X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPResponseService.ts;h=0e9c6164d299a927dd8adf3f58a15d7247e6ced6;hb=505390847039ec18d52b665e2bc5afff69414aab;hp=45a3e1f2d5822f5236e0266492935effd38f165d;hpb=298be10c5c800e43b0b9dcd6c50f6d49e2cb786b;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPResponseService.ts b/src/charging-station/ocpp/OCPPResponseService.ts index 45a3e1f2..0e9c6164 100644 --- a/src/charging-station/ocpp/OCPPResponseService.ts +++ b/src/charging-station/ocpp/OCPPResponseService.ts @@ -1,7 +1,6 @@ import _Ajv, { type ValidateFunction } from 'ajv' import _ajvFormats from 'ajv-formats' -import { OCPPServiceUtils } from './OCPPServiceUtils.js' import type { ChargingStation } from '../../charging-station/index.js' import { OCPPError } from '../../exception/index.js' import type { @@ -11,6 +10,7 @@ import type { RequestCommand } from '../../types/index.js' import { Constants, logger } from '../../utils/index.js' +import { OCPPServiceUtils } from './OCPPServiceUtils.js' type Ajv = _Ajv.default // eslint-disable-next-line @typescript-eslint/no-redeclare const Ajv = _Ajv.default @@ -23,8 +23,8 @@ export abstract class OCPPResponseService { private readonly version: OCPPVersion protected readonly ajv: Ajv protected readonly ajvIncomingRequest: Ajv - protected abstract jsonSchemasValidateFunction: Map> - public abstract jsonSchemasIncomingRequestResponseValidateFunction: Map< + protected abstract payloadValidateFunctions: Map> + public abstract incomingRequestResponsePayloadValidateFunctions: Map< IncomingRequestCommand, ValidateFunction > @@ -60,7 +60,7 @@ export abstract class OCPPResponseService { if (chargingStation.stationInfo?.ocppStrictCompliance === false) { return true } - const validate = this.jsonSchemasValidateFunction.get(commandName) + const validate = this.payloadValidateFunctions.get(commandName) if (validate?.(payload) === true) { return true }