import ConfigurationData, {
+ ServerOptions,
StationTemplateUrl,
StorageConfiguration,
SupervisionUrlDistribution,
- UIWebSocketServerConfiguration,
+ UIServerConfiguration,
} from '../types/ConfigurationData';
import Constants from './Constants';
import { EmptyObject } from '../types/EmptyObject';
import { FileType } from '../types/FileType';
import { HandleErrorParams } from '../types/Error';
-import { ServerOptions } from 'ws';
import { StorageType } from '../types/Storage';
import type { WorkerChoiceStrategy } from 'poolifier';
import WorkerConstants from '../worker/WorkerConstants';
: Constants.DEFAULT_LOG_STATISTICS_INTERVAL;
}
- static getUIWebSocketServer(): UIWebSocketServerConfiguration {
+ static getUIServer(): UIServerConfiguration {
+ if (Configuration.objectHasOwnProperty(Configuration.getConfig(), 'uiWebSocketServer')) {
+ console.error(
+ chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration section 'uiWebSocketServer' usage. Use 'uiServer' instead}`
+ );
+ }
let options: ServerOptions = {
host: Constants.DEFAULT_UI_WEBSOCKET_SERVER_HOST,
port: Constants.DEFAULT_UI_WEBSOCKET_SERVER_PORT,
};
- let uiWebSocketServerConfiguration: UIWebSocketServerConfiguration = {
+ let uiServerConfiguration: UIServerConfiguration = {
enabled: true,
options,
};
- if (Configuration.objectHasOwnProperty(Configuration.getConfig(), 'uiWebSocketServer')) {
- if (
- Configuration.objectHasOwnProperty(Configuration.getConfig().uiWebSocketServer, 'options')
- ) {
+ if (Configuration.objectHasOwnProperty(Configuration.getConfig(), 'uiServer')) {
+ if (Configuration.objectHasOwnProperty(Configuration.getConfig().uiServer, 'options')) {
options = {
...options,
...(Configuration.objectHasOwnProperty(
- Configuration.getConfig().uiWebSocketServer.options,
+ Configuration.getConfig().uiServer.options,
'host'
- ) && { host: Configuration.getConfig().uiWebSocketServer.options.host }),
+ ) && { host: Configuration.getConfig().uiServer.options.host }),
...(Configuration.objectHasOwnProperty(
- Configuration.getConfig().uiWebSocketServer.options,
+ Configuration.getConfig().uiServer.options,
'port'
- ) && { port: Configuration.getConfig().uiWebSocketServer.options.port }),
+ ) && { port: Configuration.getConfig().uiServer.options.port }),
};
}
- uiWebSocketServerConfiguration = {
- ...uiWebSocketServerConfiguration,
- ...(Configuration.objectHasOwnProperty(
- Configuration.getConfig().uiWebSocketServer,
- 'enabled'
- ) && { enabled: Configuration.getConfig().uiWebSocketServer.enabled }),
+ uiServerConfiguration = {
+ ...uiServerConfiguration,
+ ...(Configuration.objectHasOwnProperty(Configuration.getConfig().uiServer, 'enabled') && {
+ enabled: Configuration.getConfig().uiServer.enabled,
+ }),
options,
};
}
- return uiWebSocketServerConfiguration;
+ return uiServerConfiguration;
}
static getPerformanceStorage(): StorageConfiguration {
Configuration.warnDeprecatedConfigurationKey(
'useWorkerPool',
null,
- "Use 'workerProcess' to define the type of worker process to use instead"
+ "Use 'workerProcess' to define the type of worker process model to use instead"
);
return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'workerProcess')
? Configuration.getConfig().workerProcess