@contember/engine-content-api 2.1.0-rc.3 → 2.2.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +12 -0
- package/dist/development/src/ExecutionContainer.cjs +7 -4
- package/dist/development/src/ExecutionContainer.cjs.map +1 -1
- package/dist/development/src/ExecutionContainer.js +7 -4
- 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 +8 -5
- package/dist/development/src/mapper/Mapper.cjs.map +1 -1
- package/dist/development/src/mapper/Mapper.js +8 -5
- package/dist/development/src/mapper/Mapper.js.map +1 -1
- package/dist/development/src/mapper/MapperFactory.cjs +7 -4
- package/dist/development/src/mapper/MapperFactory.cjs.map +1 -1
- package/dist/development/src/mapper/MapperFactory.js +7 -4
- package/dist/development/src/mapper/MapperFactory.js.map +1 -1
- package/dist/development/src/mapper/MutationProcessorHelper.cjs.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 +10 -1
- package/dist/development/src/mapper/select/ConditionBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/ConditionBuilder.js +10 -1
- 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 +2 -2
- package/dist/development/src/mapper/select/RelationFetcher.cjs.map +1 -1
- package/dist/development/src/mapper/select/RelationFetcher.js +2 -2
- 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 +39 -19
- package/dist/development/src/mapper/select/SelectHydrator.cjs.map +1 -1
- package/dist/development/src/mapper/select/SelectHydrator.js +39 -19
- 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 +49 -35
- package/dist/development/src/resolvers/MutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/MutationResolver.js +50 -36
- 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 +7 -4
- package/dist/production/src/ExecutionContainer.cjs.map +1 -1
- package/dist/production/src/ExecutionContainer.js +7 -4
- 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 +8 -5
- package/dist/production/src/mapper/Mapper.cjs.map +1 -1
- package/dist/production/src/mapper/Mapper.js +8 -5
- package/dist/production/src/mapper/Mapper.js.map +1 -1
- package/dist/production/src/mapper/MapperFactory.cjs +7 -4
- package/dist/production/src/mapper/MapperFactory.cjs.map +1 -1
- package/dist/production/src/mapper/MapperFactory.js +7 -4
- package/dist/production/src/mapper/MapperFactory.js.map +1 -1
- package/dist/production/src/mapper/MutationProcessorHelper.cjs.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 +10 -1
- package/dist/production/src/mapper/select/ConditionBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/ConditionBuilder.js +10 -1
- 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 +2 -2
- package/dist/production/src/mapper/select/RelationFetcher.cjs.map +1 -1
- package/dist/production/src/mapper/select/RelationFetcher.js +2 -2
- 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 +39 -19
- package/dist/production/src/mapper/select/SelectHydrator.cjs.map +1 -1
- package/dist/production/src/mapper/select/SelectHydrator.js +39 -19
- 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 +49 -35
- package/dist/production/src/resolvers/MutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/MutationResolver.js +50 -36
- 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/memoryBudget.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/insert/memoryBudget.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/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/integration/graphQlSchema/model.d.ts +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/assert.d.ts.map +1 -1
- package/dist/tests/src/tags.d.ts.map +1 -1
- package/dist/tests/src/test.d.ts +4 -1
- package/dist/tests/src/test.d.ts.map +1 -1
- package/dist/tests/src/testGraphql.d.ts.map +1 -1
- package/dist/tests/src/testUuid.d.ts.map +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ExecutionContainer.d.ts +14 -13
- package/dist/types/ExecutionContainer.d.ts.map +1 -1
- package/dist/types/acl/Authorizator.d.ts.map +1 -1
- package/dist/types/acl/EvaluatedPredicateReplacer.d.ts.map +1 -1
- package/dist/types/acl/PermissionFactory.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/VariableInjector.d.ts.map +1 -1
- package/dist/types/acl/VariableUtils.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/exception.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/ColumnValueResolver.d.ts.map +1 -1
- package/dist/types/input-validation/EntityRulesResolver.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/ValidationContext.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/ValidationPath.d.ts.map +1 -1
- package/dist/types/input-validation/dependencies/DependencyCollector.d.ts.map +1 -1
- package/dist/types/input-validation/dependencies/DependencyMerger.d.ts +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/FieldNode.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/introspection/introspection.schema.d.ts.map +1 -1
- package/dist/types/mapper/CheckedPrimary.d.ts.map +1 -1
- package/dist/types/mapper/ColumnValue.d.ts.map +1 -1
- package/dist/types/mapper/Constraints.d.ts.map +1 -1
- package/dist/types/mapper/ErrorUtils.d.ts +1 -1
- package/dist/types/mapper/ErrorUtils.d.ts.map +1 -1
- package/dist/types/mapper/EventManager.d.ts +11 -11
- 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 +17 -14
- package/dist/types/mapper/Mapper.d.ts.map +1 -1
- package/dist/types/mapper/MapperFactory.d.ts +11 -10
- 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/DeletedEntitiesStorage.d.ts.map +1 -1
- package/dist/types/mapper/delete/helpers.d.ts +1 -1
- package/dist/types/mapper/delete/helpers.d.ts.map +1 -1
- package/dist/types/mapper/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 +8 -8
- 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/Path.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 +7 -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/ConditionOptimizer.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/select/optimizer/WhereReplacer.d.ts.map +1 -1
- package/dist/types/mapper/select/optimizer/helpers.d.ts +1 -1
- package/dist/types/mapper/select/optimizer/helpers.d.ts.map +1 -1
- package/dist/types/mapper/types.d.ts +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/EnumsProvider.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/OperationExtension.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/schema/utils.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/Mutex.d.ts.map +1 -1
- package/dist/types/utils/ResolveInfoUtils.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/isIt.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/dist/types/utils/promises.d.ts.map +1 -1
- package/dist/types/utils/singletonFactory.d.ts.map +1 -1
- package/dist/types/utils/strings.d.ts.map +1 -1
- package/dist/types/utils/tuple.d.ts.map +1 -1
- package/dist/types/utils/uniqueWhereFields.d.ts.map +1 -1
- package/dist/types/utils/viewComputedId.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/ExecutionContainer.ts +27 -14
- 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 +23 -19
- package/src/mapper/MapperFactory.ts +15 -11
- 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 +15 -2
- 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 +11 -13
- 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 +45 -18
- 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 +68 -45
- 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/memoryBudget.test.ts +97 -0
- 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 +51 -5
- 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 +6 -6
- 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 +4 -4
- 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 +3 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-create-only.gql +1 -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 +3 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-restricted-delete.gql +3 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-restricted-update.gql +3 -0
- package/tests/cases/integration/graphQlSchema/schema-acl.gql +3 -0
- package/tests/cases/integration/graphQlSchema/schema-aliased-type.gql +3 -0
- package/tests/cases/integration/graphQlSchema/schema-array.gql +1 -0
- package/tests/cases/integration/graphQlSchema/schema-basic.gql +3 -0
- package/tests/cases/integration/graphQlSchema/schema-bug-66.gql +3 -0
- package/tests/cases/integration/graphQlSchema/schema-column-types.gql +3 -0
- package/tests/cases/integration/graphQlSchema/schema-custom-primary.gql +3 -0
- package/tests/cases/integration/graphQlSchema/schema-has-many-reduction.gql +3 -0
- package/tests/cases/integration/graphQlSchema/schema-new-builder.gql +3 -0
- package/tests/cases/integration/graphQlSchema/schema-no-root-ops.gql +3 -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 +9 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutationProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/MutationProvider.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLFieldConfig, GraphQLNonNull, GraphQLObjectType, GraphQLObjectTypeConfig, GraphQLString } from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { Context } from '../types'\nimport { EntityTypeProvider } from './EntityTypeProvider'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { Authorizator } from '../acl'\nimport { EntityInputProvider, EntityInputType } from './mutations'\nimport { filterObject } from '../utils'\nimport { aliasAwareResolver, GqlTypeName } from './utils'\nimport { ResultSchemaTypeProvider } from './ResultSchemaTypeProvider'\nimport { ExtensionKey, Operation, OperationMeta } from './OperationExtension'\n\ntype FieldConfig<TArgs> = GraphQLFieldConfig<any, Context, TArgs>\n\nexport class MutationProvider {\n\tconstructor(\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityInputProvider: EntityInputProvider<EntityInputType.update>,\n\t\tprivate readonly resultSchemaTypeProvider: ResultSchemaTypeProvider,\n\t) {}\n\n\tpublic getMutations(entity: Model.Entity): { [fieldName: string]: FieldConfig<any> } {\n\t\tconst entityName = entity.name\n\t\tconst mutations: { [fieldName: string]: FieldConfig<any> | undefined } = {}\n\t\tmutations[`create${entityName}`] = this.getCreateMutation(entity)\n\t\tmutations[`delete${entityName}`] = this.getDeleteMutation(entity)\n\t\tmutations[`update${entityName}`] = this.getUpdateMutation(entity)\n\t\tmutations[`upsert${entityName}`] = this.getUpsertMutation(entity)\n\n\t\treturn filterObject(mutations, (key, value): value is FieldConfig<any> => value !== undefined)\n\t}\n\n\tprotected getCreateMutation(entity: Model.Entity): FieldConfig<Input.CreateInput> | undefined {\n\t\tif (this.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.create)) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.createEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst resultType = this.createResultType(entityName, 'create')\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(resultType),\n\t\t\targs: {\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.create, entity) },\n\t\t\tresolve: (parent, args, context: Context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.mutation.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.mutationResolver.resolveCreate(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprotected getDeleteMutation(entity: Model.Entity): FieldConfig<Input.DeleteInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tif (this.authorizator.isRootOperationDisallowed(entityName, Acl.Operation.delete)) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (entity.view) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.delete, entityName) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.createResultType(entityName, 'delete')),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.delete, entity) },\n\t\t\tresolve: (parent, args, context: Context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.mutation.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.mutationResolver.resolveDelete(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprotected getUpdateMutation(entity: Model.Entity): FieldConfig<Input.UpdateInput> | undefined {\n\t\tif (this.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.update)) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.updateEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst resultType = this.createResultType(entityName, 'update')\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(resultType),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.update, entity) },\n\t\t\tresolve: (parent, args, context: Context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.mutationResolver.resolveUpdate(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate getUpsertMutation(entity: Model.Entity): FieldConfig<Input.UpsertInput> | undefined {\n\t\tif (\n\t\t\tthis.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.update)\n\t\t\t|| this.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.create)\n\t\t) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst entityName = entity.name\n\t\tconst createInput = this.createEntityInputProvider.getInput(entityName)\n\t\tif (createInput === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst updateInput = this.updateEntityInputProvider.getInput(entityName)\n\t\tif (updateInput === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst resultType = this.createResultType(entityName, 'upsert')\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(resultType),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t\tupdate: { type: new GraphQLNonNull(updateInput) },\n\t\t\t\tcreate: { type: new GraphQLNonNull(createInput) },\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.upsert, entity) },\n\t\t\tresolve: (parent, args, context: Context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.mutationResolver.resolveUpsert(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate createResultType(\n\t\tentityName: string,\n\t\toperation: 'create' | 'update' | 'delete' | 'upsert',\n\t): GraphQLObjectType {\n\t\tconst fields: GraphQLObjectTypeConfig<any, any>['fields'] = {\n\t\t\tok: { type: new GraphQLNonNull(GraphQLBoolean) },\n\t\t\terrorMessage: { type: GraphQLString },\n\t\t\terrors: { type: this.resultSchemaTypeProvider.errorListResultType },\n\t\t}\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) !== 'no') {\n\t\t\tconst nodeType = this.entityTypeProvider.getEntity(entityName)\n\t\t\tfields.node = { type: nodeType, resolve: aliasAwareResolver }\n\t\t}\n\t\tif (operation !== 'delete') {\n\t\t\tfields.validation = {\n\t\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\t}\n\t\t}\n\t\treturn new GraphQLObjectType({\n\t\t\tname: GqlTypeName`${entityName}${operation}Result`,\n\t\t\tfields: fields,\n\t\t\tinterfaces: [this.resultSchemaTypeProvider.mutationResultType],\n\t\t})\n\t}\n}\n"],"names":[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KAAK,mBAAmB,UAAU,UAAU;AAC7D,aAAO,OAAO,EAAE,MAAM,UAAU,SAAS,mBAAA;AAAA,IAC1C;AACA,QAAI,cAAc,UAAU;AAC3B,aAAO,aAAa;AAAA,QACnB,MAAM,IAAI,eAAe,KAAK,yBAAyB,oBAAoB;AAAA,MAAA;AAAA,IAE7E;AACA,WAAO,IAAI,kBAAkB;AAAA,MAC5B,MAAM,cAAc,UAAU,GAAG,SAAS;AAAA,MAC1C;AAAA,MACA,YAAY,CAAC,KAAK,yBAAyB,kBAAkB;AAAA,IAAA,CAC7D;AAAA,EACF;AACD;"}
|
|
1
|
+
{"version":3,"file":"MutationProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/MutationProvider.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLFieldConfig, GraphQLNonNull, GraphQLObjectType, GraphQLObjectTypeConfig, GraphQLString } from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { Context } from '../types.js'\nimport { EntityTypeProvider } from './EntityTypeProvider.js'\nimport { WhereTypeProvider } from './WhereTypeProvider.js'\nimport { Authorizator } from '../acl/index.js'\nimport { EntityInputProvider, EntityInputType } from './mutations/index.js'\nimport { filterObject } from '../utils/index.js'\nimport { aliasAwareResolver, GqlTypeName } from './utils.js'\nimport { ResultSchemaTypeProvider } from './ResultSchemaTypeProvider.js'\nimport { ExtensionKey, Operation, OperationMeta } from './OperationExtension.js'\n\ntype FieldConfig<TArgs> = GraphQLFieldConfig<any, Context, TArgs>\n\nexport class MutationProvider {\n\tconstructor(\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityInputProvider: EntityInputProvider<EntityInputType.update>,\n\t\tprivate readonly resultSchemaTypeProvider: ResultSchemaTypeProvider,\n\t) {}\n\n\tpublic getMutations(entity: Model.Entity): { [fieldName: string]: FieldConfig<any> } {\n\t\tconst entityName = entity.name\n\t\tconst mutations: { [fieldName: string]: FieldConfig<any> | undefined } = {}\n\t\tmutations[`create${entityName}`] = this.getCreateMutation(entity)\n\t\tmutations[`delete${entityName}`] = this.getDeleteMutation(entity)\n\t\tmutations[`update${entityName}`] = this.getUpdateMutation(entity)\n\t\tmutations[`upsert${entityName}`] = this.getUpsertMutation(entity)\n\n\t\treturn filterObject(mutations, (key, value): value is FieldConfig<any> => value !== undefined)\n\t}\n\n\tprotected getCreateMutation(entity: Model.Entity): FieldConfig<Input.CreateInput> | undefined {\n\t\tif (this.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.create)) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.createEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst resultType = this.createResultType(entityName, 'create')\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(resultType),\n\t\t\targs: {\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.create, entity) },\n\t\t\tresolve: (parent, args, context: Context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.mutation.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.mutationResolver.resolveCreate(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprotected getDeleteMutation(entity: Model.Entity): FieldConfig<Input.DeleteInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tif (this.authorizator.isRootOperationDisallowed(entityName, Acl.Operation.delete)) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (entity.view) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.delete, entityName) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.createResultType(entityName, 'delete')),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.delete, entity) },\n\t\t\tresolve: (parent, args, context: Context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.mutation.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.mutationResolver.resolveDelete(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprotected getUpdateMutation(entity: Model.Entity): FieldConfig<Input.UpdateInput> | undefined {\n\t\tif (this.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.update)) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.updateEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst resultType = this.createResultType(entityName, 'update')\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(resultType),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.update, entity) },\n\t\t\tresolve: (parent, args, context: Context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.mutationResolver.resolveUpdate(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate getUpsertMutation(entity: Model.Entity): FieldConfig<Input.UpsertInput> | undefined {\n\t\tif (\n\t\t\tthis.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.update)\n\t\t\t|| this.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.create)\n\t\t) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst entityName = entity.name\n\t\tconst createInput = this.createEntityInputProvider.getInput(entityName)\n\t\tif (createInput === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst updateInput = this.updateEntityInputProvider.getInput(entityName)\n\t\tif (updateInput === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst resultType = this.createResultType(entityName, 'upsert')\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(resultType),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t\tupdate: { type: new GraphQLNonNull(updateInput) },\n\t\t\t\tcreate: { type: new GraphQLNonNull(createInput) },\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.upsert, entity) },\n\t\t\tresolve: (parent, args, context: Context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.mutationResolver.resolveUpsert(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate createResultType(\n\t\tentityName: string,\n\t\toperation: 'create' | 'update' | 'delete' | 'upsert',\n\t): GraphQLObjectType {\n\t\tconst fields: GraphQLObjectTypeConfig<any, any>['fields'] = {\n\t\t\tok: { type: new GraphQLNonNull(GraphQLBoolean) },\n\t\t\terrorMessage: { type: GraphQLString },\n\t\t\terrors: { type: this.resultSchemaTypeProvider.errorListResultType },\n\t\t}\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) !== 'no') {\n\t\t\tconst nodeType = this.entityTypeProvider.getEntity(entityName)\n\t\t\tfields.node = { type: nodeType, resolve: aliasAwareResolver }\n\t\t}\n\t\tif (operation !== 'delete') {\n\t\t\tfields.validation = {\n\t\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\t}\n\t\t}\n\t\treturn new GraphQLObjectType({\n\t\t\tname: GqlTypeName`${entityName}${operation}Result`,\n\t\t\tfields: fields,\n\t\t\tinterfaces: [this.resultSchemaTypeProvider.mutationResultType],\n\t\t})\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAcO,MAAM,iBAAiB;AAAA,EAC7B,YACkB,cACA,mBACA,oBACA,2BACA,2BACA,0BAChB;AANgB,SAAA,eAAA;AACA,SAAA,oBAAA;AACA,SAAA,qBAAA;AACA,SAAA,4BAAA;AACA,SAAA,4BAAA;AACA,SAAA,2BAAA;AAAA,EACf;AAAA,EAEI,aAAa,QAAiE;AACpF,UAAM,aAAa,OAAO;AAC1B,UAAM,YAAmE,CAAA;AACzE,cAAU,SAAS,UAAU,EAAE,IAAI,KAAK,kBAAkB,MAAM;AAChE,cAAU,SAAS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AAA,EACF;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationExtension.cjs","sources":["../../../../../packages/engine-content-api/src/schema/OperationExtension.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { ImplementationException } from '../exception'\n\nexport class OperationMeta {\n\tconstructor(public readonly operation: Operation, public readonly entity: Model.Entity) {}\n}\n\nexport const ExtensionKey = 'OperationMeta'\n\nexport const readOperationMeta = (data: Record<string, unknown> | undefined | null): OperationMeta => {\n\tif (!data) {\n\t\tthrow new ImplementationException()\n\t}\n\tconst meta = data[ExtensionKey]\n\tif (!(meta instanceof OperationMeta)) {\n\t\tthrow new ImplementationException('OperationMeta not found')\n\t}\n\treturn meta\n}\n\nexport enum Operation {\n\tcreate = 'create',\n\tupdate = 'update',\n\tupsert = 'upsert',\n\tdelete = 'delete',\n\tlist = 'list',\n\tget = 'get',\n\tpaginate = 'paginate',\n}\n"],"names":["ImplementationException","Operation"],"mappings":";;;AAGO,MAAM,cAAc;AAAA,EAC1B,YAA4B,WAAsC,QAAsB;AAA5D,SAAA,YAAA;AAAsC,SAAA,SAAA;AAAA,EAAuB;AAC1F;AAEO,MAAM,eAAe;AAErB,MAAM,oBAAoB,CAAC,SAAoE;AACrG,MAAI,CAAC,MAAM;AACV,UAAM,IAAIA,UAAAA,wBAAA;AAAA,EACX;AACA,QAAM,OAAO,KAAK,YAAY;AAC9B,MAAI,EAAE,gBAAgB,gBAAgB;AACrC,UAAM,IAAIA,UAAAA,wBAAwB,yBAAyB;AAAA,EAC5D;AACA,SAAO;AACR;AAEO,IAAK,8BAAAC,eAAL;AACNA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AACNA,aAAA,UAAA,IAAW;AAPA,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"OperationExtension.cjs","sources":["../../../../../packages/engine-content-api/src/schema/OperationExtension.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { ImplementationException } from '../exception.js'\n\nexport class OperationMeta {\n\tconstructor(public readonly operation: Operation, public readonly entity: Model.Entity) {}\n}\n\nexport const ExtensionKey = 'OperationMeta'\n\nexport const readOperationMeta = (data: Record<string, unknown> | undefined | null): OperationMeta => {\n\tif (!data) {\n\t\tthrow new ImplementationException()\n\t}\n\tconst meta = data[ExtensionKey]\n\tif (!(meta instanceof OperationMeta)) {\n\t\tthrow new ImplementationException('OperationMeta not found')\n\t}\n\treturn meta\n}\n\nexport enum Operation {\n\tcreate = 'create',\n\tupdate = 'update',\n\tupsert = 'upsert',\n\tdelete = 'delete',\n\tlist = 'list',\n\tget = 'get',\n\tpaginate = 'paginate',\n}\n"],"names":["ImplementationException","Operation"],"mappings":";;;AAGO,MAAM,cAAc;AAAA,EAC1B,YAA4B,WAAsC,QAAsB;AAA5D,SAAA,YAAA;AAAsC,SAAA,SAAA;AAAA,EAAuB;AAC1F;AAEO,MAAM,eAAe;AAErB,MAAM,oBAAoB,CAAC,SAAoE;AACrG,MAAI,CAAC,MAAM;AACV,UAAM,IAAIA,UAAAA,wBAAA;AAAA,EACX;AACA,QAAM,OAAO,KAAK,YAAY;AAC9B,MAAI,EAAE,gBAAgB,gBAAgB;AACrC,UAAM,IAAIA,UAAAA,wBAAwB,yBAAyB;AAAA,EAC5D;AACA,SAAO;AACR;AAEO,IAAK,8BAAAC,eAAL;AACNA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AACNA,aAAA,UAAA,IAAW;AAPA,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationExtension.js","sources":["../../../../../packages/engine-content-api/src/schema/OperationExtension.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { ImplementationException } from '../exception'\n\nexport class OperationMeta {\n\tconstructor(public readonly operation: Operation, public readonly entity: Model.Entity) {}\n}\n\nexport const ExtensionKey = 'OperationMeta'\n\nexport const readOperationMeta = (data: Record<string, unknown> | undefined | null): OperationMeta => {\n\tif (!data) {\n\t\tthrow new ImplementationException()\n\t}\n\tconst meta = data[ExtensionKey]\n\tif (!(meta instanceof OperationMeta)) {\n\t\tthrow new ImplementationException('OperationMeta not found')\n\t}\n\treturn meta\n}\n\nexport enum Operation {\n\tcreate = 'create',\n\tupdate = 'update',\n\tupsert = 'upsert',\n\tdelete = 'delete',\n\tlist = 'list',\n\tget = 'get',\n\tpaginate = 'paginate',\n}\n"],"names":["Operation"],"mappings":";AAGO,MAAM,cAAc;AAAA,EAC1B,YAA4B,WAAsC,QAAsB;AAA5D,SAAA,YAAA;AAAsC,SAAA,SAAA;AAAA,EAAuB;AAC1F;AAEO,MAAM,eAAe;AAErB,MAAM,oBAAoB,CAAC,SAAoE;AACrG,MAAI,CAAC,MAAM;AACV,UAAM,IAAI,wBAAA;AAAA,EACX;AACA,QAAM,OAAO,KAAK,YAAY;AAC9B,MAAI,EAAE,gBAAgB,gBAAgB;AACrC,UAAM,IAAI,wBAAwB,yBAAyB;AAAA,EAC5D;AACA,SAAO;AACR;AAEO,IAAK,8BAAAA,eAAL;AACNA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AACNA,aAAA,UAAA,IAAW;AAPA,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"OperationExtension.js","sources":["../../../../../packages/engine-content-api/src/schema/OperationExtension.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { ImplementationException } from '../exception.js'\n\nexport class OperationMeta {\n\tconstructor(public readonly operation: Operation, public readonly entity: Model.Entity) {}\n}\n\nexport const ExtensionKey = 'OperationMeta'\n\nexport const readOperationMeta = (data: Record<string, unknown> | undefined | null): OperationMeta => {\n\tif (!data) {\n\t\tthrow new ImplementationException()\n\t}\n\tconst meta = data[ExtensionKey]\n\tif (!(meta instanceof OperationMeta)) {\n\t\tthrow new ImplementationException('OperationMeta not found')\n\t}\n\treturn meta\n}\n\nexport enum Operation {\n\tcreate = 'create',\n\tupdate = 'update',\n\tupsert = 'upsert',\n\tdelete = 'delete',\n\tlist = 'list',\n\tget = 'get',\n\tpaginate = 'paginate',\n}\n"],"names":["Operation"],"mappings":";AAGO,MAAM,cAAc;AAAA,EAC1B,YAA4B,WAAsC,QAAsB;AAA5D,SAAA,YAAA;AAAsC,SAAA,SAAA;AAAA,EAAuB;AAC1F;AAEO,MAAM,eAAe;AAErB,MAAM,oBAAoB,CAAC,SAAoE;AACrG,MAAI,CAAC,MAAM;AACV,UAAM,IAAI,wBAAA;AAAA,EACX;AACA,QAAM,OAAO,KAAK,YAAY;AAC9B,MAAI,EAAE,gBAAgB,gBAAgB;AACrC,UAAM,IAAI,wBAAwB,yBAAyB;AAAA,EAC5D;AACA,SAAO;AACR;AAEO,IAAK,8BAAAA,eAAL;AACNA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AACNA,aAAA,UAAA,IAAW;AAPA,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderByTypeProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/OrderByTypeProvider.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInputFieldConfig,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType,\n\tGraphQLInputType,\n\tGraphQLInt,\n} from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { singletonFactory } from '../utils'\nimport { GqlTypeName } from './utils'\nimport { Authorizator } from '../acl'\nimport { FieldAccessVisitor } from './FieldAccessVisitor'\n\nexport class OrderByTypeProvider {\n\tprivate orderBySingleton = singletonFactory(name => this.createEntityOrderByType(name))\n\n\tprivate orderDirectionEnum = new GraphQLEnumType({\n\t\tname: 'OrderDirection',\n\t\tvalues: {\n\t\t\tasc: { value: 'asc' },\n\t\t\tdesc: { value: 'desc' },\n\t\t\tascNullsFirst: { value: 'ascNullsFirst' },\n\t\t\tdescNullsLast: { value: 'descNullsLast' },\n\t\t},\n\t})\n\n\tconstructor(private readonly schema: Model.Schema, private readonly authorizator: Authorizator) {}\n\n\tpublic getEntityOrderByType(entityName: string): GraphQLInputType {\n\t\treturn this.orderBySingleton(entityName)\n\t}\n\n\tprivate createEntityOrderByType(entityName: string): GraphQLInputType {\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}OrderBy`,\n\t\t\tfields: () => this.getEntityOrderByFields(entityName),\n\t\t})\n\t}\n\n\tprivate getEntityOrderByFields(name: string) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {\n\t\t\t_random: { type: GraphQLBoolean },\n\t\t\t_randomSeeded: { type: GraphQLInt },\n\t\t}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst field = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => {\n\t\t\t\t\tif (column.list) {\n\t\t\t\t\t\treturn undefined\n\t\t\t\t\t}\n\t\t\t\t\treturn ({ type: this.orderDirectionEnum })\n\t\t\t\t},\n\t\t\t\tvisitHasOne: ({ relation }) => ({ type: this.getEntityOrderByType(relation.target) }),\n\t\t\t\tvisitHasMany: () => undefined,\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig | undefined>)\n\n\t\t\tif (field !== undefined) {\n\t\t\t\tfields[fieldName] = field\n\t\t\t}\n\t\t}\n\n\t\treturn fields\n\t}\n}\n"],"names":["schema","singletonFactory","GraphQLEnumType","GraphQLInputObjectType","GqlTypeName","GraphQLBoolean","GraphQLInt","FieldAccessVisitor","Acl","acceptFieldVisitor"],"mappings":";;;;;;;;;;;AAgBO,MAAM,oBAAoB;AAAA,EAahC,YAA6BA,SAAuC,cAA4B;AAAnE,SAAA,SAAAA;AAAuC,SAAA,eAAA;AAZpE,kBAAA,MAAQ,oBAAmBC,kCAAiB,CAAA,SAAQ,KAAK,wBAAwB,IAAI,CAAC,CAAA;AAEtF,kBAAA,MAAQ,sBAAqB,IAAIC,wBAAgB;AAAA,MAChD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,KAAK,EAAE,OAAO,MAAA;AAAA,QACd,MAAM,EAAE,OAAO,OAAA;AAAA,QACf,eAAe,EAAE,OAAO,gBAAA;AAAA,QACxB,eAAe,EAAE,OAAO,gBAAA;AAAA,MAAgB;AAAA,IACzC,CACA,CAAA;AAAA,EAEgG;AAAA,EAE1F,qBAAqB,YAAsC;AACjE,WAAO,KAAK,iBAAiB,UAAU;AAAA,EACxC;AAAA,EAEQ,wBAAwB,YAAsC;AACrE,WAAO,IAAIC,QAAAA,uBAAuB;AAAA,MACjC,MAAMC,MAAAA,cAAc,UAAU;AAAA,MAC9B,QAAQ,MAAM,KAAK,uBAAuB,UAAU;AAAA,IAAA,CACpD;AAAA,EACF;AAAA,EAEQ,uBAAuB,MAAc;AAC5C,UAAM,SAAqC;AAAA,MAC1C,SAAS,EAAE,MAAMC,uBAAA;AAAA,MACjB,eAAe,EAAE,MAAMC,QAAAA,WAAA;AAAA,IAAW;AAEnC,UAAM,SAAS,KAAK,OAAO,SAAS,IAAI;AAExC,eAAW,aAAa,OAAO,QAAQ;AACtC,UAAI,CAAC,OAAO,OAAO,eAAe,SAAS,GAAG;AAC7C;AAAA,MACD;AACA,YAAM,gBAAgB,IAAIC,sCAAmBC,OAAAA,IAAI,UAAU,MAAM,KAAK,YAAY;AAClF,UAAI,CAACC,YAAAA,mBAAmB,KAAK,QAAQ,MAAM,WAAW,aAAa,GAAG;AACrE;AAAA,MACD;AAEA,YAAM,QAAQA,YAAAA,mBAAmB,KAAK,QAAQ,MAAM,WAAW;AAAA,QAC9D,aAAa,CAAC,EAAE,aAAa;AAC5B,cAAI,OAAO,MAAM;AAChB,mBAAO;AAAA,UACR;AACA,iBAAQ,EAAE,MAAM,KAAK,mBAAA;AAAA,QACtB;AAAA,QACA,aAAa,CAAC,EAAE,SAAA,OAAgB,EAAE,MAAM,KAAK,qBAAqB,SAAS,MAAM;QACjF,cAAc,MAAM;AAAA,MAAA,CACuC;AAE5D,UAAI,UAAU,QAAW;AACxB,eAAO,SAAS,IAAI;AAAA,MACrB;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;;"}
|
|
1
|
+
{"version":3,"file":"OrderByTypeProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/OrderByTypeProvider.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInputFieldConfig,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType,\n\tGraphQLInputType,\n\tGraphQLInt,\n} from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { singletonFactory } from '../utils/index.js'\nimport { GqlTypeName } from './utils.js'\nimport { Authorizator } from '../acl/index.js'\nimport { FieldAccessVisitor } from './FieldAccessVisitor.js'\n\nexport class OrderByTypeProvider {\n\tprivate orderBySingleton = singletonFactory(name => this.createEntityOrderByType(name))\n\n\tprivate orderDirectionEnum = new GraphQLEnumType({\n\t\tname: 'OrderDirection',\n\t\tvalues: {\n\t\t\tasc: { value: 'asc' },\n\t\t\tdesc: { value: 'desc' },\n\t\t\tascNullsFirst: { value: 'ascNullsFirst' },\n\t\t\tdescNullsLast: { value: 'descNullsLast' },\n\t\t},\n\t})\n\n\tconstructor(private readonly schema: Model.Schema, private readonly authorizator: Authorizator) {}\n\n\tpublic getEntityOrderByType(entityName: string): GraphQLInputType {\n\t\treturn this.orderBySingleton(entityName)\n\t}\n\n\tprivate createEntityOrderByType(entityName: string): GraphQLInputType {\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}OrderBy`,\n\t\t\tfields: () => this.getEntityOrderByFields(entityName),\n\t\t})\n\t}\n\n\tprivate getEntityOrderByFields(name: string) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {\n\t\t\t_random: { type: GraphQLBoolean },\n\t\t\t_randomSeeded: { type: GraphQLInt },\n\t\t}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst field = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => {\n\t\t\t\t\tif (column.list) {\n\t\t\t\t\t\treturn undefined\n\t\t\t\t\t}\n\t\t\t\t\treturn ({ type: this.orderDirectionEnum })\n\t\t\t\t},\n\t\t\t\tvisitHasOne: ({ relation }) => ({ type: this.getEntityOrderByType(relation.target) }),\n\t\t\t\tvisitHasMany: () => undefined,\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig | undefined>)\n\n\t\t\tif (field !== undefined) {\n\t\t\t\tfields[fieldName] = field\n\t\t\t}\n\t\t}\n\n\t\treturn fields\n\t}\n}\n"],"names":["schema","singletonFactory","GraphQLEnumType","GraphQLInputObjectType","GqlTypeName","GraphQLBoolean","GraphQLInt","FieldAccessVisitor","Acl","acceptFieldVisitor"],"mappings":";;;;;;;;;;;AAgBO,MAAM,oBAAoB;AAAA,EAahC,YAA6BA,SAAuC,cAA4B;AAAnE,SAAA,SAAAA;AAAuC,SAAA,eAAA;AAZpE,kBAAA,MAAQ,oBAAmBC,kCAAiB,CAAA,SAAQ,KAAK,wBAAwB,IAAI,CAAC,CAAA;AAEtF,kBAAA,MAAQ,sBAAqB,IAAIC,wBAAgB;AAAA,MAChD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,KAAK,EAAE,OAAO,MAAA;AAAA,QACd,MAAM,EAAE,OAAO,OAAA;AAAA,QACf,eAAe,EAAE,OAAO,gBAAA;AAAA,QACxB,eAAe,EAAE,OAAO,gBAAA;AAAA,MAAgB;AAAA,IACzC,CACA,CAAA;AAAA,EAEgG;AAAA,EAE1F,qBAAqB,YAAsC;AACjE,WAAO,KAAK,iBAAiB,UAAU;AAAA,EACxC;AAAA,EAEQ,wBAAwB,YAAsC;AACrE,WAAO,IAAIC,QAAAA,uBAAuB;AAAA,MACjC,MAAMC,MAAAA,cAAc,UAAU;AAAA,MAC9B,QAAQ,MAAM,KAAK,uBAAuB,UAAU;AAAA,IAAA,CACpD;AAAA,EACF;AAAA,EAEQ,uBAAuB,MAAc;AAC5C,UAAM,SAAqC;AAAA,MAC1C,SAAS,EAAE,MAAMC,uBAAA;AAAA,MACjB,eAAe,EAAE,MAAMC,QAAAA,WAAA;AAAA,IAAW;AAEnC,UAAM,SAAS,KAAK,OAAO,SAAS,IAAI;AAExC,eAAW,aAAa,OAAO,QAAQ;AACtC,UAAI,CAAC,OAAO,OAAO,eAAe,SAAS,GAAG;AAC7C;AAAA,MACD;AACA,YAAM,gBAAgB,IAAIC,sCAAmBC,OAAAA,IAAI,UAAU,MAAM,KAAK,YAAY;AAClF,UAAI,CAACC,YAAAA,mBAAmB,KAAK,QAAQ,MAAM,WAAW,aAAa,GAAG;AACrE;AAAA,MACD;AAEA,YAAM,QAAQA,YAAAA,mBAAmB,KAAK,QAAQ,MAAM,WAAW;AAAA,QAC9D,aAAa,CAAC,EAAE,aAAa;AAC5B,cAAI,OAAO,MAAM;AAChB,mBAAO;AAAA,UACR;AACA,iBAAQ,EAAE,MAAM,KAAK,mBAAA;AAAA,QACtB;AAAA,QACA,aAAa,CAAC,EAAE,SAAA,OAAgB,EAAE,MAAM,KAAK,qBAAqB,SAAS,MAAM;QACjF,cAAc,MAAM;AAAA,MAAA,CACuC;AAE5D,UAAI,UAAU,QAAW;AACxB,eAAO,SAAS,IAAI;AAAA,MACrB;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderByTypeProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/OrderByTypeProvider.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInputFieldConfig,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType,\n\tGraphQLInputType,\n\tGraphQLInt,\n} from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { singletonFactory } from '../utils'\nimport { GqlTypeName } from './utils'\nimport { Authorizator } from '../acl'\nimport { FieldAccessVisitor } from './FieldAccessVisitor'\n\nexport class OrderByTypeProvider {\n\tprivate orderBySingleton = singletonFactory(name => this.createEntityOrderByType(name))\n\n\tprivate orderDirectionEnum = new GraphQLEnumType({\n\t\tname: 'OrderDirection',\n\t\tvalues: {\n\t\t\tasc: { value: 'asc' },\n\t\t\tdesc: { value: 'desc' },\n\t\t\tascNullsFirst: { value: 'ascNullsFirst' },\n\t\t\tdescNullsLast: { value: 'descNullsLast' },\n\t\t},\n\t})\n\n\tconstructor(private readonly schema: Model.Schema, private readonly authorizator: Authorizator) {}\n\n\tpublic getEntityOrderByType(entityName: string): GraphQLInputType {\n\t\treturn this.orderBySingleton(entityName)\n\t}\n\n\tprivate createEntityOrderByType(entityName: string): GraphQLInputType {\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}OrderBy`,\n\t\t\tfields: () => this.getEntityOrderByFields(entityName),\n\t\t})\n\t}\n\n\tprivate getEntityOrderByFields(name: string) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {\n\t\t\t_random: { type: GraphQLBoolean },\n\t\t\t_randomSeeded: { type: GraphQLInt },\n\t\t}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst field = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => {\n\t\t\t\t\tif (column.list) {\n\t\t\t\t\t\treturn undefined\n\t\t\t\t\t}\n\t\t\t\t\treturn ({ type: this.orderDirectionEnum })\n\t\t\t\t},\n\t\t\t\tvisitHasOne: ({ relation }) => ({ type: this.getEntityOrderByType(relation.target) }),\n\t\t\t\tvisitHasMany: () => undefined,\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig | undefined>)\n\n\t\t\tif (field !== undefined) {\n\t\t\t\tfields[fieldName] = field\n\t\t\t}\n\t\t}\n\n\t\treturn fields\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;AAgBO,MAAM,oBAAoB;AAAA,EAahC,YAA6B,QAAuC,cAA4B;AAAnE,SA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AA,QACA,aAAa,CAAC,EAAE,SAAA,OAAgB,EAAE,MAAM,KAAK,qBAAqB,SAAS,MAAM;QACjF,cAAc,MAAM;AAAA,MAAA,CACuC;AAE5D,UAAI,UAAU,QAAW;AACxB,eAAO,SAAS,IAAI;AAAA,MACrB;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;"}
|
|
1
|
+
{"version":3,"file":"OrderByTypeProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/OrderByTypeProvider.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInputFieldConfig,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType,\n\tGraphQLInputType,\n\tGraphQLInt,\n} from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { singletonFactory } from '../utils/index.js'\nimport { GqlTypeName } from './utils.js'\nimport { Authorizator } from '../acl/index.js'\nimport { FieldAccessVisitor } from './FieldAccessVisitor.js'\n\nexport class OrderByTypeProvider {\n\tprivate orderBySingleton = singletonFactory(name => this.createEntityOrderByType(name))\n\n\tprivate orderDirectionEnum = new GraphQLEnumType({\n\t\tname: 'OrderDirection',\n\t\tvalues: {\n\t\t\tasc: { value: 'asc' },\n\t\t\tdesc: { value: 'desc' },\n\t\t\tascNullsFirst: { value: 'ascNullsFirst' },\n\t\t\tdescNullsLast: { value: 'descNullsLast' },\n\t\t},\n\t})\n\n\tconstructor(private readonly schema: Model.Schema, private readonly authorizator: Authorizator) {}\n\n\tpublic getEntityOrderByType(entityName: string): GraphQLInputType {\n\t\treturn this.orderBySingleton(entityName)\n\t}\n\n\tprivate createEntityOrderByType(entityName: string): GraphQLInputType {\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}OrderBy`,\n\t\t\tfields: () => this.getEntityOrderByFields(entityName),\n\t\t})\n\t}\n\n\tprivate getEntityOrderByFields(name: string) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {\n\t\t\t_random: { type: GraphQLBoolean },\n\t\t\t_randomSeeded: { type: GraphQLInt },\n\t\t}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst field = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => {\n\t\t\t\t\tif (column.list) {\n\t\t\t\t\t\treturn undefined\n\t\t\t\t\t}\n\t\t\t\t\treturn ({ type: this.orderDirectionEnum })\n\t\t\t\t},\n\t\t\t\tvisitHasOne: ({ relation }) => ({ type: this.getEntityOrderByType(relation.target) }),\n\t\t\t\tvisitHasMany: () => undefined,\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig | undefined>)\n\n\t\t\tif (field !== undefined) {\n\t\t\t\tfields[fieldName] = field\n\t\t\t}\n\t\t}\n\n\t\treturn fields\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;AAgBO,MAAM,oBAAoB;AAAA,EAahC,YAA6B,QAAuC,cAA4B;AAAnE,SAAA,SAAA;AAAuC,SAAA,eAAA;AAZpE,kBAAA,MAAQ,oBAAmB,iBAAiB,CAAA,SAAQ,KAAK,wBAAwB,IAAI,CAAC,CAAA;AAEtF,kBAAA,MAAQ,sBAAqB,IAAI,gBAAgB;AAAA,MAChD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,KAAK,EAAE,OAAO,MAAA;AAAA,QACd,MAAM,EAAE,OAAO,OAAA;AAAA,QACf,eAAe,EAAE,OAAO,gBAAA;AAAA,QACxB,eAAe,EAAE,OAAO,gBAAA;AAAA,MAAgB;AAAA,IACzC,CACA,CAAA;AAAA,EAEgG;AAAA,EAE1F,qBAAqB,YAAsC;AACjE,WAAO,KAAK,iBAAiB,UAAU;AAAA,EACxC;AAAA,EAEQ,wBAAwB,YAAsC;AACrE,WAAO,IAAI,uBAAuB;AAAA,MACjC,MAAM,cAAc,UAAU;AAAA,MAC9B,QAAQ,MAAM,KAAK,uBAAuB,UAAU;AAAA,IAAA,CACpD;AAAA,EACF;AAAA,EAEQ,uBAAuB,MAAc;AAC5C,UAAM,SAAqC;AAAA,MAC1C,SAAS,EAAE,MAAM,eAAA;AAAA,MACjB,eAAe,EAAE,MAAM,WAAA;AAAA,IAAW;AAEnC,UAAM,SAAS,KAAK,OAAO,SAAS,IAAI;AAExC,eAAW,aAAa,OAAO,QAAQ;AACtC,UAAI,CAAC,OAAO,OAAO,eAAe,SAAS,GAAG;AAC7C;AAAA,MACD;AACA,YAAM,gBAAgB,IAAI,mBAAmB,IAAI,UAAU,MAAM,KAAK,YAAY;AAClF,UAAI,CAAC,mBAAmB,KAAK,QAAQ,MAAM,WAAW,aAAa,GAAG;AACrE;AAAA,MACD;AAEA,YAAM,QAAQ,mBAAmB,KAAK,QAAQ,MAAM,WAAW;AAAA,QAC9D,aAAa,CAAC,EAAE,aAAa;AAC5B,cAAI,OAAO,MAAM;AAChB,mBAAO;AAAA,UACR;AACA,iBAAQ,EAAE,MAAM,KAAK,mBAAA;AAAA,QACtB;AAAA,QACA,aAAa,CAAC,EAAE,SAAA,OAAgB,EAAE,MAAM,KAAK,qBAAqB,SAAS,MAAM;QACjF,cAAc,MAAM;AAAA,MAAA,CACuC;AAE5D,UAAI,UAAU,QAAW;AACxB,eAAO,SAAS,IAAI;AAAA,MACrB;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginatedFieldConfigFactory.cjs","sources":["../../../../../packages/engine-content-api/src/schema/PaginatedFieldConfigFactory.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { OrderByTypeProvider } from './OrderByTypeProvider'\nimport { EntityTypeProvider } from './EntityTypeProvider'\nimport { GraphQLFieldConfig, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\n\nexport class PaginatedFieldConfigFactory {\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t) {}\n\n\tcreateFieldConfig(entity: Model.Entity): GraphQLFieldConfig<any, any> {\n\t\tconst entityName = entity.name\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.entityTypeProvider.getConnection(entityName)),\n\n\t\t\targs: {\n\t\t\t\tfilter: { type: this.whereTypeProvider.getEntityWhereType(entityName) },\n\t\t\t\torderBy: {\n\t\t\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(entityName))),\n\t\t\t\t},\n\t\t\t\tskip: { type: GraphQLInt },\n\t\t\t\tfirst: { type: GraphQLInt },\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["GraphQLNonNull","GraphQLList","GraphQLInt"],"mappings":";;;AAMO,MAAM,4BAA4B;AAAA,EACxC,YACkB,mBACA,qBACA,oBAChB;AAHgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AACA,SAAA,qBAAA;AAAA,EACf;AAAA,EAEH,kBAAkB,QAAoD;AACrE,UAAM,aAAa,OAAO;AAC1B,WAAO;AAAA,MACN,MAAM,IAAIA,QAAAA,eAAe,KAAK,mBAAmB,cAAc,UAAU,CAAC;AAAA,MAE1E,MAAM;AAAA,QACL,QAAQ,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,UAAU,EAAA;AAAA,QACpE,SAAS;AAAA,UACR,MAAM,IAAIC,QAAAA,YAAY,IAAID,QAAAA,eAAe,KAAK,oBAAoB,qBAAqB,UAAU,CAAC,CAAC;AAAA,QAAA;AAAA,QAEpG,MAAM,EAAE,MAAME,mBAAA;AAAA,QACd,OAAO,EAAE,MAAMA,QAAAA,WAAA;AAAA,MAAW;AAAA,IAC3B;AAAA,EAEF;AACD;;"}
|
|
1
|
+
{"version":3,"file":"PaginatedFieldConfigFactory.cjs","sources":["../../../../../packages/engine-content-api/src/schema/PaginatedFieldConfigFactory.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { WhereTypeProvider } from './WhereTypeProvider.js'\nimport { OrderByTypeProvider } from './OrderByTypeProvider.js'\nimport { EntityTypeProvider } from './EntityTypeProvider.js'\nimport { GraphQLFieldConfig, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\n\nexport class PaginatedFieldConfigFactory {\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t) {}\n\n\tcreateFieldConfig(entity: Model.Entity): GraphQLFieldConfig<any, any> {\n\t\tconst entityName = entity.name\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.entityTypeProvider.getConnection(entityName)),\n\n\t\t\targs: {\n\t\t\t\tfilter: { type: this.whereTypeProvider.getEntityWhereType(entityName) },\n\t\t\t\torderBy: {\n\t\t\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(entityName))),\n\t\t\t\t},\n\t\t\t\tskip: { type: GraphQLInt },\n\t\t\t\tfirst: { type: GraphQLInt },\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["GraphQLNonNull","GraphQLList","GraphQLInt"],"mappings":";;;AAMO,MAAM,4BAA4B;AAAA,EACxC,YACkB,mBACA,qBACA,oBAChB;AAHgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AACA,SAAA,qBAAA;AAAA,EACf;AAAA,EAEH,kBAAkB,QAAoD;AACrE,UAAM,aAAa,OAAO;AAC1B,WAAO;AAAA,MACN,MAAM,IAAIA,QAAAA,eAAe,KAAK,mBAAmB,cAAc,UAAU,CAAC;AAAA,MAE1E,MAAM;AAAA,QACL,QAAQ,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,UAAU,EAAA;AAAA,QACpE,SAAS;AAAA,UACR,MAAM,IAAIC,QAAAA,YAAY,IAAID,QAAAA,eAAe,KAAK,oBAAoB,qBAAqB,UAAU,CAAC,CAAC;AAAA,QAAA;AAAA,QAEpG,MAAM,EAAE,MAAME,mBAAA;AAAA,QACd,OAAO,EAAE,MAAMA,QAAAA,WAAA;AAAA,MAAW;AAAA,IAC3B;AAAA,EAEF;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginatedFieldConfigFactory.js","sources":["../../../../../packages/engine-content-api/src/schema/PaginatedFieldConfigFactory.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { OrderByTypeProvider } from './OrderByTypeProvider'\nimport { EntityTypeProvider } from './EntityTypeProvider'\nimport { GraphQLFieldConfig, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\n\nexport class PaginatedFieldConfigFactory {\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t) {}\n\n\tcreateFieldConfig(entity: Model.Entity): GraphQLFieldConfig<any, any> {\n\t\tconst entityName = entity.name\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.entityTypeProvider.getConnection(entityName)),\n\n\t\t\targs: {\n\t\t\t\tfilter: { type: this.whereTypeProvider.getEntityWhereType(entityName) },\n\t\t\t\torderBy: {\n\t\t\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(entityName))),\n\t\t\t\t},\n\t\t\t\tskip: { type: GraphQLInt },\n\t\t\t\tfirst: { type: GraphQLInt },\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAMO,MAAM,4BAA4B;AAAA,EACxC,YACkB,mBACA,qBACA,oBAChB;AAHgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AACA,SAAA,qBAAA;AAAA,EACf;AAAA,EAEH,kBAAkB,QAAoD;AACrE,UAAM,aAAa,OAAO;AAC1B,WAAO;AAAA,MACN,MAAM,IAAI,eAAe,KAAK,mBAAmB,cAAc,UAAU,CAAC;AAAA,MAE1E,MAAM;AAAA,QACL,QAAQ,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,UAAU,EAAA;AAAA,QACpE,SAAS;AAAA,UACR,MAAM,IAAI,YAAY,IAAI,eAAe,KAAK,oBAAoB,qBAAqB,UAAU,CAAC,CAAC;AAAA,QAAA;AAAA,QAEpG,MAAM,EAAE,MAAM,WAAA;AAAA,QACd,OAAO,EAAE,MAAM,WAAA;AAAA,MAAW;AAAA,IAC3B;AAAA,EAEF;AACD;"}
|
|
1
|
+
{"version":3,"file":"PaginatedFieldConfigFactory.js","sources":["../../../../../packages/engine-content-api/src/schema/PaginatedFieldConfigFactory.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { WhereTypeProvider } from './WhereTypeProvider.js'\nimport { OrderByTypeProvider } from './OrderByTypeProvider.js'\nimport { EntityTypeProvider } from './EntityTypeProvider.js'\nimport { GraphQLFieldConfig, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\n\nexport class PaginatedFieldConfigFactory {\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t) {}\n\n\tcreateFieldConfig(entity: Model.Entity): GraphQLFieldConfig<any, any> {\n\t\tconst entityName = entity.name\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.entityTypeProvider.getConnection(entityName)),\n\n\t\t\targs: {\n\t\t\t\tfilter: { type: this.whereTypeProvider.getEntityWhereType(entityName) },\n\t\t\t\torderBy: {\n\t\t\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(entityName))),\n\t\t\t\t},\n\t\t\t\tskip: { type: GraphQLInt },\n\t\t\t\tfirst: { type: GraphQLInt },\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAMO,MAAM,4BAA4B;AAAA,EACxC,YACkB,mBACA,qBACA,oBAChB;AAHgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AACA,SAAA,qBAAA;AAAA,EACf;AAAA,EAEH,kBAAkB,QAAoD;AACrE,UAAM,aAAa,OAAO;AAC1B,WAAO;AAAA,MACN,MAAM,IAAI,eAAe,KAAK,mBAAmB,cAAc,UAAU,CAAC;AAAA,MAE1E,MAAM;AAAA,QACL,QAAQ,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,UAAU,EAAA;AAAA,QACpE,SAAS;AAAA,UACR,MAAM,IAAI,YAAY,IAAI,eAAe,KAAK,oBAAoB,qBAAqB,UAAU,CAAC,CAAC;AAAA,QAAA;AAAA,QAEpG,MAAM,EAAE,MAAM,WAAA;AAAA,QACd,OAAO,EAAE,MAAM,WAAA;AAAA,MAAW;AAAA,IAC3B;AAAA,EAEF;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/QueryProvider.ts"],"sourcesContent":["import { GraphQLFieldConfig, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { Context } from '../types'\nimport { EntityTypeProvider } from './EntityTypeProvider'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { Authorizator } from '../acl'\nimport { OrderByTypeProvider } from './OrderByTypeProvider'\nimport { ExtensionKey, Operation, OperationMeta } from './OperationExtension'\nimport { ImplementationException } from '../exception'\nimport { PaginatedFieldConfigFactory } from './PaginatedFieldConfigFactory'\n\nexport class QueryProvider {\n\tconstructor(\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly paginatedFieldConfigFactory: PaginatedFieldConfigFactory,\n\t) {}\n\n\tpublic getQueries(entity: Model.Entity): { [fieldName: string]: GraphQLFieldConfig<any, Context, any> } {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entity.name) === 'no') {\n\t\t\treturn {}\n\t\t}\n\t\tif (this.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.read)) {\n\t\t\treturn {}\n\t\t}\n\t\treturn {\n\t\t\t['get' + entity.name]: this.getByUniqueQuery(entity),\n\t\t\t['list' + entity.name]: this.getListQuery(entity),\n\t\t\t['paginate' + entity.name]: this.getPaginationQuery(entity),\n\t\t}\n\t}\n\n\tprivate getByUniqueQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.UniqueQueryInput> {\n\t\tconst entityName = entity.name\n\t\tconst entityType = this.entityTypeProvider.getEntity(entityName)\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn {\n\t\t\ttype: entityType,\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.get, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolveGetQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate getListQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.ListQueryInput> {\n\t\tconst entityName = entity.name\n\n\t\tconst entityType = this.entityTypeProvider.getEntity(entityName)\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType))),\n\t\t\targs: {\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t\torderBy: {\n\t\t\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(entityName))),\n\t\t\t\t},\n\t\t\t\toffset: {\n\t\t\t\t\ttype: GraphQLInt,\n\t\t\t\t},\n\t\t\t\tlimit: {\n\t\t\t\t\ttype: GraphQLInt,\n\t\t\t\t},\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.list, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolveListQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate getPaginationQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.ListQueryInput> {\n\t\treturn {\n\t\t\t...this.paginatedFieldConfigFactory.createFieldConfig(entity),\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.paginate, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolvePaginationQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["Acl","ImplementationException","GraphQLNonNull","ExtensionKey","OperationMeta","Operation","GraphQLList","GraphQLInt"],"mappings":";;;;;;AAWO,MAAM,cAAc;AAAA,EAC1B,YACkB,cACA,mBACA,qBACA,oBACA,6BAChB;AALgB,SAAA,eAAA;AACA,SAAA,oBAAA;AACA,SAAA,sBAAA;AACA,SAAA,qBAAA;AACA,SAAA,8BAAA;AAAA,EACf;AAAA,EAEI,WAAW,QAAsF;AACvG,QAAI,KAAK,aAAa,oBAAoBA,OAAAA,IAAI,UAAU,MAAM,OAAO,IAAI,MAAM,MAAM;AACpF,aAAO,CAAA;AAAA,IACR;AACA,QAAI,KAAK,aAAa,0BAA0B,OAAO,MAAMA,OAAAA,IAAI,UAAU,IAAI,GAAG;AACjF,aAAO,CAAA;AAAA,IACR;AACA,WAAO;AAAA,MACN,CAAC,QAAQ,OAAO,IAAI,GAAG,KAAK,iBAAiB,MAAM;AAAA,MACnD,CAAC,SAAS,OAAO,IAAI,GAAG,KAAK,aAAa,MAAM;AAAA,MAChD,CAAC,aAAa,OAAO,IAAI,GAAG,KAAK,mBAAmB,MAAM;AAAA,IAAA;AAAA,EAE5D;AAAA,EAEQ,iBAAiB,QAAgF;AACxG,UAAM,aAAa,OAAO;AAC1B,UAAM,aAAa,KAAK,mBAAmB,UAAU,UAAU;AAC/D,UAAM,cAAc,KAAK,kBAAkB,yBAAyB,UAAU;AAC9E,QAAI,CAAC,aAAa;AACjB,YAAM,IAAIC,UAAAA,wBAAA;AAAA,IACX;AACA,WAAO;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,QACL,IAAI;AAAA,UACH,MAAM,IAAIC,QAAAA,eAAe,WAAW;AAAA,QAAA;AAAA,QAErC,QAAQ;AAAA,UACP,MAAM,KAAK,kBAAkB,mBAAmB,UAAU;AAAA,QAAA;AAAA,MAC3D;AAAA,MAED,YAAY,EAAE,CAACC,+BAAY,GAAG,IAAIC,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AAA,QAC7E,CAAC;AAAA,MACF;AAAA,IAAA;AAAA,EAEF;AAAA,EAEQ,mBAAmB,QAA8E;AACxG,WAAO;AAAA,MACN,GAAG,KAAK,4BAA4B,kBAAkB,MAAM;AAAA,MAC5D,YAAY,EAAE,CAACF,+BAAY,GAAG,IAAIC,mBAAAA,cAAcC,6BAAU,UAAU,MAAM,EAAA;AAAA,MAC1E,SAAS,CAAC,QAAQ,MAAM,SAAS,SAAS;AACzC,eAAO,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM;AAC7D,cAAI,UAAU,KAAK,MAAM;AACxB,mBAAO,OAAO,KAAK,KAAK,GAAG;AAAA,UAC5B;AACA,iBAAO,QAAQ,mBAAmB,aAAa,uBAAuB,QAAQ,IAAI;AAAA,QACnF,CAAC;AAAA,MACF;AAAA,IAAA;AAAA,EAEF;AACD;;"}
|
|
1
|
+
{"version":3,"file":"QueryProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/QueryProvider.ts"],"sourcesContent":["import { GraphQLFieldConfig, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { Context } from '../types.js'\nimport { EntityTypeProvider } from './EntityTypeProvider.js'\nimport { WhereTypeProvider } from './WhereTypeProvider.js'\nimport { Authorizator } from '../acl/index.js'\nimport { OrderByTypeProvider } from './OrderByTypeProvider.js'\nimport { ExtensionKey, Operation, OperationMeta } from './OperationExtension.js'\nimport { ImplementationException } from '../exception.js'\nimport { PaginatedFieldConfigFactory } from './PaginatedFieldConfigFactory.js'\n\nexport class QueryProvider {\n\tconstructor(\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly paginatedFieldConfigFactory: PaginatedFieldConfigFactory,\n\t) {}\n\n\tpublic getQueries(entity: Model.Entity): { [fieldName: string]: GraphQLFieldConfig<any, Context, any> } {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entity.name) === 'no') {\n\t\t\treturn {}\n\t\t}\n\t\tif (this.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.read)) {\n\t\t\treturn {}\n\t\t}\n\t\treturn {\n\t\t\t['get' + entity.name]: this.getByUniqueQuery(entity),\n\t\t\t['list' + entity.name]: this.getListQuery(entity),\n\t\t\t['paginate' + entity.name]: this.getPaginationQuery(entity),\n\t\t}\n\t}\n\n\tprivate getByUniqueQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.UniqueQueryInput> {\n\t\tconst entityName = entity.name\n\t\tconst entityType = this.entityTypeProvider.getEntity(entityName)\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn {\n\t\t\ttype: entityType,\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.get, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolveGetQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate getListQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.ListQueryInput> {\n\t\tconst entityName = entity.name\n\n\t\tconst entityType = this.entityTypeProvider.getEntity(entityName)\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType))),\n\t\t\targs: {\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t\torderBy: {\n\t\t\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(entityName))),\n\t\t\t\t},\n\t\t\t\toffset: {\n\t\t\t\t\ttype: GraphQLInt,\n\t\t\t\t},\n\t\t\t\tlimit: {\n\t\t\t\t\ttype: GraphQLInt,\n\t\t\t\t},\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.list, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolveListQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate getPaginationQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.ListQueryInput> {\n\t\treturn {\n\t\t\t...this.paginatedFieldConfigFactory.createFieldConfig(entity),\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.paginate, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolvePaginationQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["Acl","ImplementationException","GraphQLNonNull","ExtensionKey","OperationMeta","Operation","GraphQLList","GraphQLInt"],"mappings":";;;;;;AAWO,MAAM,cAAc;AAAA,EAC1B,YACkB,cACA,mBACA,qBACA,oBACA,6BAChB;AALgB,SAAA,eAAA;AACA,SAAA,oBAAA;AACA,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A,MAC1E,SAAS,CAAC,QAAQ,MAAM,SAAS,SAAS;AACzC,eAAO,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM;AAC7D,cAAI,UAAU,KAAK,MAAM;AACxB,mBAAO,OAAO,KAAK,KAAK,GAAG;AAAA,UAC5B;AACA,iBAAO,QAAQ,mBAAmB,aAAa,uBAAuB,QAAQ,IAAI;AAAA,QACnF,CAAC;AAAA,MACF;AAAA,IAAA;AAAA,EAEF;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/QueryProvider.ts"],"sourcesContent":["import { GraphQLFieldConfig, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { Context } from '../types'\nimport { EntityTypeProvider } from './EntityTypeProvider'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { Authorizator } from '../acl'\nimport { OrderByTypeProvider } from './OrderByTypeProvider'\nimport { ExtensionKey, Operation, OperationMeta } from './OperationExtension'\nimport { ImplementationException } from '../exception'\nimport { PaginatedFieldConfigFactory } from './PaginatedFieldConfigFactory'\n\nexport class QueryProvider {\n\tconstructor(\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly paginatedFieldConfigFactory: PaginatedFieldConfigFactory,\n\t) {}\n\n\tpublic getQueries(entity: Model.Entity): { [fieldName: string]: GraphQLFieldConfig<any, Context, any> } {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entity.name) === 'no') {\n\t\t\treturn {}\n\t\t}\n\t\tif (this.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.read)) {\n\t\t\treturn {}\n\t\t}\n\t\treturn {\n\t\t\t['get' + entity.name]: this.getByUniqueQuery(entity),\n\t\t\t['list' + entity.name]: this.getListQuery(entity),\n\t\t\t['paginate' + entity.name]: this.getPaginationQuery(entity),\n\t\t}\n\t}\n\n\tprivate getByUniqueQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.UniqueQueryInput> {\n\t\tconst entityName = entity.name\n\t\tconst entityType = this.entityTypeProvider.getEntity(entityName)\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn {\n\t\t\ttype: entityType,\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.get, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolveGetQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate getListQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.ListQueryInput> {\n\t\tconst entityName = entity.name\n\n\t\tconst entityType = this.entityTypeProvider.getEntity(entityName)\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType))),\n\t\t\targs: {\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t\torderBy: {\n\t\t\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(entityName))),\n\t\t\t\t},\n\t\t\t\toffset: {\n\t\t\t\t\ttype: GraphQLInt,\n\t\t\t\t},\n\t\t\t\tlimit: {\n\t\t\t\t\ttype: GraphQLInt,\n\t\t\t\t},\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.list, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolveListQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate getPaginationQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.ListQueryInput> {\n\t\treturn {\n\t\t\t...this.paginatedFieldConfigFactory.createFieldConfig(entity),\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.paginate, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolvePaginationQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;AAWO,MAAM,cAAc;AAAA,EAC1B,YACkB,cACA,mBACA,qBACA,oBACA,6BAChB;AALgB,SAAA,eAAA;AACA,SAAA,oBAAA;AACA,SAAA,sBAAA;AACA,SAAA,qBAAA;AACA,SAAA,8BAAA;AAAA,EACf;AAAA,EAEI,WAAW,QAAsF;AACvG,QAAI,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,OAAO,IAAI,MAAM,MAAM;AACpF,aAAO,CAAA;AAAA,IACR;AACA,QAAI,KAAK,aAAa,0BAA0B,OAAO,MAAM,IAAI,UAAU,IAAI,GAAG;AACjF,aAAO,CAAA;AAAA,IACR;AACA,WAAO;AAAA,MACN,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AAmB,UAAU;AAAA,QAAA;AAAA,QAE3D,SAAS;AAAA,UACR,MAAM,IAAI,YAAY,IAAI,eAAe,KAAK,oBAAoB,qBAAqB,UAAU,CAAC,CAAC;AAAA,QAAA;AAAA,QAEpG,QAAQ;AAAA,UACP,MAAM;AAAA,QAAA;AAAA,QAEP,OAAO;AAAA,UACN,MAAM;AAAA,QAAA;AAAA,MACP;AAAA,MAED,YAAY,EAAE,CAAC,YAAY,GAAG,IAAI,cAAc,UAAU,MAAM,MAAM,EAAA;AAAA,MACtE,SAAS,CAAC,QAAQ,MAAM,SAAS,SAAS;AACzC,eAAO,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM;AAC7D,cAAI,UAAU,KAAK,MAAM;AACxB,mBAAO,OAAO,KAAK,KAAK,GAAG;AAAA,UAC5B;AACA,iBAAO,QAAQ,mBAAmB,aAAa,iBAAiB,QAAQ,IAAI;AAAA,QAC7E,CAAC;AAAA,MACF;AAAA,IAAA;AAAA,EAEF;AAAA,EAEQ,mBAAmB,QAA8E;AACxG,WAAO;AAAA,MACN,GAAG,KAAK,4BAA4B,kBAAkB,MAAM;AAAA,MAC5D,YAAY,EAAE,CAAC,YAAY,GAAG,IAAI,cAAc,UAAU,UAAU,MAAM,EAAA;AAAA,MAC1E,SAAS,CAAC,QAAQ,MAAM,SAAS,SAAS;AACzC,eAAO,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM;AAC7D,cAAI,UAAU,KAAK,MAAM;AACxB,mBAAO,OAAO,KAAK,KAAK,GAAG;AAAA,UAC5B;AACA,iBAAO,QAAQ,mBAAmB,aAAa,uBAAuB,QAAQ,IAAI;AAAA,QACnF,CAAC;AAAA,MACF;AAAA,IAAA;AAAA,EAEF;AACD;"}
|
|
1
|
+
{"version":3,"file":"QueryProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/QueryProvider.ts"],"sourcesContent":["import { GraphQLFieldConfig, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { Context } from '../types.js'\nimport { EntityTypeProvider } from './EntityTypeProvider.js'\nimport { WhereTypeProvider } from './WhereTypeProvider.js'\nimport { Authorizator } from '../acl/index.js'\nimport { OrderByTypeProvider } from './OrderByTypeProvider.js'\nimport { ExtensionKey, Operation, OperationMeta } from './OperationExtension.js'\nimport { ImplementationException } from '../exception.js'\nimport { PaginatedFieldConfigFactory } from './PaginatedFieldConfigFactory.js'\n\nexport class QueryProvider {\n\tconstructor(\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly paginatedFieldConfigFactory: PaginatedFieldConfigFactory,\n\t) {}\n\n\tpublic getQueries(entity: Model.Entity): { [fieldName: string]: GraphQLFieldConfig<any, Context, any> } {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entity.name) === 'no') {\n\t\t\treturn {}\n\t\t}\n\t\tif (this.authorizator.isRootOperationDisallowed(entity.name, Acl.Operation.read)) {\n\t\t\treturn {}\n\t\t}\n\t\treturn {\n\t\t\t['get' + entity.name]: this.getByUniqueQuery(entity),\n\t\t\t['list' + entity.name]: this.getListQuery(entity),\n\t\t\t['paginate' + entity.name]: this.getPaginationQuery(entity),\n\t\t}\n\t}\n\n\tprivate getByUniqueQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.UniqueQueryInput> {\n\t\tconst entityName = entity.name\n\t\tconst entityType = this.entityTypeProvider.getEntity(entityName)\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn {\n\t\t\ttype: entityType,\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.get, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolveGetQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate getListQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.ListQueryInput> {\n\t\tconst entityName = entity.name\n\n\t\tconst entityType = this.entityTypeProvider.getEntity(entityName)\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType))),\n\t\t\targs: {\n\t\t\t\tfilter: {\n\t\t\t\t\ttype: this.whereTypeProvider.getEntityWhereType(entityName),\n\t\t\t\t},\n\t\t\t\torderBy: {\n\t\t\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(entityName))),\n\t\t\t\t},\n\t\t\t\toffset: {\n\t\t\t\t\ttype: GraphQLInt,\n\t\t\t\t},\n\t\t\t\tlimit: {\n\t\t\t\t\ttype: GraphQLInt,\n\t\t\t\t},\n\t\t\t},\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.list, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolveListQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n\n\tprivate getPaginationQuery(entity: Model.Entity): GraphQLFieldConfig<any, Context, Input.ListQueryInput> {\n\t\treturn {\n\t\t\t...this.paginatedFieldConfigFactory.createFieldConfig(entity),\n\t\t\textensions: { [ExtensionKey]: new OperationMeta(Operation.paginate, entity) },\n\t\t\tresolve: (parent, args, context, info) => {\n\t\t\t\treturn context.timer(`GraphQL.query.${info.fieldName}`, () => {\n\t\t\t\t\tif (parent && info.path) {\n\t\t\t\t\t\treturn parent[info.path.key]\n\t\t\t\t\t}\n\t\t\t\t\treturn context.executionContainer.readResolver.resolvePaginationQuery(entity, info)\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;AAWO,MAAM,cAAc;AAAA,EAC1B,YACkB,cACA,mBACA,qBACA,oBACA,6BAChB;AALgB,SAAA,eAAA;AACA,SAAA,oBAAA;AACA,SAAA,sBAAA;AACA,SAAA,qBAAA;AACA,SAAA,8BAAA;AAAA,EACf;AAAA,EAEI,WAAW,QAAsF;AACvG,QAAI,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,OAAO,IAAI,MAAM,MAAM;AACpF,aAAO,CAAA;AAAA,IACR;AACA,QAAI,KAAK,aAAa,0BAA0B,OAAO,MAAM,IAAI,UAAU,IAAI,GAAG;AACjF,aAAO,CAAA;AAAA,IACR;AACA,WAAO;AAAA,MACN,CAAC,QAAQ,OAAO,IAAI,GAAG,KAAK,iBAAiB,MAAM;AAAA,MACnD,CAAC,SAAS,OAAO,IAAI,GAAG,KAAK,aAAa,MAAM;AAAA,MAChD,CAAC,aAAa,OAAO,IAAI,GAAG,KAAK,mBAAmB,MAAM;AAAA,IAAA;AAAA,EAE5D;AAAA,EAEQ,iBAAiB,QAAgF;AACxG,UAAM,aAAa,OAAO;AAC1B,UAAM,aAAa,KAAK,mBAAmB,UAAU,UAAU;AAC/D,UAAM,cAAc,KAAK,kBAAkB,yBAAyB,UAAU;AAC9E,QAAI,CAAC,aAAa;AACjB,YAAM,IAAI,wBAAA;AAAA,IACX;AACA,WAAO;AAAA,MACN,MAAM;AAAA,MAC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AU,KAAK,MAAM;AACxB,mBAAO,OAAO,KAAK,KAAK,GAAG;AAAA,UAC5B;AACA,iBAAO,QAAQ,mBAAmB,aAAa,iBAAiB,QAAQ,IAAI;AAAA,QAC7E,CAAC;AAAA,MACF;AAAA,IAAA;AAAA,EAEF;AAAA,EAEQ,mBAAmB,QAA8E;AACxG,WAAO;AAAA,MACN,GAAG,KAAK,4BAA4B,kBAAkB,MAAM;AAAA,MAC5D,YAAY,EAAE,CAAC,YAAY,GAAG,IAAI,cAAc,UAAU,UAAU,MAAM,EAAA;AAAA,MAC1E,SAAS,CAAC,QAAQ,MAAM,SAAS,SAAS;AACzC,eAAO,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM;AAC7D,cAAI,UAAU,KAAK,MAAM;AACxB,mBAAO,OAAO,KAAK,KAAK,GAAG;AAAA,UAC5B;AACA,iBAAO,QAAQ,mBAAmB,aAAa,uBAAuB,QAAQ,IAAI;AAAA,QACnF,CAAC;AAAA,MACF;AAAA,IAAA;AAAA,EAEF;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshViewMutationProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/RefreshViewMutationProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { GraphQLBoolean, GraphQLEnumType, GraphQLFieldConfig, GraphQLInputObjectType, GraphQLObjectType } from 'graphql'\nimport { Context } from '../types'\nimport { Authorizator } from '../acl'\n\nexport class RefreshViewMutationProvider {\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\tgetMutation(): GraphQLFieldConfig<any, Context, any> | undefined {\n\t\tconst materializedViews = Object.values(this.schema.entities)\n\t\t\t.filter(it => it.view?.materialized)\n\t\t\t.filter(it => this.authorizator.isRefreshMaterializedViewAllowed(it.name))\n\t\tif (materializedViews.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst materializedViewsEnum = new GraphQLEnumType({\n\t\t\tname: '_MaterializedView',\n\t\t\tvalues: Object.fromEntries(materializedViews.map(it => [it.name, { value: it.name }])),\n\t\t})\n\n\t\tconst refreshViewOptions = new GraphQLInputObjectType({\n\t\t\tname: 'RefreshMaterializedViewOptions',\n\t\t\tfields: {\n\t\t\t\tconcurrently: { type: GraphQLBoolean },\n\t\t\t},\n\t\t})\n\t\treturn {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: 'RefreshMaterializedViewResponse',\n\t\t\t\tfields: {\n\t\t\t\t\tok: { type: GraphQLBoolean },\n\t\t\t\t},\n\t\t\t}),\n\t\t\targs: {\n\t\t\t\tname: { type: materializedViewsEnum },\n\t\t\t\toptions: { type: refreshViewOptions },\n\t\t\t},\n\t\t\tresolve: async (parent, args, context) => {\n\t\t\t\treturn await context.executionContainer.refreshViewResolver.resolve(args.name, args.options)\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["GraphQLEnumType","GraphQLInputObjectType","GraphQLBoolean","GraphQLObjectType"],"mappings":";;;AAKO,MAAM,4BAA4B;AAAA,EACxC,YACkB,QACA,cAChB;AAFgB,SAAA,SAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EACA,cAAiE;AAChE,UAAM,oBAAoB,OAAO,OAAO,KAAK,OAAO,QAAQ,EAC1D,OAAO,CAAA,OAAM,GAAG,MAAM,YAAY,EAClC,OAAO,CAAA,OAAM,KAAK,aAAa,iCAAiC,GAAG,IAAI,CAAC;AAC1E,QAAI,kBAAkB,WAAW,GAAG;AACnC,aAAO;AAAA,IACR;AAEA,UAAM,wBAAwB,IAAIA,wBAAgB;AAAA,MACjD,MAAM;AAAA,MACN,QAAQ,OAAO,YAAY,kBAAkB,IAAI,CAAA,OAAM,CAAC,GAAG,MAAM,EAAE,OAAO,GAAG,KAAA,CAAM,CAAC,CAAC;AAAA,IAAA,CACrF;AAED,UAAM,qBAAqB,IAAIC,+BAAuB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,cAAc,EAAE,MAAMC,QAAAA,eAAA;AAAA,MAAe;AAAA,IACtC,CACA;AACD,WAAO;AAAA,MACN,MAAM,IAAIC,QAAAA,kBAAkB;AAAA,QAC3B,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,IAAI,EAAE,MAAMD,QAAAA,eAAA;AAAA,QAAe;AAAA,MAC5B,CACA;AAAA,MACD,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,sBAAA;AAAA,QACd,SAAS,EAAE,MAAM,mBAAA;AAAA,MAAmB;AAAA,MAErC,SAAS,OAAO,QAAQ,MAAM,YAAY;AACzC,eAAO,MAAM,QAAQ,mBAAmB,oBAAoB,QAAQ,KAAK,MAAM,KAAK,OAAO;AAAA,MAC5F;AAAA,IAAA;AAAA,EAEF;AACD;;"}
|
|
1
|
+
{"version":3,"file":"RefreshViewMutationProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/RefreshViewMutationProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { GraphQLBoolean, GraphQLEnumType, GraphQLFieldConfig, GraphQLInputObjectType, GraphQLObjectType } from 'graphql'\nimport { Context } from '../types.js'\nimport { Authorizator } from '../acl/index.js'\n\nexport class RefreshViewMutationProvider {\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\tgetMutation(): GraphQLFieldConfig<any, Context, any> | undefined {\n\t\tconst materializedViews = Object.values(this.schema.entities)\n\t\t\t.filter(it => it.view?.materialized)\n\t\t\t.filter(it => this.authorizator.isRefreshMaterializedViewAllowed(it.name))\n\t\tif (materializedViews.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst materializedViewsEnum = new GraphQLEnumType({\n\t\t\tname: '_MaterializedView',\n\t\t\tvalues: Object.fromEntries(materializedViews.map(it => [it.name, { value: it.name }])),\n\t\t})\n\n\t\tconst refreshViewOptions = new GraphQLInputObjectType({\n\t\t\tname: 'RefreshMaterializedViewOptions',\n\t\t\tfields: {\n\t\t\t\tconcurrently: { type: GraphQLBoolean },\n\t\t\t},\n\t\t})\n\t\treturn {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: 'RefreshMaterializedViewResponse',\n\t\t\t\tfields: {\n\t\t\t\t\tok: { type: GraphQLBoolean },\n\t\t\t\t},\n\t\t\t}),\n\t\t\targs: {\n\t\t\t\tname: { type: materializedViewsEnum },\n\t\t\t\toptions: { type: refreshViewOptions },\n\t\t\t},\n\t\t\tresolve: async (parent, args, context) => {\n\t\t\t\treturn await context.executionContainer.refreshViewResolver.resolve(args.name, args.options)\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["GraphQLEnumType","GraphQLInputObjectType","GraphQLBoolean","GraphQLObjectType"],"mappings":";;;AAKO,MAAM,4BAA4B;AAAA,EACxC,YACkB,QACA,cAChB;AAFgB,SAAA,SAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EACA,cAAiE;AAChE,UAAM,oBAAoB,OAAO,OAAO,KAAK,OAAO,QAAQ,EAC1D,OAAO,CAAA,OAAM,GAAG,MAAM,YAAY,EAClC,OAAO,CAAA,OAAM,KAAK,aAAa,iCAAiC,GAAG,IAAI,CAAC;AAC1E,QAAI,kBAAkB,WAAW,GAAG;AACnC,aAAO;AAAA,IACR;AAEA,UAAM,wBAAwB,IAAIA,wBAAgB;AAAA,MACjD,MAAM;AAAA,MACN,QAAQ,OAAO,YAAY,kBAAkB,IAAI,CAAA,OAAM,CAAC,GAAG,MAAM,EAAE,OAAO,GAAG,KAAA,CAAM,CAAC,CAAC;AAAA,IAAA,CACrF;AAED,UAAM,qBAAqB,IAAIC,+BAAuB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,cAAc,EAAE,MAAMC,QAAAA,eAAA;AAAA,MAAe;AAAA,IACtC,CACA;AACD,WAAO;AAAA,MACN,MAAM,IAAIC,QAAAA,kBAAkB;AAAA,QAC3B,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,IAAI,EAAE,MAAMD,QAAAA,eAAA;AAAA,QAAe;AAAA,MAC5B,CACA;AAAA,MACD,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,sBAAA;AAAA,QACd,SAAS,EAAE,MAAM,mBAAA;AAAA,MAAmB;AAAA,MAErC,SAAS,OAAO,QAAQ,MAAM,YAAY;AACzC,eAAO,MAAM,QAAQ,mBAAmB,oBAAoB,QAAQ,KAAK,MAAM,KAAK,OAAO;AAAA,MAC5F;AAAA,IAAA;AAAA,EAEF;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshViewMutationProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/RefreshViewMutationProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { GraphQLBoolean, GraphQLEnumType, GraphQLFieldConfig, GraphQLInputObjectType, GraphQLObjectType } from 'graphql'\nimport { Context } from '../types'\nimport { Authorizator } from '../acl'\n\nexport class RefreshViewMutationProvider {\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\tgetMutation(): GraphQLFieldConfig<any, Context, any> | undefined {\n\t\tconst materializedViews = Object.values(this.schema.entities)\n\t\t\t.filter(it => it.view?.materialized)\n\t\t\t.filter(it => this.authorizator.isRefreshMaterializedViewAllowed(it.name))\n\t\tif (materializedViews.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst materializedViewsEnum = new GraphQLEnumType({\n\t\t\tname: '_MaterializedView',\n\t\t\tvalues: Object.fromEntries(materializedViews.map(it => [it.name, { value: it.name }])),\n\t\t})\n\n\t\tconst refreshViewOptions = new GraphQLInputObjectType({\n\t\t\tname: 'RefreshMaterializedViewOptions',\n\t\t\tfields: {\n\t\t\t\tconcurrently: { type: GraphQLBoolean },\n\t\t\t},\n\t\t})\n\t\treturn {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: 'RefreshMaterializedViewResponse',\n\t\t\t\tfields: {\n\t\t\t\t\tok: { type: GraphQLBoolean },\n\t\t\t\t},\n\t\t\t}),\n\t\t\targs: {\n\t\t\t\tname: { type: materializedViewsEnum },\n\t\t\t\toptions: { type: refreshViewOptions },\n\t\t\t},\n\t\t\tresolve: async (parent, args, context) => {\n\t\t\t\treturn await context.executionContainer.refreshViewResolver.resolve(args.name, args.options)\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAKO,MAAM,4BAA4B;AAAA,EACxC,YACkB,QACA,cAChB;AAFgB,SAAA,SAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EACA,cAAiE;AAChE,UAAM,oBAAoB,OAAO,OAAO,KAAK,OAAO,QAAQ,EAC1D,OAAO,CAAA,OAAM,GAAG,MAAM,YAAY,EAClC,OAAO,CAAA,OAAM,KAAK,aAAa,iCAAiC,GAAG,IAAI,CAAC;AAC1E,QAAI,kBAAkB,WAAW,GAAG;AACnC,aAAO;AAAA,IACR;AAEA,UAAM,wBAAwB,IAAI,gBAAgB;AAAA,MACjD,MAAM;AAAA,MACN,QAAQ,OAAO,YAAY,kBAAkB,IAAI,CAAA,OAAM,CAAC,GAAG,MAAM,EAAE,OAAO,GAAG,KAAA,CAAM,CAAC,CAAC;AAAA,IAAA,CACrF;AAED,UAAM,qBAAqB,IAAI,uBAAuB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,cAAc,EAAE,MAAM,eAAA;AAAA,MAAe;AAAA,IACtC,CACA;AACD,WAAO;AAAA,MACN,MAAM,IAAI,kBAAkB;AAAA,QAC3B,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,IAAI,EAAE,MAAM,eAAA;AAAA,QAAe;AAAA,MAC5B,CACA;AAAA,MACD,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,sBAAA;AAAA,QACd,SAAS,EAAE,MAAM,mBAAA;AAAA,MAAmB;AAAA,MAErC,SAAS,OAAO,QAAQ,MAAM,YAAY;AACzC,eAAO,MAAM,QAAQ,mBAAmB,oBAAoB,QAAQ,KAAK,MAAM,KAAK,OAAO;AAAA,MAC5F;AAAA,IAAA;AAAA,EAEF;AACD;"}
|
|
1
|
+
{"version":3,"file":"RefreshViewMutationProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/RefreshViewMutationProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { GraphQLBoolean, GraphQLEnumType, GraphQLFieldConfig, GraphQLInputObjectType, GraphQLObjectType } from 'graphql'\nimport { Context } from '../types.js'\nimport { Authorizator } from '../acl/index.js'\n\nexport class RefreshViewMutationProvider {\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\tgetMutation(): GraphQLFieldConfig<any, Context, any> | undefined {\n\t\tconst materializedViews = Object.values(this.schema.entities)\n\t\t\t.filter(it => it.view?.materialized)\n\t\t\t.filter(it => this.authorizator.isRefreshMaterializedViewAllowed(it.name))\n\t\tif (materializedViews.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst materializedViewsEnum = new GraphQLEnumType({\n\t\t\tname: '_MaterializedView',\n\t\t\tvalues: Object.fromEntries(materializedViews.map(it => [it.name, { value: it.name }])),\n\t\t})\n\n\t\tconst refreshViewOptions = new GraphQLInputObjectType({\n\t\t\tname: 'RefreshMaterializedViewOptions',\n\t\t\tfields: {\n\t\t\t\tconcurrently: { type: GraphQLBoolean },\n\t\t\t},\n\t\t})\n\t\treturn {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: 'RefreshMaterializedViewResponse',\n\t\t\t\tfields: {\n\t\t\t\t\tok: { type: GraphQLBoolean },\n\t\t\t\t},\n\t\t\t}),\n\t\t\targs: {\n\t\t\t\tname: { type: materializedViewsEnum },\n\t\t\t\toptions: { type: refreshViewOptions },\n\t\t\t},\n\t\t\tresolve: async (parent, args, context) => {\n\t\t\t\treturn await context.executionContainer.refreshViewResolver.resolve(args.name, args.options)\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAKO,MAAM,4BAA4B;AAAA,EACxC,YACkB,QACA,cAChB;AAFgB,SAAA,SAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EACA,cAAiE;AAChE,UAAM,oBAAoB,OAAO,OAAO,KAAK,OAAO,QAAQ,EAC1D,OAAO,CAAA,OAAM,GAAG,MAAM,YAAY,EAClC,OAAO,CAAA,OAAM,KAAK,aAAa,iCAAiC,GAAG,IAAI,CAAC;AAC1E,QAAI,kBAAkB,WAAW,GAAG;AACnC,aAAO;AAAA,IACR;AAEA,UAAM,wBAAwB,IAAI,gBAAgB;AAAA,MACjD,MAAM;AAAA,MACN,QAAQ,OAAO,YAAY,kBAAkB,IAAI,CAAA,OAAM,CAAC,GAAG,MAAM,EAAE,OAAO,GAAG,KAAA,CAAM,CAAC,CAAC;AAAA,IAAA,CACrF;AAED,UAAM,qBAAqB,IAAI,uBAAuB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,cAAc,EAAE,MAAM,eAAA;AAAA,MAAe;AAAA,IACtC,CACA;AACD,WAAO;AAAA,MACN,MAAM,IAAI,kBAAkB;AAAA,QAC3B,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,IAAI,EAAE,MAAM,eAAA;AAAA,QAAe;AAAA,MAC5B,CACA;AAAA,MACD,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,sBAAA;AAAA,QACd,SAAS,EAAE,MAAM,mBAAA;AAAA,MAAmB;AAAA,MAErC,SAAS,OAAO,QAAQ,MAAM,YAAY;AACzC,eAAO,MAAM,QAAQ,mBAAmB,oBAAoB,QAAQ,KAAK,MAAM,KAAK,OAAO;AAAA,MAC5F;AAAA,IAAA;AAAA,EAEF;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationQueriesProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/ValidationQueriesProvider.ts"],"sourcesContent":["import { GraphQLFieldConfig, GraphQLNonNull } from 'graphql'\nimport { Context } from '../types'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { EntityInputProvider, EntityInputType } from './mutations'\nimport { Input, Model } from '@contember/schema'\nimport { filterObject } from '../utils'\nimport { ResultSchemaTypeProvider } from './ResultSchemaTypeProvider'\n\ntype FieldConfig<TArgs> = GraphQLFieldConfig<Context, any, TArgs>\n\nexport class ValidationQueriesProvider {\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityInputProvider: EntityInputProvider<EntityInputType.update>,\n\t\tprivate readonly resultSchemaTypeProvider: ResultSchemaTypeProvider,\n\t) {}\n\n\tpublic getQueries(entity: Model.Entity): { [fieldName: string]: FieldConfig<any> } {\n\t\tconst entityName = entity.name\n\t\tconst validations: { [fieldName: string]: FieldConfig<any> | undefined } = {}\n\t\tvalidations[`validateCreate${entityName}`] = this.getValidateCreateQuery(entity)\n\t\tvalidations[`validateUpdate${entityName}`] = this.getValidateUpdateQuery(entity)\n\n\t\treturn filterObject(validations, (key, value): value is FieldConfig<any> => value !== undefined)\n\t}\n\n\tprivate getValidateCreateQuery(entity: Model.Entity): FieldConfig<Input.CreateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.createEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateCreate(entity, args)),\n\t\t}\n\t}\n\n\tprivate getValidateUpdateQuery(entity: Model.Entity): FieldConfig<Input.UpdateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.updateEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateUpdate(entity, args)),\n\t\t}\n\t}\n}\n"],"names":["filterObject","GraphQLNonNull"],"mappings":";;;;;AAUO,MAAM,0BAA0B;AAAA,EACtC,YACkB,mBACA,2BACA,2BACA,0BAChB;AAJgB,SAAA,oBAAA;AACA,SAAA,4BAAA;AACA,SAAA,4BAAA;AACA,SAAA,2BAAA;AAAA,EACf;AAAA,EAEI,WAAW,QAAiE;AAClF,UAAM,aAAa,OAAO;AAC1B,UAAM,cAAqE,CAAA;AAC3E,gBAAY,iBAAiB,UAAU,EAAE,IAAI,KAAK,uBAAuB,MAAM;AAC/E,gBAAY,iBAAiB,UAAU,EAAE,IAAI,KAAK,uBAAuB,MAAM;AAE/E,WAAOA,OAAAA,aAAa,aAAa,CAAC,KAAK,UAAqC,UAAU,MAAS;AAAA,EAChG;AAAA,EAEQ,uBAAuB,QAAkE;AAChG,UAAM,aAAa,OAAO;AAC1B,UAAM,WAAW,KAAK,0BAA0B,SAAS,UAAU;AACnE,QAAI,aAAa,QAAW;AAC3B,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAIC,QAAAA,eAAe,KAAK,yBAAyB,oBAAoB;AAAA,MAC3E,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,IAAIA,QAAAA,eAAe,QAAQ,EAAA;AAAA,MAAE;AAAA,MAE5C,SAAS,CAAC,QAAQ,MAAM,SAAkB,SACzC,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI,CAAC;AAAA,IAAA;AAAA,EAEpI;AAAA,EAEQ,uBAAuB,QAAkE;AAChG,UAAM,aAAa,OAAO;AAC1B,UAAM,WAAW,KAAK,0BAA0B,SAAS,UAAU;AACnE,QAAI,aAAa,QAAW;AAC3B,aAAO;AAAA,IACR;AACA,UAAM,cAAc,KAAK,kBAAkB,yBAAyB,UAAU;AAC9E,QAAI,CAAC,aAAa;AACjB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAIA,QAAAA,eAAe,KAAK,yBAAyB,oBAAoB;AAAA,MAC3E,MAAM;AAAA,QACL,IAAI;AAAA,UACH,MAAM,IAAIA,QAAAA,eAAe,WAAW;AAAA,QAAA;AAAA,QAErC,MAAM,EAAE,MAAM,IAAIA,QAAAA,eAAe,QAAQ,EAAA;AAAA,MAAE;AAAA,MAE5C,SAAS,CAAC,QAAQ,MAAM,SAAkB,SACzC,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI,CAAC;AAAA,IAAA;AAAA,EAEpI;AACD;;"}
|
|
1
|
+
{"version":3,"file":"ValidationQueriesProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/ValidationQueriesProvider.ts"],"sourcesContent":["import { GraphQLFieldConfig, GraphQLNonNull } from 'graphql'\nimport { Context } from '../types.js'\nimport { WhereTypeProvider } from './WhereTypeProvider.js'\nimport { EntityInputProvider, EntityInputType } from './mutations/index.js'\nimport { Input, Model } from '@contember/schema'\nimport { filterObject } from '../utils/index.js'\nimport { ResultSchemaTypeProvider } from './ResultSchemaTypeProvider.js'\n\ntype FieldConfig<TArgs> = GraphQLFieldConfig<Context, any, TArgs>\n\nexport class ValidationQueriesProvider {\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityInputProvider: EntityInputProvider<EntityInputType.update>,\n\t\tprivate readonly resultSchemaTypeProvider: ResultSchemaTypeProvider,\n\t) {}\n\n\tpublic getQueries(entity: Model.Entity): { [fieldName: string]: FieldConfig<any> } {\n\t\tconst entityName = entity.name\n\t\tconst validations: { [fieldName: string]: FieldConfig<any> | undefined } = {}\n\t\tvalidations[`validateCreate${entityName}`] = this.getValidateCreateQuery(entity)\n\t\tvalidations[`validateUpdate${entityName}`] = this.getValidateUpdateQuery(entity)\n\n\t\treturn filterObject(validations, (key, value): value is FieldConfig<any> => value !== undefined)\n\t}\n\n\tprivate getValidateCreateQuery(entity: Model.Entity): FieldConfig<Input.CreateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.createEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateCreate(entity, args)),\n\t\t}\n\t}\n\n\tprivate getValidateUpdateQuery(entity: Model.Entity): FieldConfig<Input.UpdateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.updateEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateUpdate(entity, args)),\n\t\t}\n\t}\n}\n"],"names":["filterObject","GraphQLNonNull"],"mappings":";;;;;AAUO,MAAM,0BAA0B;AAAA,EACtC,YACkB,mBACA,2BACA,2BACA,0BAChB;AAJgB,SAAA,oBAAA;AACA,SAAA,4BAAA;AACA,SAAA,4BAAA;AACA,SAAA,2BAAA;AAAA,EACf;AAAA,EAEI,WAAW,QAAiE;AAClF,UAAM,aAAa,OAAO;AAC1B,UAAM,cAAqE,CAAA;AAC3E,gBAAY,iBAAiB,UAAU,EAAE,IAAI,KAAK,uBAAuB,MAAM;AAC/E,gBAAY,iBAAiB,UAAU,EAAE,IAAI,KAAK,uBAAuB,MAAM;AAE/E,WAAOA,OAAAA,aAAa,aAAa,CAAC,KAAK,UAAqC,UAAU,MAAS;AAAA,EAChG;AAAA,EAEQ,uBAAuB,QAAkE;AAChG,UAAM,aAAa,OAAO;AAC1B,UAAM,WAAW,KAAK,0BAA0B,SAAS,UAAU;AACnE,QAAI,aAAa,QAAW;AAC3B,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAIC,QAAAA,eAAe,KAAK,yBAAyB,oBAAoB;AAAA,MAC3E,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,IAAIA,QAAAA,eAAe,QAAQ,EAAA;AAAA,MAAE;AAAA,MAE5C,SAAS,CAAC,QAAQ,MAAM,SAAkB,SACzC,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI,CAAC;AAAA,IAAA;AAAA,EAEpI;AAAA,EAEQ,uBAAuB,QAAkE;AAChG,UAAM,aAAa,OAAO;AAC1B,UAAM,WAAW,KAAK,0BAA0B,SAAS,UAAU;AACnE,QAAI,aAAa,QAAW;AAC3B,aAAO;AAAA,IACR;AACA,UAAM,cAAc,KAAK,kBAAkB,yBAAyB,UAAU;AAC9E,QAAI,CAAC,aAAa;AACjB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAIA,QAAAA,eAAe,KAAK,yBAAyB,oBAAoB;AAAA,MAC3E,MAAM;AAAA,QACL,IAAI;AAAA,UACH,MAAM,IAAIA,QAAAA,eAAe,WAAW;AAAA,QAAA;AAAA,QAErC,MAAM,EAAE,MAAM,IAAIA,QAAAA,eAAe,QAAQ,EAAA;AAAA,MAAE;AAAA,MAE5C,SAAS,CAAC,QAAQ,MAAM,SAAkB,SACzC,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI,CAAC;AAAA,IAAA;AAAA,EAEpI;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationQueriesProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/ValidationQueriesProvider.ts"],"sourcesContent":["import { GraphQLFieldConfig, GraphQLNonNull } from 'graphql'\nimport { Context } from '../types'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { EntityInputProvider, EntityInputType } from './mutations'\nimport { Input, Model } from '@contember/schema'\nimport { filterObject } from '../utils'\nimport { ResultSchemaTypeProvider } from './ResultSchemaTypeProvider'\n\ntype FieldConfig<TArgs> = GraphQLFieldConfig<Context, any, TArgs>\n\nexport class ValidationQueriesProvider {\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityInputProvider: EntityInputProvider<EntityInputType.update>,\n\t\tprivate readonly resultSchemaTypeProvider: ResultSchemaTypeProvider,\n\t) {}\n\n\tpublic getQueries(entity: Model.Entity): { [fieldName: string]: FieldConfig<any> } {\n\t\tconst entityName = entity.name\n\t\tconst validations: { [fieldName: string]: FieldConfig<any> | undefined } = {}\n\t\tvalidations[`validateCreate${entityName}`] = this.getValidateCreateQuery(entity)\n\t\tvalidations[`validateUpdate${entityName}`] = this.getValidateUpdateQuery(entity)\n\n\t\treturn filterObject(validations, (key, value): value is FieldConfig<any> => value !== undefined)\n\t}\n\n\tprivate getValidateCreateQuery(entity: Model.Entity): FieldConfig<Input.CreateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.createEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateCreate(entity, args)),\n\t\t}\n\t}\n\n\tprivate getValidateUpdateQuery(entity: Model.Entity): FieldConfig<Input.UpdateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.updateEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateUpdate(entity, args)),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAUO,MAAM,0BAA0B;AAAA,EACtC,YACkB,mBACA,2BACA,2BACA,0BAChB;AAJgB,SAAA,oBAAA;AACA,SAAA,4BAAA;AACA,SAAA,4BAAA;AACA,SAAA,2BAAA;AAAA,EACf;AAAA,EAEI,WAAW,QAAiE;AAClF,UAAM,aAAa,OAAO;AAC1B,UAAM,cAAqE,CAAA;AAC3E,gBAAY,iBAAiB,UAAU,EAAE,IAAI,KAAK,uBAAuB,MAAM;AAC/E,gBAAY,iBAAiB,UAAU,EAAE,IAAI,KAAK,uBAAuB,MAAM;AAE/E,WAAO,aAAa,aAAa,CAAC,KAAK,UAAqC,UAAU,MAAS;AAAA,EAChG;AAAA,EAEQ,uBAAuB,QAAkE;AAChG,UAAM,aAAa,OAAO;AAC1B,UAAM,WAAW,KAAK,0BAA0B,SAAS,UAAU;AACnE,QAAI,aAAa,QAAW;AAC3B,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAI,eAAe,KAAK,yBAAyB,oBAAoB;AAAA,MAC3E,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,IAAI,eAAe,QAAQ,EAAA;AAAA,MAAE;AAAA,MAE5C,SAAS,CAAC,QAAQ,MAAM,SAAkB,SACzC,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI,CAAC;AAAA,IAAA;AAAA,EAEpI;AAAA,EAEQ,uBAAuB,QAAkE;AAChG,UAAM,aAAa,OAAO;AAC1B,UAAM,WAAW,KAAK,0BAA0B,SAAS,UAAU;AACnE,QAAI,aAAa,QAAW;AAC3B,aAAO;AAAA,IACR;AACA,UAAM,cAAc,KAAK,kBAAkB,yBAAyB,UAAU;AAC9E,QAAI,CAAC,aAAa;AACjB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAI,eAAe,KAAK,yBAAyB,oBAAoB;AAAA,MAC3E,MAAM;AAAA,QACL,IAAI;AAAA,UACH,MAAM,IAAI,eAAe,WAAW;AAAA,QAAA;AAAA,QAErC,MAAM,EAAE,MAAM,IAAI,eAAe,QAAQ,EAAA;AAAA,MAAE;AAAA,MAE5C,SAAS,CAAC,QAAQ,MAAM,SAAkB,SACzC,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI,CAAC;AAAA,IAAA;AAAA,EAEpI;AACD;"}
|
|
1
|
+
{"version":3,"file":"ValidationQueriesProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/ValidationQueriesProvider.ts"],"sourcesContent":["import { GraphQLFieldConfig, GraphQLNonNull } from 'graphql'\nimport { Context } from '../types.js'\nimport { WhereTypeProvider } from './WhereTypeProvider.js'\nimport { EntityInputProvider, EntityInputType } from './mutations/index.js'\nimport { Input, Model } from '@contember/schema'\nimport { filterObject } from '../utils/index.js'\nimport { ResultSchemaTypeProvider } from './ResultSchemaTypeProvider.js'\n\ntype FieldConfig<TArgs> = GraphQLFieldConfig<Context, any, TArgs>\n\nexport class ValidationQueriesProvider {\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityInputProvider: EntityInputProvider<EntityInputType.update>,\n\t\tprivate readonly resultSchemaTypeProvider: ResultSchemaTypeProvider,\n\t) {}\n\n\tpublic getQueries(entity: Model.Entity): { [fieldName: string]: FieldConfig<any> } {\n\t\tconst entityName = entity.name\n\t\tconst validations: { [fieldName: string]: FieldConfig<any> | undefined } = {}\n\t\tvalidations[`validateCreate${entityName}`] = this.getValidateCreateQuery(entity)\n\t\tvalidations[`validateUpdate${entityName}`] = this.getValidateUpdateQuery(entity)\n\n\t\treturn filterObject(validations, (key, value): value is FieldConfig<any> => value !== undefined)\n\t}\n\n\tprivate getValidateCreateQuery(entity: Model.Entity): FieldConfig<Input.CreateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.createEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateCreate(entity, args)),\n\t\t}\n\t}\n\n\tprivate getValidateUpdateQuery(entity: Model.Entity): FieldConfig<Input.UpdateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.updateEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateUpdate(entity, args)),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAUO,MAAM,0BAA0B;AAAA,EACtC,YACkB,mBACA,2BACA,2BACA,0BAChB;AAJgB,SAAA,oBAAA;AACA,SAAA,4BAAA;AACA,SAAA,4BAAA;AACA,SAAA,2BAAA;AAAA,EAC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kB,SACzC,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI,CAAC;AAAA,IAAA;AAAA,EAEpI;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WhereTypeProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/WhereTypeProvider.ts"],"sourcesContent":["import { Acl, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getEntity } from '@contember/schema-utils'\nimport { GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLList } from 'graphql'\nimport { capitalizeFirstLetter, getFieldsForUniqueWhere, singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { ConditionTypeProvider } from './ConditionTypeProvider'\nimport { GqlTypeName } from './utils'\nimport { Authorizator } from '../acl'\nimport { FieldAccessVisitor } from './FieldAccessVisitor'\nimport { ImplementationException } from '../exception'\n\nexport class WhereTypeProvider {\n\tprivate whereSingleton = singletonFactory(name => this.createEntityWhereType(name))\n\tprivate uniqueWhereSingleton = singletonFactory(name => this.createEntityUniqueWhereType(name))\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 conditionTypeProvider: ConditionTypeProvider,\n\t) {}\n\n\tpublic getEntityWhereType(entityName: string): GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.whereSingleton(entityName)\n\t}\n\n\tpublic getEntityUniqueWhereType(entityName: string): undefined | GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.uniqueWhereSingleton(entityName)\n\t}\n\n\tprivate createEntityWhereType(entityName: string) {\n\t\tconst where: GraphQLInputObjectType = new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}Where`,\n\t\t\tfields: () => this.getEntityWhereFields(entityName, where),\n\t\t})\n\n\t\treturn where\n\t}\n\n\tprivate createEntityUniqueWhereType(entityName: string, withoutRelation?: string) {\n\t\tconst entity = getEntity(this.schema, entityName)\n\n\t\tconst combinations: string[] = []\n\n\t\tconst possibleUniqueWhereFields = getFieldsForUniqueWhere(this.schema, entity)\n\t\tconst uniqueKeys: (readonly string[])[] = possibleUniqueWhereFields.filter(uniqueKey =>\n\t\t\tuniqueKey.every(it => acceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator)))\n\t\t)\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tcombinations.push(uniqueKey.join(', '))\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: capitalizeFirstLetter(entityName) + 'UniqueWhere',\n\t\t\t// description: `Valid combinations are: (${combinations.join('), (')})`, generates invalid schema file\n\t\t\tfields: () => this.getUniqueWhereFields(entity, uniqueKeys),\n\t\t})\n\t}\n\n\tpublic getUniqueWhereFields(entity: Model.Entity, uniqueKeys: (readonly string[])[]) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tfor (const field of uniqueKey) {\n\t\t\t\tif (fields[field] !== undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfields[field] = acceptFieldVisitor<GraphQLInputFieldConfig>(this.schema, entity, field, {\n\t\t\t\t\tvisitRelation: ({ targetEntity }) => {\n\t\t\t\t\t\t// if (!isIt<Model.JoiningColumnRelation>(relation, 'joiningColumn')) {\n\t\t\t\t\t\t// \tthrow new Error('Only column or owning relation can be a part of unique key')\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tconst uniqueWhere = this.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\t\t\tif (!uniqueWhere) {\n\t\t\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn { type: uniqueWhere }\n\t\t\t\t\t},\n\t\t\t\t\tvisitColumn: ({ column }) => ({ type: this.columnTypeResolver.getType(column)[0] }),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate getEntityWhereFields(name: string, where: GraphQLInputObjectType) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfields[fieldName] = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => ({ type: this.conditionTypeProvider.getCondition(column) }),\n\t\t\t\tvisitRelation: ({ relation }) => ({ type: this.getEntityWhereType(relation.target) }),\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig>)\n\t\t}\n\n\t\tfields.and = { type: new GraphQLList(where) }\n\t\tfields.or = { type: new GraphQLList(where) }\n\t\tfields.not = { type: where }\n\n\t\treturn fields\n\t}\n}\n"],"names":["schema","singletonFactory","Acl","ImplementationException","GraphQLInputObjectType","GqlTypeName","getEntity","getFieldsForUniqueWhere","acceptFieldVisitor","FieldAccessVisitor","capitalizeFirstLetter","GraphQLList"],"mappings":";;;;;;;;;;;;;;AAWO,MAAM,kBAAkB;AAAA,EAI9B,YACkBA,SACA,cACA,oBACA,uBAChB;AAJgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,wBAAA;AAPlB,kBAAA,MAAQ,kBAAiBC,kCAAiB,CAAA,SAAQ,KAAK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AmB,SAAS,MAAM,EAAA;AAAA,MAAE,CACpC;AAAA,IACjD;AAEA,WAAO,MAAM,EAAE,MAAM,IAAIG,QAAAA,YAAY,KAAK,EAAA;AAC1C,WAAO,KAAK,EAAE,MAAM,IAAIA,QAAAA,YAAY,KAAK,EAAA;AACzC,WAAO,MAAM,EAAE,MAAM,MAAA;AAErB,WAAO;AAAA,EACR;AACD;;"}
|
|
1
|
+
{"version":3,"file":"WhereTypeProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/WhereTypeProvider.ts"],"sourcesContent":["import { Acl, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getEntity } from '@contember/schema-utils'\nimport { GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLList } from 'graphql'\nimport { capitalizeFirstLetter, getFieldsForUniqueWhere, singletonFactory } from '../utils/index.js'\nimport { ColumnTypeResolver } from './ColumnTypeResolver.js'\nimport { ConditionTypeProvider } from './ConditionTypeProvider.js'\nimport { GqlTypeName } from './utils.js'\nimport { Authorizator } from '../acl/index.js'\nimport { FieldAccessVisitor } from './FieldAccessVisitor.js'\nimport { ImplementationException } from '../exception.js'\n\nexport class WhereTypeProvider {\n\tprivate whereSingleton = singletonFactory(name => this.createEntityWhereType(name))\n\tprivate uniqueWhereSingleton = singletonFactory(name => this.createEntityUniqueWhereType(name))\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 conditionTypeProvider: ConditionTypeProvider,\n\t) {}\n\n\tpublic getEntityWhereType(entityName: string): GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.whereSingleton(entityName)\n\t}\n\n\tpublic getEntityUniqueWhereType(entityName: string): undefined | GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.uniqueWhereSingleton(entityName)\n\t}\n\n\tprivate createEntityWhereType(entityName: string) {\n\t\tconst where: GraphQLInputObjectType = new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}Where`,\n\t\t\tfields: () => this.getEntityWhereFields(entityName, where),\n\t\t})\n\n\t\treturn where\n\t}\n\n\tprivate createEntityUniqueWhereType(entityName: string, withoutRelation?: string) {\n\t\tconst entity = getEntity(this.schema, entityName)\n\n\t\tconst combinations: string[] = []\n\n\t\tconst possibleUniqueWhereFields = getFieldsForUniqueWhere(this.schema, entity)\n\t\tconst uniqueKeys: (readonly string[])[] = possibleUniqueWhereFields.filter(uniqueKey =>\n\t\t\tuniqueKey.every(it => acceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator)))\n\t\t)\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tcombinations.push(uniqueKey.join(', '))\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: capitalizeFirstLetter(entityName) + 'UniqueWhere',\n\t\t\t// description: `Valid combinations are: (${combinations.join('), (')})`, generates invalid schema file\n\t\t\tfields: () => this.getUniqueWhereFields(entity, uniqueKeys),\n\t\t})\n\t}\n\n\tpublic getUniqueWhereFields(entity: Model.Entity, uniqueKeys: (readonly string[])[]) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tfor (const field of uniqueKey) {\n\t\t\t\tif (fields[field] !== undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfields[field] = acceptFieldVisitor<GraphQLInputFieldConfig>(this.schema, entity, field, {\n\t\t\t\t\tvisitRelation: ({ targetEntity }) => {\n\t\t\t\t\t\t// if (!isIt<Model.JoiningColumnRelation>(relation, 'joiningColumn')) {\n\t\t\t\t\t\t// \tthrow new Error('Only column or owning relation can be a part of unique key')\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tconst uniqueWhere = this.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\t\t\tif (!uniqueWhere) {\n\t\t\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn { type: uniqueWhere }\n\t\t\t\t\t},\n\t\t\t\t\tvisitColumn: ({ column }) => ({ type: this.columnTypeResolver.getType(column)[0] }),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate getEntityWhereFields(name: string, where: GraphQLInputObjectType) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfields[fieldName] = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => ({ type: this.conditionTypeProvider.getCondition(column) }),\n\t\t\t\tvisitRelation: ({ relation }) => ({ type: this.getEntityWhereType(relation.target) }),\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig>)\n\t\t}\n\n\t\tfields.and = { type: new GraphQLList(where) }\n\t\tfields.or = { type: new GraphQLList(where) }\n\t\tfields.not = { type: where }\n\n\t\treturn fields\n\t}\n}\n"],"names":["schema","singletonFactory","Acl","ImplementationException","GraphQLInputObjectType","GqlTypeName","getEntity","getFieldsForUniqueWhere","acceptFieldVisitor","FieldAccessVisitor","capitalizeFirstLetter","GraphQLList"],"mappings":";;;;;;;;;;;;;;AAWO,MAAM,kBAAkB;AAAA,EAI9B,YACkBA,SACA,cACA,oBACA,uBAChB;AAJgB,SAAA,SAAAA;A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OAAA,OAAc,EAAE,MAAM,KAAK,sBAAsB,aAAa,MAAM;QACpF,eAAe,CAAC,EAAE,SAAA,OAAgB,EAAE,MAAM,KAAK,mBAAmB,SAAS,MAAM,EAAA;AAAA,MAAE,CACpC;AAAA,IACjD;AAEA,WAAO,MAAM,EAAE,MAAM,IAAIG,QAAAA,YAAY,KAAK,EAAA;AAC1C,WAAO,KAAK,EAAE,MAAM,IAAIA,QAAAA,YAAY,KAAK,EAAA;AACzC,WAAO,MAAM,EAAE,MAAM,MAAA;AAErB,WAAO;AAAA,EACR;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WhereTypeProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/WhereTypeProvider.ts"],"sourcesContent":["import { Acl, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getEntity } from '@contember/schema-utils'\nimport { GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLList } from 'graphql'\nimport { capitalizeFirstLetter, getFieldsForUniqueWhere, singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { ConditionTypeProvider } from './ConditionTypeProvider'\nimport { GqlTypeName } from './utils'\nimport { Authorizator } from '../acl'\nimport { FieldAccessVisitor } from './FieldAccessVisitor'\nimport { ImplementationException } from '../exception'\n\nexport class WhereTypeProvider {\n\tprivate whereSingleton = singletonFactory(name => this.createEntityWhereType(name))\n\tprivate uniqueWhereSingleton = singletonFactory(name => this.createEntityUniqueWhereType(name))\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 conditionTypeProvider: ConditionTypeProvider,\n\t) {}\n\n\tpublic getEntityWhereType(entityName: string): GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.whereSingleton(entityName)\n\t}\n\n\tpublic getEntityUniqueWhereType(entityName: string): undefined | GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.uniqueWhereSingleton(entityName)\n\t}\n\n\tprivate createEntityWhereType(entityName: string) {\n\t\tconst where: GraphQLInputObjectType = new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}Where`,\n\t\t\tfields: () => this.getEntityWhereFields(entityName, where),\n\t\t})\n\n\t\treturn where\n\t}\n\n\tprivate createEntityUniqueWhereType(entityName: string, withoutRelation?: string) {\n\t\tconst entity = getEntity(this.schema, entityName)\n\n\t\tconst combinations: string[] = []\n\n\t\tconst possibleUniqueWhereFields = getFieldsForUniqueWhere(this.schema, entity)\n\t\tconst uniqueKeys: (readonly string[])[] = possibleUniqueWhereFields.filter(uniqueKey =>\n\t\t\tuniqueKey.every(it => acceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator)))\n\t\t)\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tcombinations.push(uniqueKey.join(', '))\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: capitalizeFirstLetter(entityName) + 'UniqueWhere',\n\t\t\t// description: `Valid combinations are: (${combinations.join('), (')})`, generates invalid schema file\n\t\t\tfields: () => this.getUniqueWhereFields(entity, uniqueKeys),\n\t\t})\n\t}\n\n\tpublic getUniqueWhereFields(entity: Model.Entity, uniqueKeys: (readonly string[])[]) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tfor (const field of uniqueKey) {\n\t\t\t\tif (fields[field] !== undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfields[field] = acceptFieldVisitor<GraphQLInputFieldConfig>(this.schema, entity, field, {\n\t\t\t\t\tvisitRelation: ({ targetEntity }) => {\n\t\t\t\t\t\t// if (!isIt<Model.JoiningColumnRelation>(relation, 'joiningColumn')) {\n\t\t\t\t\t\t// \tthrow new Error('Only column or owning relation can be a part of unique key')\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tconst uniqueWhere = this.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\t\t\tif (!uniqueWhere) {\n\t\t\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn { type: uniqueWhere }\n\t\t\t\t\t},\n\t\t\t\t\tvisitColumn: ({ column }) => ({ type: this.columnTypeResolver.getType(column)[0] }),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate getEntityWhereFields(name: string, where: GraphQLInputObjectType) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfields[fieldName] = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => ({ type: this.conditionTypeProvider.getCondition(column) }),\n\t\t\t\tvisitRelation: ({ relation }) => ({ type: this.getEntityWhereType(relation.target) }),\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig>)\n\t\t}\n\n\t\tfields.and = { type: new GraphQLList(where) }\n\t\tfields.or = { type: new GraphQLList(where) }\n\t\tfields.not = { type: where }\n\n\t\treturn fields\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAWO,MAAM,kBAAkB;AAAA,EAI9B,YACkB,QACA,cACA,oBACA,uBAChB;AAJgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA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jD;AAEA,WAAO,MAAM,EAAE,MAAM,IAAI,YAAY,KAAK,EAAA;AAC1C,WAAO,KAAK,EAAE,MAAM,IAAI,YAAY,KAAK,EAAA;AACzC,WAAO,MAAM,EAAE,MAAM,MAAA;AAErB,WAAO;AAAA,EACR;AACD;"}
|
|
1
|
+
{"version":3,"file":"WhereTypeProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/WhereTypeProvider.ts"],"sourcesContent":["import { Acl, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getEntity } from '@contember/schema-utils'\nimport { GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLList } from 'graphql'\nimport { capitalizeFirstLetter, getFieldsForUniqueWhere, singletonFactory } from '../utils/index.js'\nimport { ColumnTypeResolver } from './ColumnTypeResolver.js'\nimport { ConditionTypeProvider } from './ConditionTypeProvider.js'\nimport { GqlTypeName } from './utils.js'\nimport { Authorizator } from '../acl/index.js'\nimport { FieldAccessVisitor } from './FieldAccessVisitor.js'\nimport { ImplementationException } from '../exception.js'\n\nexport class WhereTypeProvider {\n\tprivate whereSingleton = singletonFactory(name => this.createEntityWhereType(name))\n\tprivate uniqueWhereSingleton = singletonFactory(name => this.createEntityUniqueWhereType(name))\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 conditionTypeProvider: ConditionTypeProvider,\n\t) {}\n\n\tpublic getEntityWhereType(entityName: string): GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.whereSingleton(entityName)\n\t}\n\n\tpublic getEntityUniqueWhereType(entityName: string): undefined | GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.uniqueWhereSingleton(entityName)\n\t}\n\n\tprivate createEntityWhereType(entityName: string) {\n\t\tconst where: GraphQLInputObjectType = new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}Where`,\n\t\t\tfields: () => this.getEntityWhereFields(entityName, where),\n\t\t})\n\n\t\treturn where\n\t}\n\n\tprivate createEntityUniqueWhereType(entityName: string, withoutRelation?: string) {\n\t\tconst entity = getEntity(this.schema, entityName)\n\n\t\tconst combinations: string[] = []\n\n\t\tconst possibleUniqueWhereFields = getFieldsForUniqueWhere(this.schema, entity)\n\t\tconst uniqueKeys: (readonly string[])[] = possibleUniqueWhereFields.filter(uniqueKey =>\n\t\t\tuniqueKey.every(it => acceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator)))\n\t\t)\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tcombinations.push(uniqueKey.join(', '))\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: capitalizeFirstLetter(entityName) + 'UniqueWhere',\n\t\t\t// description: `Valid combinations are: (${combinations.join('), (')})`, generates invalid schema file\n\t\t\tfields: () => this.getUniqueWhereFields(entity, uniqueKeys),\n\t\t})\n\t}\n\n\tpublic getUniqueWhereFields(entity: Model.Entity, uniqueKeys: (readonly string[])[]) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tfor (const field of uniqueKey) {\n\t\t\t\tif (fields[field] !== undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfields[field] = acceptFieldVisitor<GraphQLInputFieldConfig>(this.schema, entity, field, {\n\t\t\t\t\tvisitRelation: ({ targetEntity }) => {\n\t\t\t\t\t\t// if (!isIt<Model.JoiningColumnRelation>(relation, 'joiningColumn')) {\n\t\t\t\t\t\t// \tthrow new Error('Only column or owning relation can be a part of unique key')\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tconst uniqueWhere = this.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\t\t\tif (!uniqueWhere) {\n\t\t\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn { type: uniqueWhere }\n\t\t\t\t\t},\n\t\t\t\t\tvisitColumn: ({ column }) => ({ type: this.columnTypeResolver.getType(column)[0] }),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate getEntityWhereFields(name: string, where: GraphQLInputObjectType) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfields[fieldName] = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => ({ type: this.conditionTypeProvider.getCondition(column) }),\n\t\t\t\tvisitRelation: ({ relation }) => ({ type: this.getEntityWhereType(relation.target) }),\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig>)\n\t\t}\n\n\t\tfields.and = { type: new GraphQLList(where) }\n\t\tfields.or = { type: new GraphQLList(where) }\n\t\tfields.not = { type: where }\n\n\t\treturn fields\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAWO,MAAM,kBAAkB;AAAA,EAI9B,YACkB,QACA,cACA,oBACA,uBAChB;AAJgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,wBAAA;AAPlB,kBAAA,MAAQ,kBAAiB,iBAAiB,CAAA,SAAQ,KAAK,sBAAsB,IAAI,CAAC,CAAA;AAClF,kBAAA,MAAQ,wBAAuB,iBAAiB,CAAA,SAAQ,KAAK,4BA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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldArgsVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldArgsVisitor.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { GraphQLFieldConfigArgumentMap, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { OrderByTypeProvider } from '../OrderByTypeProvider'\n\nexport class FieldArgsVisitor\n\timplements\n\t\tModel.ColumnVisitor<GraphQLFieldConfigArgumentMap | undefined>,\n\t\tModel.RelationByGenericTypeVisitor<GraphQLFieldConfigArgumentMap | undefined>\n{\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t) {\n\t\tthis.whereTypeProvider = whereTypeProvider\n\t}\n\n\tpublic visitColumn() {\n\t\treturn undefined\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\tconst orderBy = this.getOrderByArgs(relation)\n\t\treturn {\n\t\t\tfilter,\n\t\t\torderBy,\n\t\t\toffset: { type: GraphQLInt },\n\t\t\tlimit: { type: GraphQLInt },\n\t\t}\n\t}\n\n\tpublic visitHasOne({ relation }: Model.ManyHasOneContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\treturn { filter }\n\t}\n\n\tprivate getWhereArg(relation: Model.Relation) {\n\t\treturn { type: this.whereTypeProvider.getEntityWhereType(relation.target) }\n\t}\n\n\tprivate getOrderByArgs(relation: Model.Relation) {\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(relation.target))),\n\t\t}\n\t}\n}\n"],"names":["GraphQLInt","GraphQLList","GraphQLNonNull"],"mappings":";;;AAKO,MAAM,iBAIb;AAAA,EACC,YACkB,mBACA,qBAChB;AAFgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AAEjB,SAAK,oBAAoB;AAAA,EAC1B;AAAA,EAEO,cAAc;AACpB,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAA6C;AAClE,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,UAAM,UAAU,KAAK,eAAe,QAAQ;AAC5C,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA,QAAQ,EAAE,MAAMA,mBAAA;AAAA,MAChB,OAAO,EAAE,MAAMA,QAAAA,WAAA;AAAA,IAAW;AAAA,EAE5B;AAAA,EAEO,YAAY,EAAE,YAAqC;AACzD,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,WAAO,EAAE,OAAA;AAAA,EACV;AAAA,EAEQ,YAAY,UAA0B;AAC7C,WAAO,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,SAAS,MAAM,EAAA;AAAA,EACzE;AAAA,EAEQ,eAAe,UAA0B;AAChD,WAAO;AAAA,MACN,MAAM,IAAIC,oBAAY,IAAIC,uBAAe,KAAK,oBAAoB,qBAAqB,SAAS,MAAM,CAAC,CAAC;AAAA,IAAA;AAAA,EAE1G;AACD;;"}
|
|
1
|
+
{"version":3,"file":"FieldArgsVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldArgsVisitor.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { WhereTypeProvider } from '../WhereTypeProvider.js'\nimport { GraphQLFieldConfigArgumentMap, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { OrderByTypeProvider } from '../OrderByTypeProvider.js'\n\nexport class FieldArgsVisitor\n\timplements\n\t\tModel.ColumnVisitor<GraphQLFieldConfigArgumentMap | undefined>,\n\t\tModel.RelationByGenericTypeVisitor<GraphQLFieldConfigArgumentMap | undefined>\n{\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t) {\n\t\tthis.whereTypeProvider = whereTypeProvider\n\t}\n\n\tpublic visitColumn() {\n\t\treturn undefined\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\tconst orderBy = this.getOrderByArgs(relation)\n\t\treturn {\n\t\t\tfilter,\n\t\t\torderBy,\n\t\t\toffset: { type: GraphQLInt },\n\t\t\tlimit: { type: GraphQLInt },\n\t\t}\n\t}\n\n\tpublic visitHasOne({ relation }: Model.ManyHasOneContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\treturn { filter }\n\t}\n\n\tprivate getWhereArg(relation: Model.Relation) {\n\t\treturn { type: this.whereTypeProvider.getEntityWhereType(relation.target) }\n\t}\n\n\tprivate getOrderByArgs(relation: Model.Relation) {\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(relation.target))),\n\t\t}\n\t}\n}\n"],"names":["GraphQLInt","GraphQLList","GraphQLNonNull"],"mappings":";;;AAKO,MAAM,iBAIb;AAAA,EACC,YACkB,mBACA,qBAChB;AAFgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AAEjB,SAAK,oBAAoB;AAAA,EAC1B;AAAA,EAEO,cAAc;AACpB,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAA6C;AAClE,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,UAAM,UAAU,KAAK,eAAe,QAAQ;AAC5C,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA,QAAQ,EAAE,MAAMA,mBAAA;AAAA,MAChB,OAAO,EAAE,MAAMA,QAAAA,WAAA;AAAA,IAAW;AAAA,EAE5B;AAAA,EAEO,YAAY,EAAE,YAAqC;AACzD,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,WAAO,EAAE,OAAA;AAAA,EACV;AAAA,EAEQ,YAAY,UAA0B;AAC7C,WAAO,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,SAAS,MAAM,EAAA;AAAA,EACzE;AAAA,EAEQ,eAAe,UAA0B;AAChD,WAAO;AAAA,MACN,MAAM,IAAIC,oBAAY,IAAIC,uBAAe,KAAK,oBAAoB,qBAAqB,SAAS,MAAM,CAAC,CAAC;AAAA,IAAA;AAAA,EAE1G;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldArgsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldArgsVisitor.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { GraphQLFieldConfigArgumentMap, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { OrderByTypeProvider } from '../OrderByTypeProvider'\n\nexport class FieldArgsVisitor\n\timplements\n\t\tModel.ColumnVisitor<GraphQLFieldConfigArgumentMap | undefined>,\n\t\tModel.RelationByGenericTypeVisitor<GraphQLFieldConfigArgumentMap | undefined>\n{\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t) {\n\t\tthis.whereTypeProvider = whereTypeProvider\n\t}\n\n\tpublic visitColumn() {\n\t\treturn undefined\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\tconst orderBy = this.getOrderByArgs(relation)\n\t\treturn {\n\t\t\tfilter,\n\t\t\torderBy,\n\t\t\toffset: { type: GraphQLInt },\n\t\t\tlimit: { type: GraphQLInt },\n\t\t}\n\t}\n\n\tpublic visitHasOne({ relation }: Model.ManyHasOneContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\treturn { filter }\n\t}\n\n\tprivate getWhereArg(relation: Model.Relation) {\n\t\treturn { type: this.whereTypeProvider.getEntityWhereType(relation.target) }\n\t}\n\n\tprivate getOrderByArgs(relation: Model.Relation) {\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(relation.target))),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAKO,MAAM,iBAIb;AAAA,EACC,YACkB,mBACA,qBAChB;AAFgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AAEjB,SAAK,oBAAoB;AAAA,EAC1B;AAAA,EAEO,cAAc;AACpB,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAA6C;AAClE,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,UAAM,UAAU,KAAK,eAAe,QAAQ;AAC5C,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA,QAAQ,EAAE,MAAM,WAAA;AAAA,MAChB,OAAO,EAAE,MAAM,WAAA;AAAA,IAAW;AAAA,EAE5B;AAAA,EAEO,YAAY,EAAE,YAAqC;AACzD,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,WAAO,EAAE,OAAA;AAAA,EACV;AAAA,EAEQ,YAAY,UAA0B;AAC7C,WAAO,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,SAAS,MAAM,EAAA;AAAA,EACzE;AAAA,EAEQ,eAAe,UAA0B;AAChD,WAAO;AAAA,MACN,MAAM,IAAI,YAAY,IAAI,eAAe,KAAK,oBAAoB,qBAAqB,SAAS,MAAM,CAAC,CAAC;AAAA,IAAA;AAAA,EAE1G;AACD;"}
|
|
1
|
+
{"version":3,"file":"FieldArgsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldArgsVisitor.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { WhereTypeProvider } from '../WhereTypeProvider.js'\nimport { GraphQLFieldConfigArgumentMap, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { OrderByTypeProvider } from '../OrderByTypeProvider.js'\n\nexport class FieldArgsVisitor\n\timplements\n\t\tModel.ColumnVisitor<GraphQLFieldConfigArgumentMap | undefined>,\n\t\tModel.RelationByGenericTypeVisitor<GraphQLFieldConfigArgumentMap | undefined>\n{\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t) {\n\t\tthis.whereTypeProvider = whereTypeProvider\n\t}\n\n\tpublic visitColumn() {\n\t\treturn undefined\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\tconst orderBy = this.getOrderByArgs(relation)\n\t\treturn {\n\t\t\tfilter,\n\t\t\torderBy,\n\t\t\toffset: { type: GraphQLInt },\n\t\t\tlimit: { type: GraphQLInt },\n\t\t}\n\t}\n\n\tpublic visitHasOne({ relation }: Model.ManyHasOneContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\treturn { filter }\n\t}\n\n\tprivate getWhereArg(relation: Model.Relation) {\n\t\treturn { type: this.whereTypeProvider.getEntityWhereType(relation.target) }\n\t}\n\n\tprivate getOrderByArgs(relation: Model.Relation) {\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(relation.target))),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAKO,MAAM,iBAIb;AAAA,EACC,YACkB,mBACA,qBAChB;AAFgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AAEjB,SAAK,oBAAoB;AAAA,EAC1B;AAAA,EAEO,cAAc;AACpB,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAA6C;AAClE,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,UAAM,UAAU,KAAK,eAAe,QAAQ;AAC5C,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA,QAAQ,EAAE,MAAM,WAAA;AAAA,MAChB,OAAO,EAAE,MAAM,WAAA;AAAA,IAAW;AAAA,EAE5B;AAAA,EAEO,YAAY,EAAE,YAAqC;AACzD,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,WAAO,EAAE,OAAA;AAAA,EACV;AAAA,EAEQ,YAAY,UAA0B;AAC7C,WAAO,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,SAAS,MAAM,EAAA;AAAA,EACzE;AAAA,EAEQ,eAAe,UAA0B;AAChD,WAAO;AAAA,MACN,MAAM,IAAI,YAAY,IAAI,eAAe,KAAK,oBAAoB,qBAAqB,SAAS,MAAM,CAAC,CAAC;AAAA,IAAA;AAAA,EAE1G;AACD;"}
|
|
@@ -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;AA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