X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationTemplate.ts;h=b3cc773489d0f384feb8bf93cb5934039628eeae;hb=05558d929eb51343f080455aae1a4ec4fed62fa5;hp=789ce248bc3d5e40beba0ccc2a2e221a618501fb;hpb=4be984941dac8bf0e6201a960e0e048ad4e9edee;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationTemplate.ts b/src/types/ChargingStationTemplate.ts index 789ce248..b3cc7734 100644 --- a/src/types/ChargingStationTemplate.ts +++ b/src/types/ChargingStationTemplate.ts @@ -1,99 +1,135 @@ -import ChargingStationOcppConfiguration from './ChargingStationOcppConfiguration'; -import { ClientOptions } from 'ws'; -import { ClientRequestArgs } from 'http'; -import { ConnectorStatus } from './ConnectorStatus'; -import { OCPPProtocol } from './ocpp/OCPPProtocol'; -import { OCPPVersion } from './ocpp/OCPPVersion'; +import type { ClientRequestArgs } from 'node:http' + +import type { ClientOptions } from 'ws' + +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 { JsonObject } from './JsonType.js' +import type { OCPPProtocol } from './ocpp/OCPPProtocol.js' +import type { OCPPVersion } from './ocpp/OCPPVersion.js' +import type { + FirmwareStatus, + IncomingRequestCommand, + MessageTrigger, + RequestCommand +} from './ocpp/Requests.js' export enum CurrentType { AC = 'AC', - DC = 'DC', + DC = 'DC' } export enum PowerUnits { WATT = 'W', - KILO_WATT = 'kW', + KILO_WATT = 'kW' } export enum AmpereUnits { MILLI_AMPERE = 'mA', CENTI_AMPERE = 'cA', DECI_AMPERE = 'dA', - AMPERE = 'A', + AMPERE = 'A' } export enum Voltage { VOLTAGE_110 = 110, VOLTAGE_230 = 230, VOLTAGE_400 = 400, - VOLTAGE_800 = 800, + VOLTAGE_800 = 800 +} + +export type WsOptions = ClientOptions & ClientRequestArgs + +export interface FirmwareUpgrade extends JsonObject { + versionUpgrade?: { + patternGroup?: number + step?: number + } + reset?: boolean + failureStatus?: FirmwareStatus } -export interface AutomaticTransactionGenerator { - enable: boolean; - minDuration: number; - maxDuration: number; - minDelayBetweenTwoTransactions: number; - maxDelayBetweenTwoTransactions: number; - probabilityOfStart: number; - stopAfterHours: number; - stopOnConnectionFailure: boolean; - requireAuthorize?: boolean; +interface CommandsSupport extends JsonObject { + incomingCommands: Record + outgoingCommands?: Record } -export type WsOptions = ClientOptions & ClientRequestArgs; +enum x509CertificateType { + V2GRootCertificate = 'V2GRootCertificate', + MORootCertificate = 'MORootCertificate', + CSMSRootCertificate = 'CSMSRootCertificate', + ManufacturerRootCertificate = 'ManufacturerRootCertificate', + ChargingStationCertificate = 'ChargingStationCertificate', + V2GCertificate = 'V2GCertificate' +} -export default interface ChargingStationTemplate { - templateHash?: string; - supervisionUrls?: string | string[]; - supervisionUrlOcppConfiguration?: boolean; - supervisionUrlOcppKey?: string; - supervisionUser?: string; - supervisionPassword?: string; - ocppVersion?: OCPPVersion; - ocppProtocol?: OCPPProtocol; - ocppStrictCompliance?: boolean; - ocppPersistentConfiguration?: boolean; - wsOptions?: WsOptions; - authorizationFile?: string; - baseName: string; - nameSuffix?: string; - fixedName?: boolean; - chargePointModel: string; - chargePointVendor: string; - chargePointSerialNumberPrefix?: string; - chargeBoxSerialNumberPrefix?: string; - firmwareVersion?: string; - iccid?: string; - imsi?: string; - meterSerialNumberPrefix?: string; - meterType?: string; - power: number | number[]; - powerSharedByConnectors?: boolean; - powerUnit: PowerUnits; - currentOutType?: CurrentType; - voltageOut?: Voltage; - numberOfPhases?: number; - numberOfConnectors?: number | number[]; - useConnectorId0?: boolean; - randomConnectors?: boolean; - resetTime?: number; - autoRegister: boolean; - autoReconnectMaxRetries?: number; - reconnectExponentialDelay?: boolean; - registrationMaxRetries?: number; - enableStatistics?: boolean; - mayAuthorizeAtRemoteStart: boolean; - amperageLimitationOcppKey?: string; - amperageLimitationUnit?: AmpereUnits; - beginEndMeterValues?: boolean; - outOfOrderEndMeterValues?: boolean; - meteringPerTransaction?: boolean; - transactionDataMeterValues?: boolean; - mainVoltageMeterValues?: boolean; - phaseLineToLineVoltageMeterValues?: boolean; - customValueLimitationMeterValues?: boolean; - Configuration?: ChargingStationOcppConfiguration; - AutomaticTransactionGenerator: AutomaticTransactionGenerator; - Connectors: Record; +export interface ChargingStationTemplate { + templateHash?: string + supervisionUrls?: string | string[] + supervisionUrlOcppConfiguration?: boolean + supervisionUrlOcppKey?: string + supervisionUser?: string + supervisionPassword?: string + autoStart?: boolean + ocppVersion?: OCPPVersion + ocppProtocol?: OCPPProtocol + ocppStrictCompliance?: boolean + ocppPersistentConfiguration?: boolean + stationInfoPersistentConfiguration?: boolean + automaticTransactionGeneratorPersistentConfiguration?: boolean + wsOptions?: WsOptions + idTagsFile?: string + baseName: string + nameSuffix?: string + fixedName?: boolean + chargePointModel: string + chargePointVendor: string + chargePointSerialNumberPrefix?: string + chargeBoxSerialNumberPrefix?: string + firmwareVersionPattern?: string + firmwareVersion?: string + firmwareUpgrade?: FirmwareUpgrade + iccid?: string + imsi?: string + meterSerialNumberPrefix?: string + meterType?: string + power?: number | number[] + powerUnit?: PowerUnits + powerSharedByConnectors?: boolean + currentOutType?: CurrentType + voltageOut?: Voltage + numberOfPhases?: number + numberOfConnectors?: number | number[] + useConnectorId0?: boolean + randomConnectors?: boolean + resetTime?: number + autoRegister?: boolean + autoReconnectMaxRetries?: number + reconnectExponentialDelay?: boolean + registrationMaxRetries?: number + enableStatistics?: boolean + remoteAuthorization?: boolean + /** @deprecated Replaced by remoteAuthorization. */ + mustAuthorizeAtRemoteStart?: boolean + /** @deprecated Replaced by ocppStrictCompliance. */ + payloadSchemaValidation?: boolean + amperageLimitationOcppKey?: string + amperageLimitationUnit?: AmpereUnits + beginEndMeterValues?: boolean + outOfOrderEndMeterValues?: boolean + meteringPerTransaction?: boolean + transactionDataMeterValues?: boolean + stopTransactionsOnStopped?: boolean + mainVoltageMeterValues?: boolean + phaseLineToLineVoltageMeterValues?: boolean + customValueLimitationMeterValues?: boolean + commandsSupport?: CommandsSupport + messageTriggerSupport?: Record + Configuration?: ChargingStationOcppConfiguration + AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration + Evses?: Record + Connectors?: Record + x509Certificates?: Record }