786ea617be0fb38e518003d52ffcacd007ca82af
[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 }
25
26 export enum OCPP16IncomingRequestCommand {
27 RESET = 'Reset',
28 CLEAR_CACHE = 'ClearCache',
29 CHANGE_AVAILABILITY = 'ChangeAvailability',
30 UNLOCK_CONNECTOR = 'UnlockConnector',
31 GET_CONFIGURATION = 'GetConfiguration',
32 CHANGE_CONFIGURATION = 'ChangeConfiguration',
33 GET_COMPOSITE_SCHEDULE = 'GetCompositeSchedule',
34 SET_CHARGING_PROFILE = 'SetChargingProfile',
35 CLEAR_CHARGING_PROFILE = 'ClearChargingProfile',
36 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
37 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
38 GET_DIAGNOSTICS = 'GetDiagnostics',
39 TRIGGER_MESSAGE = 'TriggerMessage',
40 DATA_TRANSFER = 'DataTransfer',
41 UPDATE_FIRMWARE = 'UpdateFirmware',
42 }
43
44 export type OCPP16HeartbeatRequest = EmptyObject;
45
46 export interface OCPP16BootNotificationRequest extends JsonObject {
47 chargePointVendor: string;
48 chargePointModel: string;
49 chargePointSerialNumber?: string;
50 chargeBoxSerialNumber?: string;
51 firmwareVersion?: string;
52 iccid?: string;
53 imsi?: string;
54 meterType?: string;
55 meterSerialNumber?: string;
56 }
57
58 export interface OCPP16StatusNotificationRequest extends JsonObject {
59 connectorId: number;
60 errorCode: OCPP16ChargePointErrorCode;
61 status: OCPP16ChargePointStatus;
62 info?: string;
63 timestamp?: Date;
64 vendorId?: string;
65 vendorErrorCode?: string;
66 }
67
68 export type OCPP16ClearCacheRequest = EmptyObject;
69
70 type OCPP16ConfigurationKey = string | OCPP16StandardParametersKey | OCPP16VendorParametersKey;
71
72 export interface ChangeConfigurationRequest extends JsonObject {
73 key: OCPP16ConfigurationKey;
74 value: string;
75 }
76
77 export interface RemoteStartTransactionRequest extends JsonObject {
78 connectorId: number;
79 idTag: string;
80 chargingProfile?: OCPP16ChargingProfile;
81 }
82
83 export interface RemoteStopTransactionRequest extends JsonObject {
84 transactionId: number;
85 }
86
87 export interface UnlockConnectorRequest extends JsonObject {
88 connectorId: number;
89 }
90
91 export interface GetConfigurationRequest extends JsonObject {
92 key?: OCPP16ConfigurationKey[];
93 }
94
95 enum ResetType {
96 HARD = 'Hard',
97 SOFT = 'Soft',
98 }
99
100 export interface ResetRequest extends JsonObject {
101 type: ResetType;
102 }
103
104 export interface OCPP16GetCompositeScheduleRequest extends JsonObject {
105 connectorId: number;
106 duration: number;
107 chargingRateUnit?: OCPP16ChargingRateUnitType;
108 }
109
110 export interface SetChargingProfileRequest extends JsonObject {
111 connectorId: number;
112 csChargingProfiles: OCPP16ChargingProfile;
113 }
114
115 export enum OCPP16AvailabilityType {
116 Inoperative = 'Inoperative',
117 Operative = 'Operative',
118 }
119
120 export interface ChangeAvailabilityRequest extends JsonObject {
121 connectorId: number;
122 type: OCPP16AvailabilityType;
123 }
124
125 export interface ClearChargingProfileRequest extends JsonObject {
126 id?: number;
127 connectorId?: number;
128 chargingProfilePurpose?: OCPP16ChargingProfilePurposeType;
129 stackLevel?: number;
130 }
131
132 export interface OCPP16UpdateFirmwareRequest extends JsonObject {
133 location: string;
134 retrieveDate: Date;
135 retries?: number;
136 retryInterval?: number;
137 }
138
139 export enum OCPP16FirmwareStatus {
140 Downloaded = 'Downloaded',
141 DownloadFailed = 'DownloadFailed',
142 Downloading = 'Downloading',
143 Idle = 'Idle',
144 InstallationFailed = 'InstallationFailed',
145 Installing = 'Installing',
146 Installed = 'Installed',
147 }
148
149 export type OCPP16FirmwareStatusNotificationRequest = {
150 status: OCPP16FirmwareStatus;
151 } & JsonObject;
152
153 export interface GetDiagnosticsRequest extends JsonObject {
154 location: string;
155 retries?: number;
156 retryInterval?: number;
157 startTime?: Date;
158 stopTime?: Date;
159 }
160
161 export interface OCPP16DiagnosticsStatusNotificationRequest extends JsonObject {
162 status: OCPP16DiagnosticsStatus;
163 }
164
165 export enum OCPP16MessageTrigger {
166 BootNotification = 'BootNotification',
167 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
168 FirmwareStatusNotification = 'FirmwareStatusNotification',
169 Heartbeat = 'Heartbeat',
170 MeterValues = 'MeterValues',
171 StatusNotification = 'StatusNotification',
172 }
173
174 export interface OCPP16TriggerMessageRequest extends JsonObject {
175 requestedMessage: OCPP16MessageTrigger;
176 connectorId?: number;
177 }
178
179 export enum OCPP16DataTransferVendorId {}
180
181 export interface OCPP16DataTransferRequest extends JsonObject {
182 vendorId: string;
183 messageId?: string;
184 data?: string;
185 }
186
187 export interface OCPP16ReserveNowRequest {
188 connectorId: string;
189 expiryDate: Date;
190 idTag: string;
191 parentIdTag?: string;
192 reservationId: number;
193 }
194
195 export interface OCPP16CancelReservationRequest {
196 reservationId: number;
197 }