feat(ui): add right action bar and use it to start transaction
[e-mobility-charging-stations-simulator.git] / ui / web / src / types / UIProtocol.ts
CommitLineData
66a7748d 1import type { JsonObject } from './JsonType'
32de5a57
LM
2
3export enum Protocol {
a974c8e4 4 UI = 'ui'
32de5a57
LM
5}
6
7export enum ApplicationProtocol {
217db058
JB
8 WS = 'ws',
9 WSS = 'wss'
32de5a57
LM
10}
11
12export enum ProtocolVersion {
a974c8e4 13 '0.0.1' = '0.0.1'
32de5a57
LM
14}
15
217db058 16export enum AuthenticationType {
329eab0e 17 PROTOCOL_BASIC_AUTH = 'protocol-basic-auth'
217db058
JB
18}
19
66a7748d
JB
20export type ProtocolRequest = [string, ProcedureName, RequestPayload]
21export type ProtocolResponse = [string, ResponsePayload]
4e3ff94d
JB
22
23export type ProtocolRequestHandler = (
66a7748d
JB
24 payload: RequestPayload
25) => ResponsePayload | Promise<ResponsePayload>
4e3ff94d 26
32de5a57 27export enum ProcedureName {
757b2ecf
JB
28 START_SIMULATOR = 'startSimulator',
29 STOP_SIMULATOR = 'stopSimulator',
c317ae3e 30 LIST_TEMPLATES = 'listTemplates',
32de5a57 31 LIST_CHARGING_STATIONS = 'listChargingStations',
c317ae3e
JB
32 ADD_CHARGING_STATIONS = 'addChargingStations',
33 DELETE_CHARGING_STATIONS = 'deleteChargingStations',
4e3ff94d
JB
34 START_CHARGING_STATION = 'startChargingStation',
35 STOP_CHARGING_STATION = 'stopChargingStation',
ce7a4fc3
JB
36 OPEN_CONNECTION = 'openConnection',
37 CLOSE_CONNECTION = 'closeConnection',
757b2ecf
JB
38 START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator',
39 STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator',
5e8e29f4 40 START_TRANSACTION = 'startTransaction',
a974c8e4 41 STOP_TRANSACTION = 'stopTransaction'
32de5a57 42}
a65319ba 43
4e3ff94d 44export interface RequestPayload extends JsonObject {
66a7748d
JB
45 hashIds?: string[]
46 connectorIds?: number[]
4e3ff94d 47}
32de5a57
LM
48
49export enum ResponseStatus {
50 SUCCESS = 'success',
a974c8e4 51 FAILURE = 'failure'
32de5a57
LM
52}
53
54export interface ResponsePayload extends JsonObject {
66a7748d
JB
55 status: ResponseStatus
56 hashIds?: string[]
32de5a57 57}