X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FConfigurationData.ts;h=5a6853d22fd1853f714df96b06ad270d57d58c04;hb=5b43123fc02370da77b9265aeec62edbdbc83728;hp=fb67bced00fdf3ac8f75f107a74f1383ff61a02e;hpb=eb3abc4fe41400debcf894e53f91937498e77571;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ConfigurationData.ts b/src/types/ConfigurationData.ts index fb67bced..5a6853d2 100644 --- a/src/types/ConfigurationData.ts +++ b/src/types/ConfigurationData.ts @@ -1,25 +1,24 @@ -import type { ListenOptions } from 'net'; +import type { ListenOptions } from 'node:net'; import type { WorkerChoiceStrategy } from 'poolifier'; -import type { StorageType } from './Storage'; -import type { ApplicationProtocol, AuthenticationType } from './UIProtocol'; -import type { WorkerProcessType } from './Worker'; +import type { ApplicationProtocol, AuthenticationType, StorageType } from './internal'; +import type { WorkerProcessType } from '../worker'; -export type ServerOptions = ListenOptions; +type ServerOptions = ListenOptions; export enum SupervisionUrlDistribution { ROUND_ROBIN = 'round-robin', RANDOM = 'random', - SEQUENTIAL = 'sequential', + CHARGING_STATION_AFFINITY = 'charging-station-affinity', } -export interface StationTemplateUrl { +export type StationTemplateUrl = { file: string; numberOfStations: number; -} +}; -export interface UIServerConfiguration { +export type UIServerConfiguration = { enabled?: boolean; type?: ApplicationProtocol; options?: ServerOptions; @@ -29,15 +28,15 @@ export interface UIServerConfiguration { username?: string; password?: string; }; -} +}; -export interface StorageConfiguration { +export type StorageConfiguration = { enabled?: boolean; type?: StorageType; uri?: string; -} +}; -export interface WorkerConfiguration { +export type WorkerConfiguration = { processType?: WorkerProcessType; startDelay?: number; elementsPerWorker?: number; @@ -45,9 +44,9 @@ export interface WorkerConfiguration { poolMinSize?: number; poolMaxSize?: number; poolStrategy?: WorkerChoiceStrategy; -} +}; -export default interface ConfigurationData { +export type ConfigurationData = { supervisionUrls?: string | string[]; supervisionUrlDistribution?: SupervisionUrlDistribution; stationTemplateUrls: StationTemplateUrl[]; @@ -55,26 +54,27 @@ export default interface ConfigurationData { performanceStorage?: StorageConfiguration; worker?: WorkerConfiguration; autoReconnectMaxRetries?: number; - // deprecated + /** @deprecated Moved to worker configuration section. */ workerProcess?: WorkerProcessType; - // deprecated + /** @deprecated Moved to worker configuration section. */ workerStartDelay?: number; - // deprecated + /** @deprecated Moved to worker configuration section. */ elementStartDelay?: number; - // deprecated + /** @deprecated Moved to worker configuration section. */ workerPoolMinSize?: number; - // deprecated + /** @deprecated Moved to worker configuration section. */ workerPoolMaxSize?: number; - // deprecated + /** @deprecated Moved to worker configuration section. */ workerPoolStrategy?: WorkerChoiceStrategy; - // deprecated + /** @deprecated Moved to worker configuration section. */ chargingStationsPerWorker?: number; logStatisticsInterval?: number; logFormat?: string; logLevel?: string; logRotate?: boolean; - logMaxFiles?: number; + logMaxFiles?: number | string; + logMaxSize?: number | string; logFile?: string; logErrorFile?: string; logConsole?: boolean; -} +};