fix(ci): silence linter
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / OCPPResponseService.ts
index 45a3e1f2d5822f5236e0266492935effd38f165d..00d539b7c214b1f4ed973299d31836dbcf4b2ae3 100644 (file)
@@ -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 { ajvErrorsToErrorType } 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<RequestCommand, ValidateFunction<JsonType>>
-  public abstract jsonSchemasIncomingRequestResponseValidateFunction: Map<
+  protected abstract payloadValidateFunctions: Map<RequestCommand, ValidateFunction<JsonType>>
+  public abstract incomingRequestResponsePayloadValidateFunctions: Map<
   IncomingRequestCommand,
   ValidateFunction<JsonType>
   >
@@ -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
     }
@@ -69,7 +69,7 @@ export abstract class OCPPResponseService {
       validate?.errors
     )
     throw new OCPPError(
-      OCPPServiceUtils.ajvErrorsToErrorType(validate?.errors),
+      ajvErrorsToErrorType(validate?.errors),
       'Response PDU is invalid',
       commandName,
       JSON.stringify(validate?.errors, undefined, 2)