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