From: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2026 00:44:22 +0000 (+0000) Subject: chore(deps): update dependency prettier to ^3.8.5 (#1932) X-Git-Tag: cli@v4.11.0~79 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=98d541cef85283eb090564922868a312ec0baf3b;p=e-mobility-charging-stations-simulator.git chore(deps): update dependency prettier to ^3.8.5 (#1932) * chore(deps): update dependency prettier to ^3.8.5 * [autofix.ci] apply automated fixes --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- diff --git a/README.md b/README.md index 57d694f0..f103406e 100644 --- a/README.md +++ b/README.md @@ -973,13 +973,13 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Response: `PDU`: { - `status`: 'success' | 'failure', - `state`: { - `version`: string, - `configuration`: ConfigurationData, - `started`: boolean, - `templateStatistics`: Record - } + `status`: 'success' | 'failure', + `state`: { + `version`: string, + `configuration`: ConfigurationData, + `started`: boolean, + `templateStatistics`: Record + } } ###### Start Simulator @@ -990,7 +990,7 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Response: `PDU`: { - `status`: 'success' | 'failure' + `status`: 'success' | 'failure' } ###### Stop Simulator @@ -1001,7 +1001,7 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Response: `PDU`: { - `status`: 'success' | 'failure' + `status`: 'success' | 'failure' } ###### List Charging Station Templates @@ -1012,8 +1012,8 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Response: `PDU`: { - `status`: 'success' | 'failure', - `templates`: string[] + `status`: 'success' | 'failure', + `templates`: string[] } ###### Add Charging Stations @@ -1021,29 +1021,29 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'addChargingStations' `PDU`: { - `template`: string, - `numberOfStations`: number, - `options?`: { - `autoRegister?`: boolean, - `autoStart?`: boolean, - `baseName?`: string, - `enableStatistics?`: boolean, - `fixedName?`: boolean, - `nameSuffix?`: string, - `ocppStrictCompliance?`: boolean, - `persistentConfiguration?`: boolean, - `stopTransactionsOnStopped?`: boolean, - `supervisionPassword?`: string, - `supervisionUrls?`: string | string[], - `supervisionUser?`: string - } + `template`: string, + `numberOfStations`: number, + `options?`: { + `autoRegister?`: boolean, + `autoStart?`: boolean, + `baseName?`: string, + `enableStatistics?`: boolean, + `fixedName?`: boolean, + `nameSuffix?`: string, + `ocppStrictCompliance?`: boolean, + `persistentConfiguration?`: boolean, + `stopTransactionsOnStopped?`: boolean, + `supervisionPassword?`: string, + `supervisionUrls?`: string | string[], + `supervisionUser?`: string + } } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array (optional), - `hashIdsFailed`: charging station unique identifier strings array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array (optional), + `hashIdsFailed`: charging station unique identifier strings array (optional) } ###### Delete Charging Stations @@ -1051,16 +1051,16 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'deleteChargingStations' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), - `deleteConfiguration?`: boolean + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `deleteConfiguration?`: boolean } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Set Charging Station Supervision URL @@ -1068,19 +1068,19 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'setSupervisionUrl' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), - `url`: string, - `supervisionUser?`: string, - `supervisionPassword?`: string + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `url`: string, + `supervisionUser?`: string, + `supervisionPassword?`: string } `url` is required. `supervisionUser` and `supervisionPassword` are each optional and independent: a string (including `""`, which clears the field) updates the value; omitting the field preserves the existing value. Changes take effect on the next WebSocket (re)connect. - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Performance Statistics @@ -1091,8 +1091,8 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Response: `PDU`: { - `status`: 'success' | 'failure', - `performanceStatistics`: Statistics[] + `status`: 'success' | 'failure', + `performanceStatistics`: Statistics[] } ###### List Charging Stations @@ -1103,8 +1103,8 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Response: `PDU`: { - `status`: 'success' | 'failure', - `chargingStations`: ChargingStationData[] + `status`: 'success' | 'failure', + `chargingStations`: ChargingStationData[] } ###### Start Charging Station @@ -1112,15 +1112,15 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'startChargingStation' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Stop Charging Station @@ -1128,15 +1128,15 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'stopChargingStation' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Open Connection @@ -1144,15 +1144,15 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'openConnection' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Close Connection @@ -1160,15 +1160,15 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'closeConnection' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Start Automatic Transaction Generator @@ -1176,16 +1176,16 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'startAutomaticTransactionGenerator' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), - `connectorIds`: connector id integer array (optional, default: all connectors) + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `connectorIds`: connector id integer array (optional, default: all connectors) } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Stop Automatic Transaction Generator @@ -1193,16 +1193,16 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'stopAutomaticTransactionGenerator' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), - `connectorIds`: connector id integer array (optional, default: all connectors) + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `connectorIds`: connector id integer array (optional, default: all connectors) } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Lock Connector @@ -1210,16 +1210,16 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'lockConnector' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), - `connectorId`: connector id integer + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `connectorId`: connector id integer } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Unlock Connector @@ -1227,16 +1227,16 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'unlockConnector' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), - `connectorId`: connector id integer + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `connectorId`: connector id integer } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### OCPP commands trigger @@ -1244,16 +1244,16 @@ Set the WebSocket header _Sec-WebSocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'commandName' (the OCPP command name in camel case) `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), - ...`commandPayload` + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + ...`commandPayload` } (the OCPP command payload with some optional fields added to target the simulated charging stations) - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } Available OCPP command procedure names: @@ -1266,84 +1266,84 @@ Examples: - **Authorize** - Request: - `ProcedureName`: 'authorize' - `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), - `idTag`: RFID tag string - } + `ProcedureName`: 'authorize' + `PDU`: { + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `idTag`: RFID tag string + } - Response: - `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) - } + `PDU`: { + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) + } - **Start Transaction** - Request: `ProcedureName`: 'startTransaction' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), - `connectorId`: connector id integer, - `idTag`: RFID tag string + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `connectorId`: connector id integer, + `idTag`: RFID tag string } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } - **Stop Transaction** - Request: `ProcedureName`: 'stopTransaction' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), - `transactionId`: transaction id integer + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `transactionId`: transaction id integer } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } - **Status Notification** - Request: `ProcedureName`: 'statusNotification' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), - `connectorId`: connector id integer, - `errorCode`: connector error code, - `status`: connector status + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `connectorId`: connector id integer, + `errorCode`: connector error code, + `status`: connector status } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } - **Heartbeat** - Request: `ProcedureName`: 'heartbeat' `PDU`: { - `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) } - Response: `PDU`: { - `status`: 'success' | 'failure', - `hashIdsSucceeded`: charging station unique identifier strings array, - `hashIdsFailed`: charging station unique identifier strings array (optional), - `responsesFailed`: failed responses payload array (optional) + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ### HTTP Protocol (deprecated) diff --git a/package.json b/package.json index 19e4c6df..45a9efab 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "husky": "^9.1.7", "lint-staged": "^17.0.8", "neostandard": "^0.13.0", - "prettier": "^3.8.4", + "prettier": "^3.8.5", "rimraf": "^6.1.3", "semver": "^7.8.5", "skott": "^0.35.11", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1a2db565..febd5ba3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -133,8 +133,8 @@ importers: specifier: ^0.13.0 version: 0.13.0(eslint@9.39.4(jiti@2.6.1))(typescript@6.0.3) prettier: - specifier: ^3.8.4 - version: 3.8.4 + specifier: ^3.8.5 + version: 3.9.1 rimraf: specifier: ^6.1.3 version: 6.1.3 @@ -3951,8 +3951,8 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@3.8.4: - resolution: {integrity: sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==} + prettier@3.9.1: + resolution: {integrity: sha512-ppiDo2CSwexck1eyZUwJHg/N3nf1+6IRCv7W/VJ5vaLnVCmB7+3CdRfMwoCHBBX6xTrREDTksZ4OZl5SSf4zXA==} engines: {node: '>=14'} hasBin: true @@ -8894,7 +8894,7 @@ snapshots: prelude-ls@1.2.1: {} - prettier@3.8.4: {} + prettier@3.9.1: {} prom-client@15.1.3: dependencies: diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index e4e4af98..4752ee4f 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -426,12 +426,10 @@ export class ChargingStation extends EventEmitter { * @returns The ATG configuration or undefined if not available */ public getAutomaticTransactionGeneratorConfiguration (): - | AutomaticTransactionGeneratorConfiguration - | undefined { + AutomaticTransactionGeneratorConfiguration | undefined { if (this.automaticTransactionGeneratorConfiguration == null) { let automaticTransactionGeneratorConfiguration: - | AutomaticTransactionGeneratorConfiguration - | undefined + AutomaticTransactionGeneratorConfiguration | undefined const stationTemplate = this.getTemplateFromFile() const stationConfiguration = this.getConfigurationFromFile() if ( diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index 37d0406a..39090abe 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -11,8 +11,7 @@ import { type WorkerDataError, type WorkerMessage, WorkerMessageEvents } from '. import { ChargingStation } from './ChargingStation.js' export let chargingStationWorker: - | object - | ThreadWorker + object | ThreadWorker if (Configuration.workerPoolInUse()) { chargingStationWorker = new ThreadWorker< ChargingStationWorkerData, diff --git a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts index 029ed118..42df35cd 100644 --- a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts @@ -349,9 +349,7 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne if ( ( commandResponse as - | OCPP16AuthorizeResponse - | StartTransactionResponse - | StopTransactionResponse + OCPP16AuthorizeResponse | StartTransactionResponse | StopTransactionResponse ).idTagInfo?.status === AuthorizationStatus.ACCEPTED ) { return ResponseStatus.SUCCESS diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index d903904c..3ecadfdc 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -387,10 +387,12 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { switch (requestedMessage) { case OCPP16MessageTrigger.BootNotification: chargingStation.ocppRequestService - .requestHandler< - OCPP16BootNotificationRequest, - OCPP16BootNotificationResponse - >(chargingStation, OCPP16RequestCommand.BOOT_NOTIFICATION, chargingStation.bootNotificationRequest as OCPP16BootNotificationRequest, { skipBufferingOnError: true, triggerMessage: true }) + .requestHandler( + chargingStation, + OCPP16RequestCommand.BOOT_NOTIFICATION, + chargingStation.bootNotificationRequest as OCPP16BootNotificationRequest, + { skipBufferingOnError: true, triggerMessage: true } + ) .catch(errorHandler) break case OCPP16MessageTrigger.DiagnosticsStatusNotification: diff --git a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts index e81bb3df..92c61ff5 100644 --- a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts +++ b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts @@ -536,10 +536,12 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { switch (requestedMessage) { case MessageTriggerEnumType.BootNotification: chargingStation.ocppRequestService - .requestHandler< - OCPP20BootNotificationRequest, - OCPP20BootNotificationResponse - >(chargingStation, OCPP20RequestCommand.BOOT_NOTIFICATION, chargingStation.bootNotificationRequest as OCPP20BootNotificationRequest, { skipBufferingOnError: true, triggerMessage: true }) + .requestHandler( + chargingStation, + OCPP20RequestCommand.BOOT_NOTIFICATION, + chargingStation.bootNotificationRequest as OCPP20BootNotificationRequest, + { skipBufferingOnError: true, triggerMessage: true } + ) .catch(errorHandler) break case MessageTriggerEnumType.FirmwareStatusNotification: { @@ -551,16 +553,23 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { .requestHandler< OCPP20FirmwareStatusNotificationRequest, OCPP20FirmwareStatusNotificationResponse - >(chargingStation, OCPP20RequestCommand.FIRMWARE_STATUS_NOTIFICATION, { requestId: stationState.activeFirmwareUpdateRequestId, status: firmwareStatus }, { skipBufferingOnError: true, triggerMessage: true }) + >( + chargingStation, + OCPP20RequestCommand.FIRMWARE_STATUS_NOTIFICATION, + { requestId: stationState.activeFirmwareUpdateRequestId, status: firmwareStatus }, + { skipBufferingOnError: true, triggerMessage: true } + ) .catch(errorHandler) break } case MessageTriggerEnumType.Heartbeat: chargingStation.ocppRequestService - .requestHandler< - OCPP20HeartbeatRequest, - OCPP20HeartbeatResponse - >(chargingStation, OCPP20RequestCommand.HEARTBEAT, OCPP20Constants.OCPP_RESPONSE_EMPTY as OCPP20HeartbeatRequest, { skipBufferingOnError: true, triggerMessage: true }) + .requestHandler( + chargingStation, + OCPP20RequestCommand.HEARTBEAT, + OCPP20Constants.OCPP_RESPONSE_EMPTY as OCPP20HeartbeatRequest, + { skipBufferingOnError: true, triggerMessage: true } + ) .catch(errorHandler) break case MessageTriggerEnumType.LogStatusNotification: @@ -568,7 +577,12 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { .requestHandler< OCPP20LogStatusNotificationRequest, OCPP20LogStatusNotificationResponse - >(chargingStation, OCPP20RequestCommand.LOG_STATUS_NOTIFICATION, { status: UploadLogStatusEnumType.Idle }, { skipBufferingOnError: true, triggerMessage: true }) + >( + chargingStation, + OCPP20RequestCommand.LOG_STATUS_NOTIFICATION, + { status: UploadLogStatusEnumType.Idle }, + { skipBufferingOnError: true, triggerMessage: true } + ) .catch(errorHandler) break case MessageTriggerEnumType.MeterValues: { @@ -3894,10 +3908,16 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { )) { const resolvedStatus = connectorStatus.status ?? ConnectorStatusEnum.Available chargingStation.ocppRequestService - .requestHandler< - OCPP20StatusNotificationRequest, - OCPP20StatusNotificationResponse - >(chargingStation, OCPP20RequestCommand.STATUS_NOTIFICATION, { connectorId, connectorStatus: resolvedStatus, evseId } as unknown as OCPP20StatusNotificationRequest, { skipBufferingOnError: true, triggerMessage: true }) + .requestHandler( + chargingStation, + OCPP20RequestCommand.STATUS_NOTIFICATION, + { + connectorId, + connectorStatus: resolvedStatus, + evseId, + } as unknown as OCPP20StatusNotificationRequest, + { skipBufferingOnError: true, triggerMessage: true } + ) .catch(errorHandler) } } @@ -3912,10 +3932,16 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { const connectorStatus = evseStatus?.connectors.get(evse.connectorId) const resolvedStatus = connectorStatus?.status ?? ConnectorStatusEnum.Available chargingStation.ocppRequestService - .requestHandler< - OCPP20StatusNotificationRequest, - OCPP20StatusNotificationResponse - >(chargingStation, OCPP20RequestCommand.STATUS_NOTIFICATION, { connectorId: evse.connectorId, connectorStatus: resolvedStatus, evseId: evse.id } as unknown as OCPP20StatusNotificationRequest, { skipBufferingOnError: true, triggerMessage: true }) + .requestHandler( + chargingStation, + OCPP20RequestCommand.STATUS_NOTIFICATION, + { + connectorId: evse.connectorId, + connectorStatus: resolvedStatus, + evseId: evse.id, + } as unknown as OCPP20StatusNotificationRequest, + { skipBufferingOnError: true, triggerMessage: true } + ) .catch(errorHandler) } else if (chargingStation.hasEvses) { this.triggerAllEvseStatusNotifications(chargingStation, errorHandler) diff --git a/src/charging-station/ocpp/2.0/OCPP20RequestService.ts b/src/charging-station/ocpp/2.0/OCPP20RequestService.ts index 5021ae37..33e06555 100644 --- a/src/charging-station/ocpp/2.0/OCPP20RequestService.ts +++ b/src/charging-station/ocpp/2.0/OCPP20RequestService.ts @@ -190,8 +190,7 @@ export class OCPP20RequestService extends OCPPRequestService { } const certificateType = (commandParams as JsonObject | undefined)?.certificateType as - | CertificateSigningUseEnumType - | undefined + CertificateSigningUseEnumType | undefined const requestPayload: OCPP20SignCertificateRequest = { csr, diff --git a/src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts b/src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts index 301ecbdf..92743273 100644 --- a/src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts +++ b/src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts @@ -1155,8 +1155,7 @@ export class OCPP20ServiceUtils { const endedMeterValues = (connectorStatus?.transactionEndedMeterValues ?? []) as OCPP20MeterValue[] const beginMeterValue = connectorStatus?.transactionBeginMeterValue as - | OCPP20MeterValue - | undefined + OCPP20MeterValue | undefined try { const measurandsKey = buildConfigKey( diff --git a/src/charging-station/ocpp/OCPPConstants.ts b/src/charging-station/ocpp/OCPPConstants.ts index a79edf6c..c28c4706 100644 --- a/src/charging-station/ocpp/OCPPConstants.ts +++ b/src/charging-station/ocpp/OCPPConstants.ts @@ -162,8 +162,7 @@ export class OCPPConstants { static readonly OCPP_WEBSOCKET_TIMEOUT_MS = 60000 static readonly UNKNOWN_OCPP_COMMAND = 'unknown OCPP command' as - | IncomingRequestCommand - | RequestCommand + IncomingRequestCommand | RequestCommand protected constructor () { // This is intentional diff --git a/src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts b/src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts index b7db7d2c..9c2739b7 100644 --- a/src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts +++ b/src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts @@ -329,8 +329,7 @@ export class OCPPAuthServiceImpl implements OCPPAuthService { // Get rate limiting stats from cache via remote strategy let rateLimitStatistics: - | undefined - | { blockedRequests: number; rateLimitedIdentifiers: number; totalChecks: number } + undefined | { blockedRequests: number; rateLimitedIdentifiers: number; totalChecks: number } const remoteStrategy = this.strategies.get('remote') if (remoteStrategy?.getStats) { const strategyStatistics = remoteStrategy.getStats() diff --git a/src/charging-station/ui-server/UIMCPServer.ts b/src/charging-station/ui-server/UIMCPServer.ts index 9895d108..2ac68868 100644 --- a/src/charging-station/ui-server/UIMCPServer.ts +++ b/src/charging-station/ui-server/UIMCPServer.ts @@ -296,8 +296,7 @@ export class UIMCPServer extends AbstractUIServer { // The SDK does not provide a public API for wrapping existing handlers. // setRequestHandler() replaces handlers entirely, losing Zod→JSON Schema conversion. const handlers = Reflect.get(mcpServer.server, '_requestHandlers') as - | Map Promise> - | undefined + Map Promise> | undefined if (handlers == null || !(handlers instanceof Map)) { logger.warn( `${this.logPrefix(moduleName, 'injectOcppJsonSchemas')} MCP SDK internal API changed — OCPP schema injection disabled` diff --git a/src/types/ChargingStationWorker.ts b/src/types/ChargingStationWorker.ts index b1ee7b04..7d359622 100644 --- a/src/types/ChargingStationWorker.ts +++ b/src/types/ChargingStationWorker.ts @@ -82,5 +82,4 @@ export const ChargingStationWorkerMessageEvents = { } as const // eslint-disable-next-line @typescript-eslint/no-redeclare export type ChargingStationWorkerMessageEvents = - | ChargingStationEvents - | ChargingStationMessageEvents + ChargingStationEvents | ChargingStationMessageEvents diff --git a/src/types/ocpp/ChargingProfile.ts b/src/types/ocpp/ChargingProfile.ts index aaa9f1f5..11336f16 100644 --- a/src/types/ocpp/ChargingProfile.ts +++ b/src/types/ocpp/ChargingProfile.ts @@ -29,8 +29,7 @@ export const ChargingProfilePurposeType = { } as const // eslint-disable-next-line @typescript-eslint/no-redeclare export type ChargingProfilePurposeType = - | OCPP16ChargingProfilePurposeType - | OCPP20ChargingProfilePurposeEnumType + OCPP16ChargingProfilePurposeType | OCPP20ChargingProfilePurposeEnumType export const ChargingProfileKindType = { ...OCPP16ChargingProfileKindType, @@ -38,8 +37,7 @@ export const ChargingProfileKindType = { } as const // eslint-disable-next-line @typescript-eslint/no-redeclare export type ChargingProfileKindType = - | OCPP16ChargingProfileKindType - | OCPP20ChargingProfileKindEnumType + OCPP16ChargingProfileKindType | OCPP20ChargingProfileKindEnumType export const RecurrencyKindType = { ...OCPP16RecurrencyKindType, diff --git a/src/types/ocpp/Requests.ts b/src/types/ocpp/Requests.ts index 3cc1df8b..28ddadbf 100644 --- a/src/types/ocpp/Requests.ts +++ b/src/types/ocpp/Requests.ts @@ -52,8 +52,7 @@ export type DiagnosticsStatusNotificationRequest = OCPP16DiagnosticsStatusNotifi export type ErrorCallback = (ocppError: OCPPError, requestStatistic?: boolean) => void export type FirmwareStatusNotificationRequest = - | OCPP16FirmwareStatusNotificationRequest - | OCPP20FirmwareStatusNotificationRequest + OCPP16FirmwareStatusNotificationRequest | OCPP20FirmwareStatusNotificationRequest // eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents export type HeartbeatRequest = OCPP16HeartbeatRequest | OCPP20HeartbeatRequest @@ -100,8 +99,7 @@ export type MeterValuesRequest = OCPP16MeterValuesRequest | OCPP20MeterValuesReq export type ResponseCallback = (payload: JsonType, requestPayload: JsonType) => void export type StatusNotificationRequest = - | OCPP16StatusNotificationRequest - | OCPP20StatusNotificationRequest + OCPP16StatusNotificationRequest | OCPP20StatusNotificationRequest export const AvailabilityType = { ...OCPP16AvailabilityType, diff --git a/src/types/ocpp/Responses.ts b/src/types/ocpp/Responses.ts index 58ccd5db..cd66b49a 100644 --- a/src/types/ocpp/Responses.ts +++ b/src/types/ocpp/Responses.ts @@ -38,8 +38,7 @@ import { import { type GenericResponse, GenericStatus } from './Common.js' export type BootNotificationResponse = - | OCPP16BootNotificationResponse - | OCPP20BootNotificationResponse + OCPP16BootNotificationResponse | OCPP20BootNotificationResponse export type CancelReservationResponse = GenericResponse diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index cab09f6c..1daa6ac7 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -47,10 +47,7 @@ import { } from './Utils.js' type ConfigurationSectionType = - | LogConfiguration - | StorageConfiguration - | UIServerConfiguration - | WorkerConfiguration + LogConfiguration | StorageConfiguration | UIServerConfiguration | WorkerConfiguration const defaultUIServerConfiguration: UIServerConfiguration = { accessPolicy: { diff --git a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts index dd712ad9..cf5aeb05 100644 --- a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts +++ b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts @@ -352,8 +352,7 @@ export const createMockLocalAuthListManager = ( export const getTestAuthCache = (authService: OCPPAuthService): AuthCache => { const localStrategy = (authService as OCPPAuthServiceImpl).getStrategy('local') as - | LocalAuthStrategy - | undefined + LocalAuthStrategy | undefined const cache = localStrategy?.getAuthCache() assert.ok(cache != null, 'Auth cache must be available for test') return cache diff --git a/tests/charging-station/ui-server/UIMetricsEndpoint.test.ts b/tests/charging-station/ui-server/UIMetricsEndpoint.test.ts index 66b5e0a6..e1021f92 100644 --- a/tests/charging-station/ui-server/UIMetricsEndpoint.test.ts +++ b/tests/charging-station/ui-server/UIMetricsEndpoint.test.ts @@ -1671,8 +1671,7 @@ await describe('UIHttpServer /metrics endpoint (issue #851)', async () => { localServer as unknown as { scheduleClientNotification: () => void } ).scheduleClientNotification() const installed = Reflect.get(localServer, 'clientNotificationDebounceTimer') as - | NodeJS.Timeout - | undefined + NodeJS.Timeout | undefined assert.ok(installed !== undefined, 'precondition: debounce timer installed') const clearedHandles: unknown[] = [] const originalClearTimeout = globalThis.clearTimeout @@ -1702,8 +1701,7 @@ await describe('UIHttpServer /metrics endpoint (issue #851)', async () => { localServer as unknown as { scheduleClientNotification: () => void } ).scheduleClientNotification() const reinstalled = Reflect.get(localServer, 'clientNotificationDebounceTimer') as - | NodeJS.Timeout - | undefined + NodeJS.Timeout | undefined assert.ok(reinstalled !== undefined, 'precondition: 2nd timer installed after first stop()') const beforeStop2 = clearedHandles.length localServer.stop()