X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FUIProtocol.ts;h=13da330efc3094f2c117d067e9e787cc02fd9c6e;hb=42e341c40076aa8c5fc37e10512ec41c9ab60825;hp=52b91b972d14b06c1fa6ab711dd9b4e5b19226bf;hpb=69074173770c04bc5e5aa744b655edf9491daa46;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/UIProtocol.ts b/src/types/UIProtocol.ts index 52b91b97..13da330e 100644 --- a/src/types/UIProtocol.ts +++ b/src/types/UIProtocol.ts @@ -1,35 +1,36 @@ -import type { JsonObject } from './JsonType'; -import type { BroadcastChannelResponsePayload } from './WorkerBroadcastChannel'; +import type { JsonObject } from './JsonType.js' +import type { BroadcastChannelResponsePayload } from './WorkerBroadcastChannel.js' export enum Protocol { - UI = 'ui', + UI = 'ui' } export enum ApplicationProtocol { HTTP = 'http', - WS = 'ws', + WS = 'ws' } export enum AuthenticationType { - BASIC_AUTH = 'basic-auth', + BASIC_AUTH = 'basic-auth' } export enum ProtocolVersion { - '0.0.1' = '0.0.1', + '0.0.1' = '0.0.1' } -export type ProtocolRequest = [string, ProcedureName, RequestPayload]; -export type ProtocolResponse = [string, ResponsePayload]; +export type ProtocolRequest = [string, ProcedureName, RequestPayload] +export type ProtocolResponse = [string, ResponsePayload] export type ProtocolRequestHandler = ( uuid?: string, procedureName?: ProcedureName, payload?: RequestPayload -) => undefined | Promise | ResponsePayload | Promise; +) => undefined | Promise | ResponsePayload | Promise export enum ProcedureName { START_SIMULATOR = 'startSimulator', STOP_SIMULATOR = 'stopSimulator', + LIST_TEMPLATES = 'listTemplates', LIST_CHARGING_STATIONS = 'listChargingStations', START_CHARGING_STATION = 'startChargingStation', STOP_CHARGING_STATION = 'stopChargingStation', @@ -47,22 +48,22 @@ export enum ProcedureName { METER_VALUES = 'meterValues', DATA_TRANSFER = 'dataTransfer', DIAGNOSTICS_STATUS_NOTIFICATION = 'diagnosticsStatusNotification', - FIRMWARE_STATUS_NOTIFICATION = 'firmwareStatusNotification', + FIRMWARE_STATUS_NOTIFICATION = 'firmwareStatusNotification' } export interface RequestPayload extends JsonObject { - hashIds?: string[]; - connectorIds?: number[]; + hashIds?: string[] + connectorIds?: number[] } export enum ResponseStatus { SUCCESS = 'success', - FAILURE = 'failure', + FAILURE = 'failure' } export interface ResponsePayload extends JsonObject { - status: ResponseStatus; - hashIdsSucceeded?: string[]; - hashIdsFailed?: string[]; - responsesFailed?: BroadcastChannelResponsePayload[]; + status: ResponseStatus + hashIdsSucceeded?: string[] + hashIdsFailed?: string[] + responsesFailed?: BroadcastChannelResponsePayload[] }