1 import type { ChargingStation
} from
'../../charging-station/index.js'
2 import type { JsonType
} from
'../JsonType.js'
3 import type { OCPP16MeterValuesResponse
} from
'./1.6/MeterValues.js'
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 OCPP16ReservationStatus
,
16 type OCPP16StatusNotificationResponse
,
17 OCPP16TriggerMessageStatus
,
19 } from
'./1.6/Responses.js'
20 import type { OCPP20BootNotificationResponse
, OCPP20ClearCacheResponse
} from
'./2.0/Responses.js'
21 import { type GenericResponse
, GenericStatus
} from
'./Common.js'
22 import type { ErrorType
} from
'./ErrorType.js'
23 import type { MessageType
} from
'./MessageType.js'
25 export type Response
= [MessageType
.CALL_RESULT_MESSAGE
, string, JsonType
]
27 export type ErrorResponse
= [MessageType
.CALL_ERROR_MESSAGE
, string, ErrorType
, string, JsonType
]
29 export type ResponseHandler
= (
30 chargingStation
: ChargingStation
,
32 requestPayload
?: JsonType
33 ) => void | Promise
<void>
35 export type BootNotificationResponse
=
36 | OCPP16BootNotificationResponse
37 | OCPP20BootNotificationResponse
39 export type HeartbeatResponse
= OCPP16HeartbeatResponse
41 export type ClearCacheResponse
= GenericResponse
| OCPP20ClearCacheResponse
43 export type StatusNotificationResponse
= OCPP16StatusNotificationResponse
45 export type MeterValuesResponse
= OCPP16MeterValuesResponse
47 export type DataTransferResponse
= OCPP16DataTransferResponse
49 export type DiagnosticsStatusNotificationResponse
= OCPP16DiagnosticsStatusNotificationResponse
51 export type FirmwareStatusNotificationResponse
= OCPP16FirmwareStatusNotificationResponse
53 export const AvailabilityStatus
= {
54 ...OCPP16AvailabilityStatus
56 // eslint-disable-next-line @typescript-eslint/no-redeclare
57 export type AvailabilityStatus
= OCPP16AvailabilityStatus
59 export const ChargingProfileStatus
= {
60 ...OCPP16ChargingProfileStatus
62 // eslint-disable-next-line @typescript-eslint/no-redeclare
63 export type ChargingProfileStatus
= OCPP16ChargingProfileStatus
65 export const ClearChargingProfileStatus
= {
66 ...OCPP16ClearChargingProfileStatus
68 // eslint-disable-next-line @typescript-eslint/no-redeclare
69 export type ClearChargingProfileStatus
= OCPP16ClearChargingProfileStatus
71 export const ConfigurationStatus
= {
72 ...OCPP16ConfigurationStatus
74 // eslint-disable-next-line @typescript-eslint/no-redeclare
75 export type ConfigurationStatus
= OCPP16ConfigurationStatus
77 export const UnlockStatus
= {
80 // eslint-disable-next-line @typescript-eslint/no-redeclare
81 export type UnlockStatus
= OCPP16UnlockStatus
83 export const TriggerMessageStatus
= {
84 ...OCPP16TriggerMessageStatus
86 // eslint-disable-next-line @typescript-eslint/no-redeclare
87 export type TriggerMessageStatus
= OCPP16TriggerMessageStatus
89 export const DataTransferStatus
= {
90 ...OCPP16DataTransferStatus
92 // eslint-disable-next-line @typescript-eslint/no-redeclare
93 export type DataTransferStatus
= OCPP16DataTransferStatus
95 export type ReservationStatus
= OCPP16ReservationStatus
96 // eslint-disable-next-line @typescript-eslint/no-redeclare
97 export const ReservationStatus
= {
98 ...OCPP16ReservationStatus
101 export type CancelReservationStatus
= GenericStatus
102 // eslint-disable-next-line @typescript-eslint/no-redeclare
103 export const CancelReservationStatus
= {
107 export type CancelReservationResponse
= GenericResponse