| 1 | import { |
| 2 | OCPP16AvailabilityType, |
| 3 | OCPP16BootNotificationRequest, |
| 4 | OCPP16IncomingRequestCommand, |
| 5 | OCPP16RequestCommand, |
| 6 | } from './1.6/Requests'; |
| 7 | |
| 8 | import { JsonType } from '../JsonType'; |
| 9 | import { MessageType } from './MessageType'; |
| 10 | import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus'; |
| 11 | import OCPPError from '../../exception/OCPPError'; |
| 12 | |
| 13 | export interface SendParams { |
| 14 | skipBufferingOnError?: boolean; |
| 15 | triggerMessage?: boolean; |
| 16 | } |
| 17 | |
| 18 | export type IncomingRequestHandler = (commandPayload: JsonType) => JsonType | Promise<JsonType>; |
| 19 | |
| 20 | export type ResponseType = JsonType | OCPPError | string; |
| 21 | |
| 22 | export type BootNotificationRequest = OCPP16BootNotificationRequest; |
| 23 | |
| 24 | export type AvailabilityType = OCPP16AvailabilityType; |
| 25 | |
| 26 | export const AvailabilityType = { |
| 27 | ...OCPP16AvailabilityType, |
| 28 | }; |
| 29 | |
| 30 | export type RequestCommand = OCPP16RequestCommand; |
| 31 | |
| 32 | export const RequestCommand = { |
| 33 | ...OCPP16RequestCommand, |
| 34 | }; |
| 35 | |
| 36 | export type IncomingRequestCommand = OCPP16IncomingRequestCommand; |
| 37 | |
| 38 | export const IncomingRequestCommand = { |
| 39 | ...OCPP16IncomingRequestCommand, |
| 40 | }; |
| 41 | |
| 42 | export type DiagnosticsStatus = OCPP16DiagnosticsStatus; |
| 43 | |
| 44 | export const DiagnosticsStatus = { |
| 45 | ...OCPP16DiagnosticsStatus, |
| 46 | }; |
| 47 | |
| 48 | export type Request = [MessageType, string, RequestCommand, JsonType, JsonType]; |
| 49 | |
| 50 | export type IncomingRequest = [MessageType, string, IncomingRequestCommand, JsonType, JsonType]; |
| 51 | |
| 52 | export type CachedRequest = [ |
| 53 | (payload: JsonType, requestPayload: JsonType) => void, |
| 54 | (error: OCPPError, requestStatistic?: boolean) => void, |
| 55 | RequestCommand | IncomingRequestCommand, |
| 56 | JsonType | OCPPError |
| 57 | ]; |