Add Insomnia UI protocol collection
[e-mobility-charging-stations-simulator.git] / src / types / UIProtocol.ts
index 2c5914953b2768bd94bdf836bb15c50fd40d1457..3a76bd0007302ec8a11540a6c317bd59fd3c4675 100644 (file)
@@ -1,4 +1,4 @@
-import { JsonObject } from './JsonType';
+import type { JsonObject } from './JsonType';
 
 export enum Protocol {
   UI = 'ui',
@@ -19,7 +19,7 @@ export type ProtocolResponse = [string, ResponsePayload];
 export type ProtocolRequestHandler = (
   uuid?: string,
   payload?: RequestPayload
-) => ResponsePayload | Promise<ResponsePayload>;
+) => undefined | Promise<undefined> | ResponsePayload | Promise<ResponsePayload>;
 
 export enum ProcedureName {
   LIST_CHARGING_STATIONS = 'listChargingStations',
@@ -29,9 +29,13 @@ export enum ProcedureName {
   STOP_TRANSACTION = 'stopTransaction',
   START_SIMULATOR = 'startSimulator',
   STOP_SIMULATOR = 'stopSimulator',
+  OPEN_CONNECTION = 'openConnection',
+  CLOSE_CONNECTION = 'closeConnection',
 }
+
 export interface RequestPayload extends JsonObject {
   hashId?: string;
+  hashIds?: string[];
 }
 
 export enum ResponseStatus {
@@ -41,4 +45,5 @@ export enum ResponseStatus {
 
 export interface ResponsePayload extends JsonObject {
   status: ResponseStatus;
+  hashIds?: string[];
 }