@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
|
@@ -0,0 +1,948 @@
|
|
|
1
|
+
import { test } from 'bun:test'
|
|
2
|
+
import { Acl } from '@contember/schema'
|
|
3
|
+
import { execute, failedTransaction, sqlTransaction } from '../../../../../src/test.js'
|
|
4
|
+
import { GQL, SQL } from '../../../../../src/tags.js'
|
|
5
|
+
import { testUuid } from '../../../../../src/testUuid.js'
|
|
6
|
+
import { postWithLocale, postWithNullableLocale } from './schema.js'
|
|
7
|
+
|
|
8
|
+
test('set with default orphanStrategy (disconnect)', async () => {
|
|
9
|
+
await execute({
|
|
10
|
+
schema: postWithNullableLocale,
|
|
11
|
+
query: GQL`mutation {
|
|
12
|
+
updatePost(
|
|
13
|
+
by: {id: "${testUuid(2)}"},
|
|
14
|
+
data: {locales: {set: [{connect: {id: "${testUuid(1)}"}}]}}
|
|
15
|
+
) {
|
|
16
|
+
ok
|
|
17
|
+
}
|
|
18
|
+
}`,
|
|
19
|
+
executes: [
|
|
20
|
+
...sqlTransaction([
|
|
21
|
+
{
|
|
22
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
23
|
+
parameters: [testUuid(2)],
|
|
24
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
25
|
+
},
|
|
26
|
+
// snapshot the members up front - orphans are members from *before* the operation
|
|
27
|
+
{
|
|
28
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
29
|
+
parameters: [testUuid(2)],
|
|
30
|
+
response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
|
|
31
|
+
},
|
|
32
|
+
// resolve the connect target primary
|
|
33
|
+
{
|
|
34
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
|
|
35
|
+
parameters: [testUuid(1)],
|
|
36
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
37
|
+
},
|
|
38
|
+
// orphan (id=3) is disconnected: resolve it
|
|
39
|
+
{
|
|
40
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
41
|
+
parameters: [testUuid(3), testUuid(2)],
|
|
42
|
+
response: { rows: [{ id: testUuid(3) }] },
|
|
43
|
+
},
|
|
44
|
+
// orphan (id=3) disconnected: set post_id to null
|
|
45
|
+
{
|
|
46
|
+
sql:
|
|
47
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
48
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
49
|
+
parameters: [null, testUuid(3)],
|
|
50
|
+
response: { rows: [{ post_id_old__: testUuid(2) }] },
|
|
51
|
+
},
|
|
52
|
+
// connect: point the target locale to the post
|
|
53
|
+
{
|
|
54
|
+
sql:
|
|
55
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
56
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
57
|
+
parameters: [testUuid(2), testUuid(1)],
|
|
58
|
+
response: { rows: [{ post_id_old__: testUuid(99) }] },
|
|
59
|
+
},
|
|
60
|
+
]),
|
|
61
|
+
],
|
|
62
|
+
return: {
|
|
63
|
+
data: {
|
|
64
|
+
updatePost: {
|
|
65
|
+
ok: true,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
test('set with orphanStrategy delete', async () => {
|
|
73
|
+
await execute({
|
|
74
|
+
schema: postWithNullableLocale,
|
|
75
|
+
query: GQL`mutation {
|
|
76
|
+
updatePost(
|
|
77
|
+
by: {id: "${testUuid(2)}"},
|
|
78
|
+
data: {locales: {orphanStrategy: delete, set: [{connect: {id: "${testUuid(1)}"}}]}}
|
|
79
|
+
) {
|
|
80
|
+
ok
|
|
81
|
+
}
|
|
82
|
+
}`,
|
|
83
|
+
executes: [
|
|
84
|
+
...sqlTransaction([
|
|
85
|
+
{
|
|
86
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
87
|
+
parameters: [testUuid(2)],
|
|
88
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
92
|
+
parameters: [testUuid(2)],
|
|
93
|
+
response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
|
|
97
|
+
parameters: [testUuid(1)],
|
|
98
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
99
|
+
},
|
|
100
|
+
// orphan (id=3) is deleted
|
|
101
|
+
{
|
|
102
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
103
|
+
parameters: [testUuid(3), testUuid(2)],
|
|
104
|
+
response: { rows: [{ id: testUuid(3) }] },
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
sql: SQL`select "root_"."id" as "id", true as "allowed" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
|
|
108
|
+
parameters: [testUuid(3)],
|
|
109
|
+
response: { rows: [{ id: testUuid(3), allowed: true }] },
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
sql: SQL`delete from "public"."post_locale" where "id" in (?)`,
|
|
113
|
+
parameters: [testUuid(3)],
|
|
114
|
+
response: { rows: [{ id: testUuid(3) }] },
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
sql:
|
|
118
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
119
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
120
|
+
parameters: [testUuid(2), testUuid(1)],
|
|
121
|
+
response: { rows: [{ post_id_old__: testUuid(99) }] },
|
|
122
|
+
},
|
|
123
|
+
]),
|
|
124
|
+
],
|
|
125
|
+
return: {
|
|
126
|
+
data: {
|
|
127
|
+
updatePost: {
|
|
128
|
+
ok: true,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
test('set without orphans (collection already matches)', async () => {
|
|
136
|
+
await execute({
|
|
137
|
+
schema: postWithNullableLocale,
|
|
138
|
+
query: GQL`mutation {
|
|
139
|
+
updatePost(
|
|
140
|
+
by: {id: "${testUuid(2)}"},
|
|
141
|
+
data: {locales: {set: [{connect: {id: "${testUuid(1)}"}}]}}
|
|
142
|
+
) {
|
|
143
|
+
ok
|
|
144
|
+
}
|
|
145
|
+
}`,
|
|
146
|
+
executes: [
|
|
147
|
+
...sqlTransaction([
|
|
148
|
+
{
|
|
149
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
150
|
+
parameters: [testUuid(2)],
|
|
151
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
152
|
+
},
|
|
153
|
+
// snapshot the members up front - orphans are members from *before* the operation
|
|
154
|
+
{
|
|
155
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
156
|
+
parameters: [testUuid(2)],
|
|
157
|
+
response: { rows: [{ primary_: testUuid(1) }] },
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
|
|
161
|
+
parameters: [testUuid(1)],
|
|
162
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
sql:
|
|
166
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
167
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
168
|
+
parameters: [testUuid(2), testUuid(1)],
|
|
169
|
+
response: { rows: [{ post_id_old__: testUuid(99) }] },
|
|
170
|
+
},
|
|
171
|
+
]),
|
|
172
|
+
],
|
|
173
|
+
return: {
|
|
174
|
+
data: {
|
|
175
|
+
updatePost: {
|
|
176
|
+
ok: true,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
test('set with a create item and an orphan disconnect', async () => {
|
|
184
|
+
await execute({
|
|
185
|
+
schema: postWithNullableLocale,
|
|
186
|
+
query: GQL`mutation {
|
|
187
|
+
updatePost(
|
|
188
|
+
by: {id: "${testUuid(2)}"},
|
|
189
|
+
data: {locales: {set: [{create: {locale: "cs", title: "cs"}}]}}
|
|
190
|
+
) {
|
|
191
|
+
ok
|
|
192
|
+
}
|
|
193
|
+
}`,
|
|
194
|
+
executes: [
|
|
195
|
+
...sqlTransaction([
|
|
196
|
+
{
|
|
197
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
198
|
+
parameters: [testUuid(2)],
|
|
199
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
200
|
+
},
|
|
201
|
+
// snapshot the members up front - orphans are members from *before* the operation
|
|
202
|
+
{
|
|
203
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
204
|
+
parameters: [testUuid(2)],
|
|
205
|
+
response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
|
|
206
|
+
},
|
|
207
|
+
// phase 2: a `create` item names no existing member, so both are orphans and go first
|
|
208
|
+
{
|
|
209
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
210
|
+
parameters: [testUuid(1), testUuid(2)],
|
|
211
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
sql:
|
|
215
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
216
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
217
|
+
parameters: [null, testUuid(1)],
|
|
218
|
+
response: { rows: [{ post_id_old__: testUuid(2) }] },
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
222
|
+
parameters: [testUuid(3), testUuid(2)],
|
|
223
|
+
response: { rows: [{ id: testUuid(3) }] },
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
sql:
|
|
227
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
228
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
229
|
+
parameters: [null, testUuid(3)],
|
|
230
|
+
response: { rows: [{ post_id_old__: testUuid(2) }] },
|
|
231
|
+
},
|
|
232
|
+
// phase 3: only now is the new locale inserted
|
|
233
|
+
{
|
|
234
|
+
sql:
|
|
235
|
+
SQL`with "root_" as (select ? :: uuid as "id", ? :: text as "title", ? :: text as "locale", ? :: uuid as "post_id") insert into "public"."post_locale" ("id", "title", "locale", "post_id") select "root_"."id", "root_"."title", "root_"."locale", "root_"."post_id" from "root_" returning "id"`,
|
|
236
|
+
parameters: [testUuid(1), 'cs', 'cs', testUuid(2)],
|
|
237
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
238
|
+
},
|
|
239
|
+
]),
|
|
240
|
+
],
|
|
241
|
+
return: {
|
|
242
|
+
data: {
|
|
243
|
+
updatePost: {
|
|
244
|
+
ok: true,
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
})
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
test('set must be the only item', async () => {
|
|
252
|
+
let error: unknown
|
|
253
|
+
try {
|
|
254
|
+
await execute({
|
|
255
|
+
schema: postWithNullableLocale,
|
|
256
|
+
query: GQL`mutation {
|
|
257
|
+
updatePost(
|
|
258
|
+
by: {id: "${testUuid(2)}"},
|
|
259
|
+
data: {locales: [{set: [{connect: {id: "${testUuid(1)}"}}]}, {connect: {id: "${testUuid(3)}"}}]}
|
|
260
|
+
) {
|
|
261
|
+
ok
|
|
262
|
+
}
|
|
263
|
+
}`,
|
|
264
|
+
executes: [
|
|
265
|
+
...sqlTransaction([]),
|
|
266
|
+
],
|
|
267
|
+
return: {},
|
|
268
|
+
})
|
|
269
|
+
} catch (e) {
|
|
270
|
+
error = e
|
|
271
|
+
}
|
|
272
|
+
if (!(error instanceof Error) || !error.message.includes('"set" operation must be the only item')) {
|
|
273
|
+
throw new Error(`Expected a "set must be the only item" error, got: ${String(error)}`)
|
|
274
|
+
}
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
test('set with an update item (updates an existing member, no orphans)', async () => {
|
|
278
|
+
await execute({
|
|
279
|
+
schema: postWithNullableLocale,
|
|
280
|
+
query: GQL`mutation {
|
|
281
|
+
updatePost(
|
|
282
|
+
by: {id: "${testUuid(2)}"},
|
|
283
|
+
data: {locales: {set: [{update: {by: {id: "${testUuid(1)}"}, data: {title: "Hello"}}}]}}
|
|
284
|
+
) {
|
|
285
|
+
ok
|
|
286
|
+
}
|
|
287
|
+
}`,
|
|
288
|
+
executes: [
|
|
289
|
+
...sqlTransaction([
|
|
290
|
+
{
|
|
291
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
292
|
+
parameters: [testUuid(2)],
|
|
293
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
294
|
+
},
|
|
295
|
+
// snapshot the members up front - orphans are members from *before* the operation
|
|
296
|
+
{
|
|
297
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
298
|
+
parameters: [testUuid(2)],
|
|
299
|
+
response: { rows: [{ primary_: testUuid(1) }] },
|
|
300
|
+
},
|
|
301
|
+
// phase 1 resolves the update target scoped to the owner, so a partial composite
|
|
302
|
+
// unique key would work here just as it does for a plain per-item update
|
|
303
|
+
{
|
|
304
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
305
|
+
parameters: [testUuid(1), testUuid(2)],
|
|
306
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
307
|
+
},
|
|
308
|
+
// no orphans - the only member is the one the input names
|
|
309
|
+
// phase 3: the update processor resolves it again, then updates
|
|
310
|
+
{
|
|
311
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
312
|
+
parameters: [testUuid(1), testUuid(2)],
|
|
313
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
sql:
|
|
317
|
+
SQL`with "newData_" as (select ? :: text as "title", "root_"."title" as "title_old__", "root_"."id", "root_"."locale", "root_"."post_id" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
318
|
+
update "public"."post_locale" set "title" = "newData_"."title" from "newData_" where "post_locale"."id" = "newData_"."id" returning "title_old__"`,
|
|
319
|
+
parameters: ['Hello', testUuid(1)],
|
|
320
|
+
response: { rows: [{ title_old__: 'Hi' }] },
|
|
321
|
+
},
|
|
322
|
+
]),
|
|
323
|
+
],
|
|
324
|
+
return: {
|
|
325
|
+
data: {
|
|
326
|
+
updatePost: {
|
|
327
|
+
ok: true,
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
})
|
|
332
|
+
})
|
|
333
|
+
|
|
334
|
+
test('set with a connectOrCreate item (existing target) and an orphan disconnect', async () => {
|
|
335
|
+
await execute({
|
|
336
|
+
schema: postWithNullableLocale,
|
|
337
|
+
query: GQL`mutation {
|
|
338
|
+
updatePost(
|
|
339
|
+
by: {id: "${testUuid(2)}"},
|
|
340
|
+
data: {locales: {set: [{connectOrCreate: {connect: {id: "${testUuid(1)}"}, create: {locale: "cs", title: "cs"}}}]}}
|
|
341
|
+
) {
|
|
342
|
+
ok
|
|
343
|
+
}
|
|
344
|
+
}`,
|
|
345
|
+
executes: [
|
|
346
|
+
...sqlTransaction([
|
|
347
|
+
{
|
|
348
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
349
|
+
parameters: [testUuid(2)],
|
|
350
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
351
|
+
},
|
|
352
|
+
// snapshot the members up front - orphans are members from *before* the operation
|
|
353
|
+
{
|
|
354
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
355
|
+
parameters: [testUuid(2)],
|
|
356
|
+
response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
|
|
357
|
+
},
|
|
358
|
+
// the set helper resolves the connectOrCreate target up-front to mark it desired
|
|
359
|
+
{
|
|
360
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
|
|
361
|
+
parameters: [testUuid(1)],
|
|
362
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
366
|
+
parameters: [testUuid(3), testUuid(2)],
|
|
367
|
+
response: { rows: [{ id: testUuid(3) }] },
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
sql:
|
|
371
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
372
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
373
|
+
parameters: [null, testUuid(3)],
|
|
374
|
+
response: { rows: [{ post_id_old__: testUuid(2) }] },
|
|
375
|
+
},
|
|
376
|
+
// connectOrCreate processor resolves the target again, finds it, and connects it
|
|
377
|
+
{
|
|
378
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
|
|
379
|
+
parameters: [testUuid(1)],
|
|
380
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
sql:
|
|
384
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
385
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
386
|
+
parameters: [testUuid(2), testUuid(1)],
|
|
387
|
+
response: { rows: [{ post_id_old__: testUuid(99) }] },
|
|
388
|
+
},
|
|
389
|
+
]),
|
|
390
|
+
],
|
|
391
|
+
return: {
|
|
392
|
+
data: {
|
|
393
|
+
updatePost: {
|
|
394
|
+
ok: true,
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
})
|
|
399
|
+
})
|
|
400
|
+
|
|
401
|
+
test('set with an upsert item that creates (target does not exist)', async () => {
|
|
402
|
+
await execute({
|
|
403
|
+
schema: postWithNullableLocale,
|
|
404
|
+
query: GQL`mutation {
|
|
405
|
+
updatePost(
|
|
406
|
+
by: {id: "${testUuid(2)}"},
|
|
407
|
+
data: {locales: {set: [{upsert: {by: {id: "${testUuid(1)}"}, update: {title: "upd"}, create: {locale: "cs", title: "cs"}}}]}}
|
|
408
|
+
) {
|
|
409
|
+
ok
|
|
410
|
+
}
|
|
411
|
+
}`,
|
|
412
|
+
executes: [
|
|
413
|
+
...sqlTransaction([
|
|
414
|
+
{
|
|
415
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
416
|
+
parameters: [testUuid(2)],
|
|
417
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
418
|
+
},
|
|
419
|
+
// snapshot the members up front - orphans are members from *before* the operation
|
|
420
|
+
{
|
|
421
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
422
|
+
parameters: [testUuid(2)],
|
|
423
|
+
response: { rows: [{ primary_: testUuid(3) }] },
|
|
424
|
+
},
|
|
425
|
+
// phase 1 resolves the upsert target within the collection - it is not there
|
|
426
|
+
{
|
|
427
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
428
|
+
parameters: [testUuid(1), testUuid(2)],
|
|
429
|
+
response: { rows: [] },
|
|
430
|
+
},
|
|
431
|
+
// phase 2: the member the input does not name is disconnected first
|
|
432
|
+
{
|
|
433
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
434
|
+
parameters: [testUuid(3), testUuid(2)],
|
|
435
|
+
response: { rows: [{ id: testUuid(3) }] },
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
sql:
|
|
439
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
440
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
441
|
+
parameters: [null, testUuid(3)],
|
|
442
|
+
response: { rows: [{ post_id_old__: testUuid(2) }] },
|
|
443
|
+
},
|
|
444
|
+
// phase 3: the upsert processor tries the update first, scoped to the owner - not found
|
|
445
|
+
{
|
|
446
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
447
|
+
parameters: [testUuid(1), testUuid(2)],
|
|
448
|
+
response: { rows: [] },
|
|
449
|
+
},
|
|
450
|
+
// falls back to insert
|
|
451
|
+
{
|
|
452
|
+
sql:
|
|
453
|
+
SQL`with "root_" as (select ? :: uuid as "id", ? :: text as "title", ? :: text as "locale", ? :: uuid as "post_id") insert into "public"."post_locale" ("id", "title", "locale", "post_id") select "root_"."id", "root_"."title", "root_"."locale", "root_"."post_id" from "root_" returning "id"`,
|
|
454
|
+
parameters: [testUuid(1), 'cs', 'cs', testUuid(2)],
|
|
455
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
456
|
+
},
|
|
457
|
+
]),
|
|
458
|
+
],
|
|
459
|
+
return: {
|
|
460
|
+
data: {
|
|
461
|
+
updatePost: {
|
|
462
|
+
ok: true,
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
})
|
|
467
|
+
})
|
|
468
|
+
|
|
469
|
+
test('set with orphanStrategy delete is rejected when delete is ACL-denied', async () => {
|
|
470
|
+
await execute({
|
|
471
|
+
schema: postWithNullableLocale,
|
|
472
|
+
query: GQL`mutation {
|
|
473
|
+
updatePost(
|
|
474
|
+
by: {id: "${testUuid(2)}"},
|
|
475
|
+
data: {locales: {orphanStrategy: delete, set: [{connect: {id: "${testUuid(1)}"}}]}}
|
|
476
|
+
) {
|
|
477
|
+
ok
|
|
478
|
+
}
|
|
479
|
+
}`,
|
|
480
|
+
executes: [
|
|
481
|
+
...failedTransaction([
|
|
482
|
+
{
|
|
483
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
484
|
+
parameters: [testUuid(2)],
|
|
485
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
489
|
+
parameters: [testUuid(2)],
|
|
490
|
+
response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
|
|
494
|
+
parameters: [testUuid(1)],
|
|
495
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
496
|
+
},
|
|
497
|
+
// orphan (id=3): delete is attempted, but the ACL predicate denies it
|
|
498
|
+
{
|
|
499
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
500
|
+
parameters: [testUuid(3), testUuid(2)],
|
|
501
|
+
response: { rows: [{ id: testUuid(3) }] },
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
sql: SQL`select "root_"."id" as "id", true as "allowed" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
|
|
505
|
+
parameters: [testUuid(3)],
|
|
506
|
+
response: { rows: [{ id: testUuid(3), allowed: false }] },
|
|
507
|
+
},
|
|
508
|
+
]),
|
|
509
|
+
],
|
|
510
|
+
return: {
|
|
511
|
+
data: {
|
|
512
|
+
updatePost: {
|
|
513
|
+
ok: false,
|
|
514
|
+
},
|
|
515
|
+
},
|
|
516
|
+
},
|
|
517
|
+
})
|
|
518
|
+
})
|
|
519
|
+
|
|
520
|
+
test('empty set clears the whole collection (disconnect)', async () => {
|
|
521
|
+
await execute({
|
|
522
|
+
schema: postWithNullableLocale,
|
|
523
|
+
query: GQL`mutation {
|
|
524
|
+
updatePost(
|
|
525
|
+
by: {id: "${testUuid(2)}"},
|
|
526
|
+
data: {locales: {set: []}}
|
|
527
|
+
) {
|
|
528
|
+
ok
|
|
529
|
+
}
|
|
530
|
+
}`,
|
|
531
|
+
executes: [
|
|
532
|
+
...sqlTransaction([
|
|
533
|
+
{
|
|
534
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
535
|
+
parameters: [testUuid(2)],
|
|
536
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
537
|
+
},
|
|
538
|
+
// no desired members - every current member is an orphan
|
|
539
|
+
{
|
|
540
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
541
|
+
parameters: [testUuid(2)],
|
|
542
|
+
response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
|
|
543
|
+
},
|
|
544
|
+
// orphan (id=1) disconnected
|
|
545
|
+
{
|
|
546
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
547
|
+
parameters: [testUuid(1), testUuid(2)],
|
|
548
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
sql:
|
|
552
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
553
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
554
|
+
parameters: [null, testUuid(1)],
|
|
555
|
+
response: { rows: [{ post_id_old__: testUuid(2) }] },
|
|
556
|
+
},
|
|
557
|
+
// orphan (id=3) disconnected
|
|
558
|
+
{
|
|
559
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
560
|
+
parameters: [testUuid(3), testUuid(2)],
|
|
561
|
+
response: { rows: [{ id: testUuid(3) }] },
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
sql:
|
|
565
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
566
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
567
|
+
parameters: [null, testUuid(3)],
|
|
568
|
+
response: { rows: [{ post_id_old__: testUuid(2) }] },
|
|
569
|
+
},
|
|
570
|
+
]),
|
|
571
|
+
],
|
|
572
|
+
return: {
|
|
573
|
+
data: {
|
|
574
|
+
updatePost: {
|
|
575
|
+
ok: true,
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
})
|
|
580
|
+
})
|
|
581
|
+
|
|
582
|
+
// An upsert whose `by` names a record outside the collection falls back to an insert. Phase 1
|
|
583
|
+
// resolves `by` within the collection, so it marks nothing, and the record the insert creates
|
|
584
|
+
// cannot be an orphan - it did not exist when the snapshot was taken.
|
|
585
|
+
test('set with an upsert item whose "by" matches a record outside the collection', async () => {
|
|
586
|
+
await execute({
|
|
587
|
+
schema: postWithNullableLocale,
|
|
588
|
+
query: GQL`mutation {
|
|
589
|
+
updatePost(
|
|
590
|
+
by: {id: "${testUuid(2)}"},
|
|
591
|
+
data: {locales: {set: [{upsert: {by: {id: "${testUuid(10)}"}, update: {title: "upd"}, create: {locale: "cs", title: "cs"}}}]}}
|
|
592
|
+
) {
|
|
593
|
+
ok
|
|
594
|
+
}
|
|
595
|
+
}`,
|
|
596
|
+
executes: [
|
|
597
|
+
...sqlTransaction([
|
|
598
|
+
{
|
|
599
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
600
|
+
parameters: [testUuid(2)],
|
|
601
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
602
|
+
},
|
|
603
|
+
// snapshot the members up front - orphans are members from *before* the operation
|
|
604
|
+
{
|
|
605
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
606
|
+
parameters: [testUuid(2)],
|
|
607
|
+
response: { rows: [{ primary_: testUuid(3) }] },
|
|
608
|
+
},
|
|
609
|
+
// phase 1 resolves `by` within the collection - not there, so nothing is marked
|
|
610
|
+
{
|
|
611
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
612
|
+
parameters: [testUuid(10), testUuid(2)],
|
|
613
|
+
response: { rows: [] },
|
|
614
|
+
},
|
|
615
|
+
// phase 2: only the pre-existing member (id=3) is orphaned
|
|
616
|
+
{
|
|
617
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
618
|
+
parameters: [testUuid(3), testUuid(2)],
|
|
619
|
+
response: { rows: [{ id: testUuid(3) }] },
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
sql:
|
|
623
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
624
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
625
|
+
parameters: [null, testUuid(3)],
|
|
626
|
+
response: { rows: [{ post_id_old__: testUuid(2) }] },
|
|
627
|
+
},
|
|
628
|
+
// phase 3: the upsert processor tries its own scoped update first - not found
|
|
629
|
+
{
|
|
630
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
631
|
+
parameters: [testUuid(10), testUuid(2)],
|
|
632
|
+
response: { rows: [] },
|
|
633
|
+
},
|
|
634
|
+
// falls back to insert; the new record survives the operation
|
|
635
|
+
{
|
|
636
|
+
sql:
|
|
637
|
+
SQL`with "root_" as (select ? :: uuid as "id", ? :: text as "title", ? :: text as "locale", ? :: uuid as "post_id") insert into "public"."post_locale" ("id", "title", "locale", "post_id") select "root_"."id", "root_"."title", "root_"."locale", "root_"."post_id" from "root_" returning "id"`,
|
|
638
|
+
parameters: [testUuid(1), 'cs', 'cs', testUuid(2)],
|
|
639
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
640
|
+
},
|
|
641
|
+
]),
|
|
642
|
+
],
|
|
643
|
+
return: {
|
|
644
|
+
data: {
|
|
645
|
+
updatePost: {
|
|
646
|
+
ok: true,
|
|
647
|
+
},
|
|
648
|
+
},
|
|
649
|
+
},
|
|
650
|
+
})
|
|
651
|
+
})
|
|
652
|
+
|
|
653
|
+
// The relation input type exposes `alias` next to `set`, so it must be accepted (and ignored)
|
|
654
|
+
// rather than rejected as an unexpected key.
|
|
655
|
+
test('set accepts an alias on the relation input', async () => {
|
|
656
|
+
await execute({
|
|
657
|
+
schema: postWithNullableLocale,
|
|
658
|
+
query: GQL`mutation {
|
|
659
|
+
updatePost(
|
|
660
|
+
by: {id: "${testUuid(2)}"},
|
|
661
|
+
data: {locales: {alias: "myAlias", set: [{connect: {id: "${testUuid(1)}"}}]}}
|
|
662
|
+
) {
|
|
663
|
+
ok
|
|
664
|
+
}
|
|
665
|
+
}`,
|
|
666
|
+
executes: [
|
|
667
|
+
...sqlTransaction([
|
|
668
|
+
{
|
|
669
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
670
|
+
parameters: [testUuid(2)],
|
|
671
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
675
|
+
parameters: [testUuid(2)],
|
|
676
|
+
response: { rows: [{ primary_: testUuid(1) }] },
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
|
|
680
|
+
parameters: [testUuid(1)],
|
|
681
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
sql:
|
|
685
|
+
SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
686
|
+
update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
|
|
687
|
+
parameters: [testUuid(2), testUuid(1)],
|
|
688
|
+
response: { rows: [{ post_id_old__: testUuid(2) }] },
|
|
689
|
+
},
|
|
690
|
+
]),
|
|
691
|
+
],
|
|
692
|
+
return: {
|
|
693
|
+
data: {
|
|
694
|
+
updatePost: {
|
|
695
|
+
ok: true,
|
|
696
|
+
},
|
|
697
|
+
},
|
|
698
|
+
},
|
|
699
|
+
})
|
|
700
|
+
})
|
|
701
|
+
|
|
702
|
+
// A not-null owning relation has nowhere to put the null, so the default `disconnect` strategy
|
|
703
|
+
// cannot remove an orphan. The engine reports it instead of emitting a doomed UPDATE.
|
|
704
|
+
test('set with the default orphanStrategy fails on a not-null owning relation', async () => {
|
|
705
|
+
await execute({
|
|
706
|
+
schema: postWithLocale,
|
|
707
|
+
query: GQL`mutation {
|
|
708
|
+
updatePost(
|
|
709
|
+
by: {id: "${testUuid(2)}"},
|
|
710
|
+
data: {locales: {set: [{connect: {id: "${testUuid(1)}"}}]}}
|
|
711
|
+
) {
|
|
712
|
+
ok
|
|
713
|
+
errors {
|
|
714
|
+
type
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}`,
|
|
718
|
+
executes: [
|
|
719
|
+
...failedTransaction([
|
|
720
|
+
{
|
|
721
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
722
|
+
parameters: [testUuid(2)],
|
|
723
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
724
|
+
},
|
|
725
|
+
// snapshot the members up front - orphans are members from *before* the operation
|
|
726
|
+
{
|
|
727
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
728
|
+
parameters: [testUuid(2)],
|
|
729
|
+
response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
|
|
733
|
+
parameters: [testUuid(1)],
|
|
734
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
735
|
+
},
|
|
736
|
+
// orphan (id=3): resolved, but there is no way to detach it
|
|
737
|
+
{
|
|
738
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
|
|
739
|
+
parameters: [testUuid(3), testUuid(2)],
|
|
740
|
+
response: { rows: [{ id: testUuid(3) }] },
|
|
741
|
+
},
|
|
742
|
+
]),
|
|
743
|
+
],
|
|
744
|
+
return: {
|
|
745
|
+
data: {
|
|
746
|
+
updatePost: {
|
|
747
|
+
ok: false,
|
|
748
|
+
errors: [{ type: 'NotNullConstraintViolation' }],
|
|
749
|
+
},
|
|
750
|
+
},
|
|
751
|
+
},
|
|
752
|
+
})
|
|
753
|
+
})
|
|
754
|
+
|
|
755
|
+
// Nullable GraphQL variables mean an operation key can arrive as an explicit null. The per-item
|
|
756
|
+
// path strips those before dispatching; `set` items have to behave the same, or the null key
|
|
757
|
+
// picks its branch and the mutation dies with an internal error.
|
|
758
|
+
test('set strips null-valued operation keys from an item', async () => {
|
|
759
|
+
await execute({
|
|
760
|
+
schema: postWithNullableLocale,
|
|
761
|
+
query: GQL`mutation {
|
|
762
|
+
updatePost(
|
|
763
|
+
by: {id: "${testUuid(2)}"},
|
|
764
|
+
data: {locales: {set: [{connect: null, create: {locale: "cs", title: "cs"}}]}}
|
|
765
|
+
) {
|
|
766
|
+
ok
|
|
767
|
+
}
|
|
768
|
+
}`,
|
|
769
|
+
executes: [
|
|
770
|
+
...sqlTransaction([
|
|
771
|
+
{
|
|
772
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
773
|
+
parameters: [testUuid(2)],
|
|
774
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
778
|
+
parameters: [testUuid(2)],
|
|
779
|
+
response: { rows: [] },
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
sql:
|
|
783
|
+
SQL`with "root_" as (select ? :: uuid as "id", ? :: text as "title", ? :: text as "locale", ? :: uuid as "post_id") insert into "public"."post_locale" ("id", "title", "locale", "post_id") select "root_"."id", "root_"."title", "root_"."locale", "root_"."post_id" from "root_" returning "id"`,
|
|
784
|
+
parameters: [testUuid(1), 'cs', 'cs', testUuid(2)],
|
|
785
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
786
|
+
},
|
|
787
|
+
]),
|
|
788
|
+
],
|
|
789
|
+
return: {
|
|
790
|
+
data: {
|
|
791
|
+
updatePost: {
|
|
792
|
+
ok: true,
|
|
793
|
+
},
|
|
794
|
+
},
|
|
795
|
+
},
|
|
796
|
+
})
|
|
797
|
+
})
|
|
798
|
+
|
|
799
|
+
// `set: null` is schema-valid (the field is a nullable list). It must be rejected with a user error
|
|
800
|
+
// rather than routed into the set path, where it would clear the collection.
|
|
801
|
+
test('set: null is rejected as a missing operation', async () => {
|
|
802
|
+
let error: unknown
|
|
803
|
+
try {
|
|
804
|
+
await execute({
|
|
805
|
+
schema: postWithNullableLocale,
|
|
806
|
+
query: GQL`mutation {
|
|
807
|
+
updatePost(
|
|
808
|
+
by: {id: "${testUuid(2)}"},
|
|
809
|
+
data: {locales: {set: null}}
|
|
810
|
+
) {
|
|
811
|
+
ok
|
|
812
|
+
}
|
|
813
|
+
}`,
|
|
814
|
+
executes: [
|
|
815
|
+
...sqlTransaction([
|
|
816
|
+
{
|
|
817
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
818
|
+
parameters: [testUuid(2)],
|
|
819
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
820
|
+
},
|
|
821
|
+
]),
|
|
822
|
+
],
|
|
823
|
+
return: {},
|
|
824
|
+
})
|
|
825
|
+
} catch (e) {
|
|
826
|
+
error = e
|
|
827
|
+
}
|
|
828
|
+
if (!(error instanceof Error) || !error.message.includes('Expected exactly one of')) {
|
|
829
|
+
throw new Error(`Expected a user error about a missing operation, got: ${String(error)}`)
|
|
830
|
+
}
|
|
831
|
+
})
|
|
832
|
+
|
|
833
|
+
// The owner scope is what lets a partial composite unique key address a member, so phase 1 has to
|
|
834
|
+
// resolve `update.by` the same way the processor does - a global lookup would reject `{locale}`
|
|
835
|
+
// as non-unique on an entity whose unique key is (locale, post).
|
|
836
|
+
test('set resolves a partial composite unique `by` within the collection', async () => {
|
|
837
|
+
await execute({
|
|
838
|
+
schema: postWithNullableLocale,
|
|
839
|
+
query: GQL`mutation {
|
|
840
|
+
updatePost(
|
|
841
|
+
by: {id: "${testUuid(2)}"},
|
|
842
|
+
data: {locales: {set: [{update: {by: {locale: "cs"}, data: {title: "Hello"}}}]}}
|
|
843
|
+
) {
|
|
844
|
+
ok
|
|
845
|
+
}
|
|
846
|
+
}`,
|
|
847
|
+
executes: [
|
|
848
|
+
...sqlTransaction([
|
|
849
|
+
{
|
|
850
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
851
|
+
parameters: [testUuid(2)],
|
|
852
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
|
|
856
|
+
parameters: [testUuid(2)],
|
|
857
|
+
response: { rows: [{ primary_: testUuid(1) }] },
|
|
858
|
+
},
|
|
859
|
+
// phase 1: `{locale: "cs"}` alone is only unique once the owner completes it
|
|
860
|
+
{
|
|
861
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."locale" = ? and "root_"."post_id" = ?`,
|
|
862
|
+
parameters: ['cs', testUuid(2)],
|
|
863
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
864
|
+
},
|
|
865
|
+
// phase 3: the update processor resolves it again, then updates
|
|
866
|
+
{
|
|
867
|
+
sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."locale" = ? and "root_"."post_id" = ?`,
|
|
868
|
+
parameters: ['cs', testUuid(2)],
|
|
869
|
+
response: { rows: [{ id: testUuid(1) }] },
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
sql:
|
|
873
|
+
SQL`with "newData_" as (select ? :: text as "title", "root_"."title" as "title_old__", "root_"."id", "root_"."locale", "root_"."post_id" from "public"."post_locale" as "root_" where "root_"."id" = ?)
|
|
874
|
+
update "public"."post_locale" set "title" = "newData_"."title" from "newData_" where "post_locale"."id" = "newData_"."id" returning "title_old__"`,
|
|
875
|
+
parameters: ['Hello', testUuid(1)],
|
|
876
|
+
response: { rows: [{ title_old__: 'Hi' }] },
|
|
877
|
+
},
|
|
878
|
+
]),
|
|
879
|
+
],
|
|
880
|
+
return: {
|
|
881
|
+
data: {
|
|
882
|
+
updatePost: {
|
|
883
|
+
ok: true,
|
|
884
|
+
},
|
|
885
|
+
},
|
|
886
|
+
},
|
|
887
|
+
})
|
|
888
|
+
})
|
|
889
|
+
|
|
890
|
+
// Orphans are found by the FK column and the target's read predicate only, like the many-has-many
|
|
891
|
+
// junction read. The owner's read predicate must not hide members from the diff.
|
|
892
|
+
const restrictedReadPermissions: Acl.Permissions = {
|
|
893
|
+
Post: {
|
|
894
|
+
predicates: {
|
|
895
|
+
post_read_predicate: { id: { eq: testUuid(2) } },
|
|
896
|
+
},
|
|
897
|
+
operations: {
|
|
898
|
+
read: { id: 'post_read_predicate' },
|
|
899
|
+
update: { id: true, locales: true },
|
|
900
|
+
},
|
|
901
|
+
},
|
|
902
|
+
PostLocale: {
|
|
903
|
+
predicates: {
|
|
904
|
+
locale_read_predicate: { locale: { eq: 'cs' } },
|
|
905
|
+
},
|
|
906
|
+
operations: {
|
|
907
|
+
read: { id: 'locale_read_predicate', post: true, locale: 'locale_read_predicate' },
|
|
908
|
+
update: { post: true },
|
|
909
|
+
},
|
|
910
|
+
},
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
test('set applies only the target read predicate when computing orphans', async () => {
|
|
914
|
+
await execute({
|
|
915
|
+
schema: postWithNullableLocale,
|
|
916
|
+
permissions: restrictedReadPermissions,
|
|
917
|
+
variables: {},
|
|
918
|
+
query: GQL`mutation {
|
|
919
|
+
updatePost(
|
|
920
|
+
by: {id: "${testUuid(2)}"},
|
|
921
|
+
data: {locales: {set: []}}
|
|
922
|
+
) {
|
|
923
|
+
ok
|
|
924
|
+
}
|
|
925
|
+
}`,
|
|
926
|
+
executes: [
|
|
927
|
+
...sqlTransaction([
|
|
928
|
+
{
|
|
929
|
+
sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
|
|
930
|
+
parameters: [testUuid(2)],
|
|
931
|
+
response: { rows: [{ id: testUuid(2) }] },
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ? and "root_"."locale" = ?`,
|
|
935
|
+
parameters: [testUuid(2), 'cs'],
|
|
936
|
+
response: { rows: [] },
|
|
937
|
+
},
|
|
938
|
+
]),
|
|
939
|
+
],
|
|
940
|
+
return: {
|
|
941
|
+
data: {
|
|
942
|
+
updatePost: {
|
|
943
|
+
ok: true,
|
|
944
|
+
},
|
|
945
|
+
},
|
|
946
|
+
},
|
|
947
|
+
})
|
|
948
|
+
})
|