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