Commit | Line | Data |
---|---|---|
e7aeea18 JB |
1 | import { |
2 | OCPP16AvailabilityStatus, | |
3 | OCPP16BootNotificationResponse, | |
4 | OCPP16ChargingProfileStatus, | |
5 | OCPP16ClearChargingProfileStatus, | |
6 | OCPP16ConfigurationStatus, | |
f22266fd | 7 | OCPP16HeartbeatResponse, |
e7aeea18 | 8 | OCPP16RegistrationStatus, |
f22266fd | 9 | OCPP16StatusNotificationResponse, |
e7aeea18 JB |
10 | OCPP16TriggerMessageStatus, |
11 | OCPP16UnlockStatus, | |
12 | } from './1.6/Responses'; | |
c0560973 | 13 | |
b3ec7bc1 | 14 | import { ErrorType } from './ErrorType'; |
e3822d6f | 15 | import { JsonObject } from '../JsonType'; |
b3ec7bc1 | 16 | import { MessageType } from './MessageType'; |
f22266fd | 17 | import { OCPP16MeterValuesResponse } from './1.6/MeterValues'; |
d1888640 | 18 | |
e3822d6f | 19 | export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonObject]; |
b3ec7bc1 | 20 | |
e3822d6f | 21 | export type ErrorResponse = [MessageType.CALL_ERROR_MESSAGE, string, ErrorType, string, JsonObject]; |
b3ec7bc1 | 22 | |
e7aeea18 | 23 | export type ResponseHandler = ( |
e3822d6f JB |
24 | payload: JsonObject, |
25 | requestPayload?: JsonObject | |
e7aeea18 | 26 | ) => void | Promise<void>; |
58144adb | 27 | |
c0560973 JB |
28 | export type BootNotificationResponse = OCPP16BootNotificationResponse; |
29 | ||
f22266fd JB |
30 | export type HeartbeatResponse = OCPP16HeartbeatResponse; |
31 | ||
32 | export type StatusNotificationResponse = OCPP16StatusNotificationResponse; | |
33 | ||
34 | export type MeterValuesResponse = OCPP16MeterValuesResponse; | |
35 | ||
9ccca265 JB |
36 | export enum DefaultStatus { |
37 | ACCEPTED = 'Accepted', | |
e7aeea18 | 38 | REJECTED = 'Rejected', |
9ccca265 JB |
39 | } |
40 | ||
41 | export interface DefaultResponse { | |
42 | status: DefaultStatus; | |
43 | } | |
44 | ||
c0560973 JB |
45 | export type RegistrationStatus = OCPP16RegistrationStatus; |
46 | ||
47 | export const RegistrationStatus = { | |
e7aeea18 | 48 | ...OCPP16RegistrationStatus, |
c0560973 | 49 | }; |
9ccca265 JB |
50 | |
51 | export type AvailabilityStatus = OCPP16AvailabilityStatus; | |
52 | ||
53 | export const AvailabilityStatus = { | |
e7aeea18 | 54 | ...OCPP16AvailabilityStatus, |
9ccca265 JB |
55 | }; |
56 | ||
57 | export type ChargingProfileStatus = OCPP16ChargingProfileStatus; | |
58 | ||
59 | export const ChargingProfileStatus = { | |
e7aeea18 | 60 | ...OCPP16ChargingProfileStatus, |
9ccca265 JB |
61 | }; |
62 | ||
63 | export type ClearChargingProfileStatus = OCPP16ClearChargingProfileStatus; | |
64 | ||
65 | export const ClearChargingProfileStatus = { | |
e7aeea18 | 66 | ...OCPP16ClearChargingProfileStatus, |
9ccca265 JB |
67 | }; |
68 | ||
69 | export type ConfigurationStatus = OCPP16ConfigurationStatus; | |
70 | ||
71 | export const ConfigurationStatus = { | |
e7aeea18 | 72 | ...OCPP16ConfigurationStatus, |
9ccca265 JB |
73 | }; |
74 | ||
75 | export type UnlockStatus = OCPP16UnlockStatus; | |
76 | ||
77 | export const UnlockStatus = { | |
e7aeea18 | 78 | ...OCPP16UnlockStatus, |
9ccca265 | 79 | }; |
802cfa13 JB |
80 | |
81 | export type TriggerMessageStatus = OCPP16TriggerMessageStatus; | |
82 | ||
83 | export const TriggerMessageStatus = { | |
e7aeea18 | 84 | ...OCPP16TriggerMessageStatus, |
802cfa13 | 85 | }; |