OCPPVersion,
type RequestParams,
} from '../../../types';
-import { Constants } from '../../../utils/Constants';
-import { Utils } from '../../../utils/Utils';
+import { Constants, Utils } from '../../../utils';
import {
OCPP16ServiceUtils,
OCPPConstants,
protected jsonSchemas: Map<OCPP16RequestCommand, JSONSchemaType<JsonObject>>;
public constructor(ocppResponseService: OCPPResponseService) {
- if (new.target?.name === moduleName) {
- throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
- }
+ // if (new.target?.name === moduleName) {
+ // throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
+ // }
super(OCPPVersion.VERSION_16, ocppResponseService);
this.jsonSchemas = new Map<OCPP16RequestCommand, JSONSchemaType<JsonObject>>([
[
commandParams?: JsonType,
params?: RequestParams
): Promise<ResponseType> {
+ // FIXME?: add sanity checks on charging station availability, connector availability, connector status, etc.
if (OCPP16ServiceUtils.isRequestCommandSupported(chargingStation, commandName) === true) {
return (await this.sendMessage(
chargingStation,
this.buildRequestPayload<RequestType>(chargingStation, commandName, commandParams),
commandName,
params
- )) as unknown as ResponseType;
+ )) as ResponseType;
}
// OCPPError usage here is debatable: it's an error in the OCPP stack but not targeted to sendError().
throw new OCPPError(