Convert some type definitions to type syntax
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 2.0 / Requests.ts
1 import type { EmptyObject } from '../../EmptyObject';
2 import type { JsonObject } from '../../JsonType';
3
4 export enum OCPP20RequestCommand {
5 BOOT_NOTIFICATION = 'BootNotification',
6 HEARTBEAT = 'Heartbeat',
7 STATUS_NOTIFICATION = 'StatusNotification',
8 }
9
10 export enum OCPP20IncomingRequestCommand {
11 CLEAR_CACHE = 'ClearCache',
12 REQUEST_START_TRANSACTION = 'RequestStartTransaction',
13 REQUEST_STOP_TRANSACTION = 'RequestStopTransaction',
14 }
15
16 export enum BootReasonEnumType {
17 ApplicationReset = 'ApplicationReset',
18 FirmwareUpdate = 'FirmwareUpdate',
19 LocalReset = 'LocalReset',
20 PowerUp = 'PowerUp',
21 RemoteReset = 'RemoteReset',
22 ScheduledReset = 'ScheduledReset',
23 Triggered = 'Triggered',
24 Unknown = 'Unknown',
25 Watchdog = 'Watchdog',
26 }
27
28 export type ModemType = {
29 iccid?: string;
30 imsi?: string;
31 } & JsonObject;
32
33 export type ChargingStationType = {
34 serialNumber?: string;
35 model: string;
36 vendorName: string;
37 firmwareVersion?: string;
38 modem?: ModemType;
39 } & JsonObject;
40
41 export type OCPP20BootNotificationRequest = {
42 reason: BootReasonEnumType;
43 chargingStation: ChargingStationType;
44 } & JsonObject;
45
46 export type OCPP20HeartbeatRequest = EmptyObject;
47
48 export type OCPP20ClearCacheRequest = EmptyObject;
49
50 export enum OCPP20ConnectorStatusEnumType {
51 AVAILABLE = 'Available',
52 OCCUPIED = 'Occupied',
53 RESERVED = 'Reserved',
54 UNAVAILABLE = 'Unavailable',
55 FAULTED = 'Faulted',
56 }
57
58 export type OCPP20StatusNotificationRequest = {
59 timestamp: Date;
60 connectorStatus: OCPP20ConnectorStatusEnumType;
61 evseId: number;
62 connectorId: number;
63 } & JsonObject;