Add charging stations listing to WS server commands
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / Requests.ts
CommitLineData
c0560973
JB
1import { OCPP16AvailabilityType, OCPP16BootNotificationRequest, OCPP16IncomingRequestCommand, OCPP16RequestCommand } from './1.6/Requests';
2
6a64534b 3import { MessageType } from './MessageType';
47e22477 4import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus';
14763b46 5import OCPPError from '../../charging-station/ocpp/OCPPError';
6a64534b 6
58144adb
JB
7export type IncomingRequestHandler = (commandPayload: Record<string, unknown>) => Record<string, unknown> | Promise<Record<string, unknown>>;
8
c0560973
JB
9export type BootNotificationRequest = OCPP16BootNotificationRequest;
10
7e3926cc 11export type AvailabilityType = OCPP16AvailabilityType;
c0560973
JB
12
13export const AvailabilityType = {
14 ...OCPP16AvailabilityType
15};
16
7e3926cc 17export type RequestCommand = OCPP16RequestCommand;
c0560973
JB
18
19export const RequestCommand = {
20 ...OCPP16RequestCommand
21};
22
7e3926cc 23export type IncomingRequestCommand = OCPP16IncomingRequestCommand;
9c13b3b5
JB
24
25export const IncomingRequestCommand = {
26 ...OCPP16IncomingRequestCommand
27};
c0560973 28
47e22477
JB
29export type DiagnosticsStatus = OCPP16DiagnosticsStatus;
30
31export const DiagnosticsStatus = {
32 ...OCPP16DiagnosticsStatus
33};
34
32b02249 35export type Request = [MessageType, string, RequestCommand, Record<string, unknown>, Record<string, unknown>];
6a64534b 36
690e5af7 37export type IncomingRequest = [MessageType, string, IncomingRequestCommand, Record<string, unknown>, Record<string, unknown>];
32b02249 38
9239b49a 39export type CachedRequest = [(payload: Record<string, unknown> | string, requestPayload: Record<string, unknown>) => void, (error: OCPPError, requestStatistic?: boolean) => void, RequestCommand | IncomingRequestCommand, Record<string, unknown>];