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