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';
17 type OCPP20BootNotificationRequest
,
18 OCPP20IncomingRequestCommand
,
20 type OCPP20StatusNotificationRequest
,
21 } from
'./2.0/Requests';
22 import type { MessageType
} from
'./MessageType';
23 import type ChargingStation from
'../../charging-station/ChargingStation';
24 import type OCPPError from
'../../exception/OCPPError';
25 import type { JsonType
} from
'../JsonType';
27 export const RequestCommand
= {
28 ...OCPP16RequestCommand
,
29 ...OCPP20RequestCommand
,
31 export type RequestCommand
= OCPP16RequestCommand
| OCPP20RequestCommand
;
33 export type OutgoingRequest
= [MessageType
.CALL_MESSAGE
, string, RequestCommand
, JsonType
];
35 export type RequestParams
= {
36 skipBufferingOnError
?: boolean;
37 triggerMessage
?: boolean;
41 export const IncomingRequestCommand
= {
42 ...OCPP16IncomingRequestCommand
,
43 ...OCPP20IncomingRequestCommand
,
45 export type IncomingRequestCommand
= OCPP16IncomingRequestCommand
| OCPP20IncomingRequestCommand
;
47 export type IncomingRequest
= [MessageType
.CALL_MESSAGE
, string, IncomingRequestCommand
, JsonType
];
49 export type ResponseCallback
= (payload
: JsonType
, requestPayload
: JsonType
) => void;
51 export type ErrorCallback
= (error
: OCPPError
, requestStatistic
?: boolean) => void;
53 export type CachedRequest
= [
56 RequestCommand
| IncomingRequestCommand
,
60 export const MessageTrigger
= {
61 ...OCPP16MessageTrigger
,
63 export type MessageTrigger
= OCPP16MessageTrigger
;
65 export type BootNotificationRequest
= OCPP16BootNotificationRequest
| OCPP20BootNotificationRequest
;
67 export type HeartbeatRequest
= OCPP16HeartbeatRequest
;
69 export type StatusNotificationRequest
=
70 | OCPP16StatusNotificationRequest
71 | OCPP20StatusNotificationRequest
;
73 export type MeterValuesRequest
= OCPP16MeterValuesRequest
;
75 export type DataTransferRequest
= OCPP16DataTransferRequest
;
77 export type DiagnosticsStatusNotificationRequest
= OCPP16DiagnosticsStatusNotificationRequest
;
79 export type FirmwareStatusNotificationRequest
= OCPP16FirmwareStatusNotificationRequest
;
81 export type IncomingRequestHandler
= (
82 chargingStation
: ChargingStation
,
83 commandPayload
: JsonType
84 ) => JsonType
| Promise
<JsonType
>;
86 export const AvailabilityType
= {
87 ...OCPP16AvailabilityType
,
89 export type AvailabilityType
= OCPP16AvailabilityType
;
91 export const DiagnosticsStatus
= {
92 ...OCPP16DiagnosticsStatus
,
94 export type DiagnosticsStatus
= OCPP16DiagnosticsStatus
;
96 export const FirmwareStatus
= {
97 ...OCPP16FirmwareStatus
,
99 export type FirmwareStatus
= OCPP16FirmwareStatus
;
101 export type ResponseType
= JsonType
| OCPPError
;