harperdb 4.5.0-alpha.2 → 4.5.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- "use strict";var Se=Object.defineProperty;var r=(t,_)=>Se(t,"name",{value:_,configurable:!0});var P=(t,_)=>()=>(_||t((_={exports:{}}).exports,_),_.exports);var B=P((S_,$)=>{var g=require("node:path"),ce=require("node:fs");function ae(){let t=__dirname;for(;!ce.existsSync(g.join(t,"package.json"));){let _=g.dirname(t);if(_===t)throw new Error("Could not find package root");t=_}return t}r(ae,"getHDBPackageRoot");var M=ae(),Re="harperdb-config.yaml",Oe="defaultConfig.yaml",Ae="hdb",le="config.yaml",Ne="harperdb.js",Ie="restartHdb.js",V="HarperDB",y="Custom Functions",F="Clustering Hub",v="Clustering Leaf",ue="Clustering Ingest Service",de="Clustering Reply Service",Ce={HDB:V,CLUSTERING_HUB:F,CLUSTERING_LEAF:v,CLUSTERING_INGEST_SERVICE:ue,CLUSTERING_REPLY_SERVICE:de,CUSTOM_FUNCTIONS:y,RESTART_HDB:"Restart HDB",INSTALL:"Install",RUN:"Run",STOP:"Stop",UPGRADE:"Upgrade",REGISTER:"Register",JOB:"Job",CLUSTERING_UPGRADE_4_0_0:"Upgrade-4-0-0"},pe={harperdb:V,"clustering hub":F,"clustering leaf":v,"custom functions":y,custom_functions:y,clustering:"clustering","clustering config":"clustering config",clustering_config:"clustering_config",http_workers:"http_workers",http:"http"},Le={CLUSTERING_HUB_PROC_DESCRIPTOR:F,CLUSTERING_LEAF_PROC_DESCRIPTOR:v},me="hdb.pid",Ue="data",Pe={HDB:"hdb.log",INSTALL:"install.log",CLUSTERING_HUB:"clustering_hub.log",CLUSTERING_LEAF:"clustering_leaf.log"},ge={NOTIFY:"notify",FATAL:"fatal",ERROR:"error",WARN:"warn",INFO:"info",DEBUG:"debug",TRACE:"trace"},he={MAIN:"bin/harperdb.js",NATS_INGEST_SERVICE:g.join(M,"launchServiceScripts/launchNatsIngestService.js"),NATS_REPLY_SERVICE:g.join(M,"launchServiceScripts/launchNatsReplyService.js"),NODES_UPGRADE_4_0_0:g.join(M,"launchServiceScripts/launchUpdateNodes4-0-0.js")},De={SUPER_USER:"super_user",CLUSTER_USER:"cluster_user"},Y="support@harperdb.io",Ge=`For support, please submit a request at https://harperdbhelp.zendesk.com/hc/en-us/requests/new or contact ${Y}`,Me="None of the specified records were found.",fe="U+002E",He=/\//g,be="U+002F",ye=/U\+002F/g,Fe="--max-old-space-size=",ve="system",Be=".harperdb",Ke="keys",ke="hdb_boot_properties.file",we=6e4,Ve=448,Ye="database",je="schema",We="transactions",xe="PROCESS_NAME",j={SETTINGS_PATH_KEY:"settings_path"},qe={TC_AGREEMENT:"TC_AGREEMENT",CLUSTERING_USER:"CLUSTERING_USER",CLUSTERING_PASSWORD:"CLUSTERING_PASSWORD",HDB_ADMIN_USERNAME:"HDB_ADMIN_USERNAME",HDB_ADMIN_PASSWORD:"HDB_ADMIN_PASSWORD",OPERATIONSAPI_ROOT:"OPERATIONSAPI_ROOT",ROOTPATH:"ROOTPATH",CLUSTERING_NODENAME:"CLUSTERING_NODENAME",CLUSTERING_ENABLED:"CLUSTERING_ENABLED",HDB_CONFIG:"HDB_CONFIG",DEFAULTS_MODE:"DEFAULTS_MODE",REPLICATION_HOSTNAME:"REPLICATION_HOSTNAME",CLUSTERING_PORT:"CLUSTERING_PORT",HDB_ROOT:"HDB_ROOT",SERVER_PORT:"SERVER_PORT",NODE_NAME:"NODE_NAME",CLUSTERING:"CLUSTERING"},$e=250,Xe={DATA_VERSION:"data_version",UPGRADE_VERSION:"upgrade_version"},ze={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"},Qe="info_id",Je={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"},Ze="060493.ks",et=".license",tt={CREATED:"CREATED",IN_PROGRESS:"IN_PROGRESS",COMPLETE:"COMPLETE",ERROR:"ERROR"},n={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",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",GET_FINGERPRINT:"get_fingerprint",SET_LICENSE:"set_license",GET_REGISTRATION_INFO:"registration_info",CONFIGURE_CLUSTER:"configure_cluster",SET_CONFIGURATION:"set_configuration",CLUSTER_STATUS:"cluster_status",CLUSTER_NETWORK:"cluster_network",DROP_ATTRIBUTE:"drop_attribute",REMOVE_NODE:"remove_node",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",CLUSTER_SET_ROUTES:"cluster_set_routes",CLUSTER_DELETE_ROUTES:"cluster_delete_routes",CLUSTER_GET_ROUTES:"cluster_get_routes",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",SIGN_CERTIFICATE:"sign_certificate",CREATE_CSR:"create_csr",LIST_CERTIFICATES:"list_certificates",ADD_CERTIFICATES:"add_certificate",REMOVE_CERTIFICATE:"remove_certificate",ADD_NODE_BACK:"add_node_back",REMOVE_NODE_BACK:"remove_node_back",ADD_SSH_KEY:"add_ssh_key",UPDATE_SSH_KEY:"update_ssh_key",DELETE_SSH_KEY:"delete_ssh_key",LIST_SSH_KEYS:"list_ssh_keys",SET_SSH_KNOWN_HOSTS:"set_ssh_known_hosts",GET_SSH_KNOWN_HOSTS:"get_ssh_known_hosts",GET_KEY:"get_key"},_t={CSV:".csv",JSON:".json"},Et={AWS_ACCESS_KEY:"aws_access_key_id",AWS_SECRET:"aws_secret_access_key",AWS_BUCKET:"bucket",AWS_FILE_KEY:"key",REGION:"region"},st={SELECT:"select",INSERT:"insert",UPDATE:"update",DELETE:"delete"},ot={[n.INSERT]:n.INSERT,[n.UPDATE]:n.UPDATE,[n.UPSERT]:n.UPSERT,[n.DELETE]:n.DELETE},Tt={DEV:"dev",RUN:"run",START:"start",INSTALL:"install",REGISTER:"register",STOP:"stop",RESTART:"restart",VERSION:"version",UPGRADE:"upgrade",HELP:"help",STATUS:"status",OPERATION:"operation",RENEWCERTS:"renew-certs",COPYDB:"copy-db"},rt={point:"point",lineString:"lineString",multiLineString:"multiLineString",multiPoint:"multiPoint",multiPolygon:"multiPolygon",polygon:"polygon"},nt={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",CLUSTERING_PORT_KEY:"CLUSTERING_PORT",CLUSTERING_NODE_NAME_KEY:"NODE_NAME",CLUSTERING_ENABLED_KEY:"CLUSTERING",ALLOW_SELF_SIGNED_SSL_CERTS:"ALLOW_SELF_SIGNED_SSL_CERTS",MAX_HDB_PROCESSES:"MAX_HDB_PROCESSES",INSTALL_USER:"install_user",CLUSTERING_USER_KEY:"CLUSTERING_USER",MAX_CLUSTERING_PROCESSES:"MAX_CLUSTERING_PROCESSES",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"},it={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"},e={ANALYTICS_AGGREGATEPERIOD:"analytics_aggregatePeriod",AUTHENTICATION_AUTHORIZELOCAL:"authentication_authorizeLocal",AUTHENTICATION_CACHETTL:"authentication_cacheTTL",AUTHENTICATION_ENABLESESSIONS:"authentication_enableSessions",AUTHENTICATION_OPERATIONTOKENTIMEOUT:"authentication_operationTokenTimeout",AUTHENTICATION_REFRESHTOKENTIMEOUT:"authentication_refreshTokenTimeout",AUTHENTICATION_HASHFUNCTION:"authentication_hashFunction",CLUSTERING_USER:"clustering_user",CLUSTERING_ENABLED:"clustering_enabled",CLUSTERING_HUBSERVER_CLUSTER_NAME:"clustering_hubServer_cluster_name",CLUSTERING_HUBSERVER_CLUSTER_NETWORK_PORT:"clustering_hubServer_cluster_network_port",CLUSTERING_HUBSERVER_CLUSTER_NETWORK_ROUTES:"clustering_hubServer_cluster_network_routes",CLUSTERING_HUBSERVER_LEAFNODES_NETWORK_PORT:"clustering_hubServer_leafNodes_network_port",CLUSTERING_HUBSERVER_NETWORK_PORT:"clustering_hubServer_network_port",CLUSTERING_LEAFSERVER_NETWORK_PORT:"clustering_leafServer_network_port",CLUSTERING_LEAFSERVER_NETWORK_ROUTES:"clustering_leafServer_network_routes",CLUSTERING_LEAFSERVER_STREAMS_MAXAGE:"clustering_leafServer_streams_maxAge",CLUSTERING_LEAFSERVER_STREAMS_MAXBYTES:"clustering_leafServer_streams_maxBytes",CLUSTERING_LEAFSERVER_STREAMS_MAXMSGS:"clustering_leafServer_streams_maxMsgs",CLUSTERING_LEAFSERVER_STREAMS_MAXCONSUMEMSGS:"clustering_leafServer_streams_maxConsumeMsgs",CLUSTERING_LEAFSERVER_STREAMS_MAXINGESTTHREADS:"clustering_leafServer_streams_maxIngestThreads",CLUSTERING_LEAFSERVER_STREAMS_PATH:"clustering_leafServer_streams_path",CLUSTERING_NODENAME:"clustering_nodeName",CLUSTERING_TLS_CERTIFICATE:"clustering_tls_certificate",CLUSTERING_TLS_PRIVATEKEY:"clustering_tls_privateKey",CLUSTERING_TLS_CERT_AUTH:"clustering_tls_certificateAuthority",CLUSTERING_TLS_INSECURE:"clustering_tls_insecure",CLUSTERING_TLS_VERIFY:"clustering_tls_verify",CLUSTERING_LOGLEVEL:"clustering_logLevel",CLUSTERING_REPUBLISHMESSAGES:"clustering_republishMessages",CLUSTERING_DATABASELEVEL:"clustering_databaseLevel",CUSTOMFUNCTIONS_NETWORK_HTTPS:"customFunctions_network_https",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",HTTP_SESSIONAFFINITY:"http_sessionAffinity",HTTP_COMPRESSIONTHRESHOLD:"http_compressionThreshold",HTTP_CORS:"http_cors",HTTP_CORSACCESSLIST:"http_corsAccessList",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_MAXHEADERSIZE:"http_maxHeaderSize",HTTP_THREADRANGE:"http_threadRange",HTTP_HTTP2:"http_http2",LOCALSTUDIO_ENABLED:"localStudio_enabled",LOGGING_CONSOLE:"logging_console",LOGGING_FILE:"logging_file",LOGGING_LEVEL:"logging_level",LOGGING_ROOT:"logging_root",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_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_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",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_COPYTABLESTOCATCHUP:"replication_copyTablesToCatchUp",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_PREFETCHWRITES:"storage_prefetchWrites",STORAGE_ENCRYPTION:"storage_encryption",STORAGE_MAXTRANSACTIONQUEUETIME:"storage_maxTransactionQueueTime",STORAGE_PATH:"storage_path",STORAGE_BLOBPATHS:"storage_blobPaths",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",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:"tls",CLONED:"cloned"},W={settings_path:j.SETTINGS_PATH_KEY,hdb_root_key:e.ROOTPATH,hdb_root:e.ROOTPATH,rootpath:e.ROOTPATH,server_port_key:e.OPERATIONSAPI_NETWORK_PORT,server_port:e.OPERATIONSAPI_NETWORK_PORT,cert_key:e.TLS_CERTIFICATE,certificate:e.TLS_CERTIFICATE,private_key_key:e.TLS_PRIVATEKEY,private_key:e.TLS_PRIVATEKEY,http_secure_enabled_key:e.OPERATIONSAPI_NETWORK_HTTPS,https_on:e.OPERATIONSAPI_NETWORK_HTTPS,cors_enabled_key:e.OPERATIONSAPI_NETWORK_CORS,cors_on:e.OPERATIONSAPI_NETWORK_CORS,cors_whitelist_key:e.OPERATIONSAPI_NETWORK_CORSACCESSLIST,cors_whitelist:e.OPERATIONSAPI_NETWORK_CORSACCESSLIST,cors_accesslist_key:e.OPERATIONSAPI_NETWORK_CORSACCESSLIST,cors_accesslist:e.OPERATIONSAPI_NETWORK_CORSACCESSLIST,log_level_key:e.LOGGING_LEVEL,log_level:e.LOGGING_LEVEL,log_path_key:e.LOGGING_ROOT,log_path:e.LOGGING_ROOT,clustering_node_name_key:e.CLUSTERING_NODENAME,node_name:e.CLUSTERING_NODENAME,clustering_enabled_key:e.CLUSTERING_ENABLED,clustering:e.CLUSTERING_ENABLED,max_http_threads:e.THREADS_COUNT,max_hdb_processes:e.THREADS_COUNT,server_timeout_key:e.OPERATIONSAPI_NETWORK_TIMEOUT,server_timeout_ms:e.OPERATIONSAPI_NETWORK_TIMEOUT,server_keep_alive_timeout_key:e.OPERATIONSAPI_NETWORK_KEEPALIVETIMEOUT,server_keep_alive_timeout:e.OPERATIONSAPI_NETWORK_KEEPALIVETIMEOUT,server_headers_timeout_key:e.OPERATIONSAPI_NETWORK_HEADERSTIMEOUT,server_headers_timeout:e.OPERATIONSAPI_NETWORK_HEADERSTIMEOUT,disable_transaction_log_key:e.LOGGING_AUDITLOG,disable_transaction_log:e.LOGGING_AUDITLOG,operation_token_timeout_key:e.AUTHENTICATION_OPERATIONTOKENTIMEOUT,operation_token_timeout:e.AUTHENTICATION_OPERATIONTOKENTIMEOUT,refresh_token_timeout_key:e.AUTHENTICATION_REFRESHTOKENTIMEOUT,refresh_token_timeout:e.AUTHENTICATION_REFRESHTOKENTIMEOUT,custom_functions_port_key:e.HTTP_PORT,custom_functions_port:e.HTTP_PORT,custom_functions_directory_key:e.COMPONENTSROOT,custom_functions_directory:e.COMPONENTSROOT,max_custom_function_processes:e.THREADS_COUNT,logging_console:e.LOGGING_CONSOLE,log_to_file:e.LOGGING_FILE,log_to_stdstreams:e.LOGGING_STDSTREAMS,local_studio_on:e.LOCALSTUDIO_ENABLED,clustering_port:e.CLUSTERING_HUBSERVER_CLUSTER_NETWORK_PORT,clustering_user:e.CLUSTERING_USER,customfunctions_network_port:e.HTTP_PORT,customfunctions_tls_certificate:e.TLS_CERTIFICATE,customfunctions_network_cors:e.HTTP_CORS,customfunctions_network_corsaccesslist:e.HTTP_CORSACCESSLIST,customfunctions_network_headerstimeout:e.HTTP_HEADERSTIMEOUT,customfunctions_network_https:e.CUSTOMFUNCTIONS_NETWORK_HTTPS,customfunctions_network_keepalivetimeout:e.HTTP_KEEPALIVETIMEOUT,customfunctions_tls_privatekey:e.TLS_PRIVATEKEY,customfunctions_tls_certificateauthority:e.TLS_CERTIFICATEAUTHORITY,customfunctions_network_timeout:e.HTTP_TIMEOUT,customfunctions_tls:e.TLS,http_threads:e.THREADS_COUNT,threads:e.THREADS_COUNT,threads_count:e.THREADS_COUNT,customfunctions_processes:e.THREADS_COUNT,customfunctions_root:e.COMPONENTSROOT,operationsapi_root:e.ROOTPATH};for(let t in e){let _=e[t];W[_.toLowerCase()]=_}var St={TABLES:"tables",PATH:"path",AUDIT_PATH:"auditPath"},ct={csv_file_load:"csv_file_load",csv_data_load:n.CSV_DATA_LOAD,csv_url_load:n.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"},at={CLUSTERING_PAYLOAD:"clustering_payload",DELEGATE_THREAD_RESPONSE:"delegate_thread_response",CLUSTERING:"clustering",SCHEMA:"schema",CLUSTER_STATUS:"cluster_status",JOB:"job",CHILD_STARTED:"child_started",CHILD_STOPPED:"child_stopped",USER:"user",RESTART:"restart"},Rt={VERSION_DEFAULT:"2.2.0"},Ot={DEVELOPMENT:8192,DEFAULT:512},At={ENOENT:"ENOENT",EACCES:"EACCES",EEXIST:"EEXIST",ERR_INVALID_ARG_TYPE:"ERR_INVALID_ARG_TYPE"},lt=Symbol("metadata"),Nt="__clustering__",x="__createdtime__",q="__updatedtime__",It={CREATED_TIME:x,UPDATED_TIME:q},ut=[x,q],dt=15984864e5,Ct={LESS:"<",LESS_OR_EQ:"<=",GREATER:">",GREATER_OR_EQ:">=",BETWEEN:"..."},pt={"<":"LESS","<=":"LESS_OR_EQ",">":"GREATER",">=":"GREATER_OR_EQ","...":"BETWEEN"},Lt={READ:"read",INSERT:"insert",UPDATE:"update",DELETE:"delete"},mt=["*","%"],Ut="func_val",Pt={HASH_VALUE:"hash_value",TIMESTAMP:"timestamp",USERNAME:"username"},gt={JWT_PRIVATE_KEY_NAME:".jwtPrivate.key",JWT_PUBLIC_KEY_NAME:".jwtPublic.key",JWT_PASSPHRASE_NAME:".jwtPass"},ht={SHUTDOWN:"shutdown",CHILD_STARTED:"child_started",CHILD_STOPPED:"child_stopped",SCHEMA:"schema",USER:"user",CLUSTER_STATUS_RESPONSE:"cluster_status_response",CLUSTER_STATUS_REQUEST:"cluster_status_request",METRICS:"metrics",GET_METRICS:"get_metrics",RESTART:"restart",START_JOB:"start_job",NATS_CONSUMER_UPDATE:"nats_consumer_update"},Dt={HTTP:"http"},Gt="3.x.x",Mt={SUCCESS:"success",FAILURE:"failure"},ft={AUTHENTICATION:"authentication",AUTHORIZATION:"authorization"};$.exports={PACKAGE_ROOT:M,HDB_CONFIG_FILE:Re,HDB_DEFAULT_CONFIG_FILE:Oe,HDB_ROOT_DIR_NAME:Ae,HDB_COMPONENT_CONFIG_FILE:le,HDB_PROC_NAME:Ne,HDB_RESTART_SCRIPT:Ie,PROCESS_DESCRIPTORS:Ce,HDB_PROCESS_SERVICES:pe,CLUSTERING_PROCESSES:Le,HDB_PID_FILE:me,DEFAULT_DATABASE_NAME:Ue,LOG_NAMES:Pe,LOG_LEVELS:ge,LAUNCH_SERVICE_SCRIPTS:he,ROLE_TYPES_ENUM:De,HDB_SUPPORT_ADDRESS:Y,SUPPORT_HELP_MSG:Ge,SEARCH_NOT_FOUND_MESSAGE:Me,UNICODE_PERIOD:fe,FORWARD_SLASH_REGEX:He,UNICODE_FORWARD_SLASH:be,ESCAPED_FORWARD_SLASH_REGEX:ye,MEM_SETTING_KEY:Fe,SYSTEM_SCHEMA_NAME:ve,HDB_HOME_DIR_NAME:Be,LICENSE_KEY_DIR_NAME:Ke,BOOT_PROPS_FILE_NAME:ke,RESTART_TIMEOUT_MS:we,HDB_FILE_PERMISSIONS:Ve,DATABASES_DIR_NAME:Ye,LEGACY_DATABASES_DIR_NAME:je,TRANSACTIONS_DIR_NAME:We,PROCESS_NAME_ENV_PROP:xe,BOOT_PROP_PARAMS:j,INSTALL_PROMPTS:qe,INSERT_MAX_CHARACTER_SIZE:$e,UPGRADE_JSON_FIELD_NAMES_ENUM:Xe,SYSTEM_TABLE_NAMES:ze,INFO_TABLE_HASH_ATTRIBUTE:Qe,SYSTEM_DEFAULT_ATTRIBUTE_NAMES:Je,REG_KEY_FILE_NAME:Ze,LICENSE_FILE_NAME:et,JOB_STATUS_ENUM:tt,OPERATIONS_ENUM:n,VALID_S3_FILE_TYPES:_t,S3_BUCKET_AUTH_KEYS:Et,VALID_SQL_OPS_ENUM:st,CLUSTER_OPERATIONS:ot,SERVICE_ACTIONS_ENUM:Tt,GEO_CONVERSION_ENUM:rt,HDB_SETTINGS_NAMES:nt,LEGACY_CONFIG_PARAMS:it,CONFIG_PARAMS:e,CONFIG_PARAM_MAP:W,DATABASES_PARAM_CONFIG:St,JOB_TYPE_ENUM:ct,CLUSTER_MESSAGE_TYPE_ENUM:at,LICENSE_VALUES:Rt,RAM_ALLOCATION_ENUM:Ot,NODE_ERROR_CODES:At,METADATA_PROPERTY:lt,CLUSTERING_FLAG:Nt,TIME_STAMP_NAMES_ENUM:It,TIME_STAMP_NAMES:ut,PERMS_UPDATE_RELEASE_TIMESTAMP:dt,VALUE_SEARCH_COMPARATORS:Ct,VALUE_SEARCH_COMPARATORS_REVERSE_LOOKUP:pt,PERMS_CRUD_ENUM:Lt,SEARCH_WILDCARDS:mt,FUNC_VAL:Ut,READ_AUDIT_LOG_SEARCH_TYPES_ENUM:Pt,JWT_ENUM:gt,ITC_EVENT_TYPES:ht,THREAD_TYPES:Dt,PRE_4_0_0_VERSION:Gt,AUTH_AUDIT_STATUS:Mt,AUTH_AUDIT_TYPES:ft}});var z=P((a_,X)=>{if(__filename.endsWith("dev.js")){let t=require("fast-glob"),{tmpdir:_}=require("node:os"),{relative:E,join:o}=require("node:path"),{existsSync:l,statSync:N,readFileSync:p,writeFileSync:b}=require("node:fs"),{isMainThread:G}=require("node:worker_threads"),{spawnSync:L,spawn:m}=require("node:child_process"),{PACKAGE_ROOT:i}=B(),ne=["bin","components","dataLayer","resources","server","sqlTranslator","upgrade","utility","validation"],U="ts-build";if(G){let I=!1,O=!1;if((O=l(o(i,U)))?I=t.sync(ne.map(T=>`${T}/**/*.ts`),{cwd:i}).some(T=>{let S=0,c=0;try{S=N(o(i,T)).mtimeMs-5e3,c=N(o(i,U,T.replace(/.ts$/,".js"))).mtimeMs}catch{}return S>c}):I=!0,I){console.log("Compiling TypeScript...");let T=L("npx",["tsc"],{cwd:i});if(T.stdout?.length&&console.log(T.stdout.toString()),T.stderr?.length&&console.log(T.stderr.toString()),O){let S=o(_(),"harperdb-tsc.pid"),c=!1;if(l(S))try{process.kill(+p(S,"utf8"),0),c=!0}catch{}if(!c){console.log("Starting background TypeScript compilation...");let a=m("npx",["tsc","--watch"],{detached:!0,cwd:i,stdio:"ignore"});b(S,a.pid.toString()),a.unref()}}}}let k=X.constructor,ie=k._findPath;k._findPath=function(I,O,T){if(I.startsWith(".")&&!T&&O.length===1&&O[0].startsWith(i)&&!O[0].includes("node_modules")){let S=E(i,O[0]),c;S.startsWith(U)?c=o(i,E(U,S)):c=o(i,U,S);let a=o(c,I),w=a+".js";if(l(w))return w;if(a.includes(".")&&l(a))return a}return ie(I,O,T)}}});var Z=P((O_,J)=>{"use strict";var{platform:R_}=require("os"),Ht="nats-server.zip",K="nats-server",bt=process.platform==="win32"?`${K}.exe`:K,yt=/^[^\s.,*>]+$/,Q="__request__",Ft=r(t=>`${t}.${Q}`,"REQUEST_SUBJECT"),vt={NATS_MSG_ID:"Nats-Msg-Id",ORIGIN:"origin",TRANSACTED_NODES:"transacted_nodes"},Bt={HUB_SERVER:"hub.json",LEAF_SERVER:"leaf.json"},Kt={HUB:"hub.pid",LEAF:"leaf.pid"},kt={HUB:"-hub",LEAF:"-leaf",ADMIN:"-admin"},wt={SUCCESS:"success",ERROR:"error"},Vt={OPEN:"open",CLOSED:"closed",NO_RESPONDERS:"NoResponders",TIMEOUT:"Timeout"},Yt={TXN:"txn",MSGID:"msgid"},C={ERR:"error",WRN:"warn",INF:"info",DBG:"debug",TRC:"trace"},jt={[C.ERR]:1,[C.WRN]:2,[C.INF]:3,[C.DBG]:4,[C.TRC]:5},Wt={debug:"-D",trace:"-DVV"};J.exports={NATS_SERVER_ZIP:Ht,NATS_SERVER_NAME:K,NATS_BINARY_NAME:bt,PID_FILES:Kt,NATS_CONFIG_FILES:Bt,SERVER_SUFFIX:kt,NATS_TERM_CONSTRAINTS_RX:yt,REQUEST_SUFFIX:Q,UPDATE_REMOTE_RESPONSE_STATUSES:wt,CLUSTER_STATUS_STATUSES:Vt,REQUEST_SUBJECT:Ft,SUBJECT_PREFIXES:Yt,MSG_HEADERS:vt,LOG_LEVELS:C,LOG_LEVEL_FLAGS:Wt,LOG_LEVEL_HIERARCHY:jt}});var ee=P((l_,xt)=>{xt.exports={name:"harperdb",version:"4.5.0-alpha.2",description:"HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.",keywords:["database","nosql","api","distributed","broker","mqtt","real-time","enterprise","Fastify","NATS","HarperDB","Harper","clustering","replication","REST","WebSockets","decentralized","server-sent events","document store"],main:"harperdb.js",bin:{harperdb:"./bin/harperdb.js"},engines:{"minimum-node":"16.0.0","go-lang":"1.21.7","nats-server":"2.10.11"},exports:{".":"./index.js"},homepage:"https://www.harperdb.io/",bugs:"support@harperdb.io",author:{name:"HarperDB",email:"support@harperdb.io"},license:"SEE LICENSE IN LICENSE",scripts:{submodules:"git submodule update --init --recursive","cover:test":"pm2 kill && rimraf ./.nyc_output/* && node utility/devops/register.js --reset_license && nyc --no-clean --reporter=lcovonly npm run test:replication && nyc --no-clean --reporter=lcovonly npm run test:apitests && nyc --no-clean --reporter=lcovonly npm run test:resources && nyc --no-clean --reporter=lcovonly npm run test:logging && nyc --no-clean --reporter=lcovonly npm run test:upgrade && nyc --no-clean --reporter=lcovonly npm run test:nats && nyc --no-clean --reporter=lcovonly npm run test:cfserver && nyc --no-clean --reporter=lcovonly npm run test:hdbserver && nyc --no-clean --reporter=lcovonly npm run test:bin && nyc --no-clean --reporter=lcovonly npm run test:main && nyc --no-clean --reporter=lcovonly npm run test:security && nyc merge .nyc_output coverage.json && node ./utility/devops/register.js --reset_license",test:"pm2 kill && rimraf ./.nyc_output/* && node utility/devops/register.js --reset_license && npm run test:replication && npm run test:apitests && npm run test:resources && npm run test:logging && npm run test:upgrade && npm run test:nats && npm run test:cfserver && npm run test:hdbserver && npm run test:bin && npm run test:main && npm run test:security && nyc merge .nyc_output coverage.json && node ./utility/devops/register.js --reset_license","test:resources":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/resources/**/*.js' --config '../unitTests/.mocharc.json'","test:bin":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/bin/**/*.js' --config '../unitTests/.mocharc.json'","test:main":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/**/*.js' --config '../unitTests/.mocharc-main.json'","test:lmdbbridge":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/dataLayer/harperBridge/lmdbBridge/**/*.js' --config '../unitTests/.mocharc.json'","test:lmdbutility":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/utility/lmdb/**/*.js' --config '../unitTests/.mocharc.json'","test:hdbserver":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/server/harperdb/hdbServer-test.js' --config '../unitTests/.mocharc.json'","test:cfserver":"npm run submodules && cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/server/fastifyRoutes/customFunctionsServer-test.js' --config '../unitTests/.mocharc.json'","test:nats":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/server/nats/**/*.js' --config '../unitTests/.mocharc.json'","test:upgrade":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/upgrade/**/*.js' --config '../unitTests/.mocharc.json'","test:apitests":"pm2 kill && cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/apiTests/**/*-test.mjs' --config '../unitTests/.mocharc.json'","test:logging":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/utility/logging/*.js' --config '../unitTests/.mocharc.json'","test:ci":" cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/**/*.js' --retries 3 --config '../unitTests/.mocharc-main.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/dataLayer/harperBridge/lmdbBridge/**/*.js' --parallel --retries 3 --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/utility/lmdb/**/*.js' --parallel --retries 3 --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/server/harperdb/hdbServer-test.js' --parallel --retries 3 --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/server/customFunctions/customFunctionsServer-test.js' --parallel --retries 3 --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/upgrade/**/*.js' --parallel --retries 3 --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/server/nats/**/*.js' --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter","test:security":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/security/**/*.js' --config '../unitTests/.mocharc.json'","test:replication":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/server/replication/**/*.js' --config '../unitTests/.mocharc.json'","hdb-check":"./utility/devops/hdb-check.sh","download-prebuilds":"node ./utility/devops/build/download-prebuilds.js",prebuild:"date",postinstall:"node ./launchServiceScripts/launchInstallNATSServer.js",build_nats_dependency:"node ./utility/devops/nats/builder.js",coverage:"nyc --reporter=lcov npm test",format:"prettier .","format:fix":"npm run format -- --write",lint:"eslint .","lint:fix":"npm run lint -- --fix","cluster:local":"docker compose -f utility/dev/docker-compose.yml --project-directory . build && docker compose -f utility/dev/docker-compose.yml --project-directory . up","cluster:latest":"docker compose -f utility/dev/docker-compose.yml --project-directory . pull && docker compose -f utility/dev/docker-compose.yml --project-directory . up"},dependencies:{"@aws-sdk/client-s3":"3.717.0","@aws-sdk/lib-storage":"3.717.0","@endo/static-module-record":"^1.0.4","@fastify/autoload":"5.10.0","@fastify/compress":"~6.5.0","@fastify/cors":"~9.0.1","@fastify/static":"~7.0.4","@turf/area":"6.5.0","@turf/boolean-contains":"6.5.0","@turf/boolean-disjoint":"6.5.0","@turf/boolean-equal":"6.5.0","@turf/circle":"6.5.0","@turf/difference":"6.5.0","@turf/distance":"6.5.0","@turf/helpers":"6.5.0","@turf/length":"6.5.0",alasql:"4.1.10",argon2:"0.41.1","cbor-x":"1.6.0",chalk:"4.1.2","cli-progress":"3.12.0",clone:"2.1.2","fast-glob":"3.3.2",fastify:"~4.29.0","fastify-plugin":"~4.5.1","fs-extra":"11.2.0",graphql:"^16.10.0","gunzip-maybe":"1.4.2","human-readable-ids":"1.0.4",inquirer:"8.2.6","is-number":"7.0.0",joi:"17.12.2","json-bigint-fixes":"1.1.0",json2csv:"5.0.7",jsonata:"1.8.7",jsonwebtoken:"9.0.2",lmdb:"3.2.5",lodash:"4.17.21",mathjs:"11.12.0",minimist:"1.2.8",moment:"2.30.1","mqtt-packet":"~9.0.0",msgpackr:"1.11.2",nats:"2.19.0",needle:"3.3.1","node-forge":"^1.3.1","node-stream-zip":"1.15.0","node-unix-socket":"0.2.5","normalize-path":"^3.0.0",ora:"5.4.1","ordered-binary":"1.5.3",papaparse:"5.4.1",passport:"0.6.0","passport-http":"0.3.0","passport-local":"1.0.0",pino:"8.16.0",pm2:"5.4.1",prompt:"1.3.0","properties-reader":"2.3.0","recursive-iterator":"3.3.0",semver:"7.5.4",send:"^1.1.0","serve-static":"2.1.0",ses:"1.1.0","stream-chain":"2.2.5","stream-json":"1.8.0",systeminformation:"5.24.5","tar-fs":"3.0.6",ulidx:"0.5.0",uuid:"10.0.0","validate.js":"0.13.1",ws:"8.18.0",yaml:"2.7.0"},devDependencies:{"@tsconfig/node16":"^1.0.3","@types/node":"20.14.8","@typescript-eslint/eslint-plugin":"^7.18.0","@typescript-eslint/parser":"^7.18.0",axios:"1.7.5",chai:"4.4.1","chai-as-promised":"7.1.1","chai-integer":"0.1.0",esbuild:"^0.24.2",eslint:"^8.57.1","eslint-config-prettier":"^9.1.0","eslint-plugin-sonarjs":"^3.0.1",eventsource:"^2.0.2","graphql-http":"^1.22.3","hook-std":"3.0.0","intercept-stdout":"0.1.2",mkcert:"1.5.1",mocha:"^11.0.1","mocha-teamcity-reporter":"^4.2.0","mock-require":"3.0.3","mock-stdin":"1.0.0",mqtt:"~4.3.8",newman:"6.1.3","node-fetch":"2.6.7",nyc:"15.1.0",prettier:"3.3.3",rewire:"5.0.0",rimraf:"3.0.2",sinon:"10.0.0","sinon-chai":"3.7.0","source-map-support":"^0.5.21",typescript:"^5.7.2",undici:"^6.19.8","why-is-node-still-running":"^1.0.0"},overrides:{alasql:{xlsx:"0.18.5"}},optionalDependencies:{bufferutil:"^4.0.7","segfault-handler":"^1.3.0","utf-8-validate":"^5.0.10"}}});var re=P((N_,Te)=>{"use strict";var u=require("fs-extra"),A=require("path"),s=require("chalk"),qt=require("needle"),te=require("node-stream-zip"),_e=require("semver"),d=Z(),$t=require("util"),Xt=require("child_process"),{platform:zt}=require("os"),Qt=$t.promisify(Xt.exec),{PACKAGE_ROOT:Jt}=B(),R=A.join(Jt,"dependencies"),Zt=A.join(R,d.NATS_SERVER_ZIP),Ee=ee(),f=Ee.engines["go-lang"],D=Ee.engines[d.NATS_SERVER_NAME],e_=`${process.platform}-${process.arch}`,H=A.join(R,e_,`${d.NATS_BINARY_NAME}`),t_=`https://github.com/nats-io/nats-server/releases/download/v${D}/nats-server-v${D}-`,se={"linux-x64":"linux-amd64.zip","linux-arm64":"linux-arm64.zip","darwin-x64":"darwin-amd64.zip","darwin-arm64":"darwin-arm64.zip","win32-x64":"windows-amd64.zip"},__=Object.keys(se).map(t=>t.split("-"));async function h(t,_=void 0){let{stdout:E,stderr:o}=await Qt(t,{cwd:_});if(o)throw new Error(o.replace(`
1
+ "use strict";var Se=Object.defineProperty;var r=(t,_)=>Se(t,"name",{value:_,configurable:!0});var P=(t,_)=>()=>(_||t((_={exports:{}}).exports,_),_.exports);var B=P((S_,$)=>{var g=require("node:path"),ce=require("node:fs");function ae(){let t=__dirname;for(;!ce.existsSync(g.join(t,"package.json"));){let _=g.dirname(t);if(_===t)throw new Error("Could not find package root");t=_}return t}r(ae,"getHDBPackageRoot");var M=ae(),Re="harperdb-config.yaml",Oe="defaultConfig.yaml",Ae="hdb",le="config.yaml",Ne="harperdb.js",Ie="restartHdb.js",V="HarperDB",y="Custom Functions",F="Clustering Hub",v="Clustering Leaf",ue="Clustering Ingest Service",de="Clustering Reply Service",Ce={HDB:V,CLUSTERING_HUB:F,CLUSTERING_LEAF:v,CLUSTERING_INGEST_SERVICE:ue,CLUSTERING_REPLY_SERVICE:de,CUSTOM_FUNCTIONS:y,RESTART_HDB:"Restart HDB",INSTALL:"Install",RUN:"Run",STOP:"Stop",UPGRADE:"Upgrade",REGISTER:"Register",JOB:"Job",CLUSTERING_UPGRADE_4_0_0:"Upgrade-4-0-0"},pe={harperdb:V,"clustering hub":F,"clustering leaf":v,"custom functions":y,custom_functions:y,clustering:"clustering","clustering config":"clustering config",clustering_config:"clustering_config",http_workers:"http_workers",http:"http"},Le={CLUSTERING_HUB_PROC_DESCRIPTOR:F,CLUSTERING_LEAF_PROC_DESCRIPTOR:v},me="hdb.pid",Ue="data",Pe={HDB:"hdb.log",INSTALL:"install.log",CLUSTERING_HUB:"clustering_hub.log",CLUSTERING_LEAF:"clustering_leaf.log"},ge={NOTIFY:"notify",FATAL:"fatal",ERROR:"error",WARN:"warn",INFO:"info",DEBUG:"debug",TRACE:"trace"},he={MAIN:"bin/harperdb.js",NATS_INGEST_SERVICE:g.join(M,"launchServiceScripts/launchNatsIngestService.js"),NATS_REPLY_SERVICE:g.join(M,"launchServiceScripts/launchNatsReplyService.js"),NODES_UPGRADE_4_0_0:g.join(M,"launchServiceScripts/launchUpdateNodes4-0-0.js")},De={SUPER_USER:"super_user",CLUSTER_USER:"cluster_user"},Y="support@harperdb.io",Ge=`For support, please submit a request at https://harperdbhelp.zendesk.com/hc/en-us/requests/new or contact ${Y}`,Me="None of the specified records were found.",fe="U+002E",He=/\//g,be="U+002F",ye=/U\+002F/g,Fe="--max-old-space-size=",ve="system",Be=".harperdb",Ke="keys",ke="hdb_boot_properties.file",we=6e4,Ve=448,Ye="database",je="schema",We="transactions",xe="PROCESS_NAME",j={SETTINGS_PATH_KEY:"settings_path"},qe={TC_AGREEMENT:"TC_AGREEMENT",CLUSTERING_USER:"CLUSTERING_USER",CLUSTERING_PASSWORD:"CLUSTERING_PASSWORD",HDB_ADMIN_USERNAME:"HDB_ADMIN_USERNAME",HDB_ADMIN_PASSWORD:"HDB_ADMIN_PASSWORD",OPERATIONSAPI_ROOT:"OPERATIONSAPI_ROOT",ROOTPATH:"ROOTPATH",CLUSTERING_NODENAME:"CLUSTERING_NODENAME",CLUSTERING_ENABLED:"CLUSTERING_ENABLED",HDB_CONFIG:"HDB_CONFIG",DEFAULTS_MODE:"DEFAULTS_MODE",REPLICATION_HOSTNAME:"REPLICATION_HOSTNAME",CLUSTERING_PORT:"CLUSTERING_PORT",HDB_ROOT:"HDB_ROOT",SERVER_PORT:"SERVER_PORT",NODE_NAME:"NODE_NAME",CLUSTERING:"CLUSTERING"},$e=250,Xe={DATA_VERSION:"data_version",UPGRADE_VERSION:"upgrade_version"},ze={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"},Qe="info_id",Je={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"},Ze="060493.ks",et=".license",tt={CREATED:"CREATED",IN_PROGRESS:"IN_PROGRESS",COMPLETE:"COMPLETE",ERROR:"ERROR"},n={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",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",GET_FINGERPRINT:"get_fingerprint",SET_LICENSE:"set_license",GET_REGISTRATION_INFO:"registration_info",CONFIGURE_CLUSTER:"configure_cluster",SET_CONFIGURATION:"set_configuration",CLUSTER_STATUS:"cluster_status",CLUSTER_NETWORK:"cluster_network",DROP_ATTRIBUTE:"drop_attribute",REMOVE_NODE:"remove_node",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",CLUSTER_SET_ROUTES:"cluster_set_routes",CLUSTER_DELETE_ROUTES:"cluster_delete_routes",CLUSTER_GET_ROUTES:"cluster_get_routes",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",SIGN_CERTIFICATE:"sign_certificate",CREATE_CSR:"create_csr",LIST_CERTIFICATES:"list_certificates",ADD_CERTIFICATES:"add_certificate",REMOVE_CERTIFICATE:"remove_certificate",ADD_NODE_BACK:"add_node_back",REMOVE_NODE_BACK:"remove_node_back",ADD_SSH_KEY:"add_ssh_key",UPDATE_SSH_KEY:"update_ssh_key",DELETE_SSH_KEY:"delete_ssh_key",LIST_SSH_KEYS:"list_ssh_keys",SET_SSH_KNOWN_HOSTS:"set_ssh_known_hosts",GET_SSH_KNOWN_HOSTS:"get_ssh_known_hosts",GET_KEY:"get_key"},_t={CSV:".csv",JSON:".json"},Et={AWS_ACCESS_KEY:"aws_access_key_id",AWS_SECRET:"aws_secret_access_key",AWS_BUCKET:"bucket",AWS_FILE_KEY:"key",REGION:"region"},st={SELECT:"select",INSERT:"insert",UPDATE:"update",DELETE:"delete"},ot={[n.INSERT]:n.INSERT,[n.UPDATE]:n.UPDATE,[n.UPSERT]:n.UPSERT,[n.DELETE]:n.DELETE},Tt={DEV:"dev",RUN:"run",START:"start",INSTALL:"install",REGISTER:"register",STOP:"stop",RESTART:"restart",VERSION:"version",UPGRADE:"upgrade",HELP:"help",STATUS:"status",OPERATION:"operation",RENEWCERTS:"renew-certs",COPYDB:"copy-db"},rt={point:"point",lineString:"lineString",multiLineString:"multiLineString",multiPoint:"multiPoint",multiPolygon:"multiPolygon",polygon:"polygon"},nt={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",CLUSTERING_PORT_KEY:"CLUSTERING_PORT",CLUSTERING_NODE_NAME_KEY:"NODE_NAME",CLUSTERING_ENABLED_KEY:"CLUSTERING",ALLOW_SELF_SIGNED_SSL_CERTS:"ALLOW_SELF_SIGNED_SSL_CERTS",MAX_HDB_PROCESSES:"MAX_HDB_PROCESSES",INSTALL_USER:"install_user",CLUSTERING_USER_KEY:"CLUSTERING_USER",MAX_CLUSTERING_PROCESSES:"MAX_CLUSTERING_PROCESSES",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"},it={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"},e={ANALYTICS_AGGREGATEPERIOD:"analytics_aggregatePeriod",AUTHENTICATION_AUTHORIZELOCAL:"authentication_authorizeLocal",AUTHENTICATION_CACHETTL:"authentication_cacheTTL",AUTHENTICATION_ENABLESESSIONS:"authentication_enableSessions",AUTHENTICATION_OPERATIONTOKENTIMEOUT:"authentication_operationTokenTimeout",AUTHENTICATION_REFRESHTOKENTIMEOUT:"authentication_refreshTokenTimeout",AUTHENTICATION_HASHFUNCTION:"authentication_hashFunction",CLUSTERING_USER:"clustering_user",CLUSTERING_ENABLED:"clustering_enabled",CLUSTERING_HUBSERVER_CLUSTER_NAME:"clustering_hubServer_cluster_name",CLUSTERING_HUBSERVER_CLUSTER_NETWORK_PORT:"clustering_hubServer_cluster_network_port",CLUSTERING_HUBSERVER_CLUSTER_NETWORK_ROUTES:"clustering_hubServer_cluster_network_routes",CLUSTERING_HUBSERVER_LEAFNODES_NETWORK_PORT:"clustering_hubServer_leafNodes_network_port",CLUSTERING_HUBSERVER_NETWORK_PORT:"clustering_hubServer_network_port",CLUSTERING_LEAFSERVER_NETWORK_PORT:"clustering_leafServer_network_port",CLUSTERING_LEAFSERVER_NETWORK_ROUTES:"clustering_leafServer_network_routes",CLUSTERING_LEAFSERVER_STREAMS_MAXAGE:"clustering_leafServer_streams_maxAge",CLUSTERING_LEAFSERVER_STREAMS_MAXBYTES:"clustering_leafServer_streams_maxBytes",CLUSTERING_LEAFSERVER_STREAMS_MAXMSGS:"clustering_leafServer_streams_maxMsgs",CLUSTERING_LEAFSERVER_STREAMS_MAXCONSUMEMSGS:"clustering_leafServer_streams_maxConsumeMsgs",CLUSTERING_LEAFSERVER_STREAMS_MAXINGESTTHREADS:"clustering_leafServer_streams_maxIngestThreads",CLUSTERING_LEAFSERVER_STREAMS_PATH:"clustering_leafServer_streams_path",CLUSTERING_NODENAME:"clustering_nodeName",CLUSTERING_TLS_CERTIFICATE:"clustering_tls_certificate",CLUSTERING_TLS_PRIVATEKEY:"clustering_tls_privateKey",CLUSTERING_TLS_CERT_AUTH:"clustering_tls_certificateAuthority",CLUSTERING_TLS_INSECURE:"clustering_tls_insecure",CLUSTERING_TLS_VERIFY:"clustering_tls_verify",CLUSTERING_LOGLEVEL:"clustering_logLevel",CLUSTERING_REPUBLISHMESSAGES:"clustering_republishMessages",CLUSTERING_DATABASELEVEL:"clustering_databaseLevel",CUSTOMFUNCTIONS_NETWORK_HTTPS:"customFunctions_network_https",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",HTTP_SESSIONAFFINITY:"http_sessionAffinity",HTTP_COMPRESSIONTHRESHOLD:"http_compressionThreshold",HTTP_CORS:"http_cors",HTTP_CORSACCESSLIST:"http_corsAccessList",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_MAXHEADERSIZE:"http_maxHeaderSize",HTTP_THREADRANGE:"http_threadRange",HTTP_HTTP2:"http_http2",LOCALSTUDIO_ENABLED:"localStudio_enabled",LOGGING_CONSOLE:"logging_console",LOGGING_FILE:"logging_file",LOGGING_LEVEL:"logging_level",LOGGING_ROOT:"logging_root",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_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_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",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_COPYTABLESTOCATCHUP:"replication_copyTablesToCatchUp",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_PREFETCHWRITES:"storage_prefetchWrites",STORAGE_ENCRYPTION:"storage_encryption",STORAGE_MAXTRANSACTIONQUEUETIME:"storage_maxTransactionQueueTime",STORAGE_PATH:"storage_path",STORAGE_BLOBPATHS:"storage_blobPaths",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",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:"tls",CLONED:"cloned"},W={settings_path:j.SETTINGS_PATH_KEY,hdb_root_key:e.ROOTPATH,hdb_root:e.ROOTPATH,rootpath:e.ROOTPATH,server_port_key:e.OPERATIONSAPI_NETWORK_PORT,server_port:e.OPERATIONSAPI_NETWORK_PORT,cert_key:e.TLS_CERTIFICATE,certificate:e.TLS_CERTIFICATE,private_key_key:e.TLS_PRIVATEKEY,private_key:e.TLS_PRIVATEKEY,http_secure_enabled_key:e.OPERATIONSAPI_NETWORK_HTTPS,https_on:e.OPERATIONSAPI_NETWORK_HTTPS,cors_enabled_key:e.OPERATIONSAPI_NETWORK_CORS,cors_on:e.OPERATIONSAPI_NETWORK_CORS,cors_whitelist_key:e.OPERATIONSAPI_NETWORK_CORSACCESSLIST,cors_whitelist:e.OPERATIONSAPI_NETWORK_CORSACCESSLIST,cors_accesslist_key:e.OPERATIONSAPI_NETWORK_CORSACCESSLIST,cors_accesslist:e.OPERATIONSAPI_NETWORK_CORSACCESSLIST,log_level_key:e.LOGGING_LEVEL,log_level:e.LOGGING_LEVEL,log_path_key:e.LOGGING_ROOT,log_path:e.LOGGING_ROOT,clustering_node_name_key:e.CLUSTERING_NODENAME,node_name:e.CLUSTERING_NODENAME,clustering_enabled_key:e.CLUSTERING_ENABLED,clustering:e.CLUSTERING_ENABLED,max_http_threads:e.THREADS_COUNT,max_hdb_processes:e.THREADS_COUNT,server_timeout_key:e.OPERATIONSAPI_NETWORK_TIMEOUT,server_timeout_ms:e.OPERATIONSAPI_NETWORK_TIMEOUT,server_keep_alive_timeout_key:e.OPERATIONSAPI_NETWORK_KEEPALIVETIMEOUT,server_keep_alive_timeout:e.OPERATIONSAPI_NETWORK_KEEPALIVETIMEOUT,server_headers_timeout_key:e.OPERATIONSAPI_NETWORK_HEADERSTIMEOUT,server_headers_timeout:e.OPERATIONSAPI_NETWORK_HEADERSTIMEOUT,disable_transaction_log_key:e.LOGGING_AUDITLOG,disable_transaction_log:e.LOGGING_AUDITLOG,operation_token_timeout_key:e.AUTHENTICATION_OPERATIONTOKENTIMEOUT,operation_token_timeout:e.AUTHENTICATION_OPERATIONTOKENTIMEOUT,refresh_token_timeout_key:e.AUTHENTICATION_REFRESHTOKENTIMEOUT,refresh_token_timeout:e.AUTHENTICATION_REFRESHTOKENTIMEOUT,custom_functions_port_key:e.HTTP_PORT,custom_functions_port:e.HTTP_PORT,custom_functions_directory_key:e.COMPONENTSROOT,custom_functions_directory:e.COMPONENTSROOT,max_custom_function_processes:e.THREADS_COUNT,logging_console:e.LOGGING_CONSOLE,log_to_file:e.LOGGING_FILE,log_to_stdstreams:e.LOGGING_STDSTREAMS,local_studio_on:e.LOCALSTUDIO_ENABLED,clustering_port:e.CLUSTERING_HUBSERVER_CLUSTER_NETWORK_PORT,clustering_user:e.CLUSTERING_USER,customfunctions_network_port:e.HTTP_PORT,customfunctions_tls_certificate:e.TLS_CERTIFICATE,customfunctions_network_cors:e.HTTP_CORS,customfunctions_network_corsaccesslist:e.HTTP_CORSACCESSLIST,customfunctions_network_headerstimeout:e.HTTP_HEADERSTIMEOUT,customfunctions_network_https:e.CUSTOMFUNCTIONS_NETWORK_HTTPS,customfunctions_network_keepalivetimeout:e.HTTP_KEEPALIVETIMEOUT,customfunctions_tls_privatekey:e.TLS_PRIVATEKEY,customfunctions_tls_certificateauthority:e.TLS_CERTIFICATEAUTHORITY,customfunctions_network_timeout:e.HTTP_TIMEOUT,customfunctions_tls:e.TLS,http_threads:e.THREADS_COUNT,threads:e.THREADS_COUNT,threads_count:e.THREADS_COUNT,customfunctions_processes:e.THREADS_COUNT,customfunctions_root:e.COMPONENTSROOT,operationsapi_root:e.ROOTPATH};for(let t in e){let _=e[t];W[_.toLowerCase()]=_}var St={TABLES:"tables",PATH:"path",AUDIT_PATH:"auditPath"},ct={csv_file_load:"csv_file_load",csv_data_load:n.CSV_DATA_LOAD,csv_url_load:n.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"},at={CLUSTERING_PAYLOAD:"clustering_payload",DELEGATE_THREAD_RESPONSE:"delegate_thread_response",CLUSTERING:"clustering",SCHEMA:"schema",CLUSTER_STATUS:"cluster_status",JOB:"job",CHILD_STARTED:"child_started",CHILD_STOPPED:"child_stopped",USER:"user",RESTART:"restart"},Rt={VERSION_DEFAULT:"2.2.0"},Ot={DEVELOPMENT:8192,DEFAULT:512},At={ENOENT:"ENOENT",EACCES:"EACCES",EEXIST:"EEXIST",ERR_INVALID_ARG_TYPE:"ERR_INVALID_ARG_TYPE"},lt=Symbol("metadata"),Nt="__clustering__",x="__createdtime__",q="__updatedtime__",It={CREATED_TIME:x,UPDATED_TIME:q},ut=[x,q],dt=15984864e5,Ct={LESS:"<",LESS_OR_EQ:"<=",GREATER:">",GREATER_OR_EQ:">=",BETWEEN:"..."},pt={"<":"LESS","<=":"LESS_OR_EQ",">":"GREATER",">=":"GREATER_OR_EQ","...":"BETWEEN"},Lt={READ:"read",INSERT:"insert",UPDATE:"update",DELETE:"delete"},mt=["*","%"],Ut="func_val",Pt={HASH_VALUE:"hash_value",TIMESTAMP:"timestamp",USERNAME:"username"},gt={JWT_PRIVATE_KEY_NAME:".jwtPrivate.key",JWT_PUBLIC_KEY_NAME:".jwtPublic.key",JWT_PASSPHRASE_NAME:".jwtPass"},ht={SHUTDOWN:"shutdown",CHILD_STARTED:"child_started",CHILD_STOPPED:"child_stopped",SCHEMA:"schema",USER:"user",CLUSTER_STATUS_RESPONSE:"cluster_status_response",CLUSTER_STATUS_REQUEST:"cluster_status_request",METRICS:"metrics",GET_METRICS:"get_metrics",RESTART:"restart",START_JOB:"start_job",NATS_CONSUMER_UPDATE:"nats_consumer_update"},Dt={HTTP:"http"},Gt="3.x.x",Mt={SUCCESS:"success",FAILURE:"failure"},ft={AUTHENTICATION:"authentication",AUTHORIZATION:"authorization"};$.exports={PACKAGE_ROOT:M,HDB_CONFIG_FILE:Re,HDB_DEFAULT_CONFIG_FILE:Oe,HDB_ROOT_DIR_NAME:Ae,HDB_COMPONENT_CONFIG_FILE:le,HDB_PROC_NAME:Ne,HDB_RESTART_SCRIPT:Ie,PROCESS_DESCRIPTORS:Ce,HDB_PROCESS_SERVICES:pe,CLUSTERING_PROCESSES:Le,HDB_PID_FILE:me,DEFAULT_DATABASE_NAME:Ue,LOG_NAMES:Pe,LOG_LEVELS:ge,LAUNCH_SERVICE_SCRIPTS:he,ROLE_TYPES_ENUM:De,HDB_SUPPORT_ADDRESS:Y,SUPPORT_HELP_MSG:Ge,SEARCH_NOT_FOUND_MESSAGE:Me,UNICODE_PERIOD:fe,FORWARD_SLASH_REGEX:He,UNICODE_FORWARD_SLASH:be,ESCAPED_FORWARD_SLASH_REGEX:ye,MEM_SETTING_KEY:Fe,SYSTEM_SCHEMA_NAME:ve,HDB_HOME_DIR_NAME:Be,LICENSE_KEY_DIR_NAME:Ke,BOOT_PROPS_FILE_NAME:ke,RESTART_TIMEOUT_MS:we,HDB_FILE_PERMISSIONS:Ve,DATABASES_DIR_NAME:Ye,LEGACY_DATABASES_DIR_NAME:je,TRANSACTIONS_DIR_NAME:We,PROCESS_NAME_ENV_PROP:xe,BOOT_PROP_PARAMS:j,INSTALL_PROMPTS:qe,INSERT_MAX_CHARACTER_SIZE:$e,UPGRADE_JSON_FIELD_NAMES_ENUM:Xe,SYSTEM_TABLE_NAMES:ze,INFO_TABLE_HASH_ATTRIBUTE:Qe,SYSTEM_DEFAULT_ATTRIBUTE_NAMES:Je,REG_KEY_FILE_NAME:Ze,LICENSE_FILE_NAME:et,JOB_STATUS_ENUM:tt,OPERATIONS_ENUM:n,VALID_S3_FILE_TYPES:_t,S3_BUCKET_AUTH_KEYS:Et,VALID_SQL_OPS_ENUM:st,CLUSTER_OPERATIONS:ot,SERVICE_ACTIONS_ENUM:Tt,GEO_CONVERSION_ENUM:rt,HDB_SETTINGS_NAMES:nt,LEGACY_CONFIG_PARAMS:it,CONFIG_PARAMS:e,CONFIG_PARAM_MAP:W,DATABASES_PARAM_CONFIG:St,JOB_TYPE_ENUM:ct,CLUSTER_MESSAGE_TYPE_ENUM:at,LICENSE_VALUES:Rt,RAM_ALLOCATION_ENUM:Ot,NODE_ERROR_CODES:At,METADATA_PROPERTY:lt,CLUSTERING_FLAG:Nt,TIME_STAMP_NAMES_ENUM:It,TIME_STAMP_NAMES:ut,PERMS_UPDATE_RELEASE_TIMESTAMP:dt,VALUE_SEARCH_COMPARATORS:Ct,VALUE_SEARCH_COMPARATORS_REVERSE_LOOKUP:pt,PERMS_CRUD_ENUM:Lt,SEARCH_WILDCARDS:mt,FUNC_VAL:Ut,READ_AUDIT_LOG_SEARCH_TYPES_ENUM:Pt,JWT_ENUM:gt,ITC_EVENT_TYPES:ht,THREAD_TYPES:Dt,PRE_4_0_0_VERSION:Gt,AUTH_AUDIT_STATUS:Mt,AUTH_AUDIT_TYPES:ft}});var z=P((a_,X)=>{if(__filename.endsWith("dev.js")){let t=require("fast-glob"),{tmpdir:_}=require("node:os"),{relative:E,join:o}=require("node:path"),{existsSync:l,statSync:N,readFileSync:p,writeFileSync:b}=require("node:fs"),{isMainThread:G}=require("node:worker_threads"),{spawnSync:L,spawn:m}=require("node:child_process"),{PACKAGE_ROOT:i}=B(),ne=["bin","components","dataLayer","resources","server","sqlTranslator","upgrade","utility","validation"],U="ts-build";if(G){let I=!1,O=!1;if((O=l(o(i,U)))?I=t.sync(ne.map(T=>`${T}/**/*.ts`),{cwd:i}).some(T=>{let S=0,c=0;try{S=N(o(i,T)).mtimeMs-5e3,c=N(o(i,U,T.replace(/.ts$/,".js"))).mtimeMs}catch{}return S>c}):I=!0,I){console.log("Compiling TypeScript...");let T=L("npx",["tsc"],{cwd:i});if(T.stdout?.length&&console.log(T.stdout.toString()),T.stderr?.length&&console.log(T.stderr.toString()),O){let S=o(_(),"harperdb-tsc.pid"),c=!1;if(l(S))try{process.kill(+p(S,"utf8"),0),c=!0}catch{}if(!c){console.log("Starting background TypeScript compilation...");let a=m("npx",["tsc","--watch"],{detached:!0,cwd:i,stdio:"ignore"});b(S,a.pid.toString()),a.unref()}}}}let k=X.constructor,ie=k._findPath;k._findPath=function(I,O,T){if(I.startsWith(".")&&!T&&O.length===1&&O[0].startsWith(i)&&!O[0].includes("node_modules")){let S=E(i,O[0]),c;S.startsWith(U)?c=o(i,E(U,S)):c=o(i,U,S);let a=o(c,I),w=a+".js";if(l(w))return w;if(a.includes(".")&&l(a))return a}return ie(I,O,T)}}});var Z=P((O_,J)=>{"use strict";var{platform:R_}=require("os"),Ht="nats-server.zip",K="nats-server",bt=process.platform==="win32"?`${K}.exe`:K,yt=/^[^\s.,*>]+$/,Q="__request__",Ft=r(t=>`${t}.${Q}`,"REQUEST_SUBJECT"),vt={NATS_MSG_ID:"Nats-Msg-Id",ORIGIN:"origin",TRANSACTED_NODES:"transacted_nodes"},Bt={HUB_SERVER:"hub.json",LEAF_SERVER:"leaf.json"},Kt={HUB:"hub.pid",LEAF:"leaf.pid"},kt={HUB:"-hub",LEAF:"-leaf",ADMIN:"-admin"},wt={SUCCESS:"success",ERROR:"error"},Vt={OPEN:"open",CLOSED:"closed",NO_RESPONDERS:"NoResponders",TIMEOUT:"Timeout"},Yt={TXN:"txn",MSGID:"msgid"},C={ERR:"error",WRN:"warn",INF:"info",DBG:"debug",TRC:"trace"},jt={[C.ERR]:1,[C.WRN]:2,[C.INF]:3,[C.DBG]:4,[C.TRC]:5},Wt={debug:"-D",trace:"-DVV"};J.exports={NATS_SERVER_ZIP:Ht,NATS_SERVER_NAME:K,NATS_BINARY_NAME:bt,PID_FILES:Kt,NATS_CONFIG_FILES:Bt,SERVER_SUFFIX:kt,NATS_TERM_CONSTRAINTS_RX:yt,REQUEST_SUFFIX:Q,UPDATE_REMOTE_RESPONSE_STATUSES:wt,CLUSTER_STATUS_STATUSES:Vt,REQUEST_SUBJECT:Ft,SUBJECT_PREFIXES:Yt,MSG_HEADERS:vt,LOG_LEVELS:C,LOG_LEVEL_FLAGS:Wt,LOG_LEVEL_HIERARCHY:jt}});var ee=P((l_,xt)=>{xt.exports={name:"harperdb",version:"4.5.0-alpha.3",description:"HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.",keywords:["database","nosql","api","distributed","broker","mqtt","real-time","enterprise","Fastify","NATS","HarperDB","Harper","clustering","replication","REST","WebSockets","decentralized","server-sent events","document store"],main:"harperdb.js",bin:{harperdb:"./bin/harperdb.js"},engines:{"minimum-node":"16.0.0","go-lang":"1.21.7","nats-server":"2.10.11"},exports:{".":"./index.js"},homepage:"https://www.harperdb.io/",bugs:"support@harperdb.io",author:{name:"HarperDB",email:"support@harperdb.io"},license:"SEE LICENSE IN LICENSE",scripts:{submodules:"git submodule update --init --recursive","cover:test":"pm2 kill && rimraf ./.nyc_output/* && node utility/devops/register.js --reset_license && nyc --no-clean --reporter=lcovonly npm run test:replication && nyc --no-clean --reporter=lcovonly npm run test:apitests && nyc --no-clean --reporter=lcovonly npm run test:resources && nyc --no-clean --reporter=lcovonly npm run test:logging && nyc --no-clean --reporter=lcovonly npm run test:upgrade && nyc --no-clean --reporter=lcovonly npm run test:nats && nyc --no-clean --reporter=lcovonly npm run test:cfserver && nyc --no-clean --reporter=lcovonly npm run test:hdbserver && nyc --no-clean --reporter=lcovonly npm run test:bin && nyc --no-clean --reporter=lcovonly npm run test:main && nyc --no-clean --reporter=lcovonly npm run test:security && nyc merge .nyc_output coverage.json && node ./utility/devops/register.js --reset_license",test:"pm2 kill && rimraf ./.nyc_output/* && node utility/devops/register.js --reset_license && npm run test:replication && npm run test:apitests && npm run test:resources && npm run test:logging && npm run test:upgrade && npm run test:nats && npm run test:cfserver && npm run test:hdbserver && npm run test:bin && npm run test:main && npm run test:security && nyc merge .nyc_output coverage.json && node ./utility/devops/register.js --reset_license","test:resources":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/resources/**/*.js' --config '../unitTests/.mocharc.json'","test:bin":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/bin/**/*.js' --config '../unitTests/.mocharc.json'","test:main":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/**/*.js' --config '../unitTests/.mocharc-main.json'","test:lmdbbridge":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/dataLayer/harperBridge/lmdbBridge/**/*.js' --config '../unitTests/.mocharc.json'","test:lmdbutility":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/utility/lmdb/**/*.js' --config '../unitTests/.mocharc.json'","test:hdbserver":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/server/harperdb/hdbServer-test.js' --config '../unitTests/.mocharc.json'","test:cfserver":"npm run submodules && cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/server/fastifyRoutes/customFunctionsServer-test.js' --config '../unitTests/.mocharc.json'","test:nats":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/server/nats/**/*.js' --config '../unitTests/.mocharc.json'","test:upgrade":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/upgrade/**/*.js' --config '../unitTests/.mocharc.json'","test:apitests":"pm2 kill && cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/apiTests/**/*-test.mjs' --config '../unitTests/.mocharc.json'","test:logging":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/utility/logging/*.js' --config '../unitTests/.mocharc.json'","test:ci":" cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/**/*.js' --retries 3 --config '../unitTests/.mocharc-main.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/dataLayer/harperBridge/lmdbBridge/**/*.js' --parallel --retries 3 --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/utility/lmdb/**/*.js' --parallel --retries 3 --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/server/harperdb/hdbServer-test.js' --parallel --retries 3 --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/server/customFunctions/customFunctionsServer-test.js' --parallel --retries 3 --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/upgrade/**/*.js' --parallel --retries 3 --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter && ../node_modules/mocha/bin/_mocha '../unitTests/server/nats/**/*.js' --config '../unitTests/.mocharc.json' --reporter mocha-teamcity-reporter","test:security":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/security/**/*.js' --config '../unitTests/.mocharc.json'","test:replication":"cd bin/ && ../node_modules/mocha/bin/_mocha '../unitTests/server/replication/**/*.js' --config '../unitTests/.mocharc.json'","hdb-check":"./utility/devops/hdb-check.sh","download-prebuilds":"node ./utility/devops/build/download-prebuilds.js",prebuild:"date",postinstall:"node ./launchServiceScripts/launchInstallNATSServer.js",build_nats_dependency:"node ./utility/devops/nats/builder.js",coverage:"nyc --reporter=lcov npm test",format:"prettier .","format:fix":"npm run format -- --write",lint:"eslint .","lint:fix":"npm run lint -- --fix","cluster:local":"docker compose -f utility/dev/docker-compose.yml --project-directory . build && docker compose -f utility/dev/docker-compose.yml --project-directory . up","cluster:latest":"docker compose -f utility/dev/docker-compose.yml --project-directory . pull && docker compose -f utility/dev/docker-compose.yml --project-directory . up"},dependencies:{"@aws-sdk/client-s3":"3.717.0","@aws-sdk/lib-storage":"3.717.0","@endo/static-module-record":"^1.0.4","@fastify/autoload":"5.10.0","@fastify/compress":"~6.5.0","@fastify/cors":"~9.0.1","@fastify/static":"~7.0.4","@turf/area":"6.5.0","@turf/boolean-contains":"6.5.0","@turf/boolean-disjoint":"6.5.0","@turf/boolean-equal":"6.5.0","@turf/circle":"6.5.0","@turf/difference":"6.5.0","@turf/distance":"6.5.0","@turf/helpers":"6.5.0","@turf/length":"6.5.0",alasql:"4.1.10",argon2:"0.41.1","cbor-x":"1.6.0",chalk:"4.1.2","cli-progress":"3.12.0",clone:"2.1.2","fast-glob":"3.3.2",fastify:"~4.29.0","fastify-plugin":"~4.5.1","fs-extra":"11.2.0",graphql:"^16.10.0","gunzip-maybe":"1.4.2","human-readable-ids":"1.0.4",inquirer:"8.2.6","is-number":"7.0.0",joi:"17.12.2","json-bigint-fixes":"1.1.0",json2csv:"5.0.7",jsonata:"1.8.7",jsonwebtoken:"9.0.2",lmdb:"3.2.6",lodash:"4.17.21",mathjs:"11.12.0",minimist:"1.2.8",moment:"2.30.1","mqtt-packet":"~9.0.0",msgpackr:"1.11.2",nats:"2.19.0",needle:"3.3.1","node-forge":"^1.3.1","node-stream-zip":"1.15.0","node-unix-socket":"0.2.5","normalize-path":"^3.0.0",ora:"5.4.1","ordered-binary":"1.5.3",papaparse:"5.4.1",passport:"0.6.0","passport-http":"0.3.0","passport-local":"1.0.0",pino:"8.16.0",pm2:"5.4.1",prompt:"1.3.0","properties-reader":"2.3.0","recursive-iterator":"3.3.0",semver:"7.5.4",send:"^1.1.0","serve-static":"2.1.0",ses:"1.1.0","stream-chain":"2.2.5","stream-json":"1.8.0",systeminformation:"5.24.5","tar-fs":"3.0.6",ulidx:"0.5.0",uuid:"10.0.0","validate.js":"0.13.1",ws:"8.18.0",yaml:"2.7.0"},devDependencies:{"@tsconfig/node16":"^1.0.3","@types/node":"20.14.8","@typescript-eslint/eslint-plugin":"^7.18.0","@typescript-eslint/parser":"^7.18.0",axios:"1.7.5",chai:"4.4.1","chai-as-promised":"7.1.1","chai-integer":"0.1.0",esbuild:"^0.24.2",eslint:"^8.57.1","eslint-config-prettier":"^9.1.0","eslint-plugin-sonarjs":"^3.0.1",eventsource:"^2.0.2","graphql-http":"^1.22.3","hook-std":"3.0.0","intercept-stdout":"0.1.2",mkcert:"1.5.1",mocha:"^11.0.1","mocha-teamcity-reporter":"^4.2.0","mock-require":"3.0.3","mock-stdin":"1.0.0",mqtt:"~4.3.8",newman:"6.1.3","node-fetch":"2.6.7",nyc:"15.1.0",prettier:"3.3.3",rewire:"5.0.0",rimraf:"3.0.2",sinon:"10.0.0","sinon-chai":"3.7.0","source-map-support":"^0.5.21",typescript:"^5.7.2",undici:"^6.19.8","why-is-node-still-running":"^1.0.0"},overrides:{alasql:{xlsx:"0.18.5"}},optionalDependencies:{bufferutil:"^4.0.7","segfault-handler":"^1.3.0","utf-8-validate":"^5.0.10"}}});var re=P((N_,Te)=>{"use strict";var u=require("fs-extra"),A=require("path"),s=require("chalk"),qt=require("needle"),te=require("node-stream-zip"),_e=require("semver"),d=Z(),$t=require("util"),Xt=require("child_process"),{platform:zt}=require("os"),Qt=$t.promisify(Xt.exec),{PACKAGE_ROOT:Jt}=B(),R=A.join(Jt,"dependencies"),Zt=A.join(R,d.NATS_SERVER_ZIP),Ee=ee(),f=Ee.engines["go-lang"],D=Ee.engines[d.NATS_SERVER_NAME],e_=`${process.platform}-${process.arch}`,H=A.join(R,e_,`${d.NATS_BINARY_NAME}`),t_=`https://github.com/nats-io/nats-server/releases/download/v${D}/nats-server-v${D}-`,se={"linux-x64":"linux-amd64.zip","linux-arm64":"linux-arm64.zip","darwin-x64":"darwin-amd64.zip","darwin-arm64":"darwin-arm64.zip","win32-x64":"windows-amd64.zip"},__=Object.keys(se).map(t=>t.split("-"));async function h(t,_=void 0){let{stdout:E,stderr:o}=await Qt(t,{cwd:_});if(o)throw new Error(o.replace(`
2
2
  `,""));return E.replace(`
3
3
  `,"")}r(h,"runCommand");async function E_(){try{await u.access(H)}catch{return!1}let t=await h(`${H} --version`,void 0),_=t.substring(t.lastIndexOf("v")+1,t.length);return _e.eq(_,D)}r(E_,"checkNATSServerInstalled");async function s_(){console.log(s.green(`Verifying go v${f} is on system.`));let t;try{t=(await h("go version",void 0)).match(/[\d.]+/)[0]}catch{throw Error("go does not appear to be installed or is not in the PATH, cannot install clustering dependencies.")}if(!_e.gte(t,f))throw Error(`go version ${f} or higher must be installed.`);console.log(s.green(`go v${f} is on the system.`))}r(s_,"checkGoVersion");async function o_(){console.log(s.green("Extracting NATS Server source code."));let t=new te.async({file:Zt}),_=A.join(R,`${d.NATS_SERVER_NAME}-src`),E=await t.extract(null,R);return console.log(s.green(`Extracted ${E} entries.`)),await t.close(),_}r(o_,"extractNATSServer");async function T_(t){let _=A.join(t,d.NATS_BINARY_NAME),E=A.join(R,"pkg");await u.move(_,H,{overwrite:!0}),await u.remove(t),await u.remove(E)}r(T_,"cleanUp");async function oe(t,_){let E=t&&_?`${t}-${_}`:`${process.platform}-${process.arch}`,o=se[E];if(o===void 0)throw Error(`unknown platform - architecture: ${E}`);let l=`${t_}${o}`,N=A.join(R,E,o);await u.ensureFile(N),console.log(s.green(`****Downloading install of NATS Server: ${l}****`)),await qt("get",l,{output:N,follow_max:5}),console.log(s.green("Successfully downloaded and saved nats-server zip.")),console.log(s.green("Extracting nats-server zip."));let p=new te.async({file:N}),b=await p.entries(),G=t==="win32"||process.platform==="win32"?`${d.NATS_SERVER_NAME}.exe`:d.NATS_SERVER_NAME,L=A.join(R,E,G);for(let m of Object.values(b))!m.isDirectory&&m.name.endsWith(G)&&(await p.extract(m.name,L),console.log(s.green(`Successfully extracted nats-server zip to ${L}.`)));await p.close(),await u.remove(N),await u.chmod(L,511)}r(oe,"downloadNATSServer");async function r_(){if(console.log(s.green("****Starting install of NATS Server.****")),await E_()){console.log(s.green(`****NATS Server v${D} installed.****`));return}try{await oe();try{let E=await h(`${H} --version`,void 0);console.log(s.green(`****Successfully extracted ${E}.****`))}catch(E){if(E.toString().includes("file busy"))console.warn("Error checking NATS versions",E);else throw E}return}catch(E){console.error(s.red(`Error: ${E.message}. Failed to download NATS server. Building from source`))}try{await s_()}catch(E){console.error(s.red(E.message)),process.exit(1)}let _=await o_();console.log(s.green("Building NATS Server binary.")),zt()=="win32"?await h(`set GOPATH=${R}&& go build`,_):await h(`export GOPATH=${R} && go build`,_),console.log(s.green("Building NATS Server binary complete.")),await T_(_),console.log(s.green(`****NATS Server v${D} is installed.****`))}r(r_,"installer");Te.exports={installer:r_,downloadNATSServer:oe,ALL_SUPPORTED_PLATFORM_ARCHITECTURES:__}});z();var u_=require("fs"),d_=require("path"),n_=re();(async()=>{try{await n_.installer()}catch(t){console.error(t)}})();