@contember/engine-content-api 2.2.0-alpha.2 → 2.2.0-alpha.20
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/CLAUDE.md +25 -7
- package/dist/development/index.cjs +36 -0
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +40 -4
- package/dist/development/index.js.map +1 -1
- package/dist/development/src/ExecutionContainer.cjs +18 -10
- package/dist/development/src/ExecutionContainer.cjs.map +1 -1
- package/dist/development/src/ExecutionContainer.js +18 -10
- package/dist/development/src/ExecutionContainer.js.map +1 -1
- package/dist/development/src/acl/AclScope.cjs +7 -0
- package/dist/development/src/acl/AclScope.cjs.map +1 -0
- package/dist/development/src/acl/AclScope.js +7 -0
- package/dist/development/src/acl/AclScope.js.map +1 -0
- package/dist/development/src/acl/Authorizator.cjs +6 -4
- package/dist/development/src/acl/Authorizator.cjs.map +1 -1
- package/dist/development/src/acl/Authorizator.js +6 -4
- package/dist/development/src/acl/Authorizator.js.map +1 -1
- package/dist/development/src/acl/EvaluatedPredicateReplacer.cjs +4 -1
- package/dist/development/src/acl/EvaluatedPredicateReplacer.cjs.map +1 -1
- package/dist/development/src/acl/EvaluatedPredicateReplacer.js +4 -1
- package/dist/development/src/acl/EvaluatedPredicateReplacer.js.map +1 -1
- package/dist/development/src/acl/PermissionFactory.cjs +57 -68
- package/dist/development/src/acl/PermissionFactory.cjs.map +1 -1
- package/dist/development/src/acl/PermissionFactory.js +58 -69
- package/dist/development/src/acl/PermissionFactory.js.map +1 -1
- package/dist/development/src/acl/PredicateFactory.cjs +95 -26
- package/dist/development/src/acl/PredicateFactory.cjs.map +1 -1
- package/dist/development/src/acl/PredicateFactory.js +95 -26
- package/dist/development/src/acl/PredicateFactory.js.map +1 -1
- package/dist/development/src/acl/PredicatesInjector.cjs +97 -99
- package/dist/development/src/acl/PredicatesInjector.cjs.map +1 -1
- package/dist/development/src/acl/PredicatesInjector.js +99 -101
- package/dist/development/src/acl/PredicatesInjector.js.map +1 -1
- package/dist/development/src/acl/VariableInjector.cjs +7 -2
- package/dist/development/src/acl/VariableInjector.cjs.map +1 -1
- package/dist/development/src/acl/VariableInjector.js +7 -2
- package/dist/development/src/acl/VariableInjector.js.map +1 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs +28 -2
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs.map +1 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js +29 -3
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js.map +1 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs +16 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js +16 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs +29 -3
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js +29 -3
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs +14 -0
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js +14 -0
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js.map +1 -1
- package/dist/development/src/input-validation/ValidationDataSelector.cjs +2 -2
- package/dist/development/src/input-validation/ValidationDataSelector.cjs.map +1 -1
- package/dist/development/src/input-validation/ValidationDataSelector.js +2 -2
- package/dist/development/src/input-validation/ValidationDataSelector.js.map +1 -1
- package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs +24 -3
- package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs.map +1 -1
- package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js +24 -3
- package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js.map +1 -1
- package/dist/development/src/inputProcessing/UpdateInputVisitor.cjs +52 -2
- package/dist/development/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
- package/dist/development/src/inputProcessing/UpdateInputVisitor.js +52 -2
- package/dist/development/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
- package/dist/development/src/introspection/IntrospectionSchemaFactory.cjs +11 -6
- package/dist/development/src/introspection/IntrospectionSchemaFactory.cjs.map +1 -1
- package/dist/development/src/introspection/IntrospectionSchemaFactory.js +11 -6
- package/dist/development/src/introspection/IntrospectionSchemaFactory.js.map +1 -1
- package/dist/development/src/introspection/introspection.schema.cjs +2 -2
- package/dist/development/src/introspection/introspection.schema.cjs.map +1 -1
- package/dist/development/src/introspection/introspection.schema.js +2 -2
- package/dist/development/src/introspection/introspection.schema.js.map +1 -1
- package/dist/development/src/mapper/ErrorUtils.cjs +17 -1
- package/dist/development/src/mapper/ErrorUtils.cjs.map +1 -1
- package/dist/development/src/mapper/ErrorUtils.js +17 -1
- package/dist/development/src/mapper/ErrorUtils.js.map +1 -1
- package/dist/development/src/mapper/JunctionTableManager.cjs +18 -12
- package/dist/development/src/mapper/JunctionTableManager.cjs.map +1 -1
- package/dist/development/src/mapper/JunctionTableManager.js +19 -13
- package/dist/development/src/mapper/JunctionTableManager.js.map +1 -1
- package/dist/development/src/mapper/Mapper.cjs +111 -37
- package/dist/development/src/mapper/Mapper.cjs.map +1 -1
- package/dist/development/src/mapper/Mapper.js +112 -38
- package/dist/development/src/mapper/Mapper.js.map +1 -1
- package/dist/development/src/mapper/MapperFactory.cjs +7 -4
- package/dist/development/src/mapper/MapperFactory.cjs.map +1 -1
- package/dist/development/src/mapper/MapperFactory.js +7 -4
- package/dist/development/src/mapper/MapperFactory.js.map +1 -1
- package/dist/development/src/mapper/MutationProcessorHelper.cjs +12 -0
- package/dist/development/src/mapper/MutationProcessorHelper.cjs.map +1 -1
- package/dist/development/src/mapper/MutationProcessorHelper.js +13 -1
- package/dist/development/src/mapper/MutationProcessorHelper.js.map +1 -1
- package/dist/development/src/mapper/Result.cjs +1 -0
- package/dist/development/src/mapper/Result.cjs.map +1 -1
- package/dist/development/src/mapper/Result.js +1 -0
- package/dist/development/src/mapper/Result.js.map +1 -1
- package/dist/development/src/mapper/delete/DeleteExecutor.cjs +15 -8
- package/dist/development/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
- package/dist/development/src/mapper/delete/DeleteExecutor.js +15 -8
- package/dist/development/src/mapper/delete/DeleteExecutor.js.map +1 -1
- package/dist/development/src/mapper/insert/InsertBuilder.cjs +3 -2
- package/dist/development/src/mapper/insert/InsertBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/insert/InsertBuilder.js +3 -2
- package/dist/development/src/mapper/insert/InsertBuilder.js.map +1 -1
- package/dist/development/src/mapper/insert/InsertBuilderFactory.cjs +2 -2
- package/dist/development/src/mapper/insert/InsertBuilderFactory.cjs.map +1 -1
- package/dist/development/src/mapper/insert/InsertBuilderFactory.js +2 -2
- package/dist/development/src/mapper/insert/InsertBuilderFactory.js.map +1 -1
- package/dist/development/src/mapper/insert/Inserter.cjs +3 -3
- package/dist/development/src/mapper/insert/Inserter.cjs.map +1 -1
- package/dist/development/src/mapper/insert/Inserter.js +3 -3
- package/dist/development/src/mapper/insert/Inserter.js.map +1 -1
- package/dist/development/src/mapper/insert/SqlCreateInputProcessor.cjs +3 -2
- package/dist/development/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/SqlCreateInputProcessor.js +3 -2
- package/dist/development/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs +9 -8
- package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js +9 -8
- package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs +4 -4
- package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js +4 -4
- package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs +3 -3
- package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js +3 -3
- package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs +7 -7
- package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js +7 -7
- package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs +6 -6
- package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js +6 -6
- package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/select/ConditionBuilder.cjs +8 -1
- package/dist/development/src/mapper/select/ConditionBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/ConditionBuilder.js +8 -1
- package/dist/development/src/mapper/select/ConditionBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/JoinBuilder.cjs +26 -4
- package/dist/development/src/mapper/select/JoinBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/JoinBuilder.js +27 -5
- package/dist/development/src/mapper/select/JoinBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/OrderByBuilder.cjs +84 -15
- package/dist/development/src/mapper/select/OrderByBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/OrderByBuilder.js +86 -17
- package/dist/development/src/mapper/select/OrderByBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/OrderByHelper.cjs +17 -7
- package/dist/development/src/mapper/select/OrderByHelper.cjs.map +1 -1
- package/dist/development/src/mapper/select/OrderByHelper.js +17 -7
- package/dist/development/src/mapper/select/OrderByHelper.js.map +1 -1
- package/dist/development/src/mapper/select/Path.cjs +25 -3
- package/dist/development/src/mapper/select/Path.cjs.map +1 -1
- package/dist/development/src/mapper/select/Path.js +26 -4
- package/dist/development/src/mapper/select/Path.js.map +1 -1
- package/dist/development/src/mapper/select/RelationFetcher.cjs +6 -5
- package/dist/development/src/mapper/select/RelationFetcher.cjs.map +1 -1
- package/dist/development/src/mapper/select/RelationFetcher.js +6 -5
- package/dist/development/src/mapper/select/RelationFetcher.js.map +1 -1
- package/dist/development/src/mapper/select/SelectBuilder.cjs +15 -21
- package/dist/development/src/mapper/select/SelectBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/SelectBuilder.js +13 -19
- package/dist/development/src/mapper/select/SelectBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/SelectHydrator.cjs +92 -31
- package/dist/development/src/mapper/select/SelectHydrator.cjs.map +1 -1
- package/dist/development/src/mapper/select/SelectHydrator.js +92 -31
- package/dist/development/src/mapper/select/SelectHydrator.js.map +1 -1
- package/dist/development/src/mapper/select/WhereBuilder.cjs +261 -47
- package/dist/development/src/mapper/select/WhereBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/WhereBuilder.js +262 -48
- package/dist/development/src/mapper/select/WhereBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/getFieldReadPredicate.cjs +8 -0
- package/dist/development/src/mapper/select/getFieldReadPredicate.cjs.map +1 -0
- package/dist/development/src/mapper/select/getFieldReadPredicate.js +8 -0
- package/dist/development/src/mapper/select/getFieldReadPredicate.js.map +1 -0
- package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs +9 -13
- package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
- package/dist/development/src/mapper/select/handlers/FieldsVisitor.js +10 -14
- package/dist/development/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
- package/dist/development/src/mapper/select/handlers/MetaHandler.cjs +6 -2
- package/dist/development/src/mapper/select/handlers/MetaHandler.cjs.map +1 -1
- package/dist/development/src/mapper/select/handlers/MetaHandler.js +6 -2
- package/dist/development/src/mapper/select/handlers/MetaHandler.js.map +1 -1
- package/dist/development/src/mapper/select/optimizer/WhereOptimizer.cjs +229 -3
- package/dist/development/src/mapper/select/optimizer/WhereOptimizer.cjs.map +1 -1
- package/dist/development/src/mapper/select/optimizer/WhereOptimizer.js +230 -4
- package/dist/development/src/mapper/select/optimizer/WhereOptimizer.js.map +1 -1
- package/dist/development/src/mapper/select/optimizer/WhereReplacer.cjs +3 -3
- package/dist/development/src/mapper/select/optimizer/WhereReplacer.cjs.map +1 -1
- package/dist/development/src/mapper/select/optimizer/WhereReplacer.js +1 -1
- package/dist/development/src/mapper/select/optimizer/WhereReplacer.js.map +1 -1
- package/dist/development/src/mapper/update/SqlUpdateInputProcessor.cjs +9 -5
- package/dist/development/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/SqlUpdateInputProcessor.js +10 -6
- package/dist/development/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/UpdateBuilder.cjs +35 -2
- package/dist/development/src/mapper/update/UpdateBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/update/UpdateBuilder.js +36 -3
- package/dist/development/src/mapper/update/UpdateBuilder.js.map +1 -1
- package/dist/development/src/mapper/update/UpdateBuilderFactory.cjs +3 -2
- package/dist/development/src/mapper/update/UpdateBuilderFactory.cjs.map +1 -1
- package/dist/development/src/mapper/update/UpdateBuilderFactory.js +3 -2
- package/dist/development/src/mapper/update/UpdateBuilderFactory.js.map +1 -1
- package/dist/development/src/mapper/update/Updater.cjs +12 -6
- package/dist/development/src/mapper/update/Updater.cjs.map +1 -1
- package/dist/development/src/mapper/update/Updater.js +13 -7
- package/dist/development/src/mapper/update/Updater.js.map +1 -1
- package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs +33 -19
- package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js +33 -19
- package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs +13 -11
- package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js +13 -11
- package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs +17 -8
- package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js +17 -8
- package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs +19 -16
- package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js +19 -16
- package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs +19 -16
- package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js +19 -16
- package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/relations/SetManyRelationHelper.cjs +123 -0
- package/dist/development/src/mapper/update/relations/SetManyRelationHelper.cjs.map +1 -0
- package/dist/development/src/mapper/update/relations/SetManyRelationHelper.js +123 -0
- package/dist/development/src/mapper/update/relations/SetManyRelationHelper.js.map +1 -0
- package/dist/development/src/resolvers/GraphQlQueryAstFactory.cjs.map +1 -1
- package/dist/development/src/resolvers/GraphQlQueryAstFactory.js.map +1 -1
- package/dist/development/src/resolvers/MutationResolver.cjs +76 -79
- package/dist/development/src/resolvers/MutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/MutationResolver.js +78 -81
- package/dist/development/src/resolvers/MutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/ReadHelpers.cjs +17 -6
- package/dist/development/src/resolvers/ReadHelpers.cjs.map +1 -1
- package/dist/development/src/resolvers/ReadHelpers.js +17 -6
- package/dist/development/src/resolvers/ReadHelpers.js.map +1 -1
- package/dist/development/src/resolvers/ReadResolver.cjs +27 -22
- package/dist/development/src/resolvers/ReadResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/ReadResolver.js +27 -22
- package/dist/development/src/resolvers/ReadResolver.js.map +1 -1
- package/dist/development/src/schema/CustomTypesProvider.cjs +35 -14
- package/dist/development/src/schema/CustomTypesProvider.cjs.map +1 -1
- package/dist/development/src/schema/CustomTypesProvider.js +36 -15
- package/dist/development/src/schema/CustomTypesProvider.js.map +1 -1
- package/dist/development/src/schema/EntityTypeProvider.cjs +11 -7
- package/dist/development/src/schema/EntityTypeProvider.cjs.map +1 -1
- package/dist/development/src/schema/EntityTypeProvider.js +11 -7
- package/dist/development/src/schema/EntityTypeProvider.js.map +1 -1
- package/dist/development/src/schema/GraphQlSchemaBuilder.cjs +16 -6
- package/dist/development/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
- package/dist/development/src/schema/GraphQlSchemaBuilder.js +16 -6
- package/dist/development/src/schema/GraphQlSchemaBuilder.js.map +1 -1
- package/dist/development/src/schema/GraphQlSchemaBuilderFactory.cjs +39 -11
- package/dist/development/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
- package/dist/development/src/schema/GraphQlSchemaBuilderFactory.js +39 -11
- package/dist/development/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
- package/dist/development/src/schema/MutationProvider.cjs +38 -16
- package/dist/development/src/schema/MutationProvider.cjs.map +1 -1
- package/dist/development/src/schema/MutationProvider.js +38 -16
- package/dist/development/src/schema/MutationProvider.js.map +1 -1
- package/dist/development/src/schema/OrderByTypeProvider.cjs +8 -2
- package/dist/development/src/schema/OrderByTypeProvider.cjs.map +1 -1
- package/dist/development/src/schema/OrderByTypeProvider.js +9 -3
- package/dist/development/src/schema/OrderByTypeProvider.js.map +1 -1
- package/dist/development/src/schema/QueryProvider.cjs +12 -11
- package/dist/development/src/schema/QueryProvider.cjs.map +1 -1
- package/dist/development/src/schema/QueryProvider.js +12 -11
- package/dist/development/src/schema/QueryProvider.js.map +1 -1
- package/dist/development/src/schema/ValidationQueriesProvider.cjs +2 -0
- package/dist/development/src/schema/ValidationQueriesProvider.cjs.map +1 -1
- package/dist/development/src/schema/ValidationQueriesProvider.js +2 -0
- package/dist/development/src/schema/ValidationQueriesProvider.js.map +1 -1
- package/dist/development/src/schema/WhereTypeProvider.cjs +17 -5
- package/dist/development/src/schema/WhereTypeProvider.cjs.map +1 -1
- package/dist/development/src/schema/WhereTypeProvider.js +18 -6
- package/dist/development/src/schema/WhereTypeProvider.js.map +1 -1
- package/dist/development/src/schema/calendarDate.cjs +21 -0
- package/dist/development/src/schema/calendarDate.cjs.map +1 -0
- package/dist/development/src/schema/calendarDate.js +21 -0
- package/dist/development/src/schema/calendarDate.js.map +1 -0
- package/dist/development/src/schema/entities/FieldTypeVisitor.cjs +15 -2
- package/dist/development/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
- package/dist/development/src/schema/entities/FieldTypeVisitor.js +15 -2
- package/dist/development/src/schema/entities/FieldTypeVisitor.js.map +1 -1
- package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.cjs +11 -3
- package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
- package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.js +11 -3
- package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs +11 -3
- package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.js +11 -3
- package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs +39 -2
- package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js +40 -3
- package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js.map +1 -1
- package/dist/development/src/schema/utils.cjs +10 -0
- package/dist/development/src/schema/utils.cjs.map +1 -1
- package/dist/development/src/schema/utils.js +11 -1
- package/dist/development/src/schema/utils.js.map +1 -1
- package/dist/development/src/schema-json/GraphQLJsBridge.cjs +108 -0
- package/dist/development/src/schema-json/GraphQLJsBridge.cjs.map +1 -0
- package/dist/development/src/schema-json/GraphQLJsBridge.js +108 -0
- package/dist/development/src/schema-json/GraphQLJsBridge.js.map +1 -0
- package/dist/development/src/schema-json/JsonColumnTypes.cjs +102 -0
- package/dist/development/src/schema-json/JsonColumnTypes.cjs.map +1 -0
- package/dist/development/src/schema-json/JsonColumnTypes.js +102 -0
- package/dist/development/src/schema-json/JsonColumnTypes.js.map +1 -0
- package/dist/development/src/schema-json/JsonContentSchemaBuilder.cjs +418 -0
- package/dist/development/src/schema-json/JsonContentSchemaBuilder.cjs.map +1 -0
- package/dist/development/src/schema-json/JsonContentSchemaBuilder.js +418 -0
- package/dist/development/src/schema-json/JsonContentSchemaBuilder.js.map +1 -0
- package/dist/development/src/schema-json/JsonContentSchemaShared.cjs +18 -0
- package/dist/development/src/schema-json/JsonContentSchemaShared.cjs.map +1 -0
- package/dist/development/src/schema-json/JsonContentSchemaShared.js +18 -0
- package/dist/development/src/schema-json/JsonContentSchemaShared.js.map +1 -0
- package/dist/development/src/schema-json/JsonEntityTypes.cjs +206 -0
- package/dist/development/src/schema-json/JsonEntityTypes.cjs.map +1 -0
- package/dist/development/src/schema-json/JsonEntityTypes.js +206 -0
- package/dist/development/src/schema-json/JsonEntityTypes.js.map +1 -0
- package/dist/development/src/schema-json/JsonFilterTypes.cjs +152 -0
- package/dist/development/src/schema-json/JsonFilterTypes.cjs.map +1 -0
- package/dist/development/src/schema-json/JsonFilterTypes.js +152 -0
- package/dist/development/src/schema-json/JsonFilterTypes.js.map +1 -0
- package/dist/development/src/schema-json/JsonInputTypes.cjs +256 -0
- package/dist/development/src/schema-json/JsonInputTypes.cjs.map +1 -0
- package/dist/development/src/schema-json/JsonInputTypes.js +256 -0
- package/dist/development/src/schema-json/JsonInputTypes.js.map +1 -0
- package/dist/development/src/schema-json/JsonIntrospectionExtension.cjs +36 -0
- package/dist/development/src/schema-json/JsonIntrospectionExtension.cjs.map +1 -0
- package/dist/development/src/schema-json/JsonIntrospectionExtension.js +36 -0
- package/dist/development/src/schema-json/JsonIntrospectionExtension.js.map +1 -0
- package/dist/development/src/schema-json/JsonQueryAstFactory.cjs +107 -0
- package/dist/development/src/schema-json/JsonQueryAstFactory.cjs.map +1 -0
- package/dist/development/src/schema-json/JsonQueryAstFactory.js +107 -0
- package/dist/development/src/schema-json/JsonQueryAstFactory.js.map +1 -0
- package/dist/development/src/schema-json/JsonTypeRegistry.cjs +230 -0
- package/dist/development/src/schema-json/JsonTypeRegistry.cjs.map +1 -0
- package/dist/development/src/schema-json/JsonTypeRegistry.js +230 -0
- package/dist/development/src/schema-json/JsonTypeRegistry.js.map +1 -0
- package/dist/development/src/utils/ResolveInfoUtils.cjs.map +1 -1
- package/dist/development/src/utils/ResolveInfoUtils.js.map +1 -1
- package/dist/development/src/utils/uniqueWhereFields.cjs +10 -0
- package/dist/development/src/utils/uniqueWhereFields.cjs.map +1 -1
- package/dist/development/src/utils/uniqueWhereFields.js +10 -0
- package/dist/development/src/utils/uniqueWhereFields.js.map +1 -1
- package/dist/production/index.cjs +36 -0
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +40 -4
- package/dist/production/index.js.map +1 -1
- package/dist/production/src/ExecutionContainer.cjs +18 -10
- package/dist/production/src/ExecutionContainer.cjs.map +1 -1
- package/dist/production/src/ExecutionContainer.js +18 -10
- package/dist/production/src/ExecutionContainer.js.map +1 -1
- package/dist/production/src/acl/AclScope.cjs +7 -0
- package/dist/production/src/acl/AclScope.cjs.map +1 -0
- package/dist/production/src/acl/AclScope.js +7 -0
- package/dist/production/src/acl/AclScope.js.map +1 -0
- package/dist/production/src/acl/Authorizator.cjs +6 -4
- package/dist/production/src/acl/Authorizator.cjs.map +1 -1
- package/dist/production/src/acl/Authorizator.js +6 -4
- package/dist/production/src/acl/Authorizator.js.map +1 -1
- package/dist/production/src/acl/EvaluatedPredicateReplacer.cjs +4 -1
- package/dist/production/src/acl/EvaluatedPredicateReplacer.cjs.map +1 -1
- package/dist/production/src/acl/EvaluatedPredicateReplacer.js +4 -1
- package/dist/production/src/acl/EvaluatedPredicateReplacer.js.map +1 -1
- package/dist/production/src/acl/PermissionFactory.cjs +57 -68
- package/dist/production/src/acl/PermissionFactory.cjs.map +1 -1
- package/dist/production/src/acl/PermissionFactory.js +58 -69
- package/dist/production/src/acl/PermissionFactory.js.map +1 -1
- package/dist/production/src/acl/PredicateFactory.cjs +95 -26
- package/dist/production/src/acl/PredicateFactory.cjs.map +1 -1
- package/dist/production/src/acl/PredicateFactory.js +95 -26
- package/dist/production/src/acl/PredicateFactory.js.map +1 -1
- package/dist/production/src/acl/PredicatesInjector.cjs +97 -99
- package/dist/production/src/acl/PredicatesInjector.cjs.map +1 -1
- package/dist/production/src/acl/PredicatesInjector.js +99 -101
- package/dist/production/src/acl/PredicatesInjector.js.map +1 -1
- package/dist/production/src/acl/VariableInjector.cjs +7 -2
- package/dist/production/src/acl/VariableInjector.cjs.map +1 -1
- package/dist/production/src/acl/VariableInjector.js +7 -2
- package/dist/production/src/acl/VariableInjector.js.map +1 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs +28 -2
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs.map +1 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js +29 -3
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js.map +1 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs +16 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js +16 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs +29 -3
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js +29 -3
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs +14 -0
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js +14 -0
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js.map +1 -1
- package/dist/production/src/input-validation/ValidationDataSelector.cjs +2 -2
- package/dist/production/src/input-validation/ValidationDataSelector.cjs.map +1 -1
- package/dist/production/src/input-validation/ValidationDataSelector.js +2 -2
- package/dist/production/src/input-validation/ValidationDataSelector.js.map +1 -1
- package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs +24 -3
- package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs.map +1 -1
- package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js +24 -3
- package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js.map +1 -1
- package/dist/production/src/inputProcessing/UpdateInputVisitor.cjs +52 -2
- package/dist/production/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
- package/dist/production/src/inputProcessing/UpdateInputVisitor.js +52 -2
- package/dist/production/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
- package/dist/production/src/introspection/IntrospectionSchemaFactory.cjs +11 -6
- package/dist/production/src/introspection/IntrospectionSchemaFactory.cjs.map +1 -1
- package/dist/production/src/introspection/IntrospectionSchemaFactory.js +11 -6
- package/dist/production/src/introspection/IntrospectionSchemaFactory.js.map +1 -1
- package/dist/production/src/introspection/introspection.schema.cjs +2 -2
- package/dist/production/src/introspection/introspection.schema.cjs.map +1 -1
- package/dist/production/src/introspection/introspection.schema.js +2 -2
- package/dist/production/src/introspection/introspection.schema.js.map +1 -1
- package/dist/production/src/mapper/ErrorUtils.cjs +17 -1
- package/dist/production/src/mapper/ErrorUtils.cjs.map +1 -1
- package/dist/production/src/mapper/ErrorUtils.js +17 -1
- package/dist/production/src/mapper/ErrorUtils.js.map +1 -1
- package/dist/production/src/mapper/JunctionTableManager.cjs +18 -12
- package/dist/production/src/mapper/JunctionTableManager.cjs.map +1 -1
- package/dist/production/src/mapper/JunctionTableManager.js +19 -13
- package/dist/production/src/mapper/JunctionTableManager.js.map +1 -1
- package/dist/production/src/mapper/Mapper.cjs +111 -37
- package/dist/production/src/mapper/Mapper.cjs.map +1 -1
- package/dist/production/src/mapper/Mapper.js +112 -38
- package/dist/production/src/mapper/Mapper.js.map +1 -1
- package/dist/production/src/mapper/MapperFactory.cjs +7 -4
- package/dist/production/src/mapper/MapperFactory.cjs.map +1 -1
- package/dist/production/src/mapper/MapperFactory.js +7 -4
- package/dist/production/src/mapper/MapperFactory.js.map +1 -1
- package/dist/production/src/mapper/MutationProcessorHelper.cjs +12 -0
- package/dist/production/src/mapper/MutationProcessorHelper.cjs.map +1 -1
- package/dist/production/src/mapper/MutationProcessorHelper.js +13 -1
- package/dist/production/src/mapper/MutationProcessorHelper.js.map +1 -1
- package/dist/production/src/mapper/Result.cjs +1 -0
- package/dist/production/src/mapper/Result.cjs.map +1 -1
- package/dist/production/src/mapper/Result.js +1 -0
- package/dist/production/src/mapper/Result.js.map +1 -1
- package/dist/production/src/mapper/delete/DeleteExecutor.cjs +15 -8
- package/dist/production/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
- package/dist/production/src/mapper/delete/DeleteExecutor.js +15 -8
- package/dist/production/src/mapper/delete/DeleteExecutor.js.map +1 -1
- package/dist/production/src/mapper/insert/InsertBuilder.cjs +3 -2
- package/dist/production/src/mapper/insert/InsertBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/insert/InsertBuilder.js +3 -2
- package/dist/production/src/mapper/insert/InsertBuilder.js.map +1 -1
- package/dist/production/src/mapper/insert/InsertBuilderFactory.cjs +2 -2
- package/dist/production/src/mapper/insert/InsertBuilderFactory.cjs.map +1 -1
- package/dist/production/src/mapper/insert/InsertBuilderFactory.js +2 -2
- package/dist/production/src/mapper/insert/InsertBuilderFactory.js.map +1 -1
- package/dist/production/src/mapper/insert/Inserter.cjs +3 -3
- package/dist/production/src/mapper/insert/Inserter.cjs.map +1 -1
- package/dist/production/src/mapper/insert/Inserter.js +3 -3
- package/dist/production/src/mapper/insert/Inserter.js.map +1 -1
- package/dist/production/src/mapper/insert/SqlCreateInputProcessor.cjs +3 -2
- package/dist/production/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/SqlCreateInputProcessor.js +3 -2
- package/dist/production/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs +9 -8
- package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js +9 -8
- package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs +4 -4
- package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js +4 -4
- package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs +3 -3
- package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js +3 -3
- package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs +7 -7
- package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js +7 -7
- package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs +6 -6
- package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js +6 -6
- package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/select/ConditionBuilder.cjs +8 -1
- package/dist/production/src/mapper/select/ConditionBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/ConditionBuilder.js +8 -1
- package/dist/production/src/mapper/select/ConditionBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/JoinBuilder.cjs +26 -4
- package/dist/production/src/mapper/select/JoinBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/JoinBuilder.js +27 -5
- package/dist/production/src/mapper/select/JoinBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/OrderByBuilder.cjs +84 -15
- package/dist/production/src/mapper/select/OrderByBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/OrderByBuilder.js +86 -17
- package/dist/production/src/mapper/select/OrderByBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/OrderByHelper.cjs +17 -7
- package/dist/production/src/mapper/select/OrderByHelper.cjs.map +1 -1
- package/dist/production/src/mapper/select/OrderByHelper.js +17 -7
- package/dist/production/src/mapper/select/OrderByHelper.js.map +1 -1
- package/dist/production/src/mapper/select/Path.cjs +25 -3
- package/dist/production/src/mapper/select/Path.cjs.map +1 -1
- package/dist/production/src/mapper/select/Path.js +26 -4
- package/dist/production/src/mapper/select/Path.js.map +1 -1
- package/dist/production/src/mapper/select/RelationFetcher.cjs +6 -5
- package/dist/production/src/mapper/select/RelationFetcher.cjs.map +1 -1
- package/dist/production/src/mapper/select/RelationFetcher.js +6 -5
- package/dist/production/src/mapper/select/RelationFetcher.js.map +1 -1
- package/dist/production/src/mapper/select/SelectBuilder.cjs +15 -21
- package/dist/production/src/mapper/select/SelectBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/SelectBuilder.js +13 -19
- package/dist/production/src/mapper/select/SelectBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/SelectHydrator.cjs +92 -31
- package/dist/production/src/mapper/select/SelectHydrator.cjs.map +1 -1
- package/dist/production/src/mapper/select/SelectHydrator.js +92 -31
- package/dist/production/src/mapper/select/SelectHydrator.js.map +1 -1
- package/dist/production/src/mapper/select/WhereBuilder.cjs +261 -47
- package/dist/production/src/mapper/select/WhereBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/WhereBuilder.js +262 -48
- package/dist/production/src/mapper/select/WhereBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/getFieldReadPredicate.cjs +8 -0
- package/dist/production/src/mapper/select/getFieldReadPredicate.cjs.map +1 -0
- package/dist/production/src/mapper/select/getFieldReadPredicate.js +8 -0
- package/dist/production/src/mapper/select/getFieldReadPredicate.js.map +1 -0
- package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs +9 -13
- package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
- package/dist/production/src/mapper/select/handlers/FieldsVisitor.js +10 -14
- package/dist/production/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
- package/dist/production/src/mapper/select/handlers/MetaHandler.cjs +6 -2
- package/dist/production/src/mapper/select/handlers/MetaHandler.cjs.map +1 -1
- package/dist/production/src/mapper/select/handlers/MetaHandler.js +6 -2
- package/dist/production/src/mapper/select/handlers/MetaHandler.js.map +1 -1
- package/dist/production/src/mapper/select/optimizer/WhereOptimizer.cjs +229 -3
- package/dist/production/src/mapper/select/optimizer/WhereOptimizer.cjs.map +1 -1
- package/dist/production/src/mapper/select/optimizer/WhereOptimizer.js +230 -4
- package/dist/production/src/mapper/select/optimizer/WhereOptimizer.js.map +1 -1
- package/dist/production/src/mapper/select/optimizer/WhereReplacer.cjs +3 -3
- package/dist/production/src/mapper/select/optimizer/WhereReplacer.cjs.map +1 -1
- package/dist/production/src/mapper/select/optimizer/WhereReplacer.js +1 -1
- package/dist/production/src/mapper/select/optimizer/WhereReplacer.js.map +1 -1
- package/dist/production/src/mapper/update/SqlUpdateInputProcessor.cjs +9 -5
- package/dist/production/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/SqlUpdateInputProcessor.js +10 -6
- package/dist/production/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/UpdateBuilder.cjs +35 -2
- package/dist/production/src/mapper/update/UpdateBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/update/UpdateBuilder.js +36 -3
- package/dist/production/src/mapper/update/UpdateBuilder.js.map +1 -1
- package/dist/production/src/mapper/update/UpdateBuilderFactory.cjs +3 -2
- package/dist/production/src/mapper/update/UpdateBuilderFactory.cjs.map +1 -1
- package/dist/production/src/mapper/update/UpdateBuilderFactory.js +3 -2
- package/dist/production/src/mapper/update/UpdateBuilderFactory.js.map +1 -1
- package/dist/production/src/mapper/update/Updater.cjs +12 -6
- package/dist/production/src/mapper/update/Updater.cjs.map +1 -1
- package/dist/production/src/mapper/update/Updater.js +13 -7
- package/dist/production/src/mapper/update/Updater.js.map +1 -1
- package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs +33 -19
- package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js +33 -19
- package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs +13 -11
- package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js +13 -11
- package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs +17 -8
- package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js +17 -8
- package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs +19 -16
- package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js +19 -16
- package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs +19 -16
- package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js +19 -16
- package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/relations/SetManyRelationHelper.cjs +123 -0
- package/dist/production/src/mapper/update/relations/SetManyRelationHelper.cjs.map +1 -0
- package/dist/production/src/mapper/update/relations/SetManyRelationHelper.js +123 -0
- package/dist/production/src/mapper/update/relations/SetManyRelationHelper.js.map +1 -0
- package/dist/production/src/resolvers/GraphQlQueryAstFactory.cjs.map +1 -1
- package/dist/production/src/resolvers/GraphQlQueryAstFactory.js.map +1 -1
- package/dist/production/src/resolvers/MutationResolver.cjs +76 -79
- package/dist/production/src/resolvers/MutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/MutationResolver.js +78 -81
- package/dist/production/src/resolvers/MutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/ReadHelpers.cjs +17 -6
- package/dist/production/src/resolvers/ReadHelpers.cjs.map +1 -1
- package/dist/production/src/resolvers/ReadHelpers.js +17 -6
- package/dist/production/src/resolvers/ReadHelpers.js.map +1 -1
- package/dist/production/src/resolvers/ReadResolver.cjs +27 -22
- package/dist/production/src/resolvers/ReadResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/ReadResolver.js +27 -22
- package/dist/production/src/resolvers/ReadResolver.js.map +1 -1
- package/dist/production/src/schema/CustomTypesProvider.cjs +35 -14
- package/dist/production/src/schema/CustomTypesProvider.cjs.map +1 -1
- package/dist/production/src/schema/CustomTypesProvider.js +36 -15
- package/dist/production/src/schema/CustomTypesProvider.js.map +1 -1
- package/dist/production/src/schema/EntityTypeProvider.cjs +11 -7
- package/dist/production/src/schema/EntityTypeProvider.cjs.map +1 -1
- package/dist/production/src/schema/EntityTypeProvider.js +11 -7
- package/dist/production/src/schema/EntityTypeProvider.js.map +1 -1
- package/dist/production/src/schema/GraphQlSchemaBuilder.cjs +16 -6
- package/dist/production/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
- package/dist/production/src/schema/GraphQlSchemaBuilder.js +16 -6
- package/dist/production/src/schema/GraphQlSchemaBuilder.js.map +1 -1
- package/dist/production/src/schema/GraphQlSchemaBuilderFactory.cjs +39 -11
- package/dist/production/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
- package/dist/production/src/schema/GraphQlSchemaBuilderFactory.js +39 -11
- package/dist/production/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
- package/dist/production/src/schema/MutationProvider.cjs +38 -16
- package/dist/production/src/schema/MutationProvider.cjs.map +1 -1
- package/dist/production/src/schema/MutationProvider.js +38 -16
- package/dist/production/src/schema/MutationProvider.js.map +1 -1
- package/dist/production/src/schema/OrderByTypeProvider.cjs +8 -2
- package/dist/production/src/schema/OrderByTypeProvider.cjs.map +1 -1
- package/dist/production/src/schema/OrderByTypeProvider.js +9 -3
- package/dist/production/src/schema/OrderByTypeProvider.js.map +1 -1
- package/dist/production/src/schema/QueryProvider.cjs +12 -11
- package/dist/production/src/schema/QueryProvider.cjs.map +1 -1
- package/dist/production/src/schema/QueryProvider.js +12 -11
- package/dist/production/src/schema/QueryProvider.js.map +1 -1
- package/dist/production/src/schema/ValidationQueriesProvider.cjs +2 -0
- package/dist/production/src/schema/ValidationQueriesProvider.cjs.map +1 -1
- package/dist/production/src/schema/ValidationQueriesProvider.js +2 -0
- package/dist/production/src/schema/ValidationQueriesProvider.js.map +1 -1
- package/dist/production/src/schema/WhereTypeProvider.cjs +17 -5
- package/dist/production/src/schema/WhereTypeProvider.cjs.map +1 -1
- package/dist/production/src/schema/WhereTypeProvider.js +18 -6
- package/dist/production/src/schema/WhereTypeProvider.js.map +1 -1
- package/dist/production/src/schema/calendarDate.cjs +21 -0
- package/dist/production/src/schema/calendarDate.cjs.map +1 -0
- package/dist/production/src/schema/calendarDate.js +21 -0
- package/dist/production/src/schema/calendarDate.js.map +1 -0
- package/dist/production/src/schema/entities/FieldTypeVisitor.cjs +15 -2
- package/dist/production/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
- package/dist/production/src/schema/entities/FieldTypeVisitor.js +15 -2
- package/dist/production/src/schema/entities/FieldTypeVisitor.js.map +1 -1
- package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.cjs +11 -3
- package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
- package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.js +11 -3
- package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs +11 -3
- package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.js +11 -3
- package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs +39 -2
- package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js +40 -3
- package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js.map +1 -1
- package/dist/production/src/schema/utils.cjs +10 -0
- package/dist/production/src/schema/utils.cjs.map +1 -1
- package/dist/production/src/schema/utils.js +11 -1
- package/dist/production/src/schema/utils.js.map +1 -1
- package/dist/production/src/schema-json/GraphQLJsBridge.cjs +108 -0
- package/dist/production/src/schema-json/GraphQLJsBridge.cjs.map +1 -0
- package/dist/production/src/schema-json/GraphQLJsBridge.js +108 -0
- package/dist/production/src/schema-json/GraphQLJsBridge.js.map +1 -0
- package/dist/production/src/schema-json/JsonColumnTypes.cjs +102 -0
- package/dist/production/src/schema-json/JsonColumnTypes.cjs.map +1 -0
- package/dist/production/src/schema-json/JsonColumnTypes.js +102 -0
- package/dist/production/src/schema-json/JsonColumnTypes.js.map +1 -0
- package/dist/production/src/schema-json/JsonContentSchemaBuilder.cjs +418 -0
- package/dist/production/src/schema-json/JsonContentSchemaBuilder.cjs.map +1 -0
- package/dist/production/src/schema-json/JsonContentSchemaBuilder.js +418 -0
- package/dist/production/src/schema-json/JsonContentSchemaBuilder.js.map +1 -0
- package/dist/production/src/schema-json/JsonContentSchemaShared.cjs +18 -0
- package/dist/production/src/schema-json/JsonContentSchemaShared.cjs.map +1 -0
- package/dist/production/src/schema-json/JsonContentSchemaShared.js +18 -0
- package/dist/production/src/schema-json/JsonContentSchemaShared.js.map +1 -0
- package/dist/production/src/schema-json/JsonEntityTypes.cjs +206 -0
- package/dist/production/src/schema-json/JsonEntityTypes.cjs.map +1 -0
- package/dist/production/src/schema-json/JsonEntityTypes.js +206 -0
- package/dist/production/src/schema-json/JsonEntityTypes.js.map +1 -0
- package/dist/production/src/schema-json/JsonFilterTypes.cjs +152 -0
- package/dist/production/src/schema-json/JsonFilterTypes.cjs.map +1 -0
- package/dist/production/src/schema-json/JsonFilterTypes.js +152 -0
- package/dist/production/src/schema-json/JsonFilterTypes.js.map +1 -0
- package/dist/production/src/schema-json/JsonInputTypes.cjs +256 -0
- package/dist/production/src/schema-json/JsonInputTypes.cjs.map +1 -0
- package/dist/production/src/schema-json/JsonInputTypes.js +256 -0
- package/dist/production/src/schema-json/JsonInputTypes.js.map +1 -0
- package/dist/production/src/schema-json/JsonIntrospectionExtension.cjs +36 -0
- package/dist/production/src/schema-json/JsonIntrospectionExtension.cjs.map +1 -0
- package/dist/production/src/schema-json/JsonIntrospectionExtension.js +36 -0
- package/dist/production/src/schema-json/JsonIntrospectionExtension.js.map +1 -0
- package/dist/production/src/schema-json/JsonQueryAstFactory.cjs +107 -0
- package/dist/production/src/schema-json/JsonQueryAstFactory.cjs.map +1 -0
- package/dist/production/src/schema-json/JsonQueryAstFactory.js +107 -0
- package/dist/production/src/schema-json/JsonQueryAstFactory.js.map +1 -0
- package/dist/production/src/schema-json/JsonTypeRegistry.cjs +230 -0
- package/dist/production/src/schema-json/JsonTypeRegistry.cjs.map +1 -0
- package/dist/production/src/schema-json/JsonTypeRegistry.js +230 -0
- package/dist/production/src/schema-json/JsonTypeRegistry.js.map +1 -0
- package/dist/production/src/utils/ResolveInfoUtils.cjs.map +1 -1
- package/dist/production/src/utils/ResolveInfoUtils.js.map +1 -1
- package/dist/production/src/utils/uniqueWhereFields.cjs +10 -0
- package/dist/production/src/utils/uniqueWhereFields.cjs.map +1 -1
- package/dist/production/src/utils/uniqueWhereFields.js +10 -0
- package/dist/production/src/utils/uniqueWhereFields.js.map +1 -1
- package/dist/tests/cases/integration/graphQlRequests/delete/acl/throughScope.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/delete/acl/throughScope.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/insert/acl/throughScope.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/insert/acl/throughScope.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/insert/memoryBudget.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/insert/memoryBudget.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/hasManyCellPredicate.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/hasManyCellPredicate.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/impliedReadGuard.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/impliedReadGuard.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/internalColumnAliases.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/internalColumnAliases.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/manyHasManyGuardedJoin.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/manyHasManyGuardedJoin.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/maskedRelationField.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/maskedRelationField.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/mergedRolePredicate.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/mergedRolePredicate.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/metaReadableThroughContext.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/metaReadableThroughContext.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/negationAcrossSubquery.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/negationAcrossSubquery.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/nonAdjacentBackReference.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/nonAdjacentBackReference.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/notOverGuardedHop.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/notOverGuardedHop.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/notOverOrCellPredicate.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/notOverOrCellPredicate.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/orderByCellPredicate.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/orderByCellPredicate.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScope.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScope.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScopeFilter.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScopeFilter.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScopeNullability.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScopeNullability.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/filter/hasOneDataViewFilter.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/filter/hasOneDataViewFilter.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/legacyNoRootRootWrites.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/legacyNoRootRootWrites.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScope.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScope.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeJunction.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeJunction.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeLookup.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeLookup.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeRootWrites.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeRootWrites.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeUpdate.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeUpdate.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/set.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/set.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/set.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/set.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/set.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/set.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/upsert/acl/throughScope.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/upsert/acl/throughScope.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/validation/utils.d.ts.map +1 -1
- package/dist/tests/cases/integration/graphQlSchema/model.d.ts +1 -1
- package/dist/tests/cases/unit/checkViolationError.test.d.ts +2 -0
- package/dist/tests/cases/unit/checkViolationError.test.d.ts.map +1 -0
- package/dist/tests/cases/unit/dateType.test.d.ts +2 -0
- package/dist/tests/cases/unit/dateType.test.d.ts.map +1 -0
- package/dist/tests/cases/unit/internalColumnAliases.test.d.ts +2 -0
- package/dist/tests/cases/unit/internalColumnAliases.test.d.ts.map +1 -0
- package/dist/tests/cases/unit/introspectionAcl.test.d.ts +2 -0
- package/dist/tests/cases/unit/introspectionAcl.test.d.ts.map +1 -0
- package/dist/tests/cases/unit/mutationSqlError.test.d.ts +2 -0
- package/dist/tests/cases/unit/mutationSqlError.test.d.ts.map +1 -0
- package/dist/tests/cases/unit/pathAlias.test.d.ts +2 -0
- package/dist/tests/cases/unit/pathAlias.test.d.ts.map +1 -0
- package/dist/tests/src/assert.d.ts.map +1 -1
- package/dist/tests/src/tags.d.ts.map +1 -1
- package/dist/tests/src/test.d.ts +12 -0
- package/dist/tests/src/test.d.ts.map +1 -1
- package/dist/tests/src/testGraphql.d.ts +18 -5
- package/dist/tests/src/testGraphql.d.ts.map +1 -1
- package/dist/tests/src/testUuid.d.ts.map +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ExecutionContainer.d.ts +4 -2
- package/dist/types/ExecutionContainer.d.ts.map +1 -1
- package/dist/types/acl/AclScope.d.ts +26 -0
- package/dist/types/acl/AclScope.d.ts.map +1 -0
- package/dist/types/acl/Authorizator.d.ts +0 -1
- package/dist/types/acl/Authorizator.d.ts.map +1 -1
- package/dist/types/acl/EvaluatedPredicateReplacer.d.ts +1 -0
- package/dist/types/acl/EvaluatedPredicateReplacer.d.ts.map +1 -1
- package/dist/types/acl/PermissionFactory.d.ts +19 -4
- package/dist/types/acl/PermissionFactory.d.ts.map +1 -1
- package/dist/types/acl/PredicateFactory.d.ts +31 -15
- package/dist/types/acl/PredicateFactory.d.ts.map +1 -1
- package/dist/types/acl/PredicatesInjector.d.ts +66 -12
- package/dist/types/acl/PredicatesInjector.d.ts.map +1 -1
- package/dist/types/acl/VariableInjector.d.ts.map +1 -1
- package/dist/types/acl/VariableUtils.d.ts.map +1 -1
- package/dist/types/acl/index.d.ts +1 -0
- package/dist/types/acl/index.d.ts.map +1 -1
- package/dist/types/exception.d.ts.map +1 -1
- package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.d.ts.map +1 -1
- package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.d.ts +3 -1
- package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.d.ts.map +1 -1
- package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.d.ts.map +1 -1
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.d.ts.map +1 -1
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.d.ts +3 -1
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.d.ts.map +1 -1
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.d.ts.map +1 -1
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.d.ts.map +1 -1
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/input-validation/ColumnValueResolver.d.ts.map +1 -1
- package/dist/types/input-validation/EntityRulesResolver.d.ts.map +1 -1
- package/dist/types/input-validation/JsonSchemaValidator.d.ts.map +1 -1
- package/dist/types/input-validation/QueryAstFactory.d.ts.map +1 -1
- package/dist/types/input-validation/ValidationContext.d.ts.map +1 -1
- package/dist/types/input-validation/ValidationDataSelector.d.ts +2 -1
- package/dist/types/input-validation/ValidationDataSelector.d.ts.map +1 -1
- package/dist/types/input-validation/ValidationEvaluation.d.ts.map +1 -1
- package/dist/types/input-validation/ValidationPath.d.ts.map +1 -1
- package/dist/types/input-validation/dependencies/DependencyCollector.d.ts.map +1 -1
- package/dist/types/input-validation/dependencies/DependencyMerger.d.ts.map +1 -1
- package/dist/types/input-validation/preValidation/CreateInputPreValidationProcessor.d.ts.map +1 -1
- package/dist/types/input-validation/preValidation/InputPreValidator.d.ts.map +1 -1
- package/dist/types/input-validation/preValidation/UpdateInputPreValidationProcessor.d.ts +6 -0
- package/dist/types/input-validation/preValidation/UpdateInputPreValidationProcessor.d.ts.map +1 -1
- package/dist/types/inputProcessing/CreateInputVisitor.d.ts.map +1 -1
- package/dist/types/inputProcessing/FieldNode.d.ts.map +1 -1
- package/dist/types/inputProcessing/ObjectNode.d.ts.map +1 -1
- package/dist/types/inputProcessing/UniqueWhereExpander.d.ts.map +1 -1
- package/dist/types/inputProcessing/UpdateInputProcessor.d.ts +7 -0
- package/dist/types/inputProcessing/UpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/inputProcessing/UpdateInputVisitor.d.ts +2 -0
- package/dist/types/inputProcessing/UpdateInputVisitor.d.ts.map +1 -1
- package/dist/types/introspection/IntrospectionSchemaDefinitionFactory.d.ts.map +1 -1
- package/dist/types/introspection/IntrospectionSchemaFactory.d.ts.map +1 -1
- package/dist/types/introspection/introspection.schema.d.ts.map +1 -1
- package/dist/types/mapper/CheckedPrimary.d.ts.map +1 -1
- package/dist/types/mapper/ColumnValue.d.ts.map +1 -1
- package/dist/types/mapper/Constraints.d.ts.map +1 -1
- package/dist/types/mapper/ErrorUtils.d.ts.map +1 -1
- package/dist/types/mapper/EventManager.d.ts +9 -9
- package/dist/types/mapper/EventManager.d.ts.map +1 -1
- package/dist/types/mapper/JunctionTableManager.d.ts +17 -5
- package/dist/types/mapper/JunctionTableManager.d.ts.map +1 -1
- package/dist/types/mapper/Mapper.d.ts +26 -13
- package/dist/types/mapper/Mapper.d.ts.map +1 -1
- package/dist/types/mapper/MapperFactory.d.ts +3 -2
- package/dist/types/mapper/MapperFactory.d.ts.map +1 -1
- package/dist/types/mapper/MutationProcessorHelper.d.ts +3 -0
- package/dist/types/mapper/MutationProcessorHelper.d.ts.map +1 -1
- package/dist/types/mapper/Result.d.ts +2 -1
- package/dist/types/mapper/Result.d.ts.map +1 -1
- package/dist/types/mapper/delete/DeleteExecutor.d.ts +6 -2
- package/dist/types/mapper/delete/DeleteExecutor.d.ts.map +1 -1
- package/dist/types/mapper/delete/DeleteState.d.ts.map +1 -1
- package/dist/types/mapper/delete/DeletedEntitiesStorage.d.ts.map +1 -1
- package/dist/types/mapper/delete/helpers.d.ts +1 -1
- package/dist/types/mapper/delete/helpers.d.ts.map +1 -1
- package/dist/types/mapper/insert/InsertBuilder.d.ts +3 -2
- package/dist/types/mapper/insert/InsertBuilder.d.ts.map +1 -1
- package/dist/types/mapper/insert/InsertBuilderFactory.d.ts +2 -2
- package/dist/types/mapper/insert/InsertBuilderFactory.d.ts.map +1 -1
- package/dist/types/mapper/insert/Inserter.d.ts +2 -1
- package/dist/types/mapper/insert/Inserter.d.ts.map +1 -1
- package/dist/types/mapper/insert/SqlCreateInputProcessor.d.ts +6 -1
- package/dist/types/mapper/insert/SqlCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/insert/relations/ManyHasManyCreateInputProcessor.d.ts +7 -2
- package/dist/types/mapper/insert/relations/ManyHasManyCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/insert/relations/ManyHasOneCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/insert/relations/OneHasManyCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.d.ts +1 -1
- package/dist/types/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/select/ConditionBuilder.d.ts.map +1 -1
- package/dist/types/mapper/select/JoinBuilder.d.ts +8 -2
- package/dist/types/mapper/select/JoinBuilder.d.ts.map +1 -1
- package/dist/types/mapper/select/JoinVisitor.d.ts.map +1 -1
- package/dist/types/mapper/select/OrderByBuilder.d.ts +18 -2
- package/dist/types/mapper/select/OrderByBuilder.d.ts.map +1 -1
- package/dist/types/mapper/select/OrderByHelper.d.ts +2 -0
- package/dist/types/mapper/select/OrderByHelper.d.ts.map +1 -1
- package/dist/types/mapper/select/Path.d.ts +12 -0
- package/dist/types/mapper/select/Path.d.ts.map +1 -1
- package/dist/types/mapper/select/RelationFetcher.d.ts.map +1 -1
- package/dist/types/mapper/select/SelectBuilder.d.ts.map +1 -1
- package/dist/types/mapper/select/SelectExecutionHandler.d.ts +5 -0
- package/dist/types/mapper/select/SelectExecutionHandler.d.ts.map +1 -1
- package/dist/types/mapper/select/SelectHydrator.d.ts +10 -1
- package/dist/types/mapper/select/SelectHydrator.d.ts.map +1 -1
- package/dist/types/mapper/select/WhereBuilder.d.ts +33 -1
- package/dist/types/mapper/select/WhereBuilder.d.ts.map +1 -1
- package/dist/types/mapper/select/getFieldReadPredicate.d.ts +4 -0
- package/dist/types/mapper/select/getFieldReadPredicate.d.ts.map +1 -0
- package/dist/types/mapper/select/handlers/FieldsVisitor.d.ts +0 -1
- package/dist/types/mapper/select/handlers/FieldsVisitor.d.ts.map +1 -1
- package/dist/types/mapper/select/handlers/FieldsVisitorFactory.d.ts.map +1 -1
- package/dist/types/mapper/select/handlers/MetaHandler.d.ts.map +1 -1
- package/dist/types/mapper/select/index.d.ts +1 -0
- package/dist/types/mapper/select/index.d.ts.map +1 -1
- package/dist/types/mapper/select/optimizer/ConditionOptimizer.d.ts.map +1 -1
- package/dist/types/mapper/select/optimizer/WhereOptimizer.d.ts +36 -0
- package/dist/types/mapper/select/optimizer/WhereOptimizer.d.ts.map +1 -1
- package/dist/types/mapper/select/optimizer/WhereReplacer.d.ts.map +1 -1
- package/dist/types/mapper/select/optimizer/helpers.d.ts +1 -1
- package/dist/types/mapper/select/optimizer/helpers.d.ts.map +1 -1
- package/dist/types/mapper/types.d.ts +8 -1
- package/dist/types/mapper/types.d.ts.map +1 -1
- package/dist/types/mapper/update/SqlUpdateInputProcessor.d.ts +6 -1
- package/dist/types/mapper/update/SqlUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/UpdateBuilder.d.ts +18 -2
- package/dist/types/mapper/update/UpdateBuilder.d.ts.map +1 -1
- package/dist/types/mapper/update/UpdateBuilderFactory.d.ts +2 -2
- package/dist/types/mapper/update/UpdateBuilderFactory.d.ts.map +1 -1
- package/dist/types/mapper/update/Updater.d.ts +3 -2
- package/dist/types/mapper/update/Updater.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/ManyHasManyUpdateInputProcessor.d.ts +15 -3
- package/dist/types/mapper/update/relations/ManyHasManyUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/ManyHasOneUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/OneHasManyUpdateInputProcessor.d.ts +5 -0
- package/dist/types/mapper/update/relations/OneHasManyUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/SetManyRelationHelper.d.ts +67 -0
- package/dist/types/mapper/update/relations/SetManyRelationHelper.d.ts.map +1 -0
- package/dist/types/resolvers/GraphQlQueryAstFactory.d.ts +4 -3
- package/dist/types/resolvers/GraphQlQueryAstFactory.d.ts.map +1 -1
- package/dist/types/resolvers/MutationResolver.d.ts +14 -11
- package/dist/types/resolvers/MutationResolver.d.ts.map +1 -1
- package/dist/types/resolvers/ReadHelpers.d.ts +1 -2
- package/dist/types/resolvers/ReadHelpers.d.ts.map +1 -1
- package/dist/types/resolvers/ReadResolver.d.ts +8 -10
- package/dist/types/resolvers/ReadResolver.d.ts.map +1 -1
- package/dist/types/resolvers/RefreshViewResolver.d.ts.map +1 -1
- package/dist/types/resolvers/ValidationResolver.d.ts.map +1 -1
- package/dist/types/schema/ColumnTypeResolver.d.ts.map +1 -1
- package/dist/types/schema/ConditionTypeProvider.d.ts.map +1 -1
- package/dist/types/schema/CustomTypesProvider.d.ts.map +1 -1
- package/dist/types/schema/EntityTypeProvider.d.ts +2 -1
- package/dist/types/schema/EntityTypeProvider.d.ts.map +1 -1
- package/dist/types/schema/EnumsProvider.d.ts.map +1 -1
- package/dist/types/schema/FieldAccessVisitor.d.ts.map +1 -1
- package/dist/types/schema/GraphQlSchemaBuilder.d.ts.map +1 -1
- package/dist/types/schema/GraphQlSchemaBuilderFactory.d.ts +10 -2
- package/dist/types/schema/GraphQlSchemaBuilderFactory.d.ts.map +1 -1
- package/dist/types/schema/MutationProvider.d.ts +7 -1
- package/dist/types/schema/MutationProvider.d.ts.map +1 -1
- package/dist/types/schema/OperationExtension.d.ts.map +1 -1
- package/dist/types/schema/OrderByTypeProvider.d.ts.map +1 -1
- package/dist/types/schema/PaginatedFieldConfigFactory.d.ts.map +1 -1
- package/dist/types/schema/QueryProvider.d.ts +2 -1
- package/dist/types/schema/QueryProvider.d.ts.map +1 -1
- package/dist/types/schema/RefreshViewMutationProvider.d.ts.map +1 -1
- package/dist/types/schema/ValidationQueriesProvider.d.ts.map +1 -1
- package/dist/types/schema/WhereTypeProvider.d.ts.map +1 -1
- package/dist/types/schema/calendarDate.d.ts +6 -0
- package/dist/types/schema/calendarDate.d.ts.map +1 -0
- package/dist/types/schema/entities/FieldArgsVisitor.d.ts.map +1 -1
- package/dist/types/schema/entities/FieldTypeVisitor.d.ts +4 -1
- package/dist/types/schema/entities/FieldTypeVisitor.d.ts.map +1 -1
- package/dist/types/schema/index.d.ts +1 -0
- package/dist/types/schema/index.d.ts.map +1 -1
- package/dist/types/schema/mutations/ConnectOrCreateRelationInputProvider.d.ts.map +1 -1
- package/dist/types/schema/mutations/CreateEntityInputFieldVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/CreateEntityRelationInputFieldVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/CreateEntityRelationInputProvider.d.ts.map +1 -1
- package/dist/types/schema/mutations/EntityInputProvider.d.ts.map +1 -1
- package/dist/types/schema/mutations/UpdateEntityInputFieldVisitor.d.ts +3 -0
- package/dist/types/schema/mutations/UpdateEntityInputFieldVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/UpdateEntityRelationInputFieldVisitor.d.ts +1 -0
- package/dist/types/schema/mutations/UpdateEntityRelationInputFieldVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/UpdateEntityRelationInputProvider.d.ts.map +1 -1
- package/dist/types/schema/utils.d.ts +7 -0
- package/dist/types/schema/utils.d.ts.map +1 -1
- package/dist/types/schema-json/GraphQLJsBridge.d.ts +12 -0
- package/dist/types/schema-json/GraphQLJsBridge.d.ts.map +1 -0
- package/dist/types/schema-json/JsonColumnTypes.d.ts +23 -0
- package/dist/types/schema-json/JsonColumnTypes.d.ts.map +1 -0
- package/dist/types/schema-json/JsonContentSchemaBuilder.d.ts +56 -0
- package/dist/types/schema-json/JsonContentSchemaBuilder.d.ts.map +1 -0
- package/dist/types/schema-json/JsonContentSchemaShared.d.ts +19 -0
- package/dist/types/schema-json/JsonContentSchemaShared.d.ts.map +1 -0
- package/dist/types/schema-json/JsonEntityTypes.d.ts +29 -0
- package/dist/types/schema-json/JsonEntityTypes.d.ts.map +1 -0
- package/dist/types/schema-json/JsonFilterTypes.d.ts +21 -0
- package/dist/types/schema-json/JsonFilterTypes.d.ts.map +1 -0
- package/dist/types/schema-json/JsonInputTypes.d.ts +36 -0
- package/dist/types/schema-json/JsonInputTypes.d.ts.map +1 -0
- package/dist/types/schema-json/JsonIntrospectionExtension.d.ts +5 -0
- package/dist/types/schema-json/JsonIntrospectionExtension.d.ts.map +1 -0
- package/dist/types/schema-json/JsonQueryAstFactory.d.ts +18 -0
- package/dist/types/schema-json/JsonQueryAstFactory.d.ts.map +1 -0
- package/dist/types/schema-json/JsonTypeRegistry.d.ts +57 -0
- package/dist/types/schema-json/JsonTypeRegistry.d.ts.map +1 -0
- package/dist/types/schema-json/index.d.ts +7 -0
- package/dist/types/schema-json/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/utils/Mutex.d.ts.map +1 -1
- package/dist/types/utils/ResolveInfoUtils.d.ts +4 -2
- package/dist/types/utils/ResolveInfoUtils.d.ts.map +1 -1
- package/dist/types/utils/accessor.d.ts.map +1 -1
- package/dist/types/utils/isIt.d.ts.map +1 -1
- package/dist/types/utils/paginationUtils.d.ts.map +1 -1
- package/dist/types/utils/promises.d.ts.map +1 -1
- package/dist/types/utils/singletonFactory.d.ts.map +1 -1
- package/dist/types/utils/strings.d.ts.map +1 -1
- package/dist/types/utils/tuple.d.ts.map +1 -1
- package/dist/types/utils/uniqueWhereFields.d.ts.map +1 -1
- package/dist/types/utils/viewComputedId.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/ExecutionContainer.ts +20 -8
- package/src/acl/AclScope.ts +29 -0
- package/src/acl/Authorizator.ts +7 -5
- package/src/acl/EvaluatedPredicateReplacer.ts +6 -2
- package/src/acl/PermissionFactory.ts +68 -104
- package/src/acl/PredicateFactory.ts +131 -28
- package/src/acl/PredicatesInjector.ts +135 -156
- package/src/acl/VariableInjector.ts +8 -3
- package/src/acl/index.ts +1 -0
- package/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.ts +14 -3
- package/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.ts +3 -0
- package/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.ts +10 -2
- package/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.ts +9 -7
- package/src/index.ts +1 -0
- package/src/input-validation/ValidationDataSelector.ts +3 -2
- package/src/input-validation/preValidation/UpdateInputPreValidationProcessor.ts +29 -0
- package/src/inputProcessing/UpdateInputProcessor.ts +6 -0
- package/src/inputProcessing/UpdateInputVisitor.ts +64 -2
- package/src/introspection/IntrospectionSchemaFactory.ts +13 -6
- package/src/mapper/ErrorUtils.ts +22 -1
- package/src/mapper/JunctionTableManager.ts +28 -6
- package/src/mapper/Mapper.ts +137 -29
- package/src/mapper/MapperFactory.ts +7 -3
- package/src/mapper/MutationProcessorHelper.ts +14 -0
- package/src/mapper/Result.ts +1 -0
- package/src/mapper/delete/DeleteExecutor.ts +13 -7
- package/src/mapper/insert/InsertBuilder.ts +3 -2
- package/src/mapper/insert/InsertBuilderFactory.ts +3 -3
- package/src/mapper/insert/Inserter.ts +4 -2
- package/src/mapper/insert/SqlCreateInputProcessor.ts +4 -1
- package/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.ts +10 -7
- package/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.ts +4 -4
- package/src/mapper/insert/relations/OneHasManyCreateInputProcessor.ts +3 -3
- package/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.ts +7 -7
- package/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.ts +6 -6
- package/src/mapper/select/ConditionBuilder.ts +12 -1
- package/src/mapper/select/JoinBuilder.ts +39 -6
- package/src/mapper/select/OrderByBuilder.ts +140 -19
- package/src/mapper/select/OrderByHelper.ts +19 -10
- package/src/mapper/select/Path.ts +36 -5
- package/src/mapper/select/RelationFetcher.ts +7 -9
- package/src/mapper/select/SelectBuilder.ts +12 -20
- package/src/mapper/select/SelectExecutionHandler.ts +5 -0
- package/src/mapper/select/SelectHydrator.ts +113 -31
- package/src/mapper/select/WhereBuilder.ts +322 -50
- package/src/mapper/select/getFieldReadPredicate.ts +12 -0
- package/src/mapper/select/handlers/FieldsVisitor.ts +10 -15
- package/src/mapper/select/handlers/MetaHandler.ts +5 -3
- package/src/mapper/select/index.ts +1 -0
- package/src/mapper/select/optimizer/WhereOptimizer.ts +279 -6
- package/src/mapper/select/optimizer/WhereReplacer.ts +1 -1
- package/src/mapper/types.ts +16 -1
- package/src/mapper/update/SqlUpdateInputProcessor.ts +8 -2
- package/src/mapper/update/UpdateBuilder.ts +41 -3
- package/src/mapper/update/UpdateBuilderFactory.ts +3 -2
- package/src/mapper/update/Updater.ts +11 -4
- package/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.ts +38 -18
- package/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.ts +11 -9
- package/src/mapper/update/relations/OneHasManyUpdateInputProcessor.ts +17 -5
- package/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.ts +16 -13
- package/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.ts +16 -13
- package/src/mapper/update/relations/SetManyRelationHelper.ts +199 -0
- package/src/resolvers/GraphQlQueryAstFactory.ts +2 -2
- package/src/resolvers/MutationResolver.ts +87 -85
- package/src/resolvers/ReadHelpers.ts +2 -5
- package/src/resolvers/ReadResolver.ts +29 -23
- package/src/schema/CustomTypesProvider.ts +40 -15
- package/src/schema/EntityTypeProvider.ts +10 -5
- package/src/schema/GraphQlSchemaBuilder.ts +18 -7
- package/src/schema/GraphQlSchemaBuilderFactory.ts +24 -8
- package/src/schema/MutationProvider.ts +41 -16
- package/src/schema/OrderByTypeProvider.ts +9 -3
- package/src/schema/QueryProvider.ts +13 -10
- package/src/schema/ValidationQueriesProvider.ts +2 -0
- package/src/schema/WhereTypeProvider.ts +18 -6
- package/src/schema/calendarDate.ts +26 -0
- package/src/schema/entities/FieldTypeVisitor.ts +17 -1
- package/src/schema/index.ts +1 -0
- package/src/schema/mutations/CreateEntityInputFieldVisitor.ts +10 -2
- package/src/schema/mutations/UpdateEntityInputFieldVisitor.ts +10 -2
- package/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts +66 -7
- package/src/schema/utils.ts +14 -0
- package/src/schema-json/GraphQLJsBridge.ts +142 -0
- package/src/schema-json/JsonColumnTypes.ts +116 -0
- package/src/schema-json/JsonContentSchemaBuilder.ts +501 -0
- package/src/schema-json/JsonContentSchemaShared.ts +19 -0
- package/src/schema-json/JsonEntityTypes.ts +237 -0
- package/src/schema-json/JsonFilterTypes.ts +159 -0
- package/src/schema-json/JsonInputTypes.ts +305 -0
- package/src/schema-json/JsonIntrospectionExtension.ts +37 -0
- package/src/schema-json/JsonQueryAstFactory.ts +128 -0
- package/src/schema-json/JsonTypeRegistry.ts +286 -0
- package/src/schema-json/index.ts +6 -0
- package/src/tsconfig.json +3 -1
- package/src/utils/ResolveInfoUtils.ts +2 -2
- package/src/utils/uniqueWhereFields.ts +14 -0
- package/tests/cases/bugs/bug102.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/delete/acl/throughScope.test.ts +320 -0
- package/tests/cases/integration/graphQlRequests/delete/deleteById.test.ts +4 -3
- package/tests/cases/integration/graphQlRequests/insert/acl/throughScope.test.ts +502 -0
- package/tests/cases/integration/graphQlRequests/insert/memoryBudget.test.ts +96 -0
- package/tests/cases/integration/graphQlRequests/query/acl/differentRowAndFieldPredicate.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/query/acl/fieldRestrictedByLocale.test.ts +12 -10
- package/tests/cases/integration/graphQlRequests/query/acl/hasManyCellPredicate.test.ts +54 -0
- package/tests/cases/integration/graphQlRequests/query/acl/impliedReadGuard.test.ts +142 -0
- package/tests/cases/integration/graphQlRequests/query/acl/internalColumnAliases.test.ts +326 -0
- package/tests/cases/integration/graphQlRequests/query/acl/isNullAcl.test.ts +7 -4
- package/tests/cases/integration/graphQlRequests/query/acl/manyHasManyGuardedJoin.test.ts +64 -0
- package/tests/cases/integration/graphQlRequests/query/acl/maskedRelationField.test.ts +124 -0
- package/tests/cases/integration/graphQlRequests/query/acl/mergedRolePredicate.test.ts +124 -0
- package/tests/cases/integration/graphQlRequests/query/acl/metaReadableThroughContext.test.ts +315 -0
- package/tests/cases/integration/graphQlRequests/query/acl/negationAcrossSubquery.test.ts +55 -0
- package/tests/cases/integration/graphQlRequests/query/acl/nestedPredicate.test.ts +7 -6
- package/tests/cases/integration/graphQlRequests/query/acl/nonAdjacentBackReference.test.ts +141 -0
- package/tests/cases/integration/graphQlRequests/query/acl/notOverGuardedHop.test.ts +320 -0
- package/tests/cases/integration/graphQlRequests/query/acl/notOverOrCellPredicate.test.ts +156 -0
- package/tests/cases/integration/graphQlRequests/query/acl/orderByCellPredicate.test.ts +513 -0
- package/tests/cases/integration/graphQlRequests/query/acl/predicateElimination.test.ts +25 -23
- package/tests/cases/integration/graphQlRequests/query/acl/relationAcl.test.ts +12 -9
- package/tests/cases/integration/graphQlRequests/query/acl/rowPredicateSubset.test.ts +6 -6
- package/tests/cases/integration/graphQlRequests/query/acl/throughScope.test.ts +350 -0
- package/tests/cases/integration/graphQlRequests/query/acl/throughScopeFilter.test.ts +203 -0
- package/tests/cases/integration/graphQlRequests/query/acl/throughScopeNullability.test.ts +127 -0
- package/tests/cases/integration/graphQlRequests/query/filter/backReferencedFilter.test.ts +3 -1
- package/tests/cases/integration/graphQlRequests/query/filter/hasOneDataViewFilter.test.ts +79 -0
- package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/alias.test.ts +46 -3
- package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/fragments.test.ts +8 -8
- package/tests/cases/integration/graphQlRequests/query/misc/reducedHasMany.test.ts +10 -10
- package/tests/cases/integration/graphQlRequests/query/pagination/hasManyLimit.test.ts +54 -8
- package/tests/cases/integration/graphQlRequests/query/pagination/paginate.test.ts +5 -4
- package/tests/cases/integration/graphQlRequests/query/pagination/paginateAliased.test.ts +5 -4
- package/tests/cases/integration/graphQlRequests/query/relations/advanced.test.ts +17 -8
- package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyInverse.test.ts +6 -6
- package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyOwning.test.ts +6 -6
- package/tests/cases/integration/graphQlRequests/query/relations/manyHasOne.test.ts +12 -9
- package/tests/cases/integration/graphQlRequests/query/relations/oneHasMany.test.ts +15 -15
- package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneInverse.test.ts +6 -4
- package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneOwner.test.ts +6 -4
- package/tests/cases/integration/graphQlRequests/query/sorting/defaultOrdering.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/query/sorting/randomSort.test.ts +108 -4
- package/tests/cases/integration/graphQlRequests/query/sorting/sortedHasMany.test.ts +2 -2
- package/tests/cases/integration/graphQlRequests/query/view/view.test.ts +6 -6
- package/tests/cases/integration/graphQlRequests/update/acl/legacyNoRootRootWrites.test.ts +127 -0
- package/tests/cases/integration/graphQlRequests/update/acl/throughScope.test.ts +89 -0
- package/tests/cases/integration/graphQlRequests/update/acl/throughScopeJunction.test.ts +296 -0
- package/tests/cases/integration/graphQlRequests/update/acl/throughScopeLookup.test.ts +265 -0
- package/tests/cases/integration/graphQlRequests/update/acl/throughScopeRootWrites.test.ts +441 -0
- package/tests/cases/integration/graphQlRequests/update/acl/throughScopeUpdate.test.ts +415 -0
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/set.test.ts +219 -0
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/set.test.ts +479 -0
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/set.test.ts +948 -0
- package/tests/cases/integration/graphQlRequests/upsert/acl/throughScope.test.ts +134 -0
- package/tests/cases/integration/graphQlSchema/graphQlSchemaBuilder.test.ts +247 -26
- package/tests/cases/integration/graphQlSchema/schema-acl-allowed.gql +18 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-create-only.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-restricted-create.gql +15 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-restricted-delete.gql +12 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-restricted-read.gql +254 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-restricted-update.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-acl.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-aliased-type.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-array.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-basic.gql +51 -0
- package/tests/cases/integration/graphQlSchema/schema-bug-66.gql +18 -0
- package/tests/cases/integration/graphQlSchema/schema-column-types.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-custom-primary.gql +51 -0
- package/tests/cases/integration/graphQlSchema/schema-deprecation.gql +962 -0
- package/tests/cases/integration/graphQlSchema/schema-description.gql +992 -0
- package/tests/cases/integration/graphQlSchema/schema-has-many-reduction.gql +18 -0
- package/tests/cases/integration/graphQlSchema/schema-mixed-root-through.gql +266 -0
- package/tests/cases/integration/graphQlSchema/schema-new-builder.gql +51 -0
- package/tests/cases/integration/graphQlSchema/schema-no-root-ops.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-not-null-through.gql +201 -0
- package/tests/cases/unit/checkViolationError.test.ts +49 -0
- package/tests/cases/unit/dateType.test.ts +46 -0
- package/tests/cases/unit/decimalType.test.ts +2 -2
- package/tests/cases/unit/internalColumnAliases.test.ts +41 -0
- package/tests/cases/unit/introspectionAcl.test.ts +30 -0
- package/tests/cases/unit/mutationSqlError.test.ts +30 -0
- package/tests/cases/unit/pathAlias.test.ts +26 -0
- package/tests/cases/unit/permissionMerger.test.ts +947 -13
- package/tests/cases/unit/predicatesFactory.test.ts +7 -16
- package/tests/cases/unit/predicatesInjector.test.ts +1046 -183
- package/tests/cases/unit/variableInjector.test.ts +12 -0
- package/tests/cases/unit/whereOptimizer.test.ts +62 -0
- package/tests/src/test.ts +51 -9
- package/tests/src/testGraphql.ts +43 -20
- package/tests/tsconfig.json +1 -0
|
@@ -4,9 +4,13 @@ const schemaUtils = require("@contember/schema-utils");
|
|
|
4
4
|
require("@contember/schema");
|
|
5
5
|
const Database = require("@contember/database");
|
|
6
6
|
require("node:crypto");
|
|
7
|
+
const AclScope = require("../acl/AclScope.cjs");
|
|
7
8
|
const exception = require("../exception.cjs");
|
|
8
|
-
const OrderByHelper = require("./select/OrderByHelper.cjs");
|
|
9
9
|
const Mutex = require("../utils/Mutex.cjs");
|
|
10
|
+
require("@contember/utilities");
|
|
11
|
+
require("../acl/PredicatesInjector.cjs");
|
|
12
|
+
require("./select/Path.cjs");
|
|
13
|
+
const OrderByHelper = require("./select/OrderByHelper.cjs");
|
|
10
14
|
const CheckedPrimary = require("./CheckedPrimary.cjs");
|
|
11
15
|
const SelectHydrator = require("./select/SelectHydrator.cjs");
|
|
12
16
|
const DeletedEntitiesStorage = require("./delete/DeletedEntitiesStorage.cjs");
|
|
@@ -17,7 +21,7 @@ var __defProp = Object.defineProperty;
|
|
|
17
21
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
22
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
23
|
class Mapper {
|
|
20
|
-
constructor(db, identityId, transactionId, schema, schemaDatabaseMetadata, predicatesInjector, selectBuilderFactory, uniqueWhereExpander, whereBuilder, junctionTableManager, deleteExecutor, updater, inserter, pathFactory) {
|
|
24
|
+
constructor(db, identityId, transactionId, schema, schemaDatabaseMetadata, predicatesInjector, selectBuilderFactory, uniqueWhereExpander, whereBuilder, junctionTableManager, deleteExecutor, updater, inserter, pathFactory, memoryBudget) {
|
|
21
25
|
this.db = db;
|
|
22
26
|
this.identityId = identityId;
|
|
23
27
|
this.transactionId = transactionId;
|
|
@@ -32,33 +36,36 @@ class Mapper {
|
|
|
32
36
|
this.updater = updater;
|
|
33
37
|
this.inserter = inserter;
|
|
34
38
|
this.pathFactory = pathFactory;
|
|
39
|
+
this.memoryBudget = memoryBudget;
|
|
35
40
|
__publicField(this, "systemVariablesSetupDone");
|
|
36
41
|
__publicField(this, "deletedEntities", new DeletedEntitiesStorage.DeletedEntitiesStorage());
|
|
37
42
|
__publicField(this, "mutex", new Mutex.Mutex());
|
|
38
43
|
__publicField(this, "constraintHelper");
|
|
44
|
+
__publicField(this, "selectionDb");
|
|
39
45
|
__publicField(this, "eventManager");
|
|
40
46
|
this.constraintHelper = new Database.ConstraintHelper(db, this.schemaDatabaseMetadata);
|
|
47
|
+
this.selectionDb = memoryBudget ? db.withMemoryBudget(memoryBudget, { chargeRows: true }) : db;
|
|
41
48
|
this.eventManager = new EventManager.EventManager(this);
|
|
42
49
|
}
|
|
43
|
-
async selectField(entity, where, fieldName) {
|
|
50
|
+
async selectField(entity, where, fieldName, scope) {
|
|
44
51
|
const columnName = schemaUtils.getColumnName(this.schema, entity, fieldName);
|
|
45
52
|
const qb = Database.SelectBuilder.create().from(entity.tableName, "root_").select(["root_", columnName]);
|
|
46
53
|
const expandedWhere = this.uniqueWhereExpander.expand(entity, where);
|
|
47
|
-
const withPredicates = this.predicatesInjector.inject(entity, expandedWhere);
|
|
54
|
+
const withPredicates = this.predicatesInjector.inject(entity, expandedWhere, scope);
|
|
48
55
|
const builtQb = this.whereBuilder.build(qb, entity, this.pathFactory.create([]), withPredicates);
|
|
49
56
|
const result = await builtQb.getResult(this.db);
|
|
50
57
|
return result[0] !== void 0 ? result[0][columnName] : void 0;
|
|
51
58
|
}
|
|
52
59
|
async selectAssoc(entity, input, relationPath, indexBy) {
|
|
53
|
-
const hydrator = new SelectHydrator.SelectHydrator();
|
|
60
|
+
const hydrator = new SelectHydrator.SelectHydrator(this.memoryBudget);
|
|
54
61
|
const path = this.pathFactory.create([]);
|
|
55
|
-
const indexByAlias = path.for(indexBy).alias;
|
|
62
|
+
const indexByAlias = path.forInternal("index").for(indexBy).alias;
|
|
56
63
|
const qb = Database.SelectBuilder.create().select([path.alias, schemaUtils.getColumnName(this.schema, entity, indexBy)], indexByAlias);
|
|
57
64
|
const rows = await this.selectRows(hydrator, qb, entity, input, relationPath);
|
|
58
65
|
return await hydrator.hydrateAll(rows, indexByAlias);
|
|
59
66
|
}
|
|
60
67
|
async select(entity, input, relationPath) {
|
|
61
|
-
const hydrator = new SelectHydrator.SelectHydrator();
|
|
68
|
+
const hydrator = new SelectHydrator.SelectHydrator(this.memoryBudget);
|
|
62
69
|
const qb = Database.SelectBuilder.create();
|
|
63
70
|
const rows = await this.selectRows(hydrator, qb, entity, input, relationPath);
|
|
64
71
|
return await hydrator.hydrateAll(rows);
|
|
@@ -71,7 +78,7 @@ class Mapper {
|
|
|
71
78
|
return rows[0] ?? null;
|
|
72
79
|
}
|
|
73
80
|
async selectGrouped(entity, input, relation, relationPath) {
|
|
74
|
-
const hydrator = new SelectHydrator.SelectHydrator();
|
|
81
|
+
const hydrator = new SelectHydrator.SelectHydrator(this.memoryBudget);
|
|
75
82
|
const path = this.pathFactory.create([]);
|
|
76
83
|
const groupingKey = "__grouping_key";
|
|
77
84
|
const qb = Database.SelectBuilder.create().select([path.alias, relation.joiningColumn.columnName], groupingKey);
|
|
@@ -86,17 +93,18 @@ class Mapper {
|
|
|
86
93
|
const filterWithPredicates = this.predicatesInjector.inject(
|
|
87
94
|
entity,
|
|
88
95
|
inputWithOrder.args.filter || {},
|
|
96
|
+
AclScope.aclScopeFromPath(relationPath),
|
|
89
97
|
relationPath[relationPath.length - 1],
|
|
90
98
|
relationPath
|
|
91
99
|
);
|
|
92
100
|
const inputWithPredicates = inputWithOrder.withArg("filter", filterWithPredicates);
|
|
93
101
|
selector.select(this, entity, inputWithPredicates, path, groupBy);
|
|
94
|
-
return await selector.execute(this.
|
|
102
|
+
return await selector.execute(this.selectionDb);
|
|
95
103
|
}
|
|
96
|
-
async count(entity, filter) {
|
|
104
|
+
async count(entity, filter, scope) {
|
|
97
105
|
const path = this.pathFactory.create([]);
|
|
98
106
|
const qb = Database.SelectBuilder.create().from(entity.tableName, path.alias).select((expr) => expr.raw("count(*)"), "row_count");
|
|
99
|
-
const withPredicates = this.predicatesInjector.inject(entity, filter);
|
|
107
|
+
const withPredicates = this.predicatesInjector.inject(entity, filter, scope);
|
|
100
108
|
const qbWithWhere = this.whereBuilder.build(qb, entity, path, withPredicates);
|
|
101
109
|
const result = await qbWithWhere.getResult(this.db);
|
|
102
110
|
return result[0].row_count;
|
|
@@ -104,7 +112,13 @@ class Mapper {
|
|
|
104
112
|
async countGrouped(entity, filter, relation, relationPath) {
|
|
105
113
|
const path = this.pathFactory.create([]);
|
|
106
114
|
const qb = Database.SelectBuilder.create().from(entity.tableName, path.alias).select((expr) => expr.raw("count(*)"), "row_count").select([path.alias, relation.joiningColumn.columnName]).groupBy([path.alias, relation.joiningColumn.columnName]);
|
|
107
|
-
const withPredicates = this.predicatesInjector.inject(
|
|
115
|
+
const withPredicates = this.predicatesInjector.inject(
|
|
116
|
+
entity,
|
|
117
|
+
filter,
|
|
118
|
+
AclScope.aclScopeFromPath(relationPath),
|
|
119
|
+
relationPath[relationPath.length - 1],
|
|
120
|
+
relationPath
|
|
121
|
+
);
|
|
108
122
|
const qbWithWhere = this.whereBuilder.build(qb, entity, path, withPredicates, { relationPath });
|
|
109
123
|
const rows = await qbWithWhere.getResult(this.db);
|
|
110
124
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -113,74 +127,91 @@ class Mapper {
|
|
|
113
127
|
}
|
|
114
128
|
return Object.fromEntries(result);
|
|
115
129
|
}
|
|
116
|
-
async insert(entity, data, builderCb = () => {
|
|
130
|
+
async insert(entity, data, scope, builderCb = () => {
|
|
117
131
|
}) {
|
|
118
132
|
if (entity.view) {
|
|
119
133
|
throw new exception.ImplementationException();
|
|
120
134
|
}
|
|
121
135
|
await this.setupSystemVariables();
|
|
122
|
-
return ErrorUtils.tryMutation(this.schema, this.schemaDatabaseMetadata, () => this.insertInternal(entity, data, builderCb));
|
|
136
|
+
return ErrorUtils.tryMutation(this.schema, this.schemaDatabaseMetadata, () => this.insertInternal(entity, data, scope, builderCb));
|
|
123
137
|
}
|
|
124
|
-
async update(entity, by, data, filter) {
|
|
138
|
+
async update(entity, by, data, scope, filter) {
|
|
125
139
|
if (entity.view) {
|
|
126
140
|
throw new exception.ImplementationException();
|
|
127
141
|
}
|
|
128
142
|
await this.setupSystemVariables();
|
|
129
143
|
return ErrorUtils.tryMutation(this.schema, this.schemaDatabaseMetadata, async () => {
|
|
130
|
-
const [primaryValue, err] = await this.getPrimaryValue(entity, by);
|
|
144
|
+
const [primaryValue, err] = await this.getPrimaryValue(entity, by, AclScope.ROW_LOOKUP_SCOPE);
|
|
131
145
|
if (err) return [err];
|
|
132
|
-
return await this.updater.update(this, entity, primaryValue, data, filter);
|
|
146
|
+
return await this.updater.update(this, entity, primaryValue, data, scope, filter);
|
|
133
147
|
});
|
|
134
148
|
}
|
|
135
|
-
async updateInternal(entity, by, builderCb) {
|
|
149
|
+
async updateInternal(entity, by, builderCb, scope) {
|
|
136
150
|
if (entity.view) {
|
|
137
151
|
throw new exception.ImplementationException();
|
|
138
152
|
}
|
|
139
153
|
await this.setupSystemVariables();
|
|
140
154
|
return ErrorUtils.tryMutation(this.schema, this.schemaDatabaseMetadata, async () => {
|
|
141
|
-
const [primaryValue, err] = await this.getPrimaryValue(entity, by);
|
|
155
|
+
const [primaryValue, err] = await this.getPrimaryValue(entity, by, AclScope.ROW_LOOKUP_SCOPE);
|
|
142
156
|
if (err) return [err];
|
|
143
|
-
return await this.updater.updateCb(this, entity, primaryValue, builderCb);
|
|
157
|
+
return await this.updater.updateCb(this, entity, primaryValue, builderCb, scope);
|
|
144
158
|
});
|
|
145
159
|
}
|
|
146
|
-
async upsert(entity, by, update, create, filter) {
|
|
160
|
+
async upsert(entity, by, update, create, scope, filter) {
|
|
147
161
|
if (entity.view) {
|
|
148
162
|
throw new exception.ImplementationException();
|
|
149
163
|
}
|
|
150
164
|
await this.setupSystemVariables();
|
|
151
165
|
return ErrorUtils.tryMutation(this.schema, this.schemaDatabaseMetadata, async () => {
|
|
152
|
-
const [primaryValue] = await this.getPrimaryValue(entity, by);
|
|
166
|
+
const [primaryValue] = await this.getPrimaryValue(entity, by, AclScope.ROW_LOOKUP_SCOPE);
|
|
153
167
|
if (primaryValue === void 0) {
|
|
154
|
-
return await this.insertInternal(entity, create);
|
|
168
|
+
return await this.insertInternal(entity, create, scope);
|
|
155
169
|
}
|
|
156
|
-
return await this.updater.update(this, entity, primaryValue, update, filter);
|
|
170
|
+
return await this.updater.update(this, entity, primaryValue, update, scope, filter);
|
|
157
171
|
});
|
|
158
172
|
}
|
|
159
|
-
insertInternal(entity, data, builderCb = () => {
|
|
173
|
+
insertInternal(entity, data, scope, builderCb = () => {
|
|
160
174
|
}) {
|
|
161
|
-
return this.inserter.insert(
|
|
162
|
-
|
|
175
|
+
return this.inserter.insert(
|
|
176
|
+
this,
|
|
177
|
+
entity,
|
|
178
|
+
data,
|
|
179
|
+
(id) => {
|
|
180
|
+
},
|
|
181
|
+
builderCb,
|
|
182
|
+
scope
|
|
183
|
+
);
|
|
163
184
|
}
|
|
164
|
-
async delete(entity, by, filter) {
|
|
185
|
+
async delete(entity, by, scope, filter) {
|
|
165
186
|
if (entity.view) {
|
|
166
187
|
throw new exception.ImplementationException();
|
|
167
188
|
}
|
|
168
189
|
await this.setupSystemVariables();
|
|
169
190
|
return ErrorUtils.tryMutation(this.schema, this.schemaDatabaseMetadata, () => {
|
|
170
|
-
return this.deleteExecutor.execute(this, entity, by, filter);
|
|
191
|
+
return this.deleteExecutor.execute(this, entity, by, scope, filter);
|
|
171
192
|
});
|
|
172
193
|
}
|
|
173
|
-
|
|
194
|
+
/**
|
|
195
|
+
* `scope` belongs to `entity` - the side the caller named. The other side of the junction is
|
|
196
|
+
* reached over the relation, so it always resolves as nested.
|
|
197
|
+
*/
|
|
198
|
+
async connectJunction(entity, relation, thisPrimary, otherPrimary, scope) {
|
|
174
199
|
await this.setupSystemVariables();
|
|
175
200
|
const err = () => {
|
|
176
201
|
throw new exception.ImplementationException();
|
|
177
202
|
};
|
|
178
203
|
return await schemaUtils.acceptFieldVisitor(this.schema, entity, relation, {
|
|
179
204
|
visitManyHasManyOwning: ({ entity: entity2, relation: relation2 }) => {
|
|
180
|
-
return this.junctionTableManager.connectJunction(this, entity2, relation2, thisPrimary, otherPrimary
|
|
205
|
+
return this.junctionTableManager.connectJunction(this, entity2, relation2, thisPrimary, otherPrimary, {
|
|
206
|
+
owning: scope,
|
|
207
|
+
inverse: "nested"
|
|
208
|
+
});
|
|
181
209
|
},
|
|
182
210
|
visitManyHasManyInverse: ({ targetEntity, targetRelation }) => {
|
|
183
|
-
return this.junctionTableManager.connectJunction(this, targetEntity, targetRelation, otherPrimary, thisPrimary
|
|
211
|
+
return this.junctionTableManager.connectJunction(this, targetEntity, targetRelation, otherPrimary, thisPrimary, {
|
|
212
|
+
owning: "nested",
|
|
213
|
+
inverse: scope
|
|
214
|
+
});
|
|
184
215
|
},
|
|
185
216
|
visitColumn: err,
|
|
186
217
|
visitOneHasMany: err,
|
|
@@ -189,17 +220,24 @@ class Mapper {
|
|
|
189
220
|
visitManyHasOne: err
|
|
190
221
|
});
|
|
191
222
|
}
|
|
192
|
-
|
|
223
|
+
/** See {@link connectJunction} for how `scope` maps onto the two sides. */
|
|
224
|
+
async disconnectJunction(entity, relation, thisPrimary, otherPrimary, scope) {
|
|
193
225
|
await this.setupSystemVariables();
|
|
194
226
|
const err = () => {
|
|
195
227
|
throw new exception.ImplementationException();
|
|
196
228
|
};
|
|
197
229
|
return await schemaUtils.acceptFieldVisitor(this.schema, entity, relation, {
|
|
198
230
|
visitManyHasManyOwning: ({ entity: entity2, relation: relation2 }) => {
|
|
199
|
-
return this.junctionTableManager.disconnectJunction(this, entity2, relation2, thisPrimary, otherPrimary
|
|
231
|
+
return this.junctionTableManager.disconnectJunction(this, entity2, relation2, thisPrimary, otherPrimary, {
|
|
232
|
+
owning: scope,
|
|
233
|
+
inverse: "nested"
|
|
234
|
+
});
|
|
200
235
|
},
|
|
201
236
|
visitManyHasManyInverse: ({ targetEntity, targetRelation }) => {
|
|
202
|
-
return this.junctionTableManager.disconnectJunction(this, targetEntity, targetRelation, otherPrimary, thisPrimary
|
|
237
|
+
return this.junctionTableManager.disconnectJunction(this, targetEntity, targetRelation, otherPrimary, thisPrimary, {
|
|
238
|
+
owning: "nested",
|
|
239
|
+
inverse: scope
|
|
240
|
+
});
|
|
203
241
|
},
|
|
204
242
|
visitColumn: err,
|
|
205
243
|
visitOneHasMany: err,
|
|
@@ -208,11 +246,47 @@ class Mapper {
|
|
|
208
246
|
visitManyHasOne: err
|
|
209
247
|
});
|
|
210
248
|
}
|
|
211
|
-
|
|
249
|
+
/**
|
|
250
|
+
* Fetches the primary values of entities currently in a has-many relation of the given owner.
|
|
251
|
+
* Used by the declarative `set` operation to compute orphans. Respects ACL read predicates on the target entity.
|
|
252
|
+
*/
|
|
253
|
+
async fetchHasManyPrimaries(context, ownerPrimary) {
|
|
254
|
+
if (context.type === "oneHasMany") {
|
|
255
|
+
const { targetEntity: targetEntity2, targetRelation } = context;
|
|
256
|
+
const readPredicate2 = this.predicatesInjector.inject(targetEntity2, {}, "nested");
|
|
257
|
+
const path = this.pathFactory.create([]);
|
|
258
|
+
let qb2 = Database.SelectBuilder.create().from(targetEntity2.tableName, path.alias).select([path.alias, targetEntity2.primaryColumn], "primary_").where((cond) => cond.compare([path.alias, targetRelation.joiningColumn.columnName], Database.Operator.eq, ownerPrimary));
|
|
259
|
+
if (Object.keys(readPredicate2).length > 0) {
|
|
260
|
+
qb2 = this.whereBuilder.build(qb2, targetEntity2, path, readPredicate2);
|
|
261
|
+
}
|
|
262
|
+
const rows2 = await qb2.getResult(this.db);
|
|
263
|
+
return rows2.map((it) => it.primary_);
|
|
264
|
+
}
|
|
265
|
+
const owningContext = context.type === "manyHasManyOwning" ? { entity: context.entity, relation: context.relation, ownerIsJoining: true } : { entity: context.targetEntity, relation: context.targetRelation, ownerIsJoining: false };
|
|
266
|
+
const targetEntity = context.targetEntity;
|
|
267
|
+
const joiningTable = owningContext.relation.joiningTable;
|
|
268
|
+
const ownerColumn = owningContext.ownerIsJoining ? joiningTable.joiningColumn.columnName : joiningTable.inverseJoiningColumn.columnName;
|
|
269
|
+
const targetColumn = owningContext.ownerIsJoining ? joiningTable.inverseJoiningColumn.columnName : joiningTable.joiningColumn.columnName;
|
|
270
|
+
const readPredicate = this.predicatesInjector.inject(targetEntity, {}, "nested");
|
|
271
|
+
const hasReadPredicate = Object.keys(readPredicate).length > 0;
|
|
272
|
+
let qb = Database.SelectBuilder.create().from(joiningTable.tableName, "junction_").select(["junction_", targetColumn], "primary_").where((cond) => cond.compare(["junction_", ownerColumn], Database.Operator.eq, ownerPrimary));
|
|
273
|
+
if (hasReadPredicate) {
|
|
274
|
+
const path = this.pathFactory.create([]);
|
|
275
|
+
qb = qb.join(
|
|
276
|
+
targetEntity.tableName,
|
|
277
|
+
path.alias,
|
|
278
|
+
(clause) => clause.compareColumns(["junction_", targetColumn], Database.Operator.eq, [path.alias, targetEntity.primaryColumn])
|
|
279
|
+
);
|
|
280
|
+
qb = this.whereBuilder.build(qb, targetEntity, path, readPredicate);
|
|
281
|
+
}
|
|
282
|
+
const rows = await qb.getResult(this.db);
|
|
283
|
+
return rows.map((it) => it.primary_);
|
|
284
|
+
}
|
|
285
|
+
async getPrimaryValue(entity, where, scope) {
|
|
212
286
|
if (where instanceof CheckedPrimary.CheckedPrimary) {
|
|
213
287
|
return [where.primaryValue, void 0];
|
|
214
288
|
}
|
|
215
|
-
const result = await this.selectField(entity, where, entity.primary);
|
|
289
|
+
const result = await this.selectField(entity, where, entity.primary, scope);
|
|
216
290
|
return result ? [result, void 0] : [void 0, new Result.MutationEntryNotFoundError([], where)];
|
|
217
291
|
}
|
|
218
292
|
async setupSystemVariables() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mapper.cjs","sources":["../../../../../packages/engine-content-api/src/mapper/Mapper.ts"],"sourcesContent":["import { Input, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getColumnName } from '@contember/schema-utils'\nimport {\n\tOrderByHelper,\n\tPathFactory,\n\tSelectBuilderFactory,\n\tSelectGroupedObjects,\n\tSelectHydrator,\n\tSelectIndexedResultObjects,\n\tSelectResultObject,\n\tWhereBuilder,\n} from './select/index.js'\nimport { Client, Connection, ConstraintHelper, DatabaseMetadata, SelectBuilder } from '@contember/database'\nimport { PredicatesInjector } from '../acl/index.js'\nimport { JunctionTableManager } from './JunctionTableManager.js'\nimport { DeletedEntitiesStorage, DeleteExecutor } from './delete/index.js'\nimport { MutationEntryNotFoundError, MutationResultList } from './Result.js'\nimport { UpdateBuilder, Updater } from './update/index.js'\nimport { InsertBuilder, Inserter } from './insert/index.js'\nimport { tryMutation } from './ErrorUtils.js'\nimport { ObjectNode, UniqueWhereExpander } from '../inputProcessing/index.js'\nimport { Mutex } from '../utils/index.js'\nimport { CheckedPrimary } from './CheckedPrimary.js'\nimport { ImplementationException } from '../exception.js'\nimport { EventManager } from './EventManager.js'\nimport { MapperInput } from './types.js'\n\nexport class Mapper<ConnectionType extends Connection.ConnectionLike = Connection.ConnectionLike> {\n\tprivate systemVariablesSetupDone: Promise<void> | undefined\n\tpublic readonly deletedEntities = new DeletedEntitiesStorage()\n\tpublic readonly mutex = new Mutex()\n\tpublic readonly constraintHelper: ConstraintHelper\n\n\tpublic readonly eventManager: EventManager\n\n\tconstructor(\n\t\tpublic readonly db: Client<ConnectionType>,\n\t\tpublic readonly identityId: string,\n\t\tpublic readonly transactionId: string,\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly schemaDatabaseMetadata: DatabaseMetadata,\n\t\tprivate readonly predicatesInjector: PredicatesInjector,\n\t\tprivate readonly selectBuilderFactory: SelectBuilderFactory,\n\t\tprivate readonly uniqueWhereExpander: UniqueWhereExpander,\n\t\tprivate readonly whereBuilder: WhereBuilder,\n\t\tprivate readonly junctionTableManager: JunctionTableManager,\n\t\tprivate readonly deleteExecutor: DeleteExecutor,\n\t\tprivate readonly updater: Updater,\n\t\tprivate readonly inserter: Inserter,\n\t\tprivate readonly pathFactory: PathFactory,\n\t) {\n\t\tthis.constraintHelper = new ConstraintHelper(db, this.schemaDatabaseMetadata)\n\t\tthis.eventManager = new EventManager(this)\n\t}\n\n\tpublic async selectField(entity: Model.Entity, where: Input.UniqueWhere | CheckedPrimary, fieldName: string) {\n\t\tconst columnName = getColumnName(this.schema, entity, fieldName)\n\n\t\tconst qb = SelectBuilder.create() //\n\t\t\t.from(entity.tableName, 'root_')\n\t\t\t.select(['root_', columnName])\n\t\tconst expandedWhere = this.uniqueWhereExpander.expand(entity, where)\n\t\tconst withPredicates = this.predicatesInjector.inject(entity, expandedWhere)\n\t\tconst builtQb = this.whereBuilder.build(qb, entity, this.pathFactory.create([]), withPredicates)\n\t\tconst result = await builtQb.getResult(this.db)\n\n\t\treturn result[0] !== undefined ? result[0][columnName] : undefined\n\t}\n\n\tpublic async selectAssoc(\n\t\tentity: Model.Entity,\n\t\tinput: ObjectNode<Input.ListQueryInput>,\n\t\trelationPath: Model.AnyRelationContext[],\n\t\tindexBy: string,\n\t): Promise<SelectIndexedResultObjects> {\n\t\tconst hydrator = new SelectHydrator()\n\t\tconst path = this.pathFactory.create([])\n\t\tconst indexByAlias: string = path.for(indexBy).alias\n\t\tconst qb: SelectBuilder = SelectBuilder.create()\n\t\t\t.select([path.alias, getColumnName(this.schema, entity, indexBy)], indexByAlias)\n\t\tconst rows = await this.selectRows(hydrator, qb, entity, input, relationPath)\n\t\treturn await hydrator.hydrateAll(rows, indexByAlias)\n\t}\n\n\tpublic async select(\n\t\tentity: Model.Entity,\n\t\tinput: ObjectNode<Input.ListQueryInput>,\n\t\trelationPath: Model.AnyRelationContext[],\n\t): Promise<SelectResultObject[]> {\n\t\tconst hydrator = new SelectHydrator()\n\t\tconst qb: SelectBuilder<SelectBuilder.Result> = SelectBuilder.create()\n\n\t\tconst rows = await this.selectRows(hydrator, qb, entity, input, relationPath)\n\n\t\treturn await hydrator.hydrateAll(rows)\n\t}\n\n\tpublic async selectUnique(\n\t\tentity: Model.Entity,\n\t\tquery: ObjectNode<Input.UniqueQueryInput>,\n\t\trelationPath: Model.AnyRelationContext[],\n\t): Promise<SelectResultObject | null> {\n\t\tconst uniqueWhere = this.uniqueWhereExpander.expand(entity, query.args.by)\n\t\tconst where = query.args.filter ? { and: [uniqueWhere, query.args.filter] } : uniqueWhere\n\t\tconst queryExpanded = query.withArg<Input.ListQueryInput>('filter', where)\n\n\t\tconst rows = await this.select(entity, queryExpanded, relationPath)\n\n\t\treturn rows[0] ?? null\n\t}\n\n\tpublic async selectGrouped(\n\t\tentity: Model.Entity,\n\t\tinput: ObjectNode<Input.ListQueryInput>,\n\t\trelation: Model.JoiningColumnRelation & Model.AnyRelation,\n\t\trelationPath: Model.AnyRelationContext[],\n\t): Promise<SelectGroupedObjects> {\n\t\tconst hydrator = new SelectHydrator()\n\t\tconst path = this.pathFactory.create([])\n\t\tconst groupingKey = '__grouping_key'\n\t\tconst qb: SelectBuilder = SelectBuilder.create()\n\t\t\t.select([path.alias, relation.joiningColumn.columnName], groupingKey)\n\n\t\tconst rows = await this.selectRows(hydrator, qb, entity, input, relationPath, relation.name)\n\n\t\treturn await hydrator.hydrateGroups(rows, groupingKey)\n\t}\n\n\tprivate async selectRows(\n\t\thydrator: SelectHydrator,\n\t\tqb: SelectBuilder<SelectBuilder.Result>,\n\t\tentity: Model.Entity,\n\t\tinput: ObjectNode<Input.ListQueryInput>,\n\t\trelationPath: Model.AnyRelationContext[],\n\t\tgroupBy?: string,\n\t) {\n\t\tconst inputWithOrder = OrderByHelper.appendDefaultOrderBy(entity, input, undefined)\n\t\tconst path = this.pathFactory.create([])\n\t\tconst augmentedBuilder = qb.from(entity.tableName, path.alias).meta('path', [...input.path, input.alias])\n\n\t\tconst selector = this.selectBuilderFactory.create(augmentedBuilder, hydrator, relationPath)\n\t\tconst filterWithPredicates = this.predicatesInjector.inject(\n\t\t\tentity,\n\t\t\tinputWithOrder.args.filter || {},\n\t\t\trelationPath[relationPath.length - 1],\n\t\t\trelationPath,\n\t\t)\n\t\tconst inputWithPredicates = inputWithOrder.withArg('filter', filterWithPredicates)\n\t\tselector.select(this, entity, inputWithPredicates, path, groupBy)\n\t\treturn await selector.execute(this.db)\n\t}\n\n\tpublic async count(entity: Model.Entity, filter: Input.OptionalWhere) {\n\t\tconst path = this.pathFactory.create([])\n\t\tconst qb = SelectBuilder.create()\n\t\t\t.from(entity.tableName, path.alias)\n\t\t\t.select(expr => expr.raw('count(*)'), 'row_count')\n\t\tconst withPredicates = this.predicatesInjector.inject(entity, filter)\n\t\tconst qbWithWhere = this.whereBuilder.build(qb, entity, path, withPredicates)\n\t\tconst result = await qbWithWhere.getResult(this.db)\n\t\treturn result[0].row_count\n\t}\n\n\tpublic async countGrouped(\n\t\tentity: Model.Entity,\n\t\tfilter: Input.OptionalWhere,\n\t\trelation: Model.JoiningColumnRelation & Model.Relation,\n\t\trelationPath: Model.AnyRelationContext[],\n\t): Promise<Record<string, number>> {\n\t\tconst path = this.pathFactory.create([])\n\t\tconst qb = SelectBuilder.create()\n\t\t\t.from(entity.tableName, path.alias)\n\t\t\t.select(expr => expr.raw('count(*)'), 'row_count')\n\t\t\t.select([path.alias, relation.joiningColumn.columnName])\n\t\t\t.groupBy([path.alias, relation.joiningColumn.columnName])\n\t\tconst withPredicates = this.predicatesInjector.inject(entity, filter, relationPath[relationPath.length - 1], relationPath)\n\t\tconst qbWithWhere = this.whereBuilder.build(qb, entity, path, withPredicates, { relationPath })\n\t\tconst rows = await qbWithWhere.getResult(this.db)\n\t\tconst result = new Map<string, number>()\n\t\tfor (const row of rows) {\n\t\t\tresult.set(String(row[relation.joiningColumn.columnName]), Number(row.row_count))\n\t\t}\n\t\treturn Object.fromEntries(result)\n\t}\n\n\tpublic async insert(\n\t\tentity: Model.Entity,\n\t\tdata: MapperInput.CreateDataInput,\n\t\tbuilderCb: (builder: InsertBuilder) => void = () => {},\n\t): Promise<MutationResultList> {\n\t\tif (entity.view) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tawait this.setupSystemVariables()\n\t\treturn tryMutation(this.schema, this.schemaDatabaseMetadata, () => this.insertInternal(entity, data, builderCb))\n\t}\n\n\tpublic async update(\n\t\tentity: Model.Entity,\n\t\tby: Input.UniqueWhere | CheckedPrimary,\n\t\tdata: MapperInput.UpdateDataInput,\n\t\tfilter?: Input.OptionalWhere,\n\t): Promise<MutationResultList> {\n\t\tif (entity.view) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tawait this.setupSystemVariables()\n\t\treturn tryMutation(this.schema, this.schemaDatabaseMetadata, async () => {\n\t\t\tconst [primaryValue, err] = await this.getPrimaryValue(entity, by)\n\t\t\tif (err) return [err]\n\n\t\t\treturn await this.updater.update(this, entity, primaryValue, data, filter)\n\t\t})\n\t}\n\n\tpublic async updateInternal(\n\t\tentity: Model.Entity,\n\t\tby: Input.UniqueWhere | CheckedPrimary,\n\t\tbuilderCb: (builder: UpdateBuilder) => void,\n\t): Promise<MutationResultList> {\n\t\tif (entity.view) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tawait this.setupSystemVariables()\n\t\treturn tryMutation(this.schema, this.schemaDatabaseMetadata, async () => {\n\t\t\tconst [primaryValue, err] = await this.getPrimaryValue(entity, by)\n\t\t\tif (err) return [err]\n\n\t\t\treturn await this.updater.updateCb(this, entity, primaryValue, builderCb)\n\t\t})\n\t}\n\tpublic async upsert(\n\t\tentity: Model.Entity,\n\t\tby: Input.UniqueWhere | CheckedPrimary,\n\t\tupdate: MapperInput.UpdateDataInput,\n\t\tcreate: MapperInput.CreateDataInput,\n\t\tfilter?: Input.OptionalWhere,\n\t): Promise<MutationResultList> {\n\t\tif (entity.view) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tawait this.setupSystemVariables()\n\t\treturn tryMutation(this.schema, this.schemaDatabaseMetadata, async () => {\n\t\t\tconst [primaryValue] = await this.getPrimaryValue(entity, by)\n\t\t\tif (primaryValue === undefined) {\n\t\t\t\treturn await this.insertInternal(entity, create)\n\t\t\t}\n\t\t\treturn await this.updater.update(this, entity, primaryValue, update, filter)\n\t\t})\n\t}\n\n\tprivate insertInternal(entity: Model.Entity, data: MapperInput.CreateDataInput, builderCb: (builder: InsertBuilder) => void = () => {}) {\n\t\treturn this.inserter.insert(this, entity, data, id => {\n\t\t}, builderCb)\n\t}\n\n\tpublic async delete(\n\t\tentity: Model.Entity,\n\t\tby: Input.UniqueWhere | CheckedPrimary,\n\t\tfilter?: Input.OptionalWhere,\n\t): Promise<MutationResultList> {\n\t\tif (entity.view) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tawait this.setupSystemVariables()\n\t\treturn tryMutation(this.schema, this.schemaDatabaseMetadata, () => {\n\t\t\treturn this.deleteExecutor.execute(this, entity, by, filter)\n\t\t})\n\t}\n\n\tpublic async connectJunction(\n\t\tentity: Model.Entity,\n\t\trelation: Model.ManyHasManyOwningRelation | Model.ManyHasManyInverseRelation,\n\t\tthisPrimary: Input.PrimaryValue,\n\t\totherPrimary: Input.PrimaryValue,\n\t): Promise<MutationResultList> {\n\t\tawait this.setupSystemVariables()\n\t\tconst err = () => {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn await acceptFieldVisitor(this.schema, entity, relation, {\n\t\t\tvisitManyHasManyOwning: ({ entity, relation }) => {\n\t\t\t\treturn this.junctionTableManager.connectJunction(this, entity, relation, thisPrimary, otherPrimary)\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: ({ targetEntity, targetRelation }) => {\n\t\t\t\treturn this.junctionTableManager.connectJunction(this, targetEntity, targetRelation, otherPrimary, thisPrimary)\n\t\t\t},\n\t\t\tvisitColumn: err,\n\t\t\tvisitOneHasMany: err,\n\t\t\tvisitOneHasOneInverse: err,\n\t\t\tvisitOneHasOneOwning: err,\n\t\t\tvisitManyHasOne: err,\n\t\t})\n\t}\n\n\tpublic async disconnectJunction(\n\t\tentity: Model.Entity,\n\t\trelation: Model.ManyHasManyOwningRelation | Model.ManyHasManyInverseRelation,\n\t\tthisPrimary: Input.PrimaryValue,\n\t\totherPrimary: Input.PrimaryValue,\n\t): Promise<MutationResultList> {\n\t\tawait this.setupSystemVariables()\n\t\tconst err = () => {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn await acceptFieldVisitor(this.schema, entity, relation, {\n\t\t\tvisitManyHasManyOwning: ({ entity, relation }) => {\n\t\t\t\treturn this.junctionTableManager.disconnectJunction(this, entity, relation, thisPrimary, otherPrimary)\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: ({ targetEntity, targetRelation }) => {\n\t\t\t\treturn this.junctionTableManager.disconnectJunction(this, targetEntity, targetRelation, otherPrimary, thisPrimary)\n\t\t\t},\n\t\t\tvisitColumn: err,\n\t\t\tvisitOneHasMany: err,\n\t\t\tvisitOneHasOneInverse: err,\n\t\t\tvisitOneHasOneOwning: err,\n\t\t\tvisitManyHasOne: err,\n\t\t})\n\t}\n\n\tpublic async getPrimaryValue(\n\t\tentity: Model.Entity,\n\t\twhere: Input.UniqueWhere | CheckedPrimary,\n\t): Promise<[Input.PrimaryValue, undefined] | [undefined, MutationEntryNotFoundError]> {\n\t\tif (where instanceof CheckedPrimary) {\n\t\t\treturn [where.primaryValue, undefined]\n\t\t}\n\t\tconst result = await this.selectField(entity, where, entity.primary)\n\t\treturn result ? [result, undefined] : [undefined, new MutationEntryNotFoundError([], where)]\n\t}\n\n\tprivate async setupSystemVariables() {\n\t\tthis.systemVariablesSetupDone ??= (async () => {\n\t\t\tawait this.db.query('SELECT set_config(?, ?, false)', ['tenant.identity_id', this.identityId]) // todo rename to system.identity_id\n\t\t\tawait this.db.query('SELECT set_config(?, ?, false)', ['system.transaction_id', this.transactionId])\n\t\t})()\n\t\tawait this.systemVariablesSetupDone\n\t}\n}\n"],"names":["DeletedEntitiesStorage","Mutex","ConstraintHelper","EventManager","getColumnName","SelectBuilder","SelectHydrator","OrderByHelper","ImplementationException","tryMutation","acceptFieldVisitor","entity","relation","CheckedPrimary","MutationEntryNotFoundError"],"mappings":";;;;;;;;;;;;;;;;;;AA2BO,MAAM,OAAqF;AAAA,EAQjG,YACiB,IACA,YACA,eACC,QACA,wBACA,oBACA,sBACA,qBACA,cACA,sBACA,gBACA,SACA,UACA,aAChB;AAde,SAAA,KAAA;AACA,SAAA,aAAA;AACA,SAAA,gBAAA;AACC,SAAA,SAAA;AACA,SAAA,yBAAA;AACA,SAAA,qBAAA;AACA,SAAA,uBAAA;AACA,SAAA,sBAAA;AACA,SAAA,eAAA;AACA,SAAA,uBAAA;AACA,SAAA,iBAAA;AACA,SAAA,UAAA;AACA,SAA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AC,QAAQ,MAAS,IAAI,CAAC,QAAW,IAAIC,OAAAA,2BAA2B,IAAI,KAAK,CAAC;AAAA,EAC5F;AAAA,EAEA,MAAc,uBAAuB;AACpC,SAAK,6BAAL,KAAK,4BAA8B,YAAY;AAC9C,YAAM,KAAK,GAAG,MAAM,kCAAkC,CAAC,sBAAsB,KAAK,UAAU,CAAC;AAC7F,YAAM,KAAK,GAAG,MAAM,kCAAkC,CAAC,yBAAyB,KAAK,aAAa,CAAC;AAAA,IACpG;AACA,UAAM,KAAK;AAAA,EACZ;AACD;;"}
|
|
1
|
+
{"version":3,"file":"Mapper.cjs","sources":["../../../../../packages/engine-content-api/src/mapper/Mapper.ts"],"sourcesContent":["import { Input, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getColumnName } from '@contember/schema-utils'\nimport {\n\tOrderByHelper,\n\tPathFactory,\n\tSelectBuilderFactory,\n\tSelectGroupedObjects,\n\tSelectHydrator,\n\tSelectIndexedResultObjects,\n\tSelectResultObject,\n\tWhereBuilder,\n} from './select/index.js'\nimport { Client, Connection, ConstraintHelper, DatabaseMetadata, Operator, RequestMemoryBudget, SelectBuilder } from '@contember/database'\nimport { AclScope, aclScopeFromPath, PredicatesInjector, ROW_LOOKUP_SCOPE } from '../acl/index.js'\nimport { JunctionTableManager } from './JunctionTableManager.js'\nimport { DeletedEntitiesStorage, DeleteExecutor } from './delete/index.js'\nimport { MutationEntryNotFoundError, MutationResultList } from './Result.js'\nimport { UpdateBuilder, Updater } from './update/index.js'\nimport { InsertBuilder, Inserter } from './insert/index.js'\nimport { tryMutation } from './ErrorUtils.js'\nimport { ObjectNode, UniqueWhereExpander } from '../inputProcessing/index.js'\nimport { Mutex } from '../utils/index.js'\nimport { CheckedPrimary } from './CheckedPrimary.js'\nimport { ImplementationException } from '../exception.js'\nimport { EventManager } from './EventManager.js'\nimport { MapperInput } from './types.js'\n\nexport class Mapper<ConnectionType extends Connection.ConnectionLike = Connection.ConnectionLike> {\n\tprivate systemVariablesSetupDone: Promise<void> | undefined\n\tpublic readonly deletedEntities = new DeletedEntitiesStorage()\n\tpublic readonly mutex = new Mutex()\n\tpublic readonly constraintHelper: ConstraintHelper\n\t/** Charges the request memory budget; only selection results use it, internal mutation queries stay on `db`. */\n\tpublic readonly selectionDb: Client<ConnectionType>\n\n\tpublic readonly eventManager: EventManager\n\n\tconstructor(\n\t\tpublic readonly db: Client<ConnectionType>,\n\t\tpublic readonly identityId: string,\n\t\tpublic readonly transactionId: string,\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly schemaDatabaseMetadata: DatabaseMetadata,\n\t\tprivate readonly predicatesInjector: PredicatesInjector,\n\t\tprivate readonly selectBuilderFactory: SelectBuilderFactory,\n\t\tprivate readonly uniqueWhereExpander: UniqueWhereExpander,\n\t\tprivate readonly whereBuilder: WhereBuilder,\n\t\tprivate readonly junctionTableManager: JunctionTableManager,\n\t\tprivate readonly deleteExecutor: DeleteExecutor,\n\t\tprivate readonly updater: Updater,\n\t\tprivate readonly inserter: Inserter,\n\t\tprivate readonly pathFactory: PathFactory,\n\t\tprivate readonly memoryBudget?: RequestMemoryBudget,\n\t) {\n\t\tthis.constraintHelper = new ConstraintHelper(db, this.schemaDatabaseMetadata)\n\t\tthis.selectionDb = memoryBudget ? db.withMemoryBudget(memoryBudget, { chargeRows: true }) : db\n\t\tthis.eventManager = new EventManager(this)\n\t}\n\n\tpublic async selectField(entity: Model.Entity, where: Input.UniqueWhere | CheckedPrimary, fieldName: string, scope: AclScope) {\n\t\tconst columnName = getColumnName(this.schema, entity, fieldName)\n\n\t\tconst qb = SelectBuilder.create() //\n\t\t\t.from(entity.tableName, 'root_')\n\t\t\t.select(['root_', columnName])\n\t\tconst expandedWhere = this.uniqueWhereExpander.expand(entity, where)\n\t\tconst withPredicates = this.predicatesInjector.inject(entity, expandedWhere, scope)\n\t\tconst builtQb = this.whereBuilder.build(qb, entity, this.pathFactory.create([]), withPredicates)\n\t\tconst result = await builtQb.getResult(this.db)\n\n\t\treturn result[0] !== undefined ? result[0][columnName] : undefined\n\t}\n\n\tpublic async selectAssoc(\n\t\tentity: Model.Entity,\n\t\tinput: ObjectNode<Input.ListQueryInput>,\n\t\trelationPath: Model.AnyRelationContext[],\n\t\tindexBy: string,\n\t): Promise<SelectIndexedResultObjects> {\n\t\tconst hydrator = new SelectHydrator(this.memoryBudget)\n\t\tconst path = this.pathFactory.create([])\n\t\tconst indexByAlias: string = path.forInternal('index').for(indexBy).alias\n\t\tconst qb: SelectBuilder = SelectBuilder.create()\n\t\t\t.select([path.alias, getColumnName(this.schema, entity, indexBy)], indexByAlias)\n\t\tconst rows = await this.selectRows(hydrator, qb, entity, input, relationPath)\n\t\treturn await hydrator.hydrateAll(rows, indexByAlias)\n\t}\n\n\tpublic async select(\n\t\tentity: Model.Entity,\n\t\tinput: ObjectNode<Input.ListQueryInput>,\n\t\trelationPath: Model.AnyRelationContext[],\n\t): Promise<SelectResultObject[]> {\n\t\tconst hydrator = new SelectHydrator(this.memoryBudget)\n\t\tconst qb: SelectBuilder<SelectBuilder.Result> = SelectBuilder.create()\n\n\t\tconst rows = await this.selectRows(hydrator, qb, entity, input, relationPath)\n\n\t\treturn await hydrator.hydrateAll(rows)\n\t}\n\n\tpublic async selectUnique(\n\t\tentity: Model.Entity,\n\t\tquery: ObjectNode<Input.UniqueQueryInput>,\n\t\trelationPath: Model.AnyRelationContext[],\n\t): Promise<SelectResultObject | null> {\n\t\tconst uniqueWhere = this.uniqueWhereExpander.expand(entity, query.args.by)\n\t\tconst where = query.args.filter ? { and: [uniqueWhere, query.args.filter] } : uniqueWhere\n\t\tconst queryExpanded = query.withArg<Input.ListQueryInput>('filter', where)\n\n\t\tconst rows = await this.select(entity, queryExpanded, relationPath)\n\n\t\treturn rows[0] ?? null\n\t}\n\n\tpublic async selectGrouped(\n\t\tentity: Model.Entity,\n\t\tinput: ObjectNode<Input.ListQueryInput>,\n\t\trelation: Model.JoiningColumnRelation & Model.AnyRelation,\n\t\trelationPath: Model.AnyRelationContext[],\n\t): Promise<SelectGroupedObjects> {\n\t\tconst hydrator = new SelectHydrator(this.memoryBudget)\n\t\tconst path = this.pathFactory.create([])\n\t\tconst groupingKey = '__grouping_key'\n\t\tconst qb: SelectBuilder = SelectBuilder.create()\n\t\t\t.select([path.alias, relation.joiningColumn.columnName], groupingKey)\n\n\t\tconst rows = await this.selectRows(hydrator, qb, entity, input, relationPath, relation.name)\n\n\t\treturn await hydrator.hydrateGroups(rows, groupingKey)\n\t}\n\n\tprivate async selectRows(\n\t\thydrator: SelectHydrator,\n\t\tqb: SelectBuilder<SelectBuilder.Result>,\n\t\tentity: Model.Entity,\n\t\tinput: ObjectNode<Input.ListQueryInput>,\n\t\trelationPath: Model.AnyRelationContext[],\n\t\tgroupBy?: string,\n\t) {\n\t\tconst inputWithOrder = OrderByHelper.appendDefaultOrderBy(entity, input, undefined)\n\t\tconst path = this.pathFactory.create([])\n\t\tconst augmentedBuilder = qb.from(entity.tableName, path.alias).meta('path', [...input.path, input.alias])\n\n\t\tconst selector = this.selectBuilderFactory.create(augmentedBuilder, hydrator, relationPath)\n\t\tconst filterWithPredicates = this.predicatesInjector.inject(\n\t\t\tentity,\n\t\t\tinputWithOrder.args.filter || {},\n\t\t\taclScopeFromPath(relationPath),\n\t\t\trelationPath[relationPath.length - 1],\n\t\t\trelationPath,\n\t\t)\n\t\tconst inputWithPredicates = inputWithOrder.withArg('filter', filterWithPredicates)\n\t\tselector.select(this, entity, inputWithPredicates, path, groupBy)\n\t\treturn await selector.execute(this.selectionDb)\n\t}\n\n\tpublic async count(entity: Model.Entity, filter: Input.OptionalWhere, scope: AclScope) {\n\t\tconst path = this.pathFactory.create([])\n\t\tconst qb = SelectBuilder.create()\n\t\t\t.from(entity.tableName, path.alias)\n\t\t\t.select(expr => expr.raw('count(*)'), 'row_count')\n\t\tconst withPredicates = this.predicatesInjector.inject(entity, filter, scope)\n\t\tconst qbWithWhere = this.whereBuilder.build(qb, entity, path, withPredicates)\n\t\tconst result = await qbWithWhere.getResult(this.db)\n\t\treturn result[0].row_count\n\t}\n\n\tpublic async countGrouped(\n\t\tentity: Model.Entity,\n\t\tfilter: Input.OptionalWhere,\n\t\trelation: Model.JoiningColumnRelation & Model.Relation,\n\t\trelationPath: Model.AnyRelationContext[],\n\t): Promise<Record<string, number>> {\n\t\tconst path = this.pathFactory.create([])\n\t\tconst qb = SelectBuilder.create()\n\t\t\t.from(entity.tableName, path.alias)\n\t\t\t.select(expr => expr.raw('count(*)'), 'row_count')\n\t\t\t.select([path.alias, relation.joiningColumn.columnName])\n\t\t\t.groupBy([path.alias, relation.joiningColumn.columnName])\n\t\tconst withPredicates = this.predicatesInjector.inject(\n\t\t\tentity,\n\t\t\tfilter,\n\t\t\taclScopeFromPath(relationPath),\n\t\t\trelationPath[relationPath.length - 1],\n\t\t\trelationPath,\n\t\t)\n\t\tconst qbWithWhere = this.whereBuilder.build(qb, entity, path, withPredicates, { relationPath })\n\t\tconst rows = await qbWithWhere.getResult(this.db)\n\t\tconst result = new Map<string, number>()\n\t\tfor (const row of rows) {\n\t\t\tresult.set(String(row[relation.joiningColumn.columnName]), Number(row.row_count))\n\t\t}\n\t\treturn Object.fromEntries(result)\n\t}\n\n\tpublic async insert(\n\t\tentity: Model.Entity,\n\t\tdata: MapperInput.CreateDataInput,\n\t\tscope: AclScope,\n\t\tbuilderCb: (builder: InsertBuilder) => void = () => {},\n\t): Promise<MutationResultList> {\n\t\tif (entity.view) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tawait this.setupSystemVariables()\n\t\treturn tryMutation(this.schema, this.schemaDatabaseMetadata, () => this.insertInternal(entity, data, scope, builderCb))\n\t}\n\n\tpublic async update(\n\t\tentity: Model.Entity,\n\t\tby: Input.UniqueWhere | CheckedPrimary,\n\t\tdata: MapperInput.UpdateDataInput,\n\t\tscope: AclScope,\n\t\tfilter?: Input.OptionalWhere,\n\t): Promise<MutationResultList> {\n\t\tif (entity.view) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tawait this.setupSystemVariables()\n\t\treturn tryMutation(this.schema, this.schemaDatabaseMetadata, async () => {\n\t\t\tconst [primaryValue, err] = await this.getPrimaryValue(entity, by, ROW_LOOKUP_SCOPE)\n\t\t\tif (err) return [err]\n\n\t\t\treturn await this.updater.update(this, entity, primaryValue, data, scope, filter)\n\t\t})\n\t}\n\n\tpublic async updateInternal(\n\t\tentity: Model.Entity,\n\t\tby: Input.UniqueWhere | CheckedPrimary,\n\t\tbuilderCb: (builder: UpdateBuilder) => void,\n\t\tscope: AclScope,\n\t): Promise<MutationResultList> {\n\t\tif (entity.view) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tawait this.setupSystemVariables()\n\t\treturn tryMutation(this.schema, this.schemaDatabaseMetadata, async () => {\n\t\t\tconst [primaryValue, err] = await this.getPrimaryValue(entity, by, ROW_LOOKUP_SCOPE)\n\t\t\tif (err) return [err]\n\n\t\t\treturn await this.updater.updateCb(this, entity, primaryValue, builderCb, scope)\n\t\t})\n\t}\n\tpublic async upsert(\n\t\tentity: Model.Entity,\n\t\tby: Input.UniqueWhere | CheckedPrimary,\n\t\tupdate: MapperInput.UpdateDataInput,\n\t\tcreate: MapperInput.CreateDataInput,\n\t\tscope: AclScope,\n\t\tfilter?: Input.OptionalWhere,\n\t): Promise<MutationResultList> {\n\t\tif (entity.view) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tawait this.setupSystemVariables()\n\t\treturn tryMutation(this.schema, this.schemaDatabaseMetadata, async () => {\n\t\t\tconst [primaryValue] = await this.getPrimaryValue(entity, by, ROW_LOOKUP_SCOPE)\n\t\t\tif (primaryValue === undefined) {\n\t\t\t\treturn await this.insertInternal(entity, create, scope)\n\t\t\t}\n\t\t\treturn await this.updater.update(this, entity, primaryValue, update, scope, filter)\n\t\t})\n\t}\n\n\tprivate insertInternal(\n\t\tentity: Model.Entity,\n\t\tdata: MapperInput.CreateDataInput,\n\t\tscope: AclScope,\n\t\tbuilderCb: (builder: InsertBuilder) => void = () => {},\n\t) {\n\t\treturn this.inserter.insert(\n\t\t\tthis,\n\t\t\tentity,\n\t\t\tdata,\n\t\t\tid => {\n\t\t\t},\n\t\t\tbuilderCb,\n\t\t\tscope,\n\t\t)\n\t}\n\n\tpublic async delete(\n\t\tentity: Model.Entity,\n\t\tby: Input.UniqueWhere | CheckedPrimary,\n\t\tscope: AclScope,\n\t\tfilter?: Input.OptionalWhere,\n\t): Promise<MutationResultList> {\n\t\tif (entity.view) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tawait this.setupSystemVariables()\n\t\treturn tryMutation(this.schema, this.schemaDatabaseMetadata, () => {\n\t\t\treturn this.deleteExecutor.execute(this, entity, by, scope, filter)\n\t\t})\n\t}\n\n\t/**\n\t * `scope` belongs to `entity` - the side the caller named. The other side of the junction is\n\t * reached over the relation, so it always resolves as nested.\n\t */\n\tpublic async connectJunction(\n\t\tentity: Model.Entity,\n\t\trelation: Model.ManyHasManyOwningRelation | Model.ManyHasManyInverseRelation,\n\t\tthisPrimary: Input.PrimaryValue,\n\t\totherPrimary: Input.PrimaryValue,\n\t\tscope: AclScope,\n\t): Promise<MutationResultList> {\n\t\tawait this.setupSystemVariables()\n\t\tconst err = () => {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn await acceptFieldVisitor(this.schema, entity, relation, {\n\t\t\tvisitManyHasManyOwning: ({ entity, relation }) => {\n\t\t\t\treturn this.junctionTableManager.connectJunction(this, entity, relation, thisPrimary, otherPrimary, {\n\t\t\t\t\towning: scope,\n\t\t\t\t\tinverse: 'nested',\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: ({ targetEntity, targetRelation }) => {\n\t\t\t\treturn this.junctionTableManager.connectJunction(this, targetEntity, targetRelation, otherPrimary, thisPrimary, {\n\t\t\t\t\towning: 'nested',\n\t\t\t\t\tinverse: scope,\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitColumn: err,\n\t\t\tvisitOneHasMany: err,\n\t\t\tvisitOneHasOneInverse: err,\n\t\t\tvisitOneHasOneOwning: err,\n\t\t\tvisitManyHasOne: err,\n\t\t})\n\t}\n\n\t/** See {@link connectJunction} for how `scope` maps onto the two sides. */\n\tpublic async disconnectJunction(\n\t\tentity: Model.Entity,\n\t\trelation: Model.ManyHasManyOwningRelation | Model.ManyHasManyInverseRelation,\n\t\tthisPrimary: Input.PrimaryValue,\n\t\totherPrimary: Input.PrimaryValue,\n\t\tscope: AclScope,\n\t): Promise<MutationResultList> {\n\t\tawait this.setupSystemVariables()\n\t\tconst err = () => {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn await acceptFieldVisitor(this.schema, entity, relation, {\n\t\t\tvisitManyHasManyOwning: ({ entity, relation }) => {\n\t\t\t\treturn this.junctionTableManager.disconnectJunction(this, entity, relation, thisPrimary, otherPrimary, {\n\t\t\t\t\towning: scope,\n\t\t\t\t\tinverse: 'nested',\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: ({ targetEntity, targetRelation }) => {\n\t\t\t\treturn this.junctionTableManager.disconnectJunction(this, targetEntity, targetRelation, otherPrimary, thisPrimary, {\n\t\t\t\t\towning: 'nested',\n\t\t\t\t\tinverse: scope,\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitColumn: err,\n\t\t\tvisitOneHasMany: err,\n\t\t\tvisitOneHasOneInverse: err,\n\t\t\tvisitOneHasOneOwning: err,\n\t\t\tvisitManyHasOne: err,\n\t\t})\n\t}\n\n\t/**\n\t * Fetches the primary values of entities currently in a has-many relation of the given owner.\n\t * Used by the declarative `set` operation to compute orphans. Respects ACL read predicates on the target entity.\n\t */\n\tpublic async fetchHasManyPrimaries(\n\t\tcontext: Model.OneHasManyContext | Model.ManyHasManyOwningContext | Model.ManyHasManyInverseContext,\n\t\townerPrimary: Input.PrimaryValue,\n\t): Promise<Input.PrimaryValue[]> {\n\t\tif (context.type === 'oneHasMany') {\n\t\t\tconst { targetEntity, targetRelation } = context\n\t\t\t// Compare the FK column directly: filtering through the back-reference relation would also apply\n\t\t\t// the owner's and the relation field's read predicates, unlike the many-has-many junction read.\n\t\t\tconst readPredicate = this.predicatesInjector.inject(targetEntity, {}, 'nested')\n\t\t\tconst path = this.pathFactory.create([])\n\t\t\tlet qb = SelectBuilder.create()\n\t\t\t\t.from(targetEntity.tableName, path.alias)\n\t\t\t\t.select([path.alias, targetEntity.primaryColumn], 'primary_')\n\t\t\t\t.where(cond => cond.compare([path.alias, targetRelation.joiningColumn.columnName], Operator.eq, ownerPrimary))\n\t\t\tif (Object.keys(readPredicate).length > 0) {\n\t\t\t\tqb = this.whereBuilder.build(qb, targetEntity, path, readPredicate)\n\t\t\t}\n\t\t\tconst rows = await qb.getResult(this.db)\n\t\t\treturn rows.map(it => it.primary_ as Input.PrimaryValue)\n\t\t}\n\n\t\t// many-has-many: read from the junction table via the owning side\n\t\tconst owningContext = context.type === 'manyHasManyOwning'\n\t\t\t? { entity: context.entity, relation: context.relation, ownerIsJoining: true }\n\t\t\t: { entity: context.targetEntity, relation: context.targetRelation, ownerIsJoining: false }\n\t\tconst targetEntity = context.targetEntity\n\t\tconst joiningTable = owningContext.relation.joiningTable\n\t\tconst ownerColumn = owningContext.ownerIsJoining ? joiningTable.joiningColumn.columnName : joiningTable.inverseJoiningColumn.columnName\n\t\tconst targetColumn = owningContext.ownerIsJoining ? joiningTable.inverseJoiningColumn.columnName : joiningTable.joiningColumn.columnName\n\n\t\t// Apply the target entity's ACL read predicate so that members the current role cannot read\n\t\t// are excluded from the orphan computation (left untouched), matching the oneHasMany behavior.\n\t\t// `inject` returns an empty where when there is no read predicate, in which case the junction\n\t\t// is read directly with no join, preserving the permissive/no-ACL query unchanged.\n\t\tconst readPredicate = this.predicatesInjector.inject(targetEntity, {}, 'nested')\n\t\tconst hasReadPredicate = Object.keys(readPredicate).length > 0\n\n\t\tlet qb = SelectBuilder.create()\n\t\t\t.from(joiningTable.tableName, 'junction_')\n\t\t\t.select(['junction_', targetColumn], 'primary_')\n\t\t\t.where(cond => cond.compare(['junction_', ownerColumn], Operator.eq, ownerPrimary))\n\n\t\tif (hasReadPredicate) {\n\t\t\tconst path = this.pathFactory.create([])\n\t\t\tqb = qb.join(\n\t\t\t\ttargetEntity.tableName,\n\t\t\t\tpath.alias,\n\t\t\t\tclause => clause.compareColumns(['junction_', targetColumn], Operator.eq, [path.alias, targetEntity.primaryColumn]),\n\t\t\t)\n\t\t\tqb = this.whereBuilder.build(qb, targetEntity, path, readPredicate)\n\t\t}\n\n\t\tconst rows = await qb.getResult(this.db)\n\t\treturn rows.map(it => it.primary_ as Input.PrimaryValue)\n\t}\n\n\tpublic async getPrimaryValue(\n\t\tentity: Model.Entity,\n\t\twhere: Input.UniqueWhere | CheckedPrimary,\n\t\tscope: AclScope,\n\t): Promise<[Input.PrimaryValue, undefined] | [undefined, MutationEntryNotFoundError]> {\n\t\tif (where instanceof CheckedPrimary) {\n\t\t\treturn [where.primaryValue, undefined]\n\t\t}\n\t\tconst result = await this.selectField(entity, where, entity.primary, scope)\n\t\treturn result ? [result, undefined] : [undefined, new MutationEntryNotFoundError([], where)]\n\t}\n\n\tprivate async setupSystemVariables() {\n\t\tthis.systemVariablesSetupDone ??= (async () => {\n\t\t\tawait this.db.query('SELECT set_config(?, ?, false)', ['tenant.identity_id', this.identityId]) // todo rename to system.identity_id\n\t\t\tawait this.db.query('SELECT set_config(?, ?, false)', ['system.transaction_id', this.transactionId])\n\t\t})()\n\t\tawait this.systemVariablesSetupDone\n\t}\n}\n"],"names":["DeletedEntitiesStorage","Mutex","ConstraintHelper","EventManager","getColumnName","SelectBuilder","SelectHydrator","OrderByHelper","aclScopeFromPath","ImplementationException","tryMutation","ROW_LOOKUP_SCOPE","acceptFieldVisitor","entity","relation","targetEntity","readPredicate","qb","Operator","rows","CheckedPrimary","MutationEntryNotFoundError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,OAAqF;AAAA,EAUjG,YACiB,IACA,YACA,eACC,QAC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