build(deps): apply updates
[e-mobility-charging-stations-simulator.git] / src / utils / MessageChannelUtils.ts
index 2bb43a961ccfa11686896321a52c02b5b0f74eb9..f3008b50d117b675cfeec772a8b90518669a998d 100644 (file)
@@ -13,37 +13,37 @@ import {
 } from '../types';
 
 export const buildStartedMessage = (
-  chargingStation: ChargingStation
+  chargingStation: ChargingStation,
 ): ChargingStationWorkerMessage<ChargingStationData> => {
   return {
-    id: ChargingStationWorkerMessageEvents.started,
+    event: ChargingStationWorkerMessageEvents.started,
     data: buildChargingStationDataPayload(chargingStation),
   };
 };
 
 export const buildStoppedMessage = (
-  chargingStation: ChargingStation
+  chargingStation: ChargingStation,
 ): ChargingStationWorkerMessage<ChargingStationData> => {
   return {
-    id: ChargingStationWorkerMessageEvents.stopped,
+    event: ChargingStationWorkerMessageEvents.stopped,
     data: buildChargingStationDataPayload(chargingStation),
   };
 };
 
 export const buildUpdatedMessage = (
-  chargingStation: ChargingStation
+  chargingStation: ChargingStation,
 ): ChargingStationWorkerMessage<ChargingStationData> => {
   return {
-    id: ChargingStationWorkerMessageEvents.updated,
+    event: ChargingStationWorkerMessageEvents.updated,
     data: buildChargingStationDataPayload(chargingStation),
   };
 };
 
 export const buildPerformanceStatisticsMessage = (
-  statistics: Statistics
+  statistics: Statistics,
 ): ChargingStationWorkerMessage<Statistics> => {
   return {
-    id: ChargingStationWorkerMessageEvents.performanceStatistics,
+    event: ChargingStationWorkerMessageEvents.performanceStatistics,
     data: statistics,
   };
 };
@@ -54,7 +54,7 @@ const buildChargingStationDataPayload = (chargingStation: ChargingStation): Char
     stationInfo: chargingStation.stationInfo,
     connectors: buildConnectorsStatus(chargingStation),
     evses: buildEvsesStatus(chargingStation, OutputFormat.worker),
-    ocppConfiguration: chargingStation.ocppConfiguration,
+    ocppConfiguration: chargingStation.ocppConfiguration!,
     wsState: chargingStation?.wsConnection?.readyState,
     bootNotificationResponse: chargingStation.bootNotificationResponse,
     ...(chargingStation.automaticTransactionGenerator && {