+ protected constructor (version: OCPPVersion) {
+ this.version = version
+ this.ajv = new Ajv({
+ keywords: ['javaType'],
+ multipleOfPrecision: 2
+ })
+ ajvFormats(this.ajv)
+ this.jsonValidateFunctions = new Map<IncomingRequestCommand, ValidateFunction<JsonType>>()
+ this.incomingRequestHandler = this.incomingRequestHandler.bind(this) as <
+ ReqType extends JsonType,
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ ResType extends JsonType
+ >(
+ chargingStation: ChargingStation,
+ messageId: string,
+ commandName: IncomingRequestCommand,
+ commandPayload: ReqType
+ ) => Promise<void>
+ this.validateIncomingRequestPayload = this.validateIncomingRequestPayload.bind(this) as <
+ T extends JsonType
+ >(
+ chargingStation: ChargingStation,
+ commandName: IncomingRequestCommand,
+ schema: JSONSchemaType<T>,
+ payload: T
+ ) => boolean