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 OCPP16HeartbeatRequest
,
10 OCPP16IncomingRequestCommand
,
12 OCPP16StatusNotificationRequest
,
13 } from
'./1.6/Requests';
14 import type { MessageType
} from
'./MessageType';
16 export type RequestCommand
= OCPP16RequestCommand
;
18 export const RequestCommand
= {
19 ...OCPP16RequestCommand
,
22 export type OutgoingRequest
= [MessageType
.CALL_MESSAGE
, string, RequestCommand
, JsonType
];
24 export interface RequestParams
{
25 skipBufferingOnError
?: boolean;
26 triggerMessage
?: boolean;
29 export type IncomingRequestCommand
= OCPP16IncomingRequestCommand
;
31 export const IncomingRequestCommand
= {
32 ...OCPP16IncomingRequestCommand
,
35 export type IncomingRequest
= [MessageType
.CALL_MESSAGE
, string, IncomingRequestCommand
, JsonType
];
37 export type CachedRequest
= [
38 (payload
: JsonType
, requestPayload
: JsonType
) => void,
39 (error
: OCPPError
, requestStatistic
?: boolean) => void,
40 RequestCommand
| IncomingRequestCommand
,
44 export type BootNotificationRequest
= OCPP16BootNotificationRequest
;
46 export type HeartbeatRequest
= OCPP16HeartbeatRequest
;
48 export type StatusNotificationRequest
= OCPP16StatusNotificationRequest
;
50 export type MeterValuesRequest
= OCPP16MeterValuesRequest
;
52 export type IncomingRequestHandler
= (
53 chargingStation
: ChargingStation
,
54 commandPayload
: JsonType
55 ) => JsonType
| Promise
<JsonType
>;
57 export type AvailabilityType
= OCPP16AvailabilityType
;
59 export const AvailabilityType
= {
60 ...OCPP16AvailabilityType
,
63 export type DiagnosticsStatus
= OCPP16DiagnosticsStatus
;
65 export const DiagnosticsStatus
= {
66 ...OCPP16DiagnosticsStatus
,
69 export type ResponseType
= JsonType
| OCPPError
;