@harperfast/harper 5.0.30 → 5.1.0-beta.2
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 +134 -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 +17 -24
- 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 +132 -18
- package/components/anthropic/index.ts +547 -0
- package/components/bedrock/index.ts +823 -0
- package/components/componentLoader.ts +64 -32
- package/components/deployLifecycle.ts +161 -0
- package/components/deploymentOperations.ts +173 -0
- package/components/deploymentRecorder.ts +427 -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 +607 -0
- package/components/mcp/session.ts +151 -0
- package/components/mcp/sessionRegistry.ts +140 -0
- package/components/mcp/toolRegistry.ts +294 -0
- package/components/mcp/tools/application.ts +761 -0
- package/components/mcp/tools/operations.ts +311 -0
- package/components/mcp/tools/schemas/derive.ts +356 -0
- package/components/mcp/tools/schemas/operationDescriptions.ts +241 -0
- package/components/mcp/tools/schemas/operations.ts +301 -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 +217 -60
- package/components/operationsValidation.js +12 -4
- 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 +78 -4
- 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 +123 -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 +14 -22
- package/dist/bin/upgrade.js.map +1 -1
- 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 +112 -12
- 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 +65 -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 +97 -0
- package/dist/components/deploymentRecorder.js +425 -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 +526 -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 +151 -0
- package/dist/components/mcp/toolRegistry.js +177 -0
- package/dist/components/mcp/toolRegistry.js.map +1 -0
- package/dist/components/mcp/tools/application.d.ts +72 -0
- package/dist/components/mcp/tools/application.js +660 -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 +331 -0
- package/dist/components/mcp/tools/operations.js.map +1 -0
- package/dist/components/mcp/tools/schemas/derive.d.ts +50 -0
- package/dist/components/mcp/tools/schemas/derive.js +291 -0
- package/dist/components/mcp/tools/schemas/derive.js.map +1 -0
- package/dist/components/mcp/tools/schemas/operationDescriptions.d.ts +32 -0
- package/dist/components/mcp/tools/schemas/operationDescriptions.js +179 -0
- package/dist/components/mcp/tools/schemas/operationDescriptions.js.map +1 -0
- package/dist/components/mcp/tools/schemas/operations.d.ts +27 -0
- package/dist/components/mcp/tools/schemas/operations.js +299 -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 +205 -52
- package/dist/components/operations.js.map +1 -1
- package/dist/components/operationsValidation.d.ts +2 -2
- package/dist/components/operationsValidation.js +13 -4
- package/dist/components/operationsValidation.js.map +1 -1
- 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 +10 -12
- package/dist/resources/RecordEncoder.js +38 -38
- 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 +25 -5
- package/dist/resources/Resource.js +43 -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 +10 -3
- package/dist/resources/RocksTransactionLogStore.js.map +1 -1
- package/dist/resources/Table.d.ts +76 -329
- package/dist/resources/Table.js +306 -116
- 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 +8 -1
- package/dist/resources/analytics/read.js +69 -8
- 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 +16 -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 +17 -0
- package/dist/resources/databases.js +175 -59
- package/dist/resources/databases.js.map +1 -1
- package/dist/resources/graphql.d.ts +1 -7
- package/dist/resources/graphql.js +267 -173
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +17 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +327 -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/jsonSchemaTypes.d.ts +60 -0
- package/dist/resources/jsonSchemaTypes.js +78 -0
- package/dist/resources/jsonSchemaTypes.js.map +1 -0
- 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/openApi.js +74 -34
- package/dist/resources/openApi.js.map +1 -1
- package/dist/resources/replayLogs.js +7 -1
- package/dist/resources/replayLogs.js.map +1 -1
- package/dist/resources/replayLogsGuards.d.ts +9 -0
- package/dist/resources/replayLogsGuards.js +47 -0
- package/dist/resources/replayLogsGuards.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 +23 -15
- 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 +46 -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-1-0.d.ts +6 -0
- package/dist/upgrade/directives/5-1-0.js +114 -0
- package/dist/upgrade/directives/5-1-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 +2 -8
- package/dist/upgrade/upgradePrompt.js +55 -60
- 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 +54 -1
- package/dist/utility/hdbTerms.js +54 -1
- 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 +117 -54
- 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 +12 -15
- package/dist/utility/lmdb/OpenDBIObject.js +68 -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 +177 -82
- 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 +67 -32
- 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 +80 -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 +38 -24
- 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 +41 -39
- package/resources/RequestTarget.ts +2 -0
- package/resources/Resource.ts +96 -56
- package/resources/ResourceInterface.ts +44 -21
- package/resources/Resources.ts +8 -8
- package/resources/RocksIndexStore.ts +3 -0
- package/resources/RocksTransactionLogStore.ts +13 -4
- package/resources/Table.ts +440 -223
- package/resources/analytics/metadata.ts +1 -0
- package/resources/analytics/read.ts +99 -10
- package/resources/analytics/write.ts +240 -17
- package/resources/auditStore.ts +30 -19
- package/resources/blob.ts +53 -53
- package/resources/dataLoader.ts +4 -4
- package/resources/databases.ts +208 -74
- package/resources/graphql.ts +267 -165
- package/resources/indexes/HierarchicalNavigableSmallWorld.ts +310 -65
- package/resources/indexes/vector.ts +17 -0
- package/resources/jsonSchemaTypes.ts +102 -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/openApi.ts +65 -31
- package/resources/replayLogs.ts +20 -9
- package/resources/replayLogsGuards.ts +45 -0
- package/resources/roles.ts +62 -67
- package/resources/search.ts +355 -135
- package/resources/tracked.ts +18 -9
- package/resources/transaction.ts +8 -8
- package/resources/transactionBroadcast.ts +3 -3
- package/schema.graphql +7 -0
- 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 +3 -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/static/defaultConfig.yaml +0 -1
- package/studio/web/assets/{index-CybLScHg.js → index-Dqr9oVhe.js} +5 -5
- package/studio/web/assets/index-Dqr9oVhe.js.map +1 -0
- package/studio/web/assets/{index.lazy-DKx5-iXF.js → index.lazy-CpKcKb7M.js} +2 -2
- package/studio/web/assets/{index.lazy-DKx5-iXF.js.map → index.lazy-CpKcKb7M.js.map} +1 -1
- package/studio/web/assets/{profile-BOjes0Wl.js → profile-C1cujdsg.js} +2 -2
- package/studio/web/assets/{profile-BOjes0Wl.js.map → profile-C1cujdsg.js.map} +1 -1
- package/studio/web/assets/{status-EWKUIrjT.js → status-CTiIIQlY.js} +2 -2
- package/studio/web/assets/{status-EWKUIrjT.js.map → status-CTiIIQlY.js.map} +1 -1
- package/studio/web/index.html +1 -1
- package/upgrade/{UpgradeObjects.js → UpgradeObjects.ts} +3 -6
- package/upgrade/directives/5-1-0.ts +89 -0
- package/upgrade/directives/{directivesController.js → directivesController.ts} +16 -16
- package/upgrade/{directivesManager.js → directivesManager.ts} +7 -11
- package/upgrade/{upgradePrompt.js → upgradePrompt.ts} +6 -54
- 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 +54 -1
- package/utility/install/checkJWTTokensExist.js +1 -1
- package/utility/install/{installer.js → installer.ts} +66 -42
- 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 +57 -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} +137 -90
- package/utility/logging/{logRotator.js → logRotator.ts} +15 -18
- 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 +44 -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-CybLScHg.js.map +0 -1
- package/utility/globalSchema.js +0 -35
- package/utility/lmdb/OpenDBIObject.js +0 -31
|
@@ -2,17 +2,18 @@ import { streamAsJSON, stringify, parse } from './JSONStream.ts';
|
|
|
2
2
|
import { pack, unpack, encodeIter } from 'msgpackr';
|
|
3
3
|
import { decode, Encoder, EncoderStream } from 'cbor-x';
|
|
4
4
|
import { createBrotliCompress, brotliCompress, constants } from 'zlib';
|
|
5
|
-
import { ClientError } from '../../utility/errors/hdbError.
|
|
5
|
+
import { ClientError } from '../../utility/errors/hdbError.ts';
|
|
6
6
|
import stream, { Readable, Transform } from 'node:stream';
|
|
7
7
|
import { server } from '../Server.ts';
|
|
8
8
|
import { _assignPackageExport } from '../../globals.js';
|
|
9
|
-
import envMgr from '../../utility/environment/environmentManager.
|
|
9
|
+
import * as envMgr from '../../utility/environment/environmentManager.ts';
|
|
10
10
|
import { CONFIG_PARAMS } from '../../utility/hdbTerms.ts';
|
|
11
11
|
import * as YAML from 'yaml';
|
|
12
12
|
import { logger } from '../../utility/logging/logger.ts';
|
|
13
13
|
import { Blob } from '../../resources/blob.ts';
|
|
14
14
|
// TODO: Only load this if fastify is loaded
|
|
15
15
|
import fp from 'fastify-plugin';
|
|
16
|
+
import { parseMultipartRequest } from './multipartParser.ts';
|
|
16
17
|
const SERIALIZATION_BIGINT = envMgr.get(CONFIG_PARAMS.SERIALIZATION_BIGINT) !== false;
|
|
17
18
|
const JSONStringify = SERIALIZATION_BIGINT ? stringify : JSON.stringify;
|
|
18
19
|
const JSONParse = SERIALIZATION_BIGINT ? parse : JSON.parse;
|
|
@@ -36,14 +37,14 @@ const mediaTypes = new Map<
|
|
|
36
37
|
>();
|
|
37
38
|
|
|
38
39
|
export const contentTypes = mediaTypes;
|
|
39
|
-
server.contentTypes = contentTypes;
|
|
40
|
+
server.contentTypes = contentTypes as any;
|
|
40
41
|
_assignPackageExport('contentTypes', contentTypes);
|
|
41
42
|
// TODO: Make these monomorphic for faster access. And use a Map
|
|
42
43
|
mediaTypes.set('application/json', {
|
|
43
44
|
serializeStream: streamAsJSON,
|
|
44
45
|
serialize: JSONStringify,
|
|
45
46
|
deserialize(data) {
|
|
46
|
-
return JSONParse(data);
|
|
47
|
+
return JSONParse(data as any);
|
|
47
48
|
},
|
|
48
49
|
q: 0.8,
|
|
49
50
|
});
|
|
@@ -60,7 +61,7 @@ mediaTypes.set('application/cbor', {
|
|
|
60
61
|
mediaTypes.set('application/x-msgpack', {
|
|
61
62
|
serializeStream(data: any) {
|
|
62
63
|
if ((data?.[Symbol.iterator] || data?.[Symbol.asyncIterator]) && !Array.isArray(data)) {
|
|
63
|
-
return Readable.from(encodeIter(data, PUBLIC_ENCODE_OPTIONS));
|
|
64
|
+
return Readable.from(encodeIter(data, PUBLIC_ENCODE_OPTIONS) as any);
|
|
64
65
|
}
|
|
65
66
|
return pack(data);
|
|
66
67
|
},
|
|
@@ -101,6 +102,29 @@ mediaTypes.set('text/yaml', {
|
|
|
101
102
|
q: 0.7,
|
|
102
103
|
});
|
|
103
104
|
|
|
105
|
+
const ndjsonHandler = {
|
|
106
|
+
serializeStream(data: any) {
|
|
107
|
+
if (data?.[Symbol.iterator] || data?.[Symbol.asyncIterator]) {
|
|
108
|
+
return Readable.from(transformIterable(data, (msg: any) => JSONStringify(msg) + '\n'));
|
|
109
|
+
}
|
|
110
|
+
return JSONStringify(data) + '\n';
|
|
111
|
+
},
|
|
112
|
+
serialize(data: any) {
|
|
113
|
+
return JSONStringify(data) + '\n';
|
|
114
|
+
},
|
|
115
|
+
deserialize(data: Buffer) {
|
|
116
|
+
return data
|
|
117
|
+
.toString()
|
|
118
|
+
.split('\n')
|
|
119
|
+
.map((line) => line.trim())
|
|
120
|
+
.filter(Boolean)
|
|
121
|
+
.map((line) => JSONParse(line));
|
|
122
|
+
},
|
|
123
|
+
q: 0.7,
|
|
124
|
+
};
|
|
125
|
+
mediaTypes.set('application/x-ndjson', ndjsonHandler);
|
|
126
|
+
mediaTypes.set('application/ndjson', ndjsonHandler);
|
|
127
|
+
|
|
104
128
|
mediaTypes.set('text/event-stream', {
|
|
105
129
|
// Server-Sent Events (SSE)
|
|
106
130
|
serializeStream: function (iterable) {
|
|
@@ -196,7 +220,7 @@ export function registerContentHandlers(app) {
|
|
|
196
220
|
regex: /^application\/(x-)?msgpack$/,
|
|
197
221
|
serializer: function (data) {
|
|
198
222
|
if ((data?.[Symbol.iterator] || data?.[Symbol.asyncIterator]) && !Array.isArray(data)) {
|
|
199
|
-
return Readable.from(encodeIter(data, PUBLIC_ENCODE_OPTIONS));
|
|
223
|
+
return Readable.from(encodeIter(data, PUBLIC_ENCODE_OPTIONS) as any);
|
|
200
224
|
}
|
|
201
225
|
return pack(data);
|
|
202
226
|
},
|
|
@@ -227,6 +251,13 @@ export function registerContentHandlers(app) {
|
|
|
227
251
|
done(error);
|
|
228
252
|
}
|
|
229
253
|
});
|
|
254
|
+
|
|
255
|
+
// multipart/form-data is streamed: we hand the operation handler a Readable for the file
|
|
256
|
+
// part rather than buffering the body, so deploy_component payloads can exceed the 2 GB
|
|
257
|
+
// Node Buffer cap. See multipartParser.ts for the part ordering contract.
|
|
258
|
+
app.addContentTypeParser(/^multipart\/form-data/, (req, payload, done) => {
|
|
259
|
+
parseMultipartRequest(req, payload, done);
|
|
260
|
+
});
|
|
230
261
|
}
|
|
231
262
|
|
|
232
263
|
const registerFastifySerializers = fp(
|
|
@@ -299,7 +330,7 @@ export function findBestSerializer(incomingMessage) {
|
|
|
299
330
|
const quality = (serializer.q || 1) * clientQuality;
|
|
300
331
|
if (quality > bestQuality) {
|
|
301
332
|
bestSerializer = serializer;
|
|
302
|
-
bestType = serializer.type || type;
|
|
333
|
+
bestType = (serializer as any).type || type;
|
|
303
334
|
bestQuality = quality;
|
|
304
335
|
bestParameters = parameters;
|
|
305
336
|
}
|
|
@@ -421,11 +452,11 @@ export function serializeMessage(
|
|
|
421
452
|
try {
|
|
422
453
|
let serialized: Buffer | string;
|
|
423
454
|
if (request) {
|
|
424
|
-
let serialize = request.serialize;
|
|
455
|
+
let serialize = (request as any).serialize;
|
|
425
456
|
if (serialize) serialized = serialize(message);
|
|
426
457
|
else {
|
|
427
458
|
const serializer = findBestSerializer(request);
|
|
428
|
-
serialize = request.serialize = serializer.serializer.serialize;
|
|
459
|
+
serialize = (request as any).serialize = serializer.serializer.serialize;
|
|
429
460
|
serialized = serialize(message);
|
|
430
461
|
}
|
|
431
462
|
} else {
|
|
@@ -573,7 +604,7 @@ function deserializerUnknownType(contentType: ContentType): Deserialize {
|
|
|
573
604
|
// try to parse as JSON if no content type
|
|
574
605
|
try {
|
|
575
606
|
// if the first byte is `{` then it is likely JSON
|
|
576
|
-
if (data?.[0] === 123) return JSONParse(data);
|
|
607
|
+
if (data?.[0] === 123) return JSONParse(data as any);
|
|
577
608
|
} catch {
|
|
578
609
|
// continue if cannot parse as JSON
|
|
579
610
|
}
|
|
@@ -618,7 +649,7 @@ function transformIterable(iterable, transform) {
|
|
|
618
649
|
* @param data
|
|
619
650
|
* @returns stream
|
|
620
651
|
*/
|
|
621
|
-
export function toCsvStream(data, columns) {
|
|
652
|
+
export function toCsvStream(data, columns?) {
|
|
622
653
|
// ensure that we pass it an iterable
|
|
623
654
|
const readStream = stream.Readable.from(data?.[Symbol.iterator] || data?.[Symbol.asyncIterator] ? data : [data]);
|
|
624
655
|
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import busboy from 'busboy';
|
|
2
|
+
import type { FastifyRequest } from 'fastify';
|
|
3
|
+
import type { Readable } from 'node:stream';
|
|
4
|
+
import { ClientError } from '../../utility/errors/hdbError.ts';
|
|
5
|
+
import { logger } from '../../utility/logging/logger.ts';
|
|
6
|
+
|
|
7
|
+
interface MultipartBody {
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
payload?: Readable;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const FIELD_SIZE_LIMIT = 1024 * 1024; // 1 MB per non-file field — generous for JSON params
|
|
13
|
+
const MAX_FIELDS = 64;
|
|
14
|
+
// Operation handlers stream the file part directly into extraction (gunzip + tar-fs),
|
|
15
|
+
// so there is no separate filesize cap to enforce here. Backpressure flows through busboy
|
|
16
|
+
// → the file Readable → the consumer, bounded by disk space rather than memory.
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Parse a multipart/form-data request body for the operations API.
|
|
20
|
+
*
|
|
21
|
+
* Field parts populate properties on the returned body object; values that look like JSON
|
|
22
|
+
* (`{...}`, `[...]`, numbers, booleans, null) are decoded so the operations API sees the
|
|
23
|
+
* same shape it would from a JSON/CBOR body. The (optional) file part — by convention the
|
|
24
|
+
* last part, named `payload` — is exposed as a Readable on `body.payload` and streamed
|
|
25
|
+
* lazily by the operation handler; this lets us deploy components larger than the Node.js
|
|
26
|
+
* 2 GB Buffer cap.
|
|
27
|
+
*
|
|
28
|
+
* The CLI must place the file part LAST so all dispatching fields (`operation`, auth-
|
|
29
|
+
* relevant flags, etc.) have arrived by the time the route handler runs.
|
|
30
|
+
*/
|
|
31
|
+
export function parseMultipartRequest(
|
|
32
|
+
request: FastifyRequest,
|
|
33
|
+
rawStream: Readable,
|
|
34
|
+
done: (err: Error | null, body?: MultipartBody) => void
|
|
35
|
+
): void {
|
|
36
|
+
const contentType = request.headers['content-type'];
|
|
37
|
+
if (!contentType) {
|
|
38
|
+
done(new ClientError('Missing Content-Type header', 400));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
let bb: ReturnType<typeof busboy>;
|
|
43
|
+
try {
|
|
44
|
+
bb = busboy({
|
|
45
|
+
headers: { 'content-type': contentType },
|
|
46
|
+
limits: {
|
|
47
|
+
fieldSize: FIELD_SIZE_LIMIT,
|
|
48
|
+
fields: MAX_FIELDS,
|
|
49
|
+
files: 1,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
} catch (err) {
|
|
53
|
+
done(toClientError(err, 'Invalid multipart request'));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const body: MultipartBody = {};
|
|
58
|
+
let fileSeen = false;
|
|
59
|
+
let doneCalled = false;
|
|
60
|
+
|
|
61
|
+
const callDone = (err: Error | null, value?: MultipartBody) => {
|
|
62
|
+
if (doneCalled) return;
|
|
63
|
+
doneCalled = true;
|
|
64
|
+
done(err, value);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
bb.on('field', (name, value) => {
|
|
68
|
+
if (fileSeen) {
|
|
69
|
+
// Fields after the file part are out-of-order and ignored. We can't propagate them
|
|
70
|
+
// to the route handler — by the time busboy emits the event, `done` has already
|
|
71
|
+
// fired and the file stream has typically ended too. The CLI always sends fields
|
|
72
|
+
// first; this branch only fires on malformed/hand-crafted clients.
|
|
73
|
+
logger.warn?.(`Multipart field "${name}" arrived after the file part; ignoring`);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
body[name] = decodeFieldValue(value);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
bb.on('file', (name, fileStream) => {
|
|
80
|
+
fileSeen = true;
|
|
81
|
+
if (name !== 'payload') {
|
|
82
|
+
// We only consume a single field named `payload`. Other file fields are an error
|
|
83
|
+
// rather than silently consumed — the CLI never sends them and accepting them
|
|
84
|
+
// would mask client bugs.
|
|
85
|
+
fileStream.resume(); // drain so busboy can finish
|
|
86
|
+
callDone(new ClientError(`Unexpected file field "${name}"; expected "payload"`, 400));
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
body.payload = fileStream;
|
|
90
|
+
// Hand control to the route handler immediately — the file stream is now wired
|
|
91
|
+
// into body.payload and will be drained by extraction. busboy keeps pumping data
|
|
92
|
+
// out of rawStream as the consumer reads, providing natural backpressure.
|
|
93
|
+
callDone(null, body);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
bb.on('error', (err) => {
|
|
97
|
+
callDone(toClientError(err, 'Malformed multipart body'));
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
bb.on('close', () => {
|
|
101
|
+
// If the request had no file part, the handler still needs to dispatch on the fields
|
|
102
|
+
// we collected (e.g. an operation that doesn't need a payload at all).
|
|
103
|
+
if (!doneCalled) callDone(null, body);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
rawStream.on('error', (err) => {
|
|
107
|
+
const clientErr = toClientError(err, 'Request stream error');
|
|
108
|
+
// If `done` hasn't fired yet, the route handler hasn't started and this surfaces as a
|
|
109
|
+
// dispatch error. If it has — i.e. the file part is mid-stream — `callDone` is a no-op
|
|
110
|
+
// but the file Readable already handed out as `body.payload` is its own object that
|
|
111
|
+
// `bb.destroy()` does NOT propagate to. We have to destroy it explicitly, otherwise
|
|
112
|
+
// the consumer (`pipeline(tarball, gunzip(), extract(...))` in Application.ts) hangs
|
|
113
|
+
// until TCP keepalives close the socket. Node's `.pipe()` doesn't forward errors from
|
|
114
|
+
// source to destination either, hence we don't rely on it here.
|
|
115
|
+
callDone(clientErr);
|
|
116
|
+
const payload = body.payload as (Readable & { destroyed?: boolean }) | undefined;
|
|
117
|
+
if (payload && !payload.destroyed) payload.destroy(clientErr);
|
|
118
|
+
bb.destroy(clientErr);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
rawStream.pipe(bb);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function decodeFieldValue(raw: string): unknown {
|
|
125
|
+
if (raw === '') return raw;
|
|
126
|
+
const first = raw.charCodeAt(0);
|
|
127
|
+
// Only attempt JSON parse for values that begin with a JSON sentinel — otherwise the
|
|
128
|
+
// overwhelming common case of a plain string identifier ("my-project") needlessly
|
|
129
|
+
// goes through a try/catch.
|
|
130
|
+
const looksLikeJson =
|
|
131
|
+
first === 0x7b /* { */ ||
|
|
132
|
+
first === 0x5b /* [ */ ||
|
|
133
|
+
first === 0x22 /* " */ ||
|
|
134
|
+
first === 0x2d /* - */ ||
|
|
135
|
+
(first >= 0x30 && first <= 0x39) /* 0-9 */ ||
|
|
136
|
+
raw === 'true' ||
|
|
137
|
+
raw === 'false' ||
|
|
138
|
+
raw === 'null';
|
|
139
|
+
if (!looksLikeJson) return raw;
|
|
140
|
+
try {
|
|
141
|
+
return JSON.parse(raw);
|
|
142
|
+
} catch {
|
|
143
|
+
return raw;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function toClientError(err: unknown, fallbackMessage: string): ClientError {
|
|
148
|
+
if (err instanceof ClientError) return err;
|
|
149
|
+
const message = err instanceof Error ? err.message : fallbackMessage;
|
|
150
|
+
logger.debug?.('Multipart parse error: ' + message);
|
|
151
|
+
return new ClientError(message || fallbackMessage, 400);
|
|
152
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { PassThrough, Readable } from 'node:stream';
|
|
2
|
+
|
|
3
|
+
export interface ProgressEvent {
|
|
4
|
+
event: string;
|
|
5
|
+
data: unknown;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type ProgressListener = (event: ProgressEvent) => void;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Lightweight pub-sub used to report phase/install/replicate events from a long-running
|
|
12
|
+
* operation back to the HTTP layer. We deliberately don't use Node's EventEmitter here:
|
|
13
|
+
* we only need broadcast semantics for a small set of event types, and we want the
|
|
14
|
+
* `emit(event, data)` shape that matches the SSE wire format directly.
|
|
15
|
+
*/
|
|
16
|
+
export class ProgressEmitter {
|
|
17
|
+
private listeners: ProgressListener[] = [];
|
|
18
|
+
|
|
19
|
+
emit(event: string, data: unknown): void {
|
|
20
|
+
// Snapshot before iteration so a listener that unsubscribes itself during dispatch
|
|
21
|
+
// doesn't shift indexes underneath us.
|
|
22
|
+
const snapshot = this.listeners.slice();
|
|
23
|
+
for (const listener of snapshot) {
|
|
24
|
+
try {
|
|
25
|
+
listener({ event, data });
|
|
26
|
+
} catch {
|
|
27
|
+
// A buggy listener must never break the operation. Swallow and continue.
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
subscribe(listener: ProgressListener): () => void {
|
|
33
|
+
this.listeners.push(listener);
|
|
34
|
+
return () => {
|
|
35
|
+
const i = this.listeners.indexOf(listener);
|
|
36
|
+
if (i !== -1) this.listeners.splice(i, 1);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Wrap a long-running operation so its progress events stream back as Server-Sent Events.
|
|
43
|
+
*
|
|
44
|
+
* The returned Readable emits one SSE message per `emitter.emit(...)` call, then a final
|
|
45
|
+
* `done` (or `error`) event with the operation's result, then ends. The caller is
|
|
46
|
+
* expected to set Content-Type: text/event-stream on the response.
|
|
47
|
+
*/
|
|
48
|
+
export function createSSEResponseStream(emitter: ProgressEmitter, operation: () => Promise<unknown>): Readable {
|
|
49
|
+
const stream = new PassThrough();
|
|
50
|
+
// Prime the stream with an SSE comment line so the response body is non-empty by the time
|
|
51
|
+
// Fastify starts piping. Without this, Fastify buffers the PassThrough's internal queue
|
|
52
|
+
// until its end and only flushes the final chunk to the wire — making intermediate
|
|
53
|
+
// progress events invisible to the client. The comment ": ..." is a valid SSE record
|
|
54
|
+
// that consumers ignore, so it's safe filler.
|
|
55
|
+
stream.write(`: stream open\n\n`);
|
|
56
|
+
|
|
57
|
+
let active = true;
|
|
58
|
+
let errorEmitted = false;
|
|
59
|
+
const unsubscribe = emitter.subscribe((event) => {
|
|
60
|
+
if (active) {
|
|
61
|
+
writeSSE(stream, event);
|
|
62
|
+
if (event.event === 'error') errorEmitted = true;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const cleanup = () => {
|
|
67
|
+
if (active) {
|
|
68
|
+
active = false;
|
|
69
|
+
unsubscribe();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// If the client disconnects (Ctrl-C, network drop) stop writing to the stream and
|
|
74
|
+
// release the emitter subscription so it doesn't accumulate for the operation lifetime.
|
|
75
|
+
stream.on('close', cleanup);
|
|
76
|
+
stream.on('end', cleanup);
|
|
77
|
+
|
|
78
|
+
operation()
|
|
79
|
+
.then((result) => {
|
|
80
|
+
if (active) writeSSE(stream, { event: 'done', data: { result } });
|
|
81
|
+
})
|
|
82
|
+
.catch((err) => {
|
|
83
|
+
// Only emit a framework-level error event if the operation itself didn't already
|
|
84
|
+
// emit one (with richer context like phase) through the emitter subscriber above.
|
|
85
|
+
if (active && !errorEmitted) {
|
|
86
|
+
writeSSE(stream, {
|
|
87
|
+
event: 'error',
|
|
88
|
+
data: {
|
|
89
|
+
message: err?.message ?? String(err),
|
|
90
|
+
code: err?.statusCode ?? err?.code,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
.finally(() => {
|
|
96
|
+
cleanup();
|
|
97
|
+
stream.end();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
return stream;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function writeSSE(stream: PassThrough, event: ProgressEvent): void {
|
|
104
|
+
const data = typeof event.data === 'string' ? event.data : JSON.stringify(event.data);
|
|
105
|
+
stream.write(`event: ${event.event}\n`);
|
|
106
|
+
for (const line of data.split(/\r?\n/)) {
|
|
107
|
+
stream.write(`data: ${line}\n`);
|
|
108
|
+
}
|
|
109
|
+
stream.write('\n');
|
|
110
|
+
}
|
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const terms = require('../../utility/hdbTerms.ts');
|
|
4
|
-
const hdbUtil = require('../../utility/common_utils.
|
|
5
|
-
const harperLogger = require('../../utility/logging/harper_logger.
|
|
6
|
-
const {
|
|
4
|
+
const hdbUtil = require('../../utility/common_utils.ts');
|
|
5
|
+
const harperLogger = require('../../utility/logging/harper_logger.ts');
|
|
6
|
+
const { realExit } = require('../threads/workerProcessGuard.ts');
|
|
7
|
+
const { handleHDBError, hdbErrors } = require('../../utility/errors/hdbError.ts');
|
|
7
8
|
const { isMainThread } = require('worker_threads');
|
|
8
9
|
const { Readable } = require('stream');
|
|
9
10
|
|
|
10
11
|
const os = require('os');
|
|
11
|
-
const util = require('util');
|
|
12
12
|
|
|
13
|
-
const auth = require('../../security/fastifyAuth.
|
|
14
|
-
|
|
13
|
+
const auth = require('../../security/fastifyAuth.ts');
|
|
14
|
+
|
|
15
|
+
// this is a hack to suppress a deprecation warning and can be removed once `auth.authorize`
|
|
16
|
+
// is converted to an async function
|
|
17
|
+
function pAuthorize(req, resp) {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
auth.authorize(req, resp, (err, user) => (err ? reject(err) : resolve(user)));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
const serverUtilities = require('./serverUtilities.ts');
|
|
16
24
|
const { applyImpersonation } = require('../../security/impersonation.ts');
|
|
17
25
|
const { createGzip, constants } = require('zlib');
|
|
26
|
+
const { ProgressEmitter, createSSEResponseStream } = require('./progressEmitter.ts');
|
|
27
|
+
|
|
28
|
+
// Operations that support `Accept: text/event-stream` for live progress streaming. The
|
|
29
|
+
// handler attaches a ProgressEmitter as req.body.progress so the operation can emit phase
|
|
30
|
+
// events; the response body is the SSE-encoded emitter output. Non-SSE clients see the
|
|
31
|
+
// historical single-response shape because progress is undefined on that path.
|
|
32
|
+
const SSE_PROGRESS_OPERATIONS = new Set([terms.OPERATIONS_ENUM.DEPLOY_COMPONENT, terms.OPERATIONS_ENUM.GET_DEPLOYMENT]);
|
|
18
33
|
|
|
19
34
|
const NO_AUTH_OPERATIONS = [
|
|
20
35
|
terms.OPERATIONS_ENUM.CREATE_AUTHENTICATION_TOKENS,
|
|
@@ -28,7 +43,9 @@ function handleServerUncaughtException(err) {
|
|
|
28
43
|
}Terminating ${isMainThread ? 'HDB' : 'thread'}.`;
|
|
29
44
|
console.error(message);
|
|
30
45
|
harperLogger.fatal(message);
|
|
31
|
-
|
|
46
|
+
// Harper-intentional fatal termination on uncaught exception. Use realExit
|
|
47
|
+
// so the worker process guard does not intercept it.
|
|
48
|
+
realExit(1);
|
|
32
49
|
}
|
|
33
50
|
|
|
34
51
|
function serverErrorHandler(error, req, resp) {
|
|
@@ -119,6 +136,25 @@ async function handlePostRequest(req, res, _bypassAuth = false) {
|
|
|
119
136
|
if (req.body.bypass_auth) delete req.body.bypass_auth;
|
|
120
137
|
|
|
121
138
|
operation_function = serverUtilities.chooseOperation(req.body);
|
|
139
|
+
|
|
140
|
+
// SSE progress branch — when the client asks for `text/event-stream` on an operation
|
|
141
|
+
// that supports it, run the operation in the background and stream events back as they
|
|
142
|
+
// happen. The progress emitter is attached to req.body so the operation handler can
|
|
143
|
+
// emit without changing its return signature; non-SSE callers leave `progress`
|
|
144
|
+
// undefined and the handler stays on its synchronous result path.
|
|
145
|
+
// Optional-chained `req.headers` because unit tests dispatch through this path with
|
|
146
|
+
// synthetic req shapes that don't set headers; production Fastify requests always do.
|
|
147
|
+
// `Accept` parsing only checks for the text/event-stream token; allow comma-separated
|
|
148
|
+
// values like `text/event-stream, application/json` and quality params per RFC 7231.
|
|
149
|
+
if (req.headers?.accept?.includes('text/event-stream') && SSE_PROGRESS_OPERATIONS.has(req.body.operation)) {
|
|
150
|
+
const emitter = new ProgressEmitter();
|
|
151
|
+
req.body.progress = emitter;
|
|
152
|
+
res.header('Content-Type', 'text/event-stream');
|
|
153
|
+
res.header('Cache-Control', 'no-cache');
|
|
154
|
+
res.header('X-Accel-Buffering', 'no'); // disable proxy buffering so events flush in real time
|
|
155
|
+
return createSSEResponseStream(emitter, () => serverUtilities.processLocalTransaction(req, operation_function));
|
|
156
|
+
}
|
|
157
|
+
|
|
122
158
|
let result = await serverUtilities.processLocalTransaction(req, operation_function);
|
|
123
159
|
if (result instanceof Readable && result.headers) {
|
|
124
160
|
for (let [name, value] of result.headers) {
|
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import search from '../../dataLayer/search.
|
|
2
|
-
import bulkLoad from '../../dataLayer/bulkLoad.
|
|
3
|
-
import schema from '../../dataLayer/schema.
|
|
4
|
-
import schemaDescribe from '../../dataLayer/schemaDescribe.
|
|
5
|
-
import delete_ from '../../dataLayer/delete.
|
|
6
|
-
import readAuditLog from '../../dataLayer/readAuditLog.
|
|
1
|
+
import * as search from '../../dataLayer/search.ts';
|
|
2
|
+
import * as bulkLoad from '../../dataLayer/bulkLoad.ts';
|
|
3
|
+
import * as schema from '../../dataLayer/schema.ts';
|
|
4
|
+
import * as schemaDescribe from '../../dataLayer/schemaDescribe.ts';
|
|
5
|
+
import * as delete_ from '../../dataLayer/delete.ts';
|
|
6
|
+
import readAuditLog from '../../dataLayer/readAuditLog.ts';
|
|
7
7
|
import * as user from '../../security/user.ts';
|
|
8
|
-
import role from '../../security/role.
|
|
8
|
+
import * as role from '../../security/role.ts';
|
|
9
9
|
import customFunctionOperations from '../../components/operations.js';
|
|
10
|
-
import harperLogger from '../../utility/logging/harper_logger.
|
|
11
|
-
import readLog from '../../utility/logging/readLog.
|
|
12
|
-
import export_ from '../../dataLayer/export.
|
|
13
|
-
import opAuth from '../../utility/operation_authorization.
|
|
14
|
-
import jobs from '../jobs/jobs.
|
|
10
|
+
import harperLogger from '../../utility/logging/harper_logger.ts';
|
|
11
|
+
import readLog from '../../utility/logging/readLog.ts';
|
|
12
|
+
import * as export_ from '../../dataLayer/export.ts';
|
|
13
|
+
import * as opAuth from '../../utility/operation_authorization.ts';
|
|
14
|
+
import * as jobs from '../jobs/jobs.ts';
|
|
15
15
|
import * as terms from '../../utility/hdbTerms.ts';
|
|
16
|
-
import { hdbErrors, handleHDBError } from '../../utility/errors/hdbError.
|
|
16
|
+
import { hdbErrors, handleHDBError } from '../../utility/errors/hdbError.ts';
|
|
17
17
|
const { HTTP_STATUS_CODES } = hdbErrors;
|
|
18
|
-
import restart from '../../bin/restart.
|
|
18
|
+
import * as restart from '../../bin/restart.ts';
|
|
19
19
|
import * as util from 'util';
|
|
20
|
-
import insert from '../../dataLayer/insert.
|
|
21
|
-
import globalSchema from '../../utility/globalSchema.
|
|
20
|
+
import * as insert from '../../dataLayer/insert.ts';
|
|
21
|
+
import * as globalSchema from '../../utility/globalSchema.ts';
|
|
22
22
|
import { systemInformation } from '../../utility/environment/systemInformation.ts';
|
|
23
|
-
import jobRunner from '../jobs/jobRunner.
|
|
23
|
+
import * as jobRunner from '../jobs/jobRunner.ts';
|
|
24
24
|
import * as tokenAuthentication from '../../security/tokenAuthentication.ts';
|
|
25
25
|
import * as auth from '../../security/auth.ts';
|
|
26
26
|
import configUtils from '../../config/configUtils.js';
|
|
27
|
-
import transactionLog from '../../utility/logging/transactionLog.
|
|
28
|
-
import npmUtilities from '../../utility/npmUtilities.
|
|
27
|
+
import * as transactionLog from '../../utility/logging/transactionLog.ts';
|
|
28
|
+
import * as npmUtilities from '../../utility/npmUtilities.ts';
|
|
29
29
|
import { _assignPackageExport } from '../../globals.js';
|
|
30
|
-
import { transformReq } from '../../utility/common_utils.
|
|
30
|
+
import { transformReq } from '../../utility/common_utils.ts';
|
|
31
31
|
import { server } from '../Server.ts';
|
|
32
32
|
const operationLog = harperLogger.loggerWithTag('operation');
|
|
33
33
|
import * as analytics from '../../resources/analytics/read.ts';
|
|
34
|
-
import operationFunctionCaller from '../../utility/OperationFunctionCaller.
|
|
34
|
+
import * as operationFunctionCaller from '../../utility/OperationFunctionCaller.ts';
|
|
35
35
|
import type { OperationRequest, OperationRequestBody } from '../operationsServer.ts';
|
|
36
36
|
import type { Context } from '../../resources/ResourceInterface.ts';
|
|
37
37
|
import * as status from '../status/index.ts';
|
|
38
38
|
import * as regDeprecated from '../../resources/registrationDeprecated.ts';
|
|
39
|
+
import * as deploymentOperations from '../../components/deploymentOperations.ts';
|
|
39
40
|
|
|
40
41
|
const pSearchSearch = util.promisify(search.search);
|
|
41
42
|
let pEvaluateSql: (sql: string) => Promise<any>;
|
|
42
43
|
function evaluateSQL(command) {
|
|
43
44
|
if (!pEvaluateSql) {
|
|
44
|
-
const sql = require('../../sqlTranslator/index
|
|
45
|
+
const sql = require('../../sqlTranslator/index');
|
|
45
46
|
pEvaluateSql = util.promisify(sql.evaluateSQL);
|
|
46
47
|
}
|
|
47
48
|
return pEvaluateSql(command);
|
|
@@ -70,9 +71,9 @@ export async function processLocalTransaction(req: OperationRequest, operationFu
|
|
|
70
71
|
try {
|
|
71
72
|
if (
|
|
72
73
|
req.body.operation !== 'read_log' &&
|
|
73
|
-
(harperLogger.
|
|
74
|
-
harperLogger.
|
|
75
|
-
harperLogger.
|
|
74
|
+
(harperLogger.logLevel === terms.LOG_LEVELS.INFO ||
|
|
75
|
+
harperLogger.logLevel === terms.LOG_LEVELS.DEBUG ||
|
|
76
|
+
harperLogger.logLevel === terms.LOG_LEVELS.TRACE)
|
|
76
77
|
) {
|
|
77
78
|
// Need to remove auth variables, but we don't want to create an object unless
|
|
78
79
|
// the logging is actually going to happen.
|
|
@@ -103,7 +104,7 @@ export async function processLocalTransaction(req: OperationRequest, operationFu
|
|
|
103
104
|
return data;
|
|
104
105
|
}
|
|
105
106
|
|
|
106
|
-
const OPERATION_FUNCTION_MAP = initializeOperationFunctionMap();
|
|
107
|
+
export const OPERATION_FUNCTION_MAP = initializeOperationFunctionMap();
|
|
107
108
|
|
|
108
109
|
server.operation = operation;
|
|
109
110
|
export type OperationDefinition = {
|
|
@@ -111,6 +112,7 @@ export type OperationDefinition = {
|
|
|
111
112
|
execute: (operation: any) => any | Promise<any>;
|
|
112
113
|
httpMethod?: 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; // method to use for REST
|
|
113
114
|
isJob?: boolean;
|
|
115
|
+
parametersSchema?: any[];
|
|
114
116
|
};
|
|
115
117
|
|
|
116
118
|
/**
|
|
@@ -118,7 +120,7 @@ export type OperationDefinition = {
|
|
|
118
120
|
* @param operationDefinition
|
|
119
121
|
*/
|
|
120
122
|
server.registerOperation = (operationDefinition: OperationDefinition) => {
|
|
121
|
-
OPERATION_FUNCTION_MAP.set(operationDefinition.name, new OperationFunctionObject(operationDefinition.execute));
|
|
123
|
+
OPERATION_FUNCTION_MAP.set(operationDefinition.name as any, new OperationFunctionObject(operationDefinition.execute));
|
|
122
124
|
};
|
|
123
125
|
|
|
124
126
|
export function chooseOperation(json: OperationRequestBody) {
|
|
@@ -136,7 +138,7 @@ export function chooseOperation(json: OperationRequestBody) {
|
|
|
136
138
|
// on all affected tables/attributes.
|
|
137
139
|
try {
|
|
138
140
|
if (json.operation === 'sql' || (json.search_operation && json.search_operation.operation === 'sql')) {
|
|
139
|
-
const sql = require('../../sqlTranslator/index
|
|
141
|
+
const sql = require('../../sqlTranslator/index');
|
|
140
142
|
const sqlStatement = json.operation === 'sql' ? json.sql : json.search_operation.sql;
|
|
141
143
|
const parsedSqlObject = sql.convertSQLToAST(sqlStatement);
|
|
142
144
|
json.parsed_sql_object = parsedSqlObject;
|
|
@@ -186,7 +188,7 @@ export function chooseOperation(json: OperationRequestBody) {
|
|
|
186
188
|
}
|
|
187
189
|
}
|
|
188
190
|
} catch (err) {
|
|
189
|
-
throw handleHDBError(err, `There was an error when trying to choose an operation path
|
|
191
|
+
throw handleHDBError(err, `There was an error when trying to choose an operation path`, 500);
|
|
190
192
|
}
|
|
191
193
|
return operation_function;
|
|
192
194
|
}
|
|
@@ -296,7 +298,7 @@ export async function executeJob(json: OperationRequestBody): Promise<JobResult>
|
|
|
296
298
|
const error = err instanceof Error ? err : null;
|
|
297
299
|
const message = `There was an error executing job: ${error && 'http_resp_msg' in error ? error.http_resp_msg : err}`;
|
|
298
300
|
operationLog.error(message);
|
|
299
|
-
throw handleHDBError(err, message);
|
|
301
|
+
throw handleHDBError(err, message, 500);
|
|
300
302
|
}
|
|
301
303
|
}
|
|
302
304
|
|
|
@@ -445,6 +447,14 @@ function initializeOperationFunctionMap(): Map<OperationFunctionName, OperationF
|
|
|
445
447
|
terms.OPERATIONS_ENUM.DEPLOY_COMPONENT,
|
|
446
448
|
new OperationFunctionObject(customFunctionOperations.deployComponent)
|
|
447
449
|
);
|
|
450
|
+
opFuncMap.set(
|
|
451
|
+
terms.OPERATIONS_ENUM.LIST_DEPLOYMENTS,
|
|
452
|
+
new OperationFunctionObject(deploymentOperations.handleListDeployments)
|
|
453
|
+
);
|
|
454
|
+
opFuncMap.set(
|
|
455
|
+
terms.OPERATIONS_ENUM.GET_DEPLOYMENT,
|
|
456
|
+
new OperationFunctionObject(deploymentOperations.handleGetDeployment)
|
|
457
|
+
);
|
|
448
458
|
opFuncMap.set(
|
|
449
459
|
terms.OPERATIONS_ENUM.READ_TRANSACTION_LOG,
|
|
450
460
|
new OperationFunctionObject(transactionLog.readTransactionLog)
|