@harperfast/harper-pro 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/analytics/profile.ts +4 -0
- package/core/AGENTS.md +94 -6
- package/core/DESIGN.md +36 -0
- package/core/README.md +11 -10
- package/core/agent/agent.ts +203 -0
- package/core/agent/loop.ts +205 -0
- package/core/agent/operations.ts +148 -0
- package/core/agent/session.ts +187 -0
- package/core/agent/tools/fsTools.ts +276 -0
- package/core/agent/tools/httpFetchTool.ts +112 -0
- package/core/agent/tools/scheduleTool.ts +68 -0
- package/core/agent/toolset.ts +43 -0
- package/core/agent/types.ts +85 -0
- package/core/benchmarks/hnsw-search.js +157 -0
- package/core/benchmarks/ycsb/README.md +144 -0
- package/core/benchmarks/ycsb/analyze-profile.mts +120 -0
- package/core/benchmarks/ycsb/app/config.yaml +3 -0
- package/core/benchmarks/ycsb/app/schema.graphql +17 -0
- package/core/benchmarks/ycsb/harness.mts +328 -0
- package/core/benchmarks/ycsb/restClient.mts +120 -0
- package/core/benchmarks/ycsb/run-single-node.mts +97 -0
- package/core/benchmarks/ycsb/to-benchmark-json.mts +58 -0
- package/core/benchmarks/ycsb/workload.mts +499 -0
- package/core/benchmarks/ycsb/workload.test.mts +174 -0
- package/core/bin/{BinObjects.js → BinObjects.ts} +4 -5
- package/core/bin/cliCredentials.ts +133 -0
- package/core/bin/cliOperations.ts +339 -0
- package/core/bin/copyDb.ts +10 -10
- package/core/bin/deployRenderer.ts +196 -0
- package/core/bin/{harper.js → harper.ts} +48 -24
- package/core/bin/{install.js → install.ts} +3 -3
- package/core/bin/lite.ts +2 -0
- package/core/bin/login.ts +134 -0
- package/core/bin/logout.ts +11 -0
- package/core/bin/mcp/client.ts +407 -0
- package/core/bin/mcp/doctor.ts +189 -0
- package/core/bin/mcp/index.ts +80 -0
- package/core/bin/mcp/options.ts +122 -0
- package/core/bin/mcp/printConfig.ts +89 -0
- package/core/bin/multipartBuilder.ts +74 -0
- package/core/bin/{restart.js → restart.ts} +31 -32
- package/core/bin/{run.js → run.ts} +57 -46
- package/core/bin/sseConsumer.ts +126 -0
- package/core/bin/{status.js → status.ts} +10 -10
- package/core/bin/stop.ts +21 -0
- package/core/bin/upgrade.js +17 -24
- package/core/components/Application.ts +144 -18
- package/core/components/ApplicationScope.ts +2 -2
- package/core/components/ComponentV1.ts +2 -2
- package/core/components/EntryHandler.ts +159 -9
- package/core/components/OptionsWatcher.ts +75 -11
- package/core/components/Scope.ts +132 -18
- package/core/components/anthropic/index.ts +547 -0
- package/core/components/bedrock/index.ts +823 -0
- package/core/components/componentLoader.ts +64 -32
- package/core/components/deployLifecycle.ts +161 -0
- package/core/components/deploymentOperations.ts +173 -0
- package/core/components/deploymentRecorder.ts +427 -0
- package/core/components/deriveURLPath.ts +4 -4
- package/core/components/mcp/adapters/fastify.ts +87 -0
- package/core/components/mcp/adapters/harperHttp.ts +103 -0
- package/core/components/mcp/audit.ts +75 -0
- package/core/components/mcp/index.ts +134 -0
- package/core/components/mcp/jsonrpc.ts +134 -0
- package/core/components/mcp/lifecycle.ts +105 -0
- package/core/components/mcp/listChanged.ts +270 -0
- package/core/components/mcp/rateLimit.ts +217 -0
- package/core/components/mcp/resources.ts +607 -0
- package/core/components/mcp/session.ts +151 -0
- package/core/components/mcp/sessionRegistry.ts +140 -0
- package/core/components/mcp/toolRegistry.ts +294 -0
- package/core/components/mcp/tools/application.ts +761 -0
- package/core/components/mcp/tools/operations.ts +311 -0
- package/core/components/mcp/tools/schemas/derive.ts +356 -0
- package/core/components/mcp/tools/schemas/operationDescriptions.ts +241 -0
- package/core/components/mcp/tools/schemas/operations.ts +301 -0
- package/core/components/mcp/transport.ts +517 -0
- package/core/components/ollama/index.ts +316 -0
- package/core/components/openai/index.ts +563 -0
- package/core/components/operations.js +217 -60
- package/core/components/operationsValidation.js +12 -4
- package/core/components/packageComponent.ts +97 -29
- package/core/components/requestRestart.ts +17 -2
- package/core/components/status/crossThread.ts +14 -5
- package/core/components/status/errors.ts +1 -1
- package/core/config/RootConfigWatcher.ts +56 -2
- package/core/config/configUtils.js +29 -8
- package/core/config/harperConfigEnvVars.ts +1 -1
- package/core/dataLayer/{CreateAttributeObject.js → CreateAttributeObject.ts} +4 -3
- package/core/dataLayer/{CreateTableObject.js → CreateTableObject.ts} +2 -1
- package/core/dataLayer/{DataLayerObjects.js → DataLayerObjects.ts} +17 -9
- package/core/dataLayer/{DeleteBeforeObject.js → DeleteBeforeObject.ts} +2 -1
- package/core/dataLayer/{DeleteObject.js → DeleteObject.ts} +3 -2
- package/core/dataLayer/{DropAttributeObject.js → DropAttributeObject.ts} +2 -1
- package/core/dataLayer/{GetBackupObject.js → GetBackupObject.ts} +3 -2
- package/core/dataLayer/{InsertObject.js → InsertObject.ts} +3 -2
- package/core/dataLayer/{ReadAuditLogObject.js → ReadAuditLogObject.ts} +3 -2
- package/core/dataLayer/{SQLSearch.js → SQLSearch.ts} +97 -43
- package/core/dataLayer/{SearchByConditionsObject.js → SearchByConditionsObject.ts} +5 -6
- package/core/dataLayer/{SearchByHashObject.js → SearchByHashObject.ts} +2 -1
- package/core/dataLayer/{SearchObject.js → SearchObject.ts} +2 -1
- package/core/dataLayer/{SqlSearchObject.js → SqlSearchObject.ts} +2 -1
- package/core/dataLayer/{UpdateObject.js → UpdateObject.ts} +3 -2
- package/core/dataLayer/{UpsertObject.js → UpsertObject.ts} +3 -2
- package/core/dataLayer/{bulkLoad.js → bulkLoad.ts} +40 -49
- package/core/dataLayer/{delete.js → delete.ts} +21 -26
- package/core/dataLayer/{export.js → export.ts} +22 -26
- package/core/dataLayer/{getBackup.js → getBackup.ts} +7 -9
- package/core/dataLayer/harperBridge/BridgeMethods.ts +102 -0
- package/core/dataLayer/harperBridge/ResourceBridge.ts +27 -26
- package/core/dataLayer/harperBridge/TableSizeObject.ts +1 -0
- package/core/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js +4 -4
- package/core/dataLayer/harperBridge/{harperBridge.js → harperBridge.ts} +3 -3
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js +8 -6
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js +4 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js +1 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js +6 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js +5 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js +4 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js +6 -5
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js +5 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js +5 -5
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js +1 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js +3 -3
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js +1 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js +3 -2
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js +5 -5
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js +10 -8
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js +1 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js +4 -3
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js +3 -3
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js +6 -5
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js +2 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js +3 -2
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +2 -2
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js +5 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js +6 -3
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.ts +1 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js +4 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js +5 -5
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js +4 -4
- package/core/dataLayer/{hdbInfoController.js → hdbInfoController.ts} +20 -26
- package/core/dataLayer/{insert.js → insert.ts} +24 -24
- package/core/dataLayer/{readAuditLog.js → readAuditLog.ts} +8 -10
- package/core/dataLayer/{schema.js → schema.ts} +32 -44
- package/core/dataLayer/{schemaDescribe.js → schemaDescribe.ts} +23 -26
- package/core/dataLayer/{search.js → search.ts} +9 -15
- package/core/dataLayer/{transaction.js → transaction.ts} +2 -5
- package/core/dataLayer/{update.js → update.ts} +19 -22
- package/core/index.ts +5 -0
- package/core/json/systemSchema.json +65 -0
- package/core/launchServiceScripts/utility/checkNodeVersion.js +2 -0
- package/core/package-lock.json +9087 -4345
- package/core/resources/DESIGN.md +98 -0
- package/core/resources/DatabaseTransaction.ts +58 -30
- package/core/resources/ErrorResource.ts +2 -1
- package/core/resources/LMDBTransaction.ts +38 -29
- package/core/resources/RecordEncoder.ts +41 -39
- package/core/resources/RequestTarget.ts +2 -0
- package/core/resources/Resource.ts +96 -56
- package/core/resources/ResourceInterface.ts +44 -21
- package/core/resources/Resources.ts +8 -8
- package/core/resources/RocksIndexStore.ts +3 -0
- package/core/resources/RocksTransactionLogStore.ts +13 -4
- package/core/resources/Table.ts +440 -223
- package/core/resources/analytics/metadata.ts +1 -0
- package/core/resources/analytics/read.ts +99 -10
- package/core/resources/analytics/write.ts +240 -17
- package/core/resources/auditStore.ts +30 -19
- package/core/resources/blob.ts +53 -53
- package/core/resources/dataLoader.ts +4 -4
- package/core/resources/databases.ts +208 -74
- package/core/resources/graphql.ts +267 -165
- package/core/resources/indexes/HierarchicalNavigableSmallWorld.ts +310 -65
- package/core/resources/indexes/vector.ts +17 -0
- package/core/resources/jsonSchemaTypes.ts +102 -0
- package/core/resources/loadEnv.ts +21 -17
- package/core/resources/login.ts +5 -3
- package/core/resources/models/Models.ts +304 -0
- package/core/resources/models/TestBackend.ts +83 -0
- package/core/resources/models/agentLoop.ts +895 -0
- package/core/resources/models/analyticsTable.ts +199 -0
- package/core/resources/models/backendHelpers.ts +116 -0
- package/core/resources/models/backendRegistry.ts +66 -0
- package/core/resources/models/bootstrap.ts +135 -0
- package/core/resources/models/embedHook.ts +138 -0
- package/core/resources/models/types.ts +296 -0
- package/core/resources/openApi.ts +65 -31
- package/core/resources/replayLogs.ts +20 -9
- package/core/resources/replayLogsGuards.ts +45 -0
- package/core/resources/roles.ts +62 -67
- package/core/resources/search.ts +355 -135
- package/core/resources/tracked.ts +18 -9
- package/core/resources/transaction.ts +8 -8
- package/core/resources/transactionBroadcast.ts +3 -3
- package/core/security/auth.ts +35 -26
- package/core/security/certificateVerification/crlVerification.ts +11 -4
- package/core/security/{cryptoHash.js → cryptoHash.ts} +3 -8
- package/core/security/data_objects/{PermissionAttributeResponseObject.js → PermissionAttributeResponseObject.ts} +4 -4
- package/core/security/data_objects/{PermissionResponseObject.js → PermissionResponseObject.ts} +12 -11
- package/core/security/data_objects/{PermissionTableResponseObject.js → PermissionTableResponseObject.ts} +6 -4
- package/core/security/{fastifyAuth.js → fastifyAuth.ts} +93 -20
- package/core/security/impersonation.ts +3 -3
- package/core/security/jsLoader.ts +22 -8
- package/core/security/{keys.js → keys.ts} +113 -121
- package/core/security/permissionsTranslator.js +2 -2
- package/core/security/{role.js → role.ts} +26 -33
- package/core/security/tokenAuthentication.ts +34 -7
- package/core/security/user.ts +26 -22
- package/core/server/DESIGN.md +139 -0
- package/core/server/DurableSubscriptionsSession.ts +67 -50
- package/core/server/REST.ts +120 -107
- package/core/server/Server.ts +31 -12
- package/core/server/fastifyRoutes/helpers/getCORSOptions.js +1 -1
- package/core/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js +1 -1
- package/core/server/fastifyRoutes/helpers/getServerOptions.js +1 -1
- package/core/server/fastifyRoutes.ts +37 -33
- package/core/server/graphqlQuerying.ts +6 -5
- package/core/server/http.ts +517 -26
- package/core/server/itc/serverHandlers.js +75 -14
- package/core/server/jobs/{JobObject.js → JobObject.ts} +13 -6
- package/core/server/jobs/{jobProcess.js → jobProcess.ts} +20 -16
- package/core/server/jobs/{jobRunner.js → jobRunner.ts} +20 -21
- package/core/server/jobs/{jobs.js → jobs.ts} +41 -44
- package/core/server/loadRootComponents.js +1 -1
- package/core/server/middlewareChain.ts +270 -0
- package/core/server/mqtt.ts +35 -26
- package/core/server/nodeName.ts +3 -1
- package/core/server/operationsServer.ts +85 -10
- package/core/server/serverHelpers/Headers.ts +10 -8
- package/core/server/serverHelpers/JSONStream.ts +15 -5
- package/core/server/serverHelpers/Request.ts +370 -13
- package/core/server/serverHelpers/contentTypes.ts +42 -11
- package/core/server/serverHelpers/multipartParser.ts +152 -0
- package/core/server/serverHelpers/progressEmitter.ts +110 -0
- package/core/server/serverHelpers/serverHandlers.js +43 -7
- package/core/server/serverHelpers/serverUtilities.ts +40 -30
- package/core/server/static.ts +9 -6
- package/core/server/status/index.ts +2 -2
- package/core/server/storageReclamation.ts +39 -2
- package/core/server/threads/itc.js +7 -4
- package/core/server/threads/manageThreads.js +100 -26
- package/core/server/threads/socketRouter.ts +12 -275
- package/core/server/threads/threadServer.js +345 -105
- package/core/server/threads/workerProcessGuard.ts +93 -0
- package/core/server/throttle.ts +18 -0
- package/core/sqlTranslator/{SelectValidator.js → SelectValidator.ts} +41 -49
- package/core/sqlTranslator/{alasqlFunctionImporter.js → alasqlFunctionImporter.ts} +5 -5
- package/core/sqlTranslator/{deleteTranslator.js → deleteTranslator.ts} +13 -18
- package/core/sqlTranslator/{index.js → index.ts} +30 -33
- package/core/sqlTranslator/{sql_statement_bucket.js → sql_statement_bucket.ts} +49 -20
- package/core/static/README.md +10 -9
- package/core/static/defaultConfig.yaml +0 -1
- package/core/system/000004.log +0 -0
- package/core/system/CURRENT +1 -0
- package/core/system/IDENTITY +1 -0
- package/core/system/LOCK +0 -0
- package/core/system/LOG +1351 -0
- package/core/system/MANIFEST-000005 +0 -0
- package/core/system/OPTIONS-000013 +607 -0
- package/core/system/OPTIONS-000015 +734 -0
- package/core/upgrade/{UpgradeObjects.js → UpgradeObjects.ts} +3 -6
- package/core/upgrade/directives/5-1-0.ts +89 -0
- package/core/upgrade/directives/{directivesController.js → directivesController.ts} +16 -16
- package/core/upgrade/{directivesManager.js → directivesManager.ts} +7 -11
- package/core/upgrade/{upgradePrompt.js → upgradePrompt.ts} +6 -54
- package/core/upgrade/{upgradeUtilities.js → upgradeUtilities.ts} +3 -7
- package/core/utility/{OperationFunctionCaller.js → OperationFunctionCaller.ts} +7 -7
- package/core/utility/{assignCmdEnvVariables.js → assignCmdEnvVariables.ts} +6 -8
- package/core/utility/{common_utils.js → common_utils.ts} +113 -139
- package/core/utility/environment/{environmentManager.js → environmentManager.ts} +34 -33
- package/core/utility/environment/systemInformation.ts +18 -4
- package/core/utility/errors/{commonErrors.js → commonErrors.ts} +9 -9
- package/core/utility/errors/{hdbError.js → hdbError.ts} +39 -45
- package/core/utility/expandEnvVar.ts +110 -0
- package/core/utility/functions/geo.js +2 -2
- package/core/utility/functions/sql/alaSQLExtension.js +1 -1
- package/core/utility/globalSchema.ts +30 -0
- package/core/utility/hdbTerms.ts +54 -1
- package/core/utility/install/checkJWTTokensExist.js +1 -1
- package/core/utility/install/{installer.js → installer.ts} +86 -62
- package/core/utility/installation.ts +2 -2
- package/core/utility/lmdb/{DBIDefinition.js → DBIDefinition.ts} +4 -1
- package/core/utility/lmdb/{DeleteRecordsResponseObject.js → DeleteRecordsResponseObject.ts} +2 -1
- package/core/utility/lmdb/{InsertRecordsResponseObject.js → InsertRecordsResponseObject.ts} +2 -1
- package/core/utility/lmdb/OpenDBIObject.ts +57 -0
- package/core/utility/lmdb/{OpenEnvironmentObject.js → OpenEnvironmentObject.ts} +19 -6
- package/core/utility/lmdb/{UpdateRecordsResponseObject.js → UpdateRecordsResponseObject.ts} +2 -1
- package/core/utility/lmdb/{UpsertRecordsResponseObject.js → UpsertRecordsResponseObject.ts} +2 -1
- package/core/utility/lmdb/{cleanLMDBMap.js → cleanLMDBMap.ts} +5 -5
- package/core/utility/lmdb/{commonUtility.js → commonUtility.ts} +13 -21
- package/core/utility/lmdb/{deleteUtility.js → deleteUtility.ts} +8 -12
- package/core/utility/lmdb/{environmentUtility.js → environmentUtility.ts} +43 -52
- package/core/utility/lmdb/{searchCursorFunctions.js → searchCursorFunctions.ts} +12 -26
- package/core/utility/lmdb/{searchUtility.js → searchUtility.ts} +75 -64
- package/core/utility/lmdb/{terms.js → terms.ts} +10 -23
- package/core/utility/lmdb/{writeUtility.js → writeUtility.ts} +37 -22
- package/core/utility/logging/{harper_logger.js → harper_logger.ts} +137 -90
- package/core/utility/logging/{logRotator.js → logRotator.ts} +15 -18
- package/core/utility/logging/logger.ts +1 -1
- package/core/utility/logging/{readLog.js → readLog.ts} +19 -19
- package/core/utility/logging/{transactionLog.js → transactionLog.ts} +10 -14
- package/core/utility/{mount_hdb.js → mount_hdb.ts} +15 -16
- package/core/utility/{npmUtilities.js → npmUtilities.ts} +14 -17
- package/core/utility/{operation_authorization.js → operation_authorization.ts} +173 -124
- package/core/utility/packageUtils.js +7 -16
- package/core/utility/password.ts +1 -1
- package/core/utility/processManagement/processManagement.js +2 -2
- package/core/utility/processManagement/servicesConfig.js +1 -1
- package/core/utility/{signalling.js → signalling.ts} +6 -11
- package/core/utility/watcherFallback.ts +74 -0
- package/core/validation/analyticsValidator.ts +44 -0
- package/core/validation/{bulkDeleteValidator.js → bulkDeleteValidator.ts} +5 -5
- package/core/validation/{check_permissions.js → check_permissions.ts} +3 -3
- package/core/validation/{common_validators.js → common_validators.ts} +12 -24
- package/core/validation/{configValidator.js → configValidator.ts} +114 -18
- package/core/validation/{deleteValidator.js → deleteValidator.ts} +5 -5
- package/core/validation/{fileLoadValidator.js → fileLoadValidator.ts} +12 -19
- package/core/validation/{insertValidator.js → insertValidator.ts} +5 -5
- package/core/validation/{installValidator.js → installValidator.ts} +8 -8
- package/core/validation/{readLogValidator.js → readLogValidator.ts} +10 -10
- package/core/validation/{role_validation.js → role_validation.ts} +26 -32
- package/core/validation/{schemaMetadataValidator.js → schemaMetadataValidator.ts} +5 -11
- package/core/validation/{searchValidator.js → searchValidator.ts} +12 -11
- package/core/validation/statusValidator.ts +1 -1
- package/core/validation/{transactionLogValidator.js → transactionLogValidator.ts} +4 -9
- package/core/validation/{user_validation.js → user_validation.ts} +4 -10
- package/core/validation/{validationWrapper.js → validationWrapper.ts} +3 -9
- package/dist/analytics/profile.js +4 -0
- package/dist/analytics/profile.js.map +1 -1
- package/dist/cloneNode/cloneNode.js +224 -12
- package/dist/cloneNode/cloneNode.js.map +1 -1
- package/dist/core/agent/agent.js +175 -0
- package/dist/core/agent/agent.js.map +1 -0
- package/dist/core/agent/loop.js +176 -0
- package/dist/core/agent/loop.js.map +1 -0
- package/dist/core/agent/operations.js +137 -0
- package/dist/core/agent/operations.js.map +1 -0
- package/dist/core/agent/session.js +182 -0
- package/dist/core/agent/session.js.map +1 -0
- package/dist/core/agent/tools/fsTools.js +286 -0
- package/dist/core/agent/tools/fsTools.js.map +1 -0
- package/dist/core/agent/tools/httpFetchTool.js +116 -0
- package/dist/core/agent/tools/httpFetchTool.js.map +1 -0
- package/dist/core/agent/tools/scheduleTool.js +54 -0
- package/dist/core/agent/tools/scheduleTool.js.map +1 -0
- package/dist/core/agent/toolset.js +33 -0
- package/dist/core/agent/toolset.js.map +1 -0
- package/dist/core/agent/types.js +10 -0
- package/dist/core/agent/types.js.map +1 -0
- package/dist/core/bin/BinObjects.js +6 -3
- package/dist/core/bin/BinObjects.js.map +1 -1
- package/dist/core/bin/cliCredentials.js +130 -0
- package/dist/core/bin/cliCredentials.js.map +1 -0
- package/dist/core/bin/cliOperations.js +254 -40
- package/dist/core/bin/cliOperations.js.map +1 -1
- package/dist/core/bin/copyDb.js +16 -16
- package/dist/core/bin/copyDb.js.map +1 -1
- package/dist/core/bin/deployRenderer.js +185 -0
- package/dist/core/bin/deployRenderer.js.map +1 -0
- package/dist/core/bin/harper.js +92 -31
- package/dist/core/bin/harper.js.map +1 -1
- package/dist/core/bin/install.js +41 -4
- package/dist/core/bin/install.js.map +1 -1
- package/dist/core/bin/lite.js +3 -4
- package/dist/core/bin/lite.js.map +1 -1
- package/dist/core/bin/login.js +123 -0
- package/dist/core/bin/login.js.map +1 -0
- package/dist/core/bin/logout.js +16 -0
- package/dist/core/bin/logout.js.map +1 -0
- package/dist/core/bin/mcp/client.js +395 -0
- package/dist/core/bin/mcp/client.js.map +1 -0
- package/dist/core/bin/mcp/doctor.js +193 -0
- package/dist/core/bin/mcp/doctor.js.map +1 -0
- package/dist/core/bin/mcp/index.js +81 -0
- package/dist/core/bin/mcp/index.js.map +1 -0
- package/dist/core/bin/mcp/options.js +113 -0
- package/dist/core/bin/mcp/options.js.map +1 -0
- package/dist/core/bin/mcp/printConfig.js +85 -0
- package/dist/core/bin/mcp/printConfig.js.map +1 -0
- package/dist/core/bin/multipartBuilder.js +55 -0
- package/dist/core/bin/multipartBuilder.js.map +1 -0
- package/dist/core/bin/restart.js +85 -48
- package/dist/core/bin/restart.js.map +1 -1
- package/dist/core/bin/run.js +123 -77
- package/dist/core/bin/run.js.map +1 -1
- package/dist/core/bin/sseConsumer.js +127 -0
- package/dist/core/bin/sseConsumer.js.map +1 -0
- package/dist/core/bin/status.js +48 -11
- package/dist/core/bin/status.js.map +1 -1
- package/dist/core/bin/stop.js +44 -7
- package/dist/core/bin/stop.js.map +1 -1
- package/dist/core/bin/upgrade.js +14 -22
- package/dist/core/bin/upgrade.js.map +1 -1
- package/dist/core/components/Application.js +134 -28
- package/dist/core/components/Application.js.map +1 -1
- package/dist/core/components/ApplicationScope.js +2 -2
- package/dist/core/components/ComponentV1.js +5 -5
- package/dist/core/components/ComponentV1.js.map +1 -1
- package/dist/core/components/EntryHandler.js +153 -13
- package/dist/core/components/EntryHandler.js.map +1 -1
- package/dist/core/components/OptionsWatcher.js +72 -10
- package/dist/core/components/OptionsWatcher.js.map +1 -1
- package/dist/core/components/Scope.js +112 -12
- package/dist/core/components/Scope.js.map +1 -1
- package/dist/core/components/anthropic/index.js +428 -0
- package/dist/core/components/anthropic/index.js.map +1 -0
- package/dist/core/components/bedrock/index.js +734 -0
- package/dist/core/components/bedrock/index.js.map +1 -0
- package/dist/core/components/componentLoader.js +65 -38
- package/dist/core/components/componentLoader.js.map +1 -1
- package/dist/core/components/deployLifecycle.js +156 -0
- package/dist/core/components/deployLifecycle.js.map +1 -0
- package/dist/core/components/deploymentOperations.js +185 -0
- package/dist/core/components/deploymentOperations.js.map +1 -0
- package/dist/core/components/deploymentRecorder.js +425 -0
- package/dist/core/components/deploymentRecorder.js.map +1 -0
- package/dist/core/components/deriveURLPath.js +2 -2
- package/dist/core/components/deriveURLPath.js.map +1 -1
- package/dist/core/components/mcp/adapters/fastify.js +66 -0
- package/dist/core/components/mcp/adapters/fastify.js.map +1 -0
- package/dist/core/components/mcp/adapters/harperHttp.js +78 -0
- package/dist/core/components/mcp/adapters/harperHttp.js.map +1 -0
- package/dist/core/components/mcp/audit.js +73 -0
- package/dist/core/components/mcp/audit.js.map +1 -0
- package/dist/core/components/mcp/index.js +109 -0
- package/dist/core/components/mcp/index.js.map +1 -0
- package/dist/core/components/mcp/jsonrpc.js +93 -0
- package/dist/core/components/mcp/jsonrpc.js.map +1 -0
- package/dist/core/components/mcp/lifecycle.js +79 -0
- package/dist/core/components/mcp/lifecycle.js.map +1 -0
- package/dist/core/components/mcp/listChanged.js +257 -0
- package/dist/core/components/mcp/listChanged.js.map +1 -0
- package/dist/core/components/mcp/rateLimit.js +226 -0
- package/dist/core/components/mcp/rateLimit.js.map +1 -0
- package/dist/core/components/mcp/resources.js +526 -0
- package/dist/core/components/mcp/resources.js.map +1 -0
- package/dist/core/components/mcp/session.js +170 -0
- package/dist/core/components/mcp/session.js.map +1 -0
- package/dist/core/components/mcp/sessionRegistry.js +124 -0
- package/dist/core/components/mcp/sessionRegistry.js.map +1 -0
- package/dist/core/components/mcp/toolRegistry.js +177 -0
- package/dist/core/components/mcp/toolRegistry.js.map +1 -0
- package/dist/core/components/mcp/tools/application.js +660 -0
- package/dist/core/components/mcp/tools/application.js.map +1 -0
- package/dist/core/components/mcp/tools/operations.js +331 -0
- package/dist/core/components/mcp/tools/operations.js.map +1 -0
- package/dist/core/components/mcp/tools/schemas/derive.js +291 -0
- package/dist/core/components/mcp/tools/schemas/derive.js.map +1 -0
- package/dist/core/components/mcp/tools/schemas/operationDescriptions.js +179 -0
- package/dist/core/components/mcp/tools/schemas/operationDescriptions.js.map +1 -0
- package/dist/core/components/mcp/tools/schemas/operations.js +299 -0
- package/dist/core/components/mcp/tools/schemas/operations.js.map +1 -0
- package/dist/core/components/mcp/transport.js +467 -0
- package/dist/core/components/mcp/transport.js.map +1 -0
- package/dist/core/components/ollama/index.js +239 -0
- package/dist/core/components/ollama/index.js.map +1 -0
- package/dist/core/components/openai/index.js +475 -0
- package/dist/core/components/openai/index.js.map +1 -0
- package/dist/core/components/operations.js +205 -52
- package/dist/core/components/operations.js.map +1 -1
- package/dist/core/components/operationsValidation.js +13 -4
- package/dist/core/components/operationsValidation.js.map +1 -1
- package/dist/core/components/packageComponent.js +87 -26
- package/dist/core/components/packageComponent.js.map +1 -1
- package/dist/core/components/requestRestart.js +12 -1
- package/dist/core/components/requestRestart.js.map +1 -1
- package/dist/core/components/status/crossThread.js +12 -5
- package/dist/core/components/status/crossThread.js.map +1 -1
- package/dist/core/components/status/errors.js +7 -7
- package/dist/core/config/RootConfigWatcher.js +52 -1
- package/dist/core/config/RootConfigWatcher.js.map +1 -1
- package/dist/core/config/configUtils.js +31 -8
- package/dist/core/config/configUtils.js.map +1 -1
- package/dist/core/config/harperConfigEnvVars.js +1 -1
- package/dist/core/config/harperConfigEnvVars.js.map +1 -1
- package/dist/core/dataLayer/CreateAttributeObject.js +4 -3
- package/dist/core/dataLayer/CreateAttributeObject.js.map +1 -1
- package/dist/core/dataLayer/CreateTableObject.js +2 -1
- package/dist/core/dataLayer/CreateTableObject.js.map +1 -1
- package/dist/core/dataLayer/DataLayerObjects.js +19 -5
- package/dist/core/dataLayer/DataLayerObjects.js.map +1 -1
- package/dist/core/dataLayer/DeleteBeforeObject.js +2 -1
- package/dist/core/dataLayer/DeleteBeforeObject.js.map +1 -1
- package/dist/core/dataLayer/DeleteObject.js +4 -3
- package/dist/core/dataLayer/DeleteObject.js.map +1 -1
- package/dist/core/dataLayer/DropAttributeObject.js +2 -1
- package/dist/core/dataLayer/DropAttributeObject.js.map +1 -1
- package/dist/core/dataLayer/GetBackupObject.js +4 -3
- package/dist/core/dataLayer/GetBackupObject.js.map +1 -1
- package/dist/core/dataLayer/InsertObject.js +4 -3
- package/dist/core/dataLayer/InsertObject.js.map +1 -1
- package/dist/core/dataLayer/ReadAuditLogObject.js +4 -3
- package/dist/core/dataLayer/ReadAuditLogObject.js.map +1 -1
- package/dist/core/dataLayer/SQLSearch.js +140 -78
- package/dist/core/dataLayer/SQLSearch.js.map +1 -1
- package/dist/core/dataLayer/SearchByConditionsObject.js +5 -7
- package/dist/core/dataLayer/SearchByConditionsObject.js.map +1 -1
- package/dist/core/dataLayer/SearchByHashObject.js +2 -1
- package/dist/core/dataLayer/SearchByHashObject.js.map +1 -1
- package/dist/core/dataLayer/SearchObject.js +2 -1
- package/dist/core/dataLayer/SearchObject.js.map +1 -1
- package/dist/core/dataLayer/SqlSearchObject.js +2 -1
- package/dist/core/dataLayer/SqlSearchObject.js.map +1 -1
- package/dist/core/dataLayer/UpdateObject.js +4 -3
- package/dist/core/dataLayer/UpdateObject.js.map +1 -1
- package/dist/core/dataLayer/UpsertObject.js +4 -3
- package/dist/core/dataLayer/UpsertObject.js.map +1 -1
- package/dist/core/dataLayer/bulkLoad.js +122 -88
- package/dist/core/dataLayer/bulkLoad.js.map +1 -1
- package/dist/core/dataLayer/delete.js +74 -39
- package/dist/core/dataLayer/delete.js.map +1 -1
- package/dist/core/dataLayer/export.js +90 -55
- package/dist/core/dataLayer/export.js.map +1 -1
- package/dist/core/dataLayer/getBackup.js +43 -11
- package/dist/core/dataLayer/getBackup.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/BridgeMethods.js +41 -20
- package/dist/core/dataLayer/harperBridge/BridgeMethods.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/ResourceBridge.js +26 -25
- package/dist/core/dataLayer/harperBridge/ResourceBridge.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/TableSizeObject.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js +4 -4
- package/dist/core/dataLayer/harperBridge/harperBridge.js +38 -4
- package/dist/core/dataLayer/harperBridge/harperBridge.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js +7 -6
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js +5 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js +5 -5
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js +5 -5
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js +3 -3
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js +2 -2
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js +5 -5
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js +8 -8
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js +3 -3
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js +3 -3
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js +5 -5
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js +2 -2
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +2 -2
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js +5 -3
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.js +2 -2
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js +5 -5
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js +4 -4
- package/dist/core/dataLayer/hdbInfoController.js +66 -31
- package/dist/core/dataLayer/hdbInfoController.js.map +1 -1
- package/dist/core/dataLayer/insert.js +63 -28
- package/dist/core/dataLayer/insert.js.map +1 -1
- package/dist/core/dataLayer/readAuditLog.js +45 -13
- package/dist/core/dataLayer/readAuditLog.js.map +1 -1
- package/dist/core/dataLayer/schema.js +124 -89
- package/dist/core/dataLayer/schema.js.map +1 -1
- package/dist/core/dataLayer/schemaDescribe.js +78 -41
- package/dist/core/dataLayer/schemaDescribe.js.map +1 -1
- package/dist/core/dataLayer/search.js +12 -13
- package/dist/core/dataLayer/search.js.map +1 -1
- package/dist/core/dataLayer/transaction.js +3 -4
- package/dist/core/dataLayer/transaction.js.map +1 -1
- package/dist/core/dataLayer/update.js +53 -18
- package/dist/core/dataLayer/update.js.map +1 -1
- package/dist/core/globals.js +1 -0
- package/dist/core/globals.js.map +1 -1
- package/dist/core/index.js +4 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/json/systemSchema.json +65 -0
- package/dist/core/launchServiceScripts/utility/checkNodeVersion.js +3 -0
- package/dist/core/launchServiceScripts/utility/checkNodeVersion.js.map +1 -1
- package/dist/core/resources/DatabaseTransaction.js +39 -15
- package/dist/core/resources/DatabaseTransaction.js.map +1 -1
- package/dist/core/resources/ErrorResource.js +3 -1
- package/dist/core/resources/ErrorResource.js.map +1 -1
- package/dist/core/resources/LMDBTransaction.js +18 -7
- package/dist/core/resources/LMDBTransaction.js.map +1 -1
- package/dist/core/resources/RecordEncoder.js +38 -38
- package/dist/core/resources/RecordEncoder.js.map +1 -1
- package/dist/core/resources/RequestTarget.js.map +1 -1
- package/dist/core/resources/Resource.js +43 -10
- package/dist/core/resources/Resource.js.map +1 -1
- package/dist/core/resources/ResourceInterface.js +20 -0
- package/dist/core/resources/ResourceInterface.js.map +1 -1
- package/dist/core/resources/Resources.js +7 -6
- package/dist/core/resources/Resources.js.map +1 -1
- package/dist/core/resources/RocksIndexStore.js +3 -0
- package/dist/core/resources/RocksIndexStore.js.map +1 -1
- package/dist/core/resources/RocksTransactionLogStore.js +10 -3
- package/dist/core/resources/RocksTransactionLogStore.js.map +1 -1
- package/dist/core/resources/Table.js +306 -116
- package/dist/core/resources/Table.js.map +1 -1
- package/dist/core/resources/analytics/metadata.js +1 -0
- package/dist/core/resources/analytics/metadata.js.map +1 -1
- package/dist/core/resources/analytics/read.js +69 -8
- package/dist/core/resources/analytics/read.js.map +1 -1
- package/dist/core/resources/analytics/write.js +232 -20
- package/dist/core/resources/analytics/write.js.map +1 -1
- package/dist/core/resources/auditStore.js +16 -8
- package/dist/core/resources/auditStore.js.map +1 -1
- package/dist/core/resources/blob.js +8 -8
- package/dist/core/resources/blob.js.map +1 -1
- package/dist/core/resources/dataLoader.js +13 -13
- package/dist/core/resources/databases.js +175 -59
- package/dist/core/resources/databases.js.map +1 -1
- package/dist/core/resources/graphql.js +267 -173
- package/dist/core/resources/graphql.js.map +1 -1
- package/dist/core/resources/indexes/HierarchicalNavigableSmallWorld.js +327 -59
- package/dist/core/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
- package/dist/core/resources/indexes/vector.js +14 -0
- package/dist/core/resources/indexes/vector.js.map +1 -1
- package/dist/core/resources/jsonSchemaTypes.js +78 -0
- package/dist/core/resources/jsonSchemaTypes.js.map +1 -0
- package/dist/core/resources/loadEnv.js +21 -18
- package/dist/core/resources/loadEnv.js.map +1 -1
- package/dist/core/resources/login.js +5 -4
- package/dist/core/resources/login.js.map +1 -1
- package/dist/core/resources/models/Models.js +265 -0
- package/dist/core/resources/models/Models.js.map +1 -0
- package/dist/core/resources/models/TestBackend.js +71 -0
- package/dist/core/resources/models/TestBackend.js.map +1 -0
- package/dist/core/resources/models/agentLoop.js +746 -0
- package/dist/core/resources/models/agentLoop.js.map +1 -0
- package/dist/core/resources/models/analyticsTable.js +166 -0
- package/dist/core/resources/models/analyticsTable.js.map +1 -0
- package/dist/core/resources/models/backendHelpers.js +109 -0
- package/dist/core/resources/models/backendHelpers.js.map +1 -0
- package/dist/core/resources/models/backendRegistry.js +54 -0
- package/dist/core/resources/models/backendRegistry.js.map +1 -0
- package/dist/core/resources/models/bootstrap.js +112 -0
- package/dist/core/resources/models/bootstrap.js.map +1 -0
- package/dist/core/resources/models/embedHook.js +127 -0
- package/dist/core/resources/models/embedHook.js.map +1 -0
- package/dist/core/resources/models/types.js +11 -0
- package/dist/core/resources/models/types.js.map +1 -0
- package/dist/core/resources/openApi.js +74 -34
- package/dist/core/resources/openApi.js.map +1 -1
- package/dist/core/resources/replayLogs.js +7 -1
- package/dist/core/resources/replayLogs.js.map +1 -1
- package/dist/core/resources/replayLogsGuards.js +47 -0
- package/dist/core/resources/replayLogsGuards.js.map +1 -1
- package/dist/core/resources/roles.js +67 -71
- package/dist/core/resources/roles.js.map +1 -1
- package/dist/core/resources/search.js +349 -140
- package/dist/core/resources/search.js.map +1 -1
- package/dist/core/resources/tracked.js +23 -15
- package/dist/core/resources/tracked.js.map +1 -1
- package/dist/core/resources/transaction.js +1 -1
- package/dist/core/resources/transaction.js.map +1 -1
- package/dist/core/resources/transactionBroadcast.js.map +1 -1
- package/dist/core/security/auth.js +34 -25
- package/dist/core/security/auth.js.map +1 -1
- package/dist/core/security/certificateVerification/crlVerification.js +7 -1
- package/dist/core/security/certificateVerification/crlVerification.js.map +1 -1
- package/dist/core/security/cryptoHash.js +37 -5
- package/dist/core/security/cryptoHash.js.map +1 -1
- package/dist/core/security/data_objects/PermissionAttributeResponseObject.js +4 -1
- package/dist/core/security/data_objects/PermissionAttributeResponseObject.js.map +1 -1
- package/dist/core/security/data_objects/PermissionResponseObject.js +15 -8
- package/dist/core/security/data_objects/PermissionResponseObject.js.map +1 -1
- package/dist/core/security/data_objects/PermissionTableResponseObject.js +6 -1
- package/dist/core/security/data_objects/PermissionTableResponseObject.js.map +1 -1
- package/dist/core/security/fastifyAuth.js +131 -22
- package/dist/core/security/fastifyAuth.js.map +1 -1
- package/dist/core/security/impersonation.js +15 -15
- package/dist/core/security/jsLoader.js +18 -5
- package/dist/core/security/jsLoader.js.map +1 -1
- package/dist/core/security/keys.js +160 -114
- package/dist/core/security/keys.js.map +1 -1
- package/dist/core/security/permissionsTranslator.js +2 -2
- package/dist/core/security/role.js +70 -35
- package/dist/core/security/role.js.map +1 -1
- package/dist/core/security/tokenAuthentication.js +57 -27
- package/dist/core/security/tokenAuthentication.js.map +1 -1
- package/dist/core/security/user.js +74 -38
- package/dist/core/security/user.js.map +1 -1
- package/dist/core/server/DurableSubscriptionsSession.js +71 -55
- package/dist/core/server/DurableSubscriptionsSession.js.map +1 -1
- package/dist/core/server/REST.js +17 -16
- package/dist/core/server/REST.js.map +1 -1
- package/dist/core/server/Server.js +1 -1
- package/dist/core/server/Server.js.map +1 -1
- package/dist/core/server/fastifyRoutes/helpers/getCORSOptions.js +1 -1
- package/dist/core/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js +1 -1
- package/dist/core/server/fastifyRoutes/helpers/getServerOptions.js +1 -1
- package/dist/core/server/fastifyRoutes.js +34 -30
- package/dist/core/server/fastifyRoutes.js.map +1 -1
- package/dist/core/server/graphqlQuerying.js +8 -7
- package/dist/core/server/graphqlQuerying.js.map +1 -1
- package/dist/core/server/http.js +523 -47
- package/dist/core/server/http.js.map +1 -1
- package/dist/core/server/itc/serverHandlers.js +66 -15
- package/dist/core/server/itc/serverHandlers.js.map +1 -1
- package/dist/core/server/jobs/JobObject.js +53 -7
- package/dist/core/server/jobs/JobObject.js.map +1 -1
- package/dist/core/server/jobs/jobProcess.js +64 -24
- package/dist/core/server/jobs/jobProcess.js.map +1 -1
- package/dist/core/server/jobs/jobRunner.js +68 -30
- package/dist/core/server/jobs/jobRunner.js.map +1 -1
- package/dist/core/server/jobs/jobs.js +93 -61
- package/dist/core/server/jobs/jobs.js.map +1 -1
- package/dist/core/server/loadRootComponents.js +1 -1
- package/dist/core/server/middlewareChain.js +252 -0
- package/dist/core/server/middlewareChain.js.map +1 -0
- package/dist/core/server/mqtt.js +22 -17
- package/dist/core/server/mqtt.js.map +1 -1
- package/dist/core/server/nodeName.js +46 -13
- package/dist/core/server/nodeName.js.map +1 -1
- package/dist/core/server/operationsServer.js +106 -33
- package/dist/core/server/operationsServer.js.map +1 -1
- package/dist/core/server/serverHelpers/Headers.js +2 -0
- package/dist/core/server/serverHelpers/Headers.js.map +1 -1
- package/dist/core/server/serverHelpers/JSONStream.js +12 -3
- package/dist/core/server/serverHelpers/JSONStream.js.map +1 -1
- package/dist/core/server/serverHelpers/Request.js +370 -9
- package/dist/core/server/serverHelpers/Request.js.map +1 -1
- package/dist/core/server/serverHelpers/contentTypes.js +36 -7
- package/dist/core/server/serverHelpers/contentTypes.js.map +1 -1
- package/dist/core/server/serverHelpers/multipartParser.js +142 -0
- package/dist/core/server/serverHelpers/multipartParser.js.map +1 -0
- package/dist/core/server/serverHelpers/progressEmitter.js +103 -0
- package/dist/core/server/serverHelpers/progressEmitter.js.map +1 -0
- package/dist/core/server/serverHelpers/serverHandlers.js +38 -7
- package/dist/core/server/serverHelpers/serverHandlers.js.map +1 -1
- package/dist/core/server/serverHelpers/serverUtilities.js +97 -93
- package/dist/core/server/serverHelpers/serverUtilities.js.map +1 -1
- package/dist/core/server/static.js +8 -5
- package/dist/core/server/static.js.map +1 -1
- package/dist/core/server/status/index.js +3 -3
- package/dist/core/server/storageReclamation.js +68 -9
- package/dist/core/server/storageReclamation.js.map +1 -1
- package/dist/core/server/threads/itc.js +7 -4
- package/dist/core/server/threads/itc.js.map +1 -1
- package/dist/core/server/threads/manageThreads.js +110 -26
- package/dist/core/server/threads/manageThreads.js.map +1 -1
- package/dist/core/server/threads/socketRouter.js +8 -271
- package/dist/core/server/threads/socketRouter.js.map +1 -1
- package/dist/core/server/threads/threadServer.js +360 -118
- package/dist/core/server/threads/threadServer.js.map +1 -1
- package/dist/core/server/threads/workerProcessGuard.js +114 -0
- package/dist/core/server/threads/workerProcessGuard.js.map +1 -0
- package/dist/core/server/throttle.js +17 -0
- package/dist/core/server/throttle.js.map +1 -1
- package/dist/core/sqlTranslator/SelectValidator.js +86 -47
- package/dist/core/sqlTranslator/SelectValidator.js.map +1 -1
- package/dist/core/sqlTranslator/alasqlFunctionImporter.js +40 -3
- package/dist/core/sqlTranslator/alasqlFunctionImporter.js.map +1 -1
- package/dist/core/sqlTranslator/deleteTranslator.js +48 -14
- package/dist/core/sqlTranslator/deleteTranslator.js.map +1 -1
- package/dist/core/sqlTranslator/index.js +69 -30
- package/dist/core/sqlTranslator/index.js.map +1 -1
- package/dist/core/sqlTranslator/sql_statement_bucket.js +55 -13
- package/dist/core/sqlTranslator/sql_statement_bucket.js.map +1 -1
- package/dist/core/upgrade/UpgradeObjects.js +37 -4
- package/dist/core/upgrade/UpgradeObjects.js.map +1 -1
- package/dist/core/upgrade/directives/5-1-0.js +114 -0
- package/dist/core/upgrade/directives/5-1-0.js.map +1 -0
- package/dist/core/upgrade/directives/directivesController.js +52 -11
- package/dist/core/upgrade/directives/directivesController.js.map +1 -1
- package/dist/core/upgrade/directivesManager.js +53 -18
- package/dist/core/upgrade/directivesManager.js.map +1 -1
- package/dist/core/upgrade/upgradePrompt.js +55 -60
- package/dist/core/upgrade/upgradePrompt.js.map +1 -1
- package/dist/core/upgrade/upgradeUtilities.js +37 -5
- package/dist/core/upgrade/upgradeUtilities.js.map +1 -1
- package/dist/core/utility/OperationFunctionCaller.js +45 -10
- package/dist/core/utility/OperationFunctionCaller.js.map +1 -1
- package/dist/core/utility/assignCmdEnvVariables.js +8 -4
- package/dist/core/utility/assignCmdEnvVariables.js.map +1 -1
- package/dist/core/utility/common_utils.js +140 -79
- package/dist/core/utility/common_utils.js.map +1 -1
- package/dist/core/utility/environment/environmentManager.js +75 -29
- package/dist/core/utility/environment/environmentManager.js.map +1 -1
- package/dist/core/utility/environment/systemInformation.js +27 -16
- package/dist/core/utility/environment/systemInformation.js.map +1 -1
- package/dist/core/utility/errors/commonErrors.js +49 -18
- package/dist/core/utility/errors/commonErrors.js.map +1 -1
- package/dist/core/utility/errors/hdbError.js +65 -26
- package/dist/core/utility/errors/hdbError.js.map +1 -1
- package/dist/core/utility/expandEnvVar.js +113 -0
- package/dist/core/utility/expandEnvVar.js.map +1 -0
- package/dist/core/utility/functions/geo.js +2 -2
- package/dist/core/utility/functions/sql/alaSQLExtension.js +1 -1
- package/dist/core/utility/globalSchema.js +14 -11
- package/dist/core/utility/globalSchema.js.map +1 -1
- package/dist/core/utility/hdbTerms.js +54 -1
- package/dist/core/utility/hdbTerms.js.map +1 -1
- package/dist/core/utility/install/checkJWTTokensExist.js +1 -1
- package/dist/core/utility/install/installer.js +136 -73
- package/dist/core/utility/install/installer.js.map +1 -1
- package/dist/core/utility/installation.js +3 -3
- package/dist/core/utility/lmdb/DBIDefinition.js +5 -1
- package/dist/core/utility/lmdb/DBIDefinition.js.map +1 -1
- package/dist/core/utility/lmdb/DeleteRecordsResponseObject.js +2 -1
- package/dist/core/utility/lmdb/DeleteRecordsResponseObject.js.map +1 -1
- package/dist/core/utility/lmdb/InsertRecordsResponseObject.js +2 -1
- package/dist/core/utility/lmdb/InsertRecordsResponseObject.js.map +1 -1
- package/dist/core/utility/lmdb/OpenDBIObject.js +68 -6
- package/dist/core/utility/lmdb/OpenDBIObject.js.map +1 -1
- package/dist/core/utility/lmdb/OpenEnvironmentObject.js +52 -4
- package/dist/core/utility/lmdb/OpenEnvironmentObject.js.map +1 -1
- package/dist/core/utility/lmdb/UpdateRecordsResponseObject.js +2 -1
- package/dist/core/utility/lmdb/UpdateRecordsResponseObject.js.map +1 -1
- package/dist/core/utility/lmdb/UpsertRecordsResponseObject.js +2 -1
- package/dist/core/utility/lmdb/UpsertRecordsResponseObject.js.map +1 -1
- package/dist/core/utility/lmdb/cleanLMDBMap.js +44 -7
- package/dist/core/utility/lmdb/cleanLMDBMap.js.map +1 -1
- package/dist/core/utility/lmdb/commonUtility.js +46 -17
- package/dist/core/utility/lmdb/commonUtility.js.map +1 -1
- package/dist/core/utility/lmdb/deleteUtility.js +51 -16
- package/dist/core/utility/lmdb/deleteUtility.js.map +1 -1
- package/dist/core/utility/lmdb/environmentUtility.js +91 -51
- package/dist/core/utility/lmdb/environmentUtility.js.map +1 -1
- package/dist/core/utility/lmdb/searchCursorFunctions.js +46 -14
- package/dist/core/utility/lmdb/searchCursorFunctions.js.map +1 -1
- package/dist/core/utility/lmdb/searchUtility.js +91 -55
- package/dist/core/utility/lmdb/searchUtility.js.map +1 -1
- package/dist/core/utility/lmdb/terms.js +12 -22
- package/dist/core/utility/lmdb/terms.js.map +1 -1
- package/dist/core/utility/lmdb/writeUtility.js +61 -28
- package/dist/core/utility/lmdb/writeUtility.js.map +1 -1
- package/dist/core/utility/logging/harper_logger.js +177 -82
- package/dist/core/utility/logging/harper_logger.js.map +1 -1
- package/dist/core/utility/logging/logRotator.js +67 -32
- package/dist/core/utility/logging/logRotator.js.map +1 -1
- package/dist/core/utility/logging/logger.js +4 -4
- package/dist/core/utility/logging/readLog.js +54 -17
- package/dist/core/utility/logging/readLog.js.map +1 -1
- package/dist/core/utility/logging/transactionLog.js +51 -16
- package/dist/core/utility/logging/transactionLog.js.map +1 -1
- package/dist/core/utility/mount_hdb.js +54 -17
- package/dist/core/utility/mount_hdb.js.map +1 -1
- package/dist/core/utility/npmUtilities.js +54 -19
- package/dist/core/utility/npmUtilities.js.map +1 -1
- package/dist/core/utility/operation_authorization.js +135 -86
- package/dist/core/utility/operation_authorization.js.map +1 -1
- package/dist/core/utility/packageUtils.js +7 -17
- package/dist/core/utility/packageUtils.js.map +1 -1
- package/dist/core/utility/password.js +2 -2
- package/dist/core/utility/processManagement/processManagement.js +2 -2
- package/dist/core/utility/processManagement/servicesConfig.js +1 -1
- package/dist/core/utility/signalling.js +51 -16
- package/dist/core/utility/signalling.js.map +1 -1
- package/dist/core/utility/watcherFallback.js +73 -0
- package/dist/core/utility/watcherFallback.js.map +1 -0
- package/dist/core/validation/analyticsValidator.js +80 -0
- package/dist/core/validation/analyticsValidator.js.map +1 -0
- package/dist/core/validation/bulkDeleteValidator.js +49 -11
- package/dist/core/validation/bulkDeleteValidator.js.map +1 -1
- package/dist/core/validation/check_permissions.js +38 -3
- package/dist/core/validation/check_permissions.js.map +1 -1
- package/dist/core/validation/common_validators.js +62 -31
- package/dist/core/validation/common_validators.js.map +1 -1
- package/dist/core/validation/configValidator.js +189 -54
- package/dist/core/validation/configValidator.js.map +1 -1
- package/dist/core/validation/deleteValidator.js +49 -11
- package/dist/core/validation/deleteValidator.js.map +1 -1
- package/dist/core/validation/fileLoadValidator.js +67 -32
- package/dist/core/validation/fileLoadValidator.js.map +1 -1
- package/dist/core/validation/insertValidator.js +48 -10
- package/dist/core/validation/insertValidator.js.map +1 -1
- package/dist/core/validation/installValidator.js +47 -10
- package/dist/core/validation/installValidator.js.map +1 -1
- package/dist/core/validation/readLogValidator.js +60 -22
- package/dist/core/validation/readLogValidator.js.map +1 -1
- package/dist/core/validation/role_validation.js +55 -19
- package/dist/core/validation/role_validation.js.map +1 -1
- package/dist/core/validation/schemaMetadataValidator.js +11 -12
- package/dist/core/validation/schemaMetadataValidator.js.map +1 -1
- package/dist/core/validation/searchValidator.js +82 -43
- package/dist/core/validation/searchValidator.js.map +1 -1
- package/dist/core/validation/transactionLogValidator.js +52 -17
- package/dist/core/validation/transactionLogValidator.js.map +1 -1
- package/dist/core/validation/user_validation.js +38 -6
- package/dist/core/validation/user_validation.js.map +1 -1
- package/dist/core/validation/validationWrapper.js +4 -5
- package/dist/core/validation/validationWrapper.js.map +1 -1
- package/dist/licensing/usageLicensing.js +30 -21
- package/dist/licensing/usageLicensing.js.map +1 -1
- package/dist/replication/knownNodes.js +171 -41
- package/dist/replication/knownNodes.js.map +1 -1
- package/dist/replication/replicationConnection.js +441 -85
- package/dist/replication/replicationConnection.js.map +1 -1
- package/dist/replication/replicator.js +56 -28
- package/dist/replication/replicator.js.map +1 -1
- package/dist/replication/setNode.js +24 -4
- package/dist/replication/setNode.js.map +1 -1
- package/dist/replication/subscriptionManager.js +195 -16
- package/dist/replication/subscriptionManager.js.map +1 -1
- package/dist/security/certificate.js +41 -6
- package/dist/security/certificate.js.map +1 -1
- package/dist/security/sshKeyOperations.js +35 -2
- package/dist/security/sshKeyOperations.js.map +1 -1
- package/licensing/usageLicensing.ts +32 -37
- package/npm-shrinkwrap.json +9032 -4334
- package/package.json +17 -12
- package/replication/DESIGN.md +139 -0
- package/replication/knownNodes.ts +165 -44
- package/replication/replicationConnection.ts +475 -92
- package/replication/replicator.ts +54 -27
- package/replication/setNode.ts +29 -10
- package/replication/subscriptionManager.ts +227 -21
- package/security/certificate.ts +8 -4
- package/security/sshKeyOperations.ts +1 -1
- package/static/defaultConfig.yaml +1 -0
- 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/core/bin/cliOperations.js +0 -159
- package/core/bin/lite.js +0 -5
- package/core/bin/stop.js +0 -21
- package/core/dataLayer/harperBridge/BridgeMethods.js +0 -85
- package/core/utility/globalSchema.js +0 -35
- package/core/utility/lmdb/OpenDBIObject.js +0 -31
- package/studio/web/assets/index-CybLScHg.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use strict';
|
|
1
2
|
const { join, dirname } = require('node:path');
|
|
2
3
|
const { existsSync, readFileSync } = require('node:fs');
|
|
3
4
|
|
|
@@ -6,9 +7,6 @@ const { existsSync, readFileSync } = require('node:fs');
|
|
|
6
7
|
* subsequently the root directory of the package. In theory we could require
|
|
7
8
|
* package.json directly (`require('../../package.json')`), but that would not
|
|
8
9
|
* give us the root directory of the repo, which is needed for other things.
|
|
9
|
-
* Furthermore, when this is eventually converted to TS, we should consider
|
|
10
|
-
* using `import('../../package.json')` as that will give type-safe access to
|
|
11
|
-
* the package.json file.
|
|
12
10
|
*
|
|
13
11
|
* The purpose of doing this instead of cobbling together a path directly is
|
|
14
12
|
* that in development mode this file will be resolved from its actual path
|
|
@@ -18,13 +16,11 @@ const { existsSync, readFileSync } = require('node:fs');
|
|
|
18
16
|
* requires/imports), we need to stick to directory traversal to find the
|
|
19
17
|
* package root.
|
|
20
18
|
*
|
|
21
|
-
* This
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @returns {string} package.json file path
|
|
19
|
+
* NOTE: This file is intentionally kept as CommonJS (.js) rather than
|
|
20
|
+
* TypeScript. Node v24 type-stripping treats `.ts` files with top-level
|
|
21
|
+
* `import`/`export` as ESM, where `__dirname` is undefined. Keeping this as
|
|
22
|
+
* `.js` lets it stay CJS, retaining `__dirname`, while remaining importable
|
|
23
|
+
* from both CJS and ESM (via Node's CJS interop) consumers.
|
|
28
24
|
*/
|
|
29
25
|
function findPackageJson() {
|
|
30
26
|
const MAX = 10;
|
|
@@ -44,12 +40,7 @@ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
|
|
44
40
|
* The Harper package root directory.
|
|
45
41
|
*
|
|
46
42
|
* Works across dev and prod (built).
|
|
47
|
-
*
|
|
48
|
-
* @type {string}
|
|
49
43
|
*/
|
|
50
44
|
const PACKAGE_ROOT = dirname(packageJsonPath);
|
|
51
45
|
|
|
52
|
-
module.exports = {
|
|
53
|
-
packageJson,
|
|
54
|
-
PACKAGE_ROOT,
|
|
55
|
-
};
|
|
46
|
+
module.exports = { packageJson, PACKAGE_ROOT };
|
package/core/utility/password.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as crypto from 'node:crypto';
|
|
2
2
|
import * as argon2 from 'argon2';
|
|
3
|
-
import { get } from './environment/environmentManager.
|
|
3
|
+
import { get } from './environment/environmentManager.ts';
|
|
4
4
|
import { CONFIG_PARAMS } from './hdbTerms.ts';
|
|
5
5
|
const configuredHashFunction = get(CONFIG_PARAMS.AUTHENTICATION_HASHFUNCTION)?.toLowerCase();
|
|
6
6
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const hdbTerms = require('../hdbTerms.ts');
|
|
4
4
|
const servicesConfig = require('./servicesConfig.js');
|
|
5
|
-
const envMangr = require('../environment/environmentManager.
|
|
6
|
-
const hdbLogger = require('../../utility/logging/harper_logger.
|
|
5
|
+
const envMangr = require('../environment/environmentManager.ts');
|
|
6
|
+
const hdbLogger = require('../../utility/logging/harper_logger.ts');
|
|
7
7
|
const { onMessageFromWorkers } = require('../../server/threads/manageThreads.js');
|
|
8
8
|
const fs = require('fs');
|
|
9
9
|
const path = require('node:path');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const hdbTerms = require('../hdbTerms.ts');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const { PACKAGE_ROOT } = require('../../utility/packageUtils.js');
|
|
6
|
-
const hdbUtils = require('../common_utils.
|
|
6
|
+
const hdbUtils = require('../common_utils.ts');
|
|
7
7
|
const SCRIPTS_DIR = path.join(PACKAGE_ROOT, 'utility/scripts');
|
|
8
8
|
const RESTART_SCRIPT = path.join(SCRIPTS_DIR, hdbTerms.HDB_RESTART_SCRIPT);
|
|
9
9
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import * as hdbTerms from './hdbTerms.ts';
|
|
4
|
+
import hdbLogger from '../utility/logging/harper_logger.ts';
|
|
5
|
+
import ITCEventObject from '../server/itc/utility/ITCEventObject.js';
|
|
6
6
|
let serverItcHandlers;
|
|
7
|
-
|
|
7
|
+
import { sendItcEvent } from '../server/threads/itc.js';
|
|
8
8
|
|
|
9
|
-
function signalSchemaChange(message) {
|
|
9
|
+
export function signalSchemaChange(message: any) {
|
|
10
10
|
try {
|
|
11
11
|
hdbLogger.debug('signalSchemaChange called with message:', message);
|
|
12
12
|
serverItcHandlers = serverItcHandlers || require('../server/itc/serverHandlers.js');
|
|
@@ -18,7 +18,7 @@ function signalSchemaChange(message) {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function signalUserChange(message) {
|
|
21
|
+
export function signalUserChange(message: any) {
|
|
22
22
|
try {
|
|
23
23
|
hdbLogger.trace('signalUserChange called with message:', message);
|
|
24
24
|
serverItcHandlers = serverItcHandlers || require('../server/itc/serverHandlers.js');
|
|
@@ -29,8 +29,3 @@ function signalUserChange(message) {
|
|
|
29
29
|
hdbLogger.error(err);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
module.exports = {
|
|
34
|
-
signalSchemaChange,
|
|
35
|
-
signalUserChange,
|
|
36
|
-
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Polling fallback for chokidar watchers.
|
|
2
|
+
//
|
|
3
|
+
// When the host system runs out of inotify watches (ENOSPC) or file descriptors
|
|
4
|
+
// (EMFILE), native chokidar watchers emit an error and stop firing change
|
|
5
|
+
// events. Polling-based watching doesn't consume inotify handles or per-watcher
|
|
6
|
+
// file descriptors, so we fall back to it once and warn — see harper#488.
|
|
7
|
+
|
|
8
|
+
import { loggerWithTag } from './logging/harper_logger.ts';
|
|
9
|
+
|
|
10
|
+
// One-time process-wide warning so a thundering herd of failing watchers doesn't
|
|
11
|
+
// produce hundreds of identical log lines.
|
|
12
|
+
let exhaustionWarned = false;
|
|
13
|
+
|
|
14
|
+
const fallbackLogger = loggerWithTag('watcher');
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns `true` if the chokidar error indicates the OS-level watcher pool is
|
|
18
|
+
* exhausted (inotify watches on Linux, open file descriptors on macOS/Linux).
|
|
19
|
+
*/
|
|
20
|
+
export function isWatcherExhaustionError(error: unknown): boolean {
|
|
21
|
+
if (typeof error !== 'object' || error === null) return false;
|
|
22
|
+
const code = (error as { code?: string }).code;
|
|
23
|
+
return code === 'ENOSPC' || code === 'EMFILE';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Polling-watch options to pass through to chokidar when falling back, for
|
|
28
|
+
* watchers backed by a single file (a config.yaml etc.).
|
|
29
|
+
*
|
|
30
|
+
* Intervals are deliberately conservative — polling-based watching is
|
|
31
|
+
* fundamentally less efficient than inotify, and once we're in this mode the
|
|
32
|
+
* host is already under resource pressure. A second-scale interval keeps CPU
|
|
33
|
+
* cost bounded; the alternative is to lose change events entirely.
|
|
34
|
+
*/
|
|
35
|
+
export const POLLING_FALLBACK_OPTIONS = {
|
|
36
|
+
usePolling: true,
|
|
37
|
+
interval: 1000,
|
|
38
|
+
binaryInterval: 2000,
|
|
39
|
+
} as const;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Polling-watch options for directory-tree watchers (EntryHandler). Chokidar
|
|
43
|
+
* polls fs.stat on every watched file each interval, so a tree with thousands
|
|
44
|
+
* of files at 1s would burn meaningful CPU; we trade responsiveness for cost
|
|
45
|
+
* here on the assumption that the host is already strained.
|
|
46
|
+
*/
|
|
47
|
+
export const DIRECTORY_POLLING_FALLBACK_OPTIONS = {
|
|
48
|
+
usePolling: true,
|
|
49
|
+
interval: 3000,
|
|
50
|
+
binaryInterval: 5000,
|
|
51
|
+
} as const;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Log a one-time warning when a watcher first falls back to polling. Subsequent
|
|
55
|
+
* fallbacks in the same process are silent.
|
|
56
|
+
*/
|
|
57
|
+
export function warnWatcherFallback(watchedPath: string): void {
|
|
58
|
+
if (exhaustionWarned) return;
|
|
59
|
+
exhaustionWarned = true;
|
|
60
|
+
fallbackLogger.warn?.(
|
|
61
|
+
`File watcher exhaustion (ENOSPC/EMFILE) on ${watchedPath}. ` +
|
|
62
|
+
'Falling back to polling-based watching for affected watchers — ' +
|
|
63
|
+
'this will increase CPU usage proportional to the size of the watched trees ' +
|
|
64
|
+
'and may delay or miss rapid file changes. ' +
|
|
65
|
+
'To restore native watching, raise the OS limit, for example: ' +
|
|
66
|
+
'`sudo sysctl -w fs.inotify.max_user_watches=524288` ' +
|
|
67
|
+
'or `sudo sysctl -w fs.inotify.max_user_instances=10000` (Linux).'
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Test-only hook to reset the one-time warning gate between cases.
|
|
72
|
+
export function _resetForTests(): void {
|
|
73
|
+
exhaustionWarned = false;
|
|
74
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import * as validator from './validationWrapper.ts';
|
|
3
|
+
import { COMPARATORS } from '../resources/ResourceInterface.ts';
|
|
4
|
+
|
|
5
|
+
// A leaf condition. Both the canonical (attribute/comparator/value) and the
|
|
6
|
+
// legacy (search_attribute/search_type/search_value) names are accepted —
|
|
7
|
+
// `conformCondition` in resources/analytics/read.ts maps the latter onto the
|
|
8
|
+
// former.
|
|
9
|
+
const directConditionSchema = Joi.object({
|
|
10
|
+
attribute: Joi.string(),
|
|
11
|
+
search_attribute: Joi.string(),
|
|
12
|
+
comparator: Joi.string().valid(...COMPARATORS),
|
|
13
|
+
search_type: Joi.string().valid(...COMPARATORS),
|
|
14
|
+
value: Joi.any(),
|
|
15
|
+
search_value: Joi.any(),
|
|
16
|
+
})
|
|
17
|
+
.or('attribute', 'search_attribute')
|
|
18
|
+
.or('comparator', 'search_type')
|
|
19
|
+
.or('value', 'search_value');
|
|
20
|
+
|
|
21
|
+
// A condition group. The nested `conditions` array is left unconstrained for
|
|
22
|
+
// the same reason searchByConditionsSchema leaves it unconstrained: shallow
|
|
23
|
+
// validation here is enough to reject scalar/wrong-type inputs at the boundary.
|
|
24
|
+
const groupConditionSchema = Joi.object({
|
|
25
|
+
operator: Joi.string().valid('and', 'or'),
|
|
26
|
+
conditions: Joi.array().required(),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// `.strict()` disables Joi's default type coercion so a numeric string like
|
|
30
|
+
// '1779834663816' is rejected for a `Joi.number()` field instead of being
|
|
31
|
+
// silently converted. Strictness propagates to child schemas.
|
|
32
|
+
const getAnalyticsSchema = Joi.object({
|
|
33
|
+
metric: Joi.string().required(),
|
|
34
|
+
start_time: Joi.number().greater(0),
|
|
35
|
+
end_time: Joi.number().greater(0),
|
|
36
|
+
get_attributes: Joi.array().items(Joi.string()),
|
|
37
|
+
coalesce_time: Joi.boolean(),
|
|
38
|
+
conditions: Joi.array().items(Joi.alternatives(groupConditionSchema, directConditionSchema)),
|
|
39
|
+
replicated: Joi.boolean(),
|
|
40
|
+
}).strict();
|
|
41
|
+
|
|
42
|
+
export function validateGetAnalytics(req: any): Error | undefined {
|
|
43
|
+
return validator.validateBySchema(req, getAnalyticsSchema);
|
|
44
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import * as validator from './validationWrapper.ts';
|
|
2
|
+
import Joi from 'joi';
|
|
3
|
+
import { hdbTable, hdbDatabase } from './common_validators.ts';
|
|
4
4
|
|
|
5
5
|
const validationSchema = {
|
|
6
6
|
schema: hdbDatabase,
|
|
@@ -16,9 +16,9 @@ const timestampSchema = {
|
|
|
16
16
|
timestamp: Joi.date().timestamp().required().messages({ 'date.format': "'timestamp' is invalid" }),
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
export default function (deleteObject: any, dateFormat: any) {
|
|
20
20
|
const finalSchema =
|
|
21
21
|
dateFormat === 'timestamp' ? { ...validationSchema, ...timestampSchema } : { ...validationSchema, ...dateSchema };
|
|
22
22
|
const bulkDeleteSchema = Joi.object(finalSchema);
|
|
23
23
|
return validator.validateBySchema(deleteObject, bulkDeleteSchema);
|
|
24
|
-
}
|
|
24
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import * as validator from './validationWrapper.ts';
|
|
2
2
|
|
|
3
3
|
const constraints = {
|
|
4
4
|
user: {
|
|
@@ -14,6 +14,6 @@ const constraints = {
|
|
|
14
14
|
presence: true,
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
export default function (deleteObject) {
|
|
18
18
|
return validator.validateObject(deleteObject, constraints);
|
|
19
|
-
}
|
|
19
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const schemaRegex = /^[\x20-\x2E|\x30-\x5F|\x61-\x7E]*$/;
|
|
6
|
-
|
|
3
|
+
import * as hdbUtils from '../utility/common_utils.ts';
|
|
4
|
+
import * as hdbTerms from '../utility/hdbTerms.ts';
|
|
5
|
+
export const schemaRegex = /^[\x20-\x2E|\x30-\x5F|\x61-\x7E]*$/;
|
|
6
|
+
import Joi from 'joi';
|
|
7
7
|
|
|
8
|
-
const commonValidators = {
|
|
8
|
+
export const commonValidators = {
|
|
9
9
|
schema_format: {
|
|
10
10
|
pattern: schemaRegex,
|
|
11
11
|
message: 'names cannot include backticks or forward slashes',
|
|
@@ -18,7 +18,7 @@ const commonValidators = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
// A Joi schema that can be used to validate hdb schemas and tables.
|
|
21
|
-
const hdbSchemaTable = Joi.alternatives(
|
|
21
|
+
export const hdbSchemaTable = Joi.alternatives(
|
|
22
22
|
Joi.string()
|
|
23
23
|
.min(1)
|
|
24
24
|
.max(commonValidators.schema_length.maximum)
|
|
@@ -28,7 +28,7 @@ const hdbSchemaTable = Joi.alternatives(
|
|
|
28
28
|
Joi.array()
|
|
29
29
|
).required();
|
|
30
30
|
|
|
31
|
-
const hdbDatabase = Joi.alternatives(
|
|
31
|
+
export const hdbDatabase = Joi.alternatives(
|
|
32
32
|
Joi.string()
|
|
33
33
|
.min(1)
|
|
34
34
|
.max(commonValidators.schema_length.maximum)
|
|
@@ -37,7 +37,7 @@ const hdbDatabase = Joi.alternatives(
|
|
|
37
37
|
Joi.number()
|
|
38
38
|
);
|
|
39
39
|
|
|
40
|
-
const hdbTable = Joi.alternatives(
|
|
40
|
+
export const hdbTable = Joi.alternatives(
|
|
41
41
|
Joi.string()
|
|
42
42
|
.min(1)
|
|
43
43
|
.max(commonValidators.schema_length.maximum)
|
|
@@ -46,7 +46,7 @@ const hdbTable = Joi.alternatives(
|
|
|
46
46
|
Joi.number()
|
|
47
47
|
).required();
|
|
48
48
|
|
|
49
|
-
function checkValidTable(propertyName, value) {
|
|
49
|
+
export function checkValidTable(propertyName, value) {
|
|
50
50
|
if (!value) return `'${propertyName}' is required`;
|
|
51
51
|
if (typeof value !== 'string') return `'${propertyName}' must be a string`;
|
|
52
52
|
if (!value.length) return `'${propertyName}' must be at least one character`;
|
|
@@ -55,7 +55,7 @@ function checkValidTable(propertyName, value) {
|
|
|
55
55
|
return '';
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
function validateSchemaExists(value, helpers) {
|
|
58
|
+
export function validateSchemaExists(value, helpers) {
|
|
59
59
|
if (!hdbUtils.doesSchemaExist(value)) {
|
|
60
60
|
return helpers.message(`Database '${value}' does not exist`);
|
|
61
61
|
}
|
|
@@ -63,7 +63,7 @@ function validateSchemaExists(value, helpers) {
|
|
|
63
63
|
return value;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
function validateTableExists(value, helpers) {
|
|
66
|
+
export function validateTableExists(value, helpers) {
|
|
67
67
|
const schema = helpers.state.ancestors[0].schema;
|
|
68
68
|
if (!hdbUtils.doesTableExist(schema, value)) {
|
|
69
69
|
return helpers.message(`Table '${value}' does not exist`);
|
|
@@ -72,7 +72,7 @@ function validateTableExists(value, helpers) {
|
|
|
72
72
|
return value;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
function validateSchemaName(value, helpers) {
|
|
75
|
+
export function validateSchemaName(value, helpers) {
|
|
76
76
|
if (value.toLowerCase() === hdbTerms.SYSTEM_SCHEMA_NAME) {
|
|
77
77
|
return helpers.message(
|
|
78
78
|
`'subscriptions[${helpers.state.path[1]}]' invalid database name, '${hdbTerms.SYSTEM_SCHEMA_NAME}' name is reserved`
|
|
@@ -81,15 +81,3 @@ function validateSchemaName(value, helpers) {
|
|
|
81
81
|
|
|
82
82
|
return value;
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
module.exports = {
|
|
86
|
-
commonValidators,
|
|
87
|
-
schemaRegex,
|
|
88
|
-
hdbSchemaTable,
|
|
89
|
-
validateSchemaExists,
|
|
90
|
-
validateTableExists,
|
|
91
|
-
validateSchemaName,
|
|
92
|
-
checkValidTable,
|
|
93
|
-
hdbDatabase,
|
|
94
|
-
hdbTable,
|
|
95
|
-
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import * as fs from 'fs-extra';
|
|
4
|
+
import Joi from 'joi';
|
|
5
|
+
import * as os from 'os';
|
|
6
6
|
const { boolean, string, number, array } = Joi.types();
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import { totalmem } from 'os';
|
|
8
|
+
import * as path from 'path';
|
|
9
|
+
import * as hdbLogger from '../utility/logging/harper_logger.ts';
|
|
10
|
+
import * as hdbUtils from '../utility/common_utils.ts';
|
|
11
|
+
import * as hdbTerms from '../utility/hdbTerms.ts';
|
|
12
|
+
import * as validator from './validationWrapper.ts';
|
|
13
13
|
|
|
14
14
|
const DEFAULT_LOG_FOLDER = 'log';
|
|
15
15
|
const DEFAULT_COMPONENTS_FOLDER = 'components';
|
|
@@ -24,7 +24,7 @@ const UNDEFINED_OPS_API = 'rootPath config parameter is undefined';
|
|
|
24
24
|
const portConstraints = Joi.alternatives([number.min(0), string])
|
|
25
25
|
.optional()
|
|
26
26
|
.empty(null);
|
|
27
|
-
const routeConstraints = Joi.alternatives([
|
|
27
|
+
export const routeConstraints = Joi.alternatives([
|
|
28
28
|
array
|
|
29
29
|
.items(
|
|
30
30
|
string,
|
|
@@ -44,13 +44,7 @@ const routeConstraints = Joi.alternatives([
|
|
|
44
44
|
let hdbRoot;
|
|
45
45
|
let skipFsVal = false;
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
configValidator,
|
|
49
|
-
routesValidator,
|
|
50
|
-
routeConstraints,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
function configValidator(configJson, skipFsValidation = false) {
|
|
47
|
+
export function configValidator(configJson, skipFsValidation = false) {
|
|
54
48
|
skipFsVal = skipFsValidation;
|
|
55
49
|
hdbRoot = configJson.rootPath;
|
|
56
50
|
if (hdbUtils.isEmpty(hdbRoot)) {
|
|
@@ -72,6 +66,104 @@ function configValidator(configJson, skipFsValidation = false) {
|
|
|
72
66
|
privateKey: pemFileConstraints,
|
|
73
67
|
});
|
|
74
68
|
|
|
69
|
+
// MCP — sub-issue #613 lands the config surface ahead of the transport (#614).
|
|
70
|
+
// Presence-based enablement: a profile is on iff its sub-block exists in
|
|
71
|
+
// config (same convention as `replication`). No `enabled` field.
|
|
72
|
+
const mcpRateLimitSchema = Joi.object({
|
|
73
|
+
perToolPerSecond: number.min(0).optional(),
|
|
74
|
+
perToolBurst: number.min(0).optional(),
|
|
75
|
+
sessionConcurrency: number.min(0).optional(),
|
|
76
|
+
sessionPerSecond: number.min(0).optional(),
|
|
77
|
+
});
|
|
78
|
+
const mcpOperationsSchema = Joi.object({
|
|
79
|
+
mountPath: string.optional().default('/mcp'),
|
|
80
|
+
allow: array.items(string).optional(),
|
|
81
|
+
deny: array.items(string).optional(),
|
|
82
|
+
maxTools: number.min(1).optional(),
|
|
83
|
+
rateLimit: mcpRateLimitSchema.optional(),
|
|
84
|
+
});
|
|
85
|
+
const mcpApplicationSchema = mcpOperationsSchema.keys({
|
|
86
|
+
searchMaxResults: number.min(1).optional(),
|
|
87
|
+
});
|
|
88
|
+
const mcpSessionSchema = Joi.object({
|
|
89
|
+
idleTimeoutSeconds: number.min(1).optional(),
|
|
90
|
+
allowClientDelete: boolean.optional(),
|
|
91
|
+
});
|
|
92
|
+
const mcpSchema = Joi.object({
|
|
93
|
+
operations: mcpOperationsSchema.optional(),
|
|
94
|
+
application: mcpApplicationSchema.optional(),
|
|
95
|
+
session: mcpSessionSchema.optional(),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// Models — `models:` block opts a deployment into the per-backend registry.
|
|
99
|
+
// Per-backend shape is validated by a discriminated alternative on the
|
|
100
|
+
// `backend` field. Phase 2 (#629) lands ollama; Phase 3 (#630) lands openai.
|
|
101
|
+
//
|
|
102
|
+
// `.unknown(false)` on each known backend's schema turns field-name typos
|
|
103
|
+
// (`bakend: ollama`, `hsot: ...`) into boot-blocking validation errors.
|
|
104
|
+
// Without it, Joi's top-level `allowUnknown: true` propagates and typos
|
|
105
|
+
// silently survive into bootstrap. Unknown backend types (anything not in
|
|
106
|
+
// the `switch` list) fall through to a permissive schema so future Harper
|
|
107
|
+
// versions or third-party components can register their own backends
|
|
108
|
+
// without core schema edits — `bootstrapModels` logs+skips at runtime.
|
|
109
|
+
//
|
|
110
|
+
// `requestTimeoutMs: min(1)` (not `min(0)`) so the meaning is unambiguous:
|
|
111
|
+
// omit the field for "no timeout". `0` would validate but `composeSignal`
|
|
112
|
+
// treats it as "no timeout" via `if (!timeoutMs)`, surprising a test that
|
|
113
|
+
// sets 0 to mean "fail immediately".
|
|
114
|
+
const commonEntryFields = {
|
|
115
|
+
model: string.optional(),
|
|
116
|
+
requestTimeoutMs: number.min(1).optional(),
|
|
117
|
+
};
|
|
118
|
+
const ollamaEntrySchema = Joi.object({
|
|
119
|
+
backend: string.valid('ollama').required(),
|
|
120
|
+
host: string.optional(),
|
|
121
|
+
...commonEntryFields,
|
|
122
|
+
}).unknown(false);
|
|
123
|
+
const openaiEntrySchema = Joi.object({
|
|
124
|
+
backend: string.valid('openai').required(),
|
|
125
|
+
// `apiKey` may be a literal secret or a `${ENV_VAR}` placeholder; both
|
|
126
|
+
// are syntactically strings. `bootstrap.ts` runs `expandEnvVarsDeep`
|
|
127
|
+
// before construction; the backend rejects unresolved placeholders
|
|
128
|
+
// with an explicit error pointing at the env-var name.
|
|
129
|
+
apiKey: string.required(),
|
|
130
|
+
baseUrl: string.optional(),
|
|
131
|
+
organization: string.optional(),
|
|
132
|
+
...commonEntryFields,
|
|
133
|
+
}).unknown(false);
|
|
134
|
+
const anthropicEntrySchema = Joi.object({
|
|
135
|
+
backend: string.valid('anthropic').required(),
|
|
136
|
+
// Same secret-handling posture as openai's `apiKey`.
|
|
137
|
+
apiKey: string.required(),
|
|
138
|
+
baseUrl: string.optional(),
|
|
139
|
+
...commonEntryFields,
|
|
140
|
+
}).unknown(false);
|
|
141
|
+
const bedrockEntrySchema = Joi.object({
|
|
142
|
+
backend: string.valid('bedrock').required(),
|
|
143
|
+
// AWS credentials resolve via the SDK chain (env / shared file / IAM
|
|
144
|
+
// roles for service accounts) — no apiKey field. `region` is
|
|
145
|
+
// effectively required (Bedrock is regional) but the backend can
|
|
146
|
+
// fall back to AWS_REGION env, so we leave it optional here.
|
|
147
|
+
region: string.optional(),
|
|
148
|
+
...commonEntryFields,
|
|
149
|
+
}).unknown(false);
|
|
150
|
+
const unknownBackendEntrySchema = Joi.object({
|
|
151
|
+
backend: string.required(),
|
|
152
|
+
}).unknown(true);
|
|
153
|
+
const modelEntrySchema = Joi.alternatives().conditional('.backend', {
|
|
154
|
+
switch: [
|
|
155
|
+
{ is: 'ollama', then: ollamaEntrySchema },
|
|
156
|
+
{ is: 'openai', then: openaiEntrySchema },
|
|
157
|
+
{ is: 'anthropic', then: anthropicEntrySchema },
|
|
158
|
+
{ is: 'bedrock', then: bedrockEntrySchema },
|
|
159
|
+
],
|
|
160
|
+
otherwise: unknownBackendEntrySchema,
|
|
161
|
+
});
|
|
162
|
+
const modelsSchema = Joi.object({
|
|
163
|
+
embedding: Joi.object().pattern(Joi.string(), modelEntrySchema).optional(),
|
|
164
|
+
generative: Joi.object().pattern(Joi.string(), modelEntrySchema).optional(),
|
|
165
|
+
});
|
|
166
|
+
|
|
75
167
|
const configSchema = Joi.object({
|
|
76
168
|
authentication: Joi.alternatives(
|
|
77
169
|
Joi.object({
|
|
@@ -99,6 +191,8 @@ function configValidator(configJson, skipFsValidation = false) {
|
|
|
99
191
|
databases: Joi.alternatives(string, array),
|
|
100
192
|
enableRootCAs: boolean.optional(),
|
|
101
193
|
copyTablesToCatchUp: boolean.optional(),
|
|
194
|
+
pingInterval: number.min(1).optional().empty(null),
|
|
195
|
+
pingTimeout: number.min(1).optional().empty(null),
|
|
102
196
|
}).optional(),
|
|
103
197
|
componentsRoot: rootConstraints.optional(),
|
|
104
198
|
localStudio: Joi.object({
|
|
@@ -201,6 +295,8 @@ function configValidator(configJson, skipFsValidation = false) {
|
|
|
201
295
|
maxFreeSpaceToLoad: number.optional(),
|
|
202
296
|
maxFreeSpaceToRetain: number.optional(),
|
|
203
297
|
}).required(),
|
|
298
|
+
mcp: mcpSchema.optional(),
|
|
299
|
+
models: modelsSchema.optional(),
|
|
204
300
|
ignoreScripts: boolean.optional(),
|
|
205
301
|
tls: Joi.alternatives([Joi.array().items(tlsConstraints), tlsConstraints]),
|
|
206
302
|
});
|
|
@@ -331,7 +427,7 @@ function setDefaultRoot(parent, helpers) {
|
|
|
331
427
|
* @param routesArray
|
|
332
428
|
* @returns {*}
|
|
333
429
|
*/
|
|
334
|
-
function routesValidator(routesArray) {
|
|
430
|
+
export function routesValidator(routesArray) {
|
|
335
431
|
const schema = Joi.object({
|
|
336
432
|
routes: routeConstraints,
|
|
337
433
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import * as validator from './validationWrapper.ts';
|
|
2
|
+
import Joi from 'joi';
|
|
3
|
+
import { hdbTable, hdbDatabase } from './common_validators.ts';
|
|
4
4
|
|
|
5
5
|
const deleteSchema = Joi.object({
|
|
6
6
|
schema: hdbDatabase,
|
|
@@ -10,6 +10,6 @@ const deleteSchema = Joi.object({
|
|
|
10
10
|
ids: Joi.array(),
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
export default function (deleteObject: any) {
|
|
14
14
|
return validator.validateBySchema(deleteObject, deleteSchema);
|
|
15
|
-
}
|
|
15
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import clone from 'clone';
|
|
2
|
+
import * as validator from './validationWrapper.ts';
|
|
3
|
+
import * as commonUtils from '../utility/common_utils.ts';
|
|
4
|
+
import * as hdbTerms from '../utility/hdbTerms.ts';
|
|
5
|
+
import * as fs from 'fs';
|
|
6
|
+
import joi from 'joi';
|
|
7
7
|
const { string } = joi.types();
|
|
8
|
-
|
|
8
|
+
import { hdbErrors, handleHDBError } from '../utility/errors/hdbError.ts';
|
|
9
9
|
const { HTTP_STATUS_CODES } = hdbErrors;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import { commonValidators } from './common_validators.ts';
|
|
12
12
|
|
|
13
13
|
const isRequiredString = ' is required';
|
|
14
14
|
|
|
@@ -96,22 +96,22 @@ const urlSchema = clone(baseJoiSchema);
|
|
|
96
96
|
urlSchema.csv_url = string.uri().messages({ 'string.uri': "'csv_url' must be a valid url" }).required();
|
|
97
97
|
urlSchema.passthrough_headers = joi.object();
|
|
98
98
|
|
|
99
|
-
function dataObject(object) {
|
|
99
|
+
export function dataObject(object) {
|
|
100
100
|
let validateRes = validator.validateObject(object, dataConstraints);
|
|
101
101
|
return postValidateChecks(object, validateRes);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
function urlObject(object) {
|
|
104
|
+
export function urlObject(object) {
|
|
105
105
|
let validateRes = validator.validateBySchema(object, joi.object(urlSchema));
|
|
106
106
|
return postValidateChecks(object, validateRes);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
function fileObject(object) {
|
|
109
|
+
export function fileObject(object) {
|
|
110
110
|
let validateRes = validator.validateObject(object, fileConstraints);
|
|
111
111
|
return postValidateChecks(object, validateRes);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
function s3FileObject(object) {
|
|
114
|
+
export function s3FileObject(object) {
|
|
115
115
|
let validateRes = validator.validateObject(object, s3FileConstraints);
|
|
116
116
|
return postValidateChecks(object, validateRes);
|
|
117
117
|
}
|
|
@@ -144,10 +144,3 @@ function postValidateChecks(object, validateRes) {
|
|
|
144
144
|
}
|
|
145
145
|
return validateRes;
|
|
146
146
|
}
|
|
147
|
-
|
|
148
|
-
module.exports = {
|
|
149
|
-
dataObject,
|
|
150
|
-
urlObject,
|
|
151
|
-
fileObject,
|
|
152
|
-
s3FileObject,
|
|
153
|
-
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { hdbTable, hdbDatabase } from './common_validators.ts';
|
|
2
|
+
import * as validator from './validationWrapper.ts';
|
|
3
|
+
import Joi from 'joi';
|
|
4
4
|
const INVALID_ATTRIBUTE_NAMES = {
|
|
5
5
|
undefined: 'undefined',
|
|
6
6
|
null: 'null',
|
|
@@ -35,6 +35,6 @@ const insertSchema = Joi.object({
|
|
|
35
35
|
records: Joi.array().items(Joi.object().custom(customRecordsVal)).required(),
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
export default function (insertObject: any) {
|
|
39
39
|
return validator.validateBySchema(insertObject, insertSchema);
|
|
40
|
-
}
|
|
40
|
+
}
|