feat: expose template stats to UI server simulatorState command
[e-mobility-charging-stations-simulator.git] / ui / web / src / types / UIProtocol.ts
index a431540b7d44bdc0cf41b750dd660ed7d5a7e225..5b3efcdcef1efb81cccc8eeddc5525ccda0797f1 100644 (file)
@@ -25,10 +25,14 @@ export type ProtocolRequestHandler = (
 ) => ResponsePayload | Promise<ResponsePayload>
 
 export enum ProcedureName {
+  SIMULATOR_STATE = 'simulatorState',
   START_SIMULATOR = 'startSimulator',
   STOP_SIMULATOR = 'stopSimulator',
-  DELETE_CHARGING_STATIONS = 'deleteChargingStations',
+  LIST_TEMPLATES = 'listTemplates',
   LIST_CHARGING_STATIONS = 'listChargingStations',
+  ADD_CHARGING_STATIONS = 'addChargingStations',
+  DELETE_CHARGING_STATIONS = 'deleteChargingStations',
+  SET_SUPERVISION_URL = 'setSupervisionUrl',
   START_CHARGING_STATION = 'startChargingStation',
   STOP_CHARGING_STATION = 'stopChargingStation',
   OPEN_CONNECTION = 'openConnection',
@@ -53,3 +57,16 @@ export interface ResponsePayload extends JsonObject {
   status: ResponseStatus
   hashIds?: string[]
 }
+
+interface TemplateStatistics extends JsonObject {
+  configured: number
+  added: number
+  started: number
+  indexes: number[]
+}
+
+export interface SimulatorState extends JsonObject {
+  version: string
+  started: boolean
+  templateStatistics: Record<string, TemplateStatistics>
+}