| 1 | import type { OCPP16MeterValuesResponse } from './1.6/MeterValues'; |
| 2 | import { |
| 3 | OCPP16AvailabilityStatus, |
| 4 | type OCPP16BootNotificationResponse, |
| 5 | OCPP16ChargingProfileStatus, |
| 6 | OCPP16ClearChargingProfileStatus, |
| 7 | OCPP16ConfigurationStatus, |
| 8 | type OCPP16DataTransferResponse, |
| 9 | OCPP16DataTransferStatus, |
| 10 | type OCPP16DiagnosticsStatusNotificationResponse, |
| 11 | type OCPP16FirmwareStatusNotificationResponse, |
| 12 | type OCPP16HeartbeatResponse, |
| 13 | OCPP16ReservationStatus, |
| 14 | type OCPP16StatusNotificationResponse, |
| 15 | OCPP16TriggerMessageStatus, |
| 16 | OCPP16UnlockStatus, |
| 17 | } from './1.6/Responses'; |
| 18 | import type { |
| 19 | OCPP20BootNotificationResponse, |
| 20 | OCPP20ClearCacheResponse, |
| 21 | OCPP20StatusNotificationResponse, |
| 22 | } from './2.0/Responses'; |
| 23 | import type { ErrorType } from './ErrorType'; |
| 24 | import type { MessageType } from './MessageType'; |
| 25 | import type { ChargingStation } from '../../charging-station'; |
| 26 | import type { JsonType } from '../JsonType'; |
| 27 | |
| 28 | export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType]; |
| 29 | |
| 30 | export type ErrorResponse = [MessageType.CALL_ERROR_MESSAGE, string, ErrorType, string, JsonType]; |
| 31 | |
| 32 | export type ResponseHandler = ( |
| 33 | chargingStation: ChargingStation, |
| 34 | payload: JsonType, |
| 35 | requestPayload?: JsonType, |
| 36 | ) => void | Promise<void>; |
| 37 | |
| 38 | export type BootNotificationResponse = |
| 39 | | OCPP16BootNotificationResponse |
| 40 | | OCPP20BootNotificationResponse; |
| 41 | |
| 42 | export type HeartbeatResponse = OCPP16HeartbeatResponse; |
| 43 | |
| 44 | export type ClearCacheResponse = GenericResponse | OCPP20ClearCacheResponse; |
| 45 | |
| 46 | export type StatusNotificationResponse = |
| 47 | | OCPP16StatusNotificationResponse |
| 48 | | OCPP20StatusNotificationResponse; |
| 49 | |
| 50 | export type MeterValuesResponse = OCPP16MeterValuesResponse; |
| 51 | |
| 52 | export type DataTransferResponse = OCPP16DataTransferResponse; |
| 53 | |
| 54 | export type DiagnosticsStatusNotificationResponse = OCPP16DiagnosticsStatusNotificationResponse; |
| 55 | |
| 56 | export type FirmwareStatusNotificationResponse = OCPP16FirmwareStatusNotificationResponse; |
| 57 | |
| 58 | export enum GenericStatus { |
| 59 | Accepted = 'Accepted', |
| 60 | Rejected = 'Rejected', |
| 61 | } |
| 62 | |
| 63 | export type GenericResponse = { |
| 64 | status: GenericStatus; |
| 65 | }; |
| 66 | |
| 67 | export enum RegistrationStatusEnumType { |
| 68 | ACCEPTED = 'Accepted', |
| 69 | PENDING = 'Pending', |
| 70 | REJECTED = 'Rejected', |
| 71 | } |
| 72 | |
| 73 | export const AvailabilityStatus = { |
| 74 | ...OCPP16AvailabilityStatus, |
| 75 | } as const; |
| 76 | export type AvailabilityStatus = OCPP16AvailabilityStatus; |
| 77 | |
| 78 | export const ChargingProfileStatus = { |
| 79 | ...OCPP16ChargingProfileStatus, |
| 80 | } as const; |
| 81 | export type ChargingProfileStatus = OCPP16ChargingProfileStatus; |
| 82 | |
| 83 | export const ClearChargingProfileStatus = { |
| 84 | ...OCPP16ClearChargingProfileStatus, |
| 85 | } as const; |
| 86 | export type ClearChargingProfileStatus = OCPP16ClearChargingProfileStatus; |
| 87 | |
| 88 | export const ConfigurationStatus = { |
| 89 | ...OCPP16ConfigurationStatus, |
| 90 | } as const; |
| 91 | export type ConfigurationStatus = OCPP16ConfigurationStatus; |
| 92 | |
| 93 | export const UnlockStatus = { |
| 94 | ...OCPP16UnlockStatus, |
| 95 | } as const; |
| 96 | export type UnlockStatus = OCPP16UnlockStatus; |
| 97 | |
| 98 | export const TriggerMessageStatus = { |
| 99 | ...OCPP16TriggerMessageStatus, |
| 100 | } as const; |
| 101 | export type TriggerMessageStatus = OCPP16TriggerMessageStatus; |
| 102 | |
| 103 | export const DataTransferStatus = { |
| 104 | ...OCPP16DataTransferStatus, |
| 105 | } as const; |
| 106 | export type DataTransferStatus = OCPP16DataTransferStatus; |
| 107 | |
| 108 | export type ReservationStatus = OCPP16ReservationStatus; |
| 109 | export const ReservationStatus = { |
| 110 | ...OCPP16ReservationStatus, |
| 111 | }; |
| 112 | |
| 113 | export type CancelReservationStatus = GenericStatus; |
| 114 | export const CancelReservationStatus = { |
| 115 | ...GenericStatus, |
| 116 | }; |
| 117 | |
| 118 | export type CancelReservationResponse = GenericResponse; |