"EditorConfig.EditorConfig",
"ms-azuretools.vscode-docker",
"streetsidesoftware.code-spell-checker",
- "Vue.volar"
+ "Vue.volar",
+ "Vue.vscode-typescript-vue-plugin"
]
}
// Partial Copyright Jerome Benoit. 2021. All Rights Reserved.
import PerformanceStatistics from '../performance/PerformanceStatistics';
-import {
+import type {
AutomaticTransactionGeneratorConfiguration,
Status,
} from '../types/AutomaticTransactionGenerator';
import { MeterValuesRequest, RequestCommand } from '../types/ocpp/Requests';
-import { MeterValuesResponse } from '../types/ocpp/Responses';
+import type { MeterValuesResponse } from '../types/ocpp/Responses';
import {
AuthorizationStatus,
AuthorizeRequest,
import { version } from '../../package.json';
import BaseError from '../exception/BaseError';
-import { Storage } from '../performance/storage/Storage';
+import type { Storage } from '../performance/storage/Storage';
import { StorageFactory } from '../performance/storage/StorageFactory';
import {
ChargingStationData,
ChargingStationWorkerMessageData,
ChargingStationWorkerMessageEvents,
} from '../types/ChargingStationWorker';
-import { StationTemplateUrl } from '../types/ConfigurationData';
-import Statistics from '../types/Statistics';
+import type { StationTemplateUrl } from '../types/ConfigurationData';
+import type Statistics from '../types/Statistics';
import Configuration from '../utils/Configuration';
import logger from '../utils/Logger';
import Utils from '../utils/Utils';
-import WorkerAbstract from '../worker/WorkerAbstract';
+import type WorkerAbstract from '../worker/WorkerAbstract';
import WorkerFactory from '../worker/WorkerFactory';
import { ChargingStationUtils } from './ChargingStationUtils';
-import { AbstractUIServer } from './ui-server/AbstractUIServer';
+import type { AbstractUIServer } from './ui-server/AbstractUIServer';
import { UIServiceUtils } from './ui-server/ui-services/UIServiceUtils';
import UIServerFactory from './ui-server/UIServerFactory';
import BaseError from '../exception/BaseError';
import OCPPError from '../exception/OCPPError';
import PerformanceStatistics from '../performance/PerformanceStatistics';
-import { AutomaticTransactionGeneratorConfiguration } from '../types/AutomaticTransactionGenerator';
-import ChargingStationConfiguration from '../types/ChargingStationConfiguration';
-import ChargingStationInfo from '../types/ChargingStationInfo';
-import ChargingStationOcppConfiguration from '../types/ChargingStationOcppConfiguration';
+import type { AutomaticTransactionGeneratorConfiguration } from '../types/AutomaticTransactionGenerator';
+import type ChargingStationConfiguration from '../types/ChargingStationConfiguration';
+import type ChargingStationInfo from '../types/ChargingStationInfo';
+import type ChargingStationOcppConfiguration from '../types/ChargingStationOcppConfiguration';
import ChargingStationTemplate, {
CurrentType,
PowerUnits,
WsOptions,
} from '../types/ChargingStationTemplate';
import { SupervisionUrlDistribution } from '../types/ConfigurationData';
-import { ConnectorStatus } from '../types/ConnectorStatus';
+import type { ConnectorStatus } from '../types/ConnectorStatus';
import { FileType } from '../types/FileType';
-import { JsonType } from '../types/JsonType';
+import type { JsonType } from '../types/JsonType';
import { ChargePointErrorCode } from '../types/ocpp/ChargePointErrorCode';
import { ChargePointStatus } from '../types/ocpp/ChargePointStatus';
import { ChargingProfile, ChargingRateUnitType } from '../types/ocpp/ChargingProfile';
import OCPP16RequestService from './ocpp/1.6/OCPP16RequestService';
import OCPP16ResponseService from './ocpp/1.6/OCPP16ResponseService';
import { OCPP16ServiceUtils } from './ocpp/1.6/OCPP16ServiceUtils';
-import OCPPIncomingRequestService from './ocpp/OCPPIncomingRequestService';
-import OCPPRequestService from './ocpp/OCPPRequestService';
+import type OCPPIncomingRequestService from './ocpp/OCPPIncomingRequestService';
+import type OCPPRequestService from './ocpp/OCPPRequestService';
import SharedLRUCache from './SharedLRUCache';
export default class ChargingStation {
-import { ConfigurationKey } from '../types/ChargingStationOcppConfiguration';
-import { StandardParametersKey } from '../types/ocpp/Configuration';
+import type { ConfigurationKey } from '../types/ChargingStationOcppConfiguration';
+import type { StandardParametersKey } from '../types/ocpp/Configuration';
import logger from '../utils/Logger';
import type ChargingStation from './ChargingStation';
import moment from 'moment';
import BaseError from '../exception/BaseError';
-import ChargingStationInfo from '../types/ChargingStationInfo';
+import type ChargingStationInfo from '../types/ChargingStationInfo';
import ChargingStationTemplate, {
AmpereUnits,
CurrentType,
Voltage,
} from '../types/ChargingStationTemplate';
-import { SampledValueTemplate } from '../types/MeasurandPerPhaseSampledValueTemplates';
+import type { SampledValueTemplate } from '../types/MeasurandPerPhaseSampledValueTemplates';
import { ChargingProfileKindType, RecurrencyKindType } from '../types/ocpp/1.6/ChargingProfile';
-import { ChargingProfile, ChargingSchedulePeriod } from '../types/ocpp/ChargingProfile';
+import type { ChargingProfile, ChargingSchedulePeriod } from '../types/ocpp/ChargingProfile';
import { StandardParametersKey } from '../types/ocpp/Configuration';
import { MeterValueMeasurand, MeterValuePhase } from '../types/ocpp/MeterValues';
import {
ChargingStationWorkerMessage,
ChargingStationWorkerMessageEvents,
} from '../types/ChargingStationWorker';
-import Statistics from '../types/Statistics';
+import type Statistics from '../types/Statistics';
import type ChargingStation from './ChargingStation';
export class MessageChannelUtils {
import LRUCache from 'mnemonist/lru-map-with-delete';
-import ChargingStationConfiguration from '../types/ChargingStationConfiguration';
-import ChargingStationTemplate from '../types/ChargingStationTemplate';
+import type ChargingStationConfiguration from '../types/ChargingStationConfiguration';
+import type ChargingStationTemplate from '../types/ChargingStationTemplate';
import Utils from '../utils/Utils';
enum CacheType {
-import { BroadcastChannelResponse, MessageEvent } from '../types/WorkerBroadcastChannel';
+import type { BroadcastChannelResponse, MessageEvent } from '../types/WorkerBroadcastChannel';
import logger from '../utils/Logger';
import type AbstractUIService from './ui-server/ui-services/AbstractUIService';
import WorkerBroadcastChannel from './WorkerBroadcastChannel';
import { BroadcastChannel } from 'worker_threads';
import BaseError from '../exception/BaseError';
-import {
+import type {
BroadcastChannelRequest,
BroadcastChannelResponse,
MessageEvent,
import path from 'path';
import { URL, fileURLToPath } from 'url';
-import { JSONSchemaType } from 'ajv';
+import type { JSONSchemaType } from 'ajv';
import { Client, FTPResponse } from 'basic-ftp';
import tar from 'tar';
import OCPPError from '../../../exception/OCPPError';
-import { JsonObject, JsonType } from '../../../types/JsonType';
+import type { JsonObject, JsonType } from '../../../types/JsonType';
import { OCPP16ChargePointErrorCode } from '../../../types/ocpp/1.6/ChargePointErrorCode';
import { OCPP16ChargePointStatus } from '../../../types/ocpp/1.6/ChargePointStatus';
import {
OCPP16SupportedFeatureProfiles,
} from '../../../types/ocpp/1.6/Configuration';
import { OCPP16DiagnosticsStatus } from '../../../types/ocpp/1.6/DiagnosticsStatus';
-import {
+import type {
OCPP16MeterValuesRequest,
OCPP16MeterValuesResponse,
} from '../../../types/ocpp/1.6/MeterValues';
SetChargingProfileRequest,
UnlockConnectorRequest,
} from '../../../types/ocpp/1.6/Requests';
-import {
+import type {
ChangeAvailabilityResponse,
ChangeConfigurationResponse,
ClearChargingProfileResponse,
OCPP16StopTransactionRequest,
OCPP16StopTransactionResponse,
} from '../../../types/ocpp/1.6/Transaction';
-import { OCPPConfigurationKey } from '../../../types/ocpp/Configuration';
+import type { OCPPConfigurationKey } from '../../../types/ocpp/Configuration';
import { ErrorType } from '../../../types/ocpp/ErrorType';
-import { IncomingRequestHandler } from '../../../types/ocpp/Requests';
-import { DefaultResponse } from '../../../types/ocpp/Responses';
+import type { IncomingRequestHandler } from '../../../types/ocpp/Requests';
+import type { DefaultResponse } from '../../../types/ocpp/Responses';
import Constants from '../../../utils/Constants';
import logger from '../../../utils/Logger';
import Utils from '../../../utils/Utils';
import path from 'path';
import { fileURLToPath } from 'url';
-import { JSONSchemaType } from 'ajv';
+import type { JSONSchemaType } from 'ajv';
import OCPPError from '../../../exception/OCPPError';
-import { JsonObject, JsonType } from '../../../types/JsonType';
-import { OCPP16MeterValuesRequest } from '../../../types/ocpp/1.6/MeterValues';
+import type { JsonObject, JsonType } from '../../../types/JsonType';
+import type { OCPP16MeterValuesRequest } from '../../../types/ocpp/1.6/MeterValues';
import {
DiagnosticsStatusNotificationRequest,
OCPP16BootNotificationRequest,
OCPP16RequestCommand,
OCPP16StatusNotificationRequest,
} from '../../../types/ocpp/1.6/Requests';
-import {
+import type {
OCPP16AuthorizeRequest,
OCPP16StartTransactionRequest,
OCPP16StopTransactionRequest,
} from '../../../types/ocpp/1.6/Transaction';
import { ErrorType } from '../../../types/ocpp/ErrorType';
-import { RequestParams } from '../../../types/ocpp/Requests';
+import type { RequestParams } from '../../../types/ocpp/Requests';
import Constants from '../../../utils/Constants';
import logger from '../../../utils/Logger';
import Utils from '../../../utils/Utils';
this.validatePayload.bind(this);
}
- public async requestHandler<Request extends JsonType, Response extends JsonType>(
+ public async requestHandler<RequestType extends JsonType, ResponseType extends JsonType>(
chargingStation: ChargingStation,
commandName: OCPP16RequestCommand,
commandParams?: JsonType,
params?: RequestParams
- ): Promise<Response> {
+ ): Promise<ResponseType> {
if (ChargingStationUtils.isRequestCommandSupported(commandName, chargingStation)) {
- const requestPayload = this.buildRequestPayload<Request>(
+ const requestPayload = this.buildRequestPayload<RequestType>(
chargingStation,
commandName,
commandParams
requestPayload,
commandName,
params
- )) as unknown as Response;
+ )) as unknown as ResponseType;
}
throw new OCPPError(
ErrorType.NOT_SUPPORTED,
import path from 'path';
import { fileURLToPath } from 'url';
-import { JSONSchemaType } from 'ajv';
+import type { JSONSchemaType } from 'ajv';
import OCPPError from '../../../exception/OCPPError';
-import { JsonObject, JsonType } from '../../../types/JsonType';
+import type { JsonObject, JsonType } from '../../../types/JsonType';
import { OCPP16ChargePointErrorCode } from '../../../types/ocpp/1.6/ChargePointErrorCode';
import { OCPP16ChargePointStatus } from '../../../types/ocpp/1.6/ChargePointStatus';
import { OCPP16StandardParametersKey } from '../../../types/ocpp/1.6/Configuration';
-import {
+import type {
OCPP16MeterValuesRequest,
OCPP16MeterValuesResponse,
} from '../../../types/ocpp/1.6/MeterValues';
OCPP16StopTransactionResponse,
} from '../../../types/ocpp/1.6/Transaction';
import { ErrorType } from '../../../types/ocpp/ErrorType';
-import { ResponseHandler } from '../../../types/ocpp/Responses';
+import type { ResponseHandler } from '../../../types/ocpp/Responses';
import logger from '../../../utils/Logger';
import Utils from '../../../utils/Utils';
import type ChargingStation from '../../ChargingStation';
import OCPPError from '../../../exception/OCPPError';
import { CurrentType, Voltage } from '../../../types/ChargingStationTemplate';
-import MeasurandPerPhaseSampledValueTemplates, {
- SampledValueTemplate,
-} from '../../../types/MeasurandPerPhaseSampledValueTemplates';
-import MeasurandValues from '../../../types/MeasurandValues';
+import type MeasurandPerPhaseSampledValueTemplates from '../../../types/MeasurandPerPhaseSampledValueTemplates';
+// eslint-disable-next-line no-duplicate-imports
+import type { SampledValueTemplate } from '../../../types/MeasurandPerPhaseSampledValueTemplates';
+import type MeasurandValues from '../../../types/MeasurandValues';
import {
OCPP16StandardParametersKey,
OCPP16SupportedFeatureProfiles,
-import { JSONSchemaType } from 'ajv';
+import type { JSONSchemaType } from 'ajv';
import Ajv from 'ajv-draft-04';
import ajvFormats from 'ajv-formats';
import OCPPError from '../../exception/OCPPError';
-import { HandleErrorParams } from '../../types/Error';
-import { JsonType } from '../../types/JsonType';
-import { IncomingRequestCommand } from '../../types/ocpp/Requests';
+import type { HandleErrorParams } from '../../types/Error';
+import type { JsonType } from '../../types/JsonType';
+import type { IncomingRequestCommand } from '../../types/ocpp/Requests';
import logger from '../../utils/Logger';
import type ChargingStation from '../ChargingStation';
import { OCPPServiceUtils } from './OCPPServiceUtils';
-import { JSONSchemaType } from 'ajv';
+import type { JSONSchemaType } from 'ajv';
import Ajv from 'ajv-draft-04';
import ajvFormats from 'ajv-formats';
import OCPPError from '../../exception/OCPPError';
import PerformanceStatistics from '../../performance/PerformanceStatistics';
-import { EmptyObject } from '../../types/EmptyObject';
-import { HandleErrorParams } from '../../types/Error';
-import { JsonObject, JsonType } from '../../types/JsonType';
+import type { EmptyObject } from '../../types/EmptyObject';
+import type { HandleErrorParams } from '../../types/Error';
+import type { JsonObject, JsonType } from '../../types/JsonType';
import { ErrorType } from '../../types/ocpp/ErrorType';
import { MessageType } from '../../types/ocpp/MessageType';
import {
RequestParams,
ResponseType,
} from '../../types/ocpp/Requests';
-import { ErrorResponse, Response } from '../../types/ocpp/Responses';
+import type { ErrorResponse, Response } from '../../types/ocpp/Responses';
import Constants from '../../utils/Constants';
import logger from '../../utils/Logger';
import Utils from '../../utils/Utils';
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- public abstract requestHandler<Request extends JsonType, Response extends JsonType>(
+ public abstract requestHandler<RequestType extends JsonType, ResponseType extends JsonType>(
chargingStation: ChargingStation,
commandName: RequestCommand,
commandParams?: JsonType,
params?: RequestParams
- ): Promise<Response>;
+ ): Promise<ResponseType>;
}
-import { JSONSchemaType } from 'ajv';
+import type { JSONSchemaType } from 'ajv';
import Ajv from 'ajv-draft-04';
import ajvFormats from 'ajv-formats';
import OCPPError from '../../exception/OCPPError';
-import { JsonType } from '../../types/JsonType';
-import { RequestCommand } from '../../types/ocpp/Requests';
+import type { JsonType } from '../../types/JsonType';
+import type { RequestCommand } from '../../types/ocpp/Requests';
import logger from '../../utils/Logger';
import type ChargingStation from '../ChargingStation';
import { OCPPServiceUtils } from './OCPPServiceUtils';
-import { DefinedError, ErrorObject } from 'ajv';
+import type { DefinedError, ErrorObject } from 'ajv';
import { ErrorType } from '../../types/ocpp/ErrorType';
-import { Server as HttpServer } from 'http';
+import type { Server as HttpServer } from 'http';
-import WebSocket from 'ws';
+import type WebSocket from 'ws';
-import { ChargingStationData } from '../../types/ChargingStationWorker';
-import {
+import type { ChargingStationData } from '../../types/ChargingStationWorker';
+import type {
ProcedureName,
ProtocolRequest,
ProtocolResponse,
import { StatusCodes } from 'http-status-codes';
import BaseError from '../../exception/BaseError';
-import { ServerOptions } from '../../types/ConfigurationData';
+import type { ServerOptions } from '../../types/ConfigurationData';
import {
ProcedureName,
Protocol,
import chalk from 'chalk';
-import { ServerOptions } from '../../types/ConfigurationData';
+import type { ServerOptions } from '../../types/ConfigurationData';
import { ApplicationProtocol } from '../../types/UIProtocol';
import Configuration from '../../utils/Configuration';
-import { AbstractUIServer } from './AbstractUIServer';
+import type { AbstractUIServer } from './AbstractUIServer';
import { UIServiceUtils } from './ui-services/UIServiceUtils';
import UIHttpServer from './UIHttpServer';
import UIWebSocketServer from './UIWebSocketServer';
-import { IncomingMessage } from 'http';
+import type { IncomingMessage } from 'http';
import WebSocket from 'ws';
-import { ServerOptions } from '../../types/ConfigurationData';
+import type { ServerOptions } from '../../types/ConfigurationData';
import { Protocol, ProtocolVersion } from '../../types/UIProtocol';
import Configuration from '../../utils/Configuration';
import logger from '../../utils/Logger';
-import { RawData } from 'ws';
+import type { RawData } from 'ws';
import BaseError from '../../../exception/BaseError';
import { Bootstrap } from '../../../internal';
-import { JsonType } from '../../../types/JsonType';
+import type { JsonType } from '../../../types/JsonType';
import {
ProcedureName,
ProtocolRequest,
BroadcastChannelProcedureName,
BroadcastChannelRequestPayload,
} from '../../../types/WorkerBroadcastChannel';
-import { AbstractUIServer } from '../AbstractUIServer';
+import type { AbstractUIServer } from '../AbstractUIServer';
import AbstractUIService from './AbstractUIService';
export default class UIService001 extends AbstractUIService {
import { ProtocolVersion } from '../../../types/UIProtocol';
-import { AbstractUIServer } from '../AbstractUIServer';
-import AbstractUIService from './AbstractUIService';
+import type { AbstractUIServer } from '../AbstractUIServer';
+import type AbstractUIService from './AbstractUIService';
import UIService001 from './UIService001';
export default class UIServiceFactory {
-import { IncomingMessage } from 'http';
+import type { IncomingMessage } from 'http';
import { Protocol, ProtocolVersion } from '../../../types/UIProtocol';
import logger from '../../../utils/Logger';
// Partial Copyright Jerome Benoit. 2021. All Rights Reserved.
-import { JsonType } from '../types/JsonType';
+import type { JsonType } from '../types/JsonType';
import { ErrorType } from '../types/ocpp/ErrorType';
-import { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests';
+import type { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests';
import BaseError from './BaseError';
export default class OCPPError extends BaseError {
// Partial Copyright Jerome Benoit. 2021. All Rights Reserved.
import { PerformanceEntry, PerformanceObserver, performance } from 'perf_hooks';
-import { URL } from 'url';
+import type { URL } from 'url';
import { parentPort } from 'worker_threads';
import { MessageChannelUtils } from '../charging-station/MessageChannelUtils';
import { MessageType } from '../types/ocpp/MessageType';
-import { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests';
-import Statistics, { StatisticsData, TimeSeries } from '../types/Statistics';
+import type { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests';
+import type Statistics from '../types/Statistics';
+// eslint-disable-next-line no-duplicate-imports
+import type { StatisticsData, TimeSeries } from '../types/Statistics';
import { CircularArray, DEFAULT_CIRCULAR_ARRAY_SIZE } from '../utils/CircularArray';
import Configuration from '../utils/Configuration';
import logger from '../utils/Logger';
import lockfile from 'proper-lockfile';
import { FileType } from '../../types/FileType';
-import Statistics from '../../types/Statistics';
+import type Statistics from '../../types/Statistics';
import FileUtils from '../../utils/FileUtils';
import { Storage } from './Storage';
import { PerformanceData } from '../../types/orm/entities/PerformanceData';
import { PerformanceRecord } from '../../types/orm/entities/PerformanceRecord';
-import Statistics from '../../types/Statistics';
+import type Statistics from '../../types/Statistics';
import { MikroORMDBType, StorageType } from '../../types/Storage';
import Constants from '../../utils/Constants';
import { Storage } from './Storage';
import { MongoClient } from 'mongodb';
-import Statistics from '../../types/Statistics';
+import type Statistics from '../../types/Statistics';
import { StorageType } from '../../types/Storage';
import Constants from '../../utils/Constants';
import { Storage } from './Storage';
import { URL } from 'url';
-import { EmptyObject } from '../../types/EmptyObject';
-import { HandleErrorParams } from '../../types/Error';
-import Statistics from '../../types/Statistics';
+import type { EmptyObject } from '../../types/EmptyObject';
+import type { HandleErrorParams } from '../../types/Error';
+import type Statistics from '../../types/Statistics';
import { DBName, StorageType } from '../../types/Storage';
import logger from '../../utils/Logger';
import Utils from '../../utils/Utils';
import { JsonFileStorage } from './JsonFileStorage';
import { MikroOrmStorage } from './MikroOrmStorage';
import { MongoDBStorage } from './MongoDBStorage';
-import { Storage } from './Storage';
+import type { Storage } from './Storage';
export class StorageFactory {
private constructor() {
-import { ChargingStationInfoConfiguration } from './ChargingStationInfo';
-import ChargingStationOcppConfiguration from './ChargingStationOcppConfiguration';
+import type { ChargingStationInfoConfiguration } from './ChargingStationInfo';
+import type ChargingStationOcppConfiguration from './ChargingStationOcppConfiguration';
export default interface ChargingStationConfiguration
extends ChargingStationInfoConfiguration,
-import ChargingStationTemplate from './ChargingStationTemplate';
+import type ChargingStationTemplate from './ChargingStationTemplate';
export default interface ChargingStationInfo
extends Omit<
-import { OCPPConfigurationKey } from './ocpp/Configuration';
+import type { OCPPConfigurationKey } from './ocpp/Configuration';
export interface ConfigurationKey extends OCPPConfigurationKey {
visible?: boolean;
-import { ClientRequestArgs } from 'http';
+import type { ClientRequestArgs } from 'http';
-import { ClientOptions } from 'ws';
+import type { ClientOptions } from 'ws';
-import { AutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator';
-import ChargingStationOcppConfiguration from './ChargingStationOcppConfiguration';
-import { ConnectorStatus } from './ConnectorStatus';
-import { OCPPProtocol } from './ocpp/OCPPProtocol';
-import { OCPPVersion } from './ocpp/OCPPVersion';
-import { IncomingRequestCommand, RequestCommand } from './ocpp/Requests';
+import type { AutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator';
+import type ChargingStationOcppConfiguration from './ChargingStationOcppConfiguration';
+import type { ConnectorStatus } from './ConnectorStatus';
+import type { OCPPProtocol } from './ocpp/OCPPProtocol';
+import type { OCPPVersion } from './ocpp/OCPPVersion';
+import type { IncomingRequestCommand, RequestCommand } from './ocpp/Requests';
export enum CurrentType {
AC = 'AC',
-import ChargingStationInfo from './ChargingStationInfo';
-import { ConnectorStatus } from './ConnectorStatus';
-import { JsonObject } from './JsonType';
-import { BootNotificationResponse } from './ocpp/Responses';
-import Statistics from './Statistics';
+import type ChargingStationInfo from './ChargingStationInfo';
+import type { ConnectorStatus } from './ConnectorStatus';
+import type { JsonObject } from './JsonType';
+import type { BootNotificationResponse } from './ocpp/Responses';
+import type Statistics from './Statistics';
import { WorkerData, WorkerMessage, WorkerMessageEvents } from './Worker';
export interface ChargingStationWorkerOptions extends JsonObject {
-import { ListenOptions } from 'net';
+import type { ListenOptions } from 'net';
import type { WorkerChoiceStrategy } from 'poolifier';
-import { ServerOptions as WSServerOptions } from 'ws';
+import type { ServerOptions as WSServerOptions } from 'ws';
-import { StorageType } from './Storage';
-import { ApplicationProtocol } from './UIProtocol';
-import { WorkerProcessType } from './Worker';
+import type { StorageType } from './Storage';
+import type { ApplicationProtocol } from './UIProtocol';
+import type { WorkerProcessType } from './Worker';
export type ServerOptions = WSServerOptions & ListenOptions;
-import { SampledValueTemplate } from './MeasurandPerPhaseSampledValueTemplates';
-import { ChargePointStatus } from './ocpp/ChargePointStatus';
-import { ChargingProfile } from './ocpp/ChargingProfile';
-import { MeterValue } from './ocpp/MeterValues';
-import { AvailabilityType } from './ocpp/Requests';
+import type { SampledValueTemplate } from './MeasurandPerPhaseSampledValueTemplates';
+import type { ChargePointStatus } from './ocpp/ChargePointStatus';
+import type { ChargingProfile } from './ocpp/ChargingProfile';
+import type { MeterValue } from './ocpp/MeterValues';
+import type { AvailabilityType } from './ocpp/Requests';
export interface ConnectorStatus {
availability: AvailabilityType;
-import { SampledValue } from './ocpp/MeterValues';
+import type { SampledValue } from './ocpp/MeterValues';
export interface SampledValueTemplate extends SampledValue {
fluctuationPercent?: number;
-import { CircularArray } from '../utils/CircularArray';
-import { WorkerData } from './Worker';
+import type { CircularArray } from '../utils/CircularArray';
+import type { WorkerData } from './Worker';
export interface TimeSeries {
timestamp: number;
-import { Configuration } from '@mikro-orm/core';
+import type { Configuration } from '@mikro-orm/core';
export type MikroORMDBType = keyof typeof Configuration.PLATFORMS;
-import { JsonObject } from './JsonType';
+import type { JsonObject } from './JsonType';
export enum Protocol {
UI = 'ui',
-import { Worker } from 'worker_threads';
+import type { Worker } from 'worker_threads';
-import { PoolOptions } from 'poolifier';
+import type { PoolOptions } from 'poolifier';
export enum WorkerProcessType {
WORKER_SET = 'workerSet',
-import { RequestPayload, ResponsePayload } from './UIProtocol';
+import type { RequestPayload, ResponsePayload } from './UIProtocol';
export type BroadcastChannelRequest = [
string,
-import { JsonObject } from '../../JsonType';
+import type { JsonObject } from '../../JsonType';
export interface OCPP16ChargingProfile extends JsonObject {
chargingProfileId: number;
-import { EmptyObject } from '../../EmptyObject';
-import { JsonObject } from '../../JsonType';
+import type { EmptyObject } from '../../EmptyObject';
+import type { JsonObject } from '../../JsonType';
export enum MeterValueUnit {
WATT_HOUR = 'Wh',
-import { EmptyObject } from '../../EmptyObject';
-import { JsonObject } from '../../JsonType';
-import { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
-import { OCPP16ChargePointStatus } from './ChargePointStatus';
-import { ChargingProfilePurposeType, OCPP16ChargingProfile } from './ChargingProfile';
-import { OCPP16StandardParametersKey } from './Configuration';
-import { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
+import type { EmptyObject } from '../../EmptyObject';
+import type { JsonObject } from '../../JsonType';
+import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
+import type { OCPP16ChargePointStatus } from './ChargePointStatus';
+import type { ChargingProfilePurposeType, OCPP16ChargingProfile } from './ChargingProfile';
+import type { OCPP16StandardParametersKey } from './Configuration';
+import type { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
export enum OCPP16RequestCommand {
BOOT_NOTIFICATION = 'BootNotification',
-import { EmptyObject } from '../../EmptyObject';
-import { JsonObject } from '../../JsonType';
-import { OCPPConfigurationKey } from '../Configuration';
+import type { EmptyObject } from '../../EmptyObject';
+import type { JsonObject } from '../../JsonType';
+import type { OCPPConfigurationKey } from '../Configuration';
export interface OCPP16HeartbeatResponse extends JsonObject {
currentTime: string;
-import { JsonObject } from '../../JsonType';
-import { OCPP16MeterValue } from './MeterValues';
+import type { JsonObject } from '../../JsonType';
+import type { OCPP16MeterValue } from './MeterValues';
export enum OCPP16StopTransactionReason {
NONE = '',
-import { JsonObject } from '../JsonType';
+import type { JsonObject } from '../JsonType';
import {
OCPP16StandardParametersKey,
OCPP16SupportedFeatureProfiles,
import type ChargingStation from '../../charging-station/ChargingStation';
-import OCPPError from '../../exception/OCPPError';
-import { JsonType } from '../JsonType';
+import type OCPPError from '../../exception/OCPPError';
+import type { JsonType } from '../JsonType';
import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus';
-import { OCPP16MeterValuesRequest } from './1.6/MeterValues';
+import type { OCPP16MeterValuesRequest } from './1.6/MeterValues';
import {
OCPP16AvailabilityType,
OCPP16BootNotificationRequest,
OCPP16RequestCommand,
OCPP16StatusNotificationRequest,
} from './1.6/Requests';
-import { MessageType } from './MessageType';
+import type { MessageType } from './MessageType';
export type RequestCommand = OCPP16RequestCommand;
import type ChargingStation from '../../charging-station/ChargingStation';
-import { JsonType } from '../JsonType';
-import { OCPP16MeterValuesResponse } from './1.6/MeterValues';
+import type { JsonType } from '../JsonType';
+import type { OCPP16MeterValuesResponse } from './1.6/MeterValues';
import {
OCPP16AvailabilityStatus,
OCPP16BootNotificationResponse,
OCPP16TriggerMessageStatus,
OCPP16UnlockStatus,
} from './1.6/Responses';
-import { ErrorType } from './ErrorType';
-import { MessageType } from './MessageType';
+import type { ErrorType } from './ErrorType';
+import type { MessageType } from './MessageType';
export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType];
import { Collection, Entity, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
-import { PerformanceData } from './PerformanceData';
+import type { PerformanceData } from './PerformanceData';
@Entity()
export class PerformanceRecord {
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
- '@vue/typescript/recommended',
- 'plugin:prettier/recommended',
+ '@vue/eslint-config-typescript/recommended',
+ '@vue/eslint-config-prettier',
],
- parser: 'vue-eslint-parser',
-
parserOptions: {
- ecmaVersion: 2020,
- parser: '@typescript-eslint/parser',
+ ecmaVersion: 'latest',
},
rules: {
"@vue/cli-plugin-typescript": "~5.0.8",
"@vue/cli-plugin-unit-mocha": "~5.0.8",
"@vue/cli-service": "~5.0.8",
+ "@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.0",
"@vue/test-utils": "^2.0.2",
+ "@vue/tsconfig": "^0.1.3",
"chai": "^4.3.6",
"eslint": "^8.22.0",
- "eslint-config-prettier": "^8.5.0",
- "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.4.0",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
- "typescript": "^4.8.2",
- "vue-eslint-parser": "^9.0.3"
+ "typescript": "^4.8.2"
}
},
"node_modules/@achrinza/node-ipc": {
"resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.1.4.tgz",
"integrity": "sha512-IiA0SvDrJEgXvVxjNkHPFfDx6SXw0b/TUkqMcDZWNg9fnCAHbTpoo59YfJ9QLFkwa3raau5vSlRVzMSLDnfdtQ=="
},
+ "node_modules/@vue/eslint-config-prettier": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@vue/eslint-config-prettier/-/eslint-config-prettier-7.0.0.tgz",
+ "integrity": "sha512-/CTc6ML3Wta1tCe1gUeO0EYnVXfo3nJXsIhZ8WJr3sov+cGASr6yuiibJTL6lmIBm7GobopToOuB3B6AWyV0Iw==",
+ "dev": true,
+ "dependencies": {
+ "eslint-config-prettier": "^8.3.0",
+ "eslint-plugin-prettier": "^4.0.0"
+ },
+ "peerDependencies": {
+ "eslint": ">= 7.28.0",
+ "prettier": ">= 2.0.0"
+ }
+ },
"node_modules/@vue/eslint-config-typescript": {
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-11.0.0.tgz",
"vue": "^3.0.1"
}
},
+ "node_modules/@vue/tsconfig": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/@vue/tsconfig/-/tsconfig-0.1.3.tgz",
+ "integrity": "sha512-kQVsh8yyWPvHpb8gIc9l/HIDiiVUy1amynLNpCy8p+FoCiZXCo6fQos5/097MmnNZc9AtseDsCrfkhqCrJ8Olg==",
+ "dev": true,
+ "peerDependencies": {
+ "@types/node": "*"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@vue/vue-loader-v15": {
"name": "vue-loader",
"version": "15.10.0",
"resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.1.4.tgz",
"integrity": "sha512-IiA0SvDrJEgXvVxjNkHPFfDx6SXw0b/TUkqMcDZWNg9fnCAHbTpoo59YfJ9QLFkwa3raau5vSlRVzMSLDnfdtQ=="
},
+ "@vue/eslint-config-prettier": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@vue/eslint-config-prettier/-/eslint-config-prettier-7.0.0.tgz",
+ "integrity": "sha512-/CTc6ML3Wta1tCe1gUeO0EYnVXfo3nJXsIhZ8WJr3sov+cGASr6yuiibJTL6lmIBm7GobopToOuB3B6AWyV0Iw==",
+ "dev": true,
+ "requires": {
+ "eslint-config-prettier": "^8.3.0",
+ "eslint-plugin-prettier": "^4.0.0"
+ }
+ },
"@vue/eslint-config-typescript": {
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-11.0.0.tgz",
"dev": true,
"requires": {}
},
+ "@vue/tsconfig": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/@vue/tsconfig/-/tsconfig-0.1.3.tgz",
+ "integrity": "sha512-kQVsh8yyWPvHpb8gIc9l/HIDiiVUy1amynLNpCy8p+FoCiZXCo6fQos5/097MmnNZc9AtseDsCrfkhqCrJ8Olg==",
+ "dev": true,
+ "requires": {}
+ },
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.0.tgz",
"@vue/cli-plugin-typescript": "~5.0.8",
"@vue/cli-plugin-unit-mocha": "~5.0.8",
"@vue/cli-service": "~5.0.8",
+ "@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.0",
"@vue/test-utils": "^2.0.2",
+ "@vue/tsconfig": "^0.1.3",
"chai": "^4.3.6",
"eslint": "^8.22.0",
- "eslint-config-prettier": "^8.5.0",
- "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.4.0",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
- "typescript": "^4.8.2",
- "vue-eslint-parser": "^9.0.3"
+ "typescript": "^4.8.2"
},
"_id": "webui@0.1.0",
"gitHooks": {
-import { BaseConfig } from '@/type/ConfigurationType';
+import type { BaseConfig } from '@/type/ConfigurationType';
const config: BaseConfig = {
emobility: {
-import { JsonType } from '@/type/JsonType';
-import {
- ProcedureName,
- ProtocolResponse,
- ResponsePayload,
- ResponseStatus,
-} from '@/type/UIProtocol';
+import type { JsonType } from '@/type/JsonType';
+import { ProcedureName, ResponseStatus } from '@/type/UIProtocol';
+import type { ProtocolResponse, ResponsePayload } from '@/type/UIProtocol';
+
import Utils from './Utils';
import config from '@/assets/config';
import { v4 as uuidv4 } from 'uuid';
-import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
+import { createRouter, createWebHistory } from 'vue-router';
+import type { RouteRecordRaw } from 'vue-router';
import ChargingStationsView from '@/views/ChargingStationsView.vue';
const routes: Array<RouteRecordRaw> = [
-import { JsonObject } from './JsonType';
+import type { JsonObject } from './JsonType';
export type ChargingStationData = {
hashId: string;
-import { JsonObject } from './JsonType';
+import type { JsonObject } from './JsonType';
export enum Protocol {
UI = 'ui',
{
+ "extends": "@vue/tsconfig/tsconfig.node.json",
"compilerOptions": {
- "target": "esnext",
- "module": "esnext",
- "strict": true,
- "jsx": "preserve",
- "moduleResolution": "node",
"experimentalDecorators": true,
- "skipLibCheck": true,
- "esModuleInterop": true,
"allowSyntheticDefaultImports": true,
- "forceConsistentCasingInFileNames": true,
- "useDefineForClassFields": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
+ "node",
"webpack-env",
"mocha",
"chai"
},
"lib": [
"esnext",
- "dom",
- "dom.iterable",
- "scripthost"
+ "dom"
]
},
"include": [
UIServerConfiguration,
WorkerConfiguration,
} from '../types/ConfigurationData';
-import { EmptyObject } from '../types/EmptyObject';
-import { HandleErrorParams } from '../types/Error';
+import type { EmptyObject } from '../types/EmptyObject';
+import type { HandleErrorParams } from '../types/Error';
import { FileType } from '../types/FileType';
import { StorageType } from '../types/Storage';
import { ApplicationProtocol } from '../types/UIProtocol';
import chalk from 'chalk';
-import { EmptyObject } from '../types/EmptyObject';
-import { HandleErrorParams } from '../types/Error';
-import { FileType } from '../types/FileType';
-import { JsonType } from '../types/JsonType';
+import type { EmptyObject } from '../types/EmptyObject';
+import type { HandleErrorParams } from '../types/Error';
+import type { FileType } from '../types/FileType';
+import type { JsonType } from '../types/JsonType';
import logger from './Logger';
import Utils from './Utils';
-import { Format } from 'logform';
+import type { Format } from 'logform';
import { Logger, createLogger, format, transport } from 'winston';
import DailyRotateFile from 'winston-daily-rotate-file';
import TransportType from 'winston/lib/winston/transports/index.js';
import fs from 'fs';
-import { WorkerData, WorkerOptions } from '../types/Worker';
+import type { WorkerData, WorkerOptions } from '../types/Worker';
import WorkerConstants from './WorkerConstants';
export default abstract class WorkerAbstract<T extends WorkerData> {
import { DynamicThreadPool } from 'poolifier';
-import { WorkerData, WorkerOptions } from '../types/Worker';
+import type { WorkerData, WorkerOptions } from '../types/Worker';
import Utils from '../utils/Utils';
import WorkerAbstract from './WorkerAbstract';
import { WorkerUtils } from './WorkerUtils';
import { Worker, isMainThread } from 'worker_threads';
-import { PoolOptions } from 'poolifier';
+import type { PoolOptions } from 'poolifier';
import { WorkerData, WorkerOptions, WorkerProcessType } from '../types/Worker';
import type WorkerAbstract from './WorkerAbstract';
import { FixedThreadPool } from 'poolifier';
-import { WorkerData, WorkerOptions } from '../types/Worker';
+import type { WorkerData, WorkerOptions } from '../types/Worker';
import Utils from '../utils/Utils';
import WorkerAbstract from './WorkerAbstract';
import { WorkerUtils } from './WorkerUtils';
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
+ "importsNotUsedAsValues": "error", /* Enforce using `import type` instead of `import` for types */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */