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