Add UI HTTP server (#6)
[e-mobility-charging-stations-simulator.git] / src / types / ConfigurationData.ts
CommitLineData
b153c0fd 1import { ListenOptions } from 'net';
8114d10e 2
9efbac5b 3import type { WorkerChoiceStrategy } from 'poolifier';
8114d10e
JB
4import { ServerOptions as WSServerOptions } from 'ws';
5
6import { StorageType } from './Storage';
1f7fa4de 7import { ApplicationProtocol } from './UIProtocol';
a4624c96
JB
8import { WorkerProcessType } from './Worker';
9
b153c0fd 10export type ServerOptions = WSServerOptions & ListenOptions;
66271092 11
2dcfe98e
JB
12export enum SupervisionUrlDistribution {
13 ROUND_ROBIN = 'round-robin',
14 RANDOM = 'random',
15 SEQUENTIAL = 'sequential',
16}
17
1f5df42a 18export interface StationTemplateUrl {
e118beaa
JB
19 file: string;
20 numberOfStations: number;
21}
22
675fa8e3 23export interface UIServerConfiguration {
6a49ad23 24 enabled?: boolean;
1f7fa4de 25 type?: ApplicationProtocol;
66271092 26 options?: ServerOptions;
6a49ad23
JB
27}
28
72f041bd
JB
29export interface StorageConfiguration {
30 enabled?: boolean;
31 type?: StorageType;
1f5df42a 32 uri?: string;
72f041bd
JB
33}
34
cf2a5d9b
JB
35export interface WorkerConfiguration {
36 processType?: WorkerProcessType;
37 startDelay?: number;
38 elementsPerWorker?: number;
39 elementStartDelay?: number;
40 poolMinSize?: number;
41 poolMaxSize?: number;
42 poolStrategy?: WorkerChoiceStrategy;
43}
44
e118beaa 45export default interface ConfigurationData {
2dcfe98e
JB
46 supervisionUrls?: string | string[];
47 supervisionUrlDistribution?: SupervisionUrlDistribution;
1f5df42a 48 stationTemplateUrls: StationTemplateUrl[];
675fa8e3 49 uiServer?: UIServerConfiguration;
72f041bd 50 performanceStorage?: StorageConfiguration;
cf2a5d9b 51 worker?: WorkerConfiguration;
e118beaa 52 autoReconnectMaxRetries?: number;
cf2a5d9b 53 // deprecated
a4624c96 54 workerProcess?: WorkerProcessType;
cf2a5d9b 55 // deprecated
322c9192 56 workerStartDelay?: number;
cf2a5d9b 57 // deprecated
4bfd80fa 58 elementStartDelay?: number;
cf2a5d9b 59 // deprecated
a4624c96 60 workerPoolMinSize?: number;
cf2a5d9b 61 // deprecated
4fa59b8a 62 workerPoolMaxSize?: number;
cf2a5d9b 63 // deprecated
9efbac5b 64 workerPoolStrategy?: WorkerChoiceStrategy;
cf2a5d9b 65 // deprecated
5fdab605 66 chargingStationsPerWorker?: number;
72f041bd 67 logStatisticsInterval?: number;
e118beaa 68 logFormat?: string;
324fd4ee 69 logLevel?: string;
6bf6769e
JB
70 logRotate?: boolean;
71 logMaxFiles?: number;
e118beaa 72 logFile?: string;
7ec46a9a
JB
73 logErrorFile?: string;
74 logConsole?: boolean;
e118beaa 75}