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