1 import type ChargingStation from
'../../charging-station/ChargingStation';
2 import type { JsonType
} from
'../JsonType';
3 import type { OCPP16MeterValuesResponse
} from
'./1.6/MeterValues';
5 OCPP16AvailabilityStatus
,
6 type OCPP16BootNotificationResponse
,
7 OCPP16ChargingProfileStatus
,
8 OCPP16ClearChargingProfileStatus
,
9 OCPP16ConfigurationStatus
,
10 type OCPP16DataTransferResponse
,
11 OCPP16DataTransferStatus
,
12 type OCPP16DiagnosticsStatusNotificationResponse
,
13 type OCPP16FirmwareStatusNotificationResponse
,
14 type OCPP16HeartbeatResponse
,
15 type OCPP16StatusNotificationResponse
,
16 OCPP16TriggerMessageStatus
,
18 } from
'./1.6/Responses';
19 import type { OCPP20BootNotificationResponse
, OCPP20ClearCacheResponse
} from
'./2.0/Responses';
20 import type { ErrorType
} from
'./ErrorType';
21 import type { MessageType
} from
'./MessageType';
23 export type Response
= [MessageType
.CALL_RESULT_MESSAGE
, string, JsonType
];
25 export type ErrorResponse
= [MessageType
.CALL_ERROR_MESSAGE
, string, ErrorType
, string, JsonType
];
27 export type ResponseHandler
= (
28 chargingStation
: ChargingStation
,
30 requestPayload
?: JsonType
31 ) => void | Promise
<void>;
33 export type BootNotificationResponse
=
34 | OCPP16BootNotificationResponse
35 | OCPP20BootNotificationResponse
;
37 export type HeartbeatResponse
= OCPP16HeartbeatResponse
;
39 export type ClearCacheResponse
= DefaultResponse
| OCPP20ClearCacheResponse
;
41 export type StatusNotificationResponse
= OCPP16StatusNotificationResponse
;
43 export type MeterValuesResponse
= OCPP16MeterValuesResponse
;
45 export type DataTransferResponse
= OCPP16DataTransferResponse
;
47 export type DiagnosticsStatusNotificationResponse
= OCPP16DiagnosticsStatusNotificationResponse
;
49 export type FirmwareStatusNotificationResponse
= OCPP16FirmwareStatusNotificationResponse
;
51 export enum DefaultStatus
{
52 ACCEPTED
= 'Accepted',
53 REJECTED
= 'Rejected',
56 export type DefaultResponse
= {
57 status: DefaultStatus
;
60 export enum RegistrationStatusEnumType
{
61 ACCEPTED
= 'Accepted',
63 REJECTED
= 'Rejected',
66 export const AvailabilityStatus
= {
67 ...OCPP16AvailabilityStatus
,
69 export type AvailabilityStatus
= OCPP16AvailabilityStatus
;
71 export const ChargingProfileStatus
= {
72 ...OCPP16ChargingProfileStatus
,
74 export type ChargingProfileStatus
= OCPP16ChargingProfileStatus
;
76 export const ClearChargingProfileStatus
= {
77 ...OCPP16ClearChargingProfileStatus
,
79 export type ClearChargingProfileStatus
= OCPP16ClearChargingProfileStatus
;
81 export const ConfigurationStatus
= {
82 ...OCPP16ConfigurationStatus
,
84 export type ConfigurationStatus
= OCPP16ConfigurationStatus
;
86 export const UnlockStatus
= {
87 ...OCPP16UnlockStatus
,
89 export type UnlockStatus
= OCPP16UnlockStatus
;
91 export const TriggerMessageStatus
= {
92 ...OCPP16TriggerMessageStatus
,
94 export type TriggerMessageStatus
= OCPP16TriggerMessageStatus
;
96 export const DataTransferStatus
= {
97 ...OCPP16DataTransferStatus
,
99 export type DataTransferStatus
= OCPP16DataTransferStatus
;