refactor: applied changes for pull request
[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 type FirmwareUpgrade = {
45 versionUpgrade?: {
46 patternGroup?: number;
47 step?: number;
48 };
49 reset?: boolean;
50 failureStatus?: FirmwareStatus;
51 };
52
53 type CommandsSupport = {
54 incomingCommands: Record<IncomingRequestCommand, boolean>;
55 outgoingCommands?: Record<RequestCommand, boolean>;
56 };
57
58 export type ChargingStationTemplate = {
59 templateHash?: string;
60 supervisionUrls?: string | string[];
61 supervisionUrlOcppConfiguration?: boolean;
62 supervisionUrlOcppKey?: string;
63 supervisionUser?: string;
64 supervisionPassword?: string;
65 ocppVersion?: OCPPVersion;
66 ocppProtocol?: OCPPProtocol;
67 ocppStrictCompliance?: boolean;
68 ocppPersistentConfiguration?: boolean;
69 stationInfoPersistentConfiguration?: boolean;
70 wsOptions?: WsOptions;
71 idTagsFile?: string;
72 baseName: string;
73 nameSuffix?: string;
74 fixedName?: boolean;
75 chargePointModel: string;
76 chargePointVendor: string;
77 chargePointSerialNumberPrefix?: string;
78 chargeBoxSerialNumberPrefix?: string;
79 firmwareVersionPattern?: string;
80 firmwareVersion?: string;
81 firmwareUpgrade?: FirmwareUpgrade;
82 iccid?: string;
83 imsi?: string;
84 meterSerialNumberPrefix?: string;
85 meterType?: string;
86 power: number | number[];
87 powerSharedByConnectors?: boolean;
88 powerUnit: PowerUnits;
89 currentOutType?: CurrentType;
90 voltageOut?: Voltage;
91 numberOfPhases?: number;
92 numberOfConnectors?: number | number[];
93 useConnectorId0?: boolean;
94 randomConnectors?: boolean;
95 resetTime?: number;
96 autoRegister?: boolean;
97 autoReconnectMaxRetries?: number;
98 reconnectExponentialDelay?: boolean;
99 registrationMaxRetries?: number;
100 enableStatistics?: boolean;
101 mustAuthorizeAtRemoteStart?: boolean;
102 payloadSchemaValidation?: boolean;
103 amperageLimitationOcppKey?: string;
104 amperageLimitationUnit?: AmpereUnits;
105 beginEndMeterValues?: boolean;
106 outOfOrderEndMeterValues?: boolean;
107 meteringPerTransaction?: boolean;
108 transactionDataMeterValues?: boolean;
109 mainVoltageMeterValues?: boolean;
110 phaseLineToLineVoltageMeterValues?: boolean;
111 customValueLimitationMeterValues?: boolean;
112 commandsSupport?: CommandsSupport;
113 messageTriggerSupport?: Record<MessageTrigger, boolean>;
114 Configuration?: ChargingStationOcppConfiguration;
115 AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration;
116 Evses?: Record<string, EvseTemplate>;
117 Connectors?: Record<string, ConnectorStatus>;
118 };