From 368a6eda4a2cb8f8f6daaf44fb029fa18bfdbff4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 12 Feb 2023 16:07:55 +0100 Subject: [PATCH] refactor(simulator): add control over the OCPP stack exports MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 22 ++++++++++--------- .../ChargingStationWorkerBroadcastChannel.ts | 2 +- src/charging-station/ocpp/index.ts | 11 ++++++++++ 3 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 src/charging-station/ocpp/index.ts diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 0118f3d1..c74daceb 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -15,16 +15,18 @@ import { ChargingStationConfigurationUtils } from './ChargingStationConfiguratio import { ChargingStationUtils } from './ChargingStationUtils'; import { ChargingStationWorkerBroadcastChannel } from './ChargingStationWorkerBroadcastChannel'; import { MessageChannelUtils } from './MessageChannelUtils'; -import { OCPP16IncomingRequestService } from './ocpp/1.6/OCPP16IncomingRequestService'; -import { OCPP16RequestService } from './ocpp/1.6/OCPP16RequestService'; -import { OCPP16ResponseService } from './ocpp/1.6/OCPP16ResponseService'; -import { OCPP16ServiceUtils } from './ocpp/1.6/OCPP16ServiceUtils'; -import { OCPP20IncomingRequestService } from './ocpp/2.0/OCPP20IncomingRequestService'; -import { OCPP20RequestService } from './ocpp/2.0/OCPP20RequestService'; -import { OCPP20ResponseService } from './ocpp/2.0/OCPP20ResponseService'; -import type { OCPPIncomingRequestService } from './ocpp/OCPPIncomingRequestService'; -import type { OCPPRequestService } from './ocpp/OCPPRequestService'; -import { OCPPServiceUtils } from './ocpp/OCPPServiceUtils'; +import { + OCPP16IncomingRequestService, + OCPP16RequestService, + OCPP16ResponseService, + OCPP16ServiceUtils, + OCPP20IncomingRequestService, + OCPP20RequestService, + OCPP20ResponseService, + type OCPPIncomingRequestService, + type OCPPRequestService, + OCPPServiceUtils, +} from './ocpp'; import { SharedLRUCache } from './SharedLRUCache'; import { BaseError, OCPPError } from '../exception'; import { PerformanceStatistics } from '../performance/PerformanceStatistics'; diff --git a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts index 6ffa0f14..1a2943a7 100644 --- a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts @@ -1,6 +1,6 @@ import type { ChargingStation } from './ChargingStation'; import { ChargingStationConfigurationUtils } from './ChargingStationConfigurationUtils'; -import { OCPP16ServiceUtils } from './ocpp/1.6/OCPP16ServiceUtils'; +import { OCPP16ServiceUtils } from './ocpp'; import { WorkerBroadcastChannel } from './WorkerBroadcastChannel'; import { BaseError, type OCPPError } from '../exception'; import { diff --git a/src/charging-station/ocpp/index.ts b/src/charging-station/ocpp/index.ts new file mode 100644 index 00000000..a0634d19 --- /dev/null +++ b/src/charging-station/ocpp/index.ts @@ -0,0 +1,11 @@ +export * from './OCPPIncomingRequestService'; +export * from './OCPPRequestService'; +export * from './OCPPServiceUtils'; +export * from './1.6/OCPP16IncomingRequestService'; +export * from './1.6/OCPP16RequestService'; +export * from './1.6/OCPP16ResponseService'; +// FIXME: shall not be exported +export * from './1.6/OCPP16ServiceUtils'; +export * from './2.0/OCPP20IncomingRequestService'; +export * from './2.0/OCPP20RequestService'; +export * from './2.0/OCPP20ResponseService'; -- 2.34.1