feat: expose template stats to UI server simulatorState command
[e-mobility-charging-stations-simulator.git] / ui / web / src / types / UIProtocol.ts
index afc55b03069540e6f7a48b7e86dec88f4cea1291..5b3efcdcef1efb81cccc8eeddc5525ccda0797f1 100644 (file)
@@ -25,6 +25,7 @@ export type ProtocolRequestHandler = (
 ) => ResponsePayload | Promise<ResponsePayload>
 
 export enum ProcedureName {
+  SIMULATOR_STATE = 'simulatorState',
   START_SIMULATOR = 'startSimulator',
   STOP_SIMULATOR = 'stopSimulator',
   LIST_TEMPLATES = 'listTemplates',
@@ -56,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>
+}