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