@contember/engine-content-api 2.1.0-beta.2 → 2.2.0-alpha.2
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/dist/development/src/ExecutionContainer.cjs.map +1 -1
- package/dist/development/src/ExecutionContainer.js.map +1 -1
- package/dist/development/src/acl/EvaluatedPredicateReplacer.cjs.map +1 -1
- package/dist/development/src/acl/EvaluatedPredicateReplacer.js.map +1 -1
- package/dist/development/src/acl/PermissionFactory.cjs.map +1 -1
- package/dist/development/src/acl/PermissionFactory.js.map +1 -1
- package/dist/development/src/acl/PredicateFactory.cjs.map +1 -1
- package/dist/development/src/acl/PredicateFactory.js.map +1 -1
- package/dist/development/src/acl/PredicatesInjector.cjs.map +1 -1
- package/dist/development/src/acl/PredicatesInjector.js.map +1 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.cjs.map +1 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.js.map +1 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs.map +1 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js.map +1 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.cjs.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.js.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.cjs.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.js.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.cjs.map +1 -1
- package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.js.map +1 -1
- package/dist/development/src/input-validation/EntityRulesResolver.cjs.map +1 -1
- package/dist/development/src/input-validation/EntityRulesResolver.js.map +1 -1
- package/dist/development/src/input-validation/JsonSchemaValidator.cjs +208 -0
- package/dist/development/src/input-validation/JsonSchemaValidator.cjs.map +1 -0
- package/dist/development/src/input-validation/JsonSchemaValidator.js +208 -0
- package/dist/development/src/input-validation/JsonSchemaValidator.js.map +1 -0
- package/dist/development/src/input-validation/QueryAstFactory.cjs.map +1 -1
- package/dist/development/src/input-validation/QueryAstFactory.js.map +1 -1
- package/dist/development/src/input-validation/ValidationContext.cjs.map +1 -1
- package/dist/development/src/input-validation/ValidationContext.js.map +1 -1
- package/dist/development/src/input-validation/ValidationDataSelector.cjs.map +1 -1
- package/dist/development/src/input-validation/ValidationDataSelector.js.map +1 -1
- package/dist/development/src/input-validation/ValidationEvaluation.cjs.map +1 -1
- package/dist/development/src/input-validation/ValidationEvaluation.js.map +1 -1
- package/dist/development/src/input-validation/dependencies/DependencyCollector.cjs.map +1 -1
- package/dist/development/src/input-validation/dependencies/DependencyCollector.js.map +1 -1
- package/dist/development/src/input-validation/dependencies/DependencyMerger.cjs.map +1 -1
- package/dist/development/src/input-validation/dependencies/DependencyMerger.js.map +1 -1
- package/dist/development/src/input-validation/preValidation/CreateInputPreValidationProcessor.cjs.map +1 -1
- package/dist/development/src/input-validation/preValidation/CreateInputPreValidationProcessor.js.map +1 -1
- package/dist/development/src/input-validation/preValidation/InputPreValidator.cjs +38 -2
- package/dist/development/src/input-validation/preValidation/InputPreValidator.cjs.map +1 -1
- package/dist/development/src/input-validation/preValidation/InputPreValidator.js +38 -2
- package/dist/development/src/input-validation/preValidation/InputPreValidator.js.map +1 -1
- package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs.map +1 -1
- package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js.map +1 -1
- package/dist/development/src/inputProcessing/CreateInputVisitor.cjs.map +1 -1
- package/dist/development/src/inputProcessing/CreateInputVisitor.js.map +1 -1
- package/dist/development/src/inputProcessing/ObjectNode.cjs.map +1 -1
- package/dist/development/src/inputProcessing/ObjectNode.js.map +1 -1
- package/dist/development/src/inputProcessing/UniqueWhereExpander.cjs.map +1 -1
- package/dist/development/src/inputProcessing/UniqueWhereExpander.js.map +1 -1
- package/dist/development/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
- package/dist/development/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
- package/dist/development/src/introspection/IntrospectionSchemaDefinitionFactory.cjs.map +1 -1
- package/dist/development/src/introspection/IntrospectionSchemaDefinitionFactory.js.map +1 -1
- package/dist/development/src/introspection/IntrospectionSchemaFactory.cjs.map +1 -1
- package/dist/development/src/introspection/IntrospectionSchemaFactory.js.map +1 -1
- package/dist/development/src/mapper/ErrorUtils.cjs.map +1 -1
- package/dist/development/src/mapper/ErrorUtils.js.map +1 -1
- package/dist/development/src/mapper/EventManager.cjs.map +1 -1
- package/dist/development/src/mapper/EventManager.js.map +1 -1
- package/dist/development/src/mapper/JunctionTableManager.cjs.map +1 -1
- package/dist/development/src/mapper/JunctionTableManager.js.map +1 -1
- package/dist/development/src/mapper/Mapper.cjs.map +1 -1
- package/dist/development/src/mapper/Mapper.js.map +1 -1
- package/dist/development/src/mapper/MapperFactory.cjs.map +1 -1
- package/dist/development/src/mapper/MapperFactory.js.map +1 -1
- package/dist/development/src/mapper/MutationProcessorHelper.cjs.map +1 -1
- package/dist/development/src/mapper/MutationProcessorHelper.js.map +1 -1
- package/dist/development/src/mapper/Result.cjs.map +1 -1
- package/dist/development/src/mapper/Result.js.map +1 -1
- package/dist/development/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
- package/dist/development/src/mapper/delete/DeleteExecutor.js.map +1 -1
- package/dist/development/src/mapper/delete/DeleteState.cjs.map +1 -1
- package/dist/development/src/mapper/delete/DeleteState.js.map +1 -1
- package/dist/development/src/mapper/insert/InsertBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/insert/InsertBuilder.js.map +1 -1
- package/dist/development/src/mapper/insert/InsertBuilderFactory.cjs.map +1 -1
- package/dist/development/src/mapper/insert/InsertBuilderFactory.js.map +1 -1
- package/dist/development/src/mapper/insert/Inserter.cjs.map +1 -1
- package/dist/development/src/mapper/insert/Inserter.js.map +1 -1
- package/dist/development/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/select/ConditionBuilder.cjs +2 -0
- package/dist/development/src/mapper/select/ConditionBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/ConditionBuilder.js +2 -0
- package/dist/development/src/mapper/select/ConditionBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/JoinBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/JoinBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/JoinVisitor.cjs.map +1 -1
- package/dist/development/src/mapper/select/JoinVisitor.js.map +1 -1
- package/dist/development/src/mapper/select/OrderByBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/OrderByBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/OrderByHelper.cjs.map +1 -1
- package/dist/development/src/mapper/select/OrderByHelper.js.map +1 -1
- package/dist/development/src/mapper/select/RelationFetcher.cjs.map +1 -1
- package/dist/development/src/mapper/select/RelationFetcher.js.map +1 -1
- package/dist/development/src/mapper/select/SelectBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/SelectBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/SelectHydrator.cjs.map +1 -1
- package/dist/development/src/mapper/select/SelectHydrator.js.map +1 -1
- package/dist/development/src/mapper/select/WhereBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/WhereBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs +9 -1
- package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
- package/dist/development/src/mapper/select/handlers/FieldsVisitor.js +9 -1
- package/dist/development/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
- package/dist/development/src/mapper/select/handlers/FieldsVisitorFactory.cjs.map +1 -1
- package/dist/development/src/mapper/select/handlers/FieldsVisitorFactory.js.map +1 -1
- package/dist/development/src/mapper/select/handlers/MetaHandler.cjs.map +1 -1
- package/dist/development/src/mapper/select/handlers/MetaHandler.js.map +1 -1
- package/dist/development/src/mapper/select/optimizer/ConditionOptimizer.cjs.map +1 -1
- package/dist/development/src/mapper/select/optimizer/ConditionOptimizer.js.map +1 -1
- package/dist/development/src/mapper/select/optimizer/WhereOptimizer.cjs.map +1 -1
- package/dist/development/src/mapper/select/optimizer/WhereOptimizer.js.map +1 -1
- package/dist/development/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/UpdateBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/update/UpdateBuilder.js.map +1 -1
- package/dist/development/src/mapper/update/UpdateBuilderFactory.cjs.map +1 -1
- package/dist/development/src/mapper/update/UpdateBuilderFactory.js.map +1 -1
- package/dist/development/src/mapper/update/Updater.cjs.map +1 -1
- package/dist/development/src/mapper/update/Updater.js.map +1 -1
- package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -1
- 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.map +1 -1
- package/dist/development/src/resolvers/MutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/ReadHelpers.cjs.map +1 -1
- package/dist/development/src/resolvers/ReadHelpers.js.map +1 -1
- package/dist/development/src/resolvers/ReadResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/ReadResolver.js.map +1 -1
- package/dist/development/src/resolvers/RefreshViewResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/RefreshViewResolver.js.map +1 -1
- package/dist/development/src/resolvers/ValidationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/ValidationResolver.js.map +1 -1
- package/dist/development/src/schema/ColumnTypeResolver.cjs +2 -0
- package/dist/development/src/schema/ColumnTypeResolver.cjs.map +1 -1
- package/dist/development/src/schema/ColumnTypeResolver.js +2 -0
- package/dist/development/src/schema/ColumnTypeResolver.js.map +1 -1
- package/dist/development/src/schema/ConditionTypeProvider.cjs +2 -0
- package/dist/development/src/schema/ConditionTypeProvider.cjs.map +1 -1
- package/dist/development/src/schema/ConditionTypeProvider.js +2 -0
- package/dist/development/src/schema/ConditionTypeProvider.js.map +1 -1
- package/dist/development/src/schema/CustomTypesProvider.cjs +32 -0
- package/dist/development/src/schema/CustomTypesProvider.cjs.map +1 -1
- package/dist/development/src/schema/CustomTypesProvider.js +32 -0
- package/dist/development/src/schema/CustomTypesProvider.js.map +1 -1
- package/dist/development/src/schema/EntityTypeProvider.cjs.map +1 -1
- package/dist/development/src/schema/EntityTypeProvider.js.map +1 -1
- package/dist/development/src/schema/EnumsProvider.cjs.map +1 -1
- package/dist/development/src/schema/EnumsProvider.js.map +1 -1
- package/dist/development/src/schema/FieldAccessVisitor.cjs.map +1 -1
- package/dist/development/src/schema/FieldAccessVisitor.js.map +1 -1
- package/dist/development/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
- package/dist/development/src/schema/GraphQlSchemaBuilder.js.map +1 -1
- package/dist/development/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
- package/dist/development/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
- package/dist/development/src/schema/MutationProvider.cjs.map +1 -1
- package/dist/development/src/schema/MutationProvider.js.map +1 -1
- package/dist/development/src/schema/OperationExtension.cjs.map +1 -1
- package/dist/development/src/schema/OperationExtension.js.map +1 -1
- package/dist/development/src/schema/OrderByTypeProvider.cjs.map +1 -1
- package/dist/development/src/schema/OrderByTypeProvider.js.map +1 -1
- package/dist/development/src/schema/PaginatedFieldConfigFactory.cjs.map +1 -1
- package/dist/development/src/schema/PaginatedFieldConfigFactory.js.map +1 -1
- package/dist/development/src/schema/QueryProvider.cjs.map +1 -1
- package/dist/development/src/schema/QueryProvider.js.map +1 -1
- package/dist/development/src/schema/RefreshViewMutationProvider.cjs.map +1 -1
- package/dist/development/src/schema/RefreshViewMutationProvider.js.map +1 -1
- package/dist/development/src/schema/ValidationQueriesProvider.cjs.map +1 -1
- package/dist/development/src/schema/ValidationQueriesProvider.js.map +1 -1
- package/dist/development/src/schema/WhereTypeProvider.cjs.map +1 -1
- package/dist/development/src/schema/WhereTypeProvider.js.map +1 -1
- package/dist/development/src/schema/entities/FieldArgsVisitor.cjs.map +1 -1
- package/dist/development/src/schema/entities/FieldArgsVisitor.js.map +1 -1
- package/dist/development/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
- package/dist/development/src/schema/entities/FieldTypeVisitor.js.map +1 -1
- package/dist/development/src/schema/mutations/ConnectOrCreateRelationInputProvider.cjs.map +1 -1
- package/dist/development/src/schema/mutations/ConnectOrCreateRelationInputProvider.js.map +1 -1
- package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
- package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
- package/dist/development/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
- package/dist/development/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.js.map +1 -1
- package/dist/development/src/schema/mutations/CreateEntityRelationInputFieldVisitor.cjs.map +1 -1
- package/dist/development/src/schema/mutations/CreateEntityRelationInputFieldVisitor.js.map +1 -1
- package/dist/development/src/schema/mutations/CreateEntityRelationInputProvider.cjs.map +1 -1
- package/dist/development/src/schema/mutations/CreateEntityRelationInputProvider.js.map +1 -1
- package/dist/development/src/schema/mutations/EntityInputProvider.cjs.map +1 -1
- package/dist/development/src/schema/mutations/EntityInputProvider.js.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.js.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityRelationInputProvider.cjs.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityRelationInputProvider.js.map +1 -1
- package/dist/development/src/schema/utils.cjs.map +1 -1
- package/dist/development/src/schema/utils.js.map +1 -1
- package/dist/development/src/utils/accessor.cjs.map +1 -1
- package/dist/development/src/utils/accessor.js.map +1 -1
- package/dist/development/src/utils/paginationUtils.cjs.map +1 -1
- package/dist/development/src/utils/paginationUtils.js.map +1 -1
- package/dist/development/src/utils/singletonFactory.cjs.map +1 -1
- package/dist/development/src/utils/singletonFactory.js.map +1 -1
- package/dist/production/src/ExecutionContainer.cjs.map +1 -1
- package/dist/production/src/ExecutionContainer.js.map +1 -1
- package/dist/production/src/acl/EvaluatedPredicateReplacer.cjs.map +1 -1
- package/dist/production/src/acl/EvaluatedPredicateReplacer.js.map +1 -1
- package/dist/production/src/acl/PermissionFactory.cjs.map +1 -1
- package/dist/production/src/acl/PermissionFactory.js.map +1 -1
- package/dist/production/src/acl/PredicateFactory.cjs.map +1 -1
- package/dist/production/src/acl/PredicateFactory.js.map +1 -1
- package/dist/production/src/acl/PredicatesInjector.cjs.map +1 -1
- package/dist/production/src/acl/PredicatesInjector.js.map +1 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.cjs.map +1 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.js.map +1 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs.map +1 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js.map +1 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.cjs.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.js.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.cjs.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.js.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.cjs.map +1 -1
- package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.js.map +1 -1
- package/dist/production/src/input-validation/EntityRulesResolver.cjs.map +1 -1
- package/dist/production/src/input-validation/EntityRulesResolver.js.map +1 -1
- package/dist/production/src/input-validation/JsonSchemaValidator.cjs +208 -0
- package/dist/production/src/input-validation/JsonSchemaValidator.cjs.map +1 -0
- package/dist/production/src/input-validation/JsonSchemaValidator.js +208 -0
- package/dist/production/src/input-validation/JsonSchemaValidator.js.map +1 -0
- package/dist/production/src/input-validation/QueryAstFactory.cjs.map +1 -1
- package/dist/production/src/input-validation/QueryAstFactory.js.map +1 -1
- package/dist/production/src/input-validation/ValidationContext.cjs.map +1 -1
- package/dist/production/src/input-validation/ValidationContext.js.map +1 -1
- package/dist/production/src/input-validation/ValidationDataSelector.cjs.map +1 -1
- package/dist/production/src/input-validation/ValidationDataSelector.js.map +1 -1
- package/dist/production/src/input-validation/ValidationEvaluation.cjs.map +1 -1
- package/dist/production/src/input-validation/ValidationEvaluation.js.map +1 -1
- package/dist/production/src/input-validation/dependencies/DependencyCollector.cjs.map +1 -1
- package/dist/production/src/input-validation/dependencies/DependencyCollector.js.map +1 -1
- package/dist/production/src/input-validation/dependencies/DependencyMerger.cjs.map +1 -1
- package/dist/production/src/input-validation/dependencies/DependencyMerger.js.map +1 -1
- package/dist/production/src/input-validation/preValidation/CreateInputPreValidationProcessor.cjs.map +1 -1
- package/dist/production/src/input-validation/preValidation/CreateInputPreValidationProcessor.js.map +1 -1
- package/dist/production/src/input-validation/preValidation/InputPreValidator.cjs +38 -2
- package/dist/production/src/input-validation/preValidation/InputPreValidator.cjs.map +1 -1
- package/dist/production/src/input-validation/preValidation/InputPreValidator.js +38 -2
- package/dist/production/src/input-validation/preValidation/InputPreValidator.js.map +1 -1
- package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs.map +1 -1
- package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js.map +1 -1
- package/dist/production/src/inputProcessing/CreateInputVisitor.cjs.map +1 -1
- package/dist/production/src/inputProcessing/CreateInputVisitor.js.map +1 -1
- package/dist/production/src/inputProcessing/ObjectNode.cjs.map +1 -1
- package/dist/production/src/inputProcessing/ObjectNode.js.map +1 -1
- package/dist/production/src/inputProcessing/UniqueWhereExpander.cjs.map +1 -1
- package/dist/production/src/inputProcessing/UniqueWhereExpander.js.map +1 -1
- package/dist/production/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
- package/dist/production/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
- package/dist/production/src/introspection/IntrospectionSchemaDefinitionFactory.cjs.map +1 -1
- package/dist/production/src/introspection/IntrospectionSchemaDefinitionFactory.js.map +1 -1
- package/dist/production/src/introspection/IntrospectionSchemaFactory.cjs.map +1 -1
- package/dist/production/src/introspection/IntrospectionSchemaFactory.js.map +1 -1
- package/dist/production/src/mapper/ErrorUtils.cjs.map +1 -1
- package/dist/production/src/mapper/ErrorUtils.js.map +1 -1
- package/dist/production/src/mapper/EventManager.cjs.map +1 -1
- package/dist/production/src/mapper/EventManager.js.map +1 -1
- package/dist/production/src/mapper/JunctionTableManager.cjs.map +1 -1
- package/dist/production/src/mapper/JunctionTableManager.js.map +1 -1
- package/dist/production/src/mapper/Mapper.cjs.map +1 -1
- package/dist/production/src/mapper/Mapper.js.map +1 -1
- package/dist/production/src/mapper/MapperFactory.cjs.map +1 -1
- package/dist/production/src/mapper/MapperFactory.js.map +1 -1
- package/dist/production/src/mapper/MutationProcessorHelper.cjs.map +1 -1
- package/dist/production/src/mapper/MutationProcessorHelper.js.map +1 -1
- package/dist/production/src/mapper/Result.cjs.map +1 -1
- package/dist/production/src/mapper/Result.js.map +1 -1
- package/dist/production/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
- package/dist/production/src/mapper/delete/DeleteExecutor.js.map +1 -1
- package/dist/production/src/mapper/delete/DeleteState.cjs.map +1 -1
- package/dist/production/src/mapper/delete/DeleteState.js.map +1 -1
- package/dist/production/src/mapper/insert/InsertBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/insert/InsertBuilder.js.map +1 -1
- package/dist/production/src/mapper/insert/InsertBuilderFactory.cjs.map +1 -1
- package/dist/production/src/mapper/insert/InsertBuilderFactory.js.map +1 -1
- package/dist/production/src/mapper/insert/Inserter.cjs.map +1 -1
- package/dist/production/src/mapper/insert/Inserter.js.map +1 -1
- package/dist/production/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/select/ConditionBuilder.cjs +2 -0
- package/dist/production/src/mapper/select/ConditionBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/ConditionBuilder.js +2 -0
- package/dist/production/src/mapper/select/ConditionBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/JoinBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/JoinBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/JoinVisitor.cjs.map +1 -1
- package/dist/production/src/mapper/select/JoinVisitor.js.map +1 -1
- package/dist/production/src/mapper/select/OrderByBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/OrderByBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/OrderByHelper.cjs.map +1 -1
- package/dist/production/src/mapper/select/OrderByHelper.js.map +1 -1
- package/dist/production/src/mapper/select/RelationFetcher.cjs.map +1 -1
- package/dist/production/src/mapper/select/RelationFetcher.js.map +1 -1
- package/dist/production/src/mapper/select/SelectBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/SelectBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/SelectHydrator.cjs.map +1 -1
- package/dist/production/src/mapper/select/SelectHydrator.js.map +1 -1
- package/dist/production/src/mapper/select/WhereBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/WhereBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs +9 -1
- package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
- package/dist/production/src/mapper/select/handlers/FieldsVisitor.js +9 -1
- package/dist/production/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
- package/dist/production/src/mapper/select/handlers/FieldsVisitorFactory.cjs.map +1 -1
- package/dist/production/src/mapper/select/handlers/FieldsVisitorFactory.js.map +1 -1
- package/dist/production/src/mapper/select/handlers/MetaHandler.cjs.map +1 -1
- package/dist/production/src/mapper/select/handlers/MetaHandler.js.map +1 -1
- package/dist/production/src/mapper/select/optimizer/ConditionOptimizer.cjs.map +1 -1
- package/dist/production/src/mapper/select/optimizer/ConditionOptimizer.js.map +1 -1
- package/dist/production/src/mapper/select/optimizer/WhereOptimizer.cjs.map +1 -1
- package/dist/production/src/mapper/select/optimizer/WhereOptimizer.js.map +1 -1
- package/dist/production/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/UpdateBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/update/UpdateBuilder.js.map +1 -1
- package/dist/production/src/mapper/update/UpdateBuilderFactory.cjs.map +1 -1
- package/dist/production/src/mapper/update/UpdateBuilderFactory.js.map +1 -1
- package/dist/production/src/mapper/update/Updater.cjs.map +1 -1
- package/dist/production/src/mapper/update/Updater.js.map +1 -1
- package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -1
- 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.map +1 -1
- package/dist/production/src/resolvers/MutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/ReadHelpers.cjs.map +1 -1
- package/dist/production/src/resolvers/ReadHelpers.js.map +1 -1
- package/dist/production/src/resolvers/ReadResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/ReadResolver.js.map +1 -1
- package/dist/production/src/resolvers/RefreshViewResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/RefreshViewResolver.js.map +1 -1
- package/dist/production/src/resolvers/ValidationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/ValidationResolver.js.map +1 -1
- package/dist/production/src/schema/ColumnTypeResolver.cjs +2 -0
- package/dist/production/src/schema/ColumnTypeResolver.cjs.map +1 -1
- package/dist/production/src/schema/ColumnTypeResolver.js +2 -0
- package/dist/production/src/schema/ColumnTypeResolver.js.map +1 -1
- package/dist/production/src/schema/ConditionTypeProvider.cjs +2 -0
- package/dist/production/src/schema/ConditionTypeProvider.cjs.map +1 -1
- package/dist/production/src/schema/ConditionTypeProvider.js +2 -0
- package/dist/production/src/schema/ConditionTypeProvider.js.map +1 -1
- package/dist/production/src/schema/CustomTypesProvider.cjs +32 -0
- package/dist/production/src/schema/CustomTypesProvider.cjs.map +1 -1
- package/dist/production/src/schema/CustomTypesProvider.js +32 -0
- package/dist/production/src/schema/CustomTypesProvider.js.map +1 -1
- package/dist/production/src/schema/EntityTypeProvider.cjs.map +1 -1
- package/dist/production/src/schema/EntityTypeProvider.js.map +1 -1
- package/dist/production/src/schema/EnumsProvider.cjs.map +1 -1
- package/dist/production/src/schema/EnumsProvider.js.map +1 -1
- package/dist/production/src/schema/FieldAccessVisitor.cjs.map +1 -1
- package/dist/production/src/schema/FieldAccessVisitor.js.map +1 -1
- package/dist/production/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
- package/dist/production/src/schema/GraphQlSchemaBuilder.js.map +1 -1
- package/dist/production/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
- package/dist/production/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
- package/dist/production/src/schema/MutationProvider.cjs.map +1 -1
- package/dist/production/src/schema/MutationProvider.js.map +1 -1
- package/dist/production/src/schema/OperationExtension.cjs.map +1 -1
- package/dist/production/src/schema/OperationExtension.js.map +1 -1
- package/dist/production/src/schema/OrderByTypeProvider.cjs.map +1 -1
- package/dist/production/src/schema/OrderByTypeProvider.js.map +1 -1
- package/dist/production/src/schema/PaginatedFieldConfigFactory.cjs.map +1 -1
- package/dist/production/src/schema/PaginatedFieldConfigFactory.js.map +1 -1
- package/dist/production/src/schema/QueryProvider.cjs.map +1 -1
- package/dist/production/src/schema/QueryProvider.js.map +1 -1
- package/dist/production/src/schema/RefreshViewMutationProvider.cjs.map +1 -1
- package/dist/production/src/schema/RefreshViewMutationProvider.js.map +1 -1
- package/dist/production/src/schema/ValidationQueriesProvider.cjs.map +1 -1
- package/dist/production/src/schema/ValidationQueriesProvider.js.map +1 -1
- package/dist/production/src/schema/WhereTypeProvider.cjs.map +1 -1
- package/dist/production/src/schema/WhereTypeProvider.js.map +1 -1
- package/dist/production/src/schema/entities/FieldArgsVisitor.cjs.map +1 -1
- package/dist/production/src/schema/entities/FieldArgsVisitor.js.map +1 -1
- package/dist/production/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
- package/dist/production/src/schema/entities/FieldTypeVisitor.js.map +1 -1
- package/dist/production/src/schema/mutations/ConnectOrCreateRelationInputProvider.cjs.map +1 -1
- package/dist/production/src/schema/mutations/ConnectOrCreateRelationInputProvider.js.map +1 -1
- package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
- package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
- package/dist/production/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
- package/dist/production/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.js.map +1 -1
- package/dist/production/src/schema/mutations/CreateEntityRelationInputFieldVisitor.cjs.map +1 -1
- package/dist/production/src/schema/mutations/CreateEntityRelationInputFieldVisitor.js.map +1 -1
- package/dist/production/src/schema/mutations/CreateEntityRelationInputProvider.cjs.map +1 -1
- package/dist/production/src/schema/mutations/CreateEntityRelationInputProvider.js.map +1 -1
- package/dist/production/src/schema/mutations/EntityInputProvider.cjs.map +1 -1
- package/dist/production/src/schema/mutations/EntityInputProvider.js.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.js.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityRelationInputProvider.cjs.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityRelationInputProvider.js.map +1 -1
- package/dist/production/src/schema/utils.cjs.map +1 -1
- package/dist/production/src/schema/utils.js.map +1 -1
- package/dist/production/src/utils/accessor.cjs.map +1 -1
- package/dist/production/src/utils/accessor.js.map +1 -1
- package/dist/production/src/utils/paginationUtils.cjs.map +1 -1
- package/dist/production/src/utils/paginationUtils.js.map +1 -1
- package/dist/production/src/utils/singletonFactory.cjs.map +1 -1
- package/dist/production/src/utils/singletonFactory.js.map +1 -1
- package/dist/tests/cases/integration/graphQlRequests/insert/numericColumn.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/insert/numericColumn.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/filter/numericFilter.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/filter/numericFilter.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/filter/similarQuery.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/filter/similarQuery.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/formatting/numericFormat.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/formatting/numericFormat.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/query/formatting/numericList.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/query/formatting/numericList.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/validation/utils.d.ts +1 -1
- package/dist/tests/cases/integration/graphQlRequests/validation/utils.d.ts.map +1 -1
- package/dist/tests/cases/unit/decimalType.test.d.ts +2 -0
- package/dist/tests/cases/unit/decimalType.test.d.ts.map +1 -0
- package/dist/tests/cases/unit/jsonSchemaValidator.test.d.ts +2 -0
- package/dist/tests/cases/unit/jsonSchemaValidator.test.d.ts.map +1 -0
- package/dist/tests/src/test.d.ts +2 -1
- package/dist/tests/src/test.d.ts.map +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ExecutionContainer.d.ts +11 -11
- package/dist/types/ExecutionContainer.d.ts.map +1 -1
- package/dist/types/acl/PredicateFactory.d.ts +1 -1
- package/dist/types/acl/PredicateFactory.d.ts.map +1 -1
- package/dist/types/acl/PredicatesInjector.d.ts +1 -1
- package/dist/types/acl/PredicatesInjector.d.ts.map +1 -1
- package/dist/types/acl/index.d.ts +6 -6
- package/dist/types/acl/index.d.ts.map +1 -1
- package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.d.ts +2 -2
- package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.d.ts.map +1 -1
- package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.d.ts +3 -3
- package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.d.ts.map +1 -1
- package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.d.ts +3 -3
- package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.d.ts.map +1 -1
- package/dist/types/extensions/hasManyToHasOneReducer/index.d.ts +3 -3
- package/dist/types/extensions/hasManyToHasOneReducer/index.d.ts.map +1 -1
- package/dist/types/extensions/index.d.ts +2 -2
- package/dist/types/extensions/index.d.ts.map +1 -1
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.d.ts +2 -2
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.d.ts.map +1 -1
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.d.ts +2 -2
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.d.ts.map +1 -1
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.d.ts +2 -2
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.d.ts.map +1 -1
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.d.ts +2 -2
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.d.ts.map +1 -1
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.d.ts +2 -2
- package/dist/types/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.d.ts.map +1 -1
- package/dist/types/index.d.ts +11 -11
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/input-validation/InputValidator.d.ts +1 -1
- package/dist/types/input-validation/InputValidator.d.ts.map +1 -1
- package/dist/types/input-validation/JsonSchemaValidator.d.ts +25 -0
- package/dist/types/input-validation/JsonSchemaValidator.d.ts.map +1 -0
- package/dist/types/input-validation/QueryAstFactory.d.ts +2 -2
- package/dist/types/input-validation/QueryAstFactory.d.ts.map +1 -1
- package/dist/types/input-validation/ValidationDataSelector.d.ts +4 -4
- package/dist/types/input-validation/ValidationDataSelector.d.ts.map +1 -1
- package/dist/types/input-validation/ValidationEvaluation.d.ts +1 -1
- package/dist/types/input-validation/ValidationEvaluation.d.ts.map +1 -1
- package/dist/types/input-validation/dependencies/DependencyMerger.d.ts +1 -1
- package/dist/types/input-validation/dependencies/DependencyMerger.d.ts.map +1 -1
- package/dist/types/input-validation/dependencies/index.d.ts +2 -2
- package/dist/types/input-validation/dependencies/index.d.ts.map +1 -1
- package/dist/types/input-validation/index.d.ts +12 -11
- package/dist/types/input-validation/index.d.ts.map +1 -1
- package/dist/types/input-validation/preValidation/CreateInputPreValidationProcessor.d.ts +5 -5
- package/dist/types/input-validation/preValidation/CreateInputPreValidationProcessor.d.ts.map +1 -1
- package/dist/types/input-validation/preValidation/InputPreValidator.d.ts +11 -6
- package/dist/types/input-validation/preValidation/InputPreValidator.d.ts.map +1 -1
- package/dist/types/input-validation/preValidation/UpdateInputPreValidationProcessor.d.ts +7 -7
- package/dist/types/input-validation/preValidation/UpdateInputPreValidationProcessor.d.ts.map +1 -1
- package/dist/types/input-validation/preValidation/index.d.ts +3 -3
- package/dist/types/input-validation/preValidation/index.d.ts.map +1 -1
- package/dist/types/inputProcessing/CreateInputProcessor.d.ts +2 -2
- package/dist/types/inputProcessing/CreateInputProcessor.d.ts.map +1 -1
- package/dist/types/inputProcessing/CreateInputVisitor.d.ts +2 -2
- package/dist/types/inputProcessing/CreateInputVisitor.d.ts.map +1 -1
- package/dist/types/inputProcessing/ObjectNode.d.ts +1 -1
- package/dist/types/inputProcessing/ObjectNode.d.ts.map +1 -1
- package/dist/types/inputProcessing/UniqueWhereExpander.d.ts +2 -2
- package/dist/types/inputProcessing/UniqueWhereExpander.d.ts.map +1 -1
- package/dist/types/inputProcessing/UpdateInputProcessor.d.ts +2 -2
- package/dist/types/inputProcessing/UpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/inputProcessing/UpdateInputVisitor.d.ts +2 -2
- package/dist/types/inputProcessing/UpdateInputVisitor.d.ts.map +1 -1
- package/dist/types/inputProcessing/index.d.ts +7 -7
- package/dist/types/inputProcessing/index.d.ts.map +1 -1
- package/dist/types/introspection/IntrospectionSchemaDefinitionFactory.d.ts +1 -1
- package/dist/types/introspection/IntrospectionSchemaDefinitionFactory.d.ts.map +1 -1
- package/dist/types/introspection/IntrospectionSchemaFactory.d.ts +3 -3
- package/dist/types/introspection/IntrospectionSchemaFactory.d.ts.map +1 -1
- package/dist/types/introspection/index.d.ts +4 -4
- package/dist/types/introspection/index.d.ts.map +1 -1
- package/dist/types/mapper/ErrorUtils.d.ts +1 -1
- package/dist/types/mapper/ErrorUtils.d.ts.map +1 -1
- package/dist/types/mapper/EventManager.d.ts +2 -2
- package/dist/types/mapper/EventManager.d.ts.map +1 -1
- package/dist/types/mapper/JunctionTableManager.d.ts +4 -4
- package/dist/types/mapper/JunctionTableManager.d.ts.map +1 -1
- package/dist/types/mapper/Mapper.d.ts +12 -12
- package/dist/types/mapper/Mapper.d.ts.map +1 -1
- package/dist/types/mapper/MapperFactory.d.ts +8 -8
- package/dist/types/mapper/MapperFactory.d.ts.map +1 -1
- package/dist/types/mapper/MutationProcessorHelper.d.ts +1 -1
- package/dist/types/mapper/MutationProcessorHelper.d.ts.map +1 -1
- package/dist/types/mapper/Result.d.ts +1 -1
- package/dist/types/mapper/Result.d.ts.map +1 -1
- package/dist/types/mapper/delete/DeleteExecutor.d.ts +6 -6
- package/dist/types/mapper/delete/DeleteExecutor.d.ts.map +1 -1
- package/dist/types/mapper/delete/DeleteState.d.ts +2 -2
- package/dist/types/mapper/delete/DeleteState.d.ts.map +1 -1
- package/dist/types/mapper/delete/index.d.ts +2 -2
- package/dist/types/mapper/delete/index.d.ts.map +1 -1
- package/dist/types/mapper/index.d.ts +15 -15
- package/dist/types/mapper/index.d.ts.map +1 -1
- package/dist/types/mapper/insert/InsertBuilder.d.ts +4 -4
- package/dist/types/mapper/insert/InsertBuilder.d.ts.map +1 -1
- package/dist/types/mapper/insert/InsertBuilderFactory.d.ts +3 -3
- package/dist/types/mapper/insert/InsertBuilderFactory.d.ts.map +1 -1
- package/dist/types/mapper/insert/Inserter.d.ts +5 -5
- package/dist/types/mapper/insert/Inserter.d.ts.map +1 -1
- package/dist/types/mapper/insert/SqlCreateInputProcessor.d.ts +4 -4
- package/dist/types/mapper/insert/SqlCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/insert/index.d.ts +4 -4
- package/dist/types/mapper/insert/index.d.ts.map +1 -1
- package/dist/types/mapper/insert/relations/ManyHasManyCreateInputProcessor.d.ts +7 -7
- package/dist/types/mapper/insert/relations/ManyHasManyCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/insert/relations/ManyHasOneCreateInputProcessor.d.ts +9 -9
- package/dist/types/mapper/insert/relations/ManyHasOneCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/insert/relations/OneHasManyCreateInputProcessor.d.ts +8 -8
- package/dist/types/mapper/insert/relations/OneHasManyCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.d.ts +7 -7
- package/dist/types/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.d.ts +7 -7
- 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 +1 -1
- package/dist/types/mapper/select/JoinBuilder.d.ts.map +1 -1
- package/dist/types/mapper/select/JoinVisitor.d.ts +1 -1
- package/dist/types/mapper/select/JoinVisitor.d.ts.map +1 -1
- package/dist/types/mapper/select/OrderByBuilder.d.ts +2 -2
- package/dist/types/mapper/select/OrderByBuilder.d.ts.map +1 -1
- package/dist/types/mapper/select/OrderByHelper.d.ts +1 -1
- package/dist/types/mapper/select/OrderByHelper.d.ts.map +1 -1
- package/dist/types/mapper/select/RelationFetcher.d.ts +7 -7
- package/dist/types/mapper/select/RelationFetcher.d.ts.map +1 -1
- package/dist/types/mapper/select/SelectBuilder.d.ts +10 -10
- package/dist/types/mapper/select/SelectBuilder.d.ts.map +1 -1
- package/dist/types/mapper/select/SelectBuilderFactory.d.ts +2 -2
- package/dist/types/mapper/select/SelectBuilderFactory.d.ts.map +1 -1
- package/dist/types/mapper/select/SelectExecutionHandler.d.ts +4 -4
- package/dist/types/mapper/select/SelectExecutionHandler.d.ts.map +1 -1
- package/dist/types/mapper/select/SelectHydrator.d.ts +1 -1
- package/dist/types/mapper/select/SelectHydrator.d.ts.map +1 -1
- package/dist/types/mapper/select/WhereBuilder.d.ts +4 -4
- package/dist/types/mapper/select/WhereBuilder.d.ts.map +1 -1
- package/dist/types/mapper/select/handlers/FieldsVisitor.d.ts +4 -4
- package/dist/types/mapper/select/handlers/FieldsVisitor.d.ts.map +1 -1
- package/dist/types/mapper/select/handlers/FieldsVisitorFactory.d.ts +5 -5
- package/dist/types/mapper/select/handlers/FieldsVisitorFactory.d.ts.map +1 -1
- package/dist/types/mapper/select/handlers/MetaHandler.d.ts +3 -3
- package/dist/types/mapper/select/handlers/MetaHandler.d.ts.map +1 -1
- package/dist/types/mapper/select/handlers/index.d.ts +3 -3
- package/dist/types/mapper/select/handlers/index.d.ts.map +1 -1
- package/dist/types/mapper/select/index.d.ts +13 -13
- package/dist/types/mapper/select/index.d.ts.map +1 -1
- package/dist/types/mapper/select/optimizer/WhereOptimizer.d.ts +1 -1
- package/dist/types/mapper/select/optimizer/WhereOptimizer.d.ts.map +1 -1
- package/dist/types/mapper/types.d.ts +1 -1
- package/dist/types/mapper/types.d.ts.map +1 -1
- package/dist/types/mapper/update/SqlUpdateInputProcessor.d.ts +5 -5
- package/dist/types/mapper/update/SqlUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/UpdateBuilder.d.ts +4 -4
- package/dist/types/mapper/update/UpdateBuilder.d.ts.map +1 -1
- package/dist/types/mapper/update/UpdateBuilderFactory.d.ts +3 -3
- package/dist/types/mapper/update/UpdateBuilderFactory.d.ts.map +1 -1
- package/dist/types/mapper/update/Updater.d.ts +5 -5
- package/dist/types/mapper/update/Updater.d.ts.map +1 -1
- package/dist/types/mapper/update/index.d.ts +4 -4
- package/dist/types/mapper/update/index.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/ManyHasManyUpdateInputProcessor.d.ts +12 -12
- package/dist/types/mapper/update/relations/ManyHasManyUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/ManyHasOneUpdateInputProcessor.d.ts +12 -12
- package/dist/types/mapper/update/relations/ManyHasOneUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/OneHasManyUpdateInputProcessor.d.ts +12 -12
- package/dist/types/mapper/update/relations/OneHasManyUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.d.ts +6 -6
- package/dist/types/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.d.ts +10 -10
- package/dist/types/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/resolvers/GraphQlQueryAstFactory.d.ts +1 -1
- package/dist/types/resolvers/GraphQlQueryAstFactory.d.ts.map +1 -1
- package/dist/types/resolvers/MutationResolver.d.ts +3 -3
- package/dist/types/resolvers/MutationResolver.d.ts.map +1 -1
- package/dist/types/resolvers/ReadHelpers.d.ts +2 -2
- package/dist/types/resolvers/ReadHelpers.d.ts.map +1 -1
- package/dist/types/resolvers/ReadResolver.d.ts +4 -4
- package/dist/types/resolvers/ReadResolver.d.ts.map +1 -1
- package/dist/types/resolvers/RefreshViewResolver.d.ts +1 -1
- package/dist/types/resolvers/RefreshViewResolver.d.ts.map +1 -1
- package/dist/types/resolvers/ValidationResolver.d.ts +2 -2
- package/dist/types/resolvers/ValidationResolver.d.ts.map +1 -1
- package/dist/types/resolvers/index.d.ts +4 -4
- package/dist/types/resolvers/index.d.ts.map +1 -1
- package/dist/types/schema/ColumnTypeResolver.d.ts +2 -2
- package/dist/types/schema/ColumnTypeResolver.d.ts.map +1 -1
- package/dist/types/schema/ConditionTypeProvider.d.ts +1 -1
- package/dist/types/schema/ConditionTypeProvider.d.ts.map +1 -1
- package/dist/types/schema/CustomTypesProvider.d.ts +1 -0
- package/dist/types/schema/CustomTypesProvider.d.ts.map +1 -1
- package/dist/types/schema/EntityTypeProvider.d.ts +5 -5
- package/dist/types/schema/EntityTypeProvider.d.ts.map +1 -1
- package/dist/types/schema/FieldAccessVisitor.d.ts +1 -1
- package/dist/types/schema/FieldAccessVisitor.d.ts.map +1 -1
- package/dist/types/schema/GraphQlSchemaBuilder.d.ts +6 -6
- package/dist/types/schema/GraphQlSchemaBuilder.d.ts.map +1 -1
- package/dist/types/schema/GraphQlSchemaBuilderFactory.d.ts +30 -30
- package/dist/types/schema/GraphQlSchemaBuilderFactory.d.ts.map +1 -1
- package/dist/types/schema/MutationProvider.d.ts +6 -6
- package/dist/types/schema/MutationProvider.d.ts.map +1 -1
- package/dist/types/schema/OrderByTypeProvider.d.ts +1 -1
- package/dist/types/schema/OrderByTypeProvider.d.ts.map +1 -1
- package/dist/types/schema/PaginatedFieldConfigFactory.d.ts +3 -3
- package/dist/types/schema/PaginatedFieldConfigFactory.d.ts.map +1 -1
- package/dist/types/schema/QueryProvider.d.ts +6 -6
- package/dist/types/schema/QueryProvider.d.ts.map +1 -1
- package/dist/types/schema/RefreshViewMutationProvider.d.ts +2 -2
- package/dist/types/schema/RefreshViewMutationProvider.d.ts.map +1 -1
- package/dist/types/schema/ValidationQueriesProvider.d.ts +4 -4
- package/dist/types/schema/ValidationQueriesProvider.d.ts.map +1 -1
- package/dist/types/schema/WhereTypeProvider.d.ts +3 -3
- package/dist/types/schema/WhereTypeProvider.d.ts.map +1 -1
- package/dist/types/schema/entities/FieldArgsVisitor.d.ts +2 -2
- package/dist/types/schema/entities/FieldArgsVisitor.d.ts.map +1 -1
- package/dist/types/schema/entities/FieldTypeVisitor.d.ts +3 -3
- package/dist/types/schema/entities/FieldTypeVisitor.d.ts.map +1 -1
- package/dist/types/schema/entities/index.d.ts +2 -2
- package/dist/types/schema/entities/index.d.ts.map +1 -1
- package/dist/types/schema/index.d.ts +18 -18
- package/dist/types/schema/index.d.ts.map +1 -1
- package/dist/types/schema/mutations/ConnectOrCreateRelationInputProvider.d.ts +3 -3
- package/dist/types/schema/mutations/ConnectOrCreateRelationInputProvider.d.ts.map +1 -1
- package/dist/types/schema/mutations/CreateEntityInputFieldVisitor.d.ts +3 -3
- package/dist/types/schema/mutations/CreateEntityInputFieldVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.d.ts +1 -1
- package/dist/types/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/CreateEntityRelationInputFieldVisitor.d.ts +5 -5
- package/dist/types/schema/mutations/CreateEntityRelationInputFieldVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/CreateEntityRelationInputProvider.d.ts +1 -1
- package/dist/types/schema/mutations/CreateEntityRelationInputProvider.d.ts.map +1 -1
- package/dist/types/schema/mutations/EntityInputProvider.d.ts +1 -1
- package/dist/types/schema/mutations/EntityInputProvider.d.ts.map +1 -1
- package/dist/types/schema/mutations/UpdateEntityInputFieldVisitor.d.ts +4 -4
- package/dist/types/schema/mutations/UpdateEntityInputFieldVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.d.ts +1 -1
- package/dist/types/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/UpdateEntityRelationInputFieldVisitor.d.ts +6 -6
- package/dist/types/schema/mutations/UpdateEntityRelationInputFieldVisitor.d.ts.map +1 -1
- package/dist/types/schema/mutations/UpdateEntityRelationInputProvider.d.ts +1 -1
- package/dist/types/schema/mutations/UpdateEntityRelationInputProvider.d.ts.map +1 -1
- package/dist/types/schema/mutations/index.d.ts +9 -9
- package/dist/types/schema/mutations/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/accessor.d.ts +1 -1
- package/dist/types/utils/accessor.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +13 -13
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/paginationUtils.d.ts +1 -1
- package/dist/types/utils/paginationUtils.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/ExecutionContainer.ts +20 -12
- package/src/acl/EvaluatedPredicateReplacer.ts +1 -1
- package/src/acl/PermissionFactory.ts +2 -2
- package/src/acl/PredicateFactory.ts +2 -2
- package/src/acl/PredicatesInjector.ts +1 -1
- package/src/acl/index.ts +6 -6
- package/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.ts +2 -2
- package/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.ts +5 -5
- package/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.ts +4 -4
- package/src/extensions/hasManyToHasOneReducer/index.ts +3 -3
- package/src/extensions/index.ts +2 -2
- package/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.ts +2 -2
- package/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.ts +5 -5
- package/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.ts +2 -2
- package/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.ts +4 -4
- package/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.ts +2 -2
- package/src/index.ts +11 -11
- package/src/input-validation/EntityRulesResolver.ts +3 -3
- package/src/input-validation/InputValidator.ts +1 -1
- package/src/input-validation/JsonSchemaValidator.ts +257 -0
- package/src/input-validation/QueryAstFactory.ts +2 -2
- package/src/input-validation/ValidationContext.ts +1 -1
- package/src/input-validation/ValidationDataSelector.ts +3 -3
- package/src/input-validation/ValidationEvaluation.ts +1 -1
- package/src/input-validation/dependencies/DependencyCollector.ts +1 -1
- package/src/input-validation/dependencies/DependencyMerger.ts +2 -2
- package/src/input-validation/dependencies/index.ts +2 -2
- package/src/input-validation/index.ts +12 -11
- package/src/input-validation/preValidation/CreateInputPreValidationProcessor.ts +4 -4
- package/src/input-validation/preValidation/InputPreValidator.ts +60 -17
- package/src/input-validation/preValidation/UpdateInputPreValidationProcessor.ts +4 -4
- package/src/input-validation/preValidation/index.ts +3 -3
- package/src/inputProcessing/CreateInputProcessor.ts +2 -2
- package/src/inputProcessing/CreateInputVisitor.ts +4 -4
- package/src/inputProcessing/ObjectNode.ts +1 -1
- package/src/inputProcessing/UniqueWhereExpander.ts +3 -3
- package/src/inputProcessing/UpdateInputProcessor.ts +2 -2
- package/src/inputProcessing/UpdateInputVisitor.ts +4 -4
- package/src/inputProcessing/index.ts +7 -7
- package/src/introspection/IntrospectionSchemaDefinitionFactory.ts +3 -3
- package/src/introspection/IntrospectionSchemaFactory.ts +4 -4
- package/src/introspection/index.ts +4 -4
- package/src/mapper/ErrorUtils.ts +2 -2
- package/src/mapper/EventManager.ts +2 -2
- package/src/mapper/JunctionTableManager.ts +6 -6
- package/src/mapper/Mapper.ts +14 -14
- package/src/mapper/MapperFactory.ts +8 -8
- package/src/mapper/MutationProcessorHelper.ts +1 -1
- package/src/mapper/Result.ts +1 -1
- package/src/mapper/delete/DeleteExecutor.ts +11 -11
- package/src/mapper/delete/DeleteState.ts +3 -3
- package/src/mapper/delete/index.ts +2 -2
- package/src/mapper/index.ts +15 -15
- package/src/mapper/insert/InsertBuilder.ts +5 -5
- package/src/mapper/insert/InsertBuilderFactory.ts +3 -3
- package/src/mapper/insert/Inserter.ts +8 -8
- package/src/mapper/insert/SqlCreateInputProcessor.ts +10 -10
- package/src/mapper/insert/index.ts +4 -4
- package/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.ts +6 -6
- package/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.ts +7 -7
- package/src/mapper/insert/relations/OneHasManyCreateInputProcessor.ts +5 -5
- package/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.ts +6 -6
- package/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.ts +7 -7
- package/src/mapper/select/ConditionBuilder.ts +3 -1
- package/src/mapper/select/JoinBuilder.ts +2 -2
- package/src/mapper/select/JoinVisitor.ts +1 -1
- package/src/mapper/select/OrderByBuilder.ts +3 -3
- package/src/mapper/select/OrderByHelper.ts +1 -1
- package/src/mapper/select/RelationFetcher.ts +9 -9
- package/src/mapper/select/SelectBuilder.ts +11 -11
- package/src/mapper/select/SelectBuilderFactory.ts +2 -2
- package/src/mapper/select/SelectExecutionHandler.ts +4 -4
- package/src/mapper/select/SelectHydrator.ts +2 -2
- package/src/mapper/select/WhereBuilder.ts +5 -5
- package/src/mapper/select/handlers/FieldsVisitor.ts +22 -7
- package/src/mapper/select/handlers/FieldsVisitorFactory.ts +5 -5
- package/src/mapper/select/handlers/MetaHandler.ts +5 -5
- package/src/mapper/select/handlers/index.ts +3 -3
- package/src/mapper/select/index.ts +13 -13
- package/src/mapper/select/optimizer/ConditionOptimizer.ts +1 -1
- package/src/mapper/select/optimizer/WhereOptimizer.ts +3 -3
- package/src/mapper/types.ts +1 -1
- package/src/mapper/update/SqlUpdateInputProcessor.ts +11 -11
- package/src/mapper/update/UpdateBuilder.ts +6 -6
- package/src/mapper/update/UpdateBuilderFactory.ts +3 -3
- package/src/mapper/update/Updater.ts +8 -8
- package/src/mapper/update/index.ts +4 -4
- package/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.ts +6 -6
- package/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.ts +7 -7
- package/src/mapper/update/relations/OneHasManyUpdateInputProcessor.ts +6 -6
- package/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.ts +6 -6
- package/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.ts +7 -7
- package/src/resolvers/GraphQlQueryAstFactory.ts +2 -2
- package/src/resolvers/MutationResolver.ts +9 -9
- package/src/resolvers/ReadHelpers.ts +5 -5
- package/src/resolvers/ReadResolver.ts +4 -4
- package/src/resolvers/RefreshViewResolver.ts +1 -1
- package/src/resolvers/ValidationResolver.ts +3 -3
- package/src/resolvers/index.ts +4 -4
- package/src/schema/ColumnTypeResolver.ts +6 -4
- package/src/schema/ConditionTypeProvider.ts +7 -4
- package/src/schema/CustomTypesProvider.ts +37 -0
- package/src/schema/EntityTypeProvider.ts +10 -10
- package/src/schema/EnumsProvider.ts +1 -1
- package/src/schema/FieldAccessVisitor.ts +1 -1
- package/src/schema/GraphQlSchemaBuilder.ts +6 -6
- package/src/schema/GraphQlSchemaBuilderFactory.ts +30 -30
- package/src/schema/MutationProvider.ts +9 -9
- package/src/schema/OperationExtension.ts +1 -1
- package/src/schema/OrderByTypeProvider.ts +4 -4
- package/src/schema/PaginatedFieldConfigFactory.ts +3 -3
- package/src/schema/QueryProvider.ts +8 -8
- package/src/schema/RefreshViewMutationProvider.ts +2 -2
- package/src/schema/ValidationQueriesProvider.ts +5 -5
- package/src/schema/WhereTypeProvider.ts +7 -7
- package/src/schema/entities/FieldArgsVisitor.ts +2 -2
- package/src/schema/entities/FieldTypeVisitor.ts +4 -4
- package/src/schema/entities/index.ts +2 -2
- package/src/schema/index.ts +18 -18
- package/src/schema/mutations/ConnectOrCreateRelationInputProvider.ts +5 -5
- package/src/schema/mutations/CreateEntityInputFieldVisitor.ts +3 -3
- package/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.ts +2 -2
- package/src/schema/mutations/CreateEntityRelationInputFieldVisitor.ts +7 -7
- package/src/schema/mutations/CreateEntityRelationInputProvider.ts +2 -2
- package/src/schema/mutations/EntityInputProvider.ts +4 -4
- package/src/schema/mutations/UpdateEntityInputFieldVisitor.ts +3 -3
- package/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.ts +1 -1
- package/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts +8 -8
- package/src/schema/mutations/UpdateEntityRelationInputProvider.ts +2 -2
- package/src/schema/mutations/index.ts +9 -9
- package/src/schema/utils.ts +1 -1
- package/src/types.ts +1 -1
- package/src/utils/accessor.ts +2 -2
- package/src/utils/index.ts +13 -13
- package/src/utils/paginationUtils.ts +1 -1
- package/src/utils/singletonFactory.ts +1 -1
- package/tests/cases/bugs/bug-filter-or.test.ts +3 -3
- package/tests/cases/bugs/bug-update-by-nested-unique.test.ts +3 -3
- package/tests/cases/bugs/bug102.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/delete/aclDelete.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/delete/additionalDeleteFilter.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/delete/cascadeDelete.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/delete/deleteById.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/delete/orphanRemoval.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/delete/restrictOnDelete.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/delete/setNullOnDelete.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/acl/setField.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/aclInsert.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/basicInsert.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/insertCustomId.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/jsonInsert.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/manyHasManyInverse/create.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/manyHasManyOwning/create.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/manyHasOne/connectOrCreate.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/manyHasOne/create.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/numericColumn.test.ts +110 -0
- package/tests/cases/integration/graphQlRequests/insert/oneHasMany/connect.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/oneHasMany/create.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/oneHasOneInverse/create.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/oneHasOneOwning/create.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/oneHasOneOwning/empty.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/subOperationFail.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/insert/validation/toBeFixed.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/acl/differentRowAndFieldPredicate.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/acl/fieldRestrictedByLocale.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/acl/isNullAcl.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/query/acl/nestedPredicate.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/acl/orPredicate.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/acl/predicateElimination.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/query/acl/relationAcl.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/query/acl/rowPredicateSubset.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/query/acl/sameRowAndFieldPredicate.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/filter/backReferencedFilter.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/filter/complexCondition.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/filter/composedFilter.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/filter/containsQuery.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/filter/manyHasManyOwnerRelation.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/filter/manyHasOneRelation.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/filter/numericFilter.test.ts +92 -0
- package/tests/cases/integration/graphQlRequests/query/filter/oneHasManyRelation.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/filter/similarQuery.test.ts +72 -0
- package/tests/cases/integration/graphQlRequests/query/formatting/dateFormat.test.ts +135 -4
- package/tests/cases/integration/graphQlRequests/query/formatting/numericFormat.test.ts +68 -0
- package/tests/cases/integration/graphQlRequests/query/formatting/numericList.test.ts +41 -0
- package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/alias.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/fragments.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/misc/aliasedType.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/misc/longAliasHash.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/misc/reducedHasMany.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/misc/transaction.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/pagination/hasManyLimit.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/pagination/paginate.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/pagination/paginateAliased.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/pagination/simpleLimit.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/relations/advanced.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyInverse.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyOwning.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/relations/manyHasOne.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/relations/oneHasMany.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneInverse.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneOwner.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/sorting/byRelations.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/sorting/defaultOrdering.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/sorting/orderBy.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/sorting/randomSort.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/sorting/sortNulls.test.ts +2 -2
- package/tests/cases/integration/graphQlRequests/query/sorting/sortedHasMany.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/unique/basicQueryById.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/unique/composedUnique.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/unique/oneHasManyUnique.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/unique/uniqueWithFilter.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/query/view/view.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/update/acl/aclUpdate.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/update/additionalFilter.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/update/basic/columnUpdate.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/connect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/create.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/delete.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/disconnect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/update.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/upsert.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/connect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/connectOrCreate.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/create.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/delete.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/disconnect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/update.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/upsert.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/connect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/create.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/delete.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/disconnect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/update.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/upsert.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/combination.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/connect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/connectOrCreate.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/create.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/delete.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/disconnect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/update.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/upsert.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/connect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/create.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/delete.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/disconnect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/update.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/upsert.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connectOrCreate.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/create.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/delete.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/disconnect.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/update.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/upsert.test.ts +4 -4
- package/tests/cases/integration/graphQlRequests/update/queryPortal.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/update/transaction.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/update/validation/toBeFixed.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/upsert/basicUpsert.test.ts +3 -3
- package/tests/cases/integration/graphQlRequests/validation/conditions.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/nestedValidation.test.ts +2 -2
- package/tests/cases/integration/graphQlRequests/validation/optionalAssert.test.ts +2 -2
- package/tests/cases/integration/graphQlRequests/validation/required.test.ts +2 -2
- package/tests/cases/integration/graphQlRequests/validation/requiredWhen.test.ts +2 -2
- package/tests/cases/integration/graphQlRequests/validation/rules/andRule.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/rules/lengthRangeRule.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/rules/maxLengthRule.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/rules/minLength.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/rules/notEmptyRule.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/rules/notRule.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/rules/orRule.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/rules/patternRule.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/rules/rangeRule.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/utils.ts +2 -2
- package/tests/cases/integration/graphQlSchema/graphQlSchemaBuilder.test.ts +2 -2
- package/tests/cases/integration/graphQlSchema/schema-acl-allowed.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-predicate.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-predicate2.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-restricted-create.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-restricted-delete.gql +2 -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-basic.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-bug-66.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-column-types.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-custom-primary.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-has-many-reduction.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-new-builder.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-no-root-ops.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-read-only.gql +2 -0
- package/tests/cases/integration/graphQlSchema/schema-view-entity.gql +2 -0
- package/tests/cases/unit/aclVariablesFactory.test.ts +2 -2
- package/tests/cases/unit/conditionOptimizer.test.ts +1 -1
- package/tests/cases/unit/decimalType.test.ts +65 -0
- package/tests/cases/unit/inputPreValidator.test.ts +101 -6
- package/tests/cases/unit/inputValidation.test.ts +3 -3
- package/tests/cases/unit/jsonSchemaValidator.test.ts +115 -0
- package/tests/cases/unit/orderbyHelper.test.ts +3 -3
- package/tests/cases/unit/permissionMerger.test.ts +2 -2
- package/tests/cases/unit/predicatesFactory.test.ts +2 -2
- package/tests/cases/unit/predicatesInjector.test.ts +5 -5
- package/tests/cases/unit/uuidType.test.ts +1 -1
- package/tests/cases/unit/variableInjector.test.ts +2 -2
- package/tests/cases/unit/whereBuilder.test.ts +4 -4
- package/tests/cases/unit/whereOptimizer.test.ts +3 -3
- package/tests/src/test.ts +6 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldTypeVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldTypeVisitor.ts"],"sourcesContent":["import { GraphQLList, GraphQLNonNull, GraphQLOutputType } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { EntityTypeProvider } from '../EntityTypeProvider'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class FieldTypeVisitor implements Model.ColumnVisitor<GraphQLOutputType>, Model.RelationByGenericTypeVisitor<GraphQLOutputType> {\n\tconstructor(\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\n\tpublic visitColumn({ column, entity }: Model.ColumnContext): GraphQLOutputType {\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\tconst fieldPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, column.name)\n\t\tconst idPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, entity.primary)\n\t\tif (!fieldPredicate || !idPredicate) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tif (!column.nullable && (fieldPredicate === true || fieldPredicate === idPredicate)) {\n\t\t\treturn new GraphQLNonNull(type)\n\t\t}\n\t\treturn type\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext): GraphQLOutputType {\n\t\tconst entityType = this.entityTypeProvider.getEntity(relation.target)\n\t\treturn new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType)))\n\t}\n\n\tpublic visitHasOne({ relation }: Model.AnyHasOneRelationContext): GraphQLOutputType {\n\t\treturn this.entityTypeProvider.getEntity(relation.target)\n\t}\n}\n"],"names":["Acl","ImplementationException","GraphQLNonNull","GraphQLList"],"mappings":";;;;;AAOO,MAAM,iBAA0H;AAAA,EACtI,YACkB,oBACA,oBACA,cAChB;AAHgB,SAAA,qBAAA;AACA,SAAA,qBAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EAEO,YAAY,EAAE,QAAQ,UAAkD;AAC9E,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,UAAM,iBAAiB,KAAK,aAAa,kBAAkBA,OAAAA,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,IAAI;AACvG,UAAM,cAAc,KAAK,aAAa,kBAAkBA,OAAAA,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,OAAO;AACvG,QAAI,CAAC,kBAAkB,CAAC,aAAa;AACpC,YAAM,IAAIC,UAAAA,wBAAA;AAAA,IACX;AACA,QAAI,CAAC,OAAO,aAAa,mBAAmB,QAAQ,mBAAmB,cAAc;AACpF,aAAO,IAAIC,QAAAA,eAAe,IAAI;AAAA,IAC/B;AACA,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAAgE;AACrF,UAAM,aAAa,KAAK,mBAAmB,UAAU,SAAS,MAAM;AACpE,WAAO,IAAIA,QAAAA,eAAe,IAAIC,QAAAA,YAAY,IAAID,QAAAA,eAAe,UAAU,CAAC,CAAC;AAAA,EAC1E;AAAA,EAEO,YAAY,EAAE,YAA+D;AACnF,WAAO,KAAK,mBAAmB,UAAU,SAAS,MAAM;AAAA,EACzD;AACD;;"}
|
|
1
|
+
{"version":3,"file":"FieldTypeVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldTypeVisitor.ts"],"sourcesContent":["import { GraphQLList, GraphQLNonNull, GraphQLOutputType } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver.js'\nimport { EntityTypeProvider } from '../EntityTypeProvider.js'\nimport { Authorizator } from '../../acl/index.js'\nimport { ImplementationException } from '../../exception.js'\n\nexport class FieldTypeVisitor implements Model.ColumnVisitor<GraphQLOutputType>, Model.RelationByGenericTypeVisitor<GraphQLOutputType> {\n\tconstructor(\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\n\tpublic visitColumn({ column, entity }: Model.ColumnContext): GraphQLOutputType {\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\tconst fieldPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, column.name)\n\t\tconst idPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, entity.primary)\n\t\tif (!fieldPredicate || !idPredicate) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tif (!column.nullable && (fieldPredicate === true || fieldPredicate === idPredicate)) {\n\t\t\treturn new GraphQLNonNull(type)\n\t\t}\n\t\treturn type\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext): GraphQLOutputType {\n\t\tconst entityType = this.entityTypeProvider.getEntity(relation.target)\n\t\treturn new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType)))\n\t}\n\n\tpublic visitHasOne({ relation }: Model.AnyHasOneRelationContext): GraphQLOutputType {\n\t\treturn this.entityTypeProvider.getEntity(relation.target)\n\t}\n}\n"],"names":["Acl","ImplementationException","GraphQLNonNull","GraphQLList"],"mappings":";;;;;AAOO,MAAM,iBAA0H;AAAA,EACtI,YACkB,oBACA,oBACA,cAChB;AAHgB,SAAA,qBAAA;AACA,SAAA,qBAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EAEO,YAAY,EAAE,QAAQ,UAAkD;AAC9E,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,UAAM,iBAAiB,KAAK,aAAa,kBAAkBA,OAAAA,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,IAAI;AACvG,UAAM,cAAc,KAAK,aAAa,kBAAkBA,OAAAA,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,OAAO;AACvG,QAAI,CAAC,kBAAkB,CAAC,aAAa;AACpC,YAAM,IAAIC,UAAAA,wBAAA;AAAA,IACX;AACA,QAAI,CAAC,OAAO,aAAa,mBAAmB,QAAQ,mBAAmB,cAAc;AACpF,aAAO,IAAIC,QAAAA,eAAe,IAAI;AAAA,IAC/B;AACA,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAAgE;AACrF,UAAM,aAAa,KAAK,mBAAmB,UAAU,SAAS,MAAM;AACpE,WAAO,IAAIA,QAAAA,eAAe,IAAIC,QAAAA,YAAY,IAAID,QAAAA,eAAe,UAAU,CAAC,CAAC;AAAA,EAC1E;AAAA,EAEO,YAAY,EAAE,YAA+D;AACnF,WAAO,KAAK,mBAAmB,UAAU,SAAS,MAAM;AAAA,EACzD;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldTypeVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldTypeVisitor.ts"],"sourcesContent":["import { GraphQLList, GraphQLNonNull, GraphQLOutputType } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { EntityTypeProvider } from '../EntityTypeProvider'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class FieldTypeVisitor implements Model.ColumnVisitor<GraphQLOutputType>, Model.RelationByGenericTypeVisitor<GraphQLOutputType> {\n\tconstructor(\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\n\tpublic visitColumn({ column, entity }: Model.ColumnContext): GraphQLOutputType {\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\tconst fieldPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, column.name)\n\t\tconst idPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, entity.primary)\n\t\tif (!fieldPredicate || !idPredicate) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tif (!column.nullable && (fieldPredicate === true || fieldPredicate === idPredicate)) {\n\t\t\treturn new GraphQLNonNull(type)\n\t\t}\n\t\treturn type\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext): GraphQLOutputType {\n\t\tconst entityType = this.entityTypeProvider.getEntity(relation.target)\n\t\treturn new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType)))\n\t}\n\n\tpublic visitHasOne({ relation }: Model.AnyHasOneRelationContext): GraphQLOutputType {\n\t\treturn this.entityTypeProvider.getEntity(relation.target)\n\t}\n}\n"],"names":[],"mappings":";;;AAOO,MAAM,iBAA0H;AAAA,EACtI,YACkB,oBACA,oBACA,cAChB;AAHgB,SAAA,qBAAA;AACA,SAAA,qBAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EAEO,YAAY,EAAE,QAAQ,UAAkD;AAC9E,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,UAAM,iBAAiB,KAAK,aAAa,kBAAkB,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,IAAI;AACvG,UAAM,cAAc,KAAK,aAAa,kBAAkB,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,OAAO;AACvG,QAAI,CAAC,kBAAkB,CAAC,aAAa;AACpC,YAAM,IAAI,wBAAA;AAAA,IACX;AACA,QAAI,CAAC,OAAO,aAAa,mBAAmB,QAAQ,mBAAmB,cAAc;AACpF,aAAO,IAAI,eAAe,IAAI;AAAA,IAC/B;AACA,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAAgE;AACrF,UAAM,aAAa,KAAK,mBAAmB,UAAU,SAAS,MAAM;AACpE,WAAO,IAAI,eAAe,IAAI,YAAY,IAAI,eAAe,UAAU,CAAC,CAAC;AAAA,EAC1E;AAAA,EAEO,YAAY,EAAE,YAA+D;AACnF,WAAO,KAAK,mBAAmB,UAAU,SAAS,MAAM;AAAA,EACzD;AACD;"}
|
|
1
|
+
{"version":3,"file":"FieldTypeVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldTypeVisitor.ts"],"sourcesContent":["import { GraphQLList, GraphQLNonNull, GraphQLOutputType } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver.js'\nimport { EntityTypeProvider } from '../EntityTypeProvider.js'\nimport { Authorizator } from '../../acl/index.js'\nimport { ImplementationException } from '../../exception.js'\n\nexport class FieldTypeVisitor implements Model.ColumnVisitor<GraphQLOutputType>, Model.RelationByGenericTypeVisitor<GraphQLOutputType> {\n\tconstructor(\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\n\tpublic visitColumn({ column, entity }: Model.ColumnContext): GraphQLOutputType {\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\tconst fieldPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, column.name)\n\t\tconst idPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, entity.primary)\n\t\tif (!fieldPredicate || !idPredicate) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tif (!column.nullable && (fieldPredicate === true || fieldPredicate === idPredicate)) {\n\t\t\treturn new GraphQLNonNull(type)\n\t\t}\n\t\treturn type\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext): GraphQLOutputType {\n\t\tconst entityType = this.entityTypeProvider.getEntity(relation.target)\n\t\treturn new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType)))\n\t}\n\n\tpublic visitHasOne({ relation }: Model.AnyHasOneRelationContext): GraphQLOutputType {\n\t\treturn this.entityTypeProvider.getEntity(relation.target)\n\t}\n}\n"],"names":[],"mappings":";;;AAOO,MAAM,iBAA0H;AAAA,EACtI,YACkB,oBACA,oBACA,cAChB;AAHgB,SAAA,qBAAA;AACA,SAAA,qBAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EAEO,YAAY,EAAE,QAAQ,UAAkD;AAC9E,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,UAAM,iBAAiB,KAAK,aAAa,kBAAkB,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,IAAI;AACvG,UAAM,cAAc,KAAK,aAAa,kBAAkB,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,OAAO;AACvG,QAAI,CAAC,kBAAkB,CAAC,aAAa;AACpC,YAAM,IAAI,wBAAA;AAAA,IACX;AACA,QAAI,CAAC,OAAO,aAAa,mBAAmB,QAAQ,mBAAmB,cAAc;AACpF,aAAO,IAAI,eAAe,IAAI;AAAA,IAC/B;AACA,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAAgE;AACrF,UAAM,aAAa,KAAK,mBAAmB,UAAU,SAAS,MAAM;AACpE,WAAO,IAAI,eAAe,IAAI,YAAY,IAAI,eAAe,UAAU,CAAC,CAAC;AAAA,EAC1E;AAAA,EAEO,YAAY,EAAE,YAA+D;AACnF,WAAO,KAAK,mBAAmB,UAAU,SAAS,MAAM;AAAA,EACzD;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectOrCreateRelationInputProvider.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/ConnectOrCreateRelationInputProvider.ts"],"sourcesContent":["import { Accessor, Interface, singletonFactory } from '../../utils'\nimport { GraphQLInputObjectType, GraphQLNonNull } from 'graphql'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { Model } from '@contember/schema'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception'\n\ntype Args = {\n\tentityName: string\n\trelationName: string\n}\n\nexport class ConnectOrCreateRelationInputProvider {\n\tprivate inputs = singletonFactory<GraphQLInputObjectType, Args>(id => this.createInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t) {\n\t}\n\n\tgetInput(entityName: string, relationName: string) {\n\t\treturn this.inputs({ entityName, relationName })\n\t}\n\n\tprivate createInput(entityName: string, relationName: string) {\n\t\treturn acceptFieldVisitor<GraphQLInputObjectType>(this.schema, entityName, relationName, {\n\t\t\tvisitColumn() {\n\t\t\t\tthrow new ImplementationException()\n\t\t\t},\n\t\t\tvisitRelation: ({ entity, targetEntity, targetRelation, relation }) => {\n\t\t\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\t\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\t\t\tif (!uniqueWhere || !createInput) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\n\t\t\t\treturn new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}ConnectOrCreate${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tconnect: { type: new GraphQLNonNull(uniqueWhere) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInput) },\n\t\t\t\t\t}),\n\t\t\t\t})\n\t\t\t},\n\t\t})\n\t}\n}\n"],"names":["singletonFactory","acceptFieldVisitor","ImplementationException","GraphQLInputObjectType","GqlTypeName","GraphQLNonNull"],"mappings":";;;;;;;;;;AAcO,MAAM,qCAAqC;AAAA,EAGjD,YACkB,QACA,kBACA,mCAChB;AAHgB,SAAA,SAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AALlB,kBAAA,MAAQ,UAASA,iBAAAA,iBAA+C,CAAA,OAAM,KAAK,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAOtH;AAAA,EAEA,SAAS,YAAoB,cAAsB;AAClD,WAAO,KAAK,OAAO,EAAE,YAAY,cAAc;AAAA,EAChD;AAAA,EAEQ,YAAY,YAAoB,cAAsB;AAC7D,WAAOC,YAAAA,mBAA2C,KAAK,QAAQ,YAAY,cAAc;AAAA,MACxF,cAAc;AACb,cAAM,IAAIC,UAAAA,wBAAA;AAAA,MACX;AAAA,MACA,eAAe,CAAC,EAAE,QAAQ,cAAc,gBAAgB,eAAe;AACtE,cAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,cAAM,aAAa,iBAAiB,eAAe,OAAO;AAC1D,cAAM,cAAc,KAAK,kCAAkC,IAAA,EAAM,SAAS,aAAa,MAAM,UAAU;AACvG,YAAI,CAAC,eAAe,CAAC,aAAa;AACjC,gBAAM,IAAIA,UAAAA,wBAAA;AAAA,QACX;AAEA,eAAO,IAAIC,QAAAA,uBAAuB;AAAA,UACjC,MAAMC,MAAAA,cAAc,OAAO,IAAI,kBAAkB,SAAS,IAAI;AAAA,UAC9D,QAAQ,OAAO;AAAA,YACd,SAAS,EAAE,MAAM,IAAIC,QAAAA,eAAe,WAAW,EAAA;AAAA,YAC/C,QAAQ,EAAE,MAAM,IAAIA,QAAAA,eAAe,WAAW,EAAA;AAAA,UAAE;AAAA,QACjD,CACA;AAAA,MACF;AAAA,IAAA,CACA;AAAA,EACF;AACD;;"}
|
|
1
|
+
{"version":3,"file":"ConnectOrCreateRelationInputProvider.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/ConnectOrCreateRelationInputProvider.ts"],"sourcesContent":["import { Accessor, Interface, singletonFactory } from '../../utils/index.js'\nimport { GraphQLInputObjectType, GraphQLNonNull } from 'graphql'\nimport { GqlTypeName } from '../utils.js'\nimport { WhereTypeProvider } from '../WhereTypeProvider.js'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider.js'\nimport { Model } from '@contember/schema'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception.js'\n\ntype Args = {\n\tentityName: string\n\trelationName: string\n}\n\nexport class ConnectOrCreateRelationInputProvider {\n\tprivate inputs = singletonFactory<GraphQLInputObjectType, Args>(id => this.createInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t) {\n\t}\n\n\tgetInput(entityName: string, relationName: string) {\n\t\treturn this.inputs({ entityName, relationName })\n\t}\n\n\tprivate createInput(entityName: string, relationName: string) {\n\t\treturn acceptFieldVisitor<GraphQLInputObjectType>(this.schema, entityName, relationName, {\n\t\t\tvisitColumn() {\n\t\t\t\tthrow new ImplementationException()\n\t\t\t},\n\t\t\tvisitRelation: ({ entity, targetEntity, targetRelation, relation }) => {\n\t\t\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\t\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\t\t\tif (!uniqueWhere || !createInput) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\n\t\t\t\treturn new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}ConnectOrCreate${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tconnect: { type: new GraphQLNonNull(uniqueWhere) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInput) },\n\t\t\t\t\t}),\n\t\t\t\t})\n\t\t\t},\n\t\t})\n\t}\n}\n"],"names":["singletonFactory","acceptFieldVisitor","ImplementationException","GraphQLInputObjectType","GqlTypeName","GraphQLNonNull"],"mappings":";;;;;;;;;;AAcO,MAAM,qCAAqC;AAAA,EAGjD,YACkB,QACA,kBACA,mCAChB;AAHgB,SAAA,SAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AALlB,kBAAA,MAAQ,UAASA,iBAAAA,iBAA+C,CAAA,OAAM,KAAK,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAOtH;AAAA,EAEA,SAAS,YAAoB,cAAsB;AAClD,WAAO,KAAK,OAAO,EAAE,YAAY,cAAc;AAAA,EAChD;AAAA,EAEQ,YAAY,YAAoB,cAAsB;AAC7D,WAAOC,YAAAA,mBAA2C,KAAK,QAAQ,YAAY,cAAc;AAAA,MACxF,cAAc;AACb,cAAM,IAAIC,UAAAA,wBAAA;AAAA,MACX;AAAA,MACA,eAAe,CAAC,EAAE,QAAQ,cAAc,gBAAgB,eAAe;AACtE,cAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,cAAM,aAAa,iBAAiB,eAAe,OAAO;AAC1D,cAAM,cAAc,KAAK,kCAAkC,IAAA,EAAM,SAAS,aAAa,MAAM,UAAU;AACvG,YAAI,CAAC,eAAe,CAAC,aAAa;AACjC,gBAAM,IAAIA,UAAAA,wBAAA;AAAA,QACX;AAEA,eAAO,IAAIC,QAAAA,uBAAuB;AAAA,UACjC,MAAMC,MAAAA,cAAc,OAAO,IAAI,kBAAkB,SAAS,IAAI;AAAA,UAC9D,QAAQ,OAAO;AAAA,YACd,SAAS,EAAE,MAAM,IAAIC,QAAAA,eAAe,WAAW,EAAA;AAAA,YAC/C,QAAQ,EAAE,MAAM,IAAIA,QAAAA,eAAe,WAAW,EAAA;AAAA,UAAE;AAAA,QACjD,CACA;AAAA,MACF;AAAA,IAAA,CACA;AAAA,EACF;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectOrCreateRelationInputProvider.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/ConnectOrCreateRelationInputProvider.ts"],"sourcesContent":["import { Accessor, Interface, singletonFactory } from '../../utils'\nimport { GraphQLInputObjectType, GraphQLNonNull } from 'graphql'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { Model } from '@contember/schema'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception'\n\ntype Args = {\n\tentityName: string\n\trelationName: string\n}\n\nexport class ConnectOrCreateRelationInputProvider {\n\tprivate inputs = singletonFactory<GraphQLInputObjectType, Args>(id => this.createInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t) {\n\t}\n\n\tgetInput(entityName: string, relationName: string) {\n\t\treturn this.inputs({ entityName, relationName })\n\t}\n\n\tprivate createInput(entityName: string, relationName: string) {\n\t\treturn acceptFieldVisitor<GraphQLInputObjectType>(this.schema, entityName, relationName, {\n\t\t\tvisitColumn() {\n\t\t\t\tthrow new ImplementationException()\n\t\t\t},\n\t\t\tvisitRelation: ({ entity, targetEntity, targetRelation, relation }) => {\n\t\t\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\t\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\t\t\tif (!uniqueWhere || !createInput) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\n\t\t\t\treturn new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}ConnectOrCreate${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tconnect: { type: new GraphQLNonNull(uniqueWhere) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInput) },\n\t\t\t\t\t}),\n\t\t\t\t})\n\t\t\t},\n\t\t})\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAcO,MAAM,qCAAqC;AAAA,EAGjD,YACkB,QACA,kBACA,mCAChB;AAHgB,SAAA,SAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AALlB,kBAAA,MAAQ,UAAS,iBAA+C,CAAA,OAAM,KAAK,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAOtH;AAAA,EAEA,SAAS,YAAoB,cAAsB;AAClD,WAAO,KAAK,OAAO,EAAE,YAAY,cAAc;AAAA,EAChD;AAAA,EAEQ,YAAY,YAAoB,cAAsB;AAC7D,WAAO,mBAA2C,KAAK,QAAQ,YAAY,cAAc;AAAA,MACxF,cAAc;AACb,cAAM,IAAI,wBAAA;AAAA,MACX;AAAA,MACA,eAAe,CAAC,EAAE,QAAQ,cAAc,gBAAgB,eAAe;AACtE,cAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,cAAM,aAAa,iBAAiB,eAAe,OAAO;AAC1D,cAAM,cAAc,KAAK,kCAAkC,IAAA,EAAM,SAAS,aAAa,MAAM,UAAU;AACvG,YAAI,CAAC,eAAe,CAAC,aAAa;AACjC,gBAAM,IAAI,wBAAA;AAAA,QACX;AAEA,eAAO,IAAI,uBAAuB;AAAA,UACjC,MAAM,cAAc,OAAO,IAAI,kBAAkB,SAAS,IAAI;AAAA,UAC9D,QAAQ,OAAO;AAAA,YACd,SAAS,EAAE,MAAM,IAAI,eAAe,WAAW,EAAA;AAAA,YAC/C,QAAQ,EAAE,MAAM,IAAI,eAAe,WAAW,EAAA;AAAA,UAAE;AAAA,QACjD,CACA;AAAA,MACF;AAAA,IAAA,CACA;AAAA,EACF;AACD;"}
|
|
1
|
+
{"version":3,"file":"ConnectOrCreateRelationInputProvider.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/ConnectOrCreateRelationInputProvider.ts"],"sourcesContent":["import { Accessor, Interface, singletonFactory } from '../../utils/index.js'\nimport { GraphQLInputObjectType, GraphQLNonNull } from 'graphql'\nimport { GqlTypeName } from '../utils.js'\nimport { WhereTypeProvider } from '../WhereTypeProvider.js'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider.js'\nimport { Model } from '@contember/schema'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception.js'\n\ntype Args = {\n\tentityName: string\n\trelationName: string\n}\n\nexport class ConnectOrCreateRelationInputProvider {\n\tprivate inputs = singletonFactory<GraphQLInputObjectType, Args>(id => this.createInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t) {\n\t}\n\n\tgetInput(entityName: string, relationName: string) {\n\t\treturn this.inputs({ entityName, relationName })\n\t}\n\n\tprivate createInput(entityName: string, relationName: string) {\n\t\treturn acceptFieldVisitor<GraphQLInputObjectType>(this.schema, entityName, relationName, {\n\t\t\tvisitColumn() {\n\t\t\t\tthrow new ImplementationException()\n\t\t\t},\n\t\t\tvisitRelation: ({ entity, targetEntity, targetRelation, relation }) => {\n\t\t\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\t\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\t\t\tif (!uniqueWhere || !createInput) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\n\t\t\t\treturn new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}ConnectOrCreate${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tconnect: { type: new GraphQLNonNull(uniqueWhere) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInput) },\n\t\t\t\t\t}),\n\t\t\t\t})\n\t\t\t},\n\t\t})\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAcO,MAAM,qCAAqC;AAAA,EAGjD,YACkB,QACA,kBACA,mCAChB;AAHgB,SAAA,SAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AALlB,kBAAA,MAAQ,UAAS,iBAA+C,CAAA,OAAM,KAAK,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAOtH;AAAA,EAEA,SAAS,YAAoB,cAAsB;AAClD,WAAO,KAAK,OAAO,EAAE,YAAY,cAAc;AAAA,EAChD;AAAA,EAEQ,YAAY,YAAoB,cAAsB;AAC7D,WAAO,mBAA2C,KAAK,QAAQ,YAAY,cAAc;AAAA,MACxF,cAAc;AACb,cAAM,IAAI,wBAAA;AAAA,MACX;AAAA,MACA,eAAe,CAAC,EAAE,QAAQ,cAAc,gBAAgB,eAAe;AACtE,cAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,cAAM,aAAa,iBAAiB,eAAe,OAAO;AAC1D,cAAM,cAAc,KAAK,kCAAkC,IAAA,EAAM,SAAS,aAAa,MAAM,UAAU;AACvG,YAAI,CAAC,eAAe,CAAC,aAAa;AACjC,gBAAM,IAAI,wBAAA;AAAA,QACX;AAEA,eAAO,IAAI,uBAAuB;AAAA,UACjC,MAAM,cAAc,OAAO,IAAI,kBAAkB,SAAS,IAAI;AAAA,UAC9D,QAAQ,OAAO;AAAA,YACd,SAAS,EAAE,MAAM,IAAI,eAAe,WAAW,EAAA;AAAA,YAC/C,QAAQ,EAAE,MAAM,IAAI,eAAe,WAAW,EAAA;AAAA,UAAE;AAAA,QACjD,CACA;AAAA,MACF;AAAA,IAAA,CACA;AAAA,EACF;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateEntityInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfig, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { CreateEntityRelationInputProvider } from './CreateEntityRelationInputProvider'\nimport { Authorizator } from '../../acl'\n\nexport class CreateEntityInputFieldVisitor\n\timplements Model.ColumnVisitor<GraphQLInputFieldConfig | undefined>, Model.RelationByGenericTypeVisitor<GraphQLInputFieldConfig | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly createEntityRelationInputProvider: CreateEntityRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn({ entity, column }: Model.ColumnContext): GraphQLInputFieldConfig | undefined {\n\t\tif (entity.primary === column.name && !this.authorizator.isCustomPrimaryAllowed(entity.name)) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getFieldPermissions(Acl.Operation.create, entity.name, column.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\treturn { type }\n\t}\n\n\tpublic visitHasOne({ entity, relation }: Model.AnyHasOneRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn { type }\n\t}\n\n\tpublic visitHasMany({ entity, relation }: Model.AnyHasManyRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(type)),\n\t\t}\n\t}\n}\n"],"names":["schema","Acl","GraphQLList","GraphQLNonNull"],"mappings":";;;;AAMO,MAAM,8BAEb;AAAA,EACC,YACkBA,SACA,cACA,oBACA,mCAChB;AAJgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EACf;AAAA,EAEI,YAAY,EAAE,QAAQ,UAAoE;AAChG,QAAI,OAAO,YAAY,OAAO,QAAQ,CAAC,KAAK,aAAa,uBAAuB,OAAO,IAAI,GAAG;AAC7F,aAAO;AAAA,IACR;AACA,QAAI,KAAK,aAAa,oBAAoBC,OAAAA,IAAI,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AACnG,aAAO;AAAA,IACR;AACA,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,YAAY,EAAE,QAAQ,YAAiF;AAC7G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,aAAa,EAAE,QAAQ,YAAkF;AAC/G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAIC,QAAAA,YAAY,IAAIC,QAAAA,eAAe,IAAI,CAAC;AAAA,IAAA;AAAA,EAEhD;AACD;;"}
|
|
1
|
+
{"version":3,"file":"CreateEntityInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfig, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver.js'\nimport { CreateEntityRelationInputProvider } from './CreateEntityRelationInputProvider.js'\nimport { Authorizator } from '../../acl/index.js'\n\nexport class CreateEntityInputFieldVisitor\n\timplements Model.ColumnVisitor<GraphQLInputFieldConfig | undefined>, Model.RelationByGenericTypeVisitor<GraphQLInputFieldConfig | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly createEntityRelationInputProvider: CreateEntityRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn({ entity, column }: Model.ColumnContext): GraphQLInputFieldConfig | undefined {\n\t\tif (entity.primary === column.name && !this.authorizator.isCustomPrimaryAllowed(entity.name)) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getFieldPermissions(Acl.Operation.create, entity.name, column.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\treturn { type }\n\t}\n\n\tpublic visitHasOne({ entity, relation }: Model.AnyHasOneRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn { type }\n\t}\n\n\tpublic visitHasMany({ entity, relation }: Model.AnyHasManyRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(type)),\n\t\t}\n\t}\n}\n"],"names":["schema","Acl","GraphQLList","GraphQLNonNull"],"mappings":";;;;AAMO,MAAM,8BAEb;AAAA,EACC,YACkBA,SACA,cACA,oBACA,mCAChB;AAJgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EACf;AAAA,EAEI,YAAY,EAAE,QAAQ,UAAoE;AAChG,QAAI,OAAO,YAAY,OAAO,QAAQ,CAAC,KAAK,aAAa,uBAAuB,OAAO,IAAI,GAAG;AAC7F,aAAO;AAAA,IACR;AACA,QAAI,KAAK,aAAa,oBAAoBC,OAAAA,IAAI,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AACnG,aAAO;AAAA,IACR;AACA,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,YAAY,EAAE,QAAQ,YAAiF;AAC7G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,aAAa,EAAE,QAAQ,YAAkF;AAC/G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAIC,QAAAA,YAAY,IAAIC,QAAAA,eAAe,IAAI,CAAC;AAAA,IAAA;AAAA,EAEhD;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateEntityInputFieldVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfig, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { CreateEntityRelationInputProvider } from './CreateEntityRelationInputProvider'\nimport { Authorizator } from '../../acl'\n\nexport class CreateEntityInputFieldVisitor\n\timplements Model.ColumnVisitor<GraphQLInputFieldConfig | undefined>, Model.RelationByGenericTypeVisitor<GraphQLInputFieldConfig | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly createEntityRelationInputProvider: CreateEntityRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn({ entity, column }: Model.ColumnContext): GraphQLInputFieldConfig | undefined {\n\t\tif (entity.primary === column.name && !this.authorizator.isCustomPrimaryAllowed(entity.name)) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getFieldPermissions(Acl.Operation.create, entity.name, column.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\treturn { type }\n\t}\n\n\tpublic visitHasOne({ entity, relation }: Model.AnyHasOneRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn { type }\n\t}\n\n\tpublic visitHasMany({ entity, relation }: Model.AnyHasManyRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(type)),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAMO,MAAM,8BAEb;AAAA,EACC,YACkB,QACA,cACA,oBACA,mCAChB;AAJgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EACf;AAAA,EAEI,YAAY,EAAE,QAAQ,UAAoE;AAChG,QAAI,OAAO,YAAY,OAAO,QAAQ,CAAC,KAAK,aAAa,uBAAuB,OAAO,IAAI,GAAG;AAC7F,aAAO;AAAA,IACR;AACA,QAAI,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AACnG,aAAO;AAAA,IACR;AACA,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,YAAY,EAAE,QAAQ,YAAiF;AAC7G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,aAAa,EAAE,QAAQ,YAAkF;AAC/G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAI,YAAY,IAAI,eAAe,IAAI,CAAC;AAAA,IAAA;AAAA,EAEhD;AACD;"}
|
|
1
|
+
{"version":3,"file":"CreateEntityInputFieldVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfig, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver.js'\nimport { CreateEntityRelationInputProvider } from './CreateEntityRelationInputProvider.js'\nimport { Authorizator } from '../../acl/index.js'\n\nexport class CreateEntityInputFieldVisitor\n\timplements Model.ColumnVisitor<GraphQLInputFieldConfig | undefined>, Model.RelationByGenericTypeVisitor<GraphQLInputFieldConfig | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly createEntityRelationInputProvider: CreateEntityRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn({ entity, column }: Model.ColumnContext): GraphQLInputFieldConfig | undefined {\n\t\tif (entity.primary === column.name && !this.authorizator.isCustomPrimaryAllowed(entity.name)) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getFieldPermissions(Acl.Operation.create, entity.name, column.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\treturn { type }\n\t}\n\n\tpublic visitHasOne({ entity, relation }: Model.AnyHasOneRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn { type }\n\t}\n\n\tpublic visitHasMany({ entity, relation }: Model.AnyHasManyRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(type)),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAMO,MAAM,8BAEb;AAAA,EACC,YACkB,QACA,cACA,oBACA,mCAChB;AAJgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EACf;AAAA,EAEI,YAAY,EAAE,QAAQ,UAAoE;AAChG,QAAI,OAAO,YAAY,OAAO,QAAQ,CAAC,KAAK,aAAa,uBAAuB,OAAO,IAAI,GAAG;AAC7F,aAAO;AAAA,IACR;AACA,QAAI,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AACnG,aAAO;AAAA,IACR;AACA,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,YAAY,EAAE,QAAQ,YAAiF;AAC7G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,aAAa,EAAE,QAAQ,YAAkF;AAC/G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAI,YAAY,IAAI,eAAe,IAAI,CAAC;AAAA,IAAA;AAAA,EAEhD;AACD;"}
|
package/dist/production/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateEntityRelationAllowedOperationsVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class CreateEntityRelationAllowedOperationsVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByTypeVisitor<Input.CreateRelationOperation[]>\n{\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetEntity, targetRelation }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, entity, relation }: Model.ManyHasOneContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasOneInverse({ targetEntity, targetRelation, relation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (!targetRelation || targetRelation.nullable || relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.CreateRelationOperation[] {\n\t\tconst result: Input.CreateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canCreateOwning = this.authorizator.getFieldPermissions(Acl.Operation.create, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connect)\n\t\t}\n\t\tif (canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.create)\n\t\t}\n\t\tif (canReadTargetEntity && canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":["ImplementationException","Input","Acl"],"mappings":";;;;AAIO,MAAM,6CAEb;AAAA,EACC,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAA6B;AAAA,EAE1D,cAAqB;AACpB,UAAM,IAAIA,UAAAA,wBAAwB,2EAA2E;AAAA,EAC9G;AAAA,EAEO,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,uBAAuB,EAAE,QAAQ,cAAc,YAA4C;AACjG,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,gBAAgB,EAAE,cAAc,kBAA2C;AACjF,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,gBAAgB,EAAE,cAAc,QAAQ,YAAqC;AACnF,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,sBAAsB,EAAE,cAAc,gBAAgB,YAA2C;AACvG,UAAM,aAAa,KAAK,qBAAqB,cAAc,cAAc,cAAc;AACvF,QAAI,SAAS,YAAY,eAAe,UAAU;AACjD,aAAO;AAAA,IACR;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,OAAOC,OAAAA,MAAM,wBAAwB,MAAM;AAAA,EAC3E;AAAA,EAEO,qBAAqB,EAAE,cAAc,QAAQ,UAAU,kBAAgD;AAC7G,UAAM,aAAa,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAC3E,QAAI,CAAC,kBAAkB,eAAe,YAAY,SAAS,UAAU;AACpE,aAAO;AAAA,IACR;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,OAAOA,OAAAA,MAAM,wBAAwB,MAAM;AAAA,EAC3E;AAAA,EAEQ,qBACP,cACA,cACA,gBACkC;AAClC,UAAM,SAA0C,CAAA;AAEhD,UAAM,sBAAsB,KAAK,aAAa,oBAAoBC,OAAAA,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM;AAC7G,UAAM,wBAAwB,KAAK,aAAa,oBAAoBA,OAAAA,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AACjH,UAAM,kBAAkB,KAAK,aAAa,oBAAoBA,OAAAA,IAAI,UAAU,QAAQ,aAAa,MAAM,eAAe,IAAI,MAAM;AAEhI,QAAI,uBAAuB,iBAAiB;AAC3C,aAAO,KAAKD,aAAM,wBAAwB,OAAO;AAAA,IAClD;AACA,QAAI,yBAAyB,iBAAiB;AAC7C,aAAO,KAAKA,aAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,uBAAuB,yBAAyB,iBAAiB;AACpE,aAAO,KAAKA,aAAM,wBAAwB,eAAe;AAAA,IAC1D;AAEA,WAAO;AAAA,EACR;AACD;;"}
|
|
1
|
+
{"version":3,"file":"CreateEntityRelationAllowedOperationsVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl/index.js'\nimport { ImplementationException } from '../../exception.js'\n\nexport class CreateEntityRelationAllowedOperationsVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByTypeVisitor<Input.CreateRelationOperation[]>\n{\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetEntity, targetRelation }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, entity, relation }: Model.ManyHasOneContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasOneInverse({ targetEntity, targetRelation, relation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (!targetRelation || targetRelation.nullable || relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.CreateRelationOperation[] {\n\t\tconst result: Input.CreateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canCreateOwning = this.authorizator.getFieldPermissions(Acl.Operation.create, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connect)\n\t\t}\n\t\tif (canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.create)\n\t\t}\n\t\tif (canReadTargetEntity && canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":["ImplementationException","Input","Acl"],"mappings":";;;;AAIO,MAAM,6CAEb;AAAA,EACC,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAA6B;AAAA,EAE1D,cAAqB;AACpB,UAAM,IAAIA,UAAAA,wBAAwB,2EAA2E;AAAA,EAC9G;AAAA,EAEO,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,uBAAuB,EAAE,QAAQ,cAAc,YAA4C;AACjG,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,gBAAgB,EAAE,cAAc,kBAA2C;AACjF,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,gBAAgB,EAAE,cAAc,QAAQ,YAAqC;AACnF,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,sBAAsB,EAAE,cAAc,gBAAgB,YAA2C;AACvG,UAAM,aAAa,KAAK,qBAAqB,cAAc,cAAc,cAAc;AACvF,QAAI,SAAS,YAAY,eAAe,UAAU;AACjD,aAAO;AAAA,IACR;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,OAAOC,OAAAA,MAAM,wBAAwB,MAAM;AAAA,EAC3E;AAAA,EAEO,qBAAqB,EAAE,cAAc,QAAQ,UAAU,kBAAgD;AAC7G,UAAM,aAAa,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAC3E,QAAI,CAAC,kBAAkB,eAAe,YAAY,SAAS,UAAU;AACpE,aAAO;AAAA,IACR;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,OAAOA,OAAAA,MAAM,wBAAwB,MAAM;AAAA,EAC3E;AAAA,EAEQ,qBACP,cACA,cACA,gBACkC;AAClC,UAAM,SAA0C,CAAA;AAEhD,UAAM,sBAAsB,KAAK,aAAa,oBAAoBC,OAAAA,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM;AAC7G,UAAM,wBAAwB,KAAK,aAAa,oBAAoBA,OAAAA,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AACjH,UAAM,kBAAkB,KAAK,aAAa,oBAAoBA,OAAAA,IAAI,UAAU,QAAQ,aAAa,MAAM,eAAe,IAAI,MAAM;AAEhI,QAAI,uBAAuB,iBAAiB;AAC3C,aAAO,KAAKD,aAAM,wBAAwB,OAAO;AAAA,IAClD;AACA,QAAI,yBAAyB,iBAAiB;AAC7C,aAAO,KAAKA,aAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,uBAAuB,yBAAyB,iBAAiB;AACpE,aAAO,KAAKA,aAAM,wBAAwB,eAAe;AAAA,IAC1D;AAEA,WAAO;AAAA,EACR;AACD;;"}
|
package/dist/production/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateEntityRelationAllowedOperationsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class CreateEntityRelationAllowedOperationsVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByTypeVisitor<Input.CreateRelationOperation[]>\n{\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetEntity, targetRelation }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, entity, relation }: Model.ManyHasOneContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasOneInverse({ targetEntity, targetRelation, relation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (!targetRelation || targetRelation.nullable || relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.CreateRelationOperation[] {\n\t\tconst result: Input.CreateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canCreateOwning = this.authorizator.getFieldPermissions(Acl.Operation.create, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connect)\n\t\t}\n\t\tif (canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.create)\n\t\t}\n\t\tif (canReadTargetEntity && canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,6CAEb;AAAA,EACC,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAA6B;AAAA,EAE1D,cAAqB;AACpB,UAAM,IAAI,wBAAwB,2EAA2E;AAAA,EAC9G;AAAA,EAEO,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,uBAAuB,EAAE,QAAQ,cAAc,YAA4C;AACjG,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,gBAAgB,EAAE,cAAc,kBAA2C;AACjF,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,gBAAgB,EAAE,cAAc,QAAQ,YAAqC;AACnF,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,sBAAsB,EAAE,cAAc,gBAAgB,YAA2C;AACvG,UAAM,aAAa,KAAK,qBAAqB,cAAc,cAAc,cAAc;AACvF,QAAI,SAAS,YAAY,eAAe,UAAU;AACjD,aAAO;AAAA,IACR;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,OAAO,MAAM,wBAAwB,MAAM;AAAA,EAC3E;AAAA,EAEO,qBAAqB,EAAE,cAAc,QAAQ,UAAU,kBAAgD;AAC7G,UAAM,aAAa,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAC3E,QAAI,CAAC,kBAAkB,eAAe,YAAY,SAAS,UAAU;AACpE,aAAO;AAAA,IACR;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,OAAO,MAAM,wBAAwB,MAAM;AAAA,EAC3E;AAAA,EAEQ,qBACP,cACA,cACA,gBACkC;AAClC,UAAM,SAA0C,CAAA;AAEhD,UAAM,sBAAsB,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM;AAC7G,UAAM,wBAAwB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AACjH,UAAM,kBAAkB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,MAAM,eAAe,IAAI,MAAM;AAEhI,QAAI,uBAAuB,iBAAiB;AAC3C,aAAO,KAAK,MAAM,wBAAwB,OAAO;AAAA,IAClD;AACA,QAAI,yBAAyB,iBAAiB;AAC7C,aAAO,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,uBAAuB,yBAAyB,iBAAiB;AACpE,aAAO,KAAK,MAAM,wBAAwB,eAAe;AAAA,IAC1D;AAEA,WAAO;AAAA,EACR;AACD;"}
|
|
1
|
+
{"version":3,"file":"CreateEntityRelationAllowedOperationsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl/index.js'\nimport { ImplementationException } from '../../exception.js'\n\nexport class CreateEntityRelationAllowedOperationsVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByTypeVisitor<Input.CreateRelationOperation[]>\n{\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetEntity, targetRelation }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, entity, relation }: Model.ManyHasOneContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasOneInverse({ targetEntity, targetRelation, relation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (!targetRelation || targetRelation.nullable || relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.CreateRelationOperation[] {\n\t\tconst result: Input.CreateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canCreateOwning = this.authorizator.getFieldPermissions(Acl.Operation.create, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connect)\n\t\t}\n\t\tif (canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.create)\n\t\t}\n\t\tif (canReadTargetEntity && canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,6CAEb;AAAA,EACC,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAA6B;AAAA,EAE1D,cAAqB;AACpB,UAAM,IAAI,wBAAwB,2EAA2E;AAAA,EAC9G;AAAA,EAEO,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,uBAAuB,EAAE,QAAQ,cAAc,YAA4C;AACjG,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,gBAAgB,EAAE,cAAc,kBAA2C;AACjF,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,gBAAgB,EAAE,cAAc,QAAQ,YAAqC;AACnF,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,sBAAsB,EAAE,cAAc,gBAAgB,YAA2C;AACvG,UAAM,aAAa,KAAK,qBAAqB,cAAc,cAAc,cAAc;AACvF,QAAI,SAAS,YAAY,eAAe,UAAU;AACjD,aAAO;AAAA,IACR;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,OAAO,MAAM,wBAAwB,MAAM;AAAA,EAC3E;AAAA,EAEO,qBAAqB,EAAE,cAAc,QAAQ,UAAU,kBAAgD;AAC7G,UAAM,aAAa,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAC3E,QAAI,CAAC,kBAAkB,eAAe,YAAY,SAAS,UAAU;AACpE,aAAO;AAAA,IACR;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,OAAO,MAAM,wBAAwB,MAAM;AAAA,EAC3E;AAAA,EAEQ,qBACP,cACA,cACA,gBACkC;AAClC,UAAM,SAA0C,CAAA;AAEhD,UAAM,sBAAsB,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM;AAC7G,UAAM,wBAAwB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AACjH,UAAM,kBAAkB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,MAAM,eAAe,IAAI,MAAM;AAEhI,QAAI,uBAAuB,iBAAiB;AAC3C,aAAO,KAAK,MAAM,wBAAwB,OAAO;AAAA,IAClD;AACA,QAAI,yBAAyB,iBAAiB;AAC7C,aAAO,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,uBAAuB,yBAAyB,iBAAiB;AACpE,aAAO,KAAK,MAAM,wBAAwB,eAAe;AAAA,IAC1D;AAEA,WAAO;AAAA,EACR;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateEntityRelationInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLString } from 'graphql'\nimport { Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { Accessor, Interface } from '../../utils'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { CreateEntityRelationAllowedOperationsVisitor } from './CreateEntityRelationAllowedOperationsVisitor'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider'\n\nexport class CreateEntityRelationInputFieldVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t\tprivate readonly createEntityRelationAllowedOperationsVisitor: CreateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne(context: Model.ManyHasOneContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, false)\n\t}\n\n\tpublic visitHasMany(context: Model.OneHasManyContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, true)\n\t}\n\n\tpublic createInputObject(\n\t\t{ entity, relation, targetEntity, targetRelation }: Model.AnyRelationContext,\n\t\twithAliasField: boolean,\n\t): GraphQLInputObjectType | undefined {\n\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.createEntityRelationAllowedOperationsVisitor,\n\t\t)\n\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connect) && uniqueWhere) {\n\t\t\tfields[Input.CreateRelationOperation.connect] = {\n\t\t\t\ttype: uniqueWhere,\n\t\t\t}\n\t\t}\n\n\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.create) && createInput !== undefined) {\n\t\t\tfields[Input.CreateRelationOperation.create] = {\n\t\t\t\ttype: createInput,\n\t\t\t}\n\t\t}\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connectOrCreate) && uniqueWhere !== undefined && createInput !== undefined) {\n\t\t\tconst connectOrCreateInput = this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name)\n\t\t\tif (connectOrCreateInput) {\n\t\t\t\tfields[Input.CreateRelationOperation.connectOrCreate] = {\n\t\t\t\t\ttype: connectOrCreateInput,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (Object.keys(fields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Create${relation.name}EntityRelationInput`,\n\t\t\tfields: () =>\n\t\t\t\twithAliasField\n\t\t\t\t\t? {\n\t\t\t\t\t\t...fields,\n\t\t\t\t\t\talias: { type: GraphQLString },\n\t\t\t\t\t}\n\t\t\t\t\t: fields,\n\t\t})\n\t}\n}\n"],"names":["schema","ImplementationException","acceptFieldVisitor","Input","GraphQLInputObjectType","GqlTypeName","GraphQLString"],"mappings":";;;;;;;AAWO,MAAM,sCAEb;AAAA,EACC,YACkBA,SACA,kBACA,mCACA,8CACA,sCAChB;AALgB,SAAA,SAAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AACA,SAAA,+CAAA;AACA,SAAA,uCAAA;AAAA,EACf;AAAA,EAEI,cAAqB;AAC3B,UAAM,IAAIC,UAAAA,wBAAwB,oEAAoE;AAAA,EACvG;AAAA,EAEO,YAAY,SAAsE;AACxF,WAAO,KAAK,kBAAkB,SAAS,KAAK;AAAA,EAC7C;AAAA,EAEO,aAAa,SAAsE;AACzF,WAAO,KAAK,kBAAkB,SAAS,IAAI;AAAA,EAC5C;AAAA,EAEO,kBACN,EAAE,QAAQ,UAAU,cAAc,eAAA,GAClC,gBACqC;AACrC,UAAM,aAAa,iBAAiB,eAAe,OAAO;AAC1D,UAAM,SAAqC,CAAA;AAC3C,UAAM,oBAAoBC,YAAAA;AAAAA,MACzB,KAAK;AAAA,MACL;AAAA,MACA,SAAS;AAAA,MACT,KAAK;AAAA,IAAA;AAGN,UAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,QAAI,kBAAkB,SAASC,OAAAA,MAAM,wBAAwB,OAAO,KAAK,aAAa;AACrF,aAAOA,OAAAA,MAAM,wBAAwB,OAAO,IAAI;AAAA,QAC/C,MAAM;AAAA,MAAA;AAAA,IAER;AAEA,UAAM,cAAc,KAAK,kCAAkC,IAAA,EAAM,SAAS,aAAa,MAAM,UAAU;AACvG,QAAI,kBAAkB,SAASA,OAAAA,MAAM,wBAAwB,MAAM,KAAK,gBAAgB,QAAW;AAClG,aAAOA,OAAAA,MAAM,wBAAwB,MAAM,IAAI;AAAA,QAC9C,MAAM;AAAA,MAAA;AAAA,IAER;AACA,QAAI,kBAAkB,SAASA,OAAAA,MAAM,wBAAwB,eAAe,KAAK,gBAAgB,UAAa,gBAAgB,QAAW;AACxI,YAAM,uBAAuB,KAAK,qCAAqC,SAAS,OAAO,MAAM,SAAS,IAAI;AAC1G,UAAI,sBAAsB;AACzB,eAAOA,OAAAA,MAAM,wBAAwB,eAAe,IAAI;AAAA,UACvD,MAAM;AAAA,QAAA;AAAA,MAER;AAAA,IACD;AACA,QAAI,OAAO,KAAK,MAAM,EAAE,WAAW,GAAG;AACrC,aAAO;AAAA,IACR;AACA,WAAO,IAAIC,QAAAA,uBAAuB;AAAA,MACjC,MAAMC,MAAAA,cAAc,OAAO,IAAI,SAAS,SAAS,IAAI;AAAA,MACrD,QAAQ,MACP,iBACG;AAAA,QACD,GAAG;AAAA,QACH,OAAO,EAAE,MAAMC,QAAAA,cAAA;AAAA,MAAc,IAE5B;AAAA,IAAA,CACJ;AAAA,EACF;AACD;;"}
|
|
1
|
+
{"version":3,"file":"CreateEntityRelationInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLString } from 'graphql'\nimport { Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils.js'\nimport { WhereTypeProvider } from '../WhereTypeProvider.js'\nimport { Accessor, Interface } from '../../utils/index.js'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider.js'\nimport { CreateEntityRelationAllowedOperationsVisitor } from './CreateEntityRelationAllowedOperationsVisitor.js'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception.js'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider.js'\n\nexport class CreateEntityRelationInputFieldVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t\tprivate readonly createEntityRelationAllowedOperationsVisitor: CreateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne(context: Model.ManyHasOneContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, false)\n\t}\n\n\tpublic visitHasMany(context: Model.OneHasManyContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, true)\n\t}\n\n\tpublic createInputObject(\n\t\t{ entity, relation, targetEntity, targetRelation }: Model.AnyRelationContext,\n\t\twithAliasField: boolean,\n\t): GraphQLInputObjectType | undefined {\n\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.createEntityRelationAllowedOperationsVisitor,\n\t\t)\n\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connect) && uniqueWhere) {\n\t\t\tfields[Input.CreateRelationOperation.connect] = {\n\t\t\t\ttype: uniqueWhere,\n\t\t\t}\n\t\t}\n\n\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.create) && createInput !== undefined) {\n\t\t\tfields[Input.CreateRelationOperation.create] = {\n\t\t\t\ttype: createInput,\n\t\t\t}\n\t\t}\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connectOrCreate) && uniqueWhere !== undefined && createInput !== undefined) {\n\t\t\tconst connectOrCreateInput = this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name)\n\t\t\tif (connectOrCreateInput) {\n\t\t\t\tfields[Input.CreateRelationOperation.connectOrCreate] = {\n\t\t\t\t\ttype: connectOrCreateInput,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (Object.keys(fields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Create${relation.name}EntityRelationInput`,\n\t\t\tfields: () =>\n\t\t\t\twithAliasField\n\t\t\t\t\t? {\n\t\t\t\t\t\t...fields,\n\t\t\t\t\t\talias: { type: GraphQLString },\n\t\t\t\t\t}\n\t\t\t\t\t: fields,\n\t\t})\n\t}\n}\n"],"names":["schema","ImplementationException","acceptFieldVisitor","Input","GraphQLInputObjectType","GqlTypeName","GraphQLString"],"mappings":";;;;;;;AAWO,MAAM,sCAEb;AAAA,EACC,YACkBA,SACA,kBACA,mCACA,8CACA,sCAChB;AALgB,SAAA,SAAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AACA,SA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,KAAK,MAAM,EAAE,WAAW,GAAG;AACrC,aAAO;AAAA,IACR;AACA,WAAO,IAAIC,QAAAA,uBAAuB;AAAA,MACjC,MAAMC,MAAAA,cAAc,OAAO,IAAI,SAAS,SAAS,IAAI;AAAA,MACrD,QAAQ,MACP,iBACG;AAAA,QACD,GAAG;AAAA,QACH,OAAO,EAAE,MAAMC,QAAAA,cAAA;AAAA,MAAc,IAE5B;AAAA,IAAA,CACJ;AAAA,EACF;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateEntityRelationInputFieldVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLString } from 'graphql'\nimport { Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { Accessor, Interface } from '../../utils'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { CreateEntityRelationAllowedOperationsVisitor } from './CreateEntityRelationAllowedOperationsVisitor'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider'\n\nexport class CreateEntityRelationInputFieldVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t\tprivate readonly createEntityRelationAllowedOperationsVisitor: CreateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne(context: Model.ManyHasOneContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, false)\n\t}\n\n\tpublic visitHasMany(context: Model.OneHasManyContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, true)\n\t}\n\n\tpublic createInputObject(\n\t\t{ entity, relation, targetEntity, targetRelation }: Model.AnyRelationContext,\n\t\twithAliasField: boolean,\n\t): GraphQLInputObjectType | undefined {\n\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.createEntityRelationAllowedOperationsVisitor,\n\t\t)\n\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connect) && uniqueWhere) {\n\t\t\tfields[Input.CreateRelationOperation.connect] = {\n\t\t\t\ttype: uniqueWhere,\n\t\t\t}\n\t\t}\n\n\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.create) && createInput !== undefined) {\n\t\t\tfields[Input.CreateRelationOperation.create] = {\n\t\t\t\ttype: createInput,\n\t\t\t}\n\t\t}\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connectOrCreate) && uniqueWhere !== undefined && createInput !== undefined) {\n\t\t\tconst connectOrCreateInput = this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name)\n\t\t\tif (connectOrCreateInput) {\n\t\t\t\tfields[Input.CreateRelationOperation.connectOrCreate] = {\n\t\t\t\t\ttype: connectOrCreateInput,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (Object.keys(fields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Create${relation.name}EntityRelationInput`,\n\t\t\tfields: () =>\n\t\t\t\twithAliasField\n\t\t\t\t\t? {\n\t\t\t\t\t\t...fields,\n\t\t\t\t\t\talias: { type: GraphQLString },\n\t\t\t\t\t}\n\t\t\t\t\t: fields,\n\t\t})\n\t}\n}\n"],"names":[],"mappings":";;;;;AAWO,MAAM,sCAEb;AAAA,EACC,YACkB,QACA,kBACA,mCACA,8CACA,sCAChB;AALgB,SAAA,SAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AACA,SAAA,+CAAA;AACA,SAAA,uCAAA;AAAA,EACf;AAAA,EAEI,cAAqB;AAC3B,UAAM,IAAI,wBAAwB,oEAAoE;AAAA,EACvG;AAAA,EAEO,YAAY,SAAsE;AACxF,WAAO,KAAK,kBAAkB,SAAS,KAAK;AAAA,EAC7C;AAAA,EAEO,aAAa,SAAsE;AACzF,WAAO,KAAK,kBAAkB,SAAS,IAAI;AAAA,EAC5C;AAAA,EAEO,kBACN,EAAE,QAAQ,UAAU,cAAc,eAAA,GAClC,gBACqC;AACrC,UAAM,aAAa,iBAAiB,eAAe,OAAO;AAC1D,UAAM,SAAqC,CAAA;AAC3C,UAAM,oBAAoB;AAAA,MACzB,KAAK;AAAA,MACL;AAAA,MACA,SAAS;AAAA,MACT,KAAK;AAAA,IAAA;AAGN,UAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,QAAI,kBAAkB,SAAS,MAAM,wBAAwB,OAAO,KAAK,aAAa;AACrF,aAAO,MAAM,wBAAwB,OAAO,IAAI;AAAA,QAC/C,MAAM;AAAA,MAAA;AAAA,IAER;AAEA,UAAM,cAAc,KAAK,kCAAkC,IAAA,EAAM,SAAS,aAAa,MAAM,UAAU;AACvG,QAAI,kBAAkB,SAAS,MAAM,wBAAwB,MAAM,KAAK,gBAAgB,QAAW;AAClG,aAAO,MAAM,wBAAwB,MAAM,IAAI;AAAA,QAC9C,MAAM;AAAA,MAAA;AAAA,IAER;AACA,QAAI,kBAAkB,SAAS,MAAM,wBAAwB,eAAe,KAAK,gBAAgB,UAAa,gBAAgB,QAAW;AACxI,YAAM,uBAAuB,KAAK,qCAAqC,SAAS,OAAO,MAAM,SAAS,IAAI;AAC1G,UAAI,sBAAsB;AACzB,eAAO,MAAM,wBAAwB,eAAe,IAAI;AAAA,UACvD,MAAM;AAAA,QAAA;AAAA,MAER;AAAA,IACD;AACA,QAAI,OAAO,KAAK,MAAM,EAAE,WAAW,GAAG;AACrC,aAAO;AAAA,IACR;AACA,WAAO,IAAI,uBAAuB;AAAA,MACjC,MAAM,cAAc,OAAO,IAAI,SAAS,SAAS,IAAI;AAAA,MACrD,QAAQ,MACP,iBACG;AAAA,QACD,GAAG;AAAA,QACH,OAAO,EAAE,MAAM,cAAA;AAAA,MAAc,IAE5B;AAAA,IAAA,CACJ;AAAA,EACF;AACD;"}
|
|
1
|
+
{"version":3,"file":"CreateEntityRelationInputFieldVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLString } from 'graphql'\nimport { Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils.js'\nimport { WhereTypeProvider } from '../WhereTypeProvider.js'\nimport { Accessor, Interface } from '../../utils/index.js'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider.js'\nimport { CreateEntityRelationAllowedOperationsVisitor } from './CreateEntityRelationAllowedOperationsVisitor.js'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception.js'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider.js'\n\nexport class CreateEntityRelationInputFieldVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t\tprivate readonly createEntityRelationAllowedOperationsVisitor: CreateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne(context: Model.ManyHasOneContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, false)\n\t}\n\n\tpublic visitHasMany(context: Model.OneHasManyContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, true)\n\t}\n\n\tpublic createInputObject(\n\t\t{ entity, relation, targetEntity, targetRelation }: Model.AnyRelationContext,\n\t\twithAliasField: boolean,\n\t): GraphQLInputObjectType | undefined {\n\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.createEntityRelationAllowedOperationsVisitor,\n\t\t)\n\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connect) && uniqueWhere) {\n\t\t\tfields[Input.CreateRelationOperation.connect] = {\n\t\t\t\ttype: uniqueWhere,\n\t\t\t}\n\t\t}\n\n\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.create) && createInput !== undefined) {\n\t\t\tfields[Input.CreateRelationOperation.create] = {\n\t\t\t\ttype: createInput,\n\t\t\t}\n\t\t}\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connectOrCreate) && uniqueWhere !== undefined && createInput !== undefined) {\n\t\t\tconst connectOrCreateInput = this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name)\n\t\t\tif (connectOrCreateInput) {\n\t\t\t\tfields[Input.CreateRelationOperation.connectOrCreate] = {\n\t\t\t\t\ttype: connectOrCreateInput,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (Object.keys(fields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Create${relation.name}EntityRelationInput`,\n\t\t\tfields: () =>\n\t\t\t\twithAliasField\n\t\t\t\t\t? {\n\t\t\t\t\t\t...fields,\n\t\t\t\t\t\talias: { type: GraphQLString },\n\t\t\t\t\t}\n\t\t\t\t\t: fields,\n\t\t})\n\t}\n}\n"],"names":[],"mappings":";;;;;AAWO,MAAM,sCAEb;AAAA,EACC,YACkB,QACA,kBACA,mCACA,8CACA,sCAChB;AALgB,SAAA,SAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AACA,SAAA,+CAAA;AACA,SAAA,uCAAA;AAAA,EACf;AAAA,EAEI,cAAqB;AAC3B,UAAM,IAAI,wBAAwB,oEAAoE;AAAA,EACvG;AAAA,EAEO,YAAY,SAAsE;AACxF,WAAO,KAAK,kBAAkB,SAAS,KAAK;AAAA,EAC7C;AAAA,EAEO,aAAa,SAAsE;AACzF,WAAO,KAAK,kBAAkB,SAAS,IAAI;AAAA,EAC5C;AAAA,EAEO,kBACN,EAAE,QAAQ,UAAU,cAAc,eAAA,GAClC,gBACqC;AACrC,UAAM,aAAa,iBAAiB,eAAe,OAAO;AAC1D,UAAM,SAAqC,CAAA;AAC3C,UAAM,oBAAoB;AAAA,MACzB,KAAK;AAAA,MACL;AAAA,MACA,SAAS;AAAA,MACT,KAAK;AAAA,IAAA;AAGN,UAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,QAAI,kBAAkB,SAAS,MAAM,wBAAwB,OAAO,KAAK,aAAa;AACrF,aAAO,MAAM,wBAAwB,OAAO,IAAI;AAAA,QAC/C,MAAM;AAAA,MAAA;AAAA,IAER;AAEA,UAAM,cAAc,KAAK,kCAAkC,IAAA,EAAM,SAAS,aAAa,MAAM,UAAU;AACvG,QAAI,kBAAkB,SAAS,MAAM,wBAAwB,MAAM,KAAK,gBAAgB,QAAW;AAClG,aAAO,MAAM,wBAAwB,MAAM,IAAI;AAAA,QAC9C,MAAM;AAAA,MAAA;AAAA,IAER;AACA,QAAI,kBAAkB,SAAS,MAAM,wBAAwB,eAAe,KAAK,gBAAgB,UAAa,gBAAgB,QAAW;AACxI,YAAM,uBAAuB,KAAK,qCAAqC,SAAS,OAAO,MAAM,SAAS,IAAI;AAC1G,UAAI,sBAAsB;AACzB,eAAO,MAAM,wBAAwB,eAAe,IAAI;AAAA,UACvD,MAAM;AAAA,QAAA;AAAA,MAER;AAAA,IACD;AACA,QAAI,OAAO,KAAK,MAAM,EAAE,WAAW,GAAG;AACrC,aAAO;AAAA,IACR;AACA,WAAO,IAAI,uBAAuB;AAAA,MACjC,MAAM,cAAc,OAAO,IAAI,SAAS,SAAS,IAAI;AAAA,MACrD,QAAQ,MACP,iBACG;AAAA,QACD,GAAG;AAAA,QACH,OAAO,EAAE,MAAM,cAAA;AAAA,MAAc,IAE5B;AAAA,IAAA,CACJ;AAAA,EACF;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateEntityRelationInputProvider.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationInputProvider.ts"],"sourcesContent":["import { acceptFieldVisitor } from '@contember/schema-utils'\nimport { CreateEntityRelationInputFieldVisitor } from './CreateEntityRelationInputFieldVisitor'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { singletonFactory } from '../../utils'\nimport { Model } from '@contember/schema'\n\nexport class CreateEntityRelationInputProvider {\n\tprivate createEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{ entityName: string; relationName: string }\n\t>(id => this.createCreateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly createEntityRelationInputFieldVisitor: CreateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getCreateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.createEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createCreateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.createEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":["singletonFactory","acceptFieldVisitor"],"mappings":";;;;;;;AAMO,MAAM,kCAAkC;AAAA,EAM9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAPlB,kBAAA,MAAQ,8BAA6BA,iBAAAA,iBAGnC,CAAA,OAAM,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAKzE;AAAA,EAEI,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,cAAc;AAAA,EACpE;AAAA,EAEQ,gCACP,YACA,cACqC;AACrC,WAAOC,YAAAA,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAC5G;AACD;;"}
|
|
1
|
+
{"version":3,"file":"CreateEntityRelationInputProvider.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationInputProvider.ts"],"sourcesContent":["import { acceptFieldVisitor } from '@contember/schema-utils'\nimport { CreateEntityRelationInputFieldVisitor } from './CreateEntityRelationInputFieldVisitor.js'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { singletonFactory } from '../../utils/index.js'\nimport { Model } from '@contember/schema'\n\nexport class CreateEntityRelationInputProvider {\n\tprivate createEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{ entityName: string; relationName: string }\n\t>(id => this.createCreateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly createEntityRelationInputFieldVisitor: CreateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getCreateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.createEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createCreateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.createEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":["singletonFactory","acceptFieldVisitor"],"mappings":";;;;;;;AAMO,MAAM,kCAAkC;AAAA,EAM9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAPlB,kBAAA,MAAQ,8BAA6BA,iBAAAA,iBAGnC,CAAA,OAAM,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAKzE;AAAA,EAEI,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,cAAc;AAAA,EACpE;AAAA,EAEQ,gCACP,YACA,cACqC;AACrC,WAAOC,YAAAA,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAC5G;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateEntityRelationInputProvider.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationInputProvider.ts"],"sourcesContent":["import { acceptFieldVisitor } from '@contember/schema-utils'\nimport { CreateEntityRelationInputFieldVisitor } from './CreateEntityRelationInputFieldVisitor'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { singletonFactory } from '../../utils'\nimport { Model } from '@contember/schema'\n\nexport class CreateEntityRelationInputProvider {\n\tprivate createEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{ entityName: string; relationName: string }\n\t>(id => this.createCreateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly createEntityRelationInputFieldVisitor: CreateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getCreateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.createEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createCreateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.createEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,kCAAkC;AAAA,EAM9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAPlB,kBAAA,MAAQ,8BAA6B,iBAGnC,CAAA,OAAM,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAKzE;AAAA,EAEI,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,cAAc;AAAA,EACpE;AAAA,EAEQ,gCACP,YACA,cACqC;AACrC,WAAO,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAC5G;AACD;"}
|
|
1
|
+
{"version":3,"file":"CreateEntityRelationInputProvider.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationInputProvider.ts"],"sourcesContent":["import { acceptFieldVisitor } from '@contember/schema-utils'\nimport { CreateEntityRelationInputFieldVisitor } from './CreateEntityRelationInputFieldVisitor.js'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { singletonFactory } from '../../utils/index.js'\nimport { Model } from '@contember/schema'\n\nexport class CreateEntityRelationInputProvider {\n\tprivate createEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{ entityName: string; relationName: string }\n\t>(id => this.createCreateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly createEntityRelationInputFieldVisitor: CreateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getCreateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.createEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createCreateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.createEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,kCAAkC;AAAA,EAM9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAPlB,kBAAA,MAAQ,8BAA6B,iBAGnC,CAAA,OAAM,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAKzE;AAAA,EAEI,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,cAAc;AAAA,EACpE;AAAA,EAEQ,gCACP,YACA,cACqC;AACrC,WAAO,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAC5G;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityInputProvider.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/EntityInputProvider.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLInputType } from 'graphql'\nimport { acceptFieldVisitor, getEntity } from '@contember/schema-utils'\nimport { GqlTypeName } from '../utils'\nimport { Acl, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\nimport { singletonFactory } from '../../utils'\nimport { ImplementationException } from '../../exception'\n\nexport class EntityInputProvider<Operation extends EntityInputType> {\n\tprivate entityInputs = singletonFactory<\n\t\tGraphQLInputType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\twithoutRelation?: string\n\t\t}\n\t>(id => this.createInput(getEntity(this.schema, id.entityName), id.withoutRelation))\n\n\tconstructor(\n\t\tprivate readonly operation: Operation,\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly visitor: Model.FieldVisitor<GraphQLInputFieldConfig | undefined>,\n\t) {}\n\n\tpublic getInput(entityName: string, withoutRelation?: string): GraphQLInputType | undefined {\n\t\treturn this.entityInputs({ entityName, withoutRelation })\n\t}\n\n\tprotected createInput(entity: Model.Entity, withoutRelation?: string): GraphQLInputObjectType | undefined {\n\t\tif (entity.view) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst entityName = entity.name\n\t\tconst withoutSuffix = withoutRelation ? GqlTypeName`Without${withoutRelation}` : ''\n\t\tconst operation: Acl.Operation = (() => {\n\t\t\tswitch (this.operation) {\n\t\t\t\tcase EntityInputType.create:\n\t\t\t\t\treturn Acl.Operation.create\n\t\t\t\tcase EntityInputType.update:\n\t\t\t\t\treturn Acl.Operation.update\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ImplementationException(`EntityInputProvider: Invalid operation ${this.operation}`)\n\t\t\t}\n\t\t})()\n\t\tif (this.authorizator.getEntityPermission(operation, entity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst fieldNames = Object.keys(entity.fields).filter(it => it !== withoutRelation)\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}${withoutSuffix}${this.operation}Input`,\n\t\t\tfields: () => this.createEntityFields(entityName, fieldNames),\n\t\t})\n\t}\n\n\tprivate createEntityFields(entityName: string, fieldsNames: string[]) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tfor (const fieldName of fieldsNames) {\n\t\t\tconst result = acceptFieldVisitor(this.schema, entityName, fieldName, this.visitor)\n\t\t\tif (result !== undefined) {\n\t\t\t\tfields[fieldName] = result\n\t\t\t}\n\t\t}\n\n\t\tfields['_dummy_field_'] = { type: GraphQLBoolean }\n\n\t\treturn fields\n\t}\n}\n\nexport enum EntityInputType {\n\tcreate = 'create',\n\tupdate = 'update',\n}\n"],"names":["schema","singletonFactory","getEntity","GqlTypeName","Acl","ImplementationException","GraphQLInputObjectType","acceptFieldVisitor","GraphQLBoolean","EntityInputType"],"mappings":";;;;;;;;;;;AAQO,MAAM,oBAAuD;AAAA,EASnE,YACkB,WACAA,SACA,cACA,SAChB;AAJgB,SAAA,YAAA;AACA,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,UAAA;AAZlB,kBAAA,MAAQ,gBAAeC,iBAAAA,iBAMrB,CAAA,OAAM,KAAK,YAAYC,YAAAA,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG,GAAG,eAAe,CAAC,CAAA;AAAA,EAOhF;AAAA,EAEI,SAAS,YAAoB,iBAAwD;AAC3F,WAAO,KAAK,aAAa,EAAE,YAAY,iBAAiB;AAAA,EACzD;AAAA,EAEU,YAAY,QAAsB,iBAA8D;AACzG,QAAI,OAAO,MAAM;AAChB,aAAO;AAAA,IACR;AACA,UAAM,aAAa,OAAO;AAC1B,UAAM,gBAAgB,kBAAkBC,MAAAA,qBAAqB,eAAe,KAAK;AACjF,UAAM,aAA4B,MAAM;AACvC,cAAQ,KAAK,WAAA;AAAA,QACZ,KAAK;AACJ,iBAAOC,OAAAA,IAAI,UAAU;AAAA,QACtB,KAAK;AACJ,iBAAOA,OAAAA,IAAI,UAAU;AAAA,QACtB;AACC,gBAAM,IAAIC,UAAAA,wBAAwB,0CAA0C,KAAK,SAAS,EAAE;AAAA,MAAA;AAAA,IAE/F,GAAA;AACA,QAAI,KAAK,aAAa,oBAAoB,WAAW,OAAO,IAAI,MAAM,MAAM;AAC3E,aAAO;AAAA,IACR;AAEA,UAAM,aAAa,OAAO,KAAK,OAAO,MAAM,EAAE,OAAO,CAAA,OAAM,OAAO,eAAe;AAEjF,WAAO,IAAIC,QAAAA,uBAAuB;AAAA,MACjC,MAAMH,MAAAA,cAAc,UAAU,GAAG,aAAa,GAAG,KAAK,SAAS;AAAA,MAC/D,QAAQ,MAAM,KAAK,mBAAmB,YAAY,UAAU;AAAA,IAAA,CAC5D;AAAA,EACF;AAAA,EAEQ,mBAAmB,YAAoB,aAAuB;AACrE,UAAM,SAAqC,CAAA;AAC3C,eAAW,aAAa,aAAa;AACpC,YAAM,SAASI,YAAAA,mBAAmB,KAAK,QAAQ,YAAY,WAAW,KAAK,OAAO;AAClF,UAAI,WAAW,QAAW;AACzB,eAAO,SAAS,IAAI;AAAA,MACrB;AAAA,IACD;AAEA,WAAO,eAAe,IAAI,EAAE,MAAMC,QAAAA,eAAA;AAElC,WAAO;AAAA,EACR;AACD;AAEO,IAAK,oCAAAC,qBAAL;AACNA,mBAAA,QAAA,IAAS;AACTA,mBAAA,QAAA,IAAS;AAFE,SAAAA;AAAA,GAAA,mBAAA,CAAA,CAAA;;;"}
|
|
1
|
+
{"version":3,"file":"EntityInputProvider.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/EntityInputProvider.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLInputType } from 'graphql'\nimport { acceptFieldVisitor, getEntity } from '@contember/schema-utils'\nimport { GqlTypeName } from '../utils.js'\nimport { Acl, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl/index.js'\nimport { singletonFactory } from '../../utils/index.js'\nimport { ImplementationException } from '../../exception.js'\n\nexport class EntityInputProvider<Operation extends EntityInputType> {\n\tprivate entityInputs = singletonFactory<\n\t\tGraphQLInputType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\twithoutRelation?: string\n\t\t}\n\t>(id => this.createInput(getEntity(this.schema, id.entityName), id.withoutRelation))\n\n\tconstructor(\n\t\tprivate readonly operation: Operation,\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly visitor: Model.FieldVisitor<GraphQLInputFieldConfig | undefined>,\n\t) {}\n\n\tpublic getInput(entityName: string, withoutRelation?: string): GraphQLInputType | undefined {\n\t\treturn this.entityInputs({ entityName, withoutRelation })\n\t}\n\n\tprotected createInput(entity: Model.Entity, withoutRelation?: string): GraphQLInputObjectType | undefined {\n\t\tif (entity.view) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst entityName = entity.name\n\t\tconst withoutSuffix = withoutRelation ? GqlTypeName`Without${withoutRelation}` : ''\n\t\tconst operation: Acl.Operation = (() => {\n\t\t\tswitch (this.operation) {\n\t\t\t\tcase EntityInputType.create:\n\t\t\t\t\treturn Acl.Operation.create\n\t\t\t\tcase EntityInputType.update:\n\t\t\t\t\treturn Acl.Operation.update\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ImplementationException(`EntityInputProvider: Invalid operation ${this.operation}`)\n\t\t\t}\n\t\t})()\n\t\tif (this.authorizator.getEntityPermission(operation, entity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst fieldNames = Object.keys(entity.fields).filter(it => it !== withoutRelation)\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}${withoutSuffix}${this.operation}Input`,\n\t\t\tfields: () => this.createEntityFields(entityName, fieldNames),\n\t\t})\n\t}\n\n\tprivate createEntityFields(entityName: string, fieldsNames: string[]) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tfor (const fieldName of fieldsNames) {\n\t\t\tconst result = acceptFieldVisitor(this.schema, entityName, fieldName, this.visitor)\n\t\t\tif (result !== undefined) {\n\t\t\t\tfields[fieldName] = result\n\t\t\t}\n\t\t}\n\n\t\tfields['_dummy_field_'] = { type: GraphQLBoolean }\n\n\t\treturn fields\n\t}\n}\n\nexport enum EntityInputType {\n\tcreate = 'create',\n\tupdate = 'update',\n}\n"],"names":["schema","singletonFactory","getEntity","GqlTypeName","Acl","ImplementationException","GraphQLInputObjectType","acceptFieldVisitor","GraphQLBoolean","EntityInputType"],"mappings":";;;;;;;;;;;AAQO,MAAM,oBAAuD;AAAA,EASnE,YACkB,WACAA,SACA,cACA,SAChB;AAJgB,SAAA,YAAA;AACA,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,UAAA;AAZlB,kBAAA,MAAQ,gBAAeC,iBAAAA,iBAMrB,CAAA,OAAM,KAAK,YAAYC,YAAAA,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG,GAAG,eAAe,CAAC,CAAA;AAAA,EAOhF;AAAA,EAEI,SAAS,YAAoB,iBAAwD;AAC3F,WAAO,KAAK,aAAa,EAAE,YAAY,iBAAiB;AAAA,EACzD;AAAA,EAEU,YAAY,QAAsB,iBAA8D;AACzG,QAAI,OAAO,MAAM;AAChB,aAAO;AAAA,IACR;AACA,UAAM,aAAa,OAAO;AAC1B,UAAM,gBAAgB,kBAAkBC,MAAAA,qBAAqB,eAAe,KAAK;AACjF,UAAM,aAA4B,MAAM;AACvC,cAAQ,KAAK,WAAA;AAAA,QACZ,KAAK;AACJ,iBAAOC,OAAAA,IAAI,UAAU;AAAA,QACtB,KAAK;AACJ,iBAAOA,OAAAA,IAAI,UAAU;AAAA,QACtB;AACC,gBAAM,IAAIC,UAAAA,wBAAwB,0CAA0C,KAAK,SAAS,EAAE;AAAA,MAAA;AAAA,IAE/F,GAAA;AACA,QAAI,KAAK,aAAa,oBAAoB,WAAW,OAAO,IAAI,MAAM,MAAM;AAC3E,aAAO;AAAA,IACR;AAEA,UAAM,aAAa,OAAO,KAAK,OAAO,MAAM,EAAE,OAAO,CAAA,OAAM,OAAO,eAAe;AAEjF,WAAO,IAAIC,QAAAA,uBAAuB;AAAA,MACjC,MAAMH,MAAAA,cAAc,UAAU,GAAG,aAAa,GAAG,KAAK,SAAS;AAAA,MAC/D,QAAQ,MAAM,KAAK,mBAAmB,YAAY,UAAU;AAAA,IAAA,CAC5D;AAAA,EACF;AAAA,EAEQ,mBAAmB,YAAoB,aAAuB;AACrE,UAAM,SAAqC,CAAA;AAC3C,eAAW,aAAa,aAAa;AACpC,YAAM,SAASI,YAAAA,mBAAmB,KAAK,QAAQ,YAAY,WAAW,KAAK,OAAO;AAClF,UAAI,WAAW,QAAW;AACzB,eAAO,SAAS,IAAI;AAAA,MACrB;AAAA,IACD;AAEA,WAAO,eAAe,IAAI,EAAE,MAAMC,QAAAA,eAAA;AAElC,WAAO;AAAA,EACR;AACD;AAEO,IAAK,oCAAAC,qBAAL;AACNA,mBAAA,QAAA,IAAS;AACTA,mBAAA,QAAA,IAAS;AAFE,SAAAA;AAAA,GAAA,mBAAA,CAAA,CAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityInputProvider.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/EntityInputProvider.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLInputType } from 'graphql'\nimport { acceptFieldVisitor, getEntity } from '@contember/schema-utils'\nimport { GqlTypeName } from '../utils'\nimport { Acl, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\nimport { singletonFactory } from '../../utils'\nimport { ImplementationException } from '../../exception'\n\nexport class EntityInputProvider<Operation extends EntityInputType> {\n\tprivate entityInputs = singletonFactory<\n\t\tGraphQLInputType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\twithoutRelation?: string\n\t\t}\n\t>(id => this.createInput(getEntity(this.schema, id.entityName), id.withoutRelation))\n\n\tconstructor(\n\t\tprivate readonly operation: Operation,\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly visitor: Model.FieldVisitor<GraphQLInputFieldConfig | undefined>,\n\t) {}\n\n\tpublic getInput(entityName: string, withoutRelation?: string): GraphQLInputType | undefined {\n\t\treturn this.entityInputs({ entityName, withoutRelation })\n\t}\n\n\tprotected createInput(entity: Model.Entity, withoutRelation?: string): GraphQLInputObjectType | undefined {\n\t\tif (entity.view) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst entityName = entity.name\n\t\tconst withoutSuffix = withoutRelation ? GqlTypeName`Without${withoutRelation}` : ''\n\t\tconst operation: Acl.Operation = (() => {\n\t\t\tswitch (this.operation) {\n\t\t\t\tcase EntityInputType.create:\n\t\t\t\t\treturn Acl.Operation.create\n\t\t\t\tcase EntityInputType.update:\n\t\t\t\t\treturn Acl.Operation.update\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ImplementationException(`EntityInputProvider: Invalid operation ${this.operation}`)\n\t\t\t}\n\t\t})()\n\t\tif (this.authorizator.getEntityPermission(operation, entity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst fieldNames = Object.keys(entity.fields).filter(it => it !== withoutRelation)\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}${withoutSuffix}${this.operation}Input`,\n\t\t\tfields: () => this.createEntityFields(entityName, fieldNames),\n\t\t})\n\t}\n\n\tprivate createEntityFields(entityName: string, fieldsNames: string[]) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tfor (const fieldName of fieldsNames) {\n\t\t\tconst result = acceptFieldVisitor(this.schema, entityName, fieldName, this.visitor)\n\t\t\tif (result !== undefined) {\n\t\t\t\tfields[fieldName] = result\n\t\t\t}\n\t\t}\n\n\t\tfields['_dummy_field_'] = { type: GraphQLBoolean }\n\n\t\treturn fields\n\t}\n}\n\nexport enum EntityInputType {\n\tcreate = 'create',\n\tupdate = 'update',\n}\n"],"names":["EntityInputType"],"mappings":";;;;;;;;;AAQO,MAAM,oBAAuD;AAAA,EASnE,YACkB,WACA,QACA,cACA,SAChB;AAJgB,SAAA,YAAA;AACA,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,UAAA;AAZlB,kBAAA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,IAAK,oCAAAA,qBAAL;AACNA,mBAAA,QAAA,IAAS;AACTA,mBAAA,QAAA,IAAS;AAFE,SAAAA;AAAA,GAAA,mBAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"EntityInputProvider.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/EntityInputProvider.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLInputType } from 'graphql'\nimport { acceptFieldVisitor, getEntity } from '@contember/schema-utils'\nimport { GqlTypeName } from '../utils.js'\nimport { Acl, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl/index.js'\nimport { singletonFactory } from '../../utils/index.js'\nimport { ImplementationException } from '../../exception.js'\n\nexport class EntityInputProvider<Operation extends EntityInputType> {\n\tprivate entityInputs = singletonFactory<\n\t\tGraphQLInputType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\twithoutRelation?: string\n\t\t}\n\t>(id => this.createInput(getEntity(this.schema, id.entityName), id.withoutRelation))\n\n\tconstructor(\n\t\tprivate readonly operation: Operation,\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly visitor: Model.FieldVisitor<GraphQLInputFieldConfig | undefined>,\n\t) {}\n\n\tpublic getInput(entityName: string, withoutRelation?: string): GraphQLInputType | undefined {\n\t\treturn this.entityInputs({ entityName, withoutRelation })\n\t}\n\n\tprotected createInput(entity: Model.Entity, withoutRelation?: string): GraphQLInputObjectType | undefined {\n\t\tif (entity.view) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst entityName = entity.name\n\t\tconst withoutSuffix = withoutRelation ? GqlTypeName`Without${withoutRelation}` : ''\n\t\tconst operation: Acl.Operation = (() => {\n\t\t\tswitch (this.operation) {\n\t\t\t\tcase EntityInputType.create:\n\t\t\t\t\treturn Acl.Operation.create\n\t\t\t\tcase EntityInputType.update:\n\t\t\t\t\treturn Acl.Operation.update\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ImplementationException(`EntityInputProvider: Invalid operation ${this.operation}`)\n\t\t\t}\n\t\t})()\n\t\tif (this.authorizator.getEntityPermission(operation, entity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst fieldNames = Object.keys(entity.fields).filter(it => it !== withoutRelation)\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}${withoutSuffix}${this.operation}Input`,\n\t\t\tfields: () => this.createEntityFields(entityName, fieldNames),\n\t\t})\n\t}\n\n\tprivate createEntityFields(entityName: string, fieldsNames: string[]) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tfor (const fieldName of fieldsNames) {\n\t\t\tconst result = acceptFieldVisitor(this.schema, entityName, fieldName, this.visitor)\n\t\t\tif (result !== undefined) {\n\t\t\t\tfields[fieldName] = result\n\t\t\t}\n\t\t}\n\n\t\tfields['_dummy_field_'] = { type: GraphQLBoolean }\n\n\t\treturn fields\n\t}\n}\n\nexport enum EntityInputType {\n\tcreate = 'create',\n\tupdate = 'update',\n}\n"],"names":["EntityInputType"],"mappings":";;;;;;;;;AAQO,MAAM,oBAAuD;AAAA,EASnE,YACkB,WACA,QACA,cACA,SAChB;AAJgB,SAAA,YAAA;AACA,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,UAAA;AAZlB,kBAAA,MAAQ,gBAAe,iBAMrB,CAAA,OAAM,KAAK,YAAY,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG,GAAG,eAAe,CAAC,CAAA;AAAA,EAOhF;AAAA,EAEI,SAAS,YAAoB,iBAAwD;AAC3F,WAAO,KAAK,aAAa,EAAE,YAAY,iBAAiB;AAAA,EACzD;AAAA,EAEU,YAAY,QAAsB,iBAA8D;AACzG,QAAI,OAAO,MAAM;AAChB,aAAO;AAAA,IACR;AACA,UAAM,aAAa,OAAO;AAC1B,UAAM,gBAAgB,kBAAkB,qBAAqB,eAAe,KAAK;AACjF,UAAM,aAA4B,MAAM;AACvC,cAAQ,KAAK,WAAA;AAAA,QACZ,KAAK;AACJ,iBAAO,IAAI,UAAU;AAAA,QACtB,KAAK;AACJ,iBAAO,IAAI,UAAU;AAAA,QACtB;AACC,gBAAM,IAAI,wBAAwB,0CAA0C,KAAK,SAAS,EAAE;AAAA,MAAA;AAAA,IAE/F,GAAA;AACA,QAAI,KAAK,aAAa,oBAAoB,WAAW,OAAO,IAAI,MAAM,MAAM;AAC3E,aAAO;AAAA,IACR;AAEA,UAAM,aAAa,OAAO,KAAK,OAAO,MAAM,EAAE,OAAO,CAAA,OAAM,OAAO,eAAe;AAEjF,WAAO,IAAI,uBAAuB;AAAA,MACjC,MAAM,cAAc,UAAU,GAAG,aAAa,GAAG,KAAK,SAAS;AAAA,MAC/D,QAAQ,MAAM,KAAK,mBAAmB,YAAY,UAAU;AAAA,IAAA,CAC5D;AAAA,EACF;AAAA,EAEQ,mBAAmB,YAAoB,aAAuB;AACrE,UAAM,SAAqC,CAAA;AAC3C,eAAW,aAAa,aAAa;AACpC,YAAM,SAAS,mBAAmB,KAAK,QAAQ,YAAY,WAAW,KAAK,OAAO;AAClF,UAAI,WAAW,QAAW;AACzB,eAAO,SAAS,IAAI;AAAA,MACrB;AAAA,IACD;AAEA,WAAO,eAAe,IAAI,EAAE,MAAM,eAAA;AAElC,WAAO;AAAA,EACR;AACD;AAEO,IAAK,oCAAAA,qBAAL;AACNA,mBAAA,QAAA,IAAS;AACTA,mBAAA,QAAA,IAAS;AAFE,SAAAA;AAAA,GAAA,mBAAA,CAAA,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateEntityInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfig, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { UpdateEntityRelationInputProvider } from './UpdateEntityRelationInputProvider'\nimport { Authorizator } from '../../acl'\n\nexport class UpdateEntityInputFieldVisitor\n\timplements Model.ColumnVisitor<GraphQLInputFieldConfig | undefined>, Model.RelationByGenericTypeVisitor<GraphQLInputFieldConfig | undefined>\n{\n\tconstructor(\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly updateEntityRelationInputProvider: UpdateEntityRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn({ entity, column }: Model.ColumnContext) {\n\t\tif (entity.primary === column.name) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getFieldPermissions(Acl.Operation.update, entity.name, column.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\treturn { type }\n\t}\n\n\tpublic visitHasOne({ entity, relation }: Model.AnyHasOneRelationContext) {\n\t\tconst type = this.updateEntityRelationInputProvider.getUpdateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn { type }\n\t}\n\n\tpublic visitHasMany({ entity, relation }: Model.AnyHasManyRelationContext) {\n\t\tconst type = this.updateEntityRelationInputProvider.getUpdateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(type)),\n\t\t}\n\t}\n}\n"],"names":["Acl","GraphQLList","GraphQLNonNull"],"mappings":";;;;AAMO,MAAM,8BAEb;AAAA,EACC,YACkB,cACA,oBACA,mCAChB;AAHgB,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EACf;AAAA,EAEI,YAAY,EAAE,QAAQ,UAA+B;AAC3D,QAAI,OAAO,YAAY,OAAO,MAAM;AACnC,aAAO;AAAA,IACR;AACA,QAAI,KAAK,aAAa,oBAAoBA,OAAAA,IAAI,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AACnG,aAAO;AAAA,IACR;AACA,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,YAAY,EAAE,QAAQ,YAA4C;AACxE,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,aAAa,EAAE,QAAQ,YAA6C;AAC1E,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAIC,QAAAA,YAAY,IAAIC,QAAAA,eAAe,IAAI,CAAC;AAAA,IAAA;AAAA,EAEhD;AACD;;"}
|
|
1
|
+
{"version":3,"file":"UpdateEntityInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfig, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver.js'\nimport { UpdateEntityRelationInputProvider } from './UpdateEntityRelationInputProvider.js'\nimport { Authorizator } from '../../acl/index.js'\n\nexport class UpdateEntityInputFieldVisitor\n\timplements Model.ColumnVisitor<GraphQLInputFieldConfig | undefined>, Model.RelationByGenericTypeVisitor<GraphQLInputFieldConfig | undefined>\n{\n\tconstructor(\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly updateEntityRelationInputProvider: UpdateEntityRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn({ entity, column }: Model.ColumnContext) {\n\t\tif (entity.primary === column.name) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getFieldPermissions(Acl.Operation.update, entity.name, column.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\treturn { type }\n\t}\n\n\tpublic visitHasOne({ entity, relation }: Model.AnyHasOneRelationContext) {\n\t\tconst type = this.updateEntityRelationInputProvider.getUpdateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn { type }\n\t}\n\n\tpublic visitHasMany({ entity, relation }: Model.AnyHasManyRelationContext) {\n\t\tconst type = this.updateEntityRelationInputProvider.getUpdateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(type)),\n\t\t}\n\t}\n}\n"],"names":["Acl","GraphQLList","GraphQLNonNull"],"mappings":";;;;AAMO,MAAM,8BAEb;AAAA,EACC,YACkB,cACA,oBACA,mCAChB;AAHgB,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EACf;AAAA,EAEI,YAAY,EAAE,QAAQ,UAA+B;AAC3D,QAAI,OAAO,YAAY,OAAO,MAAM;AACnC,aAAO;AAAA,IACR;AACA,QAAI,KAAK,aAAa,oBAAoBA,OAAAA,IAAI,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AACnG,aAAO;AAAA,IACR;AACA,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,YAAY,EAAE,QAAQ,YAA4C;AACxE,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,aAAa,EAAE,QAAQ,YAA6C;AAC1E,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAIC,QAAAA,YAAY,IAAIC,QAAAA,eAAe,IAAI,CAAC;AAAA,IAAA;AAAA,EAEhD;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateEntityInputFieldVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfig, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { UpdateEntityRelationInputProvider } from './UpdateEntityRelationInputProvider'\nimport { Authorizator } from '../../acl'\n\nexport class UpdateEntityInputFieldVisitor\n\timplements Model.ColumnVisitor<GraphQLInputFieldConfig | undefined>, Model.RelationByGenericTypeVisitor<GraphQLInputFieldConfig | undefined>\n{\n\tconstructor(\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly updateEntityRelationInputProvider: UpdateEntityRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn({ entity, column }: Model.ColumnContext) {\n\t\tif (entity.primary === column.name) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getFieldPermissions(Acl.Operation.update, entity.name, column.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\treturn { type }\n\t}\n\n\tpublic visitHasOne({ entity, relation }: Model.AnyHasOneRelationContext) {\n\t\tconst type = this.updateEntityRelationInputProvider.getUpdateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn { type }\n\t}\n\n\tpublic visitHasMany({ entity, relation }: Model.AnyHasManyRelationContext) {\n\t\tconst type = this.updateEntityRelationInputProvider.getUpdateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(type)),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAMO,MAAM,8BAEb;AAAA,EACC,YACkB,cACA,oBACA,mCAChB;AAHgB,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EACf;AAAA,EAEI,YAAY,EAAE,QAAQ,UAA+B;AAC3D,QAAI,OAAO,YAAY,OAAO,MAAM;AACnC,aAAO;AAAA,IACR;AACA,QAAI,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AACnG,aAAO;AAAA,IACR;AACA,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,YAAY,EAAE,QAAQ,YAA4C;AACxE,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,aAAa,EAAE,QAAQ,YAA6C;AAC1E,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAI,YAAY,IAAI,eAAe,IAAI,CAAC;AAAA,IAAA;AAAA,EAEhD;AACD;"}
|
|
1
|
+
{"version":3,"file":"UpdateEntityInputFieldVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfig, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver.js'\nimport { UpdateEntityRelationInputProvider } from './UpdateEntityRelationInputProvider.js'\nimport { Authorizator } from '../../acl/index.js'\n\nexport class UpdateEntityInputFieldVisitor\n\timplements Model.ColumnVisitor<GraphQLInputFieldConfig | undefined>, Model.RelationByGenericTypeVisitor<GraphQLInputFieldConfig | undefined>\n{\n\tconstructor(\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly updateEntityRelationInputProvider: UpdateEntityRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn({ entity, column }: Model.ColumnContext) {\n\t\tif (entity.primary === column.name) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getFieldPermissions(Acl.Operation.update, entity.name, column.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\treturn { type }\n\t}\n\n\tpublic visitHasOne({ entity, relation }: Model.AnyHasOneRelationContext) {\n\t\tconst type = this.updateEntityRelationInputProvider.getUpdateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn { type }\n\t}\n\n\tpublic visitHasMany({ entity, relation }: Model.AnyHasManyRelationContext) {\n\t\tconst type = this.updateEntityRelationInputProvider.getUpdateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(type)),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAMO,MAAM,8BAEb;AAAA,EACC,YACkB,cACA,oBACA,mCAChB;AAHgB,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EACf;AAAA,EAEI,YAAY,EAAE,QAAQ,UAA+B;AAC3D,QAAI,OAAO,YAAY,OAAO,MAAM;AACnC,aAAO;AAAA,IACR;AACA,QAAI,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AACnG,aAAO;AAAA,IACR;AACA,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,YAAY,EAAE,QAAQ,YAA4C;AACxE,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,aAAa,EAAE,QAAQ,YAA6C;AAC1E,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAI,YAAY,IAAI,eAAe,IAAI,CAAC;AAAA,IAAA;AAAA,EAEhD;AACD;"}
|
package/dist/production/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateEntityRelationAllowedOperationsVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\n\nexport class UpdateEntityRelationAllowedOperationsVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByTypeVisitor<Input.UpdateRelationOperation[]>\n{\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetRelation, targetEntity }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, relation, entity }: Model.ManyHasOneContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst forbiddenOperations = [Input.UpdateRelationOperation.disconnect]\n\t\tif (relation.joiningColumn.onDelete !== Model.OnDelete.cascade) {\n\t\t\tforbiddenOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => !forbiddenOperations.includes(it))\n\t}\n\n\tpublic visitOneHasOneInverse({ relation, targetEntity, targetRelation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.UpdateRelationOperation.update)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable || !targetRelation || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst allowedOperations = [Input.UpdateRelationOperation.update]\n\t\tif (relation.joiningColumn.onDelete === Model.OnDelete.cascade) {\n\t\t\tallowedOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => allowedOperations.includes(it))\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.UpdateRelationOperation[] {\n\t\tconst result: Input.UpdateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canUpdateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.update, targetEntity.name) !== 'no'\n\t\tconst canDeleteTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.delete, targetEntity.name) !== 'no'\n\t\tconst canUpdateOwningRelation = this.authorizator.getFieldPermissions(Acl.Operation.update, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connect)\n\t\t\tresult.push(Input.UpdateRelationOperation.disconnect)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.create)\n\t\t}\n\t\tif (canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.update)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.upsert)\n\t\t}\n\t\tif (canDeleteTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\tif (canReadTargetEntity && canUpdateOwningRelation && canCreateTargetEntity) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":["Input","Model","Acl"],"mappings":";;;AAGO,MAAM,6CAEb;AAAA,EACC,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAA6B;AAAA,EAE1D,cAAqB;AACpB,UAAM,IAAI,MAAM,2EAA2E;AAAA,EAC5F;AAAA,EAEO,wBAAwB,EAAE,cAAc,kBAAmD;AAC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/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl/index.js'\n\nexport class UpdateEntityRelationAllowedOperationsVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByTypeVisitor<Input.UpdateRelationOperation[]>\n{\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetRelation, targetEntity }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, relation, entity }: Model.ManyHasOneContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst forbiddenOperations = [Input.UpdateRelationOperation.disconnect]\n\t\tif (relation.joiningColumn.onDelete !== Model.OnDelete.cascade) {\n\t\t\tforbiddenOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => !forbiddenOperations.includes(it))\n\t}\n\n\tpublic visitOneHasOneInverse({ relation, targetEntity, targetRelation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.UpdateRelationOperation.update)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable || !targetRelation || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst allowedOperations = [Input.UpdateRelationOperation.update]\n\t\tif (relation.joiningColumn.onDelete === Model.OnDelete.cascade) {\n\t\t\tallowedOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => allowedOperations.includes(it))\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.UpdateRelationOperation[] {\n\t\tconst result: Input.UpdateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canUpdateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.update, targetEntity.name) !== 'no'\n\t\tconst canDeleteTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.delete, targetEntity.name) !== 'no'\n\t\tconst canUpdateOwningRelation = this.authorizator.getFieldPermissions(Acl.Operation.update, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connect)\n\t\t\tresult.push(Input.UpdateRelationOperation.disconnect)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.create)\n\t\t}\n\t\tif (canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.update)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.upsert)\n\t\t}\n\t\tif (canDeleteTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\tif (canReadTargetEntity && canUpdateOwningRelation && canCreateTargetEntity) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":["Input","Model","Acl"],"mappings":";;;AAGO,MAAM,6CAEb;AAAA,EACC,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAA6B;AAAA,EAE1D,cAAqB;AACpB,UAAM,IAAI,MAAM,2EAA2E;AAAA,EAC5F;AAAA,EAEO,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,uBAAuB,EAAE,QAAQ,cAAc,YAA4C;AACjG,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,gBAAgB,EAAE,gBAAgB,gBAAyC;AACjF,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,gBAAgB,EAAE,cAAc,UAAU,UAAmC;AACnF,UAAM,aAAa,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAC3E,QAAI,SAAS,UAAU;AACtB,aAAO;AAAA,IACR;AACA,UAAM,sBAAsB,CAACA,aAAM,wBAAwB,UAAU;AACrE,QAAI,SAAS,cAAc,aAAaC,OAAAA,MAAM,SAAS,SAAS;AAC/D,0BAAoB,KAAKD,aAAM,wBAAwB,MAAM;AAAA,IAC9D;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,CAAC,oBAAoB,SAAS,EAAE,CAAC;AAAA,EACjE;AAAA,EAEO,sBAAsB,EAAE,UAAU,cAAc,kBAAiD;AACvG,UAAM,aAAa,KAAK,qBAAqB,cAAc,cAAc,cAAc;AACvF,QAAI,SAAS,YAAY,eAAe,UAAU;AACjD,aAAO;AAAA,IACR;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,OAAOA,OA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AAA,IACjD;AACA,QAAI,yBAAyB,yBAAyB,yBAAyB;AAC9E,aAAO,KAAKA,aAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,yBAAyB,yBAAyB;AACrD,aAAO,KAAKA,aAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,uBAAuB,2BAA2B,uBAAuB;AAC5E,aAAO,KAAKA,aAAM,wBAAwB,eAAe;AAAA,IAC1D;AAEA,WAAO;AAAA,EACR;AACD;;"}
|
package/dist/production/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateEntityRelationAllowedOperationsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\n\nexport class UpdateEntityRelationAllowedOperationsVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByTypeVisitor<Input.UpdateRelationOperation[]>\n{\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetRelation, targetEntity }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, relation, entity }: Model.ManyHasOneContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst forbiddenOperations = [Input.UpdateRelationOperation.disconnect]\n\t\tif (relation.joiningColumn.onDelete !== Model.OnDelete.cascade) {\n\t\t\tforbiddenOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => !forbiddenOperations.includes(it))\n\t}\n\n\tpublic visitOneHasOneInverse({ relation, targetEntity, targetRelation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.UpdateRelationOperation.update)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable || !targetRelation || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst allowedOperations = [Input.UpdateRelationOperation.update]\n\t\tif (relation.joiningColumn.onDelete === Model.OnDelete.cascade) {\n\t\t\tallowedOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => allowedOperations.includes(it))\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.UpdateRelationOperation[] {\n\t\tconst result: Input.UpdateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canUpdateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.update, targetEntity.name) !== 'no'\n\t\tconst canDeleteTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.delete, targetEntity.name) !== 'no'\n\t\tconst canUpdateOwningRelation = this.authorizator.getFieldPermissions(Acl.Operation.update, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connect)\n\t\t\tresult.push(Input.UpdateRelationOperation.disconnect)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.create)\n\t\t}\n\t\tif (canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.update)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.upsert)\n\t\t}\n\t\tif (canDeleteTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\tif (canReadTargetEntity && canUpdateOwningRelation && canCreateTargetEntity) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,6CAEb;AAAA,EACC,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAA6B;AAAA,EAE1D,cAAqB;AACpB,UAAM,IAAI,MAAM,2EAA2E;AAAA,EAC5F;AAAA,EAEO,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,uBAAuB,EAAE,QAAQ,cAAc,YAA4C;AACjG,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,gBAAgB,EAAE,gBAAgB,gBAAyC;AACjF,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,gBAAgB,EAAE,cAAc,UAAU,UAAmC;AACnF,UAAM,aAAa,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAC3E,QAAI,SAAS,UAAU;AACtB,aAAO;AAAA,I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a,IAAI,MAAM;AACjH,UAAM,0BAA0B,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,MAAM,eAAe,IAAI,MAAM;AAExI,QAAI,uBAAuB,yBAAyB;AACnD,aAAO,KAAK,MAAM,wBAAwB,OAAO;AACjD,aAAO,KAAK,MAAM,wBAAwB,UAAU;AAAA,IACrD;AACA,QAAI,yBAAyB,yBAAyB;AACrD,aAAO,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,yBAAyB,yBAAyB;AACrD,aAAO,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,yBAAyB,yBAAyB,yBAAyB;AAC9E,aAAO,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,yBAAyB,yBAAyB;AACrD,aAAO,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,uBAAuB,2BAA2B,uBAAuB;AAC5E,aAAO,KAAK,MAAM,wBAAwB,eAAe;AAAA,IAC1D;AAEA,WAAO;AAAA,EACR;AACD;"}
|
|
1
|
+
{"version":3,"file":"UpdateEntityRelationAllowedOperationsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl/index.js'\n\nexport class UpdateEntityRelationAllowedOperationsVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByTypeVisitor<Input.UpdateRelationOperation[]>\n{\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetRelation, targetEntity }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, relation, entity }: Model.ManyHasOneContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst forbiddenOperations = [Input.UpdateRelationOperation.disconnect]\n\t\tif (relation.joiningColumn.onDelete !== Model.OnDelete.cascade) {\n\t\t\tforbiddenOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => !forbiddenOperations.includes(it))\n\t}\n\n\tpublic visitOneHasOneInverse({ relation, targetEntity, targetRelation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.UpdateRelationOperation.update)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable || !targetRelation || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst allowedOperations = [Input.UpdateRelationOperation.update]\n\t\tif (relation.joiningColumn.onDelete === Model.OnDelete.cascade) {\n\t\t\tallowedOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => allowedOperations.includes(it))\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.UpdateRelationOperation[] {\n\t\tconst result: Input.UpdateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canUpdateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.update, targetEntity.name) !== 'no'\n\t\tconst canDeleteTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.delete, targetEntity.name) !== 'no'\n\t\tconst canUpdateOwningRelation = this.authorizator.getFieldPermissions(Acl.Operation.update, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connect)\n\t\t\tresult.push(Input.UpdateRelationOperation.disconnect)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.create)\n\t\t}\n\t\tif (canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.update)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.upsert)\n\t\t}\n\t\tif (canDeleteTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\tif (canReadTargetEntity && canUpdateOwningRelation && canCreateTargetEntity) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,6CAEb;AAAA,EACC,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAA6B;AAAA,EAE1D,cAAqB;AACpB,UAAM,IAAI,MAAM,2EAA2E;AAAA,EAC5F;AAAA,EAEO,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,uBAAuB,EAAE,QAAQ,cAAc,YAA4C;AACjG,WAAO,KAA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,sBAAsB,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM;AAC7G,UAAM,wBAAwB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AACjH,UAAM,wBAAwB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AACjH,UAAM,wBAAwB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AACjH,UAAM,0BAA0B,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,MAAM,eAAe,IAAI,MAAM;AAExI,QAAI,uBAAuB,yBAAyB;AACnD,aAAO,KAAK,MAAM,wBAAwB,OAAO;AACjD,aAAO,KAAK,MAAM,wBAAwB,UAAU;AAAA,IACrD;AACA,QAAI,yBAAyB,yBAAyB;AACrD,aAAO,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,yBAAyB,yBAAyB;AACrD,aAAO,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,yBAAyB,yBAAyB,yBAAyB;AAC9E,aAAO,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,yBAAyB,yBAAyB;AACrD,aAAO,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,uBAAuB,2BAA2B,uBAAuB;AAC5E,aAAO,KAAK,MAAM,wBAAwB,eAAe;AAAA,IAC1D;AAEA,WAAO;AAAA,EACR;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateEntityRelationInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLNonNull, GraphQLString } from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { Accessor, filterObject } from '../../utils'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationAllowedOperationsVisitor } from './UpdateEntityRelationAllowedOperationsVisitor'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider'\n\nexport class UpdateEntityRelationInputFieldVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly updateEntityInputProviderAccessor: Accessor<EntityInputProvider<EntityInputType.update>>,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityRelationAllowedOperationsVisitor: UpdateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {\n\t}\n\n\tpublic visitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne({ targetRelation, targetEntity, relation, entity }: Model.AnyHasOneRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\t\tconst updateInput = updateInputType ? { type: updateInputType } : undefined\n\n\t\tconst upsertInput = updateInputType && createInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst booleanInput = {\n\t\t\ttype: GraphQLBoolean,\n\t\t}\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: booleanInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: booleanInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => filteredFields,\n\t\t})\n\t}\n\n\tpublic visitHasMany({ entity, relation, targetEntity, targetRelation }: Model.AnyHasManyRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\n\t\tconst updateSpecifiedInput = updateInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tdata: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst upsertInput = updateInputType && createInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateSpecifiedInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: whereInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => ({\n\t\t\t\t...filteredFields,\n\t\t\t\talias: { type: GraphQLString },\n\t\t\t}),\n\t\t})\n\t}\n\n\tprivate filterAllowedOperations(\n\t\tentity: Model.Entity,\n\t\trelation: Model.Relation,\n\t\tgraphQlFields: { [key: string]: GraphQLInputFieldConfig | undefined },\n\t): GraphQLInputFieldConfigMap {\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.updateEntityRelationAllowedOperationsVisitor,\n\t\t)\n\t\treturn filterObject(\n\t\t\tgraphQlFields,\n\t\t\t(key, value): value is GraphQLInputFieldConfig => allowedOperations.includes(key as Input.UpdateRelationOperation) && value !== undefined,\n\t\t)\n\t}\n\n\tprivate createUniqueWhereInput(targetEntity: Model.Entity): GraphQLInputObjectType | undefined {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (!uniqueWhere) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn uniqueWhere\n\t}\n}\n"],"names":["schema","GraphQLInputObjectType","GqlTypeName","GraphQLNonNull","GraphQLBoolean","Input","GraphQLString","acceptFieldVisitor","filterObject","Acl","ImplementationException"],"mappings":";;;;;;;;AAYO,MAAM,sCAEb;AAAA,EACC,YACkBA,SACA,cACA,kBACA,mCACA,2BACA,8CACA,sCAChB;AAPgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AACA,SAAA,4BAAA;AACA,SAAA,+CAAA;AACA,SAAA,uCAAA;AAAA,EAElB;AAAA,EAEO,cAAqB;AAC3B,UAAM,IAA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OC,OAAAA;AAAAA,MACN;AAAA,MACA,CAAC,KAAK,UAA4C,kBAAkB,SAAS,GAAoC,KAAK,UAAU;AAAA,IAAA;AAAA,EAElI;AAAA,EAEQ,uBAAuB,cAAgE;AAC9F,QAAI,KAAK,aAAa,oBAAoBC,OAAAA,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM,MAAM;AAC1F,aAAO;AAAA,IACR;AACA,UAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,QAAI,CAAC,aAAa;AACjB,YAAM,IAAIC,UAAAA,wBAAA;AAAA,IACX;AACA,WAAO;AAAA,EACR;AACD;;"}
|
|
1
|
+
{"version":3,"file":"UpdateEntityRelationInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLNonNull, GraphQLString } from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils.js'\nimport { WhereTypeProvider } from '../WhereTypeProvider.js'\nimport { Accessor, filterObject } from '../../utils/index.js'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider.js'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationAllowedOperationsVisitor } from './UpdateEntityRelationAllowedOperationsVisitor.js'\nimport { Authorizator } from '../../acl/index.js'\nimport { ImplementationException } from '../../exception.js'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider.js'\n\nexport class UpdateEntityRelationInputFieldVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly updateEntityInputProviderAccessor: Accessor<EntityInputProvider<EntityInputType.update>>,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityRelationAllowedOperationsVisitor: UpdateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {\n\t}\n\n\tpublic visitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne({ targetRelation, targetEntity, relation, entity }: Model.AnyHasOneRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\t\tconst updateInput = updateInputType ? { type: updateInputType } : undefined\n\n\t\tconst upsertInput = updateInputType && createInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst booleanInput = {\n\t\t\ttype: GraphQLBoolean,\n\t\t}\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: booleanInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: booleanInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => filteredFields,\n\t\t})\n\t}\n\n\tpublic visitHasMany({ entity, relation, targetEntity, targetRelation }: Model.AnyHasManyRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\n\t\tconst updateSpecifiedInput = updateInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tdata: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst upsertInput = updateInputType && createInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateSpecifiedInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: whereInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => ({\n\t\t\t\t...filteredFields,\n\t\t\t\talias: { type: GraphQLString },\n\t\t\t}),\n\t\t})\n\t}\n\n\tprivate filterAllowedOperations(\n\t\tentity: Model.Entity,\n\t\trelation: Model.Relation,\n\t\tgraphQlFields: { [key: string]: GraphQLInputFieldConfig | undefined },\n\t): GraphQLInputFieldConfigMap {\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.updateEntityRelationAllowedOperationsVisitor,\n\t\t)\n\t\treturn filterObject(\n\t\t\tgraphQlFields,\n\t\t\t(key, value): value is GraphQLInputFieldConfig => allowedOperations.includes(key as Input.UpdateRelationOperation) && value !== undefined,\n\t\t)\n\t}\n\n\tprivate createUniqueWhereInput(targetEntity: Model.Entity): GraphQLInputObjectType | undefined {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (!uniqueWhere) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn uniqueWhere\n\t}\n}\n"],"names":["schema","GraphQLInputObjectType","GqlTypeName","GraphQLNonNull","GraphQLBoolean","Input","GraphQLString","acceptFieldVisitor","filterObject","Acl","ImplementationException"],"mappings":";;;;;;;;AAYO,MAAM,sCAEb;AAAA,EACC,YACkBA,SACA,cACA,kBACA,mCACA,2BACA,8CACA,sCAChB;AAPgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AACA,SAAA,4BAAA;AACA,SAAA,+CAAA;AACA,SAAA,uCAAA;AAAA,EAElB;AAAA,EAEO,cAAqB;AAC3B,UAAM,IAAI,MAAM,oEAAoE;AAAA,EACrF;AAAA,EAEO,YAAY,EAAE,gBAAgB,cAAc,UAAU,UAA0C;AACtG,UAAM,kBAAkB,iBAAiB,eAAe,OAAO;AAE/D,UAAM,iBAAiB,KAAK,uBAAuB,YAAY;AAC/D,UAAM,aAAa,iBAAiB,EAAE,MAAM,mBAAmB;AAE/D,UAAM,kBAAkB,KAAK,0BAA0B,SAAS,aAAa,MAAM,eAAe;AAClG,UAAM,cAAc,kBAAkB,EAAE,MAAM,oBAAoB;AAElE,UAAM,kBAAkB,KAAK,kCAAkC,IAAA,EAAM,SAAS,aAAa,MAAM,eAAe;AAChH,UAAM,cAAc,kBAAkB,EAAE,MAAM,oBAAoB;AAElE,UAAM,cAAc,mBAAmB,kBACpC;AAAA,MACD,MAAM,IAAIC,QAAAA,uBAAuB;AAAA,QAChC,MAAMC,MAAAA,cAAc,OAAO,IA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,GAAG;AAAA,MACzC,CAACA,OAAAA,MAAM,wBAAwB,eAAe,GAAG;AAAA,MACjD,CAACA,OAAAA,MAAM,wBAAwB,UAAU,GAAG;AAAA,MAC5C,CAACA,OAAAA,MAAM,wBAAwB,MAAM,GAAG;AAAA,IAAA;AAGzC,UAAM,iBAAiB,KAAK,wBAAwB,QAAQ,UAAU,MAAM;AAC5E,QAAI,OAAO,KAAK,cAAc,EAAE,WAAW,GAAG;AAC7C,aAAO;AAAA,IACR;AAEA,WAAO,IAAIJ,QAAAA,uBAAuB;AAAA,MACjC,MAAMC,MAAAA,cAAc,OAAO,IAAI,SAAS,SAAS,IAAI;AAAA,MACrD,QAAQ,OAAO;AAAA,QACd,GAAG;AAAA,QACH,OAAO,EAAE,MAAMI,QAAAA,cAAA;AAAA,MAAc;AAAA,IAC9B,CACA;AAAA,EACF;AAAA,EAEQ,wBACP,QACA,UACA,eAC6B;AAC7B,UAAM,oBAAoBC,YAAAA;AAAAA,MACzB,KAAK;AAAA,MACL;AAAA,MACA,SAAS;AAAA,MACT,KAAK;AAAA,IAAA;AAEN,WAAOC,OAAAA;AAAAA,MACN;AAAA,MACA,CAAC,KAAK,UAA4C,kBAAkB,SAAS,GAAoC,KAAK,UAAU;AAAA,IAAA;AAAA,EAElI;AAAA,EAEQ,uBAAuB,cAAgE;AAC9F,QAAI,KAAK,aAAa,oBAAoBC,OAAAA,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM,MAAM;AAC1F,aAAO;AAAA,IACR;AACA,UAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,QAAI,CAAC,aAAa;AACjB,YAAM,IAAIC,UAAAA,wBAAA;AAAA,IACX;AACA,WAAO;AAAA,EACR;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateEntityRelationInputFieldVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLNonNull, GraphQLString } from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { Accessor, filterObject } from '../../utils'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationAllowedOperationsVisitor } from './UpdateEntityRelationAllowedOperationsVisitor'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider'\n\nexport class UpdateEntityRelationInputFieldVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly updateEntityInputProviderAccessor: Accessor<EntityInputProvider<EntityInputType.update>>,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityRelationAllowedOperationsVisitor: UpdateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {\n\t}\n\n\tpublic visitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne({ targetRelation, targetEntity, relation, entity }: Model.AnyHasOneRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\t\tconst updateInput = updateInputType ? { type: updateInputType } : undefined\n\n\t\tconst upsertInput = updateInputType && createInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst booleanInput = {\n\t\t\ttype: GraphQLBoolean,\n\t\t}\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: booleanInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: booleanInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => filteredFields,\n\t\t})\n\t}\n\n\tpublic visitHasMany({ entity, relation, targetEntity, targetRelation }: Model.AnyHasManyRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\n\t\tconst updateSpecifiedInput = updateInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tdata: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst upsertInput = updateInputType && createInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateSpecifiedInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: whereInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => ({\n\t\t\t\t...filteredFields,\n\t\t\t\talias: { type: GraphQLString },\n\t\t\t}),\n\t\t})\n\t}\n\n\tprivate filterAllowedOperations(\n\t\tentity: Model.Entity,\n\t\trelation: Model.Relation,\n\t\tgraphQlFields: { [key: string]: GraphQLInputFieldConfig | undefined },\n\t): GraphQLInputFieldConfigMap {\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.updateEntityRelationAllowedOperationsVisitor,\n\t\t)\n\t\treturn filterObject(\n\t\t\tgraphQlFields,\n\t\t\t(key, value): value is GraphQLInputFieldConfig => allowedOperations.includes(key as Input.UpdateRelationOperation) && value !== undefined,\n\t\t)\n\t}\n\n\tprivate createUniqueWhereInput(targetEntity: Model.Entity): GraphQLInputObjectType | undefined {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (!uniqueWhere) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn uniqueWhere\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAYO,MAAM,sCAEb;AAAA,EACC,YACkB,QACA,cACA,kBACA,mCACA,2BACA,8CACA,sCAChB;AAPgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AACA,SAAA,4BAAA;AACA,SAAA,+CAAA;AACA,SAAA,uCAAA;AAAA,EAElB;AAAA,EAEO,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AK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,QAAI,CAAC,aAAa;AACjB,YAAM,IAAI,wBAAA;AAAA,IACX;AACA,WAAO;AAAA,EACR;AACD;"}
|
|
1
|
+
{"version":3,"file":"UpdateEntityRelationInputFieldVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLNonNull, GraphQLString } from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils.js'\nimport { WhereTypeProvider } from '../WhereTypeProvider.js'\nimport { Accessor, filterObject } from '../../utils/index.js'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider.js'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationAllowedOperationsVisitor } from './UpdateEntityRelationAllowedOperationsVisitor.js'\nimport { Authorizator } from '../../acl/index.js'\nimport { ImplementationException } from '../../exception.js'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider.js'\n\nexport class UpdateEntityRelationInputFieldVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly updateEntityInputProviderAccessor: Accessor<EntityInputProvider<EntityInputType.update>>,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityRelationAllowedOperationsVisitor: UpdateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {\n\t}\n\n\tpublic visitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne({ targetRelation, targetEntity, relation, entity }: Model.AnyHasOneRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\t\tconst updateInput = updateInputType ? { type: updateInputType } : undefined\n\n\t\tconst upsertInput = updateInputType && createInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst booleanInput = {\n\t\t\ttype: GraphQLBoolean,\n\t\t}\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: booleanInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: booleanInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => filteredFields,\n\t\t})\n\t}\n\n\tpublic visitHasMany({ entity, relation, targetEntity, targetRelation }: Model.AnyHasManyRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\n\t\tconst updateSpecifiedInput = updateInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tdata: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst upsertInput = updateInputType && createInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateSpecifiedInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: whereInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => ({\n\t\t\t\t...filteredFields,\n\t\t\t\talias: { type: GraphQLString },\n\t\t\t}),\n\t\t})\n\t}\n\n\tprivate filterAllowedOperations(\n\t\tentity: Model.Entity,\n\t\trelation: Model.Relation,\n\t\tgraphQlFields: { [key: string]: GraphQLInputFieldConfig | undefined },\n\t): GraphQLInputFieldConfigMap {\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.updateEntityRelationAllowedOperationsVisitor,\n\t\t)\n\t\treturn filterObject(\n\t\t\tgraphQlFields,\n\t\t\t(key, value): value is GraphQLInputFieldConfig => allowedOperations.includes(key as Input.UpdateRelationOperation) && value !== undefined,\n\t\t)\n\t}\n\n\tprivate createUniqueWhereInput(targetEntity: Model.Entity): GraphQLInputObjectType | undefined {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (!uniqueWhere) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n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KAAK;AAAA,IAAA;AAEN,WAAO;AAAA,MACN;AAAA,MACA,CAAC,KAAK,UAA4C,kBAAkB,SAAS,GAAoC,KAAK,UAAU;AAAA,IAAA;AAAA,EAElI;AAAA,EAEQ,uBAAuB,cAAgE;AAC9F,QAAI,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM,MAAM;AAC1F,aAAO;AAAA,IACR;AACA,UAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,QAAI,CAAC,aAAa;AACjB,YAAM,IAAI,wBAAA;AAAA,IACX;AACA,WAAO;AAAA,EACR;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateEntityRelationInputProvider.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputProvider.ts"],"sourcesContent":["import { singletonFactory } from '../../utils'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationInputFieldVisitor } from './UpdateEntityRelationInputFieldVisitor'\nimport { Model } from '@contember/schema'\n\nexport class UpdateEntityRelationInputProvider {\n\tprivate updateEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\trelationName: string\n\t\t}\n\t>(id => this.createUpdateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly updateEntityRelationInputFieldVisitor: UpdateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getUpdateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.updateEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createUpdateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.updateEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":["singletonFactory","acceptFieldVisitor"],"mappings":";;;;;;;AAMO,MAAM,kCAAkC;AAAA,EAS9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAVlB,kBAAA,MAAQ,8BAA6BA,iBAAAA,iBAMnC,CAAA,OAAM,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAKzE;AAAA,EAEI,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,cAAc;AAAA,EACpE;AAAA,EAEQ,gCACP,YACA,cACqC;AACrC,WAAOC,YAAAA,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAC5G;AACD;;"}
|
|
1
|
+
{"version":3,"file":"UpdateEntityRelationInputProvider.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputProvider.ts"],"sourcesContent":["import { singletonFactory } from '../../utils/index.js'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationInputFieldVisitor } from './UpdateEntityRelationInputFieldVisitor.js'\nimport { Model } from '@contember/schema'\n\nexport class UpdateEntityRelationInputProvider {\n\tprivate updateEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\trelationName: string\n\t\t}\n\t>(id => this.createUpdateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly updateEntityRelationInputFieldVisitor: UpdateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getUpdateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.updateEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createUpdateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.updateEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":["singletonFactory","acceptFieldVisitor"],"mappings":";;;;;;;AAMO,MAAM,kCAAkC;AAAA,EAS9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAVlB,kBAAA,MAAQ,8BAA6BA,iBAAAA,iBAMnC,CAAA,OAAM,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAKzE;AAAA,EAEI,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,cAAc;AAAA,EACpE;AAAA,EAEQ,gCACP,YACA,cACqC;AACrC,WAAOC,YAAAA,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAC5G;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateEntityRelationInputProvider.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputProvider.ts"],"sourcesContent":["import { singletonFactory } from '../../utils'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationInputFieldVisitor } from './UpdateEntityRelationInputFieldVisitor'\nimport { Model } from '@contember/schema'\n\nexport class UpdateEntityRelationInputProvider {\n\tprivate updateEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\trelationName: string\n\t\t}\n\t>(id => this.createUpdateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly updateEntityRelationInputFieldVisitor: UpdateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getUpdateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.updateEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createUpdateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.updateEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,kCAAkC;AAAA,EAS9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAVlB,kBAAA,MAAQ,8BAA6B,iBAMnC,CAAA,OAAM,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAKzE;AAAA,EAEI,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,cAAc;AAAA,EACpE;AAAA,EAEQ,gCACP,YACA,cACqC;AACrC,WAAO,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAC5G;AACD;"}
|
|
1
|
+
{"version":3,"file":"UpdateEntityRelationInputProvider.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputProvider.ts"],"sourcesContent":["import { singletonFactory } from '../../utils/index.js'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationInputFieldVisitor } from './UpdateEntityRelationInputFieldVisitor.js'\nimport { Model } from '@contember/schema'\n\nexport class UpdateEntityRelationInputProvider {\n\tprivate updateEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\trelationName: string\n\t\t}\n\t>(id => this.createUpdateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly updateEntityRelationInputFieldVisitor: UpdateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getUpdateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.updateEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createUpdateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.updateEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,kCAAkC;AAAA,EAS9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAVlB,kBAAA,MAAQ,8BAA6B,iBAMnC,CAAA,OAAM,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAKzE;AAAA,EAEI,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,cAAc;AAAA,EACpE;AAAA,EAEQ,gCACP,YACA,cACqC;AACrC,WAAO,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAC5G;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["../../../../../packages/engine-content-api/src/schema/utils.ts"],"sourcesContent":["import { capitalizeFirstLetter } from '../utils'\nimport { GraphQLFieldResolver } from 'graphql'\n\nexport const GqlTypeName = (strings: TemplateStringsArray, ...values: string[]) => {\n\treturn strings.reduce((combined, string, i) => {\n\t\treturn combined + string + (i < values.length ? capitalizeFirstLetter(values[i]) : '')\n\t}, '')\n}\n\nexport const aliasAwareResolver: GraphQLFieldResolver<any, any> = (source, args, context, info) => {\n\tif (!info.path) {\n\t\treturn undefined\n\t}\n\treturn source[info.path.key]\n}\n"],"names":["strings","capitalizeFirstLetter"],"mappings":";;;;AAGO,MAAM,cAAc,CAACA,cAAkC,WAAqB;AAClF,SAAOA,UAAQ,OAAO,CAAC,UAAU,QAAQ,MAAM;AAC9C,WAAO,WAAW,UAAU,IAAI,OAAO,SAASC,QAAAA,sBAAsB,OAAO,CAAC,CAAC,IAAI;AAAA,EACpF,GAAG,EAAE;AACN;AAEO,MAAM,qBAAqD,CAAC,QAAQ,MAAM,SAAS,SAAS;AAClG,MAAI,CAAC,KAAK,MAAM;AACf,WAAO;AAAA,EACR;AACA,SAAO,OAAO,KAAK,KAAK,GAAG;AAC5B;;;"}
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../../../../packages/engine-content-api/src/schema/utils.ts"],"sourcesContent":["import { capitalizeFirstLetter } from '../utils/index.js'\nimport { GraphQLFieldResolver } from 'graphql'\n\nexport const GqlTypeName = (strings: TemplateStringsArray, ...values: string[]) => {\n\treturn strings.reduce((combined, string, i) => {\n\t\treturn combined + string + (i < values.length ? capitalizeFirstLetter(values[i]) : '')\n\t}, '')\n}\n\nexport const aliasAwareResolver: GraphQLFieldResolver<any, any> = (source, args, context, info) => {\n\tif (!info.path) {\n\t\treturn undefined\n\t}\n\treturn source[info.path.key]\n}\n"],"names":["strings","capitalizeFirstLetter"],"mappings":";;;;AAGO,MAAM,cAAc,CAACA,cAAkC,WAAqB;AAClF,SAAOA,UAAQ,OAAO,CAAC,UAAU,QAAQ,MAAM;AAC9C,WAAO,WAAW,UAAU,IAAI,OAAO,SAASC,QAAAA,sBAAsB,OAAO,CAAC,CAAC,IAAI;AAAA,EACpF,GAAG,EAAE;AACN;AAEO,MAAM,qBAAqD,CAAC,QAAQ,MAAM,SAAS,SAAS;AAClG,MAAI,CAAC,KAAK,MAAM;AACf,WAAO;AAAA,EACR;AACA,SAAO,OAAO,KAAK,KAAK,GAAG;AAC5B;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../packages/engine-content-api/src/schema/utils.ts"],"sourcesContent":["import { capitalizeFirstLetter } from '../utils'\nimport { GraphQLFieldResolver } from 'graphql'\n\nexport const GqlTypeName = (strings: TemplateStringsArray, ...values: string[]) => {\n\treturn strings.reduce((combined, string, i) => {\n\t\treturn combined + string + (i < values.length ? capitalizeFirstLetter(values[i]) : '')\n\t}, '')\n}\n\nexport const aliasAwareResolver: GraphQLFieldResolver<any, any> = (source, args, context, info) => {\n\tif (!info.path) {\n\t\treturn undefined\n\t}\n\treturn source[info.path.key]\n}\n"],"names":[],"mappings":";;AAGO,MAAM,cAAc,CAAC,YAAkC,WAAqB;AAClF,SAAO,QAAQ,OAAO,CAAC,UAAU,QAAQ,MAAM;AAC9C,WAAO,WAAW,UAAU,IAAI,OAAO,SAAS,sBAAsB,OAAO,CAAC,CAAC,IAAI;AAAA,EACpF,GAAG,EAAE;AACN;AAEO,MAAM,qBAAqD,CAAC,QAAQ,MAAM,SAAS,SAAS;AAClG,MAAI,CAAC,KAAK,MAAM;AACf,WAAO;AAAA,EACR;AACA,SAAO,OAAO,KAAK,KAAK,GAAG;AAC5B;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../packages/engine-content-api/src/schema/utils.ts"],"sourcesContent":["import { capitalizeFirstLetter } from '../utils/index.js'\nimport { GraphQLFieldResolver } from 'graphql'\n\nexport const GqlTypeName = (strings: TemplateStringsArray, ...values: string[]) => {\n\treturn strings.reduce((combined, string, i) => {\n\t\treturn combined + string + (i < values.length ? capitalizeFirstLetter(values[i]) : '')\n\t}, '')\n}\n\nexport const aliasAwareResolver: GraphQLFieldResolver<any, any> = (source, args, context, info) => {\n\tif (!info.path) {\n\t\treturn undefined\n\t}\n\treturn source[info.path.key]\n}\n"],"names":[],"mappings":";;AAGO,MAAM,cAAc,CAAC,YAAkC,WAAqB;AAClF,SAAO,QAAQ,OAAO,CAAC,UAAU,QAAQ,MAAM;AAC9C,WAAO,WAAW,UAAU,IAAI,OAAO,SAAS,sBAAsB,OAAO,CAAC,CAAC,IAAI;AAAA,EACpF,GAAG,EAAE;AACN;AAEO,MAAM,qBAAqD,CAAC,QAAQ,MAAM,SAAS,SAAS;AAClG,MAAI,CAAC,KAAK,MAAM;AACf,WAAO;AAAA,EACR;AACA,SAAO,OAAO,KAAK,KAAK,GAAG;AAC5B;"}
|