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