refactor: revert internal exports
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 19 May 2023 20:14:39 +0000 (22:14 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 19 May 2023 20:14:39 +0000 (22:14 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
37 files changed:
src/charging-station/index.ts
src/start.ts
src/types/ChargingStationConfiguration.ts
src/types/ChargingStationInfo.ts
src/types/ChargingStationOcppConfiguration.ts
src/types/ChargingStationTemplate.ts
src/types/ChargingStationWorker.ts
src/types/ConfigurationData.ts
src/types/ConnectorStatus.ts
src/types/Evse.ts
src/types/MeasurandPerPhaseSampledValueTemplates.ts
src/types/Statistics.ts
src/types/UIProtocol.ts
src/types/WorkerBroadcastChannel.ts
src/types/index.ts
src/types/internal.ts [deleted file]
src/types/ocpp/1.6/ChargingProfile.ts
src/types/ocpp/1.6/MeterValues.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/Common.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/ChargePointErrorCode.ts
src/types/ocpp/ChargingProfile.ts
src/types/ocpp/Configuration.ts
src/types/ocpp/ConnectorStatusEnum.ts
src/types/ocpp/MeterValues.ts
src/types/ocpp/Requests.ts
src/types/ocpp/Responses.ts
src/types/ocpp/Transaction.ts
src/types/orm/entities/PerformanceData.ts
src/types/orm/entities/PerformanceRecord.ts
src/utils/Configuration.ts
src/utils/FileUtils.ts

index db87a0d9c6968106013729f2a0b34e0fdbd3e264..ca33e9f471ceae1412e2fec60b909e62f2b80c81 100644 (file)
@@ -1,4 +1,3 @@
-export { Bootstrap } from './Bootstrap';
 export type { ChargingStation } from './ChargingStation';
 export { ChargingStationConfigurationUtils } from './ChargingStationConfigurationUtils';
 export { ChargingStationUtils } from './ChargingStationUtils';
index ee4d336ecd7436ea37dc61f0019db9fb4fa2d175..23697acad13177b20f2247a6c2591767d755bcfe 100644 (file)
@@ -2,7 +2,6 @@
 
 import chalk from 'chalk';
 
-// import { Bootstrap } from './charging-station';
 import { Bootstrap } from './charging-station/Bootstrap';
 
 Bootstrap.getInstance()
index 9f0d3423343c30521ffee5d963053760c080ddab..ff855650d029f63a9d93cc353fd6c9929f3a3d5c 100644 (file)
@@ -1,10 +1,8 @@
-import type {
-  ChargingStationAutomaticTransactionGeneratorConfiguration,
-  ChargingStationInfoConfiguration,
-  ChargingStationOcppConfiguration,
-  ConnectorStatus,
-  EvseStatus,
-} from './internal';
+import type { ChargingStationAutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator';
+import type { ChargingStationInfoConfiguration } from './ChargingStationInfo';
+import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration';
+import type { ConnectorStatus } from './ConnectorStatus';
+import type { EvseStatus } from './Evse';
 
 type ConnectorsConfiguration = {
   connectorsStatus?: ConnectorStatus[];
index e56db70980ea14a71a3af7c224f9119848f50a7e..fff8a1ad69e6805034807c9df1052bf4b560cf43 100644 (file)
@@ -1,4 +1,5 @@
-import type { ChargingStationTemplate, FirmwareStatus } from './internal';
+import type { ChargingStationTemplate } from './ChargingStationTemplate';
+import type { FirmwareStatus } from './ocpp/Requests';
 
 enum x509CertificateType {
   V2GRootCertificate = 'V2GRootCertificate',
index bbd1bcfb20fa6354ed1a6b27e42be227eec6eefc..834b1d1dd11e4031eba25d7af689f88eab3b3639 100644 (file)
@@ -1,4 +1,4 @@
-import type { OCPPConfigurationKey } from './internal';
+import type { OCPPConfigurationKey } from './ocpp/Configuration';
 
 export type ConfigurationKey = OCPPConfigurationKey & {
   visible?: boolean;
index 23644c7faa86d146867df651a2717a1ba57d9367..e3594d02200701ce1502659300e265a8d07278fc 100644 (file)
@@ -2,18 +2,18 @@ import type { ClientRequestArgs } from 'node:http';
 
 import type { ClientOptions } from 'ws';
 
+import type { AutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator';
+import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration';
+import type { ConnectorStatus } from './ConnectorStatus';
+import type { EvseTemplate } from './Evse';
+import type { OCPPProtocol } from './ocpp/OCPPProtocol';
+import type { OCPPVersion } from './ocpp/OCPPVersion';
 import type {
-  AutomaticTransactionGeneratorConfiguration,
-  ChargingStationOcppConfiguration,
-  ConnectorStatus,
-  EvseTemplate,
   FirmwareStatus,
   IncomingRequestCommand,
   MessageTrigger,
-  OCPPProtocol,
-  OCPPVersion,
   RequestCommand,
-} from './internal';
+} from './ocpp/Requests';
 
 export enum CurrentType {
   AC = 'AC',
index 3164414ae59a5b558a8a70693f8dc3f879510a02..41ca7aacc870a38e11f6552deed1c446d82b223d 100644 (file)
@@ -1,15 +1,13 @@
 import type { WebSocket } from 'ws';
 
-import type {
-  BootNotificationResponse,
-  ChargingStationAutomaticTransactionGeneratorConfiguration,
-  ChargingStationInfo,
-  ChargingStationOcppConfiguration,
-  ConnectorStatus,
-  EvseStatus,
-  JsonObject,
-  Statistics,
-} from './internal';
+import type { ChargingStationAutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator';
+import type { ChargingStationInfo } from './ChargingStationInfo';
+import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration';
+import type { ConnectorStatus } from './ConnectorStatus';
+import type { EvseStatus } from './Evse';
+import type { JsonObject } from './JsonType';
+import type { BootNotificationResponse } from './ocpp/Responses';
+import type { Statistics } from './Statistics';
 import { type WorkerData, type WorkerMessage, WorkerMessageEvents } from '../worker';
 
 interface ChargingStationWorkerOptions extends JsonObject {
index 5a6853d22fd1853f714df96b06ad270d57d58c04..276feabd0d8701191008289ac135bd9dc4658665 100644 (file)
@@ -2,7 +2,8 @@ import type { ListenOptions } from 'node:net';
 
 import type { WorkerChoiceStrategy } from 'poolifier';
 
-import type { ApplicationProtocol, AuthenticationType, StorageType } from './internal';
+import type { StorageType } from './Storage';
+import type { ApplicationProtocol, AuthenticationType } from './UIProtocol';
 import type { WorkerProcessType } from '../worker';
 
 type ServerOptions = ListenOptions;
index 02ee914e8759557f942cf2e671df737064674be0..d7698107b9cc2146677db9624f66ae174d8c9dd8 100644 (file)
@@ -1,10 +1,8 @@
-import type {
-  AvailabilityType,
-  ChargingProfile,
-  ConnectorStatusEnum,
-  MeterValue,
-  SampledValueTemplate,
-} from './internal';
+import type { SampledValueTemplate } from './MeasurandPerPhaseSampledValueTemplates';
+import type { ChargingProfile } from './ocpp/ChargingProfile';
+import type { ConnectorStatusEnum } from './ocpp/ConnectorStatusEnum';
+import type { MeterValue } from './ocpp/MeterValues';
+import type { AvailabilityType } from './ocpp/Requests';
 
 export type ConnectorStatus = {
   availability: AvailabilityType;
index 275969baace96ac85d9d5b754d118251e4e416c1..4b200c20cef923f9d91ee2e3a709b0b0477de521 100644 (file)
@@ -1,4 +1,5 @@
-import type { AvailabilityType, ConnectorStatus } from './internal';
+import type { ConnectorStatus } from './ConnectorStatus';
+import type { AvailabilityType } from './ocpp/Requests';
 
 export type EvseTemplate = {
   Connectors: Record<string, ConnectorStatus>;
index 8f69e41cdf847167462360a4c9e09d3799544314..73df20be9f1a8bf27dd1091aeb76a615fadbda0f 100644 (file)
@@ -1,4 +1,4 @@
-import type { SampledValue } from './internal';
+import type { SampledValue } from './ocpp/MeterValues';
 
 export type SampledValueTemplate = SampledValue & {
   fluctuationPercent?: number;
index 5f22cdafd7347c774a9b3472fdaa1b7bb724089f..59d13108d08e9425fc474e0aa4fd9b87c289e02f 100644 (file)
@@ -1,4 +1,4 @@
-import type { IncomingRequestCommand, RequestCommand } from './internal';
+import type { IncomingRequestCommand, RequestCommand } from './ocpp/Requests';
 import type { CircularArray } from '../utils';
 import type { WorkerData } from '../worker';
 
index e7635b2e59167f3a3b48b51e9c2eed944700ff1b..52b91b972d14b06c1fa6ab711dd9b4e5b19226bf 100644 (file)
@@ -1,4 +1,5 @@
-import type { BroadcastChannelResponsePayload, JsonObject } from './internal';
+import type { JsonObject } from './JsonType';
+import type { BroadcastChannelResponsePayload } from './WorkerBroadcastChannel';
 
 export enum Protocol {
   UI = 'ui',
index a7a2e1fadf284527ad33d1fa57b8534fb54ffb66..d2afcb90944cad1ace9ba05a12e32ad03835eb1b 100644 (file)
@@ -1,4 +1,4 @@
-import type { RequestPayload, ResponsePayload } from './internal';
+import type { RequestPayload, ResponsePayload } from './UIProtocol';
 
 export type BroadcastChannelRequest = [
   string,
index 0b54ba11ea0ccd54823608eb3f089d19c9251c36..27ffb6d75014fea6a182fc509e713cc4b0c5da54 100644 (file)
 export {
-  AmpereUnits,
   ApplicationProtocol,
   AuthenticationType,
-  AuthorizationStatus,
-  type AuthorizeRequest,
-  type AuthorizeResponse,
+  ProcedureName,
+  Protocol,
+  type ProtocolRequest,
+  type ProtocolRequestHandler,
+  type ProtocolResponse,
+  ProtocolVersion,
+  type RequestPayload,
+  type ResponsePayload,
+  ResponseStatus,
+} from './UIProtocol';
+export {
   type AutomaticTransactionGeneratorConfiguration,
-  AvailabilityStatus,
+  type ChargingStationAutomaticTransactionGeneratorConfiguration,
+  IdTagDistribution,
+  type Status,
+} from './AutomaticTransactionGenerator';
+export {
   AvailabilityType,
   type BootNotificationRequest,
-  type BootNotificationResponse,
-  BootReasonEnumType,
-  BroadcastChannelProcedureName,
-  type BroadcastChannelRequest,
-  type BroadcastChannelRequestPayload,
-  type BroadcastChannelResponse,
-  type BroadcastChannelResponsePayload,
   type CachedRequest,
-  type ChangeAvailabilityRequest,
-  type ChangeAvailabilityResponse,
-  type ChangeConfigurationRequest,
-  type ChangeConfigurationResponse,
-  ChargePointErrorCode,
-  type ChargingProfile,
-  ChargingProfileKindType,
-  ChargingProfileStatus,
-  ChargingRateUnitType,
-  type ChargingSchedulePeriod,
-  type ChargingStationAutomaticTransactionGeneratorConfiguration,
-  type ChargingStationConfiguration,
-  type ChargingStationData,
-  type ChargingStationInfo,
-  type ChargingStationOcppConfiguration,
-  type ChargingStationTemplate,
-  type ChargingStationWorkerData,
-  type ChargingStationWorkerMessage,
-  type ChargingStationWorkerMessageData,
-  ChargingStationWorkerMessageEvents,
-  type ClearCacheResponse,
-  type ClearChargingProfileRequest,
-  type ClearChargingProfileResponse,
-  ClearChargingProfileStatus,
-  type ConfigurationData,
-  type ConfigurationKey,
-  type ConfigurationKeyType,
-  ConfigurationStatus,
-  ConnectorPhaseRotation,
-  type ConnectorStatus,
-  ConnectorStatusEnum,
-  type ConnectorStatusTransition,
-  CurrentType,
-  DBName,
   type DataTransferRequest,
-  type DataTransferResponse,
-  DataTransferStatus,
   type DiagnosticsStatusNotificationRequest,
-  type DiagnosticsStatusNotificationResponse,
-  type EmptyObject,
   type ErrorCallback,
-  type ErrorResponse,
-  ErrorType,
-  type EvseStatus,
-  type EvseStatusConfiguration,
-  type EvseTemplate,
-  FileType,
   FirmwareStatus,
   type FirmwareStatusNotificationRequest,
-  type FirmwareStatusNotificationResponse,
-  type FirmwareUpgrade,
-  type GenericResponse,
-  GenericStatus,
-  type GetConfigurationRequest,
-  type GetConfigurationResponse,
-  type GetDiagnosticsRequest,
-  type GetDiagnosticsResponse,
-  type HandleErrorParams,
   type HeartbeatRequest,
-  type HeartbeatResponse,
-  IdTagDistribution,
   type IncomingRequest,
   IncomingRequestCommand,
   type IncomingRequestHandler,
-  type JsonObject,
-  type JsonType,
-  type MeasurandPerPhaseSampledValueTemplates,
-  type MeasurandValues,
-  type MessageEvent,
   MessageTrigger,
-  MessageType,
-  type MeterValue,
-  MeterValueContext,
-  MeterValueLocation,
-  MeterValueMeasurand,
-  type MeterValuePhase,
-  MeterValueUnit,
   type MeterValuesRequest,
+  type OutgoingRequest,
+  RequestCommand,
+  type RequestParams,
+  type ResponseCallback,
+  type ResponseType,
+  type StatusNotificationRequest,
+} from './ocpp/Requests';
+export {
+  AvailabilityStatus,
+  type BootNotificationResponse,
+  ChargingProfileStatus,
+  ClearChargingProfileStatus,
+  type ClearCacheResponse,
+  ConfigurationStatus,
+  DataTransferStatus,
+  type DataTransferResponse,
+  type DiagnosticsStatusNotificationResponse,
+  type ErrorResponse,
+  type FirmwareStatusNotificationResponse,
+  GenericStatus,
+  type GenericResponse,
+  type HeartbeatResponse,
   type MeterValuesResponse,
-  type MikroOrmDbType,
-  OCPP16AuthorizationStatus,
-  type OCPP16AuthorizeRequest,
-  type OCPP16AuthorizeResponse,
+  RegistrationStatusEnumType,
+  type Response,
+  type ResponseHandler,
+  type StatusNotificationResponse,
+  TriggerMessageStatus,
+  UnlockStatus,
+} from './ocpp/Responses';
+export {
+  AuthorizationStatus,
+  type AuthorizeRequest,
+  type AuthorizeResponse,
+  type StartTransactionRequest,
+  type StartTransactionResponse,
+  StopTransactionReason,
+  type StopTransactionRequest,
+  type StopTransactionResponse,
+} from './ocpp/Transaction';
+export { BootReasonEnumType, OCPP20ConnectorStatusEnumType } from './ocpp/2.0/Common';
+export {
+  BroadcastChannelProcedureName,
+  type BroadcastChannelRequest,
+  type BroadcastChannelRequestPayload,
+  type BroadcastChannelResponse,
+  type BroadcastChannelResponsePayload,
+  type MessageEvent,
+} from './WorkerBroadcastChannel';
+export {
+  type ChangeAvailabilityRequest,
+  type ChangeConfigurationRequest,
+  type ClearChargingProfileRequest,
+  type GetConfigurationRequest,
+  type GetDiagnosticsRequest,
   OCPP16AvailabilityType,
   type OCPP16BootNotificationRequest,
-  type OCPP16BootNotificationResponse,
-  OCPP16ChargePointErrorCode,
-  OCPP16ChargePointStatus,
-  type OCPP16ChargingProfile,
-  OCPP16ChargingProfilePurposeType,
-  type OCPP16ChargingSchedule,
   type OCPP16ClearCacheRequest,
   type OCPP16DataTransferRequest,
-  type OCPP16DataTransferResponse,
-  OCPP16DataTransferStatus,
   OCPP16DataTransferVendorId,
-  OCPP16DiagnosticsStatus,
   type OCPP16DiagnosticsStatusNotificationRequest,
-  type OCPP16DiagnosticsStatusNotificationResponse,
   OCPP16FirmwareStatus,
   type OCPP16FirmwareStatusNotificationRequest,
-  type OCPP16FirmwareStatusNotificationResponse,
   type OCPP16GetCompositeScheduleRequest,
-  type OCPP16GetCompositeScheduleResponse,
   type OCPP16HeartbeatRequest,
-  type OCPP16HeartbeatResponse,
   OCPP16IncomingRequestCommand,
   OCPP16MessageTrigger,
+  OCPP16RequestCommand,
+  type OCPP16StatusNotificationRequest,
+  type OCPP16TriggerMessageRequest,
+  type OCPP16UpdateFirmwareRequest,
+  type RemoteStartTransactionRequest,
+  type RemoteStopTransactionRequest,
+  type ResetRequest,
+  type SetChargingProfileRequest,
+  type UnlockConnectorRequest,
+} from './ocpp/1.6/Requests';
+export {
+  type ChangeAvailabilityResponse,
+  type ChangeConfigurationResponse,
+  type ClearChargingProfileResponse,
+  type GetConfigurationResponse,
+  type GetDiagnosticsResponse,
+  type OCPP16BootNotificationResponse,
+  type OCPP16DataTransferResponse,
+  OCPP16DataTransferStatus,
+  type OCPP16DiagnosticsStatusNotificationResponse,
+  type OCPP16FirmwareStatusNotificationResponse,
+  type OCPP16GetCompositeScheduleResponse,
+  type OCPP16HeartbeatResponse,
+  type OCPP16StatusNotificationResponse,
+  type OCPP16TriggerMessageResponse,
+  type OCPP16UpdateFirmwareResponse,
+  type SetChargingProfileResponse,
+  type UnlockConnectorResponse,
+} from './ocpp/1.6/Responses';
+export { ChargePointErrorCode } from './ocpp/ChargePointErrorCode';
+export {
+  type ChargingProfile,
+  ChargingProfileKindType,
+  ChargingRateUnitType,
+  type ChargingSchedulePeriod,
+  RecurrencyKindType,
+} from './ocpp/ChargingProfile';
+export type {
+  ChargingStationConfiguration,
+  EvseStatusConfiguration,
+} from './ChargingStationConfiguration';
+export {
+  type ChargingStationData,
+  type ChargingStationWorkerData,
+  type ChargingStationWorkerMessage,
+  type ChargingStationWorkerMessageData,
+  ChargingStationWorkerMessageEvents,
+} from './ChargingStationWorker';
+export type { ChargingStationInfo } from './ChargingStationInfo';
+export type {
+  ChargingStationOcppConfiguration,
+  ConfigurationKey,
+} from './ChargingStationOcppConfiguration';
+export {
+  AmpereUnits,
+  type ChargingStationTemplate,
+  CurrentType,
+  type FirmwareUpgrade,
+  PowerUnits,
+  Voltage,
+  type WsOptions,
+} from './ChargingStationTemplate';
+export {
+  type ConfigurationData,
+  type StationTemplateUrl,
+  type StorageConfiguration,
+  SupervisionUrlDistribution,
+  type UIServerConfiguration,
+  type WorkerConfiguration,
+} from './ConfigurationData';
+export {
+  type ConfigurationKeyType,
+  ConnectorPhaseRotation,
+  type OCPPConfigurationKey,
+  StandardParametersKey,
+  SupportedFeatureProfiles,
+  VendorParametersKey,
+} from './ocpp/Configuration';
+export type { ConnectorStatus } from './ConnectorStatus';
+export { ConnectorStatusEnum, type ConnectorStatusTransition } from './ocpp/ConnectorStatusEnum';
+export { DBName, type MikroOrmDbType, StorageType } from './Storage';
+export type { EmptyObject } from './EmptyObject';
+export { ErrorType } from './ocpp/ErrorType';
+export type { EvseTemplate, EvseStatus } from './Evse';
+export { FileType } from './FileType';
+export type { HandleErrorParams } from './Error';
+export type { JsonObject, JsonType } from './JsonType';
+export type {
+  MeasurandPerPhaseSampledValueTemplates,
+  SampledValueTemplate,
+} from './MeasurandPerPhaseSampledValueTemplates';
+export type { MeasurandValues } from './MeasurandValues';
+export { MessageType } from './ocpp/MessageType';
+export { type MeterValue, MeterValueMeasurand, MeterValuePhase } from './ocpp/MeterValues';
+export {
+  MeterValueContext,
+  MeterValueLocation,
+  MeterValueUnit,
   type OCPP16MeterValue,
   OCPP16MeterValueMeasurand,
   OCPP16MeterValuePhase,
   type OCPP16MeterValuesRequest,
   type OCPP16MeterValuesResponse,
-  OCPP16RequestCommand,
   type OCPP16SampledValue,
-  OCPP16StandardParametersKey,
+} from './ocpp/1.6/MeterValues';
+export {
+  OCPP16AuthorizationStatus,
+  type OCPP16AuthorizeRequest,
+  type OCPP16AuthorizeResponse,
   type OCPP16StartTransactionRequest,
   type OCPP16StartTransactionResponse,
-  type OCPP16StatusNotificationRequest,
-  type OCPP16StatusNotificationResponse,
   OCPP16StopTransactionReason,
   type OCPP16StopTransactionRequest,
   type OCPP16StopTransactionResponse,
+} from './ocpp/1.6/Transaction';
+export { OCPP16ChargePointErrorCode } from './ocpp/1.6/ChargePointErrorCode';
+export { OCPP16ChargePointStatus } from './ocpp/1.6/ChargePointStatus';
+export {
+  type OCPP16ChargingProfile,
+  OCPP16ChargingProfilePurposeType,
+  type OCPP16ChargingSchedule,
+} from './ocpp/1.6/ChargingProfile';
+export {
+  OCPP16StandardParametersKey,
   OCPP16SupportedFeatureProfiles,
-  type OCPP16TriggerMessageRequest,
-  type OCPP16TriggerMessageResponse,
-  type OCPP16UpdateFirmwareRequest,
-  type OCPP16UpdateFirmwareResponse,
+} from './ocpp/1.6/Configuration';
+export { OCPP16DiagnosticsStatus } from './ocpp/1.6/DiagnosticsStatus';
+export {
   type OCPP20BootNotificationRequest,
-  type OCPP20BootNotificationResponse,
   type OCPP20ClearCacheRequest,
-  type OCPP20ClearCacheResponse,
-  OCPP20ConnectorStatusEnumType,
   type OCPP20HeartbeatRequest,
-  type OCPP20HeartbeatResponse,
   OCPP20IncomingRequestCommand,
-  OCPP20OptionalVariableName,
   OCPP20RequestCommand,
   type OCPP20StatusNotificationRequest,
-  type OCPP20StatusNotificationResponse,
-  type OCPPConfigurationKey,
-  OCPPVersion,
-  type OutgoingRequest,
-  PerformanceData,
-  PerformanceRecord,
-  PowerUnits,
-  ProcedureName,
-  Protocol,
-  type ProtocolRequest,
-  type ProtocolRequestHandler,
-  type ProtocolResponse,
-  ProtocolVersion,
-  RecurrencyKindType,
-  RegistrationStatusEnumType,
-  type RemoteStartTransactionRequest,
-  type RemoteStopTransactionRequest,
-  RequestCommand,
-  type RequestParams,
-  type RequestPayload,
-  type ResetRequest,
-  type Response,
-  type ResponseCallback,
-  type ResponseHandler,
-  type ResponsePayload,
-  ResponseStatus,
-  type ResponseType,
-  type SampledValueTemplate,
-  type SetChargingProfileRequest,
-  type SetChargingProfileResponse,
-  StandardParametersKey,
-  type StartTransactionRequest,
-  type StartTransactionResponse,
-  type StationTemplateUrl,
-  type Statistics,
-  type Status,
-  type StatusNotificationRequest,
-  type StatusNotificationResponse,
-  StopTransactionReason,
-  type StopTransactionRequest,
-  type StopTransactionResponse,
-  type StorageConfiguration,
-  StorageType,
-  SupervisionUrlDistribution,
-  SupportedFeatureProfiles,
-  type TimeSeries,
-  TriggerMessageStatus,
-  type UIServerConfiguration,
-  type UnlockConnectorRequest,
-  type UnlockConnectorResponse,
-  UnlockStatus,
-  VendorParametersKey,
-  Voltage,
+} from './ocpp/2.0/Requests';
+export type {
+  OCPP20BootNotificationResponse,
+  OCPP20ClearCacheResponse,
+  OCPP20HeartbeatResponse,
+  OCPP20StatusNotificationResponse,
+} from './ocpp/2.0/Responses';
+export { OCPP20OptionalVariableName } from './ocpp/2.0/Variables';
+export { OCPPVersion } from './ocpp/OCPPVersion';
+export { PerformanceData } from './orm/entities/PerformanceData';
+export { PerformanceRecord } from './orm/entities/PerformanceRecord';
+export type { Statistics, TimeSeries } from './Statistics';
+export {
   type WSError,
   WebSocketCloseEventStatusCode,
   WebSocketCloseEventStatusString,
-  type WorkerConfiguration,
-  type WsOptions,
-} from './internal';
+} from './WebSocket';
diff --git a/src/types/internal.ts b/src/types/internal.ts
deleted file mode 100644 (file)
index 86151c8..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-export { OCPP16ChargePointErrorCode } from './ocpp/1.6/ChargePointErrorCode';
-export { OCPP16ChargePointStatus } from './ocpp/1.6/ChargePointStatus';
-export * from './ocpp/1.6/ChargingProfile';
-export * from './ocpp/1.6/Configuration';
-export { OCPP16DiagnosticsStatus } from './ocpp/1.6/DiagnosticsStatus';
-export * from './ocpp/1.6/MeterValues';
-export * from './ocpp/1.6/Requests';
-export * from './ocpp/1.6/Responses';
-export * from './ocpp/1.6/Transaction';
-export * from './ocpp/2.0/Common';
-export * from './ocpp/2.0/Requests';
-export * from './ocpp/2.0/Responses';
-export * from './ocpp/2.0/Variables';
-export * from './ocpp/ChargePointErrorCode';
-export * from './ocpp/ChargingProfile';
-export * from './ocpp/Configuration';
-export * from './ocpp/ConnectorStatusEnum';
-export { ErrorType } from './ocpp/ErrorType';
-export { MessageType } from './ocpp/MessageType';
-export * from './ocpp/MeterValues';
-export { OCPPProtocol } from './ocpp/OCPPProtocol';
-export { OCPPVersion } from './ocpp/OCPPVersion';
-export * from './ocpp/Requests';
-export * from './ocpp/Responses';
-export * from './ocpp/Transaction';
-export * from './orm/entities/PerformanceData';
-export * from './orm/entities/PerformanceRecord';
-export {
-  type AutomaticTransactionGeneratorConfiguration,
-  type ChargingStationAutomaticTransactionGeneratorConfiguration,
-  IdTagDistribution,
-  type Status,
-} from './AutomaticTransactionGenerator';
-export * from './ChargingStationConfiguration';
-export type { ChargingStationInfo, ChargingStationInfoConfiguration } from './ChargingStationInfo';
-export * from './ChargingStationOcppConfiguration';
-export * from './ChargingStationTemplate';
-export * from './ChargingStationWorker';
-export * from './ConfigurationData';
-export type { EvseTemplate, EvseStatus } from './Evse';
-export type { ConnectorStatus } from './ConnectorStatus';
-export type { EmptyObject } from './EmptyObject';
-export type { HandleErrorParams } from './Error';
-export { FileType } from './FileType';
-export type { JsonObject, JsonType } from './JsonType';
-export * from './MeasurandPerPhaseSampledValueTemplates';
-export type { MeasurandValues } from './MeasurandValues';
-export * from './Statistics';
-export * from './Storage';
-export * from './UIProtocol';
-export {
-  type WSError,
-  WebSocketCloseEventStatusCode,
-  WebSocketCloseEventStatusString,
-} from './WebSocket';
-export * from './WorkerBroadcastChannel';
index 67e12f970056a011b1671d4085bb3eec6c7e5164..b2909699d4856b90d93f7dce98a88012061a9802 100644 (file)
@@ -1,4 +1,4 @@
-import type { JsonObject } from '../../internal';
+import type { JsonObject } from '../../JsonType';
 
 export interface OCPP16ChargingProfile extends JsonObject {
   chargingProfileId: number;
index 5a59230c15f08615608c3e5f7d840f4895873aba..74698284e2c6d2a6d70fd5af2345d9fff16fe96b 100644 (file)
@@ -1,4 +1,5 @@
-import type { EmptyObject, JsonObject } from '../../internal';
+import type { EmptyObject } from '../../EmptyObject';
+import type { JsonObject } from '../../JsonType';
 
 export enum MeterValueUnit {
   WATT_HOUR = 'Wh',
index 73401d35ca1ee6573b3c993b17b419c9f36db551..60c1787fefe5e06972a72dfcd5ba730e013f3350 100644 (file)
@@ -1,15 +1,14 @@
+import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
+import type { OCPP16ChargePointStatus } from './ChargePointStatus';
 import type {
-  EmptyObject,
-  JsonObject,
-  OCPP16ChargePointErrorCode,
-  OCPP16ChargePointStatus,
   OCPP16ChargingProfile,
   OCPP16ChargingProfilePurposeType,
   OCPP16ChargingRateUnitType,
-  OCPP16DiagnosticsStatus,
-  OCPP16StandardParametersKey,
-  OCPP16VendorParametersKey,
-} from '../../internal';
+} from './ChargingProfile';
+import type { OCPP16StandardParametersKey, OCPP16VendorParametersKey } from './Configuration';
+import type { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
+import type { EmptyObject } from '../../EmptyObject';
+import type { JsonObject } from '../../JsonType';
 
 export enum OCPP16RequestCommand {
   BOOT_NOTIFICATION = 'BootNotification',
index e7814c4f178caec976040c3d6e9372c155cf1729..a6683caa87962b9050f6ef9fa1d4e7b8a3b48f2c 100644 (file)
@@ -1,11 +1,8 @@
-import type {
-  EmptyObject,
-  GenericStatus,
-  JsonObject,
-  OCPP16ChargingSchedule,
-  OCPPConfigurationKey,
-  RegistrationStatusEnumType,
-} from '../../internal';
+import type { OCPP16ChargingSchedule } from './ChargingProfile';
+import type { EmptyObject } from '../../EmptyObject';
+import type { JsonObject } from '../../JsonType';
+import type { OCPPConfigurationKey } from '../Configuration';
+import type { GenericStatus, RegistrationStatusEnumType } from '../Responses';
 
 export interface OCPP16HeartbeatResponse extends JsonObject {
   currentTime: Date;
index 215628f79a650aeaf7069aeb4d2a971f79efe7cf..4af42747ede0040b50fffa78410a943d4909b4b2 100644 (file)
@@ -1,4 +1,5 @@
-import type { JsonObject, OCPP16MeterValue } from '../../internal';
+import type { OCPP16MeterValue } from './MeterValues';
+import type { JsonObject } from '../../JsonType';
 
 export enum OCPP16StopTransactionReason {
   NONE = '',
index c73c19e3660029ec2e4f39e07bf2dcb171ca38c6..511cce005f191b147d2f7b39f14c3ec45c988896 100644 (file)
@@ -1,4 +1,5 @@
-import type { GenericStatus, JsonObject } from '../../internal';
+import type { JsonObject } from '../../JsonType';
+import type { GenericStatus } from '../Responses';
 
 export enum DataEnumType {
   // eslint-disable-next-line id-blacklist
@@ -93,7 +94,7 @@ export enum CertificateSigningUseEnumType {
   V2GCertificate = 'V2GCertificate',
 }
 
-export type CertificateSignedStatusEnumType = GenericStatus;
+export type CertificateSignedStatusEnumType = GenericStatusEnumType;
 
 export type CertificateHashDataType = {
   hashAlgorithm: HashAlgorithmEnumType;
index d584c8289ad88db7e3d79ad56b95610062b15f99..1b99c2727fb86928055cfc3beff4335733a79265 100644 (file)
@@ -1,11 +1,11 @@
 import type {
   BootReasonEnumType,
-  EmptyObject,
   InstallCertificateUseEnumType,
-  JsonObject,
   OCPP20ConnectorStatusEnumType,
-  OCPP20SetVariableDataType,
-} from '../../internal';
+} from './Common';
+import type { OCPP20SetVariableDataType } from './Variables';
+import type { EmptyObject } from '../../EmptyObject';
+import type { JsonObject } from '../../JsonType';
 
 export enum OCPP20RequestCommand {
   BOOT_NOTIFICATION = 'BootNotification',
index 5fac747a2300cfe023a482cbd3804a7dbe020f80..ab6357a9b5fbce29fb5c55b08b7eba2cc6f6b66f 100644 (file)
@@ -1,12 +1,12 @@
 import type {
-  EmptyObject,
-  GenericStatus,
+  GenericStatusEnumType,
   InstallCertificateStatusEnumType,
-  JsonObject,
-  OCPP20SetVariableResultType,
-  RegistrationStatusEnumType,
   StatusInfoType,
-} from '../../internal';
+} from './Common';
+import type { OCPP20SetVariableResultType } from './Variables';
+import type { EmptyObject } from '../../EmptyObject';
+import type { JsonObject } from '../../JsonType';
+import type { RegistrationStatusEnumType } from '../Responses';
 
 export type OCPP20BootNotificationResponse = {
   currentTime: Date;
@@ -20,7 +20,7 @@ export type OCPP20HeartbeatResponse = {
 } & JsonObject;
 
 export type OCPP20ClearCacheResponse = {
-  status: GenericStatus;
+  status: GenericStatusEnumType;
   statusInfo?: StatusInfoType;
 } & JsonObject;
 
index 0b089567c6719680ea690d1b411eddfbf9318bf7..59b1b023bfbf6b0362590f6393ab435b77e0b0f8 100644 (file)
@@ -1,4 +1,5 @@
-import type { EVSEType, JsonObject, StatusInfoType } from '../../internal';
+import type { EVSEType, StatusInfoType } from './Common';
+import type { JsonObject } from '../../JsonType';
 
 enum OCPP20ComponentName {
   AlignedDataCtrlr = 'AlignedDataCtrlr',
index 9e70845d8221b0994c982c9ff68bdc33ab60d295..d08f17a07121c078011db81253e1c9c6f51ab03d 100644 (file)
@@ -1,4 +1,4 @@
-import { OCPP16ChargePointErrorCode } from '../internal';
+import { OCPP16ChargePointErrorCode } from './1.6/ChargePointErrorCode';
 
 export const ChargePointErrorCode = {
   ...OCPP16ChargePointErrorCode,
index 0b21f1096990918b4f787fd8f18407a4d61f5eb4..bd67417e40ed8a84bcd33b1d658cdf4c9efef760 100644 (file)
@@ -4,7 +4,7 @@ import {
   OCPP16ChargingRateUnitType,
   type OCPP16ChargingSchedulePeriod,
   OCPP16RecurrencyKindType,
-} from '../internal';
+} from './1.6/ChargingProfile';
 
 export type ChargingProfile = OCPP16ChargingProfile;
 
index 39739a8fffcd7802fe838d7529929738d7406fdb..3081f13d5d4a123d882a1809474e1c009a738d40 100644 (file)
@@ -1,12 +1,14 @@
 import {
-  type JsonObject,
   OCPP16StandardParametersKey,
   OCPP16SupportedFeatureProfiles,
   OCPP16VendorParametersKey,
+} from './1.6/Configuration';
+import {
   OCPP20OptionalVariableName,
   OCPP20RequiredVariableName,
   OCPP20VendorVariableName,
-} from '../internal';
+} from './2.0/Variables';
+import type { JsonObject } from '../JsonType';
 
 export const StandardParametersKey = {
   ...OCPP16StandardParametersKey,
index 6c251cb79ab2dd431a39806f84bd5acdebd5bd2d..d3ac3e02d2a9661cfb4d440e430400b0eeb33489 100644 (file)
@@ -1,4 +1,5 @@
-import { OCPP16ChargePointStatus, OCPP20ConnectorStatusEnumType } from '../internal';
+import { OCPP16ChargePointStatus } from './1.6/ChargePointStatus';
+import { OCPP20ConnectorStatusEnumType } from './2.0/Common';
 
 export const ConnectorStatusEnum = {
   ...OCPP16ChargePointStatus,
index 10b8323df4fefac9eab9bf9719657562ccfe1389..f34a8c176fd3cf711ee158bad3f9ac2e0f950c3e 100644 (file)
@@ -3,7 +3,7 @@ import {
   OCPP16MeterValueMeasurand,
   OCPP16MeterValuePhase,
   type OCPP16SampledValue,
-} from '../internal';
+} from './1.6/MeterValues';
 
 export const MeterValueMeasurand = {
   ...OCPP16MeterValueMeasurand,
index 72555e64d5006ced8ecef53a05cff62c5b449e9d..7eef7b5b14d35f2db1c3aebef13d8f1ad12aaf82 100644 (file)
@@ -1,27 +1,29 @@
-import type { ChargingStation } from '../../charging-station';
-import type { OCPPError } from '../../exception';
+import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus';
+import type { OCPP16MeterValuesRequest } from './1.6/MeterValues';
 import {
-  type JsonType,
-  type MessageType,
   OCPP16AvailabilityType,
   type OCPP16BootNotificationRequest,
   type OCPP16DataTransferRequest,
-  OCPP16DiagnosticsStatus,
   type OCPP16DiagnosticsStatusNotificationRequest,
   OCPP16FirmwareStatus,
   type OCPP16FirmwareStatusNotificationRequest,
   type OCPP16HeartbeatRequest,
   OCPP16IncomingRequestCommand,
   OCPP16MessageTrigger,
-  type OCPP16MeterValuesRequest,
   OCPP16RequestCommand,
   type OCPP16StatusNotificationRequest,
+} from './1.6/Requests';
+import { OperationalStatusEnumType } from './2.0/Common';
+import {
   type OCPP20BootNotificationRequest,
   OCPP20IncomingRequestCommand,
   OCPP20RequestCommand,
   type OCPP20StatusNotificationRequest,
-  OperationalStatusEnumType,
-} from '../internal';
+} from './2.0/Requests';
+import type { MessageType } from './MessageType';
+import type { ChargingStation } from '../../charging-station';
+import type { OCPPError } from '../../exception';
+import type { JsonType } from '../JsonType';
 
 export const RequestCommand = {
   ...OCPP16RequestCommand,
index f14ef426871c107b8533d8744fde282f6930a857..24b8b848bebe9656660c4c884af6faf5a75df932 100644 (file)
@@ -1,8 +1,5 @@
-import type { ChargingStation } from '../../charging-station';
+import type { OCPP16MeterValuesResponse } from './1.6/MeterValues';
 import {
-  type ErrorType,
-  type JsonType,
-  type MessageType,
   OCPP16AvailabilityStatus,
   type OCPP16BootNotificationResponse,
   OCPP16ChargingProfileStatus,
@@ -13,14 +10,19 @@ import {
   type OCPP16DiagnosticsStatusNotificationResponse,
   type OCPP16FirmwareStatusNotificationResponse,
   type OCPP16HeartbeatResponse,
-  type OCPP16MeterValuesResponse,
   type OCPP16StatusNotificationResponse,
   OCPP16TriggerMessageStatus,
   OCPP16UnlockStatus,
-  type OCPP20BootNotificationResponse,
-  type OCPP20ClearCacheResponse,
-  type OCPP20StatusNotificationResponse,
-} from '../internal';
+} from './1.6/Responses';
+import type {
+  OCPP20BootNotificationResponse,
+  OCPP20ClearCacheResponse,
+  OCPP20StatusNotificationResponse,
+} from './2.0/Responses';
+import type { ErrorType } from './ErrorType';
+import type { MessageType } from './MessageType';
+import type { ChargingStation } from '../../charging-station';
+import type { JsonType } from '../JsonType';
 
 export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType];
 
index 1ce9d987e6b11431904c32137e820983f993e0c8..2a8a0ad46648978d3fe8b0fbab43f3cf008b812d 100644 (file)
@@ -7,7 +7,7 @@ import {
   OCPP16StopTransactionReason,
   type OCPP16StopTransactionRequest,
   type OCPP16StopTransactionResponse,
-} from '../internal';
+} from './1.6/Transaction';
 
 export const AuthorizationStatus = {
   ...OCPP16AuthorizationStatus,
index ef847e743897abdadddbcb0b2c55c97a08c4ec20..fc7268aa5e2c2a20e9d91196cd5310ff9cbff8ce 100644 (file)
@@ -1,6 +1,6 @@
 import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
 
-import type { PerformanceRecord } from '../../internal';
+import type { PerformanceRecord } from './PerformanceRecord';
 
 @Entity()
 export class PerformanceData {
index 1369377d7207db7b4484058aa9607f52fe7f50ae..06114da6be0a602422504d2e238a6b3792cae81a 100644 (file)
@@ -1,6 +1,6 @@
 import { Collection, Entity, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
 
-import type { PerformanceData } from '../../internal';
+import type { PerformanceData } from './PerformanceData';
 
 @Entity()
 export class PerformanceRecord {
index 47c5e160e20b86f10713c09eed61fb00ef08c399..0ed294c016385bc9d3993d6f55bde0cd52593e36 100644 (file)
@@ -7,7 +7,6 @@ import merge from 'just-merge';
 import { WorkerChoiceStrategies } from 'poolifier';
 
 import { Constants } from './Constants';
-import { FileUtils } from './FileUtils';
 import { Utils } from './Utils';
 import {
   ApplicationProtocol,
@@ -349,12 +348,11 @@ export class Configuration {
           fs.readFileSync(Configuration.configurationFile, 'utf8')
         ) as ConfigurationData;
       } catch (error) {
-        FileUtils.handleFileException(
+        Configuration.handleFileException(
           Configuration.configurationFile,
           FileType.Configuration,
           error as NodeJS.ErrnoException,
-          Configuration.logPrefix(),
-          { consoleOut: true }
+          Configuration.logPrefix()
         );
       }
       if (!Configuration.configurationFileWatcher) {
@@ -378,16 +376,39 @@ export class Configuration {
         }
       });
     } catch (error) {
-      FileUtils.handleFileException(
+      Configuration.handleFileException(
         Configuration.configurationFile,
         FileType.Configuration,
         error as NodeJS.ErrnoException,
-        Configuration.logPrefix(),
-        { consoleOut: true }
+        Configuration.logPrefix()
       );
     }
   }
 
+  private static handleFileException(
+    file: string,
+    fileType: FileType,
+    error: NodeJS.ErrnoException,
+    logPrefix: string
+  ): void {
+    const prefix = Utils.isNotEmptyString(logPrefix) ? `${logPrefix} ` : '';
+    let logMsg: string;
+    switch (error.code) {
+      case 'ENOENT':
+        logMsg = `${fileType} file ${file} not found:`;
+        break;
+      case 'EEXIST':
+        logMsg = `${fileType} file ${file} already exists:`;
+        break;
+      case 'EACCES':
+        logMsg = `${fileType} file ${file} access denied:`;
+        break;
+      default:
+        logMsg = `${fileType} file ${file} error:`;
+    }
+    console.warn(`${chalk.green(prefix)}${chalk.yellow(`${logMsg} `)}`, error);
+  }
+
   private static getDefaultPerformanceStorageUri(storageType: StorageType) {
     switch (storageType) {
       case StorageType.JSON_FILE:
index 9b7f62e0af7431759af8d56c0f18f37f293d8a67..e08fb128be960b721d99645be66ea11f617419af 100644 (file)
@@ -65,8 +65,7 @@ export class FileUtils {
         logMsg = `${fileType} file ${file} error:`;
     }
     if (params?.consoleOut) {
-      logMsg = `${logMsg} `;
-      console.warn(`${chalk.green(prefix)}${chalk.yellow(logMsg)}`, error);
+      console.warn(`${chalk.green(prefix)}${chalk.yellow(`${logMsg} `)}`, error);
     } else {
       logger.warn(`${prefix}${logMsg}`, error);
     }