Merge branch 'main' into combined-prs-branch
[e-mobility-charging-stations-simulator.git] / src / types / ConfigurationData.ts
index 41d45e4a3ee71639fbc0975e804dc64e59e196b0..d1948921660b0da42774c813686405c2baf4d74c 100644 (file)
@@ -1,4 +1,5 @@
 import type { ListenOptions } from 'node:net';
+import type { ResourceLimits } from 'node:worker_threads';
 
 import type { WorkerChoiceStrategy } from 'poolifier';
 
@@ -8,6 +9,13 @@ import type { WorkerProcessType } from '../worker';
 
 type ServerOptions = ListenOptions;
 
+export enum ConfigurationSection {
+  log = 'log',
+  performanceStorage = 'performanceStorage',
+  worker = 'worker',
+  uiServer = 'uiServer',
+}
+
 export enum SupervisionUrlDistribution {
   ROUND_ROBIN = 'round-robin',
   RANDOM = 'random',
@@ -32,9 +40,15 @@ export interface LogConfiguration {
   maxSize?: string | number;
 }
 
+export enum ApplicationProtocolVersion {
+  VERSION_11 = 1.1,
+  VERSION_20 = 2.0,
+}
+
 export interface UIServerConfiguration {
   enabled?: boolean;
   type?: ApplicationProtocol;
+  version?: ApplicationProtocolVersion;
   options?: ServerOptions;
   authentication?: {
     enabled: boolean;
@@ -50,15 +64,16 @@ export interface StorageConfiguration {
   uri?: string;
 }
 
+export type ElementsPerWorkerType = number | 'auto' | 'all';
+
 export interface WorkerConfiguration {
   processType?: WorkerProcessType;
   startDelay?: number;
-  elementsPerWorker?: number | 'auto';
+  elementsPerWorker?: ElementsPerWorkerType;
   elementStartDelay?: number;
   poolMinSize?: number;
   poolMaxSize?: number;
-  /** @deprecated Not publicly exposed to end users. */
-  poolStrategy?: WorkerChoiceStrategy;
+  resourceLimits?: ResourceLimits;
 }
 
 export interface ConfigurationData {
@@ -69,6 +84,7 @@ export interface ConfigurationData {
   worker?: WorkerConfiguration;
   uiServer?: UIServerConfiguration;
   performanceStorage?: StorageConfiguration;
+  /** @deprecated Moved to charging station template */
   autoReconnectMaxRetries?: number;
   /** @deprecated Moved to worker configuration section. */
   workerProcess?: WorkerProcessType;