@harperfast/harper 5.0.0-alpha.10
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/CODE_OF_CONDUCT.md +83 -0
- package/LICENSE +201 -0
- package/README.md +54 -0
- package/SECURITY.md +18 -0
- package/SUPPORT.md +26 -0
- package/dist/bin/BinObjects.d.ts +9 -0
- package/dist/bin/BinObjects.js +15 -0
- package/dist/bin/BinObjects.js.map +1 -0
- package/dist/bin/cliOperations.d.ts +12 -0
- package/dist/bin/cliOperations.js +156 -0
- package/dist/bin/cliOperations.js.map +1 -0
- package/dist/bin/copyDb.d.ts +2 -0
- package/dist/bin/copyDb.js +298 -0
- package/dist/bin/copyDb.js.map +1 -0
- package/dist/bin/harper.d.ts +2 -0
- package/dist/bin/harper.js +148 -0
- package/dist/bin/harper.js.map +1 -0
- package/dist/bin/install.d.ts +2 -0
- package/dist/bin/install.js +16 -0
- package/dist/bin/install.js.map +1 -0
- package/dist/bin/lite.d.ts +1 -0
- package/dist/bin/lite.js +6 -0
- package/dist/bin/lite.js.map +1 -0
- package/dist/bin/restart.d.ts +13 -0
- package/dist/bin/restart.js +194 -0
- package/dist/bin/restart.js.map +1 -0
- package/dist/bin/run.d.ts +21 -0
- package/dist/bin/run.js +365 -0
- package/dist/bin/run.js.map +1 -0
- package/dist/bin/status.d.ts +2 -0
- package/dist/bin/status.js +56 -0
- package/dist/bin/status.js.map +1 -0
- package/dist/bin/stop.d.ts +2 -0
- package/dist/bin/stop.js +17 -0
- package/dist/bin/stop.js.map +1 -0
- package/dist/bin/upgrade.d.ts +7 -0
- package/dist/bin/upgrade.js +111 -0
- package/dist/bin/upgrade.js.map +1 -0
- package/dist/components/Application.d.ts +110 -0
- package/dist/components/Application.js +509 -0
- package/dist/components/Application.js.map +1 -0
- package/dist/components/ApplicationScope.d.ts +28 -0
- package/dist/components/ApplicationScope.js +81 -0
- package/dist/components/ApplicationScope.js.map +1 -0
- package/dist/components/Component.d.ts +21 -0
- package/dist/components/Component.js +43 -0
- package/dist/components/Component.js.map +1 -0
- package/dist/components/ComponentV1.d.ts +69 -0
- package/dist/components/ComponentV1.js +263 -0
- package/dist/components/ComponentV1.js.map +1 -0
- package/dist/components/DEFAULT_CONFIG.d.ts +18 -0
- package/dist/components/DEFAULT_CONFIG.js +22 -0
- package/dist/components/DEFAULT_CONFIG.js.map +1 -0
- package/dist/components/EntryHandler.d.ts +61 -0
- package/dist/components/EntryHandler.js +148 -0
- package/dist/components/EntryHandler.js.map +1 -0
- package/dist/components/OptionsWatcher.d.ts +75 -0
- package/dist/components/OptionsWatcher.js +281 -0
- package/dist/components/OptionsWatcher.js.map +1 -0
- package/dist/components/PluginModule.d.ts +5 -0
- package/dist/components/PluginModule.js +3 -0
- package/dist/components/PluginModule.js.map +1 -0
- package/dist/components/Scope.d.ts +49 -0
- package/dist/components/Scope.js +262 -0
- package/dist/components/Scope.js.map +1 -0
- package/dist/components/componentLoader.js +498 -0
- package/dist/components/componentLoader.js.map +1 -0
- package/dist/components/deriveCommonPatternBase.d.ts +1 -0
- package/dist/components/deriveCommonPatternBase.js +34 -0
- package/dist/components/deriveCommonPatternBase.js.map +1 -0
- package/dist/components/deriveGlobOptions.d.ts +13 -0
- package/dist/components/deriveGlobOptions.js +30 -0
- package/dist/components/deriveGlobOptions.js.map +1 -0
- package/dist/components/deriveURLPath.d.ts +3 -0
- package/dist/components/deriveURLPath.js +55 -0
- package/dist/components/deriveURLPath.js.map +1 -0
- package/dist/components/operations.d.ts +97 -0
- package/dist/components/operations.js +556 -0
- package/dist/components/operations.js.map +1 -0
- package/dist/components/operationsValidation.d.ts +44 -0
- package/dist/components/operationsValidation.js +221 -0
- package/dist/components/operationsValidation.js.map +1 -0
- package/dist/components/packageComponent.d.ts +8 -0
- package/dist/components/packageComponent.js +42 -0
- package/dist/components/packageComponent.js.map +1 -0
- package/dist/components/requestRestart.d.ts +3 -0
- package/dist/components/requestRestart.js +27 -0
- package/dist/components/requestRestart.js.map +1 -0
- package/dist/components/resolveBaseURLPath.d.ts +15 -0
- package/dist/components/resolveBaseURLPath.js +38 -0
- package/dist/components/resolveBaseURLPath.js.map +1 -0
- package/dist/components/status/ComponentStatus.d.ts +61 -0
- package/dist/components/status/ComponentStatus.js +102 -0
- package/dist/components/status/ComponentStatus.js.map +1 -0
- package/dist/components/status/ComponentStatusRegistry.d.ts +89 -0
- package/dist/components/status/ComponentStatusRegistry.js +195 -0
- package/dist/components/status/ComponentStatusRegistry.js.map +1 -0
- package/dist/components/status/api.d.ts +104 -0
- package/dist/components/status/api.js +137 -0
- package/dist/components/status/api.js.map +1 -0
- package/dist/components/status/crossThread.d.ts +62 -0
- package/dist/components/status/crossThread.js +343 -0
- package/dist/components/status/crossThread.js.map +1 -0
- package/dist/components/status/errors.d.ts +68 -0
- package/dist/components/status/errors.js +123 -0
- package/dist/components/status/errors.js.map +1 -0
- package/dist/components/status/index.d.ts +35 -0
- package/dist/components/status/index.js +75 -0
- package/dist/components/status/index.js.map +1 -0
- package/dist/components/status/internal.d.ts +40 -0
- package/dist/components/status/internal.js +76 -0
- package/dist/components/status/internal.js.map +1 -0
- package/dist/components/status/registry.d.ts +10 -0
- package/dist/components/status/registry.js +14 -0
- package/dist/components/status/registry.js.map +1 -0
- package/dist/components/status/types.d.ts +94 -0
- package/dist/components/status/types.js +20 -0
- package/dist/components/status/types.js.map +1 -0
- package/dist/config/RootConfigWatcher.d.ts +10 -0
- package/dist/config/RootConfigWatcher.js +59 -0
- package/dist/config/RootConfigWatcher.js.map +1 -0
- package/dist/config/configHelpers.d.ts +6 -0
- package/dist/config/configHelpers.js +47 -0
- package/dist/config/configHelpers.js.map +1 -0
- package/dist/config/configUtils.d.ts +85 -0
- package/dist/config/configUtils.js +801 -0
- package/dist/config/configUtils.js.map +1 -0
- package/dist/config/harperConfigEnvVars.d.ts +46 -0
- package/dist/config/harperConfigEnvVars.js +527 -0
- package/dist/config/harperConfigEnvVars.js.map +1 -0
- package/dist/dataLayer/CreateAttributeObject.d.ts +19 -0
- package/dist/dataLayer/CreateAttributeObject.js +23 -0
- package/dist/dataLayer/CreateAttributeObject.js.map +1 -0
- package/dist/dataLayer/CreateTableObject.d.ts +7 -0
- package/dist/dataLayer/CreateTableObject.js +10 -0
- package/dist/dataLayer/CreateTableObject.js.map +1 -0
- package/dist/dataLayer/DataLayerObjects.d.ts +22 -0
- package/dist/dataLayer/DataLayerObjects.js +33 -0
- package/dist/dataLayer/DataLayerObjects.js.map +1 -0
- package/dist/dataLayer/DeleteBeforeObject.d.ts +18 -0
- package/dist/dataLayer/DeleteBeforeObject.js +21 -0
- package/dist/dataLayer/DeleteBeforeObject.js.map +1 -0
- package/dist/dataLayer/DeleteObject.d.ts +19 -0
- package/dist/dataLayer/DeleteObject.js +23 -0
- package/dist/dataLayer/DeleteObject.js.map +1 -0
- package/dist/dataLayer/DropAttributeObject.d.ts +7 -0
- package/dist/dataLayer/DropAttributeObject.js +10 -0
- package/dist/dataLayer/DropAttributeObject.js.map +1 -0
- package/dist/dataLayer/GetBackupObject.d.ts +16 -0
- package/dist/dataLayer/GetBackupObject.js +20 -0
- package/dist/dataLayer/GetBackupObject.js.map +1 -0
- package/dist/dataLayer/InsertObject.d.ts +20 -0
- package/dist/dataLayer/InsertObject.js +24 -0
- package/dist/dataLayer/InsertObject.js.map +1 -0
- package/dist/dataLayer/ReadAuditLogObject.d.ts +18 -0
- package/dist/dataLayer/ReadAuditLogObject.js +22 -0
- package/dist/dataLayer/ReadAuditLogObject.js.map +1 -0
- package/dist/dataLayer/SQLSearch.d.ts +171 -0
- package/dist/dataLayer/SQLSearch.js +1168 -0
- package/dist/dataLayer/SQLSearch.js.map +1 -0
- package/dist/dataLayer/SearchByConditionsObject.d.ts +85 -0
- package/dist/dataLayer/SearchByConditionsObject.js +57 -0
- package/dist/dataLayer/SearchByConditionsObject.js.map +1 -0
- package/dist/dataLayer/SearchByHashObject.d.ts +17 -0
- package/dist/dataLayer/SearchByHashObject.js +20 -0
- package/dist/dataLayer/SearchByHashObject.js.map +1 -0
- package/dist/dataLayer/SearchObject.d.ts +30 -0
- package/dist/dataLayer/SearchObject.js +33 -0
- package/dist/dataLayer/SearchObject.js.map +1 -0
- package/dist/dataLayer/SqlSearchObject.d.ts +10 -0
- package/dist/dataLayer/SqlSearchObject.js +13 -0
- package/dist/dataLayer/SqlSearchObject.js.map +1 -0
- package/dist/dataLayer/UpdateObject.d.ts +18 -0
- package/dist/dataLayer/UpdateObject.js +22 -0
- package/dist/dataLayer/UpdateObject.js.map +1 -0
- package/dist/dataLayer/UpsertObject.d.ts +18 -0
- package/dist/dataLayer/UpsertObject.js +22 -0
- package/dist/dataLayer/UpsertObject.js.map +1 -0
- package/dist/dataLayer/bulkLoad.d.ts +28 -0
- package/dist/dataLayer/bulkLoad.js +624 -0
- package/dist/dataLayer/bulkLoad.js.map +1 -0
- package/dist/dataLayer/dataObjects/BulkLoadObjects.d.ts +17 -0
- package/dist/dataLayer/dataObjects/BulkLoadObjects.js +25 -0
- package/dist/dataLayer/dataObjects/BulkLoadObjects.js.map +1 -0
- package/dist/dataLayer/dataObjects/UpsertObject.d.ts +18 -0
- package/dist/dataLayer/dataObjects/UpsertObject.js +22 -0
- package/dist/dataLayer/dataObjects/UpsertObject.js.map +1 -0
- package/dist/dataLayer/delete.d.ts +22 -0
- package/dist/dataLayer/delete.js +111 -0
- package/dist/dataLayer/delete.js.map +1 -0
- package/dist/dataLayer/export.d.ts +15 -0
- package/dist/dataLayer/export.js +302 -0
- package/dist/dataLayer/export.js.map +1 -0
- package/dist/dataLayer/getBackup.d.ts +8 -0
- package/dist/dataLayer/getBackup.js +28 -0
- package/dist/dataLayer/getBackup.js.map +1 -0
- package/dist/dataLayer/harperBridge/BridgeMethods.d.ts +24 -0
- package/dist/dataLayer/harperBridge/BridgeMethods.js +62 -0
- package/dist/dataLayer/harperBridge/BridgeMethods.js.map +1 -0
- package/dist/dataLayer/harperBridge/ResourceBridge.d.ts +104 -0
- package/dist/dataLayer/harperBridge/ResourceBridge.js +630 -0
- package/dist/dataLayer/harperBridge/ResourceBridge.js.map +1 -0
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateReturnObj.d.ts +14 -0
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateReturnObj.js +24 -0
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateReturnObj.js.map +1 -0
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.d.ts +11 -0
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js +68 -0
- package/dist/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js.map +1 -0
- package/dist/dataLayer/harperBridge/harperBridge.d.ts +2 -0
- package/dist/dataLayer/harperBridge/harperBridge.js +18 -0
- package/dist/dataLayer/harperBridge/harperBridge.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/LMDBBridge.d.ts +47 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/LMDBBridge.js +99 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/LMDBBridge.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.d.ts +15 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.js +18 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.d.ts +12 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js +74 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.d.ts +13 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js +54 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.d.ts +6 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js +23 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.d.ts +8 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js +62 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.d.ts +8 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js +82 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.d.ts +11 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js +76 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.d.ts +9 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js +83 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.d.ts +6 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js +73 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.d.ts +6 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js +110 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.d.ts +14 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js +33 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.d.ts +7 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js +110 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.d.ts +6 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js +21 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.d.ts +14 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js +25 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.d.ts +7 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js +180 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.d.ts +8 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js +134 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.d.ts +6 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js +14 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.d.ts +15 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js +26 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbTransaction.d.ts +8 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbTransaction.js +17 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbTransaction.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.d.ts +12 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js +52 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.d.ts +15 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js +56 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.d.ts +16 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js +20 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBDeleteTransactionObject.d.ts +16 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBDeleteTransactionObject.js +22 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBDeleteTransactionObject.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBInsertTransactionObject.d.ts +16 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBInsertTransactionObject.js +21 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBInsertTransactionObject.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBTransactionObject.d.ts +19 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBTransactionObject.js +22 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBTransactionObject.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBUpdateTransactionObject.d.ts +18 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBUpdateTransactionObject.js +23 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBUpdateTransactionObject.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBUpsertTransactionObject.d.ts +18 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBUpsertTransactionObject.js +23 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBUpsertTransactionObject.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/TableSizeObject.d.ts +21 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/TableSizeObject.js +24 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/TableSizeObject.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.d.ts +7 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js +19 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.d.ts +22 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +137 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.d.ts +9 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js +73 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.d.ts +8 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js +38 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.d.ts +8 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.js +29 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.d.ts +17 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js +63 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.d.ts +106 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js +251 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js.map +1 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.d.ts +8 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js +66 -0
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js.map +1 -0
- package/dist/dataLayer/hdbInfoController.d.ts +28 -0
- package/dist/dataLayer/hdbInfoController.js +203 -0
- package/dist/dataLayer/hdbInfoController.js.map +1 -0
- package/dist/dataLayer/insert.d.ts +44 -0
- package/dist/dataLayer/insert.js +192 -0
- package/dist/dataLayer/insert.js.map +1 -0
- package/dist/dataLayer/readAuditLog.d.ts +8 -0
- package/dist/dataLayer/readAuditLog.js +37 -0
- package/dist/dataLayer/readAuditLog.js.map +1 -0
- package/dist/dataLayer/schema.d.ts +24 -0
- package/dist/dataLayer/schema.js +225 -0
- package/dist/dataLayer/schema.js.map +1 -0
- package/dist/dataLayer/schemaDescribe.d.ts +26 -0
- package/dist/dataLayer/schemaDescribe.js +265 -0
- package/dist/dataLayer/schemaDescribe.js.map +1 -0
- package/dist/dataLayer/search.d.ts +4 -0
- package/dist/dataLayer/search.js +56 -0
- package/dist/dataLayer/search.js.map +1 -0
- package/dist/dataLayer/transaction.d.ts +8 -0
- package/dist/dataLayer/transaction.js +16 -0
- package/dist/dataLayer/transaction.js.map +1 -0
- package/dist/dataLayer/update.d.ts +15 -0
- package/dist/dataLayer/update.js +107 -0
- package/dist/dataLayer/update.js.map +1 -0
- package/dist/globals.d.ts +7 -0
- package/dist/globals.js +12 -0
- package/dist/globals.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/json/systemSchema.json +373 -0
- package/dist/launchServiceScripts/utility/checkNodeVersion.d.ts +4 -0
- package/dist/launchServiceScripts/utility/checkNodeVersion.js +13 -0
- package/dist/launchServiceScripts/utility/checkNodeVersion.js.map +1 -0
- package/dist/resources/DatabaseTransaction.d.ts +96 -0
- package/dist/resources/DatabaseTransaction.js +354 -0
- package/dist/resources/DatabaseTransaction.js.map +1 -0
- package/dist/resources/ErrorResource.d.ts +26 -0
- package/dist/resources/ErrorResource.js +60 -0
- package/dist/resources/ErrorResource.js.map +1 -0
- package/dist/resources/IterableEventQueue.d.ts +19 -0
- package/dist/resources/IterableEventQueue.js +103 -0
- package/dist/resources/IterableEventQueue.js.map +1 -0
- package/dist/resources/LMDBTransaction.d.ts +43 -0
- package/dist/resources/LMDBTransaction.js +371 -0
- package/dist/resources/LMDBTransaction.js.map +1 -0
- package/dist/resources/RecordEncoder.d.ts +65 -0
- package/dist/resources/RecordEncoder.js +700 -0
- package/dist/resources/RecordEncoder.js.map +1 -0
- package/dist/resources/RequestTarget.d.ts +57 -0
- package/dist/resources/RequestTarget.js +91 -0
- package/dist/resources/RequestTarget.js.map +1 -0
- package/dist/resources/Resource.d.ts +152 -0
- package/dist/resources/Resource.js +727 -0
- package/dist/resources/Resource.js.map +1 -0
- package/dist/resources/ResourceInterface.d.ts +162 -0
- package/dist/resources/ResourceInterface.js +3 -0
- package/dist/resources/ResourceInterface.js.map +1 -0
- package/dist/resources/ResourceInterfaceV2.d.ts +21 -0
- package/dist/resources/ResourceInterfaceV2.js +3 -0
- package/dist/resources/ResourceInterfaceV2.js.map +1 -0
- package/dist/resources/ResourceV2.d.ts +30 -0
- package/dist/resources/ResourceV2.js +27 -0
- package/dist/resources/ResourceV2.js.map +1 -0
- package/dist/resources/Resources.d.ts +36 -0
- package/dist/resources/Resources.js +155 -0
- package/dist/resources/Resources.js.map +1 -0
- package/dist/resources/RocksIndexStore.d.ts +24 -0
- package/dist/resources/RocksIndexStore.js +54 -0
- package/dist/resources/RocksIndexStore.js.map +1 -0
- package/dist/resources/RocksTransactionLogStore.d.ts +60 -0
- package/dist/resources/RocksTransactionLogStore.js +344 -0
- package/dist/resources/RocksTransactionLogStore.js.map +1 -0
- package/dist/resources/Table.d.ts +854 -0
- package/dist/resources/Table.js +4350 -0
- package/dist/resources/Table.js.map +1 -0
- package/dist/resources/analytics/hostnames.d.ts +16 -0
- package/dist/resources/analytics/hostnames.js +72 -0
- package/dist/resources/analytics/hostnames.js.map +1 -0
- package/dist/resources/analytics/metadata.d.ts +9 -0
- package/dist/resources/analytics/metadata.js +12 -0
- package/dist/resources/analytics/metadata.js.map +1 -0
- package/dist/resources/analytics/profile.d.ts +2 -0
- package/dist/resources/analytics/profile.js +144 -0
- package/dist/resources/analytics/profile.js.map +1 -0
- package/dist/resources/analytics/read.d.ts +41 -0
- package/dist/resources/analytics/read.js +189 -0
- package/dist/resources/analytics/read.js.map +1 -0
- package/dist/resources/analytics/write.d.ts +131 -0
- package/dist/resources/analytics/write.js +822 -0
- package/dist/resources/analytics/write.js.map +1 -0
- package/dist/resources/auditStore.d.ts +81 -0
- package/dist/resources/auditStore.js +572 -0
- package/dist/resources/auditStore.js.map +1 -0
- package/dist/resources/blob.d.ts +137 -0
- package/dist/resources/blob.js +1273 -0
- package/dist/resources/blob.js.map +1 -0
- package/dist/resources/crdt.d.ts +19 -0
- package/dist/resources/crdt.js +146 -0
- package/dist/resources/crdt.js.map +1 -0
- package/dist/resources/dataLoader.d.ts +98 -0
- package/dist/resources/dataLoader.js +461 -0
- package/dist/resources/dataLoader.js.map +1 -0
- package/dist/resources/databases.d.ts +131 -0
- package/dist/resources/databases.js +1220 -0
- package/dist/resources/databases.js.map +1 -0
- package/dist/resources/graphql.d.ts +19 -0
- package/dist/resources/graphql.js +223 -0
- package/dist/resources/graphql.js.map +1 -0
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +87 -0
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +598 -0
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -0
- package/dist/resources/indexes/customIndexes.d.ts +4 -0
- package/dist/resources/indexes/customIndexes.js +10 -0
- package/dist/resources/indexes/customIndexes.js.map +1 -0
- package/dist/resources/indexes/vector.d.ts +2 -0
- package/dist/resources/indexes/vector.js +40 -0
- package/dist/resources/indexes/vector.js.map +1 -0
- package/dist/resources/jsResource.d.ts +24 -0
- package/dist/resources/jsResource.js +82 -0
- package/dist/resources/jsResource.js.map +1 -0
- package/dist/resources/loadEnv.d.ts +5 -0
- package/dist/resources/loadEnv.js +28 -0
- package/dist/resources/loadEnv.js.map +1 -0
- package/dist/resources/login.d.ts +3 -0
- package/dist/resources/login.js +22 -0
- package/dist/resources/login.js.map +1 -0
- package/dist/resources/openApi.d.ts +27 -0
- package/dist/resources/openApi.js +327 -0
- package/dist/resources/openApi.js.map +1 -0
- package/dist/resources/registrationDeprecated.d.ts +4 -0
- package/dist/resources/registrationDeprecated.js +11 -0
- package/dist/resources/registrationDeprecated.js.map +1 -0
- package/dist/resources/replayLogs.d.ts +2 -0
- package/dist/resources/replayLogs.js +170 -0
- package/dist/resources/replayLogs.js.map +1 -0
- package/dist/resources/roles.d.ts +11 -0
- package/dist/resources/roles.js +102 -0
- package/dist/resources/roles.js.map +1 -0
- package/dist/resources/search.d.ts +39 -0
- package/dist/resources/search.js +1333 -0
- package/dist/resources/search.js.map +1 -0
- package/dist/resources/tracked.d.ts +49 -0
- package/dist/resources/tracked.js +665 -0
- package/dist/resources/tracked.js.map +1 -0
- package/dist/resources/transaction.d.ts +9 -0
- package/dist/resources/transaction.js +89 -0
- package/dist/resources/transaction.js.map +1 -0
- package/dist/resources/transactionBroadcast.d.ts +38 -0
- package/dist/resources/transactionBroadcast.js +263 -0
- package/dist/resources/transactionBroadcast.js.map +1 -0
- package/dist/security/auth.d.ts +9 -0
- package/dist/security/auth.js +408 -0
- package/dist/security/auth.js.map +1 -0
- package/dist/security/certificateVerification/certificateVerificationSource.d.ts +18 -0
- package/dist/security/certificateVerification/certificateVerificationSource.js +78 -0
- package/dist/security/certificateVerification/certificateVerificationSource.js.map +1 -0
- package/dist/security/certificateVerification/configValidation.d.ts +14 -0
- package/dist/security/certificateVerification/configValidation.js +101 -0
- package/dist/security/certificateVerification/configValidation.js.map +1 -0
- package/dist/security/certificateVerification/crlVerification.d.ts +29 -0
- package/dist/security/certificateVerification/crlVerification.js +564 -0
- package/dist/security/certificateVerification/crlVerification.js.map +1 -0
- package/dist/security/certificateVerification/index.d.ts +31 -0
- package/dist/security/certificateVerification/index.js +111 -0
- package/dist/security/certificateVerification/index.js.map +1 -0
- package/dist/security/certificateVerification/ocspVerification.d.ts +23 -0
- package/dist/security/certificateVerification/ocspVerification.js +117 -0
- package/dist/security/certificateVerification/ocspVerification.js.map +1 -0
- package/dist/security/certificateVerification/pkijs-ed25519-patch.d.ts +14 -0
- package/dist/security/certificateVerification/pkijs-ed25519-patch.js +183 -0
- package/dist/security/certificateVerification/pkijs-ed25519-patch.js.map +1 -0
- package/dist/security/certificateVerification/types.d.ts +105 -0
- package/dist/security/certificateVerification/types.js +6 -0
- package/dist/security/certificateVerification/types.js.map +1 -0
- package/dist/security/certificateVerification/verificationConfig.d.ts +29 -0
- package/dist/security/certificateVerification/verificationConfig.js +121 -0
- package/dist/security/certificateVerification/verificationConfig.js.map +1 -0
- package/dist/security/certificateVerification/verificationUtils.d.ts +79 -0
- package/dist/security/certificateVerification/verificationUtils.js +441 -0
- package/dist/security/certificateVerification/verificationUtils.js.map +1 -0
- package/dist/security/cryptoHash.d.ts +2 -0
- package/dist/security/cryptoHash.js +35 -0
- package/dist/security/cryptoHash.js.map +1 -0
- package/dist/security/data_objects/PermissionAttributeResponseObject.d.ts +11 -0
- package/dist/security/data_objects/PermissionAttributeResponseObject.js +14 -0
- package/dist/security/data_objects/PermissionAttributeResponseObject.js.map +1 -0
- package/dist/security/data_objects/PermissionResponseObject.d.ts +57 -0
- package/dist/security/data_objects/PermissionResponseObject.js +105 -0
- package/dist/security/data_objects/PermissionResponseObject.js.map +1 -0
- package/dist/security/data_objects/PermissionTableResponseObject.d.ts +16 -0
- package/dist/security/data_objects/PermissionTableResponseObject.js +19 -0
- package/dist/security/data_objects/PermissionTableResponseObject.js.map +1 -0
- package/dist/security/fastifyAuth.d.ts +2 -0
- package/dist/security/fastifyAuth.js +135 -0
- package/dist/security/fastifyAuth.js.map +1 -0
- package/dist/security/impersonation.d.ts +11 -0
- package/dist/security/impersonation.js +139 -0
- package/dist/security/impersonation.js.map +1 -0
- package/dist/security/jsLoader.d.ts +9 -0
- package/dist/security/jsLoader.js +522 -0
- package/dist/security/jsLoader.js.map +1 -0
- package/dist/security/keys.d.ts +119 -0
- package/dist/security/keys.js +866 -0
- package/dist/security/keys.js.map +1 -0
- package/dist/security/permissionsTranslator.d.ts +9 -0
- package/dist/security/permissionsTranslator.js +269 -0
- package/dist/security/permissionsTranslator.js.map +1 -0
- package/dist/security/role.d.ts +5 -0
- package/dist/security/role.js +160 -0
- package/dist/security/role.js.map +1 -0
- package/dist/security/tokenAuthentication.d.ts +38 -0
- package/dist/security/tokenAuthentication.js +205 -0
- package/dist/security/tokenAuthentication.js.map +1 -0
- package/dist/security/user.d.ts +77 -0
- package/dist/security/user.js +349 -0
- package/dist/security/user.js.map +1 -0
- package/dist/server/DurableSubscriptionsSession.d.ts +74 -0
- package/dist/server/DurableSubscriptionsSession.js +511 -0
- package/dist/server/DurableSubscriptionsSession.js.map +1 -0
- package/dist/server/REST.d.ts +16 -0
- package/dist/server/REST.js +423 -0
- package/dist/server/REST.js.map +1 -0
- package/dist/server/Server.d.ts +62 -0
- package/dist/server/Server.js +27 -0
- package/dist/server/Server.js.map +1 -0
- package/dist/server/fastifyRoutes/helpers/getCORSOptions.d.ts +11 -0
- package/dist/server/fastifyRoutes/helpers/getCORSOptions.js +32 -0
- package/dist/server/fastifyRoutes/helpers/getCORSOptions.js.map +1 -0
- package/dist/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.d.ts +6 -0
- package/dist/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js +13 -0
- package/dist/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js.map +1 -0
- package/dist/server/fastifyRoutes/helpers/getServerOptions.d.ts +12 -0
- package/dist/server/fastifyRoutes/helpers/getServerOptions.js +30 -0
- package/dist/server/fastifyRoutes/helpers/getServerOptions.js.map +1 -0
- package/dist/server/fastifyRoutes/plugins/hdbCore.d.ts +2 -0
- package/dist/server/fastifyRoutes/plugins/hdbCore.js +31 -0
- package/dist/server/fastifyRoutes/plugins/hdbCore.js.map +1 -0
- package/dist/server/fastifyRoutes.d.ts +25 -0
- package/dist/server/fastifyRoutes.js +235 -0
- package/dist/server/fastifyRoutes.js.map +1 -0
- package/dist/server/graphqlQuerying.d.ts +1 -0
- package/dist/server/graphqlQuerying.js +630 -0
- package/dist/server/graphqlQuerying.js.map +1 -0
- package/dist/server/http.d.ts +15 -0
- package/dist/server/http.js +650 -0
- package/dist/server/http.js.map +1 -0
- package/dist/server/itc/serverHandlers.d.ts +10 -0
- package/dist/server/itc/serverHandlers.js +153 -0
- package/dist/server/itc/serverHandlers.js.map +1 -0
- package/dist/server/itc/utility/ITCEventObject.d.ts +6 -0
- package/dist/server/itc/utility/ITCEventObject.js +9 -0
- package/dist/server/itc/utility/ITCEventObject.js.map +1 -0
- package/dist/server/jobs/JobObject.d.ts +15 -0
- package/dist/server/jobs/JobObject.js +22 -0
- package/dist/server/jobs/JobObject.js.map +1 -0
- package/dist/server/jobs/jobProcess.d.ts +1 -0
- package/dist/server/jobs/jobProcess.js +66 -0
- package/dist/server/jobs/jobProcess.js.map +1 -0
- package/dist/server/jobs/jobRunner.d.ts +11 -0
- package/dist/server/jobs/jobRunner.js +160 -0
- package/dist/server/jobs/jobRunner.js.map +1 -0
- package/dist/server/jobs/jobs.d.ts +20 -0
- package/dist/server/jobs/jobs.js +267 -0
- package/dist/server/jobs/jobs.js.map +1 -0
- package/dist/server/loadRootComponents.d.ts +5 -0
- package/dist/server/loadRootComponents.js +45 -0
- package/dist/server/loadRootComponents.js.map +1 -0
- package/dist/server/mqtt.d.ts +9 -0
- package/dist/server/mqtt.js +466 -0
- package/dist/server/mqtt.js.map +1 -0
- package/dist/server/nodeName.d.ts +5 -0
- package/dist/server/nodeName.js +84 -0
- package/dist/server/nodeName.js.map +1 -0
- package/dist/server/operationsServer.d.ts +48 -0
- package/dist/server/operationsServer.js +265 -0
- package/dist/server/operationsServer.js.map +1 -0
- package/dist/server/serverHelpers/Headers.d.ts +20 -0
- package/dist/server/serverHelpers/Headers.js +134 -0
- package/dist/server/serverHelpers/Headers.js.map +1 -0
- package/dist/server/serverHelpers/JSONStream.d.ts +14 -0
- package/dist/server/serverHelpers/JSONStream.js +322 -0
- package/dist/server/serverHelpers/JSONStream.js.map +1 -0
- package/dist/server/serverHelpers/OperationFunctionObject.d.ts +9 -0
- package/dist/server/serverHelpers/OperationFunctionObject.js +17 -0
- package/dist/server/serverHelpers/OperationFunctionObject.js.map +1 -0
- package/dist/server/serverHelpers/Request.d.ts +69 -0
- package/dist/server/serverHelpers/Request.js +141 -0
- package/dist/server/serverHelpers/Request.js.map +1 -0
- package/dist/server/serverHelpers/contentTypes.d.ts +57 -0
- package/dist/server/serverHelpers/contentTypes.js +639 -0
- package/dist/server/serverHelpers/contentTypes.js.map +1 -0
- package/dist/server/serverHelpers/requestTimePlugin.d.ts +2 -0
- package/dist/server/serverHelpers/requestTimePlugin.js +56 -0
- package/dist/server/serverHelpers/requestTimePlugin.js.map +1 -0
- package/dist/server/serverHelpers/serverHandlers.d.ts +6 -0
- package/dist/server/serverHelpers/serverHandlers.js +130 -0
- package/dist/server/serverHelpers/serverHandlers.js.map +1 -0
- package/dist/server/serverHelpers/serverUtilities.d.ts +29 -0
- package/dist/server/serverHelpers/serverUtilities.js +356 -0
- package/dist/server/serverHelpers/serverUtilities.js.map +1 -0
- package/dist/server/serverRegistry.d.ts +3 -0
- package/dist/server/serverRegistry.js +11 -0
- package/dist/server/serverRegistry.js.map +1 -0
- package/dist/server/static.d.ts +16 -0
- package/dist/server/static.js +164 -0
- package/dist/server/static.js.map +1 -0
- package/dist/server/status/definitions.d.ts +27 -0
- package/dist/server/status/definitions.js +22 -0
- package/dist/server/status/definitions.js.map +1 -0
- package/dist/server/status/index.d.ts +26 -0
- package/dist/server/status/index.js +89 -0
- package/dist/server/status/index.js.map +1 -0
- package/dist/server/storageReclamation.d.ts +18 -0
- package/dist/server/storageReclamation.js +96 -0
- package/dist/server/storageReclamation.js.map +1 -0
- package/dist/server/threads/itc.d.ts +53 -0
- package/dist/server/threads/itc.js +81 -0
- package/dist/server/threads/itc.js.map +1 -0
- package/dist/server/threads/manageThreads.d.ts +30 -0
- package/dist/server/threads/manageThreads.js +579 -0
- package/dist/server/threads/manageThreads.js.map +1 -0
- package/dist/server/threads/socketRouter.d.ts +6 -0
- package/dist/server/threads/socketRouter.js +395 -0
- package/dist/server/threads/socketRouter.js.map +1 -0
- package/dist/server/threads/threadServer.d.ts +5 -0
- package/dist/server/threads/threadServer.js +288 -0
- package/dist/server/threads/threadServer.js.map +1 -0
- package/dist/server/throttle.d.ts +7 -0
- package/dist/server/throttle.js +71 -0
- package/dist/server/throttle.js.map +1 -0
- package/dist/sqlTranslator/SelectValidator.d.ts +79 -0
- package/dist/sqlTranslator/SelectValidator.js +274 -0
- package/dist/sqlTranslator/SelectValidator.js.map +1 -0
- package/dist/sqlTranslator/alasqlFunctionImporter.d.ts +2 -0
- package/dist/sqlTranslator/alasqlFunctionImporter.js +55 -0
- package/dist/sqlTranslator/alasqlFunctionImporter.js.map +1 -0
- package/dist/sqlTranslator/deleteTranslator.d.ts +2 -0
- package/dist/sqlTranslator/deleteTranslator.js +56 -0
- package/dist/sqlTranslator/deleteTranslator.js.map +1 -0
- package/dist/sqlTranslator/index.d.ts +16 -0
- package/dist/sqlTranslator/index.js +215 -0
- package/dist/sqlTranslator/index.js.map +1 -0
- package/dist/sqlTranslator/sql_statement_bucket.d.ts +46 -0
- package/dist/sqlTranslator/sql_statement_bucket.js +430 -0
- package/dist/sqlTranslator/sql_statement_bucket.js.map +1 -0
- package/dist/upgrade/UpgradeObjects.d.ts +5 -0
- package/dist/upgrade/UpgradeObjects.js +12 -0
- package/dist/upgrade/UpgradeObjects.js.map +1 -0
- package/dist/upgrade/directives/directivesController.d.ts +30 -0
- package/dist/upgrade/directives/directivesController.js +76 -0
- package/dist/upgrade/directives/directivesController.js.map +1 -0
- package/dist/upgrade/directivesManager.d.ts +7 -0
- package/dist/upgrade/directivesManager.js +125 -0
- package/dist/upgrade/directivesManager.js.map +1 -0
- package/dist/upgrade/upgradePrompt.d.ts +13 -0
- package/dist/upgrade/upgradePrompt.js +102 -0
- package/dist/upgrade/upgradePrompt.js.map +1 -0
- package/dist/upgrade/upgradeUtilities.d.ts +10 -0
- package/dist/upgrade/upgradeUtilities.js +26 -0
- package/dist/upgrade/upgradeUtilities.js.map +1 -0
- package/dist/utility/AWS/AWSConnector.d.ts +2 -0
- package/dist/utility/AWS/AWSConnector.js +26 -0
- package/dist/utility/AWS/AWSConnector.js.map +1 -0
- package/dist/utility/OperationFunctionCaller.d.ts +9 -0
- package/dist/utility/OperationFunctionCaller.js +58 -0
- package/dist/utility/OperationFunctionCaller.js.map +1 -0
- package/dist/utility/assignCmdEnvVariables.d.ts +10 -0
- package/dist/utility/assignCmdEnvVariables.js +55 -0
- package/dist/utility/assignCmdEnvVariables.js.map +1 -0
- package/dist/utility/common_utils.d.ts +264 -0
- package/dist/utility/common_utils.js +806 -0
- package/dist/utility/common_utils.js.map +1 -0
- package/dist/utility/environment/environmentManager.d.ts +41 -0
- package/dist/utility/environment/environmentManager.js +179 -0
- package/dist/utility/environment/environmentManager.js.map +1 -0
- package/dist/utility/environment/systemInformation.d.ts +67 -0
- package/dist/utility/environment/systemInformation.js +326 -0
- package/dist/utility/environment/systemInformation.js.map +1 -0
- package/dist/utility/errors/commonErrors.d.ts +171 -0
- package/dist/utility/errors/commonErrors.js +230 -0
- package/dist/utility/errors/commonErrors.js.map +1 -0
- package/dist/utility/errors/hdbError.d.ts +76 -0
- package/dist/utility/errors/hdbError.js +128 -0
- package/dist/utility/errors/hdbError.js.map +1 -0
- package/dist/utility/functions/date/dateFunctions.d.ts +11 -0
- package/dist/utility/functions/date/dateFunctions.js +64 -0
- package/dist/utility/functions/date/dateFunctions.js.map +1 -0
- package/dist/utility/functions/geo.d.ts +74 -0
- package/dist/utility/functions/geo.js +311 -0
- package/dist/utility/functions/geo.js.map +1 -0
- package/dist/utility/functions/sql/alaSQLExtension.d.ts +13 -0
- package/dist/utility/functions/sql/alaSQLExtension.js +96 -0
- package/dist/utility/functions/sql/alaSQLExtension.js.map +1 -0
- package/dist/utility/globalSchema.d.ts +151 -0
- package/dist/utility/globalSchema.js +34 -0
- package/dist/utility/globalSchema.js.map +1 -0
- package/dist/utility/hdbTerms.d.ts +737 -0
- package/dist/utility/hdbTerms.js +756 -0
- package/dist/utility/hdbTerms.js.map +1 -0
- package/dist/utility/install/checkJWTTokensExist.d.ts +5 -0
- package/dist/utility/install/checkJWTTokensExist.js +53 -0
- package/dist/utility/install/checkJWTTokensExist.js.map +1 -0
- package/dist/utility/install/installer.d.ts +17 -0
- package/dist/utility/install/installer.js +569 -0
- package/dist/utility/install/installer.js.map +1 -0
- package/dist/utility/installation.d.ts +12 -0
- package/dist/utility/installation.js +64 -0
- package/dist/utility/installation.js.map +1 -0
- package/dist/utility/lmdb/DBIDefinition.d.ts +16 -0
- package/dist/utility/lmdb/DBIDefinition.js +19 -0
- package/dist/utility/lmdb/DBIDefinition.js.map +1 -0
- package/dist/utility/lmdb/DeleteRecordsResponseObject.d.ts +21 -0
- package/dist/utility/lmdb/DeleteRecordsResponseObject.js +24 -0
- package/dist/utility/lmdb/DeleteRecordsResponseObject.js.map +1 -0
- package/dist/utility/lmdb/InsertRecordsResponseObject.d.ts +18 -0
- package/dist/utility/lmdb/InsertRecordsResponseObject.js +21 -0
- package/dist/utility/lmdb/InsertRecordsResponseObject.js.map +1 -0
- package/dist/utility/lmdb/OpenDBIObject.d.ts +23 -0
- package/dist/utility/lmdb/OpenDBIObject.js +29 -0
- package/dist/utility/lmdb/OpenDBIObject.js.map +1 -0
- package/dist/utility/lmdb/OpenEnvironmentObject.d.ts +22 -0
- package/dist/utility/lmdb/OpenEnvironmentObject.js +40 -0
- package/dist/utility/lmdb/OpenEnvironmentObject.js.map +1 -0
- package/dist/utility/lmdb/UpdateRecordsResponseObject.d.ts +21 -0
- package/dist/utility/lmdb/UpdateRecordsResponseObject.js +24 -0
- package/dist/utility/lmdb/UpdateRecordsResponseObject.js.map +1 -0
- package/dist/utility/lmdb/UpsertRecordsResponseObject.d.ts +18 -0
- package/dist/utility/lmdb/UpsertRecordsResponseObject.js +21 -0
- package/dist/utility/lmdb/UpsertRecordsResponseObject.js.map +1 -0
- package/dist/utility/lmdb/cleanLMDBMap.d.ts +6 -0
- package/dist/utility/lmdb/cleanLMDBMap.js +63 -0
- package/dist/utility/lmdb/cleanLMDBMap.js.map +1 -0
- package/dist/utility/lmdb/commonUtility.d.ts +28 -0
- package/dist/utility/lmdb/commonUtility.js +120 -0
- package/dist/utility/lmdb/commonUtility.js.map +1 -0
- package/dist/utility/lmdb/deleteUtility.d.ts +10 -0
- package/dist/utility/lmdb/deleteUtility.js +115 -0
- package/dist/utility/lmdb/deleteUtility.js.map +1 -0
- package/dist/utility/lmdb/environmentUtility.d.ts +81 -0
- package/dist/utility/lmdb/environmentUtility.js +432 -0
- package/dist/utility/lmdb/environmentUtility.js.map +1 -0
- package/dist/utility/lmdb/searchCursorFunctions.d.ts +93 -0
- package/dist/utility/lmdb/searchCursorFunctions.js +174 -0
- package/dist/utility/lmdb/searchCursorFunctions.js.map +1 -0
- package/dist/utility/lmdb/searchUtility.d.ts +204 -0
- package/dist/utility/lmdb/searchUtility.js +724 -0
- package/dist/utility/lmdb/searchUtility.js.map +1 -0
- package/dist/utility/lmdb/terms.d.ts +34 -0
- package/dist/utility/lmdb/terms.js +52 -0
- package/dist/utility/lmdb/terms.js.map +1 -0
- package/dist/utility/lmdb/writeUtility.d.ts +32 -0
- package/dist/utility/lmdb/writeUtility.js +360 -0
- package/dist/utility/lmdb/writeUtility.js.map +1 -0
- package/dist/utility/logging/harper_logger.d.ts +141 -0
- package/dist/utility/logging/harper_logger.js +862 -0
- package/dist/utility/logging/harper_logger.js.map +1 -0
- package/dist/utility/logging/logRotator.d.ts +19 -0
- package/dist/utility/logging/logRotator.js +146 -0
- package/dist/utility/logging/logRotator.js.map +1 -0
- package/dist/utility/logging/logger.d.ts +11 -0
- package/dist/utility/logging/logger.js +19 -0
- package/dist/utility/logging/logger.js.map +1 -0
- package/dist/utility/logging/readLog.d.ts +8 -0
- package/dist/utility/logging/readLog.js +339 -0
- package/dist/utility/logging/readLog.js.map +1 -0
- package/dist/utility/logging/transactionLog.d.ts +8 -0
- package/dist/utility/logging/transactionLog.js +46 -0
- package/dist/utility/logging/transactionLog.js.map +1 -0
- package/dist/utility/mount_hdb.d.ts +2 -0
- package/dist/utility/mount_hdb.js +51 -0
- package/dist/utility/mount_hdb.js.map +1 -0
- package/dist/utility/npmUtilities.d.ts +6 -0
- package/dist/utility/npmUtilities.js +91 -0
- package/dist/utility/npmUtilities.js.map +1 -0
- package/dist/utility/operationPermissions.d.ts +36 -0
- package/dist/utility/operationPermissions.js +116 -0
- package/dist/utility/operationPermissions.js.map +1 -0
- package/dist/utility/operation_authorization.d.ts +18 -0
- package/dist/utility/operation_authorization.js +667 -0
- package/dist/utility/operation_authorization.js.map +1 -0
- package/dist/utility/packageUtils.d.ts +9 -0
- package/dist/utility/packageUtils.js +52 -0
- package/dist/utility/packageUtils.js.map +1 -0
- package/dist/utility/password.d.ts +20 -0
- package/dist/utility/password.js +119 -0
- package/dist/utility/password.js.map +1 -0
- package/dist/utility/processManagement/processManagement.d.ts +35 -0
- package/dist/utility/processManagement/processManagement.js +188 -0
- package/dist/utility/processManagement/processManagement.js.map +1 -0
- package/dist/utility/processManagement/servicesConfig.d.ts +29 -0
- package/dist/utility/processManagement/servicesConfig.js +52 -0
- package/dist/utility/processManagement/servicesConfig.js.map +1 -0
- package/dist/utility/scripts/restartHdb.d.ts +1 -0
- package/dist/utility/scripts/restartHdb.js +23 -0
- package/dist/utility/scripts/restartHdb.js.map +1 -0
- package/dist/utility/signalling.d.ts +2 -0
- package/dist/utility/signalling.js +35 -0
- package/dist/utility/signalling.js.map +1 -0
- package/dist/utility/terms/certificates.d.ts +46 -0
- package/dist/utility/terms/certificates.js +65 -0
- package/dist/utility/terms/certificates.js.map +1 -0
- package/dist/utility/when.d.ts +3 -0
- package/dist/utility/when.js +18 -0
- package/dist/utility/when.js.map +1 -0
- package/dist/validation/bulkDeleteValidator.d.ts +2 -0
- package/dist/validation/bulkDeleteValidator.js +21 -0
- package/dist/validation/bulkDeleteValidator.js.map +1 -0
- package/dist/validation/check_permissions.d.ts +2 -0
- package/dist/validation/check_permissions.js +20 -0
- package/dist/validation/check_permissions.js.map +1 -0
- package/dist/validation/common_validators.d.ts +19 -0
- package/dist/validation/common_validators.js +76 -0
- package/dist/validation/common_validators.js.map +1 -0
- package/dist/validation/configValidator.d.ts +8 -0
- package/dist/validation/configValidator.js +292 -0
- package/dist/validation/configValidator.js.map +1 -0
- package/dist/validation/deleteValidator.d.ts +2 -0
- package/dist/validation/deleteValidator.js +15 -0
- package/dist/validation/deleteValidator.js.map +1 -0
- package/dist/validation/fileLoadValidator.d.ts +4 -0
- package/dist/validation/fileLoadValidator.js +138 -0
- package/dist/validation/fileLoadValidator.js.map +1 -0
- package/dist/validation/insertValidator.d.ts +2 -0
- package/dist/validation/insertValidator.js +38 -0
- package/dist/validation/insertValidator.js.map +1 -0
- package/dist/validation/installValidator.d.ts +7 -0
- package/dist/validation/installValidator.js +28 -0
- package/dist/validation/installValidator.js.map +1 -0
- package/dist/validation/readLogValidator.d.ts +2 -0
- package/dist/validation/readLogValidator.js +48 -0
- package/dist/validation/readLogValidator.js.map +1 -0
- package/dist/validation/role_validation.d.ts +3 -0
- package/dist/validation/role_validation.js +284 -0
- package/dist/validation/role_validation.js.map +1 -0
- package/dist/validation/schemaMetadataValidator.d.ts +16 -0
- package/dist/validation/schemaMetadataValidator.js +38 -0
- package/dist/validation/schemaMetadataValidator.js.map +1 -0
- package/dist/validation/searchValidator.d.ts +2 -0
- package/dist/validation/searchValidator.js +141 -0
- package/dist/validation/searchValidator.js.map +1 -0
- package/dist/validation/statusValidator.d.ts +19 -0
- package/dist/validation/statusValidator.js +95 -0
- package/dist/validation/statusValidator.js.map +1 -0
- package/dist/validation/transactionLogValidator.d.ts +2 -0
- package/dist/validation/transactionLogValidator.js +28 -0
- package/dist/validation/transactionLogValidator.js.map +1 -0
- package/dist/validation/user_validation.d.ts +3 -0
- package/dist/validation/user_validation.js +52 -0
- package/dist/validation/user_validation.js.map +1 -0
- package/dist/validation/validationWrapper.d.ts +15 -0
- package/dist/validation/validationWrapper.js +95 -0
- package/dist/validation/validationWrapper.js.map +1 -0
- package/package.json +225 -0
- package/static/README.md +13 -0
- package/static/ascii_logo.txt +21 -0
- package/static/defaultConfig.yaml +75 -0
|
@@ -0,0 +1,727 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Resource = void 0;
|
|
4
|
+
exports.snakeCase = snakeCase;
|
|
5
|
+
exports.transformForSelect = transformForSelect;
|
|
6
|
+
const crypto_1 = require("crypto");
|
|
7
|
+
const DatabaseTransaction_ts_1 = require("./DatabaseTransaction.js");
|
|
8
|
+
const IterableEventQueue_ts_1 = require("./IterableEventQueue.js");
|
|
9
|
+
const globals_js_1 = require("../globals.js");
|
|
10
|
+
const hdbError_js_1 = require("../utility/errors/hdbError.js");
|
|
11
|
+
const transaction_ts_1 = require("./transaction.js");
|
|
12
|
+
const search_ts_1 = require("./search.js");
|
|
13
|
+
const RequestTarget_ts_1 = require("./RequestTarget.js");
|
|
14
|
+
const when_ts_1 = require("../utility/when.js");
|
|
15
|
+
const EXTENSION_TYPES = {
|
|
16
|
+
json: 'application/json',
|
|
17
|
+
cbor: 'application/cbor',
|
|
18
|
+
msgpack: 'application/x-msgpack',
|
|
19
|
+
csv: 'text/csv',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* This is the main class that can be extended for any resource in Harper and provides the essential reusable
|
|
23
|
+
* uniform interface for interacting with data, defining the API for providing data (data sources) and for consuming
|
|
24
|
+
* data. This interface is used pervasively in Harper and is implemented by database tables and can be used to define
|
|
25
|
+
* sources for caching, real-data sources for messaging protocols, and RESTful endpoints, as well as any other types of
|
|
26
|
+
* data aggregation, processing, or monitoring.
|
|
27
|
+
*
|
|
28
|
+
* This base Resource class provides a set of static methods that are main entry points for querying and updating data
|
|
29
|
+
* in resources/tables. The static methods provide the default handling of arguments, context, and ensuring that
|
|
30
|
+
* internal actions are wrapped in a transaction. The base Resource class intended to be extended, and the instance
|
|
31
|
+
* methods can be overridden to provide specific implementations of actions like get, put, post, delete, and subscribe.
|
|
32
|
+
*/
|
|
33
|
+
class Resource {
|
|
34
|
+
#id;
|
|
35
|
+
#context;
|
|
36
|
+
#isCollection;
|
|
37
|
+
static transactions;
|
|
38
|
+
static directURLMapping = false;
|
|
39
|
+
static loadAsInstance;
|
|
40
|
+
constructor(identifier, source) {
|
|
41
|
+
this.#id = identifier;
|
|
42
|
+
const context = source?.getContext ? (source.getContext() ?? null) : undefined;
|
|
43
|
+
this.#context = context !== undefined ? context : source || null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The get methods are for directly getting a resource, and called for HTTP GET requests.
|
|
47
|
+
*/
|
|
48
|
+
static get = transactional(function (resource, query, _request, _data) {
|
|
49
|
+
const result = resource.get?.(query);
|
|
50
|
+
// for the new API we always apply select in the instance method
|
|
51
|
+
if (!resource.constructor.loadAsInstance)
|
|
52
|
+
return result;
|
|
53
|
+
if (result?.then)
|
|
54
|
+
return result.then(handleSelect);
|
|
55
|
+
return handleSelect(result);
|
|
56
|
+
function handleSelect(result) {
|
|
57
|
+
let select;
|
|
58
|
+
if ((select = query?.select) && result != null && !result.selectApplied) {
|
|
59
|
+
const transform = transformForSelect(select, resource.constructor);
|
|
60
|
+
if (typeof result?.map === 'function') {
|
|
61
|
+
return result.map(transform);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return transform(result);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
type: 'read',
|
|
71
|
+
// allows context to reset/remove transaction after completion so it can be used in immediate mode:
|
|
72
|
+
letItLinger: true,
|
|
73
|
+
ensureLoaded: true, // load from source by default
|
|
74
|
+
hasContent: false,
|
|
75
|
+
async: true, // use async by default
|
|
76
|
+
method: 'get',
|
|
77
|
+
});
|
|
78
|
+
/**
|
|
79
|
+
* Store the provided record by the provided id. If no id is provided, it is auto-generated.
|
|
80
|
+
*/
|
|
81
|
+
static put = transactional(function (resource, query, request, data) {
|
|
82
|
+
if (Array.isArray(data) && resource.#isCollection && resource.constructor.loadAsInstance !== false) {
|
|
83
|
+
const results = [];
|
|
84
|
+
for (const element of data) {
|
|
85
|
+
const resourceClass = resource.constructor;
|
|
86
|
+
const id = element[resourceClass.primaryKey];
|
|
87
|
+
let target = new RequestTarget_ts_1.RequestTarget();
|
|
88
|
+
target.id = id;
|
|
89
|
+
const elementResource = resourceClass.getResource(target, request, {
|
|
90
|
+
async: true,
|
|
91
|
+
});
|
|
92
|
+
if (elementResource.then)
|
|
93
|
+
results.push(elementResource.then((resource) => resource.put(element, request)));
|
|
94
|
+
else
|
|
95
|
+
results.push(elementResource.put(element, query));
|
|
96
|
+
}
|
|
97
|
+
return Promise.all(results);
|
|
98
|
+
}
|
|
99
|
+
return resource.put
|
|
100
|
+
? resource.constructor.loadAsInstance === false
|
|
101
|
+
? resource.put(query, data)
|
|
102
|
+
: resource.put(data, query)
|
|
103
|
+
: missingMethod(resource, 'put');
|
|
104
|
+
}, { hasContent: true, type: 'update', method: 'put' });
|
|
105
|
+
static patch = transactional(function (resource, query, _request, data) {
|
|
106
|
+
// TODO: Allow array like put?
|
|
107
|
+
return resource.patch
|
|
108
|
+
? resource.constructor.loadAsInstance === false
|
|
109
|
+
? resource.patch(query, data)
|
|
110
|
+
: resource.patch(data, query)
|
|
111
|
+
: missingMethod(resource, 'patch');
|
|
112
|
+
}, { hasContent: true, type: 'update', method: 'patch' });
|
|
113
|
+
static delete = transactional(function (resource, query, _request, _data) {
|
|
114
|
+
return resource.delete ? resource.delete(query) : missingMethod(resource, 'delete');
|
|
115
|
+
}, { hasContent: false, type: 'delete', method: 'delete' });
|
|
116
|
+
/**
|
|
117
|
+
* Generate a new primary key for a resource; by default we use UUIDs (for now).
|
|
118
|
+
*/
|
|
119
|
+
static getNewId() {
|
|
120
|
+
return (0, crypto_1.randomUUID)();
|
|
121
|
+
}
|
|
122
|
+
static create(idPrefix, record, context) {
|
|
123
|
+
let id;
|
|
124
|
+
if (this.loadAsInstance === false) {
|
|
125
|
+
if (typeof idPrefix === 'object' && idPrefix && !context) {
|
|
126
|
+
// two argument form (record, context), shift the arguments
|
|
127
|
+
context = record;
|
|
128
|
+
record = idPrefix;
|
|
129
|
+
id = new RequestTarget_ts_1.RequestTarget();
|
|
130
|
+
id.isCollection = true;
|
|
131
|
+
}
|
|
132
|
+
else
|
|
133
|
+
id = idPrefix;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
if (idPrefix == null)
|
|
137
|
+
id = record?.[this.primaryKey] ?? this.getNewId();
|
|
138
|
+
else if (Array.isArray(idPrefix) && typeof idPrefix[0] !== 'object')
|
|
139
|
+
id = record?.[this.primaryKey] ?? [...idPrefix, this.getNewId()];
|
|
140
|
+
else if (typeof idPrefix !== 'object')
|
|
141
|
+
id = record?.[this.primaryKey] ?? [idPrefix, this.getNewId()];
|
|
142
|
+
else {
|
|
143
|
+
// two argument form, shift the arguments
|
|
144
|
+
id = idPrefix?.[this.primaryKey] ?? this.getNewId();
|
|
145
|
+
context = record || {};
|
|
146
|
+
record = idPrefix;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (context) {
|
|
150
|
+
if (context.getContext)
|
|
151
|
+
context = context.getContext();
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
// try to get the context from the async context if possible
|
|
155
|
+
context = transaction_ts_1.contextStorage.getStore() ?? {};
|
|
156
|
+
}
|
|
157
|
+
return (0, transaction_ts_1.transaction)(context, async () => {
|
|
158
|
+
context.transaction.startedFrom ??= {
|
|
159
|
+
resourceName: this.name,
|
|
160
|
+
method: 'create',
|
|
161
|
+
};
|
|
162
|
+
const resource = new this(id, context);
|
|
163
|
+
const results = resource.create ? await resource.create(id, record) : missingMethod(resource, 'create');
|
|
164
|
+
context.newLocation = id ?? results?.[this.primaryKey];
|
|
165
|
+
context.createdResource = true;
|
|
166
|
+
return this.loadAsInstance === false ? results : resource;
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
static invalidate = transactional(function (resource, query, _request, _data) {
|
|
170
|
+
return resource.invalidate ? resource.invalidate(query) : missingMethod(resource, 'invalidate');
|
|
171
|
+
}, { hasContent: false, type: 'update', method: 'invalidate' });
|
|
172
|
+
static post = transactional(function (resource, query, _request, data) {
|
|
173
|
+
if (resource.#id != null)
|
|
174
|
+
resource.update?.(); // save any changes made during post
|
|
175
|
+
return resource.constructor.loadAsInstance === false ? resource.post(query, data) : resource.post(data, query);
|
|
176
|
+
}, { hasContent: true, type: 'create', method: 'post' });
|
|
177
|
+
static update = transactional(function (resource, query, _request, data) {
|
|
178
|
+
return resource.update(query, data);
|
|
179
|
+
}, { type: 'update', method: 'update' });
|
|
180
|
+
static connect = transactional(function (resource, query, _request, data) {
|
|
181
|
+
return resource.connect
|
|
182
|
+
? resource.constructor.loadAsInstance === false
|
|
183
|
+
? resource.connect(query, data)
|
|
184
|
+
: resource.connect(data, query)
|
|
185
|
+
: missingMethod(resource, 'connect');
|
|
186
|
+
}, { hasContent: true, type: 'read', method: 'connect' });
|
|
187
|
+
static subscribe = transactional(function (resource, query, _request, _data) {
|
|
188
|
+
return resource.subscribe ? resource.subscribe(query) : missingMethod(resource, 'subscribe');
|
|
189
|
+
}, { type: 'read', method: 'subscribe', syncAllowed: true });
|
|
190
|
+
static publish = transactional(function (resource, query, _request, data) {
|
|
191
|
+
if (resource.#id != null)
|
|
192
|
+
resource.update?.(); // save any changes made during publish
|
|
193
|
+
return resource.publish
|
|
194
|
+
? resource.constructor.loadAsInstance === false
|
|
195
|
+
? resource.publish(query, data)
|
|
196
|
+
: resource.publish(data, query)
|
|
197
|
+
: missingMethod(resource, 'publish');
|
|
198
|
+
}, { hasContent: true, type: 'create', method: 'publish' });
|
|
199
|
+
static search = transactional(function (resource, query, request) {
|
|
200
|
+
const result = resource.search ? resource.search(query) : missingMethod(resource, 'search');
|
|
201
|
+
const select = request.select;
|
|
202
|
+
if (select && request.hasOwnProperty('select') && result != null && !result.selectApplied) {
|
|
203
|
+
const transform = transformForSelect(select, resource.constructor);
|
|
204
|
+
return result.map(transform);
|
|
205
|
+
}
|
|
206
|
+
return result;
|
|
207
|
+
}, { type: 'read', method: 'search', hasContent: false, syncAllowed: true });
|
|
208
|
+
static query = transactional(function (resource, query, _request, data) {
|
|
209
|
+
return resource.search
|
|
210
|
+
? resource.constructor.loadAsInstance === false
|
|
211
|
+
? resource.search(query, data)
|
|
212
|
+
: resource.search(data, query)
|
|
213
|
+
: missingMethod(resource, 'search');
|
|
214
|
+
}, { hasContent: true, type: 'read', method: 'query' });
|
|
215
|
+
static copy = transactional(function (resource, query, _request, data) {
|
|
216
|
+
return resource.copy
|
|
217
|
+
? resource.constructor.loadAsInstance === false
|
|
218
|
+
? resource.copy(query, data)
|
|
219
|
+
: resource.copy(data, query)
|
|
220
|
+
: missingMethod(resource, 'copy');
|
|
221
|
+
}, { hasContent: true, type: 'create', method: 'copy' });
|
|
222
|
+
static move = transactional(function (resource, query, _request, data) {
|
|
223
|
+
return resource.move
|
|
224
|
+
? resource.constructor.loadAsInstance === false
|
|
225
|
+
? resource.move(query, data)
|
|
226
|
+
: resource.move(data, query)
|
|
227
|
+
: missingMethod(resource, 'move');
|
|
228
|
+
}, { hasContent: true, type: 'delete', method: 'move' });
|
|
229
|
+
async post(target, newRecord) {
|
|
230
|
+
if (this.constructor.loadAsInstance === false) {
|
|
231
|
+
if (target.isCollection && this.create) {
|
|
232
|
+
newRecord = await this.create(target, newRecord);
|
|
233
|
+
return newRecord?.[this.constructor.primaryKey];
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
if (this.#isCollection) {
|
|
238
|
+
const resource = await this.constructor.create(this.#id, target, this.#context);
|
|
239
|
+
return resource.#id;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
missingMethod(this, 'post');
|
|
243
|
+
}
|
|
244
|
+
static isCollection(resource) {
|
|
245
|
+
return resource && resource.#isCollection;
|
|
246
|
+
}
|
|
247
|
+
get isCollection() {
|
|
248
|
+
return this.#isCollection;
|
|
249
|
+
}
|
|
250
|
+
static coerceId(id) {
|
|
251
|
+
return id;
|
|
252
|
+
}
|
|
253
|
+
static parseQuery(search, query) {
|
|
254
|
+
return (0, search_ts_1.parseQuery)(search, query);
|
|
255
|
+
}
|
|
256
|
+
static parsePath(path, context, query) {
|
|
257
|
+
const dotIndex = path.indexOf('.');
|
|
258
|
+
if (dotIndex > -1) {
|
|
259
|
+
// handle paths of the form /path/id.property
|
|
260
|
+
const property = path.slice(dotIndex + 1);
|
|
261
|
+
const requestedContentType = context?.headers && EXTENSION_TYPES[property];
|
|
262
|
+
if (requestedContentType) {
|
|
263
|
+
// handle path.json, path.cbor, etc. for requesting a specific content type using just the URL
|
|
264
|
+
context.requestedContentType = requestedContentType;
|
|
265
|
+
path = path.slice(0, dotIndex); // remove the property from the path
|
|
266
|
+
}
|
|
267
|
+
else if (this.attributes?.find((attribute) => attribute.name === property)) {
|
|
268
|
+
// handle path.attribute for requesting a specific attribute using just the URL
|
|
269
|
+
path = path.slice(0, dotIndex); // remove the property from the path
|
|
270
|
+
if (query)
|
|
271
|
+
query.property = property;
|
|
272
|
+
else {
|
|
273
|
+
return {
|
|
274
|
+
property,
|
|
275
|
+
id: path,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return path;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Gets an instance of a resource by id
|
|
284
|
+
* @param id
|
|
285
|
+
* @param request
|
|
286
|
+
* @param options
|
|
287
|
+
* @returns
|
|
288
|
+
*/
|
|
289
|
+
static getResource(target, request, options) {
|
|
290
|
+
let resource;
|
|
291
|
+
const id = target.id;
|
|
292
|
+
let context = request.getContext?.();
|
|
293
|
+
let isCollection;
|
|
294
|
+
if (typeof request.isCollection === 'boolean' && request.hasOwnProperty('isCollection'))
|
|
295
|
+
isCollection = request.isCollection;
|
|
296
|
+
else
|
|
297
|
+
isCollection = options?.isCollection;
|
|
298
|
+
// if it is a collection and we have a collection class defined, use it
|
|
299
|
+
const constructor = (isCollection && this.Collection) || this;
|
|
300
|
+
if (!context)
|
|
301
|
+
context = context === undefined ? request : {};
|
|
302
|
+
resource = new constructor(id, context); // outside of a transaction, just create an instance
|
|
303
|
+
if (isCollection)
|
|
304
|
+
resource.#isCollection = true;
|
|
305
|
+
return resource;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* This is called by protocols that wish to make a subscription for real-time notification/updates.
|
|
309
|
+
* This default implementation simply provides a streaming iterator that does not deliver any notifications
|
|
310
|
+
* but implementors can call send with
|
|
311
|
+
*/
|
|
312
|
+
// eslint-disable-next-line no-unused-vars
|
|
313
|
+
subscribe(request) {
|
|
314
|
+
return new IterableEventQueue_ts_1.IterableEventQueue();
|
|
315
|
+
}
|
|
316
|
+
connect(target, incomingMessages) {
|
|
317
|
+
// convert subscription to an (async) iterator
|
|
318
|
+
const query = this.constructor.loadAsInstance === false ? target : incomingMessages;
|
|
319
|
+
if (query?.subscribe !== false) {
|
|
320
|
+
// subscribing is the default action, but can be turned off
|
|
321
|
+
return this.subscribe?.(query);
|
|
322
|
+
}
|
|
323
|
+
return new IterableEventQueue_ts_1.IterableEventQueue();
|
|
324
|
+
}
|
|
325
|
+
// Default permissions (super user only accesss):
|
|
326
|
+
// eslint-disable-next-line no-unused-vars
|
|
327
|
+
allowRead(user, target, context) {
|
|
328
|
+
return user?.role.permission.super_user;
|
|
329
|
+
}
|
|
330
|
+
// eslint-disable-next-line no-unused-vars
|
|
331
|
+
allowUpdate(user, record, context) {
|
|
332
|
+
return user?.role.permission.super_user;
|
|
333
|
+
}
|
|
334
|
+
// eslint-disable-next-line no-unused-vars
|
|
335
|
+
allowCreate(user, record, context) {
|
|
336
|
+
return user?.role.permission.super_user;
|
|
337
|
+
}
|
|
338
|
+
// eslint-disable-next-line no-unused-vars
|
|
339
|
+
allowDelete(user, target, context) {
|
|
340
|
+
return user?.role.permission.super_user;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Get the primary key value for this resource.
|
|
344
|
+
* @returns primary key
|
|
345
|
+
*/
|
|
346
|
+
getId() {
|
|
347
|
+
return this.#id;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Get the context for this resource
|
|
351
|
+
* @returns context object with information about the current transaction, user, and more
|
|
352
|
+
*/
|
|
353
|
+
getContext() {
|
|
354
|
+
return this.#context;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Get the current user for the current request, based on the context.
|
|
358
|
+
* @returns user object or undefined if no user is logged in
|
|
359
|
+
*/
|
|
360
|
+
getCurrentUser() {
|
|
361
|
+
return this.getContext()?.user;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
exports.Resource = Resource;
|
|
365
|
+
(0, globals_js_1._assignPackageExport)('Resource', Resource);
|
|
366
|
+
function snakeCase(camelCase) {
|
|
367
|
+
return (camelCase[0].toLowerCase() +
|
|
368
|
+
camelCase.slice(1).replace(/[a-z][A-Z][a-z]/g, (letters) => letters[0] + '_' + letters.slice(1)));
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* This is responsible for arranging arguments in the main static methods and creating the appropriate context and default transaction wrapping
|
|
372
|
+
* @param action
|
|
373
|
+
* @param options
|
|
374
|
+
* @returns
|
|
375
|
+
*/
|
|
376
|
+
function transactional(action, options) {
|
|
377
|
+
applyContext.reliesOnPrototype = true;
|
|
378
|
+
const hasContent = options.hasContent;
|
|
379
|
+
return applyContext;
|
|
380
|
+
function applyContext(idOrQuery, dataOrContext, context) {
|
|
381
|
+
let id, query, isCollection;
|
|
382
|
+
let data;
|
|
383
|
+
// First we do our argument normalization. There are two main types of methods, with or without content
|
|
384
|
+
if (hasContent) {
|
|
385
|
+
// for put, post, patch, publish, query
|
|
386
|
+
if (context) {
|
|
387
|
+
// if there are three arguments, it is id, data, context
|
|
388
|
+
data = dataOrContext;
|
|
389
|
+
context = context.getContext?.() || context;
|
|
390
|
+
}
|
|
391
|
+
else if (dataOrContext) {
|
|
392
|
+
// two arguments, more possibilities:
|
|
393
|
+
if (typeof idOrQuery === 'object' &&
|
|
394
|
+
idOrQuery &&
|
|
395
|
+
(!Array.isArray(idOrQuery) || typeof idOrQuery[0] === 'object')) {
|
|
396
|
+
// (data, context) form
|
|
397
|
+
data = idOrQuery;
|
|
398
|
+
id = data[this.primaryKey] ?? null;
|
|
399
|
+
context = dataOrContext.getContext?.() || dataOrContext;
|
|
400
|
+
}
|
|
401
|
+
else if (dataOrContext?.transaction instanceof DatabaseTransaction_ts_1.DatabaseTransaction) {
|
|
402
|
+
// (id, context) form
|
|
403
|
+
context = dataOrContext;
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
// (id, data) form
|
|
407
|
+
data = dataOrContext;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
else if (idOrQuery && typeof idOrQuery === 'object') {
|
|
411
|
+
// single argument form, just data
|
|
412
|
+
data = idOrQuery;
|
|
413
|
+
idOrQuery = undefined;
|
|
414
|
+
id = data.getId?.() ?? data[this.primaryKey];
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
throw new hdbError_js_1.ClientError(`Invalid argument for data, must be an object, but got ${idOrQuery}`);
|
|
418
|
+
}
|
|
419
|
+
if (id === null)
|
|
420
|
+
isCollection = true;
|
|
421
|
+
// otherwise handle methods for get, delete, etc.
|
|
422
|
+
// first, check to see if it is two argument
|
|
423
|
+
}
|
|
424
|
+
else if (dataOrContext) {
|
|
425
|
+
if (context) {
|
|
426
|
+
// (id, data, context), this a method that doesn't normally have a body/data, but with the three arguments, we have explicit data
|
|
427
|
+
data = dataOrContext;
|
|
428
|
+
context = context.getContext?.() || context;
|
|
429
|
+
}
|
|
430
|
+
else if (hasContent === false) {
|
|
431
|
+
// (id, context), preferred form used for methods that are explicitly without a body
|
|
432
|
+
context = dataOrContext.getContext?.() || dataOrContext;
|
|
433
|
+
}
|
|
434
|
+
else if (dataOrContext.transaction || dataOrContext.getContext) {
|
|
435
|
+
// or if it looks like a context
|
|
436
|
+
context = dataOrContext.getContext?.() || dataOrContext;
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
data = dataOrContext;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
if (id === undefined) {
|
|
443
|
+
if (typeof idOrQuery === 'object' && idOrQuery) {
|
|
444
|
+
// it is a query
|
|
445
|
+
query = idOrQuery;
|
|
446
|
+
if (idOrQuery instanceof URLSearchParams) {
|
|
447
|
+
// already RequestTarget (or URLSearchParams), consider it already parsed,
|
|
448
|
+
// we can just do property parsing, coerce, and assign the id
|
|
449
|
+
id = idOrQuery.id;
|
|
450
|
+
if (this.directURLMapping) {
|
|
451
|
+
id = idOrQuery.toString().slice(1); // remove the leading slash
|
|
452
|
+
query.id = id;
|
|
453
|
+
}
|
|
454
|
+
else if (typeof id === 'string') {
|
|
455
|
+
// handle paths of the form /path/id.property
|
|
456
|
+
const parsedId = this.parsePath(id, context, query);
|
|
457
|
+
if (parsedId?.id !== undefined) {
|
|
458
|
+
query.property = parsedId.property;
|
|
459
|
+
id = parsedId.id;
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
id = parsedId;
|
|
463
|
+
}
|
|
464
|
+
if (id) {
|
|
465
|
+
query.id = id = this.coerceId(id);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
else if (idOrQuery[Symbol.iterator]) {
|
|
470
|
+
// get the id part from an iterable query
|
|
471
|
+
id = [];
|
|
472
|
+
isCollection = true;
|
|
473
|
+
for (const part of idOrQuery) {
|
|
474
|
+
if (typeof part === 'object' && part)
|
|
475
|
+
break;
|
|
476
|
+
id.push(part);
|
|
477
|
+
}
|
|
478
|
+
if (id.length === 0)
|
|
479
|
+
id = null;
|
|
480
|
+
else {
|
|
481
|
+
if (id.length === 1)
|
|
482
|
+
id = id[0];
|
|
483
|
+
if (query.slice) {
|
|
484
|
+
query = query.slice(id.length, query.length);
|
|
485
|
+
if (query.length === 0) {
|
|
486
|
+
query = new RequestTarget_ts_1.RequestTarget();
|
|
487
|
+
query.id = id;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
else if (id === undefined) {
|
|
493
|
+
id = idOrQuery.id ?? null;
|
|
494
|
+
if (id == null)
|
|
495
|
+
query.isCollection = true;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
id = idOrQuery;
|
|
500
|
+
query = new RequestTarget_ts_1.RequestTarget();
|
|
501
|
+
query.id = id;
|
|
502
|
+
if (id == null) {
|
|
503
|
+
if (options.method === 'get') {
|
|
504
|
+
throw new Error(`Using an argument with a value of ${id} for ${options.method}, is not allowed`);
|
|
505
|
+
}
|
|
506
|
+
query.isCollection = true;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
if (!query) {
|
|
511
|
+
query = new RequestTarget_ts_1.RequestTarget();
|
|
512
|
+
query.id = id;
|
|
513
|
+
}
|
|
514
|
+
isCollection = query.isCollection;
|
|
515
|
+
let resourceOptions;
|
|
516
|
+
if (!context) {
|
|
517
|
+
// try to get the context from the async context if possible
|
|
518
|
+
context = transaction_ts_1.contextStorage.getStore() ?? {};
|
|
519
|
+
}
|
|
520
|
+
if (query.ensureLoaded != null || query.async || isCollection) {
|
|
521
|
+
resourceOptions = { ...options };
|
|
522
|
+
if (query.ensureLoaded != null)
|
|
523
|
+
resourceOptions.ensureLoaded = query.ensureLoaded;
|
|
524
|
+
if (query.syncAllowed)
|
|
525
|
+
resourceOptions.syncAllowed = query.syncAllowed;
|
|
526
|
+
if (isCollection)
|
|
527
|
+
resourceOptions.isCollection = true;
|
|
528
|
+
}
|
|
529
|
+
else
|
|
530
|
+
resourceOptions = options;
|
|
531
|
+
const loadAsInstance = this.loadAsInstance;
|
|
532
|
+
if (context?.transaction) {
|
|
533
|
+
// we are already in a transaction, proceed
|
|
534
|
+
const resource = this.getResource(query, context, resourceOptions);
|
|
535
|
+
return resource.then
|
|
536
|
+
? resource.then(authorizeActionOnResource)
|
|
537
|
+
: (0, when_ts_1.promiseNormalize)(authorizeActionOnResource(resource), resourceOptions);
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
// start a transaction
|
|
541
|
+
return (0, when_ts_1.promiseNormalize)((0, transaction_ts_1.transaction)(context, () => {
|
|
542
|
+
// record what transaction we are starting from, so that if it times out, we can have an indication of the cause
|
|
543
|
+
context.transaction.startedFrom = {
|
|
544
|
+
resourceName: this.name,
|
|
545
|
+
method: options.method,
|
|
546
|
+
};
|
|
547
|
+
const resource = this.getResource(query, context, resourceOptions);
|
|
548
|
+
return resource.then ? resource.then(authorizeActionOnResource) : authorizeActionOnResource(resource);
|
|
549
|
+
}), resourceOptions);
|
|
550
|
+
}
|
|
551
|
+
function authorizeActionOnResource(resource) {
|
|
552
|
+
let checkPermission = false;
|
|
553
|
+
if (query.checkPermission) {
|
|
554
|
+
checkPermission = true;
|
|
555
|
+
// authorization has been requested, but only do it for this entry call
|
|
556
|
+
}
|
|
557
|
+
if (context.authorize) {
|
|
558
|
+
checkPermission = true;
|
|
559
|
+
// authorization has been requested, but only do it for this entry call
|
|
560
|
+
context.authorize = false;
|
|
561
|
+
query.checkPermission = true;
|
|
562
|
+
}
|
|
563
|
+
if (checkPermission) {
|
|
564
|
+
if (loadAsInstance !== false) {
|
|
565
|
+
// do permission checks, with allow methods
|
|
566
|
+
const allowed = options.type === 'read'
|
|
567
|
+
? resource.allowRead(context.user, query, context)
|
|
568
|
+
: options.type === 'update'
|
|
569
|
+
? resource.doesExist?.() === false
|
|
570
|
+
? resource.allowCreate(context.user, data, context)
|
|
571
|
+
: resource.allowUpdate(context.user, data, context)
|
|
572
|
+
: options.type === 'create'
|
|
573
|
+
? resource.allowCreate(context.user, data, context)
|
|
574
|
+
: resource.allowDelete(context.user, query, context);
|
|
575
|
+
if (allowed?.then) {
|
|
576
|
+
return allowed.then((allowed) => {
|
|
577
|
+
query.checkPermission = false;
|
|
578
|
+
if (!allowed) {
|
|
579
|
+
throw new hdbError_js_1.AccessViolation(context.user);
|
|
580
|
+
}
|
|
581
|
+
return (0, when_ts_1.when)(data, (data) => {
|
|
582
|
+
return action(resource, query, context, data);
|
|
583
|
+
});
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
query.checkPermission = false;
|
|
587
|
+
if (!allowed) {
|
|
588
|
+
throw new hdbError_js_1.AccessViolation(context.user);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
return (0, when_ts_1.when)(data, (data) => {
|
|
593
|
+
return action(resource, query, context, data);
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function missingMethod(resource, method) {
|
|
599
|
+
const error = new hdbError_js_1.ClientError(`The ${resource.constructor.name} does not have a ${method} method implemented`, 405);
|
|
600
|
+
error.allow = [];
|
|
601
|
+
error.method = method;
|
|
602
|
+
for (const method of ['get', 'put', 'post', 'delete', 'query', 'move', 'copy']) {
|
|
603
|
+
if (typeof resource[method] === 'function')
|
|
604
|
+
error.allow.push(method);
|
|
605
|
+
}
|
|
606
|
+
throw error;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* This is responsible for handling a select query parameter/call that selects specific
|
|
610
|
+
* properties from the returned record(s).
|
|
611
|
+
* @param object
|
|
612
|
+
* @returns
|
|
613
|
+
*/
|
|
614
|
+
function selectFromObject(object, propertyResolvers, context) {
|
|
615
|
+
// TODO: eventually we will do aggregate functions here
|
|
616
|
+
const record = object.getRecord?.();
|
|
617
|
+
if (record) {
|
|
618
|
+
const ownData = object.getChanges?.();
|
|
619
|
+
return (property) => {
|
|
620
|
+
let value, resolver;
|
|
621
|
+
if (object.hasOwnProperty(property) && typeof (value = object[property]) !== 'function') {
|
|
622
|
+
return value;
|
|
623
|
+
}
|
|
624
|
+
if (ownData && property in ownData) {
|
|
625
|
+
return ownData[property];
|
|
626
|
+
}
|
|
627
|
+
else if ((resolver = propertyResolvers?.[property])) {
|
|
628
|
+
return resolver(object, context);
|
|
629
|
+
}
|
|
630
|
+
else
|
|
631
|
+
return record[property];
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
else if (propertyResolvers) {
|
|
635
|
+
return (property) => {
|
|
636
|
+
const resolver = propertyResolvers[property];
|
|
637
|
+
return resolver ? resolver(object, context) : object[property];
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
else
|
|
641
|
+
return (property) => object[property];
|
|
642
|
+
}
|
|
643
|
+
function transformForSelect(select, resource) {
|
|
644
|
+
const propertyResolvers = resource.propertyResolvers;
|
|
645
|
+
const context = resource.getContext?.();
|
|
646
|
+
let subTransforms;
|
|
647
|
+
if (typeof select === 'string')
|
|
648
|
+
// if select is a single string then return property value
|
|
649
|
+
return function transform(object) {
|
|
650
|
+
if (object.then)
|
|
651
|
+
return object.then(transform);
|
|
652
|
+
if (Array.isArray(object))
|
|
653
|
+
return object.map(transform);
|
|
654
|
+
return selectFromObject(object, propertyResolvers, context)(select);
|
|
655
|
+
};
|
|
656
|
+
else if (typeof select === 'object') {
|
|
657
|
+
// if it is an array, return an array
|
|
658
|
+
if (select.asArray)
|
|
659
|
+
return function transform(object) {
|
|
660
|
+
if (object.then)
|
|
661
|
+
return object.then(transform);
|
|
662
|
+
if (Array.isArray(object))
|
|
663
|
+
return object.map(transform);
|
|
664
|
+
const results = [];
|
|
665
|
+
const getProperty = handleProperty(selectFromObject(object, propertyResolvers, context));
|
|
666
|
+
for (const property of select) {
|
|
667
|
+
results.push(getProperty(property));
|
|
668
|
+
}
|
|
669
|
+
return results;
|
|
670
|
+
};
|
|
671
|
+
const forceNulls = select.forceNulls;
|
|
672
|
+
return function transform(object) {
|
|
673
|
+
if (object.then)
|
|
674
|
+
return object.then(transform);
|
|
675
|
+
if (Array.isArray(object))
|
|
676
|
+
return object.map((value) => (value && typeof value === 'object' ? transform(value) : value));
|
|
677
|
+
// finally the case of returning objects
|
|
678
|
+
const selectedData = {};
|
|
679
|
+
const getProperty = handleProperty(selectFromObject(object, propertyResolvers, context));
|
|
680
|
+
let promises;
|
|
681
|
+
for (const property of select) {
|
|
682
|
+
let value = getProperty(property);
|
|
683
|
+
if (value === undefined && forceNulls)
|
|
684
|
+
value = null;
|
|
685
|
+
if (value?.then) {
|
|
686
|
+
if (!promises)
|
|
687
|
+
promises = [];
|
|
688
|
+
promises.push(value.then((value) => (selectedData[property.name || property] = value)));
|
|
689
|
+
}
|
|
690
|
+
else
|
|
691
|
+
selectedData[property.name || property] = value;
|
|
692
|
+
}
|
|
693
|
+
if (promises)
|
|
694
|
+
return Promise.all(promises).then(() => selectedData);
|
|
695
|
+
return selectedData;
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
else
|
|
699
|
+
throw new Error('Invalid select argument type ' + typeof select);
|
|
700
|
+
function handleProperty(getProperty) {
|
|
701
|
+
return (property) => {
|
|
702
|
+
if (typeof property === 'string') {
|
|
703
|
+
return getProperty(property);
|
|
704
|
+
}
|
|
705
|
+
else if (typeof property === 'object') {
|
|
706
|
+
// TODO: Handle aggregate functions
|
|
707
|
+
if (property.name) {
|
|
708
|
+
if (!subTransforms)
|
|
709
|
+
subTransforms = {};
|
|
710
|
+
// TODO: Get the resource, cache this transform, and apply above
|
|
711
|
+
let transform = subTransforms[property.name];
|
|
712
|
+
if (!transform) {
|
|
713
|
+
const resource = propertyResolvers[property.name]?.definition?.tableClass;
|
|
714
|
+
transform = subTransforms[property.name] = transformForSelect(property.select || property, resource);
|
|
715
|
+
}
|
|
716
|
+
const value = getProperty(property.name);
|
|
717
|
+
return transform(value);
|
|
718
|
+
}
|
|
719
|
+
else
|
|
720
|
+
return getProperty(property);
|
|
721
|
+
}
|
|
722
|
+
else
|
|
723
|
+
return property;
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
//# sourceMappingURL=Resource.js.map
|