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