7807837573fac8aed4fcbef66dcd73a9023cb180
[e-mobility-charging-stations-simulator.git] / src / types / ChargingStationTemplate.ts
1 import type { ClientRequestArgs } from 'node:http';
2
3 import type { ClientOptions } from 'ws';
4
5 import type { AutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator';
6 import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration';
7 import type { ConnectorStatus } from './ConnectorStatus';
8 import type { EvseTemplate } from './Evse';
9 import type { OCPPProtocol } from './ocpp/OCPPProtocol';
10 import type { OCPPVersion } from './ocpp/OCPPVersion';
11 import type {
12 FirmwareStatus,
13 IncomingRequestCommand,
14 MessageTrigger,
15 RequestCommand,
16 } from './ocpp/Requests';
17
18 export enum CurrentType {
19 AC = 'AC',
20 DC = 'DC',
21 }
22
23 export enum PowerUnits {
24 WATT = 'W',
25 KILO_WATT = 'kW',
26 }
27
28 export enum AmpereUnits {
29 MILLI_AMPERE = 'mA',
30 CENTI_AMPERE = 'cA',
31 DECI_AMPERE = 'dA',
32 AMPERE = 'A',
33 }
34
35 export enum Voltage {
36 VOLTAGE_110 = 110,
37 VOLTAGE_230 = 230,
38 VOLTAGE_400 = 400,
39 VOLTAGE_800 = 800,
40 }
41
42 export type WsOptions = ClientOptions & ClientRequestArgs;
43
44 export interface FirmwareUpgrade {
45 versionUpgrade?: {
46 patternGroup?: number;
47 step?: number;
48 };
49 reset?: boolean;
50 failureStatus?: FirmwareStatus;
51 }
52
53 interface CommandsSupport {
54 incomingCommands: Record<IncomingRequestCommand, boolean>;
55 outgoingCommands?: Record<RequestCommand, boolean>;
56 }
57
58 enum x509CertificateType {
59 V2GRootCertificate = 'V2GRootCertificate',
60 MORootCertificate = 'MORootCertificate',
61 CSMSRootCertificate = 'CSMSRootCertificate',
62 ManufacturerRootCertificate = 'ManufacturerRootCertificate',
63 ChargingStationCertificate = 'ChargingStationCertificate',
64 V2GCertificate = 'V2GCertificate',
65 }
66
67 export interface ChargingStationTemplate {
68 templateHash?: string;
69 supervisionUrls?: string | string[];
70 supervisionUrlOcppConfiguration?: boolean;
71 supervisionUrlOcppKey?: string;
72 supervisionUser?: string;
73 supervisionPassword?: string;
74 ocppVersion?: OCPPVersion;
75 ocppProtocol?: OCPPProtocol;
76 ocppStrictCompliance?: boolean;
77 ocppPersistentConfiguration?: boolean;
78 stationInfoPersistentConfiguration?: boolean;
79 automaticTransactionGeneratorPersistentConfiguration?: boolean;
80 wsOptions?: WsOptions;
81 idTagsFile?: string;
82 baseName: string;
83 nameSuffix?: string;
84 fixedName?: boolean;
85 chargePointModel: string;
86 chargePointVendor: string;
87 chargePointSerialNumberPrefix?: string;
88 chargeBoxSerialNumberPrefix?: string;
89 firmwareVersionPattern?: string;
90 firmwareVersion?: string;
91 firmwareUpgrade?: FirmwareUpgrade;
92 iccid?: string;
93 imsi?: string;
94 meterSerialNumberPrefix?: string;
95 meterType?: string;
96 power?: number | number[];
97 powerUnit?: PowerUnits;
98 powerSharedByConnectors?: boolean;
99 currentOutType?: CurrentType;
100 voltageOut?: Voltage;
101 numberOfPhases?: number;
102 numberOfConnectors?: number | number[];
103 useConnectorId0?: boolean;
104 randomConnectors?: boolean;
105 resetTime?: number;
106 autoRegister?: boolean;
107 autoReconnectMaxRetries?: number;
108 reconnectExponentialDelay?: boolean;
109 registrationMaxRetries?: number;
110 enableStatistics?: boolean;
111 mustAuthorizeAtRemoteStart?: boolean;
112 /** @deprecated Replaced by ocppStrictCompliance */
113 payloadSchemaValidation?: boolean;
114 amperageLimitationOcppKey?: string;
115 amperageLimitationUnit?: AmpereUnits;
116 beginEndMeterValues?: boolean;
117 outOfOrderEndMeterValues?: boolean;
118 meteringPerTransaction?: boolean;
119 transactionDataMeterValues?: boolean;
120 mainVoltageMeterValues?: boolean;
121 phaseLineToLineVoltageMeterValues?: boolean;
122 customValueLimitationMeterValues?: boolean;
123 commandsSupport?: CommandsSupport;
124 messageTriggerSupport?: Record<MessageTrigger, boolean>;
125 Configuration?: ChargingStationOcppConfiguration;
126 AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration;
127 Evses?: Record<string, EvseTemplate>;
128 Connectors?: Record<string, ConnectorStatus>;
129 x509Certificates?: Record<x509CertificateType, string>;
130 }