-export { Bootstrap } from './Bootstrap';
export type { ChargingStation } from './ChargingStation';
export { ChargingStationConfigurationUtils } from './ChargingStationConfigurationUtils';
export { ChargingStationUtils } from './ChargingStationUtils';
import chalk from 'chalk';
-// import { Bootstrap } from './charging-station';
import { Bootstrap } from './charging-station/Bootstrap';
Bootstrap.getInstance()
-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[];
-import type { ChargingStationTemplate, FirmwareStatus } from './internal';
+import type { ChargingStationTemplate } from './ChargingStationTemplate';
+import type { FirmwareStatus } from './ocpp/Requests';
enum x509CertificateType {
V2GRootCertificate = 'V2GRootCertificate',
-import type { OCPPConfigurationKey } from './internal';
+import type { OCPPConfigurationKey } from './ocpp/Configuration';
export type ConfigurationKey = OCPPConfigurationKey & {
visible?: boolean;
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',
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 {
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;
-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;
-import type { AvailabilityType, ConnectorStatus } from './internal';
+import type { ConnectorStatus } from './ConnectorStatus';
+import type { AvailabilityType } from './ocpp/Requests';
export type EvseTemplate = {
Connectors: Record<string, ConnectorStatus>;
-import type { SampledValue } from './internal';
+import type { SampledValue } from './ocpp/MeterValues';
export type SampledValueTemplate = SampledValue & {
fluctuationPercent?: number;
-import type { IncomingRequestCommand, RequestCommand } from './internal';
+import type { IncomingRequestCommand, RequestCommand } from './ocpp/Requests';
import type { CircularArray } from '../utils';
import type { WorkerData } from '../worker';
-import type { BroadcastChannelResponsePayload, JsonObject } from './internal';
+import type { JsonObject } from './JsonType';
+import type { BroadcastChannelResponsePayload } from './WorkerBroadcastChannel';
export enum Protocol {
UI = 'ui',
-import type { RequestPayload, ResponsePayload } from './internal';
+import type { RequestPayload, ResponsePayload } from './UIProtocol';
export type BroadcastChannelRequest = [
string,
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';
+++ /dev/null
-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';
-import type { JsonObject } from '../../internal';
+import type { JsonObject } from '../../JsonType';
export interface OCPP16ChargingProfile extends JsonObject {
chargingProfileId: number;
-import type { EmptyObject, JsonObject } from '../../internal';
+import type { EmptyObject } from '../../EmptyObject';
+import type { JsonObject } from '../../JsonType';
export enum MeterValueUnit {
WATT_HOUR = 'Wh',
+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',
-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;
-import type { JsonObject, OCPP16MeterValue } from '../../internal';
+import type { OCPP16MeterValue } from './MeterValues';
+import type { JsonObject } from '../../JsonType';
export enum OCPP16StopTransactionReason {
NONE = '',
-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
V2GCertificate = 'V2GCertificate',
}
-export type CertificateSignedStatusEnumType = GenericStatus;
+export type CertificateSignedStatusEnumType = GenericStatusEnumType;
export type CertificateHashDataType = {
hashAlgorithm: HashAlgorithmEnumType;
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',
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;
} & JsonObject;
export type OCPP20ClearCacheResponse = {
- status: GenericStatus;
+ status: GenericStatusEnumType;
statusInfo?: StatusInfoType;
} & JsonObject;
-import type { EVSEType, JsonObject, StatusInfoType } from '../../internal';
+import type { EVSEType, StatusInfoType } from './Common';
+import type { JsonObject } from '../../JsonType';
enum OCPP20ComponentName {
AlignedDataCtrlr = 'AlignedDataCtrlr',
-import { OCPP16ChargePointErrorCode } from '../internal';
+import { OCPP16ChargePointErrorCode } from './1.6/ChargePointErrorCode';
export const ChargePointErrorCode = {
...OCPP16ChargePointErrorCode,
OCPP16ChargingRateUnitType,
type OCPP16ChargingSchedulePeriod,
OCPP16RecurrencyKindType,
-} from '../internal';
+} from './1.6/ChargingProfile';
export type ChargingProfile = OCPP16ChargingProfile;
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,
-import { OCPP16ChargePointStatus, OCPP20ConnectorStatusEnumType } from '../internal';
+import { OCPP16ChargePointStatus } from './1.6/ChargePointStatus';
+import { OCPP20ConnectorStatusEnumType } from './2.0/Common';
export const ConnectorStatusEnum = {
...OCPP16ChargePointStatus,
OCPP16MeterValueMeasurand,
OCPP16MeterValuePhase,
type OCPP16SampledValue,
-} from '../internal';
+} from './1.6/MeterValues';
export const MeterValueMeasurand = {
...OCPP16MeterValueMeasurand,
-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,
-import type { ChargingStation } from '../../charging-station';
+import type { OCPP16MeterValuesResponse } from './1.6/MeterValues';
import {
- type ErrorType,
- type JsonType,
- type MessageType,
OCPP16AvailabilityStatus,
type OCPP16BootNotificationResponse,
OCPP16ChargingProfileStatus,
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];
OCPP16StopTransactionReason,
type OCPP16StopTransactionRequest,
type OCPP16StopTransactionResponse,
-} from '../internal';
+} from './1.6/Transaction';
export const AuthorizationStatus = {
...OCPP16AuthorizationStatus,
import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
-import type { PerformanceRecord } from '../../internal';
+import type { PerformanceRecord } from './PerformanceRecord';
@Entity()
export class PerformanceData {
import { Collection, Entity, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
-import type { PerformanceData } from '../../internal';
+import type { PerformanceData } from './PerformanceData';
@Entity()
export class PerformanceRecord {
import { WorkerChoiceStrategies } from 'poolifier';
import { Constants } from './Constants';
-import { FileUtils } from './FileUtils';
import { Utils } from './Utils';
import {
ApplicationProtocol,
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) {
}
});
} 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:
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);
}