1 import type ChargingStation from
'../../charging-station/ChargingStation';
2 import type OCPPError from
'../../exception/OCPPError';
3 import type { JsonType
} from
'../JsonType';
4 import { OCPP16DiagnosticsStatus
} from
'./1.6/DiagnosticsStatus';
5 import type { OCPP16MeterValuesRequest
} from
'./1.6/MeterValues';
7 OCPP16AvailabilityType
,
8 OCPP16BootNotificationRequest
,
9 OCPP16DataTransferRequest
,
10 OCPP16HeartbeatRequest
,
11 OCPP16IncomingRequestCommand
,
14 OCPP16StatusNotificationRequest
,
15 } from
'./1.6/Requests';
16 import type { MessageType
} from
'./MessageType';
18 export type RequestCommand
= OCPP16RequestCommand
;
20 export const RequestCommand
= {
21 ...OCPP16RequestCommand
,
24 export type OutgoingRequest
= [MessageType
.CALL_MESSAGE
, string, RequestCommand
, JsonType
];
26 export type RequestParams
= {
27 skipBufferingOnError
?: boolean;
28 triggerMessage
?: boolean;
31 export type IncomingRequestCommand
= OCPP16IncomingRequestCommand
;
33 export const IncomingRequestCommand
= {
34 ...OCPP16IncomingRequestCommand
,
37 export type IncomingRequest
= [MessageType
.CALL_MESSAGE
, string, IncomingRequestCommand
, JsonType
];
39 export type CachedRequest
= [
40 (payload
: JsonType
, requestPayload
: JsonType
) => void,
41 (error
: OCPPError
, requestStatistic
?: boolean) => void,
42 RequestCommand
| IncomingRequestCommand
,
46 export type MessageTrigger
= OCPP16MessageTrigger
;
48 export const MessageTrigger
= {
49 ...OCPP16MessageTrigger
,
52 export type BootNotificationRequest
= OCPP16BootNotificationRequest
;
54 export type HeartbeatRequest
= OCPP16HeartbeatRequest
;
56 export type StatusNotificationRequest
= OCPP16StatusNotificationRequest
;
58 export type MeterValuesRequest
= OCPP16MeterValuesRequest
;
60 export type DataTransferRequest
= OCPP16DataTransferRequest
;
62 export type IncomingRequestHandler
= (
63 chargingStation
: ChargingStation
,
64 commandPayload
: JsonType
65 ) => JsonType
| Promise
<JsonType
>;
67 export type AvailabilityType
= OCPP16AvailabilityType
;
69 export const AvailabilityType
= {
70 ...OCPP16AvailabilityType
,
73 export type DiagnosticsStatus
= OCPP16DiagnosticsStatus
;
75 export const DiagnosticsStatus
= {
76 ...OCPP16DiagnosticsStatus
,
79 export type ResponseType
= JsonType
| OCPPError
;