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