refactor: silence TS type casting error
[e-mobility-charging-stations-simulator.git] / src / utils / Constants.ts
CommitLineData
1fe0632a
JB
1import type { AutomaticTransactionGeneratorConfiguration } from '../types';
2
268a74bb 3export class Constants {
7d34a2f4 4 static readonly DEFAULT_BOOT_NOTIFICATION_INTERVAL = 60000; // Ms
c3da35d4
JB
5 static readonly DEFAULT_HEARTBEAT_INTERVAL = 60000; // Ms
6 static readonly DEFAULT_METER_VALUES_INTERVAL = 60000; // Ms
d2a64eb5 7
10570d97 8 static readonly CHARGING_STATION_DEFAULT_RESET_TIME = 60000; // Ms
3e888c65 9 static readonly CHARGING_STATION_ATG_AVAILABILITY_TIME = 1000; // Ms
a4cc42ea 10 static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME = 1000; // Ms
1fe0632a 11
1fe0632a
JB
12 static readonly DEFAULT_ATG_CONFIGURATION: AutomaticTransactionGeneratorConfiguration =
13 Object.freeze({
14 enable: false,
86b46b49
JB
15 minDuration: 60,
16 maxDuration: 120,
17 minDelayBetweenTwoTransactions: 15,
18 maxDelayBetweenTwoTransactions: 30,
1fe0632a 19 probabilityOfStart: 1,
86b46b49 20 stopAfterHours: 0.25,
1fe0632a
JB
21 stopOnConnectionFailure: true,
22 });
9ac86a7e 23
b25b8684 24 // See https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
3637ca2c
JB
25 static readonly SEMVER_PATTERN =
26 '^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$';
b25b8684 27
c7ba22b7 28 static readonly DEFAULT_CIRCULAR_BUFFER_CAPACITY = 4096;
1e080116 29
3f94cab5
JB
30 static readonly DEFAULT_HASH_ALGORITHM = 'sha384';
31
c69294f7 32 static readonly DEFAULT_IDTAG = '00000000';
3d2ff9e4 33
291cb255 34 static readonly DEFAULT_CONNECTION_TIMEOUT = 30;
9ccca265 35
25f5a959
JB
36 static readonly DEFAULT_LOG_STATISTICS_INTERVAL = 60; // Seconds
37
9ccca265 38 static readonly DEFAULT_FLUCTUATION_PERCENT = 5;
2a370053 39
53b8a4fd 40 static readonly DEFAULT_PERFORMANCE_DIRECTORY = 'performance';
a6b3c6c3 41 static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME = 'performanceRecords.json';
7f774a55 42 static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME = 'e-mobility-charging-stations-simulator';
ae8ee665 43 static readonly PERFORMANCE_RECORDS_TABLE = 'performance_records';
6a49ad23 44
adbddcb4
JB
45 static readonly DEFAULT_UI_SERVER_HOST = 'localhost';
46 static readonly DEFAULT_UI_SERVER_PORT = 8080;
4db8406c 47
2a232a18
JB
48 static readonly UNKNOWN_COMMAND = 'unknown command';
49
59395dc1
JB
50 static readonly MAX_RANDOM_INTEGER = 281474976710654;
51
d81db081 52 static readonly STOP_CHARGING_STATIONS_TIMEOUT = 120000; // Ms
1832a986 53
2035255d 54 static readonly EMPTY_FROZEN_OBJECT = Object.freeze({});
59b6ed8d
JB
55 static readonly EMPTY_FUNCTION = Object.freeze(() => {
56 /* This is intentional */
57 });
58
1cee0015 59 static readonly DEFAULT_MESSAGE_BUFFER_FLUSH_INTERVAL = 60000; // Ms
d193a949 60
4db8406c
JB
61 private constructor() {
62 // This is intentional
63 }
f7869514 64}