feat(simulator): add more OCPP 2.x.x types definition
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
CommitLineData
2896e06d
JB
1import type {
2 ChargingProfilePurposeType,
3 EmptyObject,
4 JsonObject,
5 OCPP16ChargePointErrorCode,
6 OCPP16ChargePointStatus,
7 OCPP16ChargingProfile,
8 OCPP16DiagnosticsStatus,
9 OCPP16StandardParametersKey,
10} from '../../internal';
5bd15d76 11
c0560973 12export enum OCPP16RequestCommand {
d9f60ba1
JB
13 BOOT_NOTIFICATION = 'BootNotification',
14 HEARTBEAT = 'Heartbeat',
15 STATUS_NOTIFICATION = 'StatusNotification',
ef6076c1 16 AUTHORIZE = 'Authorize',
d9f60ba1
JB
17 START_TRANSACTION = 'StartTransaction',
18 STOP_TRANSACTION = 'StopTransaction',
47e22477 19 METER_VALUES = 'MeterValues',
e7aeea18 20 DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification',
d4c84337 21 FIRMWARE_STATUS_NOTIFICATION = 'FirmwareStatusNotification',
91a7d3ea 22 DATA_TRANSFER = 'DataTransfer',
d9f60ba1
JB
23}
24
953d6b02
JB
25export enum OCPP16IncomingRequestCommand {
26 RESET = 'Reset',
27 CLEAR_CACHE = 'ClearCache',
28 CHANGE_AVAILABILITY = 'ChangeAvailability',
29 UNLOCK_CONNECTOR = 'UnlockConnector',
30 GET_CONFIGURATION = 'GetConfiguration',
31 CHANGE_CONFIGURATION = 'ChangeConfiguration',
32 SET_CHARGING_PROFILE = 'SetChargingProfile',
33 CLEAR_CHARGING_PROFILE = 'ClearChargingProfile',
34 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
35 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
36 GET_DIAGNOSTICS = 'GetDiagnostics',
37 TRIGGER_MESSAGE = 'TriggerMessage',
38 DATA_TRANSFER = 'DataTransfer',
39 UPDATE_FIRMWARE = 'UpdateFirmware',
40}
41
ef6fa3fb 42export type OCPP16HeartbeatRequest = EmptyObject;
f738a0e9 43
e3822d6f 44export interface OCPP16BootNotificationRequest extends JsonObject {
fec4d204 45 chargePointVendor: string;
f738a0e9
JB
46 chargePointModel: string;
47 chargePointSerialNumber?: string;
fec4d204 48 chargeBoxSerialNumber?: string;
f738a0e9
JB
49 firmwareVersion?: string;
50 iccid?: string;
51 imsi?: string;
f738a0e9 52 meterType?: string;
fec4d204 53 meterSerialNumber?: string;
f738a0e9
JB
54}
55
e3822d6f 56export interface OCPP16StatusNotificationRequest extends JsonObject {
f738a0e9 57 connectorId: number;
c0560973 58 errorCode: OCPP16ChargePointErrorCode;
c0560973 59 status: OCPP16ChargePointStatus;
a9ed42b2 60 info?: string;
c38f0ced 61 timestamp?: Date;
f738a0e9
JB
62 vendorId?: string;
63 vendorErrorCode?: string;
64}
65
e3018bc4
JB
66export type OCPP16ClearCacheRequest = EmptyObject;
67
e3822d6f 68export interface ChangeConfigurationRequest extends JsonObject {
c0560973 69 key: string | OCPP16StandardParametersKey;
f738a0e9
JB
70 value: string;
71}
72
e3822d6f 73export interface RemoteStartTransactionRequest extends JsonObject {
f738a0e9
JB
74 connectorId: number;
75 idTag: string;
c0560973 76 chargingProfile?: OCPP16ChargingProfile;
f738a0e9
JB
77}
78
e3822d6f 79export interface RemoteStopTransactionRequest extends JsonObject {
f738a0e9
JB
80 transactionId: number;
81}
82
e3822d6f 83export interface UnlockConnectorRequest extends JsonObject {
f738a0e9
JB
84 connectorId: number;
85}
86
e3822d6f 87export interface GetConfigurationRequest extends JsonObject {
9a15316c 88 key?: (string | OCPP16StandardParametersKey)[];
f738a0e9
JB
89}
90
91export enum ResetType {
92 HARD = 'Hard',
e7aeea18 93 SOFT = 'Soft',
f738a0e9
JB
94}
95
e3822d6f 96export interface ResetRequest extends JsonObject {
f738a0e9 97 type: ResetType;
63b48f77 98}
8c476a1f 99
e3822d6f 100export interface SetChargingProfileRequest extends JsonObject {
8c476a1f 101 connectorId: number;
c0560973 102 csChargingProfiles: OCPP16ChargingProfile;
8c476a1f 103}
4dff73b0 104
c0560973 105export enum OCPP16AvailabilityType {
4dff73b0 106 INOPERATIVE = 'Inoperative',
e7aeea18 107 OPERATIVE = 'Operative',
4dff73b0
JB
108}
109
e3822d6f 110export interface ChangeAvailabilityRequest extends JsonObject {
4dff73b0 111 connectorId: number;
c0560973 112 type: OCPP16AvailabilityType;
4dff73b0 113}
edf4bd64 114
e3822d6f 115export interface ClearChargingProfileRequest extends JsonObject {
edf4bd64
JB
116 id?: number;
117 connectorId?: number;
118 chargingProfilePurpose?: ChargingProfilePurposeType;
119 stackLevel?: number;
120}
47e22477 121
b03df580
JB
122export interface OCPP16UpdateFirmwareRequest extends JsonObject {
123 location: string;
124 retrieveDate: Date;
125 retries?: number;
126 retryInterval?: number;
127}
128
d4c84337
JB
129export enum OCPP16FirmwareStatus {
130 Downloaded = 'Downloaded',
131 DownloadFailed = 'DownloadFailed',
132 Downloading = 'Downloading',
133 Idle = 'Idle',
134 InstallationFailed = 'InstallationFailed',
135 Installing = 'Installing',
136 Installed = 'Installed',
137}
138
139export type OCPP16FirmwareStatusNotificationRequest = {
140 status: OCPP16FirmwareStatus;
c9a4f9ea 141} & JsonObject;
d4c84337 142
e3822d6f 143export interface GetDiagnosticsRequest extends JsonObject {
47e22477
JB
144 location: string;
145 retries?: number;
146 retryInterval?: number;
147 startTime?: Date;
148 stopTime?: Date;
149}
150
c9a4f9ea 151export interface OCPP16DiagnosticsStatusNotificationRequest extends JsonObject {
e7aeea18 152 status: OCPP16DiagnosticsStatus;
47e22477 153}
802cfa13 154
c60ed4b8 155export enum OCPP16MessageTrigger {
802cfa13
JB
156 BootNotification = 'BootNotification',
157 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
158 FirmwareStatusNotification = 'FirmwareStatusNotification',
159 Heartbeat = 'Heartbeat',
160 MeterValues = 'MeterValues',
e7aeea18 161 StatusNotification = 'StatusNotification',
802cfa13
JB
162}
163
e3822d6f 164export interface OCPP16TriggerMessageRequest extends JsonObject {
c60ed4b8 165 requestedMessage: OCPP16MessageTrigger;
e7aeea18 166 connectorId?: number;
802cfa13 167}
91a7d3ea 168
77b95a89
JB
169export enum OCPP16DataTransferVendorId {}
170
91a7d3ea
JB
171export interface OCPP16DataTransferRequest extends JsonObject {
172 vendorId: string;
173 messageId?: string;
174 data?: string;
175}