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