@contember/engine-content-api 2.0.0-alpha.9 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/index.cjs +3 -2
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +3 -2
- package/dist/development/index.js.map +1 -1
- package/dist/development/src/ExecutionContainer.cjs +2 -2
- package/dist/development/src/ExecutionContainer.cjs.map +1 -1
- package/dist/development/src/ExecutionContainer.js +2 -2
- package/dist/development/src/ExecutionContainer.js.map +1 -1
- package/dist/development/src/acl/Authorizator.cjs.map +1 -1
- package/dist/development/src/acl/Authorizator.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/acl/VariableInjector.cjs.map +1 -1
- package/dist/development/src/acl/VariableInjector.js.map +1 -1
- package/dist/development/src/acl/VariableUtils.cjs.map +1 -1
- package/dist/development/src/acl/VariableUtils.js.map +1 -1
- package/dist/development/src/exception.cjs.map +1 -1
- package/dist/development/src/exception.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 +31 -6
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
- package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js +31 -6
- 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/ColumnValueResolver.cjs.map +1 -1
- package/dist/development/src/input-validation/ColumnValueResolver.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/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/ValidationPath.cjs.map +1 -1
- package/dist/development/src/input-validation/ValidationPath.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 +1 -1
- package/dist/development/src/input-validation/preValidation/InputPreValidator.cjs.map +1 -1
- package/dist/development/src/input-validation/preValidation/InputPreValidator.js +1 -1
- 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 +16 -17
- package/dist/development/src/inputProcessing/CreateInputVisitor.cjs.map +1 -1
- package/dist/development/src/inputProcessing/CreateInputVisitor.js +16 -17
- package/dist/development/src/inputProcessing/CreateInputVisitor.js.map +1 -1
- package/dist/development/src/inputProcessing/FieldNode.cjs.map +1 -1
- package/dist/development/src/inputProcessing/FieldNode.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 +29 -27
- package/dist/development/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
- package/dist/development/src/inputProcessing/UpdateInputVisitor.js +29 -27
- package/dist/development/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
- package/dist/development/src/introspection/IntrospectionSchemaDefinitionFactory.cjs +6 -163
- package/dist/development/src/introspection/IntrospectionSchemaDefinitionFactory.cjs.map +1 -1
- package/dist/development/src/introspection/IntrospectionSchemaDefinitionFactory.js +5 -162
- 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/introspection/introspection.schema.cjs +163 -0
- package/dist/development/src/introspection/introspection.schema.cjs.map +1 -0
- package/dist/development/src/introspection/introspection.schema.js +163 -0
- package/dist/development/src/introspection/introspection.schema.js.map +1 -0
- package/dist/development/src/mapper/CheckedPrimary.cjs.map +1 -1
- package/dist/development/src/mapper/CheckedPrimary.js.map +1 -1
- package/dist/development/src/mapper/ColumnValue.cjs +8 -18
- package/dist/development/src/mapper/ColumnValue.cjs.map +1 -1
- package/dist/development/src/mapper/ColumnValue.js +8 -18
- package/dist/development/src/mapper/ColumnValue.js.map +1 -1
- package/dist/development/src/mapper/ErrorUtils.cjs +1 -1
- package/dist/development/src/mapper/ErrorUtils.cjs.map +1 -1
- package/dist/development/src/mapper/ErrorUtils.js +1 -1
- package/dist/development/src/mapper/ErrorUtils.js.map +1 -1
- package/dist/development/src/mapper/EventManager.cjs +4 -7
- package/dist/development/src/mapper/EventManager.cjs.map +1 -1
- package/dist/development/src/mapper/EventManager.js +4 -7
- 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 +10 -29
- package/dist/development/src/mapper/Mapper.cjs.map +1 -1
- package/dist/development/src/mapper/Mapper.js +10 -29
- package/dist/development/src/mapper/Mapper.js.map +1 -1
- package/dist/development/src/mapper/MapperFactory.cjs.map +1 -1
- package/dist/development/src/mapper/MapperFactory.js.map +1 -1
- package/dist/development/src/mapper/MutationProcessorHelper.cjs +10 -2
- package/dist/development/src/mapper/MutationProcessorHelper.cjs.map +1 -1
- package/dist/development/src/mapper/MutationProcessorHelper.js +10 -2
- package/dist/development/src/mapper/MutationProcessorHelper.js.map +1 -1
- package/dist/development/src/mapper/Result.cjs +10 -27
- package/dist/development/src/mapper/Result.cjs.map +1 -1
- package/dist/development/src/mapper/Result.js +10 -27
- package/dist/development/src/mapper/Result.js.map +1 -1
- package/dist/development/src/mapper/delete/DeleteExecutor.cjs +4 -8
- package/dist/development/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
- package/dist/development/src/mapper/delete/DeleteExecutor.js +5 -9
- 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/delete/DeletedEntitiesStorage.cjs.map +1 -1
- package/dist/development/src/mapper/delete/DeletedEntitiesStorage.js.map +1 -1
- package/dist/development/src/mapper/delete/helpers.cjs.map +1 -1
- package/dist/development/src/mapper/delete/helpers.js.map +1 -1
- package/dist/development/src/mapper/insert/InsertBuilder.cjs +13 -21
- package/dist/development/src/mapper/insert/InsertBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/insert/InsertBuilder.js +14 -22
- 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 +43 -21
- package/dist/development/src/mapper/insert/Inserter.cjs.map +1 -1
- package/dist/development/src/mapper/insert/Inserter.js +45 -23
- package/dist/development/src/mapper/insert/Inserter.js.map +1 -1
- package/dist/development/src/mapper/insert/SqlCreateInputProcessor.cjs +23 -79
- package/dist/development/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/insert/SqlCreateInputProcessor.js +23 -79
- package/dist/development/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs +43 -0
- package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -0
- package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js +43 -0
- package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -0
- package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs +40 -0
- package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -0
- package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js +40 -0
- package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -0
- package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs +38 -0
- package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -0
- package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js +38 -0
- package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -0
- package/dist/development/src/mapper/{relations → insert/relations}/OneHasOneInverseCreateInputProcessor.cjs +23 -32
- package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -0
- package/dist/development/src/mapper/{relations → insert/relations}/OneHasOneInverseCreateInputProcessor.js +23 -32
- package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -0
- package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs +65 -0
- package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -0
- package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js +65 -0
- package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -0
- package/dist/development/src/mapper/select/ConditionBuilder.cjs.map +1 -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/Path.cjs.map +1 -1
- package/dist/development/src/mapper/select/Path.js.map +1 -1
- package/dist/development/src/mapper/select/RelationFetcher.cjs.map +1 -1
- package/dist/development/src/mapper/select/RelationFetcher.js.map +1 -1
- package/dist/development/src/mapper/select/SelectBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/SelectBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/SelectHydrator.cjs.map +1 -1
- package/dist/development/src/mapper/select/SelectHydrator.js.map +1 -1
- package/dist/development/src/mapper/select/WhereBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/select/WhereBuilder.js.map +1 -1
- package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs +3 -0
- package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
- package/dist/development/src/mapper/select/handlers/FieldsVisitor.js +3 -0
- 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/select/optimizer/WhereReplacer.cjs.map +1 -1
- package/dist/development/src/mapper/select/optimizer/WhereReplacer.js.map +1 -1
- package/dist/development/src/mapper/select/optimizer/helpers.cjs.map +1 -1
- package/dist/development/src/mapper/select/optimizer/helpers.js.map +1 -1
- package/dist/development/src/mapper/update/SqlUpdateInputProcessor.cjs +36 -36
- package/dist/development/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
- package/dist/development/src/mapper/update/SqlUpdateInputProcessor.js +36 -36
- package/dist/development/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
- package/dist/development/src/mapper/update/UpdateBuilder.cjs +14 -19
- package/dist/development/src/mapper/update/UpdateBuilder.cjs.map +1 -1
- package/dist/development/src/mapper/update/UpdateBuilder.js +15 -20
- 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 +45 -17
- package/dist/development/src/mapper/update/Updater.cjs.map +1 -1
- package/dist/development/src/mapper/update/Updater.js +47 -19
- package/dist/development/src/mapper/update/Updater.js.map +1 -1
- package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs +84 -0
- package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -0
- package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js +84 -0
- package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -0
- package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs +88 -0
- package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -0
- package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js +88 -0
- package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -0
- package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs +87 -0
- package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -0
- package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js +87 -0
- package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -0
- package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs +147 -0
- package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -0
- package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js +147 -0
- package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -0
- package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs +183 -0
- package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -0
- package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js +183 -0
- package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -0
- package/dist/development/src/resolvers/GraphQlQueryAstFactory.cjs.map +1 -1
- package/dist/development/src/resolvers/GraphQlQueryAstFactory.js.map +1 -1
- package/dist/development/src/resolvers/MutationResolver.cjs +8 -4
- package/dist/development/src/resolvers/MutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/MutationResolver.js +8 -4
- 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/ValidationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/ValidationResolver.js.map +1 -1
- package/dist/development/src/schema/ColumnTypeResolver.cjs.map +1 -1
- package/dist/development/src/schema/ColumnTypeResolver.js.map +1 -1
- package/dist/development/src/schema/ConditionTypeProvider.cjs.map +1 -1
- package/dist/development/src/schema/ConditionTypeProvider.js.map +1 -1
- package/dist/development/src/schema/CustomTypesProvider.cjs.map +1 -1
- 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/ResultSchemaTypeProvider.cjs.map +1 -1
- package/dist/development/src/schema/ResultSchemaTypeProvider.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 +2 -0
- package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
- package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js +2 -0
- 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/Mutex.cjs.map +1 -1
- package/dist/development/src/utils/Mutex.js.map +1 -1
- package/dist/development/src/utils/ResolveInfoUtils.cjs.map +1 -1
- package/dist/development/src/utils/ResolveInfoUtils.js.map +1 -1
- package/dist/development/src/utils/accessor.cjs.map +1 -1
- package/dist/development/src/utils/accessor.js.map +1 -1
- package/dist/development/src/utils/isIt.cjs.map +1 -1
- package/dist/development/src/utils/isIt.js.map +1 -1
- package/dist/development/src/utils/object.cjs.map +1 -1
- package/dist/development/src/utils/object.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/development/src/utils/uniqueWhereFields.cjs.map +1 -1
- package/dist/development/src/utils/uniqueWhereFields.js.map +1 -1
- package/dist/production/index.cjs +3 -2
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +3 -2
- package/dist/production/index.js.map +1 -1
- package/dist/production/src/ExecutionContainer.cjs +2 -2
- package/dist/production/src/ExecutionContainer.cjs.map +1 -1
- package/dist/production/src/ExecutionContainer.js +2 -2
- package/dist/production/src/ExecutionContainer.js.map +1 -1
- package/dist/production/src/acl/Authorizator.cjs.map +1 -1
- package/dist/production/src/acl/Authorizator.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/acl/VariableInjector.cjs.map +1 -1
- package/dist/production/src/acl/VariableInjector.js.map +1 -1
- package/dist/production/src/acl/VariableUtils.cjs.map +1 -1
- package/dist/production/src/acl/VariableUtils.js.map +1 -1
- package/dist/production/src/exception.cjs.map +1 -1
- package/dist/production/src/exception.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 +31 -6
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
- package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js +31 -6
- 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/ColumnValueResolver.cjs.map +1 -1
- package/dist/production/src/input-validation/ColumnValueResolver.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/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/ValidationPath.cjs.map +1 -1
- package/dist/production/src/input-validation/ValidationPath.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 +1 -1
- package/dist/production/src/input-validation/preValidation/InputPreValidator.cjs.map +1 -1
- package/dist/production/src/input-validation/preValidation/InputPreValidator.js +1 -1
- 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 +16 -17
- package/dist/production/src/inputProcessing/CreateInputVisitor.cjs.map +1 -1
- package/dist/production/src/inputProcessing/CreateInputVisitor.js +16 -17
- package/dist/production/src/inputProcessing/CreateInputVisitor.js.map +1 -1
- package/dist/production/src/inputProcessing/FieldNode.cjs.map +1 -1
- package/dist/production/src/inputProcessing/FieldNode.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 +29 -27
- package/dist/production/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
- package/dist/production/src/inputProcessing/UpdateInputVisitor.js +29 -27
- package/dist/production/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
- package/dist/production/src/introspection/IntrospectionSchemaDefinitionFactory.cjs +6 -163
- package/dist/production/src/introspection/IntrospectionSchemaDefinitionFactory.cjs.map +1 -1
- package/dist/production/src/introspection/IntrospectionSchemaDefinitionFactory.js +5 -162
- 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/introspection/introspection.schema.cjs +163 -0
- package/dist/production/src/introspection/introspection.schema.cjs.map +1 -0
- package/dist/production/src/introspection/introspection.schema.js +163 -0
- package/dist/production/src/introspection/introspection.schema.js.map +1 -0
- package/dist/production/src/mapper/CheckedPrimary.cjs.map +1 -1
- package/dist/production/src/mapper/CheckedPrimary.js.map +1 -1
- package/dist/production/src/mapper/ColumnValue.cjs +8 -18
- package/dist/production/src/mapper/ColumnValue.cjs.map +1 -1
- package/dist/production/src/mapper/ColumnValue.js +8 -18
- package/dist/production/src/mapper/ColumnValue.js.map +1 -1
- package/dist/production/src/mapper/ErrorUtils.cjs +1 -1
- package/dist/production/src/mapper/ErrorUtils.cjs.map +1 -1
- package/dist/production/src/mapper/ErrorUtils.js +1 -1
- package/dist/production/src/mapper/ErrorUtils.js.map +1 -1
- package/dist/production/src/mapper/EventManager.cjs +4 -7
- package/dist/production/src/mapper/EventManager.cjs.map +1 -1
- package/dist/production/src/mapper/EventManager.js +4 -7
- 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 +10 -29
- package/dist/production/src/mapper/Mapper.cjs.map +1 -1
- package/dist/production/src/mapper/Mapper.js +10 -29
- package/dist/production/src/mapper/Mapper.js.map +1 -1
- package/dist/production/src/mapper/MapperFactory.cjs.map +1 -1
- package/dist/production/src/mapper/MapperFactory.js.map +1 -1
- package/dist/production/src/mapper/MutationProcessorHelper.cjs +10 -2
- package/dist/production/src/mapper/MutationProcessorHelper.cjs.map +1 -1
- package/dist/production/src/mapper/MutationProcessorHelper.js +10 -2
- package/dist/production/src/mapper/MutationProcessorHelper.js.map +1 -1
- package/dist/production/src/mapper/Result.cjs +10 -27
- package/dist/production/src/mapper/Result.cjs.map +1 -1
- package/dist/production/src/mapper/Result.js +10 -27
- package/dist/production/src/mapper/Result.js.map +1 -1
- package/dist/production/src/mapper/delete/DeleteExecutor.cjs +4 -8
- package/dist/production/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
- package/dist/production/src/mapper/delete/DeleteExecutor.js +5 -9
- 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/delete/DeletedEntitiesStorage.cjs.map +1 -1
- package/dist/production/src/mapper/delete/DeletedEntitiesStorage.js.map +1 -1
- package/dist/production/src/mapper/delete/helpers.cjs.map +1 -1
- package/dist/production/src/mapper/delete/helpers.js.map +1 -1
- package/dist/production/src/mapper/insert/InsertBuilder.cjs +13 -21
- package/dist/production/src/mapper/insert/InsertBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/insert/InsertBuilder.js +14 -22
- 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 +43 -21
- package/dist/production/src/mapper/insert/Inserter.cjs.map +1 -1
- package/dist/production/src/mapper/insert/Inserter.js +45 -23
- package/dist/production/src/mapper/insert/Inserter.js.map +1 -1
- package/dist/production/src/mapper/insert/SqlCreateInputProcessor.cjs +23 -79
- package/dist/production/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/insert/SqlCreateInputProcessor.js +23 -79
- package/dist/production/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs +43 -0
- package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -0
- package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js +43 -0
- package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -0
- package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs +40 -0
- package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -0
- package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js +40 -0
- package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -0
- package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs +38 -0
- package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -0
- package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js +38 -0
- package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -0
- package/dist/production/src/mapper/{relations → insert/relations}/OneHasOneInverseCreateInputProcessor.cjs +23 -32
- package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -0
- package/dist/production/src/mapper/{relations → insert/relations}/OneHasOneInverseCreateInputProcessor.js +23 -32
- package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -0
- package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs +65 -0
- package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -0
- package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js +65 -0
- package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -0
- package/dist/production/src/mapper/select/ConditionBuilder.cjs.map +1 -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/Path.cjs.map +1 -1
- package/dist/production/src/mapper/select/Path.js.map +1 -1
- package/dist/production/src/mapper/select/RelationFetcher.cjs.map +1 -1
- package/dist/production/src/mapper/select/RelationFetcher.js.map +1 -1
- package/dist/production/src/mapper/select/SelectBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/SelectBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/SelectHydrator.cjs.map +1 -1
- package/dist/production/src/mapper/select/SelectHydrator.js.map +1 -1
- package/dist/production/src/mapper/select/WhereBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/select/WhereBuilder.js.map +1 -1
- package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs +3 -0
- package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
- package/dist/production/src/mapper/select/handlers/FieldsVisitor.js +3 -0
- 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/select/optimizer/WhereReplacer.cjs.map +1 -1
- package/dist/production/src/mapper/select/optimizer/WhereReplacer.js.map +1 -1
- package/dist/production/src/mapper/select/optimizer/helpers.cjs.map +1 -1
- package/dist/production/src/mapper/select/optimizer/helpers.js.map +1 -1
- package/dist/production/src/mapper/update/SqlUpdateInputProcessor.cjs +36 -36
- package/dist/production/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
- package/dist/production/src/mapper/update/SqlUpdateInputProcessor.js +36 -36
- package/dist/production/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
- package/dist/production/src/mapper/update/UpdateBuilder.cjs +14 -19
- package/dist/production/src/mapper/update/UpdateBuilder.cjs.map +1 -1
- package/dist/production/src/mapper/update/UpdateBuilder.js +15 -20
- 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 +45 -17
- package/dist/production/src/mapper/update/Updater.cjs.map +1 -1
- package/dist/production/src/mapper/update/Updater.js +47 -19
- package/dist/production/src/mapper/update/Updater.js.map +1 -1
- package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs +84 -0
- package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -0
- package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js +84 -0
- package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -0
- package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs +88 -0
- package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -0
- package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js +88 -0
- package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -0
- package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs +87 -0
- package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -0
- package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js +87 -0
- package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -0
- package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs +147 -0
- package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -0
- package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js +147 -0
- package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -0
- package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs +183 -0
- package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -0
- package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js +183 -0
- package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -0
- package/dist/production/src/resolvers/GraphQlQueryAstFactory.cjs.map +1 -1
- package/dist/production/src/resolvers/GraphQlQueryAstFactory.js.map +1 -1
- package/dist/production/src/resolvers/MutationResolver.cjs +8 -4
- package/dist/production/src/resolvers/MutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/MutationResolver.js +8 -4
- 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/ValidationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/ValidationResolver.js.map +1 -1
- package/dist/production/src/schema/ColumnTypeResolver.cjs.map +1 -1
- package/dist/production/src/schema/ColumnTypeResolver.js.map +1 -1
- package/dist/production/src/schema/ConditionTypeProvider.cjs.map +1 -1
- package/dist/production/src/schema/ConditionTypeProvider.js.map +1 -1
- package/dist/production/src/schema/CustomTypesProvider.cjs.map +1 -1
- 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/ResultSchemaTypeProvider.cjs.map +1 -1
- package/dist/production/src/schema/ResultSchemaTypeProvider.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 +2 -0
- package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
- package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js +2 -0
- 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/Mutex.cjs.map +1 -1
- package/dist/production/src/utils/Mutex.js.map +1 -1
- package/dist/production/src/utils/ResolveInfoUtils.cjs.map +1 -1
- package/dist/production/src/utils/ResolveInfoUtils.js.map +1 -1
- package/dist/production/src/utils/accessor.cjs.map +1 -1
- package/dist/production/src/utils/accessor.js.map +1 -1
- package/dist/production/src/utils/isIt.cjs.map +1 -1
- package/dist/production/src/utils/isIt.js.map +1 -1
- package/dist/production/src/utils/object.cjs.map +1 -1
- package/dist/production/src/utils/object.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/production/src/utils/uniqueWhereFields.cjs.map +1 -1
- package/dist/production/src/utils/uniqueWhereFields.js.map +1 -1
- package/dist/tests/cases/integration/graphQlRequests/insert/jsonInsert.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/insert/jsonInsert.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/connectOrCreate.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/connectOrCreate.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/connectOrCreate.test.d.ts +2 -0
- package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/connectOrCreate.test.d.ts.map +1 -0
- package/dist/tests/cases/integration/graphQlRequests/validation/conditions.test.d.ts +2 -2
- package/dist/tests/cases/integration/graphQlRequests/validation/conditions.test.d.ts.map +1 -1
- package/dist/tests/cases/integration/graphQlRequests/validation/requiredWhen.test.d.ts +1 -1
- package/dist/tests/cases/integration/graphQlRequests/validation/requiredWhen.test.d.ts.map +1 -1
- package/dist/tests/cases/integration/graphQlSchema/model.d.ts +4 -4
- package/dist/tests/cases/integration/graphQlSchema/model.d.ts.map +1 -1
- package/dist/tests/src/assert.d.ts +5 -0
- package/dist/tests/src/assert.d.ts.map +1 -0
- package/dist/tests/src/test.d.ts.map +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ExecutionContainer.d.ts +8 -5
- package/dist/types/ExecutionContainer.d.ts.map +1 -1
- package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.d.ts.map +1 -1
- package/dist/types/input-validation/ColumnValueResolver.d.ts +1 -1
- package/dist/types/input-validation/ColumnValueResolver.d.ts.map +1 -1
- package/dist/types/input-validation/ValidationDataSelector.d.ts +1 -1
- package/dist/types/input-validation/preValidation/CreateInputPreValidationProcessor.d.ts +3 -3
- package/dist/types/input-validation/preValidation/CreateInputPreValidationProcessor.d.ts.map +1 -1
- package/dist/types/input-validation/preValidation/InputPreValidator.d.ts +3 -3
- package/dist/types/input-validation/preValidation/InputPreValidator.d.ts.map +1 -1
- package/dist/types/input-validation/preValidation/UpdateInputPreValidationProcessor.d.ts +4 -4
- package/dist/types/input-validation/preValidation/UpdateInputPreValidationProcessor.d.ts.map +1 -1
- package/dist/types/inputProcessing/CreateInputProcessor.d.ts +8 -6
- package/dist/types/inputProcessing/CreateInputProcessor.d.ts.map +1 -1
- package/dist/types/inputProcessing/CreateInputVisitor.d.ts +11 -10
- package/dist/types/inputProcessing/CreateInputVisitor.d.ts.map +1 -1
- package/dist/types/inputProcessing/UpdateInputProcessor.d.ts +14 -12
- package/dist/types/inputProcessing/UpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/inputProcessing/UpdateInputVisitor.d.ts +11 -10
- package/dist/types/inputProcessing/UpdateInputVisitor.d.ts.map +1 -1
- package/dist/types/introspection/IntrospectionSchemaDefinitionFactory.d.ts +1 -3
- package/dist/types/introspection/IntrospectionSchemaDefinitionFactory.d.ts.map +1 -1
- package/dist/types/introspection/index.d.ts +2 -1
- package/dist/types/introspection/index.d.ts.map +1 -1
- package/dist/types/introspection/introspection.schema.d.ts +5 -0
- package/dist/types/introspection/introspection.schema.d.ts.map +1 -0
- package/dist/types/mapper/ColumnValue.d.ts +4 -8
- package/dist/types/mapper/ColumnValue.d.ts.map +1 -1
- package/dist/types/mapper/EventManager.d.ts +9 -9
- package/dist/types/mapper/EventManager.d.ts.map +1 -1
- package/dist/types/mapper/Mapper.d.ts +6 -7
- package/dist/types/mapper/Mapper.d.ts.map +1 -1
- package/dist/types/mapper/MutationProcessorHelper.d.ts +2 -2
- package/dist/types/mapper/MutationProcessorHelper.d.ts.map +1 -1
- package/dist/types/mapper/Result.d.ts +16 -9
- package/dist/types/mapper/Result.d.ts.map +1 -1
- package/dist/types/mapper/delete/DeleteExecutor.d.ts.map +1 -1
- package/dist/types/mapper/insert/InsertBuilder.d.ts +4 -9
- package/dist/types/mapper/insert/InsertBuilder.d.ts.map +1 -1
- package/dist/types/mapper/insert/Inserter.d.ts +3 -3
- package/dist/types/mapper/insert/Inserter.d.ts.map +1 -1
- package/dist/types/mapper/insert/SqlCreateInputProcessor.d.ts +11 -8
- package/dist/types/mapper/insert/SqlCreateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/insert/relations/ManyHasManyCreateInputProcessor.d.ts +26 -0
- package/dist/types/mapper/insert/relations/ManyHasManyCreateInputProcessor.d.ts.map +1 -0
- package/dist/types/mapper/insert/relations/ManyHasOneCreateInputProcessor.d.ts +25 -0
- package/dist/types/mapper/insert/relations/ManyHasOneCreateInputProcessor.d.ts.map +1 -0
- package/dist/types/mapper/insert/relations/OneHasManyCreateInputProcessor.d.ts +28 -0
- package/dist/types/mapper/insert/relations/OneHasManyCreateInputProcessor.d.ts.map +1 -0
- package/dist/types/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.d.ts +31 -0
- package/dist/types/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.d.ts.map +1 -0
- package/dist/types/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.d.ts +26 -0
- package/dist/types/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.d.ts.map +1 -0
- package/dist/types/mapper/select/handlers/FieldsVisitor.d.ts.map +1 -1
- package/dist/types/mapper/types.d.ts +84 -1
- package/dist/types/mapper/types.d.ts.map +1 -1
- package/dist/types/mapper/update/SqlUpdateInputProcessor.d.ts +12 -8
- package/dist/types/mapper/update/SqlUpdateInputProcessor.d.ts.map +1 -1
- package/dist/types/mapper/update/UpdateBuilder.d.ts +4 -8
- package/dist/types/mapper/update/UpdateBuilder.d.ts.map +1 -1
- package/dist/types/mapper/update/Updater.d.ts +2 -2
- package/dist/types/mapper/update/Updater.d.ts.map +1 -1
- package/dist/types/mapper/update/relations/ManyHasManyUpdateInputProcessor.d.ts +48 -0
- package/dist/types/mapper/update/relations/ManyHasManyUpdateInputProcessor.d.ts.map +1 -0
- package/dist/types/mapper/update/relations/ManyHasOneUpdateInputProcessor.d.ts +42 -0
- package/dist/types/mapper/update/relations/ManyHasOneUpdateInputProcessor.d.ts.map +1 -0
- package/dist/types/mapper/update/relations/OneHasManyUpdateInputProcessor.d.ts +48 -0
- package/dist/types/mapper/update/relations/OneHasManyUpdateInputProcessor.d.ts.map +1 -0
- package/dist/types/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.d.ts +38 -0
- package/dist/types/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.d.ts.map +1 -0
- package/dist/types/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.d.ts +42 -0
- package/dist/types/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.d.ts.map +1 -0
- package/dist/types/resolvers/MutationResolver.d.ts.map +1 -1
- package/dist/types/schema/mutations/UpdateEntityRelationInputFieldVisitor.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/graphql.codegen.yml +2 -2
- package/package.json +14 -18
- package/src/ExecutionContainer.ts +5 -2
- package/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.ts +35 -2
- package/src/input-validation/ColumnValueResolver.ts +1 -1
- package/src/input-validation/preValidation/CreateInputPreValidationProcessor.ts +2 -2
- package/src/input-validation/preValidation/InputPreValidator.ts +10 -12
- package/src/input-validation/preValidation/UpdateInputPreValidationProcessor.ts +3 -3
- package/src/inputProcessing/CreateInputProcessor.ts +8 -6
- package/src/inputProcessing/CreateInputVisitor.ts +32 -33
- package/src/inputProcessing/UpdateInputProcessor.ts +13 -11
- package/src/inputProcessing/UpdateInputVisitor.ts +44 -40
- package/src/introspection/IntrospectionSchemaDefinitionFactory.ts +2 -194
- package/src/introspection/index.ts +2 -1
- package/src/introspection/introspection.schema.ts +194 -0
- package/src/mapper/ColumnValue.ts +11 -25
- package/src/mapper/ErrorUtils.ts +1 -1
- package/src/mapper/EventManager.ts +9 -13
- package/src/mapper/Mapper.ts +21 -38
- package/src/mapper/MutationProcessorHelper.ts +16 -8
- package/src/mapper/Result.ts +14 -49
- package/src/mapper/delete/DeleteExecutor.ts +4 -8
- package/src/mapper/insert/InsertBuilder.ts +23 -34
- package/src/mapper/insert/Inserter.ts +55 -41
- package/src/mapper/insert/SqlCreateInputProcessor.ts +36 -91
- package/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.ts +59 -0
- package/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.ts +57 -0
- package/src/mapper/insert/relations/OneHasManyCreateInputProcessor.ts +52 -0
- package/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.ts +90 -0
- package/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.ts +87 -0
- package/src/mapper/select/handlers/FieldsVisitor.ts +3 -0
- package/src/mapper/types.ts +115 -1
- package/src/mapper/update/SqlUpdateInputProcessor.ts +50 -47
- package/src/mapper/update/UpdateBuilder.ts +25 -31
- package/src/mapper/update/Updater.ts +55 -35
- package/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.ts +112 -0
- package/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.ts +125 -0
- package/src/mapper/update/relations/OneHasManyUpdateInputProcessor.ts +113 -0
- package/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.ts +184 -0
- package/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.ts +240 -0
- package/src/resolvers/MutationResolver.ts +6 -4
- package/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts +5 -0
- package/tests/cases/bugs/bug-filter-or.test.ts +1 -1
- package/tests/cases/bugs/bug-update-by-nested-unique.test.ts +1 -1
- package/tests/cases/bugs/bug102.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/delete/aclDelete.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/delete/additionalDeleteFilter.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/delete/cascadeDelete.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/delete/deleteById.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/delete/orphanRemoval.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/delete/restrictOnDelete.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/delete/setNullOnDelete.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/acl/setField.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/aclInsert.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/basicInsert.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/insertCustomId.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/jsonInsert.test.ts +37 -0
- package/tests/cases/integration/graphQlRequests/insert/manyHasManyInverse/create.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/manyHasManyOwning/create.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/manyHasOne/connectOrCreate.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/manyHasOne/create.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/oneHasMany/connect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/oneHasMany/create.test.ts +9 -9
- package/tests/cases/integration/graphQlRequests/insert/oneHasOneInverse/create.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/oneHasOneOwning/create.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/oneHasOneOwning/empty.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/insert/validation/toBeFixed.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/acl/differentRowAndFieldPredicate.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/acl/fieldRestrictedByLocale.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/acl/isNullAcl.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/acl/nestedPredicate.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/acl/orPredicate.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/acl/predicateElimination.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/acl/relationAcl.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/acl/rowPredicateSubset.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/acl/sameRowAndFieldPredicate.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/filter/backReferencedFilter.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/filter/complexCondition.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/filter/composedFilter.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/filter/containsQuery.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/filter/manyHasManyOwnerRelation.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/filter/manyHasOneRelation.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/filter/oneHasManyRelation.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/formatting/dateFormat.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/alias.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/fragments.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/misc/aliasedType.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/misc/longAliasHash.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/misc/reducedHasMany.test.ts +70 -1
- package/tests/cases/integration/graphQlRequests/query/misc/transaction.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/pagination/hasManyLimit.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/pagination/paginate.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/pagination/paginateAliased.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/pagination/simpleLimit.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/relations/advanced.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyInverse.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyOwning.test.ts +2 -2
- package/tests/cases/integration/graphQlRequests/query/relations/manyHasOne.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/relations/oneHasMany.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneInverse.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneOwner.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/sorting/byRelations.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/sorting/defaultOrdering.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/sorting/orderBy.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/sorting/randomSort.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/sorting/sortNulls.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/sorting/sortedHasMany.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/unique/basicQueryById.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/unique/composedUnique.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/unique/oneHasManyUnique.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/unique/uniqueWithFilter.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/query/view/view.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/acl/aclUpdate.test.ts +69 -2
- package/tests/cases/integration/graphQlRequests/update/additionalFilter.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/basic/columnUpdate.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/connect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/create.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/delete.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/disconnect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/update.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/upsert.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/connect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/connectOrCreate.test.ts +100 -0
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/create.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/delete.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/disconnect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/update.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/upsert.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/connect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/create.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/delete.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/disconnect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/update.test.ts +1 -6
- package/tests/cases/integration/graphQlRequests/update/manyHasOne/upsert.test.ts +1 -6
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/combination.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/connect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/connectOrCreate.test.ts +90 -0
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/create.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/delete.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/disconnect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/update.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasMany/upsert.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/connect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/create.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/delete.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/disconnect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/update.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/upsert.test.ts +10 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connectOrCreate.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/create.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/delete.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/disconnect.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/update.test.ts +1 -6
- package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/upsert.test.ts +1 -6
- package/tests/cases/integration/graphQlRequests/update/queryPortal.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/transaction.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/update/validation/toBeFixed.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/upsert/basicUpsert.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/conditions.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/nestedValidation.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/optionalAssert.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/required.test.ts +1 -1
- package/tests/cases/integration/graphQlRequests/validation/requiredWhen.test.ts +1 -1
- 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 -2
- package/tests/cases/integration/graphQlRequests/validation/rules/rangeRule.test.ts +1 -1
- package/tests/cases/integration/graphQlSchema/graphQlSchemaBuilder.test.ts +4 -4
- package/tests/cases/integration/graphQlSchema/schema-acl-allowed.gql +6 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-create-only.gql +28 -28
- package/tests/cases/integration/graphQlSchema/schema-acl-restricted-create.gql +5 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-restricted-delete.gql +6 -0
- package/tests/cases/integration/graphQlSchema/schema-acl-restricted-update.gql +5 -0
- package/tests/cases/integration/graphQlSchema/schema-basic.gql +15 -0
- package/tests/cases/integration/graphQlSchema/schema-bug-66.gql +7 -0
- package/tests/cases/integration/graphQlSchema/schema-custom-primary.gql +15 -0
- package/tests/cases/integration/graphQlSchema/schema-has-many-reduction.gql +7 -0
- package/tests/cases/integration/graphQlSchema/schema-new-builder.gql +123 -107
- package/tests/cases/unit/aclVariablesFactory.test.ts +5 -5
- package/tests/cases/unit/conditionOptimizer.test.ts +7 -1
- package/tests/cases/unit/inputPreValidator.test.ts +3 -2
- package/tests/cases/unit/inputValidation.test.ts +7 -6
- package/tests/cases/unit/orderbyHelper.test.ts +3 -2
- package/tests/cases/unit/permissionMerger.test.ts +2 -1
- package/tests/cases/unit/predicatesFactory.test.ts +2 -1
- package/tests/cases/unit/predicatesInjector.test.ts +2 -1
- package/tests/cases/unit/uuidType.test.ts +5 -5
- package/tests/cases/unit/variableInjector.test.ts +2 -1
- package/tests/cases/unit/whereBuilder.test.ts +2 -1
- package/tests/cases/unit/whereOptimizer.test.ts +2 -1
- package/tests/src/assert.ts +10 -0
- package/tests/src/test.ts +4 -1
- package/tests/src/testGraphql.ts +3 -3
- package/dist/development/src/mapper/DataManipulationBuilder.cjs +0 -5
- package/dist/development/src/mapper/DataManipulationBuilder.cjs.map +0 -1
- package/dist/development/src/mapper/DataManipulationBuilder.js +0 -5
- package/dist/development/src/mapper/DataManipulationBuilder.js.map +0 -1
- package/dist/development/src/mapper/relations/ManyHasManyInputProcessor.cjs +0 -75
- package/dist/development/src/mapper/relations/ManyHasManyInputProcessor.cjs.map +0 -1
- package/dist/development/src/mapper/relations/ManyHasManyInputProcessor.js +0 -75
- package/dist/development/src/mapper/relations/ManyHasManyInputProcessor.js.map +0 -1
- package/dist/development/src/mapper/relations/ManyHasOneInputProcessor.cjs +0 -114
- package/dist/development/src/mapper/relations/ManyHasOneInputProcessor.cjs.map +0 -1
- package/dist/development/src/mapper/relations/ManyHasOneInputProcessor.js +0 -114
- package/dist/development/src/mapper/relations/ManyHasOneInputProcessor.js.map +0 -1
- package/dist/development/src/mapper/relations/OneHasManyInputProcessor.cjs +0 -72
- package/dist/development/src/mapper/relations/OneHasManyInputProcessor.cjs.map +0 -1
- package/dist/development/src/mapper/relations/OneHasManyInputProcessor.js +0 -72
- package/dist/development/src/mapper/relations/OneHasManyInputProcessor.js.map +0 -1
- package/dist/development/src/mapper/relations/OneHasOneInverseCreateInputProcessor.cjs.map +0 -1
- package/dist/development/src/mapper/relations/OneHasOneInverseCreateInputProcessor.js.map +0 -1
- package/dist/development/src/mapper/relations/OneHasOneInverseUpdateInputProcessor.cjs +0 -131
- package/dist/development/src/mapper/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +0 -1
- package/dist/development/src/mapper/relations/OneHasOneInverseUpdateInputProcessor.js +0 -131
- package/dist/development/src/mapper/relations/OneHasOneInverseUpdateInputProcessor.js.map +0 -1
- package/dist/development/src/mapper/relations/OneHasOneOwningCreateInputProcessor.cjs +0 -71
- package/dist/development/src/mapper/relations/OneHasOneOwningCreateInputProcessor.cjs.map +0 -1
- package/dist/development/src/mapper/relations/OneHasOneOwningCreateInputProcessor.js +0 -71
- package/dist/development/src/mapper/relations/OneHasOneOwningCreateInputProcessor.js.map +0 -1
- package/dist/development/src/mapper/relations/OneHasOneOwningUpdateInputProcessor.cjs +0 -200
- package/dist/development/src/mapper/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +0 -1
- package/dist/development/src/mapper/relations/OneHasOneOwningUpdateInputProcessor.js +0 -200
- package/dist/development/src/mapper/relations/OneHasOneOwningUpdateInputProcessor.js.map +0 -1
- package/dist/production/src/mapper/DataManipulationBuilder.cjs +0 -5
- package/dist/production/src/mapper/DataManipulationBuilder.cjs.map +0 -1
- package/dist/production/src/mapper/DataManipulationBuilder.js +0 -5
- package/dist/production/src/mapper/DataManipulationBuilder.js.map +0 -1
- package/dist/production/src/mapper/relations/ManyHasManyInputProcessor.cjs +0 -75
- package/dist/production/src/mapper/relations/ManyHasManyInputProcessor.cjs.map +0 -1
- package/dist/production/src/mapper/relations/ManyHasManyInputProcessor.js +0 -75
- package/dist/production/src/mapper/relations/ManyHasManyInputProcessor.js.map +0 -1
- package/dist/production/src/mapper/relations/ManyHasOneInputProcessor.cjs +0 -114
- package/dist/production/src/mapper/relations/ManyHasOneInputProcessor.cjs.map +0 -1
- package/dist/production/src/mapper/relations/ManyHasOneInputProcessor.js +0 -114
- package/dist/production/src/mapper/relations/ManyHasOneInputProcessor.js.map +0 -1
- package/dist/production/src/mapper/relations/OneHasManyInputProcessor.cjs +0 -72
- package/dist/production/src/mapper/relations/OneHasManyInputProcessor.cjs.map +0 -1
- package/dist/production/src/mapper/relations/OneHasManyInputProcessor.js +0 -72
- package/dist/production/src/mapper/relations/OneHasManyInputProcessor.js.map +0 -1
- package/dist/production/src/mapper/relations/OneHasOneInverseCreateInputProcessor.cjs.map +0 -1
- package/dist/production/src/mapper/relations/OneHasOneInverseCreateInputProcessor.js.map +0 -1
- package/dist/production/src/mapper/relations/OneHasOneInverseUpdateInputProcessor.cjs +0 -131
- package/dist/production/src/mapper/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +0 -1
- package/dist/production/src/mapper/relations/OneHasOneInverseUpdateInputProcessor.js +0 -131
- package/dist/production/src/mapper/relations/OneHasOneInverseUpdateInputProcessor.js.map +0 -1
- package/dist/production/src/mapper/relations/OneHasOneOwningCreateInputProcessor.cjs +0 -71
- package/dist/production/src/mapper/relations/OneHasOneOwningCreateInputProcessor.cjs.map +0 -1
- package/dist/production/src/mapper/relations/OneHasOneOwningCreateInputProcessor.js +0 -71
- package/dist/production/src/mapper/relations/OneHasOneOwningCreateInputProcessor.js.map +0 -1
- package/dist/production/src/mapper/relations/OneHasOneOwningUpdateInputProcessor.cjs +0 -200
- package/dist/production/src/mapper/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +0 -1
- package/dist/production/src/mapper/relations/OneHasOneOwningUpdateInputProcessor.js +0 -200
- package/dist/production/src/mapper/relations/OneHasOneOwningUpdateInputProcessor.js.map +0 -1
- package/dist/types/mapper/DataManipulationBuilder.d.ts +0 -7
- package/dist/types/mapper/DataManipulationBuilder.d.ts.map +0 -1
- package/dist/types/mapper/relations/ManyHasManyInputProcessor.d.ts +0 -32
- package/dist/types/mapper/relations/ManyHasManyInputProcessor.d.ts.map +0 -1
- package/dist/types/mapper/relations/ManyHasOneInputProcessor.d.ts +0 -32
- package/dist/types/mapper/relations/ManyHasOneInputProcessor.d.ts.map +0 -1
- package/dist/types/mapper/relations/OneHasManyInputProcessor.d.ts +0 -29
- package/dist/types/mapper/relations/OneHasManyInputProcessor.d.ts.map +0 -1
- package/dist/types/mapper/relations/OneHasOneInverseCreateInputProcessor.d.ts +0 -21
- package/dist/types/mapper/relations/OneHasOneInverseCreateInputProcessor.d.ts.map +0 -1
- package/dist/types/mapper/relations/OneHasOneInverseUpdateInputProcessor.d.ts +0 -32
- package/dist/types/mapper/relations/OneHasOneInverseUpdateInputProcessor.d.ts.map +0 -1
- package/dist/types/mapper/relations/OneHasOneOwningCreateInputProcessor.d.ts +0 -21
- package/dist/types/mapper/relations/OneHasOneOwningCreateInputProcessor.d.ts.map +0 -1
- package/dist/types/mapper/relations/OneHasOneOwningUpdateInputProcessor.d.ts +0 -37
- package/dist/types/mapper/relations/OneHasOneOwningUpdateInputProcessor.d.ts.map +0 -1
- package/src/mapper/DataManipulationBuilder.ts +0 -12
- package/src/mapper/relations/ManyHasManyInputProcessor.ts +0 -108
- package/src/mapper/relations/ManyHasOneInputProcessor.ts +0 -158
- package/src/mapper/relations/OneHasManyInputProcessor.ts +0 -101
- package/src/mapper/relations/OneHasOneInverseCreateInputProcessor.ts +0 -99
- package/src/mapper/relations/OneHasOneInverseUpdateInputProcessor.ts +0 -164
- package/src/mapper/relations/OneHasOneOwningCreateInputProcessor.ts +0 -92
- package/src/mapper/relations/OneHasOneOwningUpdateInputProcessor.ts +0 -253
|
@@ -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: () => ({ type: this.orderDirectionEnum }),\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;AAE9E,kBAAA,MAAA,sBAAqB,IAAIC,wBAAgB;AAAA,MAChD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,KAAK,EAAE,OAAO,MAAM;AAAA,QACpB,MAAM,EAAE,OAAO,OAAO;AAAA,QACtB,eAAe,EAAE,OAAO,gBAAgB;AAAA,QACxC,eAAe,EAAE,OAAO,gBAAgB;AAAA,
|
|
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: () => ({ type: this.orderDirectionEnum }),\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;AAE9E,kBAAA,MAAA,sBAAqB,IAAIC,wBAAgB;AAAA,MAChD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,KAAK,EAAE,OAAO,MAAM;AAAA,QACpB,MAAM,EAAE,OAAO,OAAO;AAAA,QACtB,eAAe,EAAE,OAAO,gBAAgB;AAAA,QACxC,eAAe,EAAE,OAAO,gBAAgB;AAAA,MAAA;AAAA,IACzC,CACA,CAAA;AAAA,EAAA;AAAA,EAIM,qBAAqB,YAAsC;AAC1D,WAAA,KAAK,iBAAiB,UAAU;AAAA,EAAA;AAAA,EAGhC,wBAAwB,YAAsC;AACrE,WAAO,IAAIC,QAAAA,uBAAuB;AAAA,MACjC,MAAMC,oBAAc,UAAU;AAAA,MAC9B,QAAQ,MAAM,KAAK,uBAAuB,UAAU;AAAA,IAAA,CACpD;AAAA,EAAA;AAAA,EAGM,uBAAuB,MAAc;AAC5C,UAAM,SAAqC;AAAA,MAC1C,SAAS,EAAE,MAAMC,uBAAe;AAAA,MAChC,eAAe,EAAE,MAAMC,QAAW,WAAA;AAAA,IACnC;AACA,UAAM,SAAS,KAAK,OAAO,SAAS,IAAI;AAE7B,eAAA,aAAa,OAAO,QAAQ;AACtC,UAAI,CAAC,OAAO,OAAO,eAAe,SAAS,GAAG;AAC7C;AAAA,MAAA;AAED,YAAM,gBAAgB,IAAIC,sCAAmBC,OAAAA,IAAI,UAAU,MAAM,KAAK,YAAY;AAClF,UAAI,CAACC,YAAmB,mBAAA,KAAK,QAAQ,MAAM,WAAW,aAAa,GAAG;AACrE;AAAA,MAAA;AAGD,YAAM,QAAQA,YAAAA,mBAAmB,KAAK,QAAQ,MAAM,WAAW;AAAA,QAC9D,aAAa,OAAO,EAAE,MAAM,KAAK,mBAAmB;AAAA,QACpD,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,MAAM,KAAK,qBAAqB,SAAS,MAAM;QACjF,cAAc,MAAM;AAAA,MAAA,CACuC;AAE5D,UAAI,UAAU,QAAW;AACxB,eAAO,SAAS,IAAI;AAAA,MAAA;AAAA,IACrB;AAGM,WAAA;AAAA,EAAA;AAET;;"}
|
|
@@ -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: () => ({ type: this.orderDirectionEnum }),\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;AAE9E,kBAAA,MAAA,sBAAqB,IAAI,gBAAgB;AAAA,MAChD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,KAAK,EAAE,OAAO,MAAM;AAAA,QACpB,MAAM,EAAE,OAAO,OAAO;AAAA,QACtB,eAAe,EAAE,OAAO,gBAAgB;AAAA,QACxC,eAAe,EAAE,OAAO,gBAAgB;AAAA,
|
|
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: () => ({ type: this.orderDirectionEnum }),\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;AAE9E,kBAAA,MAAA,sBAAqB,IAAI,gBAAgB;AAAA,MAChD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,KAAK,EAAE,OAAO,MAAM;AAAA,QACpB,MAAM,EAAE,OAAO,OAAO;AAAA,QACtB,eAAe,EAAE,OAAO,gBAAgB;AAAA,QACxC,eAAe,EAAE,OAAO,gBAAgB;AAAA,MAAA;AAAA,IACzC,CACA,CAAA;AAAA,EAAA;AAAA,EAIM,qBAAqB,YAAsC;AAC1D,WAAA,KAAK,iBAAiB,UAAU;AAAA,EAAA;AAAA,EAGhC,wBAAwB,YAAsC;AACrE,WAAO,IAAI,uBAAuB;AAAA,MACjC,MAAM,cAAc,UAAU;AAAA,MAC9B,QAAQ,MAAM,KAAK,uBAAuB,UAAU;AAAA,IAAA,CACpD;AAAA,EAAA;AAAA,EAGM,uBAAuB,MAAc;AAC5C,UAAM,SAAqC;AAAA,MAC1C,SAAS,EAAE,MAAM,eAAe;AAAA,MAChC,eAAe,EAAE,MAAM,WAAW;AAAA,IACnC;AACA,UAAM,SAAS,KAAK,OAAO,SAAS,IAAI;AAE7B,eAAA,aAAa,OAAO,QAAQ;AACtC,UAAI,CAAC,OAAO,OAAO,eAAe,SAAS,GAAG;AAC7C;AAAA,MAAA;AAED,YAAM,gBAAgB,IAAI,mBAAmB,IAAI,UAAU,MAAM,KAAK,YAAY;AAClF,UAAI,CAAC,mBAAmB,KAAK,QAAQ,MAAM,WAAW,aAAa,GAAG;AACrE;AAAA,MAAA;AAGD,YAAM,QAAQ,mBAAmB,KAAK,QAAQ,MAAM,WAAW;AAAA,QAC9D,aAAa,OAAO,EAAE,MAAM,KAAK,mBAAmB;AAAA,QACpD,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,MAAM,KAAK,qBAAqB,SAAS,MAAM;QACjF,cAAc,MAAM;AAAA,MAAA,CACuC;AAE5D,UAAI,UAAU,QAAW;AACxB,eAAO,SAAS,IAAI;AAAA,MAAA;AAAA,IACrB;AAGM,WAAA;AAAA,EAAA;AAET;"}
|
|
@@ -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,
|
|
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,EAAA;AAAA,EAGlB,kBAAkB,QAAoD;AACrE,UAAM,aAAa,OAAO;AACnB,WAAA;AAAA,MACN,MAAM,IAAIA,QAAAA,eAAe,KAAK,mBAAmB,cAAc,UAAU,CAAC;AAAA,MAE1E,MAAM;AAAA,QACL,QAAQ,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,UAAU,EAAE;AAAA,QACtE,SAAS;AAAA,UACR,MAAM,IAAIC,QAAA,YAAY,IAAID,QAAA,eAAe,KAAK,oBAAoB,qBAAqB,UAAU,CAAC,CAAC;AAAA,QACpG;AAAA,QACA,MAAM,EAAE,MAAME,mBAAW;AAAA,QACzB,OAAO,EAAE,MAAMA,QAAW,WAAA;AAAA,MAAA;AAAA,IAE5B;AAAA,EAAA;AAEF;;"}
|
|
@@ -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,
|
|
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,EAAA;AAAA,EAGlB,kBAAkB,QAAoD;AACrE,UAAM,aAAa,OAAO;AACnB,WAAA;AAAA,MACN,MAAM,IAAI,eAAe,KAAK,mBAAmB,cAAc,UAAU,CAAC;AAAA,MAE1E,MAAM;AAAA,QACL,QAAQ,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,UAAU,EAAE;AAAA,QACtE,SAAS;AAAA,UACR,MAAM,IAAI,YAAY,IAAI,eAAe,KAAK,oBAAoB,qBAAqB,UAAU,CAAC,CAAC;AAAA,QACpG;AAAA,QACA,MAAM,EAAE,MAAM,WAAW;AAAA,QACzB,OAAO,EAAE,MAAM,WAAW;AAAA,MAAA;AAAA,IAE5B;AAAA,EAAA;AAEF;"}
|
|
@@ -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\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,
|
|
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\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":"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"}
|
|
@@ -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\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,
|
|
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\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":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultSchemaTypeProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/ResultSchemaTypeProvider.ts"],"sourcesContent":["import { Result } from '@contember/schema'\nimport {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInt,\n\tGraphQLInterfaceType,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLObjectType,\n\tGraphQLString,\n\tGraphQLUnionType,\n} from 'graphql'\n\nexport class ResultSchemaTypeProvider {\n\tprivate fieldPathFragmentType = new GraphQLObjectType({\n\t\tname: '_FieldPathFragment',\n\t\tfields: {\n\t\t\tfield: { type: new GraphQLNonNull(GraphQLString) },\n\t\t},\n\t})\n\tprivate indexPathFragmentType = new GraphQLObjectType({\n\t\tname: '_IndexPathFragment',\n\t\tfields: {\n\t\t\tindex: { type: new GraphQLNonNull(GraphQLInt) },\n\t\t\talias: { type: GraphQLString },\n\t\t},\n\t})\n\tprivate pathFragmentType = new GraphQLUnionType({\n\t\tname: '_PathFragment',\n\t\ttypes: () => [\n\t\t\tthis.fieldPathFragmentType,\n\t\t\tthis.indexPathFragmentType,\n\t\t],\n\t})\n\n\tprivate validationMessageType = new GraphQLObjectType({\n\t\tname: '_ValidationMessage',\n\t\tfields: {\n\t\t\ttext: { type: new GraphQLNonNull(GraphQLString) },\n\t\t},\n\t})\n\tprivate validationErrorType = new GraphQLObjectType({\n\t\tname: '_ValidationError',\n\t\tfields: {\n\t\t\tpath: {\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType))),\n\t\t\t},\n\t\t\tmessage: {\n\t\t\t\ttype: new GraphQLNonNull(this.validationMessageType),\n\t\t\t},\n\t\t},\n\t})\n\tpublic validationResultType = new GraphQLObjectType({\n\t\tname: '_ValidationResult',\n\t\tfields: {\n\t\t\tvalid: { type: new GraphQLNonNull(GraphQLBoolean) },\n\t\t\terrors: {\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.validationErrorType))),\n\t\t\t},\n\t\t},\n\t})\n\n\tprivate mutationErrorType = new GraphQLEnumType({\n\t\tname: '_MutationErrorType',\n\t\tvalues: Object.values(Result.ExecutionErrorType).reduce((acc, type) => ({ ...acc, [type]: {} }), {}),\n\t})\n\n\tpublic errorResultType = new GraphQLObjectType({\n\t\tname: '_MutationError',\n\t\tfields: {\n\t\t\tpath: {\n\t\t\t\tdeprecationReason: 'Use `paths`.',\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType))),\n\t\t\t},\n\t\t\tpaths: {\n\t\t\t\ttype: new GraphQLNonNull(\n\t\t\t\t\tnew GraphQLList(new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType)))),\n\t\t\t\t),\n\t\t\t},\n\t\t\ttype: {\n\t\t\t\ttype: new GraphQLNonNull(this.mutationErrorType),\n\t\t\t},\n\t\t\tmessage: { type: GraphQLString },\n\t\t},\n\t})\n\n\tpublic errorListResultType = new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.errorResultType)))\n\n\tpublic mutationResultType = new GraphQLInterfaceType({\n\t\tname: 'MutationResult',\n\t\tfields: {\n\t\t\tok: { type: new GraphQLNonNull(GraphQLBoolean) },\n\t\t\terrorMessage: { type: GraphQLString },\n\t\t\terrors: { type: this.errorListResultType },\n\t\t},\n\t})\n}\n"],"names":["GraphQLObjectType","GraphQLNonNull","GraphQLString","GraphQLInt","GraphQLUnionType","GraphQLList","GraphQLBoolean","GraphQLEnumType","Result","GraphQLInterfaceType"],"mappings":";;;;;;;AAaO,MAAM,yBAAyB;AAAA,EAA/B,cAAA;AACE,kBAAA,MAAA,yBAAwB,IAAIA,0BAAkB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,OAAO,EAAE,MAAM,IAAIC,
|
|
1
|
+
{"version":3,"file":"ResultSchemaTypeProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/ResultSchemaTypeProvider.ts"],"sourcesContent":["import { Result } from '@contember/schema'\nimport {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInt,\n\tGraphQLInterfaceType,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLObjectType,\n\tGraphQLString,\n\tGraphQLUnionType,\n} from 'graphql'\n\nexport class ResultSchemaTypeProvider {\n\tprivate fieldPathFragmentType = new GraphQLObjectType({\n\t\tname: '_FieldPathFragment',\n\t\tfields: {\n\t\t\tfield: { type: new GraphQLNonNull(GraphQLString) },\n\t\t},\n\t})\n\tprivate indexPathFragmentType = new GraphQLObjectType({\n\t\tname: '_IndexPathFragment',\n\t\tfields: {\n\t\t\tindex: { type: new GraphQLNonNull(GraphQLInt) },\n\t\t\talias: { type: GraphQLString },\n\t\t},\n\t})\n\tprivate pathFragmentType = new GraphQLUnionType({\n\t\tname: '_PathFragment',\n\t\ttypes: () => [\n\t\t\tthis.fieldPathFragmentType,\n\t\t\tthis.indexPathFragmentType,\n\t\t],\n\t})\n\n\tprivate validationMessageType = new GraphQLObjectType({\n\t\tname: '_ValidationMessage',\n\t\tfields: {\n\t\t\ttext: { type: new GraphQLNonNull(GraphQLString) },\n\t\t},\n\t})\n\tprivate validationErrorType = new GraphQLObjectType({\n\t\tname: '_ValidationError',\n\t\tfields: {\n\t\t\tpath: {\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType))),\n\t\t\t},\n\t\t\tmessage: {\n\t\t\t\ttype: new GraphQLNonNull(this.validationMessageType),\n\t\t\t},\n\t\t},\n\t})\n\tpublic validationResultType = new GraphQLObjectType({\n\t\tname: '_ValidationResult',\n\t\tfields: {\n\t\t\tvalid: { type: new GraphQLNonNull(GraphQLBoolean) },\n\t\t\terrors: {\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.validationErrorType))),\n\t\t\t},\n\t\t},\n\t})\n\n\tprivate mutationErrorType = new GraphQLEnumType({\n\t\tname: '_MutationErrorType',\n\t\tvalues: Object.values(Result.ExecutionErrorType).reduce((acc, type) => ({ ...acc, [type]: {} }), {}),\n\t})\n\n\tpublic errorResultType = new GraphQLObjectType({\n\t\tname: '_MutationError',\n\t\tfields: {\n\t\t\tpath: {\n\t\t\t\tdeprecationReason: 'Use `paths`.',\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType))),\n\t\t\t},\n\t\t\tpaths: {\n\t\t\t\ttype: new GraphQLNonNull(\n\t\t\t\t\tnew GraphQLList(new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType)))),\n\t\t\t\t),\n\t\t\t},\n\t\t\ttype: {\n\t\t\t\ttype: new GraphQLNonNull(this.mutationErrorType),\n\t\t\t},\n\t\t\tmessage: { type: GraphQLString },\n\t\t},\n\t})\n\n\tpublic errorListResultType = new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.errorResultType)))\n\n\tpublic mutationResultType = new GraphQLInterfaceType({\n\t\tname: 'MutationResult',\n\t\tfields: {\n\t\t\tok: { type: new GraphQLNonNull(GraphQLBoolean) },\n\t\t\terrorMessage: { type: GraphQLString },\n\t\t\terrors: { type: this.errorListResultType },\n\t\t},\n\t})\n}\n"],"names":["GraphQLObjectType","GraphQLNonNull","GraphQLString","GraphQLInt","GraphQLUnionType","GraphQLList","GraphQLBoolean","GraphQLEnumType","Result","GraphQLInterfaceType"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultSchemaTypeProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/ResultSchemaTypeProvider.ts"],"sourcesContent":["import { Result } from '@contember/schema'\nimport {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInt,\n\tGraphQLInterfaceType,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLObjectType,\n\tGraphQLString,\n\tGraphQLUnionType,\n} from 'graphql'\n\nexport class ResultSchemaTypeProvider {\n\tprivate fieldPathFragmentType = new GraphQLObjectType({\n\t\tname: '_FieldPathFragment',\n\t\tfields: {\n\t\t\tfield: { type: new GraphQLNonNull(GraphQLString) },\n\t\t},\n\t})\n\tprivate indexPathFragmentType = new GraphQLObjectType({\n\t\tname: '_IndexPathFragment',\n\t\tfields: {\n\t\t\tindex: { type: new GraphQLNonNull(GraphQLInt) },\n\t\t\talias: { type: GraphQLString },\n\t\t},\n\t})\n\tprivate pathFragmentType = new GraphQLUnionType({\n\t\tname: '_PathFragment',\n\t\ttypes: () => [\n\t\t\tthis.fieldPathFragmentType,\n\t\t\tthis.indexPathFragmentType,\n\t\t],\n\t})\n\n\tprivate validationMessageType = new GraphQLObjectType({\n\t\tname: '_ValidationMessage',\n\t\tfields: {\n\t\t\ttext: { type: new GraphQLNonNull(GraphQLString) },\n\t\t},\n\t})\n\tprivate validationErrorType = new GraphQLObjectType({\n\t\tname: '_ValidationError',\n\t\tfields: {\n\t\t\tpath: {\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType))),\n\t\t\t},\n\t\t\tmessage: {\n\t\t\t\ttype: new GraphQLNonNull(this.validationMessageType),\n\t\t\t},\n\t\t},\n\t})\n\tpublic validationResultType = new GraphQLObjectType({\n\t\tname: '_ValidationResult',\n\t\tfields: {\n\t\t\tvalid: { type: new GraphQLNonNull(GraphQLBoolean) },\n\t\t\terrors: {\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.validationErrorType))),\n\t\t\t},\n\t\t},\n\t})\n\n\tprivate mutationErrorType = new GraphQLEnumType({\n\t\tname: '_MutationErrorType',\n\t\tvalues: Object.values(Result.ExecutionErrorType).reduce((acc, type) => ({ ...acc, [type]: {} }), {}),\n\t})\n\n\tpublic errorResultType = new GraphQLObjectType({\n\t\tname: '_MutationError',\n\t\tfields: {\n\t\t\tpath: {\n\t\t\t\tdeprecationReason: 'Use `paths`.',\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType))),\n\t\t\t},\n\t\t\tpaths: {\n\t\t\t\ttype: new GraphQLNonNull(\n\t\t\t\t\tnew GraphQLList(new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType)))),\n\t\t\t\t),\n\t\t\t},\n\t\t\ttype: {\n\t\t\t\ttype: new GraphQLNonNull(this.mutationErrorType),\n\t\t\t},\n\t\t\tmessage: { type: GraphQLString },\n\t\t},\n\t})\n\n\tpublic errorListResultType = new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.errorResultType)))\n\n\tpublic mutationResultType = new GraphQLInterfaceType({\n\t\tname: 'MutationResult',\n\t\tfields: {\n\t\t\tok: { type: new GraphQLNonNull(GraphQLBoolean) },\n\t\t\terrorMessage: { type: GraphQLString },\n\t\t\terrors: { type: this.errorListResultType },\n\t\t},\n\t})\n}\n"],"names":[],"mappings":";;;;;AAaO,MAAM,yBAAyB;AAAA,EAA/B,cAAA;AACE,kBAAA,MAAA,yBAAwB,IAAI,kBAAkB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,OAAO,EAAE,MAAM,IAAI,eAAe,aAAa,EAAE;AAAA,
|
|
1
|
+
{"version":3,"file":"ResultSchemaTypeProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/ResultSchemaTypeProvider.ts"],"sourcesContent":["import { Result } from '@contember/schema'\nimport {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInt,\n\tGraphQLInterfaceType,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLObjectType,\n\tGraphQLString,\n\tGraphQLUnionType,\n} from 'graphql'\n\nexport class ResultSchemaTypeProvider {\n\tprivate fieldPathFragmentType = new GraphQLObjectType({\n\t\tname: '_FieldPathFragment',\n\t\tfields: {\n\t\t\tfield: { type: new GraphQLNonNull(GraphQLString) },\n\t\t},\n\t})\n\tprivate indexPathFragmentType = new GraphQLObjectType({\n\t\tname: '_IndexPathFragment',\n\t\tfields: {\n\t\t\tindex: { type: new GraphQLNonNull(GraphQLInt) },\n\t\t\talias: { type: GraphQLString },\n\t\t},\n\t})\n\tprivate pathFragmentType = new GraphQLUnionType({\n\t\tname: '_PathFragment',\n\t\ttypes: () => [\n\t\t\tthis.fieldPathFragmentType,\n\t\t\tthis.indexPathFragmentType,\n\t\t],\n\t})\n\n\tprivate validationMessageType = new GraphQLObjectType({\n\t\tname: '_ValidationMessage',\n\t\tfields: {\n\t\t\ttext: { type: new GraphQLNonNull(GraphQLString) },\n\t\t},\n\t})\n\tprivate validationErrorType = new GraphQLObjectType({\n\t\tname: '_ValidationError',\n\t\tfields: {\n\t\t\tpath: {\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType))),\n\t\t\t},\n\t\t\tmessage: {\n\t\t\t\ttype: new GraphQLNonNull(this.validationMessageType),\n\t\t\t},\n\t\t},\n\t})\n\tpublic validationResultType = new GraphQLObjectType({\n\t\tname: '_ValidationResult',\n\t\tfields: {\n\t\t\tvalid: { type: new GraphQLNonNull(GraphQLBoolean) },\n\t\t\terrors: {\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.validationErrorType))),\n\t\t\t},\n\t\t},\n\t})\n\n\tprivate mutationErrorType = new GraphQLEnumType({\n\t\tname: '_MutationErrorType',\n\t\tvalues: Object.values(Result.ExecutionErrorType).reduce((acc, type) => ({ ...acc, [type]: {} }), {}),\n\t})\n\n\tpublic errorResultType = new GraphQLObjectType({\n\t\tname: '_MutationError',\n\t\tfields: {\n\t\t\tpath: {\n\t\t\t\tdeprecationReason: 'Use `paths`.',\n\t\t\t\ttype: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType))),\n\t\t\t},\n\t\t\tpaths: {\n\t\t\t\ttype: new GraphQLNonNull(\n\t\t\t\t\tnew GraphQLList(new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.pathFragmentType)))),\n\t\t\t\t),\n\t\t\t},\n\t\t\ttype: {\n\t\t\t\ttype: new GraphQLNonNull(this.mutationErrorType),\n\t\t\t},\n\t\t\tmessage: { type: GraphQLString },\n\t\t},\n\t})\n\n\tpublic errorListResultType = new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(this.errorResultType)))\n\n\tpublic mutationResultType = new GraphQLInterfaceType({\n\t\tname: 'MutationResult',\n\t\tfields: {\n\t\t\tok: { type: new GraphQLNonNull(GraphQLBoolean) },\n\t\t\terrorMessage: { type: GraphQLString },\n\t\t\terrors: { type: this.errorListResultType },\n\t\t},\n\t})\n}\n"],"names":[],"mappings":";;;;;AAaO,MAAM,yBAAyB;AAAA,EAA/B,cAAA;AACE,kBAAA,MAAA,yBAAwB,IAAI,kBAAkB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,OAAO,EAAE,MAAM,IAAI,eAAe,aAAa,EAAE;AAAA,MAAA;AAAA,IAClD,CACA,CAAA;AACO,kBAAA,MAAA,yBAAwB,IAAI,kBAAkB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,OAAO,EAAE,MAAM,IAAI,eAAe,UAAU,EAAE;AAAA,QAC9C,OAAO,EAAE,MAAM,cAAc;AAAA,MAAA;AAAA,IAC9B,CACA,CAAA;AACO,kBAAA,MAAA,oBAAmB,IAAI,iBAAiB;AAAA,MAC/C,MAAM;AAAA,MACN,OAAO,MAAM;AAAA,QACZ,KAAK;AAAA,QACL,KAAK;AAAA,MAAA;AAAA,IACN,CACA,CAAA;AAEO,kBAAA,MAAA,yBAAwB,IAAI,kBAAkB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,MAAM,EAAE,MAAM,IAAI,eAAe,aAAa,EAAE;AAAA,MAAA;AAAA,IACjD,CACA,CAAA;AACO,kBAAA,MAAA,uBAAsB,IAAI,kBAAkB;AAAA,MACnD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,MAAM;AAAA,UACL,MAAM,IAAI,eAAe,IAAI,YAAY,IAAI,eAAe,KAAK,gBAAgB,CAAC,CAAC;AAAA,QACpF;AAAA,QACA,SAAS;AAAA,UACR,MAAM,IAAI,eAAe,KAAK,qBAAqB;AAAA,QAAA;AAAA,MACpD;AAAA,IACD,CACA,CAAA;AACM,kBAAA,MAAA,wBAAuB,IAAI,kBAAkB;AAAA,MACnD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,OAAO,EAAE,MAAM,IAAI,eAAe,cAAc,EAAE;AAAA,QAClD,QAAQ;AAAA,UACP,MAAM,IAAI,eAAe,IAAI,YAAY,IAAI,eAAe,KAAK,mBAAmB,CAAC,CAAC;AAAA,QAAA;AAAA,MACvF;AAAA,IACD,CACA,CAAA;AAEO,kBAAA,MAAA,qBAAoB,IAAI,gBAAgB;AAAA,MAC/C,MAAM;AAAA,MACN,QAAQ,OAAO,OAAO,OAAO,kBAAkB,EAAE,OAAO,CAAC,KAAK,UAAU,EAAE,GAAG,KAAK,CAAC,IAAI,GAAG,CAAA,EAAG,IAAI,CAAE,CAAA;AAAA,IAAA,CACnG,CAAA;AAEM,kBAAA,MAAA,mBAAkB,IAAI,kBAAkB;AAAA,MAC9C,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,MAAM;AAAA,UACL,mBAAmB;AAAA,UACnB,MAAM,IAAI,eAAe,IAAI,YAAY,IAAI,eAAe,KAAK,gBAAgB,CAAC,CAAC;AAAA,QACpF;AAAA,QACA,OAAO;AAAA,UACN,MAAM,IAAI;AAAA,YACT,IAAI,YAAY,IAAI,eAAe,IAAI,YAAY,IAAI,eAAe,KAAK,gBAAgB,CAAC,CAAC,CAAC;AAAA,UAAA;AAAA,QAEhG;AAAA,QACA,MAAM;AAAA,UACL,MAAM,IAAI,eAAe,KAAK,iBAAiB;AAAA,QAChD;AAAA,QACA,SAAS,EAAE,MAAM,cAAc;AAAA,MAAA;AAAA,IAChC,CACA,CAAA;AAEM,kBAAA,MAAA,uBAAsB,IAAI,eAAe,IAAI,YAAY,IAAI,eAAe,KAAK,eAAe,CAAC,CAAC,CAAA;AAElG,kBAAA,MAAA,sBAAqB,IAAI,qBAAqB;AAAA,MACpD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,IAAI,EAAE,MAAM,IAAI,eAAe,cAAc,EAAE;AAAA,QAC/C,cAAc,EAAE,MAAM,cAAc;AAAA,QACpC,QAAQ,EAAE,MAAM,KAAK,oBAAoB;AAAA,MAAA;AAAA,IAC1C,CACA,CAAA;AAAA,EAAA;AACF;"}
|
|
@@ -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}`, () =>\n\t\t\t\t\tcontext.executionContainer.validationResolver.validateCreate(entity, args),\n\t\t\t\t),\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}`, () =>\n\t\t\t\t\tcontext.executionContainer.validationResolver.validateUpdate(entity, args),\n\t\t\t\t),\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,
|
|
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}`, () =>\n\t\t\t\t\tcontext.executionContainer.validationResolver.validateCreate(entity, args),\n\t\t\t\t),\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}`, () =>\n\t\t\t\t\tcontext.executionContainer.validationResolver.validateUpdate(entity, args),\n\t\t\t\t),\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,EAAA;AAAA,EAGX,WAAW,QAAiE;AAClF,UAAM,aAAa,OAAO;AAC1B,UAAM,cAAqE,CAAC;AAC5E,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,EAAA;AAAA,EAGxF,uBAAuB,QAAkE;AAChG,UAAM,aAAa,OAAO;AAC1B,UAAM,WAAW,KAAK,0BAA0B,SAAS,UAAU;AACnE,QAAI,aAAa,QAAW;AACpB,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,MACN,MAAM,IAAIC,QAAe,eAAA,KAAK,yBAAyB,oBAAoB;AAAA,MAC3E,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,IAAIA,QAAAA,eAAe,QAAQ,EAAE;AAAA,MAC5C;AAAA,MACA,SAAS,CAAC,QAAQ,MAAM,SAAkB,SACzC,QAAQ;AAAA,QAAM,iBAAiB,KAAK,SAAS;AAAA,QAAI,MAChD,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI;AAAA,MAAA;AAAA,IAE5E;AAAA,EAAA;AAAA,EAGO,uBAAuB,QAAkE;AAChG,UAAM,aAAa,OAAO;AAC1B,UAAM,WAAW,KAAK,0BAA0B,SAAS,UAAU;AACnE,QAAI,aAAa,QAAW;AACpB,aAAA;AAAA,IAAA;AAER,UAAM,cAAc,KAAK,kBAAkB,yBAAyB,UAAU;AAC9E,QAAI,CAAC,aAAa;AACV,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,MACN,MAAM,IAAIA,QAAe,eAAA,KAAK,yBAAyB,oBAAoB;AAAA,MAC3E,MAAM;AAAA,QACL,IAAI;AAAA,UACH,MAAM,IAAIA,QAAAA,eAAe,WAAW;AAAA,QACrC;AAAA,QACA,MAAM,EAAE,MAAM,IAAIA,QAAAA,eAAe,QAAQ,EAAE;AAAA,MAC5C;AAAA,MACA,SAAS,CAAC,QAAQ,MAAM,SAAkB,SACzC,QAAQ;AAAA,QAAM,iBAAiB,KAAK,SAAS;AAAA,QAAI,MAChD,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI;AAAA,MAAA;AAAA,IAE5E;AAAA,EAAA;AAEF;;"}
|
|
@@ -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}`, () =>\n\t\t\t\t\tcontext.executionContainer.validationResolver.validateCreate(entity, args),\n\t\t\t\t),\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}`, () =>\n\t\t\t\t\tcontext.executionContainer.validationResolver.validateUpdate(entity, args),\n\t\t\t\t),\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,
|
|
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}`, () =>\n\t\t\t\t\tcontext.executionContainer.validationResolver.validateCreate(entity, args),\n\t\t\t\t),\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}`, () =>\n\t\t\t\t\tcontext.executionContainer.validationResolver.validateUpdate(entity, args),\n\t\t\t\t),\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,EAAA;AAAA,EAGX,WAAW,QAAiE;AAClF,UAAM,aAAa,OAAO;AAC1B,UAAM,cAAqE,CAAC;AAC5E,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,EAAA;AAAA,EAGxF,uBAAuB,QAAkE;AAChG,UAAM,aAAa,OAAO;AAC1B,UAAM,WAAW,KAAK,0BAA0B,SAAS,UAAU;AACnE,QAAI,aAAa,QAAW;AACpB,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,MACN,MAAM,IAAI,eAAe,KAAK,yBAAyB,oBAAoB;AAAA,MAC3E,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,IAAI,eAAe,QAAQ,EAAE;AAAA,MAC5C;AAAA,MACA,SAAS,CAAC,QAAQ,MAAM,SAAkB,SACzC,QAAQ;AAAA,QAAM,iBAAiB,KAAK,SAAS;AAAA,QAAI,MAChD,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI;AAAA,MAAA;AAAA,IAE5E;AAAA,EAAA;AAAA,EAGO,uBAAuB,QAAkE;AAChG,UAAM,aAAa,OAAO;AAC1B,UAAM,WAAW,KAAK,0BAA0B,SAAS,UAAU;AACnE,QAAI,aAAa,QAAW;AACpB,aAAA;AAAA,IAAA;AAER,UAAM,cAAc,KAAK,kBAAkB,yBAAyB,UAAU;AAC9E,QAAI,CAAC,aAAa;AACV,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,MACN,MAAM,IAAI,eAAe,KAAK,yBAAyB,oBAAoB;AAAA,MAC3E,MAAM;AAAA,QACL,IAAI;AAAA,UACH,MAAM,IAAI,eAAe,WAAW;AAAA,QACrC;AAAA,QACA,MAAM,EAAE,MAAM,IAAI,eAAe,QAAQ,EAAE;AAAA,MAC5C;AAAA,MACA,SAAS,CAAC,QAAQ,MAAM,SAAkB,SACzC,QAAQ;AAAA,QAAM,iBAAiB,KAAK,SAAS;AAAA,QAAI,MAChD,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI;AAAA,MAAA;AAAA,IAE5E;AAAA,EAAA;AAEF;"}
|
|
@@ -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 =>\n\t\t\t\tacceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator)),\n\t\t\t),\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) }),\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,sBAAsB,IAAI,CAAC,CAAA;AAClF,kBAAA,MAAQ,wBAAuBA,kCAAiB,CAAA,SAAQ,KAAK,4BAA4B,IAAI,CAAC,CAAA;AAAA,
|
|
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 =>\n\t\t\t\tacceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator)),\n\t\t\t),\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) }),\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":"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"}
|
|
@@ -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 =>\n\t\t\t\tacceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator)),\n\t\t\t),\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) }),\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,4BAA4B,IAAI,CAAC,CAAA;AAAA,
|
|
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 =>\n\t\t\t\tacceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator)),\n\t\t\t),\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) }),\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":"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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 implements\n\tModel.ColumnVisitor<GraphQLFieldConfigArgumentMap | undefined>,\n\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,iBAEkE;AAAA,EAE9E,YACkB,mBACA,qBAChB;AAFgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AAEjB,SAAK,oBAAoB;AAAA,
|
|
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 implements\n\tModel.ColumnVisitor<GraphQLFieldConfigArgumentMap | undefined>,\n\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,iBAEkE;AAAA,EAE9E,YACkB,mBACA,qBAChB;AAFgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AAEjB,SAAK,oBAAoB;AAAA,EAAA;AAAA,EAGnB,cAAc;AACb,WAAA;AAAA,EAAA;AAAA,EAGD,aAAa,EAAE,YAA6C;AAC5D,UAAA,SAAS,KAAK,YAAY,QAAQ;AAClC,UAAA,UAAU,KAAK,eAAe,QAAQ;AACrC,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,QAAQ,EAAE,MAAMA,mBAAW;AAAA,MAC3B,OAAO,EAAE,MAAMA,QAAW,WAAA;AAAA,IAC3B;AAAA,EAAA;AAAA,EAGM,YAAY,EAAE,YAAqC;AACnD,UAAA,SAAS,KAAK,YAAY,QAAQ;AACxC,WAAO,EAAE,OAAO;AAAA,EAAA;AAAA,EAGT,YAAY,UAA0B;AAC7C,WAAO,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,SAAS,MAAM,EAAE;AAAA,EAAA;AAAA,EAGnE,eAAe,UAA0B;AACzC,WAAA;AAAA,MACN,MAAM,IAAIC,oBAAY,IAAIC,uBAAe,KAAK,oBAAoB,qBAAqB,SAAS,MAAM,CAAC,CAAC;AAAA,IACzG;AAAA,EAAA;AAEF;;"}
|
|
@@ -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 implements\n\tModel.ColumnVisitor<GraphQLFieldConfigArgumentMap | undefined>,\n\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,iBAEkE;AAAA,EAE9E,YACkB,mBACA,qBAChB;AAFgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AAEjB,SAAK,oBAAoB;AAAA,
|
|
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 implements\n\tModel.ColumnVisitor<GraphQLFieldConfigArgumentMap | undefined>,\n\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,iBAEkE;AAAA,EAE9E,YACkB,mBACA,qBAChB;AAFgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AAEjB,SAAK,oBAAoB;AAAA,EAAA;AAAA,EAGnB,cAAc;AACb,WAAA;AAAA,EAAA;AAAA,EAGD,aAAa,EAAE,YAA6C;AAC5D,UAAA,SAAS,KAAK,YAAY,QAAQ;AAClC,UAAA,UAAU,KAAK,eAAe,QAAQ;AACrC,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC3B,OAAO,EAAE,MAAM,WAAW;AAAA,IAC3B;AAAA,EAAA;AAAA,EAGM,YAAY,EAAE,YAAqC;AACnD,UAAA,SAAS,KAAK,YAAY,QAAQ;AACxC,WAAO,EAAE,OAAO;AAAA,EAAA;AAAA,EAGT,YAAY,UAA0B;AAC7C,WAAO,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,SAAS,MAAM,EAAE;AAAA,EAAA;AAAA,EAGnE,eAAe,UAA0B;AACzC,WAAA;AAAA,MACN,MAAM,IAAI,YAAY,IAAI,eAAe,KAAK,oBAAoB,qBAAqB,SAAS,MAAM,CAAC,CAAC;AAAA,IACzG;AAAA,EAAA;AAEF;"}
|
|
@@ -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 basicType = 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(basicType)\n\t\t}\n\t\treturn basicType\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,
|
|
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 basicType = 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(basicType)\n\t\t}\n\t\treturn basicType\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,EAAA;AAAA,EAIX,YAAY,EAAE,QAAQ,UAAkD;AAC9E,UAAM,YAAY,KAAK,mBAAmB,QAAQ,MAAM;AAClD,UAAA,iBAAiB,KAAK,aAAa,kBAAkBA,OAAA,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,IAAI;AACjG,UAAA,cAAc,KAAK,aAAa,kBAAkBA,OAAA,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,OAAO;AACnG,QAAA,CAAC,kBAAkB,CAAC,aAAa;AACpC,YAAM,IAAIC,UAAAA,wBAAwB;AAAA,IAAA;AAEnC,QAAI,CAAC,OAAO,aAAa,mBAAmB,QAAQ,mBAAmB,cAAc;AAC7E,aAAA,IAAIC,uBAAe,SAAS;AAAA,IAAA;AAE7B,WAAA;AAAA,EAAA;AAAA,EAGD,aAAa,EAAE,YAAgE;AACrF,UAAM,aAAa,KAAK,mBAAmB,UAAU,SAAS,MAAM;AAC7D,WAAA,IAAIA,uBAAe,IAAIC,QAAAA,YAAY,IAAID,QAAe,eAAA,UAAU,CAAC,CAAC;AAAA,EAAA;AAAA,EAGnE,YAAY,EAAE,YAA+D;AACnF,WAAO,KAAK,mBAAmB,UAAU,SAAS,MAAM;AAAA,EAAA;AAE1D;;"}
|
|
@@ -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 basicType = 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(basicType)\n\t\t}\n\t\treturn basicType\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,
|
|
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 basicType = 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(basicType)\n\t\t}\n\t\treturn basicType\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,EAAA;AAAA,EAIX,YAAY,EAAE,QAAQ,UAAkD;AAC9E,UAAM,YAAY,KAAK,mBAAmB,QAAQ,MAAM;AAClD,UAAA,iBAAiB,KAAK,aAAa,kBAAkB,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,IAAI;AACjG,UAAA,cAAc,KAAK,aAAa,kBAAkB,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,OAAO;AACnG,QAAA,CAAC,kBAAkB,CAAC,aAAa;AACpC,YAAM,IAAI,wBAAwB;AAAA,IAAA;AAEnC,QAAI,CAAC,OAAO,aAAa,mBAAmB,QAAQ,mBAAmB,cAAc;AAC7E,aAAA,IAAI,eAAe,SAAS;AAAA,IAAA;AAE7B,WAAA;AAAA,EAAA;AAAA,EAGD,aAAa,EAAE,YAAgE;AACrF,UAAM,aAAa,KAAK,mBAAmB,UAAU,SAAS,MAAM;AAC7D,WAAA,IAAI,eAAe,IAAI,YAAY,IAAI,eAAe,UAAU,CAAC,CAAC;AAAA,EAAA;AAAA,EAGnE,YAAY,EAAE,YAA+D;AACnF,WAAO,KAAK,mBAAmB,UAAU,SAAS,MAAM;AAAA,EAAA;AAE1D;"}
|
|
@@ -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\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\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;AALV,kBAAA,MAAA,UAASA,kCAA+C,CAAM,OAAA,KAAK,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,
|
|
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\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\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;AALV,kBAAA,MAAA,UAASA,kCAA+C,CAAM,OAAA,KAAK,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAAA;AAAA,EAUtH,SAAS,YAAoB,cAAsB;AAClD,WAAO,KAAK,OAAO,EAAE,YAAY,cAAc;AAAA,EAAA;AAAA,EAGxC,YAAY,YAAoB,cAAsB;AAC7D,WAAOC,YAA2C,mBAAA,KAAK,QAAQ,YAAY,cAAc;AAAA,MACxF,cAAc;AACb,cAAM,IAAIC,UAAAA,wBAAwB;AAAA,MACnC;AAAA,MACA,eAAe,CAAC,EAAE,QAAQ,cAAc,gBAAgB,eAAe;AACtE,cAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AAC9E,cAAA,aAAa,iBAAiB,eAAe,OAAO;AACpD,cAAA,cAAc,KAAK,kCAAkC,MAAM,SAAS,aAAa,MAAM,UAAU;AACnG,YAAA,CAAC,eAAe,CAAC,aAAa;AACjC,gBAAM,IAAIA,UAAAA,wBAAwB;AAAA,QAAA;AAGnC,eAAO,IAAIC,QAAAA,uBAAuB;AAAA,UACjC,MAAMC,MAAAA,cAAc,OAAO,IAAI,kBAAkB,SAAS,IAAI;AAAA,UAC9D,QAAQ,OAAO;AAAA,YACd,SAAS,EAAE,MAAM,IAAIC,QAAA,eAAe,WAAW,EAAE;AAAA,YACjD,QAAQ,EAAE,MAAM,IAAIA,QAAAA,eAAe,WAAW,EAAE;AAAA,UACjD;AAAA,QAAA,CACA;AAAA,MAAA;AAAA,IACF,CACA;AAAA,EAAA;AAGH;;"}
|
|
@@ -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\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\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAcO,MAAM,qCAAqC;AAAA,EAGjD,YACkB,QACA,kBACA,mCAChB;AAHgB,SAAA,SAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AALV,kBAAA,MAAA,UAAS,iBAA+C,CAAM,OAAA,KAAK,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,
|
|
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\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\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAcO,MAAM,qCAAqC;AAAA,EAGjD,YACkB,QACA,kBACA,mCAChB;AAHgB,SAAA,SAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AALV,kBAAA,MAAA,UAAS,iBAA+C,CAAM,OAAA,KAAK,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAAA;AAAA,EAUtH,SAAS,YAAoB,cAAsB;AAClD,WAAO,KAAK,OAAO,EAAE,YAAY,cAAc;AAAA,EAAA;AAAA,EAGxC,YAAY,YAAoB,cAAsB;AAC7D,WAAO,mBAA2C,KAAK,QAAQ,YAAY,cAAc;AAAA,MACxF,cAAc;AACb,cAAM,IAAI,wBAAwB;AAAA,MACnC;AAAA,MACA,eAAe,CAAC,EAAE,QAAQ,cAAc,gBAAgB,eAAe;AACtE,cAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AAC9E,cAAA,aAAa,iBAAiB,eAAe,OAAO;AACpD,cAAA,cAAc,KAAK,kCAAkC,MAAM,SAAS,aAAa,MAAM,UAAU;AACnG,YAAA,CAAC,eAAe,CAAC,aAAa;AACjC,gBAAM,IAAI,wBAAwB;AAAA,QAAA;AAGnC,eAAO,IAAI,uBAAuB;AAAA,UACjC,MAAM,cAAc,OAAO,IAAI,kBAAkB,SAAS,IAAI;AAAA,UAC9D,QAAQ,OAAO;AAAA,YACd,SAAS,EAAE,MAAM,IAAI,eAAe,WAAW,EAAE;AAAA,YACjD,QAAQ,EAAE,MAAM,IAAI,eAAe,WAAW,EAAE;AAAA,UACjD;AAAA,QAAA,CACA;AAAA,MAAA;AAAA,IACF,CACA;AAAA,EAAA;AAGH;"}
|
|
@@ -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 implements\n\tModel.ColumnVisitor<GraphQLInputFieldConfig | undefined>,\n\tModel.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,8BAE4D;AAAA,EAExE,YACkBA,SACA,cACA,oBACA,mCAChB;AAJgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,
|
|
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 implements\n\tModel.ColumnVisitor<GraphQLInputFieldConfig | undefined>,\n\tModel.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,8BAE4D;AAAA,EAExE,YACkBA,SACA,cACA,oBACA,mCAChB;AAJgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EAAA;AAAA,EAGX,YAAY,EAAE,QAAQ,UAAoE;AAC5F,QAAA,OAAO,YAAY,OAAO,QAAQ,CAAC,KAAK,aAAa,uBAAuB,OAAO,IAAI,GAAG;AACtF,aAAA;AAAA,IAAA;AAEJ,QAAA,KAAK,aAAa,oBAAoBC,OAAI,IAAA,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AAC5F,aAAA;AAAA,IAAA;AAER,UAAM,OAAO,KAAK,mBAAmB,QAAQ,MAAM;AACnD,WAAO,EAAE,KAAK;AAAA,EAAA;AAAA,EAGR,YAAY,EAAE,QAAQ,YAAiF;AAC7G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AAChB,aAAA;AAAA,IAAA;AAER,WAAO,EAAE,KAAK;AAAA,EAAA;AAAA,EAGR,aAAa,EAAE,QAAQ,YAAkF;AAC/G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AAChB,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,MACN,MAAM,IAAIC,QAAAA,YAAY,IAAIC,QAAAA,eAAe,IAAI,CAAC;AAAA,IAC/C;AAAA,EAAA;AAEF;;"}
|
|
@@ -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 implements\n\tModel.ColumnVisitor<GraphQLInputFieldConfig | undefined>,\n\tModel.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,8BAE4D;AAAA,EAExE,YACkB,QACA,cACA,oBACA,mCAChB;AAJgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,
|
|
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 implements\n\tModel.ColumnVisitor<GraphQLInputFieldConfig | undefined>,\n\tModel.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,8BAE4D;AAAA,EAExE,YACkB,QACA,cACA,oBACA,mCAChB;AAJgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EAAA;AAAA,EAGX,YAAY,EAAE,QAAQ,UAAoE;AAC5F,QAAA,OAAO,YAAY,OAAO,QAAQ,CAAC,KAAK,aAAa,uBAAuB,OAAO,IAAI,GAAG;AACtF,aAAA;AAAA,IAAA;AAEJ,QAAA,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AAC5F,aAAA;AAAA,IAAA;AAER,UAAM,OAAO,KAAK,mBAAmB,QAAQ,MAAM;AACnD,WAAO,EAAE,KAAK;AAAA,EAAA;AAAA,EAGR,YAAY,EAAE,QAAQ,YAAiF;AAC7G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AAChB,aAAA;AAAA,IAAA;AAER,WAAO,EAAE,KAAK;AAAA,EAAA;AAAA,EAGR,aAAa,EAAE,QAAQ,YAAkF;AAC/G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AAChB,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,MACN,MAAM,IAAI,YAAY,IAAI,eAAe,IAAI,CAAC;AAAA,IAC/C;AAAA,EAAA;AAEF;"}
|
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 implements\n\tModel.ColumnVisitor<never>,\n\tModel.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,6CAEiD;AAAA,EAE7D,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,
|
|
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 implements\n\tModel.ColumnVisitor<never>,\n\tModel.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,6CAEiD;AAAA,EAE7D,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAAA;AAAA,EAE7B,cAAqB;AACd,UAAA,IAAIA,kCAAwB,2EAA2E;AAAA,EAAA;AAAA,EAGvG,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAAA;AAAA,EAGrE,uBAAuB,EAAE,QAAQ,cAAc,YAA4C;AACjG,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAAA;AAAA,EAGzD,gBAAgB,EAAE,cAAc,kBAA2C;AACjF,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAAA;AAAA,EAGrE,gBAAgB,EAAE,cAAc,QAAQ,YAAqC;AACnF,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAAA;AAAA,EAGzD,sBAAsB,EAAE,cAAc,gBAAgB,YAA2C;AACvG,UAAM,aAAa,KAAK,qBAAqB,cAAc,cAAc,cAAc;AACnF,QAAA,SAAS,YAAY,eAAe,UAAU;AAC1C,aAAA;AAAA,IAAA;AAER,WAAO,WAAW,OAAO,CAAA,OAAM,OAAOC,OAAA,MAAM,wBAAwB,MAAM;AAAA,EAAA;AAAA,EAGpE,qBAAqB,EAAE,cAAc,QAAQ,UAAU,kBAAgD;AAC7G,UAAM,aAAa,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAC3E,QAAI,CAAC,kBAAkB,eAAe,YAAY,SAAS,UAAU;AAC7D,aAAA;AAAA,IAAA;AAER,WAAO,WAAW,OAAO,CAAA,OAAM,OAAOA,OAAA,MAAM,wBAAwB,MAAM;AAAA,EAAA;AAAA,EAGnE,qBACP,cACA,cACA,gBACkC;AAClC,UAAM,SAA0C,CAAC;AAE3C,UAAA,sBAAsB,KAAK,aAAa,oBAAoBC,OAAAA,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM;AACvG,UAAA,wBAAwB,KAAK,aAAa,oBAAoBA,OAAAA,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AAC3G,UAAA,kBAAkB,KAAK,aAAa,oBAAoBA,OAAAA,IAAI,UAAU,QAAQ,aAAa,MAAM,eAAe,IAAI,MAAM;AAEhI,QAAI,uBAAuB,iBAAiB;AACpC,aAAA,KAAKD,aAAM,wBAAwB,OAAO;AAAA,IAAA;AAElD,QAAI,yBAAyB,iBAAiB;AACtC,aAAA,KAAKA,aAAM,wBAAwB,MAAM;AAAA,IAAA;AAE7C,QAAA,uBAAuB,yBAAyB,iBAAiB;AAC7D,aAAA,KAAKA,aAAM,wBAAwB,eAAe;AAAA,IAAA;AAGnD,WAAA;AAAA,EAAA;AAET;;"}
|
package/dist/production/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateEntityRelationAllowedOperationsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class CreateEntityRelationAllowedOperationsVisitor implements\n\tModel.ColumnVisitor<never>,\n\tModel.RelationByTypeVisitor<Input.CreateRelationOperation[]> {\n\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetEntity, targetRelation }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, entity, relation }: Model.ManyHasOneContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasOneInverse({ targetEntity, targetRelation, relation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (!targetRelation || targetRelation.nullable || relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.CreateRelationOperation[] {\n\t\tconst result: Input.CreateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canCreateOwning = this.authorizator.getFieldPermissions(Acl.Operation.create, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connect)\n\t\t}\n\t\tif (canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.create)\n\t\t}\n\t\tif (canReadTargetEntity && canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,6CAEiD;AAAA,EAE7D,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CreateEntityRelationAllowedOperationsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class CreateEntityRelationAllowedOperationsVisitor implements\n\tModel.ColumnVisitor<never>,\n\tModel.RelationByTypeVisitor<Input.CreateRelationOperation[]> {\n\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetEntity, targetRelation }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, entity, relation }: Model.ManyHasOneContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasOneInverse({ targetEntity, targetRelation, relation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (!targetRelation || targetRelation.nullable || relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.CreateRelationOperation[] {\n\t\tconst result: Input.CreateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canCreateOwning = this.authorizator.getFieldPermissions(Acl.Operation.create, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connect)\n\t\t}\n\t\tif (canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.create)\n\t\t}\n\t\tif (canReadTargetEntity && canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,6CAEiD;AAAA,EAE7D,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAAA;AAAA,EAE7B,cAAqB;AACd,UAAA,IAAI,wBAAwB,2EAA2E;AAAA,EAAA;AAAA,EAGvG,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAAA;AAAA,EAGrE,uBAAuB,EAAE,QAAQ,cAAc,YAA4C;AACjG,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAAA;AAAA,EAGzD,gBAAgB,EAAE,cAAc,kBAA2C;AACjF,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAAA;AAAA,EAGrE,gBAAgB,EAAE,cAAc,QAAQ,YAAqC;AACnF,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAAA;AAAA,EAGzD,sBAAsB,EAAE,cAAc,gBAAgB,YAA2C;AACvG,UAAM,aAAa,KAAK,qBAAqB,cAAc,cAAc,cAAc;AACnF,QAAA,SAAS,YAAY,eAAe,UAAU;AAC1C,aAAA;AAAA,IAAA;AAER,WAAO,WAAW,OAAO,CAAA,OAAM,OAAO,MAAM,wBAAwB,MAAM;AAAA,EAAA;AAAA,EAGpE,qBAAqB,EAAE,cAAc,QAAQ,UAAU,kBAAgD;AAC7G,UAAM,aAAa,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAC3E,QAAI,CAAC,kBAAkB,eAAe,YAAY,SAAS,UAAU;AAC7D,aAAA;AAAA,IAAA;AAER,WAAO,WAAW,OAAO,CAAA,OAAM,OAAO,MAAM,wBAAwB,MAAM;AAAA,EAAA;AAAA,EAGnE,qBACP,cACA,cACA,gBACkC;AAClC,UAAM,SAA0C,CAAC;AAE3C,UAAA,sBAAsB,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM;AACvG,UAAA,wBAAwB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AAC3G,UAAA,kBAAkB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,MAAM,eAAe,IAAI,MAAM;AAEhI,QAAI,uBAAuB,iBAAiB;AACpC,aAAA,KAAK,MAAM,wBAAwB,OAAO;AAAA,IAAA;AAElD,QAAI,yBAAyB,iBAAiB;AACtC,aAAA,KAAK,MAAM,wBAAwB,MAAM;AAAA,IAAA;AAE7C,QAAA,uBAAuB,yBAAyB,iBAAiB;AAC7D,aAAA,KAAK,MAAM,wBAAwB,eAAe;AAAA,IAAA;AAGnD,WAAA;AAAA,EAAA;AAET;"}
|