--- /dev/null
+export default {
+ '{src,tests}/**/*.{ts,tsx,cts,mts}': ['prettier --cache --write' /* , 'eslint --cache --fix' */],
+ '**/*.{json,md,yml,yaml}': ['prettier --cache --write'],
+ '**/*.{js,jsx,cjs,mjs}': ['prettier --cache --write', 'eslint --cache --fix'],
+};
+++ /dev/null
-{
- "{src,tests}/**/*.{ts,tsx,cts,mts}": ["prettier --cache --write", "eslint --cache --fix"],
- "**/*.{json,md,yml,yaml}": ["prettier --cache --write"],
- "**/*.{js,jsx,cjs,mjs}": ["prettier --cache --write", "eslint --cache --fix"]
-}
import { hoursToMilliseconds, secondsToMilliseconds } from 'date-fns';
-import type { ChargingStation } from './ChargingStation';
-import { checkChargingStation } from './Helpers';
-import { IdTagsCache } from './IdTagsCache';
-import { isIdTagAuthorized } from './ocpp';
-import { BaseError } from '../exception';
-import { PerformanceStatistics } from '../performance';
+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 {
AuthorizationStatus,
RequestCommand,
type Status,
StopTransactionReason,
type StopTransactionResponse,
-} from '../types';
+} from '../types/index.js';
import {
Constants,
cloneObject,
logger,
secureRandom,
sleep,
-} from '../utils';
+} from '../utils/index.js';
export class AutomaticTransactionGenerator {
private static readonly instances: Map<string, AutomaticTransactionGenerator> = new Map<
import chalk from 'chalk';
import { availableParallelism } from 'poolifier';
-import { waitChargingStationEvents } from './Helpers';
-import type { AbstractUIServer } from './ui-server/AbstractUIServer';
-import { UIServerFactory } from './ui-server/UIServerFactory';
+import { 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';
-import { type Storage, StorageFactory } from '../performance';
+import { BaseError } from '../exception/index.js';
+import { type Storage, StorageFactory } from '../performance/index.js';
import {
type ChargingStationData,
type ChargingStationWorkerData,
type StorageConfiguration,
type UIServerConfiguration,
type WorkerConfiguration,
-} from '../types';
+} from '../types/index.js';
import {
Configuration,
Constants,
isNullOrUndefined,
logPrefix,
logger,
-} from '../utils';
-import { type WorkerAbstract, WorkerFactory } from '../worker';
+} from '../utils/index.js';
+import { type WorkerAbstract, WorkerFactory } from '../worker/index.js';
const moduleName = 'Bootstrap';
import merge from 'just-merge';
import { type RawData, WebSocket } from 'ws';
-import { AutomaticTransactionGenerator } from './AutomaticTransactionGenerator';
-import { ChargingStationWorkerBroadcastChannel } from './broadcast-channel/ChargingStationWorkerBroadcastChannel';
+import { AutomaticTransactionGenerator } from './AutomaticTransactionGenerator.js';
+import { ChargingStationWorkerBroadcastChannel } from './broadcast-channel/ChargingStationWorkerBroadcastChannel.js';
import {
addConfigurationKey,
deleteConfigurationKey,
getConfigurationKey,
setConfigurationKeyValue,
-} from './ConfigurationKeyUtils';
+} from './ConfigurationKeyUtils.js';
import {
buildConnectorsMap,
checkChargingStation,
propagateSerialNumber,
stationTemplateToStationInfo,
warnTemplateKeysDeprecation,
-} from './Helpers';
-import { IdTagsCache } from './IdTagsCache';
+} from './Helpers.js';
+import { IdTagsCache } from './IdTagsCache.js';
import {
OCPP16IncomingRequestService,
OCPP16RequestService,
buildTransactionEndMeterValue,
getMessageTypeString,
sendAndSetConnectorStatus,
-} from './ocpp';
-import { SharedLRUCache } from './SharedLRUCache';
-import { BaseError, OCPPError } from '../exception';
-import { PerformanceStatistics } from '../performance';
+} from './ocpp/index.js';
+import { SharedLRUCache } from './SharedLRUCache.js';
+import { BaseError, OCPPError } from '../exception/index.js';
+import { PerformanceStatistics } from '../performance/index.js';
import {
type AutomaticTransactionGeneratorConfiguration,
AvailabilityType,
type WSError,
WebSocketCloseEventStatusCode,
type WsOptions,
-} from '../types';
+} from '../types/index.js';
import {
ACElectricUtils,
AsyncLock,
secureRandom,
sleep,
watchJsonFile,
-} from '../utils';
+} from '../utils/index.js';
export class ChargingStation extends EventEmitter {
public readonly index: number;
import { ThreadWorker } from 'poolifier';
-import { ChargingStation } from './ChargingStation';
-import { BaseError } from '../exception';
-import type { ChargingStationWorkerData } from '../types';
-import { Configuration } from '../utils';
-import { type WorkerMessage, WorkerMessageEvents } from '../worker';
+import { ChargingStation } from './ChargingStation.js';
+import { BaseError } from '../exception/index.js';
+import type { ChargingStationWorkerData } from '../types/index.js';
+import { Configuration } from '../utils/index.js';
+import { type WorkerMessage, WorkerMessageEvents } from '../worker/index.js';
/**
* Creates and starts a charging station instance
-import type { ChargingStation } from './ChargingStation';
-import type { ConfigurationKey, ConfigurationKeyType } from '../types';
-import { logger } from '../utils';
+import type { ChargingStation } from './ChargingStation.js';
+import type { ConfigurationKey, ConfigurationKeyType } from '../types/index.js';
+import { logger } from '../utils/index.js';
interface ConfigurationKeyOptions {
readonly?: boolean;
} from 'date-fns';
import { maxTime } from 'date-fns/constants';
-import type { ChargingStation } from './ChargingStation';
-import { getConfigurationKey } from './ConfigurationKeyUtils';
-import { BaseError } from '../exception';
+import type { ChargingStation } from './ChargingStation.js';
+import { getConfigurationKey } from './ConfigurationKeyUtils.js';
+import { BaseError } from '../exception/index.js';
import {
AmpereUnits,
AvailabilityType,
StandardParametersKey,
SupportedFeatureProfiles,
Voltage,
-} from '../types';
+} from '../types/index.js';
import {
ACElectricUtils,
Constants,
isValidTime,
logger,
secureRandom,
-} from '../utils';
+} from '../utils/index.js';
const moduleName = 'Helpers';
import { type FSWatcher, readFileSync } from 'node:fs';
-import type { ChargingStation } from './ChargingStation';
-import { getIdTagsFile } from './Helpers';
-import { FileType, IdTagDistribution } from '../types';
+import type { ChargingStation } from './ChargingStation.js';
+import { getIdTagsFile } from './Helpers.js';
+import { FileType, IdTagDistribution } from '../types/index.js';
import {
handleFileException,
isNotEmptyString,
logger,
secureRandom,
watchJsonFile,
-} from '../utils';
+} from '../utils/index.js';
interface IdTagsCacheValueType {
idTags: string[];
import LRUCache from 'mnemonist/lru-map-with-delete.js';
-import { Bootstrap } from './Bootstrap';
-import type { ChargingStationConfiguration, ChargingStationTemplate } from '../types';
-import { isEmptyObject, isNotEmptyArray, isNotEmptyString, isNullOrUndefined } from '../utils';
+import { Bootstrap } from './Bootstrap.js';
+import type { ChargingStationConfiguration, ChargingStationTemplate } from '../types/index.js';
+import {
+ isEmptyObject,
+ isNotEmptyArray,
+ isNotEmptyString,
+ isNullOrUndefined,
+} from '../utils/index.js';
enum CacheType {
chargingStationTemplate = 'chargingStationTemplate',
import { secondsToMilliseconds } from 'date-fns';
-import { WorkerBroadcastChannel } from './WorkerBroadcastChannel';
-import { BaseError, type OCPPError } from '../../exception';
+import { WorkerBroadcastChannel } from './WorkerBroadcastChannel.js';
+import { BaseError, type OCPPError } from '../../exception/index.js';
import {
AuthorizationStatus,
type AuthorizeRequest,
type StatusNotificationResponse,
type StopTransactionRequest,
type StopTransactionResponse,
-} from '../../types';
-import { Constants, convertToInt, isEmptyObject, isNullOrUndefined, logger } from '../../utils';
-import type { ChargingStation } from '../ChargingStation';
-import { getConfigurationKey } from '../ConfigurationKeyUtils';
-import { buildMeterValue } from '../ocpp';
+} from '../../types/index.js';
+import {
+ Constants,
+ convertToInt,
+ isEmptyObject,
+ isNullOrUndefined,
+ logger,
+} from '../../utils/index.js';
+import type { ChargingStation } from '../ChargingStation.js';
+import { getConfigurationKey } from '../ConfigurationKeyUtils.js';
+import { buildMeterValue } from '../ocpp/index.js';
const moduleName = 'ChargingStationWorkerBroadcastChannel';
-import { WorkerBroadcastChannel } from './WorkerBroadcastChannel';
+import { WorkerBroadcastChannel } from './WorkerBroadcastChannel.js';
import {
type BroadcastChannelResponse,
type BroadcastChannelResponsePayload,
type MessageEvent,
type ResponsePayload,
ResponseStatus,
-} from '../../types';
-import { isNullOrUndefined, logger } from '../../utils';
-import type { AbstractUIService } from '../ui-server/ui-services/AbstractUIService';
+} from '../../types/index.js';
+import { isNullOrUndefined, logger } from '../../utils/index.js';
+import type { AbstractUIService } from '../ui-server/ui-services/AbstractUIService.js';
const moduleName = 'UIServiceWorkerBroadcastChannel';
BroadcastChannelResponse,
JsonType,
MessageEvent,
-} from '../../types';
-import { logPrefix, logger, validateUUID } from '../../utils';
+} from '../../types/index.js';
+import { logPrefix, logger, validateUUID } from '../../utils/index.js';
const moduleName = 'WorkerBroadcastChannel';
-export { Bootstrap } from './Bootstrap';
-export type { ChargingStation } from './ChargingStation';
+export { Bootstrap } from './Bootstrap.js';
+export type { ChargingStation } from './ChargingStation.js';
export {
addConfigurationKey,
getConfigurationKey,
setConfigurationKeyValue,
-} from './ConfigurationKeyUtils';
+} from './ConfigurationKeyUtils.js';
export {
canProceedChargingProfile,
checkChargingStation,
prepareChargingProfileKind,
removeExpiredReservations,
resetConnectorStatus,
-} from './Helpers';
+} from './Helpers.js';
-import { type ConnectorStatusTransition, OCPP16ChargePointStatus } from '../../../types';
-import { OCPPConstants } from '../OCPPConstants';
+import { type ConnectorStatusTransition, OCPP16ChargePointStatus } from '../../../types/index.js';
+import { OCPPConstants } from '../OCPPConstants.js';
export class OCPP16Constants extends OCPPConstants {
static readonly ChargePointStatusChargingStationTransitions: Readonly<
import { maxTime } from 'date-fns/constants';
import { create } from 'tar';
-import { OCPP16Constants } from './OCPP16Constants';
-import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
+import { OCPP16Constants } from './OCPP16Constants.js';
+import { OCPP16ServiceUtils } from './OCPP16ServiceUtils.js';
import {
type ChargingStation,
canProceedChargingProfile,
prepareChargingProfileKind,
removeExpiredReservations,
setConfigurationKeyValue,
-} from '../../../charging-station';
-import { OCPPError } from '../../../exception';
+} from '../../../charging-station/index.js';
+import { OCPPError } from '../../../exception/index.js';
import {
type ChangeConfigurationRequest,
type ChangeConfigurationResponse,
type SetChargingProfileResponse,
type UnlockConnectorRequest,
type UnlockConnectorResponse,
-} from '../../../types';
+} from '../../../types/index.js';
import {
Constants,
convertToDate,
isUndefined,
logger,
sleep,
-} from '../../../utils';
-import { OCPPIncomingRequestService } from '../OCPPIncomingRequestService';
+} from '../../../utils/index.js';
+import { OCPPIncomingRequestService } from '../OCPPIncomingRequestService.js';
const moduleName = 'OCPP16IncomingRequestService';
import type { JSONSchemaType } from 'ajv';
-import { OCPP16Constants } from './OCPP16Constants';
-import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
-import type { ChargingStation } from '../../../charging-station';
-import { OCPPError } from '../../../exception';
+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 {
ErrorType,
type JsonObject,
type OCPP16StopTransactionRequest,
OCPPVersion,
type RequestParams,
-} from '../../../types';
-import { Constants, generateUUID } from '../../../utils';
-import { OCPPRequestService } from '../OCPPRequestService';
-import type { OCPPResponseService } from '../OCPPResponseService';
+} from '../../../types/index.js';
+import { Constants, generateUUID } from '../../../utils/index.js';
+import { OCPPRequestService } from '../OCPPRequestService.js';
+import type { OCPPResponseService } from '../OCPPResponseService.js';
const moduleName = 'OCPP16RequestService';
import type { JSONSchemaType } from 'ajv';
import { secondsToMilliseconds } from 'date-fns';
-import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
+import { OCPP16ServiceUtils } from './OCPP16ServiceUtils.js';
import {
type ChargingStation,
addConfigurationKey,
getConfigurationKey,
hasReservationExpired,
resetConnectorStatus,
-} from '../../../charging-station';
-import { OCPPError } from '../../../exception';
+} from '../../../charging-station/index.js';
+import { OCPPError } from '../../../exception/index.js';
import {
type ChangeConfigurationResponse,
ErrorType,
type ResponseHandler,
type SetChargingProfileResponse,
type UnlockConnectorResponse,
-} from '../../../types';
-import { Constants, convertToInt, isNullOrUndefined, logger } from '../../../utils';
-import { OCPPResponseService } from '../OCPPResponseService';
+} from '../../../types/index.js';
+import { Constants, convertToInt, isNullOrUndefined, logger } from '../../../utils/index.js';
+import { OCPPResponseService } from '../OCPPResponseService.js';
const moduleName = 'OCPP16ResponseService';
isWithinInterval,
} from 'date-fns';
-import { OCPP16Constants } from './OCPP16Constants';
+import { OCPP16Constants } from './OCPP16Constants.js';
import {
type ChargingStation,
hasFeatureProfile,
hasReservationExpired,
-} from '../../../charging-station';
+} from '../../../charging-station/index.js';
import {
type GenericResponse,
type JsonType,
OCPP16StopTransactionReason,
type OCPP16SupportedFeatureProfiles,
OCPPVersion,
-} from '../../../types';
-import { isNotEmptyArray, isNullOrUndefined, logger, roundTo } from '../../../utils';
-import { OCPPServiceUtils } from '../OCPPServiceUtils';
+} from '../../../types/index.js';
+import { isNotEmptyArray, isNullOrUndefined, logger, roundTo } from '../../../utils/index.js';
+import { OCPPServiceUtils } from '../OCPPServiceUtils.js';
export class OCPP16ServiceUtils extends OCPPServiceUtils {
public static checkFeatureProfile(
-import { type ConnectorStatusTransition, OCPP20ConnectorStatusEnumType } from '../../../types';
-import { OCPPConstants } from '../OCPPConstants';
+import {
+ type ConnectorStatusTransition,
+ OCPP20ConnectorStatusEnumType,
+} from '../../../types/index.js';
+import { OCPPConstants } from '../OCPPConstants.js';
export class OCPP20Constants extends OCPPConstants {
static readonly ChargingStationStatusTransitions: Readonly<ConnectorStatusTransition[]> =
import type { JSONSchemaType } from 'ajv';
-import { OCPP20ServiceUtils } from './OCPP20ServiceUtils';
-import type { ChargingStation } from '../../../charging-station';
-import { OCPPError } from '../../../exception';
+import { OCPP20ServiceUtils } from './OCPP20ServiceUtils.js';
+import type { ChargingStation } from '../../../charging-station/index.js';
+import { OCPPError } from '../../../exception/index.js';
import {
ErrorType,
type IncomingRequestHandler,
type OCPP20ClearCacheRequest,
OCPP20IncomingRequestCommand,
OCPPVersion,
-} from '../../../types';
-import { logger } from '../../../utils';
-import { OCPPIncomingRequestService } from '../OCPPIncomingRequestService';
+} from '../../../types/index.js';
+import { logger } from '../../../utils/index.js';
+import { OCPPIncomingRequestService } from '../OCPPIncomingRequestService.js';
const moduleName = 'OCPP20IncomingRequestService';
import type { JSONSchemaType } from 'ajv';
-import { OCPP20Constants } from './OCPP20Constants';
-import { OCPP20ServiceUtils } from './OCPP20ServiceUtils';
-import type { ChargingStation } from '../../../charging-station';
-import { OCPPError } from '../../../exception';
+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 {
ErrorType,
type JsonObject,
type OCPP20StatusNotificationRequest,
OCPPVersion,
type RequestParams,
-} from '../../../types';
-import { generateUUID } from '../../../utils';
-import { OCPPRequestService } from '../OCPPRequestService';
-import type { OCPPResponseService } from '../OCPPResponseService';
+} from '../../../types/index.js';
+import { generateUUID } from '../../../utils/index.js';
+import { OCPPRequestService } from '../OCPPRequestService.js';
+import type { OCPPResponseService } from '../OCPPResponseService.js';
const moduleName = 'OCPP20RequestService';
import type { JSONSchemaType } from 'ajv';
-import { OCPP20ServiceUtils } from './OCPP20ServiceUtils';
-import { type ChargingStation, addConfigurationKey } from '../../../charging-station';
-import { OCPPError } from '../../../exception';
+import { OCPP20ServiceUtils } from './OCPP20ServiceUtils.js';
+import { type ChargingStation, addConfigurationKey } from '../../../charging-station/index.js';
+import { OCPPError } from '../../../exception/index.js';
import {
ErrorType,
type JsonType,
OCPPVersion,
RegistrationStatusEnumType,
type ResponseHandler,
-} from '../../../types';
-import { logger } from '../../../utils';
-import { OCPPResponseService } from '../OCPPResponseService';
+} from '../../../types/index.js';
+import { logger } from '../../../utils/index.js';
+import { OCPPResponseService } from '../OCPPResponseService.js';
const moduleName = 'OCPP20ResponseService';
import type { JSONSchemaType } from 'ajv';
-import { type JsonType, OCPPVersion } from '../../../types';
-import { OCPPServiceUtils } from '../OCPPServiceUtils';
+import { type JsonType, OCPPVersion } from '../../../types/index.js';
+import { OCPPServiceUtils } from '../OCPPServiceUtils.js';
export class OCPP20ServiceUtils extends OCPPServiceUtils {
public static parseJsonSchemaFile<T extends JsonType>(
DataTransferStatus,
GenericStatus,
MeterValueMeasurand,
+ ReservationStatus,
TriggerMessageStatus,
UnlockStatus,
-} from '../../types';
-import { ReservationStatus } from '../../types/ocpp/Responses';
-import { Constants } from '../../utils';
+} from '../../types/index.js';
+import { Constants } from '../../utils/index.js';
export class OCPPConstants {
static readonly OCPP_WEBSOCKET_TIMEOUT = 60000; // Ms
import Ajv, { type JSONSchemaType, type ValidateFunction } from 'ajv';
import ajvFormats from 'ajv-formats';
-import { OCPPConstants } from './OCPPConstants';
-import { OCPPServiceUtils } from './OCPPServiceUtils';
-import { type ChargingStation, getIdTagsFile } from '../../charging-station';
-import { OCPPError } from '../../exception';
+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 {
ClearCacheResponse,
HandleErrorParams,
IncomingRequestCommand,
JsonType,
OCPPVersion,
-} from '../../types';
-import { logger, setDefaultErrorParams } from '../../utils';
+} from '../../types/index.js';
+import { logger, setDefaultErrorParams } from '../../utils/index.js';
const moduleName = 'OCPPIncomingRequestService';
import Ajv, { type JSONSchemaType, type ValidateFunction } from 'ajv';
import ajvFormats from 'ajv-formats';
-import { OCPPConstants } from './OCPPConstants';
-import type { OCPPResponseService } from './OCPPResponseService';
-import { OCPPServiceUtils } from './OCPPServiceUtils';
-import type { ChargingStation } from '../../charging-station';
-import { OCPPError } from '../../exception';
-import { PerformanceStatistics } from '../../performance';
+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';
import {
ChargingStationEvents,
type ErrorCallback,
type Response,
type ResponseCallback,
type ResponseType,
-} from '../../types';
+} from '../../types/index.js';
import {
cloneObject,
formatDurationMilliSeconds,
handleSendMessageError,
isNullOrUndefined,
logger,
-} from '../../utils';
+} from '../../utils/index.js';
const moduleName = 'OCPPRequestService';
import Ajv, { type JSONSchemaType, type ValidateFunction } from 'ajv';
import ajvFormats from 'ajv-formats';
-import { OCPPServiceUtils } from './OCPPServiceUtils';
-import type { ChargingStation } from '../../charging-station';
-import { OCPPError } from '../../exception';
-import type { IncomingRequestCommand, JsonType, OCPPVersion, RequestCommand } from '../../types';
-import { logger } from '../../utils';
+import { OCPPServiceUtils } from './OCPPServiceUtils.js';
+import type { ChargingStation } from '../../charging-station/index.js';
+import { OCPPError } from '../../exception/index.js';
+import type {
+ IncomingRequestCommand,
+ JsonType,
+ OCPPVersion,
+ RequestCommand,
+} from '../../types/index.js';
+import { logger } from '../../utils/index.js';
const moduleName = 'OCPPResponseService';
import type { DefinedError, ErrorObject, JSONSchemaType } from 'ajv';
import { isDate } from 'date-fns';
-import { OCPP16Constants } from './1.6/OCPP16Constants';
-import { OCPP20Constants } from './2.0/OCPP20Constants';
-import { OCPPConstants } from './OCPPConstants';
-import { type ChargingStation, getConfigurationKey, getIdTagsFile } from '../../charging-station';
-import { BaseError, OCPPError } from '../../exception';
+import { OCPP16Constants } from './1.6/OCPP16Constants.js';
+import { OCPP20Constants } from './2.0/OCPP20Constants.js';
+import { OCPPConstants } from './OCPPConstants.js';
+import {
+ type ChargingStation,
+ getConfigurationKey,
+ getIdTagsFile,
+} from '../../charging-station/index.js';
+import { BaseError, OCPPError } from '../../exception/index.js';
import {
AuthorizationStatus,
type AuthorizeRequest,
StandardParametersKey,
type StatusNotificationRequest,
type StatusNotificationResponse,
-} from '../../types';
+} from '../../types/index.js';
import {
ACElectricUtils,
Constants,
max,
min,
roundTo,
-} from '../../utils';
+} from '../../utils/index.js';
export const getMessageTypeString = (messageType: MessageType): string => {
switch (messageType) {
-export { OCPP16IncomingRequestService } from './1.6/OCPP16IncomingRequestService';
-export { OCPP16RequestService } from './1.6/OCPP16RequestService';
-export { OCPP16ResponseService } from './1.6/OCPP16ResponseService';
-export { OCPP20IncomingRequestService } from './2.0/OCPP20IncomingRequestService';
-export { OCPP20RequestService } from './2.0/OCPP20RequestService';
-export { OCPP20ResponseService } from './2.0/OCPP20ResponseService';
-export { OCPPIncomingRequestService } from './OCPPIncomingRequestService';
-export { OCPPRequestService } from './OCPPRequestService';
+export { OCPP16IncomingRequestService } from './1.6/OCPP16IncomingRequestService.js';
+export { OCPP16RequestService } from './1.6/OCPP16RequestService.js';
+export { OCPP16ResponseService } from './1.6/OCPP16ResponseService.js';
+export { OCPP20IncomingRequestService } from './2.0/OCPP20IncomingRequestService.js';
+export { OCPP20RequestService } from './2.0/OCPP20RequestService.js';
+export { OCPP20ResponseService } from './2.0/OCPP20ResponseService.js';
+export { OCPPIncomingRequestService } from './OCPPIncomingRequestService.js';
+export { OCPPRequestService } from './OCPPRequestService.js';
export {
buildMeterValue,
buildStatusNotificationRequest,
getMessageTypeString,
isIdTagAuthorized,
sendAndSetConnectorStatus,
-} from './OCPPServiceUtils';
+} from './OCPPServiceUtils.js';
import type { WebSocket } from 'ws';
-import type { AbstractUIService } from './ui-services/AbstractUIService';
-import { UIServiceFactory } from './ui-services/UIServiceFactory';
-import { BaseError } from '../../exception';
+import type { AbstractUIService } from './ui-services/AbstractUIService.js';
+import { UIServiceFactory } from './ui-services/UIServiceFactory.js';
+import { BaseError } from '../../exception/index.js';
import {
ApplicationProtocolVersion,
AuthenticationType,
type RequestPayload,
type ResponsePayload,
type UIServerConfiguration,
-} from '../../types';
+} from '../../types/index.js';
export abstract class AbstractUIServer {
public readonly chargingStations: Map<string, ChargingStationData>;
import { StatusCodes } from 'http-status-codes';
-import { AbstractUIServer } from './AbstractUIServer';
-import { UIServerUtils } from './UIServerUtils';
-import { BaseError } from '../../exception';
+import { AbstractUIServer } from './AbstractUIServer.js';
+import { UIServerUtils } from './UIServerUtils.js';
+import { BaseError } from '../../exception/index.js';
import {
ApplicationProtocolVersion,
type ProcedureName,
type RequestPayload,
ResponseStatus,
type UIServerConfiguration,
-} from '../../types';
+} from '../../types/index.js';
import {
Constants,
generateUUID,
isNullOrUndefined,
logPrefix,
logger,
-} from '../../utils';
+} from '../../utils/index.js';
const moduleName = 'UIHttpServer';
import chalk from 'chalk';
-import type { AbstractUIServer } from './AbstractUIServer';
-import { UIHttpServer } from './UIHttpServer';
-import { UIServerUtils } from './UIServerUtils';
-import { UIWebSocketServer } from './UIWebSocketServer';
+import type { AbstractUIServer } from './AbstractUIServer.js';
+import { UIHttpServer } from './UIHttpServer.js';
+import { UIServerUtils } from './UIServerUtils.js';
+import { UIWebSocketServer } from './UIWebSocketServer.js';
import {
ApplicationProtocol,
ApplicationProtocolVersion,
type UIServerConfiguration,
-} from '../../types';
+} from '../../types/index.js';
export class UIServerFactory {
private constructor() {
import type { IncomingMessage } from 'node:http';
-import { Protocol, ProtocolVersion } from '../../types';
-import { logPrefix, logger } from '../../utils';
+import { Protocol, ProtocolVersion } from '../../types/index.js';
+import { logPrefix, logger } from '../../utils/index.js';
export class UIServerUtils {
private constructor() {
import { StatusCodes } from 'http-status-codes';
import { type RawData, WebSocket, WebSocketServer } from 'ws';
-import { AbstractUIServer } from './AbstractUIServer';
-import { UIServerUtils } from './UIServerUtils';
+import { AbstractUIServer } from './AbstractUIServer.js';
+import { UIServerUtils } from './UIServerUtils.js';
import {
type ProtocolRequest,
type ProtocolResponse,
type UIServerConfiguration,
WebSocketCloseEventStatusCode,
-} from '../../types';
+} from '../../types/index.js';
import {
Constants,
getWebSocketCloseEventStatusString,
logPrefix,
logger,
validateUUID,
-} from '../../utils';
+} from '../../utils/index.js';
const moduleName = 'UIWebSocketServer';
-import { BaseError, type OCPPError } from '../../../exception';
+import { BaseError, type OCPPError } from '../../../exception/index.js';
import {
BroadcastChannelProcedureName,
type BroadcastChannelRequestPayload,
type RequestPayload,
type ResponsePayload,
ResponseStatus,
-} from '../../../types';
-import { isNotEmptyArray, isNullOrUndefined, logger } from '../../../utils';
-import { Bootstrap } from '../../Bootstrap';
-import { UIServiceWorkerBroadcastChannel } from '../../broadcast-channel/UIServiceWorkerBroadcastChannel';
-import type { AbstractUIServer } from '../AbstractUIServer';
+} from '../../../types/index.js';
+import { isNotEmptyArray, isNullOrUndefined, logger } from '../../../utils/index.js';
+import { Bootstrap } from '../../Bootstrap.js';
+import { UIServiceWorkerBroadcastChannel } from '../../broadcast-channel/UIServiceWorkerBroadcastChannel.js';
+import type { AbstractUIServer } from '../AbstractUIServer.js';
const moduleName = 'AbstractUIService';
-import { AbstractUIService } from './AbstractUIService';
-import { type ProtocolRequestHandler, ProtocolVersion } from '../../../types';
-import type { AbstractUIServer } from '../AbstractUIServer';
+import { AbstractUIService } from './AbstractUIService.js';
+import { type ProtocolRequestHandler, ProtocolVersion } from '../../../types/index.js';
+import type { AbstractUIServer } from '../AbstractUIServer.js';
export class UIService001 extends AbstractUIService {
constructor(uiServer: AbstractUIServer) {
-import type { AbstractUIService } from './AbstractUIService';
-import { UIService001 } from './UIService001';
-import { ProtocolVersion } from '../../../types';
-import type { AbstractUIServer } from '../AbstractUIServer';
+import type { AbstractUIService } from './AbstractUIService.js';
+import { UIService001 } from './UIService001.js';
+import { ProtocolVersion } from '../../../types/index.js';
+import type { AbstractUIServer } from '../AbstractUIServer.js';
export class UIServiceFactory {
private constructor() {
// Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
-import { BaseError } from './BaseError';
+import { BaseError } from './BaseError.js';
import {
ErrorType,
type IncomingRequestCommand,
type JsonType,
type RequestCommand,
-} from '../types';
-import { Constants } from '../utils';
+} from '../types/index.js';
+import { Constants } from '../utils/index.js';
export class OCPPError extends BaseError {
code: ErrorType;
-export { BaseError } from './BaseError';
-export { OCPPError } from './OCPPError';
+export { BaseError } from './BaseError.js';
+export { OCPPError } from './OCPPError.js';
type Statistics,
type StorageConfiguration,
type TimestampedData,
-} from '../types';
+} from '../types/index.js';
import {
CircularArray,
Configuration,
min,
nthPercentile,
stdDeviation,
-} from '../utils';
+} from '../utils/index.js';
export class PerformanceStatistics {
private static readonly instances: Map<string, PerformanceStatistics> = new Map<
-export { PerformanceStatistics } from './PerformanceStatistics';
-export { type Storage } from './storage/Storage';
-export { StorageFactory } from './storage/StorageFactory';
+export { PerformanceStatistics } from './PerformanceStatistics.js';
+export { type Storage } from './storage/Storage.js';
+export { StorageFactory } from './storage/StorageFactory.js';
import { closeSync, existsSync, mkdirSync, openSync, writeSync } from 'node:fs';
import { dirname } from 'node:path';
-import { Storage } from './Storage';
-import { BaseError } from '../../exception';
-import { FileType, type Statistics } from '../../types';
+import { Storage } from './Storage.js';
+import { BaseError } from '../../exception/index.js';
+import { FileType, type Statistics } from '../../types/index.js';
import {
AsyncLock,
AsyncLockType,
JSONStringifyWithMapSupport,
handleFileException,
isNullOrUndefined,
-} from '../../utils';
+} from '../../utils/index.js';
export class JsonFileStorage extends Storage {
private static performanceRecords: Map<string, Statistics>;
} from '@mikro-orm/core';
import { TsMorphMetadataProvider } from '@mikro-orm/reflection';
-import { Storage } from './Storage';
+import { Storage } from './Storage.js';
import {
type MikroOrmDbType,
PerformanceData,
PerformanceRecord,
type Statistics,
StorageType,
-} from '../../types';
-import { Constants } from '../../utils';
+} from '../../types/index.js';
+import { Constants } from '../../utils/index.js';
export class MikroOrmStorage extends Storage {
private storageType: StorageType;
import { MongoClient } from 'mongodb';
-import { Storage } from './Storage';
-import { BaseError } from '../../exception';
-import { type Statistics, StorageType } from '../../types';
-import { Constants } from '../../utils';
+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';
export class MongoDBStorage extends Storage {
private readonly client?: MongoClient;
type HandleErrorParams,
type Statistics,
StorageType,
-} from '../../types';
-import { isNullOrUndefined, logger, setDefaultErrorParams } from '../../utils';
+} from '../../types/index.js';
+import { isNullOrUndefined, logger, setDefaultErrorParams } from '../../utils/index.js';
export abstract class Storage {
protected readonly storageUri: URL;
// Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
-import { JsonFileStorage } from './JsonFileStorage';
+import { JsonFileStorage } from './JsonFileStorage.js';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-import { MikroOrmStorage } from './MikroOrmStorage';
-import { MongoDBStorage } from './MongoDBStorage';
-import type { Storage } from './Storage';
-import { BaseError } from '../../exception';
-import { StorageType } from '../../types';
+import { MikroOrmStorage } from './MikroOrmStorage.js';
+import { MongoDBStorage } from './MongoDBStorage.js';
+import type { Storage } from './Storage.js';
+import { BaseError } from '../../exception/index.js';
+import { StorageType } from '../../types/index.js';
export class StorageFactory {
private constructor() {
import chalk from 'chalk';
-import { Bootstrap } from './charging-station';
+import { Bootstrap } from './charging-station/index.js';
try {
await Bootstrap.getInstance().start();
-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';
+import type { ChargingStationAutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator.js';
+import type { ChargingStationInfoConfiguration } from './ChargingStationInfo.js';
+import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration.js';
+import type { ConnectorStatus } from './ConnectorStatus.js';
+import type { EvseStatus } from './Evse.js';
interface ConnectorsConfiguration {
connectorsStatus?: ConnectorStatus[];
-import type { ChargingStationTemplate } from './ChargingStationTemplate';
-import type { FirmwareStatus } from './ocpp/Requests';
+import type { ChargingStationTemplate } from './ChargingStationTemplate.js';
+import type { FirmwareStatus } from './ocpp/Requests.js';
export type ChargingStationInfo = Omit<
ChargingStationTemplate,
-import type { OCPPConfigurationKey } from './ocpp/Configuration';
+import type { OCPPConfigurationKey } from './ocpp/Configuration.js';
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 } from './AutomaticTransactionGenerator.js';
+import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration.js';
+import type { ConnectorStatus } from './ConnectorStatus.js';
+import type { EvseTemplate } from './Evse.js';
+import type { OCPPProtocol } from './ocpp/OCPPProtocol.js';
+import type { OCPPVersion } from './ocpp/OCPPVersion.js';
import type {
FirmwareStatus,
IncomingRequestCommand,
MessageTrigger,
RequestCommand,
-} from './ocpp/Requests';
+} from './ocpp/Requests.js';
export enum CurrentType {
AC = 'AC',
import type { WebSocket } from 'ws';
-import type { ChargingStationAutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator';
-import { ChargingStationEvents } from './ChargingStationEvents';
-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';
+import type { ChargingStationAutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator.js';
+import { ChargingStationEvents } from './ChargingStationEvents.js';
+import type { ChargingStationInfo } from './ChargingStationInfo.js';
+import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration.js';
+import type { ConnectorStatus } from './ConnectorStatus.js';
+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';
interface ChargingStationWorkerOptions extends JsonObject {
elementStartDelay?: number;
import type { WorkerChoiceStrategy } from 'poolifier';
-import type { StorageType } from './Storage';
-import type { ApplicationProtocol, AuthenticationType } from './UIProtocol';
-import type { WorkerProcessType } from '../worker';
+import type { StorageType } from './Storage.js';
+import type { ApplicationProtocol, AuthenticationType } from './UIProtocol.js';
+import type { WorkerProcessType } from '../worker/index.js';
type ServerOptions = ListenOptions;
-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';
-import type { Reservation } from './ocpp/Reservation';
+import type { SampledValueTemplate } from './MeasurandPerPhaseSampledValueTemplates.js';
+import type { ChargingProfile } from './ocpp/ChargingProfile.js';
+import type { ConnectorStatusEnum } from './ocpp/ConnectorStatusEnum.js';
+import type { MeterValue } from './ocpp/MeterValues.js';
+import type { AvailabilityType } from './ocpp/Requests.js';
+import type { Reservation } from './ocpp/Reservation.js';
export interface ConnectorStatus {
availability: AvailabilityType;
-import type { JsonType } from './JsonType';
+import type { JsonType } from './JsonType.js';
export interface HandleErrorParams<T extends JsonType> {
throwError?: boolean;
-import type { ConnectorStatus } from './ConnectorStatus';
-import type { AvailabilityType } from './ocpp/Requests';
+import type { ConnectorStatus } from './ConnectorStatus.js';
+import type { AvailabilityType } from './ocpp/Requests.js';
export interface EvseTemplate {
Connectors: Record<string, ConnectorStatus>;
-import type { SampledValue } from './ocpp/MeterValues';
+import type { SampledValue } from './ocpp/MeterValues.js';
export type SampledValueTemplate = SampledValue & {
fluctuationPercent?: number;
-import type { IncomingRequestCommand, RequestCommand } from './ocpp/Requests';
-import type { CircularArray } from '../utils';
-import type { WorkerData } from '../worker';
+import type { IncomingRequestCommand, RequestCommand } from './ocpp/Requests.js';
+import type { CircularArray } from '../utils/index.js';
+import type { WorkerData } from '../worker/index.js';
export interface TimestampedData {
timestamp: number;
-import type { JsonObject } from './JsonType';
-import type { BroadcastChannelResponsePayload } from './WorkerBroadcastChannel';
+import type { JsonObject } from './JsonType.js';
+import type { BroadcastChannelResponsePayload } from './WorkerBroadcastChannel.js';
export enum Protocol {
UI = 'ui',
-import type { RequestPayload, ResponsePayload } from './UIProtocol';
+import type { RequestPayload, ResponsePayload } from './UIProtocol.js';
export type BroadcastChannelRequest = [
string,
type RequestPayload,
type ResponsePayload,
ResponseStatus,
-} from './UIProtocol';
+} from './UIProtocol.js';
export {
type AutomaticTransactionGeneratorConfiguration,
type ChargingStationAutomaticTransactionGeneratorConfiguration,
IdTagDistribution,
type Status,
-} from './AutomaticTransactionGenerator';
-export { type GenericResponse, GenericStatus, RegistrationStatusEnumType } from './ocpp/Common';
+} from './AutomaticTransactionGenerator.js';
+export { type GenericResponse, GenericStatus, RegistrationStatusEnumType } from './ocpp/Common.js';
export {
AvailabilityType,
type BootNotificationRequest,
type ResponseCallback,
type ResponseType,
type StatusNotificationRequest,
-} from './ocpp/Requests';
+} from './ocpp/Requests.js';
export {
AvailabilityStatus,
type BootNotificationResponse,
type FirmwareStatusNotificationResponse,
type HeartbeatResponse,
type MeterValuesResponse,
+ ReservationStatus,
type Response,
type ResponseHandler,
type StatusNotificationResponse,
TriggerMessageStatus,
UnlockStatus,
-} from './ocpp/Responses';
+} from './ocpp/Responses.js';
export {
AuthorizationStatus,
type AuthorizeRequest,
StopTransactionReason,
type StopTransactionRequest,
type StopTransactionResponse,
-} from './ocpp/Transaction';
-export { BootReasonEnumType, OCPP20ConnectorStatusEnumType } from './ocpp/2.0/Common';
+} from './ocpp/Transaction.js';
+export { BootReasonEnumType, OCPP20ConnectorStatusEnumType } from './ocpp/2.0/Common.js';
export {
BroadcastChannelProcedureName,
type BroadcastChannelRequest,
type BroadcastChannelResponse,
type BroadcastChannelResponsePayload,
type MessageEvent,
-} from './WorkerBroadcastChannel';
+} from './WorkerBroadcastChannel.js';
export {
type ChangeConfigurationRequest,
type GetConfigurationRequest,
type ResetRequest,
type SetChargingProfileRequest,
type UnlockConnectorRequest,
-} from './ocpp/1.6/Requests';
+} from './ocpp/1.6/Requests.js';
export {
type ChangeConfigurationResponse,
type GetConfigurationResponse,
type OCPP16UpdateFirmwareResponse,
type SetChargingProfileResponse,
type UnlockConnectorResponse,
-} from './ocpp/1.6/Responses';
-export { ChargePointErrorCode } from './ocpp/ChargePointErrorCode';
+} from './ocpp/1.6/Responses.js';
+export { ChargePointErrorCode } from './ocpp/ChargePointErrorCode.js';
export {
type ChargingProfile,
ChargingProfileKindType,
ChargingRateUnitType,
type ChargingSchedulePeriod,
RecurrencyKindType,
-} from './ocpp/ChargingProfile';
+} from './ocpp/ChargingProfile.js';
export type {
ChargingStationConfiguration,
EvseStatusConfiguration,
-} from './ChargingStationConfiguration';
+} from './ChargingStationConfiguration.js';
export {
type ChargingStationData,
type ChargingStationWorkerData,
type ChargingStationWorkerMessageData,
ChargingStationWorkerMessageEvents,
type EvseStatusWorkerType,
-} from './ChargingStationWorker';
-export type { ChargingStationInfo } from './ChargingStationInfo';
+} from './ChargingStationWorker.js';
+export type { ChargingStationInfo } from './ChargingStationInfo.js';
export type {
ChargingStationOcppConfiguration,
ConfigurationKey,
-} from './ChargingStationOcppConfiguration';
+} from './ChargingStationOcppConfiguration.js';
export {
AmpereUnits,
type ChargingStationTemplate,
PowerUnits,
Voltage,
type WsOptions,
-} from './ChargingStationTemplate';
+} from './ChargingStationTemplate.js';
export {
ApplicationProtocolVersion,
type ConfigurationData,
SupervisionUrlDistribution,
type UIServerConfiguration,
type WorkerConfiguration,
-} from './ConfigurationData';
+} from './ConfigurationData.js';
export {
type ConfigurationKeyType,
ConnectorPhaseRotation,
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';
+} from './ocpp/Configuration.js';
+export type { ConnectorStatus } from './ConnectorStatus.js';
+export { ConnectorStatusEnum, type ConnectorStatusTransition } from './ocpp/ConnectorStatusEnum.js';
+export { DBName, type MikroOrmDbType, 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';
-export type { MeasurandValues } from './MeasurandValues';
-export { MessageType } from './ocpp/MessageType';
+} from './MeasurandPerPhaseSampledValueTemplates.js';
+export type { MeasurandValues } from './MeasurandValues.js';
+export { MessageType } from './ocpp/MessageType.js';
export {
type MeterValue,
MeterValueContext,
MeterValuePhase,
MeterValueUnit,
type SampledValue,
-} from './ocpp/MeterValues';
+} from './ocpp/MeterValues.js';
export {
type OCPP16MeterValue,
OCPP16MeterValueContext,
type OCPP16MeterValuesRequest,
type OCPP16MeterValuesResponse,
type OCPP16SampledValue,
-} from './ocpp/1.6/MeterValues';
+} from './ocpp/1.6/MeterValues.js';
export {
OCPP16AuthorizationStatus,
type OCPP16AuthorizeRequest,
OCPP16StopTransactionReason,
type OCPP16StopTransactionRequest,
type OCPP16StopTransactionResponse,
-} from './ocpp/1.6/Transaction';
-export { OCPP16ChargePointErrorCode } from './ocpp/1.6/ChargePointErrorCode';
-export { OCPP16ChargePointStatus } from './ocpp/1.6/ChargePointStatus';
+} from './ocpp/1.6/Transaction.js';
+export { OCPP16ChargePointErrorCode } from './ocpp/1.6/ChargePointErrorCode.js';
+export { OCPP16ChargePointStatus } from './ocpp/1.6/ChargePointStatus.js';
export {
type OCPP16ChargingProfile,
OCPP16ChargingProfilePurposeType,
OCPP16ChargingRateUnitType,
type OCPP16ChargingSchedule,
type OCPP16ChargingSchedulePeriod,
-} from './ocpp/1.6/ChargingProfile';
+} from './ocpp/1.6/ChargingProfile.js';
export {
OCPP16StandardParametersKey,
OCPP16SupportedFeatureProfiles,
-} from './ocpp/1.6/Configuration';
-export { OCPP16DiagnosticsStatus } from './ocpp/1.6/DiagnosticsStatus';
+} from './ocpp/1.6/Configuration.js';
+export { OCPP16DiagnosticsStatus } from './ocpp/1.6/DiagnosticsStatus.js';
export {
type OCPP20BootNotificationRequest,
type OCPP20ClearCacheRequest,
OCPP20IncomingRequestCommand,
OCPP20RequestCommand,
type OCPP20StatusNotificationRequest,
-} from './ocpp/2.0/Requests';
+} from './ocpp/2.0/Requests.js';
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, TimestampedData } from './Statistics';
+} from './ocpp/2.0/Responses.js';
+export { OCPP20OptionalVariableName } from './ocpp/2.0/Variables.js';
+export { OCPPVersion } from './ocpp/OCPPVersion.js';
+export { PerformanceData } from './orm/entities/PerformanceData.js';
+export { PerformanceRecord } from './orm/entities/PerformanceRecord.js';
+export type { Statistics, TimestampedData } from './Statistics.js';
export {
type WSError,
WebSocketCloseEventStatusCode,
WebSocketCloseEventStatusString,
-} from './WebSocket';
+} from './WebSocket.js';
export {
type Reservation,
type ReservationKey,
ReservationTerminationReason,
-} from './ocpp/Reservation';
-export { ChargingStationEvents } from './ChargingStationEvents';
+} from './ocpp/Reservation.js';
+export { ChargingStationEvents } from './ChargingStationEvents.js';
-import type { JsonObject } from '../../JsonType';
+import type { JsonObject } from '../../JsonType.js';
export interface OCPP16ChargingProfile extends JsonObject {
chargingProfileId: number;
-import type { EmptyObject } from '../../EmptyObject';
-import type { JsonObject } from '../../JsonType';
+import type { EmptyObject } from '../../EmptyObject.js';
+import type { JsonObject } from '../../JsonType.js';
export enum OCPP16MeterValueUnit {
WATT_HOUR = 'Wh',
-import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
-import type { OCPP16ChargePointStatus } from './ChargePointStatus';
+import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode.js';
+import type { OCPP16ChargePointStatus } from './ChargePointStatus.js';
import type {
OCPP16ChargingProfile,
OCPP16ChargingProfilePurposeType,
OCPP16ChargingRateUnitType,
-} from './ChargingProfile';
-import type { OCPP16StandardParametersKey, OCPP16VendorParametersKey } from './Configuration';
-import type { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
-import type { EmptyObject } from '../../EmptyObject';
-import type { JsonObject } from '../../JsonType';
+} 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',
-import type { OCPP16ChargingSchedule } from './ChargingProfile';
-import type { EmptyObject } from '../../EmptyObject';
-import type { JsonObject } from '../../JsonType';
-import type { GenericStatus, RegistrationStatusEnumType } from '../Common';
-import type { OCPPConfigurationKey } from '../Configuration';
+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';
export interface OCPP16HeartbeatResponse extends JsonObject {
currentTime: Date;
-import type { OCPP16MeterValue } from './MeterValues';
-import type { JsonObject } from '../../JsonType';
+import type { OCPP16MeterValue } from './MeterValues.js';
+import type { JsonObject } from '../../JsonType.js';
export enum OCPP16StopTransactionReason {
EMERGENCY_STOP = 'EmergencyStop',
-import type { JsonObject } from '../../JsonType';
-import type { GenericStatus } from '../Common';
+import type { JsonObject } from '../../JsonType.js';
+import type { GenericStatus } from '../Common.js';
export enum DataEnumType {
// eslint-disable-next-line id-blacklist
BootReasonEnumType,
InstallCertificateUseEnumType,
OCPP20ConnectorStatusEnumType,
-} from './Common';
-import type { OCPP20SetVariableDataType } from './Variables';
-import type { EmptyObject } from '../../EmptyObject';
-import type { JsonObject } from '../../JsonType';
+} 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',
GenericStatusEnumType,
InstallCertificateStatusEnumType,
StatusInfoType,
-} from './Common';
-import type { OCPP20SetVariableResultType } from './Variables';
-import type { EmptyObject } from '../../EmptyObject';
-import type { JsonObject } from '../../JsonType';
-import type { RegistrationStatusEnumType } from '../Common';
+} 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 type OCPP20BootNotificationResponse = {
currentTime: Date;
-import type { EVSEType, StatusInfoType } from './Common';
-import type { JsonObject } from '../../JsonType';
+import type { EVSEType, StatusInfoType } from './Common.js';
+import type { JsonObject } from '../../JsonType.js';
enum OCPP20ComponentName {
AlignedDataCtrlr = 'AlignedDataCtrlr',
-import { OCPP16ChargePointErrorCode } from './1.6/ChargePointErrorCode';
+import { OCPP16ChargePointErrorCode } from './1.6/ChargePointErrorCode.js';
export const ChargePointErrorCode = {
...OCPP16ChargePointErrorCode,
OCPP16ChargingRateUnitType,
type OCPP16ChargingSchedulePeriod,
OCPP16RecurrencyKindType,
-} from './1.6/ChargingProfile';
+} from './1.6/ChargingProfile.js';
export type ChargingProfile = OCPP16ChargingProfile;
-import type { JsonObject } from '../JsonType';
+import type { JsonObject } from '../JsonType.js';
export enum GenericStatus {
Accepted = 'Accepted',
OCPP16StandardParametersKey,
OCPP16SupportedFeatureProfiles,
OCPP16VendorParametersKey,
-} from './1.6/Configuration';
+} from './1.6/Configuration.js';
import {
OCPP20OptionalVariableName,
OCPP20RequiredVariableName,
OCPP20VendorVariableName,
-} from './2.0/Variables';
-import type { JsonObject } from '../JsonType';
+} from './2.0/Variables.js';
+import type { JsonObject } from '../JsonType.js';
export const StandardParametersKey = {
...OCPP16StandardParametersKey,
-import { OCPP16ChargePointStatus } from './1.6/ChargePointStatus';
-import { OCPP20ConnectorStatusEnumType } from './2.0/Common';
+import { OCPP16ChargePointStatus } from './1.6/ChargePointStatus.js';
+import { OCPP20ConnectorStatusEnumType } from './2.0/Common.js';
export const ConnectorStatusEnum = {
...OCPP16ChargePointStatus,
OCPP16MeterValuePhase,
OCPP16MeterValueUnit,
type OCPP16SampledValue,
-} from './1.6/MeterValues';
+} from './1.6/MeterValues.js';
export const MeterValueUnit = {
...OCPP16MeterValueUnit,
-import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus';
-import type { OCPP16MeterValuesRequest } from './1.6/MeterValues';
+import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus.js';
+import type { OCPP16MeterValuesRequest } from './1.6/MeterValues.js';
import {
OCPP16AvailabilityType,
type OCPP16BootNotificationRequest,
OCPP16RequestCommand,
type OCPP16ReserveNowRequest,
type OCPP16StatusNotificationRequest,
-} from './1.6/Requests';
-import { OperationalStatusEnumType } from './2.0/Common';
+} from './1.6/Requests.js';
+import { OperationalStatusEnumType } from './2.0/Common.js';
import {
type OCPP20BootNotificationRequest,
OCPP20IncomingRequestCommand,
OCPP20RequestCommand,
type OCPP20StatusNotificationRequest,
-} 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';
+} 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,
-import type { OCPP16ReserveNowRequest } from './1.6/Requests';
+import type { OCPP16ReserveNowRequest } from './1.6/Requests.js';
export type Reservation = OCPP16ReserveNowRequest;
-import type { OCPP16MeterValuesResponse } from './1.6/MeterValues';
+import type { OCPP16MeterValuesResponse } from './1.6/MeterValues.js';
import {
OCPP16AvailabilityStatus,
type OCPP16BootNotificationResponse,
type OCPP16StatusNotificationResponse,
OCPP16TriggerMessageStatus,
OCPP16UnlockStatus,
-} from './1.6/Responses';
-import type { OCPP20BootNotificationResponse, OCPP20ClearCacheResponse } from './2.0/Responses';
-import { type GenericResponse, GenericStatus } from './Common';
-import type { ErrorType } from './ErrorType';
-import type { MessageType } from './MessageType';
-import type { ChargingStation } from '../../charging-station';
-import type { JsonType } from '../JsonType';
+} from './1.6/Responses.js';
+import type { OCPP20BootNotificationResponse, OCPP20ClearCacheResponse } from './2.0/Responses.js';
+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];
OCPP16StopTransactionReason,
type OCPP16StopTransactionRequest,
type OCPP16StopTransactionResponse,
-} from './1.6/Transaction';
+} from './1.6/Transaction.js';
export const AuthorizationStatus = {
...OCPP16AuthorizationStatus,
import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-import type { PerformanceRecord } from './PerformanceRecord';
+import type { PerformanceRecord } from './PerformanceRecord.js';
@Entity()
export class PerformanceData {
import { Collection, Entity, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-import type { PerformanceData } from './PerformanceData';
+import type { PerformanceData } from './PerformanceData.js';
@Entity()
export class PerformanceRecord {
import Queue from 'mnemonist/queue.js';
-import { Constants } from './Constants';
+import { Constants } from './Constants.js';
export enum AsyncLockType {
configuration = 'configuration',
-import { isNullOrUndefined } from './Utils';
-import type { ChargingStation } from '../charging-station';
+import { isNullOrUndefined } from './Utils.js';
+import type { ChargingStation } from '../charging-station/index.js';
import type {
ChargingStationAutomaticTransactionGeneratorConfiguration,
ConnectorStatus,
EvseStatusConfiguration,
EvseStatusWorkerType,
-} from '../types';
+} from '../types/index.js';
export const buildChargingStationAutomaticTransactionGeneratorConfiguration = (
chargingStation: ChargingStation,
getDefaultPerformanceStorageUri,
handleFileException,
logPrefix,
-} from './ConfigurationUtils';
-import { Constants } from './Constants';
-import { hasOwnProp, isCFEnvironment, isUndefined, once } from './Utils';
+} from './ConfigurationUtils.js';
+import { Constants } from './Constants.js';
+import { hasOwnProp, isCFEnvironment, isUndefined, once } from './Utils.js';
import {
ApplicationProtocol,
type ConfigurationData,
SupervisionUrlDistribution,
type UIServerConfiguration,
type WorkerConfiguration,
-} from '../types';
+} from '../types/index.js';
import {
DEFAULT_ELEMENT_START_DELAY,
DEFAULT_POOL_MAX_SIZE,
DEFAULT_POOL_MIN_SIZE,
DEFAULT_WORKER_START_DELAY,
WorkerProcessType,
-} from '../worker';
+} from '../worker/index.js';
type ConfigurationSectionType =
| LogConfiguration
import chalk from 'chalk';
-import { Constants } from './Constants';
-import { isNotEmptyString, logPrefix as utilsLogPrefix } from './Utils';
-import { type ElementsPerWorkerType, FileType, StorageType } from '../types';
-import { WorkerProcessType } from '../worker';
+import { Constants } from './Constants.js';
+import { isNotEmptyString, logPrefix as utilsLogPrefix } from './Utils.js';
+import { type ElementsPerWorkerType, FileType, StorageType } from '../types/index.js';
+import { WorkerProcessType } from '../worker/index.js';
export const logPrefix = (): string => {
return utilsLogPrefix(' Simulator configuration |');
CurrentType,
OCPPVersion,
VendorParametersKey,
-} from '../types';
+} from '../types/index.js';
export class Constants {
static readonly DEFAULT_STATION_INFO: Partial<ChargingStationInfo> = Object.freeze({
import chalk from 'chalk';
-import { logger } from './Logger';
-import { isNotEmptyString } from './Utils';
-import type { ChargingStation } from '../charging-station';
+import { logger } from './Logger.js';
+import { isNotEmptyString } from './Utils.js';
+import type { ChargingStation } from '../charging-station/index.js';
import type {
EmptyObject,
FileType,
IncomingRequestCommand,
JsonType,
RequestCommand,
-} from '../types';
+} from '../types/index.js';
const defaultErrorParams = {
throwError: true,
import { type FSWatcher, type WatchListener, readFileSync, watch } from 'node:fs';
-import { handleFileException } from './ErrorUtils';
-import { logger } from './Logger';
-import { isNotEmptyString } from './Utils';
-import type { FileType, JsonType } from '../types';
+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,
import TransportType from 'winston/lib/winston/transports/index.js';
import DailyRotateFile from 'winston-daily-rotate-file';
-import { Configuration } from './Configuration';
-import { insertAt } from './Utils';
-import { ConfigurationSection, type LogConfiguration } from '../types';
+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,
buildChargingStationAutomaticTransactionGeneratorConfiguration,
buildConnectorsStatus,
buildEvsesStatus,
-} from './ChargingStationConfigurationUtils';
-import type { ChargingStation } from '../charging-station';
+} from './ChargingStationConfigurationUtils.js';
+import type { ChargingStation } from '../charging-station/index.js';
import {
type ChargingStationData,
type ChargingStationWorkerMessage,
ChargingStationWorkerMessageEvents,
type Statistics,
-} from '../types';
+} from '../types/index.js';
export const buildStartedMessage = (
chargingStation: ChargingStation,
-import { isEmptyArray, isNullOrUndefined } from './Utils';
+import { isEmptyArray, isNullOrUndefined } from './Utils.js';
/**
* Computes the average of the given data set.
secondsToMilliseconds,
} from 'date-fns';
-import { Constants } from './Constants';
-import { type TimestampedData, WebSocketCloseEventStatusString } from '../types';
+import { Constants } from './Constants.js';
+import { type TimestampedData, WebSocketCloseEventStatusString } from '../types/index.js';
export const logPrefix = (prefixString = ''): string => {
return `${new Date().toLocaleString()}${prefixString}`;
-export { ACElectricUtils, DCElectricUtils } from './ElectricUtils';
-export { AsyncLock, AsyncLockType } from './AsyncLock';
+export { ACElectricUtils, DCElectricUtils } from './ElectricUtils.js';
+export { AsyncLock, AsyncLockType } from './AsyncLock.js';
export {
OutputFormat,
buildChargingStationAutomaticTransactionGeneratorConfiguration,
buildConnectorsStatus,
buildEvsesStatus,
-} from './ChargingStationConfigurationUtils';
-export { CircularArray } from './CircularArray';
-export { Configuration } from './Configuration';
-export { Constants } from './Constants';
+} from './ChargingStationConfigurationUtils.js';
+export { CircularArray } from './CircularArray.js';
+export { Configuration } from './Configuration.js';
+export { Constants } from './Constants.js';
export {
handleFileException,
handleUncaughtException,
handleUnhandledRejection,
handleSendMessageError,
setDefaultErrorParams,
-} from './ErrorUtils';
-export { watchJsonFile } from './FileUtils';
+} from './ErrorUtils.js';
+export { watchJsonFile } from './FileUtils.js';
export {
buildPerformanceStatisticsMessage,
buildUpdatedMessage,
buildStartedMessage,
buildStoppedMessage,
-} from './MessageChannelUtils';
+} from './MessageChannelUtils.js';
export {
JSONStringifyWithMapSupport,
cloneObject,
secureRandom,
sleep,
validateUUID,
-} from './Utils';
-export { average, median, nthPercentile, stdDeviation } from './StatisticUtils';
-export { logger } from './Logger';
+} from './Utils.js';
+export { average, median, nthPercentile, stdDeviation } from './StatisticUtils.js';
+export { logger } from './Logger.js';
import type { PoolInfo } from 'poolifier';
-import type { SetInfo, WorkerData, WorkerOptions } from './WorkerTypes';
-import { defaultErrorHandler, defaultExitHandler } from './WorkerUtils';
+import type { SetInfo, WorkerData, WorkerOptions } from './WorkerTypes.js';
+import { defaultErrorHandler, defaultExitHandler } from './WorkerUtils.js';
export abstract class WorkerAbstract<T extends WorkerData> {
protected readonly workerScript: string;
import { availableParallelism } from 'poolifier';
-import type { WorkerOptions } from './WorkerTypes';
+import type { WorkerOptions } from './WorkerTypes.js';
export const EMPTY_FUNCTION = Object.freeze(() => {
/* This is intentional */
import { DynamicThreadPool, type PoolInfo } from 'poolifier';
-import { WorkerAbstract } from './WorkerAbstract';
-import type { WorkerData, WorkerOptions } from './WorkerTypes';
-import { randomizeDelay, sleep } from './WorkerUtils';
+import { WorkerAbstract } from './WorkerAbstract.js';
+import type { WorkerData, WorkerOptions } from './WorkerTypes.js';
+import { randomizeDelay, sleep } from './WorkerUtils.js';
export class WorkerDynamicPool extends WorkerAbstract<WorkerData> {
private readonly pool: DynamicThreadPool<WorkerData>;
import { isMainThread } from 'node:worker_threads';
-import type { WorkerAbstract } from './WorkerAbstract';
-import { DEFAULT_WORKER_OPTIONS } from './WorkerConstants';
-import { WorkerDynamicPool } from './WorkerDynamicPool';
-import { WorkerFixedPool } from './WorkerFixedPool';
-import { WorkerSet } from './WorkerSet';
-import { type WorkerData, type WorkerOptions, WorkerProcessType } from './WorkerTypes';
+import type { WorkerAbstract } from './WorkerAbstract.js';
+import { DEFAULT_WORKER_OPTIONS } from './WorkerConstants.js';
+import { WorkerDynamicPool } from './WorkerDynamicPool.js';
+import { WorkerFixedPool } from './WorkerFixedPool.js';
+import { WorkerSet } from './WorkerSet.js';
+import { type WorkerData, type WorkerOptions, WorkerProcessType } from './WorkerTypes.js';
export class WorkerFactory {
private constructor() {
import { FixedThreadPool, type PoolInfo } from 'poolifier';
-import { WorkerAbstract } from './WorkerAbstract';
-import type { WorkerData, WorkerOptions } from './WorkerTypes';
-import { randomizeDelay, sleep } from './WorkerUtils';
+import { WorkerAbstract } from './WorkerAbstract.js';
+import type { WorkerData, WorkerOptions } from './WorkerTypes.js';
+import { randomizeDelay, sleep } from './WorkerUtils.js';
export class WorkerFixedPool extends WorkerAbstract<WorkerData> {
private readonly pool: FixedThreadPool<WorkerData>;
import { EventEmitterAsyncResource } from 'node:events';
import { SHARE_ENV, Worker } from 'node:worker_threads';
-import { WorkerAbstract } from './WorkerAbstract';
-import { EMPTY_FUNCTION, workerSetVersion } from './WorkerConstants';
+import { WorkerAbstract } from './WorkerAbstract.js';
+import { EMPTY_FUNCTION, workerSetVersion } from './WorkerConstants.js';
import {
type SetInfo,
type WorkerData,
type WorkerOptions,
type WorkerSetElement,
WorkerSetEvents,
-} from './WorkerTypes';
-import { randomizeDelay, sleep } from './WorkerUtils';
+} from './WorkerTypes.js';
+import { randomizeDelay, sleep } from './WorkerUtils.js';
export class WorkerSet extends WorkerAbstract<WorkerData> {
public readonly emitter: EventEmitterAsyncResource | undefined;
-export type { WorkerAbstract } from './WorkerAbstract';
+export type { WorkerAbstract } from './WorkerAbstract.js';
export {
DEFAULT_ELEMENT_START_DELAY,
DEFAULT_POOL_MAX_SIZE,
DEFAULT_POOL_MIN_SIZE,
DEFAULT_WORKER_START_DELAY,
-} from './WorkerConstants';
-export { WorkerFactory } from './WorkerFactory';
+} from './WorkerConstants.js';
+export { WorkerFactory } from './WorkerFactory.js';
export {
type WorkerData,
WorkerEvents,
type WorkerMessage,
WorkerMessageEvents,
WorkerProcessType,
-} from './WorkerTypes';
+} from './WorkerTypes.js';
import { expect } from 'expect';
-import { CircularArray, DEFAULT_CIRCULAR_ARRAY_SIZE } from '../../src/utils/CircularArray';
+import { CircularArray, DEFAULT_CIRCULAR_ARRAY_SIZE } from '../../src/utils/CircularArray.js';
await describe('CircularArray test suite', async () => {
await it('Verify that circular array can be instantiated', () => {
import { expect } from 'expect';
-import { ACElectricUtils, DCElectricUtils } from '../../src/utils/ElectricUtils';
+import { ACElectricUtils, DCElectricUtils } from '../../src/utils/ElectricUtils.js';
await describe('ElectricUtils test suite', async () => {
await it('Verify DCElectricUtils.power()', () => {
import { expect } from 'expect';
-import { average, median, nthPercentile, stdDeviation } from '../../src/utils/StatisticUtils';
+import { average, median, nthPercentile, stdDeviation } from '../../src/utils/StatisticUtils.js';
await describe('StatisticUtils test suite', async () => {
await it('Verify average()', () => {
import { hoursToMilliseconds, hoursToSeconds } from 'date-fns';
import { expect } from 'expect';
-import { Constants } from '../../src/utils/Constants';
+import { Constants } from '../../src/utils/Constants.js';
import {
cloneObject,
convertToBoolean,
secureRandom,
sleep,
validateUUID,
-} from '../../src/utils/Utils';
+} from '../../src/utils/Utils.js';
await describe('Utils test suite', async () => {
await it('Verify generateUUID()/validateUUID()', () => {
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "es2022",
- "module": "esnext",
+ "module": "NodeNext",
"lib": ["es2022"],
"removeComments": true,
"importHelpers": true,
"strict": true,
- "moduleResolution": "node",
+ "moduleResolution": "NodeNext",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"verbatimModuleSyntax": true,