@harperfast/harper 5.0.25 → 5.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -10
- package/agent/agent.ts +203 -0
- package/agent/loop.ts +205 -0
- package/agent/operations.ts +148 -0
- package/agent/session.ts +187 -0
- package/agent/tools/fsTools.ts +276 -0
- package/agent/tools/httpFetchTool.ts +112 -0
- package/agent/tools/scheduleTool.ts +68 -0
- package/agent/toolset.ts +43 -0
- package/agent/types.ts +85 -0
- package/bin/{BinObjects.js → BinObjects.ts} +4 -5
- package/bin/cliCredentials.ts +133 -0
- package/bin/cliOperations.ts +339 -0
- package/bin/copyDb.ts +10 -10
- package/bin/deployRenderer.ts +196 -0
- package/bin/{harper.js → harper.ts} +43 -19
- package/bin/{install.js → install.ts} +3 -3
- package/bin/lite.ts +2 -0
- package/bin/login.ts +168 -0
- package/bin/logout.ts +11 -0
- package/bin/mcp/client.ts +407 -0
- package/bin/mcp/doctor.ts +189 -0
- package/bin/mcp/index.ts +80 -0
- package/bin/mcp/options.ts +122 -0
- package/bin/mcp/printConfig.ts +89 -0
- package/bin/multipartBuilder.ts +74 -0
- package/bin/{restart.js → restart.ts} +27 -28
- package/bin/{run.js → run.ts} +41 -30
- package/bin/sseConsumer.ts +126 -0
- package/bin/{status.js → status.ts} +10 -10
- package/bin/{stop.js → stop.ts} +5 -5
- package/bin/upgrade.js +6 -6
- package/components/Application.ts +144 -18
- package/components/ApplicationScope.ts +2 -2
- package/components/ComponentV1.ts +2 -2
- package/components/EntryHandler.ts +159 -9
- package/components/OptionsWatcher.ts +75 -11
- package/components/Scope.ts +125 -15
- package/components/anthropic/index.ts +547 -0
- package/components/bedrock/index.ts +823 -0
- package/components/componentLoader.ts +63 -32
- package/components/deployLifecycle.ts +161 -0
- package/components/deploymentOperations.ts +173 -0
- package/components/deploymentRecorder.ts +402 -0
- package/components/deriveURLPath.ts +4 -4
- package/components/mcp/adapters/fastify.ts +87 -0
- package/components/mcp/adapters/harperHttp.ts +103 -0
- package/components/mcp/audit.ts +75 -0
- package/components/mcp/index.ts +134 -0
- package/components/mcp/jsonrpc.ts +134 -0
- package/components/mcp/lifecycle.ts +105 -0
- package/components/mcp/listChanged.ts +270 -0
- package/components/mcp/rateLimit.ts +217 -0
- package/components/mcp/resources.ts +593 -0
- package/components/mcp/session.ts +151 -0
- package/components/mcp/sessionRegistry.ts +140 -0
- package/components/mcp/toolRegistry.ts +292 -0
- package/components/mcp/tools/application.ts +603 -0
- package/components/mcp/tools/operations.ts +283 -0
- package/components/mcp/tools/schemas/derive.ts +256 -0
- package/components/mcp/tools/schemas/operations.ts +245 -0
- package/components/mcp/transport.ts +517 -0
- package/components/ollama/index.ts +316 -0
- package/components/openai/index.ts +563 -0
- package/components/operations.js +211 -60
- package/components/operationsValidation.js +3 -3
- package/components/packageComponent.ts +97 -29
- package/components/requestRestart.ts +17 -2
- package/components/status/crossThread.ts +14 -5
- package/components/status/errors.ts +1 -1
- package/config/RootConfigWatcher.ts +56 -2
- package/config/configUtils.js +29 -8
- package/config/harperConfigEnvVars.ts +1 -1
- package/config-root.schema.json +74 -0
- package/dataLayer/{CreateAttributeObject.js → CreateAttributeObject.ts} +4 -3
- package/dataLayer/{CreateTableObject.js → CreateTableObject.ts} +2 -1
- package/dataLayer/{DataLayerObjects.js → DataLayerObjects.ts} +17 -9
- package/dataLayer/{DeleteBeforeObject.js → DeleteBeforeObject.ts} +2 -1
- package/dataLayer/{DeleteObject.js → DeleteObject.ts} +3 -2
- package/dataLayer/{DropAttributeObject.js → DropAttributeObject.ts} +2 -1
- package/dataLayer/{GetBackupObject.js → GetBackupObject.ts} +3 -2
- package/dataLayer/{InsertObject.js → InsertObject.ts} +3 -2
- package/dataLayer/{ReadAuditLogObject.js → ReadAuditLogObject.ts} +3 -2
- package/dataLayer/{SQLSearch.js → SQLSearch.ts} +97 -43
- package/dataLayer/{SearchByConditionsObject.js → SearchByConditionsObject.ts} +5 -6
- package/dataLayer/{SearchByHashObject.js → SearchByHashObject.ts} +2 -1
- package/dataLayer/{SearchObject.js → SearchObject.ts} +2 -1
- package/dataLayer/{SqlSearchObject.js → SqlSearchObject.ts} +2 -1
- package/dataLayer/{UpdateObject.js → UpdateObject.ts} +3 -2
- package/dataLayer/{UpsertObject.js → UpsertObject.ts} +3 -2
- package/dataLayer/{bulkLoad.js → bulkLoad.ts} +40 -49
- package/dataLayer/{delete.js → delete.ts} +21 -26
- package/dataLayer/{export.js → export.ts} +22 -26
- package/dataLayer/{getBackup.js → getBackup.ts} +7 -9
- package/dataLayer/harperBridge/BridgeMethods.ts +102 -0
- package/dataLayer/harperBridge/ResourceBridge.ts +27 -26
- package/dataLayer/harperBridge/TableSizeObject.ts +1 -0
- package/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js +4 -4
- package/dataLayer/harperBridge/{harperBridge.js → harperBridge.ts} +3 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js +8 -6
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js +4 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js +6 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js +5 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js +4 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js +6 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js +5 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js +5 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js +3 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js +3 -2
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js +5 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js +10 -8
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js +4 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js +3 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js +6 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js +2 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js +3 -2
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +2 -2
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js +5 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js +6 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.ts +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js +4 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js +5 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js +4 -4
- package/dataLayer/{hdbInfoController.js → hdbInfoController.ts} +20 -26
- package/dataLayer/{insert.js → insert.ts} +24 -24
- package/dataLayer/{readAuditLog.js → readAuditLog.ts} +8 -10
- package/dataLayer/{schema.js → schema.ts} +32 -44
- package/dataLayer/{schemaDescribe.js → schemaDescribe.ts} +23 -26
- package/dataLayer/{search.js → search.ts} +9 -15
- package/dataLayer/{transaction.js → transaction.ts} +2 -5
- package/dataLayer/{update.js → update.ts} +19 -22
- package/dist/agent/agent.d.ts +35 -0
- package/dist/agent/agent.js +175 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/loop.d.ts +34 -0
- package/dist/agent/loop.js +176 -0
- package/dist/agent/loop.js.map +1 -0
- package/dist/agent/operations.d.ts +17 -0
- package/dist/agent/operations.js +137 -0
- package/dist/agent/operations.js.map +1 -0
- package/dist/agent/session.d.ts +36 -0
- package/dist/agent/session.js +182 -0
- package/dist/agent/session.js.map +1 -0
- package/dist/agent/tools/fsTools.d.ts +19 -0
- package/dist/agent/tools/fsTools.js +286 -0
- package/dist/agent/tools/fsTools.js.map +1 -0
- package/dist/agent/tools/httpFetchTool.d.ts +9 -0
- package/dist/agent/tools/httpFetchTool.js +116 -0
- package/dist/agent/tools/httpFetchTool.js.map +1 -0
- package/dist/agent/tools/scheduleTool.d.ts +22 -0
- package/dist/agent/tools/scheduleTool.js +54 -0
- package/dist/agent/tools/scheduleTool.js.map +1 -0
- package/dist/agent/toolset.d.ts +24 -0
- package/dist/agent/toolset.js +33 -0
- package/dist/agent/toolset.js.map +1 -0
- package/dist/agent/types.d.ts +75 -0
- package/dist/agent/types.js +10 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/bin/BinObjects.d.ts +2 -2
- package/dist/bin/BinObjects.js +6 -3
- package/dist/bin/BinObjects.js.map +1 -1
- package/dist/bin/cliCredentials.d.ts +27 -0
- package/dist/bin/cliCredentials.js +130 -0
- package/dist/bin/cliCredentials.js.map +1 -0
- package/dist/bin/cliOperations.d.ts +7 -7
- package/dist/bin/cliOperations.js +251 -37
- package/dist/bin/cliOperations.js.map +1 -1
- package/dist/bin/copyDb.js +16 -16
- package/dist/bin/copyDb.js.map +1 -1
- package/dist/bin/deployRenderer.d.ts +47 -0
- package/dist/bin/deployRenderer.js +185 -0
- package/dist/bin/deployRenderer.js.map +1 -0
- package/dist/bin/harper.d.ts +2 -1
- package/dist/bin/harper.js +87 -26
- package/dist/bin/harper.js.map +1 -1
- package/dist/bin/install.d.ts +1 -1
- package/dist/bin/install.js +41 -4
- package/dist/bin/install.js.map +1 -1
- package/dist/bin/lite.js +3 -4
- package/dist/bin/lite.js.map +1 -1
- package/dist/bin/login.d.ts +4 -0
- package/dist/bin/login.js +158 -0
- package/dist/bin/login.js.map +1 -0
- package/dist/bin/logout.d.ts +4 -0
- package/dist/bin/logout.js +16 -0
- package/dist/bin/logout.js.map +1 -0
- package/dist/bin/mcp/client.d.ts +34 -0
- package/dist/bin/mcp/client.js +395 -0
- package/dist/bin/mcp/client.js.map +1 -0
- package/dist/bin/mcp/doctor.d.ts +11 -0
- package/dist/bin/mcp/doctor.js +193 -0
- package/dist/bin/mcp/doctor.js.map +1 -0
- package/dist/bin/mcp/index.d.ts +10 -0
- package/dist/bin/mcp/index.js +81 -0
- package/dist/bin/mcp/index.js.map +1 -0
- package/dist/bin/mcp/options.d.ts +33 -0
- package/dist/bin/mcp/options.js +113 -0
- package/dist/bin/mcp/options.js.map +1 -0
- package/dist/bin/mcp/printConfig.d.ts +14 -0
- package/dist/bin/mcp/printConfig.js +85 -0
- package/dist/bin/mcp/printConfig.js.map +1 -0
- package/dist/bin/multipartBuilder.d.ts +26 -0
- package/dist/bin/multipartBuilder.js +55 -0
- package/dist/bin/multipartBuilder.js.map +1 -0
- package/dist/bin/restart.d.ts +3 -2
- package/dist/bin/restart.js +82 -45
- package/dist/bin/restart.js.map +1 -1
- package/dist/bin/run.d.ts +13 -9
- package/dist/bin/run.js +111 -65
- package/dist/bin/run.js.map +1 -1
- package/dist/bin/sseConsumer.d.ts +24 -0
- package/dist/bin/sseConsumer.js +127 -0
- package/dist/bin/sseConsumer.js.map +1 -0
- package/dist/bin/status.d.ts +1 -1
- package/dist/bin/status.js +48 -11
- package/dist/bin/status.js.map +1 -1
- package/dist/bin/stop.d.ts +1 -1
- package/dist/bin/stop.js +43 -6
- package/dist/bin/stop.js.map +1 -1
- package/dist/bin/upgrade.js +6 -6
- package/dist/components/Application.d.ts +29 -17
- package/dist/components/Application.js +134 -28
- package/dist/components/Application.js.map +1 -1
- package/dist/components/ApplicationScope.js +2 -2
- package/dist/components/ComponentV1.d.ts +1 -1
- package/dist/components/ComponentV1.js +5 -5
- package/dist/components/ComponentV1.js.map +1 -1
- package/dist/components/EntryHandler.d.ts +26 -3
- package/dist/components/EntryHandler.js +153 -13
- package/dist/components/EntryHandler.js.map +1 -1
- package/dist/components/OptionsWatcher.d.ts +7 -2
- package/dist/components/OptionsWatcher.js +72 -10
- package/dist/components/OptionsWatcher.js.map +1 -1
- package/dist/components/Scope.d.ts +11 -6
- package/dist/components/Scope.js +105 -9
- package/dist/components/Scope.js.map +1 -1
- package/dist/components/anthropic/index.d.ts +40 -0
- package/dist/components/anthropic/index.js +428 -0
- package/dist/components/anthropic/index.js.map +1 -0
- package/dist/components/bedrock/index.d.ts +79 -0
- package/dist/components/bedrock/index.js +734 -0
- package/dist/components/bedrock/index.js.map +1 -0
- package/dist/components/componentLoader.d.ts +29 -0
- package/dist/components/componentLoader.js +63 -38
- package/dist/components/componentLoader.js.map +1 -1
- package/dist/components/deployLifecycle.d.ts +39 -0
- package/dist/components/deployLifecycle.js +156 -0
- package/dist/components/deployLifecycle.js.map +1 -0
- package/dist/components/deploymentOperations.d.ts +19 -0
- package/dist/components/deploymentOperations.js +185 -0
- package/dist/components/deploymentOperations.js.map +1 -0
- package/dist/components/deploymentRecorder.d.ts +81 -0
- package/dist/components/deploymentRecorder.js +401 -0
- package/dist/components/deploymentRecorder.js.map +1 -0
- package/dist/components/deriveURLPath.d.ts +2 -2
- package/dist/components/deriveURLPath.js +2 -2
- package/dist/components/deriveURLPath.js.map +1 -1
- package/dist/components/mcp/adapters/fastify.d.ts +35 -0
- package/dist/components/mcp/adapters/fastify.js +66 -0
- package/dist/components/mcp/adapters/fastify.js.map +1 -0
- package/dist/components/mcp/adapters/harperHttp.d.ts +38 -0
- package/dist/components/mcp/adapters/harperHttp.js +78 -0
- package/dist/components/mcp/adapters/harperHttp.js.map +1 -0
- package/dist/components/mcp/audit.d.ts +27 -0
- package/dist/components/mcp/audit.js +73 -0
- package/dist/components/mcp/audit.js.map +1 -0
- package/dist/components/mcp/index.d.ts +47 -0
- package/dist/components/mcp/index.js +109 -0
- package/dist/components/mcp/index.js.map +1 -0
- package/dist/components/mcp/jsonrpc.d.ts +71 -0
- package/dist/components/mcp/jsonrpc.js +93 -0
- package/dist/components/mcp/jsonrpc.js.map +1 -0
- package/dist/components/mcp/lifecycle.d.ts +69 -0
- package/dist/components/mcp/lifecycle.js +79 -0
- package/dist/components/mcp/lifecycle.js.map +1 -0
- package/dist/components/mcp/listChanged.d.ts +24 -0
- package/dist/components/mcp/listChanged.js +257 -0
- package/dist/components/mcp/listChanged.js.map +1 -0
- package/dist/components/mcp/rateLimit.d.ts +25 -0
- package/dist/components/mcp/rateLimit.js +226 -0
- package/dist/components/mcp/rateLimit.js.map +1 -0
- package/dist/components/mcp/resources.d.ts +90 -0
- package/dist/components/mcp/resources.js +515 -0
- package/dist/components/mcp/resources.js.map +1 -0
- package/dist/components/mcp/session.d.ts +36 -0
- package/dist/components/mcp/session.js +170 -0
- package/dist/components/mcp/session.js.map +1 -0
- package/dist/components/mcp/sessionRegistry.d.ts +63 -0
- package/dist/components/mcp/sessionRegistry.js +124 -0
- package/dist/components/mcp/sessionRegistry.js.map +1 -0
- package/dist/components/mcp/toolRegistry.d.ts +150 -0
- package/dist/components/mcp/toolRegistry.js +176 -0
- package/dist/components/mcp/toolRegistry.js.map +1 -0
- package/dist/components/mcp/tools/application.d.ts +58 -0
- package/dist/components/mcp/tools/application.js +549 -0
- package/dist/components/mcp/tools/application.js.map +1 -0
- package/dist/components/mcp/tools/operations.d.ts +23 -0
- package/dist/components/mcp/tools/operations.js +303 -0
- package/dist/components/mcp/tools/operations.js.map +1 -0
- package/dist/components/mcp/tools/schemas/derive.d.ts +36 -0
- package/dist/components/mcp/tools/schemas/derive.js +216 -0
- package/dist/components/mcp/tools/schemas/derive.js.map +1 -0
- package/dist/components/mcp/tools/schemas/operations.d.ts +27 -0
- package/dist/components/mcp/tools/schemas/operations.js +243 -0
- package/dist/components/mcp/tools/schemas/operations.js.map +1 -0
- package/dist/components/mcp/transport.d.ts +38 -0
- package/dist/components/mcp/transport.js +467 -0
- package/dist/components/mcp/transport.js.map +1 -0
- package/dist/components/ollama/index.d.ts +46 -0
- package/dist/components/ollama/index.js +239 -0
- package/dist/components/ollama/index.js.map +1 -0
- package/dist/components/openai/index.d.ts +51 -0
- package/dist/components/openai/index.js +475 -0
- package/dist/components/openai/index.js.map +1 -0
- package/dist/components/operations.d.ts +6 -6
- package/dist/components/operations.js +198 -52
- package/dist/components/operations.js.map +1 -1
- package/dist/components/operationsValidation.d.ts +2 -2
- package/dist/components/operationsValidation.js +3 -3
- package/dist/components/packageComponent.d.ts +28 -6
- package/dist/components/packageComponent.js +87 -26
- package/dist/components/packageComponent.js.map +1 -1
- package/dist/components/requestRestart.d.ts +1 -0
- package/dist/components/requestRestart.js +12 -1
- package/dist/components/requestRestart.js.map +1 -1
- package/dist/components/status/crossThread.d.ts +5 -1
- package/dist/components/status/crossThread.js +12 -5
- package/dist/components/status/crossThread.js.map +1 -1
- package/dist/components/status/errors.js +7 -7
- package/dist/config/RootConfigWatcher.d.ts +3 -0
- package/dist/config/RootConfigWatcher.js +52 -1
- package/dist/config/RootConfigWatcher.js.map +1 -1
- package/dist/config/configUtils.js +31 -8
- package/dist/config/configUtils.js.map +1 -1
- package/dist/config/harperConfigEnvVars.js +1 -1
- package/dist/config/harperConfigEnvVars.js.map +1 -1
- package/dist/dataLayer/CreateAttributeObject.d.ts +3 -7
- package/dist/dataLayer/CreateAttributeObject.js +4 -3
- package/dist/dataLayer/CreateAttributeObject.js.map +1 -1
- package/dist/dataLayer/CreateTableObject.d.ts +2 -4
- package/dist/dataLayer/CreateTableObject.js +2 -1
- package/dist/dataLayer/CreateTableObject.js.map +1 -1
- package/dist/dataLayer/DataLayerObjects.d.ts +17 -16
- package/dist/dataLayer/DataLayerObjects.js +19 -5
- package/dist/dataLayer/DataLayerObjects.js.map +1 -1
- package/dist/dataLayer/DeleteBeforeObject.d.ts +3 -5
- package/dist/dataLayer/DeleteBeforeObject.js +2 -1
- package/dist/dataLayer/DeleteBeforeObject.js.map +1 -1
- package/dist/dataLayer/DeleteObject.d.ts +3 -7
- package/dist/dataLayer/DeleteObject.js +4 -3
- package/dist/dataLayer/DeleteObject.js.map +1 -1
- package/dist/dataLayer/DropAttributeObject.d.ts +2 -4
- package/dist/dataLayer/DropAttributeObject.js +2 -1
- package/dist/dataLayer/DropAttributeObject.js.map +1 -1
- package/dist/dataLayer/GetBackupObject.d.ts +3 -5
- package/dist/dataLayer/GetBackupObject.js +4 -3
- package/dist/dataLayer/GetBackupObject.js.map +1 -1
- package/dist/dataLayer/InsertObject.d.ts +3 -8
- package/dist/dataLayer/InsertObject.js +4 -3
- package/dist/dataLayer/InsertObject.js.map +1 -1
- package/dist/dataLayer/ReadAuditLogObject.d.ts +3 -7
- package/dist/dataLayer/ReadAuditLogObject.js +4 -3
- package/dist/dataLayer/ReadAuditLogObject.js.map +1 -1
- package/dist/dataLayer/SQLSearch.d.ts +68 -38
- package/dist/dataLayer/SQLSearch.js +140 -78
- package/dist/dataLayer/SQLSearch.js.map +1 -1
- package/dist/dataLayer/SearchByConditionsObject.d.ts +10 -58
- package/dist/dataLayer/SearchByConditionsObject.js +5 -7
- package/dist/dataLayer/SearchByConditionsObject.js.map +1 -1
- package/dist/dataLayer/SearchByHashObject.d.ts +3 -6
- package/dist/dataLayer/SearchByHashObject.js +2 -1
- package/dist/dataLayer/SearchByHashObject.js.map +1 -1
- package/dist/dataLayer/SearchObject.d.ts +3 -12
- package/dist/dataLayer/SearchObject.js +2 -1
- package/dist/dataLayer/SearchObject.js.map +1 -1
- package/dist/dataLayer/SqlSearchObject.d.ts +2 -4
- package/dist/dataLayer/SqlSearchObject.js +2 -1
- package/dist/dataLayer/SqlSearchObject.js.map +1 -1
- package/dist/dataLayer/UpdateObject.d.ts +3 -7
- package/dist/dataLayer/UpdateObject.js +4 -3
- package/dist/dataLayer/UpdateObject.js.map +1 -1
- package/dist/dataLayer/UpsertObject.d.ts +3 -7
- package/dist/dataLayer/UpsertObject.js +4 -3
- package/dist/dataLayer/UpsertObject.js.map +1 -1
- package/dist/dataLayer/bulkLoad.d.ts +4 -4
- package/dist/dataLayer/bulkLoad.js +122 -88
- package/dist/dataLayer/bulkLoad.js.map +1 -1
- package/dist/dataLayer/delete.d.ts +10 -11
- package/dist/dataLayer/delete.js +74 -39
- package/dist/dataLayer/delete.js.map +1 -1
- package/dist/dataLayer/export.d.ts +8 -8
- package/dist/dataLayer/export.js +90 -55
- package/dist/dataLayer/export.js.map +1 -1
- package/dist/dataLayer/getBackup.d.ts +4 -3
- package/dist/dataLayer/getBackup.js +43 -11
- package/dist/dataLayer/getBackup.js.map +1 -1
- package/dist/dataLayer/harperBridge/BridgeMethods.d.ts +39 -21
- package/dist/dataLayer/harperBridge/BridgeMethods.js +41 -20
- package/dist/dataLayer/harperBridge/BridgeMethods.js.map +1 -1
- package/dist/dataLayer/harperBridge/ResourceBridge.d.ts +2 -2
- package/dist/dataLayer/harperBridge/ResourceBridge.js +26 -25
- package/dist/dataLayer/harperBridge/ResourceBridge.js.map +1 -1
- package/dist/dataLayer/harperBridge/TableSizeObject.d.ts +1 -0
- package/dist/dataLayer/harperBridge/TableSizeObject.js.map +1 -1
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.d.ts +4 -4
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js +4 -4
- package/dist/dataLayer/harperBridge/harperBridge.d.ts +2 -3
- package/dist/dataLayer/harperBridge/harperBridge.js +38 -4
- package/dist/dataLayer/harperBridge/harperBridge.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js +7 -6
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js +5 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js +3 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js +8 -8
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.d.ts +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js +3 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js +3 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js +5 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js +4 -4
- package/dist/dataLayer/hdbInfoController.d.ts +4 -8
- package/dist/dataLayer/hdbInfoController.js +66 -31
- package/dist/dataLayer/hdbInfoController.js.map +1 -1
- package/dist/dataLayer/insert.d.ts +14 -26
- package/dist/dataLayer/insert.js +63 -28
- package/dist/dataLayer/insert.js.map +1 -1
- package/dist/dataLayer/readAuditLog.d.ts +1 -3
- package/dist/dataLayer/readAuditLog.js +45 -13
- package/dist/dataLayer/readAuditLog.js.map +1 -1
- package/dist/dataLayer/schema.d.ts +10 -10
- package/dist/dataLayer/schema.js +124 -89
- package/dist/dataLayer/schema.js.map +1 -1
- package/dist/dataLayer/schemaDescribe.d.ts +4 -4
- package/dist/dataLayer/schemaDescribe.js +78 -41
- package/dist/dataLayer/schemaDescribe.js.map +1 -1
- package/dist/dataLayer/search.d.ts +4 -4
- package/dist/dataLayer/search.js +12 -13
- package/dist/dataLayer/search.js.map +1 -1
- package/dist/dataLayer/transaction.d.ts +1 -1
- package/dist/dataLayer/transaction.js +3 -4
- package/dist/dataLayer/transaction.js.map +1 -1
- package/dist/dataLayer/update.d.ts +2 -8
- package/dist/dataLayer/update.js +53 -18
- package/dist/dataLayer/update.js.map +1 -1
- package/dist/globals.d.ts +1 -1
- package/dist/globals.js +1 -0
- package/dist/globals.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/json/systemSchema.json +65 -0
- package/dist/launchServiceScripts/launchHarperDB.d.ts +1 -0
- package/dist/launchServiceScripts/launchHarperDB.js +3 -0
- package/dist/launchServiceScripts/launchHarperDB.js.map +1 -0
- package/dist/launchServiceScripts/utility/checkNodeVersion.js +3 -0
- package/dist/launchServiceScripts/utility/checkNodeVersion.js.map +1 -1
- package/dist/resources/DatabaseTransaction.d.ts +14 -6
- package/dist/resources/DatabaseTransaction.js +39 -15
- package/dist/resources/DatabaseTransaction.js.map +1 -1
- package/dist/resources/ErrorResource.d.ts +1 -1
- package/dist/resources/ErrorResource.js +3 -1
- package/dist/resources/ErrorResource.js.map +1 -1
- package/dist/resources/LMDBTransaction.d.ts +10 -13
- package/dist/resources/LMDBTransaction.js +18 -7
- package/dist/resources/LMDBTransaction.js.map +1 -1
- package/dist/resources/RecordEncoder.d.ts +7 -1
- package/dist/resources/RecordEncoder.js +5 -2
- package/dist/resources/RecordEncoder.js.map +1 -1
- package/dist/resources/RequestTarget.d.ts +1 -0
- package/dist/resources/RequestTarget.js.map +1 -1
- package/dist/resources/Resource.d.ts +9 -5
- package/dist/resources/Resource.js +37 -10
- package/dist/resources/Resource.js.map +1 -1
- package/dist/resources/ResourceInterface.d.ts +24 -5
- package/dist/resources/ResourceInterface.js +20 -0
- package/dist/resources/ResourceInterface.js.map +1 -1
- package/dist/resources/Resources.d.ts +3 -4
- package/dist/resources/Resources.js +7 -6
- package/dist/resources/Resources.js.map +1 -1
- package/dist/resources/RocksIndexStore.js +3 -0
- package/dist/resources/RocksIndexStore.js.map +1 -1
- package/dist/resources/RocksTransactionLogStore.d.ts +1 -1
- package/dist/resources/RocksTransactionLogStore.js +46 -27
- package/dist/resources/RocksTransactionLogStore.js.map +1 -1
- package/dist/resources/Table.d.ts +59 -329
- package/dist/resources/Table.js +267 -107
- package/dist/resources/Table.js.map +1 -1
- package/dist/resources/analytics/metadata.d.ts +1 -0
- package/dist/resources/analytics/metadata.js +1 -0
- package/dist/resources/analytics/metadata.js.map +1 -1
- package/dist/resources/analytics/read.d.ts +5 -0
- package/dist/resources/analytics/read.js +16 -5
- package/dist/resources/analytics/read.js.map +1 -1
- package/dist/resources/analytics/write.d.ts +28 -0
- package/dist/resources/analytics/write.js +232 -20
- package/dist/resources/analytics/write.js.map +1 -1
- package/dist/resources/auditStore.d.ts +18 -13
- package/dist/resources/auditStore.js +13 -8
- package/dist/resources/auditStore.js.map +1 -1
- package/dist/resources/blob.d.ts +16 -27
- package/dist/resources/blob.js +8 -8
- package/dist/resources/blob.js.map +1 -1
- package/dist/resources/dataLoader.d.ts +1 -1
- package/dist/resources/dataLoader.js +13 -13
- package/dist/resources/databases.d.ts +13 -0
- package/dist/resources/databases.js +160 -52
- package/dist/resources/databases.js.map +1 -1
- package/dist/resources/graphql.d.ts +1 -7
- package/dist/resources/graphql.js +224 -174
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +16 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +308 -59
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
- package/dist/resources/indexes/vector.d.ts +1 -0
- package/dist/resources/indexes/vector.js +14 -0
- package/dist/resources/indexes/vector.js.map +1 -1
- package/dist/resources/loadEnv.d.ts +2 -5
- package/dist/resources/loadEnv.js +21 -18
- package/dist/resources/loadEnv.js.map +1 -1
- package/dist/resources/login.d.ts +2 -3
- package/dist/resources/login.js +5 -4
- package/dist/resources/login.js.map +1 -1
- package/dist/resources/models/Models.d.ts +45 -0
- package/dist/resources/models/Models.js +265 -0
- package/dist/resources/models/Models.js.map +1 -0
- package/dist/resources/models/TestBackend.d.ts +15 -0
- package/dist/resources/models/TestBackend.js +71 -0
- package/dist/resources/models/TestBackend.js.map +1 -0
- package/dist/resources/models/agentLoop.d.ts +125 -0
- package/dist/resources/models/agentLoop.js +746 -0
- package/dist/resources/models/agentLoop.js.map +1 -0
- package/dist/resources/models/analyticsTable.d.ts +65 -0
- package/dist/resources/models/analyticsTable.js +166 -0
- package/dist/resources/models/analyticsTable.js.map +1 -0
- package/dist/resources/models/backendHelpers.d.ts +57 -0
- package/dist/resources/models/backendHelpers.js +109 -0
- package/dist/resources/models/backendHelpers.js.map +1 -0
- package/dist/resources/models/backendRegistry.d.ts +36 -0
- package/dist/resources/models/backendRegistry.js +54 -0
- package/dist/resources/models/backendRegistry.js.map +1 -0
- package/dist/resources/models/bootstrap.d.ts +24 -0
- package/dist/resources/models/bootstrap.js +112 -0
- package/dist/resources/models/bootstrap.js.map +1 -0
- package/dist/resources/models/embedHook.d.ts +33 -0
- package/dist/resources/models/embedHook.js +127 -0
- package/dist/resources/models/embedHook.js.map +1 -0
- package/dist/resources/models/types.d.ts +301 -0
- package/dist/resources/models/types.js +11 -0
- package/dist/resources/models/types.js.map +1 -0
- package/dist/resources/replayLogs.js +7 -1
- package/dist/resources/replayLogs.js.map +1 -1
- package/dist/resources/roles.d.ts +1 -7
- package/dist/resources/roles.js +67 -71
- package/dist/resources/roles.js.map +1 -1
- package/dist/resources/search.d.ts +18 -1
- package/dist/resources/search.js +349 -140
- package/dist/resources/search.js.map +1 -1
- package/dist/resources/tracked.d.ts +1 -1
- package/dist/resources/tracked.js +14 -14
- package/dist/resources/tracked.js.map +1 -1
- package/dist/resources/transaction.d.ts +1 -1
- package/dist/resources/transaction.js +1 -1
- package/dist/resources/transaction.js.map +1 -1
- package/dist/resources/transactionBroadcast.d.ts +1 -1
- package/dist/resources/transactionBroadcast.js.map +1 -1
- package/dist/security/auth.d.ts +1 -5
- package/dist/security/auth.js +34 -25
- package/dist/security/auth.js.map +1 -1
- package/dist/security/certificateVerification/crlVerification.js +7 -1
- package/dist/security/certificateVerification/crlVerification.js.map +1 -1
- package/dist/security/cryptoHash.d.ts +2 -2
- package/dist/security/cryptoHash.js +37 -5
- package/dist/security/cryptoHash.js.map +1 -1
- package/dist/security/data_objects/PermissionAttributeResponseObject.d.ts +3 -4
- package/dist/security/data_objects/PermissionAttributeResponseObject.js +4 -1
- package/dist/security/data_objects/PermissionAttributeResponseObject.js.map +1 -1
- package/dist/security/data_objects/PermissionResponseObject.d.ts +9 -9
- package/dist/security/data_objects/PermissionResponseObject.js +15 -8
- package/dist/security/data_objects/PermissionResponseObject.js.map +1 -1
- package/dist/security/data_objects/PermissionTableResponseObject.d.ts +5 -6
- package/dist/security/data_objects/PermissionTableResponseObject.js +6 -1
- package/dist/security/data_objects/PermissionTableResponseObject.js.map +1 -1
- package/dist/security/fastifyAuth.d.ts +2 -2
- package/dist/security/fastifyAuth.js +131 -22
- package/dist/security/fastifyAuth.js.map +1 -1
- package/dist/security/impersonation.js +15 -15
- package/dist/security/jsLoader.js +18 -5
- package/dist/security/jsLoader.js.map +1 -1
- package/dist/security/keys.d.ts +45 -48
- package/dist/security/keys.js +160 -114
- package/dist/security/keys.js.map +1 -1
- package/dist/security/permissionsTranslator.js +2 -2
- package/dist/security/role.d.ts +5 -5
- package/dist/security/role.js +70 -35
- package/dist/security/role.js.map +1 -1
- package/dist/security/tokenAuthentication.d.ts +13 -0
- package/dist/security/tokenAuthentication.js +57 -27
- package/dist/security/tokenAuthentication.js.map +1 -1
- package/dist/security/user.js +74 -38
- package/dist/security/user.js.map +1 -1
- package/dist/server/DurableSubscriptionsSession.d.ts +4 -2
- package/dist/server/DurableSubscriptionsSession.js +71 -55
- package/dist/server/DurableSubscriptionsSession.js.map +1 -1
- package/dist/server/REST.d.ts +1 -8
- package/dist/server/REST.js +17 -16
- package/dist/server/REST.js.map +1 -1
- package/dist/server/Server.d.ts +23 -4
- package/dist/server/Server.js +1 -1
- package/dist/server/Server.js.map +1 -1
- package/dist/server/fastifyRoutes/helpers/getCORSOptions.js +1 -1
- package/dist/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js +1 -1
- package/dist/server/fastifyRoutes/helpers/getServerOptions.js +1 -1
- package/dist/server/fastifyRoutes.d.ts +1 -4
- package/dist/server/fastifyRoutes.js +34 -30
- package/dist/server/fastifyRoutes.js.map +1 -1
- package/dist/server/graphqlQuerying.d.ts +1 -1
- package/dist/server/graphqlQuerying.js +8 -7
- package/dist/server/graphqlQuerying.js.map +1 -1
- package/dist/server/http.d.ts +9 -4
- package/dist/server/http.js +523 -47
- package/dist/server/http.js.map +1 -1
- package/dist/server/itc/serverHandlers.js +66 -15
- package/dist/server/itc/serverHandlers.js.map +1 -1
- package/dist/server/jobs/JobObject.d.ts +3 -3
- package/dist/server/jobs/JobObject.js +53 -7
- package/dist/server/jobs/JobObject.js.map +1 -1
- package/dist/server/jobs/jobProcess.js +64 -24
- package/dist/server/jobs/jobProcess.js.map +1 -1
- package/dist/server/jobs/jobRunner.d.ts +7 -6
- package/dist/server/jobs/jobRunner.js +68 -30
- package/dist/server/jobs/jobRunner.js.map +1 -1
- package/dist/server/jobs/jobs.d.ts +18 -7
- package/dist/server/jobs/jobs.js +93 -61
- package/dist/server/jobs/jobs.js.map +1 -1
- package/dist/server/loadRootComponents.js +1 -1
- package/dist/server/middlewareChain.d.ts +80 -0
- package/dist/server/middlewareChain.js +252 -0
- package/dist/server/middlewareChain.js.map +1 -0
- package/dist/server/mqtt.d.ts +1 -8
- package/dist/server/mqtt.js +22 -17
- package/dist/server/mqtt.js.map +1 -1
- package/dist/server/nodeName.js +44 -13
- package/dist/server/nodeName.js.map +1 -1
- package/dist/server/operationsServer.d.ts +2 -2
- package/dist/server/operationsServer.js +106 -33
- package/dist/server/operationsServer.js.map +1 -1
- package/dist/server/serverHelpers/Headers.d.ts +4 -4
- package/dist/server/serverHelpers/Headers.js +2 -0
- package/dist/server/serverHelpers/Headers.js.map +1 -1
- package/dist/server/serverHelpers/JSONStream.d.ts +7 -1
- package/dist/server/serverHelpers/JSONStream.js +12 -3
- package/dist/server/serverHelpers/JSONStream.js.map +1 -1
- package/dist/server/serverHelpers/Request.d.ts +106 -8
- package/dist/server/serverHelpers/Request.js +370 -9
- package/dist/server/serverHelpers/Request.js.map +1 -1
- package/dist/server/serverHelpers/contentTypes.d.ts +1 -1
- package/dist/server/serverHelpers/contentTypes.js +36 -7
- package/dist/server/serverHelpers/contentTypes.js.map +1 -1
- package/dist/server/serverHelpers/multipartParser.d.ts +21 -0
- package/dist/server/serverHelpers/multipartParser.js +142 -0
- package/dist/server/serverHelpers/multipartParser.js.map +1 -0
- package/dist/server/serverHelpers/progressEmitter.d.ts +25 -0
- package/dist/server/serverHelpers/progressEmitter.js +103 -0
- package/dist/server/serverHelpers/progressEmitter.js.map +1 -0
- package/dist/server/serverHelpers/serverHandlers.d.ts +1 -1
- package/dist/server/serverHelpers/serverHandlers.js +38 -7
- package/dist/server/serverHelpers/serverHandlers.js.map +1 -1
- package/dist/server/serverHelpers/serverUtilities.d.ts +4 -2
- package/dist/server/serverHelpers/serverUtilities.js +97 -93
- package/dist/server/serverHelpers/serverUtilities.js.map +1 -1
- package/dist/server/static.js +8 -5
- package/dist/server/static.js.map +1 -1
- package/dist/server/status/index.js +3 -3
- package/dist/server/storageReclamation.d.ts +10 -0
- package/dist/server/storageReclamation.js +68 -9
- package/dist/server/storageReclamation.js.map +1 -1
- package/dist/server/threads/itc.js +7 -4
- package/dist/server/threads/itc.js.map +1 -1
- package/dist/server/threads/manageThreads.d.ts +1 -1
- package/dist/server/threads/manageThreads.js +110 -26
- package/dist/server/threads/manageThreads.js.map +1 -1
- package/dist/server/threads/socketRouter.d.ts +0 -1
- package/dist/server/threads/socketRouter.js +8 -271
- package/dist/server/threads/socketRouter.js.map +1 -1
- package/dist/server/threads/threadServer.d.ts +1 -0
- package/dist/server/threads/threadServer.js +360 -118
- package/dist/server/threads/threadServer.js.map +1 -1
- package/dist/server/threads/workerProcessGuard.d.ts +42 -0
- package/dist/server/threads/workerProcessGuard.js +114 -0
- package/dist/server/threads/workerProcessGuard.js.map +1 -0
- package/dist/server/throttle.js +17 -0
- package/dist/server/throttle.js.map +1 -1
- package/dist/sqlTranslator/SelectValidator.d.ts +21 -24
- package/dist/sqlTranslator/SelectValidator.js +86 -47
- package/dist/sqlTranslator/SelectValidator.js.map +1 -1
- package/dist/sqlTranslator/alasqlFunctionImporter.d.ts +6 -2
- package/dist/sqlTranslator/alasqlFunctionImporter.js +40 -3
- package/dist/sqlTranslator/alasqlFunctionImporter.js.map +1 -1
- package/dist/sqlTranslator/deleteTranslator.d.ts +4 -7
- package/dist/sqlTranslator/deleteTranslator.js +48 -14
- package/dist/sqlTranslator/deleteTranslator.js.map +1 -1
- package/dist/sqlTranslator/index.d.ts +10 -9
- package/dist/sqlTranslator/index.js +69 -30
- package/dist/sqlTranslator/index.js.map +1 -1
- package/dist/sqlTranslator/sql_statement_bucket.d.ts +10 -10
- package/dist/sqlTranslator/sql_statement_bucket.js +55 -13
- package/dist/sqlTranslator/sql_statement_bucket.js.map +1 -1
- package/dist/upgrade/UpgradeObjects.d.ts +2 -3
- package/dist/upgrade/UpgradeObjects.js +37 -4
- package/dist/upgrade/UpgradeObjects.js.map +1 -1
- package/dist/upgrade/directives/5-2-0.d.ts +6 -0
- package/dist/upgrade/directives/5-2-0.js +77 -0
- package/dist/upgrade/directives/5-2-0.js.map +1 -0
- package/dist/upgrade/directives/directivesController.d.ts +10 -10
- package/dist/upgrade/directives/directivesController.js +52 -11
- package/dist/upgrade/directives/directivesController.js.map +1 -1
- package/dist/upgrade/directivesManager.d.ts +1 -1
- package/dist/upgrade/directivesManager.js +53 -18
- package/dist/upgrade/directivesManager.js.map +1 -1
- package/dist/upgrade/upgradePrompt.d.ts +3 -3
- package/dist/upgrade/upgradePrompt.js +65 -30
- package/dist/upgrade/upgradePrompt.js.map +1 -1
- package/dist/upgrade/upgradeUtilities.d.ts +1 -1
- package/dist/upgrade/upgradeUtilities.js +37 -5
- package/dist/upgrade/upgradeUtilities.js.map +1 -1
- package/dist/utility/OperationFunctionCaller.d.ts +1 -1
- package/dist/utility/OperationFunctionCaller.js +45 -10
- package/dist/utility/OperationFunctionCaller.js.map +1 -1
- package/dist/utility/assignCmdEnvVariables.d.ts +1 -2
- package/dist/utility/assignCmdEnvVariables.js +8 -4
- package/dist/utility/assignCmdEnvVariables.js.map +1 -1
- package/dist/utility/common_utils.d.ts +80 -77
- package/dist/utility/common_utils.js +140 -79
- package/dist/utility/common_utils.js.map +1 -1
- package/dist/utility/environment/environmentManager.d.ts +12 -11
- package/dist/utility/environment/environmentManager.js +75 -29
- package/dist/utility/environment/environmentManager.js.map +1 -1
- package/dist/utility/environment/systemInformation.d.ts +4 -0
- package/dist/utility/environment/systemInformation.js +27 -16
- package/dist/utility/environment/systemInformation.js.map +1 -1
- package/dist/utility/errors/commonErrors.d.ts +192 -168
- package/dist/utility/errors/commonErrors.js +49 -18
- package/dist/utility/errors/commonErrors.js.map +1 -1
- package/dist/utility/errors/hdbError.d.ts +37 -51
- package/dist/utility/errors/hdbError.js +65 -26
- package/dist/utility/errors/hdbError.js.map +1 -1
- package/dist/utility/expandEnvVar.d.ts +61 -0
- package/dist/utility/expandEnvVar.js +113 -0
- package/dist/utility/expandEnvVar.js.map +1 -0
- package/dist/utility/functions/geo.js +2 -2
- package/dist/utility/functions/sql/alaSQLExtension.js +1 -1
- package/dist/utility/globalSchema.d.ts +13 -4
- package/dist/utility/globalSchema.js +14 -11
- package/dist/utility/globalSchema.js.map +1 -1
- package/dist/utility/hdbTerms.d.ts +56 -0
- package/dist/utility/hdbTerms.js +56 -0
- package/dist/utility/hdbTerms.js.map +1 -1
- package/dist/utility/install/checkJWTTokensExist.js +1 -1
- package/dist/utility/install/installer.d.ts +9 -12
- package/dist/utility/install/installer.js +87 -51
- package/dist/utility/install/installer.js.map +1 -1
- package/dist/utility/installation.js +3 -3
- package/dist/utility/lmdb/DBIDefinition.d.ts +4 -4
- package/dist/utility/lmdb/DBIDefinition.js +5 -1
- package/dist/utility/lmdb/DBIDefinition.js.map +1 -1
- package/dist/utility/lmdb/DeleteRecordsResponseObject.d.ts +3 -6
- package/dist/utility/lmdb/DeleteRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/DeleteRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/InsertRecordsResponseObject.d.ts +3 -5
- package/dist/utility/lmdb/InsertRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/InsertRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/OpenDBIObject.d.ts +11 -15
- package/dist/utility/lmdb/OpenDBIObject.js +54 -6
- package/dist/utility/lmdb/OpenDBIObject.js.map +1 -1
- package/dist/utility/lmdb/OpenEnvironmentObject.d.ts +5 -8
- package/dist/utility/lmdb/OpenEnvironmentObject.js +52 -4
- package/dist/utility/lmdb/OpenEnvironmentObject.js.map +1 -1
- package/dist/utility/lmdb/UpdateRecordsResponseObject.d.ts +3 -6
- package/dist/utility/lmdb/UpdateRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/UpdateRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/UpsertRecordsResponseObject.d.ts +3 -5
- package/dist/utility/lmdb/UpsertRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/UpsertRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/cleanLMDBMap.d.ts +1 -1
- package/dist/utility/lmdb/cleanLMDBMap.js +44 -7
- package/dist/utility/lmdb/cleanLMDBMap.js.map +1 -1
- package/dist/utility/lmdb/commonUtility.d.ts +8 -9
- package/dist/utility/lmdb/commonUtility.js +46 -17
- package/dist/utility/lmdb/commonUtility.js.map +1 -1
- package/dist/utility/lmdb/deleteUtility.d.ts +2 -3
- package/dist/utility/lmdb/deleteUtility.js +51 -16
- package/dist/utility/lmdb/deleteUtility.js.map +1 -1
- package/dist/utility/lmdb/environmentUtility.d.ts +69 -36
- package/dist/utility/lmdb/environmentUtility.js +91 -51
- package/dist/utility/lmdb/environmentUtility.js.map +1 -1
- package/dist/utility/lmdb/searchCursorFunctions.d.ts +19 -19
- package/dist/utility/lmdb/searchCursorFunctions.js +46 -14
- package/dist/utility/lmdb/searchCursorFunctions.js.map +1 -1
- package/dist/utility/lmdb/searchUtility.d.ts +142 -73
- package/dist/utility/lmdb/searchUtility.js +91 -55
- package/dist/utility/lmdb/searchUtility.js.map +1 -1
- package/dist/utility/lmdb/terms.d.ts +34 -34
- package/dist/utility/lmdb/terms.js +12 -22
- package/dist/utility/lmdb/terms.js.map +1 -1
- package/dist/utility/lmdb/writeUtility.d.ts +3 -6
- package/dist/utility/lmdb/writeUtility.js +61 -28
- package/dist/utility/lmdb/writeUtility.js.map +1 -1
- package/dist/utility/logging/harper_logger.d.ts +87 -103
- package/dist/utility/logging/harper_logger.js +176 -81
- package/dist/utility/logging/harper_logger.js.map +1 -1
- package/dist/utility/logging/logRotator.d.ts +2 -10
- package/dist/utility/logging/logRotator.js +65 -28
- package/dist/utility/logging/logRotator.js.map +1 -1
- package/dist/utility/logging/logger.js +4 -4
- package/dist/utility/logging/readLog.d.ts +1 -1
- package/dist/utility/logging/readLog.js +54 -17
- package/dist/utility/logging/readLog.js.map +1 -1
- package/dist/utility/logging/transactionLog.d.ts +2 -2
- package/dist/utility/logging/transactionLog.js +51 -16
- package/dist/utility/logging/transactionLog.js.map +1 -1
- package/dist/utility/mount_hdb.d.ts +1 -2
- package/dist/utility/mount_hdb.js +54 -17
- package/dist/utility/mount_hdb.js.map +1 -1
- package/dist/utility/npmUtilities.d.ts +1 -1
- package/dist/utility/npmUtilities.js +54 -19
- package/dist/utility/npmUtilities.js.map +1 -1
- package/dist/utility/operation_authorization.d.ts +36 -9
- package/dist/utility/operation_authorization.js +135 -86
- package/dist/utility/operation_authorization.js.map +1 -1
- package/dist/utility/packageUtils.d.ts +0 -2
- package/dist/utility/packageUtils.js +7 -17
- package/dist/utility/packageUtils.js.map +1 -1
- package/dist/utility/password.js +2 -2
- package/dist/utility/processManagement/processManagement.js +2 -2
- package/dist/utility/processManagement/servicesConfig.js +1 -1
- package/dist/utility/signalling.d.ts +2 -2
- package/dist/utility/signalling.js +51 -16
- package/dist/utility/signalling.js.map +1 -1
- package/dist/utility/watcherFallback.d.ts +36 -0
- package/dist/utility/watcherFallback.js +73 -0
- package/dist/utility/watcherFallback.js.map +1 -0
- package/dist/validation/analyticsValidator.d.ts +1 -0
- package/dist/validation/analyticsValidator.js +79 -0
- package/dist/validation/analyticsValidator.js.map +1 -0
- package/dist/validation/bulkDeleteValidator.d.ts +1 -2
- package/dist/validation/bulkDeleteValidator.js +49 -11
- package/dist/validation/bulkDeleteValidator.js.map +1 -1
- package/dist/validation/check_permissions.d.ts +1 -2
- package/dist/validation/check_permissions.js +38 -3
- package/dist/validation/check_permissions.js.map +1 -1
- package/dist/validation/common_validators.d.ts +20 -20
- package/dist/validation/common_validators.js +62 -31
- package/dist/validation/common_validators.js.map +1 -1
- package/dist/validation/configValidator.d.ts +4 -4
- package/dist/validation/configValidator.js +189 -54
- package/dist/validation/configValidator.js.map +1 -1
- package/dist/validation/deleteValidator.d.ts +1 -2
- package/dist/validation/deleteValidator.js +49 -11
- package/dist/validation/deleteValidator.js.map +1 -1
- package/dist/validation/fileLoadValidator.d.ts +4 -4
- package/dist/validation/fileLoadValidator.js +67 -32
- package/dist/validation/fileLoadValidator.js.map +1 -1
- package/dist/validation/insertValidator.d.ts +1 -2
- package/dist/validation/insertValidator.js +48 -10
- package/dist/validation/insertValidator.js.map +1 -1
- package/dist/validation/installValidator.d.ts +2 -2
- package/dist/validation/installValidator.js +47 -10
- package/dist/validation/installValidator.js.map +1 -1
- package/dist/validation/readLogValidator.d.ts +1 -2
- package/dist/validation/readLogValidator.js +60 -22
- package/dist/validation/readLogValidator.js.map +1 -1
- package/dist/validation/role_validation.d.ts +3 -3
- package/dist/validation/role_validation.js +55 -19
- package/dist/validation/role_validation.js.map +1 -1
- package/dist/validation/schemaMetadataValidator.d.ts +3 -4
- package/dist/validation/schemaMetadataValidator.js +11 -12
- package/dist/validation/schemaMetadataValidator.js.map +1 -1
- package/dist/validation/searchValidator.d.ts +1 -2
- package/dist/validation/searchValidator.js +82 -43
- package/dist/validation/searchValidator.js.map +1 -1
- package/dist/validation/statusValidator.d.ts +1 -1
- package/dist/validation/transactionLogValidator.d.ts +3 -3
- package/dist/validation/transactionLogValidator.js +52 -17
- package/dist/validation/transactionLogValidator.js.map +1 -1
- package/dist/validation/user_validation.d.ts +3 -3
- package/dist/validation/user_validation.js +38 -6
- package/dist/validation/user_validation.js.map +1 -1
- package/dist/validation/validationWrapper.d.ts +3 -3
- package/dist/validation/validationWrapper.js +4 -5
- package/dist/validation/validationWrapper.js.map +1 -1
- package/index.ts +5 -0
- package/json/systemSchema.json +65 -0
- package/launchServiceScripts/utility/checkNodeVersion.js +2 -0
- package/package.json +37 -22
- package/resources/DESIGN.md +98 -0
- package/resources/DatabaseTransaction.ts +58 -30
- package/resources/ErrorResource.ts +2 -1
- package/resources/LMDBTransaction.ts +38 -29
- package/resources/RecordEncoder.ts +12 -4
- package/resources/RequestTarget.ts +2 -0
- package/resources/Resource.ts +89 -56
- package/resources/ResourceInterface.ts +44 -21
- package/resources/Resources.ts +8 -8
- package/resources/RocksIndexStore.ts +3 -0
- package/resources/RocksTransactionLogStore.ts +47 -28
- package/resources/Table.ts +386 -214
- package/resources/analytics/metadata.ts +1 -0
- package/resources/analytics/read.ts +24 -6
- package/resources/analytics/write.ts +240 -17
- package/resources/auditStore.ts +28 -19
- package/resources/blob.ts +53 -53
- package/resources/dataLoader.ts +4 -4
- package/resources/databases.ts +190 -71
- package/resources/graphql.ts +227 -164
- package/resources/indexes/HierarchicalNavigableSmallWorld.ts +294 -65
- package/resources/indexes/vector.ts +17 -0
- package/resources/loadEnv.ts +21 -17
- package/resources/login.ts +5 -3
- package/resources/models/Models.ts +304 -0
- package/resources/models/TestBackend.ts +83 -0
- package/resources/models/agentLoop.ts +895 -0
- package/resources/models/analyticsTable.ts +199 -0
- package/resources/models/backendHelpers.ts +116 -0
- package/resources/models/backendRegistry.ts +66 -0
- package/resources/models/bootstrap.ts +135 -0
- package/resources/models/embedHook.ts +138 -0
- package/resources/models/types.ts +296 -0
- package/resources/replayLogs.ts +15 -7
- package/resources/roles.ts +62 -67
- package/resources/search.ts +355 -135
- package/resources/tracked.ts +8 -8
- package/resources/transaction.ts +8 -8
- package/resources/transactionBroadcast.ts +3 -3
- package/security/auth.ts +35 -26
- package/security/certificateVerification/crlVerification.ts +11 -4
- package/security/{cryptoHash.js → cryptoHash.ts} +3 -8
- package/security/data_objects/{PermissionAttributeResponseObject.js → PermissionAttributeResponseObject.ts} +4 -4
- package/security/data_objects/{PermissionResponseObject.js → PermissionResponseObject.ts} +12 -11
- package/security/data_objects/{PermissionTableResponseObject.js → PermissionTableResponseObject.ts} +6 -4
- package/security/{fastifyAuth.js → fastifyAuth.ts} +93 -20
- package/security/impersonation.ts +3 -3
- package/security/jsLoader.ts +22 -8
- package/security/{keys.js → keys.ts} +113 -121
- package/security/permissionsTranslator.js +2 -2
- package/security/{role.js → role.ts} +26 -33
- package/security/tokenAuthentication.ts +34 -7
- package/security/user.ts +26 -22
- package/server/DESIGN.md +139 -0
- package/server/DurableSubscriptionsSession.ts +67 -50
- package/server/REST.ts +120 -107
- package/server/Server.ts +31 -12
- package/server/fastifyRoutes/helpers/getCORSOptions.js +1 -1
- package/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js +1 -1
- package/server/fastifyRoutes/helpers/getServerOptions.js +1 -1
- package/server/fastifyRoutes.ts +37 -33
- package/server/graphqlQuerying.ts +6 -5
- package/server/http.ts +517 -26
- package/server/itc/serverHandlers.js +75 -14
- package/server/jobs/{JobObject.js → JobObject.ts} +13 -6
- package/server/jobs/{jobProcess.js → jobProcess.ts} +20 -16
- package/server/jobs/{jobRunner.js → jobRunner.ts} +20 -21
- package/server/jobs/{jobs.js → jobs.ts} +41 -44
- package/server/loadRootComponents.js +1 -1
- package/server/middlewareChain.ts +270 -0
- package/server/mqtt.ts +35 -26
- package/server/nodeName.ts +2 -1
- package/server/operationsServer.ts +85 -10
- package/server/serverHelpers/Headers.ts +10 -8
- package/server/serverHelpers/JSONStream.ts +15 -5
- package/server/serverHelpers/Request.ts +370 -13
- package/server/serverHelpers/contentTypes.ts +42 -11
- package/server/serverHelpers/multipartParser.ts +152 -0
- package/server/serverHelpers/progressEmitter.ts +110 -0
- package/server/serverHelpers/serverHandlers.js +43 -7
- package/server/serverHelpers/serverUtilities.ts +40 -30
- package/server/static.ts +9 -6
- package/server/status/index.ts +2 -2
- package/server/storageReclamation.ts +39 -2
- package/server/threads/itc.js +7 -4
- package/server/threads/manageThreads.js +100 -26
- package/server/threads/socketRouter.ts +12 -275
- package/server/threads/threadServer.js +345 -105
- package/server/threads/workerProcessGuard.ts +93 -0
- package/server/throttle.ts +18 -0
- package/sqlTranslator/{SelectValidator.js → SelectValidator.ts} +41 -49
- package/sqlTranslator/{alasqlFunctionImporter.js → alasqlFunctionImporter.ts} +5 -5
- package/sqlTranslator/{deleteTranslator.js → deleteTranslator.ts} +13 -18
- package/sqlTranslator/{index.js → index.ts} +30 -33
- package/sqlTranslator/{sql_statement_bucket.js → sql_statement_bucket.ts} +49 -20
- package/static/README.md +10 -9
- package/studio/web/assets/{index-CmtPP0YO.js → index-COfIkCT-.js} +5 -5
- package/studio/web/assets/index-COfIkCT-.js.map +1 -0
- package/studio/web/assets/{index.lazy-C8jvGtlu.js → index.lazy-CIvl7Fj9.js} +2 -2
- package/studio/web/assets/{index.lazy-C8jvGtlu.js.map → index.lazy-CIvl7Fj9.js.map} +1 -1
- package/studio/web/assets/{profile-O0DYlJUv.js → profile-B2ZVB--r.js} +2 -2
- package/studio/web/assets/{profile-O0DYlJUv.js.map → profile-B2ZVB--r.js.map} +1 -1
- package/studio/web/assets/{status-BIlJkJby.js → status-Db6WBmhf.js} +2 -2
- package/studio/web/assets/{status-BIlJkJby.js.map → status-Db6WBmhf.js.map} +1 -1
- package/studio/web/index.html +1 -1
- package/upgrade/{UpgradeObjects.js → UpgradeObjects.ts} +3 -6
- package/upgrade/directives/5-2-0.ts +49 -0
- package/upgrade/directives/{directivesController.js → directivesController.ts} +16 -16
- package/upgrade/{directivesManager.js → directivesManager.ts} +7 -11
- package/upgrade/{upgradePrompt.js → upgradePrompt.ts} +8 -14
- package/upgrade/{upgradeUtilities.js → upgradeUtilities.ts} +3 -7
- package/utility/{OperationFunctionCaller.js → OperationFunctionCaller.ts} +7 -7
- package/utility/{assignCmdEnvVariables.js → assignCmdEnvVariables.ts} +6 -8
- package/utility/{common_utils.js → common_utils.ts} +113 -139
- package/utility/environment/{environmentManager.js → environmentManager.ts} +34 -33
- package/utility/environment/systemInformation.ts +18 -4
- package/utility/errors/{commonErrors.js → commonErrors.ts} +9 -9
- package/utility/errors/{hdbError.js → hdbError.ts} +39 -45
- package/utility/expandEnvVar.ts +110 -0
- package/utility/functions/geo.js +2 -2
- package/utility/functions/sql/alaSQLExtension.js +1 -1
- package/utility/globalSchema.ts +30 -0
- package/utility/hdbTerms.ts +56 -0
- package/utility/install/checkJWTTokensExist.js +1 -1
- package/utility/install/{installer.js → installer.ts} +38 -39
- package/utility/installation.ts +2 -2
- package/utility/lmdb/{DBIDefinition.js → DBIDefinition.ts} +4 -1
- package/utility/lmdb/{DeleteRecordsResponseObject.js → DeleteRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/{InsertRecordsResponseObject.js → InsertRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/OpenDBIObject.ts +43 -0
- package/utility/lmdb/{OpenEnvironmentObject.js → OpenEnvironmentObject.ts} +19 -6
- package/utility/lmdb/{UpdateRecordsResponseObject.js → UpdateRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/{UpsertRecordsResponseObject.js → UpsertRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/{cleanLMDBMap.js → cleanLMDBMap.ts} +5 -5
- package/utility/lmdb/{commonUtility.js → commonUtility.ts} +13 -21
- package/utility/lmdb/{deleteUtility.js → deleteUtility.ts} +8 -12
- package/utility/lmdb/{environmentUtility.js → environmentUtility.ts} +43 -52
- package/utility/lmdb/{searchCursorFunctions.js → searchCursorFunctions.ts} +12 -26
- package/utility/lmdb/{searchUtility.js → searchUtility.ts} +75 -64
- package/utility/lmdb/{terms.js → terms.ts} +10 -23
- package/utility/lmdb/{writeUtility.js → writeUtility.ts} +37 -22
- package/utility/logging/{harper_logger.js → harper_logger.ts} +136 -89
- package/utility/logging/{logRotator.js → logRotator.ts} +13 -13
- package/utility/logging/logger.ts +1 -1
- package/utility/logging/{readLog.js → readLog.ts} +19 -19
- package/utility/logging/{transactionLog.js → transactionLog.ts} +10 -14
- package/utility/{mount_hdb.js → mount_hdb.ts} +15 -16
- package/utility/{npmUtilities.js → npmUtilities.ts} +14 -17
- package/utility/{operation_authorization.js → operation_authorization.ts} +173 -124
- package/utility/packageUtils.js +7 -16
- package/utility/password.ts +1 -1
- package/utility/processManagement/processManagement.js +2 -2
- package/utility/processManagement/servicesConfig.js +1 -1
- package/utility/{signalling.js → signalling.ts} +6 -11
- package/utility/watcherFallback.ts +74 -0
- package/validation/analyticsValidator.ts +43 -0
- package/validation/{bulkDeleteValidator.js → bulkDeleteValidator.ts} +5 -5
- package/validation/{check_permissions.js → check_permissions.ts} +3 -3
- package/validation/{common_validators.js → common_validators.ts} +12 -24
- package/validation/{configValidator.js → configValidator.ts} +114 -18
- package/validation/{deleteValidator.js → deleteValidator.ts} +5 -5
- package/validation/{fileLoadValidator.js → fileLoadValidator.ts} +12 -19
- package/validation/{insertValidator.js → insertValidator.ts} +5 -5
- package/validation/{installValidator.js → installValidator.ts} +8 -8
- package/validation/{readLogValidator.js → readLogValidator.ts} +10 -10
- package/validation/{role_validation.js → role_validation.ts} +26 -32
- package/validation/{schemaMetadataValidator.js → schemaMetadataValidator.ts} +5 -11
- package/validation/{searchValidator.js → searchValidator.ts} +12 -11
- package/validation/statusValidator.ts +1 -1
- package/validation/{transactionLogValidator.js → transactionLogValidator.ts} +4 -9
- package/validation/{user_validation.js → user_validation.ts} +4 -10
- package/validation/{validationWrapper.js → validationWrapper.ts} +3 -9
- package/bin/cliOperations.js +0 -159
- package/bin/lite.js +0 -5
- package/dataLayer/harperBridge/BridgeMethods.js +0 -85
- package/studio/web/assets/index-CmtPP0YO.js.map +0 -1
- package/utility/globalSchema.js +0 -35
- package/utility/lmdb/OpenDBIObject.js +0 -31
package/resources/Resource.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { User } from '../security/user.ts';
|
|
2
|
-
import type { RecordObject } from './RecordEncoder.
|
|
2
|
+
import type { RecordObject } from './RecordEncoder.ts';
|
|
3
3
|
import {
|
|
4
4
|
ResourceInterface,
|
|
5
5
|
SubscriptionRequest,
|
|
@@ -13,7 +13,7 @@ import { randomUUID } from 'crypto';
|
|
|
13
13
|
import { DatabaseTransaction, type Transaction } from './DatabaseTransaction.ts';
|
|
14
14
|
import { IterableEventQueue } from './IterableEventQueue.ts';
|
|
15
15
|
import { _assignPackageExport } from '../globals.js';
|
|
16
|
-
import { ClientError, AccessViolation } from '../utility/errors/hdbError.
|
|
16
|
+
import { ClientError, AccessViolation } from '../utility/errors/hdbError.ts';
|
|
17
17
|
import { transaction, contextStorage } from './transaction.ts';
|
|
18
18
|
import { parseQuery } from './search.ts';
|
|
19
19
|
import { RequestTarget } from './RequestTarget.ts';
|
|
@@ -51,11 +51,27 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
51
51
|
this.#context = context !== undefined ? context : source || null;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
doesExist(): boolean {
|
|
55
|
+
return true; // Subclasses should override if needed
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
wasLoadedFromSource(): boolean | void {
|
|
59
|
+
// Subclasses should override if needed
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
addTo(_property: keyof Record, _value: Record[keyof Record]): void {
|
|
63
|
+
throw new Error('Not implemented');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
subtractFrom(_property: keyof Record, _value: Record[keyof Record]): void {
|
|
67
|
+
throw new Error('Not implemented');
|
|
68
|
+
}
|
|
69
|
+
|
|
54
70
|
/**
|
|
55
71
|
* The get methods are for directly getting a resource, and called for HTTP GET requests.
|
|
56
72
|
*/
|
|
57
73
|
static get = transactional(
|
|
58
|
-
function (resource:
|
|
74
|
+
function (resource: any, query: RequestTarget, _request: Context, _data: any) {
|
|
59
75
|
const result = resource.get?.(query);
|
|
60
76
|
// for the new API we always apply select in the instance method
|
|
61
77
|
if (!resource.constructor.loadAsInstance) return result;
|
|
@@ -89,7 +105,7 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
89
105
|
* Store the provided record by the provided id. If no id is provided, it is auto-generated.
|
|
90
106
|
*/
|
|
91
107
|
static put = transactional(
|
|
92
|
-
function (resource:
|
|
108
|
+
function (resource: any, query: RequestTarget, request: Context, data: any) {
|
|
93
109
|
if (Array.isArray(data) && resource.#isCollection && resource.constructor.loadAsInstance !== false) {
|
|
94
110
|
const results = [];
|
|
95
111
|
for (const element of data) {
|
|
@@ -115,7 +131,7 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
115
131
|
);
|
|
116
132
|
|
|
117
133
|
static patch = transactional(
|
|
118
|
-
function (resource:
|
|
134
|
+
function (resource: any, query: RequestTarget, _request: Context, data: any) {
|
|
119
135
|
// TODO: Allow array like put?
|
|
120
136
|
return resource.patch
|
|
121
137
|
? resource.constructor.loadAsInstance === false
|
|
@@ -127,7 +143,7 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
127
143
|
);
|
|
128
144
|
|
|
129
145
|
static delete = transactional(
|
|
130
|
-
function (resource:
|
|
146
|
+
function (resource: any, query: RequestTarget, _request: Context, _data: any) {
|
|
131
147
|
return resource.delete ? resource.delete(query) : missingMethod(resource, 'delete');
|
|
132
148
|
},
|
|
133
149
|
{ hasContent: false, type: 'delete', method: 'delete' }
|
|
@@ -150,7 +166,7 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
150
166
|
static create(idPrefix: Id, record: any, context: Context): Promise<Id>;
|
|
151
167
|
static create(record: any, context: Context): Promise<Id>;
|
|
152
168
|
static create(idPrefix: any, record: any, context?: Context): Promise<Id> {
|
|
153
|
-
let id:
|
|
169
|
+
let id: any;
|
|
154
170
|
if (this.loadAsInstance === false) {
|
|
155
171
|
if (typeof idPrefix === 'object' && idPrefix && !context) {
|
|
156
172
|
// two argument form (record, context), shift the arguments
|
|
@@ -160,44 +176,45 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
160
176
|
id.isCollection = true;
|
|
161
177
|
} else id = idPrefix;
|
|
162
178
|
} else {
|
|
163
|
-
|
|
179
|
+
const primaryKey = (this as any).primaryKey;
|
|
180
|
+
if (idPrefix == null) id = record?.[primaryKey] ?? this.getNewId();
|
|
164
181
|
else if (Array.isArray(idPrefix) && typeof idPrefix[0] !== 'object')
|
|
165
|
-
id = record?.[
|
|
166
|
-
else if (typeof idPrefix !== 'object') id = record?.[
|
|
182
|
+
id = record?.[primaryKey] ?? [...idPrefix, this.getNewId()];
|
|
183
|
+
else if (typeof idPrefix !== 'object') id = record?.[primaryKey] ?? [idPrefix, this.getNewId()];
|
|
167
184
|
else {
|
|
168
185
|
// two argument form, shift the arguments
|
|
169
|
-
id = idPrefix?.[
|
|
186
|
+
id = idPrefix?.[primaryKey] ?? this.getNewId();
|
|
170
187
|
context = record || {};
|
|
171
188
|
record = idPrefix;
|
|
172
189
|
}
|
|
173
190
|
}
|
|
174
191
|
if (context) {
|
|
175
|
-
if (context.getContext) context = context.getContext();
|
|
192
|
+
if ((context as any).getContext) context = (context as any).getContext();
|
|
176
193
|
} else {
|
|
177
194
|
// try to get the context from the async context if possible
|
|
178
195
|
context = contextStorage.getStore() ?? {};
|
|
179
196
|
}
|
|
180
197
|
return transaction(context, async () => {
|
|
181
|
-
context.transaction.startedFrom ??= {
|
|
198
|
+
(context as any).transaction.startedFrom ??= {
|
|
182
199
|
resourceName: this.name,
|
|
183
200
|
method: 'create',
|
|
184
201
|
};
|
|
185
|
-
const resource = new this(id, context);
|
|
202
|
+
const resource = new (this as any)(id, context);
|
|
186
203
|
const results = resource.create ? await resource.create(id, record) : missingMethod(resource, 'create');
|
|
187
|
-
context.newLocation = id ?? results?.[this.primaryKey];
|
|
188
|
-
context.createdResource = true;
|
|
204
|
+
(context as any).newLocation = id ?? results?.[(this as any).primaryKey];
|
|
205
|
+
(context as any).createdResource = true;
|
|
189
206
|
return this.loadAsInstance === false ? results : resource;
|
|
190
207
|
});
|
|
191
208
|
}
|
|
192
209
|
static invalidate = transactional(
|
|
193
|
-
function (resource:
|
|
210
|
+
function (resource: any, query: RequestTarget, _request: Context, _data: any) {
|
|
194
211
|
return resource.invalidate ? resource.invalidate(query) : missingMethod(resource, 'invalidate');
|
|
195
212
|
},
|
|
196
213
|
{ hasContent: false, type: 'update', method: 'invalidate' }
|
|
197
214
|
);
|
|
198
215
|
|
|
199
216
|
static post = transactional(
|
|
200
|
-
function (resource:
|
|
217
|
+
function (resource: any, query: RequestTarget, _request: Context, data: any) {
|
|
201
218
|
if (resource.#id != null) resource.update?.(); // save any changes made during post
|
|
202
219
|
return resource.constructor.loadAsInstance === false ? resource.post(query, data) : resource.post(data, query);
|
|
203
220
|
},
|
|
@@ -205,14 +222,14 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
205
222
|
);
|
|
206
223
|
|
|
207
224
|
static update = transactional(
|
|
208
|
-
function (resource:
|
|
225
|
+
function (resource: any, query: RequestTarget, _request: Context, data: any) {
|
|
209
226
|
return resource.update(query, data);
|
|
210
227
|
},
|
|
211
228
|
{ type: 'update', method: 'update' }
|
|
212
229
|
);
|
|
213
230
|
|
|
214
231
|
static connect = transactional(
|
|
215
|
-
function (resource:
|
|
232
|
+
function (resource: any, query: RequestTarget, _request: Context, data: any) {
|
|
216
233
|
return resource.connect
|
|
217
234
|
? resource.constructor.loadAsInstance === false
|
|
218
235
|
? resource.connect(query, data)
|
|
@@ -223,14 +240,14 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
223
240
|
);
|
|
224
241
|
|
|
225
242
|
static subscribe = transactional(
|
|
226
|
-
function (resource:
|
|
243
|
+
function (resource: any, query: RequestTarget, _request: Context, _data: any) {
|
|
227
244
|
return resource.subscribe ? resource.subscribe(query) : missingMethod(resource, 'subscribe');
|
|
228
245
|
},
|
|
229
246
|
{ type: 'read', method: 'subscribe', syncAllowed: true }
|
|
230
247
|
);
|
|
231
248
|
|
|
232
249
|
static publish = transactional(
|
|
233
|
-
function (resource:
|
|
250
|
+
function (resource: any, query: RequestTarget, _request: Context, data: any) {
|
|
234
251
|
if (resource.#id != null) resource.update?.(); // save any changes made during publish
|
|
235
252
|
return resource.publish
|
|
236
253
|
? resource.constructor.loadAsInstance === false
|
|
@@ -242,9 +259,9 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
242
259
|
);
|
|
243
260
|
|
|
244
261
|
static search = transactional(
|
|
245
|
-
function (resource:
|
|
262
|
+
function (resource: any, query: Query, request: Context) {
|
|
246
263
|
const result = resource.search ? resource.search(query) : missingMethod(resource, 'search');
|
|
247
|
-
const select = request.select;
|
|
264
|
+
const select = (request as any).select;
|
|
248
265
|
if (select && request.hasOwnProperty('select') && result != null && !result.selectApplied) {
|
|
249
266
|
const transform = transformForSelect(select, resource.constructor);
|
|
250
267
|
return result.map(transform);
|
|
@@ -255,7 +272,7 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
255
272
|
);
|
|
256
273
|
|
|
257
274
|
static query = transactional(
|
|
258
|
-
function (resource:
|
|
275
|
+
function (resource: any, query: RequestTarget, _request: Context, data: any) {
|
|
259
276
|
return resource.search
|
|
260
277
|
? resource.constructor.loadAsInstance === false
|
|
261
278
|
? resource.search(query, data)
|
|
@@ -266,7 +283,7 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
266
283
|
);
|
|
267
284
|
|
|
268
285
|
static copy = transactional(
|
|
269
|
-
function (resource:
|
|
286
|
+
function (resource: any, query: RequestTarget, _request: Context, data: any) {
|
|
270
287
|
return resource.copy
|
|
271
288
|
? resource.constructor.loadAsInstance === false
|
|
272
289
|
? resource.copy(query, data)
|
|
@@ -277,7 +294,7 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
277
294
|
);
|
|
278
295
|
|
|
279
296
|
static move = transactional(
|
|
280
|
-
function (resource:
|
|
297
|
+
function (resource: any, query: RequestTarget, _request: Context, data: any) {
|
|
281
298
|
return resource.move
|
|
282
299
|
? resource.constructor.loadAsInstance === false
|
|
283
300
|
? resource.move(query, data)
|
|
@@ -291,14 +308,14 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
291
308
|
target: RequestTargetOrId,
|
|
292
309
|
newRecord: Partial<Record & RecordObject>
|
|
293
310
|
): Promise<Record & Partial<RecordObject>> {
|
|
294
|
-
if (this.constructor.loadAsInstance === false) {
|
|
295
|
-
if (target.isCollection && this.create) {
|
|
296
|
-
newRecord = await this.create(target, newRecord);
|
|
297
|
-
return newRecord?.[this.constructor.primaryKey];
|
|
311
|
+
if ((this.constructor as any).loadAsInstance === false) {
|
|
312
|
+
if ((target as any).isCollection && this.create) {
|
|
313
|
+
newRecord = (await this.create(target as any, newRecord)) as any;
|
|
314
|
+
return newRecord?.[(this.constructor as any).primaryKey as keyof typeof newRecord] as any;
|
|
298
315
|
}
|
|
299
316
|
} else {
|
|
300
317
|
if (this.#isCollection) {
|
|
301
|
-
const resource = await this.constructor.create(this.#id, target, this.#context);
|
|
318
|
+
const resource = await (this.constructor as any).create(this.#id, target, this.#context);
|
|
302
319
|
return resource.#id;
|
|
303
320
|
}
|
|
304
321
|
}
|
|
@@ -327,7 +344,7 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
327
344
|
// handle path.json, path.cbor, etc. for requesting a specific content type using just the URL
|
|
328
345
|
context.requestedContentType = requestedContentType;
|
|
329
346
|
path = path.slice(0, dotIndex); // remove the property from the path
|
|
330
|
-
} else if (this.attributes?.find((attribute) => attribute.name === property)) {
|
|
347
|
+
} else if ((this as any).attributes?.find((attribute) => attribute.name === property)) {
|
|
331
348
|
// handle path.attribute for requesting a specific attribute using just the URL
|
|
332
349
|
path = path.slice(0, dotIndex); // remove the property from the path
|
|
333
350
|
if (query) query.property = property;
|
|
@@ -355,13 +372,13 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
355
372
|
): Resource | Promise<Resource> {
|
|
356
373
|
let resource;
|
|
357
374
|
const id = target.id;
|
|
358
|
-
let context = request.getContext?.();
|
|
375
|
+
let context = (request as any).getContext?.();
|
|
359
376
|
let isCollection;
|
|
360
|
-
if (typeof request.isCollection === 'boolean' && request.hasOwnProperty('isCollection'))
|
|
361
|
-
isCollection = request.isCollection;
|
|
377
|
+
if (typeof (request as any).isCollection === 'boolean' && request.hasOwnProperty('isCollection'))
|
|
378
|
+
isCollection = (request as any).isCollection;
|
|
362
379
|
else isCollection = options?.isCollection;
|
|
363
380
|
// if it is a collection and we have a collection class defined, use it
|
|
364
|
-
const constructor = (isCollection && this.Collection) || this;
|
|
381
|
+
const constructor = (isCollection && (this as any).Collection) || this;
|
|
365
382
|
if (!context) context = context === undefined ? request : {};
|
|
366
383
|
resource = new constructor(id, context); // outside of a transaction, just create an instance
|
|
367
384
|
if (isCollection) resource.#isCollection = true;
|
|
@@ -374,16 +391,19 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
374
391
|
* but implementors can call send with
|
|
375
392
|
*/
|
|
376
393
|
// eslint-disable-next-line no-unused-vars
|
|
377
|
-
subscribe(request: SubscriptionRequest): AsyncIterable<Record> {
|
|
394
|
+
subscribe(request: SubscriptionRequest): AsyncIterable<Record> | Promise<AsyncIterable<Record>> {
|
|
378
395
|
return new IterableEventQueue();
|
|
379
396
|
}
|
|
380
397
|
|
|
381
|
-
connect(
|
|
398
|
+
connect(
|
|
399
|
+
target: RequestTarget,
|
|
400
|
+
incomingMessages: IterableEventQueue<Record>
|
|
401
|
+
): AsyncIterable<Record> | Promise<AsyncIterable<Record>> {
|
|
382
402
|
// convert subscription to an (async) iterator
|
|
383
|
-
const query = this.constructor.loadAsInstance === false ? target : incomingMessages;
|
|
384
|
-
if (query?.subscribe !== false) {
|
|
403
|
+
const query = (this.constructor as any).loadAsInstance === false ? target : incomingMessages;
|
|
404
|
+
if ((query as any)?.subscribe !== false) {
|
|
385
405
|
// subscribing is the default action, but can be turned off
|
|
386
|
-
return this.subscribe?.(query);
|
|
406
|
+
return this.subscribe?.(query as any) as any;
|
|
387
407
|
}
|
|
388
408
|
return new IterableEventQueue();
|
|
389
409
|
}
|
|
@@ -439,9 +459,9 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
439
459
|
search?(target: RequestTargetOrId): AsyncIterable<Record & Partial<RecordObject>>;
|
|
440
460
|
|
|
441
461
|
create?(
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
): Promise<Record & Partial<RecordObject>>;
|
|
462
|
+
target: RequestTargetOrId,
|
|
463
|
+
newRecord: Partial<Record & RecordObject>
|
|
464
|
+
): void | (Record & Partial<RecordObject>) | Promise<Record & Partial<RecordObject>>;
|
|
445
465
|
put?(
|
|
446
466
|
record: Record & RecordObject,
|
|
447
467
|
target: RequestTargetOrId
|
|
@@ -452,7 +472,9 @@ export class Resource<Record extends object = any> implements ResourceInterface<
|
|
|
452
472
|
): void | (Record & Partial<RecordObject>) | Promise<void | (Record & Partial<RecordObject>)>;
|
|
453
473
|
|
|
454
474
|
delete?(target: RequestTargetOrId): boolean | Promise<boolean>;
|
|
455
|
-
invalidate
|
|
475
|
+
invalidate(_target: RequestTargetOrId): void | Promise<void> {
|
|
476
|
+
missingMethod(this, 'invalidate');
|
|
477
|
+
}
|
|
456
478
|
|
|
457
479
|
publish?(target: RequestTargetOrId, record: Record, options?: any): void;
|
|
458
480
|
}
|
|
@@ -473,12 +495,15 @@ export function snakeCase(camelCase: string) {
|
|
|
473
495
|
* @returns
|
|
474
496
|
*/
|
|
475
497
|
function transactional(
|
|
476
|
-
action: (resource:
|
|
498
|
+
action: (resource: any, query: RequestTarget, context: Context, data: any) => any,
|
|
477
499
|
options: {
|
|
478
|
-
hasContent
|
|
500
|
+
hasContent?: boolean;
|
|
479
501
|
type: 'read' | 'update' | 'create' | 'delete';
|
|
480
502
|
async?: boolean;
|
|
481
503
|
ensureLoaded?: boolean;
|
|
504
|
+
letItLinger?: boolean;
|
|
505
|
+
method?: string;
|
|
506
|
+
syncAllowed?: boolean;
|
|
482
507
|
}
|
|
483
508
|
) {
|
|
484
509
|
applyContext.reliesOnPrototype = true;
|
|
@@ -493,7 +518,7 @@ function transactional(
|
|
|
493
518
|
if (context) {
|
|
494
519
|
// if there are three arguments, it is id, data, context
|
|
495
520
|
data = dataOrContext;
|
|
496
|
-
context = context.getContext?.() || context;
|
|
521
|
+
context = (context as any).getContext?.() || context;
|
|
497
522
|
} else if (dataOrContext) {
|
|
498
523
|
// two arguments, more possibilities:
|
|
499
524
|
if (
|
|
@@ -504,7 +529,11 @@ function transactional(
|
|
|
504
529
|
// (data, context) form
|
|
505
530
|
data = idOrQuery;
|
|
506
531
|
id = data[this.primaryKey] ?? null;
|
|
507
|
-
context = dataOrContext.getContext?.() || dataOrContext;
|
|
532
|
+
context = (dataOrContext as any).getContext?.() || dataOrContext;
|
|
533
|
+
if (context instanceof DatabaseTransaction) context = { transaction: context };
|
|
534
|
+
} else if (dataOrContext instanceof DatabaseTransaction) {
|
|
535
|
+
// (id, txn) form
|
|
536
|
+
context = { transaction: dataOrContext };
|
|
508
537
|
} else if (dataOrContext?.transaction instanceof DatabaseTransaction) {
|
|
509
538
|
// (id, context) form
|
|
510
539
|
context = dataOrContext;
|
|
@@ -517,6 +546,10 @@ function transactional(
|
|
|
517
546
|
data = idOrQuery;
|
|
518
547
|
idOrQuery = undefined;
|
|
519
548
|
id = data.getId?.() ?? data[this.primaryKey];
|
|
549
|
+
} else if (idOrQuery != null && typeof idOrQuery !== 'object') {
|
|
550
|
+
// single argument form, just id
|
|
551
|
+
id = idOrQuery;
|
|
552
|
+
data = undefined;
|
|
520
553
|
} else {
|
|
521
554
|
throw new ClientError(`Invalid argument for data, must be an object, but got ${idOrQuery}`);
|
|
522
555
|
}
|
|
@@ -527,13 +560,13 @@ function transactional(
|
|
|
527
560
|
if (context) {
|
|
528
561
|
// (id, data, context), this a method that doesn't normally have a body/data, but with the three arguments, we have explicit data
|
|
529
562
|
data = dataOrContext;
|
|
530
|
-
context = context.getContext?.() || context;
|
|
563
|
+
context = (context as any).getContext?.() || context;
|
|
531
564
|
} else if (hasContent === false) {
|
|
532
565
|
// (id, context), preferred form used for methods that are explicitly without a body
|
|
533
|
-
context = dataOrContext.getContext?.() || dataOrContext;
|
|
566
|
+
context = (dataOrContext as any).getContext?.() || dataOrContext;
|
|
534
567
|
} else if (dataOrContext.transaction || dataOrContext.getContext) {
|
|
535
568
|
// or if it looks like a context
|
|
536
|
-
context = dataOrContext.getContext?.() || dataOrContext;
|
|
569
|
+
context = (dataOrContext as any).getContext?.() || dataOrContext;
|
|
537
570
|
} else {
|
|
538
571
|
data = dataOrContext;
|
|
539
572
|
}
|
|
@@ -582,7 +615,7 @@ function transactional(
|
|
|
582
615
|
}
|
|
583
616
|
}
|
|
584
617
|
} else if (id === undefined) {
|
|
585
|
-
id = idOrQuery.id ?? null;
|
|
618
|
+
id = (idOrQuery as any).id ?? null;
|
|
586
619
|
if (id == null) query.isCollection = true;
|
|
587
620
|
}
|
|
588
621
|
} else {
|
|
@@ -660,8 +693,8 @@ function transactional(
|
|
|
660
693
|
: options.type === 'create'
|
|
661
694
|
? resource.allowCreate(context.user, data, context)
|
|
662
695
|
: resource.allowDelete(context.user, query, context);
|
|
663
|
-
if (allowed?.then) {
|
|
664
|
-
return allowed.then((allowed) => {
|
|
696
|
+
if ((allowed as any)?.then) {
|
|
697
|
+
return (allowed as any).then((allowed) => {
|
|
665
698
|
query.checkPermission = false;
|
|
666
699
|
if (!allowed) {
|
|
667
700
|
throw new AccessViolation(context.user);
|
|
@@ -19,8 +19,8 @@ export interface ResourceInterface<Record extends object = any>
|
|
|
19
19
|
|
|
20
20
|
allowCreate(user: User, record: Promise<Record & RecordObject>, context: Context): boolean | Promise<boolean>;
|
|
21
21
|
create?(
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
target: RequestTargetOrId,
|
|
23
|
+
newRecord: Partial<Record & RecordObject>
|
|
24
24
|
): void | (Record & Partial<RecordObject>) | Promise<Record & Partial<RecordObject>>;
|
|
25
25
|
post?(
|
|
26
26
|
target: RequestTargetOrId,
|
|
@@ -32,10 +32,6 @@ export interface ResourceInterface<Record extends object = any>
|
|
|
32
32
|
record: Record & RecordObject,
|
|
33
33
|
target?: RequestTargetOrId
|
|
34
34
|
): void | (Record & Partial<RecordObject>) | Promise<void | (Record & Partial<RecordObject>)>;
|
|
35
|
-
patch?(
|
|
36
|
-
record: Partial<Record & RecordObject>,
|
|
37
|
-
target: RequestTargetOrId
|
|
38
|
-
): void | (Record & Partial<RecordObject>) | Promise<void | (Record & Partial<RecordObject>)>;
|
|
39
35
|
update?(updates: Record & RecordObject, fullUpdate: true): ResourceInterface<Record & Partial<RecordObject>>;
|
|
40
36
|
update?(
|
|
41
37
|
updates: Partial<Record & RecordObject>,
|
|
@@ -101,6 +97,20 @@ export interface Context {
|
|
|
101
97
|
resourceCache?: Map<Id, any>;
|
|
102
98
|
_freezeRecords?: boolean; // until v5, we conditionally freeze records for back-compat
|
|
103
99
|
timestamp?: number;
|
|
100
|
+
includeExpensiveRecordCountEstimates?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Matched route path of the calling Resource, populated by the HTTP/WS entry points
|
|
103
|
+
* before they hand the request into `transaction()`. Populated on the Request that
|
|
104
|
+
* becomes the ALS-bound Context for that path; absent for ops-API, internal jobs,
|
|
105
|
+
* and replication-driven contexts.
|
|
106
|
+
*/
|
|
107
|
+
handlerPath?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Abort signal carried through ALS so generator bodies can forward cancellation to
|
|
110
|
+
* external work (e.g. `scope.models.generateStream({ signal })`). Populated on the
|
|
111
|
+
* Request that becomes the ALS-bound Context for HTTP/WS paths via #513.
|
|
112
|
+
*/
|
|
113
|
+
signal?: AbortSignal;
|
|
104
114
|
}
|
|
105
115
|
|
|
106
116
|
export interface SourceContext<TRequestContext = Context, Record extends object = any> {
|
|
@@ -128,19 +138,27 @@ export interface SourceContext<TRequestContext = Context, Record extends object
|
|
|
128
138
|
|
|
129
139
|
export type Operator = 'and' | 'or';
|
|
130
140
|
|
|
131
|
-
export
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
export const COMPARATORS = [
|
|
142
|
+
'between',
|
|
143
|
+
'contains',
|
|
144
|
+
'ends_with',
|
|
145
|
+
'eq',
|
|
146
|
+
'equals',
|
|
147
|
+
'gt',
|
|
148
|
+
'ge',
|
|
149
|
+
'lt',
|
|
150
|
+
'le',
|
|
151
|
+
'greater_than',
|
|
152
|
+
'greater_than_equal',
|
|
153
|
+
'in',
|
|
154
|
+
'less_than',
|
|
155
|
+
'less_than_equal',
|
|
156
|
+
'ne',
|
|
157
|
+
'not_equal',
|
|
158
|
+
'starts_with',
|
|
159
|
+
] as const;
|
|
160
|
+
|
|
161
|
+
export type Comparator = (typeof COMPARATORS)[number];
|
|
144
162
|
|
|
145
163
|
export type DirectCondition<Record extends object = any> = TypedDirectCondition<Record, keyof Record>;
|
|
146
164
|
|
|
@@ -149,8 +167,13 @@ interface TypedDirectCondition<Record extends object, Property extends keyof Rec
|
|
|
149
167
|
search_attribute?: keyof Record | Array<keyof Record> | string | string[];
|
|
150
168
|
comparator?: Comparator;
|
|
151
169
|
search_type?: Comparator;
|
|
152
|
-
value?: Record[Property];
|
|
153
|
-
search_value?: Record[Property];
|
|
170
|
+
value?: Record[Property] | Record[Property][];
|
|
171
|
+
search_value?: Record[Property] | Record[Property][];
|
|
172
|
+
/**
|
|
173
|
+
* If true, the condition is negated. Phase 1: filter-only — forces a
|
|
174
|
+
* full scan unless paired with another indexed condition.
|
|
175
|
+
*/
|
|
176
|
+
negated?: boolean;
|
|
154
177
|
}
|
|
155
178
|
|
|
156
179
|
interface ConditionGroup<Record extends object = any> {
|
package/resources/Resources.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { Resource } from './Resource.ts';
|
|
2
1
|
import { transaction } from './transaction.ts';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { ServerError } from '../utility/errors/hdbError.js';
|
|
2
|
+
import logger from '../utility/logging/harper_logger.ts';
|
|
3
|
+
import { ServerError } from '../utility/errors/hdbError.ts';
|
|
6
4
|
import { server } from '../server/Server.ts';
|
|
7
5
|
|
|
8
6
|
interface ResourceEntry {
|
|
9
|
-
Resource:
|
|
7
|
+
Resource: any;
|
|
10
8
|
path: string;
|
|
11
9
|
exportTypes: any;
|
|
12
10
|
hasSubPaths: boolean;
|
|
@@ -18,11 +16,12 @@ interface ResourceEntry {
|
|
|
18
16
|
*/
|
|
19
17
|
export class Resources extends Map<string, ResourceEntry> {
|
|
20
18
|
isWorker = true;
|
|
21
|
-
loginPath?: (request) => string;
|
|
19
|
+
loginPath?: (request: any) => string;
|
|
22
20
|
|
|
23
21
|
allTypes: Map<any, any> = new Map();
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
// @ts-expect-error override with different signature
|
|
24
|
+
set(path: string, resource: any, exportTypes?: { [key: string]: boolean }, force?: boolean): void {
|
|
26
25
|
if (!resource) throw new Error('Must provide a resource');
|
|
27
26
|
if (path.startsWith('/')) path = path.replace(/^\/+/, '');
|
|
28
27
|
const entry = {
|
|
@@ -45,6 +44,7 @@ export class Resources extends Map<string, ResourceEntry> {
|
|
|
45
44
|
// don't provide anything more descriptive.
|
|
46
45
|
const error = new ServerError(`Conflicting paths for ${path}`);
|
|
47
46
|
logger.error(error);
|
|
47
|
+
const { ErrorResource } = require('./ErrorResource');
|
|
48
48
|
entry.Resource = new ErrorResource(error);
|
|
49
49
|
}
|
|
50
50
|
super.set(path, entry);
|
|
@@ -131,7 +131,7 @@ export class Resources extends Map<string, ResourceEntry> {
|
|
|
131
131
|
const entry = this.getMatch(path);
|
|
132
132
|
if (entry) {
|
|
133
133
|
path = entry.relativeURL;
|
|
134
|
-
return entry.Resource.getResource(this.pathToId(path, entry.Resource), resourceInfo);
|
|
134
|
+
return entry.Resource.getResource((this as any).pathToId(path, entry.Resource), resourceInfo);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
call(path: string, request, callback: Function) {
|
|
@@ -46,6 +46,7 @@ export class RocksIndexStore extends RocksDatabase {
|
|
|
46
46
|
* @param primaryKey
|
|
47
47
|
* @param txnId
|
|
48
48
|
*/
|
|
49
|
+
// @ts-ignore
|
|
49
50
|
put(indexedValue: any, primaryKey: Id, options: StorePutOptions) {
|
|
50
51
|
return super.putSync([indexedValue, primaryKey], null, options);
|
|
51
52
|
}
|
|
@@ -54,10 +55,12 @@ export class RocksIndexStore extends RocksDatabase {
|
|
|
54
55
|
return super.putSync([indexedValue, primaryKey], null, options);
|
|
55
56
|
}
|
|
56
57
|
|
|
58
|
+
// @ts-ignore
|
|
57
59
|
remove(indexedValue: any, primaryKey: Id, options?: StoreRemoveOptions) {
|
|
58
60
|
return super.removeSync([indexedValue, primaryKey], options);
|
|
59
61
|
}
|
|
60
62
|
|
|
63
|
+
// @ts-ignore
|
|
61
64
|
removeSync(indexedValue: any, primaryKey: Id, options?: StoreRemoveOptions) {
|
|
62
65
|
super.removeSync([indexedValue, primaryKey], options);
|
|
63
66
|
}
|
|
@@ -125,7 +125,8 @@ export class RocksTransactionLogStore extends EventEmitter {
|
|
|
125
125
|
throw new Error('Not implemented');
|
|
126
126
|
}
|
|
127
127
|
addLogToMaps(logName: string, log: TransactionLog) {
|
|
128
|
-
|
|
128
|
+
// 'local' is always the local node's log, which maps to nodeId 0
|
|
129
|
+
const nodeId = (logName === 'local' ? 0 : getIdOfRemoteNode(logName, this)) as number;
|
|
129
130
|
if (this.nodeLogs) {
|
|
130
131
|
this.nodeLogs![nodeId] ??= log;
|
|
131
132
|
}
|
|
@@ -236,35 +237,53 @@ export class RocksTransactionLogStore extends EventEmitter {
|
|
|
236
237
|
|
|
237
238
|
aggregateIterator = {
|
|
238
239
|
next() {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
240
|
+
// We get up to two passes: the normal find-earliest pass, plus one retry that
|
|
241
|
+
// forces nextEntries.length = 0 to re-poll every per-log iterator (each picks
|
|
242
|
+
// up new entries when its log file has grown since the last `.next()` returned
|
|
243
|
+
// done) and to let updateIterators pick up any new logs added since the last
|
|
244
|
+
// call (e.g. a peer's log created by replication). Without the retry, a
|
|
245
|
+
// `{ done: true }` slot in nextEntries carried over from a previous call
|
|
246
|
+
// persists across a burst of commits that all coalesce into a single
|
|
247
|
+
// notifyFromTransactionData wake-up — the find-earliest loop keeps skipping
|
|
248
|
+
// the stale done slot, never re-polls the underlying iterator, and the entire
|
|
249
|
+
// burst is silently dropped (no further 'committed' arrives to unstick us).
|
|
250
|
+
// This was the fingerprint of the cloneNode topology bug where peer rows
|
|
251
|
+
// landed in hdb_nodes via system-DB replication but subscribeToNodeUpdates
|
|
252
|
+
// never received the events, so onNodeUpdate never opened replication
|
|
253
|
+
// connections to those peers.
|
|
254
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
255
|
+
if (nextEntries.length === 0) {
|
|
256
|
+
// on the first iteration and any time we finished all the iterators,
|
|
257
|
+
// we re-retrieve all the next entries (in case we are resuming after
|
|
258
|
+
// being done)
|
|
259
|
+
updateIterators();
|
|
260
|
+
}
|
|
261
|
+
let earliest: TransactionEntry;
|
|
262
|
+
let earliestIndex = -1;
|
|
263
|
+
for (let i = 0; i < nextEntries.length; i++) {
|
|
264
|
+
const result = nextEntries[i];
|
|
265
|
+
// skip any that are done
|
|
266
|
+
if (result.done) {
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
// find the earliest one that is not done
|
|
270
|
+
const next = result.value;
|
|
271
|
+
if (!earliest || earliest.timestamp > next.timestamp) {
|
|
272
|
+
earliest = next;
|
|
273
|
+
earliestIndex = i;
|
|
274
|
+
}
|
|
251
275
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
276
|
+
if (earliestIndex >= 0) {
|
|
277
|
+
// replace the entry with the next one from the iterator we pulled from
|
|
278
|
+
nextEntries[earliestIndex] = iterators[earliestIndex].next();
|
|
279
|
+
return {
|
|
280
|
+
value: onlyKeys ? earliest.timestamp : earliest,
|
|
281
|
+
done: false,
|
|
282
|
+
};
|
|
257
283
|
}
|
|
284
|
+
// All current entries are done; force the retry pass to re-poll
|
|
285
|
+
nextEntries.length = 0;
|
|
258
286
|
}
|
|
259
|
-
if (earliestIndex >= 0) {
|
|
260
|
-
// replace the entry with the next one from the iterator we pulled from
|
|
261
|
-
nextEntries[earliestIndex] = iterators[earliestIndex].next();
|
|
262
|
-
return {
|
|
263
|
-
value: onlyKeys ? earliest.timestamp : earliest,
|
|
264
|
-
done: false,
|
|
265
|
-
};
|
|
266
|
-
} // else we are done
|
|
267
|
-
nextEntries.length = 0; // reset so if this iterator is restarted, we can re-query
|
|
268
287
|
return { value: undefined, done: true };
|
|
269
288
|
},
|
|
270
289
|
addLog(logName: string) {
|
|
@@ -367,7 +386,7 @@ export class RocksTransactionLogStore extends EventEmitter {
|
|
|
367
386
|
getUserSharedBuffer(key: string | symbol, defaultBuffer: ArrayBuffer, options?: { callback?: () => void }) {
|
|
368
387
|
return this.rootStore.getUserSharedBuffer(key, defaultBuffer, options);
|
|
369
388
|
}
|
|
370
|
-
on(eventName: string, listener: any) {
|
|
389
|
+
on(eventName: string, listener: any): any {
|
|
371
390
|
if (eventName === 'aftercommit') {
|
|
372
391
|
return super.on('aftercommit', listener);
|
|
373
392
|
} else {
|