Ensure 1:1 mapping between charging station instance and its OCPP services
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / Requests.ts
CommitLineData
c0560973
JB
1import { OCPP16AvailabilityType, OCPP16BootNotificationRequest, OCPP16IncomingRequestCommand, OCPP16RequestCommand } from './1.6/Requests';
2
d1888640 3import { JsonType } from '../JsonType';
6a64534b 4import { MessageType } from './MessageType';
47e22477 5import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus';
e58068fd 6import OCPPError from '../../exception/OCPPError';
6a64534b 7
caad9d6b
JB
8export interface SendParams {
9 skipBufferingOnError?: boolean,
10 triggerMessage?: boolean
11}
12
d1888640 13export type IncomingRequestHandler = (commandPayload: JsonType) => JsonType | Promise<JsonType>;
58144adb 14
c0560973
JB
15export type BootNotificationRequest = OCPP16BootNotificationRequest;
16
7e3926cc 17export type AvailabilityType = OCPP16AvailabilityType;
c0560973
JB
18
19export const AvailabilityType = {
20 ...OCPP16AvailabilityType
21};
22
7e3926cc 23export type RequestCommand = OCPP16RequestCommand;
c0560973
JB
24
25export const RequestCommand = {
26 ...OCPP16RequestCommand
27};
28
7e3926cc 29export type IncomingRequestCommand = OCPP16IncomingRequestCommand;
9c13b3b5
JB
30
31export const IncomingRequestCommand = {
32 ...OCPP16IncomingRequestCommand
33};
c0560973 34
47e22477
JB
35export type DiagnosticsStatus = OCPP16DiagnosticsStatus;
36
37export const DiagnosticsStatus = {
38 ...OCPP16DiagnosticsStatus
39};
40
d1888640 41export type Request = [MessageType, string, RequestCommand, JsonType, JsonType];
6a64534b 42
d1888640 43export type IncomingRequest = [MessageType, string, IncomingRequestCommand, JsonType, JsonType];
32b02249 44
d1888640 45export type CachedRequest = [(payload: JsonType, requestPayload: JsonType) => void, (error: OCPPError, requestStatistic?: boolean) => void, RequestCommand | IncomingRequestCommand, JsonType | OCPPError];