joist-core 2.3.0-next.7 → 2.3.0-next.71
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/AliasAssigner.cjs +36 -0
- package/build/AliasAssigner.cjs.map +1 -0
- package/build/AliasAssigner.d.cts +13 -0
- package/build/AliasAssigner.d.cts.map +1 -0
- package/build/AliasAssigner.d.mts +13 -0
- package/build/AliasAssigner.d.mts.map +1 -0
- package/build/AliasAssigner.js +34 -38
- package/build/AliasAssigner.js.map +1 -1
- package/build/Aliases.cjs +293 -0
- package/build/Aliases.cjs.map +1 -0
- package/build/Aliases.d.cts +115 -0
- package/build/Aliases.d.cts.map +1 -0
- package/build/Aliases.d.mts +115 -0
- package/build/Aliases.d.mts.map +1 -0
- package/build/Aliases.js +270 -442
- package/build/Aliases.js.map +1 -1
- package/build/BaseEntity.cjs +112 -0
- package/build/BaseEntity.cjs.map +1 -0
- package/build/BaseEntity.d.cts +73 -0
- package/build/BaseEntity.d.cts.map +1 -0
- package/build/BaseEntity.d.mts +73 -0
- package/build/BaseEntity.d.mts.map +1 -0
- package/build/BaseEntity.js +99 -110
- package/build/BaseEntity.js.map +1 -1
- package/build/ConditionBuilder.cjs +107 -0
- package/build/ConditionBuilder.cjs.map +1 -0
- package/build/ConditionBuilder.d.cts +31 -0
- package/build/ConditionBuilder.d.cts.map +1 -0
- package/build/ConditionBuilder.d.mts +31 -0
- package/build/ConditionBuilder.d.mts.map +1 -0
- package/build/ConditionBuilder.js +101 -107
- package/build/ConditionBuilder.js.map +1 -1
- package/build/DeferredAlias.cjs +26 -0
- package/build/DeferredAlias.cjs.map +1 -0
- package/build/DeferredAlias.d.cts +23 -0
- package/build/DeferredAlias.d.cts.map +1 -0
- package/build/DeferredAlias.d.mts +23 -0
- package/build/DeferredAlias.d.mts.map +1 -0
- package/build/DeferredAlias.js +23 -0
- package/build/DeferredAlias.js.map +1 -0
- package/build/Entity.cjs +12 -0
- package/build/Entity.cjs.map +1 -0
- package/build/Entity.d.cts +42 -0
- package/build/Entity.d.cts.map +1 -0
- package/build/Entity.d.mts +42 -0
- package/build/Entity.d.mts.map +1 -0
- package/build/Entity.js +8 -5
- package/build/Entity.js.map +1 -1
- package/build/EntityFields.cjs +1 -0
- package/build/EntityFields.d.cts +36 -0
- package/build/EntityFields.d.cts.map +1 -0
- package/build/EntityFields.d.mts +36 -0
- package/build/EntityFields.d.mts.map +1 -0
- package/build/EntityFields.js +1 -3
- package/build/EntityFilter.cjs +32 -0
- package/build/EntityFilter.cjs.map +1 -0
- package/build/EntityFilter.d.cts +135 -0
- package/build/EntityFilter.d.cts.map +1 -0
- package/build/EntityFilter.d.mts +135 -0
- package/build/EntityFilter.d.mts.map +1 -0
- package/build/EntityFilter.js +27 -17
- package/build/EntityFilter.js.map +1 -1
- package/build/EntityGraphQLFilter.cjs +56 -0
- package/build/EntityGraphQLFilter.cjs.map +1 -0
- package/build/EntityGraphQLFilter.d.cts +59 -0
- package/build/EntityGraphQLFilter.d.cts.map +1 -0
- package/build/EntityGraphQLFilter.d.mts +59 -0
- package/build/EntityGraphQLFilter.d.mts.map +1 -0
- package/build/EntityGraphQLFilter.js +51 -50
- package/build/EntityGraphQLFilter.js.map +1 -1
- package/build/EntityManager.cjs +1939 -0
- package/build/EntityManager.cjs.map +1 -0
- package/build/EntityManager.d.cts +834 -0
- package/build/EntityManager.d.cts.map +1 -0
- package/build/EntityManager.d.mts +834 -0
- package/build/EntityManager.d.mts.map +1 -0
- package/build/EntityManager.js +1816 -2223
- package/build/EntityManager.js.map +1 -1
- package/build/EntityMetadata.cjs +77 -0
- package/build/EntityMetadata.cjs.map +1 -0
- package/build/EntityMetadata.d.cts +262 -0
- package/build/EntityMetadata.d.cts.map +1 -0
- package/build/EntityMetadata.d.mts +262 -0
- package/build/EntityMetadata.d.mts.map +1 -0
- package/build/EntityMetadata.js +33 -48
- package/build/EntityMetadata.js.map +1 -1
- package/build/EnumMetadata.cjs +1 -0
- package/build/EnumMetadata.d.cts +18 -0
- package/build/EnumMetadata.d.cts.map +1 -0
- package/build/EnumMetadata.d.mts +18 -0
- package/build/EnumMetadata.d.mts.map +1 -0
- package/build/EnumMetadata.js +1 -3
- package/build/Expr.cjs +474 -0
- package/build/Expr.cjs.map +1 -0
- package/build/Expr.d.cts +258 -0
- package/build/Expr.d.cts.map +1 -0
- package/build/Expr.d.mts +258 -0
- package/build/Expr.d.mts.map +1 -0
- package/build/Expr.js +459 -0
- package/build/Expr.js.map +1 -0
- package/build/FlushLock.cjs +51 -0
- package/build/FlushLock.cjs.map +1 -0
- package/build/FlushLock.d.cts +29 -0
- package/build/FlushLock.d.cts.map +1 -0
- package/build/FlushLock.d.mts +29 -0
- package/build/FlushLock.d.mts.map +1 -0
- package/build/FlushLock.js +48 -54
- package/build/FlushLock.js.map +1 -1
- package/build/HintTree.cjs +70 -0
- package/build/HintTree.cjs.map +1 -0
- package/build/HintTree.d.cts +45 -0
- package/build/HintTree.d.cts.map +1 -0
- package/build/HintTree.d.mts +45 -0
- package/build/HintTree.d.mts.map +1 -0
- package/build/HintTree.js +63 -58
- package/build/HintTree.js.map +1 -1
- package/build/IndexManager.cjs +176 -0
- package/build/IndexManager.cjs.map +1 -0
- package/build/IndexManager.d.cts +36 -0
- package/build/IndexManager.d.cts.map +1 -0
- package/build/IndexManager.d.mts +36 -0
- package/build/IndexManager.d.mts.map +1 -0
- package/build/IndexManager.js +167 -218
- package/build/IndexManager.js.map +1 -1
- package/build/InstanceData.cjs +218 -0
- package/build/InstanceData.cjs.map +1 -0
- package/build/InstanceData.d.cts +98 -0
- package/build/InstanceData.d.cts.map +1 -0
- package/build/InstanceData.d.mts +98 -0
- package/build/InstanceData.d.mts.map +1 -0
- package/build/InstanceData.js +215 -222
- package/build/InstanceData.js.map +1 -1
- package/build/IsLoadedCache.cjs +59 -0
- package/build/IsLoadedCache.cjs.map +1 -0
- package/build/IsLoadedCache.d.cts +35 -0
- package/build/IsLoadedCache.d.cts.map +1 -0
- package/build/IsLoadedCache.d.mts +35 -0
- package/build/IsLoadedCache.d.mts.map +1 -0
- package/build/IsLoadedCache.js +57 -90
- package/build/IsLoadedCache.js.map +1 -1
- package/build/JoinRows.cjs +266 -0
- package/build/JoinRows.cjs.map +1 -0
- package/build/JoinRows.d.cts +120 -0
- package/build/JoinRows.d.cts.map +1 -0
- package/build/JoinRows.d.mts +120 -0
- package/build/JoinRows.d.mts.map +1 -0
- package/build/JoinRows.js +257 -313
- package/build/JoinRows.js.map +1 -1
- package/build/PendingChanges.cjs +2 -0
- package/build/PendingChanges.d.cts +29 -0
- package/build/PendingChanges.d.cts.map +1 -0
- package/build/PendingChanges.d.mts +29 -0
- package/build/PendingChanges.d.mts.map +1 -0
- package/build/PendingChanges.js +2 -3
- package/build/PluginManager.cjs +91 -0
- package/build/PluginManager.cjs.map +1 -0
- package/build/PluginManager.d.cts +112 -0
- package/build/PluginManager.d.cts.map +1 -0
- package/build/PluginManager.d.mts +112 -0
- package/build/PluginManager.d.mts.map +1 -0
- package/build/PluginManager.js +82 -106
- package/build/PluginManager.js.map +1 -1
- package/build/QueryParser.cjs +828 -0
- package/build/QueryParser.cjs.map +1 -0
- package/build/QueryParser.collectionJoins.cjs +353 -0
- package/build/QueryParser.collectionJoins.cjs.map +1 -0
- package/build/QueryParser.collectionJoins.d.cts +30 -0
- package/build/QueryParser.collectionJoins.d.cts.map +1 -0
- package/build/QueryParser.collectionJoins.d.mts +30 -0
- package/build/QueryParser.collectionJoins.d.mts.map +1 -0
- package/build/QueryParser.collectionJoins.js +258 -372
- package/build/QueryParser.collectionJoins.js.map +1 -1
- package/build/QueryParser.d.cts +346 -0
- package/build/QueryParser.d.cts.map +1 -0
- package/build/QueryParser.d.mts +346 -0
- package/build/QueryParser.d.mts.map +1 -0
- package/build/QueryParser.js +763 -915
- package/build/QueryParser.js.map +1 -1
- package/build/QueryParser.pruning.cjs +129 -0
- package/build/QueryParser.pruning.cjs.map +1 -0
- package/build/QueryParser.pruning.d.cts +10 -0
- package/build/QueryParser.pruning.d.cts.map +1 -0
- package/build/QueryParser.pruning.d.mts +10 -0
- package/build/QueryParser.pruning.d.mts.map +1 -0
- package/build/QueryParser.pruning.js +104 -173
- package/build/QueryParser.pruning.js.map +1 -1
- package/build/QueryVisitor.cjs +61 -0
- package/build/QueryVisitor.cjs.map +1 -0
- package/build/QueryVisitor.d.cts +21 -0
- package/build/QueryVisitor.d.cts.map +1 -0
- package/build/QueryVisitor.d.mts +21 -0
- package/build/QueryVisitor.d.mts.map +1 -0
- package/build/QueryVisitor.js +50 -97
- package/build/QueryVisitor.js.map +1 -1
- package/build/ReactionsManager.cjs +266 -0
- package/build/ReactionsManager.cjs.map +1 -0
- package/build/ReactionsManager.d.cts +99 -0
- package/build/ReactionsManager.d.cts.map +1 -0
- package/build/ReactionsManager.d.mts +99 -0
- package/build/ReactionsManager.d.mts.map +1 -0
- package/build/ReactionsManager.js +263 -313
- package/build/ReactionsManager.js.map +1 -1
- package/build/RowData.cjs +37 -0
- package/build/RowData.cjs.map +1 -0
- package/build/RowData.d.cts +53 -0
- package/build/RowData.d.cts.map +1 -0
- package/build/RowData.d.mts +53 -0
- package/build/RowData.d.mts.map +1 -0
- package/build/RowData.js +35 -0
- package/build/RowData.js.map +1 -0
- package/build/Tables.cjs +630 -0
- package/build/Tables.cjs.map +1 -0
- package/build/Tables.d.cts +231 -0
- package/build/Tables.d.cts.map +1 -0
- package/build/Tables.d.mts +231 -0
- package/build/Tables.d.mts.map +1 -0
- package/build/Tables.js +620 -0
- package/build/Tables.js.map +1 -0
- package/build/Todo.cjs +73 -0
- package/build/Todo.cjs.map +1 -0
- package/build/Todo.d.cts +38 -0
- package/build/Todo.d.cts.map +1 -0
- package/build/Todo.d.mts +38 -0
- package/build/Todo.d.mts.map +1 -0
- package/build/Todo.js +57 -61
- package/build/Todo.js.map +1 -1
- package/build/TypeInfo.cjs +80 -0
- package/build/TypeInfo.cjs.map +1 -0
- package/build/TypeInfo.d.cts +57 -0
- package/build/TypeInfo.d.cts.map +1 -0
- package/build/TypeInfo.d.mts +57 -0
- package/build/TypeInfo.d.mts.map +1 -0
- package/build/TypeInfo.js +78 -0
- package/build/TypeInfo.js.map +1 -0
- package/build/_virtual/_rolldown/runtime.cjs +23 -0
- package/build/batchloaders/BatchLoader.cjs +49 -0
- package/build/batchloaders/BatchLoader.cjs.map +1 -0
- package/build/batchloaders/BatchLoader.d.cts +17 -0
- package/build/batchloaders/BatchLoader.d.cts.map +1 -0
- package/build/batchloaders/BatchLoader.d.mts +17 -0
- package/build/batchloaders/BatchLoader.d.mts.map +1 -0
- package/build/batchloaders/BatchLoader.js +45 -54
- package/build/batchloaders/BatchLoader.js.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.cjs +66 -0
- package/build/batchloaders/enumCollectionBatchLoader.cjs.map +1 -0
- package/build/batchloaders/enumCollectionBatchLoader.d.cts +11 -0
- package/build/batchloaders/enumCollectionBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/enumCollectionBatchLoader.d.mts +11 -0
- package/build/batchloaders/enumCollectionBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/enumCollectionBatchLoader.js +58 -48
- package/build/batchloaders/enumCollectionBatchLoader.js.map +1 -1
- package/build/batchloaders/loadBatchLoader.cjs +78 -0
- package/build/batchloaders/loadBatchLoader.cjs.map +1 -0
- package/build/batchloaders/loadBatchLoader.d.cts +20 -0
- package/build/batchloaders/loadBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/loadBatchLoader.d.mts +20 -0
- package/build/batchloaders/loadBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/loadBatchLoader.js +72 -51
- package/build/batchloaders/loadBatchLoader.js.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.cjs +78 -0
- package/build/batchloaders/manyToManyBatchLoader.cjs.map +1 -0
- package/build/batchloaders/manyToManyBatchLoader.d.cts +11 -0
- package/build/batchloaders/manyToManyBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/manyToManyBatchLoader.d.mts +11 -0
- package/build/batchloaders/manyToManyBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/manyToManyBatchLoader.js +70 -61
- package/build/batchloaders/manyToManyBatchLoader.js.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.cjs +63 -0
- package/build/batchloaders/oneToManyBatchLoader.cjs.map +1 -0
- package/build/batchloaders/oneToManyBatchLoader.d.cts +11 -0
- package/build/batchloaders/oneToManyBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/oneToManyBatchLoader.d.mts +11 -0
- package/build/batchloaders/oneToManyBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/oneToManyBatchLoader.js +58 -48
- package/build/batchloaders/oneToManyBatchLoader.js.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.cjs +64 -0
- package/build/batchloaders/oneToOneBatchLoader.cjs.map +1 -0
- package/build/batchloaders/oneToOneBatchLoader.d.cts +10 -0
- package/build/batchloaders/oneToOneBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/oneToOneBatchLoader.d.mts +10 -0
- package/build/batchloaders/oneToOneBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/oneToOneBatchLoader.js +59 -50
- package/build/batchloaders/oneToOneBatchLoader.js.map +1 -1
- package/build/batchloaders/populateBatchLoader.cjs +156 -0
- package/build/batchloaders/populateBatchLoader.cjs.map +1 -0
- package/build/batchloaders/populateBatchLoader.d.cts +17 -0
- package/build/batchloaders/populateBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/populateBatchLoader.d.mts +17 -0
- package/build/batchloaders/populateBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/populateBatchLoader.js +148 -203
- package/build/batchloaders/populateBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs +78 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs.map +1 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.d.cts +10 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.d.mts +10 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.js +71 -72
- package/build/batchloaders/recursiveChildrenBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.cjs +83 -0
- package/build/batchloaders/recursiveM2mBatchLoader.cjs.map +1 -0
- package/build/batchloaders/recursiveM2mBatchLoader.d.cts +10 -0
- package/build/batchloaders/recursiveM2mBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/recursiveM2mBatchLoader.d.mts +10 -0
- package/build/batchloaders/recursiveM2mBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/recursiveM2mBatchLoader.js +76 -79
- package/build/batchloaders/recursiveM2mBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.cjs +65 -0
- package/build/batchloaders/recursiveParentsBatchLoader.cjs.map +1 -0
- package/build/batchloaders/recursiveParentsBatchLoader.d.cts +10 -0
- package/build/batchloaders/recursiveParentsBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/recursiveParentsBatchLoader.d.mts +10 -0
- package/build/batchloaders/recursiveParentsBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/recursiveParentsBatchLoader.js +58 -55
- package/build/batchloaders/recursiveParentsBatchLoader.js.map +1 -1
- package/build/changes.cjs +222 -0
- package/build/changes.cjs.map +1 -0
- package/build/changes.d.cts +95 -0
- package/build/changes.d.cts.map +1 -0
- package/build/changes.d.mts +95 -0
- package/build/changes.d.mts.map +1 -0
- package/build/changes.js +209 -285
- package/build/changes.js.map +1 -1
- package/build/columns.cjs +63 -0
- package/build/columns.cjs.map +1 -0
- package/build/columns.d.cts +38 -0
- package/build/columns.d.cts.map +1 -0
- package/build/columns.d.mts +38 -0
- package/build/columns.d.mts.map +1 -0
- package/build/columns.js +62 -0
- package/build/columns.js.map +1 -0
- package/build/config.cjs +295 -0
- package/build/config.cjs.map +1 -0
- package/build/config.d.cts +277 -0
- package/build/config.d.cts.map +1 -0
- package/build/config.d.mts +277 -0
- package/build/config.d.mts.map +1 -0
- package/build/config.js +255 -301
- package/build/config.js.map +1 -1
- package/build/configure.cjs +324 -0
- package/build/configure.cjs.map +1 -0
- package/build/configure.d.cts +19 -0
- package/build/configure.d.cts.map +1 -0
- package/build/configure.d.mts +19 -0
- package/build/configure.d.mts.map +1 -0
- package/build/configure.js +265 -348
- package/build/configure.js.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.cjs +140 -0
- package/build/dataloaders/fastWhereFilterHash.cjs.map +1 -0
- package/build/dataloaders/fastWhereFilterHash.d.cts +18 -0
- package/build/dataloaders/fastWhereFilterHash.d.cts.map +1 -0
- package/build/dataloaders/fastWhereFilterHash.d.mts +18 -0
- package/build/dataloaders/fastWhereFilterHash.d.mts.map +1 -0
- package/build/dataloaders/fastWhereFilterHash.js +108 -133
- package/build/dataloaders/fastWhereFilterHash.js.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.cjs +59 -0
- package/build/dataloaders/findByUniqueDataLoader.cjs.map +1 -0
- package/build/dataloaders/findByUniqueDataLoader.d.cts +10 -0
- package/build/dataloaders/findByUniqueDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findByUniqueDataLoader.d.mts +10 -0
- package/build/dataloaders/findByUniqueDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findByUniqueDataLoader.js +54 -44
- package/build/dataloaders/findByUniqueDataLoader.js.map +1 -1
- package/build/dataloaders/findCountDataLoader.cjs +124 -0
- package/build/dataloaders/findCountDataLoader.cjs.map +1 -0
- package/build/dataloaders/findCountDataLoader.d.cts +19 -0
- package/build/dataloaders/findCountDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findCountDataLoader.d.mts +19 -0
- package/build/dataloaders/findCountDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findCountDataLoader.js +113 -109
- package/build/dataloaders/findCountDataLoader.js.map +1 -1
- package/build/dataloaders/findDataLoader.cjs +368 -0
- package/build/dataloaders/findDataLoader.cjs.map +1 -0
- package/build/dataloaders/findDataLoader.d.cts +79 -0
- package/build/dataloaders/findDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findDataLoader.d.mts +79 -0
- package/build/dataloaders/findDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findDataLoader.js +301 -382
- package/build/dataloaders/findDataLoader.js.map +1 -1
- package/build/dataloaders/findIdsDataLoader.cjs +83 -0
- package/build/dataloaders/findIdsDataLoader.cjs.map +1 -0
- package/build/dataloaders/findIdsDataLoader.d.cts +9 -0
- package/build/dataloaders/findIdsDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findIdsDataLoader.d.mts +9 -0
- package/build/dataloaders/findIdsDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findIdsDataLoader.js +78 -74
- package/build/dataloaders/findIdsDataLoader.js.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.cjs +121 -0
- package/build/dataloaders/findOrCreateDataLoader.cjs.map +1 -0
- package/build/dataloaders/findOrCreateDataLoader.d.cts +15 -0
- package/build/dataloaders/findOrCreateDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findOrCreateDataLoader.d.mts +15 -0
- package/build/dataloaders/findOrCreateDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findOrCreateDataLoader.js +103 -164
- package/build/dataloaders/findOrCreateDataLoader.js.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.cjs +99 -0
- package/build/dataloaders/findPaginatedDataLoader.cjs.map +1 -0
- package/build/dataloaders/findPaginatedDataLoader.d.cts +10 -0
- package/build/dataloaders/findPaginatedDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findPaginatedDataLoader.d.mts +10 -0
- package/build/dataloaders/findPaginatedDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findPaginatedDataLoader.js +94 -80
- package/build/dataloaders/findPaginatedDataLoader.js.map +1 -1
- package/build/dataloaders/lensDataLoader.cjs +178 -0
- package/build/dataloaders/lensDataLoader.cjs.map +1 -0
- package/build/dataloaders/lensDataLoader.d.cts +15 -0
- package/build/dataloaders/lensDataLoader.d.cts.map +1 -0
- package/build/dataloaders/lensDataLoader.d.mts +15 -0
- package/build/dataloaders/lensDataLoader.d.mts.map +1 -0
- package/build/dataloaders/lensDataLoader.js +172 -176
- package/build/dataloaders/lensDataLoader.js.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.cjs +87 -0
- package/build/dataloaders/manyToManyFindDataLoader.cjs.map +1 -0
- package/build/dataloaders/manyToManyFindDataLoader.d.cts +13 -0
- package/build/dataloaders/manyToManyFindDataLoader.d.cts.map +1 -0
- package/build/dataloaders/manyToManyFindDataLoader.d.mts +13 -0
- package/build/dataloaders/manyToManyFindDataLoader.d.mts.map +1 -0
- package/build/dataloaders/manyToManyFindDataLoader.js +79 -70
- package/build/dataloaders/manyToManyFindDataLoader.js.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.cjs +80 -0
- package/build/dataloaders/oneToManyFindDataLoader.cjs.map +1 -0
- package/build/dataloaders/oneToManyFindDataLoader.d.cts +13 -0
- package/build/dataloaders/oneToManyFindDataLoader.d.cts.map +1 -0
- package/build/dataloaders/oneToManyFindDataLoader.d.mts +13 -0
- package/build/dataloaders/oneToManyFindDataLoader.d.mts.map +1 -0
- package/build/dataloaders/oneToManyFindDataLoader.js +74 -67
- package/build/dataloaders/oneToManyFindDataLoader.js.map +1 -1
- package/build/defaults.cjs +195 -0
- package/build/defaults.cjs.map +1 -0
- package/build/defaults.d.cts +56 -0
- package/build/defaults.d.cts.map +1 -0
- package/build/defaults.d.mts +56 -0
- package/build/defaults.d.mts.map +1 -0
- package/build/defaults.js +171 -271
- package/build/defaults.js.map +1 -1
- package/build/driverApi.cjs +19 -0
- package/build/driverApi.cjs.map +1 -0
- package/build/driverApi.d.cts +22 -0
- package/build/driverApi.d.cts.map +1 -0
- package/build/driverApi.d.mts +22 -0
- package/build/driverApi.d.mts.map +1 -0
- package/build/driverApi.js +16 -15
- package/build/driverApi.js.map +1 -1
- package/build/drivers/Driver.cjs +5 -0
- package/build/drivers/Driver.d.cts +51 -0
- package/build/drivers/Driver.d.cts.map +1 -0
- package/build/drivers/Driver.d.mts +51 -0
- package/build/drivers/Driver.d.mts.map +1 -0
- package/build/drivers/Driver.js +5 -3
- package/build/drivers/EntityWriter.cjs +213 -0
- package/build/drivers/EntityWriter.cjs.map +1 -0
- package/build/drivers/EntityWriter.d.cts +66 -0
- package/build/drivers/EntityWriter.d.cts.map +1 -0
- package/build/drivers/EntityWriter.d.mts +66 -0
- package/build/drivers/EntityWriter.d.mts.map +1 -0
- package/build/drivers/EntityWriter.js +188 -219
- package/build/drivers/EntityWriter.js.map +1 -1
- package/build/drivers/IdAssigner.cjs +90 -0
- package/build/drivers/IdAssigner.cjs.map +1 -0
- package/build/drivers/IdAssigner.d.cts +50 -0
- package/build/drivers/IdAssigner.d.cts.map +1 -0
- package/build/drivers/IdAssigner.d.mts +50 -0
- package/build/drivers/IdAssigner.d.mts.map +1 -0
- package/build/drivers/IdAssigner.js +81 -124
- package/build/drivers/IdAssigner.js.map +1 -1
- package/build/drivers/buildRawQuery.cjs +113 -0
- package/build/drivers/buildRawQuery.cjs.map +1 -0
- package/build/drivers/buildRawQuery.d.cts +24 -0
- package/build/drivers/buildRawQuery.d.cts.map +1 -0
- package/build/drivers/buildRawQuery.d.mts +24 -0
- package/build/drivers/buildRawQuery.d.mts.map +1 -0
- package/build/drivers/buildRawQuery.js +102 -144
- package/build/drivers/buildRawQuery.js.map +1 -1
- package/build/drivers/buildUtils.cjs +67 -0
- package/build/drivers/buildUtils.cjs.map +1 -0
- package/build/drivers/buildUtils.d.cts +14 -0
- package/build/drivers/buildUtils.d.cts.map +1 -0
- package/build/drivers/buildUtils.d.mts +14 -0
- package/build/drivers/buildUtils.d.mts.map +1 -0
- package/build/drivers/buildUtils.js +54 -77
- package/build/drivers/buildUtils.js.map +1 -1
- package/build/drivers/index.cjs +13 -0
- package/build/drivers/index.d.cts +6 -0
- package/build/drivers/index.d.mts +6 -0
- package/build/drivers/index.js +5 -22
- package/build/execute.cjs +223 -0
- package/build/execute.cjs.map +1 -0
- package/build/execute.d.cts +188 -0
- package/build/execute.d.cts.map +1 -0
- package/build/execute.d.mts +188 -0
- package/build/execute.d.mts.map +1 -0
- package/build/execute.js +220 -0
- package/build/execute.js.map +1 -0
- package/build/fieldSerde.cjs +188 -0
- package/build/fieldSerde.cjs.map +1 -0
- package/build/fieldSerde.d.cts +87 -0
- package/build/fieldSerde.d.cts.map +1 -0
- package/build/fieldSerde.d.mts +87 -0
- package/build/fieldSerde.d.mts.map +1 -0
- package/build/fieldSerde.js +182 -0
- package/build/fieldSerde.js.map +1 -0
- package/build/fields.cjs +127 -0
- package/build/fields.cjs.map +1 -0
- package/build/fields.d.cts +29 -0
- package/build/fields.d.cts.map +1 -0
- package/build/fields.d.mts +29 -0
- package/build/fields.d.mts.map +1 -0
- package/build/fields.js +98 -160
- package/build/fields.js.map +1 -1
- package/build/getProperties.cjs +87 -0
- package/build/getProperties.cjs.map +1 -0
- package/build/getProperties.d.cts +30 -0
- package/build/getProperties.d.cts.map +1 -0
- package/build/getProperties.d.mts +30 -0
- package/build/getProperties.d.mts.map +1 -0
- package/build/getProperties.js +71 -128
- package/build/getProperties.js.map +1 -1
- package/build/index.cjs +515 -0
- package/build/index.cjs.map +1 -0
- package/build/index.d.cts +171 -0
- package/build/index.d.cts.map +1 -0
- package/build/index.d.mts +171 -0
- package/build/index.d.mts.map +1 -0
- package/build/index.js +167 -292
- package/build/index.js.map +1 -1
- package/build/json.cjs +79 -0
- package/build/json.cjs.map +1 -0
- package/build/json.d.cts +76 -0
- package/build/json.d.cts.map +1 -0
- package/build/json.d.mts +76 -0
- package/build/json.d.mts.map +1 -0
- package/build/json.js +68 -106
- package/build/json.js.map +1 -1
- package/build/k.cjs +9 -0
- package/build/k.cjs.map +1 -0
- package/build/k.d.cts +1 -0
- package/build/k.d.mts +1 -0
- package/build/k.js +6 -6
- package/build/k.js.map +1 -1
- package/build/keys.cjs +176 -0
- package/build/keys.cjs.map +1 -0
- package/build/keys.d.cts +53 -0
- package/build/keys.d.cts.map +1 -0
- package/build/keys.d.mts +53 -0
- package/build/keys.d.mts.map +1 -0
- package/build/keys.js +125 -162
- package/build/keys.js.map +1 -1
- package/build/keywords.cjs +136 -0
- package/build/keywords.cjs.map +1 -0
- package/build/keywords.d.cts +18 -0
- package/build/keywords.d.cts.map +1 -0
- package/build/keywords.d.mts +18 -0
- package/build/keywords.d.mts.map +1 -0
- package/build/keywords.js +124 -116
- package/build/keywords.js.map +1 -1
- package/build/loadHints.cjs +100 -0
- package/build/loadHints.cjs.map +1 -0
- package/build/loadHints.d.cts +116 -0
- package/build/loadHints.d.cts.map +1 -0
- package/build/loadHints.d.mts +116 -0
- package/build/loadHints.d.mts.map +1 -0
- package/build/loadHints.js +72 -108
- package/build/loadHints.js.map +1 -1
- package/build/loadLens.cjs +213 -0
- package/build/loadLens.cjs.map +1 -0
- package/build/loadLens.d.cts +77 -0
- package/build/loadLens.d.cts.map +1 -0
- package/build/loadLens.d.mts +77 -0
- package/build/loadLens.d.mts.map +1 -0
- package/build/loadLens.js +152 -270
- package/build/loadLens.js.map +1 -1
- package/build/logging/FactoryLogger.cjs +66 -0
- package/build/logging/FactoryLogger.cjs.map +1 -0
- package/build/logging/FactoryLogger.d.cts +27 -0
- package/build/logging/FactoryLogger.d.cts.map +1 -0
- package/build/logging/FactoryLogger.d.mts +27 -0
- package/build/logging/FactoryLogger.d.mts.map +1 -0
- package/build/logging/FactoryLogger.js +58 -73
- package/build/logging/FactoryLogger.js.map +1 -1
- package/build/logging/FieldLogger.cjs +57 -0
- package/build/logging/FieldLogger.cjs.map +1 -0
- package/build/logging/FieldLogger.d.cts +32 -0
- package/build/logging/FieldLogger.d.cts.map +1 -0
- package/build/logging/FieldLogger.d.mts +32 -0
- package/build/logging/FieldLogger.d.mts.map +1 -0
- package/build/logging/FieldLogger.js +51 -67
- package/build/logging/FieldLogger.js.map +1 -1
- package/build/logging/ReactionLogger.cjs +95 -0
- package/build/logging/ReactionLogger.cjs.map +1 -0
- package/build/logging/ReactionLogger.d.cts +37 -0
- package/build/logging/ReactionLogger.d.cts.map +1 -0
- package/build/logging/ReactionLogger.d.mts +37 -0
- package/build/logging/ReactionLogger.d.mts.map +1 -0
- package/build/logging/ReactionLogger.js +78 -66
- package/build/logging/ReactionLogger.js.map +1 -1
- package/build/newEntity.cjs +89 -0
- package/build/newEntity.cjs.map +1 -0
- package/build/newEntity.d.cts +48 -0
- package/build/newEntity.d.cts.map +1 -0
- package/build/newEntity.d.mts +48 -0
- package/build/newEntity.d.mts.map +1 -0
- package/build/newEntity.js +71 -94
- package/build/newEntity.js.map +1 -1
- package/build/newTestInstance.cjs +539 -0
- package/build/newTestInstance.cjs.map +1 -0
- package/build/newTestInstance.d.cts +207 -0
- package/build/newTestInstance.d.cts.map +1 -0
- package/build/newTestInstance.d.mts +207 -0
- package/build/newTestInstance.d.mts.map +1 -0
- package/build/newTestInstance.js +459 -721
- package/build/newTestInstance.js.map +1 -1
- package/build/normalizeHints.cjs +60 -0
- package/build/normalizeHints.cjs.map +1 -0
- package/build/normalizeHints.d.cts +24 -0
- package/build/normalizeHints.d.cts.map +1 -0
- package/build/normalizeHints.d.mts +24 -0
- package/build/normalizeHints.d.mts.map +1 -0
- package/build/normalizeHints.js +42 -55
- package/build/normalizeHints.js.map +1 -1
- package/build/nowUTC.cjs +15 -0
- package/build/nowUTC.cjs.map +1 -0
- package/build/nowUTC.d.cts +10 -0
- package/build/nowUTC.d.cts.map +1 -0
- package/build/nowUTC.d.mts +10 -0
- package/build/nowUTC.d.mts.map +1 -0
- package/build/nowUTC.js +14 -0
- package/build/nowUTC.js.map +1 -0
- package/build/plugins/ImmutableEntitiesPlugin.cjs +21 -0
- package/build/plugins/ImmutableEntitiesPlugin.cjs.map +1 -0
- package/build/plugins/ImmutableEntitiesPlugin.d.cts +12 -0
- package/build/plugins/ImmutableEntitiesPlugin.d.cts.map +1 -0
- package/build/plugins/ImmutableEntitiesPlugin.d.mts +12 -0
- package/build/plugins/ImmutableEntitiesPlugin.d.mts.map +1 -0
- package/build/plugins/ImmutableEntitiesPlugin.js +19 -20
- package/build/plugins/ImmutableEntitiesPlugin.js.map +1 -1
- package/build/plugins/PreloadPlugin.cjs +6 -0
- package/build/plugins/PreloadPlugin.d.cts +77 -0
- package/build/plugins/PreloadPlugin.d.cts.map +1 -0
- package/build/plugins/PreloadPlugin.d.mts +77 -0
- package/build/plugins/PreloadPlugin.d.mts.map +1 -0
- package/build/plugins/PreloadPlugin.js +6 -3
- package/build/preloading/JsonAggregatePreloader.cjs +283 -0
- package/build/preloading/JsonAggregatePreloader.cjs.map +1 -0
- package/build/preloading/JsonAggregatePreloader.d.cts +19 -0
- package/build/preloading/JsonAggregatePreloader.d.cts.map +1 -0
- package/build/preloading/JsonAggregatePreloader.d.mts +19 -0
- package/build/preloading/JsonAggregatePreloader.d.mts.map +1 -0
- package/build/preloading/JsonAggregatePreloader.js +273 -320
- package/build/preloading/JsonAggregatePreloader.js.map +1 -1
- package/build/preloading/canPreload.cjs +19 -0
- package/build/preloading/canPreload.cjs.map +1 -0
- package/build/preloading/canPreload.d.cts +6 -0
- package/build/preloading/canPreload.d.cts.map +1 -0
- package/build/preloading/canPreload.d.mts +6 -0
- package/build/preloading/canPreload.d.mts.map +1 -0
- package/build/preloading/canPreload.js +15 -21
- package/build/preloading/canPreload.js.map +1 -1
- package/build/preloading/partitionHint.cjs +44 -0
- package/build/preloading/partitionHint.cjs.map +1 -0
- package/build/preloading/partitionHint.d.cts +8 -0
- package/build/preloading/partitionHint.d.cts.map +1 -0
- package/build/preloading/partitionHint.d.mts +8 -0
- package/build/preloading/partitionHint.d.mts.map +1 -0
- package/build/preloading/partitionHint.js +37 -56
- package/build/preloading/partitionHint.js.map +1 -1
- package/build/query.cjs +1065 -0
- package/build/query.cjs.map +1 -0
- package/build/query.d.cts +3864 -0
- package/build/query.d.cts.map +1 -0
- package/build/query.d.mts +3864 -0
- package/build/query.d.mts.map +1 -0
- package/build/query.js +1054 -0
- package/build/query.js.map +1 -0
- package/build/reactiveHints.cjs +332 -0
- package/build/reactiveHints.cjs.map +1 -0
- package/build/reactiveHints.d.cts +143 -0
- package/build/reactiveHints.d.cts.map +1 -0
- package/build/reactiveHints.d.mts +143 -0
- package/build/reactiveHints.d.mts.map +1 -0
- package/build/reactiveHints.js +291 -475
- package/build/reactiveHints.js.map +1 -1
- package/build/relations/AbstractPropertyImpl.cjs +16 -0
- package/build/relations/AbstractPropertyImpl.cjs.map +1 -0
- package/build/relations/AbstractPropertyImpl.d.cts +11 -0
- package/build/relations/AbstractPropertyImpl.d.cts.map +1 -0
- package/build/relations/AbstractPropertyImpl.d.mts +11 -0
- package/build/relations/AbstractPropertyImpl.d.mts.map +1 -0
- package/build/relations/AbstractPropertyImpl.js +13 -13
- package/build/relations/AbstractPropertyImpl.js.map +1 -1
- package/build/relations/AbstractRelationImpl.cjs +20 -0
- package/build/relations/AbstractRelationImpl.cjs.map +1 -0
- package/build/relations/AbstractRelationImpl.d.cts +44 -0
- package/build/relations/AbstractRelationImpl.d.cts.map +1 -0
- package/build/relations/AbstractRelationImpl.d.mts +44 -0
- package/build/relations/AbstractRelationImpl.d.mts.map +1 -0
- package/build/relations/AbstractRelationImpl.js +14 -15
- package/build/relations/AbstractRelationImpl.js.map +1 -1
- package/build/relations/AsyncProperty.cjs +75 -0
- package/build/relations/AsyncProperty.cjs.map +1 -0
- package/build/relations/AsyncProperty.d.cts +40 -0
- package/build/relations/AsyncProperty.d.cts.map +1 -0
- package/build/relations/AsyncProperty.d.mts +40 -0
- package/build/relations/AsyncProperty.d.mts.map +1 -0
- package/build/relations/AsyncProperty.js +61 -70
- package/build/relations/AsyncProperty.js.map +1 -1
- package/build/relations/AsyncReactiveField.cjs +110 -0
- package/build/relations/AsyncReactiveField.cjs.map +1 -0
- package/build/relations/AsyncReactiveField.d.cts +50 -0
- package/build/relations/AsyncReactiveField.d.cts.map +1 -0
- package/build/relations/AsyncReactiveField.d.mts +50 -0
- package/build/relations/AsyncReactiveField.d.mts.map +1 -0
- package/build/relations/AsyncReactiveField.js +97 -116
- package/build/relations/AsyncReactiveField.js.map +1 -1
- package/build/relations/Collection.cjs +23 -0
- package/build/relations/Collection.cjs.map +1 -0
- package/build/relations/Collection.d.cts +37 -0
- package/build/relations/Collection.d.cts.map +1 -0
- package/build/relations/Collection.d.mts +37 -0
- package/build/relations/Collection.d.mts.map +1 -0
- package/build/relations/Collection.js +14 -11
- package/build/relations/Collection.js.map +1 -1
- package/build/relations/CustomCollection.cjs +144 -0
- package/build/relations/CustomCollection.cjs.map +1 -0
- package/build/relations/CustomCollection.d.cts +74 -0
- package/build/relations/CustomCollection.d.cts.map +1 -0
- package/build/relations/CustomCollection.d.mts +74 -0
- package/build/relations/CustomCollection.d.mts.map +1 -0
- package/build/relations/CustomCollection.js +138 -162
- package/build/relations/CustomCollection.js.map +1 -1
- package/build/relations/CustomReference.cjs +142 -0
- package/build/relations/CustomReference.cjs.map +1 -0
- package/build/relations/CustomReference.d.cts +76 -0
- package/build/relations/CustomReference.d.cts.map +1 -0
- package/build/relations/CustomReference.d.mts +76 -0
- package/build/relations/CustomReference.d.mts.map +1 -0
- package/build/relations/CustomReference.js +135 -147
- package/build/relations/CustomReference.js.map +1 -1
- package/build/relations/EnumCollection.cjs +178 -0
- package/build/relations/EnumCollection.cjs.map +1 -0
- package/build/relations/EnumCollection.d.cts +86 -0
- package/build/relations/EnumCollection.d.cts.map +1 -0
- package/build/relations/EnumCollection.d.mts +86 -0
- package/build/relations/EnumCollection.d.mts.map +1 -0
- package/build/relations/EnumCollection.js +172 -207
- package/build/relations/EnumCollection.js.map +1 -1
- package/build/relations/LargeCollection.cjs +4 -0
- package/build/relations/LargeCollection.d.cts +22 -0
- package/build/relations/LargeCollection.d.cts.map +1 -0
- package/build/relations/LargeCollection.d.mts +22 -0
- package/build/relations/LargeCollection.d.mts.map +1 -0
- package/build/relations/LargeCollection.js +4 -3
- package/build/relations/LazyField.cjs +141 -0
- package/build/relations/LazyField.cjs.map +1 -0
- package/build/relations/LazyField.d.cts +51 -0
- package/build/relations/LazyField.d.cts.map +1 -0
- package/build/relations/LazyField.d.mts +51 -0
- package/build/relations/LazyField.d.mts.map +1 -0
- package/build/relations/LazyField.js +135 -0
- package/build/relations/LazyField.js.map +1 -0
- package/build/relations/ManyToManyCollection.cjs +420 -0
- package/build/relations/ManyToManyCollection.cjs.map +1 -0
- package/build/relations/ManyToManyCollection.d.cts +59 -0
- package/build/relations/ManyToManyCollection.d.cts.map +1 -0
- package/build/relations/ManyToManyCollection.d.mts +59 -0
- package/build/relations/ManyToManyCollection.d.mts.map +1 -0
- package/build/relations/ManyToManyCollection.js +410 -471
- package/build/relations/ManyToManyCollection.js.map +1 -1
- package/build/relations/ManyToManyLargeCollection.cjs +91 -0
- package/build/relations/ManyToManyLargeCollection.cjs.map +1 -0
- package/build/relations/ManyToManyLargeCollection.d.cts +34 -0
- package/build/relations/ManyToManyLargeCollection.d.cts.map +1 -0
- package/build/relations/ManyToManyLargeCollection.d.mts +34 -0
- package/build/relations/ManyToManyLargeCollection.d.mts.map +1 -0
- package/build/relations/ManyToManyLargeCollection.js +85 -118
- package/build/relations/ManyToManyLargeCollection.js.map +1 -1
- package/build/relations/ManyToOneReference.cjs +363 -0
- package/build/relations/ManyToOneReference.cjs.map +1 -0
- package/build/relations/ManyToOneReference.d.cts +121 -0
- package/build/relations/ManyToOneReference.d.cts.map +1 -0
- package/build/relations/ManyToOneReference.d.mts +121 -0
- package/build/relations/ManyToOneReference.d.mts.map +1 -0
- package/build/relations/ManyToOneReference.js +343 -411
- package/build/relations/ManyToOneReference.js.map +1 -1
- package/build/relations/OneToManyCollection.cjs +492 -0
- package/build/relations/OneToManyCollection.cjs.map +1 -0
- package/build/relations/OneToManyCollection.d.cts +69 -0
- package/build/relations/OneToManyCollection.d.cts.map +1 -0
- package/build/relations/OneToManyCollection.d.mts +69 -0
- package/build/relations/OneToManyCollection.d.mts.map +1 -0
- package/build/relations/OneToManyCollection.js +480 -579
- package/build/relations/OneToManyCollection.js.map +1 -1
- package/build/relations/OneToManyLargeCollection.cjs +85 -0
- package/build/relations/OneToManyLargeCollection.cjs.map +1 -0
- package/build/relations/OneToManyLargeCollection.d.cts +29 -0
- package/build/relations/OneToManyLargeCollection.d.cts.map +1 -0
- package/build/relations/OneToManyLargeCollection.d.mts +29 -0
- package/build/relations/OneToManyLargeCollection.d.mts.map +1 -0
- package/build/relations/OneToManyLargeCollection.js +79 -99
- package/build/relations/OneToManyLargeCollection.js.map +1 -1
- package/build/relations/OneToOneReference.cjs +208 -0
- package/build/relations/OneToOneReference.cjs.map +1 -0
- package/build/relations/OneToOneReference.d.cts +97 -0
- package/build/relations/OneToOneReference.d.cts.map +1 -0
- package/build/relations/OneToOneReference.d.mts +97 -0
- package/build/relations/OneToOneReference.d.mts.map +1 -0
- package/build/relations/OneToOneReference.js +192 -221
- package/build/relations/OneToOneReference.js.map +1 -1
- package/build/relations/PolymorphicReference.cjs +209 -0
- package/build/relations/PolymorphicReference.cjs.map +1 -0
- package/build/relations/PolymorphicReference.d.cts +93 -0
- package/build/relations/PolymorphicReference.d.cts.map +1 -0
- package/build/relations/PolymorphicReference.d.mts +93 -0
- package/build/relations/PolymorphicReference.d.mts.map +1 -0
- package/build/relations/PolymorphicReference.js +199 -237
- package/build/relations/PolymorphicReference.js.map +1 -1
- package/build/relations/PropertySymbols.cjs +7 -0
- package/build/relations/PropertySymbols.cjs.map +1 -0
- package/build/relations/PropertySymbols.d.cts +5 -0
- package/build/relations/PropertySymbols.d.cts.map +1 -0
- package/build/relations/PropertySymbols.d.mts +5 -0
- package/build/relations/PropertySymbols.d.mts.map +1 -0
- package/build/relations/PropertySymbols.js +6 -0
- package/build/relations/PropertySymbols.js.map +1 -0
- package/build/relations/ReactiveField.cjs +115 -0
- package/build/relations/ReactiveField.cjs.map +1 -0
- package/build/relations/ReactiveField.d.cts +88 -0
- package/build/relations/ReactiveField.d.cts.map +1 -0
- package/build/relations/ReactiveField.d.mts +88 -0
- package/build/relations/ReactiveField.d.mts.map +1 -0
- package/build/relations/ReactiveField.js +105 -137
- package/build/relations/ReactiveField.js.map +1 -1
- package/build/relations/ReactiveGetter.cjs +41 -0
- package/build/relations/ReactiveGetter.cjs.map +1 -0
- package/build/relations/ReactiveGetter.d.cts +33 -0
- package/build/relations/ReactiveGetter.d.cts.map +1 -0
- package/build/relations/ReactiveGetter.d.mts +33 -0
- package/build/relations/ReactiveGetter.d.mts.map +1 -0
- package/build/relations/ReactiveGetter.js +31 -31
- package/build/relations/ReactiveGetter.js.map +1 -1
- package/build/relations/ReactiveManyToMany.cjs +198 -0
- package/build/relations/ReactiveManyToMany.cjs.map +1 -0
- package/build/relations/ReactiveManyToMany.d.cts +63 -0
- package/build/relations/ReactiveManyToMany.d.cts.map +1 -0
- package/build/relations/ReactiveManyToMany.d.mts +63 -0
- package/build/relations/ReactiveManyToMany.d.mts.map +1 -0
- package/build/relations/ReactiveManyToMany.js +187 -238
- package/build/relations/ReactiveManyToMany.js.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.cjs +150 -0
- package/build/relations/ReactiveManyToManyOtherSide.cjs.map +1 -0
- package/build/relations/ReactiveManyToManyOtherSide.d.cts +53 -0
- package/build/relations/ReactiveManyToManyOtherSide.d.cts.map +1 -0
- package/build/relations/ReactiveManyToManyOtherSide.d.mts +53 -0
- package/build/relations/ReactiveManyToManyOtherSide.d.mts.map +1 -0
- package/build/relations/ReactiveManyToManyOtherSide.js +141 -152
- package/build/relations/ReactiveManyToManyOtherSide.js.map +1 -1
- package/build/relations/ReactiveReference.cjs +336 -0
- package/build/relations/ReactiveReference.cjs.map +1 -0
- package/build/relations/ReactiveReference.d.cts +124 -0
- package/build/relations/ReactiveReference.d.cts.map +1 -0
- package/build/relations/ReactiveReference.d.mts +124 -0
- package/build/relations/ReactiveReference.d.mts.map +1 -0
- package/build/relations/ReactiveReference.js +321 -385
- package/build/relations/ReactiveReference.js.map +1 -1
- package/build/relations/ReadOnlyCollection.cjs +18 -0
- package/build/relations/ReadOnlyCollection.cjs.map +1 -0
- package/build/relations/ReadOnlyCollection.d.cts +22 -0
- package/build/relations/ReadOnlyCollection.d.cts.map +1 -0
- package/build/relations/ReadOnlyCollection.d.mts +22 -0
- package/build/relations/ReadOnlyCollection.d.mts.map +1 -0
- package/build/relations/ReadOnlyCollection.js +9 -9
- package/build/relations/ReadOnlyCollection.js.map +1 -1
- package/build/relations/RecursiveCollection.cjs +387 -0
- package/build/relations/RecursiveCollection.cjs.map +1 -0
- package/build/relations/RecursiveCollection.d.cts +112 -0
- package/build/relations/RecursiveCollection.d.cts.map +1 -0
- package/build/relations/RecursiveCollection.d.mts +112 -0
- package/build/relations/RecursiveCollection.d.mts.map +1 -0
- package/build/relations/RecursiveCollection.js +368 -427
- package/build/relations/RecursiveCollection.js.map +1 -1
- package/build/relations/RecursiveCycleError.cjs +17 -0
- package/build/relations/RecursiveCycleError.cjs.map +1 -0
- package/build/relations/RecursiveCycleError.d.cts +15 -0
- package/build/relations/RecursiveCycleError.d.cts.map +1 -0
- package/build/relations/RecursiveCycleError.d.mts +15 -0
- package/build/relations/RecursiveCycleError.d.mts.map +1 -0
- package/build/relations/RecursiveCycleError.js +14 -13
- package/build/relations/RecursiveCycleError.js.map +1 -1
- package/build/relations/Reference.cjs +25 -0
- package/build/relations/Reference.cjs.map +1 -0
- package/build/relations/Reference.d.cts +39 -0
- package/build/relations/Reference.d.cts.map +1 -0
- package/build/relations/Reference.d.mts +39 -0
- package/build/relations/Reference.d.mts.map +1 -0
- package/build/relations/Reference.js +15 -14
- package/build/relations/Reference.js.map +1 -1
- package/build/relations/ReferenceSymbols.cjs +7 -0
- package/build/relations/ReferenceSymbols.cjs.map +1 -0
- package/build/relations/ReferenceSymbols.d.cts +5 -0
- package/build/relations/ReferenceSymbols.d.cts.map +1 -0
- package/build/relations/ReferenceSymbols.d.mts +5 -0
- package/build/relations/ReferenceSymbols.d.mts.map +1 -0
- package/build/relations/ReferenceSymbols.js +6 -0
- package/build/relations/ReferenceSymbols.js.map +1 -0
- package/build/relations/Relation.cjs +17 -0
- package/build/relations/Relation.cjs.map +1 -0
- package/build/relations/Relation.d.cts +16 -0
- package/build/relations/Relation.d.cts.map +1 -0
- package/build/relations/Relation.d.mts +16 -0
- package/build/relations/Relation.d.mts.map +1 -0
- package/build/relations/Relation.js +10 -8
- package/build/relations/Relation.js.map +1 -1
- package/build/relations/RelationSymbols.cjs +9 -0
- package/build/relations/RelationSymbols.cjs.map +1 -0
- package/build/relations/RelationSymbols.d.cts +6 -0
- package/build/relations/RelationSymbols.d.cts.map +1 -0
- package/build/relations/RelationSymbols.d.mts +6 -0
- package/build/relations/RelationSymbols.d.mts.map +1 -0
- package/build/relations/RelationSymbols.js +7 -0
- package/build/relations/RelationSymbols.js.map +1 -0
- package/build/relations/hasAsyncMethod.cjs +47 -0
- package/build/relations/hasAsyncMethod.cjs.map +1 -0
- package/build/relations/hasAsyncMethod.d.cts +29 -0
- package/build/relations/hasAsyncMethod.d.cts.map +1 -0
- package/build/relations/hasAsyncMethod.d.mts +29 -0
- package/build/relations/hasAsyncMethod.d.mts.map +1 -0
- package/build/relations/hasAsyncMethod.js +40 -43
- package/build/relations/hasAsyncMethod.js.map +1 -1
- package/build/relations/hasManyDerived.cjs +35 -0
- package/build/relations/hasManyDerived.cjs.map +1 -0
- package/build/relations/hasManyDerived.d.cts +25 -0
- package/build/relations/hasManyDerived.d.cts.map +1 -0
- package/build/relations/hasManyDerived.d.mts +25 -0
- package/build/relations/hasManyDerived.d.mts.map +1 -0
- package/build/relations/hasManyDerived.js +30 -28
- package/build/relations/hasManyDerived.js.map +1 -1
- package/build/relations/hasManyThrough.cjs +29 -0
- package/build/relations/hasManyThrough.cjs.map +1 -0
- package/build/relations/hasManyThrough.d.cts +16 -0
- package/build/relations/hasManyThrough.d.cts.map +1 -0
- package/build/relations/hasManyThrough.d.mts +16 -0
- package/build/relations/hasManyThrough.d.mts.map +1 -0
- package/build/relations/hasManyThrough.js +24 -20
- package/build/relations/hasManyThrough.js.map +1 -1
- package/build/relations/hasOneDerived.cjs +32 -0
- package/build/relations/hasOneDerived.cjs.map +1 -0
- package/build/relations/hasOneDerived.d.cts +15 -0
- package/build/relations/hasOneDerived.d.cts.map +1 -0
- package/build/relations/hasOneDerived.d.mts +15 -0
- package/build/relations/hasOneDerived.d.mts.map +1 -0
- package/build/relations/hasOneDerived.js +27 -20
- package/build/relations/hasOneDerived.js.map +1 -1
- package/build/relations/hasOneThrough.cjs +31 -0
- package/build/relations/hasOneThrough.cjs.map +1 -0
- package/build/relations/hasOneThrough.d.cts +16 -0
- package/build/relations/hasOneThrough.d.cts.map +1 -0
- package/build/relations/hasOneThrough.d.mts +16 -0
- package/build/relations/hasOneThrough.d.mts.map +1 -0
- package/build/relations/hasOneThrough.js +26 -22
- package/build/relations/hasOneThrough.js.map +1 -1
- package/build/relations/hasProperty.cjs +109 -0
- package/build/relations/hasProperty.cjs.map +1 -0
- package/build/relations/hasProperty.d.cts +53 -0
- package/build/relations/hasProperty.d.cts.map +1 -0
- package/build/relations/hasProperty.d.mts +53 -0
- package/build/relations/hasProperty.d.mts.map +1 -0
- package/build/relations/hasProperty.js +90 -95
- package/build/relations/hasProperty.js.map +1 -1
- package/build/relations/index.cjs +99 -0
- package/build/relations/index.d.cts +32 -0
- package/build/relations/index.d.mts +32 -0
- package/build/relations/index.js +31 -97
- package/build/resurrection.cjs +74 -0
- package/build/resurrection.cjs.map +1 -0
- package/build/resurrection.d.cts +13 -0
- package/build/resurrection.d.cts.map +1 -0
- package/build/resurrection.d.mts +13 -0
- package/build/resurrection.d.mts.map +1 -0
- package/build/resurrection.js +48 -69
- package/build/resurrection.js.map +1 -1
- package/build/rules.cjs +228 -0
- package/build/rules.cjs.map +1 -0
- package/build/rules.d.cts +145 -0
- package/build/rules.d.cts.map +1 -0
- package/build/rules.d.mts +145 -0
- package/build/rules.d.mts.map +1 -0
- package/build/rules.js +190 -204
- package/build/rules.js.map +1 -1
- package/build/runtimeConfig.cjs +25 -0
- package/build/runtimeConfig.cjs.map +1 -0
- package/build/runtimeConfig.d.cts +24 -0
- package/build/runtimeConfig.d.cts.map +1 -0
- package/build/runtimeConfig.d.mts +24 -0
- package/build/runtimeConfig.d.mts.map +1 -0
- package/build/runtimeConfig.js +16 -12
- package/build/runtimeConfig.js.map +1 -1
- package/build/scopes.cjs +302 -0
- package/build/scopes.cjs.map +1 -0
- package/build/scopes.d.cts +188 -0
- package/build/scopes.d.cts.map +1 -0
- package/build/scopes.d.mts +188 -0
- package/build/scopes.d.mts.map +1 -0
- package/build/scopes.js +240 -245
- package/build/scopes.js.map +1 -1
- package/build/serde.cjs +500 -0
- package/build/serde.cjs.map +1 -0
- package/build/serde.d.cts +248 -0
- package/build/serde.d.cts.map +1 -0
- package/build/serde.d.mts +248 -0
- package/build/serde.d.mts.map +1 -0
- package/build/serde.js +474 -505
- package/build/serde.js.map +1 -1
- package/build/skipCondition.cjs +15 -0
- package/build/skipCondition.cjs.map +1 -0
- package/build/skipCondition.d.cts +7 -0
- package/build/skipCondition.d.cts.map +1 -0
- package/build/skipCondition.d.mts +7 -0
- package/build/skipCondition.d.mts.map +1 -0
- package/build/skipCondition.js +14 -0
- package/build/skipCondition.js.map +1 -0
- package/build/temporal.cjs +57 -0
- package/build/temporal.cjs.map +1 -0
- package/build/temporal.d.cts +44 -0
- package/build/temporal.d.cts.map +1 -0
- package/build/temporal.d.mts +44 -0
- package/build/temporal.d.mts.map +1 -0
- package/build/temporal.js +47 -58
- package/build/temporal.js.map +1 -1
- package/build/temporalMappers.cjs +63 -0
- package/build/temporalMappers.cjs.map +1 -0
- package/build/temporalMappers.d.cts +36 -0
- package/build/temporalMappers.d.cts.map +1 -0
- package/build/temporalMappers.d.mts +36 -0
- package/build/temporalMappers.d.mts.map +1 -0
- package/build/temporalMappers.js +55 -55
- package/build/temporalMappers.js.map +1 -1
- package/build/trusted.cjs +16 -0
- package/build/trusted.cjs.map +1 -0
- package/build/trusted.d.cts +8 -0
- package/build/trusted.d.cts.map +1 -0
- package/build/trusted.d.mts +8 -0
- package/build/trusted.d.mts.map +1 -0
- package/build/trusted.js +8 -8
- package/build/trusted.js.map +1 -1
- package/build/typeMap.cjs +3 -0
- package/build/typeMap.d.cts +88 -0
- package/build/typeMap.d.cts.map +1 -0
- package/build/typeMap.d.mts +88 -0
- package/build/typeMap.d.mts.map +1 -0
- package/build/typeMap.js +3 -3
- package/build/unnest.cjs +64 -0
- package/build/unnest.cjs.map +1 -0
- package/build/unnest.d.cts +16 -0
- package/build/unnest.d.cts.map +1 -0
- package/build/unnest.d.mts +16 -0
- package/build/unnest.d.mts.map +1 -0
- package/build/unnest.js +50 -73
- package/build/unnest.js.map +1 -1
- package/build/upsert.cjs +175 -0
- package/build/upsert.cjs.map +1 -0
- package/build/upsert.d.cts +42 -0
- package/build/upsert.d.cts.map +1 -0
- package/build/upsert.d.mts +42 -0
- package/build/upsert.d.mts.map +1 -0
- package/build/upsert.js +159 -274
- package/build/upsert.js.map +1 -1
- package/build/utils.cjs +206 -0
- package/build/utils.cjs.map +1 -0
- package/build/utils.d.cts +65 -0
- package/build/utils.d.cts.map +1 -0
- package/build/utils.d.mts +65 -0
- package/build/utils.d.mts.map +1 -0
- package/build/utils.js +125 -192
- package/build/utils.js.map +1 -1
- package/build/withLoaded.cjs +65 -0
- package/build/withLoaded.cjs.map +1 -0
- package/build/withLoaded.d.cts +65 -0
- package/build/withLoaded.d.cts.map +1 -0
- package/build/withLoaded.d.mts +65 -0
- package/build/withLoaded.d.mts.map +1 -0
- package/build/withLoaded.js +56 -70
- package/build/withLoaded.js.map +1 -1
- package/package.json +34 -14
- package/build/AliasAssigner.d.ts +0 -10
- package/build/AliasAssigner.d.ts.map +0 -1
- package/build/Aliases.d.ts +0 -117
- package/build/Aliases.d.ts.map +0 -1
- package/build/BaseEntity.d.ts +0 -68
- package/build/BaseEntity.d.ts.map +0 -1
- package/build/ConditionBuilder.d.ts +0 -29
- package/build/ConditionBuilder.d.ts.map +0 -1
- package/build/Entity.d.ts +0 -39
- package/build/Entity.d.ts.map +0 -1
- package/build/EntityFields.d.ts +0 -37
- package/build/EntityFields.d.ts.map +0 -1
- package/build/EntityFields.js.map +0 -1
- package/build/EntityFilter.d.ts +0 -134
- package/build/EntityFilter.d.ts.map +0 -1
- package/build/EntityGraphQLFilter.d.ts +0 -56
- package/build/EntityGraphQLFilter.d.ts.map +0 -1
- package/build/EntityManager.d.ts +0 -740
- package/build/EntityManager.d.ts.map +0 -1
- package/build/EntityMetadata.d.ts +0 -233
- package/build/EntityMetadata.d.ts.map +0 -1
- package/build/EnumMetadata.d.ts +0 -15
- package/build/EnumMetadata.d.ts.map +0 -1
- package/build/EnumMetadata.js.map +0 -1
- package/build/FlushLock.d.ts +0 -26
- package/build/FlushLock.d.ts.map +0 -1
- package/build/HintTree.d.ts +0 -42
- package/build/HintTree.d.ts.map +0 -1
- package/build/IndexManager.d.ts +0 -31
- package/build/IndexManager.d.ts.map +0 -1
- package/build/InstanceData.d.ts +0 -79
- package/build/InstanceData.d.ts.map +0 -1
- package/build/IsLoadedCache.d.ts +0 -32
- package/build/IsLoadedCache.d.ts.map +0 -1
- package/build/JoinRows.d.ts +0 -117
- package/build/JoinRows.d.ts.map +0 -1
- package/build/PendingChanges.d.ts +0 -26
- package/build/PendingChanges.d.ts.map +0 -1
- package/build/PendingChanges.js.map +0 -1
- package/build/PluginManager.d.ts +0 -102
- package/build/PluginManager.d.ts.map +0 -1
- package/build/QueryParser.collectionJoins.d.ts +0 -27
- package/build/QueryParser.collectionJoins.d.ts.map +0 -1
- package/build/QueryParser.collectionJoins.test.d.ts +0 -2
- package/build/QueryParser.collectionJoins.test.d.ts.map +0 -1
- package/build/QueryParser.collectionJoins.test.js +0 -772
- package/build/QueryParser.collectionJoins.test.js.map +0 -1
- package/build/QueryParser.d.ts +0 -336
- package/build/QueryParser.d.ts.map +0 -1
- package/build/QueryParser.pruning.d.ts +0 -7
- package/build/QueryParser.pruning.d.ts.map +0 -1
- package/build/QueryParser.pruning.test.d.ts +0 -2
- package/build/QueryParser.pruning.test.d.ts.map +0 -1
- package/build/QueryParser.pruning.test.js +0 -106
- package/build/QueryParser.pruning.test.js.map +0 -1
- package/build/QueryParser.test.d.ts +0 -2
- package/build/QueryParser.test.d.ts.map +0 -1
- package/build/QueryParser.test.js +0 -27
- package/build/QueryParser.test.js.map +0 -1
- package/build/QueryVisitor.d.ts +0 -19
- package/build/QueryVisitor.d.ts.map +0 -1
- package/build/ReactionsManager.d.ts +0 -85
- package/build/ReactionsManager.d.ts.map +0 -1
- package/build/Todo.d.ts +0 -35
- package/build/Todo.d.ts.map +0 -1
- package/build/batchloaders/BatchLoader.d.ts +0 -14
- package/build/batchloaders/BatchLoader.d.ts.map +0 -1
- package/build/batchloaders/enumCollectionBatchLoader.d.ts +0 -7
- package/build/batchloaders/enumCollectionBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/loadBatchLoader.d.ts +0 -17
- package/build/batchloaders/loadBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/manyToManyBatchLoader.d.ts +0 -7
- package/build/batchloaders/manyToManyBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/oneToManyBatchLoader.d.ts +0 -7
- package/build/batchloaders/oneToManyBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/oneToOneBatchLoader.d.ts +0 -7
- package/build/batchloaders/oneToOneBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/populateBatchLoader.d.ts +0 -13
- package/build/batchloaders/populateBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.d.ts +0 -7
- package/build/batchloaders/recursiveChildrenBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/recursiveM2mBatchLoader.d.ts +0 -7
- package/build/batchloaders/recursiveM2mBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/recursiveParentsBatchLoader.d.ts +0 -7
- package/build/batchloaders/recursiveParentsBatchLoader.d.ts.map +0 -1
- package/build/changes.d.ts +0 -92
- package/build/changes.d.ts.map +0 -1
- package/build/config.d.ts +0 -250
- package/build/config.d.ts.map +0 -1
- package/build/config.test.d.ts +0 -2
- package/build/config.test.d.ts.map +0 -1
- package/build/config.test.js +0 -53
- package/build/config.test.js.map +0 -1
- package/build/configure.d.ts +0 -15
- package/build/configure.d.ts.map +0 -1
- package/build/dataloaders/fastWhereFilterHash.d.ts +0 -15
- package/build/dataloaders/fastWhereFilterHash.d.ts.map +0 -1
- package/build/dataloaders/fastWhereFilterHash.test.d.ts +0 -2
- package/build/dataloaders/fastWhereFilterHash.test.d.ts.map +0 -1
- package/build/dataloaders/fastWhereFilterHash.test.js +0 -59
- package/build/dataloaders/fastWhereFilterHash.test.js.map +0 -1
- package/build/dataloaders/findByUniqueDataLoader.d.ts +0 -7
- package/build/dataloaders/findByUniqueDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findCountDataLoader.d.ts +0 -16
- package/build/dataloaders/findCountDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findDataLoader.d.ts +0 -76
- package/build/dataloaders/findDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findIdsDataLoader.d.ts +0 -6
- package/build/dataloaders/findIdsDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findOrCreateDataLoader.d.ts +0 -13
- package/build/dataloaders/findOrCreateDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findPaginatedDataLoader.d.ts +0 -7
- package/build/dataloaders/findPaginatedDataLoader.d.ts.map +0 -1
- package/build/dataloaders/lensDataLoader.d.ts +0 -12
- package/build/dataloaders/lensDataLoader.d.ts.map +0 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.ts +0 -8
- package/build/dataloaders/manyToManyFindDataLoader.d.ts.map +0 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.ts +0 -8
- package/build/dataloaders/oneToManyFindDataLoader.d.ts.map +0 -1
- package/build/defaults.d.ts +0 -54
- package/build/defaults.d.ts.map +0 -1
- package/build/driverApi.d.ts +0 -19
- package/build/driverApi.d.ts.map +0 -1
- package/build/drivers/Driver.d.ts +0 -26
- package/build/drivers/Driver.d.ts.map +0 -1
- package/build/drivers/Driver.js.map +0 -1
- package/build/drivers/EntityWriter.d.ts +0 -64
- package/build/drivers/EntityWriter.d.ts.map +0 -1
- package/build/drivers/IdAssigner.d.ts +0 -48
- package/build/drivers/IdAssigner.d.ts.map +0 -1
- package/build/drivers/buildRawQuery.d.ts +0 -22
- package/build/drivers/buildRawQuery.d.ts.map +0 -1
- package/build/drivers/buildUtils.d.ts +0 -9
- package/build/drivers/buildUtils.d.ts.map +0 -1
- package/build/drivers/index.d.ts +0 -6
- package/build/drivers/index.d.ts.map +0 -1
- package/build/drivers/index.js.map +0 -1
- package/build/fields.d.ts +0 -26
- package/build/fields.d.ts.map +0 -1
- package/build/getProperties.d.ts +0 -28
- package/build/getProperties.d.ts.map +0 -1
- package/build/index.d.ts +0 -133
- package/build/index.d.ts.map +0 -1
- package/build/json.d.ts +0 -77
- package/build/json.d.ts.map +0 -1
- package/build/k.d.ts +0 -2
- package/build/k.d.ts.map +0 -1
- package/build/keys.d.ts +0 -49
- package/build/keys.d.ts.map +0 -1
- package/build/keywords.d.ts +0 -5
- package/build/keywords.d.ts.map +0 -1
- package/build/loadHints.d.ts +0 -121
- package/build/loadHints.d.ts.map +0 -1
- package/build/loadLens.d.ts +0 -77
- package/build/loadLens.d.ts.map +0 -1
- package/build/logging/FactoryLogger.d.ts +0 -24
- package/build/logging/FactoryLogger.d.ts.map +0 -1
- package/build/logging/FieldLogger.d.ts +0 -27
- package/build/logging/FieldLogger.d.ts.map +0 -1
- package/build/logging/ReactionLogger.d.ts +0 -27
- package/build/logging/ReactionLogger.d.ts.map +0 -1
- package/build/newEntity.d.ts +0 -45
- package/build/newEntity.d.ts.map +0 -1
- package/build/newTestInstance.d.ts +0 -208
- package/build/newTestInstance.d.ts.map +0 -1
- package/build/normalizeHints.d.ts +0 -23
- package/build/normalizeHints.d.ts.map +0 -1
- package/build/plugins/ImmutableEntitiesPlugin.d.ts +0 -9
- package/build/plugins/ImmutableEntitiesPlugin.d.ts.map +0 -1
- package/build/plugins/PreloadPlugin.d.ts +0 -69
- package/build/plugins/PreloadPlugin.d.ts.map +0 -1
- package/build/plugins/PreloadPlugin.js.map +0 -1
- package/build/preloading/JsonAggregatePreloader.d.ts +0 -16
- package/build/preloading/JsonAggregatePreloader.d.ts.map +0 -1
- package/build/preloading/canPreload.d.ts +0 -3
- package/build/preloading/canPreload.d.ts.map +0 -1
- package/build/preloading/partitionHint.d.ts +0 -5
- package/build/preloading/partitionHint.d.ts.map +0 -1
- package/build/reactiveHints.d.ts +0 -146
- package/build/reactiveHints.d.ts.map +0 -1
- package/build/relations/AbstractPropertyImpl.d.ts +0 -8
- package/build/relations/AbstractPropertyImpl.d.ts.map +0 -1
- package/build/relations/AbstractRelationImpl.d.ts +0 -41
- package/build/relations/AbstractRelationImpl.d.ts.map +0 -1
- package/build/relations/AsyncProperty.d.ts +0 -36
- package/build/relations/AsyncProperty.d.ts.map +0 -1
- package/build/relations/AsyncReactiveField.d.ts +0 -41
- package/build/relations/AsyncReactiveField.d.ts.map +0 -1
- package/build/relations/Collection.d.ts +0 -33
- package/build/relations/Collection.d.ts.map +0 -1
- package/build/relations/CustomCollection.d.ts +0 -69
- package/build/relations/CustomCollection.d.ts.map +0 -1
- package/build/relations/CustomReference.d.ts +0 -71
- package/build/relations/CustomReference.d.ts.map +0 -1
- package/build/relations/EnumCollection.d.ts +0 -81
- package/build/relations/EnumCollection.d.ts.map +0 -1
- package/build/relations/LargeCollection.d.ts +0 -19
- package/build/relations/LargeCollection.d.ts.map +0 -1
- package/build/relations/LargeCollection.js.map +0 -1
- package/build/relations/ManyToManyCollection.d.ts +0 -52
- package/build/relations/ManyToManyCollection.d.ts.map +0 -1
- package/build/relations/ManyToManyLargeCollection.d.ts +0 -31
- package/build/relations/ManyToManyLargeCollection.d.ts.map +0 -1
- package/build/relations/ManyToOneReference.d.ts +0 -117
- package/build/relations/ManyToOneReference.d.ts.map +0 -1
- package/build/relations/OneToManyCollection.d.ts +0 -62
- package/build/relations/OneToManyCollection.d.ts.map +0 -1
- package/build/relations/OneToManyLargeCollection.d.ts +0 -26
- package/build/relations/OneToManyLargeCollection.d.ts.map +0 -1
- package/build/relations/OneToOneReference.d.ts +0 -93
- package/build/relations/OneToOneReference.d.ts.map +0 -1
- package/build/relations/PolymorphicReference.d.ts +0 -89
- package/build/relations/PolymorphicReference.d.ts.map +0 -1
- package/build/relations/ReactiveField.d.ts +0 -85
- package/build/relations/ReactiveField.d.ts.map +0 -1
- package/build/relations/ReactiveGetter.d.ts +0 -30
- package/build/relations/ReactiveGetter.d.ts.map +0 -1
- package/build/relations/ReactiveManyToMany.d.ts +0 -57
- package/build/relations/ReactiveManyToMany.d.ts.map +0 -1
- package/build/relations/ReactiveManyToManyOtherSide.d.ts +0 -48
- package/build/relations/ReactiveManyToManyOtherSide.d.ts.map +0 -1
- package/build/relations/ReactiveReference.d.ts +0 -119
- package/build/relations/ReactiveReference.d.ts.map +0 -1
- package/build/relations/ReadOnlyCollection.d.ts +0 -19
- package/build/relations/ReadOnlyCollection.d.ts.map +0 -1
- package/build/relations/RecursiveCollection.d.ts +0 -108
- package/build/relations/RecursiveCollection.d.ts.map +0 -1
- package/build/relations/RecursiveCycleError.d.ts +0 -13
- package/build/relations/RecursiveCycleError.d.ts.map +0 -1
- package/build/relations/Reference.d.ts +0 -35
- package/build/relations/Reference.d.ts.map +0 -1
- package/build/relations/Relation.d.ts +0 -14
- package/build/relations/Relation.d.ts.map +0 -1
- package/build/relations/hasAsyncMethod.d.ts +0 -27
- package/build/relations/hasAsyncMethod.d.ts.map +0 -1
- package/build/relations/hasManyDerived.d.ts +0 -22
- package/build/relations/hasManyDerived.d.ts.map +0 -1
- package/build/relations/hasManyThrough.d.ts +0 -10
- package/build/relations/hasManyThrough.d.ts.map +0 -1
- package/build/relations/hasOneDerived.d.ts +0 -12
- package/build/relations/hasOneDerived.d.ts.map +0 -1
- package/build/relations/hasOneThrough.d.ts +0 -10
- package/build/relations/hasOneThrough.d.ts.map +0 -1
- package/build/relations/hasProperty.d.ts +0 -50
- package/build/relations/hasProperty.d.ts.map +0 -1
- package/build/relations/index.d.ts +0 -30
- package/build/relations/index.d.ts.map +0 -1
- package/build/relations/index.js.map +0 -1
- package/build/resurrection.d.ts +0 -10
- package/build/resurrection.d.ts.map +0 -1
- package/build/rules.d.ts +0 -123
- package/build/rules.d.ts.map +0 -1
- package/build/runtimeConfig.d.ts +0 -17
- package/build/runtimeConfig.d.ts.map +0 -1
- package/build/scopes.d.ts +0 -185
- package/build/scopes.d.ts.map +0 -1
- package/build/serde.d.ts +0 -277
- package/build/serde.d.ts.map +0 -1
- package/build/temporal.d.ts +0 -46
- package/build/temporal.d.ts.map +0 -1
- package/build/temporalMappers.d.ts +0 -25
- package/build/temporalMappers.d.ts.map +0 -1
- package/build/trusted.d.ts +0 -5
- package/build/trusted.d.ts.map +0 -1
- package/build/typeMap.d.ts +0 -68
- package/build/typeMap.d.ts.map +0 -1
- package/build/typeMap.js.map +0 -1
- package/build/unnest.d.ts +0 -13
- package/build/unnest.d.ts.map +0 -1
- package/build/upsert.d.ts +0 -42
- package/build/upsert.d.ts.map +0 -1
- package/build/utils.d.ts +0 -60
- package/build/utils.d.ts.map +0 -1
- package/build/withLoaded.d.ts +0 -56
- package/build/withLoaded.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findDataLoader.js","sourceRoot":"","sources":["../../src/dataloaders/findDataLoader.ts"],"names":[],"mappings":";;;AAsCA,wCAgHC;AASD,0CAEC;AAED,0CAIC;AAGD,sDAgBC;AAiCD,sDAiDC;AAmBD,wEAaC;AAGD,sCAcC;AAiID,wCAkBC;AA+BD,0EAUC;AAvfD,gEAAgD;AAChD,oDAAmG;AACnG,sDAAgE;AAChE,0CAA4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AAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,IAAA,oBAAW,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,SAAgB,+BAA+B,CAAC,IAAoB,EAAE,KAAsB;IAC1F,6FAA6F;IAC7F,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,WAAW,CAAC,KAAK,CAAC,CAAC;IACnB,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC/B,8EAA8E;QAC7E,KAAa,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAClC,CAAC;IACD,qDAAqD;IACrD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC"}
|
|
1
|
+
{"version":3,"file":"findDataLoader.js","names":[],"sources":["../../src/dataloaders/findDataLoader.ts"],"sourcesContent":["import { type OpColumn } from \"../drivers/EntityWriter.ts\";\nimport { type Entity } from \"../Entity.ts\";\nimport { type FilterAndSettings } from \"../EntityFilter.ts\";\nimport { opToFn } from \"../EntityGraphQLFilter.ts\";\nimport { type EntityManager, type MaybeAbstractEntityConstructor, getEmInternalApi } from \"../EntityManager.ts\";\nimport { type EntityMetadata, getMetadata } from \"../EntityMetadata.ts\";\nimport { equal, equalArrays } from \"../fields.ts\";\nimport { buildHintTree } from \"../HintTree.ts\";\nimport { kqDot } from \"../keywords.ts\";\nimport { type LoadHint } from \"../loadHints.ts\";\nimport { hintKey } from \"../normalizeHints.ts\";\nimport {\n type ColumnCondition,\n type ParsedCteClause,\n type ParsedFindQuery,\n type ParsedGroupBy,\n type ParsedSelect,\n type ParsedValueFilter,\n type RawCondition,\n getTables,\n parseAlias,\n parseFindQuery,\n} from \"../QueryParser.ts\";\nimport { visitConditions } from \"../QueryVisitor.ts\";\nimport { buildUnnestCte } from \"../unnest.ts\";\nimport { assertNever, fail } from \"../utils.ts\";\nimport { fastWhereFilterHash } from \"./fastWhereFilterHash.ts\";\n\nexport const findOperation = \"find\";\n\ninterface PreparedFindEntry<T extends Entity> {\n filter: FilterAndSettings<T>;\n query: ParsedFindQuery;\n bindings: any[];\n findSettings: any;\n checkLimit: boolean | undefined;\n}\n\nexport function findDataLoader<T extends Entity>(\n em: EntityManager,\n type: MaybeAbstractEntityConstructor<T>,\n filter: FilterAndSettings<T>,\n hint: LoadHint<T> | undefined,\n): Promise<T[]> {\n const { where, ...opts } = filter;\n if (\"limit\" in opts || \"offset\" in opts) {\n throw new Error(\"Cannot use limit/offset with findDataLoader\");\n }\n\n const meta = getMetadata(type);\n const query = parseFindQuery(meta, where, opts);\n const { checkLimit, findSettings } = em[\"prepareFind\"](meta, findOperation, query, {\n ...opts,\n limit: em.entityLimit,\n });\n const bindings: any[] = [];\n collectValues(bindings, query);\n const prepared = { filter, query, bindings, findSettings, checkLimit } satisfies PreparedFindEntry<T>;\n const batchKey = getBatchKeyFromGenericStructure(meta, query);\n\n return em\n .getLoader<PreparedFindEntry<T>, T[]>(\n findOperation,\n // It's unlikely we'll have simultaneous em.finds with the same WHERE clause structure\n // but lots of different load hints, and it'd be complicated to implement the preloading\n // in a way that doesn't naively over-fetch data (which our loadDataLoader does prevent,\n // but it's simpler b/c it's given exact ids to load), so for now just include the load\n // hint in the batch key.\n `${batchKey}-${hintKey(hint)}`,\n async (entries) => {\n // We're guaranteed that these queries all have the same structure\n\n // Don't bother with the CTE if there's only 1 query (or each query has exactly the same filter values)\n if (entries.length === 1) {\n const { query, findSettings, checkLimit } = entries[0];\n // Maybe add preload joins\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator = preloader && hint && preloader.addPreloading(meta, buildHintTree(hint), query);\n const rowData = await em[\"executePreparedFindRowData\"](meta, findOperation, query, findSettings, checkLimit);\n const entities = em[\"hydrateAndFinalize\"](type, rowData, {\n sidecars: (entities) => preloadHydrator?.(rowData, entities),\n });\n return [filterDeletedEntities(em, entities)];\n }\n\n // WITH _find (tag, arg1, arg2) AS (\n // SELECT unnest($0::int[]), unnest($0::varchar[]), unnest($0::varchar[])\n // )\n // SELECT a.*, array_agg(_find.tag) AS _tags\n // FROM authors a\n // CROSS JOIN _find AS _find\n // WHERE a.first_name = _find.arg0 OR a.last_name = _find.arg1\n // GROUP BY a.id\n\n // Build the list of 'arg1', 'arg2', ... strings\n const { query, findSettings, checkLimit } = entries[0];\n const { preloader } = getEmInternalApi(em);\n const preloadJoins = preloader && hint && preloader.getPreloadJoins(meta, buildHintTree(hint), query);\n\n const args = collectAndReplaceArgs(query, entries);\n const argsColumns: OpColumn[] = [{ columnName: \"tag\", dbType: \"int\" }, ...args.map((a) => a.column)];\n const columnValues = createColumnValuesFromPrepared(args, entries);\n const query2: ParsedFindQuery = {\n ...query,\n selects: [\"array_agg(_find.tag) as _tags\", ...query.selects],\n tables: [{ join: \"cross\", table: \"_find\", alias: \"_find\" }, ...query.tables],\n ctes: [buildUnnestCte(\"_find\", argsColumns, columnValues), ...(query.ctes ?? [])],\n };\n if (preloadJoins) {\n query2.selects.push(\n ...preloadJoins.flatMap((j) =>\n // Because we 'group by primary.id' to collapse the \"a1 matched multiple finds\" into\n // a single row, we also need to pick just the first value of each preload column\n j.selects.map((s) => `(array_agg(${s.value}))[1] AS ${s.as}`),\n ),\n );\n query2.tables.push(...preloadJoins.map((j) => j.join));\n }\n\n // Because we want to use `array_agg(tag)`, add `GROUP BY`s to the values we're selecting\n query2.groupBys = buildGroupBys(query2.selects);\n\n // Also because of our `array_agg` group by, add any order bys to the group by\n const [primary] = getTables(query2);\n for (const { alias, column } of query2.orderBys) {\n if (alias !== primary.alias) {\n query2.groupBys.push({ alias, column });\n }\n }\n\n const rowData = await em[\"executePreparedFindRowData\"](meta, findOperation, query2, findSettings, checkLimit);\n\n // Make an empty array for each batched query, per the dataloader contract\n const results = entries.map(() => [] as T[]);\n em[\"hydrateAndFinalize\"](type, rowData, {\n sidecars: (entities) => {\n preloadJoins?.forEach((j) => j.hydrator(rowData, entities));\n // Put each row into the tagged query it matched\n for (let i = 0; i < entities.length; i++) {\n const entity = entities[i];\n if (!entity.isDeletedEntity) {\n for (const tag of rowData.get(i, \"_tags\")) results[tag].push(entity);\n }\n }\n },\n });\n return results;\n },\n // Our filter/order tuple is a complex object, so use a stable cache key to ensure caching works.\n { cacheKeyFn: queryFilterHash },\n )\n .load(prepared);\n}\n\n/**\n * Returns a stable cache key from the already-parsed query rather than the raw `where`.\n *\n * A scope `where` is an opaque proxy that `fastWhereFilterHash` can't serialize — but it doesn't need\n * to: by this point the scope's structure and values are already worked into the `ParsedFindQuery`, so\n * hashing that distinguishes e.g. `Author.adult` (age>=18) from `Author.senior` (age>=65) correctly.\n */\nexport function queryFilterHash(entry: { query: ParsedFindQuery; findSettings: object }): any {\n return whereFilterHash({ query: entry.query, findSettings: entry.findSettings });\n}\n\nexport function whereFilterHash(where: object): any {\n const key = fastWhereFilterHash(where);\n if (key === undefined) throw new Error(\"fastWhereFilterHash could not serialize find filter\");\n return key;\n}\n\n/** Filters pending-delete entities in place to avoid allocating a replacement array for the common find path. */\nexport function filterDeletedEntities<T extends Entity>(em: EntityManager, entities: T[]): T[] {\n // Most EMs never delete entities, so skip even the findIndex scan until a delete has happened.\n if (!getEmInternalApi(em).hasAnyDeletes()) return entities;\n\n const firstDeleted = entities.findIndex((entity) => entity.isDeletedEntity);\n if (firstDeleted === -1) return entities;\n\n let writeIndex = firstDeleted;\n for (let readIndex = firstDeleted + 1; readIndex < entities.length; readIndex++) {\n const entity = entities[readIndex];\n if (!entity.isDeletedEntity) {\n entities[writeIndex++] = entity;\n }\n }\n entities.length = writeIndex;\n return entities;\n}\n\nclass ArgCounter {\n private index = 0;\n next(): number {\n return this.index++;\n }\n}\n\n/**\n * A single batched arg: the `_find` CTE column to create, plus the index into each entry's `bindings`\n * array that fills it. `bindingIndex` can differ from the column's position because inlined constants\n * are skipped — see {@link collectAndReplaceArgs}.\n */\nexport interface CteArg {\n column: OpColumn;\n bindingIndex: number;\n}\n\n/**\n * Rewrites each batched arg in `query` into a `_find.argX` placeholder.\n *\n * Any condition whose value(s) are identical across every batched query is left inline (using\n * query's condition as-is from entity0), so it renders as `col = ?` for better query planning.\n *\n * The returned array has the non-constant CTE columns, one {@link CteArg} per `_find.argX`.\n *\n * Because constants are skipped, the 1st CTE column (i.e. for last name) might actually have a\n * binding index of `1` if we've skipped an early constant column (i.e. first name).\n *\n * @param query the initial query in the batch, that all other queries structurally match\n * @param entries the values (bindings) for each query in the batch\n */\nexport function collectAndReplaceArgs(query: ParsedFindQuery, entries: readonly { bindings: any[] }[]): CteArg[] {\n const args: CteArg[] = [];\n const argsIndex = new ArgCounter();\n // `bindings` were pushed in this same `visitConditions` order, so we can walk the conditions and\n // each entry's `bindings` in lockstep, deciding per condition whether to inline or batch its value(s).\n const constant = computeConstantBindings(entries);\n let bindingIndex = 0;\n visitConditions(query, {\n visitCond(c: ColumnCondition) {\n if (\"value\" in c.cond) {\n const { kind } = c.cond;\n // `between` consumes two bindings, everything else (incl. array `in`/`nin`) consumes one.\n const consumed = kind === \"between\" ? 2 : 1;\n const start = bindingIndex;\n bindingIndex += consumed;\n // If every batched query shares this condition's value(s), leave it as a normal `col = ?`\n // condition (rendered from `entries[0]`'s value) instead of threading it through the CTE.\n let allConstant = true;\n for (let k = 0; k < consumed; k++) {\n if (!constant[start + k]) {\n allConstant = false;\n break;\n }\n }\n if (allConstant) return;\n // `arg${args.length}` keeps the CTE column names in step with the `_find.argX` references that\n // `rewriteToRawCondition` emits, since both only advance for the args we actually batch.\n if (kind === \"between\") {\n args.push({ column: { columnName: `arg${args.length}`, dbType: c.dbType }, bindingIndex: start });\n args.push({ column: { columnName: `arg${args.length}`, dbType: c.dbType }, bindingIndex: start + 1 });\n } else {\n // Figure out the _find CTE's `unnest($n::${dbType})` so Postgres knows what we're sending in\n const dbType =\n kind === \"in\" || kind === \"nin\"\n ? `${c.dbType}[]` // `in`/`nin` compare against an array column\n : kind === \"jsonPathExists\" || kind === \"jsonPathPredicate\"\n ? \"jsonpath\" // jsonPath needs `::jsonpath` (not `::jsonb`, which would be an invalid `jsonb @@ jsonb`)\n : c.dbType;\n args.push({ column: { columnName: `arg${args.length}`, dbType }, bindingIndex: start });\n }\n return rewriteToRawCondition(c, argsIndex);\n } else if (c.cond.kind === \"is-null\" || c.cond.kind === \"not-null\") {\n // leave it alone\n } else {\n throw new Error(\"Unsupported\");\n }\n },\n });\n return args;\n}\n\nfunction rewriteToRawCondition(c: ColumnCondition, argsIndex: ArgCounter): RawCondition {\n const [op, negate] = makeOp(c.cond, argsIndex);\n return {\n kind: \"raw\",\n aliases: [c.alias],\n condition: `${negate ? \"NOT \" : \"\"}${kqDot(c.alias, c.column)} ${op}`,\n pruneable: c.pruneable ?? false,\n bindings: [],\n };\n}\n\n/**\n * Builds the column-major values for the `_find` CTE.\n *\n * Column 0 is the per-entry `tag`; the remaining columns mirror `args` 1:1, each pulling its\n * `bindingIndex` from every entry's `bindings` (so inlined constants are naturally skipped).\n */\nexport function createColumnValuesFromPrepared(\n args: readonly CteArg[],\n entries: readonly { bindings: any[] }[],\n): any[][] {\n const columnValues: any[][] = new Array(args.length + 1);\n for (let i = 0; i < columnValues.length; i++) columnValues[i] = [];\n entries.forEach((entry, i) => {\n columnValues[0].push(i);\n for (let k = 0; k < args.length; k++) {\n columnValues[k + 1].push(entry.bindings[args[k].bindingIndex]);\n }\n });\n return columnValues;\n}\n\n/** Pushes the arg values of a given query in the cross-query `bindings` array. */\nexport function collectValues(bindings: any[], query: ParsedFindQuery): void {\n visitConditions(query, {\n visitCond(c: ColumnCondition) {\n if (\"value\" in c.cond) {\n // between has two values\n if (c.cond.kind === \"between\") {\n bindings.push(c.cond.value[0]);\n bindings.push(c.cond.value[1]);\n } else {\n bindings.push(c.cond.value);\n }\n }\n },\n });\n}\n\n/** Returns true for select expressions that do not need to be represented in GROUP BY. */\nfunction isAggregateSelect(select: string): boolean {\n return select.toLowerCase().includes(\"array_agg(\");\n}\n\n/** Builds GROUP BYs for selected values, accounting for whole-row selects that are grouped by primary key. */\nfunction buildGroupBys(selects: ParsedSelect[]): ParsedGroupBy[] {\n const sqlSelects = selects.map(selectSqlForGroupBy);\n const wholeRowAliases = new Set(\n sqlSelects\n .filter((select) => !isAggregateSelect(select) && stripSelectAlias(select).endsWith(\".*\"))\n .map(parseAlias),\n );\n return sqlSelects\n .filter((select) => !isAggregateSelect(select))\n .filter((select) => !isCoveredByWholeRowGroupBy(select, wholeRowAliases))\n .map((select) => groupBySelect(select));\n}\n\n/** Returns a SQL string for group-by analysis, until we support bindings in ParsedGroupBy. */\nfunction selectSqlForGroupBy(select: ParsedSelect): string {\n if (typeof select === \"string\") {\n return select;\n }\n throw new Error(`find batching does not support grouped selects with bindings: ${select.sql}`);\n}\n\n/** Builds a GROUP BY for a selected value so `array_agg(_find.tag)` can coexist with plugin-rewritten selects. */\nfunction groupBySelect(select: string): ParsedGroupBy {\n const expression = stripSelectAlias(select);\n if (expression.endsWith(\".*\")) {\n return { alias: parseAlias(expression), column: \"id\" };\n }\n return { expression };\n}\n\n/** Removes a trailing SQL alias from a select expression, i.e. `(a.id) as id` -> `(a.id)`. */\nfunction stripSelectAlias(select: string): string {\n const match = /^(.*)\\s+as\\s+[^\\s]+$/i.exec(select);\n return match?.[1] ?? select;\n}\n\n/** Returns true when an expression is functionally covered by an already-grouped whole-row alias. */\nfunction isCoveredByWholeRowGroupBy(select: string, wholeRowAliases: Set<string>): boolean {\n const expression = stripSelectAlias(select);\n if (expression.endsWith(\".*\")) {\n return false;\n }\n const aliases = findSelectedAliases(expression);\n return aliases.length > 0 && aliases.every((alias) => wholeRowAliases.has(alias));\n}\n\n/** Finds SQL aliases referenced as `alias.column` or `\"alias\".column`, i.e. `a.first_name` -> `a`. */\nfunction findSelectedAliases(expression: string): string[] {\n const aliases = new Set<string>();\n for (const match of expression.matchAll(/(?:\"([^\"]+)\"|([a-zA-Z_][\\w]*))\\./g)) {\n aliases.add(match[1] ?? match[2]);\n }\n return [...aliases];\n}\n\n/** Returns [operator, argsTaken, negate], i.e. `[\"=\", 1, false]`. */\nfunction makeOp(cond: ParsedValueFilter<any>, argsIndex: ArgCounter): [string, boolean] {\n switch (cond.kind) {\n case \"eq\":\n case \"ne\":\n case \"gte\":\n case \"gt\":\n case \"lte\":\n case \"lt\":\n case \"like\":\n case \"nlike\":\n case \"ilike\":\n case \"nilike\":\n case \"regex\":\n case \"nregex\":\n case \"iregex\":\n case \"niregex\":\n case \"jsonPathExists\":\n case \"jsonPathPredicate\":\n case \"contains\":\n case \"overlaps\":\n case \"containedBy\": {\n const fn = opToFn[cond.kind] ?? fail(`Invalid operator ${cond.kind}`);\n return [`${fn} _find.arg${argsIndex.next()}`, false];\n }\n case \"noverlaps\":\n case \"ncontains\": {\n const fn = (opToFn as any)[cond.kind.substring(1)] ?? fail(`Invalid operator ${cond.kind}`);\n return [`${fn} _find.arg${argsIndex.next()}`, true];\n }\n case \"is-null\":\n return [`IS NULL`, false];\n case \"not-null\":\n return [`IS NOT NULL`, false];\n case \"in\":\n return [`= ANY(_find.arg${argsIndex.next()})`, false];\n case \"nin\":\n return [`!= ALL(_find.arg${argsIndex.next()})`, false];\n case \"between\":\n return [`BETWEEN _find.arg${argsIndex.next()} AND _find.arg${argsIndex.next()}`, false];\n default:\n assertNever(cond);\n }\n}\n\n/**\n * Creates a `VALUES (...), (...)` SQL string for use in a CTE, typically for our\n * batch INSERTs/UPDATEs where the CTE is how we inject N rows of data/params into\n * the single INSERT/UPDATE statement.\n *\n * The caller is responsible for filling in the `bindings`, which should have 1\n * entry for each `rows x columns` cell.\n *\n * @deprecated Use newUnnestCte instead because it uses arrays to have a bounded number of parameters.\n */\nexport function buildValuesCte(\n alias: string,\n columns: { columnName: string; dbType: string }[],\n rows: readonly any[],\n // Should have a value for each `row x column` cell.\n bindings: readonly any[],\n): ParsedCteClause {\n return {\n alias,\n columns,\n query: {\n kind: \"raw\",\n sql: `VALUES\n ${rows.map((_, i) => `(${columns.map((c) => (i === 0 ? `?::${c.dbType}` : `?`)).join(\", \")})`).join(\", \")}\n `,\n bindings,\n },\n };\n}\n\n/** Returns, per binding slot, whether every batched query shares the same value. */\nfunction computeConstantBindings(entries: readonly { bindings: any[] }[]): boolean[] {\n const length = entries[0].bindings.length;\n const constant = new Array<boolean>(length);\n for (let j = 0; j < length; j++) {\n const first = entries[0].bindings[j];\n let same = true;\n for (let i = 1; i < entries.length; i++) {\n if (!argsEqual(entries[i].bindings[j], first)) {\n same = false;\n break;\n }\n }\n constant[j] = same;\n }\n return constant;\n}\n\n/**\n * Deep-equals two find-arg values (scalars, Dates, Temporals, or arrays thereof), reusing the same\n * scalar/array equality `setField` uses for change detection.\n *\n * Only used to decide whether a condition can be inlined, so false negatives are safe (we just fall\n * back to the CTE); we only return true when the values are genuinely equal.\n */\nfunction argsEqual(a: any, b: any): boolean {\n return equal(a, b) || (Array.isArray(a) && Array.isArray(b) && equalArrays(a, b));\n}\n\nexport function getBatchKeyFromGenericStructure(meta: EntityMetadata, query: ParsedFindQuery): string {\n // Temporarily swap condition values for `*` so we can see the generic structure of the query,\n // then restore them; this avoids deep-cloning the entire parsed query on every em.find call.\n // Track values per condition object b/c parseFindQuery does not deep copy complex conditions,\n // i.e. `a.firstName.eq(...)`, so the same condition instance could appear twice.\n const saved = new Map<any, any>();\n visitConditions(query, {\n visitCond(c: ColumnCondition) {\n const { cond } = c;\n if (\"value\" in cond && !saved.has(cond)) {\n saved.set(cond, cond.value);\n cond.value = \"*\";\n }\n },\n });\n const structure = JSON.stringify(query);\n for (const [cond, value] of saved) cond.value = value;\n // Include the meta b/c STI queries for different subtypes will look identical\n return meta.stiDiscriminatorValue ? `${structure}|${meta.type}` : structure;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAa,gBAAgB;AAU7B,SAAgB,eACd,IACA,MACA,QACA,MACc;CACd,MAAM,EAAE,OAAO,GAAG,SAAS;CAC3B,IAAI,WAAW,QAAQ,YAAY,MACjC,MAAM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MAAM,EAAE,WAAW,GAAI,CAAC,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE;;GAE5G;EACF;CACF;AACF;;AAGA,SAAS,wBAAwB,SAAoD;CACnF,MAAM,SAAS,QAAQ,EAAE,CAAC,SAAS;CACnC,MAAM,WAAW,IAAI,MAAe,MAAM;CAC1C,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,KAAK;EAC/B,MAAM,QAAQ,QAAQ,EAAE,CAAC,SAAS;EAClC,IAAI,OAAO;EACX,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAClC,IAAI,CAAC,UAAU,QAAQ,EAAE,CAAC,SAAS,IAAI,KAAK,GAAG;GAC7C,OAAO;GACP;EACF;EAEF,SAAS,KAAK;CAChB;CACA,OAAO;AACT;;;;;;;;AASA,SAAS,UAAU,GAAQ,GAAiB;CAC1C,OAAO,MAAM,GAAG,CAAC,KAAM,MAAM,QAAQ,CAAC,KAAK,MAAM,QAAQ,CAAC,KAAK,YAAY,GAAG,CAAC;AACjF;AAEA,SAAgB,gCAAgC,MAAsB,OAAgC;CAKpG,MAAM,wBAAQ,IAAI,IAAc;CAChC,gBAAgB,OAAO,EACrB,UAAU,GAAoB;EAC5B,MAAM,EAAE,SAAS;EACjB,IAAI,WAAW,QAAQ,CAAC,MAAM,IAAI,IAAI,GAAG;GACvC,MAAM,IAAI,MAAM,KAAK,KAAK;GAC1B,KAAK,QAAQ;EACf;CACF,EACF,CAAC;CACD,MAAM,YAAY,KAAK,UAAU,KAAK;CACtC,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,KAAK,QAAQ;CAEhD,OAAO,KAAK,wBAAwB,GAAG,UAAU,GAAG,KAAK,SAAS;AACpE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../EntityFilter.cjs");
|
|
3
|
+
const require_keywords = require("../keywords.cjs");
|
|
4
|
+
const require_keys = require("../keys.cjs");
|
|
5
|
+
const require_EntityMetadata = require("../EntityMetadata.cjs");
|
|
6
|
+
const require_utils = require("../utils.cjs");
|
|
7
|
+
const require_unnest = require("../unnest.cjs");
|
|
8
|
+
const require_dataloaders_findDataLoader = require("./findDataLoader.cjs");
|
|
9
|
+
require("../EntityManager.cjs");
|
|
10
|
+
require("../Entity.cjs");
|
|
11
|
+
const require_QueryParser = require("../QueryParser.cjs");
|
|
12
|
+
//#region src/dataloaders/findIdsDataLoader.ts
|
|
13
|
+
const findIdsOperation = "find-ids";
|
|
14
|
+
function findIdsDataLoader(em, type, filter) {
|
|
15
|
+
const { where, ...opts } = filter;
|
|
16
|
+
if (opts.limit || opts.offset) throw new Error("Cannot use limit/offset with findIdsDataLoader");
|
|
17
|
+
const meta = require_EntityMetadata.getMetadata(type);
|
|
18
|
+
const query = require_QueryParser.parseFindQuery(meta, where, opts);
|
|
19
|
+
const { findSettings } = em["prepareFind"](meta, findIdsOperation, query, {
|
|
20
|
+
...opts,
|
|
21
|
+
limit: void 0
|
|
22
|
+
});
|
|
23
|
+
const bindings = [];
|
|
24
|
+
require_dataloaders_findDataLoader.collectValues(bindings, query);
|
|
25
|
+
const prepared = {
|
|
26
|
+
filter,
|
|
27
|
+
query,
|
|
28
|
+
bindings,
|
|
29
|
+
findSettings
|
|
30
|
+
};
|
|
31
|
+
const batchKey = require_dataloaders_findDataLoader.getBatchKeyFromGenericStructure(meta, query);
|
|
32
|
+
return em.getLoader(findIdsOperation, batchKey, async (entries) => {
|
|
33
|
+
if (entries.length === 1) {
|
|
34
|
+
const { query, findSettings } = entries[0];
|
|
35
|
+
const primary = query.tables.find((t) => t.join === "primary") ?? require_utils.fail("No primary");
|
|
36
|
+
query.selects = [`${require_keywords.kq(primary.alias)}.id as id`];
|
|
37
|
+
query.orderBys = [{
|
|
38
|
+
alias: primary.alias,
|
|
39
|
+
column: "id",
|
|
40
|
+
order: "ASC"
|
|
41
|
+
}];
|
|
42
|
+
return [(await em["executePreparedFind"](meta, findIdsOperation, query, findSettings, false)).map((row) => require_keys.keyToTaggedId(meta, row.id))];
|
|
43
|
+
}
|
|
44
|
+
const { query, findSettings } = entries[0];
|
|
45
|
+
const args = require_dataloaders_findDataLoader.collectAndReplaceArgs(query, entries);
|
|
46
|
+
const argsColumns = [{
|
|
47
|
+
columnName: "tag",
|
|
48
|
+
dbType: "int"
|
|
49
|
+
}, ...args.map((a) => a.column)];
|
|
50
|
+
const primary = query.tables.find((t) => t.join === "primary") ?? require_utils.fail("No primary");
|
|
51
|
+
query.selects = [`${require_keywords.kq(primary.alias)}.id as id`];
|
|
52
|
+
query.orderBys = [{
|
|
53
|
+
alias: primary.alias,
|
|
54
|
+
column: "id",
|
|
55
|
+
order: "ASC"
|
|
56
|
+
}];
|
|
57
|
+
const query2 = {
|
|
58
|
+
selects: ["_find.tag as tag", "_data.id as id"],
|
|
59
|
+
tables: [{
|
|
60
|
+
join: "primary",
|
|
61
|
+
table: "_find",
|
|
62
|
+
alias: "_find"
|
|
63
|
+
}, {
|
|
64
|
+
join: "lateral",
|
|
65
|
+
query,
|
|
66
|
+
table: meta.tableName,
|
|
67
|
+
alias: "_data",
|
|
68
|
+
fromAlias: "_f"
|
|
69
|
+
}],
|
|
70
|
+
ctes: [require_unnest.buildUnnestCte("_find", argsColumns, require_dataloaders_findDataLoader.createColumnValuesFromPrepared(args, entries))],
|
|
71
|
+
orderBys: []
|
|
72
|
+
};
|
|
73
|
+
const rows = await em["executePreparedFind"](meta, findIdsOperation, query2, findSettings, false);
|
|
74
|
+
const results = entries.map(() => []);
|
|
75
|
+
for (const row of rows) results[row.tag].push(require_keys.keyToTaggedId(meta, row.id));
|
|
76
|
+
return results;
|
|
77
|
+
}, { cacheKeyFn: require_dataloaders_findDataLoader.queryFilterHash }).load(prepared);
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
exports.findIdsDataLoader = findIdsDataLoader;
|
|
81
|
+
exports.findIdsOperation = findIdsOperation;
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=findIdsDataLoader.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findIdsDataLoader.cjs","names":["getMetadata","parseFindQuery","getBatchKeyFromGenericStructure","fail","kq","keyToTaggedId","collectAndReplaceArgs","buildUnnestCte","createColumnValuesFromPrepared","queryFilterHash"],"sources":["../../src/dataloaders/findIdsDataLoader.ts"],"sourcesContent":["import { type Entity } from \"../Entity.ts\";\nimport { type FilterAndSettings } from \"../EntityFilter.ts\";\nimport { type EntityManager, type MaybeAbstractEntityConstructor } from \"../EntityManager.ts\";\nimport { getMetadata } from \"../EntityMetadata.ts\";\nimport { keyToTaggedId } from \"../keys.ts\";\nimport { kq } from \"../keywords.ts\";\nimport { type ParsedFindQuery, parseFindQuery } from \"../QueryParser.ts\";\nimport { buildUnnestCte } from \"../unnest.ts\";\nimport { fail } from \"../utils.ts\";\nimport {\n collectAndReplaceArgs,\n collectValues,\n createColumnValuesFromPrepared,\n getBatchKeyFromGenericStructure,\n queryFilterHash,\n} from \"./findDataLoader.ts\";\n\nexport const findIdsOperation = \"find-ids\";\n\nexport function findIdsDataLoader<T extends Entity>(\n em: EntityManager,\n type: MaybeAbstractEntityConstructor<T>,\n filter: FilterAndSettings<T>,\n): Promise<string[]> {\n const { where, ...opts } = filter;\n if (opts.limit || opts.offset) {\n throw new Error(\"Cannot use limit/offset with findIdsDataLoader\");\n }\n\n const meta = getMetadata(type);\n const query = parseFindQuery(meta, where, opts);\n const { findSettings } = em[\"prepareFind\"](meta, findIdsOperation, query, { ...opts, limit: undefined });\n const bindings: any[] = [];\n collectValues(bindings, query);\n const prepared = { filter, query, bindings, findSettings };\n const batchKey = getBatchKeyFromGenericStructure(meta, query);\n\n return em\n .getLoader<typeof prepared, string[]>(\n findIdsOperation,\n batchKey,\n async (entries) => {\n // We're guaranteed that these queries all have the same structure\n\n // Don't bother with the CTE if there's only 1 query (or each query has exactly the same filter values)\n if (entries.length === 1) {\n const { query, findSettings } = entries[0];\n const primary = query.tables.find((t) => t.join === \"primary\") ?? fail(\"No primary\");\n query.selects = [`${kq(primary.alias)}.id as id`];\n query.orderBys = [{ alias: primary.alias, column: \"id\", order: \"ASC\" }];\n const rows = await em[\"executePreparedFind\"](meta, findIdsOperation, query, findSettings, false);\n return [rows.map((row: any) => keyToTaggedId(meta, row.id)!)];\n }\n\n // WITH _find (tag, arg1, arg2) AS (\n // SELECT unnest($0::int[]) unnest($0::varchar[]), unnest($0::varchar[])\n // )\n // SELECT _find.tag, _data.id\n // FROM _find\n // CROSS JOIN LATERAL (\n // SELECT distinct a.id as id\n // FROM author a WHERE a.first_name = _find.arg1 OR a.last_name = _find.arg2\n // ) _data\n\n // Build the list of 'arg1', 'arg2', ... strings\n const { query, findSettings } = entries[0];\n const args = collectAndReplaceArgs(query, entries);\n const argsColumns = [{ columnName: \"tag\", dbType: \"int\" }, ...args.map((a) => a.column)];\n\n // We're not returning the entities, just selecting their IDs\n const primary = query.tables.find((t) => t.join === \"primary\") ?? fail(\"No primary\");\n query.selects = [`${kq(primary.alias)}.id as id`];\n query.orderBys = [{ alias: primary.alias, column: \"id\", order: \"ASC\" }];\n\n const query2: ParsedFindQuery = {\n selects: [\"_find.tag as tag\", \"_data.id as id\"],\n tables: [\n { join: \"primary\", table: \"_find\", alias: \"_find\" },\n { join: \"lateral\", query, table: meta.tableName, alias: \"_data\", fromAlias: \"_f\" },\n ],\n // For each unique query, capture its filter values in `bindings` to populate the CTE _find table\n ctes: [buildUnnestCte(\"_find\", argsColumns, createColumnValuesFromPrepared(args, entries))],\n orderBys: [],\n };\n\n const rows = await em[\"executePreparedFind\"](meta, findIdsOperation, query2, findSettings, false);\n\n // Make an empty array for each batched query, per the dataloader contract\n const results: string[][] = entries.map(() => []);\n // Then put each row's ID into the tagged query it matched\n for (const row of rows) {\n results[row.tag].push(keyToTaggedId(meta, row.id)!);\n }\n return results;\n },\n // Our filter/order tuple is a complex object, so use a st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AAO,QAAQ;EAAM,GAAG,GAAG,KAAK,KAAK,MAAM,EAAE,MAAM,CAAC;EAGvF,MAAM,UAAU,MAAM,OAAO,MAAM,MAAM,EAAE,SAAS,SAAS,KAAKH,cAAAA,KAAK,YAAY;EACnF,MAAM,UAAU,CAAC,GAAGC,iBAAAA,GAAG,QAAQ,KAAK,EAAE,UAAU;EAChD,MAAM,WAAW,CAAC;GAAE,OAAO,QAAQ;GAAO,QAAQ;GAAM,OAAO;EAAM,CAAC;EAEtE,MAAM,SAA0B;GAC9B,SAAS,CAAC,oBAAoB,gBAAgB;GAC9C,QAAQ,CACN;IAAE,MAAM;IAAW,OAAO;IAAS,OAAO;GAAQ,GAClD;IAAE,MAAM;IAAW;IAAO,OAAO,KAAK;IAAW,OAAO;IAAS,WAAW;GAAK,CACnF;GAEA,MAAM,CAACG,eAAAA,eAAe,SAAS,aAAaC,mCAAAA,+BAA+B,MAAM,OAAO,CAAC,CAAC;GAC1F,UAAU,CAAC;EACb;EAEA,MAAM,OAAO,MAAM,GAAG,sBAAsB,CAAC,MAAM,kBAAkB,QAAQ,cAAc,KAAK;EAGhG,MAAM,UAAsB,QAAQ,UAAU,CAAC,CAAC;EAEhD,KAAK,MAAM,OAAO,MAChB,QAAQ,IAAI,IAAI,CAAC,KAAKH,aAAAA,cAAc,MAAM,IAAI,EAAE,CAAE;EAEpD,OAAO;CACT,GAEA,EAAE,YAAYI,mCAAAA,gBAAgB,CAChC,CAAC,CACA,KAAK,QAAQ;AAClB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EntityManager, MaybeAbstractEntityConstructor } from "../EntityManager.cjs";
|
|
2
|
+
import { Entity } from "../Entity.cjs";
|
|
3
|
+
import { FilterAndSettings } from "../EntityFilter.cjs";
|
|
4
|
+
//#region src/dataloaders/findIdsDataLoader.d.ts
|
|
5
|
+
declare const findIdsOperation = "find-ids";
|
|
6
|
+
declare function findIdsDataLoader<T extends Entity>(em: EntityManager, type: MaybeAbstractEntityConstructor<T>, filter: FilterAndSettings<T>): Promise<string[]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { findIdsDataLoader, findIdsOperation };
|
|
9
|
+
//# sourceMappingURL=findIdsDataLoader.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findIdsDataLoader.d.cts","names":[],"sources":["../../src/dataloaders/findIdsDataLoader.ts"],"mappings":";;;;cAiBa;iBAEG,kBAAkB,UAAU,QAC1C,IAAI,eACJ,MAAM,+BAA+B,IACrC,QAAQ,kBAAkB,KACzB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EntityManager, MaybeAbstractEntityConstructor } from "../EntityManager.mjs";
|
|
2
|
+
import { Entity } from "../Entity.mjs";
|
|
3
|
+
import { FilterAndSettings } from "../EntityFilter.mjs";
|
|
4
|
+
//#region src/dataloaders/findIdsDataLoader.d.ts
|
|
5
|
+
declare const findIdsOperation = "find-ids";
|
|
6
|
+
declare function findIdsDataLoader<T extends Entity>(em: EntityManager, type: MaybeAbstractEntityConstructor<T>, filter: FilterAndSettings<T>): Promise<string[]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { findIdsDataLoader, findIdsOperation };
|
|
9
|
+
//# sourceMappingURL=findIdsDataLoader.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findIdsDataLoader.d.mts","names":[],"sources":["../../src/dataloaders/findIdsDataLoader.ts"],"mappings":";;;;cAiBa;iBAEG,kBAAkB,UAAU,QAC1C,IAAI,eACJ,MAAM,+BAA+B,IACrC,QAAQ,kBAAkB,KACzB"}
|
|
@@ -1,77 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import "../EntityFilter.js";
|
|
2
|
+
import { kq } from "../keywords.js";
|
|
3
|
+
import { keyToTaggedId } from "../keys.js";
|
|
4
|
+
import { getMetadata } from "../EntityMetadata.js";
|
|
5
|
+
import { fail } from "../utils.js";
|
|
6
|
+
import { buildUnnestCte } from "../unnest.js";
|
|
7
|
+
import { collectAndReplaceArgs, collectValues, createColumnValuesFromPrepared, getBatchKeyFromGenericStructure, queryFilterHash } from "./findDataLoader.js";
|
|
8
|
+
import "../EntityManager.js";
|
|
9
|
+
import "../Entity.js";
|
|
10
|
+
import { parseFindQuery } from "../QueryParser.js";
|
|
11
|
+
//#region src/dataloaders/findIdsDataLoader.ts
|
|
12
|
+
const findIdsOperation = "find-ids";
|
|
13
13
|
function findIdsDataLoader(em, type, filter) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
14
|
+
const { where, ...opts } = filter;
|
|
15
|
+
if (opts.limit || opts.offset) throw new Error("Cannot use limit/offset with findIdsDataLoader");
|
|
16
|
+
const meta = getMetadata(type);
|
|
17
|
+
const query = parseFindQuery(meta, where, opts);
|
|
18
|
+
const { findSettings } = em["prepareFind"](meta, findIdsOperation, query, {
|
|
19
|
+
...opts,
|
|
20
|
+
limit: void 0
|
|
21
|
+
});
|
|
22
|
+
const bindings = [];
|
|
23
|
+
collectValues(bindings, query);
|
|
24
|
+
const prepared = {
|
|
25
|
+
filter,
|
|
26
|
+
query,
|
|
27
|
+
bindings,
|
|
28
|
+
findSettings
|
|
29
|
+
};
|
|
30
|
+
const batchKey = getBatchKeyFromGenericStructure(meta, query);
|
|
31
|
+
return em.getLoader(findIdsOperation, batchKey, async (entries) => {
|
|
32
|
+
if (entries.length === 1) {
|
|
33
|
+
const { query, findSettings } = entries[0];
|
|
34
|
+
const primary = query.tables.find((t) => t.join === "primary") ?? fail("No primary");
|
|
35
|
+
query.selects = [`${kq(primary.alias)}.id as id`];
|
|
36
|
+
query.orderBys = [{
|
|
37
|
+
alias: primary.alias,
|
|
38
|
+
column: "id",
|
|
39
|
+
order: "ASC"
|
|
40
|
+
}];
|
|
41
|
+
return [(await em["executePreparedFind"](meta, findIdsOperation, query, findSettings, false)).map((row) => keyToTaggedId(meta, row.id))];
|
|
42
|
+
}
|
|
43
|
+
const { query, findSettings } = entries[0];
|
|
44
|
+
const args = collectAndReplaceArgs(query, entries);
|
|
45
|
+
const argsColumns = [{
|
|
46
|
+
columnName: "tag",
|
|
47
|
+
dbType: "int"
|
|
48
|
+
}, ...args.map((a) => a.column)];
|
|
49
|
+
const primary = query.tables.find((t) => t.join === "primary") ?? fail("No primary");
|
|
50
|
+
query.selects = [`${kq(primary.alias)}.id as id`];
|
|
51
|
+
query.orderBys = [{
|
|
52
|
+
alias: primary.alias,
|
|
53
|
+
column: "id",
|
|
54
|
+
order: "ASC"
|
|
55
|
+
}];
|
|
56
|
+
const query2 = {
|
|
57
|
+
selects: ["_find.tag as tag", "_data.id as id"],
|
|
58
|
+
tables: [{
|
|
59
|
+
join: "primary",
|
|
60
|
+
table: "_find",
|
|
61
|
+
alias: "_find"
|
|
62
|
+
}, {
|
|
63
|
+
join: "lateral",
|
|
64
|
+
query,
|
|
65
|
+
table: meta.tableName,
|
|
66
|
+
alias: "_data",
|
|
67
|
+
fromAlias: "_f"
|
|
68
|
+
}],
|
|
69
|
+
ctes: [buildUnnestCte("_find", argsColumns, createColumnValuesFromPrepared(args, entries))],
|
|
70
|
+
orderBys: []
|
|
71
|
+
};
|
|
72
|
+
const rows = await em["executePreparedFind"](meta, findIdsOperation, query2, findSettings, false);
|
|
73
|
+
const results = entries.map(() => []);
|
|
74
|
+
for (const row of rows) results[row.tag].push(keyToTaggedId(meta, row.id));
|
|
75
|
+
return results;
|
|
76
|
+
}, { cacheKeyFn: queryFilterHash }).load(prepared);
|
|
76
77
|
}
|
|
78
|
+
//#endregion
|
|
79
|
+
export { findIdsDataLoader, findIdsOperation };
|
|
80
|
+
|
|
77
81
|
//# sourceMappingURL=findIdsDataLoader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findIdsDataLoader.js","
|
|
1
|
+
{"version":3,"file":"findIdsDataLoader.js","names":[],"sources":["../../src/dataloaders/findIdsDataLoader.ts"],"sourcesContent":["import { type Entity } from \"../Entity.ts\";\nimport { type FilterAndSettings } from \"../EntityFilter.ts\";\nimport { type EntityManager, type MaybeAbstractEntityConstructor } from \"../EntityManager.ts\";\nimport { getMetadata } from \"../EntityMetadata.ts\";\nimport { keyToTaggedId } from \"../keys.ts\";\nimport { kq } from \"../keywords.ts\";\nimport { type ParsedFindQuery, parseFindQuery } from \"../QueryParser.ts\";\nimport { buildUnnestCte } from \"../unnest.ts\";\nimport { fail } from \"../utils.ts\";\nimport {\n collectAndReplaceArgs,\n collectValues,\n createColumnValuesFromPrepared,\n getBatchKeyFromGenericStructure,\n queryFilterHash,\n} from \"./findDataLoader.ts\";\n\nexport const findIdsOperation = \"find-ids\";\n\nexport function findIdsDataLoader<T extends Entity>(\n em: EntityManager,\n type: MaybeAbstractEntityConstructor<T>,\n filter: FilterAndSettings<T>,\n): Promise<string[]> {\n const { where, ...opts } = filter;\n if (opts.limit || opts.offset) {\n throw new Error(\"Cannot use limit/offset with findIdsDataLoader\");\n }\n\n const meta = getMetadata(type);\n const query = parseFindQuery(meta, where, opts);\n const { findSettings } = em[\"prepareFind\"](meta, findIdsOperation, query, { ...opts, limit: undefined });\n const bindings: any[] = [];\n collectValues(bindings, query);\n const prepared = { filter, query, bindings, findSettings };\n const batchKey = getBatchKeyFromGenericStructure(meta, query);\n\n return em\n .getLoader<typeof prepared, string[]>(\n findIdsOperation,\n batchKey,\n async (entries) => {\n // We're guaranteed that these queries all have the same structure\n\n // Don't bother with the CTE if there's only 1 query (or each query has exactly the same filter values)\n if (entries.length === 1) {\n const { query, findSettings } = entries[0];\n const primary = query.tables.find((t) => t.join === \"primary\") ?? fail(\"No primary\");\n query.selects = [`${kq(primary.alias)}.id as id`];\n query.orderBys = [{ alias: primary.alias, column: \"id\", order: \"ASC\" }];\n const rows = await em[\"executePreparedFind\"](meta, findIdsOperation, query, findSettings, false);\n return [rows.map((row: any) => keyToTaggedId(meta, row.id)!)];\n }\n\n // WITH _find (tag, arg1, arg2) AS (\n // SELECT unnest($0::int[]) unnest($0::varchar[]), unnest($0::varchar[])\n // )\n // SELECT _find.tag, _data.id\n // FROM _find\n // CROSS JOIN LATERAL (\n // SELECT distinct a.id as id\n // FROM author a WHERE a.first_name = _find.arg1 OR a.last_name = _find.arg2\n // ) _data\n\n // Build the list of 'arg1', 'arg2', ... strings\n const { query, findSettings } = entries[0];\n const args = collectAndReplaceArgs(query, entries);\n const argsColumns = [{ columnName: \"tag\", dbType: \"int\" }, ...args.map((a) => a.column)];\n\n // We're not returning the entities, just selecting their IDs\n const primary = query.tables.find((t) => t.join === \"primary\") ?? fail(\"No primary\");\n query.selects = [`${kq(primary.alias)}.id as id`];\n query.orderBys = [{ alias: primary.alias, column: \"id\", order: \"ASC\" }];\n\n const query2: ParsedFindQuery = {\n selects: [\"_find.tag as tag\", \"_data.id as id\"],\n tables: [\n { join: \"primary\", table: \"_find\", alias: \"_find\" },\n { join: \"lateral\", query, table: meta.tableName, alias: \"_data\", fromAlias: \"_f\" },\n ],\n // For each unique query, capture its filter values in `bindings` to populate the CTE _find table\n ctes: [buildUnnestCte(\"_find\", argsColumns, createColumnValuesFromPrepared(args, entries))],\n orderBys: [],\n };\n\n const rows = await em[\"executePreparedFind\"](meta, findIdsOperation, query2, findSettings, false);\n\n // Make an empty array for each batched query, per the dataloader contract\n const results: string[][] = entries.map(() => []);\n // Then put each row's ID into the tagged query it matched\n for (const row of rows) {\n results[row.tag].push(keyToTaggedId(meta, row.id)!);\n }\n return results;\n },\n // Our filter/order tuple is a complex object, so use a stable cache key to ensure caching works.\n { cacheKeyFn: queryFilterHash },\n )\n .load(prepared);\n}\n"],"mappings":";;;;;;;;;;;AAiBA,MAAa,mBAAmB;AAEhC,SAAgB,kBACd,IACA,MACA,QACmB;CACnB,MAAM,EAAE,OAAO,GAAG,SAAS;CAC3B,IAAI,KAAK,SAAS,KAAK,QACrB,MAAM,IAAI,MAAM,gDAAgD;CAGlE,MAAM,OAAO,YAAY,IAAI;CAC7B,MAAM,QAAQ,eAAe,MAAM,OAAO,IAAI;CAC9C,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,MAAM,kBAAkB,OAAO;EAAE,GAAG;EAAM,OAAO,KAAA;CAAU,CAAC;CACvG,MAAM,WAAkB,CAAC;CACzB,cAAc,UAAU,KAAK;CAC7B,MAAM,WAAW;EAAE;EAAQ;EAAO;EAAU;CAAa;CACzD,MAAM,WAAW,gCAAgC,MAAM,KAAK;CAE5D,OAAO,GACJ,UACC,kBACA,UACA,OAAO,YAAY;EAIjB,IAAI,QAAQ,WAAW,GAAG;GACxB,MAAM,EAAE,OAAO,iBAAiB,QAAQ;GACxC,MAAM,UAAU,MAAM,OAAO,MAAM,MAAM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;EAEpD,OAAO;CACT,GAEA,EAAE,YAAY,gBAAgB,CAChC,CAAC,CACA,KAAK,QAAQ;AAClB"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../typeMap.cjs");
|
|
3
|
+
const require_relations_Reference = require("../relations/Reference.cjs");
|
|
4
|
+
require("../relations/index.cjs");
|
|
5
|
+
const require_EntityMetadata = require("../EntityMetadata.cjs");
|
|
6
|
+
const require_utils = require("../utils.cjs");
|
|
7
|
+
const require_dataloaders_findDataLoader = require("./findDataLoader.cjs");
|
|
8
|
+
const require_resurrection = require("../resurrection.cjs");
|
|
9
|
+
const require_EntityManager = require("../EntityManager.cjs");
|
|
10
|
+
const require_Entity = require("../Entity.cjs");
|
|
11
|
+
//#region src/dataloaders/findOrCreateDataLoader.ts
|
|
12
|
+
function findOrCreateDataLoader(em, type, where, softDeletes) {
|
|
13
|
+
const meta = require_EntityMetadata.getMetadata(type);
|
|
14
|
+
const hasAnyStrings = Object.values(meta.allFields).some((f) => f.kind === "primitive" && f.type === "string");
|
|
15
|
+
const hasAnyCitext = Object.values(meta.allFields).some((f) => f.kind === "primitive" && f.citext);
|
|
16
|
+
where = hasAnyStrings ? maybeClean(meta, where) : where;
|
|
17
|
+
const whereValue = require_dataloaders_findDataLoader.whereFilterHash(hasAnyCitext ? maybeLower(meta, where) : where);
|
|
18
|
+
const batchKey = `${type.name}-${whereValue}-${softDeletes}`;
|
|
19
|
+
const invalidKeys = Object.keys(where).filter((key) => {
|
|
20
|
+
const field = meta.allFields[key] ?? require_utils.fail(`Invalid field ${key}`);
|
|
21
|
+
return !(field.kind === "primitive" || field.kind === "enum" || field.kind === "m2o" || field.kind === "poly");
|
|
22
|
+
});
|
|
23
|
+
if (invalidKeys.length > 0) throw new Error("findOrCreate only supports primitive, enum, m2o, or poly fields in the where clause. Invalid keys: " + invalidKeys.join(", "));
|
|
24
|
+
return em.getLoader("find-or-create", batchKey, async (keys) => {
|
|
25
|
+
const [{ ifNew, upsert }] = keys;
|
|
26
|
+
const inMemory = em.filterEntities(type, where);
|
|
27
|
+
if (inMemory.length > 1) throw new require_EntityManager.TooManyError(`Found more than one existing ${type.name} with ${whereAsString(where)}`);
|
|
28
|
+
else if (inMemory.length === 1) {
|
|
29
|
+
const entity = inMemory[0];
|
|
30
|
+
require_resurrection.resurrectIfSoftDeleted(entity);
|
|
31
|
+
if (upsert) entity.set(upsert);
|
|
32
|
+
return keys.map(() => entity);
|
|
33
|
+
}
|
|
34
|
+
if (Object.values(where).some((v) => require_Entity.isEntity(v) && v.isNewEntity)) {
|
|
35
|
+
const entity = em.create(type, {
|
|
36
|
+
...where,
|
|
37
|
+
...ifNew
|
|
38
|
+
});
|
|
39
|
+
if (upsert) entity.set(upsert);
|
|
40
|
+
return keys.map(() => entity);
|
|
41
|
+
}
|
|
42
|
+
const entities = await em.find(type, Object.fromEntries(Object.entries(where).map(([k, v]) => [k, v === void 0 ? null : v])), { softDeletes: "include" });
|
|
43
|
+
let entity;
|
|
44
|
+
if (entities.length > 1) throw new require_EntityManager.TooManyError(`Found more than one existing ${type.name} with ${whereAsString(where)}`);
|
|
45
|
+
else if (entities.length === 1) {
|
|
46
|
+
entity = entities[0];
|
|
47
|
+
require_resurrection.resurrectIfSoftDeleted(entity);
|
|
48
|
+
} else entity = em.create(type, {
|
|
49
|
+
...where,
|
|
50
|
+
...ifNew
|
|
51
|
+
});
|
|
52
|
+
if (upsert) entity.set(upsert);
|
|
53
|
+
return keys.map(() => entity);
|
|
54
|
+
}, { cacheKeyFn: require_dataloaders_findDataLoader.whereFilterHash });
|
|
55
|
+
}
|
|
56
|
+
/** A simple in-memory match of `entity` against a mini/flat "WHERE clause" of `opts`. */
|
|
57
|
+
function entityMatches(entity, opts) {
|
|
58
|
+
const meta = require_EntityMetadata.getMetadata(entity);
|
|
59
|
+
return Object.entries(opts).every(([fieldName, value]) => {
|
|
60
|
+
const field = meta.allFields[fieldName] ?? require_utils.fail(`Invalid field ${fieldName}`);
|
|
61
|
+
const fn = fieldName;
|
|
62
|
+
switch (field.kind) {
|
|
63
|
+
case "primaryKey":
|
|
64
|
+
case "enum": return entity[fn] === value;
|
|
65
|
+
case "primitive": if (field.citext) return compareCaseInsensitive(entity[fn], value);
|
|
66
|
+
else return entity[fn] === value;
|
|
67
|
+
case "m2o":
|
|
68
|
+
case "poly":
|
|
69
|
+
const relation = entity[fn];
|
|
70
|
+
if (require_relations_Reference.isLoadedReference(relation)) return require_EntityManager.sameEntity(relation.get, value);
|
|
71
|
+
else if (relation.isSet) return require_EntityManager.sameEntity(relation.id, value);
|
|
72
|
+
else return value === void 0 || value === null;
|
|
73
|
+
default: throw new Error(`Unsupported field ${fieldName}`);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function whereAsString(where) {
|
|
78
|
+
return Object.entries(where).map(([key, value]) => `${key}=${value}`).join(", ");
|
|
79
|
+
}
|
|
80
|
+
function compareCaseInsensitive(str1, str2) {
|
|
81
|
+
return str1 !== void 0 && str2 !== void 0 && typeof str1 === "string" && typeof str2 === "string" && str1.toLowerCase() === str2.toLowerCase();
|
|
82
|
+
}
|
|
83
|
+
/** Returns a copy of `opts` with any `citext` values turned to lower case. */
|
|
84
|
+
function maybeLower(meta, opts) {
|
|
85
|
+
if (!opts) return opts;
|
|
86
|
+
let result = void 0;
|
|
87
|
+
for (const k in opts) {
|
|
88
|
+
const v = opts[k];
|
|
89
|
+
const field = meta.allFields[k];
|
|
90
|
+
if (field && field.kind === "primitive" && field.type === "string" && field.citext) {
|
|
91
|
+
const lowered = v?.toLowerCase();
|
|
92
|
+
if (lowered !== v) {
|
|
93
|
+
result ??= { ...opts };
|
|
94
|
+
result[k] = lowered;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return result ?? opts;
|
|
99
|
+
}
|
|
100
|
+
/** Returns a copy of `opts` with any string values trimmed/coalesced. */
|
|
101
|
+
function maybeClean(meta, opts) {
|
|
102
|
+
if (!opts) return opts;
|
|
103
|
+
let result = void 0;
|
|
104
|
+
for (const k in opts) {
|
|
105
|
+
const v = opts[k];
|
|
106
|
+
const field = meta.allFields[k];
|
|
107
|
+
if (field && field.kind === "primitive" && field.type === "string" && field.sanitize !== false) {
|
|
108
|
+
const cleaned = require_utils.cleanStringValue(v);
|
|
109
|
+
if (cleaned !== v) {
|
|
110
|
+
result ??= { ...opts };
|
|
111
|
+
result[k] = cleaned;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return result ?? opts;
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
exports.entityMatches = entityMatches;
|
|
119
|
+
exports.findOrCreateDataLoader = findOrCreateDataLoader;
|
|
120
|
+
|
|
121
|
+
//# sourceMappingURL=findOrCreateDataLoader.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findOrCreateDataLoader.cjs","names":["getMetadata","whereFilterHash","fail","TooManyError","isEntity","isLoadedReference","sameEntity","cleanStringValue"],"sources":["../../src/dataloaders/findOrCreateDataLoader.ts"],"sourcesContent":["import type DataLoader from \"dataloader\";\n\nimport { type Entity, isEntity } from \"../Entity.ts\";\nimport { type EntityConstructor, type EntityManager, TooManyError, sameEntity } from \"../EntityManager.ts\";\nimport { type EntityMetadata, getMetadata } from \"../EntityMetadata.ts\";\nimport { type ManyToOneReference, type PolymorphicReference, isLoadedReference } from \"../relations/index.ts\";\nimport { resurrectIfSoftDeleted } from \"../resurrection.ts\";\nimport { type OptsOf } from \"../typeMap.ts\";\nimport { cleanStringValue, fail } from \"../utils.ts\";\nimport { whereFilterHash } from \"./findDataLoader.ts\";\n\ninterface FindOrCreateKey<T extends Entity> {\n ifNew: OptsOf<T>;\n upsert: Partial<OptsOf<T>> | undefined;\n}\n\nexport function findOrCreateDataLoader<T extends Entity>(\n em: EntityManager,\n type: EntityConstructor<T>,\n where: Partial<OptsOf<T>>,\n softDeletes: \"include\" | \"exclude\",\n): DataLoader<FindOrCreateKey<T>, T> {\n const meta = getMetadata(type);\n\n // Do some extra logic to make unclean strings/citext not create duplicate entities\n const hasAnyStrings = Object.values(meta.allFields).some((f) => f.kind === \"primitive\" && f.type === \"string\");\n const hasAnyCitext = Object.values(meta.allFields).some((f) => f.kind === \"primitive\" && f.citext);\n\n // The `where` here will be later used to `em.create`, so we only clean (not lower for citext)\n where = hasAnyStrings ? maybeClean(meta, where) : where;\n // Use `whereFilterHash` to batch the same `findOrCreate` `where: { firstName: \"a1\" }` calls together to avoid duplicates\n const whereValue = whereFilterHash(\n // Only maybeLower for the purposes of batching, not the later em.create\n hasAnyCitext ? maybeLower(meta, where) : (where as any),\n );\n const batchKey = `${type.name}-${whereValue}-${softDeletes}`;\n\n const invalidKeys = Object.keys(where).filter((key) => {\n const field = meta.allFields[key] ?? fail(`Invalid field ${key}`);\n const supported =\n field.kind === \"primitive\" || field.kind === \"enum\" || field.kind === \"m2o\" || field.kind === \"poly\";\n return !supported;\n });\n if (invalidKeys.length > 0) {\n throw new Error(\n \"findOrCreate only supports primitive, enum, m2o, or poly fields in the where clause. Invalid keys: \" +\n invalidKeys.join(\", \"),\n );\n }\n\n return em.getLoader<FindOrCreateKey<T>, T>(\n \"find-or-create\",\n batchKey,\n async (keys) => {\n // Because our `batchKey` is based only on the `where` clause, if the user called\n // `findOrCreate({ firstName: a1 })` multiple times, but with different ifNew/upsert\n // conditions (or different cased strings and is using a citext column), we'll end\n // up with multiple keys...\n //\n // This is fundamentally asking to create the same entity, but with different ifNew/upsert\n // conditions, which we could fail on, but for now just take the first tuple of\n // {where/ifNew/upsert} and assume it wins\n const [{ ifNew, upsert }] = keys;\n\n // Before we find/create an entity, see if we have a maybe-new one in the EM already.\n // This will also use any WIP changes we've made to the found entity, which ideally is\n // something `em.find` would do as well, but its queries are much more complex...\n const inMemory = em.filterEntities(type, where);\n if (inMemory.length > 1) {\n throw new TooManyError(`Found more than one existing ${type.name} with ${whereAsString(where)}`);\n } else if (inMemory.length === 1) {\n const entity = inMemory[0] as T;\n resurrectIfSoftDeleted(entity);\n if (upsert) {\n entity.set(upsert);\n }\n return keys.map(() => entity);\n }\n\n // If there is a param like `{ publisher: newPublisherEntity }`, then we know that\n // an entity matching this condition can't be in the db anyway, so skip the em.find\n const hasNewEntityParam = Object.values(where).some((v) => isEntity(v) && v.isNewEntity);\n if (hasNewEntityParam) {\n const entity = em.create(type, { ...where, ...(ifNew as object) } as OptsOf<T>);\n if (upsert) {\n entity.set(upsert);\n }\n return keys.map(() => entity);\n }\n\n // If we didn't find it in the EM, do the db query/em.create\n const entities = await em.find(\n type,\n // Convert `publisher: undefined` --> `publisher: null`, and we need to make a copy anyway\n Object.fromEntries(Object.entries(where).map(([k, v]) => [k, v === undefined ? null : v])) as any,\n // Always include soft-deleted rows so findOrCreate can resurrect them instead of creating duplicates.\n { softDeletes: \"include\" },\n );\n let entity: T;\n if (entities.length > 1) {\n throw new TooManyError(`Found more than one existing ${type.name} with ${whereAsString(where)}`);\n } else if (entities.length === 1) {\n entity = entities[0];\n resurrectIfSoftDeleted(entity);\n } else {\n entity = em.create(type, { ...where, ...(ifNew as object) } as OptsOf<T>);\n }\n if (upsert) {\n entity.set(upsert);\n }\n return keys.map(() => entity);\n },\n // Our filter tuple is a complex object, so use a stable cache key to ensure caching works.\n { cacheKeyFn: whereFilterHash as any },\n );\n}\n\n/** A simple in-memory match of `entity` against a mini/flat \"WHERE clause\" of `opts`. */\nexport function entityMatches<T extends Entity>(entity: T, opts: Partial<OptsOf<T>>): boolean {\n const meta = getMetadata(entity);\n return Object.entries(opts).every(([fieldName, value]) => {\n const field = meta.allFields[fieldName] ?? fail(`Invalid field ${fieldName}`);\n const fn = fieldName as keyof T & keyof OptsOf<T>;\n switch (field.kind) {\n case \"primaryKey\":\n case \"enum\":\n return entity[fn] === value;\n case \"primitive\":\n if (field.citext) {\n return compareCaseInsensitive(entity[fn], value);\n } else {\n return entity[fn] === value;\n }\n case \"m2o\":\n case \"poly\":\n const relation = entity[fn] as ManyToOneReference<T, any, any> | PolymorphicReference<T, any, any>;\n if (isLoadedReference(relation)) {\n // Prefer using `.get` because it will handle new/id-less entities\n return sameEntity(relation.get, value as any);\n } else if (relation.isSet) {\n // Otherwise use ids\n return sameEntity(relation.id as any, value as any);\n } else {\n // Relation is not set, match if value is null-ish (null or undefined)\n return value === undefined || value === null;\n }\n default:\n throw new Error(`Unsupported field ${fieldName}`);\n }\n });\n}\n\nfunction whereAsString(where: object): string {\n return Object.entries(where)\n .map(([key, value]) => `${key}=${value}`)\n .join(\", \");\n}\n\nfunction compareCaseInsensitive(str1: any, str2: any): boolean {\n return (\n str1 !== undefined &&\n str2 !== undefined &&\n typeof str1 === \"string\" &&\n typeof str2 === \"string\" &&\n str1.toLowerCase() === str2.toLowerCase()\n );\n}\n\n/** Returns a copy of `opts` with any `citext` values turned to lower case. */\nfunction maybeLower<T extends object | undefined>(meta: EntityMetadata, opts: T): T {\n if (!opts) return opts;\n let result: T | undefined = undefined;\n for (const k in opts) {\n const v = (opts as any)[k];\n const field = meta.allFields[k];\n const isString = field && field.kind === \"primitive\" && field.type === \"string\";\n if (isString && field.citext) {\n const lowered = v?.toLowerCase();\n if (lowered !== v) {\n result ??= { ...opts };\n (result as any)[k] = lowered as any;\n }\n }\n }\n return result ?? opts;\n}\n\n/** Returns a copy of `opts` with any string values trimmed/coalesced. */\nfunction maybeClean<T extends object | undefined>(meta: EntityMetadata, opts: T): T {\n if (!opts) return opts;\n let result: T | undefined = undefined;\n for (const k in opts) {\n const v = (opts as any)[k];\n const field = meta.allFields[k];\n const isString = field && field.kind === \"primitive\" && field.type === \"string\";\n if (isString && field.sanitize !== false) {\n const cleaned = cleanStringValue(v);\n if (cleaned !== v) {\n result ??= { ...opts }; // Only create copy on first change\n (result as any)[k] = cleaned;\n }\n }\n }\n return result ?? opts;\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAAgB,uBACd,IACA,MAC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EACF;CACF;CACA,OAAO,UAAU;AACnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OptsOf } from "../typeMap.cjs";
|
|
2
|
+
import { EntityConstructor, EntityManager } from "../EntityManager.cjs";
|
|
3
|
+
import { Entity } from "../Entity.cjs";
|
|
4
|
+
import DataLoader from "dataloader";
|
|
5
|
+
//#region src/dataloaders/findOrCreateDataLoader.d.ts
|
|
6
|
+
interface FindOrCreateKey<T extends Entity> {
|
|
7
|
+
ifNew: OptsOf<T>;
|
|
8
|
+
upsert: Partial<OptsOf<T>> | undefined;
|
|
9
|
+
}
|
|
10
|
+
declare function findOrCreateDataLoader<T extends Entity>(em: EntityManager, type: EntityConstructor<T>, where: Partial<OptsOf<T>>, softDeletes: "include" | "exclude"): DataLoader<FindOrCreateKey<T>, T>;
|
|
11
|
+
/** A simple in-memory match of `entity` against a mini/flat "WHERE clause" of `opts`. */
|
|
12
|
+
declare function entityMatches<T extends Entity>(entity: T, opts: Partial<OptsOf<T>>): boolean;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { entityMatches, findOrCreateDataLoader };
|
|
15
|
+
//# sourceMappingURL=findOrCreateDataLoader.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findOrCreateDataLoader.d.cts","names":[],"sources":["../../src/dataloaders/findOrCreateDataLoader.ts"],"mappings":";;;;;UAWU,gBAAgB,UAAU;EAClC,OAAO,OAAO;EACd,QAAQ,QAAQ,OAAO;;iBAGT,uBAAuB,UAAU,QAC/C,IAAI,eACJ,MAAM,kBAAkB,IACxB,OAAO,QAAQ,OAAO,KACtB,qCACC,WAAW,gBAAgB,IAAI;;iBAiGlB,cAAc,UAAU,QAAQ,QAAQ,GAAG,MAAM,QAAQ,OAAO"}
|