joist-core 2.3.0-next.96 → 2.3.0-next.97
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/EntityManager.cjs +36 -39
- package/build/EntityManager.cjs.map +1 -1
- package/build/EntityManager.d.cts +4 -4
- package/build/EntityManager.d.mts +4 -4
- package/build/EntityManager.js +29 -32
- package/build/EntityManager.js.map +1 -1
- package/build/EntityMetadata.cjs +3 -3
- package/build/EntityMetadata.js +3 -3
- package/build/IndexManager.cjs +1 -1
- package/build/IndexManager.js +1 -1
- package/build/InstanceData.cjs +1 -1
- package/build/InstanceData.js +1 -1
- package/build/JoinRows.cjs +1 -1
- package/build/JoinRows.js +1 -1
- package/build/PluginManager.cjs +0 -1
- package/build/PluginManager.cjs.map +1 -1
- package/build/PluginManager.d.cts +1 -1
- package/build/PluginManager.d.mts +1 -1
- package/build/PluginManager.js +0 -1
- package/build/PluginManager.js.map +1 -1
- package/build/ReactionsManager.cjs +2 -2
- package/build/ReactionsManager.js +2 -2
- package/build/Todo.cjs +1 -1
- package/build/Todo.js +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.cjs +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.js +1 -1
- package/build/batchloaders/loadBatchLoader.cjs +6 -5
- package/build/batchloaders/loadBatchLoader.cjs.map +1 -1
- package/build/batchloaders/loadBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/loadBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/loadBatchLoader.js +4 -3
- package/build/batchloaders/loadBatchLoader.js.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.cjs +1 -1
- package/build/batchloaders/manyToManyBatchLoader.js +1 -1
- package/build/batchloaders/oneToManyBatchLoader.cjs +3 -3
- package/build/batchloaders/oneToManyBatchLoader.cjs.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.js +2 -2
- package/build/batchloaders/oneToOneBatchLoader.cjs +4 -4
- package/build/batchloaders/oneToOneBatchLoader.cjs.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.js +3 -3
- package/build/batchloaders/populateBatchLoader.cjs +11 -11
- package/build/batchloaders/populateBatchLoader.cjs.map +1 -1
- package/build/batchloaders/populateBatchLoader.js +8 -8
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs +8 -8
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.js +5 -5
- package/build/batchloaders/recursiveM2mBatchLoader.cjs +5 -5
- package/build/batchloaders/recursiveM2mBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.js +2 -2
- package/build/batchloaders/recursiveParentsBatchLoader.cjs +8 -8
- package/build/batchloaders/recursiveParentsBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.js +5 -5
- package/build/changes.cjs +4 -4
- package/build/changes.js +4 -4
- package/build/config.cjs +3 -3
- package/build/config.js +3 -3
- package/build/configure.cjs +6 -6
- package/build/configure.js +6 -6
- package/build/dataloaders/fastWhereFilterHash.cjs +3 -3
- package/build/dataloaders/fastWhereFilterHash.cjs.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.js +2 -2
- package/build/dataloaders/fastWhereFilterHash.js.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.cjs +5 -6
- package/build/dataloaders/findByUniqueDataLoader.cjs.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.js +3 -4
- package/build/dataloaders/findByUniqueDataLoader.js.map +1 -1
- package/build/dataloaders/findCountDataLoader.cjs +10 -13
- package/build/dataloaders/findCountDataLoader.cjs.map +1 -1
- package/build/dataloaders/findCountDataLoader.d.cts +2 -2
- package/build/dataloaders/findCountDataLoader.d.mts +2 -2
- package/build/dataloaders/findCountDataLoader.js +4 -7
- package/build/dataloaders/findCountDataLoader.js.map +1 -1
- package/build/dataloaders/findDataLoader.cjs +15 -19
- package/build/dataloaders/findDataLoader.cjs.map +1 -1
- package/build/dataloaders/findDataLoader.d.cts +2 -2
- package/build/dataloaders/findDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findDataLoader.d.mts +2 -2
- package/build/dataloaders/findDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findDataLoader.js +5 -9
- package/build/dataloaders/findDataLoader.js.map +1 -1
- package/build/dataloaders/findIdsDataLoader.cjs +6 -9
- package/build/dataloaders/findIdsDataLoader.cjs.map +1 -1
- package/build/dataloaders/findIdsDataLoader.d.cts +1 -1
- package/build/dataloaders/findIdsDataLoader.d.mts +1 -1
- package/build/dataloaders/findIdsDataLoader.js +3 -6
- package/build/dataloaders/findIdsDataLoader.js.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.cjs +1 -2
- package/build/dataloaders/findOrCreateDataLoader.cjs.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.js +1 -2
- package/build/dataloaders/findOrCreateDataLoader.js.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.cjs +3 -6
- package/build/dataloaders/findPaginatedDataLoader.cjs.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.cts +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.mts +1 -1
- package/build/dataloaders/findPaginatedDataLoader.js +2 -5
- package/build/dataloaders/findPaginatedDataLoader.js.map +1 -1
- package/build/dataloaders/lensDataLoader.cjs +4 -4
- package/build/dataloaders/lensDataLoader.cjs.map +1 -1
- package/build/dataloaders/lensDataLoader.js +2 -2
- package/build/dataloaders/lensDataLoader.js.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.cjs +1 -4
- package/build/dataloaders/manyToManyFindDataLoader.cjs.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.cts +0 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.mts +0 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.mts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.js +1 -4
- package/build/dataloaders/manyToManyFindDataLoader.js.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.cjs +3 -6
- package/build/dataloaders/oneToManyFindDataLoader.cjs.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.cts +0 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.mts +0 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.mts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.js +2 -5
- package/build/dataloaders/oneToManyFindDataLoader.js.map +1 -1
- package/build/defaults.cjs +4 -4
- package/build/defaults.js +4 -4
- package/build/driverApi.cjs +4 -5
- package/build/driverApi.cjs.map +1 -1
- package/build/driverApi.d.cts +1 -1
- package/build/driverApi.d.mts +1 -1
- package/build/driverApi.js +2 -2
- package/build/driverApi.js.map +1 -1
- package/build/drivers/Driver.cjs +0 -1
- package/build/drivers/Driver.d.cts +1 -1
- package/build/drivers/Driver.d.mts +1 -1
- package/build/drivers/Driver.js +0 -1
- package/build/drivers/EntityWriter.cjs +2 -2
- package/build/drivers/EntityWriter.js +2 -2
- package/build/drivers/index.cjs +0 -6
- package/build/drivers/index.d.cts +1 -3
- package/build/drivers/index.d.mts +1 -3
- package/build/drivers/index.js +1 -3
- package/build/fieldSerde.cjs +2 -2
- package/build/fieldSerde.js +2 -2
- package/build/fields.cjs +2 -2
- package/build/fields.js +2 -2
- package/build/getProperties.cjs +1 -1
- package/build/getProperties.js +1 -1
- package/build/index.cjs +109 -107
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +27 -24
- package/build/index.d.cts.map +1 -1
- package/build/index.d.mts +27 -24
- package/build/index.d.mts.map +1 -1
- package/build/index.js +51 -49
- package/build/index.js.map +1 -1
- package/build/json.cjs +3 -3
- package/build/json.js +3 -3
- package/build/keys.cjs +1 -1
- package/build/keys.js +1 -1
- package/build/loadHints.cjs +1 -1
- package/build/loadHints.js +1 -1
- package/build/loadLens.cjs +1 -1
- package/build/loadLens.js +1 -1
- package/build/logging/FactoryLogger.cjs +1 -1
- package/build/logging/FactoryLogger.js +1 -1
- package/build/logging/FieldLogger.cjs +1 -1
- package/build/logging/FieldLogger.js +1 -1
- package/build/logging/ReactionLogger.cjs +1 -1
- package/build/logging/ReactionLogger.js +1 -1
- package/build/newEntity.cjs +1 -1
- package/build/newEntity.js +1 -1
- package/build/newTestInstance.cjs +3 -3
- package/build/newTestInstance.js +3 -3
- package/build/plugins/PreloadPlugin.cjs +1 -2
- package/build/plugins/PreloadPlugin.d.cts +1 -1
- package/build/plugins/PreloadPlugin.d.mts +1 -1
- package/build/plugins/PreloadPlugin.js +1 -2
- package/build/preloading/JsonAggregatePreloader.cjs +31 -31
- package/build/preloading/JsonAggregatePreloader.cjs.map +1 -1
- package/build/preloading/JsonAggregatePreloader.d.cts +1 -1
- package/build/preloading/JsonAggregatePreloader.d.mts +1 -1
- package/build/preloading/JsonAggregatePreloader.js +6 -6
- package/build/preloading/JsonAggregatePreloader.js.map +1 -1
- package/build/preloading/partitionHint.cjs +3 -3
- package/build/preloading/partitionHint.js +3 -3
- package/build/{ConditionBuilder.cjs → queries/ConditionBuilder.cjs} +7 -8
- package/build/queries/ConditionBuilder.cjs.map +1 -0
- package/build/{ConditionBuilder.d.cts → queries/ConditionBuilder.d.cts} +3 -3
- package/build/queries/ConditionBuilder.d.cts.map +1 -0
- package/build/{ConditionBuilder.d.mts → queries/ConditionBuilder.d.mts} +3 -3
- package/build/queries/ConditionBuilder.d.mts.map +1 -0
- package/build/{ConditionBuilder.js → queries/ConditionBuilder.js} +4 -5
- package/build/queries/ConditionBuilder.js.map +1 -0
- package/build/{conditions.cjs → queries/conditions.cjs} +1 -2
- package/build/queries/conditions.cjs.map +1 -0
- package/build/{conditions.d.cts → queries/conditions.d.cts} +2 -2
- package/build/queries/conditions.d.cts.map +1 -0
- package/build/{conditions.d.mts → queries/conditions.d.mts} +2 -2
- package/build/queries/conditions.d.mts.map +1 -0
- package/build/{conditions.js → queries/conditions.js} +1 -2
- package/build/queries/conditions.js.map +1 -0
- package/build/queries/entityQueryUtils.cjs +60 -0
- package/build/queries/entityQueryUtils.cjs.map +1 -0
- package/build/queries/entityQueryUtils.d.cts +19 -0
- package/build/queries/entityQueryUtils.d.cts.map +1 -0
- package/build/queries/entityQueryUtils.d.mts +19 -0
- package/build/queries/entityQueryUtils.d.mts.map +1 -0
- package/build/queries/entityQueryUtils.js +56 -0
- package/build/queries/entityQueryUtils.js.map +1 -0
- package/build/{Aliases.cjs → queries/find/Aliases.cjs} +23 -28
- package/build/queries/find/Aliases.cjs.map +1 -0
- package/build/{Aliases.d.cts → queries/find/Aliases.d.cts} +7 -7
- package/build/queries/find/Aliases.d.cts.map +1 -0
- package/build/{Aliases.d.mts → queries/find/Aliases.d.mts} +7 -7
- package/build/queries/find/Aliases.d.mts.map +1 -0
- package/build/{Aliases.js → queries/find/Aliases.js} +7 -12
- package/build/queries/find/Aliases.js.map +1 -0
- package/build/{DeferredAlias.cjs → queries/find/DeferredAlias.cjs} +3 -6
- package/build/queries/find/DeferredAlias.cjs.map +1 -0
- package/build/{DeferredAlias.d.cts → queries/find/DeferredAlias.d.cts} +4 -4
- package/build/queries/find/DeferredAlias.d.cts.map +1 -0
- package/build/{DeferredAlias.d.mts → queries/find/DeferredAlias.d.mts} +4 -4
- package/build/queries/find/DeferredAlias.d.mts.map +1 -0
- package/build/{DeferredAlias.js → queries/find/DeferredAlias.js} +2 -5
- package/build/queries/find/DeferredAlias.js.map +1 -0
- package/build/{EntityFilter.cjs → queries/find/EntityFilter.cjs} +4 -9
- package/build/queries/find/EntityFilter.cjs.map +1 -0
- package/build/{EntityFilter.d.cts → queries/find/EntityFilter.d.cts} +6 -6
- package/build/queries/find/EntityFilter.d.cts.map +1 -0
- package/build/{EntityFilter.d.mts → queries/find/EntityFilter.d.mts} +6 -6
- package/build/queries/find/EntityFilter.d.mts.map +1 -0
- package/build/{EntityFilter.js → queries/find/EntityFilter.js} +1 -6
- package/build/queries/find/EntityFilter.js.map +1 -0
- package/build/{EntityGraphQLFilter.cjs → queries/find/EntityGraphQLFilter.cjs} +1 -5
- package/build/queries/find/EntityGraphQLFilter.cjs.map +1 -0
- package/build/{EntityGraphQLFilter.d.cts → queries/find/EntityGraphQLFilter.d.cts} +3 -3
- package/build/queries/find/EntityGraphQLFilter.d.cts.map +1 -0
- package/build/{EntityGraphQLFilter.d.mts → queries/find/EntityGraphQLFilter.d.mts} +3 -3
- package/build/queries/find/EntityGraphQLFilter.d.mts.map +1 -0
- package/build/{EntityGraphQLFilter.js → queries/find/EntityGraphQLFilter.js} +1 -5
- package/build/queries/find/EntityGraphQLFilter.js.map +1 -0
- package/build/{QueryParser.cjs → queries/find/QueryParser.cjs} +68 -356
- package/build/queries/find/QueryParser.cjs.map +1 -0
- package/build/{QueryParser.collectionJoins.cjs → queries/find/QueryParser.collectionJoins.cjs} +8 -8
- package/build/queries/find/QueryParser.collectionJoins.cjs.map +1 -0
- package/build/{QueryParser.collectionJoins.d.cts → queries/find/QueryParser.collectionJoins.d.cts} +1 -1
- package/build/queries/find/QueryParser.collectionJoins.d.cts.map +1 -0
- package/build/{QueryParser.collectionJoins.d.mts → queries/find/QueryParser.collectionJoins.d.mts} +1 -1
- package/build/queries/find/QueryParser.collectionJoins.d.mts.map +1 -0
- package/build/{QueryParser.collectionJoins.js → queries/find/QueryParser.collectionJoins.js} +2 -2
- package/build/queries/find/QueryParser.collectionJoins.js.map +1 -0
- package/build/{QueryParser.d.cts → queries/find/QueryParser.d.cts} +5 -159
- package/build/queries/find/QueryParser.d.cts.map +1 -0
- package/build/{QueryParser.d.mts → queries/find/QueryParser.d.mts} +5 -159
- package/build/queries/find/QueryParser.d.mts.map +1 -0
- package/build/{QueryParser.js → queries/find/QueryParser.js} +15 -295
- package/build/queries/find/QueryParser.js.map +1 -0
- package/build/{QueryParser.pruning.cjs → queries/find/QueryParser.pruning.cjs} +6 -20
- package/build/queries/find/QueryParser.pruning.cjs.map +1 -0
- package/build/queries/find/QueryParser.pruning.d.cts +8 -0
- package/build/queries/find/QueryParser.pruning.d.cts.map +1 -0
- package/build/queries/find/QueryParser.pruning.d.mts +8 -0
- package/build/queries/find/QueryParser.pruning.d.mts.map +1 -0
- package/build/{QueryParser.pruning.js → queries/find/QueryParser.pruning.js} +4 -17
- package/build/queries/find/QueryParser.pruning.js.map +1 -0
- package/build/{QueryVisitor.cjs → queries/find/QueryVisitor.cjs} +2 -3
- package/build/queries/find/QueryVisitor.cjs.map +1 -0
- package/build/{QueryVisitor.d.cts → queries/find/QueryVisitor.d.cts} +3 -2
- package/build/queries/find/QueryVisitor.d.cts.map +1 -0
- package/build/{QueryVisitor.d.mts → queries/find/QueryVisitor.d.mts} +3 -2
- package/build/queries/find/QueryVisitor.d.mts.map +1 -0
- package/build/{QueryVisitor.js → queries/find/QueryVisitor.js} +2 -3
- package/build/queries/find/QueryVisitor.js.map +1 -0
- package/build/{drivers/buildRawQuery.cjs → queries/find/buildFindQuery.cjs} +14 -15
- package/build/queries/find/buildFindQuery.cjs.map +1 -0
- package/build/{drivers/buildRawQuery.d.cts → queries/find/buildFindQuery.d.cts} +3 -3
- package/build/queries/find/buildFindQuery.d.cts.map +1 -0
- package/build/{drivers/buildRawQuery.d.mts → queries/find/buildFindQuery.d.mts} +3 -3
- package/build/queries/find/buildFindQuery.d.mts.map +1 -0
- package/build/{drivers/buildRawQuery.js → queries/find/buildFindQuery.js} +5 -6
- package/build/queries/find/buildFindQuery.js.map +1 -0
- package/build/{scopes.cjs → queries/find/scopes.cjs} +2 -3
- package/build/queries/find/scopes.cjs.map +1 -0
- package/build/{scopes.d.cts → queries/find/scopes.d.cts} +6 -6
- package/build/queries/find/scopes.d.cts.map +1 -0
- package/build/{scopes.d.mts → queries/find/scopes.d.mts} +6 -6
- package/build/queries/find/scopes.d.mts.map +1 -0
- package/build/{scopes.js → queries/find/scopes.js} +2 -3
- package/build/queries/find/scopes.js.map +1 -0
- package/build/queries/parsedConditions.cjs +21 -0
- package/build/queries/parsedConditions.cjs.map +1 -0
- package/build/queries/parsedConditions.d.cts +127 -0
- package/build/queries/parsedConditions.d.cts.map +1 -0
- package/build/queries/parsedConditions.d.mts +127 -0
- package/build/queries/parsedConditions.d.mts.map +1 -0
- package/build/queries/parsedConditions.js +20 -0
- package/build/queries/parsedConditions.js.map +1 -0
- package/build/{drivers/buildUtils.cjs → queries/renderConditions.cjs} +7 -8
- package/build/queries/renderConditions.cjs.map +1 -0
- package/build/{drivers/buildUtils.d.mts → queries/renderConditions.d.cts} +5 -4
- package/build/queries/renderConditions.d.cts.map +1 -0
- package/build/{drivers/buildUtils.d.cts → queries/renderConditions.d.mts} +5 -4
- package/build/queries/renderConditions.d.mts.map +1 -0
- package/build/{drivers/buildUtils.js → queries/renderConditions.js} +4 -5
- package/build/queries/renderConditions.js.map +1 -0
- package/build/{skipCondition.cjs → queries/skipCondition.cjs} +1 -2
- package/build/queries/skipCondition.cjs.map +1 -0
- package/build/{skipCondition.d.cts → queries/skipCondition.d.cts} +2 -2
- package/build/{skipCondition.d.cts.map → queries/skipCondition.d.cts.map} +1 -1
- package/build/{skipCondition.d.mts → queries/skipCondition.d.mts} +2 -2
- package/build/{skipCondition.d.mts.map → queries/skipCondition.d.mts.map} +1 -1
- package/build/{skipCondition.js → queries/skipCondition.js} +1 -2
- package/build/queries/skipCondition.js.map +1 -0
- package/build/{AliasAssigner.cjs → queries/sql/AliasAssigner.cjs} +2 -3
- package/build/queries/sql/AliasAssigner.cjs.map +1 -0
- package/build/{AliasAssigner.d.cts → queries/sql/AliasAssigner.d.cts} +2 -2
- package/build/queries/sql/AliasAssigner.d.cts.map +1 -0
- package/build/{AliasAssigner.d.mts → queries/sql/AliasAssigner.d.mts} +2 -2
- package/build/queries/sql/AliasAssigner.d.mts.map +1 -0
- package/build/{AliasAssigner.js → queries/sql/AliasAssigner.js} +2 -3
- package/build/queries/sql/AliasAssigner.js.map +1 -0
- package/build/{Expr.cjs → queries/sql/Expr.cjs} +9 -9
- package/build/queries/sql/Expr.cjs.map +1 -0
- package/build/{Expr.d.cts → queries/sql/Expr.d.cts} +4 -4
- package/build/queries/sql/Expr.d.cts.map +1 -0
- package/build/{Expr.d.mts → queries/sql/Expr.d.mts} +4 -4
- package/build/queries/sql/Expr.d.mts.map +1 -0
- package/build/{Expr.js → queries/sql/Expr.js} +4 -4
- package/build/queries/sql/Expr.js.map +1 -0
- package/build/{Tables.cjs → queries/sql/Tables.cjs} +63 -67
- package/build/queries/sql/Tables.cjs.map +1 -0
- package/build/{Tables.d.cts → queries/sql/Tables.d.cts} +6 -7
- package/build/queries/sql/Tables.d.cts.map +1 -0
- package/build/{Tables.d.mts → queries/sql/Tables.d.mts} +6 -7
- package/build/queries/sql/Tables.d.mts.map +1 -0
- package/build/{Tables.js → queries/sql/Tables.js} +9 -13
- package/build/queries/sql/Tables.js.map +1 -0
- package/build/{execute.cjs → queries/sql/execute.cjs} +32 -37
- package/build/queries/sql/execute.cjs.map +1 -0
- package/build/{execute.d.cts → queries/sql/execute.d.cts} +6 -6
- package/build/queries/sql/execute.d.cts.map +1 -0
- package/build/{execute.d.mts → queries/sql/execute.d.mts} +6 -6
- package/build/queries/sql/execute.d.mts.map +1 -0
- package/build/{execute.js → queries/sql/execute.js} +5 -10
- package/build/queries/sql/execute.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/arrayAgg.cjs +12 -12
- package/build/queries/sql/expressions/arrayAgg.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/arrayAgg.d.cts +1 -1
- package/build/queries/sql/expressions/arrayAgg.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/arrayAgg.d.mts +1 -1
- package/build/queries/sql/expressions/arrayAgg.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/arrayAgg.js +1 -1
- package/build/queries/sql/expressions/arrayAgg.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/case.cjs +14 -14
- package/build/queries/sql/expressions/case.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/case.d.cts +1 -1
- package/build/queries/sql/expressions/case.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/case.d.mts +1 -1
- package/build/queries/sql/expressions/case.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/case.js +1 -1
- package/build/queries/sql/expressions/case.js.map +1 -0
- package/build/queries/sql/expressions/coalesce.cjs +25 -0
- package/build/queries/sql/expressions/coalesce.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/coalesce.d.cts +1 -1
- package/build/queries/sql/expressions/coalesce.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/coalesce.d.mts +1 -1
- package/build/queries/sql/expressions/coalesce.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/coalesce.js +1 -1
- package/build/queries/sql/expressions/coalesce.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/codecs.cjs +5 -5
- package/build/queries/sql/expressions/codecs.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/codecs.d.cts +1 -1
- package/build/queries/sql/expressions/codecs.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/codecs.d.mts +1 -1
- package/build/queries/sql/expressions/codecs.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/codecs.js +3 -3
- package/build/queries/sql/expressions/codecs.js.map +1 -0
- package/build/queries/sql/expressions/expression.cjs +102 -0
- package/build/queries/sql/expressions/expression.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/expression.d.cts +1 -1
- package/build/queries/sql/expressions/expression.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/expression.d.mts +1 -1
- package/build/queries/sql/expressions/expression.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/expression.js +2 -2
- package/build/queries/sql/expressions/expression.js.map +1 -0
- package/build/queries/sql/expressions/greatest.cjs +25 -0
- package/build/queries/sql/expressions/greatest.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/greatest.d.cts +1 -1
- package/build/queries/sql/expressions/greatest.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/greatest.d.mts +1 -1
- package/build/queries/sql/expressions/greatest.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/greatest.js +1 -1
- package/build/queries/sql/expressions/greatest.js.map +1 -0
- package/build/queries/sql/expressions/least.cjs +25 -0
- package/build/queries/sql/expressions/least.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/least.d.cts +1 -1
- package/build/queries/sql/expressions/least.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/least.d.mts +1 -1
- package/build/queries/sql/expressions/least.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/least.js +1 -1
- package/build/queries/sql/expressions/least.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/nullIf.cjs +6 -6
- package/build/queries/sql/expressions/nullIf.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/nullIf.d.cts +1 -1
- package/build/queries/sql/expressions/nullIf.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/nullIf.d.mts +1 -1
- package/build/queries/sql/expressions/nullIf.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/nullIf.js +1 -1
- package/build/queries/sql/expressions/nullIf.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/parseExpression.cjs +16 -16
- package/build/queries/sql/expressions/parseExpression.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/parseExpression.d.cts +1 -1
- package/build/queries/sql/expressions/parseExpression.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/parseExpression.d.mts +1 -1
- package/build/queries/sql/expressions/parseExpression.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/parseExpression.js +2 -2
- package/build/queries/sql/expressions/parseExpression.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/types.d.cts +1 -1
- package/build/queries/sql/expressions/types.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/types.d.mts +1 -1
- package/build/queries/sql/expressions/types.d.mts.map +1 -0
- package/build/{keywords.cjs → queries/sql/keywords.cjs} +1 -1
- package/build/queries/sql/keywords.cjs.map +1 -0
- package/build/{keywords.d.cts → queries/sql/keywords.d.cts} +1 -1
- package/build/queries/sql/keywords.d.cts.map +1 -0
- package/build/{keywords.d.mts → queries/sql/keywords.d.mts} +1 -1
- package/build/queries/sql/keywords.d.mts.map +1 -0
- package/build/{keywords.js → queries/sql/keywords.js} +1 -1
- package/build/queries/sql/keywords.js.map +1 -0
- package/build/{query.cjs → queries/sql/query.cjs} +83 -84
- package/build/queries/sql/query.cjs.map +1 -0
- package/build/{query.d.cts → queries/sql/query.d.cts} +7 -7
- package/build/queries/sql/query.d.cts.map +1 -0
- package/build/{query.d.mts → queries/sql/query.d.mts} +7 -7
- package/build/queries/sql/query.d.mts.map +1 -0
- package/build/{query.js → queries/sql/query.js} +11 -12
- package/build/queries/sql/query.js.map +1 -0
- package/build/queries/valueFilters.cjs +248 -0
- package/build/queries/valueFilters.cjs.map +1 -0
- package/build/queries/valueFilters.d.cts +28 -0
- package/build/queries/valueFilters.d.cts.map +1 -0
- package/build/queries/valueFilters.d.mts +28 -0
- package/build/queries/valueFilters.d.mts.map +1 -0
- package/build/queries/valueFilters.js +243 -0
- package/build/queries/valueFilters.js.map +1 -0
- package/build/reactiveHints.cjs +5 -5
- package/build/reactiveHints.js +5 -5
- package/build/relations/AbstractRelationImpl.cjs +0 -5
- package/build/relations/AbstractRelationImpl.cjs.map +1 -1
- package/build/relations/AbstractRelationImpl.d.cts +1 -2
- package/build/relations/AbstractRelationImpl.d.cts.map +1 -1
- package/build/relations/AbstractRelationImpl.d.mts +1 -2
- package/build/relations/AbstractRelationImpl.d.mts.map +1 -1
- package/build/relations/AbstractRelationImpl.js +1 -5
- package/build/relations/AbstractRelationImpl.js.map +1 -1
- package/build/relations/AsyncProperty.cjs +1 -1
- package/build/relations/AsyncProperty.js +1 -1
- package/build/relations/AsyncReactiveField.cjs +3 -3
- package/build/relations/AsyncReactiveField.js +3 -3
- package/build/relations/Collection.cjs +1 -1
- package/build/relations/Collection.js +1 -1
- package/build/relations/CustomCollection.cjs +1 -1
- package/build/relations/CustomCollection.js +1 -1
- package/build/relations/CustomReference.cjs +3 -3
- package/build/relations/CustomReference.js +3 -3
- package/build/relations/EnumCollection.cjs +2 -2
- package/build/relations/EnumCollection.js +2 -2
- package/build/relations/LazyField.cjs +6 -7
- package/build/relations/LazyField.cjs.map +1 -1
- package/build/relations/LazyField.js +5 -6
- package/build/relations/LazyField.js.map +1 -1
- package/build/relations/ManyToManyCollection.cjs +4 -3
- package/build/relations/ManyToManyCollection.cjs.map +1 -1
- package/build/relations/ManyToManyCollection.d.cts.map +1 -1
- package/build/relations/ManyToManyCollection.d.mts.map +1 -1
- package/build/relations/ManyToManyCollection.js +4 -3
- package/build/relations/ManyToManyCollection.js.map +1 -1
- package/build/relations/ManyToManyLargeCollection.cjs +2 -2
- package/build/relations/ManyToManyLargeCollection.js +2 -2
- package/build/relations/ManyToOneReference.cjs +7 -6
- package/build/relations/ManyToOneReference.cjs.map +1 -1
- package/build/relations/ManyToOneReference.d.cts.map +1 -1
- package/build/relations/ManyToOneReference.d.mts.map +1 -1
- package/build/relations/ManyToOneReference.js +7 -6
- package/build/relations/ManyToOneReference.js.map +1 -1
- package/build/relations/OneToManyCollection.cjs +6 -5
- package/build/relations/OneToManyCollection.cjs.map +1 -1
- package/build/relations/OneToManyCollection.d.cts.map +1 -1
- package/build/relations/OneToManyCollection.d.mts.map +1 -1
- package/build/relations/OneToManyCollection.js +4 -3
- package/build/relations/OneToManyCollection.js.map +1 -1
- package/build/relations/OneToManyLargeCollection.cjs +3 -3
- package/build/relations/OneToManyLargeCollection.js +3 -3
- package/build/relations/OneToOneReference.cjs +6 -5
- package/build/relations/OneToOneReference.cjs.map +1 -1
- package/build/relations/OneToOneReference.d.cts.map +1 -1
- package/build/relations/OneToOneReference.d.mts.map +1 -1
- package/build/relations/OneToOneReference.js +6 -5
- package/build/relations/OneToOneReference.js.map +1 -1
- package/build/relations/PolymorphicReference.cjs +7 -6
- package/build/relations/PolymorphicReference.cjs.map +1 -1
- package/build/relations/PolymorphicReference.d.cts.map +1 -1
- package/build/relations/PolymorphicReference.d.mts.map +1 -1
- package/build/relations/PolymorphicReference.js +7 -6
- package/build/relations/PolymorphicReference.js.map +1 -1
- package/build/relations/ReactiveField.cjs +3 -3
- package/build/relations/ReactiveField.js +3 -3
- package/build/relations/ReactiveGetter.cjs +1 -1
- package/build/relations/ReactiveGetter.js +1 -1
- package/build/relations/ReactiveManyToMany.cjs +5 -4
- package/build/relations/ReactiveManyToMany.cjs.map +1 -1
- package/build/relations/ReactiveManyToMany.d.cts.map +1 -1
- package/build/relations/ReactiveManyToMany.d.mts.map +1 -1
- package/build/relations/ReactiveManyToMany.js +5 -4
- package/build/relations/ReactiveManyToMany.js.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.cjs +3 -3
- package/build/relations/ReactiveManyToManyOtherSide.js +3 -3
- package/build/relations/ReactiveReference.cjs +8 -7
- package/build/relations/ReactiveReference.cjs.map +1 -1
- package/build/relations/ReactiveReference.d.cts.map +1 -1
- package/build/relations/ReactiveReference.d.mts.map +1 -1
- package/build/relations/ReactiveReference.js +8 -7
- package/build/relations/ReactiveReference.js.map +1 -1
- package/build/relations/RecursiveCollection.cjs +3 -3
- package/build/relations/RecursiveCollection.js +3 -3
- package/build/relations/Reference.cjs +1 -1
- package/build/relations/Reference.js +1 -1
- package/build/relations/hasAsyncMethod.cjs +1 -1
- package/build/relations/hasAsyncMethod.js +1 -1
- package/build/relations/hasManyDerived.cjs +1 -1
- package/build/relations/hasManyDerived.js +1 -1
- package/build/relations/hasOneDerived.cjs +2 -2
- package/build/relations/hasOneDerived.js +2 -2
- package/build/relations/hasProperty.cjs +2 -2
- package/build/relations/hasProperty.js +2 -2
- package/build/relations/index.cjs +13 -13
- package/build/relations/index.js +13 -13
- package/build/relations/isCascadeDelete.cjs +11 -0
- package/build/relations/isCascadeDelete.cjs.map +1 -0
- package/build/relations/isCascadeDelete.d.cts +7 -0
- package/build/relations/isCascadeDelete.d.cts.map +1 -0
- package/build/relations/isCascadeDelete.d.mts +7 -0
- package/build/relations/isCascadeDelete.d.mts.map +1 -0
- package/build/relations/isCascadeDelete.js +10 -0
- package/build/relations/isCascadeDelete.js.map +1 -0
- package/build/resurrection.cjs +1 -1
- package/build/resurrection.js +1 -1
- package/build/rules.cjs +4 -4
- package/build/rules.js +4 -4
- package/build/serde.cjs +1 -1
- package/build/serde.js +1 -1
- package/build/unnest.cjs +0 -1
- package/build/unnest.cjs.map +1 -1
- package/build/unnest.d.cts +1 -1
- package/build/unnest.d.mts +1 -1
- package/build/unnest.js +0 -1
- package/build/unnest.js.map +1 -1
- package/build/upsert.cjs +3 -3
- package/build/upsert.js +3 -3
- package/build/utils.cjs +1 -2
- package/build/utils.cjs.map +1 -1
- package/build/utils.d.cts +1 -1
- package/build/utils.d.mts +1 -1
- package/build/utils.js +1 -2
- package/build/utils.js.map +1 -1
- package/build/withLoaded.cjs +3 -3
- package/build/withLoaded.js +3 -3
- package/package.json +2 -2
- package/build/AliasAssigner.cjs.map +0 -1
- package/build/AliasAssigner.d.cts.map +0 -1
- package/build/AliasAssigner.d.mts.map +0 -1
- package/build/AliasAssigner.js.map +0 -1
- package/build/Aliases.cjs.map +0 -1
- package/build/Aliases.d.cts.map +0 -1
- package/build/Aliases.d.mts.map +0 -1
- package/build/Aliases.js.map +0 -1
- package/build/ConditionBuilder.cjs.map +0 -1
- package/build/ConditionBuilder.d.cts.map +0 -1
- package/build/ConditionBuilder.d.mts.map +0 -1
- package/build/ConditionBuilder.js.map +0 -1
- package/build/DeferredAlias.cjs.map +0 -1
- package/build/DeferredAlias.d.cts.map +0 -1
- package/build/DeferredAlias.d.mts.map +0 -1
- package/build/DeferredAlias.js.map +0 -1
- package/build/EntityFilter.cjs.map +0 -1
- package/build/EntityFilter.d.cts.map +0 -1
- package/build/EntityFilter.d.mts.map +0 -1
- package/build/EntityFilter.js.map +0 -1
- package/build/EntityGraphQLFilter.cjs.map +0 -1
- package/build/EntityGraphQLFilter.d.cts.map +0 -1
- package/build/EntityGraphQLFilter.d.mts.map +0 -1
- package/build/EntityGraphQLFilter.js.map +0 -1
- package/build/Expr.cjs.map +0 -1
- package/build/Expr.d.cts.map +0 -1
- package/build/Expr.d.mts.map +0 -1
- package/build/Expr.js.map +0 -1
- package/build/QueryParser.cjs.map +0 -1
- package/build/QueryParser.collectionJoins.cjs.map +0 -1
- package/build/QueryParser.collectionJoins.d.cts.map +0 -1
- package/build/QueryParser.collectionJoins.d.mts.map +0 -1
- package/build/QueryParser.collectionJoins.js.map +0 -1
- package/build/QueryParser.d.cts.map +0 -1
- package/build/QueryParser.d.mts.map +0 -1
- package/build/QueryParser.js.map +0 -1
- package/build/QueryParser.pruning.cjs.map +0 -1
- package/build/QueryParser.pruning.d.cts +0 -10
- package/build/QueryParser.pruning.d.cts.map +0 -1
- package/build/QueryParser.pruning.d.mts +0 -10
- package/build/QueryParser.pruning.d.mts.map +0 -1
- package/build/QueryParser.pruning.js.map +0 -1
- package/build/QueryVisitor.cjs.map +0 -1
- package/build/QueryVisitor.d.cts.map +0 -1
- package/build/QueryVisitor.d.mts.map +0 -1
- package/build/QueryVisitor.js.map +0 -1
- package/build/Tables.cjs.map +0 -1
- package/build/Tables.d.cts.map +0 -1
- package/build/Tables.d.mts.map +0 -1
- package/build/Tables.js.map +0 -1
- package/build/conditions.cjs.map +0 -1
- package/build/conditions.d.cts.map +0 -1
- package/build/conditions.d.mts.map +0 -1
- package/build/conditions.js.map +0 -1
- package/build/drivers/buildRawQuery.cjs.map +0 -1
- package/build/drivers/buildRawQuery.d.cts.map +0 -1
- package/build/drivers/buildRawQuery.d.mts.map +0 -1
- package/build/drivers/buildRawQuery.js.map +0 -1
- package/build/drivers/buildUtils.cjs.map +0 -1
- package/build/drivers/buildUtils.d.cts.map +0 -1
- package/build/drivers/buildUtils.d.mts.map +0 -1
- package/build/drivers/buildUtils.js.map +0 -1
- package/build/execute.cjs.map +0 -1
- package/build/execute.d.cts.map +0 -1
- package/build/execute.d.mts.map +0 -1
- package/build/execute.js.map +0 -1
- package/build/expressions/arrayAgg.cjs.map +0 -1
- package/build/expressions/arrayAgg.d.cts.map +0 -1
- package/build/expressions/arrayAgg.d.mts.map +0 -1
- package/build/expressions/arrayAgg.js.map +0 -1
- package/build/expressions/case.cjs.map +0 -1
- package/build/expressions/case.d.cts.map +0 -1
- package/build/expressions/case.d.mts.map +0 -1
- package/build/expressions/case.js.map +0 -1
- package/build/expressions/coalesce.cjs +0 -25
- package/build/expressions/coalesce.cjs.map +0 -1
- package/build/expressions/coalesce.d.cts.map +0 -1
- package/build/expressions/coalesce.d.mts.map +0 -1
- package/build/expressions/coalesce.js.map +0 -1
- package/build/expressions/codecs.cjs.map +0 -1
- package/build/expressions/codecs.d.cts.map +0 -1
- package/build/expressions/codecs.d.mts.map +0 -1
- package/build/expressions/codecs.js.map +0 -1
- package/build/expressions/expression.cjs +0 -102
- package/build/expressions/expression.cjs.map +0 -1
- package/build/expressions/expression.d.cts.map +0 -1
- package/build/expressions/expression.d.mts.map +0 -1
- package/build/expressions/expression.js.map +0 -1
- package/build/expressions/greatest.cjs +0 -25
- package/build/expressions/greatest.cjs.map +0 -1
- package/build/expressions/greatest.d.cts.map +0 -1
- package/build/expressions/greatest.d.mts.map +0 -1
- package/build/expressions/greatest.js.map +0 -1
- package/build/expressions/least.cjs +0 -25
- package/build/expressions/least.cjs.map +0 -1
- package/build/expressions/least.d.cts.map +0 -1
- package/build/expressions/least.d.mts.map +0 -1
- package/build/expressions/least.js.map +0 -1
- package/build/expressions/nullIf.cjs.map +0 -1
- package/build/expressions/nullIf.d.cts.map +0 -1
- package/build/expressions/nullIf.d.mts.map +0 -1
- package/build/expressions/nullIf.js.map +0 -1
- package/build/expressions/parseExpression.cjs.map +0 -1
- package/build/expressions/parseExpression.d.cts.map +0 -1
- package/build/expressions/parseExpression.d.mts.map +0 -1
- package/build/expressions/parseExpression.js.map +0 -1
- package/build/expressions/types.d.cts.map +0 -1
- package/build/expressions/types.d.mts.map +0 -1
- package/build/keywords.cjs.map +0 -1
- package/build/keywords.d.cts.map +0 -1
- package/build/keywords.d.mts.map +0 -1
- package/build/keywords.js.map +0 -1
- package/build/query.cjs.map +0 -1
- package/build/query.d.cts.map +0 -1
- package/build/query.d.mts.map +0 -1
- package/build/query.js.map +0 -1
- package/build/scopes.cjs.map +0 -1
- package/build/scopes.d.cts.map +0 -1
- package/build/scopes.d.mts.map +0 -1
- package/build/scopes.js.map +0 -1
- package/build/skipCondition.cjs.map +0 -1
- package/build/skipCondition.js.map +0 -1
- /package/build/{expressions → queries/sql/expressions}/types.cjs +0 -0
- /package/build/{expressions → queries/sql/expressions}/types.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueFilters.cjs","names":["isAlias","isScope","isEntity","isPlainObject","isDefined","assertNever"],"sources":["../../src/queries/valueFilters.ts"],"sourcesContent":["import { isPlainObject } from \"joist-utils\";\n\nimport type { Column } from \"../columns.ts\";\nimport { type Entity, isEntity } from \"../Entity.ts\";\nimport { isDefined } from \"../EntityManager.ts\";\nimport type { EntityMetadata } from \"../EntityMetadata.ts\";\nimport { assertNever } from \"../utils.ts\";\nimport { isAlias } from \"./find/Aliases.ts\";\nimport type { ValueFilter } from \"./find/EntityFilter.ts\";\nimport { isScope } from \"./find/scopes.ts\";\nimport type { ParsedValueFilter } from \"./parsedConditions.ts\";\n\n/** An ADT version of `EntityFilter`. */\nexport type ParsedEntityFilter =\n // ParsedValueFilter is any simple match on `id`\n | ParsedValueFilter<string | number>\n // Otherwise we return the join/complex\n | { kind: \"join\"; subFilter: object };\n\n/** Parses an entity filter, which could be \"just an id\", an array of ids, or a nested filter. */\nexport function parseEntityFilter(meta: EntityMetadata, filter: any): ParsedEntityFilter | undefined {\n if (filter === undefined) {\n // This matches legacy `em.find(Book, { author: undefined })` behavior\n return undefined;\n } else if (isAlias(filter)) {\n // We're just binding an alias to this position in the join tree\n return undefined;\n } else if (isScope(filter)) {\n // A scope on a relation (e.g. `{ author: Author.adult }`) always implies conditions on the\n // related entity, so signal \"needs a join\" via the existing `join` discriminant rather than\n // adding a dedicated `kind: \"scope\"` that every relation branch would have to learn. The empty\n // `subFilter` is intentionally never read: the m2o/m2m branches only check `kind === \"join\"` to\n // decide whether to join, then re-dispatch the original scope value back through `addTable`,\n // where `isScope(...)` routes it to `addScopeFilterAt` to apply the scope's actual fragments.\n return { kind: \"join\", subFilter: {} };\n } else if (filter === null) {\n return { kind: \"is-null\" };\n } else if (typeof filter === \"string\" || typeof filter === \"number\") {\n return { kind: \"eq\", value: filter };\n } else if (typeof filter === \"boolean\") {\n return filter ? { kind: \"not-null\" } : { kind: \"is-null\" };\n } else if (Array.isArray(filter)) {\n return {\n kind: \"in\",\n value: filter.map((v: string | number | Entity) => {\n return isEntity(v) ? (v.idTaggedMaybe ?? nilIdValue(meta)) : v;\n }),\n };\n } else if (isEntity(filter)) {\n return { kind: \"eq\", value: filter.idTaggedMaybe || nilIdValue(meta) };\n } else if (typeof filter === \"object\") {\n // Looking for `{ firstName: \"f1\" }` or `{ ne: \"f1\" }`\n const keys = Object.keys(filter);\n // Special case only looking at `ne`\n if (keys.length === 1 && keys[0] === \"ne\") {\n const value = filter[\"ne\"];\n if (value === undefined) {\n return undefined;\n } else if (value === null) {\n return { kind: \"not-null\" };\n } else if (typeof value === \"string\" || typeof value === \"number\") {\n return { kind: \"ne\", value };\n } else if (isEntity(value)) {\n return { kind: \"ne\", value: value.idTaggedMaybe || nilIdValue(meta) };\n } else {\n throw new Error(`Unsupported \"ne\" value ${value}`);\n }\n }\n // Special case only looking at `id`\n if (keys.length === 1 && keys[0] === \"id\") {\n const value = filter[\"id\"];\n if (value === undefined) {\n return undefined;\n } else if (value === null) {\n return { kind: \"is-null\" };\n } else if (typeof value === \"string\" || typeof value === \"number\") {\n return { kind: \"eq\", value };\n } else if (isEntity(value)) {\n return { kind: \"eq\", value: value.idTaggedMaybe || nilIdValue(meta) };\n } else {\n return parseValueFilter(value)[0] as any;\n }\n }\n // Look for subFilter values being EntityFilter-ish instances like ManyToOneReference\n // that have an id, and so structurally match the entity filter without really being filters,\n // and convert them over here before getting into parseValueFilter.\n const subFilter = {} as any;\n for (const [key, value] of Object.entries(filter)) {\n if (value && typeof value === \"object\" && !isPlainObject(value) && \"idTaggedMaybe\" in value) {\n subFilter[key] = value.idTaggedMaybe || nilIdValue(meta);\n } else {\n subFilter[key] = value;\n }\n }\n return { kind: \"join\", subFilter };\n } else {\n throw new Error(`Unrecognized filter ${filter}`);\n }\n}\n\n/**\n * Parses the many/hodgepodge (ergonomic!) patterns of value filters into a `ParsedValueFilter[]`.\n *\n * Note we return an array because filter might be a `ValueGraphQLFilter` that is allowed to have\n * multiple conditions, i.e. `{ lt: 10, gt: 5 }`.\n */\nexport function parseValueFilter<V>(filter: ValueFilter<V, any>): ParsedValueFilter<V>[] {\n if (filter === null) {\n return [{ kind: \"is-null\" }];\n } else if (filter === undefined) {\n // This is legacy behavior where `em.find(Book, { author: undefined })` would match all books\n return [];\n } else if (Array.isArray(filter)) {\n return [{ kind: \"in\", value: filter }];\n } else if (isPlainObject(filter)) {\n const keys = Object.keys(filter);\n if (keys.length === 0) {\n // Should this be an error?\n return [];\n } else if (keys.length === 2 && \"op\" in filter && \"value\" in filter) {\n // Probe for `findGql` op & value\n const { op, value } = filter;\n if (shouldPruneValueFilter(op, value)) {\n return [];\n } else if (value === null) {\n return [{ kind: \"is-null\" }];\n } else {\n return [{ kind: op, value: value ?? null }];\n }\n } else if (keys.length === 2 && \"gte\" in filter && \"lte\" in filter) {\n const { gte, lte } = filter;\n return [{ kind: \"between\", value: [gte, lte] }];\n } else {\n return Object.entries(filter)\n .map(([key, value]) => {\n // Always do condition pruning on the value\n if (shouldPruneValueFilter(key, value)) {\n return undefined;\n }\n switch (key) {\n case \"eq\":\n if (value === null) {\n return { kind: \"is-null\" as const };\n } else {\n return { kind: \"eq\" as const, value: filter[key] };\n }\n case \"ne\":\n if (value === null) {\n return { kind: \"not-null\" as const };\n } else {\n return { kind: \"ne\" as const, value: filter[key] ?? null };\n }\n case \"in\":\n case \"nin\":\n case \"gt\":\n case \"gte\":\n case \"lt\":\n case \"lte\":\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 \"contains\":\n case \"overlaps\":\n case \"containedBy\":\n return { kind: key, value: filter[key] };\n case \"pathExists\":\n return { kind: \"jsonPathExists\" as const, value: filter[key] };\n case \"pathIsTrue\":\n return { kind: \"jsonPathPredicate\" as const, value: filter[key] };\n case \"search\":\n return { kind: \"ilike\" as const, value: makeLike(filter[key]) };\n case \"between\":\n return { kind: key, value: filter[key] };\n default:\n throw new Error(`Unsupported value filter key ${key}`);\n }\n })\n .filter(isDefined);\n }\n } else {\n // This is a primitive like a string, number\n return [{ kind: \"eq\", value: filter }];\n }\n}\n\n/** Converts domain-level values like string ids/enums into their db equivalent. */\nexport function mapToDb(column: Column, filter: ParsedValueFilter<any>): ParsedValueFilter<any> {\n // ...to teach this `mapToDb` function to handle/rewrite `in: [1, null]` handling, we'd need to:\n // 1. return a maybe-simple/maybe-nested condition, so basically a `ParsedExpressionCondition`, because\n // this would let `in` return an `{ or: ... }` to all the callers.\n // 2. also return `{ parsed: ParsedExpressionCondition, simples: SimpleCondition[] }` tuple, for the\n // alias `addCondition` processing to track the `simples` and rewrite their alias when later bound.\n switch (filter.kind) {\n case \"eq\":\n case \"gt\":\n case \"gte\":\n case \"ne\":\n case \"lt\":\n case \"lte\":\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 filter.value = column.mapToDb(filter.value);\n return filter;\n case \"in\":\n if (column.isArray) {\n // Arrays need a special operator\n return { kind: \"contains\", value: column.mapToDb(filter.value) };\n } else {\n filter.value = filter.value.map((v) => column.mapToDb(v));\n }\n return filter;\n case \"nin\":\n if (column.isArray) {\n // Arrays need a special operator\n throw new Error(\"The nin operator is not supported on array columns yet\");\n } else {\n filter.value = filter.value.map((v) => column.mapToDb(v));\n }\n return filter;\n case \"contains\":\n case \"ncontains\":\n case \"overlaps\":\n case \"noverlaps\":\n case \"containedBy\":\n const supportsContains = column.isArray || column.dbType === \"jsonb\";\n if (!supportsContains) {\n throw new Error(`${filter.kind} is only unsupported on array or jsonb columns`);\n }\n if (column.isArray) {\n filter.value = column.mapToDb(filter.value);\n } else {\n // leave jsonb values alone\n }\n return filter;\n case \"between\":\n filter.value = [column.mapToDb(filter.value[0]), column.mapToDb(filter.value[1])];\n return filter;\n case \"is-null\":\n case \"not-null\":\n case \"jsonPathExists\":\n case \"jsonPathPredicate\":\n return filter;\n default:\n throw assertNever(filter);\n }\n}\n\n/** Converts a search term like `foo bar` into a SQL `like` pattern like `%foo%bar%`. */\nexport function makeLike(search: any | undefined): any {\n return search ? `%${search.replace(/\\s+/g, \"%\")}%` : undefined;\n}\n\n/** Recognizes placeholder IDs used when a filter contains an unpersisted entity. */\nexport function isNilIdValue(value: unknown): boolean {\n return value === -1 || value === \"00000000-0000-0000-0000-000000000000\";\n}\n\n/**\n * We use this value if users include new (id-less) entities as em.find conditions.\n *\n * The idea is that this condition would never be met, but we still want to do the em.find\n * query in case it's in an `OR` clause that would match false, but some other part of the\n * clause would match. I.e. instead of just skipping the DB query all together, which is\n * also something we could consider doing.\n *\n * For int IDs we use -1, and for uuid IDs, we use the nil UUID value:\n *\n * https://en.wikipedia.org/wiki/Universally_unique_identifier#Nil_UUID\n */\nfunction nilIdValue(meta: EntityMetadata): any {\n switch (meta.idDbType) {\n case \"int\":\n case \"bigint\":\n return -1;\n case \"uuid\":\n return \"00000000-0000-0000-0000-000000000000\";\n case \"text\":\n return \"0\";\n default:\n return assertNever(meta.idDbType);\n }\n}\n\n/** Returns true for values that should be treated like an omitted filter. */\nfunction shouldPruneValueFilter(key: unknown, value: unknown): boolean {\n if (value === undefined) return true;\n return value === false && key !== \"eq\" && key !== \"ne\";\n}\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,kBAAkB,MAAsB,QAA6C;CACnG,IAAI,WAAW,KAAA,GAEb;MACK,IAAIA,6BAAAA,QAAQ,MAAM,GAEvB;MACK,IAAIC,4BAAAA,QAAQ,MAAM,GAOvB,OAAO;EAAE,MAAM;EAAQ,WAAW,CAAC;CAAE;MAChC,IAAI,WAAW,MACpB,OAAO,EAAE,MAAM,UAAU;MACpB,IAAI,OAAO,WAAW,YAAY,OAAO,WAAW,UACzD,OAAO;EAAE,MAAM;EAAM,OAAO;CAAO;MAC9B,IAAI,OAAO,WAAW,WAC3B,OAAO,SAAS,EAAE,MAAM,WAAW,IAAI,EAAE,MAAM,UAAU;MACpD,IAAI,MAAM,QAAQ,MAAM,GAC7B,OAAO;EACL,MAAM;EACN,OAAO,OAAO,KAAK,MAAgC;GACjD,OAAOC,eAAAA,SAAS,CAAC,IAAK,EAAE,iBAAiB,WAAW,IAAI,IAAK;EAC/D,CAAC;CACH;MACK,IAAIA,eAAAA,SAAS,MAAM,GACxB,OAAO;EAAE,MAAM;EAAM,OAAO,OAAO,iBAAiB,WAAW,IAAI;CAAE;MAChE,IAAI,OAAO,WAAW,UAAU;EAErC,MAAM,OAAO,OAAO,KAAK,MAAM;EAE/B,IAAI,KAAK,WAAW,KAAK,KAAK,OAAO,MAAM;GACzC,MAAM,QAAQ,OAAO;GACrB,IAAI,UAAU,KAAA,GACZ;QACK,IAAI,UAAU,MACnB,OAAO,EAAE,MAAM,WAAW;QACrB,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UACvD,OAAO;IAAE,MAAM;IAAM;GAAM;QACtB,IAAIA,eAAAA,SAAS,KAAK,GACvB,OAAO;IAA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AAE,KAAK,KAAA;AACvD;;AAGA,SAAgB,aAAa,OAAyB;CACpD,OAAO,UAAU,MAAM,UAAU;AACnC;;;;;;;;;;;;;AAcA,SAAS,WAAW,MAA2B;CAC7C,QAAQ,KAAK,UAAb;EACE,KAAK;EACL,KAAK,UACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,SACE,OAAOA,cAAAA,YAAY,KAAK,QAAQ;CACpC;AACF;;AAGA,SAAS,uBAAuB,KAAc,OAAyB;CACrE,IAAI,UAAU,KAAA,GAAW,OAAO;CAChC,OAAO,UAAU,SAAS,QAAQ,QAAQ,QAAQ;AACpD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Column } from "../columns.cjs";
|
|
2
|
+
import { ParsedValueFilter } from "./parsedConditions.cjs";
|
|
3
|
+
import { ValueFilter } from "./find/EntityFilter.cjs";
|
|
4
|
+
import { EntityMetadata } from "../EntityMetadata.cjs";
|
|
5
|
+
//#region src/queries/valueFilters.d.ts
|
|
6
|
+
/** An ADT version of `EntityFilter`. */
|
|
7
|
+
type ParsedEntityFilter = ParsedValueFilter<string | number> | {
|
|
8
|
+
kind: "join";
|
|
9
|
+
subFilter: object;
|
|
10
|
+
};
|
|
11
|
+
/** Parses an entity filter, which could be "just an id", an array of ids, or a nested filter. */
|
|
12
|
+
declare function parseEntityFilter(meta: EntityMetadata, filter: any): ParsedEntityFilter | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Parses the many/hodgepodge (ergonomic!) patterns of value filters into a `ParsedValueFilter[]`.
|
|
15
|
+
*
|
|
16
|
+
* Note we return an array because filter might be a `ValueGraphQLFilter` that is allowed to have
|
|
17
|
+
* multiple conditions, i.e. `{ lt: 10, gt: 5 }`.
|
|
18
|
+
*/
|
|
19
|
+
declare function parseValueFilter<V>(filter: ValueFilter<V, any>): ParsedValueFilter<V>[];
|
|
20
|
+
/** Converts domain-level values like string ids/enums into their db equivalent. */
|
|
21
|
+
declare function mapToDb(column: Column, filter: ParsedValueFilter<any>): ParsedValueFilter<any>;
|
|
22
|
+
/** Converts a search term like `foo bar` into a SQL `like` pattern like `%foo%bar%`. */
|
|
23
|
+
declare function makeLike(search: any | undefined): any;
|
|
24
|
+
/** Recognizes placeholder IDs used when a filter contains an unpersisted entity. */
|
|
25
|
+
declare function isNilIdValue(value: unknown): boolean;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { ParsedEntityFilter, isNilIdValue, makeLike, mapToDb, parseEntityFilter, parseValueFilter };
|
|
28
|
+
//# sourceMappingURL=valueFilters.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueFilters.d.cts","names":[],"sources":["../../src/queries/valueFilters.ts"],"mappings":";;;;;;KAaY,qBAER;EAEE;EAAc;;;iBAGJ,kBAAkB,MAAM,gBAAgB,cAAc;;;;;;;iBAsFtD,iBAAiB,GAAG,QAAQ,YAAY,UAAU,kBAAkB;;iBAqFpE,QAAQ,QAAQ,QAAQ,QAAQ,yBAAyB;;iBAoEzD,SAAS;;iBAKT,aAAa"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Column } from "../columns.mjs";
|
|
2
|
+
import { ParsedValueFilter } from "./parsedConditions.mjs";
|
|
3
|
+
import { ValueFilter } from "./find/EntityFilter.mjs";
|
|
4
|
+
import { EntityMetadata } from "../EntityMetadata.mjs";
|
|
5
|
+
//#region src/queries/valueFilters.d.ts
|
|
6
|
+
/** An ADT version of `EntityFilter`. */
|
|
7
|
+
type ParsedEntityFilter = ParsedValueFilter<string | number> | {
|
|
8
|
+
kind: "join";
|
|
9
|
+
subFilter: object;
|
|
10
|
+
};
|
|
11
|
+
/** Parses an entity filter, which could be "just an id", an array of ids, or a nested filter. */
|
|
12
|
+
declare function parseEntityFilter(meta: EntityMetadata, filter: any): ParsedEntityFilter | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Parses the many/hodgepodge (ergonomic!) patterns of value filters into a `ParsedValueFilter[]`.
|
|
15
|
+
*
|
|
16
|
+
* Note we return an array because filter might be a `ValueGraphQLFilter` that is allowed to have
|
|
17
|
+
* multiple conditions, i.e. `{ lt: 10, gt: 5 }`.
|
|
18
|
+
*/
|
|
19
|
+
declare function parseValueFilter<V>(filter: ValueFilter<V, any>): ParsedValueFilter<V>[];
|
|
20
|
+
/** Converts domain-level values like string ids/enums into their db equivalent. */
|
|
21
|
+
declare function mapToDb(column: Column, filter: ParsedValueFilter<any>): ParsedValueFilter<any>;
|
|
22
|
+
/** Converts a search term like `foo bar` into a SQL `like` pattern like `%foo%bar%`. */
|
|
23
|
+
declare function makeLike(search: any | undefined): any;
|
|
24
|
+
/** Recognizes placeholder IDs used when a filter contains an unpersisted entity. */
|
|
25
|
+
declare function isNilIdValue(value: unknown): boolean;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { ParsedEntityFilter, isNilIdValue, makeLike, mapToDb, parseEntityFilter, parseValueFilter };
|
|
28
|
+
//# sourceMappingURL=valueFilters.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueFilters.d.mts","names":[],"sources":["../../src/queries/valueFilters.ts"],"mappings":";;;;;;KAaY,qBAER;EAEE;EAAc;;;iBAGJ,kBAAkB,MAAM,gBAAgB,cAAc;;;;;;;iBAsFtD,iBAAiB,GAAG,QAAQ,YAAY,UAAU,kBAAkB;;iBAqFpE,QAAQ,QAAQ,QAAQ,QAAQ,yBAAyB;;iBAoEzD,SAAS;;iBAKT,aAAa"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { isAlias } from "./find/Aliases.js";
|
|
2
|
+
import { isScope } from "./find/scopes.js";
|
|
3
|
+
import { assertNever } from "../utils.js";
|
|
4
|
+
import { isDefined } from "../EntityManager.js";
|
|
5
|
+
import { isEntity } from "../Entity.js";
|
|
6
|
+
import { isPlainObject } from "joist-utils";
|
|
7
|
+
//#region src/queries/valueFilters.ts
|
|
8
|
+
/** Parses an entity filter, which could be "just an id", an array of ids, or a nested filter. */
|
|
9
|
+
function parseEntityFilter(meta, filter) {
|
|
10
|
+
if (filter === void 0) return;
|
|
11
|
+
else if (isAlias(filter)) return;
|
|
12
|
+
else if (isScope(filter)) return {
|
|
13
|
+
kind: "join",
|
|
14
|
+
subFilter: {}
|
|
15
|
+
};
|
|
16
|
+
else if (filter === null) return { kind: "is-null" };
|
|
17
|
+
else if (typeof filter === "string" || typeof filter === "number") return {
|
|
18
|
+
kind: "eq",
|
|
19
|
+
value: filter
|
|
20
|
+
};
|
|
21
|
+
else if (typeof filter === "boolean") return filter ? { kind: "not-null" } : { kind: "is-null" };
|
|
22
|
+
else if (Array.isArray(filter)) return {
|
|
23
|
+
kind: "in",
|
|
24
|
+
value: filter.map((v) => {
|
|
25
|
+
return isEntity(v) ? v.idTaggedMaybe ?? nilIdValue(meta) : v;
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
|
+
else if (isEntity(filter)) return {
|
|
29
|
+
kind: "eq",
|
|
30
|
+
value: filter.idTaggedMaybe || nilIdValue(meta)
|
|
31
|
+
};
|
|
32
|
+
else if (typeof filter === "object") {
|
|
33
|
+
const keys = Object.keys(filter);
|
|
34
|
+
if (keys.length === 1 && keys[0] === "ne") {
|
|
35
|
+
const value = filter["ne"];
|
|
36
|
+
if (value === void 0) return;
|
|
37
|
+
else if (value === null) return { kind: "not-null" };
|
|
38
|
+
else if (typeof value === "string" || typeof value === "number") return {
|
|
39
|
+
kind: "ne",
|
|
40
|
+
value
|
|
41
|
+
};
|
|
42
|
+
else if (isEntity(value)) return {
|
|
43
|
+
kind: "ne",
|
|
44
|
+
value: value.idTaggedMaybe || nilIdValue(meta)
|
|
45
|
+
};
|
|
46
|
+
else throw new Error(`Unsupported "ne" value ${value}`);
|
|
47
|
+
}
|
|
48
|
+
if (keys.length === 1 && keys[0] === "id") {
|
|
49
|
+
const value = filter["id"];
|
|
50
|
+
if (value === void 0) return;
|
|
51
|
+
else if (value === null) return { kind: "is-null" };
|
|
52
|
+
else if (typeof value === "string" || typeof value === "number") return {
|
|
53
|
+
kind: "eq",
|
|
54
|
+
value
|
|
55
|
+
};
|
|
56
|
+
else if (isEntity(value)) return {
|
|
57
|
+
kind: "eq",
|
|
58
|
+
value: value.idTaggedMaybe || nilIdValue(meta)
|
|
59
|
+
};
|
|
60
|
+
else return parseValueFilter(value)[0];
|
|
61
|
+
}
|
|
62
|
+
const subFilter = {};
|
|
63
|
+
for (const [key, value] of Object.entries(filter)) if (value && typeof value === "object" && !isPlainObject(value) && "idTaggedMaybe" in value) subFilter[key] = value.idTaggedMaybe || nilIdValue(meta);
|
|
64
|
+
else subFilter[key] = value;
|
|
65
|
+
return {
|
|
66
|
+
kind: "join",
|
|
67
|
+
subFilter
|
|
68
|
+
};
|
|
69
|
+
} else throw new Error(`Unrecognized filter ${filter}`);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Parses the many/hodgepodge (ergonomic!) patterns of value filters into a `ParsedValueFilter[]`.
|
|
73
|
+
*
|
|
74
|
+
* Note we return an array because filter might be a `ValueGraphQLFilter` that is allowed to have
|
|
75
|
+
* multiple conditions, i.e. `{ lt: 10, gt: 5 }`.
|
|
76
|
+
*/
|
|
77
|
+
function parseValueFilter(filter) {
|
|
78
|
+
if (filter === null) return [{ kind: "is-null" }];
|
|
79
|
+
else if (filter === void 0) return [];
|
|
80
|
+
else if (Array.isArray(filter)) return [{
|
|
81
|
+
kind: "in",
|
|
82
|
+
value: filter
|
|
83
|
+
}];
|
|
84
|
+
else if (isPlainObject(filter)) {
|
|
85
|
+
const keys = Object.keys(filter);
|
|
86
|
+
if (keys.length === 0) return [];
|
|
87
|
+
else if (keys.length === 2 && "op" in filter && "value" in filter) {
|
|
88
|
+
const { op, value } = filter;
|
|
89
|
+
if (shouldPruneValueFilter(op, value)) return [];
|
|
90
|
+
else if (value === null) return [{ kind: "is-null" }];
|
|
91
|
+
else return [{
|
|
92
|
+
kind: op,
|
|
93
|
+
value: value ?? null
|
|
94
|
+
}];
|
|
95
|
+
} else if (keys.length === 2 && "gte" in filter && "lte" in filter) {
|
|
96
|
+
const { gte, lte } = filter;
|
|
97
|
+
return [{
|
|
98
|
+
kind: "between",
|
|
99
|
+
value: [gte, lte]
|
|
100
|
+
}];
|
|
101
|
+
} else return Object.entries(filter).map(([key, value]) => {
|
|
102
|
+
if (shouldPruneValueFilter(key, value)) return;
|
|
103
|
+
switch (key) {
|
|
104
|
+
case "eq": if (value === null) return { kind: "is-null" };
|
|
105
|
+
else return {
|
|
106
|
+
kind: "eq",
|
|
107
|
+
value: filter[key]
|
|
108
|
+
};
|
|
109
|
+
case "ne": if (value === null) return { kind: "not-null" };
|
|
110
|
+
else return {
|
|
111
|
+
kind: "ne",
|
|
112
|
+
value: filter[key] ?? null
|
|
113
|
+
};
|
|
114
|
+
case "in":
|
|
115
|
+
case "nin":
|
|
116
|
+
case "gt":
|
|
117
|
+
case "gte":
|
|
118
|
+
case "lt":
|
|
119
|
+
case "lte":
|
|
120
|
+
case "like":
|
|
121
|
+
case "nlike":
|
|
122
|
+
case "ilike":
|
|
123
|
+
case "nilike":
|
|
124
|
+
case "regex":
|
|
125
|
+
case "nregex":
|
|
126
|
+
case "iregex":
|
|
127
|
+
case "niregex":
|
|
128
|
+
case "contains":
|
|
129
|
+
case "overlaps":
|
|
130
|
+
case "containedBy": return {
|
|
131
|
+
kind: key,
|
|
132
|
+
value: filter[key]
|
|
133
|
+
};
|
|
134
|
+
case "pathExists": return {
|
|
135
|
+
kind: "jsonPathExists",
|
|
136
|
+
value: filter[key]
|
|
137
|
+
};
|
|
138
|
+
case "pathIsTrue": return {
|
|
139
|
+
kind: "jsonPathPredicate",
|
|
140
|
+
value: filter[key]
|
|
141
|
+
};
|
|
142
|
+
case "search": return {
|
|
143
|
+
kind: "ilike",
|
|
144
|
+
value: makeLike(filter[key])
|
|
145
|
+
};
|
|
146
|
+
case "between": return {
|
|
147
|
+
kind: key,
|
|
148
|
+
value: filter[key]
|
|
149
|
+
};
|
|
150
|
+
default: throw new Error(`Unsupported value filter key ${key}`);
|
|
151
|
+
}
|
|
152
|
+
}).filter(isDefined);
|
|
153
|
+
} else return [{
|
|
154
|
+
kind: "eq",
|
|
155
|
+
value: filter
|
|
156
|
+
}];
|
|
157
|
+
}
|
|
158
|
+
/** Converts domain-level values like string ids/enums into their db equivalent. */
|
|
159
|
+
function mapToDb(column, filter) {
|
|
160
|
+
switch (filter.kind) {
|
|
161
|
+
case "eq":
|
|
162
|
+
case "gt":
|
|
163
|
+
case "gte":
|
|
164
|
+
case "ne":
|
|
165
|
+
case "lt":
|
|
166
|
+
case "lte":
|
|
167
|
+
case "like":
|
|
168
|
+
case "nlike":
|
|
169
|
+
case "ilike":
|
|
170
|
+
case "nilike":
|
|
171
|
+
case "regex":
|
|
172
|
+
case "nregex":
|
|
173
|
+
case "iregex":
|
|
174
|
+
case "niregex":
|
|
175
|
+
filter.value = column.mapToDb(filter.value);
|
|
176
|
+
return filter;
|
|
177
|
+
case "in":
|
|
178
|
+
if (column.isArray) return {
|
|
179
|
+
kind: "contains",
|
|
180
|
+
value: column.mapToDb(filter.value)
|
|
181
|
+
};
|
|
182
|
+
else filter.value = filter.value.map((v) => column.mapToDb(v));
|
|
183
|
+
return filter;
|
|
184
|
+
case "nin":
|
|
185
|
+
if (column.isArray) throw new Error("The nin operator is not supported on array columns yet");
|
|
186
|
+
else filter.value = filter.value.map((v) => column.mapToDb(v));
|
|
187
|
+
return filter;
|
|
188
|
+
case "contains":
|
|
189
|
+
case "ncontains":
|
|
190
|
+
case "overlaps":
|
|
191
|
+
case "noverlaps":
|
|
192
|
+
case "containedBy":
|
|
193
|
+
if (!(column.isArray || column.dbType === "jsonb")) throw new Error(`${filter.kind} is only unsupported on array or jsonb columns`);
|
|
194
|
+
if (column.isArray) filter.value = column.mapToDb(filter.value);
|
|
195
|
+
return filter;
|
|
196
|
+
case "between":
|
|
197
|
+
filter.value = [column.mapToDb(filter.value[0]), column.mapToDb(filter.value[1])];
|
|
198
|
+
return filter;
|
|
199
|
+
case "is-null":
|
|
200
|
+
case "not-null":
|
|
201
|
+
case "jsonPathExists":
|
|
202
|
+
case "jsonPathPredicate": return filter;
|
|
203
|
+
default: throw assertNever(filter);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/** Converts a search term like `foo bar` into a SQL `like` pattern like `%foo%bar%`. */
|
|
207
|
+
function makeLike(search) {
|
|
208
|
+
return search ? `%${search.replace(/\s+/g, "%")}%` : void 0;
|
|
209
|
+
}
|
|
210
|
+
/** Recognizes placeholder IDs used when a filter contains an unpersisted entity. */
|
|
211
|
+
function isNilIdValue(value) {
|
|
212
|
+
return value === -1 || value === "00000000-0000-0000-0000-000000000000";
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* We use this value if users include new (id-less) entities as em.find conditions.
|
|
216
|
+
*
|
|
217
|
+
* The idea is that this condition would never be met, but we still want to do the em.find
|
|
218
|
+
* query in case it's in an `OR` clause that would match false, but some other part of the
|
|
219
|
+
* clause would match. I.e. instead of just skipping the DB query all together, which is
|
|
220
|
+
* also something we could consider doing.
|
|
221
|
+
*
|
|
222
|
+
* For int IDs we use -1, and for uuid IDs, we use the nil UUID value:
|
|
223
|
+
*
|
|
224
|
+
* https://en.wikipedia.org/wiki/Universally_unique_identifier#Nil_UUID
|
|
225
|
+
*/
|
|
226
|
+
function nilIdValue(meta) {
|
|
227
|
+
switch (meta.idDbType) {
|
|
228
|
+
case "int":
|
|
229
|
+
case "bigint": return -1;
|
|
230
|
+
case "uuid": return "00000000-0000-0000-0000-000000000000";
|
|
231
|
+
case "text": return "0";
|
|
232
|
+
default: return assertNever(meta.idDbType);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/** Returns true for values that should be treated like an omitted filter. */
|
|
236
|
+
function shouldPruneValueFilter(key, value) {
|
|
237
|
+
if (value === void 0) return true;
|
|
238
|
+
return value === false && key !== "eq" && key !== "ne";
|
|
239
|
+
}
|
|
240
|
+
//#endregion
|
|
241
|
+
export { isNilIdValue, makeLike, mapToDb, parseEntityFilter, parseValueFilter };
|
|
242
|
+
|
|
243
|
+
//# sourceMappingURL=valueFilters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueFilters.js","names":[],"sources":["../../src/queries/valueFilters.ts"],"sourcesContent":["import { isPlainObject } from \"joist-utils\";\n\nimport type { Column } from \"../columns.ts\";\nimport { type Entity, isEntity } from \"../Entity.ts\";\nimport { isDefined } from \"../EntityManager.ts\";\nimport type { EntityMetadata } from \"../EntityMetadata.ts\";\nimport { assertNever } from \"../utils.ts\";\nimport { isAlias } from \"./find/Aliases.ts\";\nimport type { ValueFilter } from \"./find/EntityFilter.ts\";\nimport { isScope } from \"./find/scopes.ts\";\nimport type { ParsedValueFilter } from \"./parsedConditions.ts\";\n\n/** An ADT version of `EntityFilter`. */\nexport type ParsedEntityFilter =\n // ParsedValueFilter is any simple match on `id`\n | ParsedValueFilter<string | number>\n // Otherwise we return the join/complex\n | { kind: \"join\"; subFilter: object };\n\n/** Parses an entity filter, which could be \"just an id\", an array of ids, or a nested filter. */\nexport function parseEntityFilter(meta: EntityMetadata, filter: any): ParsedEntityFilter | undefined {\n if (filter === undefined) {\n // This matches legacy `em.find(Book, { author: undefined })` behavior\n return undefined;\n } else if (isAlias(filter)) {\n // We're just binding an alias to this position in the join tree\n return undefined;\n } else if (isScope(filter)) {\n // A scope on a relation (e.g. `{ author: Author.adult }`) always implies conditions on the\n // related entity, so signal \"needs a join\" via the existing `join` discriminant rather than\n // adding a dedicated `kind: \"scope\"` that every relation branch would have to learn. The empty\n // `subFilter` is intentionally never read: the m2o/m2m branches only check `kind === \"join\"` to\n // decide whether to join, then re-dispatch the original scope value back through `addTable`,\n // where `isScope(...)` routes it to `addScopeFilterAt` to apply the scope's actual fragments.\n return { kind: \"join\", subFilter: {} };\n } else if (filter === null) {\n return { kind: \"is-null\" };\n } else if (typeof filter === \"string\" || typeof filter === \"number\") {\n return { kind: \"eq\", value: filter };\n } else if (typeof filter === \"boolean\") {\n return filter ? { kind: \"not-null\" } : { kind: \"is-null\" };\n } else if (Array.isArray(filter)) {\n return {\n kind: \"in\",\n value: filter.map((v: string | number | Entity) => {\n return isEntity(v) ? (v.idTaggedMaybe ?? nilIdValue(meta)) : v;\n }),\n };\n } else if (isEntity(filter)) {\n return { kind: \"eq\", value: filter.idTaggedMaybe || nilIdValue(meta) };\n } else if (typeof filter === \"object\") {\n // Looking for `{ firstName: \"f1\" }` or `{ ne: \"f1\" }`\n const keys = Object.keys(filter);\n // Special case only looking at `ne`\n if (keys.length === 1 && keys[0] === \"ne\") {\n const value = filter[\"ne\"];\n if (value === undefined) {\n return undefined;\n } else if (value === null) {\n return { kind: \"not-null\" };\n } else if (typeof value === \"string\" || typeof value === \"number\") {\n return { kind: \"ne\", value };\n } else if (isEntity(value)) {\n return { kind: \"ne\", value: value.idTaggedMaybe || nilIdValue(meta) };\n } else {\n throw new Error(`Unsupported \"ne\" value ${value}`);\n }\n }\n // Special case only looking at `id`\n if (keys.length === 1 && keys[0] === \"id\") {\n const value = filter[\"id\"];\n if (value === undefined) {\n return undefined;\n } else if (value === null) {\n return { kind: \"is-null\" };\n } else if (typeof value === \"string\" || typeof value === \"number\") {\n return { kind: \"eq\", value };\n } else if (isEntity(value)) {\n return { kind: \"eq\", value: value.idTaggedMaybe || nilIdValue(meta) };\n } else {\n return parseValueFilter(value)[0] as any;\n }\n }\n // Look for subFilter values being EntityFilter-ish instances like ManyToOneReference\n // that have an id, and so structurally match the entity filter without really being filters,\n // and convert them over here before getting into parseValueFilter.\n const subFilter = {} as any;\n for (const [key, value] of Object.entries(filter)) {\n if (value && typeof value === \"object\" && !isPlainObject(value) && \"idTaggedMaybe\" in value) {\n subFilter[key] = value.idTaggedMaybe || nilIdValue(meta);\n } else {\n subFilter[key] = value;\n }\n }\n return { kind: \"join\", subFilter };\n } else {\n throw new Error(`Unrecognized filter ${filter}`);\n }\n}\n\n/**\n * Parses the many/hodgepodge (ergonomic!) patterns of value filters into a `ParsedValueFilter[]`.\n *\n * Note we return an array because filter might be a `ValueGraphQLFilter` that is allowed to have\n * multiple conditions, i.e. `{ lt: 10, gt: 5 }`.\n */\nexport function parseValueFilter<V>(filter: ValueFilter<V, any>): ParsedValueFilter<V>[] {\n if (filter === null) {\n return [{ kind: \"is-null\" }];\n } else if (filter === undefined) {\n // This is legacy behavior where `em.find(Book, { author: undefined })` would match all books\n return [];\n } else if (Array.isArray(filter)) {\n return [{ kind: \"in\", value: filter }];\n } else if (isPlainObject(filter)) {\n const keys = Object.keys(filter);\n if (keys.length === 0) {\n // Should this be an error?\n return [];\n } else if (keys.length === 2 && \"op\" in filter && \"value\" in filter) {\n // Probe for `findGql` op & value\n const { op, value } = filter;\n if (shouldPruneValueFilter(op, value)) {\n return [];\n } else if (value === null) {\n return [{ kind: \"is-null\" }];\n } else {\n return [{ kind: op, value: value ?? null }];\n }\n } else if (keys.length === 2 && \"gte\" in filter && \"lte\" in filter) {\n const { gte, lte } = filter;\n return [{ kind: \"between\", value: [gte, lte] }];\n } else {\n return Object.entries(filter)\n .map(([key, value]) => {\n // Always do condition pruning on the value\n if (shouldPruneValueFilter(key, value)) {\n return undefined;\n }\n switch (key) {\n case \"eq\":\n if (value === null) {\n return { kind: \"is-null\" as const };\n } else {\n return { kind: \"eq\" as const, value: filter[key] };\n }\n case \"ne\":\n if (value === null) {\n return { kind: \"not-null\" as const };\n } else {\n return { kind: \"ne\" as const, value: filter[key] ?? null };\n }\n case \"in\":\n case \"nin\":\n case \"gt\":\n case \"gte\":\n case \"lt\":\n case \"lte\":\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 \"contains\":\n case \"overlaps\":\n case \"containedBy\":\n return { kind: key, value: filter[key] };\n case \"pathExists\":\n return { kind: \"jsonPathExists\" as const, value: filter[key] };\n case \"pathIsTrue\":\n return { kind: \"jsonPathPredicate\" as const, value: filter[key] };\n case \"search\":\n return { kind: \"ilike\" as const, value: makeLike(filter[key]) };\n case \"between\":\n return { kind: key, value: filter[key] };\n default:\n throw new Error(`Unsupported value filter key ${key}`);\n }\n })\n .filter(isDefined);\n }\n } else {\n // This is a primitive like a string, number\n return [{ kind: \"eq\", value: filter }];\n }\n}\n\n/** Converts domain-level values like string ids/enums into their db equivalent. */\nexport function mapToDb(column: Column, filter: ParsedValueFilter<any>): ParsedValueFilter<any> {\n // ...to teach this `mapToDb` function to handle/rewrite `in: [1, null]` handling, we'd need to:\n // 1. return a maybe-simple/maybe-nested condition, so basically a `ParsedExpressionCondition`, because\n // this would let `in` return an `{ or: ... }` to all the callers.\n // 2. also return `{ parsed: ParsedExpressionCondition, simples: SimpleCondition[] }` tuple, for the\n // alias `addCondition` processing to track the `simples` and rewrite their alias when later bound.\n switch (filter.kind) {\n case \"eq\":\n case \"gt\":\n case \"gte\":\n case \"ne\":\n case \"lt\":\n case \"lte\":\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 filter.value = column.mapToDb(filter.value);\n return filter;\n case \"in\":\n if (column.isArray) {\n // Arrays need a special operator\n return { kind: \"contains\", value: column.mapToDb(filter.value) };\n } else {\n filter.value = filter.value.map((v) => column.mapToDb(v));\n }\n return filter;\n case \"nin\":\n if (column.isArray) {\n // Arrays need a special operator\n throw new Error(\"The nin operator is not supported on array columns yet\");\n } else {\n filter.value = filter.value.map((v) => column.mapToDb(v));\n }\n return filter;\n case \"contains\":\n case \"ncontains\":\n case \"overlaps\":\n case \"noverlaps\":\n case \"containedBy\":\n const supportsContains = column.isArray || column.dbType === \"jsonb\";\n if (!supportsContains) {\n throw new Error(`${filter.kind} is only unsupported on array or jsonb columns`);\n }\n if (column.isArray) {\n filter.value = column.mapToDb(filter.value);\n } else {\n // leave jsonb values alone\n }\n return filter;\n case \"between\":\n filter.value = [column.mapToDb(filter.value[0]), column.mapToDb(filter.value[1])];\n return filter;\n case \"is-null\":\n case \"not-null\":\n case \"jsonPathExists\":\n case \"jsonPathPredicate\":\n return filter;\n default:\n throw assertNever(filter);\n }\n}\n\n/** Converts a search term like `foo bar` into a SQL `like` pattern like `%foo%bar%`. */\nexport function makeLike(search: any | undefined): any {\n return search ? `%${search.replace(/\\s+/g, \"%\")}%` : undefined;\n}\n\n/** Recognizes placeholder IDs used when a filter contains an unpersisted entity. */\nexport function isNilIdValue(value: unknown): boolean {\n return value === -1 || value === \"00000000-0000-0000-0000-000000000000\";\n}\n\n/**\n * We use this value if users include new (id-less) entities as em.find conditions.\n *\n * The idea is that this condition would never be met, but we still want to do the em.find\n * query in case it's in an `OR` clause that would match false, but some other part of the\n * clause would match. I.e. instead of just skipping the DB query all together, which is\n * also something we could consider doing.\n *\n * For int IDs we use -1, and for uuid IDs, we use the nil UUID value:\n *\n * https://en.wikipedia.org/wiki/Universally_unique_identifier#Nil_UUID\n */\nfunction nilIdValue(meta: EntityMetadata): any {\n switch (meta.idDbType) {\n case \"int\":\n case \"bigint\":\n return -1;\n case \"uuid\":\n return \"00000000-0000-0000-0000-000000000000\";\n case \"text\":\n return \"0\";\n default:\n return assertNever(meta.idDbType);\n }\n}\n\n/** Returns true for values that should be treated like an omitted filter. */\nfunction shouldPruneValueFilter(key: unknown, value: unknown): boolean {\n if (value === undefined) return true;\n return value === false && key !== \"eq\" && key !== \"ne\";\n}\n"],"mappings":";;;;;;;;AAoBA,SAAgB,kBAAkB,MAAsB,QAA6C;CACnG,IAAI,WAAW,KAAA,GAEb;MACK,IAAI,QAAQ,MAAM,GAEvB;MACK,IAAI,QAAQ,MAAM,GAOvB,OAAO;EAAE,MAAM;EAAQ,WAAW,CAAC;CAAE;MAChC,IAAI,WAAW,MACpB,OAAO,EAAE,MAAM,UAAU;MACpB,IAAI,OAAO,WAAW,YAAY,OAAO,WAAW,UACzD,OAAO;EAAE,MAAM;EAAM,OAAO;CAAO;MAC9B,IAAI,OAAO,W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,QAAQ,OAAO,MAAM,KAAK,MAAM,OAAO,QAAQ,CAAC,CAAC;GAE1D,OAAO;EACT,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;GAEH,IAAI,EADqB,OAAO,WAAW,OAAO,WAAW,UAE3D,MAAM,IAAI,MAAM,GAAG,OAAO,KAAK,+CAA+C;GAEhF,IAAI,OAAO,SACT,OAAO,QAAQ,OAAO,QAAQ,OAAO,KAAK;GAI5C,OAAO;EACT,KAAK;GACH,OAAO,QAAQ,CAAC,OAAO,QAAQ,OAAO,MAAM,EAAE,GAAG,OAAO,QAAQ,OAAO,MAAM,EAAE,CAAC;GAChF,OAAO;EACT,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,qBACH,OAAO;EACT,SACE,MAAM,YAAY,MAAM;CAC5B;AACF;;AAGA,SAAgB,SAAS,QAA8B;CACrD,OAAO,SAAS,IAAI,OAAO,QAAQ,QAAQ,GAAG,EAAE,KAAK,KAAA;AACvD;;AAGA,SAAgB,aAAa,OAAyB;CACpD,OAAO,UAAU,MAAM,UAAU;AACnC;;;;;;;;;;;;;AAcA,SAAS,WAAW,MAA2B;CAC7C,QAAQ,KAAK,UAAb;EACE,KAAK;EACL,KAAK,UACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,SACE,OAAO,YAAY,KAAK,QAAQ;CACpC;AACF;;AAGA,SAAS,uBAAuB,KAAc,OAAyB;CACrE,IAAI,UAAU,KAAA,GAAW,OAAO;CAChC,OAAO,UAAU,SAAS,QAAQ,QAAQ,QAAQ;AACpD"}
|
package/build/reactiveHints.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./typeMap.cjs");
|
|
3
|
-
const require_getProperties = require("./getProperties.cjs");
|
|
4
2
|
const require_relations_hasProperty = require("./relations/hasProperty.cjs");
|
|
3
|
+
require("./typeMap.cjs");
|
|
4
|
+
require("./changes.cjs");
|
|
5
5
|
require("./relations/OneToOneReference.cjs");
|
|
6
6
|
const require_relations_ReactiveGetter = require("./relations/ReactiveGetter.cjs");
|
|
7
7
|
const require_relations_RecursiveCollection = require("./relations/RecursiveCollection.cjs");
|
|
8
|
-
require("./relations/index.cjs");
|
|
9
|
-
const require_EntityMetadata = require("./EntityMetadata.cjs");
|
|
10
|
-
require("./changes.cjs");
|
|
11
8
|
const require_normalizeHints = require("./normalizeHints.cjs");
|
|
12
9
|
require("./loadHints.cjs");
|
|
13
10
|
const require_utils = require("./utils.cjs");
|
|
11
|
+
const require_getProperties = require("./getProperties.cjs");
|
|
12
|
+
require("./relations/index.cjs");
|
|
13
|
+
const require_EntityMetadata = require("./EntityMetadata.cjs");
|
|
14
14
|
const require_EntityManager = require("./EntityManager.cjs");
|
|
15
15
|
const require_Entity = require("./Entity.cjs");
|
|
16
16
|
const require_BaseEntity = require("./BaseEntity.cjs");
|
package/build/reactiveHints.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import "./typeMap.js";
|
|
2
|
-
import { getProperties } from "./getProperties.js";
|
|
3
1
|
import { PropertyImpl } from "./relations/hasProperty.js";
|
|
2
|
+
import "./typeMap.js";
|
|
3
|
+
import "./changes.js";
|
|
4
4
|
import "./relations/OneToOneReference.js";
|
|
5
5
|
import { ReactiveGetterImpl } from "./relations/ReactiveGetter.js";
|
|
6
6
|
import { RecursiveChildrenCollectionImpl, RecursiveM2mCollectionImpl, RecursiveParentsCollectionImpl } from "./relations/RecursiveCollection.js";
|
|
7
|
-
import "./relations/index.js";
|
|
8
|
-
import { getBaseAndSelfMetas, getBaseMeta, getMetadata } from "./EntityMetadata.js";
|
|
9
|
-
import "./changes.js";
|
|
10
7
|
import { normalizeHint, suffixRe } from "./normalizeHints.js";
|
|
11
8
|
import "./loadHints.js";
|
|
12
9
|
import { fail, flatAndUnique, mergeNormalizedHints } from "./utils.js";
|
|
10
|
+
import { getProperties } from "./getProperties.js";
|
|
11
|
+
import "./relations/index.js";
|
|
12
|
+
import { getBaseAndSelfMetas, getBaseMeta, getMetadata } from "./EntityMetadata.js";
|
|
13
13
|
import { getEmInternalApi, isId } from "./EntityManager.js";
|
|
14
14
|
import { isEntity } from "./Entity.js";
|
|
15
15
|
import { getInstanceData } from "./BaseEntity.js";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_relations_AbstractPropertyImpl = require("./AbstractPropertyImpl.cjs");
|
|
3
|
-
const require_EntityMetadata = require("../EntityMetadata.cjs");
|
|
4
3
|
//#region src/relations/AbstractRelationImpl.ts
|
|
5
4
|
/**
|
|
6
5
|
* Defines common hooks that relations can respond to to keep the entity graph in sync.
|
|
@@ -10,11 +9,7 @@ var AbstractRelationImpl = class extends require_relations_AbstractPropertyImpl.
|
|
|
10
9
|
super(entity);
|
|
11
10
|
}
|
|
12
11
|
};
|
|
13
|
-
function isCascadeDelete(relation, fieldName) {
|
|
14
|
-
return require_EntityMetadata.getBaseAndSelfMetas(require_EntityMetadata.getMetadata(relation.entity)).some((meta) => meta.config.__data.cascadeDeleteFields.includes(fieldName));
|
|
15
|
-
}
|
|
16
12
|
//#endregion
|
|
17
13
|
exports.AbstractRelationImpl = AbstractRelationImpl;
|
|
18
|
-
exports.isCascadeDelete = isCascadeDelete;
|
|
19
14
|
|
|
20
15
|
//# sourceMappingURL=AbstractRelationImpl.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractRelationImpl.cjs","names":["AbstractPropertyImpl"
|
|
1
|
+
{"version":3,"file":"AbstractRelationImpl.cjs","names":["AbstractPropertyImpl"],"sources":["../../src/relations/AbstractRelationImpl.ts"],"sourcesContent":["import { AbstractPropertyImpl } from \"./AbstractPropertyImpl.ts\";\n\n/**\n * Defines common hooks that relations can respond to to keep the entity graph in sync.\n */\nexport abstract class AbstractRelationImpl<T, U> extends AbstractPropertyImpl<T> {\n constructor(entity: T) {\n super(entity);\n }\n\n /** Called with the opts from a `new` or `em.create` call, i.e. on a new entity. */\n abstract setFromOpts(value: U): void;\n\n /** Similar to setFromOpts, but called post-construction. */\n abstract set(value: U): void;\n\n /** Whether this relation is loaded. */\n abstract get isLoaded(): boolean;\n\n /** Whether this relation is preloaded. */\n abstract get isPreloaded(): boolean;\n\n /** Loads the other side of this relation. */\n abstract load(opts?: { forceReload?: boolean }): Promise<any>;\n\n /** Whether the relation from the preload cache, if preloaded. */\n abstract preload(): void;\n\n abstract get get(): U | undefined;\n\n /**\n * Called when our entity has been `em.delete`-d and then `em.flush` is being called,\n * so we can unset any foreign keys to the being-deleted entity and clear out any pointers\n * to it. I.e.:\n *\n * - `em.delete(author)`\n * - `em.flush` loads all `author.books`\n * - Unsets their `book.author` to let their validation rules know\n */\n abstract cleanupOnEntityDeleted(): Promise<void>;\n\n /**\n * Called to cascade deletes into the relation if it has cascade behavior enabled. This function is called twice,\n * once on the initial `EntityManager.delete` call in a potentially unloaded state, then again from a `beforeDelete`\n * hook after the relation is fully loaded.\n */\n abstract maybeCascadeDelete(): void;\n\n abstract get fieldName(): string;\n}\n"],"mappings":";;;;;;AAKA,IAAsB,uBAAtB,cAAyDA,uCAAAA,qBAAwB;CAC/E,YAAY,QAAW;EACrB,MAAM,MAAM;CACd;AAyCF"}
|
|
@@ -38,7 +38,6 @@ declare abstract class AbstractRelationImpl<T, U> extends AbstractPropertyImpl<T
|
|
|
38
38
|
abstract maybeCascadeDelete(): void;
|
|
39
39
|
abstract get fieldName(): string;
|
|
40
40
|
}
|
|
41
|
-
declare function isCascadeDelete(relation: AbstractRelationImpl<any, any>, fieldName: string): boolean;
|
|
42
41
|
//#endregion
|
|
43
|
-
export { AbstractRelationImpl
|
|
42
|
+
export { AbstractRelationImpl };
|
|
44
43
|
//# sourceMappingURL=AbstractRelationImpl.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractRelationImpl.d.cts","names":[],"sources":["../../src/relations/AbstractRelationImpl.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"AbstractRelationImpl.d.cts","names":[],"sources":["../../src/relations/AbstractRelationImpl.ts"],"mappings":";;;;;uBAKsB,qBAAqB,GAAG,WAAW,qBAAqB;EAC5E,YAAY,QAAQ;;WAKX,YAAY,OAAO;;WAGnB,IAAI,OAAO;;eAGP;;eAGA;;WAGJ,KAAK;IAAS;MAA0B;;WAGxC;eAEI,OAAO;;;;;;;;;;WAWX,0BAA0B;;;;;;WAO1B;eAEI"}
|
|
@@ -38,7 +38,6 @@ declare abstract class AbstractRelationImpl<T, U> extends AbstractPropertyImpl<T
|
|
|
38
38
|
abstract maybeCascadeDelete(): void;
|
|
39
39
|
abstract get fieldName(): string;
|
|
40
40
|
}
|
|
41
|
-
declare function isCascadeDelete(relation: AbstractRelationImpl<any, any>, fieldName: string): boolean;
|
|
42
41
|
//#endregion
|
|
43
|
-
export { AbstractRelationImpl
|
|
42
|
+
export { AbstractRelationImpl };
|
|
44
43
|
//# sourceMappingURL=AbstractRelationImpl.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractRelationImpl.d.mts","names":[],"sources":["../../src/relations/AbstractRelationImpl.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"AbstractRelationImpl.d.mts","names":[],"sources":["../../src/relations/AbstractRelationImpl.ts"],"mappings":";;;;;uBAKsB,qBAAqB,GAAG,WAAW,qBAAqB;EAC5E,YAAY,QAAQ;;WAKX,YAAY,OAAO;;WAGnB,IAAI,OAAO;;eAGP;;eAGA;;WAGJ,KAAK;IAAS;MAA0B;;WAGxC;eAEI,OAAO;;;;;;;;;;WAWX,0BAA0B;;;;;;WAO1B;eAEI"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AbstractPropertyImpl } from "./AbstractPropertyImpl.js";
|
|
2
|
-
import { getBaseAndSelfMetas, getMetadata } from "../EntityMetadata.js";
|
|
3
2
|
//#region src/relations/AbstractRelationImpl.ts
|
|
4
3
|
/**
|
|
5
4
|
* Defines common hooks that relations can respond to to keep the entity graph in sync.
|
|
@@ -9,10 +8,7 @@ var AbstractRelationImpl = class extends AbstractPropertyImpl {
|
|
|
9
8
|
super(entity);
|
|
10
9
|
}
|
|
11
10
|
};
|
|
12
|
-
function isCascadeDelete(relation, fieldName) {
|
|
13
|
-
return getBaseAndSelfMetas(getMetadata(relation.entity)).some((meta) => meta.config.__data.cascadeDeleteFields.includes(fieldName));
|
|
14
|
-
}
|
|
15
11
|
//#endregion
|
|
16
|
-
export { AbstractRelationImpl
|
|
12
|
+
export { AbstractRelationImpl };
|
|
17
13
|
|
|
18
14
|
//# sourceMappingURL=AbstractRelationImpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractRelationImpl.js","names":[],"sources":["../../src/relations/AbstractRelationImpl.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"AbstractRelationImpl.js","names":[],"sources":["../../src/relations/AbstractRelationImpl.ts"],"sourcesContent":["import { AbstractPropertyImpl } from \"./AbstractPropertyImpl.ts\";\n\n/**\n * Defines common hooks that relations can respond to to keep the entity graph in sync.\n */\nexport abstract class AbstractRelationImpl<T, U> extends AbstractPropertyImpl<T> {\n constructor(entity: T) {\n super(entity);\n }\n\n /** Called with the opts from a `new` or `em.create` call, i.e. on a new entity. */\n abstract setFromOpts(value: U): void;\n\n /** Similar to setFromOpts, but called post-construction. */\n abstract set(value: U): void;\n\n /** Whether this relation is loaded. */\n abstract get isLoaded(): boolean;\n\n /** Whether this relation is preloaded. */\n abstract get isPreloaded(): boolean;\n\n /** Loads the other side of this relation. */\n abstract load(opts?: { forceReload?: boolean }): Promise<any>;\n\n /** Whether the relation from the preload cache, if preloaded. */\n abstract preload(): void;\n\n abstract get get(): U | undefined;\n\n /**\n * Called when our entity has been `em.delete`-d and then `em.flush` is being called,\n * so we can unset any foreign keys to the being-deleted entity and clear out any pointers\n * to it. I.e.:\n *\n * - `em.delete(author)`\n * - `em.flush` loads all `author.books`\n * - Unsets their `book.author` to let their validation rules know\n */\n abstract cleanupOnEntityDeleted(): Promise<void>;\n\n /**\n * Called to cascade deletes into the relation if it has cascade behavior enabled. This function is called twice,\n * once on the initial `EntityManager.delete` call in a potentially unloaded state, then again from a `beforeDelete`\n * hook after the relation is fully loaded.\n */\n abstract maybeCascadeDelete(): void;\n\n abstract get fieldName(): string;\n}\n"],"mappings":";;;;;AAKA,IAAsB,uBAAtB,cAAyD,qBAAwB;CAC/E,YAAY,QAAW;EACrB,MAAM,MAAM;CACd;AAyCF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_newEntity = require("../newEntity.cjs");
|
|
3
2
|
const require_relations_AbstractPropertyImpl = require("./AbstractPropertyImpl.cjs");
|
|
4
3
|
const require_relations_PropertySymbols = require("./PropertySymbols.cjs");
|
|
5
4
|
require("./hasProperty.cjs");
|
|
5
|
+
const require_newEntity = require("../newEntity.cjs");
|
|
6
6
|
require("../Entity.cjs");
|
|
7
7
|
//#region src/relations/AsyncProperty.ts
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { lazyField } from "../newEntity.js";
|
|
2
1
|
import { AbstractPropertyImpl } from "./AbstractPropertyImpl.js";
|
|
3
2
|
import { PropertyT } from "./PropertySymbols.js";
|
|
4
3
|
import "./hasProperty.js";
|
|
4
|
+
import { lazyField } from "../newEntity.js";
|
|
5
5
|
import "../Entity.js";
|
|
6
6
|
//#region src/relations/AsyncProperty.ts
|
|
7
7
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_fields = require("../fields.cjs");
|
|
3
3
|
const require_relations_AbstractPropertyImpl = require("./AbstractPropertyImpl.cjs");
|
|
4
4
|
const require_relations_PropertySymbols = require("./PropertySymbols.cjs");
|
|
5
|
-
const require_EntityMetadata = require("../EntityMetadata.cjs");
|
|
6
|
-
const require_fields = require("../fields.cjs");
|
|
7
5
|
const require_reactiveHints = require("../reactiveHints.cjs");
|
|
8
6
|
const require_normalizeHints = require("../normalizeHints.cjs");
|
|
9
7
|
const require_loadHints = require("../loadHints.cjs");
|
|
10
8
|
const require_utils = require("../utils.cjs");
|
|
9
|
+
const require_newEntity = require("../newEntity.cjs");
|
|
10
|
+
const require_EntityMetadata = require("../EntityMetadata.cjs");
|
|
11
11
|
require("../index.cjs");
|
|
12
12
|
require("../Entity.cjs");
|
|
13
13
|
//#region src/relations/AsyncReactiveField.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getField, isFieldSet, setField } from "../fields.js";
|
|
2
2
|
import { AbstractPropertyImpl } from "./AbstractPropertyImpl.js";
|
|
3
3
|
import { PropertyT } from "./PropertySymbols.js";
|
|
4
|
-
import { getMetadata } from "../EntityMetadata.js";
|
|
5
|
-
import { getField, isFieldSet, setField } from "../fields.js";
|
|
6
4
|
import { convertToLoadHint } from "../reactiveHints.js";
|
|
7
5
|
import { deepNormalizeHint } from "../normalizeHints.js";
|
|
8
6
|
import { isLoaded } from "../loadHints.js";
|
|
9
7
|
import { mergeNormalizedHints } from "../utils.js";
|
|
8
|
+
import { lazyField } from "../newEntity.js";
|
|
9
|
+
import { getMetadata } from "../EntityMetadata.js";
|
|
10
10
|
import "../index.js";
|
|
11
11
|
import "../Entity.js";
|
|
12
12
|
//#region src/relations/AsyncReactiveField.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_relations_OneToManyCollection = require("./OneToManyCollection.cjs");
|
|
2
3
|
const require_relations_CustomCollection = require("./CustomCollection.cjs");
|
|
3
4
|
const require_relations_ManyToManyCollection = require("./ManyToManyCollection.cjs");
|
|
4
|
-
const require_relations_OneToManyCollection = require("./OneToManyCollection.cjs");
|
|
5
5
|
const require_relations_ReactiveManyToMany = require("./ReactiveManyToMany.cjs");
|
|
6
6
|
const require_relations_ReactiveManyToManyOtherSide = require("./ReactiveManyToManyOtherSide.cjs");
|
|
7
7
|
require("./index.cjs");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { OneToManyCollection } from "./OneToManyCollection.js";
|
|
1
2
|
import { CustomCollection } from "./CustomCollection.js";
|
|
2
3
|
import { ManyToManyCollection } from "./ManyToManyCollection.js";
|
|
3
|
-
import { OneToManyCollection } from "./OneToManyCollection.js";
|
|
4
4
|
import { ReactiveManyToManyImpl } from "./ReactiveManyToMany.js";
|
|
5
5
|
import { ReactiveManyToManyOtherSideImpl } from "./ReactiveManyToManyOtherSide.js";
|
|
6
6
|
import "./index.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_newEntity = require("../newEntity.cjs");
|
|
3
2
|
const require_relations_AbstractRelationImpl = require("./AbstractRelationImpl.cjs");
|
|
4
3
|
const require_relations_RelationSymbols = require("./RelationSymbols.cjs");
|
|
5
4
|
const require_utils = require("../utils.cjs");
|
|
5
|
+
const require_newEntity = require("../newEntity.cjs");
|
|
6
6
|
const require_index = require("../index.cjs");
|
|
7
7
|
const require_EntityManager = require("../EntityManager.cjs");
|
|
8
8
|
require("../Entity.cjs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { lazyField } from "../newEntity.js";
|
|
2
1
|
import { AbstractRelationImpl } from "./AbstractRelationImpl.js";
|
|
3
2
|
import { RelationT, RelationU } from "./RelationSymbols.js";
|
|
4
3
|
import { fail } from "../utils.js";
|
|
4
|
+
import { lazyField } from "../newEntity.js";
|
|
5
5
|
import { ensureNotDeleted } from "../index.js";
|
|
6
6
|
import { getEmInternalApi } from "../EntityManager.js";
|
|
7
7
|
import "../Entity.js";
|