Skip to content

Commit

Permalink
refactor: revert overzealous enums ordering
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <[email protected]>
  • Loading branch information
jerome-benoit committed Aug 23, 2024
1 parent 665864c commit 42f3318
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
9 changes: 6 additions & 3 deletions src/charging-station/Bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ import { UIServerFactory } from './ui-server/UIServerFactory.js'
const moduleName = 'Bootstrap'

enum exitCodes {
duplicateChargingStationTemplateUrls = 2,
gracefulShutdownError = 4,
succeeded = 0,
// eslint-disable-next-line perfectionist/sort-enums
missingChargingStationsConfiguration = 1,
// eslint-disable-next-line perfectionist/sort-enums
duplicateChargingStationTemplateUrls = 2,
noChargingStationTemplates = 3,
succeeded = 0
// eslint-disable-next-line perfectionist/sort-enums
gracefulShutdownError = 4
}

export class Bootstrap extends EventEmitter {
Expand Down
21 changes: 11 additions & 10 deletions src/types/WebSocket.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable perfectionist/sort-enums */
export const WebSocketCloseEventStatusString: Record<WebSocketCloseEventStatusCode, string> =
Object.freeze({
1000: 'Normal Closure',
Expand All @@ -19,22 +20,22 @@ export const WebSocketCloseEventStatusString: Record<WebSocketCloseEventStatusCo
})

export enum WebSocketCloseEventStatusCode {
CLOSE_ABNORMAL = 1006,
CLOSE_BAD_GATEWAY = 1014,
CLOSE_GOING_AWAY = 1001,
CLOSE_INVALID_PAYLOAD = 1007,
CLOSE_MISSING_EXTENSION = 1010,
CLOSE_NO_STATUS = 1005,
CLOSE_NORMAL = 1000,
CLOSE_POLICY_VIOLATION = 1008,
CLOSE_GOING_AWAY = 1001,
CLOSE_PROTOCOL_ERROR = 1002,
CLOSE_UNSUPPORTED = 1003,
CLOSE_RESERVED = 1004,
CLOSE_NO_STATUS = 1005,
CLOSE_ABNORMAL = 1006,
CLOSE_INVALID_PAYLOAD = 1007,
CLOSE_POLICY_VIOLATION = 1008,
CLOSE_TOO_LARGE = 1009,
CLOSE_MISSING_EXTENSION = 1010,
CLOSE_SERVER_INTERNAL_ERROR = 1011,
CLOSE_SERVICE_RESTART = 1012,
CLOSE_TLS_HANDSHAKE = 1015,
CLOSE_TOO_LARGE = 1009,
CLOSE_TRY_AGAIN_LATER = 1013,
CLOSE_UNSUPPORTED = 1003
CLOSE_BAD_GATEWAY = 1014,
CLOSE_TLS_HANDSHAKE = 1015
}

export interface WSError extends Error {
Expand Down
5 changes: 3 additions & 2 deletions src/types/ocpp/MessageType.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export enum MessageType {
CALL_ERROR_MESSAGE = 4, // Callee to Caller
CALL_MESSAGE = 2, // Caller to Callee
CALL_RESULT_MESSAGE = 3 // Callee to Caller
CALL_RESULT_MESSAGE = 3, // Callee to Caller
// eslint-disable-next-line perfectionist/sort-enums
CALL_ERROR_MESSAGE = 4 // Callee to Caller
}

0 comments on commit 42f3318

Please sign in to comment.