joist-core 2.4.0-next.37 → 2.4.0-next.39
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/build/BaseEntity.d.cts +3 -4
- package/build/BaseEntity.d.cts.map +1 -1
- package/build/BaseEntity.d.mts +3 -4
- package/build/BaseEntity.d.mts.map +1 -1
- package/build/Entity.d.cts +3 -4
- package/build/Entity.d.cts.map +1 -1
- package/build/Entity.d.mts +3 -4
- package/build/Entity.d.mts.map +1 -1
- package/build/EntityFields.d.cts +3 -4
- package/build/EntityFields.d.cts.map +1 -1
- package/build/EntityFields.d.mts +3 -4
- package/build/EntityFields.d.mts.map +1 -1
- package/build/EntityManager.cjs +11 -3
- package/build/EntityManager.cjs.map +1 -1
- package/build/EntityManager.d.cts +47 -41
- package/build/EntityManager.d.cts.map +1 -1
- package/build/EntityManager.d.mts +47 -41
- package/build/EntityManager.d.mts.map +1 -1
- package/build/EntityManager.js +11 -3
- package/build/EntityManager.js.map +1 -1
- package/build/EntityMetadata.d.cts +31 -32
- package/build/EntityMetadata.d.cts.map +1 -1
- package/build/EntityMetadata.d.mts +31 -32
- package/build/EntityMetadata.d.mts.map +1 -1
- package/build/EnumMetadata.d.cts +1 -2
- package/build/EnumMetadata.d.cts.map +1 -1
- package/build/EnumMetadata.d.mts +1 -2
- package/build/EnumMetadata.d.mts.map +1 -1
- package/build/IndexManager.cjs.map +1 -1
- package/build/IndexManager.d.cts +2 -3
- package/build/IndexManager.d.cts.map +1 -1
- package/build/IndexManager.d.mts +2 -3
- package/build/IndexManager.d.mts.map +1 -1
- package/build/IndexManager.js.map +1 -1
- package/build/InstanceData.cjs.map +1 -1
- package/build/InstanceData.d.cts +1 -2
- package/build/InstanceData.d.cts.map +1 -1
- package/build/InstanceData.d.mts +1 -2
- package/build/InstanceData.d.mts.map +1 -1
- package/build/InstanceData.js.map +1 -1
- package/build/PluginManager.cjs.map +1 -1
- package/build/PluginManager.d.cts +4 -4
- package/build/PluginManager.d.cts.map +1 -1
- package/build/PluginManager.d.mts +4 -4
- package/build/PluginManager.d.mts.map +1 -1
- package/build/PluginManager.js.map +1 -1
- package/build/RowData.d.cts +3 -4
- package/build/RowData.d.cts.map +1 -1
- package/build/RowData.d.mts +3 -4
- package/build/RowData.d.mts.map +1 -1
- package/build/batchloaders/BatchLoader.cjs.map +1 -1
- package/build/batchloaders/BatchLoader.d.cts +1 -2
- package/build/batchloaders/BatchLoader.d.cts.map +1 -1
- package/build/batchloaders/BatchLoader.d.mts +1 -2
- package/build/batchloaders/BatchLoader.d.mts.map +1 -1
- package/build/batchloaders/BatchLoader.js.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.d.cts +2 -3
- package/build/batchloaders/enumCollectionBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.d.mts +2 -3
- package/build/batchloaders/enumCollectionBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/loadBatchLoader.d.cts +2 -3
- package/build/batchloaders/loadBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/loadBatchLoader.d.mts +2 -3
- package/build/batchloaders/loadBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.d.cts +2 -3
- package/build/batchloaders/manyToManyBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.d.mts +2 -3
- package/build/batchloaders/manyToManyBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.d.cts +2 -3
- package/build/batchloaders/oneToManyBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.d.mts +2 -3
- package/build/batchloaders/oneToManyBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.d.cts +2 -3
- package/build/batchloaders/oneToOneBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.d.mts +2 -3
- package/build/batchloaders/oneToOneBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/populateBatchLoader.d.cts +2 -3
- package/build/batchloaders/populateBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/populateBatchLoader.d.mts +2 -3
- package/build/batchloaders/populateBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.d.cts +2 -3
- package/build/batchloaders/recursiveChildrenBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.d.mts +2 -3
- package/build/batchloaders/recursiveChildrenBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.d.cts +2 -3
- package/build/batchloaders/recursiveM2mBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.d.mts +2 -3
- package/build/batchloaders/recursiveM2mBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.d.cts +2 -3
- package/build/batchloaders/recursiveParentsBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.d.mts +2 -3
- package/build/batchloaders/recursiveParentsBatchLoader.d.mts.map +1 -1
- package/build/changes.cjs.map +1 -1
- package/build/changes.d.cts +9 -10
- package/build/changes.d.cts.map +1 -1
- package/build/changes.d.mts +9 -10
- package/build/changes.d.mts.map +1 -1
- package/build/changes.js.map +1 -1
- package/build/config.d.cts +17 -17
- package/build/config.d.cts.map +1 -1
- package/build/config.d.mts +17 -17
- package/build/config.d.mts.map +1 -1
- package/build/configure.d.cts +8 -9
- package/build/configure.d.cts.map +1 -1
- package/build/configure.d.mts +8 -9
- package/build/configure.d.mts.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.d.cts +1 -2
- package/build/dataloaders/fastWhereFilterHash.d.cts.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.d.mts +1 -2
- package/build/dataloaders/fastWhereFilterHash.d.mts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.d.cts +2 -3
- package/build/dataloaders/findByUniqueDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.d.mts +2 -3
- package/build/dataloaders/findByUniqueDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findCountDataLoader.d.cts +4 -5
- package/build/dataloaders/findCountDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findCountDataLoader.d.mts +4 -5
- package/build/dataloaders/findCountDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findDataLoader.d.cts +11 -12
- package/build/dataloaders/findDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findDataLoader.d.mts +11 -12
- package/build/dataloaders/findDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findIdsDataLoader.d.cts +2 -3
- package/build/dataloaders/findIdsDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findIdsDataLoader.d.mts +2 -3
- package/build/dataloaders/findIdsDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.d.cts +3 -3
- package/build/dataloaders/findOrCreateDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.d.mts +3 -3
- package/build/dataloaders/findOrCreateDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.cts +1 -2
- package/build/dataloaders/findPaginatedDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.mts +1 -2
- package/build/dataloaders/findPaginatedDataLoader.d.mts.map +1 -1
- package/build/dataloaders/lensDataLoader.d.cts +2 -3
- package/build/dataloaders/lensDataLoader.d.cts.map +1 -1
- package/build/dataloaders/lensDataLoader.d.mts +2 -3
- package/build/dataloaders/lensDataLoader.d.mts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.cts +2 -3
- package/build/dataloaders/manyToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.mts +2 -3
- package/build/dataloaders/manyToManyFindDataLoader.d.mts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.cts +2 -3
- package/build/dataloaders/oneToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.mts +2 -3
- package/build/dataloaders/oneToManyFindDataLoader.d.mts.map +1 -1
- package/build/defaults.cjs.map +1 -1
- package/build/defaults.d.cts +7 -7
- package/build/defaults.d.cts.map +1 -1
- package/build/defaults.d.mts +7 -7
- package/build/defaults.d.mts.map +1 -1
- package/build/defaults.js.map +1 -1
- package/build/drivers/Driver.d.cts +2 -3
- package/build/drivers/Driver.d.cts.map +1 -1
- package/build/drivers/Driver.d.mts +2 -3
- package/build/drivers/Driver.d.mts.map +1 -1
- package/build/drivers/EntityWriter.d.cts +7 -7
- package/build/drivers/EntityWriter.d.cts.map +1 -1
- package/build/drivers/EntityWriter.d.mts +7 -7
- package/build/drivers/EntityWriter.d.mts.map +1 -1
- package/build/drivers/IdAssigner.cjs.map +1 -1
- package/build/drivers/IdAssigner.d.cts +5 -5
- package/build/drivers/IdAssigner.d.cts.map +1 -1
- package/build/drivers/IdAssigner.d.mts +5 -5
- package/build/drivers/IdAssigner.d.mts.map +1 -1
- package/build/drivers/IdAssigner.js.map +1 -1
- package/build/drivers/driverApi.d.cts +2 -3
- package/build/drivers/driverApi.d.cts.map +1 -1
- package/build/drivers/driverApi.d.mts +2 -3
- package/build/drivers/driverApi.d.mts.map +1 -1
- package/build/fields.d.cts +6 -7
- package/build/fields.d.cts.map +1 -1
- package/build/fields.d.mts +6 -7
- package/build/fields.d.mts.map +1 -1
- package/build/flush/FlushLock.cjs.map +1 -1
- package/build/flush/FlushLock.d.cts +1 -2
- package/build/flush/FlushLock.d.cts.map +1 -1
- package/build/flush/FlushLock.d.mts +1 -2
- package/build/flush/FlushLock.d.mts.map +1 -1
- package/build/flush/FlushLock.js.map +1 -1
- package/build/flush/JoinRows.cjs.map +1 -1
- package/build/flush/JoinRows.d.cts +5 -6
- package/build/flush/JoinRows.d.cts.map +1 -1
- package/build/flush/JoinRows.d.mts +5 -6
- package/build/flush/JoinRows.d.mts.map +1 -1
- package/build/flush/JoinRows.js.map +1 -1
- package/build/flush/PendingChanges.d.cts +5 -6
- package/build/flush/PendingChanges.d.cts.map +1 -1
- package/build/flush/PendingChanges.d.mts +5 -6
- package/build/flush/PendingChanges.d.mts.map +1 -1
- package/build/flush/Todo.d.cts +5 -6
- package/build/flush/Todo.d.cts.map +1 -1
- package/build/flush/Todo.d.mts +5 -6
- package/build/flush/Todo.d.mts.map +1 -1
- package/build/getProperties.d.cts +3 -4
- package/build/getProperties.d.cts.map +1 -1
- package/build/getProperties.d.mts +3 -4
- package/build/getProperties.d.mts.map +1 -1
- package/build/index.d.cts +17 -17
- package/build/index.d.cts.map +1 -1
- package/build/index.d.mts +17 -17
- package/build/index.d.mts.map +1 -1
- package/build/json.d.cts +11 -11
- package/build/json.d.cts.map +1 -1
- package/build/json.d.mts +11 -11
- package/build/json.d.mts.map +1 -1
- package/build/keys.d.cts +27 -27
- package/build/keys.d.cts.map +1 -1
- package/build/keys.d.mts +27 -27
- package/build/keys.d.mts.map +1 -1
- package/build/loading/HintTree.d.cts +3 -4
- package/build/loading/HintTree.d.cts.map +1 -1
- package/build/loading/HintTree.d.mts +3 -4
- package/build/loading/HintTree.d.mts.map +1 -1
- package/build/loading/IsLoadedCache.cjs.map +1 -1
- package/build/loading/IsLoadedCache.d.cts +2 -3
- package/build/loading/IsLoadedCache.d.cts.map +1 -1
- package/build/loading/IsLoadedCache.d.mts +2 -3
- package/build/loading/IsLoadedCache.d.mts.map +1 -1
- package/build/loading/IsLoadedCache.js.map +1 -1
- package/build/loading/loadHints.d.cts +17 -17
- package/build/loading/loadHints.d.cts.map +1 -1
- package/build/loading/loadHints.d.mts +17 -17
- package/build/loading/loadHints.d.mts.map +1 -1
- package/build/loading/loadLens.d.cts +13 -13
- package/build/loading/loadLens.d.cts.map +1 -1
- package/build/loading/loadLens.d.mts +13 -13
- package/build/loading/loadLens.d.mts.map +1 -1
- package/build/loading/withLoaded.d.cts +5 -6
- package/build/loading/withLoaded.d.cts.map +1 -1
- package/build/loading/withLoaded.d.mts +5 -6
- package/build/loading/withLoaded.d.mts.map +1 -1
- package/build/logging/FactoryLogger.d.cts +3 -4
- package/build/logging/FactoryLogger.d.cts.map +1 -1
- package/build/logging/FactoryLogger.d.mts +3 -4
- package/build/logging/FactoryLogger.d.mts.map +1 -1
- package/build/logging/FieldLogger.cjs.map +1 -1
- package/build/logging/FieldLogger.d.cts +4 -5
- package/build/logging/FieldLogger.d.cts.map +1 -1
- package/build/logging/FieldLogger.d.mts +4 -5
- package/build/logging/FieldLogger.d.mts.map +1 -1
- package/build/logging/FieldLogger.js.map +1 -1
- package/build/logging/ReactionLogger.d.cts +7 -7
- package/build/logging/ReactionLogger.d.cts.map +1 -1
- package/build/logging/ReactionLogger.d.mts +7 -7
- package/build/logging/ReactionLogger.d.mts.map +1 -1
- package/build/newEntity.cjs.map +1 -1
- package/build/newEntity.d.cts +4 -5
- package/build/newEntity.d.cts.map +1 -1
- package/build/newEntity.d.mts +4 -5
- package/build/newEntity.d.mts.map +1 -1
- package/build/newEntity.js.map +1 -1
- package/build/newTestInstance.d.cts +21 -21
- package/build/newTestInstance.d.cts.map +1 -1
- package/build/newTestInstance.d.mts +21 -21
- package/build/newTestInstance.d.mts.map +1 -1
- package/build/normalizeHints.d.cts +7 -8
- package/build/normalizeHints.d.cts.map +1 -1
- package/build/normalizeHints.d.mts +7 -8
- package/build/normalizeHints.d.mts.map +1 -1
- package/build/nowUTC.d.cts +4 -5
- package/build/nowUTC.d.cts.map +1 -1
- package/build/nowUTC.d.mts +4 -5
- package/build/nowUTC.d.mts.map +1 -1
- package/build/plugins/ImmutableEntitiesPlugin.d.cts +1 -2
- package/build/plugins/ImmutableEntitiesPlugin.d.cts.map +1 -1
- package/build/plugins/ImmutableEntitiesPlugin.d.mts +1 -2
- package/build/plugins/ImmutableEntitiesPlugin.d.mts.map +1 -1
- package/build/plugins/PreloadPlugin.d.cts +3 -4
- package/build/plugins/PreloadPlugin.d.cts.map +1 -1
- package/build/plugins/PreloadPlugin.d.mts +3 -4
- package/build/plugins/PreloadPlugin.d.mts.map +1 -1
- package/build/preloading/JsonAggregatePreloader.d.cts +1 -2
- package/build/preloading/JsonAggregatePreloader.d.cts.map +1 -1
- package/build/preloading/JsonAggregatePreloader.d.mts +1 -2
- package/build/preloading/JsonAggregatePreloader.d.mts.map +1 -1
- package/build/preloading/canPreload.d.cts +1 -2
- package/build/preloading/canPreload.d.cts.map +1 -1
- package/build/preloading/canPreload.d.mts +1 -2
- package/build/preloading/canPreload.d.mts.map +1 -1
- package/build/preloading/partitionHint.d.cts +1 -2
- package/build/preloading/partitionHint.d.cts.map +1 -1
- package/build/preloading/partitionHint.d.mts +1 -2
- package/build/preloading/partitionHint.d.mts.map +1 -1
- package/build/queries/ConditionBuilder.d.cts +2 -2
- package/build/queries/ConditionBuilder.d.cts.map +1 -1
- package/build/queries/ConditionBuilder.d.mts +2 -2
- package/build/queries/ConditionBuilder.d.mts.map +1 -1
- package/build/queries/conditions.d.cts +11 -12
- package/build/queries/conditions.d.cts.map +1 -1
- package/build/queries/conditions.d.mts +11 -12
- package/build/queries/conditions.d.mts.map +1 -1
- package/build/queries/entityQueryUtils.d.cts +4 -5
- package/build/queries/entityQueryUtils.d.cts.map +1 -1
- package/build/queries/entityQueryUtils.d.mts +4 -5
- package/build/queries/entityQueryUtils.d.mts.map +1 -1
- package/build/queries/find/Aliases.d.cts +16 -16
- package/build/queries/find/Aliases.d.cts.map +1 -1
- package/build/queries/find/Aliases.d.mts +16 -16
- package/build/queries/find/Aliases.d.mts.map +1 -1
- package/build/queries/find/DeferredAlias.d.cts +5 -6
- package/build/queries/find/DeferredAlias.d.cts.map +1 -1
- package/build/queries/find/DeferredAlias.d.mts +5 -6
- package/build/queries/find/DeferredAlias.d.mts.map +1 -1
- package/build/queries/find/EntityFilter.d.cts +12 -13
- package/build/queries/find/EntityFilter.d.cts.map +1 -1
- package/build/queries/find/EntityFilter.d.mts +12 -13
- package/build/queries/find/EntityFilter.d.mts.map +1 -1
- package/build/queries/find/EntityGraphQLFilter.d.cts +8 -9
- package/build/queries/find/EntityGraphQLFilter.d.cts.map +1 -1
- package/build/queries/find/EntityGraphQLFilter.d.mts +8 -9
- package/build/queries/find/EntityGraphQLFilter.d.mts.map +1 -1
- package/build/queries/find/QueryParser.collectionJoins.d.cts +1 -2
- package/build/queries/find/QueryParser.collectionJoins.d.cts.map +1 -1
- package/build/queries/find/QueryParser.collectionJoins.d.mts +1 -2
- package/build/queries/find/QueryParser.collectionJoins.d.mts.map +1 -1
- package/build/queries/find/QueryParser.d.cts +18 -18
- package/build/queries/find/QueryParser.d.cts.map +1 -1
- package/build/queries/find/QueryParser.d.mts +18 -18
- package/build/queries/find/QueryParser.d.mts.map +1 -1
- package/build/queries/find/QueryParser.pruning.d.cts +2 -3
- package/build/queries/find/QueryParser.pruning.d.cts.map +1 -1
- package/build/queries/find/QueryParser.pruning.d.mts +2 -3
- package/build/queries/find/QueryParser.pruning.d.mts.map +1 -1
- package/build/queries/find/QueryVisitor.d.cts +4 -4
- package/build/queries/find/QueryVisitor.d.cts.map +1 -1
- package/build/queries/find/QueryVisitor.d.mts +4 -4
- package/build/queries/find/QueryVisitor.d.mts.map +1 -1
- package/build/queries/find/buildFindQuery.d.cts +3 -3
- package/build/queries/find/buildFindQuery.d.cts.map +1 -1
- package/build/queries/find/buildFindQuery.d.mts +3 -3
- package/build/queries/find/buildFindQuery.d.mts.map +1 -1
- package/build/queries/find/scopes.cjs.map +1 -1
- package/build/queries/find/scopes.d.cts +12 -13
- package/build/queries/find/scopes.d.cts.map +1 -1
- package/build/queries/find/scopes.d.mts +12 -13
- package/build/queries/find/scopes.d.mts.map +1 -1
- package/build/queries/find/scopes.js.map +1 -1
- package/build/queries/parsedConditions.d.cts +7 -8
- package/build/queries/parsedConditions.d.cts.map +1 -1
- package/build/queries/parsedConditions.d.mts +7 -8
- package/build/queries/parsedConditions.d.mts.map +1 -1
- package/build/queries/renderConditions.d.cts +3 -4
- package/build/queries/renderConditions.d.cts.map +1 -1
- package/build/queries/renderConditions.d.mts +3 -4
- package/build/queries/renderConditions.d.mts.map +1 -1
- package/build/queries/skipCondition.d.cts +1 -2
- package/build/queries/skipCondition.d.cts.map +1 -1
- package/build/queries/skipCondition.d.mts +1 -2
- package/build/queries/skipCondition.d.mts.map +1 -1
- package/build/queries/sql/AliasAssigner.cjs.map +1 -1
- package/build/queries/sql/AliasAssigner.d.cts +1 -2
- package/build/queries/sql/AliasAssigner.d.cts.map +1 -1
- package/build/queries/sql/AliasAssigner.d.mts +1 -2
- package/build/queries/sql/AliasAssigner.d.mts.map +1 -1
- package/build/queries/sql/AliasAssigner.js.map +1 -1
- package/build/queries/sql/Expr.d.cts +26 -27
- package/build/queries/sql/Expr.d.cts.map +1 -1
- package/build/queries/sql/Expr.d.mts +26 -27
- package/build/queries/sql/Expr.d.mts.map +1 -1
- package/build/queries/sql/JoinTree.d.cts +5 -5
- package/build/queries/sql/JoinTree.d.cts.map +1 -1
- package/build/queries/sql/JoinTree.d.mts +5 -5
- package/build/queries/sql/JoinTree.d.mts.map +1 -1
- package/build/queries/sql/Tables.d.cts +39 -39
- package/build/queries/sql/Tables.d.cts.map +1 -1
- package/build/queries/sql/Tables.d.mts +39 -39
- package/build/queries/sql/Tables.d.mts.map +1 -1
- package/build/queries/sql/custom.d.cts +14 -14
- package/build/queries/sql/custom.d.cts.map +1 -1
- package/build/queries/sql/custom.d.mts +14 -14
- package/build/queries/sql/custom.d.mts.map +1 -1
- package/build/queries/sql/execute.d.cts +15 -15
- package/build/queries/sql/execute.d.cts.map +1 -1
- package/build/queries/sql/execute.d.mts +15 -15
- package/build/queries/sql/execute.d.mts.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.d.cts +5 -6
- package/build/queries/sql/expressions/arrayAgg.d.cts.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.d.mts +5 -6
- package/build/queries/sql/expressions/arrayAgg.d.mts.map +1 -1
- package/build/queries/sql/expressions/case.d.cts +10 -10
- package/build/queries/sql/expressions/case.d.cts.map +1 -1
- package/build/queries/sql/expressions/case.d.mts +10 -10
- package/build/queries/sql/expressions/case.d.mts.map +1 -1
- package/build/queries/sql/expressions/coalesce.d.cts +5 -6
- package/build/queries/sql/expressions/coalesce.d.cts.map +1 -1
- package/build/queries/sql/expressions/coalesce.d.mts +5 -6
- package/build/queries/sql/expressions/coalesce.d.mts.map +1 -1
- package/build/queries/sql/expressions/codecs.d.cts +1 -2
- package/build/queries/sql/expressions/codecs.d.cts.map +1 -1
- package/build/queries/sql/expressions/codecs.d.mts +1 -2
- package/build/queries/sql/expressions/codecs.d.mts.map +1 -1
- package/build/queries/sql/expressions/expression.d.cts +6 -6
- package/build/queries/sql/expressions/expression.d.cts.map +1 -1
- package/build/queries/sql/expressions/expression.d.mts +6 -6
- package/build/queries/sql/expressions/expression.d.mts.map +1 -1
- package/build/queries/sql/expressions/greatest.d.cts +5 -6
- package/build/queries/sql/expressions/greatest.d.cts.map +1 -1
- package/build/queries/sql/expressions/greatest.d.mts +5 -6
- package/build/queries/sql/expressions/greatest.d.mts.map +1 -1
- package/build/queries/sql/expressions/least.d.cts +5 -6
- package/build/queries/sql/expressions/least.d.cts.map +1 -1
- package/build/queries/sql/expressions/least.d.mts +5 -6
- package/build/queries/sql/expressions/least.d.mts.map +1 -1
- package/build/queries/sql/expressions/nullIf.d.cts +5 -6
- package/build/queries/sql/expressions/nullIf.d.cts.map +1 -1
- package/build/queries/sql/expressions/nullIf.d.mts +5 -6
- package/build/queries/sql/expressions/nullIf.d.mts.map +1 -1
- package/build/queries/sql/expressions/parseExpression.d.cts +5 -6
- package/build/queries/sql/expressions/parseExpression.d.cts.map +1 -1
- package/build/queries/sql/expressions/parseExpression.d.mts +5 -6
- package/build/queries/sql/expressions/parseExpression.d.mts.map +1 -1
- package/build/queries/sql/expressions/types.d.cts +11 -11
- package/build/queries/sql/expressions/types.d.cts.map +1 -1
- package/build/queries/sql/expressions/types.d.mts +11 -11
- package/build/queries/sql/expressions/types.d.mts.map +1 -1
- package/build/queries/sql/keywords.d.cts +4 -5
- package/build/queries/sql/keywords.d.cts.map +1 -1
- package/build/queries/sql/keywords.d.mts +4 -5
- package/build/queries/sql/keywords.d.mts.map +1 -1
- package/build/queries/sql/query.cjs.map +1 -1
- package/build/queries/sql/query.d.cts +67 -67
- package/build/queries/sql/query.d.cts.map +1 -1
- package/build/queries/sql/query.d.mts +67 -67
- package/build/queries/sql/query.d.mts.map +1 -1
- package/build/queries/sql/query.js.map +1 -1
- package/build/queries/unnest.d.cts +2 -3
- package/build/queries/unnest.d.cts.map +1 -1
- package/build/queries/unnest.d.mts +2 -3
- package/build/queries/unnest.d.mts.map +1 -1
- package/build/queries/valueFilters.d.cts +5 -6
- package/build/queries/valueFilters.d.cts.map +1 -1
- package/build/queries/valueFilters.d.mts +5 -6
- package/build/queries/valueFilters.d.mts.map +1 -1
- package/build/reactivity/ReactionsManager.cjs.map +1 -1
- package/build/reactivity/ReactionsManager.d.cts +2 -3
- package/build/reactivity/ReactionsManager.d.cts.map +1 -1
- package/build/reactivity/ReactionsManager.d.mts +2 -3
- package/build/reactivity/ReactionsManager.d.mts.map +1 -1
- package/build/reactivity/ReactionsManager.js.map +1 -1
- package/build/reactivity/reactiveHints.d.cts +18 -18
- package/build/reactivity/reactiveHints.d.cts.map +1 -1
- package/build/reactivity/reactiveHints.d.mts +18 -18
- package/build/reactivity/reactiveHints.d.mts.map +1 -1
- package/build/relations/AbstractPropertyImpl.cjs.map +1 -1
- package/build/relations/AbstractPropertyImpl.d.cts +1 -2
- package/build/relations/AbstractPropertyImpl.d.cts.map +1 -1
- package/build/relations/AbstractPropertyImpl.d.mts +1 -2
- package/build/relations/AbstractPropertyImpl.d.mts.map +1 -1
- package/build/relations/AbstractPropertyImpl.js.map +1 -1
- package/build/relations/AbstractRelationImpl.d.cts +1 -2
- package/build/relations/AbstractRelationImpl.d.cts.map +1 -1
- package/build/relations/AbstractRelationImpl.d.mts +1 -2
- package/build/relations/AbstractRelationImpl.d.mts.map +1 -1
- package/build/relations/AsyncProperty.cjs.map +1 -1
- package/build/relations/AsyncProperty.d.cts +5 -6
- package/build/relations/AsyncProperty.d.cts.map +1 -1
- package/build/relations/AsyncProperty.d.mts +5 -6
- package/build/relations/AsyncProperty.d.mts.map +1 -1
- package/build/relations/AsyncProperty.js.map +1 -1
- package/build/relations/AsyncReactiveField.cjs.map +1 -1
- package/build/relations/AsyncReactiveField.d.cts +4 -5
- package/build/relations/AsyncReactiveField.d.cts.map +1 -1
- package/build/relations/AsyncReactiveField.d.mts +4 -5
- package/build/relations/AsyncReactiveField.d.mts.map +1 -1
- package/build/relations/AsyncReactiveField.js.map +1 -1
- package/build/relations/Collection.d.cts +4 -5
- package/build/relations/Collection.d.cts.map +1 -1
- package/build/relations/Collection.d.mts +4 -5
- package/build/relations/Collection.d.mts.map +1 -1
- package/build/relations/CustomCollection.cjs.map +1 -1
- package/build/relations/CustomCollection.d.cts +3 -4
- package/build/relations/CustomCollection.d.cts.map +1 -1
- package/build/relations/CustomCollection.d.mts +3 -4
- package/build/relations/CustomCollection.d.mts.map +1 -1
- package/build/relations/CustomCollection.js.map +1 -1
- package/build/relations/CustomReference.cjs.map +1 -1
- package/build/relations/CustomReference.d.cts +3 -4
- package/build/relations/CustomReference.d.cts.map +1 -1
- package/build/relations/CustomReference.d.mts +3 -4
- package/build/relations/CustomReference.d.mts.map +1 -1
- package/build/relations/CustomReference.js.map +1 -1
- package/build/relations/EnumCollection.cjs.map +1 -1
- package/build/relations/EnumCollection.d.cts +5 -5
- package/build/relations/EnumCollection.d.cts.map +1 -1
- package/build/relations/EnumCollection.d.mts +5 -5
- package/build/relations/EnumCollection.d.mts.map +1 -1
- package/build/relations/EnumCollection.js.map +1 -1
- package/build/relations/LargeCollection.d.cts +1 -2
- package/build/relations/LargeCollection.d.cts.map +1 -1
- package/build/relations/LargeCollection.d.mts +1 -2
- package/build/relations/LargeCollection.d.mts.map +1 -1
- package/build/relations/LazyField.cjs.map +1 -1
- package/build/relations/LazyField.d.cts +7 -8
- package/build/relations/LazyField.d.cts.map +1 -1
- package/build/relations/LazyField.d.mts +7 -8
- package/build/relations/LazyField.d.mts.map +1 -1
- package/build/relations/LazyField.js.map +1 -1
- package/build/relations/ManyToManyCollection.cjs.map +1 -1
- package/build/relations/ManyToManyCollection.d.cts +2 -3
- package/build/relations/ManyToManyCollection.d.cts.map +1 -1
- package/build/relations/ManyToManyCollection.d.mts +2 -3
- package/build/relations/ManyToManyCollection.d.mts.map +1 -1
- package/build/relations/ManyToManyCollection.js.map +1 -1
- package/build/relations/ManyToManyLargeCollection.d.cts +2 -3
- package/build/relations/ManyToManyLargeCollection.d.cts.map +1 -1
- package/build/relations/ManyToManyLargeCollection.d.mts +2 -3
- package/build/relations/ManyToManyLargeCollection.d.mts.map +1 -1
- package/build/relations/ManyToOneReference.cjs.map +1 -1
- package/build/relations/ManyToOneReference.d.cts +6 -7
- package/build/relations/ManyToOneReference.d.cts.map +1 -1
- package/build/relations/ManyToOneReference.d.mts +6 -7
- package/build/relations/ManyToOneReference.d.mts.map +1 -1
- package/build/relations/ManyToOneReference.js.map +1 -1
- package/build/relations/OneToManyCollection.cjs.map +1 -1
- package/build/relations/OneToManyCollection.d.cts +2 -3
- package/build/relations/OneToManyCollection.d.cts.map +1 -1
- package/build/relations/OneToManyCollection.d.mts +2 -3
- package/build/relations/OneToManyCollection.d.mts.map +1 -1
- package/build/relations/OneToManyCollection.js.map +1 -1
- package/build/relations/OneToManyLargeCollection.cjs.map +1 -1
- package/build/relations/OneToManyLargeCollection.d.cts +2 -3
- package/build/relations/OneToManyLargeCollection.d.cts.map +1 -1
- package/build/relations/OneToManyLargeCollection.d.mts +2 -3
- package/build/relations/OneToManyLargeCollection.d.mts.map +1 -1
- package/build/relations/OneToManyLargeCollection.js.map +1 -1
- package/build/relations/OneToOneReference.cjs.map +1 -1
- package/build/relations/OneToOneReference.d.cts +7 -7
- package/build/relations/OneToOneReference.d.cts.map +1 -1
- package/build/relations/OneToOneReference.d.mts +7 -7
- package/build/relations/OneToOneReference.d.mts.map +1 -1
- package/build/relations/OneToOneReference.js.map +1 -1
- package/build/relations/PolymorphicReference.cjs.map +1 -1
- package/build/relations/PolymorphicReference.d.cts +4 -5
- package/build/relations/PolymorphicReference.d.cts.map +1 -1
- package/build/relations/PolymorphicReference.d.mts +4 -5
- package/build/relations/PolymorphicReference.d.mts.map +1 -1
- package/build/relations/PolymorphicReference.js.map +1 -1
- package/build/relations/PropertySymbols.d.cts +1 -2
- package/build/relations/PropertySymbols.d.cts.map +1 -1
- package/build/relations/PropertySymbols.d.mts +1 -2
- package/build/relations/PropertySymbols.d.mts.map +1 -1
- package/build/relations/ReactiveField.cjs.map +1 -1
- package/build/relations/ReactiveField.d.cts +4 -5
- package/build/relations/ReactiveField.d.cts.map +1 -1
- package/build/relations/ReactiveField.d.mts +4 -5
- package/build/relations/ReactiveField.d.mts.map +1 -1
- package/build/relations/ReactiveField.js.map +1 -1
- package/build/relations/ReactiveGetter.cjs.map +1 -1
- package/build/relations/ReactiveGetter.d.cts +4 -5
- package/build/relations/ReactiveGetter.d.cts.map +1 -1
- package/build/relations/ReactiveGetter.d.mts +4 -5
- package/build/relations/ReactiveGetter.d.mts.map +1 -1
- package/build/relations/ReactiveGetter.js.map +1 -1
- package/build/relations/ReactiveManyToMany.cjs.map +1 -1
- package/build/relations/ReactiveManyToMany.d.cts +4 -5
- package/build/relations/ReactiveManyToMany.d.cts.map +1 -1
- package/build/relations/ReactiveManyToMany.d.mts +4 -5
- package/build/relations/ReactiveManyToMany.d.mts.map +1 -1
- package/build/relations/ReactiveManyToMany.js.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.cjs.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.d.cts +4 -5
- package/build/relations/ReactiveManyToManyOtherSide.d.cts.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.d.mts +4 -5
- package/build/relations/ReactiveManyToManyOtherSide.d.mts.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.js.map +1 -1
- package/build/relations/ReactiveReference.cjs.map +1 -1
- package/build/relations/ReactiveReference.d.cts +5 -6
- package/build/relations/ReactiveReference.d.cts.map +1 -1
- package/build/relations/ReactiveReference.d.mts +5 -6
- package/build/relations/ReactiveReference.d.mts.map +1 -1
- package/build/relations/ReactiveReference.js.map +1 -1
- package/build/relations/ReadOnlyCollection.d.cts +4 -5
- package/build/relations/ReadOnlyCollection.d.cts.map +1 -1
- package/build/relations/ReadOnlyCollection.d.mts +4 -5
- package/build/relations/ReadOnlyCollection.d.mts.map +1 -1
- package/build/relations/RecursiveCollection.cjs.map +1 -1
- package/build/relations/RecursiveCollection.d.cts +10 -10
- package/build/relations/RecursiveCollection.d.cts.map +1 -1
- package/build/relations/RecursiveCollection.d.mts +10 -10
- package/build/relations/RecursiveCollection.d.mts.map +1 -1
- package/build/relations/RecursiveCollection.js.map +1 -1
- package/build/relations/RecursiveCycleError.d.cts +2 -2
- package/build/relations/RecursiveCycleError.d.cts.map +1 -1
- package/build/relations/RecursiveCycleError.d.mts +2 -2
- package/build/relations/RecursiveCycleError.d.mts.map +1 -1
- package/build/relations/Reference.d.cts +5 -5
- package/build/relations/Reference.d.cts.map +1 -1
- package/build/relations/Reference.d.mts +5 -5
- package/build/relations/Reference.d.mts.map +1 -1
- package/build/relations/ReferenceSymbols.d.cts +1 -2
- package/build/relations/ReferenceSymbols.d.cts.map +1 -1
- package/build/relations/ReferenceSymbols.d.mts +1 -2
- package/build/relations/ReferenceSymbols.d.mts.map +1 -1
- package/build/relations/Relation.d.cts +3 -3
- package/build/relations/Relation.d.cts.map +1 -1
- package/build/relations/Relation.d.mts +3 -3
- package/build/relations/Relation.d.mts.map +1 -1
- package/build/relations/RelationSymbols.d.cts +2 -3
- package/build/relations/RelationSymbols.d.cts.map +1 -1
- package/build/relations/RelationSymbols.d.mts +2 -3
- package/build/relations/RelationSymbols.d.mts.map +1 -1
- package/build/relations/hasAsyncMethod.cjs.map +1 -1
- package/build/relations/hasAsyncMethod.d.cts +6 -6
- package/build/relations/hasAsyncMethod.d.cts.map +1 -1
- package/build/relations/hasAsyncMethod.d.mts +6 -6
- package/build/relations/hasAsyncMethod.d.mts.map +1 -1
- package/build/relations/hasAsyncMethod.js.map +1 -1
- package/build/relations/hasManyDerived.d.cts +2 -2
- package/build/relations/hasManyDerived.d.cts.map +1 -1
- package/build/relations/hasManyDerived.d.mts +2 -2
- package/build/relations/hasManyDerived.d.mts.map +1 -1
- package/build/relations/hasManyThrough.d.cts +1 -2
- package/build/relations/hasManyThrough.d.cts.map +1 -1
- package/build/relations/hasManyThrough.d.mts +1 -2
- package/build/relations/hasManyThrough.d.mts.map +1 -1
- package/build/relations/hasOneDerived.d.cts +1 -2
- package/build/relations/hasOneDerived.d.cts.map +1 -1
- package/build/relations/hasOneDerived.d.mts +1 -2
- package/build/relations/hasOneDerived.d.mts.map +1 -1
- package/build/relations/hasOneThrough.d.cts +1 -2
- package/build/relations/hasOneThrough.d.cts.map +1 -1
- package/build/relations/hasOneThrough.d.mts +1 -2
- package/build/relations/hasOneThrough.d.mts.map +1 -1
- package/build/relations/hasProperty.cjs.map +1 -1
- package/build/relations/hasProperty.d.cts +8 -8
- package/build/relations/hasProperty.d.cts.map +1 -1
- package/build/relations/hasProperty.d.mts +8 -8
- package/build/relations/hasProperty.d.mts.map +1 -1
- package/build/relations/hasProperty.js.map +1 -1
- package/build/relations/isCascadeDelete.d.cts +1 -2
- package/build/relations/isCascadeDelete.d.cts.map +1 -1
- package/build/relations/isCascadeDelete.d.mts +1 -2
- package/build/relations/isCascadeDelete.d.mts.map +1 -1
- package/build/resurrection.d.cts +3 -4
- package/build/resurrection.d.cts.map +1 -1
- package/build/resurrection.d.mts +3 -4
- package/build/resurrection.d.mts.map +1 -1
- package/build/rules.d.cts +20 -20
- package/build/rules.d.cts.map +1 -1
- package/build/rules.d.mts +20 -20
- package/build/rules.d.mts.map +1 -1
- package/build/runtimeConfig.d.cts +4 -5
- package/build/runtimeConfig.d.cts.map +1 -1
- package/build/runtimeConfig.d.mts +4 -5
- package/build/runtimeConfig.d.mts.map +1 -1
- package/build/serde/TypeInfo.d.cts +3 -4
- package/build/serde/TypeInfo.d.cts.map +1 -1
- package/build/serde/TypeInfo.d.mts +3 -4
- package/build/serde/TypeInfo.d.mts.map +1 -1
- package/build/serde/columns.d.cts +2 -3
- package/build/serde/columns.d.cts.map +1 -1
- package/build/serde/columns.d.mts +2 -3
- package/build/serde/columns.d.mts.map +1 -1
- package/build/serde/fieldSerde.d.cts +9 -9
- package/build/serde/fieldSerde.d.cts.map +1 -1
- package/build/serde/fieldSerde.d.mts +9 -9
- package/build/serde/fieldSerde.d.mts.map +1 -1
- package/build/serde/serde.d.cts +18 -19
- package/build/serde/serde.d.cts.map +1 -1
- package/build/serde/serde.d.mts +18 -19
- package/build/serde/serde.d.mts.map +1 -1
- package/build/serde/temporal.d.cts +5 -5
- package/build/serde/temporal.d.cts.map +1 -1
- package/build/serde/temporal.d.mts +5 -5
- package/build/serde/temporal.d.mts.map +1 -1
- package/build/serde/temporalMappers.d.cts +4 -5
- package/build/serde/temporalMappers.d.cts.map +1 -1
- package/build/serde/temporalMappers.d.mts +4 -5
- package/build/serde/temporalMappers.d.mts.map +1 -1
- package/build/transitions.d.cts +17 -18
- package/build/transitions.d.cts.map +1 -1
- package/build/transitions.d.mts +17 -18
- package/build/transitions.d.mts.map +1 -1
- package/build/trusted.d.cts +2 -3
- package/build/trusted.d.cts.map +1 -1
- package/build/trusted.d.mts +2 -3
- package/build/trusted.d.mts.map +1 -1
- package/build/typeMap.d.cts +17 -17
- package/build/typeMap.d.cts.map +1 -1
- package/build/typeMap.d.mts +17 -17
- package/build/typeMap.d.mts.map +1 -1
- package/build/upsert.d.cts +4 -4
- package/build/upsert.d.cts.map +1 -1
- package/build/upsert.d.mts +4 -4
- package/build/upsert.d.mts.map +1 -1
- package/build/utils.d.cts +27 -28
- package/build/utils.d.cts.map +1 -1
- package/build/utils.d.mts +27 -28
- package/build/utils.d.mts.map +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BatchLoader } from "./batchloaders/BatchLoader.cjs";
|
|
2
|
-
import { OptsOf, OrderOf } from "./typeMap.cjs";
|
|
2
|
+
import { OptsOf, OrderOf, TypeMap } from "./typeMap.cjs";
|
|
3
3
|
import { Collection } from "./relations/Collection.cjs";
|
|
4
4
|
import { lazyColumnLoadOperation } from "./relations/LazyField.cjs";
|
|
5
5
|
import { Reference } from "./relations/Reference.cjs";
|
|
@@ -54,7 +54,7 @@ import DataLoader, { BatchLoadFn, Options } from "dataloader";
|
|
|
54
54
|
* Abstract entity types, like a base `Publisher` class that is marked `abstract`, cannot
|
|
55
55
|
* implement this and instead only have the `AbsEntityConstructor` type.
|
|
56
56
|
*/
|
|
57
|
-
interface EntityConstructor<T> {
|
|
57
|
+
export interface EntityConstructor<T> {
|
|
58
58
|
/** The pseudo-public constructor for entities; only the `EntityManager` should actually instantiate entities. */
|
|
59
59
|
new (em: EntityManager<any, any, any>): T;
|
|
60
60
|
tagName: any;
|
|
@@ -63,7 +63,7 @@ interface EntityConstructor<T> {
|
|
|
63
63
|
getInstanceData(entity: Entity): InstanceData;
|
|
64
64
|
}
|
|
65
65
|
/** Options for the auto-batchable `em.find` queries. */
|
|
66
|
-
interface FindFilterOptions<T extends Entity> {
|
|
66
|
+
export interface FindFilterOptions<T extends Entity> {
|
|
67
67
|
conditions?: ExpressionFilter;
|
|
68
68
|
orderBy?: OrderOf<T> | OrderOf<T>[];
|
|
69
69
|
limit?: number | undefined;
|
|
@@ -72,12 +72,12 @@ interface FindFilterOptions<T extends Entity> {
|
|
|
72
72
|
allowMultipleLeftJoins?: boolean;
|
|
73
73
|
optimizeJoinsToExists?: boolean;
|
|
74
74
|
}
|
|
75
|
-
interface FindGqlFilterOptions<T extends Entity> extends Omit<FindFilterOptions<T>, "limit" | "offset"> {
|
|
75
|
+
export interface FindGqlFilterOptions<T extends Entity> extends Omit<FindFilterOptions<T>, "limit" | "offset"> {
|
|
76
76
|
limit?: number | null | undefined;
|
|
77
77
|
offset?: number | null | undefined;
|
|
78
78
|
}
|
|
79
79
|
/** Options for the `findCount`. */
|
|
80
|
-
interface FindCountFilterOptions<T extends Entity> {
|
|
80
|
+
export interface FindCountFilterOptions<T extends Entity> {
|
|
81
81
|
conditions?: ExpressionFilter;
|
|
82
82
|
softDeletes?: "include" | "exclude";
|
|
83
83
|
allowMultipleLeftJoins?: boolean;
|
|
@@ -88,16 +88,18 @@ interface FindCountFilterOptions<T extends Entity> {
|
|
|
88
88
|
*
|
|
89
89
|
* I.e. this is more like "MaybeAbstractEntityConstructor".
|
|
90
90
|
*/
|
|
91
|
-
type MaybeAbstractEntityConstructor<T> = abstract new (em: EntityManager<any, any, any>, opts: any) => T;
|
|
91
|
+
export type MaybeAbstractEntityConstructor<T> = abstract new (em: EntityManager<any, any, any>, opts: any) => T;
|
|
92
92
|
/** Pulls the entity's id type out of a given entity type T. */
|
|
93
|
-
type IdOf<T> = T extends {
|
|
93
|
+
export type IdOf<T> = T extends {
|
|
94
94
|
id: infer I;
|
|
95
95
|
} ? I : never;
|
|
96
|
-
type TaggedId = string;
|
|
97
|
-
|
|
98
|
-
type
|
|
96
|
+
export type TaggedId = string;
|
|
97
|
+
/** Creation options for any registered entity type, since deep clones can include more than the root type. */
|
|
98
|
+
export type CloneOverrides = Partial<TypeMap[keyof TypeMap]["optsType"]>;
|
|
99
|
+
export declare function isId(value: any): value is IdOf<unknown>;
|
|
100
|
+
export type EntityManagerHook = "beforeBegin" | "afterBegin" | "beforeCommit" | "afterCommit";
|
|
99
101
|
/** Options for EntityManager transaction hooks. */
|
|
100
|
-
interface EntityManagerHookOptions {
|
|
102
|
+
export interface EntityManagerHookOptions {
|
|
101
103
|
/**
|
|
102
104
|
* Runs the transaction lifecycle even on write-less flushes. Defaults to false.
|
|
103
105
|
*
|
|
@@ -107,13 +109,13 @@ interface EntityManagerHookOptions {
|
|
|
107
109
|
forceTransaction?: boolean;
|
|
108
110
|
}
|
|
109
111
|
type HookFn<TX> = (em: EntityManager, txn: TX) => MaybePromise<any>;
|
|
110
|
-
type LoaderCache = Record<string, DataLoader<any, any>>;
|
|
111
|
-
interface TimestampFields {
|
|
112
|
+
export type LoaderCache = Record<string, DataLoader<any, any>>;
|
|
113
|
+
export interface TimestampFields {
|
|
112
114
|
updatedAt: string | undefined;
|
|
113
115
|
createdAt: string | undefined;
|
|
114
116
|
deletedAt: string | undefined;
|
|
115
117
|
}
|
|
116
|
-
type EntityManagerOpts<TX = unknown> = ({
|
|
118
|
+
export type EntityManagerOpts<TX = unknown> = ({
|
|
117
119
|
driver: Driver<TX>;
|
|
118
120
|
em?: undefined;
|
|
119
121
|
} | {
|
|
@@ -122,7 +124,7 @@ type EntityManagerOpts<TX = unknown> = ({
|
|
|
122
124
|
}) & {
|
|
123
125
|
preloadPlugin?: PreloadPlugin;
|
|
124
126
|
};
|
|
125
|
-
interface FlushOptions {
|
|
127
|
+
export interface FlushOptions {
|
|
126
128
|
/** Skip all validations, including reactive validations, when flushing */
|
|
127
129
|
skipValidation?: boolean;
|
|
128
130
|
}
|
|
@@ -133,8 +135,8 @@ interface FlushOptions {
|
|
|
133
135
|
* - `in-memory-writes` -- allows entity mutations and `em.flush` w/o a `COMMIT`
|
|
134
136
|
* - `writes` -- allows entity mutations and `em.flush` will `COMMIT` writes
|
|
135
137
|
*/
|
|
136
|
-
type EntityManagerMode = "read-only" | "in-memory-writes" | "writes";
|
|
137
|
-
type FindOperation = typeof findOperation | typeof findByUniqueOperation | typeof findCountOperation | typeof findIdsOperation | typeof lensOperation | typeof loadOperation | typeof manyToManyLoadOperation | typeof manyToManyFindOperation | typeof enumCollectionLoadOperation | typeof oneToManyLoadOperation | typeof oneToManyFindOperation | typeof oneToOneLoadOperation | typeof populateOperation | typeof recursiveChildrenOperation | typeof recursiveM2mOperation | typeof recursiveParentsOperation | typeof lazyColumnLoadOperation;
|
|
138
|
+
export type EntityManagerMode = "read-only" | "in-memory-writes" | "writes";
|
|
139
|
+
export type FindOperation = typeof findOperation | typeof findByUniqueOperation | typeof findCountOperation | typeof findIdsOperation | typeof lensOperation | typeof loadOperation | typeof manyToManyLoadOperation | typeof manyToManyFindOperation | typeof enumCollectionLoadOperation | typeof oneToManyLoadOperation | typeof oneToManyFindOperation | typeof oneToOneLoadOperation | typeof populateOperation | typeof recursiveChildrenOperation | typeof recursiveM2mOperation | typeof recursiveParentsOperation | typeof lazyColumnLoadOperation;
|
|
138
140
|
/**
|
|
139
141
|
* The EntityManager is the primary way nearly all code, i.e. anything that finds/creates/updates/deletes entities,
|
|
140
142
|
* will interact with the database.
|
|
@@ -155,7 +157,7 @@ type FindOperation = typeof findOperation | typeof findByUniqueOperation | typeo
|
|
|
155
157
|
* @typeParam Entity - the application's based entity type (i.e. with number ids or string ids)
|
|
156
158
|
* @typeParamTX - the application's Transaction type, i.e. `Knex`
|
|
157
159
|
*/
|
|
158
|
-
declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX extends unknown = unknown> {
|
|
160
|
+
export declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX extends unknown = unknown> {
|
|
159
161
|
#private;
|
|
160
162
|
readonly ctx: C;
|
|
161
163
|
driver: Driver<TX>;
|
|
@@ -378,6 +380,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
378
380
|
* @param deep - Populate hint of the nested tree of objects to clone
|
|
379
381
|
* @param skip - Keys that will be skipped in the clone
|
|
380
382
|
* @param skipIf - Predicate for determining if a specific entity should be skipped (and any entities beneath it
|
|
383
|
+
* @param overrides - Creation options for each entity, applied before defaults and instead of copied values
|
|
381
384
|
* @param postClone - Function to be called for each original/clone entity for any post-processing needed
|
|
382
385
|
* @returns The `Loaded` cloned entity or fails if the clone could not be made
|
|
383
386
|
*
|
|
@@ -405,6 +408,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
405
408
|
deep?: H;
|
|
406
409
|
skip?: K;
|
|
407
410
|
skipIf?: (entity: Entity$1) => boolean;
|
|
411
|
+
overrides?: (original: Entity$1) => CloneOverrides;
|
|
408
412
|
postClone?: (original: Entity$1, clone: Entity$1) => void;
|
|
409
413
|
}): Promise<Loaded<T, H>>;
|
|
410
414
|
/**
|
|
@@ -415,6 +419,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
415
419
|
* @param deep - Populate hint of the nested tree of objects to clone
|
|
416
420
|
* @param skip - Keys that will be skipped in the clone
|
|
417
421
|
* @param skipIf - Predicate for determining if a specific entity should be skipped (and any entities beneath it
|
|
422
|
+
* @param overrides - Creation options for each entity, applied before defaults and instead of copied values
|
|
418
423
|
* @param postClone - Function to be called for each original/clone entity for any post-processing needed
|
|
419
424
|
* @returns Array of `Loaded` cloned entities from the provided list or empty array if all are skipped
|
|
420
425
|
*
|
|
@@ -428,7 +433,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
428
433
|
*
|
|
429
434
|
* @example
|
|
430
435
|
* // This will duplicate the author's books, and assign them to a different author
|
|
431
|
-
* const duplicatedBooks = await em.clone(author.books.get, {
|
|
436
|
+
* const duplicatedBooks = await em.clone(author.books.get, { overrides: () => ({ author: author2 }) })
|
|
432
437
|
*
|
|
433
438
|
* @example
|
|
434
439
|
* // This will duplicate the author's books, but skip any book where the title includes `sea`
|
|
@@ -438,6 +443,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
438
443
|
deep?: H;
|
|
439
444
|
skip?: K;
|
|
440
445
|
skipIf?: (entity: Entity$1) => boolean;
|
|
446
|
+
overrides?: (original: Entity$1) => CloneOverrides;
|
|
441
447
|
postClone?: (original: Entity$1, clone: Entity$1) => void;
|
|
442
448
|
}): Promise<Loaded<T, H>[]>;
|
|
443
449
|
/**
|
|
@@ -778,7 +784,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
778
784
|
get isFlushing(): boolean;
|
|
779
785
|
}
|
|
780
786
|
/** Provides an internal API to the `EntityManager`. */
|
|
781
|
-
interface EntityManagerInternalApi {
|
|
787
|
+
export interface EntityManagerInternalApi {
|
|
782
788
|
joinRows: (m2m: ManyToManyLike) => JoinRows;
|
|
783
789
|
/** Map of taggedId -> fieldName -> pending children, i.e. when `a1.books` later loads, add/remove b1. */
|
|
784
790
|
pendingPercolate: Map<string, Map<string, {
|
|
@@ -810,35 +816,35 @@ interface EntityManagerInternalApi {
|
|
|
810
816
|
pendingDeleteIds(type: MaybeAbstractEntityConstructor<Entity>): readonly IdType[];
|
|
811
817
|
setIsRefreshing(isRefreshing: boolean): void;
|
|
812
818
|
}
|
|
813
|
-
declare function getEmInternalApi(em: EntityManager): EntityManagerInternalApi;
|
|
814
|
-
declare function getDefaultEntityLimit(): number;
|
|
815
|
-
declare function setDefaultEntityLimit(limit: number): void;
|
|
816
|
-
declare function resetDefaultEntityLimit(): void;
|
|
817
|
-
declare function isKey(k: any): k is string;
|
|
819
|
+
export declare function getEmInternalApi(em: EntityManager): EntityManagerInternalApi;
|
|
820
|
+
export declare function getDefaultEntityLimit(): number;
|
|
821
|
+
export declare function setDefaultEntityLimit(limit: number): void;
|
|
822
|
+
export declare function resetDefaultEntityLimit(): void;
|
|
823
|
+
export declare function isKey(k: any): k is string;
|
|
818
824
|
/** Compares `a` to `b`, where `b` might be an id. */
|
|
819
|
-
declare function sameEntity(a: Entity | string | number | undefined, b: Entity | string | number | undefined): boolean;
|
|
825
|
+
export declare function sameEntity(a: Entity | string | number | undefined, b: Entity | string | number | undefined): boolean;
|
|
820
826
|
/** Compares the value `a` to `b`, with handling of new entities w/o ids assigned yet. */
|
|
821
|
-
declare function sameReference<T extends Entity>(a: Reference<any, T, any>, b: Reference<any, T, any>): boolean;
|
|
827
|
+
export declare function sameReference<T extends Entity>(a: Reference<any, T, any>, b: Reference<any, T, any>): boolean;
|
|
822
828
|
/** Thrown by `findOneOrFail`, 'load' & 'loadAll' if an entity is not found. */
|
|
823
|
-
declare class NotFoundError extends Error {}
|
|
829
|
+
export declare class NotFoundError extends Error {}
|
|
824
830
|
/** Thrown by `findOne` and `findOneOrFail` if more than one entity is found. */
|
|
825
|
-
declare class TooManyError extends Error {
|
|
831
|
+
export declare class TooManyError extends Error {
|
|
826
832
|
constructor(message: string);
|
|
827
833
|
}
|
|
828
834
|
/** Invokes a single validation rule, coercing its result/sync throws into a promise. */
|
|
829
|
-
declare function invokeRule(entity: Entity, fn: (entity: any) => MaybePromise<ValidationRuleResult>): Promise<ValidationError[]>;
|
|
830
|
-
declare function driverBeforeBegin<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
831
|
-
declare function driverAfterBegin<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
832
|
-
declare function driverBeforeCommit<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
833
|
-
declare function driverAfterCommit<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
834
|
-
declare function isDefined<T extends any>(param: T | undefined | null): param is T;
|
|
835
|
-
declare function setLastNow(now: Date | undefined): void;
|
|
835
|
+
export declare function invokeRule(entity: Entity, fn: (entity: any) => MaybePromise<ValidationRuleResult>): Promise<ValidationError[]>;
|
|
836
|
+
export declare function driverBeforeBegin<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
837
|
+
export declare function driverAfterBegin<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
838
|
+
export declare function driverBeforeCommit<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
839
|
+
export declare function driverAfterCommit<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
840
|
+
export declare function isDefined<T extends any>(param: T | undefined | null): param is T;
|
|
841
|
+
export declare function setLastNow(now: Date | undefined): void;
|
|
836
842
|
/** An error thrown by `em.flush` after a previous `em.flush` on the same EntityManager failed. */
|
|
837
|
-
declare class FailedFlushError extends Error {
|
|
843
|
+
export declare class FailedFlushError extends Error {
|
|
838
844
|
constructor(cause: unknown);
|
|
839
845
|
}
|
|
840
846
|
/** An error thrown when `em.mode === "read-only"` but entities are mutated/flushed. */
|
|
841
|
-
declare class ReadOnlyError extends Error {
|
|
847
|
+
export declare class ReadOnlyError extends Error {
|
|
842
848
|
constructor();
|
|
843
849
|
}
|
|
844
850
|
/**
|
|
@@ -847,10 +853,10 @@ declare class ReadOnlyError extends Error {
|
|
|
847
853
|
*
|
|
848
854
|
* See https://github.com/brianc/node-postgres/pull/2983
|
|
849
855
|
*/
|
|
850
|
-
declare function appendStack(err: unknown, dummy: Error): unknown;
|
|
851
|
-
declare function createRowFromEntityData(e: Entity, opts?: {
|
|
856
|
+
export declare function appendStack(err: unknown, dummy: Error): unknown;
|
|
857
|
+
export declare function createRowFromEntityData(e: Entity, opts?: {
|
|
852
858
|
preferOriginalData?: boolean;
|
|
853
859
|
}): Record<string, any>;
|
|
854
860
|
//#endregion
|
|
855
|
-
export {
|
|
861
|
+
export {};
|
|
856
862
|
//# sourceMappingURL=EntityManager.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityManager.d.cts","names":[],"sources":["../src/EntityManager.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"EntityManager.d.cts","names":["EntityW","Entity"],"sources":["../src/EntityManager.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqKiB,kBAAkB;;OAE5B,IAAI,+BAA+B;EAKxC;EACA,UAAU;;EAGV,gBAAgB,QAAQ,SAAS;;;iBAIlB,kBAAkB,UAAU;EAC3C,aAAa;EACb,UAAU,QAAQ,KAAK,QAAQ;EAC/B;EACA;EACA;EACA;EACA;;iBA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I;EACJ,cAAc;EACd,WAAW;EACX;EACA;EACA,YAAY,QAAQ;MAChB,eAAe;MACf,iBAAiB;EACrB,eAAe;EACf;EACA;EACA,iBAAiB,QAAQD;EACzB,mBAAmB,QAAQA;EAC3B;EACA,iBAAiB,MAAM,+BAA+B,mBAAmB;EACzE,gBAAgB;;wBAGF,iBAAiB,IAAI,gBAAgB;wBAMrC;wBAIA,sBAAsB;wBAItB;wBAIA,MAAM,SAAS;;wBAKf,WAAW,GAAG,sCAAsC,GAAG;;wBAmBvD,cAAc,UAAU,QAAQ,GAAG,eAAe,SAAS,GAAG,eAAe;;qBAKhF,sBAAsB;;qBAGtB,qBAAqB;EAChC,YAAY;;;wBA0IQ,WACpB,QAAQ,QACR,KAAK,gBAAgB,aAAa,wBACjC,QAAQ;wBAIK,kBAAkB,KAAK,IAAI,wBAAwB,MAAM,KAAK,MAAM;wBAIpE,iBAAiB,KAAK,IAAI,wBAAwB,MAAM,KAAK,MAAM;wBAInE,mBAAmB,KAAK,IAAI,wBAAwB,MAAM,KAAK,MAAM;wBAIrE,kBAAkB,KAAK,IAAI,wBAAwB,MAAM,KAAK,MAAM;wBA4NpE,UAAU,eAAe,OAAO,uBAAuB,SAAS;wBAoChE,WAAW,KAAK;;qBAyFnB,yBAAyB;EACpC,YAAY;;;qBAMD,sBAAsB;EACjC;;;;;;;;wBA0Bc,YAAY,cAAc,OAAO;wBAsBjC,wBAAwB,GAAG,QAAQ;EAAQ;IAAmC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BatchLoader } from "./batchloaders/BatchLoader.mjs";
|
|
2
|
-
import { OptsOf, OrderOf } from "./typeMap.mjs";
|
|
2
|
+
import { OptsOf, OrderOf, TypeMap } from "./typeMap.mjs";
|
|
3
3
|
import { Collection } from "./relations/Collection.mjs";
|
|
4
4
|
import { lazyColumnLoadOperation } from "./relations/LazyField.mjs";
|
|
5
5
|
import { Reference } from "./relations/Reference.mjs";
|
|
@@ -54,7 +54,7 @@ import DataLoader, { BatchLoadFn, Options } from "dataloader";
|
|
|
54
54
|
* Abstract entity types, like a base `Publisher` class that is marked `abstract`, cannot
|
|
55
55
|
* implement this and instead only have the `AbsEntityConstructor` type.
|
|
56
56
|
*/
|
|
57
|
-
interface EntityConstructor<T> {
|
|
57
|
+
export interface EntityConstructor<T> {
|
|
58
58
|
/** The pseudo-public constructor for entities; only the `EntityManager` should actually instantiate entities. */
|
|
59
59
|
new (em: EntityManager<any, any, any>): T;
|
|
60
60
|
tagName: any;
|
|
@@ -63,7 +63,7 @@ interface EntityConstructor<T> {
|
|
|
63
63
|
getInstanceData(entity: Entity): InstanceData;
|
|
64
64
|
}
|
|
65
65
|
/** Options for the auto-batchable `em.find` queries. */
|
|
66
|
-
interface FindFilterOptions<T extends Entity> {
|
|
66
|
+
export interface FindFilterOptions<T extends Entity> {
|
|
67
67
|
conditions?: ExpressionFilter;
|
|
68
68
|
orderBy?: OrderOf<T> | OrderOf<T>[];
|
|
69
69
|
limit?: number | undefined;
|
|
@@ -72,12 +72,12 @@ interface FindFilterOptions<T extends Entity> {
|
|
|
72
72
|
allowMultipleLeftJoins?: boolean;
|
|
73
73
|
optimizeJoinsToExists?: boolean;
|
|
74
74
|
}
|
|
75
|
-
interface FindGqlFilterOptions<T extends Entity> extends Omit<FindFilterOptions<T>, "limit" | "offset"> {
|
|
75
|
+
export interface FindGqlFilterOptions<T extends Entity> extends Omit<FindFilterOptions<T>, "limit" | "offset"> {
|
|
76
76
|
limit?: number | null | undefined;
|
|
77
77
|
offset?: number | null | undefined;
|
|
78
78
|
}
|
|
79
79
|
/** Options for the `findCount`. */
|
|
80
|
-
interface FindCountFilterOptions<T extends Entity> {
|
|
80
|
+
export interface FindCountFilterOptions<T extends Entity> {
|
|
81
81
|
conditions?: ExpressionFilter;
|
|
82
82
|
softDeletes?: "include" | "exclude";
|
|
83
83
|
allowMultipleLeftJoins?: boolean;
|
|
@@ -88,16 +88,18 @@ interface FindCountFilterOptions<T extends Entity> {
|
|
|
88
88
|
*
|
|
89
89
|
* I.e. this is more like "MaybeAbstractEntityConstructor".
|
|
90
90
|
*/
|
|
91
|
-
type MaybeAbstractEntityConstructor<T> = abstract new (em: EntityManager<any, any, any>, opts: any) => T;
|
|
91
|
+
export type MaybeAbstractEntityConstructor<T> = abstract new (em: EntityManager<any, any, any>, opts: any) => T;
|
|
92
92
|
/** Pulls the entity's id type out of a given entity type T. */
|
|
93
|
-
type IdOf<T> = T extends {
|
|
93
|
+
export type IdOf<T> = T extends {
|
|
94
94
|
id: infer I;
|
|
95
95
|
} ? I : never;
|
|
96
|
-
type TaggedId = string;
|
|
97
|
-
|
|
98
|
-
type
|
|
96
|
+
export type TaggedId = string;
|
|
97
|
+
/** Creation options for any registered entity type, since deep clones can include more than the root type. */
|
|
98
|
+
export type CloneOverrides = Partial<TypeMap[keyof TypeMap]["optsType"]>;
|
|
99
|
+
export declare function isId(value: any): value is IdOf<unknown>;
|
|
100
|
+
export type EntityManagerHook = "beforeBegin" | "afterBegin" | "beforeCommit" | "afterCommit";
|
|
99
101
|
/** Options for EntityManager transaction hooks. */
|
|
100
|
-
interface EntityManagerHookOptions {
|
|
102
|
+
export interface EntityManagerHookOptions {
|
|
101
103
|
/**
|
|
102
104
|
* Runs the transaction lifecycle even on write-less flushes. Defaults to false.
|
|
103
105
|
*
|
|
@@ -107,13 +109,13 @@ interface EntityManagerHookOptions {
|
|
|
107
109
|
forceTransaction?: boolean;
|
|
108
110
|
}
|
|
109
111
|
type HookFn<TX> = (em: EntityManager, txn: TX) => MaybePromise<any>;
|
|
110
|
-
type LoaderCache = Record<string, DataLoader<any, any>>;
|
|
111
|
-
interface TimestampFields {
|
|
112
|
+
export type LoaderCache = Record<string, DataLoader<any, any>>;
|
|
113
|
+
export interface TimestampFields {
|
|
112
114
|
updatedAt: string | undefined;
|
|
113
115
|
createdAt: string | undefined;
|
|
114
116
|
deletedAt: string | undefined;
|
|
115
117
|
}
|
|
116
|
-
type EntityManagerOpts<TX = unknown> = ({
|
|
118
|
+
export type EntityManagerOpts<TX = unknown> = ({
|
|
117
119
|
driver: Driver<TX>;
|
|
118
120
|
em?: undefined;
|
|
119
121
|
} | {
|
|
@@ -122,7 +124,7 @@ type EntityManagerOpts<TX = unknown> = ({
|
|
|
122
124
|
}) & {
|
|
123
125
|
preloadPlugin?: PreloadPlugin;
|
|
124
126
|
};
|
|
125
|
-
interface FlushOptions {
|
|
127
|
+
export interface FlushOptions {
|
|
126
128
|
/** Skip all validations, including reactive validations, when flushing */
|
|
127
129
|
skipValidation?: boolean;
|
|
128
130
|
}
|
|
@@ -133,8 +135,8 @@ interface FlushOptions {
|
|
|
133
135
|
* - `in-memory-writes` -- allows entity mutations and `em.flush` w/o a `COMMIT`
|
|
134
136
|
* - `writes` -- allows entity mutations and `em.flush` will `COMMIT` writes
|
|
135
137
|
*/
|
|
136
|
-
type EntityManagerMode = "read-only" | "in-memory-writes" | "writes";
|
|
137
|
-
type FindOperation = typeof findOperation | typeof findByUniqueOperation | typeof findCountOperation | typeof findIdsOperation | typeof lensOperation | typeof loadOperation | typeof manyToManyLoadOperation | typeof manyToManyFindOperation | typeof enumCollectionLoadOperation | typeof oneToManyLoadOperation | typeof oneToManyFindOperation | typeof oneToOneLoadOperation | typeof populateOperation | typeof recursiveChildrenOperation | typeof recursiveM2mOperation | typeof recursiveParentsOperation | typeof lazyColumnLoadOperation;
|
|
138
|
+
export type EntityManagerMode = "read-only" | "in-memory-writes" | "writes";
|
|
139
|
+
export type FindOperation = typeof findOperation | typeof findByUniqueOperation | typeof findCountOperation | typeof findIdsOperation | typeof lensOperation | typeof loadOperation | typeof manyToManyLoadOperation | typeof manyToManyFindOperation | typeof enumCollectionLoadOperation | typeof oneToManyLoadOperation | typeof oneToManyFindOperation | typeof oneToOneLoadOperation | typeof populateOperation | typeof recursiveChildrenOperation | typeof recursiveM2mOperation | typeof recursiveParentsOperation | typeof lazyColumnLoadOperation;
|
|
138
140
|
/**
|
|
139
141
|
* The EntityManager is the primary way nearly all code, i.e. anything that finds/creates/updates/deletes entities,
|
|
140
142
|
* will interact with the database.
|
|
@@ -155,7 +157,7 @@ type FindOperation = typeof findOperation | typeof findByUniqueOperation | typeo
|
|
|
155
157
|
* @typeParam Entity - the application's based entity type (i.e. with number ids or string ids)
|
|
156
158
|
* @typeParamTX - the application's Transaction type, i.e. `Knex`
|
|
157
159
|
*/
|
|
158
|
-
declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX extends unknown = unknown> {
|
|
160
|
+
export declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX extends unknown = unknown> {
|
|
159
161
|
#private;
|
|
160
162
|
readonly ctx: C;
|
|
161
163
|
driver: Driver<TX>;
|
|
@@ -378,6 +380,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
378
380
|
* @param deep - Populate hint of the nested tree of objects to clone
|
|
379
381
|
* @param skip - Keys that will be skipped in the clone
|
|
380
382
|
* @param skipIf - Predicate for determining if a specific entity should be skipped (and any entities beneath it
|
|
383
|
+
* @param overrides - Creation options for each entity, applied before defaults and instead of copied values
|
|
381
384
|
* @param postClone - Function to be called for each original/clone entity for any post-processing needed
|
|
382
385
|
* @returns The `Loaded` cloned entity or fails if the clone could not be made
|
|
383
386
|
*
|
|
@@ -405,6 +408,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
405
408
|
deep?: H;
|
|
406
409
|
skip?: K;
|
|
407
410
|
skipIf?: (entity: Entity$1) => boolean;
|
|
411
|
+
overrides?: (original: Entity$1) => CloneOverrides;
|
|
408
412
|
postClone?: (original: Entity$1, clone: Entity$1) => void;
|
|
409
413
|
}): Promise<Loaded<T, H>>;
|
|
410
414
|
/**
|
|
@@ -415,6 +419,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
415
419
|
* @param deep - Populate hint of the nested tree of objects to clone
|
|
416
420
|
* @param skip - Keys that will be skipped in the clone
|
|
417
421
|
* @param skipIf - Predicate for determining if a specific entity should be skipped (and any entities beneath it
|
|
422
|
+
* @param overrides - Creation options for each entity, applied before defaults and instead of copied values
|
|
418
423
|
* @param postClone - Function to be called for each original/clone entity for any post-processing needed
|
|
419
424
|
* @returns Array of `Loaded` cloned entities from the provided list or empty array if all are skipped
|
|
420
425
|
*
|
|
@@ -428,7 +433,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
428
433
|
*
|
|
429
434
|
* @example
|
|
430
435
|
* // This will duplicate the author's books, and assign them to a different author
|
|
431
|
-
* const duplicatedBooks = await em.clone(author.books.get, {
|
|
436
|
+
* const duplicatedBooks = await em.clone(author.books.get, { overrides: () => ({ author: author2 }) })
|
|
432
437
|
*
|
|
433
438
|
* @example
|
|
434
439
|
* // This will duplicate the author's books, but skip any book where the title includes `sea`
|
|
@@ -438,6 +443,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
438
443
|
deep?: H;
|
|
439
444
|
skip?: K;
|
|
440
445
|
skipIf?: (entity: Entity$1) => boolean;
|
|
446
|
+
overrides?: (original: Entity$1) => CloneOverrides;
|
|
441
447
|
postClone?: (original: Entity$1, clone: Entity$1) => void;
|
|
442
448
|
}): Promise<Loaded<T, H>[]>;
|
|
443
449
|
/**
|
|
@@ -778,7 +784,7 @@ declare class EntityManager<C = unknown, Entity$1 extends Entity = Entity, TX ex
|
|
|
778
784
|
get isFlushing(): boolean;
|
|
779
785
|
}
|
|
780
786
|
/** Provides an internal API to the `EntityManager`. */
|
|
781
|
-
interface EntityManagerInternalApi {
|
|
787
|
+
export interface EntityManagerInternalApi {
|
|
782
788
|
joinRows: (m2m: ManyToManyLike) => JoinRows;
|
|
783
789
|
/** Map of taggedId -> fieldName -> pending children, i.e. when `a1.books` later loads, add/remove b1. */
|
|
784
790
|
pendingPercolate: Map<string, Map<string, {
|
|
@@ -810,35 +816,35 @@ interface EntityManagerInternalApi {
|
|
|
810
816
|
pendingDeleteIds(type: MaybeAbstractEntityConstructor<Entity>): readonly IdType[];
|
|
811
817
|
setIsRefreshing(isRefreshing: boolean): void;
|
|
812
818
|
}
|
|
813
|
-
declare function getEmInternalApi(em: EntityManager): EntityManagerInternalApi;
|
|
814
|
-
declare function getDefaultEntityLimit(): number;
|
|
815
|
-
declare function setDefaultEntityLimit(limit: number): void;
|
|
816
|
-
declare function resetDefaultEntityLimit(): void;
|
|
817
|
-
declare function isKey(k: any): k is string;
|
|
819
|
+
export declare function getEmInternalApi(em: EntityManager): EntityManagerInternalApi;
|
|
820
|
+
export declare function getDefaultEntityLimit(): number;
|
|
821
|
+
export declare function setDefaultEntityLimit(limit: number): void;
|
|
822
|
+
export declare function resetDefaultEntityLimit(): void;
|
|
823
|
+
export declare function isKey(k: any): k is string;
|
|
818
824
|
/** Compares `a` to `b`, where `b` might be an id. */
|
|
819
|
-
declare function sameEntity(a: Entity | string | number | undefined, b: Entity | string | number | undefined): boolean;
|
|
825
|
+
export declare function sameEntity(a: Entity | string | number | undefined, b: Entity | string | number | undefined): boolean;
|
|
820
826
|
/** Compares the value `a` to `b`, with handling of new entities w/o ids assigned yet. */
|
|
821
|
-
declare function sameReference<T extends Entity>(a: Reference<any, T, any>, b: Reference<any, T, any>): boolean;
|
|
827
|
+
export declare function sameReference<T extends Entity>(a: Reference<any, T, any>, b: Reference<any, T, any>): boolean;
|
|
822
828
|
/** Thrown by `findOneOrFail`, 'load' & 'loadAll' if an entity is not found. */
|
|
823
|
-
declare class NotFoundError extends Error {}
|
|
829
|
+
export declare class NotFoundError extends Error {}
|
|
824
830
|
/** Thrown by `findOne` and `findOneOrFail` if more than one entity is found. */
|
|
825
|
-
declare class TooManyError extends Error {
|
|
831
|
+
export declare class TooManyError extends Error {
|
|
826
832
|
constructor(message: string);
|
|
827
833
|
}
|
|
828
834
|
/** Invokes a single validation rule, coercing its result/sync throws into a promise. */
|
|
829
|
-
declare function invokeRule(entity: Entity, fn: (entity: any) => MaybePromise<ValidationRuleResult>): Promise<ValidationError[]>;
|
|
830
|
-
declare function driverBeforeBegin<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
831
|
-
declare function driverAfterBegin<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
832
|
-
declare function driverBeforeCommit<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
833
|
-
declare function driverAfterCommit<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
834
|
-
declare function isDefined<T extends any>(param: T | undefined | null): param is T;
|
|
835
|
-
declare function setLastNow(now: Date | undefined): void;
|
|
835
|
+
export declare function invokeRule(entity: Entity, fn: (entity: any) => MaybePromise<ValidationRuleResult>): Promise<ValidationError[]>;
|
|
836
|
+
export declare function driverBeforeBegin<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
837
|
+
export declare function driverAfterBegin<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
838
|
+
export declare function driverBeforeCommit<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
839
|
+
export declare function driverAfterCommit<TXN>(em: EntityManager<any, any, TXN>, txn: TXN): Promise<unknown>;
|
|
840
|
+
export declare function isDefined<T extends any>(param: T | undefined | null): param is T;
|
|
841
|
+
export declare function setLastNow(now: Date | undefined): void;
|
|
836
842
|
/** An error thrown by `em.flush` after a previous `em.flush` on the same EntityManager failed. */
|
|
837
|
-
declare class FailedFlushError extends Error {
|
|
843
|
+
export declare class FailedFlushError extends Error {
|
|
838
844
|
constructor(cause: unknown);
|
|
839
845
|
}
|
|
840
846
|
/** An error thrown when `em.mode === "read-only"` but entities are mutated/flushed. */
|
|
841
|
-
declare class ReadOnlyError extends Error {
|
|
847
|
+
export declare class ReadOnlyError extends Error {
|
|
842
848
|
constructor();
|
|
843
849
|
}
|
|
844
850
|
/**
|
|
@@ -847,10 +853,10 @@ declare class ReadOnlyError extends Error {
|
|
|
847
853
|
*
|
|
848
854
|
* See https://github.com/brianc/node-postgres/pull/2983
|
|
849
855
|
*/
|
|
850
|
-
declare function appendStack(err: unknown, dummy: Error): unknown;
|
|
851
|
-
declare function createRowFromEntityData(e: Entity, opts?: {
|
|
856
|
+
export declare function appendStack(err: unknown, dummy: Error): unknown;
|
|
857
|
+
export declare function createRowFromEntityData(e: Entity, opts?: {
|
|
852
858
|
preferOriginalData?: boolean;
|
|
853
859
|
}): Record<string, any>;
|
|
854
860
|
//#endregion
|
|
855
|
-
export {
|
|
861
|
+
export {};
|
|
856
862
|
//# sourceMappingURL=EntityManager.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityManager.d.mts","names":[],"sources":["../src/EntityManager.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"EntityManager.d.mts","names":["EntityW","Entity"],"sources":["../src/EntityManager.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqKiB,kBAAkB;;OAE5B,IAAI,+BAA+B;EAKxC;EACA,UAAU;;EAGV,gBAAgB,QAAQ,SAAS;;;iBAIlB,kBAAkB,UAAU;EAC3C,aAAa;EACb,UAAU,QAAQ,KAAK,QAAQ;EAC/B;EACA;EACA;EACA;EACA;;iBAGe,qBAAqB,UAAU,gBAAgB,KAAK,kBAAkB;EACrF;EACA;;;iBAIe,uBAAuB,UAAU;EAChD,aAAa;EACb;EACA;EACA;;;;;;;YAQU,+BAA+B,mBAAmB,IAAI,8BAA8B,cAAc;;YAGlG,KAAK,KAAK;EAAY,UAAU;IAAM;YAEtC;;YAGA,iBAAiB,QAAQ,cAAc;wBAEnC,KAAK,aAAa,SAAS;YAI/B;;iBAGK;;;;;;;EAOf;;KAGG,OAAO,OAAO,IAAI,eAAe,KAAK,OAAO;YA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AAc,UAAU,QAAQ,GAAG,eAAe,SAAS,GAAG,eAAe;;qBAKhF,sBAAsB;;qBAGtB,qBAAqB;EAChC,YAAY;;;wBA0IQ,WACpB,QAAQ,QACR,KAAK,gBAAgB,aAAa,wBACjC,QAAQ;wBAIK,kBAAkB,KAAK,IAAI,wBAAwB,MAAM,KAAK,MAAM;wBAIpE,iBAAiB,KAAK,IAAI,wBAAwB,MAAM,KAAK,MAAM;wBAInE,mBAAmB,KAAK,IAAI,wBAAwB,MAAM,KAAK,MAAM;wBAIrE,kBAAkB,KAAK,IAAI,wBAAwB,MAAM,KAAK,MAAM;wBA4NpE,UAAU,eAAe,OAAO,uBAAuB,SAAS;wBAoChE,WAAW,KAAK;;qBAyFnB,yBAAyB;EACpC,YAAY;;;qBAMD,sBAAsB;EACjC;;;;;;;;wBA0Bc,YAAY,cAAc,OAAO;wBAsBjC,wBAAwB,GAAG,QAAQ;EAAQ;IAAmC"}
|
package/build/EntityManager.js
CHANGED
|
@@ -520,7 +520,7 @@ var EntityManager = class EntityManager {
|
|
|
520
520
|
return upsert(this, type, input);
|
|
521
521
|
}
|
|
522
522
|
async clone(entityOrArray, opts) {
|
|
523
|
-
const { deep = {}, skipIf, skip = {}, postClone } = opts ?? {};
|
|
523
|
+
const { deep = {}, skipIf, skip = {}, overrides, postClone } = opts ?? {};
|
|
524
524
|
const todo = /* @__PURE__ */ new Set();
|
|
525
525
|
const skipMap = /* @__PURE__ */ new WeakMap();
|
|
526
526
|
await crawl(todo, skipMap, Array.isArray(entityOrArray) ? entityOrArray : [entityOrArray], deep, {
|
|
@@ -528,10 +528,14 @@ var EntityManager = class EntityManager {
|
|
|
528
528
|
skip
|
|
529
529
|
});
|
|
530
530
|
const deferredRelations = [];
|
|
531
|
+
const overrideMap = /* @__PURE__ */ new WeakMap();
|
|
531
532
|
const clones = [...todo].map((entity) => {
|
|
532
533
|
const skip = skipMap.get(entity) ?? [];
|
|
534
|
+
const override = overrides?.(entity) ?? {};
|
|
535
|
+
overrideMap.set(entity, override);
|
|
533
536
|
const meta = getMetadata(entity);
|
|
534
537
|
const copy = Object.fromEntries(Object.values(meta.allFields).map((f) => {
|
|
538
|
+
if (Object.hasOwn(override, f.fieldName)) return [f.fieldName, override[f.fieldName]];
|
|
535
539
|
if (skip.includes(f.fieldName)) return void 0;
|
|
536
540
|
switch (f.kind) {
|
|
537
541
|
case "primitive": if (!f.derived && !f.protected) return [f.fieldName, getField(entity, f.fieldName)];
|
|
@@ -561,11 +565,15 @@ var EntityManager = class EntityManager {
|
|
|
561
565
|
default: assertNever(f);
|
|
562
566
|
}
|
|
563
567
|
}).filter(isDefined));
|
|
564
|
-
return [entity, this.create(asConcreteCstr(meta.cstr),
|
|
568
|
+
return [entity, this.create(asConcreteCstr(meta.cstr), {
|
|
569
|
+
...copy,
|
|
570
|
+
...override
|
|
571
|
+
})];
|
|
565
572
|
});
|
|
566
573
|
const entityToClone = new Map(clones);
|
|
567
|
-
clones.forEach(([, clone]) => {
|
|
574
|
+
clones.forEach(([original, clone]) => {
|
|
568
575
|
getRelationEntries(clone).forEach(([fieldName, value]) => {
|
|
576
|
+
if (Object.hasOwn(overrideMap.get(original), fieldName)) return;
|
|
569
577
|
if (value instanceof ManyToOneReferenceImpl || value instanceof PolymorphicReferenceImpl || value instanceof ReactiveReferenceImpl) {
|
|
570
578
|
const existingIdOrEntity = getField(clone, fieldName);
|
|
571
579
|
const existing = isEntity(existingIdOrEntity) ? existingIdOrEntity : this.getEntity(existingIdOrEntity);
|