feat: add message buffer flush interval
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 2.0 / OCPP20ResponseService.ts
index 81dca3a4a29a46de3c54d85ad3b3b2324ccccaf6..111b114a34048113c4fdf2a60a77133570fe4405 100644 (file)
@@ -7,7 +7,6 @@ import { type ChargingStation, addConfigurationKey } from '../../../charging-sta
 import { OCPPError } from '../../../exception';
 import {
   ErrorType,
-  type JsonObject,
   type JsonType,
   type OCPP20BootNotificationResponse,
   type OCPP20ClearCacheResponse,
@@ -28,11 +27,11 @@ const moduleName = 'OCPP20ResponseService';
 export class OCPP20ResponseService extends OCPPResponseService {
   public jsonIncomingRequestResponseSchemas: Map<
     OCPP20IncomingRequestCommand,
-    JSONSchemaType<JsonObject>
+    JSONSchemaType<JsonType>
   >;
 
   private responseHandlers: Map<OCPP20RequestCommand, ResponseHandler>;
-  private jsonSchemas: Map<OCPP20RequestCommand, JSONSchemaType<JsonObject>>;
+  private jsonSchemas: Map<OCPP20RequestCommand, JSONSchemaType<JsonType>>;
 
   public constructor() {
     // if (new.target?.name === moduleName) {
@@ -50,7 +49,7 @@ export class OCPP20ResponseService extends OCPPResponseService {
         this.emptyResponseHandler.bind(this) as ResponseHandler,
       ],
     ]);
-    this.jsonSchemas = new Map<OCPP20RequestCommand, JSONSchemaType<JsonObject>>([
+    this.jsonSchemas = new Map<OCPP20RequestCommand, JSONSchemaType<JsonType>>([
       [
         OCPP20RequestCommand.BOOT_NOTIFICATION,
         OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20BootNotificationResponse>(
@@ -123,7 +122,7 @@ export class OCPP20ResponseService extends OCPPResponseService {
           ErrorType.NOT_IMPLEMENTED,
           `${commandName} is not implemented to handle response PDU ${JSON.stringify(
             payload,
-            null,
+            undefined,
             2,
           )}`,
           commandName,
@@ -135,7 +134,7 @@ export class OCPP20ResponseService extends OCPPResponseService {
         ErrorType.SECURITY_ERROR,
         `${commandName} cannot be issued to handle response PDU ${JSON.stringify(
           payload,
-          null,
+          undefined,
           2,
         )} while the charging station is not registered on the central server.`,
         commandName,