Commit | Line | Data |
---|---|---|
69074173 | 1 | import type { OCPP16MeterValuesResponse } from './1.6/MeterValues'; |
e7aeea18 JB |
2 | import { |
3 | OCPP16AvailabilityStatus, | |
edd13439 | 4 | type OCPP16BootNotificationResponse, |
e7aeea18 JB |
5 | OCPP16ChargingProfileStatus, |
6 | OCPP16ClearChargingProfileStatus, | |
7 | OCPP16ConfigurationStatus, | |
edd13439 | 8 | type OCPP16DataTransferResponse, |
91a7d3ea | 9 | OCPP16DataTransferStatus, |
c9a4f9ea JB |
10 | type OCPP16DiagnosticsStatusNotificationResponse, |
11 | type OCPP16FirmwareStatusNotificationResponse, | |
edd13439 | 12 | type OCPP16HeartbeatResponse, |
db652e1e | 13 | OCPP16ReservationStatus, |
edd13439 | 14 | type OCPP16StatusNotificationResponse, |
e7aeea18 JB |
15 | OCPP16TriggerMessageStatus, |
16 | OCPP16UnlockStatus, | |
69074173 | 17 | } from './1.6/Responses'; |
e1d9a0f4 | 18 | import type { OCPP20BootNotificationResponse, OCPP20ClearCacheResponse } from './2.0/Responses'; |
73ed6e01 | 19 | import { type GenericResponse, GenericStatus } from './Common'; |
69074173 JB |
20 | import type { ErrorType } from './ErrorType'; |
21 | import type { MessageType } from './MessageType'; | |
22 | import type { ChargingStation } from '../../charging-station'; | |
73ed6e01 | 23 | import type { JsonType } from '../JsonType'; |
d1888640 | 24 | |
5cc4b63b | 25 | export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType]; |
b3ec7bc1 | 26 | |
5cc4b63b | 27 | export type ErrorResponse = [MessageType.CALL_ERROR_MESSAGE, string, ErrorType, string, JsonType]; |
b3ec7bc1 | 28 | |
e7aeea18 | 29 | export type ResponseHandler = ( |
08f130a0 | 30 | chargingStation: ChargingStation, |
5cc4b63b | 31 | payload: JsonType, |
5edd8ba0 | 32 | requestPayload?: JsonType, |
e7aeea18 | 33 | ) => void | Promise<void>; |
58144adb | 34 | |
d270cc87 JB |
35 | export type BootNotificationResponse = |
36 | | OCPP16BootNotificationResponse | |
37 | | OCPP20BootNotificationResponse; | |
c0560973 | 38 | |
f22266fd JB |
39 | export type HeartbeatResponse = OCPP16HeartbeatResponse; |
40 | ||
f03e1042 | 41 | export type ClearCacheResponse = GenericResponse | OCPP20ClearCacheResponse; |
22e0d48e | 42 | |
e1d9a0f4 | 43 | export type StatusNotificationResponse = OCPP16StatusNotificationResponse; |
f22266fd JB |
44 | |
45 | export type MeterValuesResponse = OCPP16MeterValuesResponse; | |
46 | ||
91a7d3ea JB |
47 | export type DataTransferResponse = OCPP16DataTransferResponse; |
48 | ||
c9a4f9ea JB |
49 | export type DiagnosticsStatusNotificationResponse = OCPP16DiagnosticsStatusNotificationResponse; |
50 | ||
51 | export type FirmwareStatusNotificationResponse = OCPP16FirmwareStatusNotificationResponse; | |
52 | ||
9ccca265 | 53 | export const AvailabilityStatus = { |
e7aeea18 | 54 | ...OCPP16AvailabilityStatus, |
edd13439 JB |
55 | } as const; |
56 | export type AvailabilityStatus = OCPP16AvailabilityStatus; | |
9ccca265 JB |
57 | |
58 | export const ChargingProfileStatus = { | |
e7aeea18 | 59 | ...OCPP16ChargingProfileStatus, |
edd13439 JB |
60 | } as const; |
61 | export type ChargingProfileStatus = OCPP16ChargingProfileStatus; | |
9ccca265 JB |
62 | |
63 | export const ClearChargingProfileStatus = { | |
e7aeea18 | 64 | ...OCPP16ClearChargingProfileStatus, |
edd13439 JB |
65 | } as const; |
66 | export type ClearChargingProfileStatus = OCPP16ClearChargingProfileStatus; | |
9ccca265 JB |
67 | |
68 | export const ConfigurationStatus = { | |
e7aeea18 | 69 | ...OCPP16ConfigurationStatus, |
edd13439 JB |
70 | } as const; |
71 | export type ConfigurationStatus = OCPP16ConfigurationStatus; | |
9ccca265 JB |
72 | |
73 | export const UnlockStatus = { | |
e7aeea18 | 74 | ...OCPP16UnlockStatus, |
edd13439 JB |
75 | } as const; |
76 | export type UnlockStatus = OCPP16UnlockStatus; | |
802cfa13 JB |
77 | |
78 | export const TriggerMessageStatus = { | |
e7aeea18 | 79 | ...OCPP16TriggerMessageStatus, |
edd13439 JB |
80 | } as const; |
81 | export type TriggerMessageStatus = OCPP16TriggerMessageStatus; | |
91a7d3ea JB |
82 | |
83 | export const DataTransferStatus = { | |
84 | ...OCPP16DataTransferStatus, | |
edd13439 JB |
85 | } as const; |
86 | export type DataTransferStatus = OCPP16DataTransferStatus; | |
db652e1e JB |
87 | |
88 | export type ReservationStatus = OCPP16ReservationStatus; | |
db652e1e JB |
89 | export const ReservationStatus = { |
90 | ...OCPP16ReservationStatus, | |
73ed6e01 | 91 | } as const; |
db652e1e | 92 | |
b1f1b0f6 | 93 | export type CancelReservationStatus = GenericStatus; |
db652e1e | 94 | export const CancelReservationStatus = { |
66dd3447 | 95 | ...GenericStatus, |
73ed6e01 | 96 | } as const; |
66dd3447 | 97 | |
b1f1b0f6 | 98 | export type CancelReservationResponse = GenericResponse; |