@harperfast/harper 5.0.25 → 5.1.0-beta.1
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.
- package/README.md +11 -10
- package/agent/agent.ts +203 -0
- package/agent/loop.ts +205 -0
- package/agent/operations.ts +148 -0
- package/agent/session.ts +187 -0
- package/agent/tools/fsTools.ts +276 -0
- package/agent/tools/httpFetchTool.ts +112 -0
- package/agent/tools/scheduleTool.ts +68 -0
- package/agent/toolset.ts +43 -0
- package/agent/types.ts +85 -0
- package/bin/{BinObjects.js → BinObjects.ts} +4 -5
- package/bin/cliCredentials.ts +133 -0
- package/bin/cliOperations.ts +339 -0
- package/bin/copyDb.ts +10 -10
- package/bin/deployRenderer.ts +196 -0
- package/bin/{harper.js → harper.ts} +43 -19
- package/bin/{install.js → install.ts} +3 -3
- package/bin/lite.ts +2 -0
- package/bin/login.ts +168 -0
- package/bin/logout.ts +11 -0
- package/bin/mcp/client.ts +407 -0
- package/bin/mcp/doctor.ts +189 -0
- package/bin/mcp/index.ts +80 -0
- package/bin/mcp/options.ts +122 -0
- package/bin/mcp/printConfig.ts +89 -0
- package/bin/multipartBuilder.ts +74 -0
- package/bin/{restart.js → restart.ts} +27 -28
- package/bin/{run.js → run.ts} +41 -30
- package/bin/sseConsumer.ts +126 -0
- package/bin/{status.js → status.ts} +10 -10
- package/bin/{stop.js → stop.ts} +5 -5
- package/bin/upgrade.js +6 -6
- package/components/Application.ts +144 -18
- package/components/ApplicationScope.ts +2 -2
- package/components/ComponentV1.ts +2 -2
- package/components/EntryHandler.ts +159 -9
- package/components/OptionsWatcher.ts +75 -11
- package/components/Scope.ts +125 -15
- package/components/anthropic/index.ts +547 -0
- package/components/bedrock/index.ts +823 -0
- package/components/componentLoader.ts +63 -32
- package/components/deployLifecycle.ts +161 -0
- package/components/deploymentOperations.ts +173 -0
- package/components/deploymentRecorder.ts +402 -0
- package/components/deriveURLPath.ts +4 -4
- package/components/mcp/adapters/fastify.ts +87 -0
- package/components/mcp/adapters/harperHttp.ts +103 -0
- package/components/mcp/audit.ts +75 -0
- package/components/mcp/index.ts +134 -0
- package/components/mcp/jsonrpc.ts +134 -0
- package/components/mcp/lifecycle.ts +105 -0
- package/components/mcp/listChanged.ts +270 -0
- package/components/mcp/rateLimit.ts +217 -0
- package/components/mcp/resources.ts +593 -0
- package/components/mcp/session.ts +151 -0
- package/components/mcp/sessionRegistry.ts +140 -0
- package/components/mcp/toolRegistry.ts +292 -0
- package/components/mcp/tools/application.ts +603 -0
- package/components/mcp/tools/operations.ts +283 -0
- package/components/mcp/tools/schemas/derive.ts +256 -0
- package/components/mcp/tools/schemas/operations.ts +245 -0
- package/components/mcp/transport.ts +517 -0
- package/components/ollama/index.ts +316 -0
- package/components/openai/index.ts +563 -0
- package/components/operations.js +211 -60
- package/components/operationsValidation.js +3 -3
- package/components/packageComponent.ts +97 -29
- package/components/requestRestart.ts +17 -2
- package/components/status/crossThread.ts +14 -5
- package/components/status/errors.ts +1 -1
- package/config/RootConfigWatcher.ts +56 -2
- package/config/configUtils.js +29 -8
- package/config/harperConfigEnvVars.ts +1 -1
- package/config-root.schema.json +74 -0
- package/dataLayer/{CreateAttributeObject.js → CreateAttributeObject.ts} +4 -3
- package/dataLayer/{CreateTableObject.js → CreateTableObject.ts} +2 -1
- package/dataLayer/{DataLayerObjects.js → DataLayerObjects.ts} +17 -9
- package/dataLayer/{DeleteBeforeObject.js → DeleteBeforeObject.ts} +2 -1
- package/dataLayer/{DeleteObject.js → DeleteObject.ts} +3 -2
- package/dataLayer/{DropAttributeObject.js → DropAttributeObject.ts} +2 -1
- package/dataLayer/{GetBackupObject.js → GetBackupObject.ts} +3 -2
- package/dataLayer/{InsertObject.js → InsertObject.ts} +3 -2
- package/dataLayer/{ReadAuditLogObject.js → ReadAuditLogObject.ts} +3 -2
- package/dataLayer/{SQLSearch.js → SQLSearch.ts} +97 -43
- package/dataLayer/{SearchByConditionsObject.js → SearchByConditionsObject.ts} +5 -6
- package/dataLayer/{SearchByHashObject.js → SearchByHashObject.ts} +2 -1
- package/dataLayer/{SearchObject.js → SearchObject.ts} +2 -1
- package/dataLayer/{SqlSearchObject.js → SqlSearchObject.ts} +2 -1
- package/dataLayer/{UpdateObject.js → UpdateObject.ts} +3 -2
- package/dataLayer/{UpsertObject.js → UpsertObject.ts} +3 -2
- package/dataLayer/{bulkLoad.js → bulkLoad.ts} +40 -49
- package/dataLayer/{delete.js → delete.ts} +21 -26
- package/dataLayer/{export.js → export.ts} +22 -26
- package/dataLayer/{getBackup.js → getBackup.ts} +7 -9
- package/dataLayer/harperBridge/BridgeMethods.ts +102 -0
- package/dataLayer/harperBridge/ResourceBridge.ts +27 -26
- package/dataLayer/harperBridge/TableSizeObject.ts +1 -0
- package/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js +4 -4
- package/dataLayer/harperBridge/{harperBridge.js → harperBridge.ts} +3 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js +8 -6
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js +4 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js +6 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js +5 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js +4 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js +6 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js +5 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js +5 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js +3 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js +3 -2
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js +5 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js +10 -8
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js +4 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js +3 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js +6 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js +2 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js +3 -2
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +2 -2
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js +5 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js +6 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.ts +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js +4 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js +5 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js +4 -4
- package/dataLayer/{hdbInfoController.js → hdbInfoController.ts} +20 -26
- package/dataLayer/{insert.js → insert.ts} +24 -24
- package/dataLayer/{readAuditLog.js → readAuditLog.ts} +8 -10
- package/dataLayer/{schema.js → schema.ts} +32 -44
- package/dataLayer/{schemaDescribe.js → schemaDescribe.ts} +23 -26
- package/dataLayer/{search.js → search.ts} +9 -15
- package/dataLayer/{transaction.js → transaction.ts} +2 -5
- package/dataLayer/{update.js → update.ts} +19 -22
- package/dist/agent/agent.d.ts +35 -0
- package/dist/agent/agent.js +175 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/loop.d.ts +34 -0
- package/dist/agent/loop.js +176 -0
- package/dist/agent/loop.js.map +1 -0
- package/dist/agent/operations.d.ts +17 -0
- package/dist/agent/operations.js +137 -0
- package/dist/agent/operations.js.map +1 -0
- package/dist/agent/session.d.ts +36 -0
- package/dist/agent/session.js +182 -0
- package/dist/agent/session.js.map +1 -0
- package/dist/agent/tools/fsTools.d.ts +19 -0
- package/dist/agent/tools/fsTools.js +286 -0
- package/dist/agent/tools/fsTools.js.map +1 -0
- package/dist/agent/tools/httpFetchTool.d.ts +9 -0
- package/dist/agent/tools/httpFetchTool.js +116 -0
- package/dist/agent/tools/httpFetchTool.js.map +1 -0
- package/dist/agent/tools/scheduleTool.d.ts +22 -0
- package/dist/agent/tools/scheduleTool.js +54 -0
- package/dist/agent/tools/scheduleTool.js.map +1 -0
- package/dist/agent/toolset.d.ts +24 -0
- package/dist/agent/toolset.js +33 -0
- package/dist/agent/toolset.js.map +1 -0
- package/dist/agent/types.d.ts +75 -0
- package/dist/agent/types.js +10 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/bin/BinObjects.d.ts +2 -2
- package/dist/bin/BinObjects.js +6 -3
- package/dist/bin/BinObjects.js.map +1 -1
- package/dist/bin/cliCredentials.d.ts +27 -0
- package/dist/bin/cliCredentials.js +130 -0
- package/dist/bin/cliCredentials.js.map +1 -0
- package/dist/bin/cliOperations.d.ts +7 -7
- package/dist/bin/cliOperations.js +251 -37
- package/dist/bin/cliOperations.js.map +1 -1
- package/dist/bin/copyDb.js +16 -16
- package/dist/bin/copyDb.js.map +1 -1
- package/dist/bin/deployRenderer.d.ts +47 -0
- package/dist/bin/deployRenderer.js +185 -0
- package/dist/bin/deployRenderer.js.map +1 -0
- package/dist/bin/harper.d.ts +2 -1
- package/dist/bin/harper.js +87 -26
- package/dist/bin/harper.js.map +1 -1
- package/dist/bin/install.d.ts +1 -1
- package/dist/bin/install.js +41 -4
- package/dist/bin/install.js.map +1 -1
- package/dist/bin/lite.js +3 -4
- package/dist/bin/lite.js.map +1 -1
- package/dist/bin/login.d.ts +4 -0
- package/dist/bin/login.js +158 -0
- package/dist/bin/login.js.map +1 -0
- package/dist/bin/logout.d.ts +4 -0
- package/dist/bin/logout.js +16 -0
- package/dist/bin/logout.js.map +1 -0
- package/dist/bin/mcp/client.d.ts +34 -0
- package/dist/bin/mcp/client.js +395 -0
- package/dist/bin/mcp/client.js.map +1 -0
- package/dist/bin/mcp/doctor.d.ts +11 -0
- package/dist/bin/mcp/doctor.js +193 -0
- package/dist/bin/mcp/doctor.js.map +1 -0
- package/dist/bin/mcp/index.d.ts +10 -0
- package/dist/bin/mcp/index.js +81 -0
- package/dist/bin/mcp/index.js.map +1 -0
- package/dist/bin/mcp/options.d.ts +33 -0
- package/dist/bin/mcp/options.js +113 -0
- package/dist/bin/mcp/options.js.map +1 -0
- package/dist/bin/mcp/printConfig.d.ts +14 -0
- package/dist/bin/mcp/printConfig.js +85 -0
- package/dist/bin/mcp/printConfig.js.map +1 -0
- package/dist/bin/multipartBuilder.d.ts +26 -0
- package/dist/bin/multipartBuilder.js +55 -0
- package/dist/bin/multipartBuilder.js.map +1 -0
- package/dist/bin/restart.d.ts +3 -2
- package/dist/bin/restart.js +82 -45
- package/dist/bin/restart.js.map +1 -1
- package/dist/bin/run.d.ts +13 -9
- package/dist/bin/run.js +111 -65
- package/dist/bin/run.js.map +1 -1
- package/dist/bin/sseConsumer.d.ts +24 -0
- package/dist/bin/sseConsumer.js +127 -0
- package/dist/bin/sseConsumer.js.map +1 -0
- package/dist/bin/status.d.ts +1 -1
- package/dist/bin/status.js +48 -11
- package/dist/bin/status.js.map +1 -1
- package/dist/bin/stop.d.ts +1 -1
- package/dist/bin/stop.js +43 -6
- package/dist/bin/stop.js.map +1 -1
- package/dist/bin/upgrade.js +6 -6
- package/dist/components/Application.d.ts +29 -17
- package/dist/components/Application.js +134 -28
- package/dist/components/Application.js.map +1 -1
- package/dist/components/ApplicationScope.js +2 -2
- package/dist/components/ComponentV1.d.ts +1 -1
- package/dist/components/ComponentV1.js +5 -5
- package/dist/components/ComponentV1.js.map +1 -1
- package/dist/components/EntryHandler.d.ts +26 -3
- package/dist/components/EntryHandler.js +153 -13
- package/dist/components/EntryHandler.js.map +1 -1
- package/dist/components/OptionsWatcher.d.ts +7 -2
- package/dist/components/OptionsWatcher.js +72 -10
- package/dist/components/OptionsWatcher.js.map +1 -1
- package/dist/components/Scope.d.ts +11 -6
- package/dist/components/Scope.js +105 -9
- package/dist/components/Scope.js.map +1 -1
- package/dist/components/anthropic/index.d.ts +40 -0
- package/dist/components/anthropic/index.js +428 -0
- package/dist/components/anthropic/index.js.map +1 -0
- package/dist/components/bedrock/index.d.ts +79 -0
- package/dist/components/bedrock/index.js +734 -0
- package/dist/components/bedrock/index.js.map +1 -0
- package/dist/components/componentLoader.d.ts +29 -0
- package/dist/components/componentLoader.js +63 -38
- package/dist/components/componentLoader.js.map +1 -1
- package/dist/components/deployLifecycle.d.ts +39 -0
- package/dist/components/deployLifecycle.js +156 -0
- package/dist/components/deployLifecycle.js.map +1 -0
- package/dist/components/deploymentOperations.d.ts +19 -0
- package/dist/components/deploymentOperations.js +185 -0
- package/dist/components/deploymentOperations.js.map +1 -0
- package/dist/components/deploymentRecorder.d.ts +81 -0
- package/dist/components/deploymentRecorder.js +401 -0
- package/dist/components/deploymentRecorder.js.map +1 -0
- package/dist/components/deriveURLPath.d.ts +2 -2
- package/dist/components/deriveURLPath.js +2 -2
- package/dist/components/deriveURLPath.js.map +1 -1
- package/dist/components/mcp/adapters/fastify.d.ts +35 -0
- package/dist/components/mcp/adapters/fastify.js +66 -0
- package/dist/components/mcp/adapters/fastify.js.map +1 -0
- package/dist/components/mcp/adapters/harperHttp.d.ts +38 -0
- package/dist/components/mcp/adapters/harperHttp.js +78 -0
- package/dist/components/mcp/adapters/harperHttp.js.map +1 -0
- package/dist/components/mcp/audit.d.ts +27 -0
- package/dist/components/mcp/audit.js +73 -0
- package/dist/components/mcp/audit.js.map +1 -0
- package/dist/components/mcp/index.d.ts +47 -0
- package/dist/components/mcp/index.js +109 -0
- package/dist/components/mcp/index.js.map +1 -0
- package/dist/components/mcp/jsonrpc.d.ts +71 -0
- package/dist/components/mcp/jsonrpc.js +93 -0
- package/dist/components/mcp/jsonrpc.js.map +1 -0
- package/dist/components/mcp/lifecycle.d.ts +69 -0
- package/dist/components/mcp/lifecycle.js +79 -0
- package/dist/components/mcp/lifecycle.js.map +1 -0
- package/dist/components/mcp/listChanged.d.ts +24 -0
- package/dist/components/mcp/listChanged.js +257 -0
- package/dist/components/mcp/listChanged.js.map +1 -0
- package/dist/components/mcp/rateLimit.d.ts +25 -0
- package/dist/components/mcp/rateLimit.js +226 -0
- package/dist/components/mcp/rateLimit.js.map +1 -0
- package/dist/components/mcp/resources.d.ts +90 -0
- package/dist/components/mcp/resources.js +515 -0
- package/dist/components/mcp/resources.js.map +1 -0
- package/dist/components/mcp/session.d.ts +36 -0
- package/dist/components/mcp/session.js +170 -0
- package/dist/components/mcp/session.js.map +1 -0
- package/dist/components/mcp/sessionRegistry.d.ts +63 -0
- package/dist/components/mcp/sessionRegistry.js +124 -0
- package/dist/components/mcp/sessionRegistry.js.map +1 -0
- package/dist/components/mcp/toolRegistry.d.ts +150 -0
- package/dist/components/mcp/toolRegistry.js +176 -0
- package/dist/components/mcp/toolRegistry.js.map +1 -0
- package/dist/components/mcp/tools/application.d.ts +58 -0
- package/dist/components/mcp/tools/application.js +549 -0
- package/dist/components/mcp/tools/application.js.map +1 -0
- package/dist/components/mcp/tools/operations.d.ts +23 -0
- package/dist/components/mcp/tools/operations.js +303 -0
- package/dist/components/mcp/tools/operations.js.map +1 -0
- package/dist/components/mcp/tools/schemas/derive.d.ts +36 -0
- package/dist/components/mcp/tools/schemas/derive.js +216 -0
- package/dist/components/mcp/tools/schemas/derive.js.map +1 -0
- package/dist/components/mcp/tools/schemas/operations.d.ts +27 -0
- package/dist/components/mcp/tools/schemas/operations.js +243 -0
- package/dist/components/mcp/tools/schemas/operations.js.map +1 -0
- package/dist/components/mcp/transport.d.ts +38 -0
- package/dist/components/mcp/transport.js +467 -0
- package/dist/components/mcp/transport.js.map +1 -0
- package/dist/components/ollama/index.d.ts +46 -0
- package/dist/components/ollama/index.js +239 -0
- package/dist/components/ollama/index.js.map +1 -0
- package/dist/components/openai/index.d.ts +51 -0
- package/dist/components/openai/index.js +475 -0
- package/dist/components/openai/index.js.map +1 -0
- package/dist/components/operations.d.ts +6 -6
- package/dist/components/operations.js +198 -52
- package/dist/components/operations.js.map +1 -1
- package/dist/components/operationsValidation.d.ts +2 -2
- package/dist/components/operationsValidation.js +3 -3
- package/dist/components/packageComponent.d.ts +28 -6
- package/dist/components/packageComponent.js +87 -26
- package/dist/components/packageComponent.js.map +1 -1
- package/dist/components/requestRestart.d.ts +1 -0
- package/dist/components/requestRestart.js +12 -1
- package/dist/components/requestRestart.js.map +1 -1
- package/dist/components/status/crossThread.d.ts +5 -1
- package/dist/components/status/crossThread.js +12 -5
- package/dist/components/status/crossThread.js.map +1 -1
- package/dist/components/status/errors.js +7 -7
- package/dist/config/RootConfigWatcher.d.ts +3 -0
- package/dist/config/RootConfigWatcher.js +52 -1
- package/dist/config/RootConfigWatcher.js.map +1 -1
- package/dist/config/configUtils.js +31 -8
- package/dist/config/configUtils.js.map +1 -1
- package/dist/config/harperConfigEnvVars.js +1 -1
- package/dist/config/harperConfigEnvVars.js.map +1 -1
- package/dist/dataLayer/CreateAttributeObject.d.ts +3 -7
- package/dist/dataLayer/CreateAttributeObject.js +4 -3
- package/dist/dataLayer/CreateAttributeObject.js.map +1 -1
- package/dist/dataLayer/CreateTableObject.d.ts +2 -4
- package/dist/dataLayer/CreateTableObject.js +2 -1
- package/dist/dataLayer/CreateTableObject.js.map +1 -1
- package/dist/dataLayer/DataLayerObjects.d.ts +17 -16
- package/dist/dataLayer/DataLayerObjects.js +19 -5
- package/dist/dataLayer/DataLayerObjects.js.map +1 -1
- package/dist/dataLayer/DeleteBeforeObject.d.ts +3 -5
- package/dist/dataLayer/DeleteBeforeObject.js +2 -1
- package/dist/dataLayer/DeleteBeforeObject.js.map +1 -1
- package/dist/dataLayer/DeleteObject.d.ts +3 -7
- package/dist/dataLayer/DeleteObject.js +4 -3
- package/dist/dataLayer/DeleteObject.js.map +1 -1
- package/dist/dataLayer/DropAttributeObject.d.ts +2 -4
- package/dist/dataLayer/DropAttributeObject.js +2 -1
- package/dist/dataLayer/DropAttributeObject.js.map +1 -1
- package/dist/dataLayer/GetBackupObject.d.ts +3 -5
- package/dist/dataLayer/GetBackupObject.js +4 -3
- package/dist/dataLayer/GetBackupObject.js.map +1 -1
- package/dist/dataLayer/InsertObject.d.ts +3 -8
- package/dist/dataLayer/InsertObject.js +4 -3
- package/dist/dataLayer/InsertObject.js.map +1 -1
- package/dist/dataLayer/ReadAuditLogObject.d.ts +3 -7
- package/dist/dataLayer/ReadAuditLogObject.js +4 -3
- package/dist/dataLayer/ReadAuditLogObject.js.map +1 -1
- package/dist/dataLayer/SQLSearch.d.ts +68 -38
- package/dist/dataLayer/SQLSearch.js +140 -78
- package/dist/dataLayer/SQLSearch.js.map +1 -1
- package/dist/dataLayer/SearchByConditionsObject.d.ts +10 -58
- package/dist/dataLayer/SearchByConditionsObject.js +5 -7
- package/dist/dataLayer/SearchByConditionsObject.js.map +1 -1
- package/dist/dataLayer/SearchByHashObject.d.ts +3 -6
- package/dist/dataLayer/SearchByHashObject.js +2 -1
- package/dist/dataLayer/SearchByHashObject.js.map +1 -1
- package/dist/dataLayer/SearchObject.d.ts +3 -12
- package/dist/dataLayer/SearchObject.js +2 -1
- package/dist/dataLayer/SearchObject.js.map +1 -1
- package/dist/dataLayer/SqlSearchObject.d.ts +2 -4
- package/dist/dataLayer/SqlSearchObject.js +2 -1
- package/dist/dataLayer/SqlSearchObject.js.map +1 -1
- package/dist/dataLayer/UpdateObject.d.ts +3 -7
- package/dist/dataLayer/UpdateObject.js +4 -3
- package/dist/dataLayer/UpdateObject.js.map +1 -1
- package/dist/dataLayer/UpsertObject.d.ts +3 -7
- package/dist/dataLayer/UpsertObject.js +4 -3
- package/dist/dataLayer/UpsertObject.js.map +1 -1
- package/dist/dataLayer/bulkLoad.d.ts +4 -4
- package/dist/dataLayer/bulkLoad.js +122 -88
- package/dist/dataLayer/bulkLoad.js.map +1 -1
- package/dist/dataLayer/delete.d.ts +10 -11
- package/dist/dataLayer/delete.js +74 -39
- package/dist/dataLayer/delete.js.map +1 -1
- package/dist/dataLayer/export.d.ts +8 -8
- package/dist/dataLayer/export.js +90 -55
- package/dist/dataLayer/export.js.map +1 -1
- package/dist/dataLayer/getBackup.d.ts +4 -3
- package/dist/dataLayer/getBackup.js +43 -11
- package/dist/dataLayer/getBackup.js.map +1 -1
- package/dist/dataLayer/harperBridge/BridgeMethods.d.ts +39 -21
- package/dist/dataLayer/harperBridge/BridgeMethods.js +41 -20
- package/dist/dataLayer/harperBridge/BridgeMethods.js.map +1 -1
- package/dist/dataLayer/harperBridge/ResourceBridge.d.ts +2 -2
- package/dist/dataLayer/harperBridge/ResourceBridge.js +26 -25
- package/dist/dataLayer/harperBridge/ResourceBridge.js.map +1 -1
- package/dist/dataLayer/harperBridge/TableSizeObject.d.ts +1 -0
- package/dist/dataLayer/harperBridge/TableSizeObject.js.map +1 -1
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.d.ts +4 -4
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js +4 -4
- package/dist/dataLayer/harperBridge/harperBridge.d.ts +2 -3
- package/dist/dataLayer/harperBridge/harperBridge.js +38 -4
- package/dist/dataLayer/harperBridge/harperBridge.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js +7 -6
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js +5 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js +3 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js +8 -8
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.d.ts +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js +3 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js +3 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js +5 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js +4 -4
- package/dist/dataLayer/hdbInfoController.d.ts +4 -8
- package/dist/dataLayer/hdbInfoController.js +66 -31
- package/dist/dataLayer/hdbInfoController.js.map +1 -1
- package/dist/dataLayer/insert.d.ts +14 -26
- package/dist/dataLayer/insert.js +63 -28
- package/dist/dataLayer/insert.js.map +1 -1
- package/dist/dataLayer/readAuditLog.d.ts +1 -3
- package/dist/dataLayer/readAuditLog.js +45 -13
- package/dist/dataLayer/readAuditLog.js.map +1 -1
- package/dist/dataLayer/schema.d.ts +10 -10
- package/dist/dataLayer/schema.js +124 -89
- package/dist/dataLayer/schema.js.map +1 -1
- package/dist/dataLayer/schemaDescribe.d.ts +4 -4
- package/dist/dataLayer/schemaDescribe.js +78 -41
- package/dist/dataLayer/schemaDescribe.js.map +1 -1
- package/dist/dataLayer/search.d.ts +4 -4
- package/dist/dataLayer/search.js +12 -13
- package/dist/dataLayer/search.js.map +1 -1
- package/dist/dataLayer/transaction.d.ts +1 -1
- package/dist/dataLayer/transaction.js +3 -4
- package/dist/dataLayer/transaction.js.map +1 -1
- package/dist/dataLayer/update.d.ts +2 -8
- package/dist/dataLayer/update.js +53 -18
- package/dist/dataLayer/update.js.map +1 -1
- package/dist/globals.d.ts +1 -1
- package/dist/globals.js +1 -0
- package/dist/globals.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/json/systemSchema.json +65 -0
- package/dist/launchServiceScripts/launchHarperDB.d.ts +1 -0
- package/dist/launchServiceScripts/launchHarperDB.js +3 -0
- package/dist/launchServiceScripts/launchHarperDB.js.map +1 -0
- package/dist/launchServiceScripts/utility/checkNodeVersion.js +3 -0
- package/dist/launchServiceScripts/utility/checkNodeVersion.js.map +1 -1
- package/dist/resources/DatabaseTransaction.d.ts +14 -6
- package/dist/resources/DatabaseTransaction.js +39 -15
- package/dist/resources/DatabaseTransaction.js.map +1 -1
- package/dist/resources/ErrorResource.d.ts +1 -1
- package/dist/resources/ErrorResource.js +3 -1
- package/dist/resources/ErrorResource.js.map +1 -1
- package/dist/resources/LMDBTransaction.d.ts +10 -13
- package/dist/resources/LMDBTransaction.js +18 -7
- package/dist/resources/LMDBTransaction.js.map +1 -1
- package/dist/resources/RecordEncoder.d.ts +7 -1
- package/dist/resources/RecordEncoder.js +5 -2
- package/dist/resources/RecordEncoder.js.map +1 -1
- package/dist/resources/RequestTarget.d.ts +1 -0
- package/dist/resources/RequestTarget.js.map +1 -1
- package/dist/resources/Resource.d.ts +9 -5
- package/dist/resources/Resource.js +37 -10
- package/dist/resources/Resource.js.map +1 -1
- package/dist/resources/ResourceInterface.d.ts +24 -5
- package/dist/resources/ResourceInterface.js +20 -0
- package/dist/resources/ResourceInterface.js.map +1 -1
- package/dist/resources/Resources.d.ts +3 -4
- package/dist/resources/Resources.js +7 -6
- package/dist/resources/Resources.js.map +1 -1
- package/dist/resources/RocksIndexStore.js +3 -0
- package/dist/resources/RocksIndexStore.js.map +1 -1
- package/dist/resources/RocksTransactionLogStore.d.ts +1 -1
- package/dist/resources/RocksTransactionLogStore.js +46 -27
- package/dist/resources/RocksTransactionLogStore.js.map +1 -1
- package/dist/resources/Table.d.ts +59 -329
- package/dist/resources/Table.js +267 -107
- package/dist/resources/Table.js.map +1 -1
- package/dist/resources/analytics/metadata.d.ts +1 -0
- package/dist/resources/analytics/metadata.js +1 -0
- package/dist/resources/analytics/metadata.js.map +1 -1
- package/dist/resources/analytics/read.d.ts +5 -0
- package/dist/resources/analytics/read.js +16 -5
- package/dist/resources/analytics/read.js.map +1 -1
- package/dist/resources/analytics/write.d.ts +28 -0
- package/dist/resources/analytics/write.js +232 -20
- package/dist/resources/analytics/write.js.map +1 -1
- package/dist/resources/auditStore.d.ts +18 -13
- package/dist/resources/auditStore.js +13 -8
- package/dist/resources/auditStore.js.map +1 -1
- package/dist/resources/blob.d.ts +16 -27
- package/dist/resources/blob.js +8 -8
- package/dist/resources/blob.js.map +1 -1
- package/dist/resources/dataLoader.d.ts +1 -1
- package/dist/resources/dataLoader.js +13 -13
- package/dist/resources/databases.d.ts +13 -0
- package/dist/resources/databases.js +160 -52
- package/dist/resources/databases.js.map +1 -1
- package/dist/resources/graphql.d.ts +1 -7
- package/dist/resources/graphql.js +224 -174
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +16 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +308 -59
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
- package/dist/resources/indexes/vector.d.ts +1 -0
- package/dist/resources/indexes/vector.js +14 -0
- package/dist/resources/indexes/vector.js.map +1 -1
- package/dist/resources/loadEnv.d.ts +2 -5
- package/dist/resources/loadEnv.js +21 -18
- package/dist/resources/loadEnv.js.map +1 -1
- package/dist/resources/login.d.ts +2 -3
- package/dist/resources/login.js +5 -4
- package/dist/resources/login.js.map +1 -1
- package/dist/resources/models/Models.d.ts +45 -0
- package/dist/resources/models/Models.js +265 -0
- package/dist/resources/models/Models.js.map +1 -0
- package/dist/resources/models/TestBackend.d.ts +15 -0
- package/dist/resources/models/TestBackend.js +71 -0
- package/dist/resources/models/TestBackend.js.map +1 -0
- package/dist/resources/models/agentLoop.d.ts +125 -0
- package/dist/resources/models/agentLoop.js +746 -0
- package/dist/resources/models/agentLoop.js.map +1 -0
- package/dist/resources/models/analyticsTable.d.ts +65 -0
- package/dist/resources/models/analyticsTable.js +166 -0
- package/dist/resources/models/analyticsTable.js.map +1 -0
- package/dist/resources/models/backendHelpers.d.ts +57 -0
- package/dist/resources/models/backendHelpers.js +109 -0
- package/dist/resources/models/backendHelpers.js.map +1 -0
- package/dist/resources/models/backendRegistry.d.ts +36 -0
- package/dist/resources/models/backendRegistry.js +54 -0
- package/dist/resources/models/backendRegistry.js.map +1 -0
- package/dist/resources/models/bootstrap.d.ts +24 -0
- package/dist/resources/models/bootstrap.js +112 -0
- package/dist/resources/models/bootstrap.js.map +1 -0
- package/dist/resources/models/embedHook.d.ts +33 -0
- package/dist/resources/models/embedHook.js +127 -0
- package/dist/resources/models/embedHook.js.map +1 -0
- package/dist/resources/models/types.d.ts +301 -0
- package/dist/resources/models/types.js +11 -0
- package/dist/resources/models/types.js.map +1 -0
- package/dist/resources/replayLogs.js +7 -1
- package/dist/resources/replayLogs.js.map +1 -1
- package/dist/resources/roles.d.ts +1 -7
- package/dist/resources/roles.js +67 -71
- package/dist/resources/roles.js.map +1 -1
- package/dist/resources/search.d.ts +18 -1
- package/dist/resources/search.js +349 -140
- package/dist/resources/search.js.map +1 -1
- package/dist/resources/tracked.d.ts +1 -1
- package/dist/resources/tracked.js +14 -14
- package/dist/resources/tracked.js.map +1 -1
- package/dist/resources/transaction.d.ts +1 -1
- package/dist/resources/transaction.js +1 -1
- package/dist/resources/transaction.js.map +1 -1
- package/dist/resources/transactionBroadcast.d.ts +1 -1
- package/dist/resources/transactionBroadcast.js.map +1 -1
- package/dist/security/auth.d.ts +1 -5
- package/dist/security/auth.js +34 -25
- package/dist/security/auth.js.map +1 -1
- package/dist/security/certificateVerification/crlVerification.js +7 -1
- package/dist/security/certificateVerification/crlVerification.js.map +1 -1
- package/dist/security/cryptoHash.d.ts +2 -2
- package/dist/security/cryptoHash.js +37 -5
- package/dist/security/cryptoHash.js.map +1 -1
- package/dist/security/data_objects/PermissionAttributeResponseObject.d.ts +3 -4
- package/dist/security/data_objects/PermissionAttributeResponseObject.js +4 -1
- package/dist/security/data_objects/PermissionAttributeResponseObject.js.map +1 -1
- package/dist/security/data_objects/PermissionResponseObject.d.ts +9 -9
- package/dist/security/data_objects/PermissionResponseObject.js +15 -8
- package/dist/security/data_objects/PermissionResponseObject.js.map +1 -1
- package/dist/security/data_objects/PermissionTableResponseObject.d.ts +5 -6
- package/dist/security/data_objects/PermissionTableResponseObject.js +6 -1
- package/dist/security/data_objects/PermissionTableResponseObject.js.map +1 -1
- package/dist/security/fastifyAuth.d.ts +2 -2
- package/dist/security/fastifyAuth.js +131 -22
- package/dist/security/fastifyAuth.js.map +1 -1
- package/dist/security/impersonation.js +15 -15
- package/dist/security/jsLoader.js +18 -5
- package/dist/security/jsLoader.js.map +1 -1
- package/dist/security/keys.d.ts +45 -48
- package/dist/security/keys.js +160 -114
- package/dist/security/keys.js.map +1 -1
- package/dist/security/permissionsTranslator.js +2 -2
- package/dist/security/role.d.ts +5 -5
- package/dist/security/role.js +70 -35
- package/dist/security/role.js.map +1 -1
- package/dist/security/tokenAuthentication.d.ts +13 -0
- package/dist/security/tokenAuthentication.js +57 -27
- package/dist/security/tokenAuthentication.js.map +1 -1
- package/dist/security/user.js +74 -38
- package/dist/security/user.js.map +1 -1
- package/dist/server/DurableSubscriptionsSession.d.ts +4 -2
- package/dist/server/DurableSubscriptionsSession.js +71 -55
- package/dist/server/DurableSubscriptionsSession.js.map +1 -1
- package/dist/server/REST.d.ts +1 -8
- package/dist/server/REST.js +17 -16
- package/dist/server/REST.js.map +1 -1
- package/dist/server/Server.d.ts +23 -4
- package/dist/server/Server.js +1 -1
- package/dist/server/Server.js.map +1 -1
- package/dist/server/fastifyRoutes/helpers/getCORSOptions.js +1 -1
- package/dist/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js +1 -1
- package/dist/server/fastifyRoutes/helpers/getServerOptions.js +1 -1
- package/dist/server/fastifyRoutes.d.ts +1 -4
- package/dist/server/fastifyRoutes.js +34 -30
- package/dist/server/fastifyRoutes.js.map +1 -1
- package/dist/server/graphqlQuerying.d.ts +1 -1
- package/dist/server/graphqlQuerying.js +8 -7
- package/dist/server/graphqlQuerying.js.map +1 -1
- package/dist/server/http.d.ts +9 -4
- package/dist/server/http.js +523 -47
- package/dist/server/http.js.map +1 -1
- package/dist/server/itc/serverHandlers.js +66 -15
- package/dist/server/itc/serverHandlers.js.map +1 -1
- package/dist/server/jobs/JobObject.d.ts +3 -3
- package/dist/server/jobs/JobObject.js +53 -7
- package/dist/server/jobs/JobObject.js.map +1 -1
- package/dist/server/jobs/jobProcess.js +64 -24
- package/dist/server/jobs/jobProcess.js.map +1 -1
- package/dist/server/jobs/jobRunner.d.ts +7 -6
- package/dist/server/jobs/jobRunner.js +68 -30
- package/dist/server/jobs/jobRunner.js.map +1 -1
- package/dist/server/jobs/jobs.d.ts +18 -7
- package/dist/server/jobs/jobs.js +93 -61
- package/dist/server/jobs/jobs.js.map +1 -1
- package/dist/server/loadRootComponents.js +1 -1
- package/dist/server/middlewareChain.d.ts +80 -0
- package/dist/server/middlewareChain.js +252 -0
- package/dist/server/middlewareChain.js.map +1 -0
- package/dist/server/mqtt.d.ts +1 -8
- package/dist/server/mqtt.js +22 -17
- package/dist/server/mqtt.js.map +1 -1
- package/dist/server/nodeName.js +44 -13
- package/dist/server/nodeName.js.map +1 -1
- package/dist/server/operationsServer.d.ts +2 -2
- package/dist/server/operationsServer.js +106 -33
- package/dist/server/operationsServer.js.map +1 -1
- package/dist/server/serverHelpers/Headers.d.ts +4 -4
- package/dist/server/serverHelpers/Headers.js +2 -0
- package/dist/server/serverHelpers/Headers.js.map +1 -1
- package/dist/server/serverHelpers/JSONStream.d.ts +7 -1
- package/dist/server/serverHelpers/JSONStream.js +12 -3
- package/dist/server/serverHelpers/JSONStream.js.map +1 -1
- package/dist/server/serverHelpers/Request.d.ts +106 -8
- package/dist/server/serverHelpers/Request.js +370 -9
- package/dist/server/serverHelpers/Request.js.map +1 -1
- package/dist/server/serverHelpers/contentTypes.d.ts +1 -1
- package/dist/server/serverHelpers/contentTypes.js +36 -7
- package/dist/server/serverHelpers/contentTypes.js.map +1 -1
- package/dist/server/serverHelpers/multipartParser.d.ts +21 -0
- package/dist/server/serverHelpers/multipartParser.js +142 -0
- package/dist/server/serverHelpers/multipartParser.js.map +1 -0
- package/dist/server/serverHelpers/progressEmitter.d.ts +25 -0
- package/dist/server/serverHelpers/progressEmitter.js +103 -0
- package/dist/server/serverHelpers/progressEmitter.js.map +1 -0
- package/dist/server/serverHelpers/serverHandlers.d.ts +1 -1
- package/dist/server/serverHelpers/serverHandlers.js +38 -7
- package/dist/server/serverHelpers/serverHandlers.js.map +1 -1
- package/dist/server/serverHelpers/serverUtilities.d.ts +4 -2
- package/dist/server/serverHelpers/serverUtilities.js +97 -93
- package/dist/server/serverHelpers/serverUtilities.js.map +1 -1
- package/dist/server/static.js +8 -5
- package/dist/server/static.js.map +1 -1
- package/dist/server/status/index.js +3 -3
- package/dist/server/storageReclamation.d.ts +10 -0
- package/dist/server/storageReclamation.js +68 -9
- package/dist/server/storageReclamation.js.map +1 -1
- package/dist/server/threads/itc.js +7 -4
- package/dist/server/threads/itc.js.map +1 -1
- package/dist/server/threads/manageThreads.d.ts +1 -1
- package/dist/server/threads/manageThreads.js +110 -26
- package/dist/server/threads/manageThreads.js.map +1 -1
- package/dist/server/threads/socketRouter.d.ts +0 -1
- package/dist/server/threads/socketRouter.js +8 -271
- package/dist/server/threads/socketRouter.js.map +1 -1
- package/dist/server/threads/threadServer.d.ts +1 -0
- package/dist/server/threads/threadServer.js +360 -118
- package/dist/server/threads/threadServer.js.map +1 -1
- package/dist/server/threads/workerProcessGuard.d.ts +42 -0
- package/dist/server/threads/workerProcessGuard.js +114 -0
- package/dist/server/threads/workerProcessGuard.js.map +1 -0
- package/dist/server/throttle.js +17 -0
- package/dist/server/throttle.js.map +1 -1
- package/dist/sqlTranslator/SelectValidator.d.ts +21 -24
- package/dist/sqlTranslator/SelectValidator.js +86 -47
- package/dist/sqlTranslator/SelectValidator.js.map +1 -1
- package/dist/sqlTranslator/alasqlFunctionImporter.d.ts +6 -2
- package/dist/sqlTranslator/alasqlFunctionImporter.js +40 -3
- package/dist/sqlTranslator/alasqlFunctionImporter.js.map +1 -1
- package/dist/sqlTranslator/deleteTranslator.d.ts +4 -7
- package/dist/sqlTranslator/deleteTranslator.js +48 -14
- package/dist/sqlTranslator/deleteTranslator.js.map +1 -1
- package/dist/sqlTranslator/index.d.ts +10 -9
- package/dist/sqlTranslator/index.js +69 -30
- package/dist/sqlTranslator/index.js.map +1 -1
- package/dist/sqlTranslator/sql_statement_bucket.d.ts +10 -10
- package/dist/sqlTranslator/sql_statement_bucket.js +55 -13
- package/dist/sqlTranslator/sql_statement_bucket.js.map +1 -1
- package/dist/upgrade/UpgradeObjects.d.ts +2 -3
- package/dist/upgrade/UpgradeObjects.js +37 -4
- package/dist/upgrade/UpgradeObjects.js.map +1 -1
- package/dist/upgrade/directives/5-2-0.d.ts +6 -0
- package/dist/upgrade/directives/5-2-0.js +77 -0
- package/dist/upgrade/directives/5-2-0.js.map +1 -0
- package/dist/upgrade/directives/directivesController.d.ts +10 -10
- package/dist/upgrade/directives/directivesController.js +52 -11
- package/dist/upgrade/directives/directivesController.js.map +1 -1
- package/dist/upgrade/directivesManager.d.ts +1 -1
- package/dist/upgrade/directivesManager.js +53 -18
- package/dist/upgrade/directivesManager.js.map +1 -1
- package/dist/upgrade/upgradePrompt.d.ts +3 -3
- package/dist/upgrade/upgradePrompt.js +65 -30
- package/dist/upgrade/upgradePrompt.js.map +1 -1
- package/dist/upgrade/upgradeUtilities.d.ts +1 -1
- package/dist/upgrade/upgradeUtilities.js +37 -5
- package/dist/upgrade/upgradeUtilities.js.map +1 -1
- package/dist/utility/OperationFunctionCaller.d.ts +1 -1
- package/dist/utility/OperationFunctionCaller.js +45 -10
- package/dist/utility/OperationFunctionCaller.js.map +1 -1
- package/dist/utility/assignCmdEnvVariables.d.ts +1 -2
- package/dist/utility/assignCmdEnvVariables.js +8 -4
- package/dist/utility/assignCmdEnvVariables.js.map +1 -1
- package/dist/utility/common_utils.d.ts +80 -77
- package/dist/utility/common_utils.js +140 -79
- package/dist/utility/common_utils.js.map +1 -1
- package/dist/utility/environment/environmentManager.d.ts +12 -11
- package/dist/utility/environment/environmentManager.js +75 -29
- package/dist/utility/environment/environmentManager.js.map +1 -1
- package/dist/utility/environment/systemInformation.d.ts +4 -0
- package/dist/utility/environment/systemInformation.js +27 -16
- package/dist/utility/environment/systemInformation.js.map +1 -1
- package/dist/utility/errors/commonErrors.d.ts +192 -168
- package/dist/utility/errors/commonErrors.js +49 -18
- package/dist/utility/errors/commonErrors.js.map +1 -1
- package/dist/utility/errors/hdbError.d.ts +37 -51
- package/dist/utility/errors/hdbError.js +65 -26
- package/dist/utility/errors/hdbError.js.map +1 -1
- package/dist/utility/expandEnvVar.d.ts +61 -0
- package/dist/utility/expandEnvVar.js +113 -0
- package/dist/utility/expandEnvVar.js.map +1 -0
- package/dist/utility/functions/geo.js +2 -2
- package/dist/utility/functions/sql/alaSQLExtension.js +1 -1
- package/dist/utility/globalSchema.d.ts +13 -4
- package/dist/utility/globalSchema.js +14 -11
- package/dist/utility/globalSchema.js.map +1 -1
- package/dist/utility/hdbTerms.d.ts +56 -0
- package/dist/utility/hdbTerms.js +56 -0
- package/dist/utility/hdbTerms.js.map +1 -1
- package/dist/utility/install/checkJWTTokensExist.js +1 -1
- package/dist/utility/install/installer.d.ts +9 -12
- package/dist/utility/install/installer.js +87 -51
- package/dist/utility/install/installer.js.map +1 -1
- package/dist/utility/installation.js +3 -3
- package/dist/utility/lmdb/DBIDefinition.d.ts +4 -4
- package/dist/utility/lmdb/DBIDefinition.js +5 -1
- package/dist/utility/lmdb/DBIDefinition.js.map +1 -1
- package/dist/utility/lmdb/DeleteRecordsResponseObject.d.ts +3 -6
- package/dist/utility/lmdb/DeleteRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/DeleteRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/InsertRecordsResponseObject.d.ts +3 -5
- package/dist/utility/lmdb/InsertRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/InsertRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/OpenDBIObject.d.ts +11 -15
- package/dist/utility/lmdb/OpenDBIObject.js +54 -6
- package/dist/utility/lmdb/OpenDBIObject.js.map +1 -1
- package/dist/utility/lmdb/OpenEnvironmentObject.d.ts +5 -8
- package/dist/utility/lmdb/OpenEnvironmentObject.js +52 -4
- package/dist/utility/lmdb/OpenEnvironmentObject.js.map +1 -1
- package/dist/utility/lmdb/UpdateRecordsResponseObject.d.ts +3 -6
- package/dist/utility/lmdb/UpdateRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/UpdateRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/UpsertRecordsResponseObject.d.ts +3 -5
- package/dist/utility/lmdb/UpsertRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/UpsertRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/cleanLMDBMap.d.ts +1 -1
- package/dist/utility/lmdb/cleanLMDBMap.js +44 -7
- package/dist/utility/lmdb/cleanLMDBMap.js.map +1 -1
- package/dist/utility/lmdb/commonUtility.d.ts +8 -9
- package/dist/utility/lmdb/commonUtility.js +46 -17
- package/dist/utility/lmdb/commonUtility.js.map +1 -1
- package/dist/utility/lmdb/deleteUtility.d.ts +2 -3
- package/dist/utility/lmdb/deleteUtility.js +51 -16
- package/dist/utility/lmdb/deleteUtility.js.map +1 -1
- package/dist/utility/lmdb/environmentUtility.d.ts +69 -36
- package/dist/utility/lmdb/environmentUtility.js +91 -51
- package/dist/utility/lmdb/environmentUtility.js.map +1 -1
- package/dist/utility/lmdb/searchCursorFunctions.d.ts +19 -19
- package/dist/utility/lmdb/searchCursorFunctions.js +46 -14
- package/dist/utility/lmdb/searchCursorFunctions.js.map +1 -1
- package/dist/utility/lmdb/searchUtility.d.ts +142 -73
- package/dist/utility/lmdb/searchUtility.js +91 -55
- package/dist/utility/lmdb/searchUtility.js.map +1 -1
- package/dist/utility/lmdb/terms.d.ts +34 -34
- package/dist/utility/lmdb/terms.js +12 -22
- package/dist/utility/lmdb/terms.js.map +1 -1
- package/dist/utility/lmdb/writeUtility.d.ts +3 -6
- package/dist/utility/lmdb/writeUtility.js +61 -28
- package/dist/utility/lmdb/writeUtility.js.map +1 -1
- package/dist/utility/logging/harper_logger.d.ts +87 -103
- package/dist/utility/logging/harper_logger.js +176 -81
- package/dist/utility/logging/harper_logger.js.map +1 -1
- package/dist/utility/logging/logRotator.d.ts +2 -10
- package/dist/utility/logging/logRotator.js +65 -28
- package/dist/utility/logging/logRotator.js.map +1 -1
- package/dist/utility/logging/logger.js +4 -4
- package/dist/utility/logging/readLog.d.ts +1 -1
- package/dist/utility/logging/readLog.js +54 -17
- package/dist/utility/logging/readLog.js.map +1 -1
- package/dist/utility/logging/transactionLog.d.ts +2 -2
- package/dist/utility/logging/transactionLog.js +51 -16
- package/dist/utility/logging/transactionLog.js.map +1 -1
- package/dist/utility/mount_hdb.d.ts +1 -2
- package/dist/utility/mount_hdb.js +54 -17
- package/dist/utility/mount_hdb.js.map +1 -1
- package/dist/utility/npmUtilities.d.ts +1 -1
- package/dist/utility/npmUtilities.js +54 -19
- package/dist/utility/npmUtilities.js.map +1 -1
- package/dist/utility/operation_authorization.d.ts +36 -9
- package/dist/utility/operation_authorization.js +135 -86
- package/dist/utility/operation_authorization.js.map +1 -1
- package/dist/utility/packageUtils.d.ts +0 -2
- package/dist/utility/packageUtils.js +7 -17
- package/dist/utility/packageUtils.js.map +1 -1
- package/dist/utility/password.js +2 -2
- package/dist/utility/processManagement/processManagement.js +2 -2
- package/dist/utility/processManagement/servicesConfig.js +1 -1
- package/dist/utility/signalling.d.ts +2 -2
- package/dist/utility/signalling.js +51 -16
- package/dist/utility/signalling.js.map +1 -1
- package/dist/utility/watcherFallback.d.ts +36 -0
- package/dist/utility/watcherFallback.js +73 -0
- package/dist/utility/watcherFallback.js.map +1 -0
- package/dist/validation/analyticsValidator.d.ts +1 -0
- package/dist/validation/analyticsValidator.js +79 -0
- package/dist/validation/analyticsValidator.js.map +1 -0
- package/dist/validation/bulkDeleteValidator.d.ts +1 -2
- package/dist/validation/bulkDeleteValidator.js +49 -11
- package/dist/validation/bulkDeleteValidator.js.map +1 -1
- package/dist/validation/check_permissions.d.ts +1 -2
- package/dist/validation/check_permissions.js +38 -3
- package/dist/validation/check_permissions.js.map +1 -1
- package/dist/validation/common_validators.d.ts +20 -20
- package/dist/validation/common_validators.js +62 -31
- package/dist/validation/common_validators.js.map +1 -1
- package/dist/validation/configValidator.d.ts +4 -4
- package/dist/validation/configValidator.js +189 -54
- package/dist/validation/configValidator.js.map +1 -1
- package/dist/validation/deleteValidator.d.ts +1 -2
- package/dist/validation/deleteValidator.js +49 -11
- package/dist/validation/deleteValidator.js.map +1 -1
- package/dist/validation/fileLoadValidator.d.ts +4 -4
- package/dist/validation/fileLoadValidator.js +67 -32
- package/dist/validation/fileLoadValidator.js.map +1 -1
- package/dist/validation/insertValidator.d.ts +1 -2
- package/dist/validation/insertValidator.js +48 -10
- package/dist/validation/insertValidator.js.map +1 -1
- package/dist/validation/installValidator.d.ts +2 -2
- package/dist/validation/installValidator.js +47 -10
- package/dist/validation/installValidator.js.map +1 -1
- package/dist/validation/readLogValidator.d.ts +1 -2
- package/dist/validation/readLogValidator.js +60 -22
- package/dist/validation/readLogValidator.js.map +1 -1
- package/dist/validation/role_validation.d.ts +3 -3
- package/dist/validation/role_validation.js +55 -19
- package/dist/validation/role_validation.js.map +1 -1
- package/dist/validation/schemaMetadataValidator.d.ts +3 -4
- package/dist/validation/schemaMetadataValidator.js +11 -12
- package/dist/validation/schemaMetadataValidator.js.map +1 -1
- package/dist/validation/searchValidator.d.ts +1 -2
- package/dist/validation/searchValidator.js +82 -43
- package/dist/validation/searchValidator.js.map +1 -1
- package/dist/validation/statusValidator.d.ts +1 -1
- package/dist/validation/transactionLogValidator.d.ts +3 -3
- package/dist/validation/transactionLogValidator.js +52 -17
- package/dist/validation/transactionLogValidator.js.map +1 -1
- package/dist/validation/user_validation.d.ts +3 -3
- package/dist/validation/user_validation.js +38 -6
- package/dist/validation/user_validation.js.map +1 -1
- package/dist/validation/validationWrapper.d.ts +3 -3
- package/dist/validation/validationWrapper.js +4 -5
- package/dist/validation/validationWrapper.js.map +1 -1
- package/index.ts +5 -0
- package/json/systemSchema.json +65 -0
- package/launchServiceScripts/utility/checkNodeVersion.js +2 -0
- package/package.json +37 -22
- package/resources/DESIGN.md +98 -0
- package/resources/DatabaseTransaction.ts +58 -30
- package/resources/ErrorResource.ts +2 -1
- package/resources/LMDBTransaction.ts +38 -29
- package/resources/RecordEncoder.ts +12 -4
- package/resources/RequestTarget.ts +2 -0
- package/resources/Resource.ts +89 -56
- package/resources/ResourceInterface.ts +44 -21
- package/resources/Resources.ts +8 -8
- package/resources/RocksIndexStore.ts +3 -0
- package/resources/RocksTransactionLogStore.ts +47 -28
- package/resources/Table.ts +386 -214
- package/resources/analytics/metadata.ts +1 -0
- package/resources/analytics/read.ts +24 -6
- package/resources/analytics/write.ts +240 -17
- package/resources/auditStore.ts +28 -19
- package/resources/blob.ts +53 -53
- package/resources/dataLoader.ts +4 -4
- package/resources/databases.ts +190 -71
- package/resources/graphql.ts +227 -164
- package/resources/indexes/HierarchicalNavigableSmallWorld.ts +294 -65
- package/resources/indexes/vector.ts +17 -0
- package/resources/loadEnv.ts +21 -17
- package/resources/login.ts +5 -3
- package/resources/models/Models.ts +304 -0
- package/resources/models/TestBackend.ts +83 -0
- package/resources/models/agentLoop.ts +895 -0
- package/resources/models/analyticsTable.ts +199 -0
- package/resources/models/backendHelpers.ts +116 -0
- package/resources/models/backendRegistry.ts +66 -0
- package/resources/models/bootstrap.ts +135 -0
- package/resources/models/embedHook.ts +138 -0
- package/resources/models/types.ts +296 -0
- package/resources/replayLogs.ts +15 -7
- package/resources/roles.ts +62 -67
- package/resources/search.ts +355 -135
- package/resources/tracked.ts +8 -8
- package/resources/transaction.ts +8 -8
- package/resources/transactionBroadcast.ts +3 -3
- package/security/auth.ts +35 -26
- package/security/certificateVerification/crlVerification.ts +11 -4
- package/security/{cryptoHash.js → cryptoHash.ts} +3 -8
- package/security/data_objects/{PermissionAttributeResponseObject.js → PermissionAttributeResponseObject.ts} +4 -4
- package/security/data_objects/{PermissionResponseObject.js → PermissionResponseObject.ts} +12 -11
- package/security/data_objects/{PermissionTableResponseObject.js → PermissionTableResponseObject.ts} +6 -4
- package/security/{fastifyAuth.js → fastifyAuth.ts} +93 -20
- package/security/impersonation.ts +3 -3
- package/security/jsLoader.ts +22 -8
- package/security/{keys.js → keys.ts} +113 -121
- package/security/permissionsTranslator.js +2 -2
- package/security/{role.js → role.ts} +26 -33
- package/security/tokenAuthentication.ts +34 -7
- package/security/user.ts +26 -22
- package/server/DESIGN.md +139 -0
- package/server/DurableSubscriptionsSession.ts +67 -50
- package/server/REST.ts +120 -107
- package/server/Server.ts +31 -12
- package/server/fastifyRoutes/helpers/getCORSOptions.js +1 -1
- package/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js +1 -1
- package/server/fastifyRoutes/helpers/getServerOptions.js +1 -1
- package/server/fastifyRoutes.ts +37 -33
- package/server/graphqlQuerying.ts +6 -5
- package/server/http.ts +517 -26
- package/server/itc/serverHandlers.js +75 -14
- package/server/jobs/{JobObject.js → JobObject.ts} +13 -6
- package/server/jobs/{jobProcess.js → jobProcess.ts} +20 -16
- package/server/jobs/{jobRunner.js → jobRunner.ts} +20 -21
- package/server/jobs/{jobs.js → jobs.ts} +41 -44
- package/server/loadRootComponents.js +1 -1
- package/server/middlewareChain.ts +270 -0
- package/server/mqtt.ts +35 -26
- package/server/nodeName.ts +2 -1
- package/server/operationsServer.ts +85 -10
- package/server/serverHelpers/Headers.ts +10 -8
- package/server/serverHelpers/JSONStream.ts +15 -5
- package/server/serverHelpers/Request.ts +370 -13
- package/server/serverHelpers/contentTypes.ts +42 -11
- package/server/serverHelpers/multipartParser.ts +152 -0
- package/server/serverHelpers/progressEmitter.ts +110 -0
- package/server/serverHelpers/serverHandlers.js +43 -7
- package/server/serverHelpers/serverUtilities.ts +40 -30
- package/server/static.ts +9 -6
- package/server/status/index.ts +2 -2
- package/server/storageReclamation.ts +39 -2
- package/server/threads/itc.js +7 -4
- package/server/threads/manageThreads.js +100 -26
- package/server/threads/socketRouter.ts +12 -275
- package/server/threads/threadServer.js +345 -105
- package/server/threads/workerProcessGuard.ts +93 -0
- package/server/throttle.ts +18 -0
- package/sqlTranslator/{SelectValidator.js → SelectValidator.ts} +41 -49
- package/sqlTranslator/{alasqlFunctionImporter.js → alasqlFunctionImporter.ts} +5 -5
- package/sqlTranslator/{deleteTranslator.js → deleteTranslator.ts} +13 -18
- package/sqlTranslator/{index.js → index.ts} +30 -33
- package/sqlTranslator/{sql_statement_bucket.js → sql_statement_bucket.ts} +49 -20
- package/static/README.md +10 -9
- package/studio/web/assets/{index-CmtPP0YO.js → index-COfIkCT-.js} +5 -5
- package/studio/web/assets/index-COfIkCT-.js.map +1 -0
- package/studio/web/assets/{index.lazy-C8jvGtlu.js → index.lazy-CIvl7Fj9.js} +2 -2
- package/studio/web/assets/{index.lazy-C8jvGtlu.js.map → index.lazy-CIvl7Fj9.js.map} +1 -1
- package/studio/web/assets/{profile-O0DYlJUv.js → profile-B2ZVB--r.js} +2 -2
- package/studio/web/assets/{profile-O0DYlJUv.js.map → profile-B2ZVB--r.js.map} +1 -1
- package/studio/web/assets/{status-BIlJkJby.js → status-Db6WBmhf.js} +2 -2
- package/studio/web/assets/{status-BIlJkJby.js.map → status-Db6WBmhf.js.map} +1 -1
- package/studio/web/index.html +1 -1
- package/upgrade/{UpgradeObjects.js → UpgradeObjects.ts} +3 -6
- package/upgrade/directives/5-2-0.ts +49 -0
- package/upgrade/directives/{directivesController.js → directivesController.ts} +16 -16
- package/upgrade/{directivesManager.js → directivesManager.ts} +7 -11
- package/upgrade/{upgradePrompt.js → upgradePrompt.ts} +8 -14
- package/upgrade/{upgradeUtilities.js → upgradeUtilities.ts} +3 -7
- package/utility/{OperationFunctionCaller.js → OperationFunctionCaller.ts} +7 -7
- package/utility/{assignCmdEnvVariables.js → assignCmdEnvVariables.ts} +6 -8
- package/utility/{common_utils.js → common_utils.ts} +113 -139
- package/utility/environment/{environmentManager.js → environmentManager.ts} +34 -33
- package/utility/environment/systemInformation.ts +18 -4
- package/utility/errors/{commonErrors.js → commonErrors.ts} +9 -9
- package/utility/errors/{hdbError.js → hdbError.ts} +39 -45
- package/utility/expandEnvVar.ts +110 -0
- package/utility/functions/geo.js +2 -2
- package/utility/functions/sql/alaSQLExtension.js +1 -1
- package/utility/globalSchema.ts +30 -0
- package/utility/hdbTerms.ts +56 -0
- package/utility/install/checkJWTTokensExist.js +1 -1
- package/utility/install/{installer.js → installer.ts} +38 -39
- package/utility/installation.ts +2 -2
- package/utility/lmdb/{DBIDefinition.js → DBIDefinition.ts} +4 -1
- package/utility/lmdb/{DeleteRecordsResponseObject.js → DeleteRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/{InsertRecordsResponseObject.js → InsertRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/OpenDBIObject.ts +43 -0
- package/utility/lmdb/{OpenEnvironmentObject.js → OpenEnvironmentObject.ts} +19 -6
- package/utility/lmdb/{UpdateRecordsResponseObject.js → UpdateRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/{UpsertRecordsResponseObject.js → UpsertRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/{cleanLMDBMap.js → cleanLMDBMap.ts} +5 -5
- package/utility/lmdb/{commonUtility.js → commonUtility.ts} +13 -21
- package/utility/lmdb/{deleteUtility.js → deleteUtility.ts} +8 -12
- package/utility/lmdb/{environmentUtility.js → environmentUtility.ts} +43 -52
- package/utility/lmdb/{searchCursorFunctions.js → searchCursorFunctions.ts} +12 -26
- package/utility/lmdb/{searchUtility.js → searchUtility.ts} +75 -64
- package/utility/lmdb/{terms.js → terms.ts} +10 -23
- package/utility/lmdb/{writeUtility.js → writeUtility.ts} +37 -22
- package/utility/logging/{harper_logger.js → harper_logger.ts} +136 -89
- package/utility/logging/{logRotator.js → logRotator.ts} +13 -13
- package/utility/logging/logger.ts +1 -1
- package/utility/logging/{readLog.js → readLog.ts} +19 -19
- package/utility/logging/{transactionLog.js → transactionLog.ts} +10 -14
- package/utility/{mount_hdb.js → mount_hdb.ts} +15 -16
- package/utility/{npmUtilities.js → npmUtilities.ts} +14 -17
- package/utility/{operation_authorization.js → operation_authorization.ts} +173 -124
- package/utility/packageUtils.js +7 -16
- package/utility/password.ts +1 -1
- package/utility/processManagement/processManagement.js +2 -2
- package/utility/processManagement/servicesConfig.js +1 -1
- package/utility/{signalling.js → signalling.ts} +6 -11
- package/utility/watcherFallback.ts +74 -0
- package/validation/analyticsValidator.ts +43 -0
- package/validation/{bulkDeleteValidator.js → bulkDeleteValidator.ts} +5 -5
- package/validation/{check_permissions.js → check_permissions.ts} +3 -3
- package/validation/{common_validators.js → common_validators.ts} +12 -24
- package/validation/{configValidator.js → configValidator.ts} +114 -18
- package/validation/{deleteValidator.js → deleteValidator.ts} +5 -5
- package/validation/{fileLoadValidator.js → fileLoadValidator.ts} +12 -19
- package/validation/{insertValidator.js → insertValidator.ts} +5 -5
- package/validation/{installValidator.js → installValidator.ts} +8 -8
- package/validation/{readLogValidator.js → readLogValidator.ts} +10 -10
- package/validation/{role_validation.js → role_validation.ts} +26 -32
- package/validation/{schemaMetadataValidator.js → schemaMetadataValidator.ts} +5 -11
- package/validation/{searchValidator.js → searchValidator.ts} +12 -11
- package/validation/statusValidator.ts +1 -1
- package/validation/{transactionLogValidator.js → transactionLogValidator.ts} +4 -9
- package/validation/{user_validation.js → user_validation.ts} +4 -10
- package/validation/{validationWrapper.js → validationWrapper.ts} +3 -9
- package/bin/cliOperations.js +0 -159
- package/bin/lite.js +0 -5
- package/dataLayer/harperBridge/BridgeMethods.js +0 -85
- package/studio/web/assets/index-CmtPP0YO.js.map +0 -1
- package/utility/globalSchema.js +0 -35
- package/utility/lmdb/OpenDBIObject.js +0 -31
package/security/jsLoader.ts
CHANGED
|
@@ -2,18 +2,19 @@ import { Resource } from '../resources/Resource.ts';
|
|
|
2
2
|
import { contextStorage, transaction } from '../resources/transaction.ts';
|
|
3
3
|
import { RequestTarget } from '../resources/RequestTarget.ts';
|
|
4
4
|
import { tables, databases } from '../resources/databases.ts';
|
|
5
|
+
import { models as harperModelsSingleton } from '../resources/models/Models.ts';
|
|
5
6
|
import { readFile } from 'node:fs/promises';
|
|
6
7
|
import { dirname, isAbsolute } from 'node:path';
|
|
7
8
|
import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
8
9
|
import { SourceTextModule, SyntheticModule, createContext, runInContext, runInThisContext } from 'node:vm';
|
|
9
10
|
import { ApplicationScope } from '../components/ApplicationScope.ts';
|
|
10
|
-
import logger from '../utility/logging/harper_logger.
|
|
11
|
+
import logger from '../utility/logging/harper_logger.ts';
|
|
11
12
|
import { createRequire } from 'node:module';
|
|
12
13
|
import * as env from '../utility/environment/environmentManager';
|
|
13
14
|
import * as child_process from 'node:child_process';
|
|
14
15
|
import { CONFIG_PARAMS } from '../utility/hdbTerms.ts';
|
|
15
16
|
import { contentTypes } from '../server/serverHelpers/contentTypes.ts';
|
|
16
|
-
import type {
|
|
17
|
+
import type {} from 'ses';
|
|
17
18
|
import {
|
|
18
19
|
mkdirSync,
|
|
19
20
|
readFileSync,
|
|
@@ -39,6 +40,13 @@ const HARPER_MODULE_IDS = new Set([
|
|
|
39
40
|
'@harperfast/harper-pro',
|
|
40
41
|
]);
|
|
41
42
|
|
|
43
|
+
// `harper.models` (consumed by `getHarperExports`) and the top-level
|
|
44
|
+
// `models` package export both point at the same process-wide `Models`
|
|
45
|
+
// singleton declared in `resources/models/Models.ts`. The Models class has
|
|
46
|
+
// no per-Scope or per-ApplicationScope state (registry + analytics writer
|
|
47
|
+
// are process-singletons), so one shared instance is observationally
|
|
48
|
+
// identical to the per-Scope instances built in `components/Scope.ts`.
|
|
49
|
+
|
|
42
50
|
let lockedDown = false;
|
|
43
51
|
/**
|
|
44
52
|
* This is the main entry point for loading plugin and application modules that may be executed in a
|
|
@@ -95,6 +103,7 @@ export async function scopedImport(filePath: string | URL, scope?: ApplicationSc
|
|
|
95
103
|
// is hidden behind a private symbol (arrowMessagePrivateSymbol)
|
|
96
104
|
// on the error object and the only way to access it is to use the
|
|
97
105
|
// internal util.decorateErrorStack() function
|
|
106
|
+
// @ts-ignore
|
|
98
107
|
const util = await import('internal/util');
|
|
99
108
|
util.default.decorateErrorStack(err);
|
|
100
109
|
} catch {
|
|
@@ -640,7 +649,7 @@ async function loadModuleWithVM(moduleUrl: string, scope: ApplicationScope, useC
|
|
|
640
649
|
async function getCompartment(scope: ApplicationScope, globals) {
|
|
641
650
|
const { StaticModuleRecord } = await import('@endo/static-module-record');
|
|
642
651
|
require('ses');
|
|
643
|
-
const compartment:
|
|
652
|
+
const compartment: any = new (Compartment as any)(
|
|
644
653
|
globals,
|
|
645
654
|
{
|
|
646
655
|
//harperdb: { Resource, tables, databases }
|
|
@@ -774,6 +783,11 @@ function getHarperExports(scope: ApplicationScope) {
|
|
|
774
783
|
Resource,
|
|
775
784
|
tables,
|
|
776
785
|
databases,
|
|
786
|
+
// `harper.models` — same singleton that's surfaced as the top-level
|
|
787
|
+
// `models` package export (see `resources/models/Models.ts`). The
|
|
788
|
+
// registry it reads from is populated at boot by
|
|
789
|
+
// `resources/models/bootstrap.ts`.
|
|
790
|
+
models: harperModelsSingleton,
|
|
777
791
|
createBlob,
|
|
778
792
|
RequestTarget,
|
|
779
793
|
getContext,
|
|
@@ -813,7 +827,7 @@ const ALLOWED_NODE_BUILTIN_MODULES = env.get(CONFIG_PARAMS.APPLICATIONS_ALLOWEDB
|
|
|
813
827
|
},
|
|
814
828
|
};
|
|
815
829
|
const ALLOWED_COMMANDS = new Set(env.get(CONFIG_PARAMS.APPLICATIONS_ALLOWEDSPAWNCOMMANDS) ?? []);
|
|
816
|
-
const child_processConstrained = {
|
|
830
|
+
const child_processConstrained: any = {
|
|
817
831
|
exec: createSpawn(child_process.exec),
|
|
818
832
|
execFile: createSpawn(child_process.execFile),
|
|
819
833
|
fork: createSpawn(child_process.fork, true), // this is launching node, so deemed safe
|
|
@@ -1036,14 +1050,14 @@ function createSpawn(spawnFunction: (...args: any) => child_process.ChildProcess
|
|
|
1036
1050
|
*/
|
|
1037
1051
|
function checkAllowedModulePath(moduleUrl: string, allowedPath?: string): boolean {
|
|
1038
1052
|
if (moduleUrl.startsWith('file:')) {
|
|
1039
|
-
let path = moduleUrl
|
|
1053
|
+
let path = fileURLToPath(moduleUrl);
|
|
1040
1054
|
try {
|
|
1041
1055
|
path = realpathSync(path);
|
|
1042
1056
|
} catch {}
|
|
1043
1057
|
if (!allowedPath || path.startsWith(allowedPath)) {
|
|
1044
1058
|
return;
|
|
1045
1059
|
}
|
|
1046
|
-
throw new Error(`Can not load module outside of allowed path`);
|
|
1060
|
+
throw new Error(`Can not load module at ${path} outside of allowed path ${allowedPath}`);
|
|
1047
1061
|
}
|
|
1048
1062
|
let simpleName = moduleUrl.startsWith('node:') ? moduleUrl.slice(5) : moduleUrl;
|
|
1049
1063
|
simpleName = simpleName.split('/')[0];
|
|
@@ -1058,7 +1072,7 @@ export function getUser() {
|
|
|
1058
1072
|
return contextStorage.getStore()?.user;
|
|
1059
1073
|
}
|
|
1060
1074
|
export function getResponse() {
|
|
1061
|
-
return contextStorage.getStore()?.response;
|
|
1075
|
+
return (contextStorage.getStore() as any)?.response;
|
|
1062
1076
|
}
|
|
1063
1077
|
|
|
1064
1078
|
export function preventFunctionConstructor() {
|
|
@@ -1099,7 +1113,7 @@ function freezeIntrinsics() {
|
|
|
1099
1113
|
FinalizationRegistry,
|
|
1100
1114
|
]) {
|
|
1101
1115
|
Object.freeze(Intrinsic);
|
|
1102
|
-
Object.freeze(Intrinsic.prototype);
|
|
1116
|
+
Object.freeze((Intrinsic as any).prototype);
|
|
1103
1117
|
}
|
|
1104
1118
|
Object.freeze(Function);
|
|
1105
1119
|
}
|
|
@@ -1,64 +1,48 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import { watch } from 'chokidar';
|
|
5
|
+
import * as fs from 'fs-extra';
|
|
6
|
+
import * as forge from 'node-forge';
|
|
7
|
+
import * as net from 'net';
|
|
8
|
+
import { generateKeyPair as generateKeyPairOrig, X509Certificate, createPrivateKey, randomBytes } from 'node:crypto';
|
|
9
|
+
|
|
10
|
+
import * as util from 'util';
|
|
11
|
+
const generateKeyPair = util.promisify(generateKeyPairOrig);
|
|
12
|
+
|
|
11
13
|
const pki = forge.pki;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
15
|
+
import { forComponent } from '../utility/logging/harper_logger.ts';
|
|
16
|
+
import * as envManager from '../utility/environment/environmentManager.ts';
|
|
17
|
+
import * as hdbTerms from '../utility/hdbTerms.ts';
|
|
18
|
+
|
|
19
|
+
import * as certificatesTerms from '../utility/terms/certificates.js';
|
|
18
20
|
const tls = require('node:tls');
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
import { relative, join } from 'node:path';
|
|
22
|
+
|
|
23
|
+
import assignCmdenvVars from '../utility/assignCmdEnvVariables.ts';
|
|
24
|
+
import * as configUtils from '../config/configUtils.js';
|
|
25
|
+
import { table, getDatabases, databases } from '../resources/databases.ts';
|
|
24
26
|
const logger = forComponent('tls').conditional;
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
exports.generateCertsKeys = generateCertsKeys;
|
|
36
|
-
exports.getReplicationCert = getReplicationCert;
|
|
37
|
-
exports.getReplicationCertAuth = getReplicationCertAuth;
|
|
38
|
-
exports.renewSelfSigned = renewSelfSigned;
|
|
39
|
-
exports.hostnamesFromCert = hostnamesFromCert;
|
|
40
|
-
exports.getHostnamesFromCertificate = getHostnamesFromCertificate;
|
|
41
|
-
exports.getPrimaryHostName = getPrimaryHostName;
|
|
42
|
-
exports.generateSerialNumber = generateSerialNumber;
|
|
43
|
-
exports.getPrivateKeys = () => privateKeys;
|
|
44
|
-
exports.getCertAuthority = getCertAuthority;
|
|
45
|
-
exports.certExtensions = certExtensions;
|
|
46
|
-
exports.getCommonName = getCommonName;
|
|
47
|
-
|
|
48
|
-
const { readFileSync, statSync } = require('node:fs');
|
|
49
|
-
const { getTicketKeys, onMessageFromWorkers } = require('../server/threads/manageThreads.js');
|
|
50
|
-
const { isMainThread } = require('worker_threads');
|
|
51
|
-
const { TLSSocket } = require('node:tls');
|
|
27
|
+
const { CONFIG_PARAMS } = hdbTerms;
|
|
28
|
+
const { CERTIFICATE_VALUES } = certificatesTerms;
|
|
29
|
+
import { getThisNodeName, getThisNodeUrl, urlToNodeName, clearThisNodeName } from '../server/nodeName.ts';
|
|
30
|
+
|
|
31
|
+
export const getPrivateKeys = () => privateKeys;
|
|
32
|
+
|
|
33
|
+
import { readFileSync, statSync } from 'node:fs';
|
|
34
|
+
import { getTicketKeys, onMessageFromWorkers } from '../server/threads/manageThreads.js';
|
|
35
|
+
import { isMainThread } from 'worker_threads';
|
|
36
|
+
import { TLSSocket } from 'node:tls';
|
|
52
37
|
|
|
53
38
|
const CERT_VALIDITY_DAYS = 3650;
|
|
54
39
|
const CERT_DOMAINS = ['127.0.0.1', 'localhost', '::1'];
|
|
55
|
-
const CERT_ATTRIBUTES = [
|
|
40
|
+
export const CERT_ATTRIBUTES = [
|
|
56
41
|
{ name: 'countryName', value: 'USA' },
|
|
57
42
|
{ name: 'stateOrProvinceName', value: 'Colorado' },
|
|
58
43
|
{ name: 'localityName', value: 'Denver' },
|
|
59
44
|
{ name: 'organizationName', value: 'HarperDB, Inc.' },
|
|
60
45
|
];
|
|
61
|
-
exports.CERT_ATTRIBUTES = CERT_ATTRIBUTES;
|
|
62
46
|
|
|
63
47
|
/**
|
|
64
48
|
* Generates a cryptographically secure serial number for X.509 certificates.
|
|
@@ -68,7 +52,7 @@ exports.CERT_ATTRIBUTES = CERT_ATTRIBUTES;
|
|
|
68
52
|
*
|
|
69
53
|
* @returns {string} 16-character hex string
|
|
70
54
|
*/
|
|
71
|
-
function generateSerialNumber() {
|
|
55
|
+
export function generateSerialNumber() {
|
|
72
56
|
const bytes = randomBytes(8);
|
|
73
57
|
bytes[0] = (bytes[0] & 0x7f) | 0x01; // Clear high bit with bitmask 0x7F (01111111) and ensure that it is non-zero
|
|
74
58
|
return bytes.toString('hex');
|
|
@@ -83,9 +67,9 @@ onMessageFromWorkers(async (message) => {
|
|
|
83
67
|
});
|
|
84
68
|
|
|
85
69
|
let certificateTable;
|
|
86
|
-
function getCertTable() {
|
|
70
|
+
export function getCertTable() {
|
|
87
71
|
if (!certificateTable) {
|
|
88
|
-
certificateTable = getDatabases()['system']['hdb_certificate'];
|
|
72
|
+
certificateTable = getDatabases()['system']?.['hdb_certificate'];
|
|
89
73
|
if (!certificateTable) {
|
|
90
74
|
certificateTable = table({
|
|
91
75
|
table: 'hdb_certificate',
|
|
@@ -124,13 +108,13 @@ function getCertTable() {
|
|
|
124
108
|
return certificateTable;
|
|
125
109
|
}
|
|
126
110
|
|
|
127
|
-
async function getReplicationCert() {
|
|
128
|
-
const SNICallback = createTLSSelector('replication');
|
|
111
|
+
export async function getReplicationCert() {
|
|
112
|
+
const SNICallback = createTLSSelector('replication', undefined);
|
|
129
113
|
const secureTarget = {
|
|
130
114
|
secureContexts: null,
|
|
131
115
|
setSecureContext: (_ctx) => {},
|
|
132
116
|
};
|
|
133
|
-
await SNICallback.initialize(secureTarget);
|
|
117
|
+
await (SNICallback as any).initialize(secureTarget);
|
|
134
118
|
const cert = secureTarget.secureContexts.get(getThisNodeName());
|
|
135
119
|
if (!cert) return;
|
|
136
120
|
const certParsed = new X509Certificate(cert.options.cert);
|
|
@@ -140,7 +124,7 @@ async function getReplicationCert() {
|
|
|
140
124
|
return cert;
|
|
141
125
|
}
|
|
142
126
|
|
|
143
|
-
async function getReplicationCertAuth() {
|
|
127
|
+
export async function getReplicationCertAuth() {
|
|
144
128
|
getCertTable();
|
|
145
129
|
const certPem = (await getReplicationCert()).options.cert;
|
|
146
130
|
const repCert = new X509Certificate(certPem);
|
|
@@ -155,7 +139,7 @@ const privateKeys = new Map();
|
|
|
155
139
|
* This is responsible for loading any certificates that are in the harperdb-config.yaml file and putting them into the hdbCertificate table.
|
|
156
140
|
* @return {*}
|
|
157
141
|
*/
|
|
158
|
-
function loadCertificates() {
|
|
142
|
+
export function loadCertificates() {
|
|
159
143
|
if (configuredCertsLoaded) return;
|
|
160
144
|
configuredCertsLoaded = true;
|
|
161
145
|
// these are the sections of the config to check
|
|
@@ -170,9 +154,9 @@ function loadCertificates() {
|
|
|
170
154
|
if (configs) {
|
|
171
155
|
// the configs can be an array, so normalize to an array
|
|
172
156
|
if (!Array.isArray(configs)) {
|
|
173
|
-
configs = [configs];
|
|
157
|
+
configs = [configs] as any;
|
|
174
158
|
}
|
|
175
|
-
for (let config of configs) {
|
|
159
|
+
for (let config of configs as any) {
|
|
176
160
|
const privateKeyPath = config.privateKey;
|
|
177
161
|
// need to relativize the paths so they aren't exposed
|
|
178
162
|
let private_key_name = privateKeyPath && relative(join(rootPath, 'keys'), privateKeyPath);
|
|
@@ -300,7 +284,7 @@ function getHost() {
|
|
|
300
284
|
return urlToNodeName(url);
|
|
301
285
|
}
|
|
302
286
|
|
|
303
|
-
function getCommonName() {
|
|
287
|
+
export function getCommonName() {
|
|
304
288
|
let node_name = getThisNodeName();
|
|
305
289
|
if (node_name == null) {
|
|
306
290
|
const host = CERT_DOMAINS[0];
|
|
@@ -310,7 +294,7 @@ function getCommonName() {
|
|
|
310
294
|
return node_name;
|
|
311
295
|
}
|
|
312
296
|
|
|
313
|
-
function certExtensions() {
|
|
297
|
+
export function certExtensions() {
|
|
314
298
|
const altName = CERT_DOMAINS.includes(getCommonName()) ? CERT_DOMAINS : [...CERT_DOMAINS, getCommonName()];
|
|
315
299
|
if (!altName.includes(getHost())) altName.push(getHost());
|
|
316
300
|
return [
|
|
@@ -368,7 +352,7 @@ async function createCertificateTable(cert, caCert) {
|
|
|
368
352
|
});
|
|
369
353
|
}
|
|
370
354
|
|
|
371
|
-
async function setCertTable(certRecord) {
|
|
355
|
+
export async function setCertTable(certRecord) {
|
|
372
356
|
let cert;
|
|
373
357
|
try {
|
|
374
358
|
cert = new X509Certificate(certRecord.certificate);
|
|
@@ -383,7 +367,7 @@ async function setCertTable(certRecord) {
|
|
|
383
367
|
`Invalid certificate format for ${certRecord.name}: ${error.message}. ` +
|
|
384
368
|
`This may be due to corrupted certificate data during transfer or encoding issues.`
|
|
385
369
|
);
|
|
386
|
-
certError.code = 'INVALID_CERTIFICATE_FORMAT';
|
|
370
|
+
(certError as any).code = 'INVALID_CERTIFICATE_FORMAT';
|
|
387
371
|
certError.cause = error;
|
|
388
372
|
throw certError;
|
|
389
373
|
}
|
|
@@ -401,7 +385,7 @@ async function setCertTable(certRecord) {
|
|
|
401
385
|
await certificateTable.patch(certRecord);
|
|
402
386
|
}
|
|
403
387
|
|
|
404
|
-
async function generateKeys() {
|
|
388
|
+
export async function generateKeys() {
|
|
405
389
|
const keys = await generateKeyPair('rsa', {
|
|
406
390
|
modulusLength: 4096,
|
|
407
391
|
publicKeyEncoding: {
|
|
@@ -454,7 +438,7 @@ async function generateCertificates(caPrivateKey, publicKey, caCert) {
|
|
|
454
438
|
return pki.certificateToPem(publicCert);
|
|
455
439
|
}
|
|
456
440
|
|
|
457
|
-
async function getCertAuthority() {
|
|
441
|
+
export async function getCertAuthority() {
|
|
458
442
|
const allCerts = await listCertificates();
|
|
459
443
|
let match;
|
|
460
444
|
for (let cert of allCerts) {
|
|
@@ -512,7 +496,7 @@ async function generateCertAuthority(private_key, publicKey, writeKey = true) {
|
|
|
512
496
|
return caCert;
|
|
513
497
|
}
|
|
514
498
|
|
|
515
|
-
async function generateCertsKeys() {
|
|
499
|
+
export async function generateCertsKeys() {
|
|
516
500
|
const { privateKey, publicKey } = await generateKeys();
|
|
517
501
|
const caCert = await generateCertAuthority(privateKey, publicKey);
|
|
518
502
|
const publicCert = await generateCertificates(privateKey, publicKey, caCert);
|
|
@@ -524,7 +508,7 @@ async function generateCertsKeys() {
|
|
|
524
508
|
* Delete any existing self-signed certs (including CA) and create new ones
|
|
525
509
|
* @returns {Promise<void>}
|
|
526
510
|
*/
|
|
527
|
-
async function renewSelfSigned() {
|
|
511
|
+
export async function renewSelfSigned() {
|
|
528
512
|
getCertTable();
|
|
529
513
|
for await (const cert of certificateTable.search([{ attribute: 'is_self_signed', value: true }])) {
|
|
530
514
|
await certificateTable.delete(cert.name);
|
|
@@ -533,7 +517,7 @@ async function renewSelfSigned() {
|
|
|
533
517
|
await reviewSelfSignedCert();
|
|
534
518
|
}
|
|
535
519
|
|
|
536
|
-
async function reviewSelfSignedCert() {
|
|
520
|
+
export async function reviewSelfSignedCert() {
|
|
537
521
|
// Clear any cached node name var
|
|
538
522
|
clearThisNodeName();
|
|
539
523
|
await loadCertificates();
|
|
@@ -632,7 +616,7 @@ async function reviewSelfSignedCert() {
|
|
|
632
616
|
|
|
633
617
|
// Update the cert config in harperdb-config.yaml
|
|
634
618
|
// If CLI or Env values are present it will use those values, else it will use default private key.
|
|
635
|
-
function updateConfigCert() {
|
|
619
|
+
export function updateConfigCert() {
|
|
636
620
|
const cliEnvArgs = assignCmdenvVars(Object.keys(hdbTerms.CONFIG_PARAM_MAP), true);
|
|
637
621
|
const keysPath = path.join(envManager.getHdbBasePath(), hdbTerms.LICENSE_KEY_DIR_NAME);
|
|
638
622
|
const private_key = path.join(keysPath, certificatesTerms.PRIVATEKEY_PEM_NAME);
|
|
@@ -668,7 +652,7 @@ function updateConfigCert() {
|
|
|
668
652
|
// Filter out any cert config keys already set by HARPER_SET_CONFIG so we don't overwrite them
|
|
669
653
|
// with defaults. On first boot, HARPER_SET_CONFIG values are written to the config file during
|
|
670
654
|
// createConfigFile(), but updateConfigCert() runs afterward without re-applying HARPER_SET_CONFIG.
|
|
671
|
-
const { filterArgsAgainstRuntimeConfig } = require('../config/harperConfigEnvVars
|
|
655
|
+
const { filterArgsAgainstRuntimeConfig } = require('../config/harperConfigEnvVars');
|
|
672
656
|
const filteredCerts = filterArgsAgainstRuntimeConfig(newCerts);
|
|
673
657
|
|
|
674
658
|
configUtils.updateConfigValue(undefined, undefined, filteredCerts, false, true);
|
|
@@ -679,37 +663,43 @@ function readPEM(path) {
|
|
|
679
663
|
return readFileSync(path, 'utf8');
|
|
680
664
|
}
|
|
681
665
|
// this horrifying hack is brought to you by https://github.com/nodejs/node/issues/36655
|
|
682
|
-
|
|
683
|
-
tls.createSecureContext
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
const originalInit = TLSSocket.prototype._init;
|
|
700
|
-
TLSSocket.prototype._init = function (socket, wrap) {
|
|
701
|
-
originalInit.call(this, socket, wrap);
|
|
702
|
-
let tlsSocket = this;
|
|
703
|
-
this._handle.oncertcb = function (info) {
|
|
704
|
-
const servername = info.servername;
|
|
705
|
-
tlsSocket._SNICallback(servername, (err, context) => {
|
|
706
|
-
this.sni_context = context?.context || context;
|
|
707
|
-
// note that this skips the checks for multiple callbacks and entirely skips OCSP, so if we ever need that, we
|
|
708
|
-
// need to call the original oncertcb
|
|
709
|
-
this.certCbDone();
|
|
710
|
-
});
|
|
666
|
+
if (typeof globalThis.Bun === 'undefined') {
|
|
667
|
+
const origCreateSecureContext = tls.createSecureContext;
|
|
668
|
+
(tls as any).createSecureContext = function (options: any) {
|
|
669
|
+
if (!options.cert || !options.key) {
|
|
670
|
+
return origCreateSecureContext(options);
|
|
671
|
+
}
|
|
672
|
+
let lessOptions = { ...options };
|
|
673
|
+
delete lessOptions.key;
|
|
674
|
+
delete lessOptions.cert;
|
|
675
|
+
let ctx = origCreateSecureContext(lessOptions);
|
|
676
|
+
if (typeof ctx.context?.setCert !== 'function') {
|
|
677
|
+
// setCert is a Node.js internal — not available in all environments; fall back to default
|
|
678
|
+
return origCreateSecureContext(options);
|
|
679
|
+
}
|
|
680
|
+
ctx.context.setCert(options.cert);
|
|
681
|
+
ctx.context.setKey(options.key, undefined);
|
|
682
|
+
return ctx;
|
|
711
683
|
};
|
|
712
|
-
|
|
684
|
+
// Node.js SNI callbacks _add_ the certificate and don't replace it, and so we can't have a default certificate,
|
|
685
|
+
// so we have to assign the default certificate during the cert callback, because the default SNI callback isn't
|
|
686
|
+
// consistently called for all TLS connections (isn't called if no SNI server name is provided).
|
|
687
|
+
// first we have interrupt the socket initialization to add our own cert callback
|
|
688
|
+
const originalInit = (TLSSocket as any).prototype._init;
|
|
689
|
+
(TLSSocket as any).prototype._init = function (socket: any, wrap: any) {
|
|
690
|
+
originalInit.call(this, socket, wrap);
|
|
691
|
+
let tlsSocket = this;
|
|
692
|
+
this._handle.oncertcb = function (info) {
|
|
693
|
+
const servername = info.servername;
|
|
694
|
+
tlsSocket._SNICallback(servername, (err, context) => {
|
|
695
|
+
this.sni_context = context?.context || context;
|
|
696
|
+
// note that this skips the checks for multiple callbacks and entirely skips OCSP, so if we ever need that, we
|
|
697
|
+
// need to call the original oncertcb
|
|
698
|
+
this.certCbDone();
|
|
699
|
+
});
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
}
|
|
713
703
|
|
|
714
704
|
let caCerts = new Map();
|
|
715
705
|
|
|
@@ -719,17 +709,17 @@ let caCerts = new Map();
|
|
|
719
709
|
* @param mtlsOptions
|
|
720
710
|
* @return {(function(*, *): (*|undefined))|*}
|
|
721
711
|
*/
|
|
722
|
-
function createTLSSelector(type, mtlsOptions) {
|
|
712
|
+
export function createTLSSelector(type, mtlsOptions?): any {
|
|
723
713
|
let secureContexts = new Map();
|
|
724
714
|
let defaultContext;
|
|
725
715
|
let hasWildcards = false;
|
|
726
|
-
SNICallback.initialize = (server) => {
|
|
727
|
-
if (SNICallback.ready) return SNICallback.ready;
|
|
716
|
+
(SNICallback as any).initialize = (server: any) => {
|
|
717
|
+
if ((SNICallback as any).ready) return (SNICallback as any).ready;
|
|
728
718
|
if (server) {
|
|
729
719
|
server.secureContexts = secureContexts;
|
|
730
720
|
server.secureContextsListeners = [];
|
|
731
721
|
}
|
|
732
|
-
return (SNICallback.ready = new Promise((resolve, reject) => {
|
|
722
|
+
return ((SNICallback as any).ready = new Promise<void>((resolve, reject) => {
|
|
733
723
|
function updateTLS() {
|
|
734
724
|
try {
|
|
735
725
|
secureContexts.clear();
|
|
@@ -743,7 +733,7 @@ function createTLSSelector(type, mtlsOptions) {
|
|
|
743
733
|
const certificate = cert.certificate;
|
|
744
734
|
const certParsed = new X509Certificate(certificate);
|
|
745
735
|
if (cert.is_authority) {
|
|
746
|
-
certParsed.asString = certificate;
|
|
736
|
+
(certParsed as any).asString = certificate;
|
|
747
737
|
caCerts.set(certParsed.subject, certificate);
|
|
748
738
|
}
|
|
749
739
|
}
|
|
@@ -754,11 +744,13 @@ function createTLSSelector(type, mtlsOptions) {
|
|
|
754
744
|
continue;
|
|
755
745
|
}
|
|
756
746
|
let quality = cert.is_self_signed ? 1 : 3;
|
|
747
|
+
// normalize: stored as scalar in legacy/manual entries, expected array
|
|
748
|
+
const uses = Array.isArray(cert.uses) ? cert.uses : cert.uses ? [cert.uses] : [];
|
|
757
749
|
// prefer operations certificates for operations API
|
|
758
|
-
if (
|
|
759
|
-
else if (
|
|
750
|
+
if (uses.includes(type)) quality += 3;
|
|
751
|
+
else if (uses.includes('https'))
|
|
760
752
|
quality += 0.5; // this was a legacy generic general use type
|
|
761
|
-
else quality -=
|
|
753
|
+
else quality -= uses.length / 5; // if there are designed uses for this that don't match, dock points
|
|
762
754
|
|
|
763
755
|
const private_key = getPrivateKeyByName(cert.private_key_name);
|
|
764
756
|
|
|
@@ -780,19 +772,19 @@ function createTLSSelector(type, mtlsOptions) {
|
|
|
780
772
|
key_file: cert.private_key_name,
|
|
781
773
|
is_self_signed: cert.is_self_signed,
|
|
782
774
|
};
|
|
783
|
-
if (server) secureOptions.sessionIdContext = server.sessionIdContext;
|
|
775
|
+
if (server) (secureOptions as any).sessionIdContext = server.sessionIdContext;
|
|
784
776
|
let hostnames = cert.hostnames ?? hostnamesFromCert(certParsed);
|
|
785
777
|
if (!Array.isArray(hostnames)) hostnames = [hostnames];
|
|
786
778
|
for (let hostname of hostnames) {
|
|
787
779
|
if (hostname === getHost()) quality += 0.1; // prefer a certificate that has our hostname in the SANs
|
|
788
780
|
}
|
|
789
781
|
let secureContext = tls.createSecureContext(secureOptions);
|
|
790
|
-
secureContext.name = cert.name;
|
|
791
|
-
secureContext.options = secureOptions;
|
|
792
|
-
secureContext.quality = quality;
|
|
793
|
-
secureContext.certificateAuthorities = Array.from(caCerts);
|
|
782
|
+
(secureContext as any).name = cert.name;
|
|
783
|
+
(secureContext as any).options = secureOptions;
|
|
784
|
+
(secureContext as any).quality = quality;
|
|
785
|
+
(secureContext as any).certificateAuthorities = Array.from(caCerts);
|
|
794
786
|
// we store the first 100 bytes of the certificate just for debug logging
|
|
795
|
-
secureContext.certStart = certificate.toString().slice(0, 100);
|
|
787
|
+
(secureContext as any).certStart = certificate.toString().slice(0, 100);
|
|
796
788
|
// we want to configure SNI handling to pick the right certificate based on all the registered SANs
|
|
797
789
|
// in the certificate
|
|
798
790
|
for (let hostname of hostnames) {
|
|
@@ -808,12 +800,12 @@ function createTLSSelector(type, mtlsOptions) {
|
|
|
808
800
|
secureContexts.set(hostname, secureContext);
|
|
809
801
|
}
|
|
810
802
|
} else {
|
|
811
|
-
logger.error?.('No hostname found for certificate at', tls.certificate);
|
|
803
|
+
logger.error?.('No hostname found for certificate at', (tls as any).certificate);
|
|
812
804
|
}
|
|
813
805
|
}
|
|
814
806
|
logger.trace?.(
|
|
815
807
|
'Adding TLS',
|
|
816
|
-
secureContext.name,
|
|
808
|
+
(secureContext as any).name,
|
|
817
809
|
'for',
|
|
818
810
|
server.ports || 'client',
|
|
819
811
|
'cert named',
|
|
@@ -827,7 +819,7 @@ function createTLSSelector(type, mtlsOptions) {
|
|
|
827
819
|
);
|
|
828
820
|
if (quality > bestQuality /* && hasIpAddress*/) {
|
|
829
821
|
// we use this certificate as the default if it has a higher quality than the existing one
|
|
830
|
-
SNICallback.defaultContext = defaultContext = secureContext;
|
|
822
|
+
(SNICallback as any).defaultContext = defaultContext = secureContext;
|
|
831
823
|
bestQuality = quality;
|
|
832
824
|
if (server) {
|
|
833
825
|
server.defaultContext = secureContext;
|
|
@@ -850,7 +842,7 @@ function createTLSSelector(type, mtlsOptions) {
|
|
|
850
842
|
databases?.system.hdb_certificate.subscribe({
|
|
851
843
|
listener: () => setTimeout(() => updateTLS(), 1500).unref(),
|
|
852
844
|
omitCurrent: true,
|
|
853
|
-
});
|
|
845
|
+
} as any);
|
|
854
846
|
updateTLS();
|
|
855
847
|
}));
|
|
856
848
|
};
|
|
@@ -900,7 +892,7 @@ function getPrivateKeyByName(private_key_name) {
|
|
|
900
892
|
* List all the records in hdbCertificate table
|
|
901
893
|
* @returns {Promise<*[]>}
|
|
902
894
|
*/
|
|
903
|
-
async function listCertificates() {
|
|
895
|
+
export async function listCertificates() {
|
|
904
896
|
getCertTable();
|
|
905
897
|
let response = [];
|
|
906
898
|
for await (const cert of certificateTable.search([])) {
|
|
@@ -909,13 +901,13 @@ async function listCertificates() {
|
|
|
909
901
|
return response;
|
|
910
902
|
}
|
|
911
903
|
|
|
912
|
-
function getPrimaryHostName(cert /*X509Certificate*/) {
|
|
904
|
+
export function getPrimaryHostName(cert /*X509Certificate*/) {
|
|
913
905
|
const commonName = cert.subject?.match(/CN=(.*)/)?.[1];
|
|
914
906
|
if (commonName) return commonName;
|
|
915
907
|
return hostnamesFromCert(cert)[0];
|
|
916
908
|
}
|
|
917
909
|
|
|
918
|
-
function hostnamesFromCert(cert /*X509Certificate*/) {
|
|
910
|
+
export function hostnamesFromCert(cert /*X509Certificate*/) {
|
|
919
911
|
if (cert.subjectAltName) {
|
|
920
912
|
return cert.subjectAltName
|
|
921
913
|
.split(',')
|
|
@@ -946,7 +938,7 @@ function hostnamesFromCert(cert /*X509Certificate*/) {
|
|
|
946
938
|
return commonName ? [commonName] : [];
|
|
947
939
|
}
|
|
948
940
|
|
|
949
|
-
function getHostnamesFromCertificate(certificate) {
|
|
941
|
+
export function getHostnamesFromCertificate(certificate) {
|
|
950
942
|
return [
|
|
951
943
|
certificate.subject?.CN, // use the subject if it exists
|
|
952
944
|
...certificate.subjectaltname // otherwise use the subject alternative names
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
const _ = require('lodash');
|
|
4
4
|
const terms = require('../utility/hdbTerms.ts');
|
|
5
|
-
const { handleHDBError, hdbErrors } = require('../utility/errors/hdbError.
|
|
5
|
+
const { handleHDBError, hdbErrors } = require('../utility/errors/hdbError.ts');
|
|
6
6
|
const { HDB_ERROR_MSGS, HTTP_STATUS_CODES } = hdbErrors;
|
|
7
|
-
const logger = require('../utility/logging/harper_logger.
|
|
7
|
+
const logger = require('../utility/logging/harper_logger.ts');
|
|
8
8
|
|
|
9
9
|
module.exports = {
|
|
10
10
|
getRolePermissions,
|