1 import { OCPP16DiagnosticsStatus
} from
'./1.6/DiagnosticsStatus';
2 import type { OCPP16MeterValuesRequest
} from
'./1.6/MeterValues';
4 OCPP16AvailabilityType
,
5 type OCPP16BootNotificationRequest
,
6 type OCPP16DataTransferRequest
,
7 type OCPP16DiagnosticsStatusNotificationRequest
,
9 type OCPP16FirmwareStatusNotificationRequest
,
10 type OCPP16HeartbeatRequest
,
11 OCPP16IncomingRequestCommand
,
14 type OCPP16StatusNotificationRequest
,
15 } from
'./1.6/Requests';
16 import { OperationalStatusEnumType
} from
'./2.0/Common';
18 type OCPP20BootNotificationRequest
,
19 OCPP20IncomingRequestCommand
,
21 type OCPP20StatusNotificationRequest
,
22 } from
'./2.0/Requests';
23 import type { MessageType
} from
'./MessageType';
24 import type { ChargingStation
} from
'../../charging-station';
25 import type { OCPPError
} from
'../../exception';
26 import type { JsonType
} from
'../JsonType';
28 export const RequestCommand
= {
29 ...OCPP16RequestCommand
,
30 ...OCPP20RequestCommand
,
32 export type RequestCommand
= OCPP16RequestCommand
| OCPP20RequestCommand
;
34 export type OutgoingRequest
= [MessageType
.CALL_MESSAGE
, string, RequestCommand
, JsonType
];
36 export type RequestParams
= {
37 skipBufferingOnError
?: boolean;
38 triggerMessage
?: boolean;
42 export const IncomingRequestCommand
= {
43 ...OCPP16IncomingRequestCommand
,
44 ...OCPP20IncomingRequestCommand
,
46 export type IncomingRequestCommand
= OCPP16IncomingRequestCommand
| OCPP20IncomingRequestCommand
;
48 export type IncomingRequest
= [MessageType
.CALL_MESSAGE
, string, IncomingRequestCommand
, JsonType
];
50 export type ResponseCallback
= (payload
: JsonType
, requestPayload
: JsonType
) => void;
52 export type ErrorCallback
= (error
: OCPPError
, requestStatistic
?: boolean) => void;
54 export type CachedRequest
= [
57 RequestCommand
| IncomingRequestCommand
,
61 export const MessageTrigger
= {
62 ...OCPP16MessageTrigger
,
64 export type MessageTrigger
= OCPP16MessageTrigger
;
66 export type BootNotificationRequest
= OCPP16BootNotificationRequest
| OCPP20BootNotificationRequest
;
68 export type HeartbeatRequest
= OCPP16HeartbeatRequest
;
70 export type StatusNotificationRequest
=
71 | OCPP16StatusNotificationRequest
72 | OCPP20StatusNotificationRequest
;
74 export type MeterValuesRequest
= OCPP16MeterValuesRequest
;
76 export type DataTransferRequest
= OCPP16DataTransferRequest
;
78 export type DiagnosticsStatusNotificationRequest
= OCPP16DiagnosticsStatusNotificationRequest
;
80 export type FirmwareStatusNotificationRequest
= OCPP16FirmwareStatusNotificationRequest
;
82 export type IncomingRequestHandler
= (
83 chargingStation
: ChargingStation
,
84 commandPayload
: JsonType
85 ) => JsonType
| Promise
<JsonType
>;
87 export const AvailabilityType
= {
88 ...OCPP16AvailabilityType
,
89 ...OperationalStatusEnumType
,
91 export type AvailabilityType
= OCPP16AvailabilityType
| OperationalStatusEnumType
;
93 export const DiagnosticsStatus
= {
94 ...OCPP16DiagnosticsStatus
,
96 export type DiagnosticsStatus
= OCPP16DiagnosticsStatus
;
98 export const FirmwareStatus
= {
99 ...OCPP16FirmwareStatus
,
101 export type FirmwareStatus
= OCPP16FirmwareStatus
;
103 export type ResponseType
= JsonType
| OCPPError
;