@harperfast/harper 5.0.30 → 5.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -10
- package/agent/agent.ts +203 -0
- package/agent/loop.ts +205 -0
- package/agent/operations.ts +148 -0
- package/agent/session.ts +187 -0
- package/agent/tools/fsTools.ts +276 -0
- package/agent/tools/httpFetchTool.ts +112 -0
- package/agent/tools/scheduleTool.ts +68 -0
- package/agent/toolset.ts +43 -0
- package/agent/types.ts +85 -0
- package/bin/{BinObjects.js → BinObjects.ts} +4 -5
- package/bin/cliCredentials.ts +133 -0
- package/bin/cliOperations.ts +339 -0
- package/bin/copyDb.ts +10 -10
- package/bin/deployRenderer.ts +196 -0
- package/bin/{harper.js → harper.ts} +43 -19
- package/bin/{install.js → install.ts} +3 -3
- package/bin/lite.ts +2 -0
- package/bin/login.ts +134 -0
- package/bin/logout.ts +11 -0
- package/bin/mcp/client.ts +407 -0
- package/bin/mcp/doctor.ts +189 -0
- package/bin/mcp/index.ts +80 -0
- package/bin/mcp/options.ts +122 -0
- package/bin/mcp/printConfig.ts +89 -0
- package/bin/multipartBuilder.ts +74 -0
- package/bin/{restart.js → restart.ts} +27 -28
- package/bin/{run.js → run.ts} +41 -30
- package/bin/sseConsumer.ts +126 -0
- package/bin/{status.js → status.ts} +10 -10
- package/bin/{stop.js → stop.ts} +5 -5
- package/bin/upgrade.js +17 -24
- package/components/Application.ts +144 -18
- package/components/ApplicationScope.ts +2 -2
- package/components/ComponentV1.ts +2 -2
- package/components/EntryHandler.ts +159 -9
- package/components/OptionsWatcher.ts +75 -11
- package/components/Scope.ts +132 -18
- package/components/anthropic/index.ts +547 -0
- package/components/bedrock/index.ts +823 -0
- package/components/componentLoader.ts +64 -32
- package/components/deployLifecycle.ts +161 -0
- package/components/deploymentOperations.ts +173 -0
- package/components/deploymentRecorder.ts +427 -0
- package/components/deriveURLPath.ts +4 -4
- package/components/mcp/adapters/fastify.ts +87 -0
- package/components/mcp/adapters/harperHttp.ts +103 -0
- package/components/mcp/audit.ts +75 -0
- package/components/mcp/index.ts +134 -0
- package/components/mcp/jsonrpc.ts +134 -0
- package/components/mcp/lifecycle.ts +105 -0
- package/components/mcp/listChanged.ts +270 -0
- package/components/mcp/rateLimit.ts +217 -0
- package/components/mcp/resources.ts +607 -0
- package/components/mcp/session.ts +151 -0
- package/components/mcp/sessionRegistry.ts +140 -0
- package/components/mcp/toolRegistry.ts +294 -0
- package/components/mcp/tools/application.ts +761 -0
- package/components/mcp/tools/operations.ts +311 -0
- package/components/mcp/tools/schemas/derive.ts +356 -0
- package/components/mcp/tools/schemas/operationDescriptions.ts +241 -0
- package/components/mcp/tools/schemas/operations.ts +301 -0
- package/components/mcp/transport.ts +517 -0
- package/components/ollama/index.ts +316 -0
- package/components/openai/index.ts +563 -0
- package/components/operations.js +217 -60
- package/components/operationsValidation.js +12 -4
- package/components/packageComponent.ts +97 -29
- package/components/requestRestart.ts +17 -2
- package/components/status/crossThread.ts +14 -5
- package/components/status/errors.ts +1 -1
- package/config/RootConfigWatcher.ts +56 -2
- package/config/configUtils.js +29 -8
- package/config/harperConfigEnvVars.ts +1 -1
- package/config-root.schema.json +78 -4
- package/dataLayer/{CreateAttributeObject.js → CreateAttributeObject.ts} +4 -3
- package/dataLayer/{CreateTableObject.js → CreateTableObject.ts} +2 -1
- package/dataLayer/{DataLayerObjects.js → DataLayerObjects.ts} +17 -9
- package/dataLayer/{DeleteBeforeObject.js → DeleteBeforeObject.ts} +2 -1
- package/dataLayer/{DeleteObject.js → DeleteObject.ts} +3 -2
- package/dataLayer/{DropAttributeObject.js → DropAttributeObject.ts} +2 -1
- package/dataLayer/{GetBackupObject.js → GetBackupObject.ts} +3 -2
- package/dataLayer/{InsertObject.js → InsertObject.ts} +3 -2
- package/dataLayer/{ReadAuditLogObject.js → ReadAuditLogObject.ts} +3 -2
- package/dataLayer/{SQLSearch.js → SQLSearch.ts} +97 -43
- package/dataLayer/{SearchByConditionsObject.js → SearchByConditionsObject.ts} +5 -6
- package/dataLayer/{SearchByHashObject.js → SearchByHashObject.ts} +2 -1
- package/dataLayer/{SearchObject.js → SearchObject.ts} +2 -1
- package/dataLayer/{SqlSearchObject.js → SqlSearchObject.ts} +2 -1
- package/dataLayer/{UpdateObject.js → UpdateObject.ts} +3 -2
- package/dataLayer/{UpsertObject.js → UpsertObject.ts} +3 -2
- package/dataLayer/{bulkLoad.js → bulkLoad.ts} +40 -49
- package/dataLayer/{delete.js → delete.ts} +21 -26
- package/dataLayer/{export.js → export.ts} +22 -26
- package/dataLayer/{getBackup.js → getBackup.ts} +7 -9
- package/dataLayer/harperBridge/BridgeMethods.ts +102 -0
- package/dataLayer/harperBridge/ResourceBridge.ts +27 -26
- package/dataLayer/harperBridge/TableSizeObject.ts +1 -0
- package/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js +4 -4
- package/dataLayer/harperBridge/{harperBridge.js → harperBridge.ts} +3 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js +8 -6
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js +4 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js +6 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js +5 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js +4 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js +6 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js +5 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js +5 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js +3 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js +3 -2
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js +5 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js +10 -8
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js +4 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js +3 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js +6 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js +2 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js +3 -2
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +2 -2
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js +5 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js +6 -3
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.ts +1 -1
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js +4 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js +5 -5
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js +4 -4
- package/dataLayer/{hdbInfoController.js → hdbInfoController.ts} +20 -26
- package/dataLayer/{insert.js → insert.ts} +24 -24
- package/dataLayer/{readAuditLog.js → readAuditLog.ts} +8 -10
- package/dataLayer/{schema.js → schema.ts} +32 -44
- package/dataLayer/{schemaDescribe.js → schemaDescribe.ts} +23 -26
- package/dataLayer/{search.js → search.ts} +9 -15
- package/dataLayer/{transaction.js → transaction.ts} +2 -5
- package/dataLayer/{update.js → update.ts} +19 -22
- package/dist/agent/agent.d.ts +35 -0
- package/dist/agent/agent.js +175 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/loop.d.ts +34 -0
- package/dist/agent/loop.js +176 -0
- package/dist/agent/loop.js.map +1 -0
- package/dist/agent/operations.d.ts +17 -0
- package/dist/agent/operations.js +137 -0
- package/dist/agent/operations.js.map +1 -0
- package/dist/agent/session.d.ts +36 -0
- package/dist/agent/session.js +182 -0
- package/dist/agent/session.js.map +1 -0
- package/dist/agent/tools/fsTools.d.ts +19 -0
- package/dist/agent/tools/fsTools.js +286 -0
- package/dist/agent/tools/fsTools.js.map +1 -0
- package/dist/agent/tools/httpFetchTool.d.ts +9 -0
- package/dist/agent/tools/httpFetchTool.js +116 -0
- package/dist/agent/tools/httpFetchTool.js.map +1 -0
- package/dist/agent/tools/scheduleTool.d.ts +22 -0
- package/dist/agent/tools/scheduleTool.js +54 -0
- package/dist/agent/tools/scheduleTool.js.map +1 -0
- package/dist/agent/toolset.d.ts +24 -0
- package/dist/agent/toolset.js +33 -0
- package/dist/agent/toolset.js.map +1 -0
- package/dist/agent/types.d.ts +75 -0
- package/dist/agent/types.js +10 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/bin/BinObjects.d.ts +2 -2
- package/dist/bin/BinObjects.js +6 -3
- package/dist/bin/BinObjects.js.map +1 -1
- package/dist/bin/cliCredentials.d.ts +27 -0
- package/dist/bin/cliCredentials.js +130 -0
- package/dist/bin/cliCredentials.js.map +1 -0
- package/dist/bin/cliOperations.d.ts +7 -7
- package/dist/bin/cliOperations.js +251 -37
- package/dist/bin/cliOperations.js.map +1 -1
- package/dist/bin/copyDb.js +16 -16
- package/dist/bin/copyDb.js.map +1 -1
- package/dist/bin/deployRenderer.d.ts +47 -0
- package/dist/bin/deployRenderer.js +185 -0
- package/dist/bin/deployRenderer.js.map +1 -0
- package/dist/bin/harper.d.ts +2 -1
- package/dist/bin/harper.js +87 -26
- package/dist/bin/harper.js.map +1 -1
- package/dist/bin/install.d.ts +1 -1
- package/dist/bin/install.js +41 -4
- package/dist/bin/install.js.map +1 -1
- package/dist/bin/lite.js +3 -4
- package/dist/bin/lite.js.map +1 -1
- package/dist/bin/login.d.ts +4 -0
- package/dist/bin/login.js +123 -0
- package/dist/bin/login.js.map +1 -0
- package/dist/bin/logout.d.ts +4 -0
- package/dist/bin/logout.js +16 -0
- package/dist/bin/logout.js.map +1 -0
- package/dist/bin/mcp/client.d.ts +34 -0
- package/dist/bin/mcp/client.js +395 -0
- package/dist/bin/mcp/client.js.map +1 -0
- package/dist/bin/mcp/doctor.d.ts +11 -0
- package/dist/bin/mcp/doctor.js +193 -0
- package/dist/bin/mcp/doctor.js.map +1 -0
- package/dist/bin/mcp/index.d.ts +10 -0
- package/dist/bin/mcp/index.js +81 -0
- package/dist/bin/mcp/index.js.map +1 -0
- package/dist/bin/mcp/options.d.ts +33 -0
- package/dist/bin/mcp/options.js +113 -0
- package/dist/bin/mcp/options.js.map +1 -0
- package/dist/bin/mcp/printConfig.d.ts +14 -0
- package/dist/bin/mcp/printConfig.js +85 -0
- package/dist/bin/mcp/printConfig.js.map +1 -0
- package/dist/bin/multipartBuilder.d.ts +26 -0
- package/dist/bin/multipartBuilder.js +55 -0
- package/dist/bin/multipartBuilder.js.map +1 -0
- package/dist/bin/restart.d.ts +3 -2
- package/dist/bin/restart.js +82 -45
- package/dist/bin/restart.js.map +1 -1
- package/dist/bin/run.d.ts +13 -9
- package/dist/bin/run.js +111 -65
- package/dist/bin/run.js.map +1 -1
- package/dist/bin/sseConsumer.d.ts +24 -0
- package/dist/bin/sseConsumer.js +127 -0
- package/dist/bin/sseConsumer.js.map +1 -0
- package/dist/bin/status.d.ts +1 -1
- package/dist/bin/status.js +48 -11
- package/dist/bin/status.js.map +1 -1
- package/dist/bin/stop.d.ts +1 -1
- package/dist/bin/stop.js +43 -6
- package/dist/bin/stop.js.map +1 -1
- package/dist/bin/upgrade.js +14 -22
- package/dist/bin/upgrade.js.map +1 -1
- package/dist/components/Application.d.ts +29 -17
- package/dist/components/Application.js +134 -28
- package/dist/components/Application.js.map +1 -1
- package/dist/components/ApplicationScope.js +2 -2
- package/dist/components/ComponentV1.d.ts +1 -1
- package/dist/components/ComponentV1.js +5 -5
- package/dist/components/ComponentV1.js.map +1 -1
- package/dist/components/EntryHandler.d.ts +26 -3
- package/dist/components/EntryHandler.js +153 -13
- package/dist/components/EntryHandler.js.map +1 -1
- package/dist/components/OptionsWatcher.d.ts +7 -2
- package/dist/components/OptionsWatcher.js +72 -10
- package/dist/components/OptionsWatcher.js.map +1 -1
- package/dist/components/Scope.d.ts +11 -6
- package/dist/components/Scope.js +112 -12
- package/dist/components/Scope.js.map +1 -1
- package/dist/components/anthropic/index.d.ts +40 -0
- package/dist/components/anthropic/index.js +428 -0
- package/dist/components/anthropic/index.js.map +1 -0
- package/dist/components/bedrock/index.d.ts +79 -0
- package/dist/components/bedrock/index.js +734 -0
- package/dist/components/bedrock/index.js.map +1 -0
- package/dist/components/componentLoader.d.ts +29 -0
- package/dist/components/componentLoader.js +65 -38
- package/dist/components/componentLoader.js.map +1 -1
- package/dist/components/deployLifecycle.d.ts +39 -0
- package/dist/components/deployLifecycle.js +156 -0
- package/dist/components/deployLifecycle.js.map +1 -0
- package/dist/components/deploymentOperations.d.ts +19 -0
- package/dist/components/deploymentOperations.js +185 -0
- package/dist/components/deploymentOperations.js.map +1 -0
- package/dist/components/deploymentRecorder.d.ts +97 -0
- package/dist/components/deploymentRecorder.js +425 -0
- package/dist/components/deploymentRecorder.js.map +1 -0
- package/dist/components/deriveURLPath.d.ts +2 -2
- package/dist/components/deriveURLPath.js +2 -2
- package/dist/components/deriveURLPath.js.map +1 -1
- package/dist/components/mcp/adapters/fastify.d.ts +35 -0
- package/dist/components/mcp/adapters/fastify.js +66 -0
- package/dist/components/mcp/adapters/fastify.js.map +1 -0
- package/dist/components/mcp/adapters/harperHttp.d.ts +38 -0
- package/dist/components/mcp/adapters/harperHttp.js +78 -0
- package/dist/components/mcp/adapters/harperHttp.js.map +1 -0
- package/dist/components/mcp/audit.d.ts +27 -0
- package/dist/components/mcp/audit.js +73 -0
- package/dist/components/mcp/audit.js.map +1 -0
- package/dist/components/mcp/index.d.ts +47 -0
- package/dist/components/mcp/index.js +109 -0
- package/dist/components/mcp/index.js.map +1 -0
- package/dist/components/mcp/jsonrpc.d.ts +71 -0
- package/dist/components/mcp/jsonrpc.js +93 -0
- package/dist/components/mcp/jsonrpc.js.map +1 -0
- package/dist/components/mcp/lifecycle.d.ts +69 -0
- package/dist/components/mcp/lifecycle.js +79 -0
- package/dist/components/mcp/lifecycle.js.map +1 -0
- package/dist/components/mcp/listChanged.d.ts +24 -0
- package/dist/components/mcp/listChanged.js +257 -0
- package/dist/components/mcp/listChanged.js.map +1 -0
- package/dist/components/mcp/rateLimit.d.ts +25 -0
- package/dist/components/mcp/rateLimit.js +226 -0
- package/dist/components/mcp/rateLimit.js.map +1 -0
- package/dist/components/mcp/resources.d.ts +90 -0
- package/dist/components/mcp/resources.js +526 -0
- package/dist/components/mcp/resources.js.map +1 -0
- package/dist/components/mcp/session.d.ts +36 -0
- package/dist/components/mcp/session.js +170 -0
- package/dist/components/mcp/session.js.map +1 -0
- package/dist/components/mcp/sessionRegistry.d.ts +63 -0
- package/dist/components/mcp/sessionRegistry.js +124 -0
- package/dist/components/mcp/sessionRegistry.js.map +1 -0
- package/dist/components/mcp/toolRegistry.d.ts +151 -0
- package/dist/components/mcp/toolRegistry.js +177 -0
- package/dist/components/mcp/toolRegistry.js.map +1 -0
- package/dist/components/mcp/tools/application.d.ts +72 -0
- package/dist/components/mcp/tools/application.js +660 -0
- package/dist/components/mcp/tools/application.js.map +1 -0
- package/dist/components/mcp/tools/operations.d.ts +23 -0
- package/dist/components/mcp/tools/operations.js +331 -0
- package/dist/components/mcp/tools/operations.js.map +1 -0
- package/dist/components/mcp/tools/schemas/derive.d.ts +50 -0
- package/dist/components/mcp/tools/schemas/derive.js +291 -0
- package/dist/components/mcp/tools/schemas/derive.js.map +1 -0
- package/dist/components/mcp/tools/schemas/operationDescriptions.d.ts +32 -0
- package/dist/components/mcp/tools/schemas/operationDescriptions.js +179 -0
- package/dist/components/mcp/tools/schemas/operationDescriptions.js.map +1 -0
- package/dist/components/mcp/tools/schemas/operations.d.ts +27 -0
- package/dist/components/mcp/tools/schemas/operations.js +299 -0
- package/dist/components/mcp/tools/schemas/operations.js.map +1 -0
- package/dist/components/mcp/transport.d.ts +38 -0
- package/dist/components/mcp/transport.js +467 -0
- package/dist/components/mcp/transport.js.map +1 -0
- package/dist/components/ollama/index.d.ts +46 -0
- package/dist/components/ollama/index.js +239 -0
- package/dist/components/ollama/index.js.map +1 -0
- package/dist/components/openai/index.d.ts +51 -0
- package/dist/components/openai/index.js +475 -0
- package/dist/components/openai/index.js.map +1 -0
- package/dist/components/operations.d.ts +6 -6
- package/dist/components/operations.js +205 -52
- package/dist/components/operations.js.map +1 -1
- package/dist/components/operationsValidation.d.ts +2 -2
- package/dist/components/operationsValidation.js +13 -4
- package/dist/components/operationsValidation.js.map +1 -1
- package/dist/components/packageComponent.d.ts +28 -6
- package/dist/components/packageComponent.js +87 -26
- package/dist/components/packageComponent.js.map +1 -1
- package/dist/components/requestRestart.d.ts +1 -0
- package/dist/components/requestRestart.js +12 -1
- package/dist/components/requestRestart.js.map +1 -1
- package/dist/components/status/crossThread.d.ts +5 -1
- package/dist/components/status/crossThread.js +12 -5
- package/dist/components/status/crossThread.js.map +1 -1
- package/dist/components/status/errors.js +7 -7
- package/dist/config/RootConfigWatcher.d.ts +3 -0
- package/dist/config/RootConfigWatcher.js +52 -1
- package/dist/config/RootConfigWatcher.js.map +1 -1
- package/dist/config/configUtils.js +31 -8
- package/dist/config/configUtils.js.map +1 -1
- package/dist/config/harperConfigEnvVars.js +1 -1
- package/dist/config/harperConfigEnvVars.js.map +1 -1
- package/dist/dataLayer/CreateAttributeObject.d.ts +3 -7
- package/dist/dataLayer/CreateAttributeObject.js +4 -3
- package/dist/dataLayer/CreateAttributeObject.js.map +1 -1
- package/dist/dataLayer/CreateTableObject.d.ts +2 -4
- package/dist/dataLayer/CreateTableObject.js +2 -1
- package/dist/dataLayer/CreateTableObject.js.map +1 -1
- package/dist/dataLayer/DataLayerObjects.d.ts +17 -16
- package/dist/dataLayer/DataLayerObjects.js +19 -5
- package/dist/dataLayer/DataLayerObjects.js.map +1 -1
- package/dist/dataLayer/DeleteBeforeObject.d.ts +3 -5
- package/dist/dataLayer/DeleteBeforeObject.js +2 -1
- package/dist/dataLayer/DeleteBeforeObject.js.map +1 -1
- package/dist/dataLayer/DeleteObject.d.ts +3 -7
- package/dist/dataLayer/DeleteObject.js +4 -3
- package/dist/dataLayer/DeleteObject.js.map +1 -1
- package/dist/dataLayer/DropAttributeObject.d.ts +2 -4
- package/dist/dataLayer/DropAttributeObject.js +2 -1
- package/dist/dataLayer/DropAttributeObject.js.map +1 -1
- package/dist/dataLayer/GetBackupObject.d.ts +3 -5
- package/dist/dataLayer/GetBackupObject.js +4 -3
- package/dist/dataLayer/GetBackupObject.js.map +1 -1
- package/dist/dataLayer/InsertObject.d.ts +3 -8
- package/dist/dataLayer/InsertObject.js +4 -3
- package/dist/dataLayer/InsertObject.js.map +1 -1
- package/dist/dataLayer/ReadAuditLogObject.d.ts +3 -7
- package/dist/dataLayer/ReadAuditLogObject.js +4 -3
- package/dist/dataLayer/ReadAuditLogObject.js.map +1 -1
- package/dist/dataLayer/SQLSearch.d.ts +68 -38
- package/dist/dataLayer/SQLSearch.js +140 -78
- package/dist/dataLayer/SQLSearch.js.map +1 -1
- package/dist/dataLayer/SearchByConditionsObject.d.ts +10 -58
- package/dist/dataLayer/SearchByConditionsObject.js +5 -7
- package/dist/dataLayer/SearchByConditionsObject.js.map +1 -1
- package/dist/dataLayer/SearchByHashObject.d.ts +3 -6
- package/dist/dataLayer/SearchByHashObject.js +2 -1
- package/dist/dataLayer/SearchByHashObject.js.map +1 -1
- package/dist/dataLayer/SearchObject.d.ts +3 -12
- package/dist/dataLayer/SearchObject.js +2 -1
- package/dist/dataLayer/SearchObject.js.map +1 -1
- package/dist/dataLayer/SqlSearchObject.d.ts +2 -4
- package/dist/dataLayer/SqlSearchObject.js +2 -1
- package/dist/dataLayer/SqlSearchObject.js.map +1 -1
- package/dist/dataLayer/UpdateObject.d.ts +3 -7
- package/dist/dataLayer/UpdateObject.js +4 -3
- package/dist/dataLayer/UpdateObject.js.map +1 -1
- package/dist/dataLayer/UpsertObject.d.ts +3 -7
- package/dist/dataLayer/UpsertObject.js +4 -3
- package/dist/dataLayer/UpsertObject.js.map +1 -1
- package/dist/dataLayer/bulkLoad.d.ts +4 -4
- package/dist/dataLayer/bulkLoad.js +122 -88
- package/dist/dataLayer/bulkLoad.js.map +1 -1
- package/dist/dataLayer/delete.d.ts +10 -11
- package/dist/dataLayer/delete.js +74 -39
- package/dist/dataLayer/delete.js.map +1 -1
- package/dist/dataLayer/export.d.ts +8 -8
- package/dist/dataLayer/export.js +90 -55
- package/dist/dataLayer/export.js.map +1 -1
- package/dist/dataLayer/getBackup.d.ts +4 -3
- package/dist/dataLayer/getBackup.js +43 -11
- package/dist/dataLayer/getBackup.js.map +1 -1
- package/dist/dataLayer/harperBridge/BridgeMethods.d.ts +39 -21
- package/dist/dataLayer/harperBridge/BridgeMethods.js +41 -20
- package/dist/dataLayer/harperBridge/BridgeMethods.js.map +1 -1
- package/dist/dataLayer/harperBridge/ResourceBridge.d.ts +2 -2
- package/dist/dataLayer/harperBridge/ResourceBridge.js +26 -25
- package/dist/dataLayer/harperBridge/ResourceBridge.js.map +1 -1
- package/dist/dataLayer/harperBridge/TableSizeObject.d.ts +1 -0
- package/dist/dataLayer/harperBridge/TableSizeObject.js.map +1 -1
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.d.ts +4 -4
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js +4 -4
- package/dist/dataLayer/harperBridge/harperBridge.d.ts +2 -3
- package/dist/dataLayer/harperBridge/harperBridge.js +38 -4
- package/dist/dataLayer/harperBridge/harperBridge.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js +7 -6
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js +5 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js +3 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js +8 -8
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.d.ts +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js +3 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js +3 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js +5 -3
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.js +2 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.d.ts +1 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js +4 -4
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js +5 -5
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js +4 -4
- package/dist/dataLayer/hdbInfoController.d.ts +4 -8
- package/dist/dataLayer/hdbInfoController.js +66 -31
- package/dist/dataLayer/hdbInfoController.js.map +1 -1
- package/dist/dataLayer/insert.d.ts +14 -26
- package/dist/dataLayer/insert.js +63 -28
- package/dist/dataLayer/insert.js.map +1 -1
- package/dist/dataLayer/readAuditLog.d.ts +1 -3
- package/dist/dataLayer/readAuditLog.js +45 -13
- package/dist/dataLayer/readAuditLog.js.map +1 -1
- package/dist/dataLayer/schema.d.ts +10 -10
- package/dist/dataLayer/schema.js +124 -89
- package/dist/dataLayer/schema.js.map +1 -1
- package/dist/dataLayer/schemaDescribe.d.ts +4 -4
- package/dist/dataLayer/schemaDescribe.js +78 -41
- package/dist/dataLayer/schemaDescribe.js.map +1 -1
- package/dist/dataLayer/search.d.ts +4 -4
- package/dist/dataLayer/search.js +12 -13
- package/dist/dataLayer/search.js.map +1 -1
- package/dist/dataLayer/transaction.d.ts +1 -1
- package/dist/dataLayer/transaction.js +3 -4
- package/dist/dataLayer/transaction.js.map +1 -1
- package/dist/dataLayer/update.d.ts +2 -8
- package/dist/dataLayer/update.js +53 -18
- package/dist/dataLayer/update.js.map +1 -1
- package/dist/globals.d.ts +1 -1
- package/dist/globals.js +1 -0
- package/dist/globals.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/json/systemSchema.json +65 -0
- package/dist/launchServiceScripts/launchHarperDB.d.ts +1 -0
- package/dist/launchServiceScripts/launchHarperDB.js +3 -0
- package/dist/launchServiceScripts/launchHarperDB.js.map +1 -0
- package/dist/launchServiceScripts/utility/checkNodeVersion.js +3 -0
- package/dist/launchServiceScripts/utility/checkNodeVersion.js.map +1 -1
- package/dist/resources/DatabaseTransaction.d.ts +14 -6
- package/dist/resources/DatabaseTransaction.js +39 -15
- package/dist/resources/DatabaseTransaction.js.map +1 -1
- package/dist/resources/ErrorResource.d.ts +1 -1
- package/dist/resources/ErrorResource.js +3 -1
- package/dist/resources/ErrorResource.js.map +1 -1
- package/dist/resources/LMDBTransaction.d.ts +10 -13
- package/dist/resources/LMDBTransaction.js +18 -7
- package/dist/resources/LMDBTransaction.js.map +1 -1
- package/dist/resources/RecordEncoder.d.ts +10 -12
- package/dist/resources/RecordEncoder.js +38 -38
- package/dist/resources/RecordEncoder.js.map +1 -1
- package/dist/resources/RequestTarget.d.ts +1 -0
- package/dist/resources/RequestTarget.js.map +1 -1
- package/dist/resources/Resource.d.ts +25 -5
- package/dist/resources/Resource.js +43 -10
- package/dist/resources/Resource.js.map +1 -1
- package/dist/resources/ResourceInterface.d.ts +24 -5
- package/dist/resources/ResourceInterface.js +20 -0
- package/dist/resources/ResourceInterface.js.map +1 -1
- package/dist/resources/Resources.d.ts +3 -4
- package/dist/resources/Resources.js +7 -6
- package/dist/resources/Resources.js.map +1 -1
- package/dist/resources/RocksIndexStore.js +3 -0
- package/dist/resources/RocksIndexStore.js.map +1 -1
- package/dist/resources/RocksTransactionLogStore.d.ts +1 -1
- package/dist/resources/RocksTransactionLogStore.js +10 -3
- package/dist/resources/RocksTransactionLogStore.js.map +1 -1
- package/dist/resources/Table.d.ts +76 -329
- package/dist/resources/Table.js +306 -116
- package/dist/resources/Table.js.map +1 -1
- package/dist/resources/analytics/metadata.d.ts +1 -0
- package/dist/resources/analytics/metadata.js +1 -0
- package/dist/resources/analytics/metadata.js.map +1 -1
- package/dist/resources/analytics/read.d.ts +8 -1
- package/dist/resources/analytics/read.js +69 -8
- package/dist/resources/analytics/read.js.map +1 -1
- package/dist/resources/analytics/write.d.ts +28 -0
- package/dist/resources/analytics/write.js +232 -20
- package/dist/resources/analytics/write.js.map +1 -1
- package/dist/resources/auditStore.d.ts +18 -13
- package/dist/resources/auditStore.js +16 -8
- package/dist/resources/auditStore.js.map +1 -1
- package/dist/resources/blob.d.ts +16 -27
- package/dist/resources/blob.js +8 -8
- package/dist/resources/blob.js.map +1 -1
- package/dist/resources/dataLoader.d.ts +1 -1
- package/dist/resources/dataLoader.js +13 -13
- package/dist/resources/databases.d.ts +17 -0
- package/dist/resources/databases.js +175 -59
- package/dist/resources/databases.js.map +1 -1
- package/dist/resources/graphql.d.ts +1 -7
- package/dist/resources/graphql.js +267 -173
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +17 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +327 -59
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
- package/dist/resources/indexes/vector.d.ts +1 -0
- package/dist/resources/indexes/vector.js +14 -0
- package/dist/resources/indexes/vector.js.map +1 -1
- package/dist/resources/jsonSchemaTypes.d.ts +60 -0
- package/dist/resources/jsonSchemaTypes.js +78 -0
- package/dist/resources/jsonSchemaTypes.js.map +1 -0
- package/dist/resources/loadEnv.d.ts +2 -5
- package/dist/resources/loadEnv.js +21 -18
- package/dist/resources/loadEnv.js.map +1 -1
- package/dist/resources/login.d.ts +2 -3
- package/dist/resources/login.js +5 -4
- package/dist/resources/login.js.map +1 -1
- package/dist/resources/models/Models.d.ts +45 -0
- package/dist/resources/models/Models.js +265 -0
- package/dist/resources/models/Models.js.map +1 -0
- package/dist/resources/models/TestBackend.d.ts +15 -0
- package/dist/resources/models/TestBackend.js +71 -0
- package/dist/resources/models/TestBackend.js.map +1 -0
- package/dist/resources/models/agentLoop.d.ts +125 -0
- package/dist/resources/models/agentLoop.js +746 -0
- package/dist/resources/models/agentLoop.js.map +1 -0
- package/dist/resources/models/analyticsTable.d.ts +65 -0
- package/dist/resources/models/analyticsTable.js +166 -0
- package/dist/resources/models/analyticsTable.js.map +1 -0
- package/dist/resources/models/backendHelpers.d.ts +57 -0
- package/dist/resources/models/backendHelpers.js +109 -0
- package/dist/resources/models/backendHelpers.js.map +1 -0
- package/dist/resources/models/backendRegistry.d.ts +36 -0
- package/dist/resources/models/backendRegistry.js +54 -0
- package/dist/resources/models/backendRegistry.js.map +1 -0
- package/dist/resources/models/bootstrap.d.ts +24 -0
- package/dist/resources/models/bootstrap.js +112 -0
- package/dist/resources/models/bootstrap.js.map +1 -0
- package/dist/resources/models/embedHook.d.ts +33 -0
- package/dist/resources/models/embedHook.js +127 -0
- package/dist/resources/models/embedHook.js.map +1 -0
- package/dist/resources/models/types.d.ts +301 -0
- package/dist/resources/models/types.js +11 -0
- package/dist/resources/models/types.js.map +1 -0
- package/dist/resources/openApi.js +74 -34
- package/dist/resources/openApi.js.map +1 -1
- package/dist/resources/replayLogs.js +7 -1
- package/dist/resources/replayLogs.js.map +1 -1
- package/dist/resources/replayLogsGuards.d.ts +9 -0
- package/dist/resources/replayLogsGuards.js +47 -0
- package/dist/resources/replayLogsGuards.js.map +1 -1
- package/dist/resources/roles.d.ts +1 -7
- package/dist/resources/roles.js +67 -71
- package/dist/resources/roles.js.map +1 -1
- package/dist/resources/search.d.ts +18 -1
- package/dist/resources/search.js +349 -140
- package/dist/resources/search.js.map +1 -1
- package/dist/resources/tracked.d.ts +1 -1
- package/dist/resources/tracked.js +23 -15
- package/dist/resources/tracked.js.map +1 -1
- package/dist/resources/transaction.d.ts +1 -1
- package/dist/resources/transaction.js +1 -1
- package/dist/resources/transaction.js.map +1 -1
- package/dist/resources/transactionBroadcast.d.ts +1 -1
- package/dist/resources/transactionBroadcast.js.map +1 -1
- package/dist/security/auth.d.ts +1 -5
- package/dist/security/auth.js +34 -25
- package/dist/security/auth.js.map +1 -1
- package/dist/security/certificateVerification/crlVerification.js +7 -1
- package/dist/security/certificateVerification/crlVerification.js.map +1 -1
- package/dist/security/cryptoHash.d.ts +2 -2
- package/dist/security/cryptoHash.js +37 -5
- package/dist/security/cryptoHash.js.map +1 -1
- package/dist/security/data_objects/PermissionAttributeResponseObject.d.ts +3 -4
- package/dist/security/data_objects/PermissionAttributeResponseObject.js +4 -1
- package/dist/security/data_objects/PermissionAttributeResponseObject.js.map +1 -1
- package/dist/security/data_objects/PermissionResponseObject.d.ts +9 -9
- package/dist/security/data_objects/PermissionResponseObject.js +15 -8
- package/dist/security/data_objects/PermissionResponseObject.js.map +1 -1
- package/dist/security/data_objects/PermissionTableResponseObject.d.ts +5 -6
- package/dist/security/data_objects/PermissionTableResponseObject.js +6 -1
- package/dist/security/data_objects/PermissionTableResponseObject.js.map +1 -1
- package/dist/security/fastifyAuth.d.ts +2 -2
- package/dist/security/fastifyAuth.js +131 -22
- package/dist/security/fastifyAuth.js.map +1 -1
- package/dist/security/impersonation.js +15 -15
- package/dist/security/jsLoader.js +18 -5
- package/dist/security/jsLoader.js.map +1 -1
- package/dist/security/keys.d.ts +45 -48
- package/dist/security/keys.js +160 -114
- package/dist/security/keys.js.map +1 -1
- package/dist/security/permissionsTranslator.js +2 -2
- package/dist/security/role.d.ts +5 -5
- package/dist/security/role.js +70 -35
- package/dist/security/role.js.map +1 -1
- package/dist/security/tokenAuthentication.d.ts +13 -0
- package/dist/security/tokenAuthentication.js +57 -27
- package/dist/security/tokenAuthentication.js.map +1 -1
- package/dist/security/user.js +74 -38
- package/dist/security/user.js.map +1 -1
- package/dist/server/DurableSubscriptionsSession.d.ts +4 -2
- package/dist/server/DurableSubscriptionsSession.js +71 -55
- package/dist/server/DurableSubscriptionsSession.js.map +1 -1
- package/dist/server/REST.d.ts +1 -8
- package/dist/server/REST.js +17 -16
- package/dist/server/REST.js.map +1 -1
- package/dist/server/Server.d.ts +23 -4
- package/dist/server/Server.js +1 -1
- package/dist/server/Server.js.map +1 -1
- package/dist/server/fastifyRoutes/helpers/getCORSOptions.js +1 -1
- package/dist/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js +1 -1
- package/dist/server/fastifyRoutes/helpers/getServerOptions.js +1 -1
- package/dist/server/fastifyRoutes.d.ts +1 -4
- package/dist/server/fastifyRoutes.js +34 -30
- package/dist/server/fastifyRoutes.js.map +1 -1
- package/dist/server/graphqlQuerying.d.ts +1 -1
- package/dist/server/graphqlQuerying.js +8 -7
- package/dist/server/graphqlQuerying.js.map +1 -1
- package/dist/server/http.d.ts +9 -4
- package/dist/server/http.js +523 -47
- package/dist/server/http.js.map +1 -1
- package/dist/server/itc/serverHandlers.js +66 -15
- package/dist/server/itc/serverHandlers.js.map +1 -1
- package/dist/server/jobs/JobObject.d.ts +3 -3
- package/dist/server/jobs/JobObject.js +53 -7
- package/dist/server/jobs/JobObject.js.map +1 -1
- package/dist/server/jobs/jobProcess.js +64 -24
- package/dist/server/jobs/jobProcess.js.map +1 -1
- package/dist/server/jobs/jobRunner.d.ts +7 -6
- package/dist/server/jobs/jobRunner.js +68 -30
- package/dist/server/jobs/jobRunner.js.map +1 -1
- package/dist/server/jobs/jobs.d.ts +18 -7
- package/dist/server/jobs/jobs.js +93 -61
- package/dist/server/jobs/jobs.js.map +1 -1
- package/dist/server/loadRootComponents.js +1 -1
- package/dist/server/middlewareChain.d.ts +80 -0
- package/dist/server/middlewareChain.js +252 -0
- package/dist/server/middlewareChain.js.map +1 -0
- package/dist/server/mqtt.d.ts +1 -8
- package/dist/server/mqtt.js +22 -17
- package/dist/server/mqtt.js.map +1 -1
- package/dist/server/nodeName.js +46 -13
- package/dist/server/nodeName.js.map +1 -1
- package/dist/server/operationsServer.d.ts +2 -2
- package/dist/server/operationsServer.js +106 -33
- package/dist/server/operationsServer.js.map +1 -1
- package/dist/server/serverHelpers/Headers.d.ts +4 -4
- package/dist/server/serverHelpers/Headers.js +2 -0
- package/dist/server/serverHelpers/Headers.js.map +1 -1
- package/dist/server/serverHelpers/JSONStream.d.ts +7 -1
- package/dist/server/serverHelpers/JSONStream.js +12 -3
- package/dist/server/serverHelpers/JSONStream.js.map +1 -1
- package/dist/server/serverHelpers/Request.d.ts +106 -8
- package/dist/server/serverHelpers/Request.js +370 -9
- package/dist/server/serverHelpers/Request.js.map +1 -1
- package/dist/server/serverHelpers/contentTypes.d.ts +1 -1
- package/dist/server/serverHelpers/contentTypes.js +36 -7
- package/dist/server/serverHelpers/contentTypes.js.map +1 -1
- package/dist/server/serverHelpers/multipartParser.d.ts +21 -0
- package/dist/server/serverHelpers/multipartParser.js +142 -0
- package/dist/server/serverHelpers/multipartParser.js.map +1 -0
- package/dist/server/serverHelpers/progressEmitter.d.ts +25 -0
- package/dist/server/serverHelpers/progressEmitter.js +103 -0
- package/dist/server/serverHelpers/progressEmitter.js.map +1 -0
- package/dist/server/serverHelpers/serverHandlers.d.ts +1 -1
- package/dist/server/serverHelpers/serverHandlers.js +38 -7
- package/dist/server/serverHelpers/serverHandlers.js.map +1 -1
- package/dist/server/serverHelpers/serverUtilities.d.ts +4 -2
- package/dist/server/serverHelpers/serverUtilities.js +97 -93
- package/dist/server/serverHelpers/serverUtilities.js.map +1 -1
- package/dist/server/static.js +8 -5
- package/dist/server/static.js.map +1 -1
- package/dist/server/status/index.js +3 -3
- package/dist/server/storageReclamation.d.ts +10 -0
- package/dist/server/storageReclamation.js +68 -9
- package/dist/server/storageReclamation.js.map +1 -1
- package/dist/server/threads/itc.js +7 -4
- package/dist/server/threads/itc.js.map +1 -1
- package/dist/server/threads/manageThreads.d.ts +1 -1
- package/dist/server/threads/manageThreads.js +110 -26
- package/dist/server/threads/manageThreads.js.map +1 -1
- package/dist/server/threads/socketRouter.d.ts +0 -1
- package/dist/server/threads/socketRouter.js +8 -271
- package/dist/server/threads/socketRouter.js.map +1 -1
- package/dist/server/threads/threadServer.d.ts +1 -0
- package/dist/server/threads/threadServer.js +360 -118
- package/dist/server/threads/threadServer.js.map +1 -1
- package/dist/server/threads/workerProcessGuard.d.ts +42 -0
- package/dist/server/threads/workerProcessGuard.js +114 -0
- package/dist/server/threads/workerProcessGuard.js.map +1 -0
- package/dist/server/throttle.js +17 -0
- package/dist/server/throttle.js.map +1 -1
- package/dist/sqlTranslator/SelectValidator.d.ts +21 -24
- package/dist/sqlTranslator/SelectValidator.js +86 -47
- package/dist/sqlTranslator/SelectValidator.js.map +1 -1
- package/dist/sqlTranslator/alasqlFunctionImporter.d.ts +6 -2
- package/dist/sqlTranslator/alasqlFunctionImporter.js +40 -3
- package/dist/sqlTranslator/alasqlFunctionImporter.js.map +1 -1
- package/dist/sqlTranslator/deleteTranslator.d.ts +4 -7
- package/dist/sqlTranslator/deleteTranslator.js +48 -14
- package/dist/sqlTranslator/deleteTranslator.js.map +1 -1
- package/dist/sqlTranslator/index.d.ts +10 -9
- package/dist/sqlTranslator/index.js +69 -30
- package/dist/sqlTranslator/index.js.map +1 -1
- package/dist/sqlTranslator/sql_statement_bucket.d.ts +10 -10
- package/dist/sqlTranslator/sql_statement_bucket.js +55 -13
- package/dist/sqlTranslator/sql_statement_bucket.js.map +1 -1
- package/dist/upgrade/UpgradeObjects.d.ts +2 -3
- package/dist/upgrade/UpgradeObjects.js +37 -4
- package/dist/upgrade/UpgradeObjects.js.map +1 -1
- package/dist/upgrade/directives/5-1-0.d.ts +6 -0
- package/dist/upgrade/directives/5-1-0.js +114 -0
- package/dist/upgrade/directives/5-1-0.js.map +1 -0
- package/dist/upgrade/directives/directivesController.d.ts +10 -10
- package/dist/upgrade/directives/directivesController.js +52 -11
- package/dist/upgrade/directives/directivesController.js.map +1 -1
- package/dist/upgrade/directivesManager.d.ts +1 -1
- package/dist/upgrade/directivesManager.js +53 -18
- package/dist/upgrade/directivesManager.js.map +1 -1
- package/dist/upgrade/upgradePrompt.d.ts +2 -8
- package/dist/upgrade/upgradePrompt.js +55 -60
- package/dist/upgrade/upgradePrompt.js.map +1 -1
- package/dist/upgrade/upgradeUtilities.d.ts +1 -1
- package/dist/upgrade/upgradeUtilities.js +37 -5
- package/dist/upgrade/upgradeUtilities.js.map +1 -1
- package/dist/utility/OperationFunctionCaller.d.ts +1 -1
- package/dist/utility/OperationFunctionCaller.js +45 -10
- package/dist/utility/OperationFunctionCaller.js.map +1 -1
- package/dist/utility/assignCmdEnvVariables.d.ts +1 -2
- package/dist/utility/assignCmdEnvVariables.js +8 -4
- package/dist/utility/assignCmdEnvVariables.js.map +1 -1
- package/dist/utility/common_utils.d.ts +80 -77
- package/dist/utility/common_utils.js +140 -79
- package/dist/utility/common_utils.js.map +1 -1
- package/dist/utility/environment/environmentManager.d.ts +12 -11
- package/dist/utility/environment/environmentManager.js +75 -29
- package/dist/utility/environment/environmentManager.js.map +1 -1
- package/dist/utility/environment/systemInformation.d.ts +4 -0
- package/dist/utility/environment/systemInformation.js +27 -16
- package/dist/utility/environment/systemInformation.js.map +1 -1
- package/dist/utility/errors/commonErrors.d.ts +192 -168
- package/dist/utility/errors/commonErrors.js +49 -18
- package/dist/utility/errors/commonErrors.js.map +1 -1
- package/dist/utility/errors/hdbError.d.ts +37 -51
- package/dist/utility/errors/hdbError.js +65 -26
- package/dist/utility/errors/hdbError.js.map +1 -1
- package/dist/utility/expandEnvVar.d.ts +61 -0
- package/dist/utility/expandEnvVar.js +113 -0
- package/dist/utility/expandEnvVar.js.map +1 -0
- package/dist/utility/functions/geo.js +2 -2
- package/dist/utility/functions/sql/alaSQLExtension.js +1 -1
- package/dist/utility/globalSchema.d.ts +13 -4
- package/dist/utility/globalSchema.js +14 -11
- package/dist/utility/globalSchema.js.map +1 -1
- package/dist/utility/hdbTerms.d.ts +54 -1
- package/dist/utility/hdbTerms.js +54 -1
- package/dist/utility/hdbTerms.js.map +1 -1
- package/dist/utility/install/checkJWTTokensExist.js +1 -1
- package/dist/utility/install/installer.d.ts +9 -12
- package/dist/utility/install/installer.js +117 -54
- package/dist/utility/install/installer.js.map +1 -1
- package/dist/utility/installation.js +3 -3
- package/dist/utility/lmdb/DBIDefinition.d.ts +4 -4
- package/dist/utility/lmdb/DBIDefinition.js +5 -1
- package/dist/utility/lmdb/DBIDefinition.js.map +1 -1
- package/dist/utility/lmdb/DeleteRecordsResponseObject.d.ts +3 -6
- package/dist/utility/lmdb/DeleteRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/DeleteRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/InsertRecordsResponseObject.d.ts +3 -5
- package/dist/utility/lmdb/InsertRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/InsertRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/OpenDBIObject.d.ts +12 -15
- package/dist/utility/lmdb/OpenDBIObject.js +68 -6
- package/dist/utility/lmdb/OpenDBIObject.js.map +1 -1
- package/dist/utility/lmdb/OpenEnvironmentObject.d.ts +5 -8
- package/dist/utility/lmdb/OpenEnvironmentObject.js +52 -4
- package/dist/utility/lmdb/OpenEnvironmentObject.js.map +1 -1
- package/dist/utility/lmdb/UpdateRecordsResponseObject.d.ts +3 -6
- package/dist/utility/lmdb/UpdateRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/UpdateRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/UpsertRecordsResponseObject.d.ts +3 -5
- package/dist/utility/lmdb/UpsertRecordsResponseObject.js +2 -1
- package/dist/utility/lmdb/UpsertRecordsResponseObject.js.map +1 -1
- package/dist/utility/lmdb/cleanLMDBMap.d.ts +1 -1
- package/dist/utility/lmdb/cleanLMDBMap.js +44 -7
- package/dist/utility/lmdb/cleanLMDBMap.js.map +1 -1
- package/dist/utility/lmdb/commonUtility.d.ts +8 -9
- package/dist/utility/lmdb/commonUtility.js +46 -17
- package/dist/utility/lmdb/commonUtility.js.map +1 -1
- package/dist/utility/lmdb/deleteUtility.d.ts +2 -3
- package/dist/utility/lmdb/deleteUtility.js +51 -16
- package/dist/utility/lmdb/deleteUtility.js.map +1 -1
- package/dist/utility/lmdb/environmentUtility.d.ts +69 -36
- package/dist/utility/lmdb/environmentUtility.js +91 -51
- package/dist/utility/lmdb/environmentUtility.js.map +1 -1
- package/dist/utility/lmdb/searchCursorFunctions.d.ts +19 -19
- package/dist/utility/lmdb/searchCursorFunctions.js +46 -14
- package/dist/utility/lmdb/searchCursorFunctions.js.map +1 -1
- package/dist/utility/lmdb/searchUtility.d.ts +142 -73
- package/dist/utility/lmdb/searchUtility.js +91 -55
- package/dist/utility/lmdb/searchUtility.js.map +1 -1
- package/dist/utility/lmdb/terms.d.ts +34 -34
- package/dist/utility/lmdb/terms.js +12 -22
- package/dist/utility/lmdb/terms.js.map +1 -1
- package/dist/utility/lmdb/writeUtility.d.ts +3 -6
- package/dist/utility/lmdb/writeUtility.js +61 -28
- package/dist/utility/lmdb/writeUtility.js.map +1 -1
- package/dist/utility/logging/harper_logger.d.ts +87 -103
- package/dist/utility/logging/harper_logger.js +177 -82
- package/dist/utility/logging/harper_logger.js.map +1 -1
- package/dist/utility/logging/logRotator.d.ts +2 -10
- package/dist/utility/logging/logRotator.js +67 -32
- package/dist/utility/logging/logRotator.js.map +1 -1
- package/dist/utility/logging/logger.js +4 -4
- package/dist/utility/logging/readLog.d.ts +1 -1
- package/dist/utility/logging/readLog.js +54 -17
- package/dist/utility/logging/readLog.js.map +1 -1
- package/dist/utility/logging/transactionLog.d.ts +2 -2
- package/dist/utility/logging/transactionLog.js +51 -16
- package/dist/utility/logging/transactionLog.js.map +1 -1
- package/dist/utility/mount_hdb.d.ts +1 -2
- package/dist/utility/mount_hdb.js +54 -17
- package/dist/utility/mount_hdb.js.map +1 -1
- package/dist/utility/npmUtilities.d.ts +1 -1
- package/dist/utility/npmUtilities.js +54 -19
- package/dist/utility/npmUtilities.js.map +1 -1
- package/dist/utility/operation_authorization.d.ts +36 -9
- package/dist/utility/operation_authorization.js +135 -86
- package/dist/utility/operation_authorization.js.map +1 -1
- package/dist/utility/packageUtils.d.ts +0 -2
- package/dist/utility/packageUtils.js +7 -17
- package/dist/utility/packageUtils.js.map +1 -1
- package/dist/utility/password.js +2 -2
- package/dist/utility/processManagement/processManagement.js +2 -2
- package/dist/utility/processManagement/servicesConfig.js +1 -1
- package/dist/utility/signalling.d.ts +2 -2
- package/dist/utility/signalling.js +51 -16
- package/dist/utility/signalling.js.map +1 -1
- package/dist/utility/watcherFallback.d.ts +36 -0
- package/dist/utility/watcherFallback.js +73 -0
- package/dist/utility/watcherFallback.js.map +1 -0
- package/dist/validation/analyticsValidator.d.ts +1 -0
- package/dist/validation/analyticsValidator.js +80 -0
- package/dist/validation/analyticsValidator.js.map +1 -0
- package/dist/validation/bulkDeleteValidator.d.ts +1 -2
- package/dist/validation/bulkDeleteValidator.js +49 -11
- package/dist/validation/bulkDeleteValidator.js.map +1 -1
- package/dist/validation/check_permissions.d.ts +1 -2
- package/dist/validation/check_permissions.js +38 -3
- package/dist/validation/check_permissions.js.map +1 -1
- package/dist/validation/common_validators.d.ts +20 -20
- package/dist/validation/common_validators.js +62 -31
- package/dist/validation/common_validators.js.map +1 -1
- package/dist/validation/configValidator.d.ts +4 -4
- package/dist/validation/configValidator.js +189 -54
- package/dist/validation/configValidator.js.map +1 -1
- package/dist/validation/deleteValidator.d.ts +1 -2
- package/dist/validation/deleteValidator.js +49 -11
- package/dist/validation/deleteValidator.js.map +1 -1
- package/dist/validation/fileLoadValidator.d.ts +4 -4
- package/dist/validation/fileLoadValidator.js +67 -32
- package/dist/validation/fileLoadValidator.js.map +1 -1
- package/dist/validation/insertValidator.d.ts +1 -2
- package/dist/validation/insertValidator.js +48 -10
- package/dist/validation/insertValidator.js.map +1 -1
- package/dist/validation/installValidator.d.ts +2 -2
- package/dist/validation/installValidator.js +47 -10
- package/dist/validation/installValidator.js.map +1 -1
- package/dist/validation/readLogValidator.d.ts +1 -2
- package/dist/validation/readLogValidator.js +60 -22
- package/dist/validation/readLogValidator.js.map +1 -1
- package/dist/validation/role_validation.d.ts +3 -3
- package/dist/validation/role_validation.js +55 -19
- package/dist/validation/role_validation.js.map +1 -1
- package/dist/validation/schemaMetadataValidator.d.ts +3 -4
- package/dist/validation/schemaMetadataValidator.js +11 -12
- package/dist/validation/schemaMetadataValidator.js.map +1 -1
- package/dist/validation/searchValidator.d.ts +1 -2
- package/dist/validation/searchValidator.js +82 -43
- package/dist/validation/searchValidator.js.map +1 -1
- package/dist/validation/statusValidator.d.ts +1 -1
- package/dist/validation/transactionLogValidator.d.ts +3 -3
- package/dist/validation/transactionLogValidator.js +52 -17
- package/dist/validation/transactionLogValidator.js.map +1 -1
- package/dist/validation/user_validation.d.ts +3 -3
- package/dist/validation/user_validation.js +38 -6
- package/dist/validation/user_validation.js.map +1 -1
- package/dist/validation/validationWrapper.d.ts +3 -3
- package/dist/validation/validationWrapper.js +4 -5
- package/dist/validation/validationWrapper.js.map +1 -1
- package/index.ts +5 -0
- package/json/systemSchema.json +65 -0
- package/launchServiceScripts/utility/checkNodeVersion.js +2 -0
- package/package.json +38 -24
- package/resources/DESIGN.md +98 -0
- package/resources/DatabaseTransaction.ts +58 -30
- package/resources/ErrorResource.ts +2 -1
- package/resources/LMDBTransaction.ts +38 -29
- package/resources/RecordEncoder.ts +41 -39
- package/resources/RequestTarget.ts +2 -0
- package/resources/Resource.ts +96 -56
- package/resources/ResourceInterface.ts +44 -21
- package/resources/Resources.ts +8 -8
- package/resources/RocksIndexStore.ts +3 -0
- package/resources/RocksTransactionLogStore.ts +13 -4
- package/resources/Table.ts +440 -223
- package/resources/analytics/metadata.ts +1 -0
- package/resources/analytics/read.ts +99 -10
- package/resources/analytics/write.ts +240 -17
- package/resources/auditStore.ts +30 -19
- package/resources/blob.ts +53 -53
- package/resources/dataLoader.ts +4 -4
- package/resources/databases.ts +208 -74
- package/resources/graphql.ts +267 -165
- package/resources/indexes/HierarchicalNavigableSmallWorld.ts +310 -65
- package/resources/indexes/vector.ts +17 -0
- package/resources/jsonSchemaTypes.ts +102 -0
- package/resources/loadEnv.ts +21 -17
- package/resources/login.ts +5 -3
- package/resources/models/Models.ts +304 -0
- package/resources/models/TestBackend.ts +83 -0
- package/resources/models/agentLoop.ts +895 -0
- package/resources/models/analyticsTable.ts +199 -0
- package/resources/models/backendHelpers.ts +116 -0
- package/resources/models/backendRegistry.ts +66 -0
- package/resources/models/bootstrap.ts +135 -0
- package/resources/models/embedHook.ts +138 -0
- package/resources/models/types.ts +296 -0
- package/resources/openApi.ts +65 -31
- package/resources/replayLogs.ts +20 -9
- package/resources/replayLogsGuards.ts +45 -0
- package/resources/roles.ts +62 -67
- package/resources/search.ts +355 -135
- package/resources/tracked.ts +18 -9
- package/resources/transaction.ts +8 -8
- package/resources/transactionBroadcast.ts +3 -3
- package/schema.graphql +7 -0
- package/security/auth.ts +35 -26
- package/security/certificateVerification/crlVerification.ts +11 -4
- package/security/{cryptoHash.js → cryptoHash.ts} +3 -8
- package/security/data_objects/{PermissionAttributeResponseObject.js → PermissionAttributeResponseObject.ts} +4 -4
- package/security/data_objects/{PermissionResponseObject.js → PermissionResponseObject.ts} +12 -11
- package/security/data_objects/{PermissionTableResponseObject.js → PermissionTableResponseObject.ts} +6 -4
- package/security/{fastifyAuth.js → fastifyAuth.ts} +93 -20
- package/security/impersonation.ts +3 -3
- package/security/jsLoader.ts +22 -8
- package/security/{keys.js → keys.ts} +113 -121
- package/security/permissionsTranslator.js +2 -2
- package/security/{role.js → role.ts} +26 -33
- package/security/tokenAuthentication.ts +34 -7
- package/security/user.ts +26 -22
- package/server/DESIGN.md +139 -0
- package/server/DurableSubscriptionsSession.ts +67 -50
- package/server/REST.ts +120 -107
- package/server/Server.ts +31 -12
- package/server/fastifyRoutes/helpers/getCORSOptions.js +1 -1
- package/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js +1 -1
- package/server/fastifyRoutes/helpers/getServerOptions.js +1 -1
- package/server/fastifyRoutes.ts +37 -33
- package/server/graphqlQuerying.ts +6 -5
- package/server/http.ts +517 -26
- package/server/itc/serverHandlers.js +75 -14
- package/server/jobs/{JobObject.js → JobObject.ts} +13 -6
- package/server/jobs/{jobProcess.js → jobProcess.ts} +20 -16
- package/server/jobs/{jobRunner.js → jobRunner.ts} +20 -21
- package/server/jobs/{jobs.js → jobs.ts} +41 -44
- package/server/loadRootComponents.js +1 -1
- package/server/middlewareChain.ts +270 -0
- package/server/mqtt.ts +35 -26
- package/server/nodeName.ts +3 -1
- package/server/operationsServer.ts +85 -10
- package/server/serverHelpers/Headers.ts +10 -8
- package/server/serverHelpers/JSONStream.ts +15 -5
- package/server/serverHelpers/Request.ts +370 -13
- package/server/serverHelpers/contentTypes.ts +42 -11
- package/server/serverHelpers/multipartParser.ts +152 -0
- package/server/serverHelpers/progressEmitter.ts +110 -0
- package/server/serverHelpers/serverHandlers.js +43 -7
- package/server/serverHelpers/serverUtilities.ts +40 -30
- package/server/static.ts +9 -6
- package/server/status/index.ts +2 -2
- package/server/storageReclamation.ts +39 -2
- package/server/threads/itc.js +7 -4
- package/server/threads/manageThreads.js +100 -26
- package/server/threads/socketRouter.ts +12 -275
- package/server/threads/threadServer.js +345 -105
- package/server/threads/workerProcessGuard.ts +93 -0
- package/server/throttle.ts +18 -0
- package/sqlTranslator/{SelectValidator.js → SelectValidator.ts} +41 -49
- package/sqlTranslator/{alasqlFunctionImporter.js → alasqlFunctionImporter.ts} +5 -5
- package/sqlTranslator/{deleteTranslator.js → deleteTranslator.ts} +13 -18
- package/sqlTranslator/{index.js → index.ts} +30 -33
- package/sqlTranslator/{sql_statement_bucket.js → sql_statement_bucket.ts} +49 -20
- package/static/README.md +10 -9
- package/static/defaultConfig.yaml +0 -1
- package/studio/web/assets/{index-CybLScHg.js → index-Dqr9oVhe.js} +5 -5
- package/studio/web/assets/index-Dqr9oVhe.js.map +1 -0
- package/studio/web/assets/{index.lazy-DKx5-iXF.js → index.lazy-CpKcKb7M.js} +2 -2
- package/studio/web/assets/{index.lazy-DKx5-iXF.js.map → index.lazy-CpKcKb7M.js.map} +1 -1
- package/studio/web/assets/{profile-BOjes0Wl.js → profile-C1cujdsg.js} +2 -2
- package/studio/web/assets/{profile-BOjes0Wl.js.map → profile-C1cujdsg.js.map} +1 -1
- package/studio/web/assets/{status-EWKUIrjT.js → status-CTiIIQlY.js} +2 -2
- package/studio/web/assets/{status-EWKUIrjT.js.map → status-CTiIIQlY.js.map} +1 -1
- package/studio/web/index.html +1 -1
- package/upgrade/{UpgradeObjects.js → UpgradeObjects.ts} +3 -6
- package/upgrade/directives/5-1-0.ts +89 -0
- package/upgrade/directives/{directivesController.js → directivesController.ts} +16 -16
- package/upgrade/{directivesManager.js → directivesManager.ts} +7 -11
- package/upgrade/{upgradePrompt.js → upgradePrompt.ts} +6 -54
- package/upgrade/{upgradeUtilities.js → upgradeUtilities.ts} +3 -7
- package/utility/{OperationFunctionCaller.js → OperationFunctionCaller.ts} +7 -7
- package/utility/{assignCmdEnvVariables.js → assignCmdEnvVariables.ts} +6 -8
- package/utility/{common_utils.js → common_utils.ts} +113 -139
- package/utility/environment/{environmentManager.js → environmentManager.ts} +34 -33
- package/utility/environment/systemInformation.ts +18 -4
- package/utility/errors/{commonErrors.js → commonErrors.ts} +9 -9
- package/utility/errors/{hdbError.js → hdbError.ts} +39 -45
- package/utility/expandEnvVar.ts +110 -0
- package/utility/functions/geo.js +2 -2
- package/utility/functions/sql/alaSQLExtension.js +1 -1
- package/utility/globalSchema.ts +30 -0
- package/utility/hdbTerms.ts +54 -1
- package/utility/install/checkJWTTokensExist.js +1 -1
- package/utility/install/{installer.js → installer.ts} +66 -42
- package/utility/installation.ts +2 -2
- package/utility/lmdb/{DBIDefinition.js → DBIDefinition.ts} +4 -1
- package/utility/lmdb/{DeleteRecordsResponseObject.js → DeleteRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/{InsertRecordsResponseObject.js → InsertRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/OpenDBIObject.ts +57 -0
- package/utility/lmdb/{OpenEnvironmentObject.js → OpenEnvironmentObject.ts} +19 -6
- package/utility/lmdb/{UpdateRecordsResponseObject.js → UpdateRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/{UpsertRecordsResponseObject.js → UpsertRecordsResponseObject.ts} +2 -1
- package/utility/lmdb/{cleanLMDBMap.js → cleanLMDBMap.ts} +5 -5
- package/utility/lmdb/{commonUtility.js → commonUtility.ts} +13 -21
- package/utility/lmdb/{deleteUtility.js → deleteUtility.ts} +8 -12
- package/utility/lmdb/{environmentUtility.js → environmentUtility.ts} +43 -52
- package/utility/lmdb/{searchCursorFunctions.js → searchCursorFunctions.ts} +12 -26
- package/utility/lmdb/{searchUtility.js → searchUtility.ts} +75 -64
- package/utility/lmdb/{terms.js → terms.ts} +10 -23
- package/utility/lmdb/{writeUtility.js → writeUtility.ts} +37 -22
- package/utility/logging/{harper_logger.js → harper_logger.ts} +137 -90
- package/utility/logging/{logRotator.js → logRotator.ts} +15 -18
- package/utility/logging/logger.ts +1 -1
- package/utility/logging/{readLog.js → readLog.ts} +19 -19
- package/utility/logging/{transactionLog.js → transactionLog.ts} +10 -14
- package/utility/{mount_hdb.js → mount_hdb.ts} +15 -16
- package/utility/{npmUtilities.js → npmUtilities.ts} +14 -17
- package/utility/{operation_authorization.js → operation_authorization.ts} +173 -124
- package/utility/packageUtils.js +7 -16
- package/utility/password.ts +1 -1
- package/utility/processManagement/processManagement.js +2 -2
- package/utility/processManagement/servicesConfig.js +1 -1
- package/utility/{signalling.js → signalling.ts} +6 -11
- package/utility/watcherFallback.ts +74 -0
- package/validation/analyticsValidator.ts +44 -0
- package/validation/{bulkDeleteValidator.js → bulkDeleteValidator.ts} +5 -5
- package/validation/{check_permissions.js → check_permissions.ts} +3 -3
- package/validation/{common_validators.js → common_validators.ts} +12 -24
- package/validation/{configValidator.js → configValidator.ts} +114 -18
- package/validation/{deleteValidator.js → deleteValidator.ts} +5 -5
- package/validation/{fileLoadValidator.js → fileLoadValidator.ts} +12 -19
- package/validation/{insertValidator.js → insertValidator.ts} +5 -5
- package/validation/{installValidator.js → installValidator.ts} +8 -8
- package/validation/{readLogValidator.js → readLogValidator.ts} +10 -10
- package/validation/{role_validation.js → role_validation.ts} +26 -32
- package/validation/{schemaMetadataValidator.js → schemaMetadataValidator.ts} +5 -11
- package/validation/{searchValidator.js → searchValidator.ts} +12 -11
- package/validation/statusValidator.ts +1 -1
- package/validation/{transactionLogValidator.js → transactionLogValidator.ts} +4 -9
- package/validation/{user_validation.js → user_validation.ts} +4 -10
- package/validation/{validationWrapper.js → validationWrapper.ts} +3 -9
- package/bin/cliOperations.js +0 -159
- package/bin/lite.js +0 -5
- package/dataLayer/harperBridge/BridgeMethods.js +0 -85
- package/studio/web/assets/index-CybLScHg.js.map +0 -1
- package/utility/globalSchema.js +0 -35
- package/utility/lmdb/OpenDBIObject.js +0 -31
package/dist/resources/search.js
CHANGED
|
@@ -4,13 +4,15 @@ exports.COERCIBLE_OPERATORS = void 0;
|
|
|
4
4
|
exports.executeConditions = executeConditions;
|
|
5
5
|
exports.searchByIndex = searchByIndex;
|
|
6
6
|
exports.findAttribute = findAttribute;
|
|
7
|
+
exports.resolveComparator = resolveComparator;
|
|
8
|
+
exports.getNestedValue = getNestedValue;
|
|
7
9
|
exports.filterByType = filterByType;
|
|
8
10
|
exports.estimateCondition = estimateCondition;
|
|
9
11
|
exports.parseQuery = parseQuery;
|
|
10
12
|
exports.flattenKey = flattenKey;
|
|
11
13
|
exports.intersectionEstimate = intersectionEstimate;
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
+
const hdbError_ts_1 = require("../utility/errors/hdbError.js");
|
|
15
|
+
const terms_ts_1 = require("../utility/lmdb/terms.js");
|
|
14
16
|
const ordered_binary_1 = require("ordered-binary");
|
|
15
17
|
const extended_iterable_1 = require("@harperfast/extended-iterable");
|
|
16
18
|
const Table_ts_1 = require("./Table.js");
|
|
@@ -21,6 +23,15 @@ const rocksdb_js_1 = require("@harperfast/rocksdb-js");
|
|
|
21
23
|
const OPEN_RANGE_ESTIMATE = 0.3;
|
|
22
24
|
const BETWEEN_ESTIMATE = 0.1;
|
|
23
25
|
const STARTS_WITH_ESTIMATE = 0.05;
|
|
26
|
+
// Synthetic Table-like object used to recurse through plain JSON nested-path
|
|
27
|
+
// segments. It has no attributes, indices, or property resolvers, so the
|
|
28
|
+
// recursive filterByType call dispatches purely on the comparator.
|
|
29
|
+
const NESTED_PATH_TABLE = Object.freeze({
|
|
30
|
+
attributes: [],
|
|
31
|
+
indices: {},
|
|
32
|
+
primaryKey: null,
|
|
33
|
+
propertyResolvers: null,
|
|
34
|
+
});
|
|
24
35
|
const SYMBOL_OPERATORS = {
|
|
25
36
|
// these are coercing operators
|
|
26
37
|
'<': 'lt',
|
|
@@ -114,16 +125,17 @@ function searchByIndex(searchCondition, transaction, reverse, Table, allowFullSc
|
|
|
114
125
|
let value = searchCondition[1] ?? searchCondition.value;
|
|
115
126
|
const comparator = searchCondition.comparator;
|
|
116
127
|
if (value === undefined && comparator !== 'sort') {
|
|
117
|
-
throw new
|
|
128
|
+
throw new hdbError_ts_1.ClientError(`Search condition for ${attribute_name} must have a value`);
|
|
118
129
|
}
|
|
130
|
+
let needFullScan;
|
|
119
131
|
if (Array.isArray(attribute_name)) {
|
|
120
132
|
const firstAttributeName = attribute_name[0];
|
|
121
133
|
// get the potential relationship attribute
|
|
122
134
|
const attribute = findAttribute(Table.attributes, firstAttributeName);
|
|
123
|
-
if (attribute
|
|
135
|
+
if (attribute?.relationship) {
|
|
124
136
|
// it is a join/relational query
|
|
125
137
|
if (attribute_name.length < 2)
|
|
126
|
-
throw new
|
|
138
|
+
throw new hdbError_ts_1.ClientError('Can not directly query a relational attribute, must query an attribute within the target table');
|
|
127
139
|
const relatedTable = attribute.definition?.tableClass || attribute.elements?.definition?.tableClass;
|
|
128
140
|
const joined = new Map();
|
|
129
141
|
// search the related table
|
|
@@ -131,6 +143,7 @@ function searchByIndex(searchCondition, transaction, reverse, Table, allowFullSc
|
|
|
131
143
|
attribute: attribute_name.length > 2 ? attribute_name.slice(1) : attribute_name[1],
|
|
132
144
|
value,
|
|
133
145
|
comparator,
|
|
146
|
+
negated: searchCondition.negated,
|
|
134
147
|
}, transaction, reverse, relatedTable, allowFullScan, joined);
|
|
135
148
|
if (attribute.relationship.to) {
|
|
136
149
|
// this is one-to-many or many-to-many, so we need to track the filtering of related entries that match
|
|
@@ -161,7 +174,10 @@ function searchByIndex(searchCondition, transaction, reverse, Table, allowFullSc
|
|
|
161
174
|
attribute_name = attribute_name[0];
|
|
162
175
|
}
|
|
163
176
|
else {
|
|
164
|
-
|
|
177
|
+
// Non-relationship nested path (plain JSON path). Phase 1: filter-only —
|
|
178
|
+
// we don't have an index for the nested path, so fall through to a full
|
|
179
|
+
// scan with `filterByType` walking the path on each record.
|
|
180
|
+
needFullScan = true;
|
|
165
181
|
}
|
|
166
182
|
}
|
|
167
183
|
const isPrimaryKey = attribute_name === Table.primaryKey || attribute_name == null;
|
|
@@ -170,86 +186,102 @@ function searchByIndex(searchCondition, transaction, reverse, Table, allowFullSc
|
|
|
170
186
|
let end, inclusiveEnd, exclusiveStart;
|
|
171
187
|
if (value instanceof Date)
|
|
172
188
|
value = value.getTime();
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
// this search needs to be of the form:
|
|
193
|
-
// start: [prefix, null], end: [prefix, MAXIMUM_KEY]
|
|
194
|
-
if (!Array.isArray(value))
|
|
195
|
-
value = [value, null];
|
|
196
|
-
else if (value[value.length - 1] != null)
|
|
197
|
-
value = value.concat(null);
|
|
198
|
-
start = value;
|
|
199
|
-
end = value.slice(0);
|
|
200
|
-
end[end.length - 1] = ordered_binary_1.MAXIMUM_KEY;
|
|
201
|
-
break;
|
|
202
|
-
case 'starts_with':
|
|
203
|
-
start = value.toString();
|
|
204
|
-
end = value + String.fromCharCode(0xffff);
|
|
205
|
-
break;
|
|
206
|
-
case 'between':
|
|
207
|
-
case 'gele':
|
|
208
|
-
case 'gelt':
|
|
209
|
-
case 'gtlt':
|
|
210
|
-
case 'gtle':
|
|
211
|
-
start = value[0];
|
|
212
|
-
if (start instanceof Date)
|
|
213
|
-
start = start.getTime();
|
|
214
|
-
end = value[1];
|
|
215
|
-
if (end instanceof Date)
|
|
216
|
-
end = end.getTime();
|
|
217
|
-
inclusiveEnd = comparator === 'gele' || comparator === 'gtle' || comparator === 'between';
|
|
218
|
-
exclusiveStart = comparator === 'gtlt' || comparator === 'gtle';
|
|
219
|
-
break;
|
|
220
|
-
case 'equals':
|
|
221
|
-
case undefined:
|
|
222
|
-
start = value;
|
|
223
|
-
end = value;
|
|
224
|
-
inclusiveEnd = true;
|
|
225
|
-
break;
|
|
226
|
-
case 'ne':
|
|
227
|
-
if (value === null) {
|
|
228
|
-
// since null is the lowest value in an index, we can treat anything higher as a non-null
|
|
189
|
+
if (searchCondition.negated) {
|
|
190
|
+
// Negated conditions are filter-only in Phase 1: scan the whole index/table
|
|
191
|
+
// and exclude matching rows in the filter. Without overriding the range,
|
|
192
|
+
// the bounded index iteration would only visit *included* rows.
|
|
193
|
+
start = true;
|
|
194
|
+
needFullScan = true;
|
|
195
|
+
}
|
|
196
|
+
else
|
|
197
|
+
switch (ALTERNATE_COMPARATOR_NAMES[comparator] || comparator) {
|
|
198
|
+
case 'lt':
|
|
199
|
+
start = true;
|
|
200
|
+
end = value;
|
|
201
|
+
break;
|
|
202
|
+
case 'le':
|
|
203
|
+
start = true;
|
|
204
|
+
end = value;
|
|
205
|
+
inclusiveEnd = true;
|
|
206
|
+
break;
|
|
207
|
+
case 'gt':
|
|
229
208
|
start = value;
|
|
230
209
|
exclusiveStart = true;
|
|
231
210
|
break;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
211
|
+
case 'ge':
|
|
212
|
+
start = value;
|
|
213
|
+
break;
|
|
214
|
+
case 'prefix': // this is form finding multi-part keys that start with the provided prefix
|
|
215
|
+
// this search needs to be of the form:
|
|
216
|
+
// start: [prefix, null], end: [prefix, MAXIMUM_KEY]
|
|
217
|
+
if (!Array.isArray(value))
|
|
218
|
+
value = [value, null];
|
|
219
|
+
else if (value[value.length - 1] != null)
|
|
220
|
+
value = value.concat(null);
|
|
221
|
+
start = value;
|
|
222
|
+
end = value.slice(0);
|
|
223
|
+
end[end.length - 1] = ordered_binary_1.MAXIMUM_KEY;
|
|
224
|
+
break;
|
|
225
|
+
case 'starts_with':
|
|
226
|
+
start = value.toString();
|
|
227
|
+
end = value + String.fromCharCode(0xffff);
|
|
228
|
+
break;
|
|
229
|
+
case 'between':
|
|
230
|
+
case 'gele':
|
|
231
|
+
case 'gelt':
|
|
232
|
+
case 'gtlt':
|
|
233
|
+
case 'gtle':
|
|
234
|
+
start = value[0];
|
|
235
|
+
if (start instanceof Date)
|
|
236
|
+
start = start.getTime();
|
|
237
|
+
end = value[1];
|
|
238
|
+
if (end instanceof Date)
|
|
239
|
+
end = end.getTime();
|
|
240
|
+
inclusiveEnd =
|
|
241
|
+
comparator === 'gele' || comparator === 'gtle' || comparator === 'between';
|
|
242
|
+
exclusiveStart = comparator === 'gtlt' || comparator === 'gtle';
|
|
243
|
+
break;
|
|
244
|
+
case 'equals':
|
|
245
|
+
case undefined:
|
|
246
|
+
start = value;
|
|
247
|
+
end = value;
|
|
248
|
+
inclusiveEnd = true;
|
|
249
|
+
break;
|
|
250
|
+
case 'in':
|
|
251
|
+
// Phase 1: route through filter — index-merge optimization is a Phase 2 follow-up.
|
|
252
|
+
// `value` is expected to be an array (empty array matches no rows).
|
|
253
|
+
if (!Array.isArray(value))
|
|
254
|
+
throw new hdbError_ts_1.ClientError(`"in" comparator requires an array value`);
|
|
255
|
+
start = true;
|
|
256
|
+
needFullScan = true;
|
|
257
|
+
break;
|
|
258
|
+
case 'ne':
|
|
259
|
+
if (value === null) {
|
|
260
|
+
// since null is the lowest value in an index, we can treat anything higher as a non-null
|
|
261
|
+
start = value;
|
|
262
|
+
exclusiveStart = true;
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
case 'sort': // this is a special case for when we want to get all records for sorting
|
|
266
|
+
case 'contains':
|
|
267
|
+
case 'ends_with':
|
|
268
|
+
// we have to revert to full table scan here
|
|
269
|
+
start = true;
|
|
270
|
+
needFullScan = true;
|
|
271
|
+
break;
|
|
272
|
+
default:
|
|
273
|
+
throw new hdbError_ts_1.ClientError(`Unknown query comparator "${comparator}"`);
|
|
274
|
+
}
|
|
243
275
|
let filter;
|
|
244
|
-
if (typeof start === 'string' && start.length >
|
|
276
|
+
if (typeof start === 'string' && start.length > terms_ts_1.MAX_SEARCH_KEY_LENGTH) {
|
|
245
277
|
// if the key is too long, we need to truncate it and filter the results
|
|
246
|
-
start = start.slice(0,
|
|
278
|
+
start = start.slice(0, terms_ts_1.MAX_SEARCH_KEY_LENGTH) + terms_ts_1.OVERFLOW_MARKER;
|
|
247
279
|
exclusiveStart = false;
|
|
248
280
|
filter = filterByType(searchCondition, Table, null, filtered, isPrimaryKey);
|
|
249
281
|
}
|
|
250
|
-
if (typeof end === 'string' && end.length >
|
|
282
|
+
if (typeof end === 'string' && end.length > terms_ts_1.MAX_SEARCH_KEY_LENGTH) {
|
|
251
283
|
// if the key is too long, we need to truncate it and filter the results
|
|
252
|
-
end = end.slice(0,
|
|
284
|
+
end = end.slice(0, terms_ts_1.MAX_SEARCH_KEY_LENGTH) + terms_ts_1.OVERFLOW_MARKER;
|
|
253
285
|
inclusiveEnd = true;
|
|
254
286
|
filter = filter ?? filterByType(searchCondition, Table, null, filtered, isPrimaryKey);
|
|
255
287
|
}
|
|
@@ -261,19 +293,23 @@ function searchByIndex(searchCondition, transaction, reverse, Table, allowFullSc
|
|
|
261
293
|
exclusiveStart = !inclusiveEnd;
|
|
262
294
|
inclusiveEnd = newEnd;
|
|
263
295
|
}
|
|
264
|
-
|
|
296
|
+
// For negated conditions we need to consider records whose attribute value is
|
|
297
|
+
// missing from the index (e.g. nulls when the index doesn't index nulls), so
|
|
298
|
+
// we bypass the secondary index and iterate over the primary store.
|
|
299
|
+
const skipIndex = searchCondition.negated && index && !isPrimaryKey;
|
|
300
|
+
if (!index || index.isIndexing || needFullScan || (value === null && !index.indexNulls) || skipIndex) {
|
|
265
301
|
// no indexed searching available, need a full scan
|
|
266
302
|
if (allowFullScan === false && !index)
|
|
267
|
-
throw new
|
|
303
|
+
throw new hdbError_ts_1.ClientError(`"${attribute_name}" is not indexed, can not search for this attribute`, 404);
|
|
268
304
|
if (allowFullScan === false && needFullScan)
|
|
269
|
-
throw new
|
|
305
|
+
throw new hdbError_ts_1.ClientError(`Can not use ${comparator || 'equal'} operator without combining with a condition that uses an index, can not search for attribute ${attribute_name}`, 403);
|
|
270
306
|
if (index?.isIndexing)
|
|
271
|
-
throw new
|
|
307
|
+
throw new hdbError_ts_1.ServerError(`"${attribute_name}" is not indexed yet, can not search for this attribute`, 503);
|
|
272
308
|
if (value === null && index && !index.indexNulls)
|
|
273
|
-
throw new
|
|
309
|
+
throw new hdbError_ts_1.ClientError(`"${attribute_name}" is not indexed for nulls, index needs to be rebuilt to search for nulls, can not search for this attribute`, 400);
|
|
274
310
|
filter = filter ?? filterByType(searchCondition, Table, null, filtered, isPrimaryKey);
|
|
275
311
|
if (!filter) {
|
|
276
|
-
throw new
|
|
312
|
+
throw new hdbError_ts_1.ClientError(`Unknown search operator ${searchCondition.comparator}`);
|
|
277
313
|
}
|
|
278
314
|
}
|
|
279
315
|
const rangeOptions = {
|
|
@@ -318,9 +354,9 @@ function searchByIndex(searchCondition, transaction, reverse, Table, allowFullSc
|
|
|
318
354
|
results.hasEntries = true;
|
|
319
355
|
return results;
|
|
320
356
|
}
|
|
321
|
-
else if (index) {
|
|
357
|
+
else if (index && !skipIndex) {
|
|
322
358
|
if (index.customIndex) {
|
|
323
|
-
|
|
359
|
+
const loaded = index.customIndex.search(searchCondition, context).map((entry) => {
|
|
324
360
|
// if the custom index returns an entry with metadata, merge it with the loaded entry
|
|
325
361
|
if (typeof entry === 'object' && entry) {
|
|
326
362
|
const { key, ...otherProps } = entry;
|
|
@@ -337,11 +373,29 @@ function searchByIndex(searchCondition, transaction, reverse, Table, allowFullSc
|
|
|
337
373
|
}
|
|
338
374
|
return entry;
|
|
339
375
|
});
|
|
376
|
+
// Rerank: a quantized index navigates on approximate distances, so for a nearest-neighbor
|
|
377
|
+
// (sort) query, recompute the exact distance from each loaded record's full-precision vector
|
|
378
|
+
// and re-sort — restoring exact ordering and $distance. (lt/le threshold queries still use the
|
|
379
|
+
// index's approximate distance for now; exact threshold filtering needs over-fetch — follow-up.)
|
|
380
|
+
if (index.customIndex.int8 &&
|
|
381
|
+
index.customIndex.exactDistance &&
|
|
382
|
+
comparator === 'sort' &&
|
|
383
|
+
searchCondition.target &&
|
|
384
|
+
typeof attribute_name === 'string') {
|
|
385
|
+
const rescored = loaded.filter((e) => e !== extended_iterable_1.SKIP && e && e.value);
|
|
386
|
+
for (const e of rescored)
|
|
387
|
+
e.distance = index.customIndex.exactDistance(searchCondition, e.value[attribute_name]);
|
|
388
|
+
// comparison-based (not subtraction) so Infinity sentinels for missing vectors
|
|
389
|
+
// sort last without producing NaN (Infinity - Infinity).
|
|
390
|
+
rescored.sort((a, b) => (a.distance === b.distance ? 0 : a.distance < b.distance ? -1 : 1));
|
|
391
|
+
return rescored;
|
|
392
|
+
}
|
|
393
|
+
return loaded;
|
|
340
394
|
}
|
|
341
395
|
return index.getRange(rangeOptions).map(filter
|
|
342
396
|
? function ({ key, value }) {
|
|
343
397
|
let recordMatcher;
|
|
344
|
-
if (typeof key === 'string' && key.length >
|
|
398
|
+
if (typeof key === 'string' && key.length > terms_ts_1.MAX_SEARCH_KEY_LENGTH) {
|
|
345
399
|
// if it is an overflow string, need to get the actual value from the database
|
|
346
400
|
recordMatcher = Table.primaryStore.getSync(value);
|
|
347
401
|
}
|
|
@@ -581,12 +635,59 @@ const ALTERNATE_COMPARATOR_NAMES = {
|
|
|
581
635
|
'ew': 'ends_with',
|
|
582
636
|
'endsWith': 'ends_with',
|
|
583
637
|
'ct': 'contains',
|
|
638
|
+
'includes': 'in',
|
|
584
639
|
'>': 'gt',
|
|
585
640
|
'>=': 'ge',
|
|
586
641
|
'<': 'lt',
|
|
587
642
|
'<=': 'le',
|
|
588
643
|
'...': 'between',
|
|
589
644
|
};
|
|
645
|
+
// Comparators whose value is a list (array) of values. Used to recognize the
|
|
646
|
+
// REST `(v1,v2,...)` value syntax during parsing.
|
|
647
|
+
const LIST_VALUE_COMPARATORS = new Set(['in', 'between']);
|
|
648
|
+
// Base comparators that accept the `not_` prefix to produce a negated form.
|
|
649
|
+
// `not_equal` is an existing alias for `ne` and keeps its existing semantics.
|
|
650
|
+
const NEGATABLE_BASE_COMPARATORS = new Set(['in', 'between', 'starts_with', 'ends_with', 'contains', 'equals']);
|
|
651
|
+
/**
|
|
652
|
+
* Resolve a comparator name to a (possibly stripped) base comparator and a
|
|
653
|
+
* `negated` flag. Existing aliases are preserved as-is — the execution layer
|
|
654
|
+
* resolves them via `ALTERNATE_COMPARATOR_NAMES`. Only the `not_` prefix is
|
|
655
|
+
* stripped here, and only when the base is a recognized negatable comparator
|
|
656
|
+
* and the full name is not itself an existing alias (so `not_equal` keeps its
|
|
657
|
+
* historical mapping to `ne`).
|
|
658
|
+
*/
|
|
659
|
+
function resolveComparator(comparator) {
|
|
660
|
+
if (comparator == null)
|
|
661
|
+
return { comparator, negated: false };
|
|
662
|
+
// Preserve existing aliases (e.g., `not_equal` -> `ne`) — let execution-time
|
|
663
|
+
// alias resolution handle them so we don't change comparator strings stored
|
|
664
|
+
// on the condition object.
|
|
665
|
+
if (ALTERNATE_COMPARATOR_NAMES[comparator])
|
|
666
|
+
return { comparator, negated: false };
|
|
667
|
+
if (typeof comparator === 'string' && comparator.startsWith('not_')) {
|
|
668
|
+
const base = comparator.slice(4);
|
|
669
|
+
const baseResolved = ALTERNATE_COMPARATOR_NAMES[base] || base;
|
|
670
|
+
if (NEGATABLE_BASE_COMPARATORS.has(baseResolved)) {
|
|
671
|
+
return { comparator: base, negated: true };
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return { comparator, negated: false };
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Walk a nested-property path on a record. Returns the value at the path,
|
|
678
|
+
* or undefined if any intermediate property is missing.
|
|
679
|
+
*/
|
|
680
|
+
function getNestedValue(record, path) {
|
|
681
|
+
if (typeof path === 'string')
|
|
682
|
+
return record?.[path];
|
|
683
|
+
let current = record;
|
|
684
|
+
for (let i = 0; i < path.length; i++) {
|
|
685
|
+
if (current == null)
|
|
686
|
+
return undefined;
|
|
687
|
+
current = current[path[i]];
|
|
688
|
+
}
|
|
689
|
+
return current;
|
|
690
|
+
}
|
|
590
691
|
/**
|
|
591
692
|
* Create a filter based on the search condition that can be used to test each supplied record.
|
|
592
693
|
* @param {SearchObject} searchCondition
|
|
@@ -594,6 +695,7 @@ const ALTERNATE_COMPARATOR_NAMES = {
|
|
|
594
695
|
*/
|
|
595
696
|
function filterByType(searchCondition, Table, context, filtered, isPrimaryKey, estimatedIncomingCount) {
|
|
596
697
|
const comparator = searchCondition.comparator;
|
|
698
|
+
const negated = searchCondition.negated;
|
|
597
699
|
let attribute = searchCondition[0] ?? searchCondition.attribute;
|
|
598
700
|
let value = searchCondition[1] ?? searchCondition.value;
|
|
599
701
|
if (Array.isArray(attribute)) {
|
|
@@ -603,9 +705,25 @@ function filterByType(searchCondition, Table, context, filtered, isPrimaryKey, e
|
|
|
603
705
|
attribute = attribute[0];
|
|
604
706
|
else if (attribute.length > 1) {
|
|
605
707
|
const firstAttributeName = attribute[0];
|
|
606
|
-
// get the relationship attribute
|
|
607
|
-
const firstAttribute = findAttribute(Table
|
|
608
|
-
const relatedTable = firstAttribute
|
|
708
|
+
// get the relationship attribute (may be undefined for plain JSON paths)
|
|
709
|
+
const firstAttribute = findAttribute(Table?.attributes, firstAttributeName);
|
|
710
|
+
const relatedTable = firstAttribute?.definition?.tableClass || firstAttribute?.elements?.definition?.tableClass;
|
|
711
|
+
if (!relatedTable) {
|
|
712
|
+
// Plain JSON nested path — walk the path on each record. Array
|
|
713
|
+
// intermediates use `some` semantics (match if any element matches).
|
|
714
|
+
const restAttribute = attribute.length > 2 ? attribute.slice(1) : attribute[1];
|
|
715
|
+
const leafFilter = filterByType({ attribute: restAttribute, value, comparator, negated }, NESTED_PATH_TABLE, context, null, false, estimatedIncomingCount);
|
|
716
|
+
if (!leafFilter)
|
|
717
|
+
return;
|
|
718
|
+
return function nestedRecordFilter(record, entry) {
|
|
719
|
+
const subObject = record?.[firstAttributeName];
|
|
720
|
+
if (subObject == null)
|
|
721
|
+
return leafFilter(undefined, entry);
|
|
722
|
+
if (Array.isArray(subObject))
|
|
723
|
+
return subObject.some((item) => leafFilter(item, entry));
|
|
724
|
+
return leafFilter(subObject, entry);
|
|
725
|
+
};
|
|
726
|
+
}
|
|
609
727
|
// TODO: If this is a relationship, we can potentially make this more efficient by using the index
|
|
610
728
|
// and retrieving the set of matching ids first
|
|
611
729
|
const filterMap = filtered?.[firstAttributeName];
|
|
@@ -613,6 +731,7 @@ function filterByType(searchCondition, Table, context, filtered, isPrimaryKey, e
|
|
|
613
731
|
attribute: attribute.length > 2 ? attribute.slice(1) : attribute[1],
|
|
614
732
|
value,
|
|
615
733
|
comparator,
|
|
734
|
+
negated,
|
|
616
735
|
}, relatedTable, context, filterMap?.[firstAttributeName]?.joined, attribute[1] === relatedTable.primaryKey, estimatedIncomingCount);
|
|
617
736
|
if (!nextFilter)
|
|
618
737
|
return;
|
|
@@ -623,7 +742,7 @@ function filterByType(searchCondition, Table, context, filtered, isPrimaryKey, e
|
|
|
623
742
|
return;
|
|
624
743
|
}
|
|
625
744
|
const resolver = Table.propertyResolvers?.[firstAttributeName];
|
|
626
|
-
if (resolver
|
|
745
|
+
if (resolver?.to)
|
|
627
746
|
nextFilter.to = resolver.to;
|
|
628
747
|
let subIdFilter;
|
|
629
748
|
const getSubObject = (record, entry) => {
|
|
@@ -688,7 +807,7 @@ function filterByType(searchCondition, Table, context, filtered, isPrimaryKey, e
|
|
|
688
807
|
filtered[firstAttributeName] = {
|
|
689
808
|
fromRecord(record) {
|
|
690
809
|
// this is called when selecting the fields to include in results
|
|
691
|
-
const value = getSubObject(record).subObject;
|
|
810
|
+
const value = getSubObject(record, undefined).subObject;
|
|
692
811
|
if (Array.isArray(value))
|
|
693
812
|
return value.filter(nextFilter).map((value) => value[relatedTable.primaryKey]);
|
|
694
813
|
return value;
|
|
@@ -702,22 +821,27 @@ function filterByType(searchCondition, Table, context, filtered, isPrimaryKey, e
|
|
|
702
821
|
}
|
|
703
822
|
if (value instanceof Date)
|
|
704
823
|
value = value.getTime();
|
|
824
|
+
let baseFilter;
|
|
705
825
|
switch (ALTERNATE_COMPARATOR_NAMES[comparator] || comparator) {
|
|
706
|
-
case
|
|
826
|
+
case terms_ts_1.SEARCH_TYPES.EQUALS:
|
|
707
827
|
case undefined:
|
|
708
|
-
|
|
828
|
+
baseFilter = attributeComparator(attribute, (recordValue) => recordValue === value, true);
|
|
829
|
+
break;
|
|
709
830
|
case 'contains':
|
|
710
|
-
|
|
831
|
+
baseFilter = attributeComparator(attribute, (recordValue) => recordValue?.toString().includes(value));
|
|
832
|
+
break;
|
|
711
833
|
case 'ends_with':
|
|
712
|
-
|
|
834
|
+
baseFilter = attributeComparator(attribute, (recordValue) => recordValue?.toString().endsWith(value));
|
|
835
|
+
break;
|
|
713
836
|
case 'starts_with':
|
|
714
|
-
|
|
837
|
+
baseFilter = attributeComparator(attribute, (recordValue) => typeof recordValue === 'string' && recordValue.startsWith(value), true);
|
|
838
|
+
break;
|
|
715
839
|
case 'prefix':
|
|
716
840
|
if (!Array.isArray(value))
|
|
717
841
|
value = [value];
|
|
718
842
|
else if (value[value.length - 1] == null)
|
|
719
843
|
value = value.slice(0, -1);
|
|
720
|
-
|
|
844
|
+
baseFilter = attributeComparator(attribute, (recordValue) => {
|
|
721
845
|
if (!Array.isArray(recordValue))
|
|
722
846
|
return false;
|
|
723
847
|
for (let i = 0, l = value.length; i < l; i++) {
|
|
@@ -726,29 +850,65 @@ function filterByType(searchCondition, Table, context, filtered, isPrimaryKey, e
|
|
|
726
850
|
}
|
|
727
851
|
return true;
|
|
728
852
|
}, true);
|
|
853
|
+
break;
|
|
729
854
|
case 'between':
|
|
855
|
+
case 'gele':
|
|
856
|
+
case 'gtlt':
|
|
857
|
+
case 'gtle':
|
|
858
|
+
case 'gelt': {
|
|
730
859
|
if (value[0] instanceof Date)
|
|
731
860
|
value[0] = value[0].getTime();
|
|
732
861
|
if (value[1] instanceof Date)
|
|
733
862
|
value[1] = value[1].getTime();
|
|
734
|
-
|
|
735
|
-
|
|
863
|
+
const resolvedComparator = ALTERNATE_COMPARATOR_NAMES[comparator] || comparator;
|
|
864
|
+
const startInclusive = resolvedComparator === 'between' || resolvedComparator === 'gele' || resolvedComparator === 'gelt';
|
|
865
|
+
const endInclusive = resolvedComparator === 'between' || resolvedComparator === 'gele' || resolvedComparator === 'gtle';
|
|
866
|
+
baseFilter = attributeComparator(attribute, (recordValue) => {
|
|
867
|
+
const cmpStart = (0, ordered_binary_1.compareKeys)(recordValue, value[0]);
|
|
868
|
+
const cmpEnd = (0, ordered_binary_1.compareKeys)(recordValue, value[1]);
|
|
869
|
+
return (startInclusive ? cmpStart >= 0 : cmpStart > 0) && (endInclusive ? cmpEnd <= 0 : cmpEnd < 0);
|
|
736
870
|
}, true);
|
|
871
|
+
break;
|
|
872
|
+
}
|
|
873
|
+
case 'in': {
|
|
874
|
+
if (!Array.isArray(value))
|
|
875
|
+
throw new hdbError_ts_1.ClientError(`"in" comparator requires an array value`);
|
|
876
|
+
// Cache the Set on the condition so multi-row evaluation reuses it.
|
|
877
|
+
let valueSet = searchCondition.cachedSet;
|
|
878
|
+
if (!valueSet) {
|
|
879
|
+
valueSet = new Set(value.map((v) => (v instanceof Date ? v.getTime() : v)));
|
|
880
|
+
searchCondition.cachedSet = valueSet;
|
|
881
|
+
}
|
|
882
|
+
baseFilter = attributeComparator(attribute, (recordValue) => valueSet.has(recordValue), true);
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
737
885
|
case 'gt':
|
|
738
|
-
|
|
886
|
+
baseFilter = attributeComparator(attribute, (recordValue) => (0, ordered_binary_1.compareKeys)(recordValue, value) > 0);
|
|
887
|
+
break;
|
|
739
888
|
case 'ge':
|
|
740
|
-
|
|
889
|
+
baseFilter = attributeComparator(attribute, (recordValue) => (0, ordered_binary_1.compareKeys)(recordValue, value) >= 0);
|
|
890
|
+
break;
|
|
741
891
|
case 'lt':
|
|
742
|
-
|
|
892
|
+
baseFilter = attributeComparator(attribute, (recordValue) => (0, ordered_binary_1.compareKeys)(recordValue, value) < 0);
|
|
893
|
+
break;
|
|
743
894
|
case 'le':
|
|
744
|
-
|
|
895
|
+
baseFilter = attributeComparator(attribute, (recordValue) => (0, ordered_binary_1.compareKeys)(recordValue, value) <= 0);
|
|
896
|
+
break;
|
|
745
897
|
case 'ne':
|
|
746
|
-
|
|
898
|
+
baseFilter = attributeComparator(attribute, (recordValue) => (0, ordered_binary_1.compareKeys)(recordValue, value) !== 0, false, true);
|
|
899
|
+
break;
|
|
747
900
|
case 'sort':
|
|
748
901
|
return () => true;
|
|
749
902
|
default:
|
|
750
|
-
throw new
|
|
903
|
+
throw new hdbError_ts_1.ClientError(`Unknown query comparator "${comparator}"`);
|
|
751
904
|
}
|
|
905
|
+
if (negated && baseFilter) {
|
|
906
|
+
// Wrap with negation. Internal index-optimization state on `baseFilter`
|
|
907
|
+
// (idFilter, to, etc.) is intentionally not propagated through the
|
|
908
|
+
// negation wrapper — negated conditions are filter-only in Phase 1.
|
|
909
|
+
return (record, entry) => !baseFilter(record, entry);
|
|
910
|
+
}
|
|
911
|
+
return baseFilter;
|
|
752
912
|
/** Create a comparison function that can take the record and check the attribute's value with the filter function */
|
|
753
913
|
function attributeComparator(attribute, filter, canUseIndex, allowObjectMatching) {
|
|
754
914
|
let thresholdRemainingMisses;
|
|
@@ -768,7 +928,9 @@ function filterByType(searchCondition, Table, context, filtered, isPrimaryKey, e
|
|
|
768
928
|
let misses = 0;
|
|
769
929
|
let filteredSoFar = 3; // what we use to calculate miss rate; we give some buffer so we don't jump to indexed retrieval too quickly
|
|
770
930
|
function recordFilter(record) {
|
|
771
|
-
|
|
931
|
+
// `record` may be null/undefined when called via a nested-path filter
|
|
932
|
+
// where an intermediate property is missing.
|
|
933
|
+
const value = record == null ? undefined : record[attribute];
|
|
772
934
|
let matches;
|
|
773
935
|
if (typeof value !== 'object' || !value || allowObjectMatching)
|
|
774
936
|
matches = filter(value);
|
|
@@ -840,26 +1002,32 @@ function estimateCondition(table) {
|
|
|
840
1002
|
// skip if it is cached
|
|
841
1003
|
let searchType = condition.comparator || condition.search_type;
|
|
842
1004
|
searchType = ALTERNATE_COMPARATOR_NAMES[searchType] || searchType;
|
|
843
|
-
if (searchType ===
|
|
1005
|
+
if (searchType === terms_ts_1.SEARCH_TYPES.EQUALS || !searchType) {
|
|
844
1006
|
const attribute_name = condition[0] ?? condition.attribute;
|
|
845
1007
|
if (attribute_name == null || attribute_name === table.primaryKey)
|
|
846
1008
|
condition.estimated_count = 1;
|
|
847
1009
|
else if (Array.isArray(attribute_name) && attribute_name.length > 1) {
|
|
848
1010
|
const attribute = findAttribute(table.attributes, attribute_name[0]);
|
|
849
|
-
const relatedTable = attribute
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
1011
|
+
const relatedTable = attribute?.definition?.tableClass || attribute?.elements?.definition?.tableClass;
|
|
1012
|
+
if (!relatedTable) {
|
|
1013
|
+
// Plain JSON nested path — no index, can't estimate cheaply.
|
|
1014
|
+
condition.estimated_count = Infinity;
|
|
1015
|
+
}
|
|
1016
|
+
else {
|
|
1017
|
+
const estimate = estimateCondition(relatedTable)({
|
|
1018
|
+
value: condition.value,
|
|
1019
|
+
attribute: attribute_name.length > 2 ? attribute_name.slice(1) : attribute_name[1],
|
|
1020
|
+
comparator: 'equals',
|
|
1021
|
+
});
|
|
1022
|
+
const fromIndex = table.indices[attribute.relationship?.from];
|
|
1023
|
+
// the estimated count is sum of the estimate of the related table and the estimate of the index
|
|
1024
|
+
condition.estimated_count =
|
|
1025
|
+
estimate +
|
|
1026
|
+
(fromIndex
|
|
1027
|
+
? (estimate * estimatedEntryCount(table.indices[attribute.relationship.from])) /
|
|
1028
|
+
(estimatedEntryCount(relatedTable.primaryStore) || 1)
|
|
1029
|
+
: estimate);
|
|
1030
|
+
}
|
|
863
1031
|
}
|
|
864
1032
|
else {
|
|
865
1033
|
// we only attempt to estimate count on equals operator because that's really all that LMDB supports (some other key-value stores like libmdbx could be considered if we need to do estimated counts of ranges at some point)
|
|
@@ -876,6 +1044,23 @@ function estimateCondition(table) {
|
|
|
876
1044
|
}
|
|
877
1045
|
else
|
|
878
1046
|
condition.estimated_count = Infinity;
|
|
1047
|
+
}
|
|
1048
|
+
else if (searchType === 'in') {
|
|
1049
|
+
const attribute_name = condition[0] ?? condition.attribute;
|
|
1050
|
+
const index = table.indices[attribute_name];
|
|
1051
|
+
if (Array.isArray(condition.value) && index) {
|
|
1052
|
+
// Sum of per-value matches (over-counts duplicates but is a fine ceiling)
|
|
1053
|
+
let estimate = 0;
|
|
1054
|
+
for (const item of condition.value) {
|
|
1055
|
+
estimate += index.getValuesCount(item);
|
|
1056
|
+
}
|
|
1057
|
+
condition.estimated_count = estimate;
|
|
1058
|
+
}
|
|
1059
|
+
else if (Array.isArray(condition.value)) {
|
|
1060
|
+
condition.estimated_count = Infinity;
|
|
1061
|
+
}
|
|
1062
|
+
else
|
|
1063
|
+
condition.estimated_count = Infinity;
|
|
879
1064
|
// for range queries (betweens, startsWith, greater, etc.), just arbitrarily guess
|
|
880
1065
|
}
|
|
881
1066
|
else if (searchType === 'starts_with' || searchType === 'prefix')
|
|
@@ -909,11 +1094,12 @@ function estimateCondition(table) {
|
|
|
909
1094
|
}
|
|
910
1095
|
return estimateConditionForTable;
|
|
911
1096
|
}
|
|
912
|
-
class SyntaxViolation extends
|
|
1097
|
+
class SyntaxViolation extends hdbError_ts_1.Violation {
|
|
913
1098
|
}
|
|
914
1099
|
const NEEDS_PARSER = /[()[\]|!<>.]|(=\w*=)/;
|
|
915
1100
|
const QUERY_PARSER = /([^?&|=<>!([{}\]),]*)([([{}\])|,&]|[=<>!]*)/g;
|
|
916
1101
|
const VALUE_PARSER = /([^&|=[\]{}]+)([[\]{}]|[&|=]*)/g;
|
|
1102
|
+
const FIQL_OPERATOR_NAME = /^[a-zA-Z_][a-zA-Z_0-9]*$/;
|
|
917
1103
|
let lastIndex;
|
|
918
1104
|
let currentQuery;
|
|
919
1105
|
let queryString;
|
|
@@ -986,8 +1172,10 @@ function parseBlock(query, expectedEnd) {
|
|
|
986
1172
|
switch (operator) {
|
|
987
1173
|
case '=':
|
|
988
1174
|
if (attribute != undefined) {
|
|
989
|
-
//
|
|
990
|
-
|
|
1175
|
+
// FIQL operator like =gt= or =starts_with= — accept any identifier
|
|
1176
|
+
// (letters, digits, underscores). Unknown comparator names are
|
|
1177
|
+
// caught at execution time with a clearer error.
|
|
1178
|
+
if (FIQL_OPERATOR_NAME.test(value))
|
|
991
1179
|
comparator = value;
|
|
992
1180
|
else
|
|
993
1181
|
recordError(`invalid FIQL operator ${value}`);
|
|
@@ -1034,13 +1222,7 @@ function parseBlock(query, expectedEnd) {
|
|
|
1034
1222
|
else {
|
|
1035
1223
|
if (!query.conditions)
|
|
1036
1224
|
recordError('conditions/comparisons are not allowed in a property list');
|
|
1037
|
-
const condition =
|
|
1038
|
-
comparator,
|
|
1039
|
-
attribute: attribute || null,
|
|
1040
|
-
value: valueDecoder(value),
|
|
1041
|
-
};
|
|
1042
|
-
if (comparator === 'eq')
|
|
1043
|
-
wildcardDecoding(condition, value);
|
|
1225
|
+
const condition = buildCondition(attribute, comparator, value, valueDecoder);
|
|
1044
1226
|
if (attribute === '') {
|
|
1045
1227
|
// this is a nested condition
|
|
1046
1228
|
const lastCondition = query.conditions[query.conditions.length - 1];
|
|
@@ -1186,13 +1368,7 @@ function parseBlock(query, expectedEnd) {
|
|
|
1186
1368
|
if (query.conditions) {
|
|
1187
1369
|
// finish condition
|
|
1188
1370
|
if (attribute) {
|
|
1189
|
-
const condition =
|
|
1190
|
-
comparator: comparator || 'equals',
|
|
1191
|
-
attribute,
|
|
1192
|
-
value: valueDecoder(value),
|
|
1193
|
-
};
|
|
1194
|
-
if (comparator === 'eq')
|
|
1195
|
-
wildcardDecoding(condition, value);
|
|
1371
|
+
const condition = buildCondition(attribute, comparator || 'equals', value, valueDecoder);
|
|
1196
1372
|
assignOperator(query, lastBinaryOperator);
|
|
1197
1373
|
query.conditions.push(condition);
|
|
1198
1374
|
}
|
|
@@ -1256,7 +1432,7 @@ function typedDecoding(value) {
|
|
|
1256
1432
|
else if (type === 'string')
|
|
1257
1433
|
return decodeURIComponent(valueToCoerce);
|
|
1258
1434
|
else
|
|
1259
|
-
throw new
|
|
1435
|
+
throw new hdbError_ts_1.ClientError(`Unknown type ${type}`);
|
|
1260
1436
|
}
|
|
1261
1437
|
return decodeURIComponent(value);
|
|
1262
1438
|
}
|
|
@@ -1272,10 +1448,43 @@ function wildcardDecoding(condition, value) {
|
|
|
1272
1448
|
condition.value = decodeURIComponent(value.slice(0, -1));
|
|
1273
1449
|
}
|
|
1274
1450
|
else {
|
|
1275
|
-
throw new
|
|
1451
|
+
throw new hdbError_ts_1.ClientError('wildcard can only be used at the end of a string');
|
|
1276
1452
|
}
|
|
1277
1453
|
}
|
|
1278
1454
|
}
|
|
1455
|
+
/**
|
|
1456
|
+
* Build a condition from a parsed attribute, raw comparator name, raw value
|
|
1457
|
+
* string, and the value decoder for the operator. Centralizes:
|
|
1458
|
+
* - alias resolution and `not_` prefix handling (for `negated`)
|
|
1459
|
+
* - `(v1,v2,...)` list-value syntax for list-taking comparators
|
|
1460
|
+
* - wildcard detection on `eq` (typed-equality)
|
|
1461
|
+
*/
|
|
1462
|
+
function buildCondition(attribute, rawComparator, rawValue, valueDecoder) {
|
|
1463
|
+
const { comparator: resolvedComparator, negated } = resolveComparator(rawComparator);
|
|
1464
|
+
let value;
|
|
1465
|
+
if (LIST_VALUE_COMPARATORS.has(resolvedComparator) &&
|
|
1466
|
+
rawValue.length >= 2 &&
|
|
1467
|
+
rawValue.charCodeAt(0) === 0x28 /* ( */ &&
|
|
1468
|
+
rawValue.charCodeAt(rawValue.length - 1) === 0x29 /* ) */) {
|
|
1469
|
+
// `(v1,v2,...)` list-value syntax. Each element is decoded individually.
|
|
1470
|
+
const inner = rawValue.slice(1, -1);
|
|
1471
|
+
value = inner.length === 0 ? [] : inner.split(',').map(valueDecoder);
|
|
1472
|
+
}
|
|
1473
|
+
else {
|
|
1474
|
+
value = valueDecoder(rawValue);
|
|
1475
|
+
}
|
|
1476
|
+
const condition = {
|
|
1477
|
+
comparator: resolvedComparator,
|
|
1478
|
+
attribute: attribute || null,
|
|
1479
|
+
value,
|
|
1480
|
+
};
|
|
1481
|
+
if (negated)
|
|
1482
|
+
condition.negated = true;
|
|
1483
|
+
// preserve existing wildcard behavior on coercive equality
|
|
1484
|
+
if (rawComparator === 'eq')
|
|
1485
|
+
wildcardDecoding(condition, rawValue);
|
|
1486
|
+
return condition;
|
|
1487
|
+
}
|
|
1279
1488
|
function toSortObject(sort) {
|
|
1280
1489
|
const sortObject = toSortEntry(sort[0]);
|
|
1281
1490
|
if (sort.length > 1) {
|