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