chore: switch coding style to JS standard
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
CommitLineData
66a7748d
JB
1import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode.js'
2import type { OCPP16ChargePointStatus } from './ChargePointStatus.js'
2896e06d 3import type {
2896e06d 4 OCPP16ChargingProfile,
0ac97927 5 OCPP16ChargingProfilePurposeType,
66a7748d
JB
6 OCPP16ChargingRateUnitType
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',
66a7748d 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 42 RESERVE_NOW = 'ReserveNow',
66a7748d 43 CANCEL_RESERVATION = 'CancelReservation'
953d6b02
JB
44}
45
66a7748d 46export type OCPP16HeartbeatRequest = EmptyObject
f738a0e9 47
e3822d6f 48export interface OCPP16BootNotificationRequest extends JsonObject {
66a7748d
JB
49 chargePointVendor: string
50 chargePointModel: string
51 chargePointSerialNumber?: string
52 chargeBoxSerialNumber?: string
53 firmwareVersion?: string
54 iccid?: string
55 imsi?: string
56 meterType?: string
57 meterSerialNumber?: string
f738a0e9
JB
58}
59
e3822d6f 60export interface OCPP16StatusNotificationRequest extends JsonObject {
66a7748d
JB
61 connectorId: number
62 errorCode: OCPP16ChargePointErrorCode
63 status: OCPP16ChargePointStatus
64 info?: string
65 timestamp?: Date
66 vendorId?: string
67 vendorErrorCode?: string
f738a0e9
JB
68}
69
66a7748d 70export type OCPP16ClearCacheRequest = EmptyObject
e3018bc4 71
66a7748d 72type OCPP16ConfigurationKey = string | OCPP16StandardParametersKey | OCPP16VendorParametersKey
6dad8e21 73
e3822d6f 74export interface ChangeConfigurationRequest extends JsonObject {
66a7748d
JB
75 key: OCPP16ConfigurationKey
76 value: string
f738a0e9
JB
77}
78
e3822d6f 79export interface RemoteStartTransactionRequest extends JsonObject {
66a7748d
JB
80 connectorId: number
81 idTag: string
82 chargingProfile?: OCPP16ChargingProfile
f738a0e9
JB
83}
84
e3822d6f 85export interface RemoteStopTransactionRequest extends JsonObject {
66a7748d 86 transactionId: number
f738a0e9
JB
87}
88
e3822d6f 89export interface UnlockConnectorRequest extends JsonObject {
66a7748d 90 connectorId: number
f738a0e9
JB
91}
92
e3822d6f 93export interface GetConfigurationRequest extends JsonObject {
66a7748d 94 key?: OCPP16ConfigurationKey[]
f738a0e9
JB
95}
96
0ac97927 97enum ResetType {
f738a0e9 98 HARD = 'Hard',
66a7748d 99 SOFT = 'Soft'
f738a0e9
JB
100}
101
e3822d6f 102export interface ResetRequest extends JsonObject {
66a7748d 103 type: ResetType
63b48f77 104}
8c476a1f 105
41189456 106export interface OCPP16GetCompositeScheduleRequest extends JsonObject {
66a7748d
JB
107 connectorId: number
108 duration: number
109 chargingRateUnit?: OCPP16ChargingRateUnitType
41189456
JB
110}
111
e3822d6f 112export interface SetChargingProfileRequest extends JsonObject {
66a7748d
JB
113 connectorId: number
114 csChargingProfiles: OCPP16ChargingProfile
8c476a1f 115}
4dff73b0 116
c0560973 117export enum OCPP16AvailabilityType {
0d6f335f 118 Inoperative = 'Inoperative',
66a7748d 119 Operative = 'Operative'
4dff73b0
JB
120}
121
366f75f6 122export interface OCPP16ChangeAvailabilityRequest extends JsonObject {
66a7748d
JB
123 connectorId: number
124 type: OCPP16AvailabilityType
4dff73b0 125}
edf4bd64 126
41f3983a 127export interface OCPP16ClearChargingProfileRequest extends JsonObject {
66a7748d
JB
128 id?: number
129 connectorId?: number
130 chargingProfilePurpose?: OCPP16ChargingProfilePurposeType
131 stackLevel?: number
edf4bd64 132}
47e22477 133
b03df580 134export interface OCPP16UpdateFirmwareRequest extends JsonObject {
66a7748d
JB
135 location: string
136 retrieveDate: Date
137 retries?: number
138 retryInterval?: number
b03df580
JB
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',
66a7748d 148 Installed = 'Installed'
d4c84337
JB
149}
150
151export type OCPP16FirmwareStatusNotificationRequest = {
66a7748d
JB
152 status: OCPP16FirmwareStatus
153} & JsonObject
d4c84337 154
e3822d6f 155export interface GetDiagnosticsRequest extends JsonObject {
66a7748d
JB
156 location: string
157 retries?: number
158 retryInterval?: number
159 startTime?: Date
160 stopTime?: Date
47e22477
JB
161}
162
c9a4f9ea 163export interface OCPP16DiagnosticsStatusNotificationRequest extends JsonObject {
66a7748d 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',
66a7748d 173 StatusNotification = 'StatusNotification'
802cfa13
JB
174}
175
e3822d6f 176export interface OCPP16TriggerMessageRequest extends JsonObject {
66a7748d
JB
177 requestedMessage: OCPP16MessageTrigger
178 connectorId?: number
802cfa13 179}
91a7d3ea 180
77b95a89
JB
181export enum OCPP16DataTransferVendorId {}
182
91a7d3ea 183export interface OCPP16DataTransferRequest extends JsonObject {
66a7748d
JB
184 vendorId: string
185 messageId?: string
186 data?: string
91a7d3ea 187}
db652e1e 188
d193a949 189export interface OCPP16ReserveNowRequest extends JsonObject {
66a7748d
JB
190 connectorId: number
191 expiryDate: Date
192 idTag: string
193 parentIdTag?: string
194 reservationId: number
db652e1e
JB
195}
196
d193a949 197export interface OCPP16CancelReservationRequest extends JsonObject {
66a7748d 198 reservationId: number
db652e1e 199}