Add UI server factory with server class abstraction
[e-mobility-charging-stations-simulator.git] / src / types / ConfigurationData.ts
CommitLineData
66271092 1import { ServerOptions as HttpServerOptions } from 'http';
72f041bd 2import { StorageType } from './Storage';
18d3414a 3import { ServerOptions as WSServerOptions } from 'ws';
9efbac5b 4import type { WorkerChoiceStrategy } from 'poolifier';
a4624c96
JB
5import { WorkerProcessType } from './Worker';
6
66271092
JB
7export type ServerOptions = WSServerOptions & HttpServerOptions;
8
2dcfe98e
JB
9export enum SupervisionUrlDistribution {
10 ROUND_ROBIN = 'round-robin',
11 RANDOM = 'random',
12 SEQUENTIAL = 'sequential',
13}
14
1f5df42a 15export interface StationTemplateUrl {
e118beaa
JB
16 file: string;
17 numberOfStations: number;
18}
19
675fa8e3 20export interface UIServerConfiguration {
6a49ad23 21 enabled?: boolean;
66271092 22 options?: ServerOptions;
6a49ad23
JB
23}
24
72f041bd
JB
25export interface StorageConfiguration {
26 enabled?: boolean;
27 type?: StorageType;
1f5df42a 28 uri?: string;
72f041bd
JB
29}
30
e118beaa 31export default interface ConfigurationData {
2dcfe98e
JB
32 supervisionUrls?: string | string[];
33 supervisionUrlDistribution?: SupervisionUrlDistribution;
1f5df42a 34 stationTemplateUrls: StationTemplateUrl[];
675fa8e3 35 uiServer?: UIServerConfiguration;
72f041bd 36 performanceStorage?: StorageConfiguration;
e118beaa 37 autoReconnectMaxRetries?: number;
a4624c96 38 workerProcess?: WorkerProcessType;
322c9192 39 workerStartDelay?: number;
4bfd80fa 40 elementStartDelay?: number;
a4624c96 41 workerPoolMinSize?: number;
4fa59b8a 42 workerPoolMaxSize?: number;
9efbac5b 43 workerPoolStrategy?: WorkerChoiceStrategy;
5fdab605 44 chargingStationsPerWorker?: number;
72f041bd 45 logStatisticsInterval?: number;
e118beaa 46 logFormat?: string;
324fd4ee 47 logLevel?: string;
6bf6769e
JB
48 logRotate?: boolean;
49 logMaxFiles?: number;
e118beaa 50 logFile?: string;
7ec46a9a
JB
51 logErrorFile?: string;
52 logConsole?: boolean;
e118beaa 53}