refactor: cleanup module name namespace
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 28 Jul 2023 23:31:22 +0000 (01:31 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 28 Jul 2023 23:31:22 +0000 (01:31 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/AutomaticTransactionGenerator.ts
src/charging-station/Bootstrap.ts
src/charging-station/ChargingStation.ts
src/charging-station/ConfigurationKeyUtils.ts [moved from src/charging-station/ChargingStationConfigurationKeyUtils.ts with 100% similarity]
src/charging-station/IdTagsCache.ts
src/charging-station/Utils.ts [moved from src/charging-station/ChargingStationUtils.ts with 99% similarity]
src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts
src/charging-station/index.ts

index f90662fc88cd3513568eca74fb3eda5059a5c9bb..5e11f36e4f95762bf408f6dcb16c0a63e5c5c028 100644 (file)
@@ -5,8 +5,8 @@ import { AsyncResource } from 'node:async_hooks';
 import { hoursToMilliseconds, secondsToMilliseconds } from 'date-fns';
 
 import type { ChargingStation } from './ChargingStation';
-import { checkChargingStation } from './ChargingStationUtils';
 import { IdTagsCache } from './IdTagsCache';
+import { checkChargingStation } from './Utils';
 import { BaseError } from '../exception';
 import { PerformanceStatistics } from '../performance';
 import {
index 16a590a9a493193c9dd7d4ede7789b6f4c8a2cfa..76b2c2999d00318960199be014bfab9a49b60150 100644 (file)
@@ -8,9 +8,9 @@ import { isMainThread } from 'node:worker_threads';
 import chalk from 'chalk';
 import { availableParallelism } from 'poolifier';
 
-import { waitChargingStationEvents } from './ChargingStationUtils';
 import type { AbstractUIServer } from './ui-server/AbstractUIServer';
 import { UIServerFactory } from './ui-server/UIServerFactory';
+import { waitChargingStationEvents } from './Utils';
 import { version } from '../../package.json' assert { type: 'json' };
 import { BaseError } from '../exception';
 import { type Storage, StorageFactory } from '../performance';
index f1dac8a3a97ab54f0ff6a1042a879570044d96e3..aad6a5370617841e4f7480e2c90bd9daebd52e9c 100644 (file)
@@ -25,7 +25,21 @@ import {
   deleteConfigurationKey,
   getConfigurationKey,
   setConfigurationKeyValue,
-} from './ChargingStationConfigurationKeyUtils';
+} from './ConfigurationKeyUtils';
+import { IdTagsCache } from './IdTagsCache';
+import {
+  OCPP16IncomingRequestService,
+  OCPP16RequestService,
+  OCPP16ResponseService,
+  OCPP16ServiceUtils,
+  OCPP20IncomingRequestService,
+  OCPP20RequestService,
+  OCPP20ResponseService,
+  type OCPPIncomingRequestService,
+  type OCPPRequestService,
+  OCPPServiceUtils,
+} from './ocpp';
+import { SharedLRUCache } from './SharedLRUCache';
 import {
   buildConnectorsMap,
   checkConnectorsConfiguration,
@@ -48,21 +62,7 @@ import {
   propagateSerialNumber,
   stationTemplateToStationInfo,
   warnTemplateKeysDeprecation,
-} from './ChargingStationUtils';
-import { IdTagsCache } from './IdTagsCache';
-import {
-  OCPP16IncomingRequestService,
-  OCPP16RequestService,
-  OCPP16ResponseService,
-  OCPP16ServiceUtils,
-  OCPP20IncomingRequestService,
-  OCPP20RequestService,
-  OCPP20ResponseService,
-  type OCPPIncomingRequestService,
-  type OCPPRequestService,
-  OCPPServiceUtils,
-} from './ocpp';
-import { SharedLRUCache } from './SharedLRUCache';
+} from './Utils';
 import { BaseError, OCPPError } from '../exception';
 import { PerformanceStatistics } from '../performance';
 import {
index 86214393d15ed94c649b947a5e3cd2f69542cc46..e88a3a5d0e6564a27b88b8a6c36dacb3a970d152 100644 (file)
@@ -1,7 +1,7 @@
 import { type FSWatcher, readFileSync } from 'node:fs';
 
 import type { ChargingStation } from './ChargingStation';
-import { getIdTagsFile } from './ChargingStationUtils';
+import { getIdTagsFile } from './Utils';
 import { FileType, IdTagDistribution } from '../types';
 import {
   handleFileException,
similarity index 99%
rename from src/charging-station/ChargingStationUtils.ts
rename to src/charging-station/Utils.ts
index d7da3dc8b36aa95cbc6faaab89fddc09ece0f15e..fa60c9a5fe6984f76a58228956b629a107366df3 100644 (file)
@@ -19,7 +19,7 @@ import {
 } from 'date-fns';
 
 import type { ChargingStation } from './ChargingStation';
-import { getConfigurationKey } from './ChargingStationConfigurationKeyUtils';
+import { getConfigurationKey } from './ConfigurationKeyUtils';
 import { BaseError } from '../exception';
 import {
   AmpereUnits,
@@ -65,7 +65,7 @@ import {
   secureRandom,
 } from '../utils';
 
-const moduleName = 'ChargingStationUtils';
+const moduleName = 'Utils';
 
 export const getChargingStationId = (
   index: number,
index f591bfbe86d0607bc96b9956a60f6321331e96d1..83684c647f8cfb9d11689fc16fd472b6ddd6886f 100644 (file)
@@ -39,7 +39,7 @@ import {
 } from '../../types';
 import { Constants, convertToInt, isEmptyObject, isNullOrUndefined, logger } from '../../utils';
 import type { ChargingStation } from '../ChargingStation';
-import { getConfigurationKey } from '../ChargingStationConfigurationKeyUtils';
+import { getConfigurationKey } from '../ConfigurationKeyUtils';
 import { OCPP16ServiceUtils } from '../ocpp';
 
 const moduleName = 'ChargingStationWorkerBroadcastChannel';
index d377e7e8461ff4e4a6bd1970c3819b6cb5285668..32417cb24557994c091b69dfd3ce0cf045361712 100644 (file)
@@ -4,10 +4,10 @@ export {
   addConfigurationKey,
   getConfigurationKey,
   setConfigurationKeyValue,
-} from './ChargingStationConfigurationKeyUtils';
+} from './ConfigurationKeyUtils';
 export {
   getIdTagsFile,
   checkChargingStation,
   resetConnectorStatus,
   hasFeatureProfile,
-} from './ChargingStationUtils';
+} from './Utils';