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
} 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 StatusNotificationResponse
= OCPP16StatusNotificationResponse
;
41 export type MeterValuesResponse
= OCPP16MeterValuesResponse
;
43 export type DataTransferResponse
= OCPP16DataTransferResponse
;
45 export type DiagnosticsStatusNotificationResponse
= OCPP16DiagnosticsStatusNotificationResponse
;
47 export type FirmwareStatusNotificationResponse
= OCPP16FirmwareStatusNotificationResponse
;
49 export enum DefaultStatus
{
50 ACCEPTED
= 'Accepted',
51 REJECTED
= 'Rejected',
54 export type DefaultResponse
= {
55 status: DefaultStatus
;
58 export enum RegistrationStatusEnumType
{
59 ACCEPTED
= 'Accepted',
61 REJECTED
= 'Rejected',
64 export const AvailabilityStatus
= {
65 ...OCPP16AvailabilityStatus
,
67 export type AvailabilityStatus
= OCPP16AvailabilityStatus
;
69 export const ChargingProfileStatus
= {
70 ...OCPP16ChargingProfileStatus
,
72 export type ChargingProfileStatus
= OCPP16ChargingProfileStatus
;
74 export const ClearChargingProfileStatus
= {
75 ...OCPP16ClearChargingProfileStatus
,
77 export type ClearChargingProfileStatus
= OCPP16ClearChargingProfileStatus
;
79 export const ConfigurationStatus
= {
80 ...OCPP16ConfigurationStatus
,
82 export type ConfigurationStatus
= OCPP16ConfigurationStatus
;
84 export const UnlockStatus
= {
85 ...OCPP16UnlockStatus
,
87 export type UnlockStatus
= OCPP16UnlockStatus
;
89 export const TriggerMessageStatus
= {
90 ...OCPP16TriggerMessageStatus
,
92 export type TriggerMessageStatus
= OCPP16TriggerMessageStatus
;
94 export const DataTransferStatus
= {
95 ...OCPP16DataTransferStatus
,
97 export type DataTransferStatus
= OCPP16DataTransferStatus
;