Import cleanups
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
... / ...
CommitLineData
1import type { EmptyObject } from '../../EmptyObject';
2import type { JsonObject } from '../../JsonType';
3import type { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
4import type { OCPP16ChargePointStatus } from './ChargePointStatus';
5import type { ChargingProfilePurposeType, OCPP16ChargingProfile } from './ChargingProfile';
6import type { OCPP16StandardParametersKey } from './Configuration';
7import type { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
8
9export enum OCPP16RequestCommand {
10 BOOT_NOTIFICATION = 'BootNotification',
11 HEARTBEAT = 'Heartbeat',
12 STATUS_NOTIFICATION = 'StatusNotification',
13 AUTHORIZE = 'Authorize',
14 START_TRANSACTION = 'StartTransaction',
15 STOP_TRANSACTION = 'StopTransaction',
16 METER_VALUES = 'MeterValues',
17 DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification',
18 DATA_TRANSFER = 'DataTransfer',
19}
20
21export enum OCPP16IncomingRequestCommand {
22 RESET = 'Reset',
23 CLEAR_CACHE = 'ClearCache',
24 CHANGE_AVAILABILITY = 'ChangeAvailability',
25 UNLOCK_CONNECTOR = 'UnlockConnector',
26 GET_CONFIGURATION = 'GetConfiguration',
27 CHANGE_CONFIGURATION = 'ChangeConfiguration',
28 SET_CHARGING_PROFILE = 'SetChargingProfile',
29 CLEAR_CHARGING_PROFILE = 'ClearChargingProfile',
30 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
31 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
32 GET_DIAGNOSTICS = 'GetDiagnostics',
33 TRIGGER_MESSAGE = 'TriggerMessage',
34 DATA_TRANSFER = 'DataTransfer',
35 UPDATE_FIRMWARE = 'UpdateFirmware',
36}
37
38export type OCPP16HeartbeatRequest = EmptyObject;
39
40export interface OCPP16BootNotificationRequest extends JsonObject {
41 chargePointVendor: string;
42 chargePointModel: string;
43 chargePointSerialNumber?: string;
44 chargeBoxSerialNumber?: string;
45 firmwareVersion?: string;
46 iccid?: string;
47 imsi?: string;
48 meterType?: string;
49 meterSerialNumber?: string;
50}
51
52export interface OCPP16StatusNotificationRequest extends JsonObject {
53 connectorId: number;
54 errorCode: OCPP16ChargePointErrorCode;
55 status: OCPP16ChargePointStatus;
56 info?: string;
57 timestamp?: string;
58 vendorId?: string;
59 vendorErrorCode?: string;
60}
61
62export type OCPP16ClearCacheRequest = EmptyObject;
63
64export interface ChangeConfigurationRequest extends JsonObject {
65 key: string | OCPP16StandardParametersKey;
66 value: string;
67}
68
69export interface RemoteStartTransactionRequest extends JsonObject {
70 connectorId: number;
71 idTag: string;
72 chargingProfile?: OCPP16ChargingProfile;
73}
74
75export interface RemoteStopTransactionRequest extends JsonObject {
76 transactionId: number;
77}
78
79export interface UnlockConnectorRequest extends JsonObject {
80 connectorId: number;
81}
82
83export interface GetConfigurationRequest extends JsonObject {
84 key?: string | OCPP16StandardParametersKey[];
85}
86
87export enum ResetType {
88 HARD = 'Hard',
89 SOFT = 'Soft',
90}
91
92export interface ResetRequest extends JsonObject {
93 type: ResetType;
94}
95
96export interface SetChargingProfileRequest extends JsonObject {
97 connectorId: number;
98 csChargingProfiles: OCPP16ChargingProfile;
99}
100
101export enum OCPP16AvailabilityType {
102 INOPERATIVE = 'Inoperative',
103 OPERATIVE = 'Operative',
104}
105
106export interface ChangeAvailabilityRequest extends JsonObject {
107 connectorId: number;
108 type: OCPP16AvailabilityType;
109}
110
111export interface ClearChargingProfileRequest extends JsonObject {
112 id?: number;
113 connectorId?: number;
114 chargingProfilePurpose?: ChargingProfilePurposeType;
115 stackLevel?: number;
116}
117
118export interface OCPP16UpdateFirmwareRequest extends JsonObject {
119 location: string;
120 retrieveDate: Date;
121 retries?: number;
122 retryInterval?: number;
123}
124
125export interface GetDiagnosticsRequest extends JsonObject {
126 location: string;
127 retries?: number;
128 retryInterval?: number;
129 startTime?: Date;
130 stopTime?: Date;
131}
132
133export interface DiagnosticsStatusNotificationRequest extends JsonObject {
134 status: OCPP16DiagnosticsStatus;
135}
136
137export enum OCPP16MessageTrigger {
138 BootNotification = 'BootNotification',
139 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
140 FirmwareStatusNotification = 'FirmwareStatusNotification',
141 Heartbeat = 'Heartbeat',
142 MeterValues = 'MeterValues',
143 StatusNotification = 'StatusNotification',
144}
145
146export interface OCPP16TriggerMessageRequest extends JsonObject {
147 requestedMessage: OCPP16MessageTrigger;
148 connectorId?: number;
149}
150
151export enum OCPP16DataTransferVendorId {}
152
153export interface OCPP16DataTransferRequest extends JsonObject {
154 vendorId: string;
155 messageId?: string;
156 data?: string;
157}