chore: switch coding style to JS standard
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / Responses.ts
CommitLineData
66a7748d 1import type { OCPP16MeterValuesResponse } from './1.6/MeterValues.js'
e7aeea18
JB
2import {
3 OCPP16AvailabilityStatus,
edd13439 4 type OCPP16BootNotificationResponse,
e7aeea18
JB
5 OCPP16ChargingProfileStatus,
6 OCPP16ClearChargingProfileStatus,
7 OCPP16ConfigurationStatus,
edd13439 8 type OCPP16DataTransferResponse,
91a7d3ea 9 OCPP16DataTransferStatus,
c9a4f9ea
JB
10 type OCPP16DiagnosticsStatusNotificationResponse,
11 type OCPP16FirmwareStatusNotificationResponse,
edd13439 12 type OCPP16HeartbeatResponse,
db652e1e 13 OCPP16ReservationStatus,
edd13439 14 type OCPP16StatusNotificationResponse,
e7aeea18 15 OCPP16TriggerMessageStatus,
66a7748d
JB
16 OCPP16UnlockStatus
17} from './1.6/Responses.js'
18import type { OCPP20BootNotificationResponse, OCPP20ClearCacheResponse } from './2.0/Responses.js'
19import { type GenericResponse, GenericStatus } from './Common.js'
20import type { ErrorType } from './ErrorType.js'
21import type { MessageType } from './MessageType.js'
22import type { ChargingStation } from '../../charging-station/index.js'
23import type { JsonType } from '../JsonType.js'
d1888640 24
66a7748d 25export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType]
b3ec7bc1 26
66a7748d 27export type ErrorResponse = [MessageType.CALL_ERROR_MESSAGE, string, ErrorType, string, JsonType]
b3ec7bc1 28
e7aeea18 29export type ResponseHandler = (
08f130a0 30 chargingStation: ChargingStation,
5cc4b63b 31 payload: JsonType,
66a7748d
JB
32 requestPayload?: JsonType
33) => void | Promise<void>
58144adb 34
d270cc87
JB
35export type BootNotificationResponse =
36 | OCPP16BootNotificationResponse
66a7748d 37 | OCPP20BootNotificationResponse
c0560973 38
66a7748d 39export type HeartbeatResponse = OCPP16HeartbeatResponse
f22266fd 40
66a7748d 41export type ClearCacheResponse = GenericResponse | OCPP20ClearCacheResponse
22e0d48e 42
66a7748d 43export type StatusNotificationResponse = OCPP16StatusNotificationResponse
f22266fd 44
66a7748d 45export type MeterValuesResponse = OCPP16MeterValuesResponse
f22266fd 46
66a7748d 47export type DataTransferResponse = OCPP16DataTransferResponse
91a7d3ea 48
66a7748d 49export type DiagnosticsStatusNotificationResponse = OCPP16DiagnosticsStatusNotificationResponse
c9a4f9ea 50
66a7748d 51export type FirmwareStatusNotificationResponse = OCPP16FirmwareStatusNotificationResponse
c9a4f9ea 52
9ccca265 53export const AvailabilityStatus = {
66a7748d
JB
54 ...OCPP16AvailabilityStatus
55} as const
56// eslint-disable-next-line @typescript-eslint/no-redeclare
57export type AvailabilityStatus = OCPP16AvailabilityStatus
9ccca265
JB
58
59export const ChargingProfileStatus = {
66a7748d
JB
60 ...OCPP16ChargingProfileStatus
61} as const
62// eslint-disable-next-line @typescript-eslint/no-redeclare
63export type ChargingProfileStatus = OCPP16ChargingProfileStatus
9ccca265
JB
64
65export const ClearChargingProfileStatus = {
66a7748d
JB
66 ...OCPP16ClearChargingProfileStatus
67} as const
68// eslint-disable-next-line @typescript-eslint/no-redeclare
69export type ClearChargingProfileStatus = OCPP16ClearChargingProfileStatus
9ccca265
JB
70
71export const ConfigurationStatus = {
66a7748d
JB
72 ...OCPP16ConfigurationStatus
73} as const
74// eslint-disable-next-line @typescript-eslint/no-redeclare
75export type ConfigurationStatus = OCPP16ConfigurationStatus
9ccca265
JB
76
77export const UnlockStatus = {
66a7748d
JB
78 ...OCPP16UnlockStatus
79} as const
80// eslint-disable-next-line @typescript-eslint/no-redeclare
81export type UnlockStatus = OCPP16UnlockStatus
802cfa13
JB
82
83export const TriggerMessageStatus = {
66a7748d
JB
84 ...OCPP16TriggerMessageStatus
85} as const
86// eslint-disable-next-line @typescript-eslint/no-redeclare
87export type TriggerMessageStatus = OCPP16TriggerMessageStatus
91a7d3ea
JB
88
89export const DataTransferStatus = {
66a7748d
JB
90 ...OCPP16DataTransferStatus
91} as const
92// eslint-disable-next-line @typescript-eslint/no-redeclare
93export type DataTransferStatus = OCPP16DataTransferStatus
db652e1e 94
66a7748d
JB
95export type ReservationStatus = OCPP16ReservationStatus
96// eslint-disable-next-line @typescript-eslint/no-redeclare
db652e1e 97export const ReservationStatus = {
66a7748d
JB
98 ...OCPP16ReservationStatus
99} as const
db652e1e 100
66a7748d
JB
101export type CancelReservationStatus = GenericStatus
102// eslint-disable-next-line @typescript-eslint/no-redeclare
db652e1e 103export const CancelReservationStatus = {
66a7748d
JB
104 ...GenericStatus
105} as const
66dd3447 106
66a7748d 107export type CancelReservationResponse = GenericResponse