perf: reduce OCPPUtils memory usage
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
... / ...
CommitLineData
1import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
2import type { OCPP16ChargePointStatus } from './ChargePointStatus';
3import type {
4 OCPP16ChargingProfile,
5 OCPP16ChargingProfilePurposeType,
6 OCPP16ChargingRateUnitType,
7} from './ChargingProfile';
8import type { OCPP16StandardParametersKey, OCPP16VendorParametersKey } from './Configuration';
9import type { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
10import type { EmptyObject } from '../../EmptyObject';
11import type { JsonObject } from '../../JsonType';
12
13export 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
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',
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 RESERVE_NOW = 'ReserveNow',
43 CANCEL_RESERVATION = 'CancelReservation',
44}
45
46export type OCPP16HeartbeatRequest = EmptyObject;
47
48export interface OCPP16BootNotificationRequest extends JsonObject {
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;
58}
59
60export interface OCPP16StatusNotificationRequest extends JsonObject {
61 connectorId: number;
62 errorCode: OCPP16ChargePointErrorCode;
63 status: OCPP16ChargePointStatus;
64 info?: string;
65 timestamp?: Date;
66 vendorId?: string;
67 vendorErrorCode?: string;
68}
69
70export type OCPP16ClearCacheRequest = EmptyObject;
71
72type OCPP16ConfigurationKey = string | OCPP16StandardParametersKey | OCPP16VendorParametersKey;
73
74export interface ChangeConfigurationRequest extends JsonObject {
75 key: OCPP16ConfigurationKey;
76 value: string;
77}
78
79export interface RemoteStartTransactionRequest extends JsonObject {
80 connectorId: number;
81 idTag: string;
82 chargingProfile?: OCPP16ChargingProfile;
83}
84
85export interface RemoteStopTransactionRequest extends JsonObject {
86 transactionId: number;
87}
88
89export interface UnlockConnectorRequest extends JsonObject {
90 connectorId: number;
91}
92
93export interface GetConfigurationRequest extends JsonObject {
94 key?: OCPP16ConfigurationKey[];
95}
96
97enum ResetType {
98 HARD = 'Hard',
99 SOFT = 'Soft',
100}
101
102export interface ResetRequest extends JsonObject {
103 type: ResetType;
104}
105
106export interface OCPP16GetCompositeScheduleRequest extends JsonObject {
107 connectorId: number;
108 duration: number;
109 chargingRateUnit?: OCPP16ChargingRateUnitType;
110}
111
112export interface SetChargingProfileRequest extends JsonObject {
113 connectorId: number;
114 csChargingProfiles: OCPP16ChargingProfile;
115}
116
117export enum OCPP16AvailabilityType {
118 Inoperative = 'Inoperative',
119 Operative = 'Operative',
120}
121
122export interface OCPP16ChangeAvailabilityRequest extends JsonObject {
123 connectorId: number;
124 type: OCPP16AvailabilityType;
125}
126
127export interface ClearChargingProfileRequest extends JsonObject {
128 id?: number;
129 connectorId?: number;
130 chargingProfilePurpose?: OCPP16ChargingProfilePurposeType;
131 stackLevel?: number;
132}
133
134export interface OCPP16UpdateFirmwareRequest extends JsonObject {
135 location: string;
136 retrieveDate: Date;
137 retries?: number;
138 retryInterval?: number;
139}
140
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;
153} & JsonObject;
154
155export interface GetDiagnosticsRequest extends JsonObject {
156 location: string;
157 retries?: number;
158 retryInterval?: number;
159 startTime?: Date;
160 stopTime?: Date;
161}
162
163export interface OCPP16DiagnosticsStatusNotificationRequest extends JsonObject {
164 status: OCPP16DiagnosticsStatus;
165}
166
167export enum OCPP16MessageTrigger {
168 BootNotification = 'BootNotification',
169 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
170 FirmwareStatusNotification = 'FirmwareStatusNotification',
171 Heartbeat = 'Heartbeat',
172 MeterValues = 'MeterValues',
173 StatusNotification = 'StatusNotification',
174}
175
176export interface OCPP16TriggerMessageRequest extends JsonObject {
177 requestedMessage: OCPP16MessageTrigger;
178 connectorId?: number;
179}
180
181export enum OCPP16DataTransferVendorId {}
182
183export interface OCPP16DataTransferRequest extends JsonObject {
184 vendorId: string;
185 messageId?: string;
186 data?: string;
187}
188
189export interface OCPP16ReserveNowRequest extends JsonObject {
190 connectorId: number;
191 expiryDate: Date;
192 idTag: string;
193 parentIdTag?: string;
194 reservationId: number;
195}
196
197export interface OCPP16CancelReservationRequest extends JsonObject {
198 reservationId: number;
199}