build(simulator): features for reserve-now and cancel-reservation support added
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
1 import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
2 import type { OCPP16ChargePointStatus } from './ChargePointStatus';
3 import type {
4 OCPP16ChargingProfile,
5 OCPP16ChargingProfilePurposeType,
6 OCPP16ChargingRateUnitType,
7 } from './ChargingProfile';
8 import type { OCPP16StandardParametersKey, OCPP16VendorParametersKey } from './Configuration';
9 import type { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
10 import type { EmptyObject } from '../../EmptyObject';
11 import type { JsonObject } from '../../JsonType';
12
13 export enum OCPP16RequestCommand {
14 BOOT_NOTIFICATION = 'BootNotification',
15 HEARTBEAT = 'Heartbeat',
16 STATUS_NOTIFICATION = 'StatusNotification',
17 AUTHORIZE = 'Authorize',
18 START_TRANSACTION = 'StartTransaction',
19 STOP_TRANSACTION = 'StopTransaction',
20 METER_VALUES = 'MeterValues',
21 DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification',
22 FIRMWARE_STATUS_NOTIFICATION = 'FirmwareStatusNotification',
23 DATA_TRANSFER = 'DataTransfer',
24 RESERVE_NOW = 'ReserveNow',
25 CANCEL_RESERVATION = 'CancelReservation',
26 }
27
28 export enum OCPP16IncomingRequestCommand {
29 RESET = 'Reset',
30 CLEAR_CACHE = 'ClearCache',
31 CHANGE_AVAILABILITY = 'ChangeAvailability',
32 UNLOCK_CONNECTOR = 'UnlockConnector',
33 GET_CONFIGURATION = 'GetConfiguration',
34 CHANGE_CONFIGURATION = 'ChangeConfiguration',
35 GET_COMPOSITE_SCHEDULE = 'GetCompositeSchedule',
36 SET_CHARGING_PROFILE = 'SetChargingProfile',
37 CLEAR_CHARGING_PROFILE = 'ClearChargingProfile',
38 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
39 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
40 GET_DIAGNOSTICS = 'GetDiagnostics',
41 TRIGGER_MESSAGE = 'TriggerMessage',
42 DATA_TRANSFER = 'DataTransfer',
43 UPDATE_FIRMWARE = 'UpdateFirmware',
44 RESERVE_NOW = 'ReserveNow',
45 CANCEL_RESERVATION = 'CancelReservation',
46 }
47
48 export type OCPP16HeartbeatRequest = EmptyObject;
49
50 export interface OCPP16BootNotificationRequest extends JsonObject {
51 chargePointVendor: string;
52 chargePointModel: string;
53 chargePointSerialNumber?: string;
54 chargeBoxSerialNumber?: string;
55 firmwareVersion?: string;
56 iccid?: string;
57 imsi?: string;
58 meterType?: string;
59 meterSerialNumber?: string;
60 }
61
62 export interface OCPP16StatusNotificationRequest extends JsonObject {
63 connectorId: number;
64 errorCode: OCPP16ChargePointErrorCode;
65 status: OCPP16ChargePointStatus;
66 info?: string;
67 timestamp?: Date;
68 vendorId?: string;
69 vendorErrorCode?: string;
70 }
71
72 export type OCPP16ClearCacheRequest = EmptyObject;
73
74 type OCPP16ConfigurationKey = string | OCPP16StandardParametersKey | OCPP16VendorParametersKey;
75
76 export interface ChangeConfigurationRequest extends JsonObject {
77 key: OCPP16ConfigurationKey;
78 value: string;
79 }
80
81 export interface RemoteStartTransactionRequest extends JsonObject {
82 connectorId: number;
83 idTag: string;
84 chargingProfile?: OCPP16ChargingProfile;
85 }
86
87 export interface RemoteStopTransactionRequest extends JsonObject {
88 transactionId: number;
89 }
90
91 export interface UnlockConnectorRequest extends JsonObject {
92 connectorId: number;
93 }
94
95 export interface GetConfigurationRequest extends JsonObject {
96 key?: OCPP16ConfigurationKey[];
97 }
98
99 enum ResetType {
100 HARD = 'Hard',
101 SOFT = 'Soft',
102 }
103
104 export interface ResetRequest extends JsonObject {
105 type: ResetType;
106 }
107
108 export interface OCPP16GetCompositeScheduleRequest extends JsonObject {
109 connectorId: number;
110 duration: number;
111 chargingRateUnit?: OCPP16ChargingRateUnitType;
112 }
113
114 export interface SetChargingProfileRequest extends JsonObject {
115 connectorId: number;
116 csChargingProfiles: OCPP16ChargingProfile;
117 }
118
119 export enum OCPP16AvailabilityType {
120 Inoperative = 'Inoperative',
121 Operative = 'Operative',
122 }
123
124 export interface ChangeAvailabilityRequest extends JsonObject {
125 connectorId: number;
126 type: OCPP16AvailabilityType;
127 }
128
129 export interface ClearChargingProfileRequest extends JsonObject {
130 id?: number;
131 connectorId?: number;
132 chargingProfilePurpose?: OCPP16ChargingProfilePurposeType;
133 stackLevel?: number;
134 }
135
136 export interface OCPP16UpdateFirmwareRequest extends JsonObject {
137 location: string;
138 retrieveDate: Date;
139 retries?: number;
140 retryInterval?: number;
141 }
142
143 export enum OCPP16FirmwareStatus {
144 Downloaded = 'Downloaded',
145 DownloadFailed = 'DownloadFailed',
146 Downloading = 'Downloading',
147 Idle = 'Idle',
148 InstallationFailed = 'InstallationFailed',
149 Installing = 'Installing',
150 Installed = 'Installed',
151 }
152
153 export type OCPP16FirmwareStatusNotificationRequest = {
154 status: OCPP16FirmwareStatus;
155 } & JsonObject;
156
157 export interface GetDiagnosticsRequest extends JsonObject {
158 location: string;
159 retries?: number;
160 retryInterval?: number;
161 startTime?: Date;
162 stopTime?: Date;
163 }
164
165 export interface OCPP16DiagnosticsStatusNotificationRequest extends JsonObject {
166 status: OCPP16DiagnosticsStatus;
167 }
168
169 export enum OCPP16MessageTrigger {
170 BootNotification = 'BootNotification',
171 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
172 FirmwareStatusNotification = 'FirmwareStatusNotification',
173 Heartbeat = 'Heartbeat',
174 MeterValues = 'MeterValues',
175 StatusNotification = 'StatusNotification',
176 }
177
178 export interface OCPP16TriggerMessageRequest extends JsonObject {
179 requestedMessage: OCPP16MessageTrigger;
180 connectorId?: number;
181 }
182
183 export enum OCPP16DataTransferVendorId {}
184
185 export interface OCPP16DataTransferRequest extends JsonObject {
186 vendorId: string;
187 messageId?: string;
188 data?: string;
189 }
190
191 export interface OCPP16ReserveNowRequest {
192 connectorId: number;
193 expiryDate: Date;
194 idTag: string;
195 parentIdTag?: string;
196 reservationId: number;
197 }
198
199 export interface OCPP16CancelReservationRequest {
200 reservationId: number;
201 }