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