Apply dependencies update
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / Requests.ts
CommitLineData
e7aeea18
JB
1import {
2 OCPP16AvailabilityType,
3 OCPP16BootNotificationRequest,
ef6fa3fb 4 OCPP16HeartbeatRequest,
e7aeea18
JB
5 OCPP16IncomingRequestCommand,
6 OCPP16RequestCommand,
ef6fa3fb 7 OCPP16StatusNotificationRequest,
e7aeea18 8} from './1.6/Requests';
c0560973 9
f3a490e6 10import type ChargingStation from '../../charging-station/ChargingStation';
5cc4b63b 11import { JsonType } from '../JsonType';
6a64534b 12import { MessageType } from './MessageType';
47e22477 13import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus';
ef6fa3fb 14import { OCPP16MeterValuesRequest } from './1.6/MeterValues';
e58068fd 15import OCPPError from '../../exception/OCPPError';
6a64534b 16
5cc4b63b 17export type OutgoingRequest = [MessageType.CALL_MESSAGE, string, RequestCommand, JsonType];
b3ec7bc1 18
5cc4b63b 19export type IncomingRequest = [MessageType.CALL_MESSAGE, string, IncomingRequestCommand, JsonType];
b3ec7bc1
JB
20
21export type CachedRequest = [
5cc4b63b 22 (payload: JsonType, requestPayload: JsonType) => void,
b3ec7bc1
JB
23 (error: OCPPError, requestStatistic?: boolean) => void,
24 RequestCommand | IncomingRequestCommand,
5cc4b63b 25 JsonType
b3ec7bc1
JB
26];
27
08f130a0
JB
28export type IncomingRequestHandler = (
29 chargingStation: ChargingStation,
30 commandPayload: JsonType
31) => JsonType | Promise<JsonType>;
b3ec7bc1 32
5cc4b63b 33export type ResponseType = JsonType | OCPPError;
b3ec7bc1 34
be9b0d50 35export interface RequestParams {
e7aeea18
JB
36 skipBufferingOnError?: boolean;
37 triggerMessage?: boolean;
caad9d6b
JB
38}
39
c0560973
JB
40export type BootNotificationRequest = OCPP16BootNotificationRequest;
41
ef6fa3fb
JB
42export type HeartbeatRequest = OCPP16HeartbeatRequest;
43
44export type StatusNotificationRequest = OCPP16StatusNotificationRequest;
45
46export type MeterValuesRequest = OCPP16MeterValuesRequest;
47
7e3926cc 48export type AvailabilityType = OCPP16AvailabilityType;
c0560973
JB
49
50export const AvailabilityType = {
e7aeea18 51 ...OCPP16AvailabilityType,
c0560973
JB
52};
53
7e3926cc 54export type RequestCommand = OCPP16RequestCommand;
c0560973
JB
55
56export const RequestCommand = {
e7aeea18 57 ...OCPP16RequestCommand,
c0560973
JB
58};
59
7e3926cc 60export type IncomingRequestCommand = OCPP16IncomingRequestCommand;
9c13b3b5
JB
61
62export const IncomingRequestCommand = {
e7aeea18 63 ...OCPP16IncomingRequestCommand,
9c13b3b5 64};
c0560973 65
47e22477
JB
66export type DiagnosticsStatus = OCPP16DiagnosticsStatus;
67
68export const DiagnosticsStatus = {
e7aeea18 69 ...OCPP16DiagnosticsStatus,
47e22477 70};