refactor: cleanup eslint configuration
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 7 Mar 2024 18:51:54 +0000 (19:51 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 7 Mar 2024 18:51:54 +0000 (19:51 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
60 files changed:
.eslintrc.cjs
package.json
pnpm-lock.yaml
src/charging-station/AutomaticTransactionGenerator.ts
src/charging-station/Bootstrap.ts
src/charging-station/ChargingStation.ts
src/charging-station/ChargingStationWorker.ts
src/charging-station/ConfigurationKeyUtils.ts
src/charging-station/Helpers.ts
src/charging-station/IdTagsCache.ts
src/charging-station/SharedLRUCache.ts
src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts
src/charging-station/broadcast-channel/UIServiceWorkerBroadcastChannel.ts
src/charging-station/broadcast-channel/WorkerBroadcastChannel.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/1.6/OCPP16ServiceUtils.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/ocpp/OCPPIncomingRequestService.ts
src/charging-station/ocpp/OCPPRequestService.ts
src/charging-station/ocpp/OCPPResponseService.ts
src/charging-station/ocpp/OCPPServiceUtils.ts
src/charging-station/ui-server/AbstractUIServer.ts
src/charging-station/ui-server/UIHttpServer.ts
src/charging-station/ui-server/UIServerFactory.ts
src/charging-station/ui-server/UIServerUtils.ts
src/charging-station/ui-server/UIWebSocketServer.ts
src/charging-station/ui-server/ui-services/UIService001.ts
src/charging-station/ui-server/ui-services/UIServiceFactory.ts
src/exception/OCPPError.ts
src/performance/PerformanceStatistics.ts
src/performance/storage/JsonFileStorage.ts
src/performance/storage/MikroOrmStorage.ts
src/performance/storage/MongoDBStorage.ts
src/performance/storage/None.ts
src/performance/storage/StorageFactory.ts
src/types/ChargingStationWorker.ts
src/types/ConfigurationData.ts
src/types/Statistics.ts
src/types/index.ts
src/types/ocpp/1.6/Requests.ts
src/types/ocpp/1.6/Responses.ts
src/types/ocpp/1.6/Transaction.ts
src/types/ocpp/2.0/Requests.ts
src/types/ocpp/2.0/Responses.ts
src/types/ocpp/2.0/Variables.ts
src/types/ocpp/Configuration.ts
src/types/ocpp/Requests.ts
src/types/ocpp/Responses.ts
src/utils/Configuration.ts
src/utils/ConfigurationUtils.ts
src/utils/ErrorUtils.ts
src/utils/FileUtils.ts
src/utils/Logger.ts
src/utils/MessageChannelUtils.ts
src/utils/Utils.ts
src/utils/index.ts

index a9d87cf38fbbbd3101d27bc02910f1767b7898fc..ec043bbe27793238c812da2818a3c5fd03cd31e7 100644 (file)
@@ -8,10 +8,10 @@ module.exports = defineConfig({
     node: true
   },
   parserOptions: {
-    ecmaVersion: 2022,
-    sourceType: 'module'
+    sourceType: 'module',
+    ecmaVersion: 2022
   },
-  plugins: ['import'],
+  plugins: ['simple-import-sort', 'import'],
   extends: ['eslint:recommended', 'plugin:import/recommended'],
   settings: {
     'import/resolver': {
@@ -21,36 +21,38 @@ module.exports = defineConfig({
     }
   },
   rules: {
-    'sort-imports': [
-      'error',
-      {
-        ignoreCase: false,
-        ignoreDeclarationSort: true,
-        ignoreMemberSort: false,
-        memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
-        allowSeparatedGroups: true
-      }
-    ],
-    'import/order': [
-      'error',
-      {
-        groups: [
-          'builtin', // Built-in imports (come from NodeJS native) go first
-          'external', // <- External imports
-          'internal', // <- Absolute imports
-          ['sibling', 'parent'], // <- Relative imports, the sibling and parent types they can be mingled together
-          'index', // <- Index imports
-          'unknown' // <- Unknown
-        ],
-        'newlines-between': 'always',
-        alphabetize: {
-          /* Sort in ascending order. Options: ["ignore", "asc", "desc"] */
-          order: 'asc',
-          /* Ignore case. Options: [true, false] */
-          caseInsensitive: true
-        }
-      }
-    ]
+    'simple-import-sort/imports': 'error',
+    'simple-import-sort/exports': 'error'
+    // 'sort-imports': [
+    //   'error',
+    //   {
+    //     ignoreCase: false,
+    //     ignoreDeclarationSort: true,
+    //     ignoreMemberSort: false,
+    //     memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
+    //     allowSeparatedGroups: true
+    //   }
+    // ],
+    // 'import/order': [
+    //   'error',
+    //   {
+    //     groups: [
+    //       'builtin', // Built-in imports (come from NodeJS native) go first
+    //       'external', // <- External imports
+    //       'internal', // <- Absolute imports
+    //       ['sibling', 'parent'], // <- Relative imports, the sibling and parent types they can be mingled together
+    //       'index', // <- Index imports
+    //       'unknown' // <- Unknown
+    //     ],
+    //     'newlines-between': 'always',
+    //     alphabetize: {
+    //       /* Sort in ascending order. Options: ["ignore", "asc", "desc"] */
+    //       order: 'asc',
+    //       /* Ignore case. Options: [true, false] */
+    //       caseInsensitive: true
+    //     }
+    //   }
+    // ]
   },
   overrides: [
     {
index 85953eb9e78c99dfe486fb43564b62f190732d6e..97a6456816c8dff896c9d750e9aee087f0c12554 100644 (file)
     "eslint-define-config": "^2.1.0",
     "eslint-import-resolver-typescript": "^3.6.1",
     "eslint-plugin-import": "^2.29.1",
+    "eslint-plugin-simple-import-sort": "^12.0.0",
     "eslint-plugin-jsdoc": "^48.2.1",
     "eslint-plugin-n": "^16.6.2",
     "eslint-plugin-tsdoc": "^0.2.17",
index 26aed9cc902efd3fa5a61d633a1c0b28725665d5..b01a20fe4eac9d0924fa0c6b48990259c5b17495 100644 (file)
@@ -157,6 +157,9 @@ importers:
       eslint-plugin-n:
         specifier: ^16.6.2
         version: 16.6.2(eslint@8.57.0)
+      eslint-plugin-simple-import-sort:
+        specifier: ^12.0.0
+        version: 12.0.0(eslint@8.57.0)
       eslint-plugin-tsdoc:
         specifier: ^0.2.17
         version: 0.2.17
index 95483b8ec54dd80072f9fe48171e45fe08761de0..40b7c7818a7731c3ea56dac4d81986a689ddc6b9 100644 (file)
@@ -2,10 +2,6 @@
 
 import { hoursToMilliseconds, secondsToMilliseconds } from 'date-fns'
 
-import type { ChargingStation } from './ChargingStation.js'
-import { checkChargingStation } from './Helpers.js'
-import { IdTagsCache } from './IdTagsCache.js'
-import { isIdTagAuthorized } from './ocpp/index.js'
 import { BaseError } from '../exception/index.js'
 import { PerformanceStatistics } from '../performance/index.js'
 import {
@@ -18,17 +14,21 @@ import {
   type StopTransactionResponse
 } from '../types/index.js'
 import {
-  Constants,
   clone,
+  Constants,
   convertToDate,
   formatDurationMilliSeconds,
   getRandomInteger,
   isValidDate,
-  logPrefix,
   logger,
+  logPrefix,
   secureRandom,
   sleep
 } from '../utils/index.js'
+import type { ChargingStation } from './ChargingStation.js'
+import { checkChargingStation } from './Helpers.js'
+import { IdTagsCache } from './IdTagsCache.js'
+import { isIdTagAuthorized } from './ocpp/index.js'
 
 export class AutomaticTransactionGenerator {
   private static readonly instances: Map<string, AutomaticTransactionGenerator> = new Map<
index faa29e6859abeb94881ae1ddb06fec951b4127c6..d31b1e5dc657cf7bf49a84e7f1cbdaa1d17b0884 100644 (file)
@@ -5,14 +5,11 @@ import { dirname, extname, join } from 'node:path'
 import process, { exit } from 'node:process'
 import { fileURLToPath } from 'node:url'
 import { isMainThread } from 'node:worker_threads'
-import type { Worker } from 'worker_threads'
 
 import chalk from 'chalk'
-import { type MessageHandler, availableParallelism } from 'poolifier'
+import { availableParallelism, type MessageHandler } from 'poolifier'
+import type { Worker } from 'worker_threads'
 
-import { buildTemplateName, waitChargingStationEvents } from './Helpers.js'
-import type { AbstractUIServer } from './ui-server/AbstractUIServer.js'
-import { UIServerFactory } from './ui-server/UIServerFactory.js'
 import { version } from '../../package.json'
 import { BaseError } from '../exception/index.js'
 import { type Storage, StorageFactory } from '../performance/index.js'
@@ -34,19 +31,22 @@ import {
   type WorkerConfiguration
 } from '../types/index.js'
 import {
+  buildTemplateStatisticsPayload,
   Configuration,
   Constants,
-  buildTemplateStatisticsPayload,
   formatDurationMilliSeconds,
   generateUUID,
   handleUncaughtException,
   handleUnhandledRejection,
   isAsyncFunction,
   isNotEmptyArray,
-  logPrefix,
-  logger
+  logger,
+  logPrefix
 } from '../utils/index.js'
 import { type WorkerAbstract, WorkerFactory } from '../worker/index.js'
+import { buildTemplateName, waitChargingStationEvents } from './Helpers.js'
+import type { AbstractUIServer } from './ui-server/AbstractUIServer.js'
+import { UIServerFactory } from './ui-server/UIServerFactory.js'
 
 const moduleName = 'Bootstrap'
 
index 5a724e53672d93ee2ea90355184cd3001d48e918..31ce3342f660d35e7598cca46c60c11f1b75c342 100644 (file)
@@ -2,7 +2,7 @@
 
 import { createHash } from 'node:crypto'
 import { EventEmitter } from 'node:events'
-import { type FSWatcher, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
+import { existsSync, type FSWatcher, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
 import { dirname, join } from 'node:path'
 import { URL } from 'node:url'
 import { parentPort } from 'node:worker_threads'
@@ -11,58 +11,6 @@ import { millisecondsToSeconds, secondsToMilliseconds } from 'date-fns'
 import { mergeDeepRight } from 'rambda'
 import { type RawData, WebSocket } from 'ws'
 
-import { AutomaticTransactionGenerator } from './AutomaticTransactionGenerator.js'
-import { ChargingStationWorkerBroadcastChannel } from './broadcast-channel/ChargingStationWorkerBroadcastChannel.js'
-import {
-  addConfigurationKey,
-  deleteConfigurationKey,
-  getConfigurationKey,
-  setConfigurationKeyValue
-} from './ConfigurationKeyUtils.js'
-import {
-  buildConnectorsMap,
-  buildTemplateName,
-  checkChargingStation,
-  checkConfiguration,
-  checkConnectorsConfiguration,
-  checkStationInfoConnectorStatus,
-  checkTemplate,
-  createBootNotificationRequest,
-  createSerialNumber,
-  getAmperageLimitationUnitDivider,
-  getBootConnectorStatus,
-  getChargingStationConnectorChargingProfilesPowerLimit,
-  getChargingStationId,
-  getDefaultVoltageOut,
-  getHashId,
-  getIdTagsFile,
-  getMaxNumberOfEvses,
-  getNumberOfReservableConnectors,
-  getPhaseRotationValue,
-  hasFeatureProfile,
-  hasReservationExpired,
-  initializeConnectorsMapStatus,
-  propagateSerialNumber,
-  setChargingStationOptions,
-  stationTemplateToStationInfo,
-  warnTemplateKeysDeprecation
-} from './Helpers.js'
-import { IdTagsCache } from './IdTagsCache.js'
-import {
-  OCPP16IncomingRequestService,
-  OCPP16RequestService,
-  OCPP16ResponseService,
-  OCPP20IncomingRequestService,
-  OCPP20RequestService,
-  OCPP20ResponseService,
-  type OCPPIncomingRequestService,
-  type OCPPRequestService,
-  buildMeterValue,
-  buildTransactionEndMeterValue,
-  getMessageTypeString,
-  sendAndSetConnectorStatus
-} from './ocpp/index.js'
-import { SharedLRUCache } from './SharedLRUCache.js'
 import { BaseError, OCPPError } from '../exception/index.js'
 import { PerformanceStatistics } from '../performance/index.js'
 import {
@@ -114,17 +62,14 @@ import {
   SupervisionUrlDistribution,
   SupportedFeatureProfiles,
   type Voltage,
-  type WSError,
   WebSocketCloseEventStatusCode,
+  type WSError,
   type WsOptions
 } from '../types/index.js'
 import {
   ACElectricUtils,
   AsyncLock,
   AsyncLockType,
-  Configuration,
-  Constants,
-  DCElectricUtils,
   buildAddedMessage,
   buildChargingStationAutomaticTransactionGeneratorConfiguration,
   buildConnectorsStatus,
@@ -134,9 +79,12 @@ import {
   buildStoppedMessage,
   buildUpdatedMessage,
   clone,
+  Configuration,
+  Constants,
   convertToBoolean,
   convertToDate,
   convertToInt,
+  DCElectricUtils,
   exponentialDelay,
   formatDurationMilliSeconds,
   formatDurationSeconds,
@@ -145,8 +93,8 @@ import {
   handleFileException,
   isNotEmptyArray,
   isNotEmptyString,
-  logPrefix,
   logger,
+  logPrefix,
   min,
   once,
   roundTo,
@@ -154,6 +102,58 @@ import {
   sleep,
   watchJsonFile
 } from '../utils/index.js'
+import { AutomaticTransactionGenerator } from './AutomaticTransactionGenerator.js'
+import { ChargingStationWorkerBroadcastChannel } from './broadcast-channel/ChargingStationWorkerBroadcastChannel.js'
+import {
+  addConfigurationKey,
+  deleteConfigurationKey,
+  getConfigurationKey,
+  setConfigurationKeyValue
+} from './ConfigurationKeyUtils.js'
+import {
+  buildConnectorsMap,
+  buildTemplateName,
+  checkChargingStation,
+  checkConfiguration,
+  checkConnectorsConfiguration,
+  checkStationInfoConnectorStatus,
+  checkTemplate,
+  createBootNotificationRequest,
+  createSerialNumber,
+  getAmperageLimitationUnitDivider,
+  getBootConnectorStatus,
+  getChargingStationConnectorChargingProfilesPowerLimit,
+  getChargingStationId,
+  getDefaultVoltageOut,
+  getHashId,
+  getIdTagsFile,
+  getMaxNumberOfEvses,
+  getNumberOfReservableConnectors,
+  getPhaseRotationValue,
+  hasFeatureProfile,
+  hasReservationExpired,
+  initializeConnectorsMapStatus,
+  propagateSerialNumber,
+  setChargingStationOptions,
+  stationTemplateToStationInfo,
+  warnTemplateKeysDeprecation
+} from './Helpers.js'
+import { IdTagsCache } from './IdTagsCache.js'
+import {
+  buildMeterValue,
+  buildTransactionEndMeterValue,
+  getMessageTypeString,
+  OCPP16IncomingRequestService,
+  OCPP16RequestService,
+  OCPP16ResponseService,
+  OCPP20IncomingRequestService,
+  OCPP20RequestService,
+  OCPP20ResponseService,
+  type OCPPIncomingRequestService,
+  type OCPPRequestService,
+  sendAndSetConnectorStatus
+} from './ocpp/index.js'
+import { SharedLRUCache } from './SharedLRUCache.js'
 
 export class ChargingStation extends EventEmitter {
   public readonly index: number
index 2623f1272d2f19142715f12bfaadaff469294ddb..35a7e534353f5ffaafbae6daba93948e9803d407 100644 (file)
@@ -4,7 +4,6 @@ import { parentPort } from 'node:worker_threads'
 
 import { ThreadWorker } from 'poolifier'
 
-import { ChargingStation } from './ChargingStation.js'
 import { BaseError } from '../exception/index.js'
 import type {
   ChargingStationData,
@@ -12,8 +11,9 @@ import type {
   ChargingStationWorkerEventError,
   ChargingStationWorkerMessage
 } from '../types/index.js'
-import { Configuration, buildChargingStationDataPayload } from '../utils/index.js'
+import { buildChargingStationDataPayload, Configuration } from '../utils/index.js'
 import { type WorkerMessage, WorkerMessageEvents } from '../worker/index.js'
+import { ChargingStation } from './ChargingStation.js'
 
 export let chargingStationWorker: object
 if (Configuration.workerPoolInUse()) {
index 075a497988ae2f5375a665568be67bd7fe8dae82..4b9eb40aa211f9c5d5c651aae0203bc8f330fb74 100644 (file)
@@ -1,6 +1,6 @@
-import type { ChargingStation } from './ChargingStation.js'
 import type { ConfigurationKey, ConfigurationKeyType } from '../types/index.js'
 import { logger } from '../utils/index.js'
+import type { ChargingStation } from './ChargingStation.js'
 
 interface ConfigurationKeyOptions {
   readonly?: boolean
index 9c790268b70100f2b749cf3b04d4d4372f429906..726a0ab3a23f4fabbd5291aca49cc7ebc059c8b6 100644 (file)
@@ -6,13 +6,13 @@ import { fileURLToPath } from 'node:url'
 
 import chalk from 'chalk'
 import {
-  type Interval,
   addDays,
   addSeconds,
   addWeeks,
   differenceInDays,
   differenceInSeconds,
   differenceInWeeks,
+  type Interval,
   isAfter,
   isBefore,
   isDate,
@@ -22,8 +22,6 @@ import {
 } from 'date-fns'
 import { maxTime } from 'date-fns/constants'
 
-import type { ChargingStation } from './ChargingStation.js'
-import { getConfigurationKey } from './ConfigurationKeyUtils.js'
 import { BaseError } from '../exception/index.js'
 import {
   AmpereUnits,
@@ -56,11 +54,11 @@ import {
 } from '../types/index.js'
 import {
   ACElectricUtils,
-  Constants,
-  DCElectricUtils,
   clone,
+  Constants,
   convertToDate,
   convertToInt,
+  DCElectricUtils,
   isArraySorted,
   isEmptyObject,
   isEmptyString,
@@ -70,6 +68,8 @@ import {
   logger,
   secureRandom
 } from '../utils/index.js'
+import type { ChargingStation } from './ChargingStation.js'
+import { getConfigurationKey } from './ConfigurationKeyUtils.js'
 
 const moduleName = 'Helpers'
 
index e1bc8b843eb124e822eea882e900210112710cdd..da4b38bfce79de421343e16f90dd2b6a17e85c6b 100644 (file)
@@ -1,16 +1,16 @@
 import { type FSWatcher, readFileSync } from 'node:fs'
 
-import type { ChargingStation } from './ChargingStation.js'
-import { getIdTagsFile } from './Helpers.js'
 import { FileType, IdTagDistribution } from '../types/index.js'
 import {
   handleFileException,
   isNotEmptyString,
-  logPrefix,
   logger,
+  logPrefix,
   secureRandom,
   watchJsonFile
 } from '../utils/index.js'
+import type { ChargingStation } from './ChargingStation.js'
+import { getIdTagsFile } from './Helpers.js'
 
 interface IdTagsCacheValueType {
   idTags: string[]
index eaa8c912672d0ce74a06a5a797a18ece1c67747b..b2a90e0ff16438057a9e3fb045b79dacf68f4c5c 100644 (file)
@@ -1,8 +1,8 @@
 import { LRUMapWithDelete as LRUCache } from 'mnemonist'
 
-import { Bootstrap } from './Bootstrap.js'
 import type { ChargingStationConfiguration, ChargingStationTemplate } from '../types/index.js'
 import { isEmptyObject, isNotEmptyArray, isNotEmptyString } from '../utils/index.js'
+import { Bootstrap } from './Bootstrap.js'
 
 enum CacheType {
   chargingStationTemplate = 'chargingStationTemplate',
index 26aa61d38e7c97149877fcb13584715afc430d34..1a825e39186e3bc94178507917ff966cd99b3db5 100644 (file)
@@ -1,6 +1,5 @@
 import { secondsToMilliseconds } from 'date-fns'
 
-import { WorkerBroadcastChannel } from './WorkerBroadcastChannel.js'
 import { BaseError, type OCPPError } from '../../exception/index.js'
 import {
   AuthorizationStatus,
@@ -47,6 +46,7 @@ import {
 import type { ChargingStation } from '../ChargingStation.js'
 import { getConfigurationKey } from '../ConfigurationKeyUtils.js'
 import { buildMeterValue } from '../ocpp/index.js'
+import { WorkerBroadcastChannel } from './WorkerBroadcastChannel.js'
 
 const moduleName = 'ChargingStationWorkerBroadcastChannel'
 
index 3a0c75b7d7e7ac19bce1cb255e320b7b4d35c5b0..ef07b5dac21abda443378f0ad0470b14f0bb4403 100644 (file)
@@ -1,4 +1,3 @@
-import { WorkerBroadcastChannel } from './WorkerBroadcastChannel.js'
 import {
   type BroadcastChannelResponse,
   type BroadcastChannelResponsePayload,
@@ -8,6 +7,7 @@ import {
 } from '../../types/index.js'
 import { logger } from '../../utils/index.js'
 import type { AbstractUIService } from '../ui-server/ui-services/AbstractUIService.js'
+import { WorkerBroadcastChannel } from './WorkerBroadcastChannel.js'
 
 const moduleName = 'UIServiceWorkerBroadcastChannel'
 
index dfd0c3e54f7804dbb4d1178ea82132b9988664ff..91c92ac2b41ede0d234b184d127ec6329f1b9427 100644 (file)
@@ -6,7 +6,7 @@ import type {
   JsonType,
   MessageEvent
 } from '../../types/index.js'
-import { logPrefix, logger, validateUUID } from '../../utils/index.js'
+import { logger, logPrefix, validateUUID } from '../../utils/index.js'
 
 const moduleName = 'WorkerBroadcastChannel'
 
index 6d60d402aeb0c98ba7b48bcb5302ca07276c834a..a61cb21995b2bd845e2eb0519f10007cd5febf08 100644 (file)
@@ -2,25 +2,23 @@
 
 import { createWriteStream, readdirSync } from 'node:fs'
 import { dirname, extname, join, resolve } from 'node:path'
-import { URL, fileURLToPath } from 'node:url'
+import { fileURLToPath, URL } from 'node:url'
 
 import type { ValidateFunction } from 'ajv'
 import { Client, type FTPResponse } from 'basic-ftp'
 import {
-  type Interval,
   addSeconds,
   differenceInSeconds,
+  type Interval,
   isDate,
   secondsToMilliseconds
 } from 'date-fns'
 import { maxTime } from 'date-fns/constants'
 import { create } from 'tar'
 
-import { OCPP16Constants } from './OCPP16Constants.js'
-import { OCPP16ServiceUtils } from './OCPP16ServiceUtils.js'
 import {
-  type ChargingStation,
   canProceedChargingProfile,
+  type ChargingStation,
   checkChargingStation,
   getConfigurationKey,
   getConnectorChargingProfiles,
@@ -114,6 +112,8 @@ import {
   sleep
 } from '../../../utils/index.js'
 import { OCPPIncomingRequestService } from '../OCPPIncomingRequestService.js'
+import { OCPP16Constants } from './OCPP16Constants.js'
+import { OCPP16ServiceUtils } from './OCPP16ServiceUtils.js'
 
 const moduleName = 'OCPP16IncomingRequestService'
 
index 74c00daa8f42335383b7d5d7f603cdd40fd90303..d673e8a31597cf893691991a50f901b874468677 100644 (file)
@@ -2,8 +2,6 @@
 
 import type { ValidateFunction } from 'ajv'
 
-import { OCPP16Constants } from './OCPP16Constants.js'
-import { OCPP16ServiceUtils } from './OCPP16ServiceUtils.js'
 import type { ChargingStation } from '../../../charging-station/index.js'
 import { OCPPError } from '../../../exception/index.js'
 import {
@@ -28,6 +26,8 @@ import {
 import { Constants, generateUUID } from '../../../utils/index.js'
 import { OCPPRequestService } from '../OCPPRequestService.js'
 import type { OCPPResponseService } from '../OCPPResponseService.js'
+import { OCPP16Constants } from './OCPP16Constants.js'
+import { OCPP16ServiceUtils } from './OCPP16ServiceUtils.js'
 
 const moduleName = 'OCPP16RequestService'
 
index 3905445e02fde891034802a202403d1b0bfb396b..0fa38728420de1d8e329f1671a2ab9cb77ae00fa 100644 (file)
@@ -3,10 +3,9 @@
 import type { ValidateFunction } from 'ajv'
 import { secondsToMilliseconds } from 'date-fns'
 
-import { OCPP16ServiceUtils } from './OCPP16ServiceUtils.js'
 import {
-  type ChargingStation,
   addConfigurationKey,
+  type ChargingStation,
   getConfigurationKey,
   hasReservationExpired,
   resetConnectorStatus
@@ -53,6 +52,7 @@ import {
 } from '../../../types/index.js'
 import { Constants, convertToInt, isAsyncFunction, logger } from '../../../utils/index.js'
 import { OCPPResponseService } from '../OCPPResponseService.js'
+import { OCPP16ServiceUtils } from './OCPP16ServiceUtils.js'
 
 const moduleName = 'OCPP16ResponseService'
 
index a959844ac497f46b1876acd068ac56f61c87045d..d9144064003fb5bf07e0443720e17ac2af084501 100644 (file)
@@ -2,16 +2,15 @@
 
 import type { JSONSchemaType } from 'ajv'
 import {
-  type Interval,
   addSeconds,
   areIntervalsOverlapping,
   differenceInSeconds,
+  type Interval,
   isAfter,
   isBefore,
   isWithinInterval
 } from 'date-fns'
 
-import { OCPP16Constants } from './OCPP16Constants.js'
 import {
   type ChargingStation,
   hasFeatureProfile,
@@ -40,6 +39,7 @@ import {
 } from '../../../types/index.js'
 import { convertToDate, isNotEmptyArray, logger, roundTo } from '../../../utils/index.js'
 import { OCPPServiceUtils } from '../OCPPServiceUtils.js'
+import { OCPP16Constants } from './OCPP16Constants.js'
 
 export class OCPP16ServiceUtils extends OCPPServiceUtils {
   public static checkFeatureProfile (
index 2a561e45795a0190a951700a5e2275cfe253a3c9..b1cd51fc8e935a7cebfe05a935a623ca4e41dc6c 100644 (file)
@@ -2,7 +2,6 @@
 
 import type { ValidateFunction } from 'ajv'
 
-import { OCPP20ServiceUtils } from './OCPP20ServiceUtils.js'
 import type { ChargingStation } from '../../../charging-station/index.js'
 import { OCPPError } from '../../../exception/index.js'
 import {
@@ -15,6 +14,7 @@ import {
 } from '../../../types/index.js'
 import { isAsyncFunction, logger } from '../../../utils/index.js'
 import { OCPPIncomingRequestService } from '../OCPPIncomingRequestService.js'
+import { OCPP20ServiceUtils } from './OCPP20ServiceUtils.js'
 
 const moduleName = 'OCPP20IncomingRequestService'
 
index 03921891105e745103479904b0b87dbd1bd03c7a..6673b9b43813d8cbf0985bed82001ef085d6b5d1 100644 (file)
@@ -2,8 +2,6 @@
 
 import type { ValidateFunction } from 'ajv'
 
-import { OCPP20Constants } from './OCPP20Constants.js'
-import { OCPP20ServiceUtils } from './OCPP20ServiceUtils.js'
 import type { ChargingStation } from '../../../charging-station/index.js'
 import { OCPPError } from '../../../exception/index.js'
 import {
@@ -20,6 +18,8 @@ import {
 import { generateUUID } from '../../../utils/index.js'
 import { OCPPRequestService } from '../OCPPRequestService.js'
 import type { OCPPResponseService } from '../OCPPResponseService.js'
+import { OCPP20Constants } from './OCPP20Constants.js'
+import { OCPP20ServiceUtils } from './OCPP20ServiceUtils.js'
 
 const moduleName = 'OCPP20RequestService'
 
index 9473324fa1b3ebcfede0fe59a37aa1699911af9c..6ab91c074d01ec4f24b01a4c5fbdffb374ad1fa9 100644 (file)
@@ -2,8 +2,7 @@
 
 import type { ValidateFunction } from 'ajv'
 
-import { OCPP20ServiceUtils } from './OCPP20ServiceUtils.js'
-import { type ChargingStation, addConfigurationKey } from '../../../charging-station/index.js'
+import { addConfigurationKey, type ChargingStation } from '../../../charging-station/index.js'
 import { OCPPError } from '../../../exception/index.js'
 import {
   ErrorType,
@@ -21,6 +20,7 @@ import {
 } from '../../../types/index.js'
 import { isAsyncFunction, logger } from '../../../utils/index.js'
 import { OCPPResponseService } from '../OCPPResponseService.js'
+import { OCPP20ServiceUtils } from './OCPP20ServiceUtils.js'
 
 const moduleName = 'OCPP20ResponseService'
 
index 49128ccbd1b74a9440d76ac998bd849f539ac723..7c88547a6c63ce285e2009e6561b9d813fc99b53 100644 (file)
@@ -3,8 +3,6 @@ import { EventEmitter } from 'node:events'
 import _Ajv, { type ValidateFunction } from 'ajv'
 import _ajvFormats from 'ajv-formats'
 
-import { OCPPConstants } from './OCPPConstants.js'
-import { OCPPServiceUtils } from './OCPPServiceUtils.js'
 import { type ChargingStation, getIdTagsFile } from '../../charging-station/index.js'
 import { OCPPError } from '../../exception/index.js'
 import type {
@@ -15,6 +13,8 @@ import type {
   OCPPVersion
 } from '../../types/index.js'
 import { logger, setDefaultErrorParams } from '../../utils/index.js'
+import { OCPPConstants } from './OCPPConstants.js'
+import { OCPPServiceUtils } from './OCPPServiceUtils.js'
 type Ajv = _Ajv.default
 // eslint-disable-next-line @typescript-eslint/no-redeclare
 const Ajv = _Ajv.default
index 4d279ade78aa27ef99abb6143eff8fb2cc025c6d..781a2b8c88f97f15b884144c5b22732cdcc285d8 100644 (file)
@@ -1,9 +1,6 @@
 import _Ajv, { type ValidateFunction } from 'ajv'
 import _ajvFormats from 'ajv-formats'
 
-import { OCPPConstants } from './OCPPConstants.js'
-import type { OCPPResponseService } from './OCPPResponseService.js'
-import { OCPPServiceUtils } from './OCPPServiceUtils.js'
 import type { ChargingStation } from '../../charging-station/index.js'
 import { OCPPError } from '../../exception/index.js'
 import { PerformanceStatistics } from '../../performance/index.js'
@@ -29,6 +26,9 @@ import {
   handleSendMessageError,
   logger
 } from '../../utils/index.js'
+import { OCPPConstants } from './OCPPConstants.js'
+import type { OCPPResponseService } from './OCPPResponseService.js'
+import { OCPPServiceUtils } from './OCPPServiceUtils.js'
 type Ajv = _Ajv.default
 // eslint-disable-next-line @typescript-eslint/no-redeclare
 const Ajv = _Ajv.default
index a526c28c6812fea7b27108d1b46daa9c3fe731ec..0e9c6164d299a927dd8adf3f58a15d7247e6ced6 100644 (file)
@@ -1,7 +1,6 @@
 import _Ajv, { type ValidateFunction } from 'ajv'
 import _ajvFormats from 'ajv-formats'
 
-import { OCPPServiceUtils } from './OCPPServiceUtils.js'
 import type { ChargingStation } from '../../charging-station/index.js'
 import { OCPPError } from '../../exception/index.js'
 import type {
@@ -11,6 +10,7 @@ import type {
   RequestCommand
 } from '../../types/index.js'
 import { Constants, logger } from '../../utils/index.js'
+import { OCPPServiceUtils } from './OCPPServiceUtils.js'
 type Ajv = _Ajv.default
 // eslint-disable-next-line @typescript-eslint/no-redeclare
 const Ajv = _Ajv.default
index 35b15d9401051f19848660cdb78c4654a3eceb90..38f218ee35b46850154516c1c53572d4724f7a4d 100644 (file)
@@ -5,9 +5,6 @@ import { fileURLToPath } from 'node:url'
 import type { DefinedError, ErrorObject, JSONSchemaType } from 'ajv'
 import { isDate } from 'date-fns'
 
-import { OCPP16Constants } from './1.6/OCPP16Constants.js'
-import { OCPP20Constants } from './2.0/OCPP20Constants.js'
-import { OCPPConstants } from './OCPPConstants.js'
 import {
   type ChargingStation,
   getConfigurationKey,
@@ -51,21 +48,24 @@ import {
 import {
   ACElectricUtils,
   Constants,
-  DCElectricUtils,
   convertToFloat,
   convertToInt,
+  DCElectricUtils,
   getRandomFloatFluctuatedRounded,
   getRandomFloatRounded,
   getRandomInteger,
   handleFileException,
   isNotEmptyArray,
   isNotEmptyString,
-  logPrefix,
   logger,
+  logPrefix,
   max,
   min,
   roundTo
 } from '../../utils/index.js'
+import { OCPP16Constants } from './1.6/OCPP16Constants.js'
+import { OCPP20Constants } from './2.0/OCPP20Constants.js'
+import { OCPPConstants } from './OCPPConstants.js'
 
 export const getMessageTypeString = (messageType: MessageType | undefined): string => {
   switch (messageType) {
index 566d496167d288d0861ad694cd81ee19c61b90f6..9056dc0dcd8ccd68cba100ca8eddbaf13c585bee 100644 (file)
@@ -1,11 +1,8 @@
 import { type IncomingMessage, Server, type ServerResponse } from 'node:http'
-import { type Http2Server, createServer } from 'node:http2'
+import { createServer, type Http2Server } from 'node:http2'
 
 import type { WebSocket } from 'ws'
 
-import type { AbstractUIService } from './ui-services/AbstractUIService.js'
-import { UIServiceFactory } from './ui-services/UIServiceFactory.js'
-import { getUsernameAndPasswordFromAuthorizationToken } from './UIServerUtils.js'
 import { BaseError } from '../../exception/index.js'
 import {
   ApplicationProtocolVersion,
@@ -20,6 +17,9 @@ import {
   type UIServerConfiguration
 } from '../../types/index.js'
 import { logger } from '../../utils/index.js'
+import type { AbstractUIService } from './ui-services/AbstractUIService.js'
+import { UIServiceFactory } from './ui-services/UIServiceFactory.js'
+import { getUsernameAndPasswordFromAuthorizationToken } from './UIServerUtils.js'
 
 const moduleName = 'AbstractUIServer'
 
index fb967ef4ecb0403d54b074738e11dcfb8446af05..b5c30b31375c825c318a65350a3c204164a8613d 100644 (file)
@@ -2,8 +2,6 @@ import type { IncomingMessage, ServerResponse } from 'node:http'
 
 import { StatusCodes } from 'http-status-codes'
 
-import { AbstractUIServer } from './AbstractUIServer.js'
-import { isProtocolAndVersionSupported } from './UIServerUtils.js'
 import { BaseError } from '../../exception/index.js'
 import {
   ApplicationProtocolVersion,
@@ -18,12 +16,14 @@ import {
 } from '../../types/index.js'
 import {
   Constants,
-  JSONStringifyWithMapSupport,
   generateUUID,
   isNotEmptyString,
-  logPrefix,
-  logger
+  JSONStringifyWithMapSupport,
+  logger,
+  logPrefix
 } from '../../utils/index.js'
+import { AbstractUIServer } from './AbstractUIServer.js'
+import { isProtocolAndVersionSupported } from './UIServerUtils.js'
 
 const moduleName = 'UIHttpServer'
 
index d7de7ddd93b152a6bd26b75007dd72b1d31f05e9..0eb71cd469f7e7b3431a6caa0e7a9c19fd949314 100644 (file)
@@ -1,9 +1,5 @@
 import chalk from 'chalk'
 
-import type { AbstractUIServer } from './AbstractUIServer.js'
-import { UIHttpServer } from './UIHttpServer.js'
-import { isLoopback } from './UIServerUtils.js'
-import { UIWebSocketServer } from './UIWebSocketServer.js'
 import { BaseError } from '../../exception/index.js'
 import {
   ApplicationProtocol,
@@ -11,6 +7,10 @@ import {
   AuthenticationType,
   type UIServerConfiguration
 } from '../../types/index.js'
+import type { AbstractUIServer } from './AbstractUIServer.js'
+import { UIHttpServer } from './UIHttpServer.js'
+import { isLoopback } from './UIServerUtils.js'
+import { UIWebSocketServer } from './UIWebSocketServer.js'
 
 // eslint-disable-next-line @typescript-eslint/no-extraneous-class
 export class UIServerFactory {
index 2aa2e92b0727a11c4796745142ed06e6c00e7371..cfe4fd2f6198ee6ae544d0b46b786e9f496f69af 100644 (file)
@@ -2,7 +2,7 @@ import type { IncomingMessage } from 'node:http'
 
 import { BaseError } from '../../exception/index.js'
 import { Protocol, ProtocolVersion } from '../../types/index.js'
-import { logPrefix, logger } from '../../utils/index.js'
+import { logger, logPrefix } from '../../utils/index.js'
 
 export const getUsernameAndPasswordFromAuthorizationToken = (
   authorizationToken: string,
index 1e1a372c698a941365df864aac280aa3bb32778c..29a6567549105a7cc8e202b9249c99c8fa6b4200 100644 (file)
@@ -4,12 +4,6 @@ import type { Duplex } from 'node:stream'
 import { StatusCodes } from 'http-status-codes'
 import { type RawData, WebSocket, WebSocketServer } from 'ws'
 
-import { AbstractUIServer } from './AbstractUIServer.js'
-import {
-  getProtocolAndVersion,
-  handleProtocols,
-  isProtocolAndVersionSupported
-} from './UIServerUtils.js'
 import {
   type ProtocolRequest,
   type ProtocolResponse,
@@ -18,13 +12,19 @@ import {
 } from '../../types/index.js'
 import {
   Constants,
-  JSONStringifyWithMapSupport,
   getWebSocketCloseEventStatusString,
   isNotEmptyString,
-  logPrefix,
+  JSONStringifyWithMapSupport,
   logger,
+  logPrefix,
   validateUUID
 } from '../../utils/index.js'
+import { AbstractUIServer } from './AbstractUIServer.js'
+import {
+  getProtocolAndVersion,
+  handleProtocols,
+  isProtocolAndVersionSupported
+} from './UIServerUtils.js'
 
 const moduleName = 'UIWebSocketServer'
 
index 674f89857404d1c34eb29de90e449d8f983382ea..511bfa7a3de64383c7302584a5c4c6f42d155157 100644 (file)
@@ -1,6 +1,6 @@
-import { AbstractUIService } from './AbstractUIService.js'
 import { type ProtocolRequestHandler, ProtocolVersion } from '../../../types/index.js'
 import type { AbstractUIServer } from '../AbstractUIServer.js'
+import { AbstractUIService } from './AbstractUIService.js'
 
 export class UIService001 extends AbstractUIService {
   constructor (uiServer: AbstractUIServer) {
index 81fc2201f294f89f14c7de9479921feb0141525e..08d81a360bdc669dac2d6fc2fd009d09a8e306bd 100644 (file)
@@ -1,7 +1,7 @@
-import type { AbstractUIService } from './AbstractUIService.js'
-import { UIService001 } from './UIService001.js'
 import { ProtocolVersion } from '../../../types/index.js'
 import type { AbstractUIServer } from '../AbstractUIServer.js'
+import type { AbstractUIService } from './AbstractUIService.js'
+import { UIService001 } from './UIService001.js'
 
 // eslint-disable-next-line @typescript-eslint/no-extraneous-class
 export class UIServiceFactory {
index 27876dadfef495d674f6cae7422fa793129a09b5..1e716ae4d1d8f7c530e489a7fb37151f5fba8644 100644 (file)
@@ -1,8 +1,8 @@
 // Partial Copyright Jerome Benoit. 2021-2024. All Rights Reserved.
 
-import { BaseError } from './BaseError.js'
 import type { ErrorType, IncomingRequestCommand, JsonType, RequestCommand } from '../types/index.js'
 import { Constants } from '../utils/index.js'
+import { BaseError } from './BaseError.js'
 
 export class OCPPError extends BaseError {
   code: ErrorType
index e90595225278d3a926059a2ca3ab7821b800d644..bf333dfd4c9c1449334bd979933b7d868d0e0c02 100644 (file)
@@ -1,6 +1,6 @@
 // Partial Copyright Jerome Benoit. 2021-2024. All Rights Reserved.
 
-import { type PerformanceEntry, PerformanceObserver, performance } from 'node:perf_hooks'
+import { performance, type PerformanceEntry, PerformanceObserver } from 'node:perf_hooks'
 import type { URL } from 'node:url'
 import { parentPort } from 'node:worker_threads'
 
@@ -19,17 +19,17 @@ import {
   type TimestampedData
 } from '../types/index.js'
 import {
+  average,
+  buildPerformanceStatisticsMessage,
   CircularArray,
   Configuration,
   Constants,
-  JSONStringifyWithMapSupport,
-  average,
-  buildPerformanceStatisticsMessage,
   extractTimeSeriesValues,
   formatDurationSeconds,
   generateUUID,
-  logPrefix,
+  JSONStringifyWithMapSupport,
   logger,
+  logPrefix,
   max,
   median,
   min,
index a69edd69ace56acf62fbd3992cb401e901fc5c3b..648b9c62f292474b0b6dcd3d871af4c0849fa36d 100644 (file)
@@ -3,15 +3,15 @@
 import { closeSync, existsSync, mkdirSync, openSync, writeSync } from 'node:fs'
 import { dirname } from 'node:path'
 
-import { Storage } from './Storage.js'
 import { BaseError } from '../../exception/index.js'
 import { FileType, type Statistics } from '../../types/index.js'
 import {
   AsyncLock,
   AsyncLockType,
-  JSONStringifyWithMapSupport,
-  handleFileException
+  handleFileException,
+  JSONStringifyWithMapSupport
 } from '../../utils/index.js'
+import { Storage } from './Storage.js'
 
 export class JsonFileStorage extends Storage {
   private fd?: number
index e91693060aea213908d1df126e99aed81b930421..7b4545bdff36ba824597c22549889641c6f60538 100644 (file)
@@ -3,9 +3,9 @@
 import { MikroORM as MariaDbORM, type Options as MariaDbOptions } from '@mikro-orm/mariadb'
 import { MikroORM as SqliteORM, type Options as SqliteOptions } from '@mikro-orm/sqlite'
 
-import { Storage } from './Storage.js'
 import { type PerformanceRecord, type Statistics, StorageType } from '../../types/index.js'
 import { Constants } from '../../utils/index.js'
+import { Storage } from './Storage.js'
 
 export class MikroOrmStorage extends Storage {
   private readonly storageType: StorageType
index b3d535e2906d33d6b13b1184e8b8458256f294a3..c3c98022d4204c63aa6d940f7cac887d2424ed58 100644 (file)
@@ -2,10 +2,10 @@
 
 import { MongoClient } from 'mongodb'
 
-import { Storage } from './Storage.js'
 import { BaseError } from '../../exception/index.js'
 import { type Statistics, StorageType } from '../../types/index.js'
 import { Constants } from '../../utils/index.js'
+import { Storage } from './Storage.js'
 
 export class MongoDBStorage extends Storage {
   private readonly client?: MongoClient
index 6506d36b6ad3fdf9efb524899551de725ae98d56..af3e273e2f5c039973a9159d8512ec637cbae641 100644 (file)
@@ -1,7 +1,7 @@
 // Copyright Jerome Benoit. 2021-2024. All Rights Reserved.
 
-import { Storage } from './Storage.js'
 import type { Statistics } from '../../types/index.js'
+import { Storage } from './Storage.js'
 
 export class None extends Storage {
   constructor () {
index 9da6b54e98fa1d181b9a8c982e0b9d365535fa9f..2b6b84ffe5b8ad75da53fc7c5fa9687b0e0089cd 100644 (file)
@@ -1,12 +1,12 @@
 // Copyright Jerome Benoit. 2021-2024. All Rights Reserved.
 
+import { BaseError } from '../../exception/index.js'
+import { StorageType } from '../../types/index.js'
 import { JsonFileStorage } from './JsonFileStorage.js'
 import { MikroOrmStorage } from './MikroOrmStorage.js'
 import { MongoDBStorage } from './MongoDBStorage.js'
 import { None } from './None.js'
 import type { Storage } from './Storage.js'
-import { BaseError } from '../../exception/index.js'
-import { StorageType } from '../../types/index.js'
 
 // eslint-disable-next-line @typescript-eslint/no-extraneous-class
 export class StorageFactory {
index ff3c5ef0fe56ed6b29d11745279dd334741a3b92..861d447ea03be6b9d5146b3233c67b41e65cf379 100644 (file)
@@ -1,5 +1,6 @@
 import type { WebSocket } from 'ws'
 
+import { type WorkerData, type WorkerMessage, WorkerMessageEvents } from '../worker/index.js'
 import type { ChargingStationAutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator.js'
 import { ChargingStationEvents } from './ChargingStationEvents.js'
 import type { ChargingStationInfo } from './ChargingStationInfo.js'
@@ -9,7 +10,6 @@ import type { EvseStatus } from './Evse.js'
 import type { JsonObject } from './JsonType.js'
 import type { BootNotificationResponse } from './ocpp/Responses.js'
 import type { Statistics } from './Statistics.js'
-import { type WorkerData, type WorkerMessage, WorkerMessageEvents } from '../worker/index.js'
 
 export interface ChargingStationOptions extends JsonObject {
   supervisionUrls?: string | string[]
index fe8b84819452354572011d23388ffc679637d701..3248ec555263eeabc3c66d81546cb471d9526083 100644 (file)
@@ -3,9 +3,9 @@ import type { ResourceLimits } from 'node:worker_threads'
 
 import type { WorkerChoiceStrategy } from 'poolifier'
 
+import type { WorkerProcessType } from '../worker/index.js'
 import type { StorageType } from './Storage.js'
 import type { ApplicationProtocol, AuthenticationType } from './UIProtocol.js'
-import type { WorkerProcessType } from '../worker/index.js'
 
 type ServerOptions = ListenOptions
 
index ecb3c2bfc4afa4746d7e7698eee144d9a10c2cae..9abd0a89982d7be726eb23d13825d2262b42696d 100644 (file)
@@ -1,6 +1,6 @@
-import type { IncomingRequestCommand, RequestCommand } from './ocpp/Requests.js'
 import type { CircularArray } from '../utils/index.js'
 import type { WorkerData } from '../worker/index.js'
+import type { IncomingRequestCommand, RequestCommand } from './ocpp/Requests.js'
 
 export interface TimestampedData {
   timestamp: number
index f312480a0eed1e4cda5865df7ebb97d2c560da70..023107fd3c0f9a7f309a26c6dbb4d43429aaa438 100644 (file)
@@ -1,87 +1,86 @@
-export {
-  ApplicationProtocol,
-  AuthenticationType,
-  ProcedureName,
-  Protocol,
-  type ProtocolRequest,
-  type ProtocolRequestHandler,
-  type ProtocolResponse,
-  ProtocolVersion,
-  type RequestPayload,
-  type ResponsePayload,
-  ResponseStatus,
-  type SimulatorState,
-  type TemplateStatistics
-} from './UIProtocol.js'
 export {
   type AutomaticTransactionGeneratorConfiguration,
   type ChargingStationAutomaticTransactionGeneratorConfiguration,
   IdTagDistribution,
   type Status
 } from './AutomaticTransactionGenerator.js'
-export { type GenericResponse, GenericStatus, RegistrationStatusEnumType } from './ocpp/Common.js'
+export type {
+  ChargingStationConfiguration,
+  EvseStatusConfiguration
+} from './ChargingStationConfiguration.js'
+export { ChargingStationEvents } from './ChargingStationEvents.js'
+export type { ChargingStationInfo } from './ChargingStationInfo.js'
+export type {
+  ChargingStationOcppConfiguration,
+  ConfigurationKey
+} from './ChargingStationOcppConfiguration.js'
 export {
-  AvailabilityType,
-  type BootNotificationRequest,
-  type CachedRequest,
-  type DataTransferRequest,
-  type DiagnosticsStatusNotificationRequest,
-  type ErrorCallback,
-  FirmwareStatus,
-  type FirmwareStatusNotificationRequest,
-  type HeartbeatRequest,
-  type IncomingRequest,
-  IncomingRequestCommand,
-  type IncomingRequestHandler,
-  MessageTrigger,
-  type MeterValuesRequest,
-  type OutgoingRequest,
-  RequestCommand,
-  type RequestParams,
-  type ResponseCallback,
-  type ResponseType,
-  type StatusNotificationRequest
-} from './ocpp/Requests.js'
+  AmpereUnits,
+  type ChargingStationTemplate,
+  CurrentType,
+  type FirmwareUpgrade,
+  PowerUnits,
+  Voltage,
+  type WsOptions
+} from './ChargingStationTemplate.js'
 export {
-  AvailabilityStatus,
-  type BootNotificationResponse,
-  ChargingProfileStatus,
-  type ClearCacheResponse,
-  ClearChargingProfileStatus,
-  ConfigurationStatus,
-  type DataTransferResponse,
-  DataTransferStatus,
-  type DiagnosticsStatusNotificationResponse,
-  type ErrorResponse,
-  type FirmwareStatusNotificationResponse,
-  type HeartbeatResponse,
-  type MeterValuesResponse,
-  ReservationStatus,
-  type Response,
-  type ResponseHandler,
-  type StatusNotificationResponse,
-  TriggerMessageStatus,
-  UnlockStatus
-} from './ocpp/Responses.js'
+  type ChargingStationData,
+  type ChargingStationOptions,
+  type ChargingStationWorkerData,
+  type ChargingStationWorkerEventError,
+  type ChargingStationWorkerMessage,
+  type ChargingStationWorkerMessageData,
+  ChargingStationWorkerMessageEvents,
+  type EvseStatusWorkerType
+} from './ChargingStationWorker.js'
 export {
-  AuthorizationStatus,
-  type AuthorizeRequest,
-  type AuthorizeResponse,
-  type StartTransactionRequest,
-  type StartTransactionResponse,
-  StopTransactionReason,
-  type StopTransactionRequest,
-  type StopTransactionResponse
-} from './ocpp/Transaction.js'
-export { BootReasonEnumType, OCPP20ConnectorStatusEnumType } from './ocpp/2.0/Common.js'
+  ApplicationProtocolVersion,
+  type ConfigurationData,
+  ConfigurationSection,
+  type ElementsPerWorkerType,
+  type LogConfiguration,
+  type StationTemplateUrl,
+  type StorageConfiguration,
+  SupervisionUrlDistribution,
+  type UIServerConfiguration,
+  type WorkerConfiguration
+} from './ConfigurationData.js'
+export type { ConnectorStatus } from './ConnectorStatus.js'
+export type { EmptyObject } from './EmptyObject.js'
+export type { HandleErrorParams } from './Error.js'
+export type { EvseStatus, EvseTemplate } from './Evse.js'
+export { FileType } from './FileType.js'
+export type { JsonObject, JsonType } from './JsonType.js'
+export type {
+  MeasurandPerPhaseSampledValueTemplates,
+  SampledValueTemplate
+} from './MeasurandPerPhaseSampledValueTemplates.js'
+export type { MeasurandValues } from './MeasurandValues.js'
+export { OCPP16ChargePointErrorCode } from './ocpp/1.6/ChargePointErrorCode.js'
+export { OCPP16ChargePointStatus } from './ocpp/1.6/ChargePointStatus.js'
 export {
-  BroadcastChannelProcedureName,
-  type BroadcastChannelRequest,
-  type BroadcastChannelRequestPayload,
-  type BroadcastChannelResponse,
-  type BroadcastChannelResponsePayload,
-  type MessageEvent
-} from './WorkerBroadcastChannel.js'
+  type OCPP16ChargingProfile,
+  OCPP16ChargingProfilePurposeType,
+  OCPP16ChargingRateUnitType,
+  type OCPP16ChargingSchedule,
+  type OCPP16ChargingSchedulePeriod
+} from './ocpp/1.6/ChargingProfile.js'
+export {
+  OCPP16StandardParametersKey,
+  OCPP16SupportedFeatureProfiles
+} from './ocpp/1.6/Configuration.js'
+export { OCPP16DiagnosticsStatus } from './ocpp/1.6/DiagnosticsStatus.js'
+export {
+  type OCPP16MeterValue,
+  OCPP16MeterValueContext,
+  OCPP16MeterValueLocation,
+  OCPP16MeterValueMeasurand,
+  OCPP16MeterValuePhase,
+  type OCPP16MeterValuesRequest,
+  type OCPP16MeterValuesResponse,
+  OCPP16MeterValueUnit,
+  type OCPP16SampledValue
+} from './ocpp/1.6/MeterValues.js'
 export {
   type ChangeConfigurationRequest,
   type GetConfigurationRequest,
@@ -133,6 +132,32 @@ export {
   type SetChargingProfileResponse,
   type UnlockConnectorResponse
 } from './ocpp/1.6/Responses.js'
+export {
+  OCPP16AuthorizationStatus,
+  type OCPP16AuthorizeRequest,
+  type OCPP16AuthorizeResponse,
+  type OCPP16StartTransactionRequest,
+  type OCPP16StartTransactionResponse,
+  OCPP16StopTransactionReason,
+  type OCPP16StopTransactionRequest,
+  type OCPP16StopTransactionResponse
+} from './ocpp/1.6/Transaction.js'
+export { BootReasonEnumType, OCPP20ConnectorStatusEnumType } from './ocpp/2.0/Common.js'
+export {
+  type OCPP20BootNotificationRequest,
+  type OCPP20ClearCacheRequest,
+  type OCPP20HeartbeatRequest,
+  OCPP20IncomingRequestCommand,
+  OCPP20RequestCommand,
+  type OCPP20StatusNotificationRequest
+} from './ocpp/2.0/Requests.js'
+export type {
+  OCPP20BootNotificationResponse,
+  OCPP20ClearCacheResponse,
+  OCPP20HeartbeatResponse,
+  OCPP20StatusNotificationResponse
+} from './ocpp/2.0/Responses.js'
+export { OCPP20OptionalVariableName } from './ocpp/2.0/Variables.js'
 export { ChargePointErrorCode } from './ocpp/ChargePointErrorCode.js'
 export {
   type ChargingProfile,
@@ -141,46 +166,7 @@ export {
   type ChargingSchedulePeriod,
   RecurrencyKindType
 } from './ocpp/ChargingProfile.js'
-export type {
-  ChargingStationConfiguration,
-  EvseStatusConfiguration
-} from './ChargingStationConfiguration.js'
-export {
-  type ChargingStationData,
-  type ChargingStationWorkerData,
-  type ChargingStationWorkerEventError,
-  type ChargingStationWorkerMessage,
-  type ChargingStationWorkerMessageData,
-  ChargingStationWorkerMessageEvents,
-  type ChargingStationOptions,
-  type EvseStatusWorkerType
-} from './ChargingStationWorker.js'
-export type { ChargingStationInfo } from './ChargingStationInfo.js'
-export type {
-  ChargingStationOcppConfiguration,
-  ConfigurationKey
-} from './ChargingStationOcppConfiguration.js'
-export {
-  AmpereUnits,
-  type ChargingStationTemplate,
-  CurrentType,
-  type FirmwareUpgrade,
-  PowerUnits,
-  Voltage,
-  type WsOptions
-} from './ChargingStationTemplate.js'
-export {
-  ApplicationProtocolVersion,
-  type ConfigurationData,
-  ConfigurationSection,
-  type ElementsPerWorkerType,
-  type LogConfiguration,
-  type StationTemplateUrl,
-  type StorageConfiguration,
-  SupervisionUrlDistribution,
-  type UIServerConfiguration,
-  type WorkerConfiguration
-} from './ConfigurationData.js'
+export { type GenericResponse, GenericStatus, RegistrationStatusEnumType } from './ocpp/Common.js'
 export {
   type ConfigurationKeyType,
   ConnectorPhaseRotation,
@@ -189,20 +175,8 @@ export {
   SupportedFeatureProfiles,
   VendorParametersKey
 } from './ocpp/Configuration.js'
-export type { ConnectorStatus } from './ConnectorStatus.js'
 export { ConnectorStatusEnum, type ConnectorStatusTransition } from './ocpp/ConnectorStatusEnum.js'
-export { DBName, StorageType } from './Storage.js'
-export type { EmptyObject } from './EmptyObject.js'
 export { ErrorType } from './ocpp/ErrorType.js'
-export type { EvseTemplate, EvseStatus } from './Evse.js'
-export { FileType } from './FileType.js'
-export type { HandleErrorParams } from './Error.js'
-export type { JsonObject, JsonType } from './JsonType.js'
-export type {
-  MeasurandPerPhaseSampledValueTemplates,
-  SampledValueTemplate
-} from './MeasurandPerPhaseSampledValueTemplates.js'
-export type { MeasurandValues } from './MeasurandValues.js'
 export { MessageType } from './ocpp/MessageType.js'
 export {
   type MeterValue,
@@ -213,57 +187,65 @@ export {
   MeterValueUnit,
   type SampledValue
 } from './ocpp/MeterValues.js'
+export { OCPPVersion } from './ocpp/OCPPVersion.js'
 export {
-  type OCPP16MeterValue,
-  OCPP16MeterValueContext,
-  OCPP16MeterValueLocation,
-  OCPP16MeterValueMeasurand,
-  OCPP16MeterValuePhase,
-  OCPP16MeterValueUnit,
-  type OCPP16MeterValuesRequest,
-  type OCPP16MeterValuesResponse,
-  type OCPP16SampledValue
-} from './ocpp/1.6/MeterValues.js'
-export {
-  OCPP16AuthorizationStatus,
-  type OCPP16AuthorizeRequest,
-  type OCPP16AuthorizeResponse,
-  type OCPP16StartTransactionRequest,
-  type OCPP16StartTransactionResponse,
-  OCPP16StopTransactionReason,
-  type OCPP16StopTransactionRequest,
-  type OCPP16StopTransactionResponse
-} from './ocpp/1.6/Transaction.js'
-export { OCPP16ChargePointErrorCode } from './ocpp/1.6/ChargePointErrorCode.js'
-export { OCPP16ChargePointStatus } from './ocpp/1.6/ChargePointStatus.js'
+  AvailabilityType,
+  type BootNotificationRequest,
+  type CachedRequest,
+  type DataTransferRequest,
+  type DiagnosticsStatusNotificationRequest,
+  type ErrorCallback,
+  FirmwareStatus,
+  type FirmwareStatusNotificationRequest,
+  type HeartbeatRequest,
+  type IncomingRequest,
+  IncomingRequestCommand,
+  type IncomingRequestHandler,
+  MessageTrigger,
+  type MeterValuesRequest,
+  type OutgoingRequest,
+  RequestCommand,
+  type RequestParams,
+  type ResponseCallback,
+  type ResponseType,
+  type StatusNotificationRequest
+} from './ocpp/Requests.js'
 export {
-  type OCPP16ChargingProfile,
-  OCPP16ChargingProfilePurposeType,
-  OCPP16ChargingRateUnitType,
-  type OCPP16ChargingSchedule,
-  type OCPP16ChargingSchedulePeriod
-} from './ocpp/1.6/ChargingProfile.js'
+  type Reservation,
+  type ReservationKey,
+  ReservationTerminationReason
+} from './ocpp/Reservation.js'
 export {
-  OCPP16StandardParametersKey,
-  OCPP16SupportedFeatureProfiles
-} from './ocpp/1.6/Configuration.js'
-export { OCPP16DiagnosticsStatus } from './ocpp/1.6/DiagnosticsStatus.js'
+  AvailabilityStatus,
+  type BootNotificationResponse,
+  ChargingProfileStatus,
+  type ClearCacheResponse,
+  ClearChargingProfileStatus,
+  ConfigurationStatus,
+  type DataTransferResponse,
+  DataTransferStatus,
+  type DiagnosticsStatusNotificationResponse,
+  type ErrorResponse,
+  type FirmwareStatusNotificationResponse,
+  type HeartbeatResponse,
+  type MeterValuesResponse,
+  ReservationStatus,
+  type Response,
+  type ResponseHandler,
+  type StatusNotificationResponse,
+  TriggerMessageStatus,
+  UnlockStatus
+} from './ocpp/Responses.js'
 export {
-  type OCPP20BootNotificationRequest,
-  type OCPP20ClearCacheRequest,
-  type OCPP20HeartbeatRequest,
-  OCPP20IncomingRequestCommand,
-  OCPP20RequestCommand,
-  type OCPP20StatusNotificationRequest
-} from './ocpp/2.0/Requests.js'
-export type {
-  OCPP20BootNotificationResponse,
-  OCPP20ClearCacheResponse,
-  OCPP20HeartbeatResponse,
-  OCPP20StatusNotificationResponse
-} from './ocpp/2.0/Responses.js'
-export { OCPP20OptionalVariableName } from './ocpp/2.0/Variables.js'
-export { OCPPVersion } from './ocpp/OCPPVersion.js'
+  AuthorizationStatus,
+  type AuthorizeRequest,
+  type AuthorizeResponse,
+  type StartTransactionRequest,
+  type StartTransactionResponse,
+  StopTransactionReason,
+  type StopTransactionRequest,
+  type StopTransactionResponse
+} from './ocpp/Transaction.js'
 export { PerformanceRecord } from './orm/entities/PerformanceRecord.js'
 export type {
   InternalTemplateStatistics,
@@ -271,14 +253,32 @@ export type {
   StatisticsData,
   TimestampedData
 } from './Statistics.js'
+export { DBName, StorageType } from './Storage.js'
+export {
+  ApplicationProtocol,
+  AuthenticationType,
+  ProcedureName,
+  Protocol,
+  type ProtocolRequest,
+  type ProtocolRequestHandler,
+  type ProtocolResponse,
+  ProtocolVersion,
+  type RequestPayload,
+  type ResponsePayload,
+  ResponseStatus,
+  type SimulatorState,
+  type TemplateStatistics
+} from './UIProtocol.js'
 export {
-  type WSError,
   WebSocketCloseEventStatusCode,
-  WebSocketCloseEventStatusString
+  WebSocketCloseEventStatusString,
+  type WSError
 } from './WebSocket.js'
 export {
-  type Reservation,
-  type ReservationKey,
-  ReservationTerminationReason
-} from './ocpp/Reservation.js'
-export { ChargingStationEvents } from './ChargingStationEvents.js'
+  BroadcastChannelProcedureName,
+  type BroadcastChannelRequest,
+  type BroadcastChannelRequestPayload,
+  type BroadcastChannelResponse,
+  type BroadcastChannelResponsePayload,
+  type MessageEvent
+} from './WorkerBroadcastChannel.js'
index 26dd03f79570fbfdaefedb8347843495ed67ab8b..c57be2032751277115f298947575d7877457d4cd 100644 (file)
@@ -1,3 +1,5 @@
+import type { EmptyObject } from '../../EmptyObject.js'
+import type { JsonObject } from '../../JsonType.js'
 import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode.js'
 import type { OCPP16ChargePointStatus } from './ChargePointStatus.js'
 import type {
@@ -7,8 +9,6 @@ import type {
 } from './ChargingProfile.js'
 import type { OCPP16StandardParametersKey, OCPP16VendorParametersKey } from './Configuration.js'
 import type { OCPP16DiagnosticsStatus } from './DiagnosticsStatus.js'
-import type { EmptyObject } from '../../EmptyObject.js'
-import type { JsonObject } from '../../JsonType.js'
 
 export enum OCPP16RequestCommand {
   BOOT_NOTIFICATION = 'BootNotification',
index b8c36ed24f471f6d23734b74c569e5eedd6ddfa0..8b67a9267d5a3a9da03632a0bd7b20a381434102 100644 (file)
@@ -1,8 +1,8 @@
-import type { OCPP16ChargingSchedule } from './ChargingProfile.js'
 import type { EmptyObject } from '../../EmptyObject.js'
 import type { JsonObject } from '../../JsonType.js'
 import type { GenericStatus, RegistrationStatusEnumType } from '../Common.js'
 import type { OCPPConfigurationKey } from '../Configuration.js'
+import type { OCPP16ChargingSchedule } from './ChargingProfile.js'
 
 export interface OCPP16HeartbeatResponse extends JsonObject {
   currentTime: Date
index 2e6c7289cde3ac8940d605b74bdff41c86b061df..f9659f695398822e3932197137b8ee581626d6d2 100644 (file)
@@ -1,5 +1,5 @@
-import type { OCPP16MeterValue } from './MeterValues.js'
 import type { JsonObject } from '../../JsonType.js'
+import type { OCPP16MeterValue } from './MeterValues.js'
 
 export enum OCPP16StopTransactionReason {
   EMERGENCY_STOP = 'EmergencyStop',
index d2c87287315cd52a25672555b80b3067864b87ae..f075e642f7284f657398f5e3a7a46b0ab7f565db 100644 (file)
@@ -1,11 +1,11 @@
+import type { EmptyObject } from '../../EmptyObject.js'
+import type { JsonObject } from '../../JsonType.js'
 import type {
   BootReasonEnumType,
   InstallCertificateUseEnumType,
   OCPP20ConnectorStatusEnumType
 } from './Common.js'
 import type { OCPP20SetVariableDataType } from './Variables.js'
-import type { EmptyObject } from '../../EmptyObject.js'
-import type { JsonObject } from '../../JsonType.js'
 
 export enum OCPP20RequestCommand {
   BOOT_NOTIFICATION = 'BootNotification',
index 51d6ad4444683a011aa62b0aaf0f317558dcf898..4248c5d8f6baf74bc7b5874371c6026a781e9442 100644 (file)
@@ -1,12 +1,12 @@
+import type { EmptyObject } from '../../EmptyObject.js'
+import type { JsonObject } from '../../JsonType.js'
+import type { RegistrationStatusEnumType } from '../Common.js'
 import type {
   GenericStatusEnumType,
   InstallCertificateStatusEnumType,
   StatusInfoType
 } from './Common.js'
 import type { OCPP20SetVariableResultType } from './Variables.js'
-import type { EmptyObject } from '../../EmptyObject.js'
-import type { JsonObject } from '../../JsonType.js'
-import type { RegistrationStatusEnumType } from '../Common.js'
 
 export interface OCPP20BootNotificationResponse extends JsonObject {
   currentTime: Date
index 439abf35c71c39ebe7029d0f47ceff2bd643346c..04a344564bcd202e3a6ab5dcef35798545b09620 100644 (file)
@@ -1,5 +1,5 @@
-import type { EVSEType, StatusInfoType } from './Common.js'
 import type { JsonObject } from '../../JsonType.js'
+import type { EVSEType, StatusInfoType } from './Common.js'
 
 enum OCPP20ComponentName {
   AlignedDataCtrlr = 'AlignedDataCtrlr',
index c174234812421c929e78f82bbbafdcceff45cdbe..f1cd34ba3f8ec0cd79b70de1d8378fb409d7e511 100644 (file)
@@ -1,3 +1,4 @@
+import type { JsonObject } from '../JsonType.js'
 import {
   OCPP16StandardParametersKey,
   OCPP16SupportedFeatureProfiles,
@@ -8,7 +9,6 @@ import {
   OCPP20RequiredVariableName,
   OCPP20VendorVariableName
 } from './2.0/Variables.js'
-import type { JsonObject } from '../JsonType.js'
 
 export const StandardParametersKey = {
   ...OCPP16StandardParametersKey,
index c718f1e03ab5b61c6fc8b92cdf49dd1154f179fd..12e1c68c3e6996cf9c3d1ddb48158662ea7ab0df 100644 (file)
@@ -1,3 +1,6 @@
+import type { ChargingStation } from '../../charging-station/index.js'
+import type { OCPPError } from '../../exception/index.js'
+import type { JsonType } from '../JsonType.js'
 import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus.js'
 import type { OCPP16MeterValuesRequest } from './1.6/MeterValues.js'
 import {
@@ -23,9 +26,6 @@ import {
   type OCPP20StatusNotificationRequest
 } from './2.0/Requests.js'
 import type { MessageType } from './MessageType.js'
-import type { ChargingStation } from '../../charging-station/index.js'
-import type { OCPPError } from '../../exception/index.js'
-import type { JsonType } from '../JsonType.js'
 
 export const RequestCommand = {
   ...OCPP16RequestCommand,
index 9983ee8a81b0721fb306d55cfb88dca15055ac57..aac5a5fc3774b39d008b454d5e85faad021e2016 100644 (file)
@@ -1,3 +1,5 @@
+import type { ChargingStation } from '../../charging-station/index.js'
+import type { JsonType } from '../JsonType.js'
 import type { OCPP16MeterValuesResponse } from './1.6/MeterValues.js'
 import {
   OCPP16AvailabilityStatus,
@@ -19,8 +21,6 @@ import type { OCPP20BootNotificationResponse, OCPP20ClearCacheResponse } from '.
 import { type GenericResponse, GenericStatus } from './Common.js'
 import type { ErrorType } from './ErrorType.js'
 import type { MessageType } from './MessageType.js'
-import type { ChargingStation } from '../../charging-station/index.js'
-import type { JsonType } from '../JsonType.js'
 
 export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType]
 
index d577ded4141858bbc08213615f116fd199bfc2c8..46ad889c7fca2e4fd772558c38270c3caf31e87d 100644 (file)
@@ -6,16 +6,6 @@ import { fileURLToPath } from 'node:url'
 import chalk from 'chalk'
 import { mergeDeepRight } from 'rambda'
 
-import {
-  buildPerformanceUriFilePath,
-  checkWorkerElementsPerWorker,
-  checkWorkerProcessType,
-  getDefaultPerformanceStorageUri,
-  handleFileException,
-  logPrefix
-} from './ConfigurationUtils.js'
-import { Constants } from './Constants.js'
-import { hasOwnProp, isCFEnvironment, once } from './Utils.js'
 import {
   ApplicationProtocol,
   ApplicationProtocolVersion,
@@ -37,6 +27,16 @@ import {
   DEFAULT_WORKER_START_DELAY,
   WorkerProcessType
 } from '../worker/index.js'
+import {
+  buildPerformanceUriFilePath,
+  checkWorkerElementsPerWorker,
+  checkWorkerProcessType,
+  getDefaultPerformanceStorageUri,
+  handleFileException,
+  logPrefix
+} from './ConfigurationUtils.js'
+import { Constants } from './Constants.js'
+import { hasOwnProp, isCFEnvironment, once } from './Utils.js'
 
 type ConfigurationSectionType =
   | LogConfiguration
index fd976859aeef04ff6f76f5cccd4395b8b75d1b5c..2a85bb0e2fd5686b603bf9a405181c3bc13f1b64 100644 (file)
@@ -3,10 +3,10 @@ import { fileURLToPath } from 'node:url'
 
 import chalk from 'chalk'
 
-import { Constants } from './Constants.js'
-import { isNotEmptyString, logPrefix as utilsLogPrefix } from './Utils.js'
 import { type ElementsPerWorkerType, type FileType, StorageType } from '../types/index.js'
 import { WorkerProcessType } from '../worker/index.js'
+import { Constants } from './Constants.js'
+import { isNotEmptyString, logPrefix as utilsLogPrefix } from './Utils.js'
 
 export const logPrefix = (): string => {
   return utilsLogPrefix(' Simulator configuration |')
index bd4fcf375ca334e96c62afa5d09b88cc8fa7a21b..9c243a299e769f67c4e70859aae110651a3444cd 100644 (file)
@@ -2,8 +2,6 @@ import process from 'node:process'
 
 import chalk from 'chalk'
 
-import { logger } from './Logger.js'
-import { isNotEmptyString } from './Utils.js'
 import type { ChargingStation } from '../charging-station/index.js'
 import type {
   EmptyObject,
@@ -13,6 +11,8 @@ import type {
   JsonType,
   RequestCommand
 } from '../types/index.js'
+import { logger } from './Logger.js'
+import { isNotEmptyString } from './Utils.js'
 
 const defaultErrorParams = {
   throwError: true,
index bc8dd07c24725d990ae282056fc5ab8d4243b942..543a2b23c2eda50f157680f15377ee335ec697da 100644 (file)
@@ -1,9 +1,9 @@
-import { type FSWatcher, type WatchListener, readFileSync, watch } from 'node:fs'
+import { type FSWatcher, readFileSync, watch, type WatchListener } from 'node:fs'
 
+import type { FileType, JsonType } from '../types/index.js'
 import { handleFileException } from './ErrorUtils.js'
 import { logger } from './Logger.js'
 import { isNotEmptyString } from './Utils.js'
-import type { FileType, JsonType } from '../types/index.js'
 
 export const watchJsonFile = <T extends JsonType>(
   file: string,
index 7d80e1aece51349349abd0766f8af5ae2b196833..b13ec0477ab9314aca3859f264e62c40ae531929 100644 (file)
@@ -3,9 +3,9 @@ import { createLogger, format, type transport } from 'winston'
 import TransportType from 'winston/lib/winston/transports/index.js'
 import DailyRotateFile from 'winston-daily-rotate-file'
 
+import { ConfigurationSection, type LogConfiguration } from '../types/index.js'
 import { Configuration } from './Configuration.js'
 import { insertAt } from './Utils.js'
-import { ConfigurationSection, type LogConfiguration } from '../types/index.js'
 
 const logConfiguration = Configuration.getConfigurationSection<LogConfiguration>(
   ConfigurationSection.log
index 65dcc9a835c36fa4fcf1cb6307e0d1063957fb6f..0306d60edd743e037f02221e9587065074541265 100644 (file)
@@ -1,10 +1,3 @@
-import {
-  OutputFormat,
-  buildChargingStationAutomaticTransactionGeneratorConfiguration,
-  buildConnectorsStatus,
-  buildEvsesStatus
-} from './ChargingStationConfigurationUtils.js'
-import { clone } from './Utils.js'
 import type { ChargingStation } from '../charging-station/index.js'
 import {
   type ChargingStationData,
@@ -14,6 +7,13 @@ import {
   type Statistics,
   type TemplateStatistics
 } from '../types/index.js'
+import {
+  buildChargingStationAutomaticTransactionGeneratorConfiguration,
+  buildConnectorsStatus,
+  buildEvsesStatus,
+  OutputFormat
+} from './ChargingStationConfigurationUtils.js'
+import { clone } from './Utils.js'
 
 export const buildAddedMessage = (
   chargingStation: ChargingStation
index abfac5e4873c98af8a4afa225ed1568fa4c9cec8..c021cadb4864aef9912b95dde1b09f20842fc84a 100644 (file)
@@ -13,13 +13,13 @@ import {
   secondsToMilliseconds
 } from 'date-fns'
 
-import { Constants } from './Constants.js'
 import {
   type EmptyObject,
   type ProtocolResponse,
   type TimestampedData,
   WebSocketCloseEventStatusString
 } from '../types/index.js'
+import { Constants } from './Constants.js'
 
 export const logPrefix = (prefixString = ''): string => {
   return `${new Date().toLocaleString()}${prefixString}`
index 1bc4fe7e0d64d5b4a161b476194d56d863eaa3b6..81dc04d2b3b94979b3a64d36b549e3abcc54039a 100644 (file)
@@ -1,14 +1,14 @@
-export { ACElectricUtils, DCElectricUtils } from './ElectricUtils.js'
 export { AsyncLock, AsyncLockType } from './AsyncLock.js'
 export {
-  OutputFormat,
   buildChargingStationAutomaticTransactionGeneratorConfiguration,
   buildConnectorsStatus,
-  buildEvsesStatus
+  buildEvsesStatus,
+  OutputFormat
 } from './ChargingStationConfigurationUtils.js'
 export { CircularArray } from './CircularArray.js'
 export { Configuration } from './Configuration.js'
 export { Constants } from './Constants.js'
+export { ACElectricUtils, DCElectricUtils } from './ElectricUtils.js'
 export {
   handleFileException,
   handleSendMessageError,
@@ -17,6 +17,7 @@ export {
   setDefaultErrorParams
 } from './ErrorUtils.js'
 export { watchJsonFile } from './FileUtils.js'
+export { logger } from './Logger.js'
 export {
   buildAddedMessage,
   buildChargingStationDataPayload,
@@ -27,8 +28,8 @@ export {
   buildTemplateStatisticsPayload,
   buildUpdatedMessage
 } from './MessageChannelUtils.js'
+export { average, median, nthPercentile, stdDeviation } from './StatisticUtils.js'
 export {
-  JSONStringifyWithMapSupport,
   clone,
   convertToBoolean,
   convertToDate,
@@ -51,6 +52,7 @@ export {
   isNotEmptyArray,
   isNotEmptyString,
   isValidDate,
+  JSONStringifyWithMapSupport,
   logPrefix,
   max,
   min,
@@ -60,5 +62,3 @@ export {
   sleep,
   validateUUID
 } from './Utils.js'
-export { average, median, nthPercentile, stdDeviation } from './StatisticUtils.js'
-export { logger } from './Logger.js'