X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FUIProtocol.ts;h=b5cf30fff02cbca47089e577d75a0a8a8e7f0bd2;hb=01b82de5b532cd149eccab7b82fe86a741289581;hp=6e120337197d3ea39b65a48517b6e9f554e9eaa2;hpb=329eab0e2561adc801877a95885f3ad15cbb90f6;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/UIProtocol.ts b/src/types/UIProtocol.ts index 6e120337..b5cf30ff 100644 --- a/src/types/UIProtocol.ts +++ b/src/types/UIProtocol.ts @@ -19,16 +19,24 @@ export enum ProtocolVersion { '0.0.1' = '0.0.1' } -export type ProtocolRequest = [string, ProcedureName, RequestPayload] -export type ProtocolResponse = [string, ResponsePayload] +export type ProtocolRequest = [ + `${string}-${string}-${string}-${string}-${string}`, + ProcedureName, + RequestPayload +] +export type ProtocolResponse = [ + `${string}-${string}-${string}-${string}-${string}`, + ResponsePayload +] export type ProtocolRequestHandler = ( - uuid?: string, + uuid?: `${string}-${string}-${string}-${string}-${string}`, procedureName?: ProcedureName, payload?: RequestPayload ) => undefined | Promise | ResponsePayload | Promise export enum ProcedureName { + SIMULATOR_STATE = 'simulatorState', START_SIMULATOR = 'startSimulator', STOP_SIMULATOR = 'stopSimulator', LIST_TEMPLATES = 'listTemplates',