import type { JSONSchemaType } from 'ajv';
-import { OCPP20ServiceUtils } from './OCPP20ServiceUtils';
+import type { ChargingStation } from '../../../charging-station';
import { OCPPError } from '../../../exception';
import {
ErrorType,
OCPP20IncomingRequestCommand,
OCPPVersion,
} from '../../../types';
-import { logger } from '../../../utils/Logger';
-import type { ChargingStation } from '../../ChargingStation';
-import { OCPPIncomingRequestService } from '../OCPPIncomingRequestService';
+import { logger } from '../../../utils';
+import { OCPP20ServiceUtils, OCPPIncomingRequestService } from '../internal';
const moduleName = 'OCPP20IncomingRequestService';
private incomingRequestHandlers: Map<OCPP20IncomingRequestCommand, IncomingRequestHandler>;
public constructor() {
- 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_20);
this.incomingRequestHandlers = new Map<OCPP20IncomingRequestCommand, IncomingRequestHandler>([
[OCPP20IncomingRequestCommand.CLEAR_CACHE, this.handleRequestClearCache.bind(this)],
),
],
]);
- this.validatePayload.bind(this);
+ this.validatePayload = this.validatePayload.bind(this) as (
+ chargingStation: ChargingStation,
+ commandName: OCPP20IncomingRequestCommand,
+ commandPayload: JsonType
+ ) => boolean;
}
public async incomingRequestHandler(