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