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