Refine TS and linter configuration
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
CommitLineData
6c1761d4
JB
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';
5bd15d76 8
c0560973 9export enum OCPP16RequestCommand {
d9f60ba1
JB
10 BOOT_NOTIFICATION = 'BootNotification',
11 HEARTBEAT = 'Heartbeat',
12 STATUS_NOTIFICATION = 'StatusNotification',
ef6076c1 13 AUTHORIZE = 'Authorize',
d9f60ba1
JB
14 START_TRANSACTION = 'StartTransaction',
15 STOP_TRANSACTION = 'StopTransaction',
47e22477 16 METER_VALUES = 'MeterValues',
e7aeea18 17 DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification',
d9f60ba1
JB
18}
19
ef6fa3fb 20export type OCPP16HeartbeatRequest = EmptyObject;
f738a0e9 21
e3822d6f 22export interface OCPP16BootNotificationRequest extends JsonObject {
fec4d204 23 chargePointVendor: string;
f738a0e9
JB
24 chargePointModel: string;
25 chargePointSerialNumber?: string;
fec4d204 26 chargeBoxSerialNumber?: string;
f738a0e9
JB
27 firmwareVersion?: string;
28 iccid?: string;
29 imsi?: string;
f738a0e9 30 meterType?: string;
fec4d204 31 meterSerialNumber?: string;
f738a0e9
JB
32}
33
e3822d6f 34export interface OCPP16StatusNotificationRequest extends JsonObject {
f738a0e9 35 connectorId: number;
c0560973 36 errorCode: OCPP16ChargePointErrorCode;
f738a0e9 37 info?: string;
c0560973 38 status: OCPP16ChargePointStatus;
f738a0e9
JB
39 timestamp?: string;
40 vendorId?: string;
41 vendorErrorCode?: string;
42}
43
e3018bc4
JB
44export enum OCPP16IncomingRequestCommand {
45 RESET = 'Reset',
46 CLEAR_CACHE = 'ClearCache',
47 CHANGE_AVAILABILITY = 'ChangeAvailability',
48 UNLOCK_CONNECTOR = 'UnlockConnector',
49 GET_CONFIGURATION = 'GetConfiguration',
50 CHANGE_CONFIGURATION = 'ChangeConfiguration',
51 SET_CHARGING_PROFILE = 'SetChargingProfile',
52 CLEAR_CHARGING_PROFILE = 'ClearChargingProfile',
53 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
54 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
55 GET_DIAGNOSTICS = 'GetDiagnostics',
56 TRIGGER_MESSAGE = 'TriggerMessage',
57}
58
59export type OCPP16ClearCacheRequest = EmptyObject;
60
e3822d6f 61export interface ChangeConfigurationRequest extends JsonObject {
c0560973 62 key: string | OCPP16StandardParametersKey;
f738a0e9
JB
63 value: string;
64}
65
e3822d6f 66export interface RemoteStartTransactionRequest extends JsonObject {
f738a0e9
JB
67 connectorId: number;
68 idTag: string;
c0560973 69 chargingProfile?: OCPP16ChargingProfile;
f738a0e9
JB
70}
71
e3822d6f 72export interface RemoteStopTransactionRequest extends JsonObject {
f738a0e9
JB
73 transactionId: number;
74}
75
e3822d6f 76export interface UnlockConnectorRequest extends JsonObject {
f738a0e9
JB
77 connectorId: number;
78}
79
e3822d6f 80export interface GetConfigurationRequest extends JsonObject {
c0560973 81 key?: string | OCPP16StandardParametersKey[];
f738a0e9
JB
82}
83
84export enum ResetType {
85 HARD = 'Hard',
e7aeea18 86 SOFT = 'Soft',
f738a0e9
JB
87}
88
e3822d6f 89export interface ResetRequest extends JsonObject {
f738a0e9 90 type: ResetType;
63b48f77 91}
8c476a1f 92
e3822d6f 93export interface SetChargingProfileRequest extends JsonObject {
8c476a1f 94 connectorId: number;
c0560973 95 csChargingProfiles: OCPP16ChargingProfile;
8c476a1f 96}
4dff73b0 97
c0560973 98export enum OCPP16AvailabilityType {
4dff73b0 99 INOPERATIVE = 'Inoperative',
e7aeea18 100 OPERATIVE = 'Operative',
4dff73b0
JB
101}
102
e3822d6f 103export interface ChangeAvailabilityRequest extends JsonObject {
4dff73b0 104 connectorId: number;
c0560973 105 type: OCPP16AvailabilityType;
4dff73b0 106}
edf4bd64 107
e3822d6f 108export interface ClearChargingProfileRequest extends JsonObject {
edf4bd64
JB
109 id?: number;
110 connectorId?: number;
111 chargingProfilePurpose?: ChargingProfilePurposeType;
112 stackLevel?: number;
113}
47e22477 114
e3822d6f 115export interface GetDiagnosticsRequest extends JsonObject {
47e22477
JB
116 location: string;
117 retries?: number;
118 retryInterval?: number;
119 startTime?: Date;
120 stopTime?: Date;
121}
122
e3822d6f 123export interface DiagnosticsStatusNotificationRequest extends JsonObject {
e7aeea18 124 status: OCPP16DiagnosticsStatus;
47e22477 125}
802cfa13
JB
126
127export enum MessageTrigger {
128 BootNotification = 'BootNotification',
129 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
130 FirmwareStatusNotification = 'FirmwareStatusNotification',
131 Heartbeat = 'Heartbeat',
132 MeterValues = 'MeterValues',
e7aeea18 133 StatusNotification = 'StatusNotification',
802cfa13
JB
134}
135
e3822d6f 136export interface OCPP16TriggerMessageRequest extends JsonObject {
802cfa13 137 requestedMessage: MessageTrigger;
e7aeea18 138 connectorId?: number;
802cfa13 139}