ATG: add support for idTag distribution algorithms
[e-mobility-charging-stations-simulator.git] / src / types / ConfigurationData.ts
1 import type { ListenOptions } from 'net';
2
3 import type { WorkerChoiceStrategy } from 'poolifier';
4
5 import type { StorageType } from './Storage';
6 import type { ApplicationProtocol, AuthenticationType } from './UIProtocol';
7 import type { WorkerProcessType } from './Worker';
8
9 export type ServerOptions = ListenOptions;
10
11 export enum SupervisionUrlDistribution {
12 ROUND_ROBIN = 'round-robin',
13 RANDOM = 'random',
14 CHARGING_STATION_AFFINITY = 'charging-station-affinity',
15 }
16
17 export type StationTemplateUrl = {
18 file: string;
19 numberOfStations: number;
20 };
21
22 export type UIServerConfiguration = {
23 enabled?: boolean;
24 type?: ApplicationProtocol;
25 options?: ServerOptions;
26 authentication?: {
27 enabled: boolean;
28 type: AuthenticationType;
29 username?: string;
30 password?: string;
31 };
32 };
33
34 export type StorageConfiguration = {
35 enabled?: boolean;
36 type?: StorageType;
37 uri?: string;
38 };
39
40 export type WorkerConfiguration = {
41 processType?: WorkerProcessType;
42 startDelay?: number;
43 elementsPerWorker?: number;
44 elementStartDelay?: number;
45 poolMinSize?: number;
46 poolMaxSize?: number;
47 poolStrategy?: WorkerChoiceStrategy;
48 };
49
50 export type ConfigurationData = {
51 supervisionUrls?: string | string[];
52 supervisionUrlDistribution?: SupervisionUrlDistribution;
53 stationTemplateUrls: StationTemplateUrl[];
54 uiServer?: UIServerConfiguration;
55 performanceStorage?: StorageConfiguration;
56 worker?: WorkerConfiguration;
57 autoReconnectMaxRetries?: number;
58 // deprecated
59 workerProcess?: WorkerProcessType;
60 // deprecated
61 workerStartDelay?: number;
62 // deprecated
63 elementStartDelay?: number;
64 // deprecated
65 workerPoolMinSize?: number;
66 // deprecated
67 workerPoolMaxSize?: number;
68 // deprecated
69 workerPoolStrategy?: WorkerChoiceStrategy;
70 // deprecated
71 chargingStationsPerWorker?: number;
72 logStatisticsInterval?: number;
73 logFormat?: string;
74 logLevel?: string;
75 logRotate?: boolean;
76 logMaxFiles?: number;
77 logFile?: string;
78 logErrorFile?: string;
79 logConsole?: boolean;
80 };