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