refactor: align set information namespace
[e-mobility-charging-stations-simulator.git] / src / types / ConfigurationData.ts
CommitLineData
3f85aa2b 1import type { ListenOptions } from 'node:net';
8114d10e 2
9efbac5b 3import type { WorkerChoiceStrategy } from 'poolifier';
8114d10e 4
69074173
JB
5import type { StorageType } from './Storage';
6import type { ApplicationProtocol, AuthenticationType } from './UIProtocol';
268a74bb 7import type { WorkerProcessType } from '../worker';
a4624c96 8
0ac97927 9type ServerOptions = ListenOptions;
66271092 10
2dcfe98e
JB
11export enum SupervisionUrlDistribution {
12 ROUND_ROBIN = 'round-robin',
13 RANDOM = 'random',
c72f6634 14 CHARGING_STATION_AFFINITY = 'charging-station-affinity',
2dcfe98e
JB
15}
16
83e00df1 17export type StationTemplateUrl = {
e118beaa
JB
18 file: string;
19 numberOfStations: number;
83e00df1 20};
e118beaa 21
83e00df1 22export type UIServerConfiguration = {
6a49ad23 23 enabled?: boolean;
1f7fa4de 24 type?: ApplicationProtocol;
66271092 25 options?: ServerOptions;
eb3abc4f
JB
26 authentication?: {
27 enabled: boolean;
28 type: AuthenticationType;
29 username?: string;
30 password?: string;
31 };
83e00df1 32};
6a49ad23 33
83e00df1 34export type StorageConfiguration = {
72f041bd
JB
35 enabled?: boolean;
36 type?: StorageType;
1f5df42a 37 uri?: string;
83e00df1 38};
72f041bd 39
83e00df1 40export type WorkerConfiguration = {
cf2a5d9b
JB
41 processType?: WorkerProcessType;
42 startDelay?: number;
43 elementsPerWorker?: number;
44 elementStartDelay?: number;
45 poolMinSize?: number;
46 poolMaxSize?: number;
47 poolStrategy?: WorkerChoiceStrategy;
83e00df1 48};
cf2a5d9b 49
83e00df1 50export type ConfigurationData = {
2dcfe98e
JB
51 supervisionUrls?: string | string[];
52 supervisionUrlDistribution?: SupervisionUrlDistribution;
1f5df42a 53 stationTemplateUrls: StationTemplateUrl[];
675fa8e3 54 uiServer?: UIServerConfiguration;
72f041bd 55 performanceStorage?: StorageConfiguration;
cf2a5d9b 56 worker?: WorkerConfiguration;
e118beaa 57 autoReconnectMaxRetries?: number;
edd13439 58 /** @deprecated Moved to worker configuration section. */
a4624c96 59 workerProcess?: WorkerProcessType;
edd13439 60 /** @deprecated Moved to worker configuration section. */
322c9192 61 workerStartDelay?: number;
edd13439 62 /** @deprecated Moved to worker configuration section. */
4bfd80fa 63 elementStartDelay?: number;
edd13439 64 /** @deprecated Moved to worker configuration section. */
a4624c96 65 workerPoolMinSize?: number;
edd13439 66 /** @deprecated Moved to worker configuration section. */
4fa59b8a 67 workerPoolMaxSize?: number;
edd13439 68 /** @deprecated Moved to worker configuration section. */
9efbac5b 69 workerPoolStrategy?: WorkerChoiceStrategy;
edd13439 70 /** @deprecated Moved to worker configuration section. */
5fdab605 71 chargingStationsPerWorker?: number;
72f041bd 72 logStatisticsInterval?: number;
ae389044
JB
73 logEnabled?: boolean;
74 logConsole?: boolean;
e118beaa 75 logFormat?: string;
324fd4ee 76 logLevel?: string;
6bf6769e 77 logRotate?: boolean;
9988696d
JB
78 logMaxFiles?: number | string;
79 logMaxSize?: number | string;
e118beaa 80 logFile?: string;
7ec46a9a 81 logErrorFile?: string;
83e00df1 82};