chore: cleanup formatting and linting configuration
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 25 Jul 2024 16:25:26 +0000 (18:25 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 25 Jul 2024 16:25:26 +0000 (18:25 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
21 files changed:
CHANGELOG.md
eslint.config.js
src/charging-station/ChargingStation.ts
src/charging-station/Helpers.ts
src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts
src/charging-station/ocpp/1.6/OCPP16RequestService.ts
src/charging-station/ocpp/1.6/OCPP16ResponseService.ts
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
src/charging-station/ocpp/2.0/OCPP20RequestService.ts
src/charging-station/ocpp/2.0/OCPP20ResponseService.ts
src/charging-station/ui-server/UIServerFactory.ts
src/charging-station/ui-server/UIWebSocketServer.ts
src/performance/storage/Storage.ts
tests/ocpp-server/CHANGELOG.md
ui/web/.lintstagedrc.js
ui/web/package.json
ui/web/src/composables/UIClient.ts
ui/web/src/types/ChargingStationType.ts
ui/web/src/types/UIProtocol.ts
ui/web/tsconfig.json

index 97ff4a26b9ba812b72241b9becbef10621843ca1..75c43feda284a477e72da2417e8ba71b5fed5897 100644 (file)
@@ -2,51 +2,45 @@
 
 ## [1.5.0](https://github.com/SAP/e-mobility-charging-stations-simulator/compare/simulator@v1.4.2...simulator@v1.5.0) (2024-07-25)
 
-
 ### 🚀 Features
 
-* add initial node sea support ([f6e18e3](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/f6e18e33b68a67239eba3f4d873172a491283d00))
-
+- add initial node sea support ([f6e18e3](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/f6e18e33b68a67239eba3f4d873172a491283d00))
 
 ### 🐞 Bug Fixes
 
-* ensure OCPP payload validation report error details ([45087a8](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/45087a81ca7dda0b6e72897acd1391d859026961))
-
+- ensure OCPP payload validation report error details ([45087a8](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/45087a81ca7dda0b6e72897acd1391d859026961))
 
 ### ✨ Polish
 
-* npx -&gt; pnpm dlx where appropriates ([bf25e53](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/bf25e531346a2e0579cb14d1d7c1da45dbb0aa08))
-* permit build code to run with other JS runtime ([456b7f2](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/456b7f2d7fc934d306e948e906c847417432009b))
-* refine OCPP PDU validation error messages ([5827ccc](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/5827ccc27d6c46f82df4e42a5707cfa19b550442))
-* refine station information validation error message ([915c88d](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/915c88d593292e7a47c92868e4b2d3752cce4dcd))
-* validate station information at CS init ([b55f94b](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/b55f94b6ac5dee58f38d13781b4345c4cc43f349))
-
+- npx -&gt; pnpm dlx where appropriates ([bf25e53](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/bf25e531346a2e0579cb14d1d7c1da45dbb0aa08))
+- permit build code to run with other JS runtime ([456b7f2](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/456b7f2d7fc934d306e948e906c847417432009b))
+- refine OCPP PDU validation error messages ([5827ccc](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/5827ccc27d6c46f82df4e42a5707cfa19b550442))
+- refine station information validation error message ([915c88d](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/915c88d593292e7a47c92868e4b2d3752cce4dcd))
+- validate station information at CS init ([b55f94b](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/b55f94b6ac5dee58f38d13781b4345c4cc43f349))
 
 ### 🧪 Tests
 
-* fix clone() test ([53ec800](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/53ec800a644f89a299cede7a89dd8a7b05959797))
-
+- fix clone() test ([53ec800](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/53ec800a644f89a299cede7a89dd8a7b05959797))
 
 ### 📚 Documentation
 
-* **README.md:** refine volta installation on windows ([fad9e72](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/fad9e7271b22c74fe6eb67e939090cf529a2b249))
-
+- **README.md:** refine volta installation on windows ([fad9e72](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/fad9e7271b22c74fe6eb67e939090cf529a2b249))
 
 ### 🤖 Automation
 
-* **ci:** fix autofix GH action ([c033310](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/c03331039ff7a080a3456d5a88fb7b18d505df7f))
-* **deps-dev:** bump @types/node from 20.14.11 to 20.14.12 ([#1106](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1106)) ([fb46a87](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/fb46a877f5c2b880759b9e70a08092510a7cb473))
-* **deps-dev:** bump @vitejs/plugin-vue from 5.0.5 to 5.1.0 ([#1105](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1105)) ([d36c4c8](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/d36c4c840ab5ac7a9c7fe6abbd2ae01844cb981e))
-* **deps-dev:** bump @vitest/coverage-v8 from 2.0.1 to 2.0.2 ([bbdb386](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/bbdb3861ed14ea52669231e5d372add76c50d65e))
-* **deps-dev:** bump eslint-plugin-jsdoc from 48.5.2 to 48.6.0 ([fd091c8](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/fd091c8cd219780ff650859e7b4506180f436861))
-* **deps-dev:** bump glob from 10.4.3 to 11.0.0 ([cff23bd](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/cff23bd9ab0f9ca92bc2d4721bf454b00a54daf0))
-* **deps-dev:** bump husky from 9.0.11 to 9.1.0 ([#1091](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1091)) ([e74759d](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/e74759d1c5cc66ef325b75bae39cc930ae33eb92))
-* **deps-dev:** bump rimraf from 5.0.8 to 6.0.0 ([207408c](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/207408cf661a7b8a1d35f8a9aa5ff02104fcd8ba))
-* **deps-dev:** bump typescript-eslint from 7.16.0 to 7.16.1 ([a60a99d](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/a60a99dce05328466e9a631ba83a9d527f3b4548))
-* **deps-dev:** bump vitest from 2.0.1 to 2.0.2 ([#1082](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1082)) ([f3d0d30](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/f3d0d30346974ec0e979d53d8a761ce254ba8bb0))
-* **deps:** bump github/combine-prs from 5.0.0 to 5.1.0 ([#1093](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1093)) ([55f4d38](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/55f4d386ab0e3903101c8a4b296b962cf71c9427))
-* **deps:** bump tar from 7.4.0 to 7.4.1 ([#1102](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1102)) ([0da233c](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/0da233c3b206d71bda0504908a1fd429547de923))
-* **deps:** bump vue from 3.4.33 to 3.4.34 ([#1107](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1107)) ([0bfef14](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/0bfef1423a926bd6054a25934957148d1d2fb4b0))
+- **ci:** fix autofix GH action ([c033310](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/c03331039ff7a080a3456d5a88fb7b18d505df7f))
+- **deps-dev:** bump @types/node from 20.14.11 to 20.14.12 ([#1106](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1106)) ([fb46a87](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/fb46a877f5c2b880759b9e70a08092510a7cb473))
+- **deps-dev:** bump @vitejs/plugin-vue from 5.0.5 to 5.1.0 ([#1105](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1105)) ([d36c4c8](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/d36c4c840ab5ac7a9c7fe6abbd2ae01844cb981e))
+- **deps-dev:** bump @vitest/coverage-v8 from 2.0.1 to 2.0.2 ([bbdb386](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/bbdb3861ed14ea52669231e5d372add76c50d65e))
+- **deps-dev:** bump eslint-plugin-jsdoc from 48.5.2 to 48.6.0 ([fd091c8](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/fd091c8cd219780ff650859e7b4506180f436861))
+- **deps-dev:** bump glob from 10.4.3 to 11.0.0 ([cff23bd](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/cff23bd9ab0f9ca92bc2d4721bf454b00a54daf0))
+- **deps-dev:** bump husky from 9.0.11 to 9.1.0 ([#1091](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1091)) ([e74759d](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/e74759d1c5cc66ef325b75bae39cc930ae33eb92))
+- **deps-dev:** bump rimraf from 5.0.8 to 6.0.0 ([207408c](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/207408cf661a7b8a1d35f8a9aa5ff02104fcd8ba))
+- **deps-dev:** bump typescript-eslint from 7.16.0 to 7.16.1 ([a60a99d](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/a60a99dce05328466e9a631ba83a9d527f3b4548))
+- **deps-dev:** bump vitest from 2.0.1 to 2.0.2 ([#1082](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1082)) ([f3d0d30](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/f3d0d30346974ec0e979d53d8a761ce254ba8bb0))
+- **deps:** bump github/combine-prs from 5.0.0 to 5.1.0 ([#1093](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1093)) ([55f4d38](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/55f4d386ab0e3903101c8a4b296b962cf71c9427))
+- **deps:** bump tar from 7.4.0 to 7.4.1 ([#1102](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1102)) ([0da233c](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/0da233c3b206d71bda0504908a1fd429547de923))
+- **deps:** bump vue from 3.4.33 to 3.4.34 ([#1107](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1107)) ([0bfef14](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/0bfef1423a926bd6054a25934957148d1d2fb4b0))
 
 ## [1.4.2](https://github.com/SAP/e-mobility-charging-stations-simulator/compare/simulator@v1.4.1...simulator@v1.4.2) (2024-07-06)
 
index 6ce2a0a25979c5409b29ac23240ced299be0005b..6c7ddf45a9d86bc12b88a5720682196f37e102d1 100644 (file)
@@ -55,6 +55,7 @@ export default defineFlatConfig([
     files: [
       'src/charging-station/Bootstrap.ts',
       'src/charging-station/ChargingStation.ts',
+      'src/charging-station/Helpers.ts',
       'src/charging-station/ocpp/OCPPServiceUtils.ts',
       'src/charging-station/ocpp/1.6/OCPP16ResponseService.ts',
       'src/performance/PerformanceStatistics.ts',
index 1f35092c6b99397a98324bc9539fa99ddfa9ea0a..32b046504b855a8d6e4a369ebf19bc1482708e14 100644 (file)
@@ -2096,7 +2096,7 @@ export class ChargingStation extends EventEmitter {
         logger.warn(
           `${this.logPrefix()} Error thrown at incoming OCPP command ${
             commandName ?? requestCommandName ?? Constants.UNKNOWN_OCPP_COMMAND
-          // eslint-disable-next-line @typescript-eslint/no-base-to-string
+            // eslint-disable-next-line @typescript-eslint/no-base-to-string
           } message '${data.toString()}' handling is not an OCPPError:`,
           error
         )
@@ -2104,7 +2104,7 @@ export class ChargingStation extends EventEmitter {
       logger.error(
         `${this.logPrefix()} Incoming OCPP command '${
           commandName ?? requestCommandName ?? Constants.UNKNOWN_OCPP_COMMAND
-        // eslint-disable-next-line @typescript-eslint/no-base-to-string
+          // eslint-disable-next-line @typescript-eslint/no-base-to-string
         }' message '${data.toString()}'${
           this.requests.has(messageId)
             ? ` matching cached request '${JSON.stringify(
index 225c838f3b5811fb4a4e8115d99538dac8df23b3..d234dcedc39837bbab62490c34d0a780e5ef92dc 100644 (file)
@@ -196,20 +196,32 @@ export const validateStationInfo = (chargingStation: ChargingStation): void => {
   if (isEmpty(chargingStation.stationInfo?.maximumPower)) {
     throw new BaseError(`${chargingStationId}: Missing maximumPower in stationInfo properties`)
   }
-  if (chargingStation.stationInfo?.maximumPower != null && chargingStation.stationInfo.maximumPower <= 0) {
-    throw new RangeError(`${chargingStationId}: Invalid maximumPower value in stationInfo properties`)
+  if (
+    chargingStation.stationInfo?.maximumPower != null &&
+    chargingStation.stationInfo.maximumPower <= 0
+  ) {
+    throw new RangeError(
+      `${chargingStationId}: Invalid maximumPower value in stationInfo properties`
+    )
   }
   if (isEmpty(chargingStation.stationInfo?.maximumAmperage)) {
     throw new BaseError(`${chargingStationId}: Missing maximumAmperage in stationInfo properties`)
   }
-  if (chargingStation.stationInfo?.maximumAmperage != null && chargingStation.stationInfo.maximumAmperage <= 0) {
-    throw new RangeError(`${chargingStationId}: Invalid maximumAmperage value in stationInfo properties`)
+  if (
+    chargingStation.stationInfo?.maximumAmperage != null &&
+    chargingStation.stationInfo.maximumAmperage <= 0
+  ) {
+    throw new RangeError(
+      `${chargingStationId}: Invalid maximumAmperage value in stationInfo properties`
+    )
   }
   switch (chargingStation.stationInfo?.ocppVersion) {
     case OCPPVersion.VERSION_20:
     case OCPPVersion.VERSION_201:
       if (chargingStation.evses.size === 0) {
-        throw new BaseError(`${chargingStationId}: OCPP 2.0 or superior requires at least one EVSE defined in the charging station template/configuration`)
+        throw new BaseError(
+          `${chargingStationId}: OCPP 2.0 or superior requires at least one EVSE defined in the charging station template/configuration`
+        )
       }
   }
 }
index 4071d88c0cccbbf4462151b30cbe90349fb1d02c..60e6d9efd7cfc0ea912b46d336e1cd5ac34a740b 100644 (file)
@@ -418,7 +418,10 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne
       case BroadcastChannelProcedureName.AUTHORIZE:
         if (
           (
-            commandResponse as StartTransactionResponse | StopTransactionResponse | AuthorizeResponse
+            commandResponse as
+              | StartTransactionResponse
+              | StopTransactionResponse
+              | AuthorizeResponse
           ).idTagInfo?.status === AuthorizationStatus.ACCEPTED
         ) {
           return ResponseStatus.SUCCESS
index 409fbbaba02d2ad9c1eb835c30654053556a0c3d..c446080eb9d3308bad34bfd87386b42ac4d20229 100644 (file)
@@ -208,190 +208,173 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
     >([
       [
         OCPP16IncomingRequestCommand.RESET,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<ResetRequest>(
-              'assets/json-schemas/ocpp/1.6/Reset.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<ResetRequest>(
+            'assets/json-schemas/ocpp/1.6/Reset.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.CLEAR_CACHE,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ClearCacheRequest>(
-              'assets/json-schemas/ocpp/1.6/ClearCache.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ClearCacheRequest>(
+            'assets/json-schemas/ocpp/1.6/ClearCache.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.UNLOCK_CONNECTOR,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<UnlockConnectorRequest>(
-              'assets/json-schemas/ocpp/1.6/UnlockConnector.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<UnlockConnectorRequest>(
+            'assets/json-schemas/ocpp/1.6/UnlockConnector.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.GET_CONFIGURATION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<GetConfigurationRequest>(
-              'assets/json-schemas/ocpp/1.6/GetConfiguration.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<GetConfigurationRequest>(
+            'assets/json-schemas/ocpp/1.6/GetConfiguration.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.CHANGE_CONFIGURATION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<ChangeConfigurationRequest>(
-              'assets/json-schemas/ocpp/1.6/ChangeConfiguration.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<ChangeConfigurationRequest>(
+            'assets/json-schemas/ocpp/1.6/ChangeConfiguration.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.GET_DIAGNOSTICS,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<GetDiagnosticsRequest>(
-              'assets/json-schemas/ocpp/1.6/GetDiagnostics.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<GetDiagnosticsRequest>(
+            'assets/json-schemas/ocpp/1.6/GetDiagnostics.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.GET_COMPOSITE_SCHEDULE,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16GetCompositeScheduleRequest>(
-              'assets/json-schemas/ocpp/1.6/GetCompositeSchedule.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16GetCompositeScheduleRequest>(
+            'assets/json-schemas/ocpp/1.6/GetCompositeSchedule.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.SET_CHARGING_PROFILE,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<SetChargingProfileRequest>(
-              'assets/json-schemas/ocpp/1.6/SetChargingProfile.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<SetChargingProfileRequest>(
+            'assets/json-schemas/ocpp/1.6/SetChargingProfile.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.CLEAR_CHARGING_PROFILE,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ClearChargingProfileRequest>(
-              'assets/json-schemas/ocpp/1.6/ClearChargingProfile.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ClearChargingProfileRequest>(
+            'assets/json-schemas/ocpp/1.6/ClearChargingProfile.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.CHANGE_AVAILABILITY,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ChangeAvailabilityRequest>(
-              'assets/json-schemas/ocpp/1.6/ChangeAvailability.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ChangeAvailabilityRequest>(
+            'assets/json-schemas/ocpp/1.6/ChangeAvailability.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.REMOTE_START_TRANSACTION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<RemoteStartTransactionRequest>(
-              'assets/json-schemas/ocpp/1.6/RemoteStartTransaction.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<RemoteStartTransactionRequest>(
+            'assets/json-schemas/ocpp/1.6/RemoteStartTransaction.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.REMOTE_STOP_TRANSACTION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<RemoteStopTransactionRequest>(
-              'assets/json-schemas/ocpp/1.6/RemoteStopTransaction.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<RemoteStopTransactionRequest>(
+            'assets/json-schemas/ocpp/1.6/RemoteStopTransaction.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.TRIGGER_MESSAGE,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16TriggerMessageRequest>(
-              'assets/json-schemas/ocpp/1.6/TriggerMessage.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16TriggerMessageRequest>(
+            'assets/json-schemas/ocpp/1.6/TriggerMessage.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.DATA_TRANSFER,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DataTransferRequest>(
-              'assets/json-schemas/ocpp/1.6/DataTransfer.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DataTransferRequest>(
+            'assets/json-schemas/ocpp/1.6/DataTransfer.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.UPDATE_FIRMWARE,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16UpdateFirmwareRequest>(
-              'assets/json-schemas/ocpp/1.6/UpdateFirmware.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16UpdateFirmwareRequest>(
+            'assets/json-schemas/ocpp/1.6/UpdateFirmware.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.RESERVE_NOW,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ReserveNowRequest>(
-              'assets/json-schemas/ocpp/1.6/ReserveNow.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ReserveNowRequest>(
+            'assets/json-schemas/ocpp/1.6/ReserveNow.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.CANCEL_RESERVATION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16CancelReservationRequest>(
-              'assets/json-schemas/ocpp/1.6/CancelReservation.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16CancelReservationRequest>(
+            'assets/json-schemas/ocpp/1.6/CancelReservation.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
     ])
     // Handle incoming request events
index 8f8108612111197ee2b300a5fc9b9010d596b414..c7b9258a2c9758352325be69591d9943069e3498 100644 (file)
@@ -42,113 +42,103 @@ export class OCPP16RequestService extends OCPPRequestService {
     this.payloadValidateFunctions = new Map<OCPP16RequestCommand, ValidateFunction<JsonType>>([
       [
         OCPP16RequestCommand.AUTHORIZE,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16AuthorizeRequest>(
-              'assets/json-schemas/ocpp/1.6/Authorize.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16AuthorizeRequest>(
+            'assets/json-schemas/ocpp/1.6/Authorize.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.BOOT_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16BootNotificationRequest>(
-              'assets/json-schemas/ocpp/1.6/BootNotification.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16BootNotificationRequest>(
+            'assets/json-schemas/ocpp/1.6/BootNotification.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DiagnosticsStatusNotificationRequest>(
-              'assets/json-schemas/ocpp/1.6/DiagnosticsStatusNotification.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DiagnosticsStatusNotificationRequest>(
+            'assets/json-schemas/ocpp/1.6/DiagnosticsStatusNotification.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.HEARTBEAT,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16HeartbeatRequest>(
-              'assets/json-schemas/ocpp/1.6/Heartbeat.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16HeartbeatRequest>(
+            'assets/json-schemas/ocpp/1.6/Heartbeat.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.METER_VALUES,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16MeterValuesRequest>(
-              'assets/json-schemas/ocpp/1.6/MeterValues.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16MeterValuesRequest>(
+            'assets/json-schemas/ocpp/1.6/MeterValues.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.STATUS_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StatusNotificationRequest>(
-              'assets/json-schemas/ocpp/1.6/StatusNotification.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StatusNotificationRequest>(
+            'assets/json-schemas/ocpp/1.6/StatusNotification.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.START_TRANSACTION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StartTransactionRequest>(
-              'assets/json-schemas/ocpp/1.6/StartTransaction.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StartTransactionRequest>(
+            'assets/json-schemas/ocpp/1.6/StartTransaction.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.STOP_TRANSACTION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StopTransactionRequest>(
-              'assets/json-schemas/ocpp/1.6/StopTransaction.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StopTransactionRequest>(
+            'assets/json-schemas/ocpp/1.6/StopTransaction.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.DATA_TRANSFER,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DataTransferRequest>(
-              'assets/json-schemas/ocpp/1.6/DataTransfer.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DataTransferRequest>(
+            'assets/json-schemas/ocpp/1.6/DataTransfer.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.FIRMWARE_STATUS_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16FirmwareStatusNotificationRequest>(
-              'assets/json-schemas/ocpp/1.6/FirmwareStatusNotification.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16FirmwareStatusNotificationRequest>(
+            'assets/json-schemas/ocpp/1.6/FirmwareStatusNotification.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
     ])
     this.buildRequestPayload = this.buildRequestPayload.bind(this)
index 4fa2dae07f91a5a0edc5a36abb8319366dff18fa..2237481adc8be72be158ac66729e12c92b590178 100644 (file)
@@ -101,113 +101,103 @@ export class OCPP16ResponseService extends OCPPResponseService {
     this.payloadValidateFunctions = new Map<OCPP16RequestCommand, ValidateFunction<JsonType>>([
       [
         OCPP16RequestCommand.BOOT_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16BootNotificationResponse>(
-              'assets/json-schemas/ocpp/1.6/BootNotificationResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16BootNotificationResponse>(
+            'assets/json-schemas/ocpp/1.6/BootNotificationResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.HEARTBEAT,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16HeartbeatResponse>(
-              'assets/json-schemas/ocpp/1.6/HeartbeatResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16HeartbeatResponse>(
+            'assets/json-schemas/ocpp/1.6/HeartbeatResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.AUTHORIZE,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16AuthorizeResponse>(
-              'assets/json-schemas/ocpp/1.6/AuthorizeResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16AuthorizeResponse>(
+            'assets/json-schemas/ocpp/1.6/AuthorizeResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.START_TRANSACTION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StartTransactionResponse>(
-              'assets/json-schemas/ocpp/1.6/StartTransactionResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StartTransactionResponse>(
+            'assets/json-schemas/ocpp/1.6/StartTransactionResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.STOP_TRANSACTION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StopTransactionResponse>(
-              'assets/json-schemas/ocpp/1.6/StopTransactionResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StopTransactionResponse>(
+            'assets/json-schemas/ocpp/1.6/StopTransactionResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.STATUS_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StatusNotificationResponse>(
-              'assets/json-schemas/ocpp/1.6/StatusNotificationResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16StatusNotificationResponse>(
+            'assets/json-schemas/ocpp/1.6/StatusNotificationResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.METER_VALUES,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16MeterValuesResponse>(
-              'assets/json-schemas/ocpp/1.6/MeterValuesResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16MeterValuesResponse>(
+            'assets/json-schemas/ocpp/1.6/MeterValuesResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DiagnosticsStatusNotificationResponse>(
-              'assets/json-schemas/ocpp/1.6/DiagnosticsStatusNotificationResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DiagnosticsStatusNotificationResponse>(
+            'assets/json-schemas/ocpp/1.6/DiagnosticsStatusNotificationResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.DATA_TRANSFER,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DataTransferResponse>(
-              'assets/json-schemas/ocpp/1.6/DataTransferResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DataTransferResponse>(
+            'assets/json-schemas/ocpp/1.6/DataTransferResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16RequestCommand.FIRMWARE_STATUS_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16FirmwareStatusNotificationResponse>(
-              'assets/json-schemas/ocpp/1.6/FirmwareStatusNotificationResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16FirmwareStatusNotificationResponse>(
+            'assets/json-schemas/ocpp/1.6/FirmwareStatusNotificationResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
     ])
     this.incomingRequestResponsePayloadValidateFunctions = new Map<
@@ -216,190 +206,173 @@ export class OCPP16ResponseService extends OCPPResponseService {
     >([
       [
         OCPP16IncomingRequestCommand.RESET,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<GenericResponse>(
-              'assets/json-schemas/ocpp/1.6/ResetResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<GenericResponse>(
+            'assets/json-schemas/ocpp/1.6/ResetResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.CLEAR_CACHE,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<GenericResponse>(
-              'assets/json-schemas/ocpp/1.6/ClearCacheResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<GenericResponse>(
+            'assets/json-schemas/ocpp/1.6/ClearCacheResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.CHANGE_AVAILABILITY,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ChangeAvailabilityResponse>(
-              'assets/json-schemas/ocpp/1.6/ChangeAvailabilityResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ChangeAvailabilityResponse>(
+            'assets/json-schemas/ocpp/1.6/ChangeAvailabilityResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.UNLOCK_CONNECTOR,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<UnlockConnectorResponse>(
-              'assets/json-schemas/ocpp/1.6/UnlockConnectorResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<UnlockConnectorResponse>(
+            'assets/json-schemas/ocpp/1.6/UnlockConnectorResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.GET_CONFIGURATION,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<GetConfigurationResponse>(
-              'assets/json-schemas/ocpp/1.6/GetConfigurationResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<GetConfigurationResponse>(
+            'assets/json-schemas/ocpp/1.6/GetConfigurationResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.CHANGE_CONFIGURATION,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<ChangeConfigurationResponse>(
-              'assets/json-schemas/ocpp/1.6/ChangeConfigurationResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<ChangeConfigurationResponse>(
+            'assets/json-schemas/ocpp/1.6/ChangeConfigurationResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.GET_COMPOSITE_SCHEDULE,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16GetCompositeScheduleResponse>(
-              'assets/json-schemas/ocpp/1.6/GetCompositeScheduleResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16GetCompositeScheduleResponse>(
+            'assets/json-schemas/ocpp/1.6/GetCompositeScheduleResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.SET_CHARGING_PROFILE,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<SetChargingProfileResponse>(
-              'assets/json-schemas/ocpp/1.6/SetChargingProfileResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<SetChargingProfileResponse>(
+            'assets/json-schemas/ocpp/1.6/SetChargingProfileResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.CLEAR_CHARGING_PROFILE,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ClearChargingProfileResponse>(
-              'assets/json-schemas/ocpp/1.6/ClearChargingProfileResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ClearChargingProfileResponse>(
+            'assets/json-schemas/ocpp/1.6/ClearChargingProfileResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.REMOTE_START_TRANSACTION,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<GenericResponse>(
-              'assets/json-schemas/ocpp/1.6/RemoteStartTransactionResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<GenericResponse>(
+            'assets/json-schemas/ocpp/1.6/RemoteStartTransactionResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.REMOTE_STOP_TRANSACTION,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<GenericResponse>(
-              'assets/json-schemas/ocpp/1.6/RemoteStopTransactionResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<GenericResponse>(
+            'assets/json-schemas/ocpp/1.6/RemoteStopTransactionResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.GET_DIAGNOSTICS,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<GetDiagnosticsResponse>(
-              'assets/json-schemas/ocpp/1.6/GetDiagnosticsResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<GetDiagnosticsResponse>(
+            'assets/json-schemas/ocpp/1.6/GetDiagnosticsResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.TRIGGER_MESSAGE,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16TriggerMessageResponse>(
-              'assets/json-schemas/ocpp/1.6/TriggerMessageResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16TriggerMessageResponse>(
+            'assets/json-schemas/ocpp/1.6/TriggerMessageResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.DATA_TRANSFER,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DataTransferResponse>(
-              'assets/json-schemas/ocpp/1.6/DataTransferResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16DataTransferResponse>(
+            'assets/json-schemas/ocpp/1.6/DataTransferResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.UPDATE_FIRMWARE,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16UpdateFirmwareResponse>(
-              'assets/json-schemas/ocpp/1.6/UpdateFirmwareResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16UpdateFirmwareResponse>(
+            'assets/json-schemas/ocpp/1.6/UpdateFirmwareResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.RESERVE_NOW,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ReserveNowResponse>(
-              'assets/json-schemas/ocpp/1.6/ReserveNowResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ReserveNowResponse>(
+            'assets/json-schemas/ocpp/1.6/ReserveNowResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP16IncomingRequestCommand.CANCEL_RESERVATION,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP16ServiceUtils.parseJsonSchemaFile<GenericResponse>(
-              'assets/json-schemas/ocpp/1.6/CancelReservationResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP16ServiceUtils.parseJsonSchemaFile<GenericResponse>(
+            'assets/json-schemas/ocpp/1.6/CancelReservationResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
     ])
     this.validatePayload = this.validatePayload.bind(this)
index 5d074f6adb8da0d19055be1f6f9570b3d8c60aae..20e04b4b6d9a9d5e82e69d209d3033cf4b7e3da4 100644 (file)
@@ -40,14 +40,13 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
     >([
       [
         OCPP20IncomingRequestCommand.CLEAR_CACHE,
-        this.ajv
-          .compile(
-            OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20ClearCacheRequest>(
-              'assets/json-schemas/ocpp/2.0/ClearCacheRequest.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20ClearCacheRequest>(
+            'assets/json-schemas/ocpp/2.0/ClearCacheRequest.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
     ])
     this.validatePayload = this.validatePayload.bind(this)
index c64de06f5f14eb27f48a8f79a064abb0602c15ab..e0f80b8b269af0f33c86ac645f348ca49b31412f 100644 (file)
@@ -34,36 +34,33 @@ export class OCPP20RequestService extends OCPPRequestService {
     this.payloadValidateFunctions = new Map<OCPP20RequestCommand, ValidateFunction<JsonType>>([
       [
         OCPP20RequestCommand.BOOT_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20BootNotificationRequest>(
-              'assets/json-schemas/ocpp/2.0/BootNotificationRequest.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20BootNotificationRequest>(
+            'assets/json-schemas/ocpp/2.0/BootNotificationRequest.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP20RequestCommand.HEARTBEAT,
-        this.ajv
-          .compile(
-            OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20HeartbeatRequest>(
-              'assets/json-schemas/ocpp/2.0/HeartbeatRequest.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20HeartbeatRequest>(
+            'assets/json-schemas/ocpp/2.0/HeartbeatRequest.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP20RequestCommand.STATUS_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20StatusNotificationRequest>(
-              'assets/json-schemas/ocpp/2.0/StatusNotificationRequest.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20StatusNotificationRequest>(
+            'assets/json-schemas/ocpp/2.0/StatusNotificationRequest.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
     ])
     this.buildRequestPayload = this.buildRequestPayload.bind(this)
index b846a76a663b43780a7075ed473fa3478f218977..61c09a90777e1f315a62b15d65a713a41e9044bb 100644 (file)
@@ -50,36 +50,33 @@ export class OCPP20ResponseService extends OCPPResponseService {
     this.payloadValidateFunctions = new Map<OCPP20RequestCommand, ValidateFunction<JsonType>>([
       [
         OCPP20RequestCommand.BOOT_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20BootNotificationResponse>(
-              'assets/json-schemas/ocpp/2.0/BootNotificationResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20BootNotificationResponse>(
+            'assets/json-schemas/ocpp/2.0/BootNotificationResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP20RequestCommand.HEARTBEAT,
-        this.ajv
-          .compile(
-            OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20HeartbeatResponse>(
-              'assets/json-schemas/ocpp/2.0/HeartbeatResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20HeartbeatResponse>(
+            'assets/json-schemas/ocpp/2.0/HeartbeatResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
       [
         OCPP20RequestCommand.STATUS_NOTIFICATION,
-        this.ajv
-          .compile(
-            OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20StatusNotificationResponse>(
-              'assets/json-schemas/ocpp/2.0/StatusNotificationResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajv.compile(
+          OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20StatusNotificationResponse>(
+            'assets/json-schemas/ocpp/2.0/StatusNotificationResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
     ])
     this.incomingRequestResponsePayloadValidateFunctions = new Map<
@@ -88,14 +85,13 @@ export class OCPP20ResponseService extends OCPPResponseService {
     >([
       [
         OCPP20IncomingRequestCommand.CLEAR_CACHE,
-        this.ajvIncomingRequest
-          .compile(
-            OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20ClearCacheResponse>(
-              'assets/json-schemas/ocpp/2.0/ClearCacheResponse.json',
-              moduleName,
-              'constructor'
-            )
-          ),
+        this.ajvIncomingRequest.compile(
+          OCPP20ServiceUtils.parseJsonSchemaFile<OCPP20ClearCacheResponse>(
+            'assets/json-schemas/ocpp/2.0/ClearCacheResponse.json',
+            moduleName,
+            'constructor'
+          )
+        ),
       ],
     ])
     this.validatePayload = this.validatePayload.bind(this)
index 600d9e9dbc71425f48be3c78cb1ea3bdfcf248df..f25c3aae67f9d8abf8498897a2dbb18da259632c 100644 (file)
@@ -71,7 +71,7 @@ export class UIServerFactory {
           // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
           const logMsg = `Unknown application protocol type '${uiServerConfiguration.type}' in '${
             ConfigurationSection.uiServer
-          // eslint-disable-next-line @typescript-eslint/no-base-to-string
+            // eslint-disable-next-line @typescript-eslint/no-base-to-string
           }' configuration section from values '${ApplicationProtocol.toString()}', defaulting to '${
             ApplicationProtocol.WS
           }'`
index 226fd10e70288f0c18c2ddf0e48d518c4581021f..4fa7972472cecb521f2150510325a60b50e2da85 100644 (file)
@@ -204,7 +204,7 @@ export class UIWebSocketServer extends AbstractUIServer {
         `${this.logPrefix(
           moduleName,
           'validateRawDataRequest'
-        // eslint-disable-next-line @typescript-eslint/no-base-to-string
+          // eslint-disable-next-line @typescript-eslint/no-base-to-string
         )} UI protocol request is not valid JSON: ${rawData.toString()}`
       )
       return false
index 89e4dbd232f64b41faa23cbe822aa7e808406f38..475c3f5d589dc47d5595423732a05817d6d9d227 100644 (file)
@@ -43,7 +43,7 @@ export abstract class Storage {
       // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
       `${this.logPrefix} ${this.getDBNameFromStorageType(type)} error '${
         error.message
-      // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+        // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
       }'${inTableOrCollectionStr}:`,
       error
     )
index 71e4bac5d120a2c3243f6f2cdca5cabcd884c742..7f219cf7b9ef251a309dca4ce7ff89cf1dbddcf5 100644 (file)
@@ -2,10 +2,9 @@
 
 ## [1.5.0](https://github.com/SAP/e-mobility-charging-stations-simulator/compare/ocpp-server@v1.4.2...ocpp-server@v1.5.0) (2024-07-25)
 
-
 ### 🤖 Automation
 
-* **deps-dev:** bump ruff from 0.5.2 to 0.5.3 in /tests/ocpp-server ([#1094](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1094)) ([be27d4e](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/be27d4eacbbc58857c7c8a3caac51383f920b2f9))
+- **deps-dev:** bump ruff from 0.5.2 to 0.5.3 in /tests/ocpp-server ([#1094](https://github.com/SAP/e-mobility-charging-stations-simulator/issues/1094)) ([be27d4e](https://github.com/SAP/e-mobility-charging-stations-simulator/commit/be27d4eacbbc58857c7c8a3caac51383f920b2f9))
 
 ## [1.4.2](https://github.com/SAP/e-mobility-charging-stations-simulator/compare/ocpp-server@v1.4.1...ocpp-server@v1.4.2) (2024-07-06)
 
index 96426a9f6d7b0dd5d4f319cf5b600f880659c60b..9ebb10b8fd0c6425b9baf3f00499797319e426d0 100644 (file)
@@ -1,5 +1,4 @@
 export default {
   '*.{.css,json,md,yml,yaml,html,js,jsx,cjs,mjs,ts,tsx,cts,mts}': 'prettier --cache --write',
-  // '*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}':
-  //   'eslint . --cache --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore',
+  '*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}': 'eslint --cache --fix',
 }
index 26fc434fec0698407733088125b2b422222004f9..345d9d26b72f96d1e80baa42d99fba6e72663675 100644 (file)
@@ -20,8 +20,8 @@
     "dev": "vite",
     "clean:dist": "pnpm exec rimraf dist",
     "clean:node_modules": "pnpm exec rimraf node_modules",
-    "lint": "cross-env TIMING=1 eslint .",
-    "lint:fix": "cross-env TIMING=1 eslint .",
+    "lint": "cross-env TIMING=1 eslint --cache .",
+    "lint:fix": "cross-env TIMING=1 eslint --cache --fix .",
     "format": "prettier --cache --write .",
     "test": "vitest",
     "coverage": "vitest run --coverage"
index 8e04c26e2a4163b39e8223140d30d5c1500235d1..765d91bb8c5e8771c5a14860c6ca27d9f9cd6c92 100644 (file)
@@ -29,7 +29,7 @@ export class UIClient {
     ResponseHandler
   >
 
-  private constructor(private uiServerConfiguration: UIServerConfigurationSection) {
+  private constructor (private uiServerConfiguration: UIServerConfigurationSection) {
     this.openWS()
     this.responseHandlers = new Map<
       `${string}-${string}-${string}-${string}-${string}`,
@@ -37,7 +37,7 @@ export class UIClient {
     >()
   }
 
-  public static getInstance(uiServerConfiguration?: UIServerConfigurationSection): UIClient {
+  public static getInstance (uiServerConfiguration?: UIServerConfigurationSection): UIClient {
     if (UIClient.instance === null) {
       if (uiServerConfiguration == null) {
         throw new Error('Cannot initialize UIClient if no configuration is provided')
@@ -47,7 +47,7 @@ export class UIClient {
     return UIClient.instance
   }
 
-  public setConfiguration(uiServerConfiguration: UIServerConfigurationSection): void {
+  public setConfiguration (uiServerConfiguration: UIServerConfigurationSection): void {
     if (this.ws?.readyState === WebSocket.OPEN) {
       this.ws.close()
       delete this.ws
@@ -72,27 +72,27 @@ export class UIClient {
     this.ws?.removeEventListener(event, listener, options)
   }
 
-  public async simulatorState(): Promise<ResponsePayload> {
+  public async simulatorState (): Promise<ResponsePayload> {
     return this.sendRequest(ProcedureName.SIMULATOR_STATE, {})
   }
 
-  public async startSimulator(): Promise<ResponsePayload> {
+  public async startSimulator (): Promise<ResponsePayload> {
     return this.sendRequest(ProcedureName.START_SIMULATOR, {})
   }
 
-  public async stopSimulator(): Promise<ResponsePayload> {
+  public async stopSimulator (): Promise<ResponsePayload> {
     return this.sendRequest(ProcedureName.STOP_SIMULATOR, {})
   }
 
-  public async listTemplates(): Promise<ResponsePayload> {
+  public async listTemplates (): Promise<ResponsePayload> {
     return this.sendRequest(ProcedureName.LIST_TEMPLATES, {})
   }
 
-  public async listChargingStations(): Promise<ResponsePayload> {
+  public async listChargingStations (): Promise<ResponsePayload> {
     return this.sendRequest(ProcedureName.LIST_CHARGING_STATIONS, {})
   }
 
-  public async addChargingStations(
+  public async addChargingStations (
     template: string,
     numberOfStations: number,
     options?: ChargingStationOptions
@@ -104,44 +104,44 @@ export class UIClient {
     })
   }
 
-  public async deleteChargingStation(hashId: string): Promise<ResponsePayload> {
+  public async deleteChargingStation (hashId: string): Promise<ResponsePayload> {
     return this.sendRequest(ProcedureName.DELETE_CHARGING_STATIONS, {
       hashIds: [hashId],
     })
   }
 
-  public async setSupervisionUrl(hashId: string, supervisionUrl: string): Promise<ResponsePayload> {
+  public async setSupervisionUrl (hashId: string, supervisionUrl: string): Promise<ResponsePayload> {
     return this.sendRequest(ProcedureName.SET_SUPERVISION_URL, {
       hashIds: [hashId],
       url: supervisionUrl,
     })
   }
 
-  public async startChargingStation(hashId: string): Promise<ResponsePayload> {
+  public async startChargingStation (hashId: string): Promise<ResponsePayload> {
     return this.sendRequest(ProcedureName.START_CHARGING_STATION, {
       hashIds: [hashId],
     })
   }
 
-  public async stopChargingStation(hashId: string): Promise<ResponsePayload> {
+  public async stopChargingStation (hashId: string): Promise<ResponsePayload> {
     return this.sendRequest(ProcedureName.STOP_CHARGING_STATION, {
       hashIds: [hashId],
     })
   }
 
-  public async openConnection(hashId: string): Promise<ResponsePayload> {
+  public async openConnection (hashId: string): Promise<ResponsePayload> {
     return this.sendRequest(ProcedureName.OPEN_CONNECTION, {
       hashIds: [hashId],
     })
   }
 
-  public async closeConnection(hashId: string): Promise<ResponsePayload> {
+  public async closeConnection (hashId: string): Promise<ResponsePayload> {
     return this.sendRequest(ProcedureName.CLOSE_CONNECTION, {
       hashIds: [hashId],
     })
   }
 
-  public async startTransaction(
+  public async startTransaction (
     hashId: string,
     connectorId: number,
     idTag: string | undefined
@@ -153,7 +153,7 @@ export class UIClient {
     })
   }
 
-  public async stopTransaction(
+  public async stopTransaction (
     hashId: string,
     transactionId: number | undefined
   ): Promise<ResponsePayload> {
@@ -163,7 +163,7 @@ export class UIClient {
     })
   }
 
-  public async startAutomaticTransactionGenerator(
+  public async startAutomaticTransactionGenerator (
     hashId: string,
     connectorId: number
   ): Promise<ResponsePayload> {
@@ -173,7 +173,7 @@ export class UIClient {
     })
   }
 
-  public async stopAutomaticTransactionGenerator(
+  public async stopAutomaticTransactionGenerator (
     hashId: string,
     connectorId: number
   ): Promise<ResponsePayload> {
@@ -183,7 +183,7 @@ export class UIClient {
     })
   }
 
-  private openWS(): void {
+  private openWS (): void {
     const protocols =
       this.uiServerConfiguration.authentication?.enabled === true &&
       // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
@@ -222,7 +222,7 @@ export class UIClient {
     }
   }
 
-  private async sendRequest(
+  private async sendRequest (
     procedureName: ProcedureName,
     payload: RequestPayload
   ): Promise<ResponsePayload> {
@@ -249,7 +249,7 @@ export class UIClient {
     })
   }
 
-  private responseHandler(messageEvent: MessageEvent<string>): void {
+  private responseHandler (messageEvent: MessageEvent<string>): void {
     let response: ProtocolResponse
     try {
       response = JSON.parse(messageEvent.data) as ProtocolResponse
index fd1cebe285c5bc992ec5209d793f74cf2b447493..8cb311cae1a9cf479bf39ecae65c0caf670b9983 100644 (file)
@@ -3,7 +3,7 @@ import type { JsonObject } from './JsonType'
 export enum IdTagDistribution {
   RANDOM = 'random',
   ROUND_ROBIN = 'round-robin',
-  CONNECTOR_AFFINITY = 'connector-affinity',
+  CONNECTOR_AFFINITY = 'connector-affinity'
 }
 
 export interface AutomaticTransactionGeneratorConfiguration extends JsonObject {
@@ -47,7 +47,7 @@ export enum OCPP16FirmwareStatus {
   Idle = 'Idle',
   InstallationFailed = 'InstallationFailed',
   Installing = 'Installing',
-  Installed = 'Installed',
+  Installed = 'Installed'
 }
 
 export interface FirmwareUpgrade extends JsonObject {
@@ -165,7 +165,7 @@ export enum OCPP16IncomingRequestCommand {
   REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
   REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
   GET_DIAGNOSTICS = 'GetDiagnostics',
-  TRIGGER_MESSAGE = 'TriggerMessage',
+  TRIGGER_MESSAGE = 'TriggerMessage'
 }
 
 export const IncomingRequestCommand = {
@@ -182,7 +182,7 @@ export enum OCPP16RequestCommand {
   START_TRANSACTION = 'StartTransaction',
   STOP_TRANSACTION = 'StopTransaction',
   METER_VALUES = 'MeterValues',
-  DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification',
+  DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification'
 }
 
 export const RequestCommand = {
@@ -196,7 +196,7 @@ export type BootNotificationResponse = OCPP16BootNotificationResponse
 export enum OCPP16RegistrationStatus {
   ACCEPTED = 'Accepted',
   PENDING = 'Pending',
-  REJECTED = 'Rejected',
+  REJECTED = 'Rejected'
 }
 
 export interface OCPP16BootNotificationResponse extends JsonObject {
@@ -211,7 +211,7 @@ export enum OCPP16MessageTrigger {
   FirmwareStatusNotification = 'FirmwareStatusNotification',
   Heartbeat = 'Heartbeat',
   MeterValues = 'MeterValues',
-  StatusNotification = 'StatusNotification',
+  StatusNotification = 'StatusNotification'
 }
 
 export const MessageTrigger = {
@@ -228,30 +228,30 @@ interface CommandsSupport extends JsonObject {
 export enum OCPPVersion {
   VERSION_16 = '1.6',
   VERSION_20 = '2.0',
-  VERSION_201 = '2.0.1',
+  VERSION_201 = '2.0.1'
 }
 
 export enum OCPPProtocol {
-  JSON = 'json',
+  JSON = 'json'
 }
 
 export enum CurrentType {
   AC = 'AC',
-  DC = 'DC',
+  DC = 'DC'
 }
 
 export enum Voltage {
   VOLTAGE_110 = 110,
   VOLTAGE_230 = 230,
   VOLTAGE_400 = 400,
-  VOLTAGE_800 = 800,
+  VOLTAGE_800 = 800
 }
 
 export enum AmpereUnits {
   MILLI_AMPERE = 'mA',
   CENTI_AMPERE = 'cA',
   DECI_AMPERE = 'dA',
-  AMPERE = 'A',
+  AMPERE = 'A'
 }
 
 export interface ConnectorStatus extends JsonObject {
@@ -277,7 +277,7 @@ export interface EvseStatus extends JsonObject {
 
 export enum OCPP16AvailabilityType {
   INOPERATIVE = 'Inoperative',
-  OPERATIVE = 'Operative',
+  OPERATIVE = 'Operative'
 }
 export type AvailabilityType = OCPP16AvailabilityType
 
@@ -291,7 +291,7 @@ export enum OCPP16ChargePointStatus {
   FINISHING = 'Finishing',
   RESERVED = 'Reserved',
   UNAVAILABLE = 'Unavailable',
-  FAULTED = 'Faulted',
+  FAULTED = 'Faulted'
 }
 export type ChargePointStatus = OCPP16ChargePointStatus
 
index 5dbbed6c9393b78e55f87bf31a2a499abc0950f3..8522aa11dcd8c4a10ac40a7e95ec94523bad1992 100644 (file)
@@ -1,30 +1,30 @@
 import type { JsonObject } from './JsonType'
 
 export enum Protocol {
-  UI = 'ui',
+  UI = 'ui'
 }
 
 export enum ApplicationProtocol {
   WS = 'ws',
-  WSS = 'wss',
+  WSS = 'wss'
 }
 
 export enum ProtocolVersion {
-  '0.0.1' = '0.0.1',
+  '0.0.1' = '0.0.1'
 }
 
 export enum AuthenticationType {
-  PROTOCOL_BASIC_AUTH = 'protocol-basic-auth',
+  PROTOCOL_BASIC_AUTH = 'protocol-basic-auth'
 }
 
 export type ProtocolRequest = [
   `${string}-${string}-${string}-${string}-${string}`,
   ProcedureName,
-  RequestPayload,
+  RequestPayload
 ]
 export type ProtocolResponse = [
   `${string}-${string}-${string}-${string}-${string}`,
-  ResponsePayload,
+  ResponsePayload
 ]
 
 export type ProtocolRequestHandler = (
@@ -47,7 +47,7 @@ export enum ProcedureName {
   START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator',
   STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator',
   START_TRANSACTION = 'startTransaction',
-  STOP_TRANSACTION = 'stopTransaction',
+  STOP_TRANSACTION = 'stopTransaction'
 }
 
 export interface RequestPayload extends JsonObject {
@@ -57,7 +57,7 @@ export interface RequestPayload extends JsonObject {
 
 export enum ResponseStatus {
   SUCCESS = 'success',
-  FAILURE = 'failure',
+  FAILURE = 'failure'
 }
 
 export interface ResponsePayload extends JsonObject {
index f4303ae87bcc4c0ba6b10f4f828e4cc1cc6d58de..c49133560fbfec1d95253e5e49aba82ab573be15 100644 (file)
@@ -19,6 +19,5 @@
     "src/**/*.vue",
     "tests/**/*.ts",
     "tests/**/*.tsx"
-  ],
-  "exclude": ["node_modules"]
+  ]
 }