joist-core 2.3.0-next.97 → 2.3.0-next.99
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.cjs.map +1 -1
- package/build/BaseEntity.js.map +1 -1
- package/build/Entity.cjs.map +1 -1
- package/build/Entity.js.map +1 -1
- package/build/EntityManager.cjs +45 -46
- package/build/EntityManager.cjs.map +1 -1
- package/build/EntityManager.d.cts +7 -7
- package/build/EntityManager.d.cts.map +1 -1
- package/build/EntityManager.d.mts +7 -7
- package/build/EntityManager.d.mts.map +1 -1
- package/build/EntityManager.js +27 -28
- package/build/EntityManager.js.map +1 -1
- package/build/EntityMetadata.cjs +0 -2
- package/build/EntityMetadata.cjs.map +1 -1
- package/build/EntityMetadata.d.cts +3 -3
- package/build/EntityMetadata.d.mts +3 -3
- package/build/EntityMetadata.js +0 -2
- package/build/EntityMetadata.js.map +1 -1
- package/build/IndexManager.cjs +1 -1
- package/build/IndexManager.cjs.map +1 -1
- package/build/IndexManager.js +1 -1
- package/build/IndexManager.js.map +1 -1
- package/build/InstanceData.cjs.map +1 -1
- package/build/InstanceData.js.map +1 -1
- package/build/PluginManager.cjs +0 -1
- package/build/PluginManager.cjs.map +1 -1
- package/build/PluginManager.d.cts +1 -1
- package/build/PluginManager.d.mts +1 -1
- package/build/PluginManager.js +0 -1
- package/build/PluginManager.js.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.cjs +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.cjs.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.d.cts +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.d.mts +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.js +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.js.map +1 -1
- package/build/batchloaders/loadBatchLoader.cjs +3 -4
- package/build/batchloaders/loadBatchLoader.cjs.map +1 -1
- package/build/batchloaders/loadBatchLoader.d.cts +1 -1
- package/build/batchloaders/loadBatchLoader.d.mts +1 -1
- package/build/batchloaders/loadBatchLoader.js +2 -3
- package/build/batchloaders/loadBatchLoader.js.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.cjs +1 -1
- package/build/batchloaders/manyToManyBatchLoader.cjs.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.d.cts +1 -1
- package/build/batchloaders/manyToManyBatchLoader.d.mts +1 -1
- package/build/batchloaders/manyToManyBatchLoader.js +1 -1
- package/build/batchloaders/manyToManyBatchLoader.js.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.cjs +1 -1
- package/build/batchloaders/oneToManyBatchLoader.cjs.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.js +1 -1
- package/build/batchloaders/oneToManyBatchLoader.js.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.cjs +1 -1
- package/build/batchloaders/oneToOneBatchLoader.cjs.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.js +1 -1
- package/build/batchloaders/oneToOneBatchLoader.js.map +1 -1
- package/build/batchloaders/populateBatchLoader.cjs +11 -12
- package/build/batchloaders/populateBatchLoader.cjs.map +1 -1
- package/build/batchloaders/populateBatchLoader.d.cts +1 -1
- package/build/batchloaders/populateBatchLoader.d.mts +1 -1
- package/build/batchloaders/populateBatchLoader.js +7 -8
- package/build/batchloaders/populateBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs +2 -2
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.js +2 -2
- package/build/batchloaders/recursiveChildrenBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.cjs +2 -2
- package/build/batchloaders/recursiveM2mBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.js +2 -2
- package/build/batchloaders/recursiveM2mBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.cjs +2 -2
- package/build/batchloaders/recursiveParentsBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.js +2 -2
- package/build/batchloaders/recursiveParentsBatchLoader.js.map +1 -1
- package/build/changes.cjs +2 -3
- package/build/changes.cjs.map +1 -1
- package/build/changes.js +2 -3
- package/build/changes.js.map +1 -1
- package/build/config.cjs +3 -3
- package/build/config.cjs.map +1 -1
- package/build/config.d.cts +2 -2
- package/build/config.d.mts +2 -2
- package/build/config.js +1 -1
- package/build/config.js.map +1 -1
- package/build/configure.cjs +10 -10
- package/build/configure.cjs.map +1 -1
- package/build/configure.js +5 -5
- package/build/configure.js.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.cjs +8 -8
- package/build/dataloaders/fastWhereFilterHash.cjs.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.d.cts.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.d.mts.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.js +3 -3
- package/build/dataloaders/fastWhereFilterHash.js.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.cjs.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.js.map +1 -1
- package/build/dataloaders/findCountDataLoader.cjs +2 -2
- package/build/dataloaders/findCountDataLoader.cjs.map +1 -1
- package/build/dataloaders/findCountDataLoader.js +1 -1
- package/build/dataloaders/findCountDataLoader.js.map +1 -1
- package/build/dataloaders/findDataLoader.cjs +6 -6
- package/build/dataloaders/findDataLoader.cjs.map +1 -1
- package/build/dataloaders/findDataLoader.d.cts +1 -1
- package/build/dataloaders/findDataLoader.d.mts +1 -1
- package/build/dataloaders/findDataLoader.js +3 -3
- package/build/dataloaders/findDataLoader.js.map +1 -1
- package/build/dataloaders/findIdsDataLoader.cjs +3 -3
- package/build/dataloaders/findIdsDataLoader.cjs.map +1 -1
- package/build/dataloaders/findIdsDataLoader.js +2 -2
- package/build/dataloaders/findIdsDataLoader.js.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.cjs +1 -1
- package/build/dataloaders/findOrCreateDataLoader.cjs.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.js +1 -1
- package/build/dataloaders/findOrCreateDataLoader.js.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.cjs +6 -6
- package/build/dataloaders/findPaginatedDataLoader.cjs.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.cts +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.mts +1 -1
- package/build/dataloaders/findPaginatedDataLoader.js +3 -3
- package/build/dataloaders/findPaginatedDataLoader.js.map +1 -1
- package/build/dataloaders/lensDataLoader.cjs +3 -3
- package/build/dataloaders/lensDataLoader.cjs.map +1 -1
- package/build/dataloaders/lensDataLoader.d.cts.map +1 -1
- package/build/dataloaders/lensDataLoader.d.mts.map +1 -1
- package/build/dataloaders/lensDataLoader.js +2 -2
- package/build/dataloaders/lensDataLoader.js.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.cjs +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.cjs.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.mts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.js +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.js.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.cjs +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.cjs.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.mts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.js +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.js.map +1 -1
- package/build/defaults.cjs +5 -5
- package/build/defaults.cjs.map +1 -1
- package/build/defaults.d.cts +1 -1
- package/build/defaults.d.cts.map +1 -1
- package/build/defaults.d.mts +1 -1
- package/build/defaults.d.mts.map +1 -1
- package/build/defaults.js +4 -4
- package/build/defaults.js.map +1 -1
- package/build/drivers/Driver.cjs +0 -1
- package/build/drivers/Driver.d.cts +1 -1
- package/build/drivers/Driver.d.mts +1 -1
- package/build/drivers/Driver.js +0 -1
- package/build/drivers/EntityWriter.cjs +6 -7
- package/build/drivers/EntityWriter.cjs.map +1 -1
- package/build/drivers/EntityWriter.d.cts +1 -1
- package/build/drivers/EntityWriter.d.mts +1 -1
- package/build/drivers/EntityWriter.js +2 -3
- package/build/drivers/EntityWriter.js.map +1 -1
- package/build/drivers/IdAssigner.cjs +0 -1
- package/build/drivers/IdAssigner.cjs.map +1 -1
- package/build/drivers/IdAssigner.d.cts +1 -1
- package/build/drivers/IdAssigner.d.mts +1 -1
- package/build/drivers/IdAssigner.js +0 -1
- package/build/drivers/IdAssigner.js.map +1 -1
- package/build/drivers/driverApi.cjs +19 -0
- package/build/drivers/driverApi.cjs.map +1 -0
- package/build/drivers/driverApi.d.cts +22 -0
- package/build/drivers/driverApi.d.cts.map +1 -0
- package/build/drivers/driverApi.d.mts +22 -0
- package/build/drivers/driverApi.d.mts.map +1 -0
- package/build/drivers/driverApi.js +18 -0
- package/build/drivers/driverApi.js.map +1 -0
- package/build/fields.cjs +3 -3
- package/build/fields.cjs.map +1 -1
- package/build/fields.js +2 -2
- package/build/fields.js.map +1 -1
- package/build/{FlushLock.cjs → flush/FlushLock.cjs} +1 -1
- package/build/flush/FlushLock.cjs.map +1 -0
- package/build/{FlushLock.d.cts → flush/FlushLock.d.cts} +1 -1
- package/build/flush/FlushLock.d.cts.map +1 -0
- package/build/{FlushLock.d.mts → flush/FlushLock.d.mts} +1 -1
- package/build/flush/FlushLock.d.mts.map +1 -0
- package/build/{FlushLock.js → flush/FlushLock.js} +1 -1
- package/build/flush/FlushLock.js.map +1 -0
- package/build/{JoinRows.cjs → flush/JoinRows.cjs} +5 -8
- package/build/flush/JoinRows.cjs.map +1 -0
- package/build/{JoinRows.d.cts → flush/JoinRows.d.cts} +5 -5
- package/build/flush/JoinRows.d.cts.map +1 -0
- package/build/{JoinRows.d.mts → flush/JoinRows.d.mts} +5 -5
- package/build/flush/JoinRows.d.mts.map +1 -0
- package/build/{JoinRows.js → flush/JoinRows.js} +5 -8
- package/build/flush/JoinRows.js.map +1 -0
- package/build/{PendingChanges.cjs → flush/PendingChanges.cjs} +0 -1
- package/build/{PendingChanges.d.cts → flush/PendingChanges.d.cts} +2 -2
- package/build/flush/PendingChanges.d.cts.map +1 -0
- package/build/{PendingChanges.d.mts → flush/PendingChanges.d.mts} +2 -2
- package/build/flush/PendingChanges.d.mts.map +1 -0
- package/build/flush/PendingChanges.js +1 -0
- package/build/{Todo.cjs → flush/Todo.cjs} +4 -6
- package/build/flush/Todo.cjs.map +1 -0
- package/build/{Todo.d.cts → flush/Todo.d.cts} +3 -3
- package/build/flush/Todo.d.cts.map +1 -0
- package/build/{Todo.d.mts → flush/Todo.d.mts} +3 -3
- package/build/flush/Todo.d.mts.map +1 -0
- package/build/{Todo.js → flush/Todo.js} +4 -6
- package/build/flush/Todo.js.map +1 -0
- package/build/getProperties.cjs.map +1 -1
- package/build/getProperties.js.map +1 -1
- package/build/index.cjs +100 -100
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +15 -15
- package/build/index.d.mts +15 -15
- package/build/index.js +42 -42
- package/build/index.js.map +1 -1
- package/build/json.cjs +4 -4
- package/build/json.cjs.map +1 -1
- package/build/json.js +3 -3
- package/build/json.js.map +1 -1
- package/build/keys.cjs +1 -1
- package/build/keys.cjs.map +1 -1
- package/build/keys.js +1 -1
- package/build/keys.js.map +1 -1
- package/build/{HintTree.cjs → loading/HintTree.cjs} +2 -5
- package/build/loading/HintTree.cjs.map +1 -0
- package/build/{HintTree.d.cts → loading/HintTree.d.cts} +3 -3
- package/build/loading/HintTree.d.cts.map +1 -0
- package/build/{HintTree.d.mts → loading/HintTree.d.mts} +3 -3
- package/build/loading/HintTree.d.mts.map +1 -0
- package/build/{HintTree.js → loading/HintTree.js} +2 -5
- package/build/loading/HintTree.js.map +1 -0
- package/build/{IsLoadedCache.cjs → loading/IsLoadedCache.cjs} +2 -3
- package/build/loading/IsLoadedCache.cjs.map +1 -0
- package/build/{IsLoadedCache.d.cts → loading/IsLoadedCache.d.cts} +2 -2
- package/build/loading/IsLoadedCache.d.cts.map +1 -0
- package/build/{IsLoadedCache.d.mts → loading/IsLoadedCache.d.mts} +2 -2
- package/build/loading/IsLoadedCache.d.mts.map +1 -0
- package/build/{IsLoadedCache.js → loading/IsLoadedCache.js} +2 -3
- package/build/{IsLoadedCache.cjs.map → loading/IsLoadedCache.js.map} +1 -1
- package/build/{loadHints.cjs → loading/loadHints.cjs} +6 -11
- package/build/loading/loadHints.cjs.map +1 -0
- package/build/{loadHints.d.cts → loading/loadHints.d.cts} +14 -14
- package/build/loading/loadHints.d.cts.map +1 -0
- package/build/{loadHints.d.mts → loading/loadHints.d.mts} +14 -14
- package/build/loading/loadHints.d.mts.map +1 -0
- package/build/{loadHints.js → loading/loadHints.js} +3 -8
- package/build/loading/loadHints.js.map +1 -0
- package/build/{loadLens.cjs → loading/loadLens.cjs} +8 -9
- package/build/loading/loadLens.cjs.map +1 -0
- package/build/{loadLens.d.cts → loading/loadLens.d.cts} +3 -3
- package/build/loading/loadLens.d.cts.map +1 -0
- package/build/{loadLens.d.mts → loading/loadLens.d.mts} +3 -3
- package/build/loading/loadLens.d.mts.map +1 -0
- package/build/{loadLens.js → loading/loadLens.js} +8 -9
- package/build/loading/loadLens.js.map +1 -0
- package/build/{withLoaded.cjs → loading/withLoaded.cjs} +12 -13
- package/build/loading/withLoaded.cjs.map +1 -0
- package/build/{withLoaded.d.cts → loading/withLoaded.d.cts} +9 -9
- package/build/loading/withLoaded.d.cts.map +1 -0
- package/build/{withLoaded.d.mts → loading/withLoaded.d.mts} +9 -9
- package/build/loading/withLoaded.d.mts.map +1 -0
- package/build/{withLoaded.js → loading/withLoaded.js} +10 -11
- package/build/loading/withLoaded.js.map +1 -0
- package/build/logging/FactoryLogger.cjs.map +1 -1
- package/build/logging/FactoryLogger.d.cts.map +1 -1
- package/build/logging/FactoryLogger.d.mts.map +1 -1
- package/build/logging/FactoryLogger.js.map +1 -1
- package/build/logging/FieldLogger.cjs.map +1 -1
- package/build/logging/FieldLogger.d.cts.map +1 -1
- package/build/logging/FieldLogger.d.mts.map +1 -1
- package/build/logging/FieldLogger.js.map +1 -1
- package/build/logging/ReactionLogger.cjs +0 -2
- package/build/logging/ReactionLogger.cjs.map +1 -1
- package/build/logging/ReactionLogger.d.cts +2 -2
- package/build/logging/ReactionLogger.d.cts.map +1 -1
- package/build/logging/ReactionLogger.d.mts +2 -2
- package/build/logging/ReactionLogger.d.mts.map +1 -1
- package/build/logging/ReactionLogger.js +0 -2
- package/build/logging/ReactionLogger.js.map +1 -1
- package/build/newEntity.cjs.map +1 -1
- package/build/newEntity.js.map +1 -1
- package/build/newTestInstance.cjs +3 -3
- package/build/newTestInstance.cjs.map +1 -1
- package/build/newTestInstance.d.cts +1 -1
- package/build/newTestInstance.d.cts.map +1 -1
- package/build/newTestInstance.d.mts +1 -1
- package/build/newTestInstance.d.mts.map +1 -1
- package/build/newTestInstance.js +2 -2
- package/build/newTestInstance.js.map +1 -1
- package/build/normalizeHints.cjs +0 -2
- package/build/normalizeHints.cjs.map +1 -1
- package/build/normalizeHints.d.cts +2 -2
- package/build/normalizeHints.d.mts +2 -2
- package/build/normalizeHints.js +0 -2
- package/build/normalizeHints.js.map +1 -1
- package/build/nowUTC.cjs +2 -2
- package/build/nowUTC.cjs.map +1 -1
- package/build/nowUTC.d.cts +1 -1
- package/build/nowUTC.d.mts +1 -1
- package/build/nowUTC.js +1 -1
- package/build/nowUTC.js.map +1 -1
- package/build/plugins/ImmutableEntitiesPlugin.cjs.map +1 -1
- package/build/plugins/ImmutableEntitiesPlugin.js.map +1 -1
- package/build/plugins/PreloadPlugin.cjs +0 -2
- package/build/plugins/PreloadPlugin.d.cts +2 -2
- package/build/plugins/PreloadPlugin.d.mts +2 -2
- package/build/plugins/PreloadPlugin.js +0 -2
- package/build/preloading/JsonAggregatePreloader.cjs +1 -4
- package/build/preloading/JsonAggregatePreloader.cjs.map +1 -1
- package/build/preloading/JsonAggregatePreloader.d.cts +2 -2
- package/build/preloading/JsonAggregatePreloader.d.cts.map +1 -1
- package/build/preloading/JsonAggregatePreloader.d.mts +2 -2
- package/build/preloading/JsonAggregatePreloader.d.mts.map +1 -1
- package/build/preloading/JsonAggregatePreloader.js +1 -4
- package/build/preloading/JsonAggregatePreloader.js.map +1 -1
- package/build/preloading/canPreload.cjs.map +1 -1
- package/build/preloading/canPreload.js.map +1 -1
- package/build/preloading/partitionHint.cjs +2 -3
- package/build/preloading/partitionHint.cjs.map +1 -1
- package/build/preloading/partitionHint.d.cts +1 -1
- package/build/preloading/partitionHint.d.mts +1 -1
- package/build/preloading/partitionHint.js +2 -3
- package/build/preloading/partitionHint.js.map +1 -1
- package/build/queries/ConditionBuilder.cjs.map +1 -1
- package/build/queries/ConditionBuilder.d.cts +1 -1
- package/build/queries/ConditionBuilder.d.mts +1 -1
- package/build/queries/ConditionBuilder.js.map +1 -1
- package/build/queries/conditions.cjs.map +1 -1
- package/build/queries/conditions.js.map +1 -1
- package/build/queries/entityQueryUtils.cjs.map +1 -1
- package/build/queries/entityQueryUtils.js.map +1 -1
- package/build/queries/find/Aliases.cjs +1 -1
- package/build/queries/find/Aliases.cjs.map +1 -1
- package/build/queries/find/Aliases.d.cts.map +1 -1
- package/build/queries/find/Aliases.d.mts.map +1 -1
- package/build/queries/find/Aliases.js +1 -1
- package/build/queries/find/Aliases.js.map +1 -1
- package/build/queries/find/DeferredAlias.cjs.map +1 -1
- package/build/queries/find/DeferredAlias.js.map +1 -1
- package/build/queries/find/EntityFilter.cjs.map +1 -1
- package/build/queries/find/EntityFilter.js.map +1 -1
- package/build/queries/find/EntityGraphQLFilter.cjs.map +1 -1
- package/build/queries/find/EntityGraphQLFilter.js.map +1 -1
- package/build/queries/find/QueryParser.cjs +2 -2
- package/build/queries/find/QueryParser.cjs.map +1 -1
- package/build/queries/find/QueryParser.collectionJoins.cjs.map +1 -1
- package/build/queries/find/QueryParser.collectionJoins.js.map +1 -1
- package/build/queries/find/QueryParser.d.cts.map +1 -1
- package/build/queries/find/QueryParser.d.mts.map +1 -1
- package/build/queries/find/QueryParser.js +2 -2
- package/build/queries/find/QueryParser.js.map +1 -1
- package/build/queries/find/QueryParser.pruning.cjs.map +1 -1
- package/build/queries/find/QueryParser.pruning.js.map +1 -1
- package/build/queries/find/QueryVisitor.cjs.map +1 -1
- package/build/queries/find/QueryVisitor.js.map +1 -1
- package/build/queries/find/buildFindQuery.cjs.map +1 -1
- package/build/queries/find/buildFindQuery.js.map +1 -1
- package/build/queries/find/scopes.cjs.map +1 -1
- package/build/queries/find/scopes.d.cts +1 -1
- package/build/queries/find/scopes.d.mts +1 -1
- package/build/queries/find/scopes.js.map +1 -1
- package/build/queries/parsedConditions.cjs.map +1 -1
- package/build/queries/parsedConditions.js.map +1 -1
- package/build/queries/renderConditions.cjs.map +1 -1
- package/build/queries/renderConditions.js.map +1 -1
- package/build/queries/skipCondition.cjs.map +1 -1
- package/build/queries/skipCondition.js.map +1 -1
- package/build/queries/sql/AliasAssigner.cjs.map +1 -1
- package/build/queries/sql/AliasAssigner.js.map +1 -1
- package/build/queries/sql/Expr.cjs +2 -2
- package/build/queries/sql/Expr.cjs.map +1 -1
- package/build/queries/sql/Expr.d.cts +1 -1
- package/build/queries/sql/Expr.d.mts +1 -1
- package/build/queries/sql/Expr.js +1 -1
- package/build/queries/sql/Expr.js.map +1 -1
- package/build/queries/sql/Tables.cjs +1 -1
- package/build/queries/sql/Tables.cjs.map +1 -1
- package/build/queries/sql/Tables.d.cts.map +1 -1
- package/build/queries/sql/Tables.d.mts.map +1 -1
- package/build/queries/sql/Tables.js +1 -1
- package/build/queries/sql/Tables.js.map +1 -1
- package/build/queries/sql/execute.cjs +1 -1
- package/build/queries/sql/execute.cjs.map +1 -1
- package/build/queries/sql/execute.js +1 -1
- package/build/queries/sql/execute.js.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.cjs.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.js.map +1 -1
- package/build/queries/sql/expressions/case.cjs.map +1 -1
- package/build/queries/sql/expressions/case.js.map +1 -1
- package/build/queries/sql/expressions/coalesce.cjs.map +1 -1
- package/build/queries/sql/expressions/coalesce.js.map +1 -1
- package/build/queries/sql/expressions/codecs.cjs +2 -2
- package/build/queries/sql/expressions/codecs.cjs.map +1 -1
- package/build/queries/sql/expressions/codecs.js +1 -1
- package/build/queries/sql/expressions/codecs.js.map +1 -1
- package/build/queries/sql/expressions/expression.cjs.map +1 -1
- package/build/queries/sql/expressions/expression.d.cts.map +1 -1
- package/build/queries/sql/expressions/expression.d.mts.map +1 -1
- package/build/queries/sql/expressions/expression.js.map +1 -1
- package/build/queries/sql/expressions/greatest.cjs.map +1 -1
- package/build/queries/sql/expressions/greatest.js.map +1 -1
- package/build/queries/sql/expressions/least.cjs.map +1 -1
- package/build/queries/sql/expressions/least.js.map +1 -1
- package/build/queries/sql/expressions/nullIf.cjs.map +1 -1
- package/build/queries/sql/expressions/nullIf.js.map +1 -1
- package/build/queries/sql/expressions/parseExpression.cjs.map +1 -1
- package/build/queries/sql/expressions/parseExpression.js.map +1 -1
- package/build/queries/sql/expressions/types.d.cts.map +1 -1
- package/build/queries/sql/expressions/types.d.mts.map +1 -1
- package/build/queries/sql/query.cjs +1 -1
- package/build/queries/sql/query.cjs.map +1 -1
- package/build/queries/sql/query.d.cts +1 -1
- package/build/queries/sql/query.d.mts +1 -1
- package/build/queries/sql/query.js +1 -1
- package/build/queries/sql/query.js.map +1 -1
- package/build/{unnest.cjs → queries/unnest.cjs} +1 -2
- package/build/queries/unnest.cjs.map +1 -0
- package/build/{unnest.d.cts → queries/unnest.d.cts} +3 -3
- package/build/queries/unnest.d.cts.map +1 -0
- package/build/{unnest.d.mts → queries/unnest.d.mts} +3 -3
- package/build/queries/unnest.d.mts.map +1 -0
- package/build/{unnest.js → queries/unnest.js} +1 -2
- package/build/queries/unnest.js.map +1 -0
- package/build/queries/valueFilters.cjs.map +1 -1
- package/build/queries/valueFilters.d.cts +1 -1
- package/build/queries/valueFilters.d.cts.map +1 -1
- package/build/queries/valueFilters.d.mts +1 -1
- package/build/queries/valueFilters.d.mts.map +1 -1
- package/build/queries/valueFilters.js.map +1 -1
- package/build/{ReactionsManager.cjs → reactivity/ReactionsManager.cjs} +8 -10
- package/build/reactivity/ReactionsManager.cjs.map +1 -0
- package/build/{ReactionsManager.d.cts → reactivity/ReactionsManager.d.cts} +5 -6
- package/build/reactivity/ReactionsManager.d.cts.map +1 -0
- package/build/{ReactionsManager.d.mts → reactivity/ReactionsManager.d.mts} +5 -6
- package/build/reactivity/ReactionsManager.d.mts.map +1 -0
- package/build/{ReactionsManager.js → reactivity/ReactionsManager.js} +6 -8
- package/build/reactivity/ReactionsManager.js.map +1 -0
- package/build/{reactiveHints.cjs → reactivity/reactiveHints.cjs} +12 -16
- package/build/reactivity/reactiveHints.cjs.map +1 -0
- package/build/{reactiveHints.d.cts → reactivity/reactiveHints.d.cts} +17 -17
- package/build/reactivity/reactiveHints.d.cts.map +1 -0
- package/build/{reactiveHints.d.mts → reactivity/reactiveHints.d.mts} +17 -17
- package/build/reactivity/reactiveHints.d.mts.map +1 -0
- package/build/{reactiveHints.js → reactivity/reactiveHints.js} +12 -16
- package/build/reactivity/reactiveHints.js.map +1 -0
- package/build/relations/AbstractRelationImpl.cjs.map +1 -1
- package/build/relations/AbstractRelationImpl.js.map +1 -1
- package/build/relations/AsyncProperty.cjs.map +1 -1
- package/build/relations/AsyncProperty.js.map +1 -1
- package/build/relations/AsyncReactiveField.cjs +6 -6
- package/build/relations/AsyncReactiveField.cjs.map +1 -1
- package/build/relations/AsyncReactiveField.d.cts +1 -1
- package/build/relations/AsyncReactiveField.d.mts +1 -1
- package/build/relations/AsyncReactiveField.js +4 -4
- package/build/relations/AsyncReactiveField.js.map +1 -1
- package/build/relations/Collection.cjs +1 -1
- package/build/relations/Collection.cjs.map +1 -1
- package/build/relations/Collection.js +1 -1
- package/build/relations/Collection.js.map +1 -1
- package/build/relations/CustomCollection.cjs.map +1 -1
- package/build/relations/CustomCollection.d.cts +1 -1
- package/build/relations/CustomCollection.d.mts +1 -1
- package/build/relations/CustomCollection.js.map +1 -1
- package/build/relations/CustomReference.cjs +1 -1
- package/build/relations/CustomReference.cjs.map +1 -1
- package/build/relations/CustomReference.d.cts +1 -1
- package/build/relations/CustomReference.d.mts +1 -1
- package/build/relations/CustomReference.js +1 -1
- package/build/relations/CustomReference.js.map +1 -1
- package/build/relations/EnumCollection.cjs.map +1 -1
- package/build/relations/EnumCollection.d.cts +1 -1
- package/build/relations/EnumCollection.d.mts +1 -1
- package/build/relations/EnumCollection.js.map +1 -1
- package/build/relations/LazyField.cjs +4 -4
- package/build/relations/LazyField.cjs.map +1 -1
- package/build/relations/LazyField.js +4 -4
- package/build/relations/LazyField.js.map +1 -1
- package/build/relations/ManyToManyCollection.cjs +3 -3
- package/build/relations/ManyToManyCollection.cjs.map +1 -1
- package/build/relations/ManyToManyCollection.js +3 -3
- package/build/relations/ManyToManyCollection.js.map +1 -1
- package/build/relations/ManyToManyLargeCollection.cjs +3 -3
- package/build/relations/ManyToManyLargeCollection.cjs.map +1 -1
- package/build/relations/ManyToManyLargeCollection.js +3 -3
- package/build/relations/ManyToManyLargeCollection.js.map +1 -1
- package/build/relations/ManyToOneReference.cjs +4 -4
- package/build/relations/ManyToOneReference.cjs.map +1 -1
- package/build/relations/ManyToOneReference.js +4 -4
- package/build/relations/ManyToOneReference.js.map +1 -1
- package/build/relations/OneToManyCollection.cjs +1 -2
- package/build/relations/OneToManyCollection.cjs.map +1 -1
- package/build/relations/OneToManyCollection.d.cts +1 -1
- package/build/relations/OneToManyCollection.d.mts +1 -1
- package/build/relations/OneToManyCollection.js +1 -2
- package/build/relations/OneToManyCollection.js.map +1 -1
- package/build/relations/OneToManyLargeCollection.cjs +1 -1
- package/build/relations/OneToManyLargeCollection.cjs.map +1 -1
- package/build/relations/OneToManyLargeCollection.js +1 -1
- package/build/relations/OneToManyLargeCollection.js.map +1 -1
- package/build/relations/OneToOneReference.cjs +5 -5
- package/build/relations/OneToOneReference.cjs.map +1 -1
- package/build/relations/OneToOneReference.js +5 -5
- package/build/relations/OneToOneReference.js.map +1 -1
- package/build/relations/PolymorphicReference.cjs +3 -3
- package/build/relations/PolymorphicReference.cjs.map +1 -1
- package/build/relations/PolymorphicReference.js +3 -3
- package/build/relations/PolymorphicReference.js.map +1 -1
- package/build/relations/ReactiveField.cjs +5 -6
- package/build/relations/ReactiveField.cjs.map +1 -1
- package/build/relations/ReactiveField.d.cts +2 -2
- package/build/relations/ReactiveField.d.mts +2 -2
- package/build/relations/ReactiveField.js +3 -4
- package/build/relations/ReactiveField.js.map +1 -1
- package/build/relations/ReactiveGetter.cjs +0 -1
- package/build/relations/ReactiveGetter.cjs.map +1 -1
- package/build/relations/ReactiveGetter.d.cts +1 -1
- package/build/relations/ReactiveGetter.d.mts +1 -1
- package/build/relations/ReactiveGetter.js +0 -1
- package/build/relations/ReactiveGetter.js.map +1 -1
- package/build/relations/ReactiveManyToMany.cjs +5 -6
- package/build/relations/ReactiveManyToMany.cjs.map +1 -1
- package/build/relations/ReactiveManyToMany.d.cts +2 -2
- package/build/relations/ReactiveManyToMany.d.cts.map +1 -1
- package/build/relations/ReactiveManyToMany.d.mts +2 -2
- package/build/relations/ReactiveManyToMany.d.mts.map +1 -1
- package/build/relations/ReactiveManyToMany.js +3 -4
- package/build/relations/ReactiveManyToMany.js.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.cjs +1 -3
- package/build/relations/ReactiveManyToManyOtherSide.cjs.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.d.cts +2 -2
- package/build/relations/ReactiveManyToManyOtherSide.d.mts +2 -2
- package/build/relations/ReactiveManyToManyOtherSide.js +1 -3
- package/build/relations/ReactiveManyToManyOtherSide.js.map +1 -1
- package/build/relations/ReactiveReference.cjs +8 -9
- package/build/relations/ReactiveReference.cjs.map +1 -1
- package/build/relations/ReactiveReference.d.cts +2 -2
- package/build/relations/ReactiveReference.d.cts.map +1 -1
- package/build/relations/ReactiveReference.d.mts +2 -2
- package/build/relations/ReactiveReference.d.mts.map +1 -1
- package/build/relations/ReactiveReference.js +6 -7
- package/build/relations/ReactiveReference.js.map +1 -1
- package/build/relations/ReadOnlyCollection.cjs.map +1 -1
- package/build/relations/ReadOnlyCollection.js.map +1 -1
- package/build/relations/RecursiveCollection.cjs +3 -4
- package/build/relations/RecursiveCollection.cjs.map +1 -1
- package/build/relations/RecursiveCollection.d.cts +1 -1
- package/build/relations/RecursiveCollection.d.mts +1 -1
- package/build/relations/RecursiveCollection.js +3 -4
- package/build/relations/RecursiveCollection.js.map +1 -1
- package/build/relations/RecursiveCycleError.cjs.map +1 -1
- package/build/relations/RecursiveCycleError.js.map +1 -1
- package/build/relations/Reference.cjs +1 -1
- package/build/relations/Reference.cjs.map +1 -1
- package/build/relations/Reference.js +1 -1
- package/build/relations/Reference.js.map +1 -1
- package/build/relations/Relation.cjs.map +1 -1
- package/build/relations/Relation.js.map +1 -1
- package/build/relations/hasAsyncMethod.cjs +2 -2
- package/build/relations/hasAsyncMethod.cjs.map +1 -1
- package/build/relations/hasAsyncMethod.d.cts +1 -1
- package/build/relations/hasAsyncMethod.d.mts +1 -1
- package/build/relations/hasAsyncMethod.js +1 -1
- package/build/relations/hasAsyncMethod.js.map +1 -1
- package/build/relations/hasManyDerived.cjs +3 -3
- package/build/relations/hasManyDerived.cjs.map +1 -1
- package/build/relations/hasManyDerived.d.cts +1 -1
- package/build/relations/hasManyDerived.d.mts +1 -1
- package/build/relations/hasManyDerived.js +2 -2
- package/build/relations/hasManyDerived.js.map +1 -1
- package/build/relations/hasManyThrough.cjs +6 -6
- package/build/relations/hasManyThrough.cjs.map +1 -1
- package/build/relations/hasManyThrough.d.cts +1 -1
- package/build/relations/hasManyThrough.d.mts +1 -1
- package/build/relations/hasManyThrough.js +2 -2
- package/build/relations/hasManyThrough.js.map +1 -1
- package/build/relations/hasOneDerived.cjs +3 -3
- package/build/relations/hasOneDerived.cjs.map +1 -1
- package/build/relations/hasOneDerived.d.cts +1 -1
- package/build/relations/hasOneDerived.d.mts +1 -1
- package/build/relations/hasOneDerived.js +2 -2
- package/build/relations/hasOneDerived.js.map +1 -1
- package/build/relations/hasOneThrough.cjs +7 -7
- package/build/relations/hasOneThrough.cjs.map +1 -1
- package/build/relations/hasOneThrough.d.cts +1 -1
- package/build/relations/hasOneThrough.d.mts +1 -1
- package/build/relations/hasOneThrough.js +2 -2
- package/build/relations/hasOneThrough.js.map +1 -1
- package/build/relations/hasProperty.cjs +4 -4
- package/build/relations/hasProperty.cjs.map +1 -1
- package/build/relations/hasProperty.d.cts +2 -2
- package/build/relations/hasProperty.d.mts +2 -2
- package/build/relations/hasProperty.js +2 -2
- package/build/relations/hasProperty.js.map +1 -1
- package/build/relations/index.cjs +10 -10
- package/build/relations/index.js +10 -10
- package/build/relations/isCascadeDelete.cjs.map +1 -1
- package/build/relations/isCascadeDelete.js.map +1 -1
- package/build/resurrection.cjs.map +1 -1
- package/build/resurrection.js.map +1 -1
- package/build/rules.cjs +3 -4
- package/build/rules.cjs.map +1 -1
- package/build/rules.d.cts +1 -1
- package/build/rules.d.mts +1 -1
- package/build/rules.js +3 -4
- package/build/rules.js.map +1 -1
- package/build/runtimeConfig.cjs.map +1 -1
- package/build/runtimeConfig.js.map +1 -1
- package/build/{TypeInfo.cjs → serde/TypeInfo.cjs} +1 -1
- package/build/serde/TypeInfo.cjs.map +1 -0
- package/build/{TypeInfo.d.cts → serde/TypeInfo.d.cts} +2 -2
- package/build/serde/TypeInfo.d.cts.map +1 -0
- package/build/{TypeInfo.d.mts → serde/TypeInfo.d.mts} +2 -2
- package/build/serde/TypeInfo.d.mts.map +1 -0
- package/build/{TypeInfo.js → serde/TypeInfo.js} +1 -1
- package/build/serde/TypeInfo.js.map +1 -0
- package/build/{columns.cjs → serde/columns.cjs} +1 -1
- package/build/serde/columns.cjs.map +1 -0
- package/build/{columns.d.cts → serde/columns.d.cts} +2 -2
- package/build/serde/columns.d.cts.map +1 -0
- package/build/{columns.d.mts → serde/columns.d.mts} +2 -2
- package/build/serde/columns.d.mts.map +1 -0
- package/build/{columns.js → serde/columns.js} +1 -1
- package/build/serde/columns.js.map +1 -0
- package/build/{fieldSerde.cjs → serde/fieldSerde.cjs} +6 -6
- package/build/serde/fieldSerde.cjs.map +1 -0
- package/build/{fieldSerde.d.cts → serde/fieldSerde.d.cts} +5 -5
- package/build/serde/fieldSerde.d.cts.map +1 -0
- package/build/{fieldSerde.d.mts → serde/fieldSerde.d.mts} +5 -5
- package/build/serde/fieldSerde.d.mts.map +1 -0
- package/build/{fieldSerde.js → serde/fieldSerde.js} +6 -6
- package/build/serde/fieldSerde.js.map +1 -0
- package/build/{serde.cjs → serde/serde.cjs} +25 -26
- package/build/serde/serde.cjs.map +1 -0
- package/build/{serde.d.cts → serde/serde.d.cts} +1 -1
- package/build/serde/serde.d.cts.map +1 -0
- package/build/{serde.d.mts → serde/serde.d.mts} +1 -1
- package/build/serde/serde.d.mts.map +1 -0
- package/build/{serde.js → serde/serde.js} +4 -5
- package/build/serde/serde.js.map +1 -0
- package/build/{temporal.cjs → serde/temporal.cjs} +1 -1
- package/build/serde/temporal.cjs.map +1 -0
- package/build/{temporal.d.cts → serde/temporal.d.cts} +1 -1
- package/build/serde/temporal.d.cts.map +1 -0
- package/build/{temporal.d.mts → serde/temporal.d.mts} +1 -1
- package/build/serde/temporal.d.mts.map +1 -0
- package/build/{temporal.js → serde/temporal.js} +1 -1
- package/build/serde/temporal.js.map +1 -0
- package/build/{temporalMappers.cjs → serde/temporalMappers.cjs} +4 -5
- package/build/serde/temporalMappers.cjs.map +1 -0
- package/build/{temporalMappers.d.cts → serde/temporalMappers.d.cts} +1 -1
- package/build/serde/temporalMappers.d.cts.map +1 -0
- package/build/{temporalMappers.d.mts → serde/temporalMappers.d.mts} +1 -1
- package/build/serde/temporalMappers.d.mts.map +1 -0
- package/build/{temporalMappers.js → serde/temporalMappers.js} +2 -3
- package/build/serde/temporalMappers.js.map +1 -0
- package/build/upsert.cjs +1 -1
- package/build/upsert.cjs.map +1 -1
- package/build/upsert.d.cts.map +1 -1
- package/build/upsert.d.mts.map +1 -1
- package/build/upsert.js +1 -1
- package/build/upsert.js.map +1 -1
- package/build/utils.cjs +0 -1
- package/build/utils.cjs.map +1 -1
- package/build/utils.d.cts +1 -1
- package/build/utils.d.mts +1 -1
- package/build/utils.js +0 -1
- package/build/utils.js.map +1 -1
- package/package.json +2 -2
- package/build/FlushLock.cjs.map +0 -1
- package/build/FlushLock.d.cts.map +0 -1
- package/build/FlushLock.d.mts.map +0 -1
- package/build/FlushLock.js.map +0 -1
- package/build/HintTree.cjs.map +0 -1
- package/build/HintTree.d.cts.map +0 -1
- package/build/HintTree.d.mts.map +0 -1
- package/build/HintTree.js.map +0 -1
- package/build/IsLoadedCache.d.cts.map +0 -1
- package/build/IsLoadedCache.d.mts.map +0 -1
- package/build/IsLoadedCache.js.map +0 -1
- package/build/JoinRows.cjs.map +0 -1
- package/build/JoinRows.d.cts.map +0 -1
- package/build/JoinRows.d.mts.map +0 -1
- package/build/JoinRows.js.map +0 -1
- package/build/PendingChanges.d.cts.map +0 -1
- package/build/PendingChanges.d.mts.map +0 -1
- package/build/PendingChanges.js +0 -2
- package/build/ReactionsManager.cjs.map +0 -1
- package/build/ReactionsManager.d.cts.map +0 -1
- package/build/ReactionsManager.d.mts.map +0 -1
- package/build/ReactionsManager.js.map +0 -1
- package/build/Todo.cjs.map +0 -1
- package/build/Todo.d.cts.map +0 -1
- package/build/Todo.d.mts.map +0 -1
- package/build/Todo.js.map +0 -1
- package/build/TypeInfo.cjs.map +0 -1
- package/build/TypeInfo.d.cts.map +0 -1
- package/build/TypeInfo.d.mts.map +0 -1
- package/build/TypeInfo.js.map +0 -1
- package/build/columns.cjs.map +0 -1
- package/build/columns.d.cts.map +0 -1
- package/build/columns.d.mts.map +0 -1
- package/build/columns.js.map +0 -1
- package/build/driverApi.cjs +0 -18
- package/build/driverApi.cjs.map +0 -1
- package/build/driverApi.d.cts +0 -22
- package/build/driverApi.d.cts.map +0 -1
- package/build/driverApi.d.mts +0 -22
- package/build/driverApi.d.mts.map +0 -1
- package/build/driverApi.js +0 -18
- package/build/driverApi.js.map +0 -1
- package/build/fieldSerde.cjs.map +0 -1
- package/build/fieldSerde.d.cts.map +0 -1
- package/build/fieldSerde.d.mts.map +0 -1
- package/build/fieldSerde.js.map +0 -1
- package/build/loadHints.cjs.map +0 -1
- package/build/loadHints.d.cts.map +0 -1
- package/build/loadHints.d.mts.map +0 -1
- package/build/loadHints.js.map +0 -1
- package/build/loadLens.cjs.map +0 -1
- package/build/loadLens.d.cts.map +0 -1
- package/build/loadLens.d.mts.map +0 -1
- package/build/loadLens.js.map +0 -1
- package/build/reactiveHints.cjs.map +0 -1
- package/build/reactiveHints.d.cts.map +0 -1
- package/build/reactiveHints.d.mts.map +0 -1
- package/build/reactiveHints.js.map +0 -1
- package/build/serde.cjs.map +0 -1
- package/build/serde.d.cts.map +0 -1
- package/build/serde.d.mts.map +0 -1
- package/build/serde.js.map +0 -1
- package/build/temporal.cjs.map +0 -1
- package/build/temporal.d.cts.map +0 -1
- package/build/temporal.d.mts.map +0 -1
- package/build/temporal.js.map +0 -1
- package/build/temporalMappers.cjs.map +0 -1
- package/build/temporalMappers.d.cts.map +0 -1
- package/build/temporalMappers.d.mts.map +0 -1
- package/build/temporalMappers.js.map +0 -1
- package/build/unnest.cjs.map +0 -1
- package/build/unnest.d.cts.map +0 -1
- package/build/unnest.d.mts.map +0 -1
- package/build/unnest.js.map +0 -1
- package/build/withLoaded.cjs.map +0 -1
- package/build/withLoaded.d.cts.map +0 -1
- package/build/withLoaded.d.mts.map +0 -1
- package/build/withLoaded.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Relation.js","names":[],"sources":["../../src/relations/Relation.ts"],"sourcesContent":["import { type Entity } from \"
|
|
1
|
+
{"version":3,"file":"Relation.js","names":[],"sources":["../../src/relations/Relation.ts"],"sourcesContent":["import { type Entity } from \"src/Entity.ts\";\nimport { isCollection, isReference } from \"src/relations/index.ts\";\nimport { RelationT, RelationU } from \"src/relations/RelationSymbols.ts\";\n\nexport { RelationT, RelationU };\n\n/** A relationship from `T` to `U`, could be any of many-to-one, one-to-many, or many-to-many. */\nexport interface Relation<T extends Entity, U extends Entity> {\n // Make our Relation somewhat non-structural, otherwise since it's a marker interface,\n // types like `number` or `string` will match it. This also seems to nudge the type\n // inference inside `LoadHint` to go beyond \"this generic T of Entity has id and __orm\"\n // to \"no really this generic T has fields firstName, title, etc.\".\n // See https://stackoverflow.com/questions/53448100/generic-type-of-extended-interface-not-inferred\n // And https://github.com/microsoft/TypeScript/issues/47213\n [RelationT]: T;\n [RelationU]: U;\n isLoaded: boolean;\n entity: Entity;\n hasBeenSet: boolean;\n}\n\n/** Type guard utility for determining if an entity field is a Relation. */\nexport function isRelation(maybeRelation: any): maybeRelation is Relation<any, any> {\n return isReference(maybeRelation) || isCollection(maybeRelation);\n}\n"],"mappings":";;;;;;;AAsBA,SAAgB,WAAW,eAAyD;CAClF,OAAO,YAAY,aAAa,KAAK,aAAa,aAAa;AACjE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_loading_loadHints = require("../loading/loadHints.cjs");
|
|
3
3
|
const require_newEntity = require("../newEntity.cjs");
|
|
4
4
|
require("../Entity.cjs");
|
|
5
5
|
//#region src/relations/hasAsyncMethod.ts
|
|
@@ -35,7 +35,7 @@ var AsyncMethodImpl = class {
|
|
|
35
35
|
return this.fn(this.#entity, ...args);
|
|
36
36
|
}
|
|
37
37
|
get isLoaded() {
|
|
38
|
-
return this.loaded ||
|
|
38
|
+
return this.loaded || require_loading_loadHints.isLoaded(this.#entity, this.#hint);
|
|
39
39
|
}
|
|
40
40
|
[AsyncMethodM];
|
|
41
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasAsyncMethod.cjs","names":["lazyField","#entity","#hint","isLoaded"],"sources":["../../src/relations/hasAsyncMethod.ts"],"sourcesContent":["import { type Entity } from \"
|
|
1
|
+
{"version":3,"file":"hasAsyncMethod.cjs","names":["lazyField","#entity","#hint","isLoaded"],"sources":["../../src/relations/hasAsyncMethod.ts"],"sourcesContent":["import { type Entity } from \"src/Entity.ts\";\nimport { type LoadHint, type Loaded, isLoaded } from \"src/loading/loadHints.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\n\nconst AsyncMethodM = Symbol();\nexport const AsyncMethodPopulateSecret = Symbol();\n\nexport interface AsyncMethod<T extends Entity, A extends unknown[], V> {\n // To differentiate from AsyncProperties\n [AsyncMethodM]: undefined;\n isLoaded: boolean;\n load(...args: A): Promise<V>;\n}\n\nexport interface LoadedMethod<T extends Entity, A extends unknown[], V> {\n call(...args: A): V;\n}\n\nexport function hasAsyncMethod<T extends Entity, const H extends LoadHint<T>, A extends unknown[], V>(\n loadHint: H,\n fn: (entity: Loaded<T, H>, ...args: A) => V,\n): AsyncMethod<T, A, V> {\n return lazyField((entity: T) => {\n return new AsyncMethodImpl(entity, loadHint, fn);\n });\n}\n\nexport class AsyncMethodImpl<T extends Entity, H extends LoadHint<T>, A extends unknown[], V> implements AsyncMethod<\n T,\n A,\n V\n> {\n private loaded = false;\n private loadPromise: Promise<any> | undefined;\n\n readonly #entity: T;\n readonly #hint: H;\n constructor(\n entity: T,\n hint: H,\n private fn: (entity: Loaded<T, H>, ...args: A) => V,\n ) {\n this.#entity = entity;\n this.#hint = hint;\n }\n\n /** Args might be either the user-provided args, or the populate `opts` if we're being preloaded. */\n async load(...args: A): Promise<V> {\n // Are we being called by `em.populate`? If so, we don't have the real args, so avoid invoking fn\n const isPopulate = args && typeof args[0] === \"object\" && AsyncMethodPopulateSecret in (args as any)[0];\n if (!this.loaded) {\n this.loadPromise ??= this.#entity.em.populate(this.#entity, this.#hint!).then((loaded) => (this.loaded = true));\n await this.loadPromise;\n }\n return isPopulate ? (undefined as any) : this.call(...args);\n }\n\n call(...args: A): V {\n if (!this.isLoaded) {\n throw new Error(\"hasAsyncMethod.call was called but not loaded\");\n }\n return this.fn(this.#entity as Loaded<T, H>, ...args);\n }\n\n get isLoaded() {\n return this.loaded || isLoaded(this.#entity, this.#hint);\n }\n\n [AsyncMethodM]: undefined;\n}\n"],"mappings":";;;;;AAIA,MAAM,eAAe,OAAO;AAC5B,MAAa,4BAA4B,OAAO;AAahD,SAAgB,eACd,UACA,IACsB;CACtB,OAAOA,kBAAAA,WAAW,WAAc;EAC9B,OAAO,IAAI,gBAAgB,QAAQ,UAAU,EAAE;CACjD,CAAC;AACH;AAEA,IAAa,kBAAb,MAIE;CASU;CARV,SAAiB;CACjB;CAEA;CACA;CACA,YACE,QACA,MACA,IACA;EADQ,KAAA,KAAA;EAER,KAAKC,UAAU;EACf,KAAKC,QAAQ;CACf;;CAGA,MAAM,KAAK,GAAG,MAAqB;EAEjC,MAAM,aAAa,QAAQ,OAAO,KAAK,OAAO,YAAY,6BAA8B,KAAa;EACrG,IAAI,CAAC,KAAK,QAAQ;GAChB,KAAK,gBAAgB,KAAKD,QAAQ,GAAG,SAAS,KAAKA,SAAS,KAAKC,KAAM,CAAC,CAAC,MAAM,WAAY,KAAK,SAAS,IAAK;GAC9G,MAAM,KAAK;EACb;EACA,OAAO,aAAc,KAAA,IAAoB,KAAK,KAAK,GAAG,IAAI;CAC5D;CAEA,KAAK,GAAG,MAAY;EAClB,IAAI,CAAC,KAAK,UACR,MAAM,IAAI,MAAM,+CAA+C;EAEjE,OAAO,KAAK,GAAG,KAAKD,SAAyB,GAAG,IAAI;CACtD;CAEA,IAAI,WAAW;EACb,OAAO,KAAK,UAAUE,0BAAAA,SAAS,KAAKF,SAAS,KAAKC,KAAK;CACzD;CAEA,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasAsyncMethod.js","names":["#entity","#hint"],"sources":["../../src/relations/hasAsyncMethod.ts"],"sourcesContent":["import { type Entity } from \"
|
|
1
|
+
{"version":3,"file":"hasAsyncMethod.js","names":["#entity","#hint"],"sources":["../../src/relations/hasAsyncMethod.ts"],"sourcesContent":["import { type Entity } from \"src/Entity.ts\";\nimport { type LoadHint, type Loaded, isLoaded } from \"src/loading/loadHints.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\n\nconst AsyncMethodM = Symbol();\nexport const AsyncMethodPopulateSecret = Symbol();\n\nexport interface AsyncMethod<T extends Entity, A extends unknown[], V> {\n // To differentiate from AsyncProperties\n [AsyncMethodM]: undefined;\n isLoaded: boolean;\n load(...args: A): Promise<V>;\n}\n\nexport interface LoadedMethod<T extends Entity, A extends unknown[], V> {\n call(...args: A): V;\n}\n\nexport function hasAsyncMethod<T extends Entity, const H extends LoadHint<T>, A extends unknown[], V>(\n loadHint: H,\n fn: (entity: Loaded<T, H>, ...args: A) => V,\n): AsyncMethod<T, A, V> {\n return lazyField((entity: T) => {\n return new AsyncMethodImpl(entity, loadHint, fn);\n });\n}\n\nexport class AsyncMethodImpl<T extends Entity, H extends LoadHint<T>, A extends unknown[], V> implements AsyncMethod<\n T,\n A,\n V\n> {\n private loaded = false;\n private loadPromise: Promise<any> | undefined;\n\n readonly #entity: T;\n readonly #hint: H;\n constructor(\n entity: T,\n hint: H,\n private fn: (entity: Loaded<T, H>, ...args: A) => V,\n ) {\n this.#entity = entity;\n this.#hint = hint;\n }\n\n /** Args might be either the user-provided args, or the populate `opts` if we're being preloaded. */\n async load(...args: A): Promise<V> {\n // Are we being called by `em.populate`? If so, we don't have the real args, so avoid invoking fn\n const isPopulate = args && typeof args[0] === \"object\" && AsyncMethodPopulateSecret in (args as any)[0];\n if (!this.loaded) {\n this.loadPromise ??= this.#entity.em.populate(this.#entity, this.#hint!).then((loaded) => (this.loaded = true));\n await this.loadPromise;\n }\n return isPopulate ? (undefined as any) : this.call(...args);\n }\n\n call(...args: A): V {\n if (!this.isLoaded) {\n throw new Error(\"hasAsyncMethod.call was called but not loaded\");\n }\n return this.fn(this.#entity as Loaded<T, H>, ...args);\n }\n\n get isLoaded() {\n return this.loaded || isLoaded(this.#entity, this.#hint);\n }\n\n [AsyncMethodM]: undefined;\n}\n"],"mappings":";;;;AAIA,MAAM,eAAe,OAAO;AAC5B,MAAa,4BAA4B,OAAO;AAahD,SAAgB,eACd,UACA,IACsB;CACtB,OAAO,WAAW,WAAc;EAC9B,OAAO,IAAI,gBAAgB,QAAQ,UAAU,EAAE;CACjD,CAAC;AACH;AAEA,IAAa,kBAAb,MAIE;CASU;CARV,SAAiB;CACjB;CAEA;CACA;CACA,YACE,QACA,MACA,IACA;EADQ,KAAA,KAAA;EAER,KAAKA,UAAU;EACf,KAAKC,QAAQ;CACf;;CAGA,MAAM,KAAK,GAAG,MAAqB;EAEjC,MAAM,aAAa,QAAQ,OAAO,KAAK,OAAO,YAAY,6BAA8B,KAAa;EACrG,IAAI,CAAC,KAAK,QAAQ;GAChB,KAAK,gBAAgB,KAAKD,QAAQ,GAAG,SAAS,KAAKA,SAAS,KAAKC,KAAM,CAAC,CAAC,MAAM,WAAY,KAAK,SAAS,IAAK;GAC9G,MAAM,KAAK;EACb;EACA,OAAO,aAAc,KAAA,IAAoB,KAAK,KAAK,GAAG,IAAI;CAC5D;CAEA,KAAK,GAAG,MAAY;EAClB,IAAI,CAAC,KAAK,UACR,MAAM,IAAI,MAAM,+CAA+C;EAEjE,OAAO,KAAK,GAAG,KAAKD,SAAyB,GAAG,IAAI;CACtD;CAEA,IAAI,WAAW;EACb,OAAO,KAAK,UAAU,SAAS,KAAKA,SAAS,KAAKC,KAAK;CACzD;CAEA,CAAC;AACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_loadHints = require("../loadHints.cjs");
|
|
3
|
-
const require_newEntity = require("../newEntity.cjs");
|
|
4
2
|
const require_relations_CustomCollection = require("./CustomCollection.cjs");
|
|
3
|
+
const require_loading_loadHints = require("../loading/loadHints.cjs");
|
|
4
|
+
const require_newEntity = require("../newEntity.cjs");
|
|
5
5
|
require("../index.cjs");
|
|
6
6
|
require("../Entity.cjs");
|
|
7
7
|
//#region src/relations/hasManyDerived.ts
|
|
@@ -23,7 +23,7 @@ function hasManyDerived(loadHint, opts) {
|
|
|
23
23
|
...opts
|
|
24
24
|
});
|
|
25
25
|
},
|
|
26
|
-
isLoaded: () =>
|
|
26
|
+
isLoaded: () => require_loading_loadHints.isLoaded(entity, loadHint),
|
|
27
27
|
loadHint,
|
|
28
28
|
...rest
|
|
29
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasManyDerived.cjs","names":["lazyField","CustomCollection","isLoaded"],"sources":["../../src/relations/hasManyDerived.ts"],"sourcesContent":["import { type
|
|
1
|
+
{"version":3,"file":"hasManyDerived.cjs","names":["lazyField","CustomCollection","isLoaded"],"sources":["../../src/relations/hasManyDerived.ts"],"sourcesContent":["import { type Entity } from \"src/Entity.ts\";\nimport { type Collection, isLoaded } from \"src/index.ts\";\nimport type { LoadHint, Loaded } from \"src/loading/loadHints.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\nimport { CustomCollection } from \"src/relations/CustomCollection.ts\";\n\ntype HasManyDerivedOpts<T extends Entity, U extends Entity, H extends LoadHint<T>> = {\n load?: (entity: T, opts: { forceReload?: boolean }) => Promise<any>;\n get: (entity: Loaded<T, H>) => readonly U[];\n set?: (entity: Loaded<T, H>, values: U[]) => void;\n add?: (entity: Loaded<T, H>, value: U) => void;\n remove?: (entity: Loaded<T, H>, value: U) => void;\n};\n\n/**\n * Creates a CustomCollection that can conditionally walk across references in the object graph.\n *\n * I.e. An Author \"has many reviews\" through the `author -> books -> reviews` relation.\n *\n * Because this is based on `CustomCollection`, it will work in populates, i.e. `em.populate(author, \"reviews\")`.\n */\nexport function hasManyDerived<T extends Entity, U extends Entity, H extends LoadHint<T>>(\n loadHint: H,\n opts: HasManyDerivedOpts<T, U, H>,\n): Collection<T, U> {\n const { load, ...rest } = opts;\n return lazyField((entity: T) => {\n return new CustomCollection<T, U>(entity, {\n load(entity, opts) {\n if (load) {\n return load(entity, opts);\n } else {\n return entity.em.populate(entity, { hint: loadHint, ...opts });\n }\n },\n isLoaded: () => isLoaded(entity, loadHint),\n loadHint,\n ...(rest as any),\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAqBA,SAAgB,eACd,UACA,MACkB;CAClB,MAAM,EAAE,MAAM,GAAG,SAAS;CAC1B,OAAOA,kBAAAA,WAAW,WAAc;EAC9B,OAAO,IAAIC,mCAAAA,iBAAuB,QAAQ;GACxC,KAAK,QAAQ,MAAM;IACjB,IAAI,MACF,OAAO,KAAK,QAAQ,IAAI;SAExB,OAAO,OAAO,GAAG,SAAS,QAAQ;KAAE,MAAM;KAAU,GAAG;IAAK,CAAC;GAEjE;GACA,gBAAgBC,0BAAAA,SAAS,QAAQ,QAAQ;GACzC;GACA,GAAI;EACN,CAAC;CACH,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collection } from "./Collection.cjs";
|
|
2
|
-
import { LoadHint, Loaded } from "../loadHints.cjs";
|
|
2
|
+
import { LoadHint, Loaded } from "../loading/loadHints.cjs";
|
|
3
3
|
import "../index.cjs";
|
|
4
4
|
import { Entity } from "../Entity.cjs";
|
|
5
5
|
//#region src/relations/hasManyDerived.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collection } from "./Collection.mjs";
|
|
2
|
-
import { LoadHint, Loaded } from "../loadHints.mjs";
|
|
2
|
+
import { LoadHint, Loaded } from "../loading/loadHints.mjs";
|
|
3
3
|
import "../index.mjs";
|
|
4
4
|
import { Entity } from "../Entity.mjs";
|
|
5
5
|
//#region src/relations/hasManyDerived.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isLoaded } from "../loadHints.js";
|
|
2
|
-
import { lazyField } from "../newEntity.js";
|
|
3
1
|
import { CustomCollection } from "./CustomCollection.js";
|
|
2
|
+
import { isLoaded } from "../loading/loadHints.js";
|
|
3
|
+
import { lazyField } from "../newEntity.js";
|
|
4
4
|
import "../index.js";
|
|
5
5
|
import "../Entity.js";
|
|
6
6
|
//#region src/relations/hasManyDerived.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasManyDerived.js","names":[],"sources":["../../src/relations/hasManyDerived.ts"],"sourcesContent":["import { type
|
|
1
|
+
{"version":3,"file":"hasManyDerived.js","names":[],"sources":["../../src/relations/hasManyDerived.ts"],"sourcesContent":["import { type Entity } from \"src/Entity.ts\";\nimport { type Collection, isLoaded } from \"src/index.ts\";\nimport type { LoadHint, Loaded } from \"src/loading/loadHints.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\nimport { CustomCollection } from \"src/relations/CustomCollection.ts\";\n\ntype HasManyDerivedOpts<T extends Entity, U extends Entity, H extends LoadHint<T>> = {\n load?: (entity: T, opts: { forceReload?: boolean }) => Promise<any>;\n get: (entity: Loaded<T, H>) => readonly U[];\n set?: (entity: Loaded<T, H>, values: U[]) => void;\n add?: (entity: Loaded<T, H>, value: U) => void;\n remove?: (entity: Loaded<T, H>, value: U) => void;\n};\n\n/**\n * Creates a CustomCollection that can conditionally walk across references in the object graph.\n *\n * I.e. An Author \"has many reviews\" through the `author -> books -> reviews` relation.\n *\n * Because this is based on `CustomCollection`, it will work in populates, i.e. `em.populate(author, \"reviews\")`.\n */\nexport function hasManyDerived<T extends Entity, U extends Entity, H extends LoadHint<T>>(\n loadHint: H,\n opts: HasManyDerivedOpts<T, U, H>,\n): Collection<T, U> {\n const { load, ...rest } = opts;\n return lazyField((entity: T) => {\n return new CustomCollection<T, U>(entity, {\n load(entity, opts) {\n if (load) {\n return load(entity, opts);\n } else {\n return entity.em.populate(entity, { hint: loadHint, ...opts });\n }\n },\n isLoaded: () => isLoaded(entity, loadHint),\n loadHint,\n ...(rest as any),\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,SAAgB,eACd,UACA,MACkB;CAClB,MAAM,EAAE,MAAM,GAAG,SAAS;CAC1B,OAAO,WAAW,WAAc;EAC9B,OAAO,IAAI,iBAAuB,QAAQ;GACxC,KAAK,QAAQ,MAAM;IACjB,IAAI,MACF,OAAO,KAAK,QAAQ,IAAI;SAExB,OAAO,OAAO,GAAG,SAAS,QAAQ;KAAE,MAAM;KAAU,GAAG;IAAK,CAAC;GAEjE;GACA,gBAAgB,SAAS,QAAQ,QAAQ;GACzC;GACA,GAAI;EACN,CAAC;CACH,CAAC;AACH"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_newEntity = require("../newEntity.cjs");
|
|
3
2
|
const require_relations_CustomCollection = require("./CustomCollection.cjs");
|
|
3
|
+
const require_newEntity = require("../newEntity.cjs");
|
|
4
4
|
const require_EntityMetadata = require("../EntityMetadata.cjs");
|
|
5
|
-
const
|
|
5
|
+
const require_loading_loadLens = require("../loading/loadLens.cjs");
|
|
6
6
|
require("../index.cjs");
|
|
7
7
|
//#region src/relations/hasManyThrough.ts
|
|
8
8
|
/**
|
|
@@ -16,10 +16,10 @@ function hasManyThrough(lens) {
|
|
|
16
16
|
return require_newEntity.lazyField((entity) => {
|
|
17
17
|
const meta = require_EntityMetadata.getMetadata(entity);
|
|
18
18
|
return new require_relations_CustomCollection.CustomCollection(entity, {
|
|
19
|
-
load: (entity, opts) =>
|
|
20
|
-
get: () =>
|
|
21
|
-
isLoaded: () =>
|
|
22
|
-
loadHint: () =>
|
|
19
|
+
load: (entity, opts) => require_loading_loadLens.loadLens(entity, lens, opts),
|
|
20
|
+
get: () => require_loading_loadLens.getLens(meta, entity, lens),
|
|
21
|
+
isLoaded: () => require_loading_loadLens.isLensLoaded(entity, lens),
|
|
22
|
+
loadHint: () => require_loading_loadLens.lensToLoadHint(lens)
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasManyThrough.cjs","names":["lazyField","getMetadata","CustomCollection","loadLens","getLens","isLensLoaded","lensToLoadHint"],"sources":["../../src/relations/hasManyThrough.ts"],"sourcesContent":["import {\n type Collection,\n CustomCollection,\n type Entity,\n type Lens,\n getLens,\n getMetadata,\n isLensLoaded,\n lensToLoadHint,\n loadLens,\n} from \"
|
|
1
|
+
{"version":3,"file":"hasManyThrough.cjs","names":["lazyField","getMetadata","CustomCollection","loadLens","getLens","isLensLoaded","lensToLoadHint"],"sources":["../../src/relations/hasManyThrough.ts"],"sourcesContent":["import {\n type Collection,\n CustomCollection,\n type Entity,\n type Lens,\n getLens,\n getMetadata,\n isLensLoaded,\n lensToLoadHint,\n loadLens,\n} from \"src/index.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\n\n/**\n * Creates a CustomCollection that will walk across references in the object graph.\n *\n * I.e. An Author \"has many reviews\" through the `author -> books -> reviews` relation.\n *\n * Because this is based on `CustomCollection`, it will work in populates, i.e. `em.populate(author, \"reviews\")`.\n */\nexport function hasManyThrough<T extends Entity, U extends Entity>(\n lens: (lens: Lens<T>) => Lens<U, U[]>,\n): Collection<T, U> {\n return lazyField((entity: T) => {\n const meta = getMetadata(entity);\n return new CustomCollection<T, U>(entity, {\n load: (entity, opts) => loadLens(entity, lens, opts),\n get: () => getLens(meta, entity, lens),\n isLoaded: () => isLensLoaded(entity, lens),\n loadHint: () => lensToLoadHint(lens),\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAAgB,eACd,MACkB;CAClB,OAAOA,kBAAAA,WAAW,WAAc;EAC9B,MAAM,OAAOC,uBAAAA,YAAY,MAAM;EAC/B,OAAO,IAAIC,mCAAAA,iBAAuB,QAAQ;GACxC,OAAO,QAAQ,SAASC,yBAAAA,SAAS,QAAQ,MAAM,IAAI;GACnD,WAAWC,yBAAAA,QAAQ,MAAM,QAAQ,IAAI;GACrC,gBAAgBC,yBAAAA,aAAa,QAAQ,IAAI;GACzC,gBAAgBC,yBAAAA,eAAe,IAAI;EACrC,CAAC;CACH,CAAC;AACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { lazyField } from "../newEntity.js";
|
|
2
1
|
import { CustomCollection } from "./CustomCollection.js";
|
|
2
|
+
import { lazyField } from "../newEntity.js";
|
|
3
3
|
import { getMetadata } from "../EntityMetadata.js";
|
|
4
|
-
import { getLens, isLensLoaded, lensToLoadHint, loadLens } from "../loadLens.js";
|
|
4
|
+
import { getLens, isLensLoaded, lensToLoadHint, loadLens } from "../loading/loadLens.js";
|
|
5
5
|
import "../index.js";
|
|
6
6
|
//#region src/relations/hasManyThrough.ts
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasManyThrough.js","names":[],"sources":["../../src/relations/hasManyThrough.ts"],"sourcesContent":["import {\n type Collection,\n CustomCollection,\n type Entity,\n type Lens,\n getLens,\n getMetadata,\n isLensLoaded,\n lensToLoadHint,\n loadLens,\n} from \"
|
|
1
|
+
{"version":3,"file":"hasManyThrough.js","names":[],"sources":["../../src/relations/hasManyThrough.ts"],"sourcesContent":["import {\n type Collection,\n CustomCollection,\n type Entity,\n type Lens,\n getLens,\n getMetadata,\n isLensLoaded,\n lensToLoadHint,\n loadLens,\n} from \"src/index.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\n\n/**\n * Creates a CustomCollection that will walk across references in the object graph.\n *\n * I.e. An Author \"has many reviews\" through the `author -> books -> reviews` relation.\n *\n * Because this is based on `CustomCollection`, it will work in populates, i.e. `em.populate(author, \"reviews\")`.\n */\nexport function hasManyThrough<T extends Entity, U extends Entity>(\n lens: (lens: Lens<T>) => Lens<U, U[]>,\n): Collection<T, U> {\n return lazyField((entity: T) => {\n const meta = getMetadata(entity);\n return new CustomCollection<T, U>(entity, {\n load: (entity, opts) => loadLens(entity, lens, opts),\n get: () => getLens(meta, entity, lens),\n isLoaded: () => isLensLoaded(entity, lens),\n loadHint: () => lensToLoadHint(lens),\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,SAAgB,eACd,MACkB;CAClB,OAAO,WAAW,WAAc;EAC9B,MAAM,OAAO,YAAY,MAAM;EAC/B,OAAO,IAAI,iBAAuB,QAAQ;GACxC,OAAO,QAAQ,SAAS,SAAS,QAAQ,MAAM,IAAI;GACnD,WAAW,QAAQ,MAAM,QAAQ,IAAI;GACrC,gBAAgB,aAAa,QAAQ,IAAI;GACzC,gBAAgB,eAAe,IAAI;EACrC,CAAC;CACH,CAAC;AACH"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_relations_CustomReference = require("./CustomReference.cjs");
|
|
3
|
+
const require_loading_loadHints = require("../loading/loadHints.cjs");
|
|
2
4
|
require("./Reference.cjs");
|
|
3
|
-
const require_loadHints = require("../loadHints.cjs");
|
|
4
5
|
const require_newEntity = require("../newEntity.cjs");
|
|
5
|
-
const require_relations_CustomReference = require("./CustomReference.cjs");
|
|
6
6
|
require("../index.cjs");
|
|
7
7
|
require("../Entity.cjs");
|
|
8
8
|
//#region src/relations/hasOneDerived.ts
|
|
@@ -21,7 +21,7 @@ function hasOneDerived(loadHint, get) {
|
|
|
21
21
|
...opts
|
|
22
22
|
}),
|
|
23
23
|
get: () => get(entity),
|
|
24
|
-
isLoaded: () =>
|
|
24
|
+
isLoaded: () => require_loading_loadHints.isLoaded(entity, loadHint),
|
|
25
25
|
loadHint
|
|
26
26
|
});
|
|
27
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasOneDerived.cjs","names":["lazyField","CustomReference","isLoaded"],"sources":["../../src/relations/hasOneDerived.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"hasOneDerived.cjs","names":["lazyField","CustomReference","isLoaded"],"sources":["../../src/relations/hasOneDerived.ts"],"sourcesContent":["import { type Entity } from \"src/Entity.ts\";\nimport { isLoaded } from \"src/index.ts\";\nimport type { LoadHint, Loaded } from \"src/loading/loadHints.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\nimport { CustomReference } from \"src/relations/CustomReference.ts\";\nimport { type Reference } from \"src/relations/Reference.ts\";\n\n/**\n * Creates a CustomReference that can conditionally walk across references in the object graph.\n *\n * I.e. A BookReview \"has one author\" through the `review -> book -> author` relation.\n *\n * Because this is based on `CustomReference`, it will work in populates, i.e. `em.populate(review, \"author\")`.\n */\nexport function hasOneDerived<\n T extends Entity,\n U extends Entity,\n N extends never | undefined,\n V extends U | N,\n const H extends LoadHint<T>,\n>(loadHint: H, get: (entity: Loaded<T, H>) => V): Reference<T, U, N> {\n return lazyField((entity: T) => {\n return new CustomReference<T, U, N>(entity, {\n load: (entity, opts) => entity.em.populate(entity, { hint: loadHint, ...opts }),\n get: () => get(entity as Loaded<T, H>),\n isLoaded: () => isLoaded(entity, loadHint as LoadHint<T>),\n loadHint,\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,SAAgB,cAMd,UAAa,KAAsD;CACnE,OAAOA,kBAAAA,WAAW,WAAc;EAC9B,OAAO,IAAIC,kCAAAA,gBAAyB,QAAQ;GAC1C,OAAO,QAAQ,SAAS,OAAO,GAAG,SAAS,QAAQ;IAAE,MAAM;IAAU,GAAG;GAAK,CAAC;GAC9E,WAAW,IAAI,MAAsB;GACrC,gBAAgBC,0BAAAA,SAAS,QAAQ,QAAuB;GACxD;EACF,CAAC;CACH,CAAC;AACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { CustomReference } from "./CustomReference.js";
|
|
2
|
+
import { isLoaded } from "../loading/loadHints.js";
|
|
1
3
|
import "./Reference.js";
|
|
2
|
-
import { isLoaded } from "../loadHints.js";
|
|
3
4
|
import { lazyField } from "../newEntity.js";
|
|
4
|
-
import { CustomReference } from "./CustomReference.js";
|
|
5
5
|
import "../index.js";
|
|
6
6
|
import "../Entity.js";
|
|
7
7
|
//#region src/relations/hasOneDerived.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasOneDerived.js","names":[],"sources":["../../src/relations/hasOneDerived.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"hasOneDerived.js","names":[],"sources":["../../src/relations/hasOneDerived.ts"],"sourcesContent":["import { type Entity } from \"src/Entity.ts\";\nimport { isLoaded } from \"src/index.ts\";\nimport type { LoadHint, Loaded } from \"src/loading/loadHints.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\nimport { CustomReference } from \"src/relations/CustomReference.ts\";\nimport { type Reference } from \"src/relations/Reference.ts\";\n\n/**\n * Creates a CustomReference that can conditionally walk across references in the object graph.\n *\n * I.e. A BookReview \"has one author\" through the `review -> book -> author` relation.\n *\n * Because this is based on `CustomReference`, it will work in populates, i.e. `em.populate(review, \"author\")`.\n */\nexport function hasOneDerived<\n T extends Entity,\n U extends Entity,\n N extends never | undefined,\n V extends U | N,\n const H extends LoadHint<T>,\n>(loadHint: H, get: (entity: Loaded<T, H>) => V): Reference<T, U, N> {\n return lazyField((entity: T) => {\n return new CustomReference<T, U, N>(entity, {\n load: (entity, opts) => entity.em.populate(entity, { hint: loadHint, ...opts }),\n get: () => get(entity as Loaded<T, H>),\n isLoaded: () => isLoaded(entity, loadHint as LoadHint<T>),\n loadHint,\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAcA,SAAgB,cAMd,UAAa,KAAsD;CACnE,OAAO,WAAW,WAAc;EAC9B,OAAO,IAAI,gBAAyB,QAAQ;GAC1C,OAAO,QAAQ,SAAS,OAAO,GAAG,SAAS,QAAQ;IAAE,MAAM;IAAU,GAAG;GAAK,CAAC;GAC9E,WAAW,IAAI,MAAsB;GACrC,gBAAgB,SAAS,QAAQ,QAAuB;GACxD;EACF,CAAC;CACH,CAAC;AACH"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_newEntity = require("../newEntity.cjs");
|
|
3
2
|
const require_relations_CustomReference = require("./CustomReference.cjs");
|
|
3
|
+
const require_newEntity = require("../newEntity.cjs");
|
|
4
4
|
const require_EntityMetadata = require("../EntityMetadata.cjs");
|
|
5
|
-
const
|
|
5
|
+
const require_loading_loadLens = require("../loading/loadLens.cjs");
|
|
6
6
|
require("../index.cjs");
|
|
7
7
|
//#region src/relations/hasOneThrough.ts
|
|
8
8
|
/**
|
|
@@ -13,14 +13,14 @@ require("../index.cjs");
|
|
|
13
13
|
* Because this is based on `CustomReference`, it will work in populates, i.e. `em.populate(review, "author")`.
|
|
14
14
|
*/
|
|
15
15
|
function hasOneThrough(lens) {
|
|
16
|
-
const paths =
|
|
17
|
-
const loadHint =
|
|
16
|
+
const paths = require_loading_loadLens.lensToPath(lens);
|
|
17
|
+
const loadHint = require_loading_loadLens.lensPathToLoadHint(paths);
|
|
18
18
|
return require_newEntity.lazyField((entity) => {
|
|
19
19
|
const meta = require_EntityMetadata.getMetadata(entity);
|
|
20
20
|
return new require_relations_CustomReference.CustomReference(entity, {
|
|
21
|
-
load: (entity, opts) =>
|
|
22
|
-
get: () =>
|
|
23
|
-
isLoaded: () =>
|
|
21
|
+
load: (entity, opts) => require_loading_loadLens.loadLensPath(entity, paths, opts),
|
|
22
|
+
get: () => require_loading_loadLens.getLensPath(meta, entity, paths),
|
|
23
|
+
isLoaded: () => require_loading_loadLens.isLensLoadedPath(entity, paths),
|
|
24
24
|
loadHint
|
|
25
25
|
});
|
|
26
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasOneThrough.cjs","names":["lensToPath","lensPathToLoadHint","lazyField","getMetadata","CustomReference","loadLensPath","getLensPath","isLensLoadedPath"],"sources":["../../src/relations/hasOneThrough.ts"],"sourcesContent":["import {\n CustomReference,\n type Entity,\n type Lens,\n type Reference,\n getLensPath,\n getMetadata,\n isLensLoadedPath,\n lensPathToLoadHint,\n lensToPath,\n loadLensPath,\n} from \"
|
|
1
|
+
{"version":3,"file":"hasOneThrough.cjs","names":["lensToPath","lensPathToLoadHint","lazyField","getMetadata","CustomReference","loadLensPath","getLensPath","isLensLoadedPath"],"sources":["../../src/relations/hasOneThrough.ts"],"sourcesContent":["import {\n CustomReference,\n type Entity,\n type Lens,\n type Reference,\n getLensPath,\n getMetadata,\n isLensLoadedPath,\n lensPathToLoadHint,\n lensToPath,\n loadLensPath,\n} from \"src/index.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\n\n/**\n * Creates a CustomReference that will walk across references in the object graph.\n *\n * I.e. A BookReview \"has one author\" through the `review -> book -> author` relation.\n *\n * Because this is based on `CustomReference`, it will work in populates, i.e. `em.populate(review, \"author\")`.\n */\nexport function hasOneThrough<T extends Entity, U extends Entity, N extends never | undefined, V extends U | N>(\n lens: (lens: Lens<T>) => Lens<V>,\n): Reference<T, U, N> {\n const paths = lensToPath(lens);\n const loadHint = lensPathToLoadHint<T>(paths);\n return lazyField((entity: T) => {\n const meta = getMetadata(entity);\n return new CustomReference<T, U, N>(entity, {\n load: (entity, opts) => loadLensPath(entity, paths, opts),\n get: () => getLensPath(meta, entity, paths),\n isLoaded: () => isLensLoadedPath(entity, paths),\n loadHint,\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAqBA,SAAgB,cACd,MACoB;CACpB,MAAM,QAAQA,yBAAAA,WAAW,IAAI;CAC7B,MAAM,WAAWC,yBAAAA,mBAAsB,KAAK;CAC5C,OAAOC,kBAAAA,WAAW,WAAc;EAC9B,MAAM,OAAOC,uBAAAA,YAAY,MAAM;EAC/B,OAAO,IAAIC,kCAAAA,gBAAyB,QAAQ;GAC1C,OAAO,QAAQ,SAASC,yBAAAA,aAAa,QAAQ,OAAO,IAAI;GACxD,WAAWC,yBAAAA,YAAY,MAAM,QAAQ,KAAK;GAC1C,gBAAgBC,yBAAAA,iBAAiB,QAAQ,KAAK;GAC9C;EACF,CAAC;CACH,CAAC;AACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { lazyField } from "../newEntity.js";
|
|
2
1
|
import { CustomReference } from "./CustomReference.js";
|
|
2
|
+
import { lazyField } from "../newEntity.js";
|
|
3
3
|
import { getMetadata } from "../EntityMetadata.js";
|
|
4
|
-
import { getLensPath, isLensLoadedPath, lensPathToLoadHint, lensToPath, loadLensPath } from "../loadLens.js";
|
|
4
|
+
import { getLensPath, isLensLoadedPath, lensPathToLoadHint, lensToPath, loadLensPath } from "../loading/loadLens.js";
|
|
5
5
|
import "../index.js";
|
|
6
6
|
//#region src/relations/hasOneThrough.ts
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasOneThrough.js","names":[],"sources":["../../src/relations/hasOneThrough.ts"],"sourcesContent":["import {\n CustomReference,\n type Entity,\n type Lens,\n type Reference,\n getLensPath,\n getMetadata,\n isLensLoadedPath,\n lensPathToLoadHint,\n lensToPath,\n loadLensPath,\n} from \"
|
|
1
|
+
{"version":3,"file":"hasOneThrough.js","names":[],"sources":["../../src/relations/hasOneThrough.ts"],"sourcesContent":["import {\n CustomReference,\n type Entity,\n type Lens,\n type Reference,\n getLensPath,\n getMetadata,\n isLensLoadedPath,\n lensPathToLoadHint,\n lensToPath,\n loadLensPath,\n} from \"src/index.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\n\n/**\n * Creates a CustomReference that will walk across references in the object graph.\n *\n * I.e. A BookReview \"has one author\" through the `review -> book -> author` relation.\n *\n * Because this is based on `CustomReference`, it will work in populates, i.e. `em.populate(review, \"author\")`.\n */\nexport function hasOneThrough<T extends Entity, U extends Entity, N extends never | undefined, V extends U | N>(\n lens: (lens: Lens<T>) => Lens<V>,\n): Reference<T, U, N> {\n const paths = lensToPath(lens);\n const loadHint = lensPathToLoadHint<T>(paths);\n return lazyField((entity: T) => {\n const meta = getMetadata(entity);\n return new CustomReference<T, U, N>(entity, {\n load: (entity, opts) => loadLensPath(entity, paths, opts),\n get: () => getLensPath(meta, entity, paths),\n isLoaded: () => isLensLoadedPath(entity, paths),\n loadHint,\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,SAAgB,cACd,MACoB;CACpB,MAAM,QAAQ,WAAW,IAAI;CAC7B,MAAM,WAAW,mBAAsB,KAAK;CAC5C,OAAO,WAAW,WAAc;EAC9B,MAAM,OAAO,YAAY,MAAM;EAC/B,OAAO,IAAI,gBAAyB,QAAQ;GAC1C,OAAO,QAAQ,SAAS,aAAa,QAAQ,OAAO,IAAI;GACxD,WAAW,YAAY,MAAM,QAAQ,KAAK;GAC1C,gBAAgB,iBAAiB,QAAQ,KAAK;GAC9C;EACF,CAAC;CACH,CAAC;AACH"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_relations_PropertySymbols = require("./PropertySymbols.cjs");
|
|
3
3
|
const require_relations_RecursiveCycleError = require("./RecursiveCycleError.cjs");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const require_reactivity_reactiveHints = require("../reactivity/reactiveHints.cjs");
|
|
5
|
+
const require_loading_loadHints = require("../loading/loadHints.cjs");
|
|
6
6
|
const require_utils = require("../utils.cjs");
|
|
7
7
|
const require_newEntity = require("../newEntity.cjs");
|
|
8
8
|
const require_EntityMetadata = require("../EntityMetadata.cjs");
|
|
@@ -64,7 +64,7 @@ var PropertyImpl = class {
|
|
|
64
64
|
return require_utils.tryResolve(() => this.get);
|
|
65
65
|
}
|
|
66
66
|
get loadHint() {
|
|
67
|
-
if (!this.#hint) this.#hint =
|
|
67
|
+
if (!this.#hint) this.#hint = require_reactivity_reactiveHints.convertToLoadHint(require_EntityMetadata.getMetadata(this.#entity), this.#reactiveHint);
|
|
68
68
|
return this.#hint;
|
|
69
69
|
}
|
|
70
70
|
get reactiveHint() {
|
|
@@ -83,7 +83,7 @@ var PropertyImpl = class {
|
|
|
83
83
|
}, [this.#entity]);
|
|
84
84
|
}
|
|
85
85
|
this.#isCheckingLoaded = true;
|
|
86
|
-
this.#loaded =
|
|
86
|
+
this.#loaded = require_loading_loadHints.isLoaded(this.#entity, this.loadHint);
|
|
87
87
|
this.#isCheckingLoaded = false;
|
|
88
88
|
}
|
|
89
89
|
return !!this.#loaded;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasProperty.cjs","names":["lazyField","#entity","#hint","#reactiveHint","#loadPromise","#loaded","tryResolve","convertToLoadHint","getMetadata","#isCheckingLoaded","RecursiveCycleError","isLoaded","PropertyT"],"sources":["../../src/relations/hasProperty.ts"],"sourcesContent":["import { type Entity } from \"
|
|
1
|
+
{"version":3,"file":"hasProperty.cjs","names":["lazyField","#entity","#hint","#reactiveHint","#loadPromise","#loaded","tryResolve","convertToLoadHint","getMetadata","#isCheckingLoaded","RecursiveCycleError","isLoaded","PropertyT"],"sources":["../../src/relations/hasProperty.ts"],"sourcesContent":["import { type Entity } from \"src/Entity.ts\";\nimport { getMetadata } from \"src/EntityMetadata.ts\";\nimport { type LoadHint, type Loaded, isLoaded } from \"src/loading/loadHints.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\nimport {\n type MaybeReactedPropertyEntity,\n type Reacted,\n type ReactiveHint,\n convertToLoadHint,\n} from \"src/reactivity/reactiveHints.ts\";\nimport { PropertyT } from \"src/relations/PropertySymbols.ts\";\nimport { RecursiveCycleError } from \"src/relations/RecursiveCycleError.ts\";\nimport { tryResolve } from \"src/utils.ts\";\n\nexport { PropertyT };\n\nexport interface Property<T extends Entity, V> {\n // Differentiate from AsyncMethod\n [PropertyT]: T;\n isLoaded: boolean;\n load(): Promise<V>;\n}\n\nexport interface LoadedProperty<T extends Entity, V> {\n get: V;\n}\n\n/**\n * Creates a calculated derived value from a load hint + lambda.\n *\n * The property can be accessed by default as a promise, with `someProperty.load()`.\n *\n * But if `someProperty` is used as a populate hint, then it can be accessed synchronously,\n * with `someProperty.get`.\n */\nexport function hasProperty<T extends Entity, const H extends LoadHint<T>, V>(\n loadHint: H,\n fn: (entity: Loaded<T, H>) => V,\n): Property<T, V> {\n return lazyField((entity: T, fieldName) => {\n return new PropertyImpl(entity, fieldName, loadHint, fn);\n });\n}\n\n/**\n * Creates a calculated derived value from a load hint + lambda.\n *\n * The property can be accessed by default as a promise, with `someProperty.load()`.\n *\n * But if `someProperty` is used as a populate hint, then it can be accessed synchronously,\n * with `someProperty.get`.\n */\nexport function hasReactiveProperty<T extends Entity, const H extends ReactiveHint<T>, V>(\n reactiveHint: H,\n fn: (entity: Reacted<T, H>) => MaybeReactedPropertyEntity<V>,\n): Property<T, V> {\n return lazyField((entity: T, fieldName) => {\n return new PropertyImpl(entity, fieldName, reactiveHint as any, fn as any, { isReactive: true });\n });\n}\n\nexport class PropertyImpl<T extends Entity, H extends LoadHint<T>, V> implements Property<T, V> {\n // We'll probe for loaded if undefined\n #loaded: boolean | undefined = undefined;\n #isCheckingLoaded = false;\n #loadPromise: any;\n\n readonly #entity: T;\n #hint: H | undefined;\n #reactiveHint: ReactiveHint<T> | undefined;\n constructor(\n entity: T,\n private fieldName: string,\n hint: H | ReactiveHint<T>,\n private fn: (entity: Loaded<T, H>) => V,\n private opts: { isReactive?: boolean } = {},\n ) {\n const { isReactive = false } = opts;\n this.#entity = entity;\n this.#hint = isReactive ? undefined : (hint as H);\n this.#reactiveHint = isReactive ? (hint as ReactiveHint<T>) : undefined;\n }\n\n load(): Promise<V> {\n if (!this.isLoaded) {\n const { loadHint, fn } = this;\n return (this.#loadPromise ??= this.#entity.em.populate(this.#entity, loadHint).then((loaded) => {\n this.#loaded = true;\n return fn(loaded);\n }));\n }\n return tryResolve(() => this.get);\n }\n\n get loadHint(): H {\n if (!this.#hint) {\n // Would be nice to statically (but lazily?) cache this...\n this.#hint = convertToLoadHint(getMetadata(this.#entity), this.#reactiveHint as any) as H;\n }\n return this.#hint;\n }\n\n get reactiveHint(): ReactiveHint<T> | undefined {\n return this.#reactiveHint;\n }\n\n get get(): V {\n return this.fn(this.#entity as Loaded<T, H>);\n }\n\n get isLoaded() {\n // Probe the first time, which is useful for factories that are DeepNew\n if (this.#loaded === undefined) {\n if (this.#isCheckingLoaded) {\n this.#isCheckingLoaded = false;\n throw new RecursiveCycleError({ entity: this.#entity, fieldName: this.fieldName }, [this.#entity]);\n }\n this.#isCheckingLoaded = true;\n this.#loaded = isLoaded(this.#entity, this.loadHint);\n this.#isCheckingLoaded = false;\n }\n return !!this.#loaded;\n }\n\n [PropertyT] = undefined as any as T;\n}\n\n/** Type guard utility for determining if an entity field is a Property. */\nexport function isProperty(maybeProperty: any): maybeProperty is Property<any, any> {\n return maybeProperty instanceof PropertyImpl;\n}\n\n/** Type guard utility for determining if an entity field is a loaded Property. */\nexport function isLoadedProperty(maybeProperty: any): maybeProperty is Property<any, any> & LoadedProperty<any, any> {\n return isProperty(maybeProperty) && maybeProperty.isLoaded;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,SAAgB,YACd,UACA,IACgB;CAChB,OAAOA,kBAAAA,WAAW,QAAW,cAAc;EACzC,OAAO,IAAI,aAAa,QAAQ,WAAW,UAAU,EAAE;CACzD,CAAC;AACH;;;;;;;;;AAUA,SAAgB,oBACd,cACA,IACgB;CAChB,OAAOA,kBAAAA,WAAW,QAAW,cAAc;EACzC,OAAO,IAAI,aAAa,QAAQ,WAAW,cAAqB,IAAW,EAAE,YAAY,KAAK,CAAC;CACjG,CAAC;AACH;AAEA,IAAa,eAAb,MAAgG;CAWpF;CAEA;CACA;CAZV,UAA+B,KAAA;CAC/B,oBAAoB;CACpB;CAEA;CACA;CACA;CACA,YACE,QACA,WACA,MACA,IACA,OAAyC,CAAC,GAC1C;EAJQ,KAAA,YAAA;EAEA,KAAA,KAAA;EACA,KAAA,OAAA;EAER,MAAM,EAAE,aAAa,UAAU;EAC/B,KAAKC,UAAU;EACf,KAAKC,QAAQ,aAAa,KAAA,IAAa;EACvC,KAAKC,gBAAgB,aAAc,OAA2B,KAAA;CAChE;CAEA,OAAmB;EACjB,IAAI,CAAC,KAAK,UAAU;GAClB,MAAM,EAAE,UAAU,OAAO;GACzB,OAAQ,KAAKC,iBAAiB,KAAKH,QAAQ,GAAG,SAAS,KAAKA,SAAS,QAAQ,CAAC,CAAC,MAAM,WAAW;IAC9F,KAAKI,UAAU;IACf,OAAO,GAAG,MAAM;GAClB,CAAC;EACH;EACA,OAAOC,cAAAA,iBAAiB,KAAK,GAAG;CAClC;CAEA,IAAI,WAAc;EAChB,IAAI,CAAC,KAAKJ,OAER,KAAKA,QAAQK,iCAAAA,kBAAkBC,uBAAAA,YAAY,KAAKP,OAAO,GAAG,KAAKE,aAAoB;EAErF,OAAO,KAAKD;CACd;CAEA,IAAI,eAA4C;EAC9C,OAAO,KAAKC;CACd;CAEA,IAAI,MAAS;EACX,OAAO,KAAK,GAAG,KAAKF,OAAuB;CAC7C;CAEA,IAAI,WAAW;EAEb,IAAI,KAAKI,YAAY,KAAA,GAAW;GAC9B,IAAI,KAAKI,mBAAmB;IAC1B,KAAKA,oBAAoB;IACzB,MAAM,IAAIC,sCAAAA,oBAAoB;KAAE,QAAQ,KAAKT;KAAS,WAAW,KAAK;IAAU,GAAG,CAAC,KAAKA,OAAO,CAAC;GACnG;GACA,KAAKQ,oBAAoB;GACzB,KAAKJ,UAAUM,0BAAAA,SAAS,KAAKV,SAAS,KAAK,QAAQ;GACnD,KAAKQ,oBAAoB;EAC3B;EACA,OAAO,CAAC,CAAC,KAAKJ;CAChB;CAEA,CAACO,kCAAAA,aAAa,KAAA;AAChB;;AAGA,SAAgB,WAAW,eAAyD;CAClF,OAAO,yBAAyB;AAClC;;AAGA,SAAgB,iBAAiB,eAAoF;CACnH,OAAO,WAAW,aAAa,KAAK,cAAc;AACpD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropertyT } from "./PropertySymbols.cjs";
|
|
2
|
-
import { LoadHint, Loaded } from "../loadHints.cjs";
|
|
3
|
-
import { MaybeReactedPropertyEntity, Reacted, ReactiveHint } from "../reactiveHints.cjs";
|
|
2
|
+
import { LoadHint, Loaded } from "../loading/loadHints.cjs";
|
|
3
|
+
import { MaybeReactedPropertyEntity, Reacted, ReactiveHint } from "../reactivity/reactiveHints.cjs";
|
|
4
4
|
import { Entity } from "../Entity.cjs";
|
|
5
5
|
//#region src/relations/hasProperty.d.ts
|
|
6
6
|
interface Property<T extends Entity, V> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropertyT } from "./PropertySymbols.mjs";
|
|
2
|
-
import { LoadHint, Loaded } from "../loadHints.mjs";
|
|
3
|
-
import { MaybeReactedPropertyEntity, Reacted, ReactiveHint } from "../reactiveHints.mjs";
|
|
2
|
+
import { LoadHint, Loaded } from "../loading/loadHints.mjs";
|
|
3
|
+
import { MaybeReactedPropertyEntity, Reacted, ReactiveHint } from "../reactivity/reactiveHints.mjs";
|
|
4
4
|
import { Entity } from "../Entity.mjs";
|
|
5
5
|
//#region src/relations/hasProperty.d.ts
|
|
6
6
|
interface Property<T extends Entity, V> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropertyT } from "./PropertySymbols.js";
|
|
2
2
|
import { RecursiveCycleError } from "./RecursiveCycleError.js";
|
|
3
|
-
import { convertToLoadHint } from "../reactiveHints.js";
|
|
4
|
-
import { isLoaded } from "../loadHints.js";
|
|
3
|
+
import { convertToLoadHint } from "../reactivity/reactiveHints.js";
|
|
4
|
+
import { isLoaded } from "../loading/loadHints.js";
|
|
5
5
|
import { tryResolve } from "../utils.js";
|
|
6
6
|
import { lazyField } from "../newEntity.js";
|
|
7
7
|
import { getMetadata } from "../EntityMetadata.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasProperty.js","names":["#entity","#hint","#reactiveHint","#loadPromise","#loaded","#isCheckingLoaded"],"sources":["../../src/relations/hasProperty.ts"],"sourcesContent":["import { type Entity } from \"
|
|
1
|
+
{"version":3,"file":"hasProperty.js","names":["#entity","#hint","#reactiveHint","#loadPromise","#loaded","#isCheckingLoaded"],"sources":["../../src/relations/hasProperty.ts"],"sourcesContent":["import { type Entity } from \"src/Entity.ts\";\nimport { getMetadata } from \"src/EntityMetadata.ts\";\nimport { type LoadHint, type Loaded, isLoaded } from \"src/loading/loadHints.ts\";\nimport { lazyField } from \"src/newEntity.ts\";\nimport {\n type MaybeReactedPropertyEntity,\n type Reacted,\n type ReactiveHint,\n convertToLoadHint,\n} from \"src/reactivity/reactiveHints.ts\";\nimport { PropertyT } from \"src/relations/PropertySymbols.ts\";\nimport { RecursiveCycleError } from \"src/relations/RecursiveCycleError.ts\";\nimport { tryResolve } from \"src/utils.ts\";\n\nexport { PropertyT };\n\nexport interface Property<T extends Entity, V> {\n // Differentiate from AsyncMethod\n [PropertyT]: T;\n isLoaded: boolean;\n load(): Promise<V>;\n}\n\nexport interface LoadedProperty<T extends Entity, V> {\n get: V;\n}\n\n/**\n * Creates a calculated derived value from a load hint + lambda.\n *\n * The property can be accessed by default as a promise, with `someProperty.load()`.\n *\n * But if `someProperty` is used as a populate hint, then it can be accessed synchronously,\n * with `someProperty.get`.\n */\nexport function hasProperty<T extends Entity, const H extends LoadHint<T>, V>(\n loadHint: H,\n fn: (entity: Loaded<T, H>) => V,\n): Property<T, V> {\n return lazyField((entity: T, fieldName) => {\n return new PropertyImpl(entity, fieldName, loadHint, fn);\n });\n}\n\n/**\n * Creates a calculated derived value from a load hint + lambda.\n *\n * The property can be accessed by default as a promise, with `someProperty.load()`.\n *\n * But if `someProperty` is used as a populate hint, then it can be accessed synchronously,\n * with `someProperty.get`.\n */\nexport function hasReactiveProperty<T extends Entity, const H extends ReactiveHint<T>, V>(\n reactiveHint: H,\n fn: (entity: Reacted<T, H>) => MaybeReactedPropertyEntity<V>,\n): Property<T, V> {\n return lazyField((entity: T, fieldName) => {\n return new PropertyImpl(entity, fieldName, reactiveHint as any, fn as any, { isReactive: true });\n });\n}\n\nexport class PropertyImpl<T extends Entity, H extends LoadHint<T>, V> implements Property<T, V> {\n // We'll probe for loaded if undefined\n #loaded: boolean | undefined = undefined;\n #isCheckingLoaded = false;\n #loadPromise: any;\n\n readonly #entity: T;\n #hint: H | undefined;\n #reactiveHint: ReactiveHint<T> | undefined;\n constructor(\n entity: T,\n private fieldName: string,\n hint: H | ReactiveHint<T>,\n private fn: (entity: Loaded<T, H>) => V,\n private opts: { isReactive?: boolean } = {},\n ) {\n const { isReactive = false } = opts;\n this.#entity = entity;\n this.#hint = isReactive ? undefined : (hint as H);\n this.#reactiveHint = isReactive ? (hint as ReactiveHint<T>) : undefined;\n }\n\n load(): Promise<V> {\n if (!this.isLoaded) {\n const { loadHint, fn } = this;\n return (this.#loadPromise ??= this.#entity.em.populate(this.#entity, loadHint).then((loaded) => {\n this.#loaded = true;\n return fn(loaded);\n }));\n }\n return tryResolve(() => this.get);\n }\n\n get loadHint(): H {\n if (!this.#hint) {\n // Would be nice to statically (but lazily?) cache this...\n this.#hint = convertToLoadHint(getMetadata(this.#entity), this.#reactiveHint as any) as H;\n }\n return this.#hint;\n }\n\n get reactiveHint(): ReactiveHint<T> | undefined {\n return this.#reactiveHint;\n }\n\n get get(): V {\n return this.fn(this.#entity as Loaded<T, H>);\n }\n\n get isLoaded() {\n // Probe the first time, which is useful for factories that are DeepNew\n if (this.#loaded === undefined) {\n if (this.#isCheckingLoaded) {\n this.#isCheckingLoaded = false;\n throw new RecursiveCycleError({ entity: this.#entity, fieldName: this.fieldName }, [this.#entity]);\n }\n this.#isCheckingLoaded = true;\n this.#loaded = isLoaded(this.#entity, this.loadHint);\n this.#isCheckingLoaded = false;\n }\n return !!this.#loaded;\n }\n\n [PropertyT] = undefined as any as T;\n}\n\n/** Type guard utility for determining if an entity field is a Property. */\nexport function isProperty(maybeProperty: any): maybeProperty is Property<any, any> {\n return maybeProperty instanceof PropertyImpl;\n}\n\n/** Type guard utility for determining if an entity field is a loaded Property. */\nexport function isLoadedProperty(maybeProperty: any): maybeProperty is Property<any, any> & LoadedProperty<any, any> {\n return isProperty(maybeProperty) && maybeProperty.isLoaded;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,SAAgB,YACd,UACA,IACgB;CAChB,OAAO,WAAW,QAAW,cAAc;EACzC,OAAO,IAAI,aAAa,QAAQ,WAAW,UAAU,EAAE;CACzD,CAAC;AACH;;;;;;;;;AAUA,SAAgB,oBACd,cACA,IACgB;CAChB,OAAO,WAAW,QAAW,cAAc;EACzC,OAAO,IAAI,aAAa,QAAQ,WAAW,cAAqB,IAAW,EAAE,YAAY,KAAK,CAAC;CACjG,CAAC;AACH;AAEA,IAAa,eAAb,MAAgG;CAWpF;CAEA;CACA;CAZV,UAA+B,KAAA;CAC/B,oBAAoB;CACpB;CAEA;CACA;CACA;CACA,YACE,QACA,WACA,MACA,IACA,OAAyC,CAAC,GAC1C;EAJQ,KAAA,YAAA;EAEA,KAAA,KAAA;EACA,KAAA,OAAA;EAER,MAAM,EAAE,aAAa,UAAU;EAC/B,KAAKA,UAAU;EACf,KAAKC,QAAQ,aAAa,KAAA,IAAa;EACvC,KAAKC,gBAAgB,aAAc,OAA2B,KAAA;CAChE;CAEA,OAAmB;EACjB,IAAI,CAAC,KAAK,UAAU;GAClB,MAAM,EAAE,UAAU,OAAO;GACzB,OAAQ,KAAKC,iBAAiB,KAAKH,QAAQ,GAAG,SAAS,KAAKA,SAAS,QAAQ,CAAC,CAAC,MAAM,WAAW;IAC9F,KAAKI,UAAU;IACf,OAAO,GAAG,MAAM;GAClB,CAAC;EACH;EACA,OAAO,iBAAiB,KAAK,GAAG;CAClC;CAEA,IAAI,WAAc;EAChB,IAAI,CAAC,KAAKH,OAER,KAAKA,QAAQ,kBAAkB,YAAY,KAAKD,OAAO,GAAG,KAAKE,aAAoB;EAErF,OAAO,KAAKD;CACd;CAEA,IAAI,eAA4C;EAC9C,OAAO,KAAKC;CACd;CAEA,IAAI,MAAS;EACX,OAAO,KAAK,GAAG,KAAKF,OAAuB;CAC7C;CAEA,IAAI,WAAW;EAEb,IAAI,KAAKI,YAAY,KAAA,GAAW;GAC9B,IAAI,KAAKC,mBAAmB;IAC1B,KAAKA,oBAAoB;IACzB,MAAM,IAAI,oBAAoB;KAAE,QAAQ,KAAKL;KAAS,WAAW,KAAK;IAAU,GAAG,CAAC,KAAKA,OAAO,CAAC;GACnG;GACA,KAAKK,oBAAoB;GACzB,KAAKD,UAAU,SAAS,KAAKJ,SAAS,KAAK,QAAQ;GACnD,KAAKK,oBAAoB;EAC3B;EACA,OAAO,CAAC,CAAC,KAAKD;CAChB;CAEA,CAAC,aAAa,KAAA;AAChB;;AAGA,SAAgB,WAAW,eAAyD;CAClF,OAAO,yBAAyB;AAClC;;AAGA,SAAgB,iBAAiB,eAAoF;CACnH,OAAO,WAAW,aAAa,KAAK,cAAc;AACpD"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_relations_Collection = require("./Collection.cjs");
|
|
3
|
+
const require_relations_CustomCollection = require("./CustomCollection.cjs");
|
|
3
4
|
const require_relations_EnumCollection = require("./EnumCollection.cjs");
|
|
4
|
-
const
|
|
5
|
-
const require_relations_hasProperty = require("./hasProperty.cjs");
|
|
6
|
-
const require_relations_LazyField = require("./LazyField.cjs");
|
|
7
|
-
const require_relations_OneToManyCollection = require("./OneToManyCollection.cjs");
|
|
8
|
-
const require_relations_ManyToOneReference = require("./ManyToOneReference.cjs");
|
|
9
|
-
const require_relations_Reference = require("./Reference.cjs");
|
|
10
|
-
const require_relations_ReactiveReference = require("./ReactiveReference.cjs");
|
|
11
|
-
const require_relations_OneToOneReference = require("./OneToOneReference.cjs");
|
|
5
|
+
const require_relations_CustomReference = require("./CustomReference.cjs");
|
|
12
6
|
const require_relations_ReactiveGetter = require("./ReactiveGetter.cjs");
|
|
13
7
|
const require_relations_Relation = require("./Relation.cjs");
|
|
14
8
|
const require_relations_ReadOnlyCollection = require("./ReadOnlyCollection.cjs");
|
|
9
|
+
const require_relations_RecursiveCycleError = require("./RecursiveCycleError.cjs");
|
|
15
10
|
const require_relations_RecursiveCollection = require("./RecursiveCollection.cjs");
|
|
16
|
-
const require_relations_CustomCollection = require("./CustomCollection.cjs");
|
|
17
|
-
const require_relations_CustomReference = require("./CustomReference.cjs");
|
|
18
11
|
const require_relations_hasAsyncMethod = require("./hasAsyncMethod.cjs");
|
|
12
|
+
const require_relations_hasProperty = require("./hasProperty.cjs");
|
|
19
13
|
const require_relations_AsyncProperty = require("./AsyncProperty.cjs");
|
|
14
|
+
const require_relations_LazyField = require("./LazyField.cjs");
|
|
20
15
|
const require_relations_hasManyDerived = require("./hasManyDerived.cjs");
|
|
21
16
|
const require_relations_hasManyThrough = require("./hasManyThrough.cjs");
|
|
17
|
+
const require_relations_Reference = require("./Reference.cjs");
|
|
22
18
|
const require_relations_hasOneDerived = require("./hasOneDerived.cjs");
|
|
23
19
|
const require_relations_hasOneThrough = require("./hasOneThrough.cjs");
|
|
24
20
|
const require_relations_ManyToManyCollection = require("./ManyToManyCollection.cjs");
|
|
25
21
|
const require_relations_ManyToManyLargeCollection = require("./ManyToManyLargeCollection.cjs");
|
|
22
|
+
const require_relations_OneToManyCollection = require("./OneToManyCollection.cjs");
|
|
23
|
+
const require_relations_ManyToOneReference = require("./ManyToOneReference.cjs");
|
|
26
24
|
const require_relations_OneToManyLargeCollection = require("./OneToManyLargeCollection.cjs");
|
|
25
|
+
const require_relations_ReactiveReference = require("./ReactiveReference.cjs");
|
|
26
|
+
const require_relations_OneToOneReference = require("./OneToOneReference.cjs");
|
|
27
27
|
const require_relations_PolymorphicReference = require("./PolymorphicReference.cjs");
|
|
28
28
|
const require_relations_ReactiveField = require("./ReactiveField.cjs");
|
|
29
29
|
const require_relations_ReactiveManyToMany = require("./ReactiveManyToMany.cjs");
|