import type { JSONSchemaType } from 'ajv';
+import { OCPP20ServiceUtils } from './OCPP20ServiceUtils';
import { type ChargingStation, ChargingStationConfigurationUtils } from '../../../charging-station';
import { OCPPError } from '../../../exception';
import {
type ResponseHandler,
} from '../../../types';
import { logger } from '../../../utils';
-import { OCPP20ServiceUtils, OCPPResponseService } from '../internal';
+import { OCPPResponseService } from '../OCPPResponseService';
const moduleName = 'OCPP20ResponseService';
[
OCPP20RequestCommand.BOOT_NOTIFICATION,
OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20BootNotificationResponse>(
- '../../../assets/json-schemas/ocpp/2.0/BootNotificationResponse.json',
+ 'assets/json-schemas/ocpp/2.0/BootNotificationResponse.json',
moduleName,
'constructor'
),
[
OCPP20RequestCommand.HEARTBEAT,
OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20HeartbeatResponse>(
- '../../../assets/json-schemas/ocpp/2.0/HeartbeatResponse.json',
+ 'assets/json-schemas/ocpp/2.0/HeartbeatResponse.json',
moduleName,
'constructor'
),
[
OCPP20RequestCommand.STATUS_NOTIFICATION,
OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20StatusNotificationResponse>(
- '../../../assets/json-schemas/ocpp/2.0/StatusNotificationResponse.json',
+ 'assets/json-schemas/ocpp/2.0/StatusNotificationResponse.json',
moduleName,
'constructor'
),
[
OCPP20IncomingRequestCommand.CLEAR_CACHE,
OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20ClearCacheResponse>(
- '../../../assets/json-schemas/ocpp/2.0/ClearCacheResponse.json',
+ 'assets/json-schemas/ocpp/2.0/ClearCacheResponse.json',
moduleName,
'constructor'
),
],
]);
- this.validatePayload.bind(this);
+ this.validatePayload = this.validatePayload.bind(this) as (
+ chargingStation: ChargingStation,
+ commandName: OCPP20RequestCommand,
+ payload: JsonType
+ ) => boolean;
}
public async responseHandler(