build: switch to NodeNext module resolution
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
CommitLineData
a6ef1ece
JB
1import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode.js';
2import type { OCPP16ChargePointStatus } from './ChargePointStatus.js';
2896e06d 3import type {
2896e06d 4 OCPP16ChargingProfile,
0ac97927 5 OCPP16ChargingProfilePurposeType,
41189456 6 OCPP16ChargingRateUnitType,
a6ef1ece
JB
7} from './ChargingProfile.js';
8import type { OCPP16StandardParametersKey, OCPP16VendorParametersKey } from './Configuration.js';
9import type { OCPP16DiagnosticsStatus } from './DiagnosticsStatus.js';
10import type { EmptyObject } from '../../EmptyObject.js';
11import type { JsonObject } from '../../JsonType.js';
5bd15d76 12
c0560973 13export enum OCPP16RequestCommand {
d9f60ba1
JB
14 BOOT_NOTIFICATION = 'BootNotification',
15 HEARTBEAT = 'Heartbeat',
16 STATUS_NOTIFICATION = 'StatusNotification',
ef6076c1 17 AUTHORIZE = 'Authorize',
d9f60ba1
JB
18 START_TRANSACTION = 'StartTransaction',
19 STOP_TRANSACTION = 'StopTransaction',
47e22477 20 METER_VALUES = 'MeterValues',
e7aeea18 21 DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification',
d4c84337 22 FIRMWARE_STATUS_NOTIFICATION = 'FirmwareStatusNotification',
91a7d3ea 23 DATA_TRANSFER = 'DataTransfer',
d9f60ba1
JB
24}
25
953d6b02
JB
26export 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',
41189456 33 GET_COMPOSITE_SCHEDULE = 'GetCompositeSchedule',
953d6b02
JB
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',
24578c31
JB
42 RESERVE_NOW = 'ReserveNow',
43 CANCEL_RESERVATION = 'CancelReservation',
953d6b02
JB
44}
45
ef6fa3fb 46export type OCPP16HeartbeatRequest = EmptyObject;
f738a0e9 47
e3822d6f 48export interface OCPP16BootNotificationRequest extends JsonObject {
fec4d204 49 chargePointVendor: string;
f738a0e9
JB
50 chargePointModel: string;
51 chargePointSerialNumber?: string;
fec4d204 52 chargeBoxSerialNumber?: string;
f738a0e9
JB
53 firmwareVersion?: string;
54 iccid?: string;
55 imsi?: string;
f738a0e9 56 meterType?: string;
fec4d204 57 meterSerialNumber?: string;
f738a0e9
JB
58}
59
e3822d6f 60export interface OCPP16StatusNotificationRequest extends JsonObject {
f738a0e9 61 connectorId: number;
c0560973 62 errorCode: OCPP16ChargePointErrorCode;
c0560973 63 status: OCPP16ChargePointStatus;
a9ed42b2 64 info?: string;
c38f0ced 65 timestamp?: Date;
f738a0e9
JB
66 vendorId?: string;
67 vendorErrorCode?: string;
68}
69
e3018bc4
JB
70export type OCPP16ClearCacheRequest = EmptyObject;
71
6dad8e21
JB
72type OCPP16ConfigurationKey = string | OCPP16StandardParametersKey | OCPP16VendorParametersKey;
73
e3822d6f 74export interface ChangeConfigurationRequest extends JsonObject {
6dad8e21 75 key: OCPP16ConfigurationKey;
f738a0e9
JB
76 value: string;
77}
78
e3822d6f 79export interface RemoteStartTransactionRequest extends JsonObject {
f738a0e9
JB
80 connectorId: number;
81 idTag: string;
c0560973 82 chargingProfile?: OCPP16ChargingProfile;
f738a0e9
JB
83}
84
e3822d6f 85export interface RemoteStopTransactionRequest extends JsonObject {
f738a0e9
JB
86 transactionId: number;
87}
88
e3822d6f 89export interface UnlockConnectorRequest extends JsonObject {
f738a0e9
JB
90 connectorId: number;
91}
92
e3822d6f 93export interface GetConfigurationRequest extends JsonObject {
6dad8e21 94 key?: OCPP16ConfigurationKey[];
f738a0e9
JB
95}
96
0ac97927 97enum ResetType {
f738a0e9 98 HARD = 'Hard',
e7aeea18 99 SOFT = 'Soft',
f738a0e9
JB
100}
101
e3822d6f 102export interface ResetRequest extends JsonObject {
f738a0e9 103 type: ResetType;
63b48f77 104}
8c476a1f 105
41189456
JB
106export interface OCPP16GetCompositeScheduleRequest extends JsonObject {
107 connectorId: number;
108 duration: number;
109 chargingRateUnit?: OCPP16ChargingRateUnitType;
110}
111
e3822d6f 112export interface SetChargingProfileRequest extends JsonObject {
8c476a1f 113 connectorId: number;
c0560973 114 csChargingProfiles: OCPP16ChargingProfile;
8c476a1f 115}
4dff73b0 116
c0560973 117export enum OCPP16AvailabilityType {
0d6f335f
JB
118 Inoperative = 'Inoperative',
119 Operative = 'Operative',
4dff73b0
JB
120}
121
366f75f6 122export interface OCPP16ChangeAvailabilityRequest extends JsonObject {
4dff73b0 123 connectorId: number;
c0560973 124 type: OCPP16AvailabilityType;
4dff73b0 125}
edf4bd64 126
41f3983a 127export interface OCPP16ClearChargingProfileRequest extends JsonObject {
edf4bd64
JB
128 id?: number;
129 connectorId?: number;
0ac97927 130 chargingProfilePurpose?: OCPP16ChargingProfilePurposeType;
edf4bd64
JB
131 stackLevel?: number;
132}
47e22477 133
b03df580
JB
134export interface OCPP16UpdateFirmwareRequest extends JsonObject {
135 location: string;
136 retrieveDate: Date;
137 retries?: number;
138 retryInterval?: number;
139}
140
d4c84337
JB
141export enum OCPP16FirmwareStatus {
142 Downloaded = 'Downloaded',
143 DownloadFailed = 'DownloadFailed',
144 Downloading = 'Downloading',
145 Idle = 'Idle',
146 InstallationFailed = 'InstallationFailed',
147 Installing = 'Installing',
148 Installed = 'Installed',
149}
150
151export type OCPP16FirmwareStatusNotificationRequest = {
152 status: OCPP16FirmwareStatus;
c9a4f9ea 153} & JsonObject;
d4c84337 154
e3822d6f 155export interface GetDiagnosticsRequest extends JsonObject {
47e22477
JB
156 location: string;
157 retries?: number;
158 retryInterval?: number;
159 startTime?: Date;
160 stopTime?: Date;
161}
162
c9a4f9ea 163export interface OCPP16DiagnosticsStatusNotificationRequest extends JsonObject {
e7aeea18 164 status: OCPP16DiagnosticsStatus;
47e22477 165}
802cfa13 166
c60ed4b8 167export enum OCPP16MessageTrigger {
802cfa13
JB
168 BootNotification = 'BootNotification',
169 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
170 FirmwareStatusNotification = 'FirmwareStatusNotification',
171 Heartbeat = 'Heartbeat',
172 MeterValues = 'MeterValues',
e7aeea18 173 StatusNotification = 'StatusNotification',
802cfa13
JB
174}
175
e3822d6f 176export interface OCPP16TriggerMessageRequest extends JsonObject {
c60ed4b8 177 requestedMessage: OCPP16MessageTrigger;
e7aeea18 178 connectorId?: number;
802cfa13 179}
91a7d3ea 180
77b95a89
JB
181export enum OCPP16DataTransferVendorId {}
182
91a7d3ea
JB
183export interface OCPP16DataTransferRequest extends JsonObject {
184 vendorId: string;
185 messageId?: string;
186 data?: string;
187}
db652e1e 188
d193a949 189export interface OCPP16ReserveNowRequest extends JsonObject {
24578c31 190 connectorId: number;
db652e1e
JB
191 expiryDate: Date;
192 idTag: string;
193 parentIdTag?: string;
194 reservationId: number;
195}
196
d193a949 197export interface OCPP16CancelReservationRequest extends JsonObject {
db652e1e
JB
198 reservationId: number;
199}