-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathhdbTerms.ts
More file actions
879 lines (816 loc) · 35 KB
/
Copy pathhdbTerms.ts
File metadata and controls
879 lines (816 loc) · 35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
/**
* This module contains common variables/values that will be used across the project.
* Using these constant values helps with consistency across the project.
*
* All variables should use a JSDoc comment to explain what it is, and any objects should be marked as `as const` for better type checking.
*/
/** Old Harper Root Config File */
export const HDB_CONFIG_FILE = 'harperdb-config.yaml';
/** Harper Root Config File */
export const HARPER_CONFIG_FILE = 'harper-config.yaml';
/** Harper Default Config File */
export const HDB_DEFAULT_CONFIG_FILE = 'defaultConfig.yaml';
/** Harper Root Directory Name */
export const HDB_ROOT_DIR_NAME = 'harper';
/** Harper Component Config File */
export const HDB_COMPONENT_CONFIG_FILE = 'config.yaml';
/** Name of the Harper Process Script */
export const HDB_PROC_NAME = 'harper.js';
/** Name of the Harper Restart Script */
export const HDB_RESTART_SCRIPT = 'restartHdb.js';
/** Harper Process Descriptor */
const HDB_PROC_DESCRIPTOR = 'Harper';
/** Custom Function Process Descriptor */
const CUSTOM_FUNCTION_PROC_DESCRIPTOR = 'Custom Functions';
/**
* Process Descriptor Map
*
* Used throughout the project to map process descriptors to their respective process names.
*/
export const PROCESS_DESCRIPTORS = {
HDB: HDB_PROC_DESCRIPTOR,
CUSTOM_FUNCTIONS: CUSTOM_FUNCTION_PROC_DESCRIPTOR,
RESTART_HDB: 'Restart HDB',
INSTALL: 'Install',
RUN: 'Run',
STOP: 'Stop',
UPGRADE: 'Upgrade',
REGISTER: 'Register',
JOB: 'Job',
} as const;
/**
* Process Services Map
*
* These are the services that the Harper process provides.
* This object is used primarily in the restart workflow to determine which services to restart.
*/
export const HDB_PROCESS_SERVICES = {
'harperdb': HDB_PROC_DESCRIPTOR,
'custom functions': CUSTOM_FUNCTION_PROC_DESCRIPTOR,
'custom_functions': CUSTOM_FUNCTION_PROC_DESCRIPTOR,
'http_workers': 'http_workers',
'http': 'http',
} as const;
/** Harper Process Identifier File Name */
export const HDB_PID_FILE = 'hdb.pid';
/** Default database name */
export const DEFAULT_DATABASE_NAME = 'data';
/** Log File Names */
export const LOG_NAMES = {
HDB: 'hdb.log',
} as const;
/** Log Levels */
export const LOG_LEVELS = {
NOTIFY: 'notify',
FATAL: 'fatal',
ERROR: 'error',
WARN: 'warn',
INFO: 'info',
DEBUG: 'debug',
TRACE: 'trace',
} as const;
/** Launch Service script paths */
export const LAUNCH_SERVICE_SCRIPTS = {
MAIN: 'dist/bin/harper.js',
} as const;
/** Specifies user role types */
export const ROLE_TYPES_ENUM = {
SUPER_USER: 'super_user',
} as const;
/** Email address for support requests */
export const HDB_SUPPORT_ADDRESS = 'support@harperdb.io';
/** Support Help Message */
export const SUPPORT_HELP_MSG = `For support, please submit a request at https://harperdbhelp.zendesk.com/hc/en-us/requests/new or contact ${HDB_SUPPORT_ADDRESS}`;
/** Message when records cannot be found for a DELETE operation */
export const SEARCH_NOT_FOUND_MESSAGE = 'None of the specified records were found.';
// TODO: The following unicode/regex terms seem pointless, and could be removed.
// Singular character codes and basic regex patterns should be included inline where they are used.
// These are not likely to ever change and don't need to be extrapolated into variables
/** Unicode for the `.` character */
export const UNICODE_PERIOD = 'U+002E';
/** Regex for matching the `/` character */
export const FORWARD_SLASH_REGEX = /\//g;
/** Unicode for the `/` character */
export const UNICODE_FORWARD_SLASH = 'U+002F';
/** Regex for matching an escaped `/` character */
export const ESCAPED_FORWARD_SLASH_REGEX = /U\+002F/g;
/** Name of the System schema */
export const SYSTEM_SCHEMA_NAME = 'system';
/** Harper Home directory */
export const HDB_HOME_DIR_NAME = '.harperdb';
/** License Key directory */
export const LICENSE_KEY_DIR_NAME = 'keys';
/** Harper Boot Properties file name */
export const BOOT_PROPS_FILE_NAME = 'hdb_boot_properties.file';
/** Restart timeout (milliseconds) */
export const RESTART_TIMEOUT_MS = 60000;
/** Harper File Permissions Mode */
export const HDB_FILE_PERMISSIONS = 0o700;
/** Database directory */
export const DATABASES_DIR_NAME = 'database';
/** Legacy Database directory */
export const LEGACY_DATABASES_DIR_NAME = 'schema';
/** Transaction directory */
export const TRANSACTIONS_DIR_NAME = 'transactions';
/** Backup directory */
export const BACKUP_DIR_NAME = 'backup';
/** Key for specifying process specific environment variables */
export const PROCESS_NAME_ENV_PROP = 'PROCESS_NAME';
/** Boot sequence property parameters */
export const BOOT_PROP_PARAMS = {
SETTINGS_PATH_KEY: 'settings_path',
} as const;
/** Installation prompt map */
export const INSTALL_PROMPTS = {
HDB_ADMIN_USERNAME: 'HDB_ADMIN_USERNAME',
HDB_ADMIN_PASSWORD: 'HDB_ADMIN_PASSWORD',
OPERATIONSAPI_ROOT: 'OPERATIONSAPI_ROOT',
ROOTPATH: 'ROOTPATH',
NODE_HOSTNAME: 'NODE_HOSTNAME',
REPLICATION_HOSTNAME: 'REPLICATION_HOSTNAME',
HDB_CONFIG: 'HDB_CONFIG',
DEFAULTS_MODE: 'DEFAULTS_MODE',
STORAGE_ENGINE: 'STORAGE_ENGINE',
} as const;
/** Insert operation max character size */
export const INSERT_MAX_CHARACTER_SIZE = 250;
/** Upgrade JSON field map */
export const UPGRADE_JSON_FIELD_NAMES_ENUM = {
DATA_VERSION: 'data_version',
UPGRADE_VERSION: 'upgrade_version',
} as const;
/** System table names */
export const SYSTEM_TABLE_NAMES = {
JOB_TABLE_NAME: 'hdb_job',
NODE_TABLE_NAME: 'hdb_nodes',
ATTRIBUTE_TABLE_NAME: 'hdb_attribute',
LICENSE_TABLE_NAME: 'hdb_license',
ROLE_TABLE_NAME: 'hdb_role',
SCHEMA_TABLE_NAME: 'hdb_schema',
TABLE_TABLE_NAME: 'hdb_table',
USER_TABLE_NAME: 'hdb_user',
INFO_TABLE_NAME: 'hdb_info',
DEPLOYMENT_TABLE_NAME: 'hdb_deployment',
AGENT_SESSION_TABLE_NAME: 'hdb_agent_session',
} as const;
/** Hash attribute for the system info table */
export const INFO_TABLE_HASH_ATTRIBUTE = 'info_id';
/** System default attributes */
export const SYSTEM_DEFAULT_ATTRIBUTE_NAMES = {
ATTR_ATTRIBUTE_KEY: 'attribute',
ATTR_CREATEDDATE_KEY: 'createddate',
ATTR_HASH_ATTRIBUTE_KEY: 'hash_attribute',
ATTR_ID_KEY: 'id',
ATTR_NAME_KEY: 'name',
ATTR_PASSWORD_KEY: 'password',
ATTR_RESIDENCE_KEY: 'residence',
ATTR_ROLE_KEY: 'role',
ATTR_SCHEMA_KEY: 'schema',
ATTR_SCHEMA_TABLE_KEY: 'schema_table',
ATTR_TABLE_KEY: 'table',
ATTR_USERNAME_KEY: 'username',
} as const;
/** Describes the available statuses for jobs */
export const JOB_STATUS_ENUM = {
CREATED: 'CREATED',
IN_PROGRESS: 'IN_PROGRESS',
COMPLETE: 'COMPLETE',
ERROR: 'ERROR',
} as const;
/** Operations */
export const OPERATIONS_ENUM = {
INSERT: 'insert',
UPDATE: 'update',
UPSERT: 'upsert',
SEARCH_BY_CONDITIONS: 'search_by_conditions',
SEARCH_BY_HASH: 'search_by_hash',
SEARCH_BY_ID: 'search_by_id',
SEARCH_BY_VALUE: 'search_by_value',
SEARCH: 'search',
SQL: 'sql',
CSV_DATA_LOAD: 'csv_data_load',
CSV_FILE_LOAD: 'csv_file_load',
CSV_URL_LOAD: 'csv_url_load',
CREATE_SCHEMA: 'create_schema',
CREATE_DATABASE: 'create_database',
CREATE_TABLE: 'create_table',
CREATE_ATTRIBUTE: 'create_attribute',
DROP_SCHEMA: 'drop_schema',
DROP_DATABASE: 'drop_database',
DROP_TABLE: 'drop_table',
DESCRIBE_SCHEMA: 'describe_schema',
DESCRIBE_DATABASE: 'describe_database',
DESCRIBE_TABLE: 'describe_table',
DESCRIBE_ALL: 'describe_all',
DESCRIBE_METRIC: 'describe_metric',
DELETE: 'delete',
ADD_USER: 'add_user',
ALTER_USER: 'alter_user',
DROP_USER: 'drop_user',
LIST_USERS: 'list_users',
LIST_ROLES: 'list_roles',
ADD_ROLE: 'add_role',
ALTER_ROLE: 'alter_role',
DROP_ROLE: 'drop_role',
USER_INFO: 'user_info',
READ_LOG: 'read_log',
ADD_NODE: 'add_node',
UPDATE_NODE: 'update_node',
SET_NODE_REPLICATION: 'set_node_replication',
EXPORT_TO_S3: 'export_to_s3',
IMPORT_FROM_S3: 'import_from_s3',
DELETE_FILES_BEFORE: 'delete_files_before',
DELETE_RECORDS_BEFORE: 'delete_records_before',
EXPORT_LOCAL: 'export_local',
SEARCH_JOBS_BY_START_DATE: 'search_jobs_by_start_date',
GET_JOB: 'get_job',
DELETE_JOB: 'delete_job',
UPDATE_JOB: 'update_job',
REGISTRATION_INFO: 'registration_info',
SET_CONFIGURATION: 'set_configuration',
DROP_ATTRIBUTE: 'drop_attribute',
RESTART: 'restart',
RESTART_SERVICE: 'restart_service',
CATCHUP: 'catchup',
SYSTEM_INFORMATION: 'system_information',
DELETE_AUDIT_LOGS_BEFORE: 'delete_audit_logs_before',
READ_AUDIT_LOG: 'read_audit_log',
CREATE_AUTHENTICATION_TOKENS: 'create_authentication_tokens',
LOGIN: 'login',
LOGOUT: 'logout',
REFRESH_OPERATION_TOKEN: 'refresh_operation_token',
GET_CONFIGURATION: 'get_configuration',
CUSTOM_FUNCTIONS_STATUS: 'custom_functions_status',
GET_CUSTOM_FUNCTIONS: 'get_custom_functions',
GET_CUSTOM_FUNCTION: 'get_custom_function',
SET_CUSTOM_FUNCTION: 'set_custom_function',
GET_COMPONENTS: 'get_components',
GET_COMPONENT_FILE: 'get_component_file',
SET_COMPONENT_FILE: 'set_component_file',
DROP_COMPONENT: 'drop_component',
DROP_CUSTOM_FUNCTION: 'drop_custom_function',
ADD_CUSTOM_FUNCTION_PROJECT: 'add_custom_function_project',
ADD_COMPONENT: 'add_component',
DROP_CUSTOM_FUNCTION_PROJECT: 'drop_custom_function_project',
PACKAGE_CUSTOM_FUNCTION_PROJECT: 'package_custom_function_project',
DEPLOY_CUSTOM_FUNCTION_PROJECT: 'deploy_custom_function_project',
PACKAGE_COMPONENT: 'package_component',
DEPLOY_COMPONENT: 'deploy_component',
READ_TRANSACTION_LOG: 'read_transaction_log',
DELETE_TRANSACTION_LOGS_BEFORE: 'delete_transaction_logs_before',
INSTALL_NODE_MODULES: 'install_node_modules',
AUDIT_NODE_MODULES: 'audit_node_modules',
PURGE_STREAM: 'purge_stream',
GET_BACKUP: 'get_backup',
CLEANUP_ORPHAN_BLOBS: 'cleanup_orphan_blobs',
GET_ANALYTICS: 'get_analytics',
LIST_METRICS: 'list_metrics',
GET_STATUS: 'get_status',
SET_STATUS: 'set_status',
CLEAR_STATUS: 'clear_status',
LIST_DEPLOYMENTS: 'list_deployments',
GET_DEPLOYMENT: 'get_deployment',
GET_DEPLOYMENT_PAYLOAD: 'get_deployment_payload',
DELETE_DEPLOYMENT_PAYLOAD: 'delete_deployment_payload',
AGENT_PROMPT: 'agent_prompt',
GET_AGENT_SESSION: 'get_agent_session',
LIST_AGENT_SESSIONS: 'list_agent_sessions',
CANCEL_AGENT_RUN: 'cancel_agent_run',
APPROVE_AGENT_ACTION: 'approve_agent_action',
SET_AGENT_CONFIG: 'set_agent_config',
} as const;
/** Defines valid file types that we are able to handle in 'import_from_s3' ops */
export const VALID_S3_FILE_TYPES = {
CSV: '.csv',
JSON: '.json',
} as const;
/** Defines the keys required in a request body for accessing a S3 bucket */
export const S3_BUCKET_AUTH_KEYS = {
AWS_ACCESS_KEY: 'aws_access_key_id',
AWS_SECRET: 'aws_secret_access_key',
AWS_BUCKET: 'bucket',
AWS_FILE_KEY: 'key',
REGION: 'region',
} as const;
/**
* Defines valid SQL operations to be used in the processAST method - this ensure we have appropriate unit test coverage
* for all SQL operations that are dynamically set after the chooseOperation method which behaves differently for the evaluateSQL operation.
*/
export const VALID_SQL_OPS_ENUM = {
SELECT: 'select',
INSERT: 'insert',
UPDATE: 'update',
DELETE: 'delete',
} as const;
/** Available service actions */
export const SERVICE_ACTIONS_ENUM = {
DEV: 'dev',
RUN: 'run',
START: 'start',
INSTALL: 'install',
STOP: 'stop',
RESTART: 'restart',
VERSION: 'version',
UPGRADE: 'upgrade',
HELP: 'help',
STATUS: 'status',
LOGIN: 'login',
LOGOUT: 'logout',
OPERATION: 'operation',
RENEWCERTS: 'renew-certs',
COPYDB: 'copy-db',
MCP: 'mcp',
} as const;
/** describes the Geo Conversion types */
export const GEO_CONVERSION_ENUM = {
point: 'point',
lineString: 'lineString',
multiLineString: 'multiLineString',
multiPoint: 'multiPoint',
multiPolygon: 'multiPolygon',
polygon: 'polygon',
} as const;
/**
* These values are relics of before the config was converted to yaml.
* The should no longer be used. Instead use CONFIG_PARAMS.
*/
export const HDB_SETTINGS_NAMES = {
HDB_ROOT_KEY: 'HDB_ROOT',
SERVER_PORT_KEY: 'SERVER_PORT',
CERT_KEY: 'CERTIFICATE',
PRIVATE_KEY_KEY: 'PRIVATE_KEY',
HTTP_SECURE_ENABLED_KEY: 'HTTPS_ON',
CORS_ENABLED_KEY: 'CORS_ON',
CORS_WHITELIST_KEY: 'CORS_WHITELIST',
LOG_LEVEL_KEY: 'LOG_LEVEL',
LOGGER_KEY: 'LOGGER',
LOG_PATH_KEY: 'LOG_PATH',
LOG_ROTATE: 'LOG_ROTATE',
LOG_ROTATE_MAX_SIZE: 'LOG_ROTATE_MAX_SIZE',
LOG_ROTATE_RETAIN: 'LOG_ROTATE_RETAIN',
LOG_ROTATE_COMPRESS: 'LOG_ROTATE_COMPRESS',
LOG_ROTATE_DATE_FORMAT: 'LOG_ROTATE_DATE_FORMAT',
LOG_ROTATE_ROTATE_MODULE: 'LOG_ROTATE_ROTATE_MODULE',
LOG_ROTATE_WORKER_INTERVAL: 'LOG_ROTATE_WORKER_INTERVAL',
LOG_ROTATE_ROTATE_INTERVAL: 'LOG_ROTATE_ROTATE_INTERVAL',
LOG_ROTATE_TIMEZONE: 'LOG_ROTATE_TIMEZONE',
LOG_DAILY_ROTATE_KEY: 'LOG_DAILY_ROTATE',
LOG_MAX_DAILY_FILES_KEY: 'LOG_MAX_DAILY_FILES',
PROPS_ENV_KEY: 'NODE_ENV',
SETTINGS_PATH_KEY: 'settings_path', // This value is used in the boot prop file not the settings file. It should stay lowercase.
ALLOW_SELF_SIGNED_SSL_CERTS: 'ALLOW_SELF_SIGNED_SSL_CERTS',
MAX_HDB_PROCESSES: 'MAX_HDB_PROCESSES',
INSTALL_USER: 'install_user', // This value is used in the boot prop file not the settings file. It should stay lowercase.
SERVER_TIMEOUT_KEY: 'SERVER_TIMEOUT_MS',
SERVER_KEEP_ALIVE_TIMEOUT_KEY: 'SERVER_KEEP_ALIVE_TIMEOUT',
SERVER_HEADERS_TIMEOUT_KEY: 'SERVER_HEADERS_TIMEOUT',
DISABLE_TRANSACTION_LOG_KEY: 'DISABLE_TRANSACTION_LOG',
OPERATION_TOKEN_TIMEOUT_KEY: 'OPERATION_TOKEN_TIMEOUT',
REFRESH_TOKEN_TIMEOUT_KEY: 'REFRESH_TOKEN_TIMEOUT',
CUSTOM_FUNCTIONS_ENABLED_KEY: 'CUSTOM_FUNCTIONS',
CUSTOM_FUNCTIONS_PORT_KEY: 'CUSTOM_FUNCTIONS_PORT',
CUSTOM_FUNCTIONS_DIRECTORY_KEY: 'CUSTOM_FUNCTIONS_DIRECTORY',
MAX_CUSTOM_FUNCTION_PROCESSES: 'MAX_CUSTOM_FUNCTION_PROCESSES',
LOG_TO_FILE: 'LOG_TO_FILE',
LOG_TO_STDSTREAMS: 'LOG_TO_STDSTREAMS',
RUN_IN_FOREGROUND: 'RUN_IN_FOREGROUND',
LOCAL_STUDIO_ON: 'LOCAL_STUDIO_ON',
STORAGE_WRITE_ASYNC: 'STORAGE_WRITE_ASYNC',
} as const;
/** Legacy configuration parameters */
export const LEGACY_CONFIG_PARAMS = {
CUSTOMFUNCTIONS_ENABLED: 'customFunctions_enabled',
CUSTOMFUNCTIONS_NETWORK_PORT: 'customFunctions_network_port',
CUSTOMFUNCTIONS_TLS_CERTIFICATE: 'customFunctions_tls_certificate',
CUSTOMFUNCTIONS_NETWORK_CORS: 'customFunctions_network_cors',
CUSTOMFUNCTIONS_NETWORK_CORSACCESSLIST: 'customFunctions_network_corsAccessList',
CUSTOMFUNCTIONS_NETWORK_HEADERSTIMEOUT: 'customFunctions_network_headersTimeout',
CUSTOMFUNCTIONS_NETWORK_HTTPS: 'customFunctions_network_https',
CUSTOMFUNCTIONS_NETWORK_KEEPALIVETIMEOUT: 'customFunctions_network_keepAliveTimeout',
CUSTOMFUNCTIONS_TLS_PRIVATEKEY: 'customFunctions_tls_privateKey',
CUSTOMFUNCTIONS_TLS_CERT_AUTH: 'customFunctions_tls_certificateAuthority',
CUSTOMFUNCTIONS_NETWORK_TIMEOUT: 'customFunctions_network_timeout',
CUSTOMFUNCTIONS_NODEENV: 'customFunctions_nodeEnv',
CUSTOMFUNCTIONS_ROOT: 'customFunctions_root',
} as const;
/**
* All configuration parameters for Harper
*
* If a param is added to config it must also be added here.
*/
export const CONFIG_PARAMS = {
ANALYTICS_AGGREGATEPERIOD: 'analytics_aggregatePeriod',
ANALYTICS_AGGREGATERETENTIONMS: 'analytics_aggregateRetentionMs',
ANALYTICS_RAWRETENTIONMS: 'analytics_rawRetentionMs',
ANALYTICS_REPLICATE: 'analytics_replicate',
ANALYTICS_STORAGEINTERVAL: 'analytics_storageInterval',
AUTHENTICATION_AUTHORIZELOCAL: 'authentication_authorizeLocal',
AUTHENTICATION_CACHETTL: 'authentication_cacheTTL',
AUTHENTICATION_COOKIE_DOMAINS: 'authentication_cookie_domains',
AUTHENTICATION_COOKIE_EXPIRES: 'authentication_cookie_expires',
AUTHENTICATION_ENABLESESSIONS: 'authentication_enableSessions',
AUTHENTICATION_OPERATIONTOKENTIMEOUT: 'authentication_operationTokenTimeout',
AUTHENTICATION_REFRESHTOKENTIMEOUT: 'authentication_refreshTokenTimeout',
AUTHENTICATION_HASHFUNCTION: 'authentication_hashFunction',
CUSTOMFUNCTIONS_NETWORK_HTTPS: 'customFunctions_network_https',
APPLICATIONS_MODULELOADER: 'applications_moduleLoader',
APPLICATIONS_LOCKDOWN: 'applications_lockdown',
APPLICATIONS_DEPENDENCYLOADER: 'applications_dependencyLoader',
APPLICATIONS_PACKAGEMANAGERPREFIX: 'applications_packageManagerPrefix',
APPLICATIONS_ALLOWEDBUILTINMODULES: 'applications_allowedBuiltInModules',
APPLICATIONS_ALLOWEDSPAWNCOMMANDS: 'applications_allowedSpawnCommands',
APPLICATIONS_ALLOWEDDIRECTORY: 'applications_allowedDirectory',
THREADS: 'threads',
THREADS_COUNT: 'threads_count',
THREADS_DEBUG: 'threads_debug',
THREADS_DEBUG_STARTINGPORT: 'threads_debug_startingPort',
THREADS_DEBUG_PORT: 'threads_debug_port',
THREADS_DEBUG_HOST: 'threads_debug_host',
THREADS_DEBUG_WAITFORDEBUGGER: 'threads_debug_waitForDebugger',
THREADS_MAXHEAPMEMORY: 'threads_maxHeapMemory',
THREADS_HEAPSNAPSHOTNEARLIMIT: 'threads_heapSnapshotNearLimit',
HTTP_SESSIONAFFINITY: 'http_sessionAffinity',
HTTP_COMPRESSIONTHRESHOLD: 'http_compressionThreshold',
HTTP_CORS: 'http_cors',
HTTP_CORSACCESSLIST: 'http_corsAccessList',
HTTP_CORSACCESSCONTROLALLOWHEADERS: 'http_corsAccessControlAllowHeaders',
HTTP_HEADERSTIMEOUT: 'http_headersTimeout',
HTTP_KEEPALIVETIMEOUT: 'http_keepAliveTimeout',
HTTP_MAXPARAMLENGTH: 'http_maxParamLength',
HTTP_TIMEOUT: 'http_timeout',
HTTP_PORT: 'http_port',
HTTP_SECUREPORT: 'http_securePort',
HTTP_MTLS: 'http_mtls',
HTTP_MTLS_REQUIRED: 'http_mtls_required',
HTTP_MTLS_USER: 'http_mtls_user',
HTTP_MTLS_CERTIFICATEVERIFICATION: 'http_mtls_certificateVerification',
HTTP_MTLS_CERTIFICATEVERIFICATION_FAILUREMODE: 'http_mtls_certificateVerification_failureMode',
HTTP_MTLS_CERTIFICATEVERIFICATION_CRL: 'http_mtls_certificateVerification_crl',
HTTP_MTLS_CERTIFICATEVERIFICATION_CRL_TIMEOUT: 'http_mtls_certificateVerification_crl_timeout',
HTTP_MTLS_CERTIFICATEVERIFICATION_CRL_CACHETTL: 'http_mtls_certificateVerification_crl_cacheTtl',
HTTP_MTLS_CERTIFICATEVERIFICATION_CRL_FAILUREMODE: 'http_mtls_certificateVerification_crl_failureMode',
HTTP_MTLS_CERTIFICATEVERIFICATION_CRL_GRACEPERIOD: 'http_mtls_certificateVerification_crl_gracePeriod',
HTTP_MTLS_CERTIFICATEVERIFICATION_OCSP: 'http_mtls_certificateVerification_ocsp',
HTTP_MTLS_CERTIFICATEVERIFICATION_OCSP_TIMEOUT: 'http_mtls_certificateVerification_ocsp_timeout',
HTTP_MTLS_CERTIFICATEVERIFICATION_OCSP_CACHETTL: 'http_mtls_certificateVerification_ocsp_cacheTtl',
HTTP_MTLS_CERTIFICATEVERIFICATION_OCSP_ERRORCACHETTL: 'http_mtls_certificateVerification_ocsp_errorCacheTtl',
HTTP_MTLS_CERTIFICATEVERIFICATION_OCSP_FAILUREMODE: 'http_mtls_certificateVerification_ocsp_failureMode',
HTTP_MAXHEADERSIZE: 'http_maxHeaderSize',
HTTP_THREADRANGE: 'http_threadRange',
HTTP_REQUESTQUEUELIMIT: 'http_requestQueueLimit',
HTTP_MAXREQUESTBODYSIZE: 'http_maxRequestBodySize',
HTTP_HTTP2: 'http_http2',
LICENSE_MODE: 'license_mode',
LICENSE_REGION: 'license_region',
LOCALSTUDIO_ENABLED: 'localStudio_enabled',
LOGGING_COLORS: 'logging_colors',
LOGGING_CONSOLE: 'logging_console',
LOGGING_FILE: 'logging_file',
LOGGING_LEVEL: 'logging_level',
LOGGING_ROOT: 'logging_root',
LOGGING_EXTERNAL_LEVEL: 'logging_external_level',
LOGGING_EXTERNAL_TAG: 'logging_external_tag',
LOGGING_EXTERNAL_PATH: 'logging_external_path',
LOGGING_ROTATION_ENABLED: 'logging_rotation_enabled',
LOGGING_ROTATION_COMPRESS: 'logging_rotation_compress',
LOGGING_ROTATION_INTERVAL: 'logging_rotation_interval',
LOGGING_ROTATION_MAXSIZE: 'logging_rotation_maxSize',
LOGGING_ROTATION_PATH: 'logging_rotation_path',
LOGGING_ROTATION_RETENTION: 'logging_rotation_retention',
LOGGING_STDSTREAMS: 'logging_stdStreams',
LOGGING_AUDITLOG: 'logging_auditLog',
LOGGING_AUDITRETENTION: 'logging_auditRetention',
LOGGING_AUDITAUTHEVENTS_LOGFAILED: 'logging_auditAuthEvents_logFailed',
LOGGING_AUDITAUTHEVENTS_LOGSUCCESSFUL: 'logging_auditAuthEvents_logSuccessful',
OPERATIONSAPI_NETWORK_CORS: 'operationsApi_network_cors',
OPERATIONSAPI_NETWORK_CORSACCESSLIST: 'operationsApi_network_corsAccessList',
OPERATIONSAPI_NETWORK_HEADERSTIMEOUT: 'operationsApi_network_headersTimeout',
OPERATIONSAPI_NETWORK_HTTPS: 'operationsApi_network_https',
OPERATIONSAPI_NETWORK_KEEPALIVETIMEOUT: 'operationsApi_network_keepAliveTimeout',
OPERATIONSAPI_NETWORK_PORT: 'operationsApi_network_port',
OPERATIONSAPI_NETWORK_DOMAINSOCKET: 'operationsApi_network_domainSocket',
OPERATIONSAPI_NETWORK_SECUREPORT: 'operationsApi_network_securePort',
OPERATIONSAPI_NETWORK_HTTP2: 'operationsApi_network_http2',
OPERATIONSAPI_NETWORK_MAXREQUESTBODYSIZE: 'operationsApi_network_maxRequestBodySize',
OPERATIONSAPI_COMPONENTFILE_MAXSIZE: 'operationsApi_componentFile_maxSize',
OPERATIONSAPI_TLS: 'operationsApi_tls',
OPERATIONSAPI_TLS_CERTIFICATE: 'operationsApi_tls_certificate',
OPERATIONSAPI_TLS_PRIVATEKEY: 'operationsApi_tls_privateKey',
OPERATIONSAPI_TLS_CERTIFICATEAUTHORITY: 'operationsApi_tls_certificateAuthority',
OPERATIONSAPI_NETWORK_TIMEOUT: 'operationsApi_network_timeout',
OPERATIONSAPI_SYSINFO_NETWORK: 'operationsApi_sysInfo_network',
OPERATIONSAPI_SYSINFO_DISK: 'operationsApi_sysInfo_disk',
MCP_OPERATIONS_MOUNTPATH: 'mcp_operations_mountPath',
MCP_OPERATIONS_ALLOW: 'mcp_operations_allow',
MCP_OPERATIONS_DENY: 'mcp_operations_deny',
MCP_OPERATIONS_MAXTOOLS: 'mcp_operations_maxTools',
MCP_OPERATIONS_RATELIMIT_PERTOOLPERSECOND: 'mcp_operations_rateLimit_perToolPerSecond',
MCP_OPERATIONS_RATELIMIT_PERTOOLBURST: 'mcp_operations_rateLimit_perToolBurst',
MCP_OPERATIONS_RATELIMIT_SESSIONCONCURRENCY: 'mcp_operations_rateLimit_sessionConcurrency',
MCP_OPERATIONS_RATELIMIT_SESSIONPERSECOND: 'mcp_operations_rateLimit_sessionPerSecond',
MCP_APPLICATION_MOUNTPATH: 'mcp_application_mountPath',
MCP_APPLICATION_ALLOW: 'mcp_application_allow',
MCP_APPLICATION_DENY: 'mcp_application_deny',
MCP_APPLICATION_MAXTOOLS: 'mcp_application_maxTools',
MCP_APPLICATION_SEARCHMAXRESULTS: 'mcp_application_searchMaxResults',
MCP_APPLICATION_RATELIMIT_PERTOOLPERSECOND: 'mcp_application_rateLimit_perToolPerSecond',
MCP_APPLICATION_RATELIMIT_PERTOOLBURST: 'mcp_application_rateLimit_perToolBurst',
MCP_APPLICATION_RATELIMIT_SESSIONCONCURRENCY: 'mcp_application_rateLimit_sessionConcurrency',
MCP_APPLICATION_RATELIMIT_SESSIONPERSECOND: 'mcp_application_rateLimit_sessionPerSecond',
MCP_SESSION_IDLETIMEOUTSECONDS: 'mcp_session_idleTimeoutSeconds',
MCP_SESSION_ALLOWCLIENTDELETE: 'mcp_session_allowClientDelete',
AGENT_ENABLED: 'agent_enabled',
AGENT_PROVIDER: 'agent_provider',
AGENT_MODEL: 'agent_model',
AGENT_MAXTURNS: 'agent_maxTurns',
AGENT_MAXCOSTUSD: 'agent_maxCostUsd',
AGENT_AUTOAPPROVE: 'agent_autoApprove',
AGENT_ALLOWDESTRUCTIVE: 'agent_allowDestructive',
AGENT_USER: 'agent_user',
AGENT_COMPONENTSSCOPE: 'agent_componentsScope',
REPLICATION: 'replication',
REPLICATION_HOSTNAME: 'replication_hostname',
REPLICATION_URL: 'replication_url',
REPLICATION_PORT: 'replication_port',
REPLICATION_SECUREPORT: 'replication_securePort',
REPLICATION_ROUTES: 'replication_routes',
REPLICATION_DATABASES: 'replication_databases',
REPLICATION_ENABLEROOTCAS: 'replication_enableRootCAs',
REPLICATION_MTLS_CERTIFICATEVERIFICATION: 'replication_mtls_certificateVerification',
REPLICATION_MTLS_CERTIFICATEVERIFICATION_FAILUREMODE: 'replication_mtls_certificateVerification_failureMode',
REPLICATION_MTLS_CERTIFICATEVERIFICATION_CRL: 'replication_mtls_certificateVerification_crl',
REPLICATION_MTLS_CERTIFICATEVERIFICATION_CRL_TIMEOUT: 'replication_mtls_certificateVerification_crl_timeout',
REPLICATION_MTLS_CERTIFICATEVERIFICATION_CRL_CACHETTL: 'replication_mtls_certificateVerification_crl_cacheTtl',
REPLICATION_MTLS_CERTIFICATEVERIFICATION_CRL_FAILUREMODE: 'replication_mtls_certificateVerification_crl_failureMode',
REPLICATION_MTLS_CERTIFICATEVERIFICATION_CRL_GRACEPERIOD: 'replication_mtls_certificateVerification_crl_gracePeriod',
REPLICATION_MTLS_CERTIFICATEVERIFICATION_OCSP: 'replication_mtls_certificateVerification_ocsp',
REPLICATION_MTLS_CERTIFICATEVERIFICATION_OCSP_TIMEOUT: 'replication_mtls_certificateVerification_ocsp_timeout',
REPLICATION_MTLS_CERTIFICATEVERIFICATION_OCSP_CACHETTL: 'replication_mtls_certificateVerification_ocsp_cacheTtl',
REPLICATION_MTLS_CERTIFICATEVERIFICATION_OCSP_ERRORCACHETTL:
'replication_mtls_certificateVerification_ocsp_errorCacheTtl',
REPLICATION_MTLS_CERTIFICATEVERIFICATION_OCSP_FAILUREMODE:
'replication_mtls_certificateVerification_ocsp_failureMode',
REPLICATION_SHARD: 'replication_shard',
REPLICATION_BLOBTIMEOUT: 'replication_blobTimeout',
REPLICATION_FAILOVER: 'replication_failover',
REPLICATION_BLOBCONCURRENCY: 'replication_blobConcurrency',
REPLICATION_MAXPAYLOAD: 'replication_maxPayload',
REPLICATION_RECORDCONCURRENCY: 'replication_recordConcurrency',
REPLICATION_PINGINTERVAL: 'replication_pingInterval',
REPLICATION_PINGTIMEOUT: 'replication_pingTimeout',
ROOTPATH: 'rootPath',
SERIALIZATION_BIGINT: 'serialization_bigInt',
STORAGE_WRITEASYNC: 'storage_writeAsync',
STORAGE_OVERLAPPINGSYNC: 'storage_overlappingSync',
STORAGE_CACHING: 'storage_caching',
STORAGE_COMPRESSION: 'storage_compression',
STORAGE_NOREADAHEAD: 'storage_noReadAhead',
STORAGE_RANDOMACCESSFIELDS: 'storage_randomAccessFields',
STORAGE_PREFETCHWRITES: 'storage_prefetchWrites',
STORAGE_ENCRYPTION: 'storage_encryption',
STORAGE_MAXTRANSACTIONQUEUETIME: 'storage_maxTransactionQueueTime',
STORAGE_MAXTRANSACTIONOPENTIME: 'storage_maxTransactionOpenTime',
STORAGE_MAX_READ_TRANSACTION_OPEN_TIME: 'storage_maxReadTransactionOpenTime',
STORAGE_DEBUGLONGTRANSACTIONS: 'storage_debugLongTransactions',
STORAGE_PATH: 'storage_path',
STORAGE_BLOBPATHS: 'storage_blobPaths',
STORAGE_BLOBCLEANUPSPEED: 'storage_blobCleanupSpeed',
STORAGE_AUDIT_PATH: 'storage_audit_path',
STORAGE_MAXFREESPACETOLOAD: 'storage_maxFreeSpaceToLoad',
STORAGE_MAXFREESPACETORETAIN: 'storage_maxFreeSpaceToRetain',
STORAGE_PAGESIZE: 'storage_pageSize',
STORAGE_COMPRESSION_DICTIONARY: 'storage_compression_dictionary',
STORAGE_COMPRESSION_THRESHOLD: 'storage_compression_threshold',
STORAGE_COMPACTONSTART: 'storage_compactOnStart',
STORAGE_COMPACTONSTARTKEEPBACKUP: 'storage_compactOnStartKeepBackup',
STORAGE_MIGRATEONSTART: 'storage_migrateOnStart',
STORAGE_RECLAMATION_THRESHOLD: 'storage_reclamation_threshold',
STORAGE_RECLAMATION_INTERVAL: 'storage_reclamation_interval',
STORAGE_RECLAMATION_EVICTIONFACTOR: 'storage_reclamation_evictionFactor',
STORAGE_ENGINE: 'storage_engine',
STORAGE_READONLY: 'storage_readOnly',
STORAGE_ROCKS_BLOCKCACHESIZE: 'storage_rocks_blockCacheSize',
STORAGE_ROCKS_WRITEBUFFERMANAGERSIZE: 'storage_rocks_writeBufferManagerSize',
STORAGE_ROCKS_WRITEBUFFERMANAGERCOSTTOCACHE: 'storage_rocks_writeBufferManagerCostToCache',
STORAGE_ROCKS_WRITEBUFFERMANAGERALLOWSTALL: 'storage_rocks_writeBufferManagerAllowStall',
DATABASES: 'databases',
IGNORE_SCRIPTS: 'ignoreScripts',
MQTT_NETWORK_PORT: 'mqtt_network_port',
MQTT_WEBSOCKET: 'mqtt_webSocket',
MQTT_NETWORK_SECUREPORT: 'mqtt_network_securePort',
MQTT_NETWORK_MTLS: 'mqtt_network_mtls',
MQTT_NETWORK_MTLS_REQUIRED: 'mqtt_network_mtls_required',
MQTT_NETWORK_MTLS_CERTIFICATEAUTHORITY: 'mqtt_network_mtls_certificateAuthority',
MQTT_NETWORK_MTLS_USER: 'mqtt_network_mtls_user',
MQTT_REQUIREAUTHENTICATION: 'mqtt_requireAuthentication',
COMPONENTSROOT: 'componentsRoot',
TLS_CERTIFICATE: 'tls_certificate',
TLS_PRIVATEKEY: 'tls_privateKey',
TLS_CERTIFICATEAUTHORITY: 'tls_certificateAuthority',
TLS_CIPHERS: 'tls_ciphers',
TLS_UNIXDOMAINSOCKETS: 'tls_unixDomainSockets',
TLS: 'tls',
CLONED: 'cloned',
NODE_HOSTNAME: 'node_hostname',
NODE_URL: 'node_url',
} as const;
/**
* This constant maps user-provided configuration parameters (from CLI, environment variables, etc.) to the
* case-sensitive configuration parameters. New parameters added to the CONFIG_PARAMS constant above are
* dynamically included in this mapping via the subsequent for loop, eliminating the need for manual updates.
* Additionally, this constant serves to map old configuration parameters to their updated counterparts.
*/
export const CONFIG_PARAM_MAP = {
settings_path: BOOT_PROP_PARAMS.SETTINGS_PATH_KEY,
hdb_root_key: CONFIG_PARAMS.ROOTPATH,
hdb_root: CONFIG_PARAMS.ROOTPATH,
rootpath: CONFIG_PARAMS.ROOTPATH,
server_port_key: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_PORT,
server_port: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_PORT,
cert_key: CONFIG_PARAMS.TLS_CERTIFICATE,
certificate: CONFIG_PARAMS.TLS_CERTIFICATE,
private_key_key: CONFIG_PARAMS.TLS_PRIVATEKEY,
private_key: CONFIG_PARAMS.TLS_PRIVATEKEY,
http_secure_enabled_key: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_HTTPS,
https_on: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_HTTPS,
cors_enabled_key: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_CORS,
cors_on: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_CORS,
cors_whitelist_key: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_CORSACCESSLIST,
cors_whitelist: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_CORSACCESSLIST,
cors_accesslist_key: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_CORSACCESSLIST,
cors_accesslist: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_CORSACCESSLIST,
log_level_key: CONFIG_PARAMS.LOGGING_LEVEL,
log_level: CONFIG_PARAMS.LOGGING_LEVEL,
log_path_key: CONFIG_PARAMS.LOGGING_ROOT,
log_path: CONFIG_PARAMS.LOGGING_ROOT,
max_http_threads: CONFIG_PARAMS.THREADS_COUNT,
max_hdb_processes: CONFIG_PARAMS.THREADS_COUNT,
server_timeout_key: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_TIMEOUT,
server_timeout_ms: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_TIMEOUT,
server_keep_alive_timeout_key: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_KEEPALIVETIMEOUT,
server_keep_alive_timeout: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_KEEPALIVETIMEOUT,
server_headers_timeout_key: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_HEADERSTIMEOUT,
server_headers_timeout: CONFIG_PARAMS.OPERATIONSAPI_NETWORK_HEADERSTIMEOUT,
disable_transaction_log_key: CONFIG_PARAMS.LOGGING_AUDITLOG,
disable_transaction_log: CONFIG_PARAMS.LOGGING_AUDITLOG,
operation_token_timeout_key: CONFIG_PARAMS.AUTHENTICATION_OPERATIONTOKENTIMEOUT,
operation_token_timeout: CONFIG_PARAMS.AUTHENTICATION_OPERATIONTOKENTIMEOUT,
refresh_token_timeout_key: CONFIG_PARAMS.AUTHENTICATION_REFRESHTOKENTIMEOUT,
refresh_token_timeout: CONFIG_PARAMS.AUTHENTICATION_REFRESHTOKENTIMEOUT,
custom_functions_port_key: CONFIG_PARAMS.HTTP_PORT,
custom_functions_port: CONFIG_PARAMS.HTTP_PORT,
custom_functions_directory_key: CONFIG_PARAMS.COMPONENTSROOT,
custom_functions_directory: CONFIG_PARAMS.COMPONENTSROOT,
max_custom_function_processes: CONFIG_PARAMS.THREADS_COUNT,
logging_console: CONFIG_PARAMS.LOGGING_CONSOLE,
log_to_file: CONFIG_PARAMS.LOGGING_FILE,
log_to_stdstreams: CONFIG_PARAMS.LOGGING_STDSTREAMS,
local_studio_on: CONFIG_PARAMS.LOCALSTUDIO_ENABLED,
customfunctions_network_port: CONFIG_PARAMS.HTTP_PORT,
customfunctions_tls_certificate: CONFIG_PARAMS.TLS_CERTIFICATE,
customfunctions_network_cors: CONFIG_PARAMS.HTTP_CORS,
customfunctions_network_corsaccesslist: CONFIG_PARAMS.HTTP_CORSACCESSLIST,
customfunctions_network_headerstimeout: CONFIG_PARAMS.HTTP_HEADERSTIMEOUT,
customfunctions_network_https: CONFIG_PARAMS.CUSTOMFUNCTIONS_NETWORK_HTTPS,
customfunctions_network_keepalivetimeout: CONFIG_PARAMS.HTTP_KEEPALIVETIMEOUT,
customfunctions_tls_privatekey: CONFIG_PARAMS.TLS_PRIVATEKEY,
customfunctions_tls_certificateauthority: CONFIG_PARAMS.TLS_CERTIFICATEAUTHORITY,
customfunctions_network_timeout: CONFIG_PARAMS.HTTP_TIMEOUT,
customfunctions_tls: CONFIG_PARAMS.TLS,
http_threads: CONFIG_PARAMS.THREADS_COUNT,
threads: CONFIG_PARAMS.THREADS_COUNT,
threads_count: CONFIG_PARAMS.THREADS_COUNT,
customfunctions_processes: CONFIG_PARAMS.THREADS_COUNT,
customfunctions_root: CONFIG_PARAMS.COMPONENTSROOT,
operationsapi_root: CONFIG_PARAMS.ROOTPATH,
node_hostname: CONFIG_PARAMS.NODE_HOSTNAME,
node_url: CONFIG_PARAMS.NODE_URL,
}; // This object is dynamically populated below so don't mark as const until we can fix this up.
for (const key in CONFIG_PARAMS) {
const name = CONFIG_PARAMS[key];
CONFIG_PARAM_MAP[name.toLowerCase()] = name;
}
/** Database parameter config */
export const DATABASES_PARAM_CONFIG = {
TABLES: 'tables',
PATH: 'path',
AUDIT_PATH: 'auditPath',
} as const;
/** Describes all available job types */
export const JOB_TYPE_ENUM = {
csv_file_load: 'csv_file_load',
csv_data_load: OPERATIONS_ENUM.CSV_DATA_LOAD,
csv_url_load: OPERATIONS_ENUM.CSV_URL_LOAD,
delete_files_before: 'delete_files_before',
delete_records_before: 'delete_records_before',
delete_audit_logs_before: 'delete_audit_logs_before',
delete_transaction_logs_before: 'delete_transaction_logs_before',
empty_trash: 'empty_trash',
export_local: 'export_local',
export_to_s3: 'export_to_s3',
import_from_s3: 'import_from_s3',
restart_service: 'restart_service',
} as const;
/** Specifies values for licenses */
export const LICENSE_VALUES = {
VERSION_DEFAULT: '2.2.0',
} as const;
/** The maximum ram allocation in MB per HDB child process */
export const RAM_ALLOCATION_ENUM = {
DEVELOPMENT: 8192, //8GB
DEFAULT: 512, //.5GB
} as const;
/** Common Node.js Error Codes */
export const NODE_ERROR_CODES = {
ENOENT: 'ENOENT', // No such file or directory.
EACCES: 'EACCES', // Permission denied.
EEXIST: 'EEXIST', // File already exists.
ERR_INVALID_ARG_TYPE: 'ERR_INVALID_ARG_TYPE',
} as const;
// TODO: Wherever this is used, replace this with a private property
/** Symbol for metadata */
export const METADATA_PROPERTY = Symbol('metadata');
const CREATED_TIME = '__createdtime__';
const UPDATED_TIME = '__updatedtime__';
/** Timestamp keys */
export const TIME_STAMP_NAMES_ENUM = {
CREATED_TIME,
UPDATED_TIME,
} as const;
/** Timestamp values */
export const TIME_STAMP_NAMES = [CREATED_TIME, UPDATED_TIME] as const;
/**
* This value is used to help evaluate whether or not a permissions translation error is related to old permissions values or if it could be another code-related bug/error.
*/
export const PERMS_UPDATE_RELEASE_TIMESTAMP = 1598486400000;
/** Search comparator value strings */
export const VALUE_SEARCH_COMPARATORS = {
LESS: '<',
LESS_OR_EQ: '<=',
GREATER: '>',
GREATER_OR_EQ: '>=',
BETWEEN: '...',
} as const;
/** Inverted form of VALUE_SEARCH_COMPARATORS */
export const VALUE_SEARCH_COMPARATORS_REVERSE_LOOKUP = {
'<': 'LESS',
'<=': 'LESS_OR_EQ',
'>': 'GREATER',
'>=': 'GREATER_OR_EQ',
'...': 'BETWEEN',
} as const;
/** Standard CRUD operation map */
export const PERMS_CRUD_ENUM = {
READ: 'read',
INSERT: 'insert',
UPDATE: 'update',
DELETE: 'delete',
} as const;
/** Search wildcards */
export const SEARCH_WILDCARDS = ['*', '%'] as const;
/** Function value used in data layer and SQL transactions */
export const FUNC_VAL = 'func_val';
/** Audit log search types for read operation */
export const READ_AUDIT_LOG_SEARCH_TYPES_ENUM = {
HASH_VALUE: 'hash_value',
TIMESTAMP: 'timestamp',
USERNAME: 'username',
} as const;
/** JWT key and pass file names */
export const JWT_ENUM = {
JWT_PRIVATE_KEY_NAME: '.jwtPrivate.key',
JWT_PUBLIC_KEY_NAME: '.jwtPublic.key',
JWT_PASSPHRASE_NAME: '.jwtPass',
} as const;
/** ITC Channel Event types */
export const ITC_EVENT_TYPES = {
SHUTDOWN: 'shutdown',
CHILD_STARTED: 'child_started',
CHILD_STOPPED: 'child_stopped',
SCHEMA: 'schema',
USER: 'user',
METRICS: 'metrics',
GET_METRICS: 'get_metrics',
RESTART: 'restart',
START_JOB: 'start_job',
COMPONENT_STATUS_REQUEST: 'component_status_request',
COMPONENT_STATUS_RESPONSE: 'component_status_response',
RESOURCE_OPENAPI_REQUEST: 'resource_openapi_request',
RESOURCE_OPENAPI_RESPONSE: 'resource_openapi_response',
} as const;
/** Supported thread types */
export const THREAD_TYPES = {
HTTP: 'http',
} as const;
/** A version string for pre 4.0.0 comparison */
export const PRE_4_0_0_VERSION = '3.x.x';
/** Authentication audit statusses */
export const AUTH_AUDIT_STATUS = {
SUCCESS: 'success',
FAILURE: 'failure',
} as const;
/** Authentication audit types */
export const AUTH_AUDIT_TYPES = {
AUTHENTICATION: 'authentication',
AUTHORIZATION: 'authorization',
} as const;