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