Commit | Line | Data |
---|---|---|
2896e06d | 1 | import type { ChargingStation } from '../../charging-station'; |
e7aeea18 | 2 | import { |
2896e06d JB |
3 | type ErrorType, |
4 | type JsonType, | |
5 | type MessageType, | |
e7aeea18 | 6 | OCPP16AvailabilityStatus, |
edd13439 | 7 | type OCPP16BootNotificationResponse, |
e7aeea18 JB |
8 | OCPP16ChargingProfileStatus, |
9 | OCPP16ClearChargingProfileStatus, | |
10 | OCPP16ConfigurationStatus, | |
edd13439 | 11 | type OCPP16DataTransferResponse, |
91a7d3ea | 12 | OCPP16DataTransferStatus, |
c9a4f9ea JB |
13 | type OCPP16DiagnosticsStatusNotificationResponse, |
14 | type OCPP16FirmwareStatusNotificationResponse, | |
edd13439 | 15 | type OCPP16HeartbeatResponse, |
2896e06d | 16 | type OCPP16MeterValuesResponse, |
edd13439 | 17 | type OCPP16StatusNotificationResponse, |
e7aeea18 JB |
18 | OCPP16TriggerMessageStatus, |
19 | OCPP16UnlockStatus, | |
2896e06d JB |
20 | type OCPP20BootNotificationResponse, |
21 | type OCPP20ClearCacheResponse, | |
22 | type OCPP20StatusNotificationResponse, | |
23 | } from '../internal'; | |
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 JB |
31 | payload: JsonType, |
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 | |
6e939d9e JB |
43 | export type StatusNotificationResponse = |
44 | | OCPP16StatusNotificationResponse | |
45 | | OCPP20StatusNotificationResponse; | |
f22266fd JB |
46 | |
47 | export type MeterValuesResponse = OCPP16MeterValuesResponse; | |
48 | ||
91a7d3ea JB |
49 | export type DataTransferResponse = OCPP16DataTransferResponse; |
50 | ||
c9a4f9ea JB |
51 | export type DiagnosticsStatusNotificationResponse = OCPP16DiagnosticsStatusNotificationResponse; |
52 | ||
53 | export type FirmwareStatusNotificationResponse = OCPP16FirmwareStatusNotificationResponse; | |
54 | ||
f03e1042 | 55 | export enum GenericStatus { |
9ccca265 | 56 | ACCEPTED = 'Accepted', |
e7aeea18 | 57 | REJECTED = 'Rejected', |
9ccca265 JB |
58 | } |
59 | ||
f03e1042 JB |
60 | export type GenericResponse = { |
61 | status: GenericStatus; | |
83e00df1 | 62 | }; |
9ccca265 | 63 | |
d270cc87 JB |
64 | export enum RegistrationStatusEnumType { |
65 | ACCEPTED = 'Accepted', | |
66 | PENDING = 'Pending', | |
67 | REJECTED = 'Rejected', | |
68 | } | |
9ccca265 JB |
69 | |
70 | export const AvailabilityStatus = { | |
e7aeea18 | 71 | ...OCPP16AvailabilityStatus, |
edd13439 JB |
72 | } as const; |
73 | export type AvailabilityStatus = OCPP16AvailabilityStatus; | |
9ccca265 JB |
74 | |
75 | export const ChargingProfileStatus = { | |
e7aeea18 | 76 | ...OCPP16ChargingProfileStatus, |
edd13439 JB |
77 | } as const; |
78 | export type ChargingProfileStatus = OCPP16ChargingProfileStatus; | |
9ccca265 JB |
79 | |
80 | export const ClearChargingProfileStatus = { | |
e7aeea18 | 81 | ...OCPP16ClearChargingProfileStatus, |
edd13439 JB |
82 | } as const; |
83 | export type ClearChargingProfileStatus = OCPP16ClearChargingProfileStatus; | |
9ccca265 JB |
84 | |
85 | export const ConfigurationStatus = { | |
e7aeea18 | 86 | ...OCPP16ConfigurationStatus, |
edd13439 JB |
87 | } as const; |
88 | export type ConfigurationStatus = OCPP16ConfigurationStatus; | |
9ccca265 JB |
89 | |
90 | export const UnlockStatus = { | |
e7aeea18 | 91 | ...OCPP16UnlockStatus, |
edd13439 JB |
92 | } as const; |
93 | export type UnlockStatus = OCPP16UnlockStatus; | |
802cfa13 JB |
94 | |
95 | export const TriggerMessageStatus = { | |
e7aeea18 | 96 | ...OCPP16TriggerMessageStatus, |
edd13439 JB |
97 | } as const; |
98 | export type TriggerMessageStatus = OCPP16TriggerMessageStatus; | |
91a7d3ea JB |
99 | |
100 | export const DataTransferStatus = { | |
101 | ...OCPP16DataTransferStatus, | |
edd13439 JB |
102 | } as const; |
103 | export type DataTransferStatus = OCPP16DataTransferStatus; |