@contember/engine-content-api 2.1.0-alpha.8 → 2.1.0-beta.1

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.
Files changed (1019) hide show
  1. package/CLAUDE.md +54 -0
  2. package/dist/development/index.cjs +0 -2
  3. package/dist/development/index.cjs.map +1 -1
  4. package/dist/development/index.js +0 -2
  5. package/dist/development/index.js.map +1 -1
  6. package/dist/development/src/ExecutionContainer.cjs +82 -29
  7. package/dist/development/src/ExecutionContainer.cjs.map +1 -1
  8. package/dist/development/src/ExecutionContainer.js +82 -29
  9. package/dist/development/src/ExecutionContainer.js.map +1 -1
  10. package/dist/development/src/acl/Authorizator.cjs.map +1 -1
  11. package/dist/development/src/acl/Authorizator.js.map +1 -1
  12. package/dist/development/src/acl/EvaluatedPredicateReplacer.cjs.map +1 -1
  13. package/dist/development/src/acl/EvaluatedPredicateReplacer.js.map +1 -1
  14. package/dist/development/src/acl/PermissionFactory.cjs.map +1 -1
  15. package/dist/development/src/acl/PermissionFactory.js.map +1 -1
  16. package/dist/development/src/acl/PredicateFactory.cjs.map +1 -1
  17. package/dist/development/src/acl/PredicateFactory.js.map +1 -1
  18. package/dist/development/src/acl/PredicatesInjector.cjs +101 -12
  19. package/dist/development/src/acl/PredicatesInjector.cjs.map +1 -1
  20. package/dist/development/src/acl/PredicatesInjector.js +101 -12
  21. package/dist/development/src/acl/PredicatesInjector.js.map +1 -1
  22. package/dist/development/src/acl/VariableInjector.cjs.map +1 -1
  23. package/dist/development/src/acl/VariableInjector.js.map +1 -1
  24. package/dist/development/src/acl/VariableUtils.cjs.map +1 -1
  25. package/dist/development/src/acl/VariableUtils.js.map +1 -1
  26. package/dist/development/src/exception.cjs.map +1 -1
  27. package/dist/development/src/exception.js.map +1 -1
  28. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.cjs.map +1 -1
  29. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.js.map +1 -1
  30. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs.map +1 -1
  31. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js.map +1 -1
  32. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs +4 -4
  33. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
  34. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js +4 -4
  35. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js.map +1 -1
  36. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.cjs.map +1 -1
  37. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.js.map +1 -1
  38. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs.map +1 -1
  39. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js.map +1 -1
  40. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.cjs.map +1 -1
  41. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.js.map +1 -1
  42. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs.map +1 -1
  43. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js.map +1 -1
  44. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.cjs.map +1 -1
  45. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.js.map +1 -1
  46. package/dist/development/src/input-validation/ColumnValueResolver.cjs.map +1 -1
  47. package/dist/development/src/input-validation/ColumnValueResolver.js.map +1 -1
  48. package/dist/development/src/input-validation/EntityRulesResolver.cjs.map +1 -1
  49. package/dist/development/src/input-validation/EntityRulesResolver.js.map +1 -1
  50. package/dist/development/src/input-validation/QueryAstFactory.cjs.map +1 -1
  51. package/dist/development/src/input-validation/QueryAstFactory.js.map +1 -1
  52. package/dist/development/src/input-validation/ValidationContext.cjs.map +1 -1
  53. package/dist/development/src/input-validation/ValidationContext.js.map +1 -1
  54. package/dist/development/src/input-validation/ValidationDataSelector.cjs.map +1 -1
  55. package/dist/development/src/input-validation/ValidationDataSelector.js.map +1 -1
  56. package/dist/development/src/input-validation/ValidationEvaluation.cjs.map +1 -1
  57. package/dist/development/src/input-validation/ValidationEvaluation.js.map +1 -1
  58. package/dist/development/src/input-validation/ValidationPath.cjs.map +1 -1
  59. package/dist/development/src/input-validation/ValidationPath.js.map +1 -1
  60. package/dist/development/src/input-validation/dependencies/DependencyCollector.cjs +3 -3
  61. package/dist/development/src/input-validation/dependencies/DependencyCollector.cjs.map +1 -1
  62. package/dist/development/src/input-validation/dependencies/DependencyCollector.js +3 -3
  63. package/dist/development/src/input-validation/dependencies/DependencyCollector.js.map +1 -1
  64. package/dist/development/src/input-validation/dependencies/DependencyMerger.cjs.map +1 -1
  65. package/dist/development/src/input-validation/dependencies/DependencyMerger.js.map +1 -1
  66. package/dist/development/src/input-validation/preValidation/CreateInputPreValidationProcessor.cjs.map +1 -1
  67. package/dist/development/src/input-validation/preValidation/CreateInputPreValidationProcessor.js.map +1 -1
  68. package/dist/development/src/input-validation/preValidation/InputPreValidator.cjs +2 -4
  69. package/dist/development/src/input-validation/preValidation/InputPreValidator.cjs.map +1 -1
  70. package/dist/development/src/input-validation/preValidation/InputPreValidator.js +2 -4
  71. package/dist/development/src/input-validation/preValidation/InputPreValidator.js.map +1 -1
  72. package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs.map +1 -1
  73. package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js.map +1 -1
  74. package/dist/development/src/inputProcessing/CreateInputVisitor.cjs +6 -4
  75. package/dist/development/src/inputProcessing/CreateInputVisitor.cjs.map +1 -1
  76. package/dist/development/src/inputProcessing/CreateInputVisitor.js +6 -4
  77. package/dist/development/src/inputProcessing/CreateInputVisitor.js.map +1 -1
  78. package/dist/development/src/inputProcessing/FieldNode.cjs.map +1 -1
  79. package/dist/development/src/inputProcessing/FieldNode.js.map +1 -1
  80. package/dist/development/src/inputProcessing/ObjectNode.cjs.map +1 -1
  81. package/dist/development/src/inputProcessing/ObjectNode.js.map +1 -1
  82. package/dist/development/src/inputProcessing/UniqueWhereExpander.cjs.map +1 -1
  83. package/dist/development/src/inputProcessing/UniqueWhereExpander.js.map +1 -1
  84. package/dist/development/src/inputProcessing/UpdateInputVisitor.cjs +7 -5
  85. package/dist/development/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
  86. package/dist/development/src/inputProcessing/UpdateInputVisitor.js +7 -5
  87. package/dist/development/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
  88. package/dist/development/src/introspection/IntrospectionSchemaDefinitionFactory.cjs.map +1 -1
  89. package/dist/development/src/introspection/IntrospectionSchemaDefinitionFactory.js.map +1 -1
  90. package/dist/development/src/introspection/IntrospectionSchemaFactory.cjs.map +1 -1
  91. package/dist/development/src/introspection/IntrospectionSchemaFactory.js.map +1 -1
  92. package/dist/development/src/introspection/content-schema.types.cjs.map +1 -1
  93. package/dist/development/src/introspection/content-schema.types.js.map +1 -1
  94. package/dist/development/src/introspection/introspection.schema.cjs.map +1 -1
  95. package/dist/development/src/introspection/introspection.schema.js.map +1 -1
  96. package/dist/development/src/mapper/CheckedPrimary.cjs.map +1 -1
  97. package/dist/development/src/mapper/CheckedPrimary.js.map +1 -1
  98. package/dist/development/src/mapper/ColumnValue.cjs.map +1 -1
  99. package/dist/development/src/mapper/ColumnValue.js.map +1 -1
  100. package/dist/development/src/mapper/ErrorUtils.cjs.map +1 -1
  101. package/dist/development/src/mapper/ErrorUtils.js +1 -1
  102. package/dist/development/src/mapper/ErrorUtils.js.map +1 -1
  103. package/dist/development/src/mapper/EventManager.cjs.map +1 -1
  104. package/dist/development/src/mapper/EventManager.js.map +1 -1
  105. package/dist/development/src/mapper/JunctionTableManager.cjs +16 -2
  106. package/dist/development/src/mapper/JunctionTableManager.cjs.map +1 -1
  107. package/dist/development/src/mapper/JunctionTableManager.js +17 -3
  108. package/dist/development/src/mapper/JunctionTableManager.js.map +1 -1
  109. package/dist/development/src/mapper/Mapper.cjs +8 -7
  110. package/dist/development/src/mapper/Mapper.cjs.map +1 -1
  111. package/dist/development/src/mapper/Mapper.js +8 -7
  112. package/dist/development/src/mapper/Mapper.js.map +1 -1
  113. package/dist/development/src/mapper/MapperFactory.cjs.map +1 -1
  114. package/dist/development/src/mapper/MapperFactory.js.map +1 -1
  115. package/dist/development/src/mapper/MutationProcessorHelper.cjs.map +1 -1
  116. package/dist/development/src/mapper/MutationProcessorHelper.js.map +1 -1
  117. package/dist/development/src/mapper/Result.cjs +1 -1
  118. package/dist/development/src/mapper/Result.cjs.map +1 -1
  119. package/dist/development/src/mapper/Result.js +1 -1
  120. package/dist/development/src/mapper/Result.js.map +1 -1
  121. package/dist/development/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
  122. package/dist/development/src/mapper/delete/DeleteExecutor.js.map +1 -1
  123. package/dist/development/src/mapper/delete/DeleteState.cjs.map +1 -1
  124. package/dist/development/src/mapper/delete/DeleteState.js.map +1 -1
  125. package/dist/development/src/mapper/delete/DeletedEntitiesStorage.cjs.map +1 -1
  126. package/dist/development/src/mapper/delete/DeletedEntitiesStorage.js.map +1 -1
  127. package/dist/development/src/mapper/delete/helpers.cjs.map +1 -1
  128. package/dist/development/src/mapper/delete/helpers.js.map +1 -1
  129. package/dist/development/src/mapper/insert/InsertBuilder.cjs +27 -31
  130. package/dist/development/src/mapper/insert/InsertBuilder.cjs.map +1 -1
  131. package/dist/development/src/mapper/insert/InsertBuilder.js +27 -31
  132. package/dist/development/src/mapper/insert/InsertBuilder.js.map +1 -1
  133. package/dist/development/src/mapper/insert/InsertBuilderFactory.cjs.map +1 -1
  134. package/dist/development/src/mapper/insert/InsertBuilderFactory.js.map +1 -1
  135. package/dist/development/src/mapper/insert/Inserter.cjs.map +1 -1
  136. package/dist/development/src/mapper/insert/Inserter.js.map +1 -1
  137. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
  138. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
  139. package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -1
  140. package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -1
  141. package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -1
  142. package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -1
  143. package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -1
  144. package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -1
  145. package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -1
  146. package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -1
  147. package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -1
  148. package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -1
  149. package/dist/development/src/mapper/select/ConditionBuilder.cjs +7 -5
  150. package/dist/development/src/mapper/select/ConditionBuilder.cjs.map +1 -1
  151. package/dist/development/src/mapper/select/ConditionBuilder.js +8 -6
  152. package/dist/development/src/mapper/select/ConditionBuilder.js.map +1 -1
  153. package/dist/development/src/mapper/select/JoinBuilder.cjs.map +1 -1
  154. package/dist/development/src/mapper/select/JoinBuilder.js.map +1 -1
  155. package/dist/development/src/mapper/select/JoinVisitor.cjs.map +1 -1
  156. package/dist/development/src/mapper/select/JoinVisitor.js.map +1 -1
  157. package/dist/development/src/mapper/select/OrderByBuilder.cjs.map +1 -1
  158. package/dist/development/src/mapper/select/OrderByBuilder.js.map +1 -1
  159. package/dist/development/src/mapper/select/OrderByHelper.cjs.map +1 -1
  160. package/dist/development/src/mapper/select/OrderByHelper.js.map +1 -1
  161. package/dist/development/src/mapper/select/Path.cjs.map +1 -1
  162. package/dist/development/src/mapper/select/Path.js.map +1 -1
  163. package/dist/development/src/mapper/select/RelationFetcher.cjs.map +1 -1
  164. package/dist/development/src/mapper/select/RelationFetcher.js.map +1 -1
  165. package/dist/development/src/mapper/select/SelectBuilder.cjs +7 -10
  166. package/dist/development/src/mapper/select/SelectBuilder.cjs.map +1 -1
  167. package/dist/development/src/mapper/select/SelectBuilder.js +7 -10
  168. package/dist/development/src/mapper/select/SelectBuilder.js.map +1 -1
  169. package/dist/development/src/mapper/select/SelectHydrator.cjs +1 -1
  170. package/dist/development/src/mapper/select/SelectHydrator.cjs.map +1 -1
  171. package/dist/development/src/mapper/select/SelectHydrator.js +1 -1
  172. package/dist/development/src/mapper/select/SelectHydrator.js.map +1 -1
  173. package/dist/development/src/mapper/select/WhereBuilder.cjs +20 -18
  174. package/dist/development/src/mapper/select/WhereBuilder.cjs.map +1 -1
  175. package/dist/development/src/mapper/select/WhereBuilder.js +20 -18
  176. package/dist/development/src/mapper/select/WhereBuilder.js.map +1 -1
  177. package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs +1 -1
  178. package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
  179. package/dist/development/src/mapper/select/handlers/FieldsVisitor.js +1 -1
  180. package/dist/development/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
  181. package/dist/development/src/mapper/select/handlers/FieldsVisitorFactory.cjs.map +1 -1
  182. package/dist/development/src/mapper/select/handlers/FieldsVisitorFactory.js.map +1 -1
  183. package/dist/development/src/mapper/select/handlers/MetaHandler.cjs.map +1 -1
  184. package/dist/development/src/mapper/select/handlers/MetaHandler.js.map +1 -1
  185. package/dist/development/src/mapper/select/optimizer/ConditionOptimizer.cjs.map +1 -1
  186. package/dist/development/src/mapper/select/optimizer/ConditionOptimizer.js.map +1 -1
  187. package/dist/development/src/mapper/select/optimizer/WhereOptimizer.cjs +7 -3
  188. package/dist/development/src/mapper/select/optimizer/WhereOptimizer.cjs.map +1 -1
  189. package/dist/development/src/mapper/select/optimizer/WhereOptimizer.js +7 -3
  190. package/dist/development/src/mapper/select/optimizer/WhereOptimizer.js.map +1 -1
  191. package/dist/development/src/mapper/select/optimizer/WhereReplacer.cjs.map +1 -1
  192. package/dist/development/src/mapper/select/optimizer/WhereReplacer.js.map +1 -1
  193. package/dist/development/src/mapper/select/optimizer/helpers.cjs.map +1 -1
  194. package/dist/development/src/mapper/select/optimizer/helpers.js.map +1 -1
  195. package/dist/development/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
  196. package/dist/development/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
  197. package/dist/development/src/mapper/update/UpdateBuilder.cjs +64 -68
  198. package/dist/development/src/mapper/update/UpdateBuilder.cjs.map +1 -1
  199. package/dist/development/src/mapper/update/UpdateBuilder.js +64 -68
  200. package/dist/development/src/mapper/update/UpdateBuilder.js.map +1 -1
  201. package/dist/development/src/mapper/update/UpdateBuilderFactory.cjs.map +1 -1
  202. package/dist/development/src/mapper/update/UpdateBuilderFactory.js.map +1 -1
  203. package/dist/development/src/mapper/update/Updater.cjs +15 -3
  204. package/dist/development/src/mapper/update/Updater.cjs.map +1 -1
  205. package/dist/development/src/mapper/update/Updater.js +16 -4
  206. package/dist/development/src/mapper/update/Updater.js.map +1 -1
  207. package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -1
  208. package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -1
  209. package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -1
  210. package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -1
  211. package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -1
  212. package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -1
  213. package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -1
  214. package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -1
  215. package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -1
  216. package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -1
  217. package/dist/development/src/resolvers/GraphQlQueryAstFactory.cjs.map +1 -1
  218. package/dist/development/src/resolvers/GraphQlQueryAstFactory.js.map +1 -1
  219. package/dist/development/src/resolvers/MutationResolver.cjs.map +1 -1
  220. package/dist/development/src/resolvers/MutationResolver.js.map +1 -1
  221. package/dist/development/src/resolvers/ReadHelpers.cjs.map +1 -1
  222. package/dist/development/src/resolvers/ReadHelpers.js.map +1 -1
  223. package/dist/development/src/resolvers/ReadResolver.cjs.map +1 -1
  224. package/dist/development/src/resolvers/ReadResolver.js.map +1 -1
  225. package/dist/development/src/resolvers/RefreshViewResolver.cjs.map +1 -1
  226. package/dist/development/src/resolvers/RefreshViewResolver.js.map +1 -1
  227. package/dist/development/src/resolvers/ValidationResolver.cjs.map +1 -1
  228. package/dist/development/src/resolvers/ValidationResolver.js.map +1 -1
  229. package/dist/development/src/schema/ColumnTypeResolver.cjs.map +1 -1
  230. package/dist/development/src/schema/ColumnTypeResolver.js.map +1 -1
  231. package/dist/development/src/schema/ConditionTypeProvider.cjs +2 -0
  232. package/dist/development/src/schema/ConditionTypeProvider.cjs.map +1 -1
  233. package/dist/development/src/schema/ConditionTypeProvider.js +3 -1
  234. package/dist/development/src/schema/ConditionTypeProvider.js.map +1 -1
  235. package/dist/development/src/schema/CustomTypesProvider.cjs.map +1 -1
  236. package/dist/development/src/schema/CustomTypesProvider.js.map +1 -1
  237. package/dist/development/src/schema/EntityTypeProvider.cjs +1 -3
  238. package/dist/development/src/schema/EntityTypeProvider.cjs.map +1 -1
  239. package/dist/development/src/schema/EntityTypeProvider.js +1 -3
  240. package/dist/development/src/schema/EntityTypeProvider.js.map +1 -1
  241. package/dist/development/src/schema/EnumsProvider.cjs.map +1 -1
  242. package/dist/development/src/schema/EnumsProvider.js.map +1 -1
  243. package/dist/development/src/schema/FieldAccessVisitor.cjs.map +1 -1
  244. package/dist/development/src/schema/FieldAccessVisitor.js.map +1 -1
  245. package/dist/development/src/schema/GraphQlSchemaBuilder.cjs +5 -11
  246. package/dist/development/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
  247. package/dist/development/src/schema/GraphQlSchemaBuilder.js +5 -11
  248. package/dist/development/src/schema/GraphQlSchemaBuilder.js.map +1 -1
  249. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.cjs +103 -3
  250. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
  251. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.js +103 -3
  252. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
  253. package/dist/development/src/schema/MutationProvider.cjs.map +1 -1
  254. package/dist/development/src/schema/MutationProvider.js +2 -2
  255. package/dist/development/src/schema/MutationProvider.js.map +1 -1
  256. package/dist/development/src/schema/OperationExtension.cjs +0 -1
  257. package/dist/development/src/schema/OperationExtension.cjs.map +1 -1
  258. package/dist/development/src/schema/OperationExtension.js +0 -1
  259. package/dist/development/src/schema/OperationExtension.js.map +1 -1
  260. package/dist/development/src/schema/OrderByTypeProvider.cjs.map +1 -1
  261. package/dist/development/src/schema/OrderByTypeProvider.js +1 -1
  262. package/dist/development/src/schema/OrderByTypeProvider.js.map +1 -1
  263. package/dist/development/src/schema/PaginatedFieldConfigFactory.cjs.map +1 -1
  264. package/dist/development/src/schema/PaginatedFieldConfigFactory.js +1 -1
  265. package/dist/development/src/schema/PaginatedFieldConfigFactory.js.map +1 -1
  266. package/dist/development/src/schema/QueryProvider.cjs.map +1 -1
  267. package/dist/development/src/schema/QueryProvider.js +2 -2
  268. package/dist/development/src/schema/QueryProvider.js.map +1 -1
  269. package/dist/development/src/schema/RefreshViewMutationProvider.cjs.map +1 -1
  270. package/dist/development/src/schema/RefreshViewMutationProvider.js.map +1 -1
  271. package/dist/development/src/schema/ResultSchemaTypeProvider.cjs.map +1 -1
  272. package/dist/development/src/schema/ResultSchemaTypeProvider.js.map +1 -1
  273. package/dist/development/src/schema/ValidationQueriesProvider.cjs +2 -8
  274. package/dist/development/src/schema/ValidationQueriesProvider.cjs.map +1 -1
  275. package/dist/development/src/schema/ValidationQueriesProvider.js +2 -8
  276. package/dist/development/src/schema/ValidationQueriesProvider.js.map +1 -1
  277. package/dist/development/src/schema/WhereTypeProvider.cjs +1 -3
  278. package/dist/development/src/schema/WhereTypeProvider.cjs.map +1 -1
  279. package/dist/development/src/schema/WhereTypeProvider.js +1 -3
  280. package/dist/development/src/schema/WhereTypeProvider.js.map +1 -1
  281. package/dist/development/src/schema/entities/FieldArgsVisitor.cjs.map +1 -1
  282. package/dist/development/src/schema/entities/FieldArgsVisitor.js.map +1 -1
  283. package/dist/development/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
  284. package/dist/development/src/schema/entities/FieldTypeVisitor.js.map +1 -1
  285. package/dist/development/src/schema/mutations/ConnectOrCreateRelationInputProvider.cjs.map +1 -1
  286. package/dist/development/src/schema/mutations/ConnectOrCreateRelationInputProvider.js.map +1 -1
  287. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
  288. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
  289. package/dist/development/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
  290. package/dist/development/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.js.map +1 -1
  291. package/dist/development/src/schema/mutations/CreateEntityRelationInputFieldVisitor.cjs.map +1 -1
  292. package/dist/development/src/schema/mutations/CreateEntityRelationInputFieldVisitor.js.map +1 -1
  293. package/dist/development/src/schema/mutations/CreateEntityRelationInputProvider.cjs.map +1 -1
  294. package/dist/development/src/schema/mutations/CreateEntityRelationInputProvider.js.map +1 -1
  295. package/dist/development/src/schema/mutations/EntityInputProvider.cjs.map +1 -1
  296. package/dist/development/src/schema/mutations/EntityInputProvider.js.map +1 -1
  297. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
  298. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
  299. package/dist/development/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
  300. package/dist/development/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.js.map +1 -1
  301. package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
  302. package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js +1 -1
  303. package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js.map +1 -1
  304. package/dist/development/src/schema/mutations/UpdateEntityRelationInputProvider.cjs.map +1 -1
  305. package/dist/development/src/schema/mutations/UpdateEntityRelationInputProvider.js.map +1 -1
  306. package/dist/development/src/schema/utils.cjs.map +1 -1
  307. package/dist/development/src/schema/utils.js.map +1 -1
  308. package/dist/development/src/utils/Mutex.cjs.map +1 -1
  309. package/dist/development/src/utils/Mutex.js.map +1 -1
  310. package/dist/development/src/utils/ResolveInfoUtils.cjs.map +1 -1
  311. package/dist/development/src/utils/ResolveInfoUtils.js.map +1 -1
  312. package/dist/development/src/utils/accessor.cjs.map +1 -1
  313. package/dist/development/src/utils/accessor.js.map +1 -1
  314. package/dist/development/src/utils/assertNever.cjs.map +1 -1
  315. package/dist/development/src/utils/assertNever.js.map +1 -1
  316. package/dist/development/src/utils/isIt.cjs.map +1 -1
  317. package/dist/development/src/utils/isIt.js.map +1 -1
  318. package/dist/development/src/utils/object.cjs.map +1 -1
  319. package/dist/development/src/utils/object.js.map +1 -1
  320. package/dist/development/src/utils/paginationUtils.cjs.map +1 -1
  321. package/dist/development/src/utils/paginationUtils.js.map +1 -1
  322. package/dist/development/src/utils/promises.cjs.map +1 -1
  323. package/dist/development/src/utils/promises.js.map +1 -1
  324. package/dist/development/src/utils/singletonFactory.cjs.map +1 -1
  325. package/dist/development/src/utils/singletonFactory.js.map +1 -1
  326. package/dist/development/src/utils/strings.cjs.map +1 -1
  327. package/dist/development/src/utils/strings.js.map +1 -1
  328. package/dist/development/src/utils/tuple.cjs.map +1 -1
  329. package/dist/development/src/utils/tuple.js.map +1 -1
  330. package/dist/development/src/utils/uniqueWhereFields.cjs.map +1 -1
  331. package/dist/development/src/utils/uniqueWhereFields.js.map +1 -1
  332. package/dist/development/src/utils/viewComputedId.cjs.map +1 -1
  333. package/dist/development/src/utils/viewComputedId.js.map +1 -1
  334. package/dist/production/index.cjs +0 -2
  335. package/dist/production/index.cjs.map +1 -1
  336. package/dist/production/index.js +0 -2
  337. package/dist/production/index.js.map +1 -1
  338. package/dist/production/src/ExecutionContainer.cjs +82 -29
  339. package/dist/production/src/ExecutionContainer.cjs.map +1 -1
  340. package/dist/production/src/ExecutionContainer.js +82 -29
  341. package/dist/production/src/ExecutionContainer.js.map +1 -1
  342. package/dist/production/src/acl/Authorizator.cjs.map +1 -1
  343. package/dist/production/src/acl/Authorizator.js.map +1 -1
  344. package/dist/production/src/acl/EvaluatedPredicateReplacer.cjs.map +1 -1
  345. package/dist/production/src/acl/EvaluatedPredicateReplacer.js.map +1 -1
  346. package/dist/production/src/acl/PermissionFactory.cjs.map +1 -1
  347. package/dist/production/src/acl/PermissionFactory.js.map +1 -1
  348. package/dist/production/src/acl/PredicateFactory.cjs.map +1 -1
  349. package/dist/production/src/acl/PredicateFactory.js.map +1 -1
  350. package/dist/production/src/acl/PredicatesInjector.cjs +101 -12
  351. package/dist/production/src/acl/PredicatesInjector.cjs.map +1 -1
  352. package/dist/production/src/acl/PredicatesInjector.js +101 -12
  353. package/dist/production/src/acl/PredicatesInjector.js.map +1 -1
  354. package/dist/production/src/acl/VariableInjector.cjs.map +1 -1
  355. package/dist/production/src/acl/VariableInjector.js.map +1 -1
  356. package/dist/production/src/acl/VariableUtils.cjs.map +1 -1
  357. package/dist/production/src/acl/VariableUtils.js.map +1 -1
  358. package/dist/production/src/exception.cjs.map +1 -1
  359. package/dist/production/src/exception.js.map +1 -1
  360. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.cjs.map +1 -1
  361. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.js.map +1 -1
  362. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs.map +1 -1
  363. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js.map +1 -1
  364. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs +4 -4
  365. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
  366. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js +4 -4
  367. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js.map +1 -1
  368. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.cjs.map +1 -1
  369. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.js.map +1 -1
  370. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs.map +1 -1
  371. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js.map +1 -1
  372. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.cjs.map +1 -1
  373. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.js.map +1 -1
  374. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs.map +1 -1
  375. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js.map +1 -1
  376. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.cjs.map +1 -1
  377. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.js.map +1 -1
  378. package/dist/production/src/input-validation/ColumnValueResolver.cjs.map +1 -1
  379. package/dist/production/src/input-validation/ColumnValueResolver.js.map +1 -1
  380. package/dist/production/src/input-validation/EntityRulesResolver.cjs.map +1 -1
  381. package/dist/production/src/input-validation/EntityRulesResolver.js.map +1 -1
  382. package/dist/production/src/input-validation/QueryAstFactory.cjs.map +1 -1
  383. package/dist/production/src/input-validation/QueryAstFactory.js.map +1 -1
  384. package/dist/production/src/input-validation/ValidationContext.cjs.map +1 -1
  385. package/dist/production/src/input-validation/ValidationContext.js.map +1 -1
  386. package/dist/production/src/input-validation/ValidationDataSelector.cjs.map +1 -1
  387. package/dist/production/src/input-validation/ValidationDataSelector.js.map +1 -1
  388. package/dist/production/src/input-validation/ValidationEvaluation.cjs.map +1 -1
  389. package/dist/production/src/input-validation/ValidationEvaluation.js.map +1 -1
  390. package/dist/production/src/input-validation/ValidationPath.cjs.map +1 -1
  391. package/dist/production/src/input-validation/ValidationPath.js.map +1 -1
  392. package/dist/production/src/input-validation/dependencies/DependencyCollector.cjs +3 -3
  393. package/dist/production/src/input-validation/dependencies/DependencyCollector.cjs.map +1 -1
  394. package/dist/production/src/input-validation/dependencies/DependencyCollector.js +3 -3
  395. package/dist/production/src/input-validation/dependencies/DependencyCollector.js.map +1 -1
  396. package/dist/production/src/input-validation/dependencies/DependencyMerger.cjs.map +1 -1
  397. package/dist/production/src/input-validation/dependencies/DependencyMerger.js.map +1 -1
  398. package/dist/production/src/input-validation/preValidation/CreateInputPreValidationProcessor.cjs.map +1 -1
  399. package/dist/production/src/input-validation/preValidation/CreateInputPreValidationProcessor.js.map +1 -1
  400. package/dist/production/src/input-validation/preValidation/InputPreValidator.cjs +2 -4
  401. package/dist/production/src/input-validation/preValidation/InputPreValidator.cjs.map +1 -1
  402. package/dist/production/src/input-validation/preValidation/InputPreValidator.js +2 -4
  403. package/dist/production/src/input-validation/preValidation/InputPreValidator.js.map +1 -1
  404. package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs.map +1 -1
  405. package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js.map +1 -1
  406. package/dist/production/src/inputProcessing/CreateInputVisitor.cjs +6 -4
  407. package/dist/production/src/inputProcessing/CreateInputVisitor.cjs.map +1 -1
  408. package/dist/production/src/inputProcessing/CreateInputVisitor.js +6 -4
  409. package/dist/production/src/inputProcessing/CreateInputVisitor.js.map +1 -1
  410. package/dist/production/src/inputProcessing/FieldNode.cjs.map +1 -1
  411. package/dist/production/src/inputProcessing/FieldNode.js.map +1 -1
  412. package/dist/production/src/inputProcessing/ObjectNode.cjs.map +1 -1
  413. package/dist/production/src/inputProcessing/ObjectNode.js.map +1 -1
  414. package/dist/production/src/inputProcessing/UniqueWhereExpander.cjs.map +1 -1
  415. package/dist/production/src/inputProcessing/UniqueWhereExpander.js.map +1 -1
  416. package/dist/production/src/inputProcessing/UpdateInputVisitor.cjs +7 -5
  417. package/dist/production/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
  418. package/dist/production/src/inputProcessing/UpdateInputVisitor.js +7 -5
  419. package/dist/production/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
  420. package/dist/production/src/introspection/IntrospectionSchemaDefinitionFactory.cjs.map +1 -1
  421. package/dist/production/src/introspection/IntrospectionSchemaDefinitionFactory.js.map +1 -1
  422. package/dist/production/src/introspection/IntrospectionSchemaFactory.cjs.map +1 -1
  423. package/dist/production/src/introspection/IntrospectionSchemaFactory.js.map +1 -1
  424. package/dist/production/src/introspection/content-schema.types.cjs.map +1 -1
  425. package/dist/production/src/introspection/content-schema.types.js.map +1 -1
  426. package/dist/production/src/introspection/introspection.schema.cjs.map +1 -1
  427. package/dist/production/src/introspection/introspection.schema.js.map +1 -1
  428. package/dist/production/src/mapper/CheckedPrimary.cjs.map +1 -1
  429. package/dist/production/src/mapper/CheckedPrimary.js.map +1 -1
  430. package/dist/production/src/mapper/ColumnValue.cjs.map +1 -1
  431. package/dist/production/src/mapper/ColumnValue.js.map +1 -1
  432. package/dist/production/src/mapper/ErrorUtils.cjs.map +1 -1
  433. package/dist/production/src/mapper/ErrorUtils.js +1 -1
  434. package/dist/production/src/mapper/ErrorUtils.js.map +1 -1
  435. package/dist/production/src/mapper/EventManager.cjs.map +1 -1
  436. package/dist/production/src/mapper/EventManager.js.map +1 -1
  437. package/dist/production/src/mapper/JunctionTableManager.cjs +16 -2
  438. package/dist/production/src/mapper/JunctionTableManager.cjs.map +1 -1
  439. package/dist/production/src/mapper/JunctionTableManager.js +17 -3
  440. package/dist/production/src/mapper/JunctionTableManager.js.map +1 -1
  441. package/dist/production/src/mapper/Mapper.cjs +8 -7
  442. package/dist/production/src/mapper/Mapper.cjs.map +1 -1
  443. package/dist/production/src/mapper/Mapper.js +8 -7
  444. package/dist/production/src/mapper/Mapper.js.map +1 -1
  445. package/dist/production/src/mapper/MapperFactory.cjs.map +1 -1
  446. package/dist/production/src/mapper/MapperFactory.js.map +1 -1
  447. package/dist/production/src/mapper/MutationProcessorHelper.cjs.map +1 -1
  448. package/dist/production/src/mapper/MutationProcessorHelper.js.map +1 -1
  449. package/dist/production/src/mapper/Result.cjs +1 -1
  450. package/dist/production/src/mapper/Result.cjs.map +1 -1
  451. package/dist/production/src/mapper/Result.js +1 -1
  452. package/dist/production/src/mapper/Result.js.map +1 -1
  453. package/dist/production/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
  454. package/dist/production/src/mapper/delete/DeleteExecutor.js.map +1 -1
  455. package/dist/production/src/mapper/delete/DeleteState.cjs.map +1 -1
  456. package/dist/production/src/mapper/delete/DeleteState.js.map +1 -1
  457. package/dist/production/src/mapper/delete/DeletedEntitiesStorage.cjs.map +1 -1
  458. package/dist/production/src/mapper/delete/DeletedEntitiesStorage.js.map +1 -1
  459. package/dist/production/src/mapper/delete/helpers.cjs.map +1 -1
  460. package/dist/production/src/mapper/delete/helpers.js.map +1 -1
  461. package/dist/production/src/mapper/insert/InsertBuilder.cjs +27 -31
  462. package/dist/production/src/mapper/insert/InsertBuilder.cjs.map +1 -1
  463. package/dist/production/src/mapper/insert/InsertBuilder.js +27 -31
  464. package/dist/production/src/mapper/insert/InsertBuilder.js.map +1 -1
  465. package/dist/production/src/mapper/insert/InsertBuilderFactory.cjs.map +1 -1
  466. package/dist/production/src/mapper/insert/InsertBuilderFactory.js.map +1 -1
  467. package/dist/production/src/mapper/insert/Inserter.cjs.map +1 -1
  468. package/dist/production/src/mapper/insert/Inserter.js.map +1 -1
  469. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
  470. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
  471. package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -1
  472. package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -1
  473. package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -1
  474. package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -1
  475. package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -1
  476. package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -1
  477. package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -1
  478. package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -1
  479. package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -1
  480. package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -1
  481. package/dist/production/src/mapper/select/ConditionBuilder.cjs +7 -5
  482. package/dist/production/src/mapper/select/ConditionBuilder.cjs.map +1 -1
  483. package/dist/production/src/mapper/select/ConditionBuilder.js +8 -6
  484. package/dist/production/src/mapper/select/ConditionBuilder.js.map +1 -1
  485. package/dist/production/src/mapper/select/JoinBuilder.cjs.map +1 -1
  486. package/dist/production/src/mapper/select/JoinBuilder.js.map +1 -1
  487. package/dist/production/src/mapper/select/JoinVisitor.cjs.map +1 -1
  488. package/dist/production/src/mapper/select/JoinVisitor.js.map +1 -1
  489. package/dist/production/src/mapper/select/OrderByBuilder.cjs.map +1 -1
  490. package/dist/production/src/mapper/select/OrderByBuilder.js.map +1 -1
  491. package/dist/production/src/mapper/select/OrderByHelper.cjs.map +1 -1
  492. package/dist/production/src/mapper/select/OrderByHelper.js.map +1 -1
  493. package/dist/production/src/mapper/select/Path.cjs.map +1 -1
  494. package/dist/production/src/mapper/select/Path.js.map +1 -1
  495. package/dist/production/src/mapper/select/RelationFetcher.cjs.map +1 -1
  496. package/dist/production/src/mapper/select/RelationFetcher.js.map +1 -1
  497. package/dist/production/src/mapper/select/SelectBuilder.cjs +7 -10
  498. package/dist/production/src/mapper/select/SelectBuilder.cjs.map +1 -1
  499. package/dist/production/src/mapper/select/SelectBuilder.js +7 -10
  500. package/dist/production/src/mapper/select/SelectBuilder.js.map +1 -1
  501. package/dist/production/src/mapper/select/SelectHydrator.cjs +1 -1
  502. package/dist/production/src/mapper/select/SelectHydrator.cjs.map +1 -1
  503. package/dist/production/src/mapper/select/SelectHydrator.js +1 -1
  504. package/dist/production/src/mapper/select/SelectHydrator.js.map +1 -1
  505. package/dist/production/src/mapper/select/WhereBuilder.cjs +20 -18
  506. package/dist/production/src/mapper/select/WhereBuilder.cjs.map +1 -1
  507. package/dist/production/src/mapper/select/WhereBuilder.js +20 -18
  508. package/dist/production/src/mapper/select/WhereBuilder.js.map +1 -1
  509. package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs +1 -1
  510. package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
  511. package/dist/production/src/mapper/select/handlers/FieldsVisitor.js +1 -1
  512. package/dist/production/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
  513. package/dist/production/src/mapper/select/handlers/FieldsVisitorFactory.cjs.map +1 -1
  514. package/dist/production/src/mapper/select/handlers/FieldsVisitorFactory.js.map +1 -1
  515. package/dist/production/src/mapper/select/handlers/MetaHandler.cjs.map +1 -1
  516. package/dist/production/src/mapper/select/handlers/MetaHandler.js.map +1 -1
  517. package/dist/production/src/mapper/select/optimizer/ConditionOptimizer.cjs.map +1 -1
  518. package/dist/production/src/mapper/select/optimizer/ConditionOptimizer.js.map +1 -1
  519. package/dist/production/src/mapper/select/optimizer/WhereOptimizer.cjs +7 -3
  520. package/dist/production/src/mapper/select/optimizer/WhereOptimizer.cjs.map +1 -1
  521. package/dist/production/src/mapper/select/optimizer/WhereOptimizer.js +7 -3
  522. package/dist/production/src/mapper/select/optimizer/WhereOptimizer.js.map +1 -1
  523. package/dist/production/src/mapper/select/optimizer/WhereReplacer.cjs.map +1 -1
  524. package/dist/production/src/mapper/select/optimizer/WhereReplacer.js.map +1 -1
  525. package/dist/production/src/mapper/select/optimizer/helpers.cjs.map +1 -1
  526. package/dist/production/src/mapper/select/optimizer/helpers.js.map +1 -1
  527. package/dist/production/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
  528. package/dist/production/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
  529. package/dist/production/src/mapper/update/UpdateBuilder.cjs +64 -68
  530. package/dist/production/src/mapper/update/UpdateBuilder.cjs.map +1 -1
  531. package/dist/production/src/mapper/update/UpdateBuilder.js +64 -68
  532. package/dist/production/src/mapper/update/UpdateBuilder.js.map +1 -1
  533. package/dist/production/src/mapper/update/UpdateBuilderFactory.cjs.map +1 -1
  534. package/dist/production/src/mapper/update/UpdateBuilderFactory.js.map +1 -1
  535. package/dist/production/src/mapper/update/Updater.cjs +15 -3
  536. package/dist/production/src/mapper/update/Updater.cjs.map +1 -1
  537. package/dist/production/src/mapper/update/Updater.js +16 -4
  538. package/dist/production/src/mapper/update/Updater.js.map +1 -1
  539. package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -1
  540. package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -1
  541. package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -1
  542. package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -1
  543. package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -1
  544. package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -1
  545. package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -1
  546. package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -1
  547. package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -1
  548. package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -1
  549. package/dist/production/src/resolvers/GraphQlQueryAstFactory.cjs.map +1 -1
  550. package/dist/production/src/resolvers/GraphQlQueryAstFactory.js.map +1 -1
  551. package/dist/production/src/resolvers/MutationResolver.cjs.map +1 -1
  552. package/dist/production/src/resolvers/MutationResolver.js.map +1 -1
  553. package/dist/production/src/resolvers/ReadHelpers.cjs.map +1 -1
  554. package/dist/production/src/resolvers/ReadHelpers.js.map +1 -1
  555. package/dist/production/src/resolvers/ReadResolver.cjs.map +1 -1
  556. package/dist/production/src/resolvers/ReadResolver.js.map +1 -1
  557. package/dist/production/src/resolvers/RefreshViewResolver.cjs.map +1 -1
  558. package/dist/production/src/resolvers/RefreshViewResolver.js.map +1 -1
  559. package/dist/production/src/resolvers/ValidationResolver.cjs.map +1 -1
  560. package/dist/production/src/resolvers/ValidationResolver.js.map +1 -1
  561. package/dist/production/src/schema/ColumnTypeResolver.cjs.map +1 -1
  562. package/dist/production/src/schema/ColumnTypeResolver.js.map +1 -1
  563. package/dist/production/src/schema/ConditionTypeProvider.cjs +2 -0
  564. package/dist/production/src/schema/ConditionTypeProvider.cjs.map +1 -1
  565. package/dist/production/src/schema/ConditionTypeProvider.js +3 -1
  566. package/dist/production/src/schema/ConditionTypeProvider.js.map +1 -1
  567. package/dist/production/src/schema/CustomTypesProvider.cjs.map +1 -1
  568. package/dist/production/src/schema/CustomTypesProvider.js.map +1 -1
  569. package/dist/production/src/schema/EntityTypeProvider.cjs +1 -3
  570. package/dist/production/src/schema/EntityTypeProvider.cjs.map +1 -1
  571. package/dist/production/src/schema/EntityTypeProvider.js +1 -3
  572. package/dist/production/src/schema/EntityTypeProvider.js.map +1 -1
  573. package/dist/production/src/schema/EnumsProvider.cjs.map +1 -1
  574. package/dist/production/src/schema/EnumsProvider.js.map +1 -1
  575. package/dist/production/src/schema/FieldAccessVisitor.cjs.map +1 -1
  576. package/dist/production/src/schema/FieldAccessVisitor.js.map +1 -1
  577. package/dist/production/src/schema/GraphQlSchemaBuilder.cjs +5 -11
  578. package/dist/production/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
  579. package/dist/production/src/schema/GraphQlSchemaBuilder.js +5 -11
  580. package/dist/production/src/schema/GraphQlSchemaBuilder.js.map +1 -1
  581. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.cjs +103 -3
  582. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
  583. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.js +103 -3
  584. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
  585. package/dist/production/src/schema/MutationProvider.cjs.map +1 -1
  586. package/dist/production/src/schema/MutationProvider.js +2 -2
  587. package/dist/production/src/schema/MutationProvider.js.map +1 -1
  588. package/dist/production/src/schema/OperationExtension.cjs +0 -1
  589. package/dist/production/src/schema/OperationExtension.cjs.map +1 -1
  590. package/dist/production/src/schema/OperationExtension.js +0 -1
  591. package/dist/production/src/schema/OperationExtension.js.map +1 -1
  592. package/dist/production/src/schema/OrderByTypeProvider.cjs.map +1 -1
  593. package/dist/production/src/schema/OrderByTypeProvider.js +1 -1
  594. package/dist/production/src/schema/OrderByTypeProvider.js.map +1 -1
  595. package/dist/production/src/schema/PaginatedFieldConfigFactory.cjs.map +1 -1
  596. package/dist/production/src/schema/PaginatedFieldConfigFactory.js +1 -1
  597. package/dist/production/src/schema/PaginatedFieldConfigFactory.js.map +1 -1
  598. package/dist/production/src/schema/QueryProvider.cjs.map +1 -1
  599. package/dist/production/src/schema/QueryProvider.js +2 -2
  600. package/dist/production/src/schema/QueryProvider.js.map +1 -1
  601. package/dist/production/src/schema/RefreshViewMutationProvider.cjs.map +1 -1
  602. package/dist/production/src/schema/RefreshViewMutationProvider.js.map +1 -1
  603. package/dist/production/src/schema/ResultSchemaTypeProvider.cjs.map +1 -1
  604. package/dist/production/src/schema/ResultSchemaTypeProvider.js.map +1 -1
  605. package/dist/production/src/schema/ValidationQueriesProvider.cjs +2 -8
  606. package/dist/production/src/schema/ValidationQueriesProvider.cjs.map +1 -1
  607. package/dist/production/src/schema/ValidationQueriesProvider.js +2 -8
  608. package/dist/production/src/schema/ValidationQueriesProvider.js.map +1 -1
  609. package/dist/production/src/schema/WhereTypeProvider.cjs +1 -3
  610. package/dist/production/src/schema/WhereTypeProvider.cjs.map +1 -1
  611. package/dist/production/src/schema/WhereTypeProvider.js +1 -3
  612. package/dist/production/src/schema/WhereTypeProvider.js.map +1 -1
  613. package/dist/production/src/schema/entities/FieldArgsVisitor.cjs.map +1 -1
  614. package/dist/production/src/schema/entities/FieldArgsVisitor.js.map +1 -1
  615. package/dist/production/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
  616. package/dist/production/src/schema/entities/FieldTypeVisitor.js.map +1 -1
  617. package/dist/production/src/schema/mutations/ConnectOrCreateRelationInputProvider.cjs.map +1 -1
  618. package/dist/production/src/schema/mutations/ConnectOrCreateRelationInputProvider.js.map +1 -1
  619. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
  620. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
  621. package/dist/production/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
  622. package/dist/production/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.js.map +1 -1
  623. package/dist/production/src/schema/mutations/CreateEntityRelationInputFieldVisitor.cjs.map +1 -1
  624. package/dist/production/src/schema/mutations/CreateEntityRelationInputFieldVisitor.js.map +1 -1
  625. package/dist/production/src/schema/mutations/CreateEntityRelationInputProvider.cjs.map +1 -1
  626. package/dist/production/src/schema/mutations/CreateEntityRelationInputProvider.js.map +1 -1
  627. package/dist/production/src/schema/mutations/EntityInputProvider.cjs.map +1 -1
  628. package/dist/production/src/schema/mutations/EntityInputProvider.js.map +1 -1
  629. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
  630. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
  631. package/dist/production/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
  632. package/dist/production/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.js.map +1 -1
  633. package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
  634. package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js +1 -1
  635. package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js.map +1 -1
  636. package/dist/production/src/schema/mutations/UpdateEntityRelationInputProvider.cjs.map +1 -1
  637. package/dist/production/src/schema/mutations/UpdateEntityRelationInputProvider.js.map +1 -1
  638. package/dist/production/src/schema/utils.cjs.map +1 -1
  639. package/dist/production/src/schema/utils.js.map +1 -1
  640. package/dist/production/src/utils/Mutex.cjs.map +1 -1
  641. package/dist/production/src/utils/Mutex.js.map +1 -1
  642. package/dist/production/src/utils/ResolveInfoUtils.cjs.map +1 -1
  643. package/dist/production/src/utils/ResolveInfoUtils.js.map +1 -1
  644. package/dist/production/src/utils/accessor.cjs.map +1 -1
  645. package/dist/production/src/utils/accessor.js.map +1 -1
  646. package/dist/production/src/utils/assertNever.cjs.map +1 -1
  647. package/dist/production/src/utils/assertNever.js.map +1 -1
  648. package/dist/production/src/utils/isIt.cjs.map +1 -1
  649. package/dist/production/src/utils/isIt.js.map +1 -1
  650. package/dist/production/src/utils/object.cjs.map +1 -1
  651. package/dist/production/src/utils/object.js.map +1 -1
  652. package/dist/production/src/utils/paginationUtils.cjs.map +1 -1
  653. package/dist/production/src/utils/paginationUtils.js.map +1 -1
  654. package/dist/production/src/utils/promises.cjs.map +1 -1
  655. package/dist/production/src/utils/promises.js.map +1 -1
  656. package/dist/production/src/utils/singletonFactory.cjs.map +1 -1
  657. package/dist/production/src/utils/singletonFactory.js.map +1 -1
  658. package/dist/production/src/utils/strings.cjs.map +1 -1
  659. package/dist/production/src/utils/strings.js.map +1 -1
  660. package/dist/production/src/utils/tuple.cjs.map +1 -1
  661. package/dist/production/src/utils/tuple.js.map +1 -1
  662. package/dist/production/src/utils/uniqueWhereFields.cjs.map +1 -1
  663. package/dist/production/src/utils/uniqueWhereFields.js.map +1 -1
  664. package/dist/production/src/utils/viewComputedId.cjs.map +1 -1
  665. package/dist/production/src/utils/viewComputedId.js.map +1 -1
  666. package/dist/tests/cases/integration/graphQlRequests/insert/subOperationFail.test.d.ts +2 -0
  667. package/dist/tests/cases/integration/graphQlRequests/insert/subOperationFail.test.d.ts.map +1 -0
  668. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/schema.d.ts.map +1 -1
  669. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/schema.d.ts.map +1 -1
  670. package/dist/tests/cases/integration/graphQlRequests/update/manyHasOne/schema.d.ts.map +1 -1
  671. package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/schema.d.ts.map +1 -1
  672. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/schema.d.ts.map +1 -1
  673. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/schema.d.ts.map +1 -1
  674. package/dist/tests/cases/integration/graphQlRequests/validation/conditions.test.d.ts.map +1 -1
  675. package/dist/tests/cases/integration/graphQlRequests/validation/requiredWhen.test.d.ts.map +1 -1
  676. package/dist/tests/cases/integration/graphQlRequests/validation/utils.d.ts.map +1 -1
  677. package/dist/tests/src/test.d.ts.map +1 -1
  678. package/dist/tests/tsconfig.tsbuildinfo +1 -1
  679. package/dist/types/ExecutionContainer.d.ts +13 -3
  680. package/dist/types/ExecutionContainer.d.ts.map +1 -1
  681. package/dist/types/acl/Authorizator.d.ts.map +1 -1
  682. package/dist/types/acl/EvaluatedPredicateReplacer.d.ts.map +1 -1
  683. package/dist/types/acl/PermissionFactory.d.ts.map +1 -1
  684. package/dist/types/acl/PredicateFactory.d.ts.map +1 -1
  685. package/dist/types/acl/PredicatesInjector.d.ts +15 -1
  686. package/dist/types/acl/PredicatesInjector.d.ts.map +1 -1
  687. package/dist/types/acl/VariableUtils.d.ts.map +1 -1
  688. package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.d.ts.map +1 -1
  689. package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.d.ts.map +1 -1
  690. package/dist/types/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.d.ts.map +1 -1
  691. package/dist/types/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.d.ts.map +1 -1
  692. package/dist/types/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.d.ts.map +1 -1
  693. package/dist/types/index.d.ts +1 -1
  694. package/dist/types/index.d.ts.map +1 -1
  695. package/dist/types/input-validation/preValidation/InputPreValidator.d.ts.map +1 -1
  696. package/dist/types/inputProcessing/CreateInputProcessor.d.ts +1 -1
  697. package/dist/types/inputProcessing/CreateInputProcessor.d.ts.map +1 -1
  698. package/dist/types/inputProcessing/CreateInputVisitor.d.ts.map +1 -1
  699. package/dist/types/inputProcessing/UpdateInputProcessor.d.ts +1 -1
  700. package/dist/types/inputProcessing/UpdateInputProcessor.d.ts.map +1 -1
  701. package/dist/types/inputProcessing/UpdateInputVisitor.d.ts.map +1 -1
  702. package/dist/types/introspection/IntrospectionSchemaFactory.d.ts.map +1 -1
  703. package/dist/types/introspection/introspection.schema.d.ts.map +1 -1
  704. package/dist/types/mapper/ColumnValue.d.ts.map +1 -1
  705. package/dist/types/mapper/ErrorUtils.d.ts.map +1 -1
  706. package/dist/types/mapper/EventManager.d.ts.map +1 -1
  707. package/dist/types/mapper/JunctionTableManager.d.ts.map +1 -1
  708. package/dist/types/mapper/Mapper.d.ts.map +1 -1
  709. package/dist/types/mapper/MapperFactory.d.ts.map +1 -1
  710. package/dist/types/mapper/Result.d.ts +2 -2
  711. package/dist/types/mapper/Result.d.ts.map +1 -1
  712. package/dist/types/mapper/delete/DeleteExecutor.d.ts.map +1 -1
  713. package/dist/types/mapper/delete/DeleteState.d.ts.map +1 -1
  714. package/dist/types/mapper/delete/helpers.d.ts.map +1 -1
  715. package/dist/types/mapper/insert/InsertBuilder.d.ts.map +1 -1
  716. package/dist/types/mapper/insert/SqlCreateInputProcessor.d.ts.map +1 -1
  717. package/dist/types/mapper/insert/relations/ManyHasManyCreateInputProcessor.d.ts +2 -2
  718. package/dist/types/mapper/insert/relations/ManyHasManyCreateInputProcessor.d.ts.map +1 -1
  719. package/dist/types/mapper/insert/relations/ManyHasOneCreateInputProcessor.d.ts +2 -2
  720. package/dist/types/mapper/insert/relations/ManyHasOneCreateInputProcessor.d.ts.map +1 -1
  721. package/dist/types/mapper/insert/relations/OneHasManyCreateInputProcessor.d.ts.map +1 -1
  722. package/dist/types/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.d.ts +1 -1
  723. package/dist/types/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.d.ts.map +1 -1
  724. package/dist/types/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.d.ts.map +1 -1
  725. package/dist/types/mapper/select/ConditionBuilder.d.ts.map +1 -1
  726. package/dist/types/mapper/select/JoinBuilder.d.ts.map +1 -1
  727. package/dist/types/mapper/select/Path.d.ts +0 -1
  728. package/dist/types/mapper/select/Path.d.ts.map +1 -1
  729. package/dist/types/mapper/select/RelationFetcher.d.ts.map +1 -1
  730. package/dist/types/mapper/select/SelectBuilder.d.ts.map +1 -1
  731. package/dist/types/mapper/select/SelectExecutionHandler.d.ts.map +1 -1
  732. package/dist/types/mapper/select/WhereBuilder.d.ts.map +1 -1
  733. package/dist/types/mapper/select/handlers/FieldsVisitor.d.ts.map +1 -1
  734. package/dist/types/mapper/select/optimizer/ConditionOptimizer.d.ts.map +1 -1
  735. package/dist/types/mapper/select/optimizer/WhereOptimizer.d.ts +6 -1
  736. package/dist/types/mapper/select/optimizer/WhereOptimizer.d.ts.map +1 -1
  737. package/dist/types/mapper/select/optimizer/WhereReplacer.d.ts.map +1 -1
  738. package/dist/types/mapper/types.d.ts +1 -1
  739. package/dist/types/mapper/types.d.ts.map +1 -1
  740. package/dist/types/mapper/update/SqlUpdateInputProcessor.d.ts.map +1 -1
  741. package/dist/types/mapper/update/UpdateBuilder.d.ts.map +1 -1
  742. package/dist/types/mapper/update/Updater.d.ts +1 -5
  743. package/dist/types/mapper/update/Updater.d.ts.map +1 -1
  744. package/dist/types/mapper/update/relations/ManyHasManyUpdateInputProcessor.d.ts +7 -7
  745. package/dist/types/mapper/update/relations/ManyHasOneUpdateInputProcessor.d.ts +5 -5
  746. package/dist/types/mapper/update/relations/ManyHasOneUpdateInputProcessor.d.ts.map +1 -1
  747. package/dist/types/mapper/update/relations/OneHasManyUpdateInputProcessor.d.ts +7 -7
  748. package/dist/types/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.d.ts.map +1 -1
  749. package/dist/types/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.d.ts +3 -3
  750. package/dist/types/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.d.ts.map +1 -1
  751. package/dist/types/resolvers/GraphQlQueryAstFactory.d.ts.map +1 -1
  752. package/dist/types/resolvers/MutationResolver.d.ts.map +1 -1
  753. package/dist/types/schema/ConditionTypeProvider.d.ts.map +1 -1
  754. package/dist/types/schema/CustomTypesProvider.d.ts.map +1 -1
  755. package/dist/types/schema/EntityTypeProvider.d.ts.map +1 -1
  756. package/dist/types/schema/GraphQlSchemaBuilder.d.ts.map +1 -1
  757. package/dist/types/schema/GraphQlSchemaBuilderFactory.d.ts +0 -1
  758. package/dist/types/schema/GraphQlSchemaBuilderFactory.d.ts.map +1 -1
  759. package/dist/types/schema/MutationProvider.d.ts.map +1 -1
  760. package/dist/types/schema/OperationExtension.d.ts +1 -1
  761. package/dist/types/schema/OperationExtension.d.ts.map +1 -1
  762. package/dist/types/schema/ValidationQueriesProvider.d.ts.map +1 -1
  763. package/dist/types/schema/WhereTypeProvider.d.ts.map +1 -1
  764. package/dist/types/schema/entities/FieldArgsVisitor.d.ts.map +1 -1
  765. package/dist/types/schema/mutations/ConnectOrCreateRelationInputProvider.d.ts.map +1 -1
  766. package/dist/types/schema/mutations/CreateEntityInputFieldVisitor.d.ts.map +1 -1
  767. package/dist/types/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.d.ts.map +1 -1
  768. package/dist/types/schema/mutations/CreateEntityRelationInputFieldVisitor.d.ts.map +1 -1
  769. package/dist/types/schema/mutations/EntityInputProvider.d.ts.map +1 -1
  770. package/dist/types/schema/mutations/UpdateEntityInputFieldVisitor.d.ts +1 -1
  771. package/dist/types/schema/mutations/UpdateEntityInputFieldVisitor.d.ts.map +1 -1
  772. package/dist/types/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.d.ts.map +1 -1
  773. package/dist/types/schema/mutations/UpdateEntityRelationInputFieldVisitor.d.ts.map +1 -1
  774. package/dist/types/tsconfig.tsbuildinfo +1 -1
  775. package/dist/types/utils/object.d.ts.map +1 -1
  776. package/graphql.codegen.yml +1 -1
  777. package/package.json +21 -16
  778. package/src/ExecutionContainer.ts +137 -122
  779. package/src/acl/Authorizator.ts +5 -3
  780. package/src/acl/EvaluatedPredicateReplacer.ts +0 -5
  781. package/src/acl/PermissionFactory.ts +9 -10
  782. package/src/acl/PredicateFactory.ts +0 -1
  783. package/src/acl/PredicatesInjector.ts +162 -12
  784. package/src/acl/VariableUtils.ts +0 -2
  785. package/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.ts +0 -2
  786. package/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.ts +9 -13
  787. package/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.ts +3 -4
  788. package/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.ts +2 -2
  789. package/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.ts +2 -5
  790. package/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.ts +3 -4
  791. package/src/index.ts +8 -7
  792. package/src/input-validation/ValidationEvaluation.ts +3 -6
  793. package/src/input-validation/dependencies/DependencyCollector.ts +3 -3
  794. package/src/input-validation/preValidation/InputPreValidator.ts +6 -8
  795. package/src/inputProcessing/CreateInputProcessor.ts +1 -2
  796. package/src/inputProcessing/CreateInputVisitor.ts +7 -8
  797. package/src/inputProcessing/UpdateInputProcessor.ts +1 -2
  798. package/src/inputProcessing/UpdateInputVisitor.ts +9 -10
  799. package/src/introspection/IntrospectionSchemaFactory.ts +3 -4
  800. package/src/introspection/content-schema.types.ts +3 -3
  801. package/src/introspection/introspection.schema.ts +0 -2
  802. package/src/mapper/ColumnValue.ts +0 -1
  803. package/src/mapper/ErrorUtils.ts +19 -7
  804. package/src/mapper/EventManager.ts +0 -2
  805. package/src/mapper/JunctionTableManager.ts +19 -17
  806. package/src/mapper/Mapper.ts +13 -6
  807. package/src/mapper/MapperFactory.ts +0 -1
  808. package/src/mapper/Result.ts +2 -2
  809. package/src/mapper/delete/DeleteExecutor.ts +6 -7
  810. package/src/mapper/delete/DeleteState.ts +0 -1
  811. package/src/mapper/delete/helpers.ts +2 -3
  812. package/src/mapper/insert/InsertBuilder.ts +32 -35
  813. package/src/mapper/insert/Inserter.ts +0 -1
  814. package/src/mapper/insert/SqlCreateInputProcessor.ts +3 -6
  815. package/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.ts +0 -1
  816. package/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.ts +1 -2
  817. package/src/mapper/insert/relations/OneHasManyCreateInputProcessor.ts +0 -1
  818. package/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.ts +1 -4
  819. package/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.ts +2 -9
  820. package/src/mapper/select/ConditionBuilder.ts +19 -13
  821. package/src/mapper/select/JoinBuilder.ts +4 -2
  822. package/src/mapper/select/OrderByHelper.ts +2 -2
  823. package/src/mapper/select/Path.ts +0 -2
  824. package/src/mapper/select/RelationFetcher.ts +31 -26
  825. package/src/mapper/select/SelectBuilder.ts +16 -14
  826. package/src/mapper/select/SelectExecutionHandler.ts +30 -28
  827. package/src/mapper/select/SelectHydrator.ts +1 -1
  828. package/src/mapper/select/WhereBuilder.ts +49 -43
  829. package/src/mapper/select/handlers/FieldsVisitor.ts +1 -2
  830. package/src/mapper/select/optimizer/ConditionOptimizer.ts +0 -7
  831. package/src/mapper/select/optimizer/WhereOptimizer.ts +37 -15
  832. package/src/mapper/select/optimizer/WhereReplacer.ts +6 -3
  833. package/src/mapper/select/optimizer/helpers.ts +1 -1
  834. package/src/mapper/types.ts +19 -18
  835. package/src/mapper/update/SqlUpdateInputProcessor.ts +1 -1
  836. package/src/mapper/update/UpdateBuilder.ts +77 -81
  837. package/src/mapper/update/Updater.ts +23 -5
  838. package/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.ts +2 -4
  839. package/src/mapper/update/relations/OneHasManyUpdateInputProcessor.ts +2 -2
  840. package/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.ts +7 -4
  841. package/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.ts +23 -9
  842. package/src/resolvers/GraphQlQueryAstFactory.ts +0 -1
  843. package/src/resolvers/MutationResolver.ts +13 -15
  844. package/src/schema/ColumnTypeResolver.ts +1 -1
  845. package/src/schema/ConditionTypeProvider.ts +3 -1
  846. package/src/schema/CustomTypesProvider.ts +1 -2
  847. package/src/schema/EntityTypeProvider.ts +1 -3
  848. package/src/schema/GraphQlSchemaBuilder.ts +8 -7
  849. package/src/schema/GraphQlSchemaBuilderFactory.ts +150 -68
  850. package/src/schema/MutationProvider.ts +5 -10
  851. package/src/schema/OperationExtension.ts +1 -2
  852. package/src/schema/ValidationQueriesProvider.ts +2 -6
  853. package/src/schema/WhereTypeProvider.ts +1 -3
  854. package/src/schema/entities/FieldArgsVisitor.ts +5 -4
  855. package/src/schema/mutations/ConnectOrCreateRelationInputProvider.ts +0 -2
  856. package/src/schema/mutations/CreateEntityInputFieldVisitor.ts +3 -4
  857. package/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.ts +3 -4
  858. package/src/schema/mutations/CreateEntityRelationInputFieldVisitor.ts +10 -10
  859. package/src/schema/mutations/EntityInputProvider.ts +1 -7
  860. package/src/schema/mutations/UpdateEntityInputFieldVisitor.ts +3 -4
  861. package/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.ts +3 -4
  862. package/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts +6 -13
  863. package/src/utils/object.ts +3 -2
  864. package/tests/cases/bugs/bug-filter-or.test.ts +1 -5
  865. package/tests/cases/bugs/bug-update-by-nested-unique.test.ts +3 -6
  866. package/tests/cases/bugs/bug102.test.ts +2 -9
  867. package/tests/cases/integration/graphQlRequests/delete/aclDelete.test.ts +2 -3
  868. package/tests/cases/integration/graphQlRequests/delete/additionalDeleteFilter.test.ts +1 -2
  869. package/tests/cases/integration/graphQlRequests/delete/cascadeDelete.test.ts +12 -19
  870. package/tests/cases/integration/graphQlRequests/delete/deleteById.test.ts +0 -2
  871. package/tests/cases/integration/graphQlRequests/delete/orphanRemoval.test.ts +4 -5
  872. package/tests/cases/integration/graphQlRequests/delete/restrictOnDelete.test.ts +6 -13
  873. package/tests/cases/integration/graphQlRequests/delete/setNullOnDelete.test.ts +9 -13
  874. package/tests/cases/integration/graphQlRequests/insert/acl/setField.test.ts +0 -2
  875. package/tests/cases/integration/graphQlRequests/insert/aclInsert.test.ts +0 -1
  876. package/tests/cases/integration/graphQlRequests/insert/basicInsert.test.ts +0 -1
  877. package/tests/cases/integration/graphQlRequests/insert/insertCustomId.test.ts +0 -1
  878. package/tests/cases/integration/graphQlRequests/insert/jsonInsert.test.ts +2 -2
  879. package/tests/cases/integration/graphQlRequests/insert/manyHasManyInverse/create.test.ts +1 -3
  880. package/tests/cases/integration/graphQlRequests/insert/manyHasManyOwning/create.test.ts +1 -4
  881. package/tests/cases/integration/graphQlRequests/insert/manyHasOne/connectOrCreate.test.ts +2 -10
  882. package/tests/cases/integration/graphQlRequests/insert/manyHasOne/create.test.ts +1 -5
  883. package/tests/cases/integration/graphQlRequests/insert/oneHasMany/connect.test.ts +3 -4
  884. package/tests/cases/integration/graphQlRequests/insert/oneHasMany/create.test.ts +2 -5
  885. package/tests/cases/integration/graphQlRequests/insert/oneHasOneInverse/create.test.ts +1 -3
  886. package/tests/cases/integration/graphQlRequests/insert/oneHasOneOwning/create.test.ts +1 -3
  887. package/tests/cases/integration/graphQlRequests/insert/oneHasOneOwning/empty.test.ts +1 -3
  888. package/tests/cases/integration/graphQlRequests/insert/subOperationFail.test.ts +107 -0
  889. package/tests/cases/integration/graphQlRequests/insert/validation/toBeFixed.test.ts +1 -9
  890. package/tests/cases/integration/graphQlRequests/query/acl/differentRowAndFieldPredicate.test.ts +0 -4
  891. package/tests/cases/integration/graphQlRequests/query/acl/fieldRestrictedByLocale.test.ts +1 -4
  892. package/tests/cases/integration/graphQlRequests/query/acl/isNullAcl.test.ts +0 -4
  893. package/tests/cases/integration/graphQlRequests/query/acl/nestedPredicate.test.ts +1 -6
  894. package/tests/cases/integration/graphQlRequests/query/acl/orPredicate.test.ts +0 -2
  895. package/tests/cases/integration/graphQlRequests/query/acl/predicateElimination.test.ts +676 -2
  896. package/tests/cases/integration/graphQlRequests/query/acl/relationAcl.test.ts +8 -11
  897. package/tests/cases/integration/graphQlRequests/query/acl/rowPredicateSubset.test.ts +2 -6
  898. package/tests/cases/integration/graphQlRequests/query/acl/sameRowAndFieldPredicate.test.ts +0 -2
  899. package/tests/cases/integration/graphQlRequests/query/filter/backReferencedFilter.test.ts +1 -4
  900. package/tests/cases/integration/graphQlRequests/query/filter/complexCondition.test.ts +0 -1
  901. package/tests/cases/integration/graphQlRequests/query/filter/composedFilter.test.ts +0 -1
  902. package/tests/cases/integration/graphQlRequests/query/filter/containsQuery.test.ts +0 -1
  903. package/tests/cases/integration/graphQlRequests/query/filter/manyHasManyOwnerRelation.test.ts +16 -18
  904. package/tests/cases/integration/graphQlRequests/query/filter/manyHasOneRelation.test.ts +0 -1
  905. package/tests/cases/integration/graphQlRequests/query/filter/oneHasManyRelation.test.ts +1 -3
  906. package/tests/cases/integration/graphQlRequests/query/formatting/dateFormat.test.ts +0 -1
  907. package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/alias.test.ts +0 -1
  908. package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/fragments.test.ts +6 -8
  909. package/tests/cases/integration/graphQlRequests/query/misc/aliasedType.test.ts +0 -1
  910. package/tests/cases/integration/graphQlRequests/query/misc/longAliasHash.test.ts +1 -3
  911. package/tests/cases/integration/graphQlRequests/query/misc/reducedHasMany.test.ts +2 -10
  912. package/tests/cases/integration/graphQlRequests/query/misc/transaction.test.ts +0 -2
  913. package/tests/cases/integration/graphQlRequests/query/pagination/hasManyLimit.test.ts +3 -10
  914. package/tests/cases/integration/graphQlRequests/query/pagination/paginate.test.ts +1 -3
  915. package/tests/cases/integration/graphQlRequests/query/pagination/paginateAliased.test.ts +1 -3
  916. package/tests/cases/integration/graphQlRequests/query/pagination/simpleLimit.test.ts +0 -1
  917. package/tests/cases/integration/graphQlRequests/query/relations/advanced.test.ts +3 -7
  918. package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyInverse.test.ts +4 -9
  919. package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyOwning.test.ts +5 -8
  920. package/tests/cases/integration/graphQlRequests/query/relations/manyHasOne.test.ts +0 -2
  921. package/tests/cases/integration/graphQlRequests/query/relations/oneHasMany.test.ts +2 -5
  922. package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneInverse.test.ts +1 -3
  923. package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneOwner.test.ts +1 -3
  924. package/tests/cases/integration/graphQlRequests/query/sorting/byRelations.test.ts +6 -8
  925. package/tests/cases/integration/graphQlRequests/query/sorting/defaultOrdering.test.ts +8 -8
  926. package/tests/cases/integration/graphQlRequests/query/sorting/orderBy.test.ts +0 -1
  927. package/tests/cases/integration/graphQlRequests/query/sorting/randomSort.test.ts +1 -5
  928. package/tests/cases/integration/graphQlRequests/query/sorting/sortNulls.test.ts +0 -1
  929. package/tests/cases/integration/graphQlRequests/query/sorting/sortedHasMany.test.ts +0 -1
  930. package/tests/cases/integration/graphQlRequests/query/unique/basicQueryById.test.ts +0 -1
  931. package/tests/cases/integration/graphQlRequests/query/unique/composedUnique.test.ts +2 -5
  932. package/tests/cases/integration/graphQlRequests/query/unique/oneHasManyUnique.test.ts +2 -5
  933. package/tests/cases/integration/graphQlRequests/query/unique/uniqueWithFilter.test.ts +0 -1
  934. package/tests/cases/integration/graphQlRequests/query/view/view.test.ts +0 -1
  935. package/tests/cases/integration/graphQlRequests/update/acl/aclUpdate.test.ts +8 -11
  936. package/tests/cases/integration/graphQlRequests/update/additionalFilter.test.ts +53 -3
  937. package/tests/cases/integration/graphQlRequests/update/basic/columnUpdate.test.ts +2 -3
  938. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/connect.test.ts +0 -1
  939. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/create.test.ts +0 -1
  940. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/delete.test.ts +0 -1
  941. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/disconnect.test.ts +0 -1
  942. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/schema.ts +1 -2
  943. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/update.test.ts +2 -2
  944. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/upsert.test.ts +2 -2
  945. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/connect.test.ts +0 -1
  946. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/connectOrCreate.test.ts +0 -2
  947. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/create.test.ts +0 -1
  948. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/delete.test.ts +0 -1
  949. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/disconnect.test.ts +0 -1
  950. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/schema.ts +1 -2
  951. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/update.test.ts +2 -2
  952. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/upsert.test.ts +7 -6
  953. package/tests/cases/integration/graphQlRequests/update/manyHasOne/connect.test.ts +2 -2
  954. package/tests/cases/integration/graphQlRequests/update/manyHasOne/create.test.ts +2 -2
  955. package/tests/cases/integration/graphQlRequests/update/manyHasOne/delete.test.ts +8 -6
  956. package/tests/cases/integration/graphQlRequests/update/manyHasOne/disconnect.test.ts +2 -3
  957. package/tests/cases/integration/graphQlRequests/update/manyHasOne/schema.ts +2 -5
  958. package/tests/cases/integration/graphQlRequests/update/manyHasOne/update.test.ts +2 -2
  959. package/tests/cases/integration/graphQlRequests/update/manyHasOne/upsert.test.ts +4 -3
  960. package/tests/cases/integration/graphQlRequests/update/oneHasMany/combination.test.ts +0 -1
  961. package/tests/cases/integration/graphQlRequests/update/oneHasMany/connect.test.ts +2 -2
  962. package/tests/cases/integration/graphQlRequests/update/oneHasMany/connectOrCreate.test.ts +2 -2
  963. package/tests/cases/integration/graphQlRequests/update/oneHasMany/create.test.ts +0 -1
  964. package/tests/cases/integration/graphQlRequests/update/oneHasMany/delete.test.ts +0 -1
  965. package/tests/cases/integration/graphQlRequests/update/oneHasMany/disconnect.test.ts +2 -2
  966. package/tests/cases/integration/graphQlRequests/update/oneHasMany/schema.ts +2 -8
  967. package/tests/cases/integration/graphQlRequests/update/oneHasMany/update.test.ts +7 -8
  968. package/tests/cases/integration/graphQlRequests/update/oneHasMany/upsert.test.ts +2 -2
  969. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/connect.test.ts +10 -6
  970. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/create.test.ts +2 -2
  971. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/delete.test.ts +1 -4
  972. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/disconnect.test.ts +2 -2
  973. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/schema.ts +2 -6
  974. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/update.test.ts +2 -2
  975. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/upsert.test.ts +2 -2
  976. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connect.test.ts +8 -5
  977. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connectOrCreate.test.ts +2 -1
  978. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/create.test.ts +4 -2
  979. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/delete.test.ts +5 -5
  980. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/disconnect.test.ts +2 -2
  981. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/schema.ts +2 -6
  982. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/update.test.ts +2 -2
  983. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/upsert.test.ts +4 -3
  984. package/tests/cases/integration/graphQlRequests/update/queryPortal.test.ts +4 -4
  985. package/tests/cases/integration/graphQlRequests/update/transaction.test.ts +6 -5
  986. package/tests/cases/integration/graphQlRequests/update/validation/toBeFixed.test.ts +9 -10
  987. package/tests/cases/integration/graphQlRequests/upsert/basicUpsert.test.ts +5 -9
  988. package/tests/cases/integration/graphQlRequests/validation/conditions.test.ts +1 -1
  989. package/tests/cases/integration/graphQlRequests/validation/nestedValidation.test.ts +0 -2
  990. package/tests/cases/integration/graphQlRequests/validation/optionalAssert.test.ts +0 -2
  991. package/tests/cases/integration/graphQlRequests/validation/required.test.ts +0 -2
  992. package/tests/cases/integration/graphQlRequests/validation/requiredWhen.test.ts +1 -2
  993. package/tests/cases/integration/graphQlRequests/validation/rules/andRule.test.ts +0 -1
  994. package/tests/cases/integration/graphQlRequests/validation/rules/lengthRangeRule.test.ts +0 -1
  995. package/tests/cases/integration/graphQlRequests/validation/rules/maxLengthRule.test.ts +0 -1
  996. package/tests/cases/integration/graphQlRequests/validation/rules/minLength.test.ts +0 -3
  997. package/tests/cases/integration/graphQlRequests/validation/rules/notEmptyRule.test.ts +0 -4
  998. package/tests/cases/integration/graphQlRequests/validation/rules/notRule.test.ts +0 -2
  999. package/tests/cases/integration/graphQlRequests/validation/rules/orRule.test.ts +0 -3
  1000. package/tests/cases/integration/graphQlRequests/validation/rules/patternRule.test.ts +0 -1
  1001. package/tests/cases/integration/graphQlRequests/validation/rules/rangeRule.test.ts +0 -1
  1002. package/tests/cases/integration/graphQlRequests/validation/utils.ts +2 -6
  1003. package/tests/cases/integration/graphQlSchema/graphQlSchemaBuilder.test.ts +31 -61
  1004. package/tests/cases/integration/graphQlSchema/schema-column-types.gql +1 -0
  1005. package/tests/cases/unit/aclVariablesFactory.test.ts +3 -7
  1006. package/tests/cases/unit/conditionOptimizer.test.ts +122 -77
  1007. package/tests/cases/unit/inputPreValidator.test.ts +5 -17
  1008. package/tests/cases/unit/inputValidation.test.ts +2 -7
  1009. package/tests/cases/unit/orderbyHelper.test.ts +8 -6
  1010. package/tests/cases/unit/permissionMerger.test.ts +1 -7
  1011. package/tests/cases/unit/predicatesFactory.test.ts +0 -1
  1012. package/tests/cases/unit/predicatesInjector.test.ts +1065 -13
  1013. package/tests/cases/unit/uuidType.test.ts +1 -2
  1014. package/tests/cases/unit/variableInjector.test.ts +1 -4
  1015. package/tests/cases/unit/whereBuilder.test.ts +8 -5
  1016. package/tests/cases/unit/whereOptimizer.test.ts +337 -244
  1017. package/tests/src/test.ts +3 -2
  1018. package/tests/src/testGraphql.ts +1 -1
  1019. package/tests/.eslintrc.cjs +0 -5
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshViewMutationProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/RefreshViewMutationProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { GraphQLBoolean, GraphQLEnumType, GraphQLFieldConfig, GraphQLInputObjectType, GraphQLObjectType } from 'graphql'\nimport { Context } from '../types'\nimport { Authorizator } from '../acl'\n\nexport class RefreshViewMutationProvider {\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\tgetMutation(): GraphQLFieldConfig<any, Context, any> | undefined {\n\t\tconst materializedViews = Object.values(this.schema.entities)\n\t\t\t.filter(it => it.view?.materialized)\n\t\t\t.filter(it => this.authorizator.isRefreshMaterializedViewAllowed(it.name))\n\t\tif (materializedViews.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst materializedViewsEnum = new GraphQLEnumType({\n\t\t\tname: '_MaterializedView',\n\t\t\tvalues: Object.fromEntries(materializedViews.map(it => [it.name, { value: it.name }])),\n\t\t})\n\n\t\tconst refreshViewOptions = new GraphQLInputObjectType({\n\t\t\tname: 'RefreshMaterializedViewOptions',\n\t\t\tfields: {\n\t\t\t\tconcurrently: { type: GraphQLBoolean },\n\t\t\t},\n\t\t})\n\t\treturn {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: 'RefreshMaterializedViewResponse',\n\t\t\t\tfields: {\n\t\t\t\t\tok: { type: GraphQLBoolean },\n\t\t\t\t},\n\t\t\t}),\n\t\t\targs: {\n\t\t\t\tname: { type: materializedViewsEnum },\n\t\t\t\toptions: { type: refreshViewOptions },\n\t\t\t},\n\t\t\tresolve: async (parent, args, context) => {\n\t\t\t\treturn await context.executionContainer.refreshViewResolver.resolve(args.name, args.options)\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["GraphQLEnumType","GraphQLInputObjectType","GraphQLBoolean","GraphQLObjectType"],"mappings":";;;AAKO,MAAM,4BAA4B;AAAA,EACxC,YACkB,QACA,cAChB;AAFgB,SAAA,SAAA;AACA,SAAA,eAAA;AAAA,EAAA;AAAA,EAGlB,cAAiE;AAC1D,UAAA,oBAAoB,OAAO,OAAO,KAAK,OAAO,QAAQ,EAC1D,OAAO,CAAM,OAAA,GAAG,MAAM,YAAY,EAClC,OAAO,CAAM,OAAA,KAAK,aAAa,iCAAiC,GAAG,IAAI,CAAC;AACtE,QAAA,kBAAkB,WAAW,GAAG;AAC5B,aAAA;AAAA,IAAA;AAGF,UAAA,wBAAwB,IAAIA,wBAAgB;AAAA,MACjD,MAAM;AAAA,MACN,QAAQ,OAAO,YAAY,kBAAkB,IAAI,CAAM,OAAA,CAAC,GAAG,MAAM,EAAE,OAAO,GAAG,KAAM,CAAA,CAAC,CAAC;AAAA,IAAA,CACrF;AAEK,UAAA,qBAAqB,IAAIC,+BAAuB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,cAAc,EAAE,MAAMC,QAAe,eAAA;AAAA,MAAA;AAAA,IACtC,CACA;AACM,WAAA;AAAA,MACN,MAAM,IAAIC,QAAAA,kBAAkB;AAAA,QAC3B,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,IAAI,EAAE,MAAMD,QAAe,eAAA;AAAA,QAAA;AAAA,MAC5B,CACA;AAAA,MACD,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,sBAAsB;AAAA,QACpC,SAAS,EAAE,MAAM,mBAAmB;AAAA,MACrC;AAAA,MACA,SAAS,OAAO,QAAQ,MAAM,YAAY;AAClC,eAAA,MAAM,QAAQ,mBAAmB,oBAAoB,QAAQ,KAAK,MAAM,KAAK,OAAO;AAAA,MAAA;AAAA,IAE7F;AAAA,EAAA;AAEF;;"}
1
+ {"version":3,"file":"RefreshViewMutationProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/RefreshViewMutationProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { GraphQLBoolean, GraphQLEnumType, GraphQLFieldConfig, GraphQLInputObjectType, GraphQLObjectType } from 'graphql'\nimport { Context } from '../types'\nimport { Authorizator } from '../acl'\n\nexport class RefreshViewMutationProvider {\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\tgetMutation(): GraphQLFieldConfig<any, Context, any> | undefined {\n\t\tconst materializedViews = Object.values(this.schema.entities)\n\t\t\t.filter(it => it.view?.materialized)\n\t\t\t.filter(it => this.authorizator.isRefreshMaterializedViewAllowed(it.name))\n\t\tif (materializedViews.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst materializedViewsEnum = new GraphQLEnumType({\n\t\t\tname: '_MaterializedView',\n\t\t\tvalues: Object.fromEntries(materializedViews.map(it => [it.name, { value: it.name }])),\n\t\t})\n\n\t\tconst refreshViewOptions = new GraphQLInputObjectType({\n\t\t\tname: 'RefreshMaterializedViewOptions',\n\t\t\tfields: {\n\t\t\t\tconcurrently: { type: GraphQLBoolean },\n\t\t\t},\n\t\t})\n\t\treturn {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: 'RefreshMaterializedViewResponse',\n\t\t\t\tfields: {\n\t\t\t\t\tok: { type: GraphQLBoolean },\n\t\t\t\t},\n\t\t\t}),\n\t\t\targs: {\n\t\t\t\tname: { type: materializedViewsEnum },\n\t\t\t\toptions: { type: refreshViewOptions },\n\t\t\t},\n\t\t\tresolve: async (parent, args, context) => {\n\t\t\t\treturn await context.executionContainer.refreshViewResolver.resolve(args.name, args.options)\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["GraphQLEnumType","GraphQLInputObjectType","GraphQLBoolean","GraphQLObjectType"],"mappings":";;;AAKO,MAAM,4BAA4B;AAAA,EACxC,YACkB,QACA,cAChB;AAFgB,SAAA,SAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EACA,cAAiE;AAChE,UAAM,oBAAoB,OAAO,OAAO,KAAK,OAAO,QAAQ,EAC1D,OAAO,CAAA,OAAM,GAAG,MAAM,YAAY,EAClC,OAAO,CAAA,OAAM,KAAK,aAAa,iCAAiC,GAAG,IAAI,CAAC;AAC1E,QAAI,kBAAkB,WAAW,GAAG;AACnC,aAAO;AAAA,IACR;AAEA,UAAM,wBAAwB,IAAIA,wBAAgB;AAAA,MACjD,MAAM;AAAA,MACN,QAAQ,OAAO,YAAY,kBAAkB,IAAI,CAAA,OAAM,CAAC,GAAG,MAAM,EAAE,OAAO,GAAG,KAAA,CAAM,CAAC,CAAC;AAAA,IAAA,CACrF;AAED,UAAM,qBAAqB,IAAIC,+BAAuB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,cAAc,EAAE,MAAMC,QAAAA,eAAA;AAAA,MAAe;AAAA,IACtC,CACA;AACD,WAAO;AAAA,MACN,MAAM,IAAIC,QAAAA,kBAAkB;AAAA,QAC3B,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,IAAI,EAAE,MAAMD,QAAAA,eAAA;AAAA,QAAe;AAAA,MAC5B,CACA;AAAA,MACD,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,sBAAA;AAAA,QACd,SAAS,EAAE,MAAM,mBAAA;AAAA,MAAmB;AAAA,MAErC,SAAS,OAAO,QAAQ,MAAM,YAAY;AACzC,eAAO,MAAM,QAAQ,mBAAmB,oBAAoB,QAAQ,KAAK,MAAM,KAAK,OAAO;AAAA,MAC5F;AAAA,IAAA;AAAA,EAEF;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshViewMutationProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/RefreshViewMutationProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { GraphQLBoolean, GraphQLEnumType, GraphQLFieldConfig, GraphQLInputObjectType, GraphQLObjectType } from 'graphql'\nimport { Context } from '../types'\nimport { Authorizator } from '../acl'\n\nexport class RefreshViewMutationProvider {\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\tgetMutation(): GraphQLFieldConfig<any, Context, any> | undefined {\n\t\tconst materializedViews = Object.values(this.schema.entities)\n\t\t\t.filter(it => it.view?.materialized)\n\t\t\t.filter(it => this.authorizator.isRefreshMaterializedViewAllowed(it.name))\n\t\tif (materializedViews.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst materializedViewsEnum = new GraphQLEnumType({\n\t\t\tname: '_MaterializedView',\n\t\t\tvalues: Object.fromEntries(materializedViews.map(it => [it.name, { value: it.name }])),\n\t\t})\n\n\t\tconst refreshViewOptions = new GraphQLInputObjectType({\n\t\t\tname: 'RefreshMaterializedViewOptions',\n\t\t\tfields: {\n\t\t\t\tconcurrently: { type: GraphQLBoolean },\n\t\t\t},\n\t\t})\n\t\treturn {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: 'RefreshMaterializedViewResponse',\n\t\t\t\tfields: {\n\t\t\t\t\tok: { type: GraphQLBoolean },\n\t\t\t\t},\n\t\t\t}),\n\t\t\targs: {\n\t\t\t\tname: { type: materializedViewsEnum },\n\t\t\t\toptions: { type: refreshViewOptions },\n\t\t\t},\n\t\t\tresolve: async (parent, args, context) => {\n\t\t\t\treturn await context.executionContainer.refreshViewResolver.resolve(args.name, args.options)\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAKO,MAAM,4BAA4B;AAAA,EACxC,YACkB,QACA,cAChB;AAFgB,SAAA,SAAA;AACA,SAAA,eAAA;AAAA,EAAA;AAAA,EAGlB,cAAiE;AAC1D,UAAA,oBAAoB,OAAO,OAAO,KAAK,OAAO,QAAQ,EAC1D,OAAO,CAAM,OAAA,GAAG,MAAM,YAAY,EAClC,OAAO,CAAM,OAAA,KAAK,aAAa,iCAAiC,GAAG,IAAI,CAAC;AACtE,QAAA,kBAAkB,WAAW,GAAG;AAC5B,aAAA;AAAA,IAAA;AAGF,UAAA,wBAAwB,IAAI,gBAAgB;AAAA,MACjD,MAAM;AAAA,MACN,QAAQ,OAAO,YAAY,kBAAkB,IAAI,CAAM,OAAA,CAAC,GAAG,MAAM,EAAE,OAAO,GAAG,KAAM,CAAA,CAAC,CAAC;AAAA,IAAA,CACrF;AAEK,UAAA,qBAAqB,IAAI,uBAAuB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,cAAc,EAAE,MAAM,eAAe;AAAA,MAAA;AAAA,IACtC,CACA;AACM,WAAA;AAAA,MACN,MAAM,IAAI,kBAAkB;AAAA,QAC3B,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,IAAI,EAAE,MAAM,eAAe;AAAA,QAAA;AAAA,MAC5B,CACA;AAAA,MACD,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,sBAAsB;AAAA,QACpC,SAAS,EAAE,MAAM,mBAAmB;AAAA,MACrC;AAAA,MACA,SAAS,OAAO,QAAQ,MAAM,YAAY;AAClC,eAAA,MAAM,QAAQ,mBAAmB,oBAAoB,QAAQ,KAAK,MAAM,KAAK,OAAO;AAAA,MAAA;AAAA,IAE7F;AAAA,EAAA;AAEF;"}
1
+ {"version":3,"file":"RefreshViewMutationProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/RefreshViewMutationProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { GraphQLBoolean, GraphQLEnumType, GraphQLFieldConfig, GraphQLInputObjectType, GraphQLObjectType } from 'graphql'\nimport { Context } from '../types'\nimport { Authorizator } from '../acl'\n\nexport class RefreshViewMutationProvider {\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\tgetMutation(): GraphQLFieldConfig<any, Context, any> | undefined {\n\t\tconst materializedViews = Object.values(this.schema.entities)\n\t\t\t.filter(it => it.view?.materialized)\n\t\t\t.filter(it => this.authorizator.isRefreshMaterializedViewAllowed(it.name))\n\t\tif (materializedViews.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst materializedViewsEnum = new GraphQLEnumType({\n\t\t\tname: '_MaterializedView',\n\t\t\tvalues: Object.fromEntries(materializedViews.map(it => [it.name, { value: it.name }])),\n\t\t})\n\n\t\tconst refreshViewOptions = new GraphQLInputObjectType({\n\t\t\tname: 'RefreshMaterializedViewOptions',\n\t\t\tfields: {\n\t\t\t\tconcurrently: { type: GraphQLBoolean },\n\t\t\t},\n\t\t})\n\t\treturn {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: 'RefreshMaterializedViewResponse',\n\t\t\t\tfields: {\n\t\t\t\t\tok: { type: GraphQLBoolean },\n\t\t\t\t},\n\t\t\t}),\n\t\t\targs: {\n\t\t\t\tname: { type: materializedViewsEnum },\n\t\t\t\toptions: { type: refreshViewOptions },\n\t\t\t},\n\t\t\tresolve: async (parent, args, context) => {\n\t\t\t\treturn await context.executionContainer.refreshViewResolver.resolve(args.name, args.options)\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAKO,MAAM,4BAA4B;AAAA,EACxC,YACkB,QACA,cAChB;AAFgB,SAAA,SAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EACA,cAAiE;AAChE,UAAM,oBAAoB,OAAO,OAAO,KAAK,OAAO,QAAQ,EAC1D,OAAO,CAAA,OAAM,GAAG,MAAM,YAAY,EAClC,OAAO,CAAA,OAAM,KAAK,aAAa,iCAAiC,GAAG,IAAI,CAAC;AAC1E,QAAI,kBAAkB,WAAW,GAAG;AACnC,aAAO;AAAA,IACR;AAEA,UAAM,wBAAwB,IAAI,gBAAgB;AAAA,MACjD,MAAM;AAAA,MACN,QAAQ,OAAO,YAAY,kBAAkB,IAAI,CAAA,OAAM,CAAC,GAAG,MAAM,EAAE,OAAO,GAAG,KAAA,CAAM,CAAC,CAAC;AAAA,IAAA,CACrF;AAED,UAAM,qBAAqB,IAAI,uBAAuB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,cAAc,EAAE,MAAM,eAAA;AAAA,MAAe;AAAA,IACtC,CACA;AACD,WAAO;AAAA,MACN,MAAM,IAAI,kBAAkB;AAAA,QAC3B,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,IAAI,EAAE,MAAM,eAAA;AAAA,QAAe;AAAA,MAC5B,CACA;AAAA,MACD,MAAM;AAAA,QACL,MAAM,EAAE,MAAM,sBAAA;AAAA,QACd,SAAS,EAAE,MAAM,mBAAA;AAAA,MAAmB;AAAA,MAErC,SAAS,OAAO,QAAQ,MAAM,YAAY;AACzC,eAAO,MAAM,QAAQ,mBAAmB,oBAAoB,QAAQ,KAAK,MAAM,KAAK,OAAO;AAAA,MAC5F;AAAA,IAAA;AAAA,EAEF;AACD;"}
@@ -1 +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,QAAAA,eAAeC,QAAAA,aAAa,EAAE;AAAA,MAAA;AAAA,IAClD,CACA,CAAA;AACO,kBAAA,MAAA,yBAAwB,IAAIF,0BAAkB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,OAAO,EAAE,MAAM,IAAIC,QAAA,eAAeE,QAAU,UAAA,EAAE;AAAA,QAC9C,OAAO,EAAE,MAAMD,QAAc,cAAA;AAAA,MAAA;AAAA,IAC9B,CACA,CAAA;AACO,kBAAA,MAAA,oBAAmB,IAAIE,yBAAiB;AAAA,MAC/C,MAAM;AAAA,MACN,OAAO,MAAM;AAAA,QACZ,KAAK;AAAA,QACL,KAAK;AAAA,MAAA;AAAA,IACN,CACA,CAAA;AAEO,kBAAA,MAAA,yBAAwB,IAAIJ,0BAAkB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ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QAAA;AAAA,YACT,IAAII,QAAA,YAAY,IAAIJ,QAAAA,eAAe,IAAII,QAAAA,YAAY,IAAIJ,uBAAe,KAAK,gBAAgB,CAAC,CAAC,CAAC;AAAA,UAAA;AAAA,QAEhG;AAAA,QACA,MAAM;AAAA,UACL,MAAM,IAAIA,uBAAe,KAAK,iBAAiB;AAAA,QAChD;AAAA,QACA,SAAS,EAAE,MAAMC,QAAc,cAAA;AAAA,MAAA;AAAA,IAChC,CACA,CAAA;AAEM,kBAAA,MAAA,uBAAsB,IAAID,uBAAe,IAAII,oBAAY,IAAIJ,uBAAe,KAAK,eAAe,CAAC,CAAC,CAAA;AAElG,kBAAA,MAAA,sBAAqB,IAAIQ,6BAAqB;AAAA,MACpD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,IAAI,EAAE,MAAM,IAAIR,QAAA,eAAeK,QAAc,cAAA,EAAE;AAAA,QAC/C,cAAc,EAAE,MAAMJ,sBAAc;AAAA,QACpC,QAAQ,EAAE,MAAM,KAAK,oBAAoB;AAAA,MAAA;AAAA,IAC1C,CACA,CAAA;AAAA,EAAA;AACF;;"}
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;AACN,kBAAA,MAAQ,yBAAwB,IAAIA,0BAAkB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,OAAO,EAAE,MAAM,IAAIC,QAAAA,eAAeC,QAAAA,aAAa,EAAA;AAAA,MAAE;AAAA,IAClD,CACA,CAAA;AACD,kBAAA,MAAQ,yBAAwB,IAAIF,0BAAkB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,OAAO,EAAE,MAAM,IAAIC,QAAAA,eAAeE,QAAAA,UAAU,EAAA;AAAA,QAC5C,OAAO,EAAE,MAAMD,QAAAA,cAAA;AAAA,MAAc;AAAA,IAC9B,CACA,CAAA;AACD,kBAAA,MAAQ,oBAAmB,IAAIE,yBAAiB;AAAA,MAC/C,MAAM;AAAA,MACN,OAAO,MAAM;AAAA,QACZ,KAAK;AAAA,QACL,KAAK;AAAA,MAAA;AAAA,IACN,CACA,CAAA;AAED,kBAAA,MAAQ,yBAAwB,IAAIJ,0BAAkB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,MAAM,EAAE,MAAM,IAAIC,QAAAA,eAAeC,QAAAA,aAAa,EAAA;AAAA,MAAE;AAAA,IACjD,CACA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AAe,KAAK,gBAAgB,CAAC,CAAC,CAAC;AAAA,UAAA;AAAA,QAC/F;AAAA,QAED,MAAM;AAAA,UACL,MAAM,IAAIA,uBAAe,KAAK,iBAAiB;AAAA,QAAA;AAAA,QAEhD,SAAS,EAAE,MAAMC,QAAAA,cAAA;AAAA,MAAc;AAAA,IAChC,CACA,CAAA;AAED,kBAAA,MAAO,uBAAsB,IAAID,uBAAe,IAAII,oBAAY,IAAIJ,uBAAe,KAAK,eAAe,CAAC,CAAC,CAAA;AAEzG,kBAAA,MAAO,sBAAqB,IAAIQ,6BAAqB;AAAA,MACpD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,IAAI,EAAE,MAAM,IAAIR,QAAAA,eAAeK,QAAAA,cAAc,EAAA;AAAA,QAC7C,cAAc,EAAE,MAAMJ,sBAAA;AAAA,QACtB,QAAQ,EAAE,MAAM,KAAK,oBAAA;AAAA,MAAoB;AAAA,IAC1C,CACA,CAAA;AAAA,EAAA;AACF;;"}
@@ -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,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,q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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
+ {"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;AACN,kBAAA,MAAQ,yBAAwB,IAAI,kBAAkB;AAAA,MACrD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,OAAO,EAAE,MAAM,IAAI,eAAe,aAAa,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BAAkB,EAAE,OAAO,CAAC,KAAK,UAAU,EAAE,GAAG,KAAK,CAAC,IAAI,GAAG,CAAA,EAAC,IAAM,CAAA,CAAE;AAAA,IAAA,CACnG,CAAA;AAED,kBAAA,MAAO,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,QAAA;AAAA,QAEpF,OAAO;AAAA,UACN,MAAM,IAAI;AAAA,YACT,IAAI,YAAY,IAAI,eAAe,IAAI,YAAY,IAAI,eAAe,KAAK,gBAAgB,CAAC,CAAC,CAAC;AAAA,UAAA;AAAA,QAC/F;AAAA,QAED,MAAM;AAAA,UACL,MAAM,IAAI,eAAe,KAAK,iBAAiB;AAAA,QAAA;AAAA,QAEhD,SAAS,EAAE,MAAM,cAAA;AAAA,MAAc;AAAA,IAChC,CACA,CAAA;AAED,kBAAA,MAAO,uBAAsB,IAAI,eAAe,IAAI,YAAY,IAAI,eAAe,KAAK,eAAe,CAAC,CAAC,CAAA;AAEzG,kBAAA,MAAO,sBAAqB,IAAI,qBAAqB;AAAA,MACpD,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,IAAI,EAAE,MAAM,IAAI,eAAe,cAAc,EAAA;AAAA,QAC7C,cAAc,EAAE,MAAM,cAAA;AAAA,QACtB,QAAQ,EAAE,MAAM,KAAK,oBAAA;AAAA,MAAoB;AAAA,IAC1C,CACA,CAAA;AAAA,EAAA;AACF;"}
@@ -28,10 +28,7 @@ class ValidationQueriesProvider {
28
28
  args: {
29
29
  data: { type: new graphql.GraphQLNonNull(dataType) }
30
30
  },
31
- resolve: (parent, args, context, info) => context.timer(
32
- `GraphQL.query.${info.fieldName}`,
33
- () => context.executionContainer.validationResolver.validateCreate(entity, args)
34
- )
31
+ resolve: (parent, args, context, info) => context.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateCreate(entity, args))
35
32
  };
36
33
  }
37
34
  getValidateUpdateQuery(entity) {
@@ -52,10 +49,7 @@ class ValidationQueriesProvider {
52
49
  },
53
50
  data: { type: new graphql.GraphQLNonNull(dataType) }
54
51
  },
55
- resolve: (parent, args, context, info) => context.timer(
56
- `GraphQL.query.${info.fieldName}`,
57
- () => context.executionContainer.validationResolver.validateUpdate(entity, args)
58
- )
52
+ resolve: (parent, args, context, info) => context.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateUpdate(entity, args))
59
53
  };
60
54
  }
61
55
  }
@@ -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;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A,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
+ {"version":3,"file":"ValidationQueriesProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/ValidationQueriesProvider.ts"],"sourcesContent":["import { GraphQLFieldConfig, GraphQLNonNull } from 'graphql'\nimport { Context } from '../types'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { EntityInputProvider, EntityInputType } from './mutations'\nimport { Input, Model } from '@contember/schema'\nimport { filterObject } from '../utils'\nimport { ResultSchemaTypeProvider } from './ResultSchemaTypeProvider'\n\ntype FieldConfig<TArgs> = GraphQLFieldConfig<Context, any, TArgs>\n\nexport class ValidationQueriesProvider {\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityInputProvider: EntityInputProvider<EntityInputType.update>,\n\t\tprivate readonly resultSchemaTypeProvider: ResultSchemaTypeProvider,\n\t) {}\n\n\tpublic getQueries(entity: Model.Entity): { [fieldName: string]: FieldConfig<any> } {\n\t\tconst entityName = entity.name\n\t\tconst validations: { [fieldName: string]: FieldConfig<any> | undefined } = {}\n\t\tvalidations[`validateCreate${entityName}`] = this.getValidateCreateQuery(entity)\n\t\tvalidations[`validateUpdate${entityName}`] = this.getValidateUpdateQuery(entity)\n\n\t\treturn filterObject(validations, (key, value): value is FieldConfig<any> => value !== undefined)\n\t}\n\n\tprivate getValidateCreateQuery(entity: Model.Entity): FieldConfig<Input.CreateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.createEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateCreate(entity, args)),\n\t\t}\n\t}\n\n\tprivate getValidateUpdateQuery(entity: Model.Entity): FieldConfig<Input.UpdateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.updateEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateUpdate(entity, args)),\n\t\t}\n\t}\n}\n"],"names":["filterObject","GraphQLNonNull"],"mappings":";;;;;AAUO,MAAM,0BAA0B;AAAA,EACtC,YACkB,mBACA,2BACA,2BACA,0BAChB;AAJgB,SAAA,oBAAA;AACA,SAAA,4BAAA;AACA,SAAA,4BAAA;AACA,SAAA,2BAAA;AAAA,EACf;AAAA,EAEI,WAAW,QAAiE;AAClF,UAAM,aAAa,OAAO;AAC1B,UAAM,cAAqE,CAAA;AAC3E,gBAAY,iBAAiB,UAAU,EAAE,IAAI,KAAK,uBAAuB,MAAM;AAC/E,gBAAY,iBA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AA,IAAA;AAAA,EAEpI;AACD;;"}
@@ -26,10 +26,7 @@ class ValidationQueriesProvider {
26
26
  args: {
27
27
  data: { type: new GraphQLNonNull(dataType) }
28
28
  },
29
- resolve: (parent, args, context, info) => context.timer(
30
- `GraphQL.query.${info.fieldName}`,
31
- () => context.executionContainer.validationResolver.validateCreate(entity, args)
32
- )
29
+ resolve: (parent, args, context, info) => context.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateCreate(entity, args))
33
30
  };
34
31
  }
35
32
  getValidateUpdateQuery(entity) {
@@ -50,10 +47,7 @@ class ValidationQueriesProvider {
50
47
  },
51
48
  data: { type: new GraphQLNonNull(dataType) }
52
49
  },
53
- resolve: (parent, args, context, info) => context.timer(
54
- `GraphQL.query.${info.fieldName}`,
55
- () => context.executionContainer.validationResolver.validateUpdate(entity, args)
56
- )
50
+ resolve: (parent, args, context, info) => context.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateUpdate(entity, args))
57
51
  };
58
52
  }
59
53
  }
@@ -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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,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
+ {"version":3,"file":"ValidationQueriesProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/ValidationQueriesProvider.ts"],"sourcesContent":["import { GraphQLFieldConfig, GraphQLNonNull } from 'graphql'\nimport { Context } from '../types'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { EntityInputProvider, EntityInputType } from './mutations'\nimport { Input, Model } from '@contember/schema'\nimport { filterObject } from '../utils'\nimport { ResultSchemaTypeProvider } from './ResultSchemaTypeProvider'\n\ntype FieldConfig<TArgs> = GraphQLFieldConfig<Context, any, TArgs>\n\nexport class ValidationQueriesProvider {\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityInputProvider: EntityInputProvider<EntityInputType.update>,\n\t\tprivate readonly resultSchemaTypeProvider: ResultSchemaTypeProvider,\n\t) {}\n\n\tpublic getQueries(entity: Model.Entity): { [fieldName: string]: FieldConfig<any> } {\n\t\tconst entityName = entity.name\n\t\tconst validations: { [fieldName: string]: FieldConfig<any> | undefined } = {}\n\t\tvalidations[`validateCreate${entityName}`] = this.getValidateCreateQuery(entity)\n\t\tvalidations[`validateUpdate${entityName}`] = this.getValidateUpdateQuery(entity)\n\n\t\treturn filterObject(validations, (key, value): value is FieldConfig<any> => value !== undefined)\n\t}\n\n\tprivate getValidateCreateQuery(entity: Model.Entity): FieldConfig<Input.CreateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.createEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateCreate(entity, args)),\n\t\t}\n\t}\n\n\tprivate getValidateUpdateQuery(entity: Model.Entity): FieldConfig<Input.UpdateInput> | undefined {\n\t\tconst entityName = entity.name\n\t\tconst dataType = this.updateEntityInputProvider.getInput(entityName)\n\t\tif (dataType === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeProvider.getEntityUniqueWhereType(entityName)\n\t\tif (!uniqueWhere) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLNonNull(this.resultSchemaTypeProvider.validationResultType),\n\t\t\targs: {\n\t\t\t\tby: {\n\t\t\t\t\ttype: new GraphQLNonNull(uniqueWhere),\n\t\t\t\t},\n\t\t\t\tdata: { type: new GraphQLNonNull(dataType) },\n\t\t\t},\n\t\t\tresolve: (parent, args, context: Context, info) =>\n\t\t\t\tcontext.timer(`GraphQL.query.${info.fieldName}`, () => context.executionContainer.validationResolver.validateUpdate(entity, args)),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAUO,MAAM,0BAA0B;AAAA,EACtC,YACkB,mBACA,2BACA,2BACA,0BAChB;AAJgB,SAAA,oBAAA;AACA,SAAA,4BAAA;AACA,SAAA,4BAAA;AACA,SAAA,2BAAA;AAAA,EAC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kB,SACzC,QAAQ,MAAM,iBAAiB,KAAK,SAAS,IAAI,MAAM,QAAQ,mBAAmB,mBAAmB,eAAe,QAAQ,IAAI,CAAC;AAAA,IAAA;AAAA,EAEpI;AACD;"}
@@ -45,9 +45,7 @@ class WhereTypeProvider {
45
45
  const combinations = [];
46
46
  const possibleUniqueWhereFields = uniqueWhereFields.getFieldsForUniqueWhere(this.schema, entity);
47
47
  const uniqueKeys = possibleUniqueWhereFields.filter(
48
- (uniqueKey) => uniqueKey.every(
49
- (it) => schemaUtils.acceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor.FieldAccessVisitor(schema.Acl.Operation.read, this.authorizator))
50
- )
48
+ (uniqueKey) => uniqueKey.every((it) => schemaUtils.acceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor.FieldAccessVisitor(schema.Acl.Operation.read, this.authorizator)))
51
49
  );
52
50
  for (const uniqueKey of uniqueKeys) {
53
51
  combinations.push(uniqueKey.join(", "));
@@ -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)[0] }),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate getEntityWhereFields(name: string, where: GraphQLInputObjectType) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfields[fieldName] = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => ({ type: this.conditionTypeProvider.getCondition(column) }),\n\t\t\t\tvisitRelation: ({ relation }) => ({ type: this.getEntityWhereType(relation.target) }),\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig>)\n\t\t}\n\n\t\tfields.and = { type: new GraphQLList(where) }\n\t\tfields.or = { type: new GraphQLList(where) }\n\t\tfields.not = { type: where }\n\n\t\treturn fields\n\t}\n}\n"],"names":["schema","singletonFactory","Acl","ImplementationException","GraphQLInputObjectType","GqlTypeName","getEntity","getFieldsForUniqueWhere","acceptFieldVisitor","FieldAccessVisitor","capitalizeFirstLetter","GraphQLList"],"mappings":";;;;;;;;;;;;;;AAWO,MAAM,kBAAkB;AAAA,EAI9B,YACkBA,SACA,cACA,oBACA,uBAChB;AAJgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,wBAAA;AAPlB,kBAAA,MAAQ,kBAAiBC,kCAAiB,CAAA,SAAQ,KAAK,sBAAsB,IAAI,CAAC,CAAA;AAClF,kBAAA,MAAQ,wBAAuBA,kCAAiB,CAAA,SAAQ,KAAK,4BAA4B,IAAI,CAAC,CAAA;AAAA,EAAA;AAAA,EASvF,mBAAmB,YAA4C;AACjE,QAAA,KAAK,aAAa,oBAAoBC,OAAAA,IAAI,UAAU,MAAM,UAAU,MAAM,MAAM;AACnF,YAAM,IAAIC,UAAAA,wBAAwB;AAAA,IAAA;AAE5B,WAAA,KAAK,eAAe,UAAU;AAAA,EAAA;AAAA,EAG/B,yBAAyB,YAAwD;AACnF,QAAA,KAAK,aAAa,oBAAoBD,OAAAA,IAAI,UAAU,MAAM,UAAU,MAAM,MAAM;AAC5E,aAAA;AAAA,IAAA;AAED,WAAA,KAAK,qBAAqB,UAAU;AAAA,EAAA;AAAA,EAGpC,sBAAsB,YAAoB;AAC3C,UAAA,QAAgC,IAAIE,+BAAuB;AAAA,MAChE,MAAMC,oBAAc,UAAU;AAAA,MAC9B,QAAQ,MAAM,KAAK,qBAAqB,YAAY,KAAK;AAAA,IAAA,CACzD;AAEM,WAAA;AAAA,EAAA;AAAA,EAGA,4BAA4B,YAAoB,iBAA0B;AACjF,UAAM,SAASC,YAAA,UAAU,KAAK,Q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SAAS,KAAK,OAAO,SAAS,IAAI;AAE7B,eAAA,aAAa,OAAO,QAAQ;AACtC,UAAI,CAAC,OAAO,OAAO,eAAe,SAAS,GAAG;AAC7C;AAAA,MAAA;AAED,YAAM,gBAAgB,IAAIM,sCAAmBP,OAAAA,IAAI,UAAU,MAAM,KAAK,YAAY;AAClF,UAAI,CAACM,YAAmB,mBAAA,KAAK,QAAQ,MAAM,WAAW,aAAa,GAAG;AACrE;AAAA,MAAA;AAED,aAAO,SAAS,IAAIA,YAAA,mBAAmB,KAAK,QAAQ,MAAM,WAAW;AAAA,QACpE,aAAa,CAAC,EAAE,OAAO,OAAO,EAAE,MAAM,KAAK,sBAAsB,aAAa,MAAM;QACpF,eAAe,CAAC,EAAE,SAAS,OAAO,EAAE,MAAM,KAAK,mBAAmB,SAAS,MAAM,EAAE;AAAA,MAAA,CACpC;AAAA,IAAA;AAGjD,WAAO,MAAM,EAAE,MAAM,IAAIG,QAAA,YAAY,KAAK,EAAE;AAC5C,WAAO,KAAK,EAAE,MAAM,IAAIA,QAAA,YAAY,KAAK,EAAE;AACpC,WAAA,MAAM,EAAE,MAAM,MAAM;AAEpB,WAAA;AAAA,EAAA;AAET;;"}
1
+ {"version":3,"file":"WhereTypeProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/WhereTypeProvider.ts"],"sourcesContent":["import { Acl, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getEntity } from '@contember/schema-utils'\nimport { GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLList } from 'graphql'\nimport { capitalizeFirstLetter, getFieldsForUniqueWhere, singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { ConditionTypeProvider } from './ConditionTypeProvider'\nimport { GqlTypeName } from './utils'\nimport { Authorizator } from '../acl'\nimport { FieldAccessVisitor } from './FieldAccessVisitor'\nimport { ImplementationException } from '../exception'\n\nexport class WhereTypeProvider {\n\tprivate whereSingleton = singletonFactory(name => this.createEntityWhereType(name))\n\tprivate uniqueWhereSingleton = singletonFactory(name => this.createEntityUniqueWhereType(name))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly conditionTypeProvider: ConditionTypeProvider,\n\t) {}\n\n\tpublic getEntityWhereType(entityName: string): GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.whereSingleton(entityName)\n\t}\n\n\tpublic getEntityUniqueWhereType(entityName: string): undefined | GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.uniqueWhereSingleton(entityName)\n\t}\n\n\tprivate createEntityWhereType(entityName: string) {\n\t\tconst where: GraphQLInputObjectType = new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}Where`,\n\t\t\tfields: () => this.getEntityWhereFields(entityName, where),\n\t\t})\n\n\t\treturn where\n\t}\n\n\tprivate createEntityUniqueWhereType(entityName: string, withoutRelation?: string) {\n\t\tconst entity = getEntity(this.schema, entityName)\n\n\t\tconst combinations: string[] = []\n\n\t\tconst possibleUniqueWhereFields = getFieldsForUniqueWhere(this.schema, entity)\n\t\tconst uniqueKeys: (readonly string[])[] = possibleUniqueWhereFields.filter(uniqueKey =>\n\t\t\tuniqueKey.every(it => acceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator)))\n\t\t)\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tcombinations.push(uniqueKey.join(', '))\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: capitalizeFirstLetter(entityName) + 'UniqueWhere',\n\t\t\t// description: `Valid combinations are: (${combinations.join('), (')})`, generates invalid schema file\n\t\t\tfields: () => this.getUniqueWhereFields(entity, uniqueKeys),\n\t\t})\n\t}\n\n\tpublic getUniqueWhereFields(entity: Model.Entity, uniqueKeys: (readonly string[])[]) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tfor (const field of uniqueKey) {\n\t\t\t\tif (fields[field] !== undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfields[field] = acceptFieldVisitor<GraphQLInputFieldConfig>(this.schema, entity, field, {\n\t\t\t\t\tvisitRelation: ({ targetEntity }) => {\n\t\t\t\t\t\t// if (!isIt<Model.JoiningColumnRelation>(relation, 'joiningColumn')) {\n\t\t\t\t\t\t// \tthrow new Error('Only column or owning relation can be a part of unique key')\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tconst uniqueWhere = this.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\t\t\tif (!uniqueWhere) {\n\t\t\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn { type: uniqueWhere }\n\t\t\t\t\t},\n\t\t\t\t\tvisitColumn: ({ column }) => ({ type: this.columnTypeResolver.getType(column)[0] }),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate getEntityWhereFields(name: string, where: GraphQLInputObjectType) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfields[fieldName] = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => ({ type: this.conditionTypeProvider.getCondition(column) }),\n\t\t\t\tvisitRelation: ({ relation }) => ({ type: this.getEntityWhereType(relation.target) }),\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig>)\n\t\t}\n\n\t\tfields.and = { type: new GraphQLList(where) }\n\t\tfields.or = { type: new GraphQLList(where) }\n\t\tfields.not = { type: where }\n\n\t\treturn fields\n\t}\n}\n"],"names":["schema","singletonFactory","Acl","ImplementationException","GraphQLInputObjectType","GqlTypeName","getEntity","getFieldsForUniqueWhere","acceptFieldVisitor","FieldAccessVisitor","capitalizeFirstLetter","GraphQLList"],"mappings":";;;;;;;;;;;;;;AAWO,MAAM,kBAAkB;AAAA,EAI9B,YACkBA,SACA,cACA,oBACA,uBAChB;AAJgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,wBAAA;AAPlB,kBAAA,MAAQ,kBAAiBC,kCAAiB,CAAA,SAAQ,KAAK,sBAAsB,IAAI,CAAC,CAAA;AAClF,kBAAA,MAAQ,wBAAuBA,kCAAiB,CAAA,SAAQ,KAAK,4BAA4B,IAAI,CAAC,CAAA;AAAA,EAO3F;AAAA,EAEI,mBAAmB,YAA4C;AACrE,QAAI,KAAK,aAAa,oBAAoBC,OAAAA,IAAI,UAAU,MAAM,UAAU,MAAM,MAAM;AACnF,YAAM,IAAIC,UAAAA,wBAAA;AAAA,IACX;AACA,WAAO,KAAK,eAAe,UAAU;AAAA,EACtC;AAAA,EAEO,yBAAyB,YAAwD;AACvF,QAAI,KAAK,aAAa,oBAAoBD,OAAAA,IAAI,UAAU,MAAM,UAAU,MAAM,MAAM;AACnF,aAAO;AAAA,IACR;AACA,WAAO,KAAK,qBAAqB,UAAU;AAAA,EAC5C;AAAA,EAEQ,sBAAsB,YAAoB;AACjD,UAAM,QAAgC,IAAIE,+BAAuB;AAAA,MAChE,MAAMC,MAAAA,cAAc,UAAU;AAAA,MAC9B,QAAQ,MAAM,KAAK,qBAAqB,YAAY,KAAK;AAAA,IAAA,CAC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AA,EACR;AAAA,EAEQ,qBAAqB,MAAc,OAA+B;AACzE,UAAM,SAAqC,CAAA;AAC3C,UAAM,SAAS,KAAK,OAAO,SAAS,IAAI;AAExC,eAAW,aAAa,OAAO,QAAQ;AACtC,UAAI,CAAC,OAAO,OAAO,eAAe,SAAS,GAAG;AAC7C;AAAA,MACD;AACA,YAAM,gBAAgB,IAAIM,sCAAmBP,OAAAA,IAAI,UAAU,MAAM,KAAK,YAAY;AAClF,UAAI,CAACM,YAAAA,mBAAmB,KAAK,QAAQ,MAAM,WAAW,aAAa,GAAG;AACrE;AAAA,MACD;AACA,aAAO,SAAS,IAAIA,YAAAA,mBAAmB,KAAK,QAAQ,MAAM,WAAW;AAAA,QACpE,aAAa,CAAC,EAAE,OAAA,OAAc,EAAE,MAAM,KAAK,sBAAsB,aAAa,MAAM;QACpF,eAAe,CAAC,EAAE,SAAA,OAAgB,EAAE,MAAM,KAAK,mBAAmB,SAAS,MAAM,EAAA;AAAA,MAAE,CACpC;AAAA,IACjD;AAEA,WAAO,MAAM,EAAE,MAAM,IAAIG,QAAAA,YAAY,KAAK,EAAA;AAC1C,WAAO,KAAK,EAAE,MAAM,IAAIA,QAAAA,YAAY,KAAK,EAAA;AACzC,WAAO,MAAM,EAAE,MAAM,MAAA;AAErB,WAAO;AAAA,EACR;AACD;;"}
@@ -43,9 +43,7 @@ class WhereTypeProvider {
43
43
  const combinations = [];
44
44
  const possibleUniqueWhereFields = getFieldsForUniqueWhere(this.schema, entity);
45
45
  const uniqueKeys = possibleUniqueWhereFields.filter(
46
- (uniqueKey) => uniqueKey.every(
47
- (it) => acceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator))
48
- )
46
+ (uniqueKey) => uniqueKey.every((it) => acceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator)))
49
47
  );
50
48
  for (const uniqueKey of uniqueKeys) {
51
49
  combinations.push(uniqueKey.join(", "));
@@ -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)[0] }),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate getEntityWhereFields(name: string, where: GraphQLInputObjectType) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfields[fieldName] = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => ({ type: this.conditionTypeProvider.getCondition(column) }),\n\t\t\t\tvisitRelation: ({ relation }) => ({ type: this.getEntityWhereType(relation.target) }),\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig>)\n\t\t}\n\n\t\tfields.and = { type: new GraphQLList(where) }\n\t\tfields.or = { type: new GraphQLList(where) }\n\t\tfields.not = { type: where }\n\n\t\treturn fields\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAWO,MAAM,kBAAkB;AAAA,EAI9B,YACkB,QACA,cACA,oBACA,uBAChB;AAJgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,wBAAA;AAPlB,kBAAA,MAAQ,kBAAiB,iBAAiB,CAAA,SAAQ,KAAK,sBAAsB,IAAI,CAAC,CAAA;AAClF,kBAAA,MAAQ,wBAAuB,iBAAiB,CAAA,SAAQ,KAAK,4BAA4B,IAAI,CAAC,CAAA;AAAA,EAAA;AAAA,EASvF,mBAAmB,YAA4C;AACjE,QAAA,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,UAAU,MAAM,MAAM;AACnF,YAAM,IAAI,wBAAwB;AAAA,IAAA;AAE5B,WA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pC,kBAAM,cAAc,KAAK,yBAAyB,aAAa,IAAI;AACnE,gBAAI,CAAC,aAAa;AACjB,oBAAM,IAAI,wBAAwB;AAAA,YAAA;AAE5B,mBAAA,EAAE,MAAM,YAAY;AAAA,UAC5B;AAAA,UACA,aAAa,CAAC,EAAE,OAAc,OAAA,EAAE,MAAM,KAAK,mBAAmB,QAAQ,MAAM,EAAE,CAAC,EAAE;AAAA,QAAA,CACjF;AAAA,MAAA;AAAA,IACF;AAEM,WAAA;AAAA,EAAA;AAAA,EAGA,qBAAqB,MAAc,OAA+B;AACzE,UAAM,SAAqC,CAAC;AAC5C,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;AAED,aAAO,SAAS,IAAI,mBAAmB,KAAK,QAAQ,MAAM,WAAW;AAAA,QACpE,aAAa,CAAC,EAAE,OAAO,OAAO,EAAE,MAAM,KAAK,sBAAsB,aAAa,MAAM;QACpF,eAAe,CAAC,EAAE,SAAS,OAAO,EAAE,MAAM,KAAK,mBAAmB,SAAS,MAAM,EAAE;AAAA,MAAA,CACpC;AAAA,IAAA;AAGjD,WAAO,MAAM,EAAE,MAAM,IAAI,YAAY,KAAK,EAAE;AAC5C,WAAO,KAAK,EAAE,MAAM,IAAI,YAAY,KAAK,EAAE;AACpC,WAAA,MAAM,EAAE,MAAM,MAAM;AAEpB,WAAA;AAAA,EAAA;AAET;"}
1
+ {"version":3,"file":"WhereTypeProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/WhereTypeProvider.ts"],"sourcesContent":["import { Acl, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getEntity } from '@contember/schema-utils'\nimport { GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLList } from 'graphql'\nimport { capitalizeFirstLetter, getFieldsForUniqueWhere, singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { ConditionTypeProvider } from './ConditionTypeProvider'\nimport { GqlTypeName } from './utils'\nimport { Authorizator } from '../acl'\nimport { FieldAccessVisitor } from './FieldAccessVisitor'\nimport { ImplementationException } from '../exception'\n\nexport class WhereTypeProvider {\n\tprivate whereSingleton = singletonFactory(name => this.createEntityWhereType(name))\n\tprivate uniqueWhereSingleton = singletonFactory(name => this.createEntityUniqueWhereType(name))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly conditionTypeProvider: ConditionTypeProvider,\n\t) {}\n\n\tpublic getEntityWhereType(entityName: string): GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.whereSingleton(entityName)\n\t}\n\n\tpublic getEntityUniqueWhereType(entityName: string): undefined | GraphQLInputObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.uniqueWhereSingleton(entityName)\n\t}\n\n\tprivate createEntityWhereType(entityName: string) {\n\t\tconst where: GraphQLInputObjectType = new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entityName}Where`,\n\t\t\tfields: () => this.getEntityWhereFields(entityName, where),\n\t\t})\n\n\t\treturn where\n\t}\n\n\tprivate createEntityUniqueWhereType(entityName: string, withoutRelation?: string) {\n\t\tconst entity = getEntity(this.schema, entityName)\n\n\t\tconst combinations: string[] = []\n\n\t\tconst possibleUniqueWhereFields = getFieldsForUniqueWhere(this.schema, entity)\n\t\tconst uniqueKeys: (readonly string[])[] = possibleUniqueWhereFields.filter(uniqueKey =>\n\t\t\tuniqueKey.every(it => acceptFieldVisitor(this.schema, entityName, it, new FieldAccessVisitor(Acl.Operation.read, this.authorizator)))\n\t\t)\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tcombinations.push(uniqueKey.join(', '))\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: capitalizeFirstLetter(entityName) + 'UniqueWhere',\n\t\t\t// description: `Valid combinations are: (${combinations.join('), (')})`, generates invalid schema file\n\t\t\tfields: () => this.getUniqueWhereFields(entity, uniqueKeys),\n\t\t})\n\t}\n\n\tpublic getUniqueWhereFields(entity: Model.Entity, uniqueKeys: (readonly string[])[]) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tfor (const uniqueKey of uniqueKeys) {\n\t\t\tfor (const field of uniqueKey) {\n\t\t\t\tif (fields[field] !== undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfields[field] = acceptFieldVisitor<GraphQLInputFieldConfig>(this.schema, entity, field, {\n\t\t\t\t\tvisitRelation: ({ targetEntity }) => {\n\t\t\t\t\t\t// if (!isIt<Model.JoiningColumnRelation>(relation, 'joiningColumn')) {\n\t\t\t\t\t\t// \tthrow new Error('Only column or owning relation can be a part of unique key')\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tconst uniqueWhere = this.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\t\t\tif (!uniqueWhere) {\n\t\t\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn { type: uniqueWhere }\n\t\t\t\t\t},\n\t\t\t\t\tvisitColumn: ({ column }) => ({ type: this.columnTypeResolver.getType(column)[0] }),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate getEntityWhereFields(name: string, where: GraphQLInputObjectType) {\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst entity = this.schema.entities[name]\n\n\t\tfor (const fieldName in entity.fields) {\n\t\t\tif (!entity.fields.hasOwnProperty(fieldName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\t\tif (!acceptFieldVisitor(this.schema, name, fieldName, accessVisitor)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfields[fieldName] = acceptFieldVisitor(this.schema, name, fieldName, {\n\t\t\t\tvisitColumn: ({ column }) => ({ type: this.conditionTypeProvider.getCondition(column) }),\n\t\t\t\tvisitRelation: ({ relation }) => ({ type: this.getEntityWhereType(relation.target) }),\n\t\t\t} as Model.FieldVisitor<GraphQLInputFieldConfig>)\n\t\t}\n\n\t\tfields.and = { type: new GraphQLList(where) }\n\t\tfields.or = { type: new GraphQLList(where) }\n\t\tfields.not = { type: where }\n\n\t\treturn fields\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAWO,MAAM,kBAAkB;AAAA,EAI9B,YACkB,QACA,cACA,oBACA,uBAChB;AAJgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA,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,EAO3F;AAAA,EAEI,mBAAmB,YAA4C;AACrE,QAAI,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,UAAU,MAAM,MAAM;AACnF,YAAM,IAAI,wBAAA;AAAA,IACX;AACA,WAAO,KAAK,eAAe,UAAU;AAAA,EACtC;AAAA,EAEO,yBAAyB,YAAwD;AACvF,QAAI,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,UAAU,MAAM,MAAM;AACnF,aAAO;AAAA,IACR;AACA,WAAO,KAAK,qB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AE,MAAM,KAAK,mBAAmB,QAAQ,MAAM,EAAE,CAAC,EAAA;AAAA,QAAE,CACjF;AAAA,MACF;AAAA,IACD;AACA,WAAO;AAAA,EACR;AAAA,EAEQ,qBAAqB,MAAc,OAA+B;AACzE,UAAM,SAAqC,CAAA;AAC3C,UAAM,SAAS,KAAK,OAAO,SAAS,IAAI;AAExC,eAAW,aAAa,OAAO,QAAQ;AACtC,UAAI,CAAC,OAAO,OAAO,eAAe,SAAS,GAAG;AAC7C;AAAA,MACD;AACA,YAAM,gBAAgB,IAAI,mBAAmB,IAAI,UAAU,MAAM,KAAK,YAAY;AAClF,UAAI,CAAC,mBAAmB,KAAK,QAAQ,MAAM,WAAW,aAAa,GAAG;AACrE;AAAA,MACD;AACA,aAAO,SAAS,IAAI,mBAAmB,KAAK,QAAQ,MAAM,WAAW;AAAA,QACpE,aAAa,CAAC,EAAE,OAAA,OAAc,EAAE,MAAM,KAAK,sBAAsB,aAAa,MAAM;QACpF,eAAe,CAAC,EAAE,SAAA,OAAgB,EAAE,MAAM,KAAK,mBAAmB,SAAS,MAAM,EAAA;AAAA,MAAE,CACpC;AAAA,IACjD;AAEA,WAAO,MAAM,EAAE,MAAM,IAAI,YAAY,KAAK,EAAA;AAC1C,WAAO,KAAK,EAAE,MAAM,IAAI,YAAY,KAAK,EAAA;AACzC,WAAO,MAAM,EAAE,MAAM,MAAA;AAErB,WAAO;AAAA,EACR;AACD;"}
@@ -1 +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,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
+ {"version":3,"file":"FieldArgsVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldArgsVisitor.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { GraphQLFieldConfigArgumentMap, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { OrderByTypeProvider } from '../OrderByTypeProvider'\n\nexport class FieldArgsVisitor\n\timplements\n\t\tModel.ColumnVisitor<GraphQLFieldConfigArgumentMap | undefined>,\n\t\tModel.RelationByGenericTypeVisitor<GraphQLFieldConfigArgumentMap | undefined>\n{\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t) {\n\t\tthis.whereTypeProvider = whereTypeProvider\n\t}\n\n\tpublic visitColumn() {\n\t\treturn undefined\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\tconst orderBy = this.getOrderByArgs(relation)\n\t\treturn {\n\t\t\tfilter,\n\t\t\torderBy,\n\t\t\toffset: { type: GraphQLInt },\n\t\t\tlimit: { type: GraphQLInt },\n\t\t}\n\t}\n\n\tpublic visitHasOne({ relation }: Model.ManyHasOneContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\treturn { filter }\n\t}\n\n\tprivate getWhereArg(relation: Model.Relation) {\n\t\treturn { type: this.whereTypeProvider.getEntityWhereType(relation.target) }\n\t}\n\n\tprivate getOrderByArgs(relation: Model.Relation) {\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(relation.target))),\n\t\t}\n\t}\n}\n"],"names":["GraphQLInt","GraphQLList","GraphQLNonNull"],"mappings":";;;AAKO,MAAM,iBAIb;AAAA,EACC,YACkB,mBACA,qBAChB;AAFgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AAEjB,SAAK,oBAAoB;AAAA,EAC1B;AAAA,EAEO,cAAc;AACpB,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAA6C;AAClE,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,UAAM,UAAU,KAAK,eAAe,QAAQ;AAC5C,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA,QAAQ,EAAE,MAAMA,mBAAA;AAAA,MAChB,OAAO,EAAE,MAAMA,QAAAA,WAAA;AAAA,IAAW;AAAA,EAE5B;AAAA,EAEO,YAAY,EAAE,YAAqC;AACzD,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,WAAO,EAAE,OAAA;AAAA,EACV;AAAA,EAEQ,YAAY,UAA0B;AAC7C,WAAO,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,SAAS,MAAM,EAAA;AAAA,EACzE;AAAA,EAEQ,eAAe,UAA0B;AAChD,WAAO;AAAA,MACN,MAAM,IAAIC,oBAAY,IAAIC,uBAAe,KAAK,oBAAoB,qBAAqB,SAAS,MAAM,CAAC,CAAC;AAAA,IAAA;AAAA,EAE1G;AACD;;"}
@@ -1 +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,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
+ {"version":3,"file":"FieldArgsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldArgsVisitor.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { GraphQLFieldConfigArgumentMap, GraphQLInt, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { OrderByTypeProvider } from '../OrderByTypeProvider'\n\nexport class FieldArgsVisitor\n\timplements\n\t\tModel.ColumnVisitor<GraphQLFieldConfigArgumentMap | undefined>,\n\t\tModel.RelationByGenericTypeVisitor<GraphQLFieldConfigArgumentMap | undefined>\n{\n\tconstructor(\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t) {\n\t\tthis.whereTypeProvider = whereTypeProvider\n\t}\n\n\tpublic visitColumn() {\n\t\treturn undefined\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\tconst orderBy = this.getOrderByArgs(relation)\n\t\treturn {\n\t\t\tfilter,\n\t\t\torderBy,\n\t\t\toffset: { type: GraphQLInt },\n\t\t\tlimit: { type: GraphQLInt },\n\t\t}\n\t}\n\n\tpublic visitHasOne({ relation }: Model.ManyHasOneContext) {\n\t\tconst filter = this.getWhereArg(relation)\n\t\treturn { filter }\n\t}\n\n\tprivate getWhereArg(relation: Model.Relation) {\n\t\treturn { type: this.whereTypeProvider.getEntityWhereType(relation.target) }\n\t}\n\n\tprivate getOrderByArgs(relation: Model.Relation) {\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(this.orderByTypeProvider.getEntityOrderByType(relation.target))),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAKO,MAAM,iBAIb;AAAA,EACC,YACkB,mBACA,qBAChB;AAFgB,SAAA,oBAAA;AACA,SAAA,sBAAA;AAEjB,SAAK,oBAAoB;AAAA,EAC1B;AAAA,EAEO,cAAc;AACpB,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAA6C;AAClE,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,UAAM,UAAU,KAAK,eAAe,QAAQ;AAC5C,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA,QAAQ,EAAE,MAAM,WAAA;AAAA,MAChB,OAAO,EAAE,MAAM,WAAA;AAAA,IAAW;AAAA,EAE5B;AAAA,EAEO,YAAY,EAAE,YAAqC;AACzD,UAAM,SAAS,KAAK,YAAY,QAAQ;AACxC,WAAO,EAAE,OAAA;AAAA,EACV;AAAA,EAEQ,YAAY,UAA0B;AAC7C,WAAO,EAAE,MAAM,KAAK,kBAAkB,mBAAmB,SAAS,MAAM,EAAA;AAAA,EACzE;AAAA,EAEQ,eAAe,UAA0B;AAChD,WAAO;AAAA,MACN,MAAM,IAAI,YAAY,IAAI,eAAe,KAAK,oBAAoB,qBAAqB,SAAS,MAAM,CAAC,CAAC;AAAA,IAAA;AAAA,EAE1G;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldTypeVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldTypeVisitor.ts"],"sourcesContent":["import { GraphQLList, GraphQLNonNull, GraphQLOutputType } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { EntityTypeProvider } from '../EntityTypeProvider'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class FieldTypeVisitor implements Model.ColumnVisitor<GraphQLOutputType>, Model.RelationByGenericTypeVisitor<GraphQLOutputType> {\n\tconstructor(\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\n\tpublic visitColumn({ column, entity }: Model.ColumnContext): GraphQLOutputType {\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\tconst fieldPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, column.name)\n\t\tconst idPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, entity.primary)\n\t\tif (!fieldPredicate || !idPredicate) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tif (!column.nullable && (fieldPredicate === true || fieldPredicate === idPredicate)) {\n\t\t\treturn new GraphQLNonNull(type)\n\t\t}\n\t\treturn type\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext): GraphQLOutputType {\n\t\tconst entityType = this.entityTypeProvider.getEntity(relation.target)\n\t\treturn new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType)))\n\t}\n\n\tpublic visitHasOne({ relation }: Model.AnyHasOneRelationContext): GraphQLOutputType {\n\t\treturn this.entityTypeProvider.getEntity(relation.target)\n\t}\n}\n"],"names":["Acl","ImplementationException","GraphQLNonNull","GraphQLList"],"mappings":";;;;;AAOO,MAAM,iBAA0H;AAAA,EACtI,YACkB,oBACA,oBACA,cAChB;AAHgB,SAAA,qBAAA;AACA,SAAA,qBAAA;AACA,SAAA,eAAA;AAAA,EAAA;AAAA,EAIX,YAAY,EAAE,QAAQ,UAAkD;AAC9E,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AAC/C,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,IAAI;AAAA,IAAA;AAExB,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
+ {"version":3,"file":"FieldTypeVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldTypeVisitor.ts"],"sourcesContent":["import { GraphQLList, GraphQLNonNull, GraphQLOutputType } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { EntityTypeProvider } from '../EntityTypeProvider'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class FieldTypeVisitor implements Model.ColumnVisitor<GraphQLOutputType>, Model.RelationByGenericTypeVisitor<GraphQLOutputType> {\n\tconstructor(\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\n\tpublic visitColumn({ column, entity }: Model.ColumnContext): GraphQLOutputType {\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\tconst fieldPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, column.name)\n\t\tconst idPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, entity.primary)\n\t\tif (!fieldPredicate || !idPredicate) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tif (!column.nullable && (fieldPredicate === true || fieldPredicate === idPredicate)) {\n\t\t\treturn new GraphQLNonNull(type)\n\t\t}\n\t\treturn type\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext): GraphQLOutputType {\n\t\tconst entityType = this.entityTypeProvider.getEntity(relation.target)\n\t\treturn new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType)))\n\t}\n\n\tpublic visitHasOne({ relation }: Model.AnyHasOneRelationContext): GraphQLOutputType {\n\t\treturn this.entityTypeProvider.getEntity(relation.target)\n\t}\n}\n"],"names":["Acl","ImplementationException","GraphQLNonNull","GraphQLList"],"mappings":";;;;;AAOO,MAAM,iBAA0H;AAAA,EACtI,YACkB,oBACA,oBACA,cAChB;AAHgB,SAAA,qBAAA;AACA,SAAA,qBAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EAEO,YAAY,EAAE,QAAQ,UAAkD;AAC9E,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,UAAM,iBAAiB,KAAK,aAAa,kBAAkBA,OAAAA,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,IAAI;AACvG,UAAM,cAAc,KAAK,aAAa,kBAAkBA,OAAAA,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,OAAO;AACvG,QAAI,CAAC,kBAAkB,CAAC,aAAa;AACpC,YAAM,IAAIC,UAAAA,wBAAA;AAAA,IACX;AACA,QAAI,CAAC,OAAO,aAAa,mBAAmB,QAAQ,mBAAmB,cAAc;AACpF,aAAO,IAAIC,QAAAA,eAAe,IAAI;AAAA,IAC/B;AACA,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAAgE;AACrF,UAAM,aAAa,KAAK,mBAAmB,UAAU,SAAS,MAAM;AACpE,WAAO,IAAIA,QAAAA,eAAe,IAAIC,QAAAA,YAAY,IAAID,QAAAA,eAAe,UAAU,CAAC,CAAC;AAAA,EAC1E;AAAA,EAEO,YAAY,EAAE,YAA+D;AACnF,WAAO,KAAK,mBAAmB,UAAU,SAAS,MAAM;AAAA,EACzD;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldTypeVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldTypeVisitor.ts"],"sourcesContent":["import { GraphQLList, GraphQLNonNull, GraphQLOutputType } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { EntityTypeProvider } from '../EntityTypeProvider'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class FieldTypeVisitor implements Model.ColumnVisitor<GraphQLOutputType>, Model.RelationByGenericTypeVisitor<GraphQLOutputType> {\n\tconstructor(\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\n\tpublic visitColumn({ column, entity }: Model.ColumnContext): GraphQLOutputType {\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\tconst fieldPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, column.name)\n\t\tconst idPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, entity.primary)\n\t\tif (!fieldPredicate || !idPredicate) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tif (!column.nullable && (fieldPredicate === true || fieldPredicate === idPredicate)) {\n\t\t\treturn new GraphQLNonNull(type)\n\t\t}\n\t\treturn type\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext): GraphQLOutputType {\n\t\tconst entityType = this.entityTypeProvider.getEntity(relation.target)\n\t\treturn new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType)))\n\t}\n\n\tpublic visitHasOne({ relation }: Model.AnyHasOneRelationContext): GraphQLOutputType {\n\t\treturn this.entityTypeProvider.getEntity(relation.target)\n\t}\n}\n"],"names":[],"mappings":";;;AAOO,MAAM,iBAA0H;AAAA,EACtI,YACkB,oBACA,oBACA,cAChB;AAHgB,SAAA,qBAAA;AACA,SAAA,qBAAA;AACA,SAAA,eAAA;AAAA,EAAA;AAAA,EAIX,YAAY,EAAE,QAAQ,UAAkD;AAC9E,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AAC/C,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,IAAI;AAAA,IAAA;AAExB,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
+ {"version":3,"file":"FieldTypeVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/entities/FieldTypeVisitor.ts"],"sourcesContent":["import { GraphQLList, GraphQLNonNull, GraphQLOutputType } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { EntityTypeProvider } from '../EntityTypeProvider'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class FieldTypeVisitor implements Model.ColumnVisitor<GraphQLOutputType>, Model.RelationByGenericTypeVisitor<GraphQLOutputType> {\n\tconstructor(\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly entityTypeProvider: EntityTypeProvider,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {\n\t}\n\n\tpublic visitColumn({ column, entity }: Model.ColumnContext): GraphQLOutputType {\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\tconst fieldPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, column.name)\n\t\tconst idPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, entity.primary)\n\t\tif (!fieldPredicate || !idPredicate) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tif (!column.nullable && (fieldPredicate === true || fieldPredicate === idPredicate)) {\n\t\t\treturn new GraphQLNonNull(type)\n\t\t}\n\t\treturn type\n\t}\n\n\tpublic visitHasMany({ relation }: Model.AnyHasManyRelationContext): GraphQLOutputType {\n\t\tconst entityType = this.entityTypeProvider.getEntity(relation.target)\n\t\treturn new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(entityType)))\n\t}\n\n\tpublic visitHasOne({ relation }: Model.AnyHasOneRelationContext): GraphQLOutputType {\n\t\treturn this.entityTypeProvider.getEntity(relation.target)\n\t}\n}\n"],"names":[],"mappings":";;;AAOO,MAAM,iBAA0H;AAAA,EACtI,YACkB,oBACA,oBACA,cAChB;AAHgB,SAAA,qBAAA;AACA,SAAA,qBAAA;AACA,SAAA,eAAA;AAAA,EAElB;AAAA,EAEO,YAAY,EAAE,QAAQ,UAAkD;AAC9E,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,UAAM,iBAAiB,KAAK,aAAa,kBAAkB,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,IAAI;AACvG,UAAM,cAAc,KAAK,aAAa,kBAAkB,IAAI,UAAU,MAAM,OAAO,MAAM,OAAO,OAAO;AACvG,QAAI,CAAC,kBAAkB,CAAC,aAAa;AACpC,YAAM,IAAI,wBAAA;AAAA,IACX;AACA,QAAI,CAAC,OAAO,aAAa,mBAAmB,QAAQ,mBAAmB,cAAc;AACpF,aAAO,IAAI,eAAe,IAAI;AAAA,IAC/B;AACA,WAAO;AAAA,EACR;AAAA,EAEO,aAAa,EAAE,YAAgE;AACrF,UAAM,aAAa,KAAK,mBAAmB,UAAU,SAAS,MAAM;AACpE,WAAO,IAAI,eAAe,IAAI,YAAY,IAAI,eAAe,UAAU,CAAC,CAAC;AAAA,EAC1E;AAAA,EAEO,YAAY,EAAE,YAA+D;AACnF,WAAO,KAAK,mBAAmB,UAAU,SAAS,MAAM;AAAA,EACzD;AACD;"}
@@ -1 +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,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
+ {"version":3,"file":"ConnectOrCreateRelationInputProvider.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/ConnectOrCreateRelationInputProvider.ts"],"sourcesContent":["import { Accessor, Interface, singletonFactory } from '../../utils'\nimport { GraphQLInputObjectType, GraphQLNonNull } from 'graphql'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { Model } from '@contember/schema'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception'\n\ntype Args = {\n\tentityName: string\n\trelationName: string\n}\n\nexport class ConnectOrCreateRelationInputProvider {\n\tprivate inputs = singletonFactory<GraphQLInputObjectType, Args>(id => this.createInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t) {\n\t}\n\n\tgetInput(entityName: string, relationName: string) {\n\t\treturn this.inputs({ entityName, relationName })\n\t}\n\n\tprivate createInput(entityName: string, relationName: string) {\n\t\treturn acceptFieldVisitor<GraphQLInputObjectType>(this.schema, entityName, relationName, {\n\t\t\tvisitColumn() {\n\t\t\t\tthrow new ImplementationException()\n\t\t\t},\n\t\t\tvisitRelation: ({ entity, targetEntity, targetRelation, relation }) => {\n\t\t\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\t\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\t\t\tif (!uniqueWhere || !createInput) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\n\t\t\t\treturn new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}ConnectOrCreate${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tconnect: { type: new GraphQLNonNull(uniqueWhere) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInput) },\n\t\t\t\t\t}),\n\t\t\t\t})\n\t\t\t},\n\t\t})\n\t}\n}\n"],"names":["singletonFactory","acceptFieldVisitor","ImplementationException","GraphQLInputObjectType","GqlTypeName","GraphQLNonNull"],"mappings":";;;;;;;;;;AAcO,MAAM,qCAAqC;AAAA,EAGjD,YACkB,QACA,kBACA,mCAChB;AAHgB,SAAA,SAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AALlB,kBAAA,MAAQ,UAASA,iBAAAA,iBAA+C,CAAA,OAAM,KAAK,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAOtH;AAAA,EAEA,SAAS,YAAoB,cAAsB;AAClD,WAAO,KAAK,OAAO,EAAE,YAAY,cAAc;AAAA,EAChD;AAAA,EAEQ,YAAY,YAAoB,cAAsB;AAC7D,WAAOC,YAAAA,mBAA2C,KAAK,QAAQ,YAAY,cAAc;AAAA,MACxF,cAAc;AACb,cAAM,IAAIC,UAAAA,wBAAA;AAAA,MACX;AAAA,MACA,eAAe,CAAC,EAAE,QAAQ,cAAc,gBAAgB,eAAe;AACtE,cAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,cAAM,aAAa,iBAAiB,eAAe,OAAO;AAC1D,cAAM,cAAc,KAAK,kCAAkC,IAAA,EAAM,SAAS,aAAa,MAAM,UAAU;AACvG,YAAI,CAAC,eAAe,CAAC,aAAa;AACjC,gBAAM,IAAIA,UAAAA,wBAAA;AAAA,QACX;AAEA,eAAO,IAAIC,QAAAA,uBAAuB;AAAA,UACjC,MAAMC,MAAAA,cAAc,OAAO,IAAI,kBAAkB,SAAS,IAAI;AAAA,UAC9D,QAAQ,OAAO;AAAA,YACd,SAAS,EAAE,MAAM,IAAIC,QAAAA,eAAe,WAAW,EAAA;AAAA,YAC/C,QAAQ,EAAE,MAAM,IAAIA,QAAAA,eAAe,WAAW,EAAA;AAAA,UAAE;AAAA,QACjD,CACA;AAAA,MACF;AAAA,IAAA,CACA;AAAA,EACF;AACD;;"}
@@ -1 +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,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
+ {"version":3,"file":"ConnectOrCreateRelationInputProvider.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/ConnectOrCreateRelationInputProvider.ts"],"sourcesContent":["import { Accessor, Interface, singletonFactory } from '../../utils'\nimport { GraphQLInputObjectType, GraphQLNonNull } from 'graphql'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { Model } from '@contember/schema'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception'\n\ntype Args = {\n\tentityName: string\n\trelationName: string\n}\n\nexport class ConnectOrCreateRelationInputProvider {\n\tprivate inputs = singletonFactory<GraphQLInputObjectType, Args>(id => this.createInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t) {\n\t}\n\n\tgetInput(entityName: string, relationName: string) {\n\t\treturn this.inputs({ entityName, relationName })\n\t}\n\n\tprivate createInput(entityName: string, relationName: string) {\n\t\treturn acceptFieldVisitor<GraphQLInputObjectType>(this.schema, entityName, relationName, {\n\t\t\tvisitColumn() {\n\t\t\t\tthrow new ImplementationException()\n\t\t\t},\n\t\t\tvisitRelation: ({ entity, targetEntity, targetRelation, relation }) => {\n\t\t\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\t\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\t\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\t\t\tif (!uniqueWhere || !createInput) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\n\t\t\t\treturn new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}ConnectOrCreate${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tconnect: { type: new GraphQLNonNull(uniqueWhere) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInput) },\n\t\t\t\t\t}),\n\t\t\t\t})\n\t\t\t},\n\t\t})\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAcO,MAAM,qCAAqC;AAAA,EAGjD,YACkB,QACA,kBACA,mCAChB;AAHgB,SAAA,SAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AALlB,kBAAA,MAAQ,UAAS,iBAA+C,CAAA,OAAM,KAAK,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAOtH;AAAA,EAEA,SAAS,YAAoB,cAAsB;AAClD,WAAO,KAAK,OAAO,EAAE,YAAY,cAAc;AAAA,EAChD;AAAA,EAEQ,YAAY,YAAoB,cAAsB;AAC7D,WAAO,mBAA2C,KAAK,QAAQ,YAAY,cAAc;AAAA,MACxF,cAAc;AACb,cAAM,IAAI,wBAAA;AAAA,MACX;AAAA,MACA,eAAe,CAAC,EAAE,QAAQ,cAAc,gBAAgB,eAAe;AACtE,cAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,cAAM,aAAa,iBAAiB,eAAe,OAAO;AAC1D,cAAM,cAAc,KAAK,kCAAkC,IAAA,EAAM,SAAS,aAAa,MAAM,UAAU;AACvG,YAAI,CAAC,eAAe,CAAC,aAAa;AACjC,gBAAM,IAAI,wBAAA;AAAA,QACX;AAEA,eAAO,IAAI,uBAAuB;AAAA,UACjC,MAAM,cAAc,OAAO,IAAI,kBAAkB,SAAS,IAAI;AAAA,UAC9D,QAAQ,OAAO;AAAA,YACd,SAAS,EAAE,MAAM,IAAI,eAAe,WAAW,EAAA;AAAA,YAC/C,QAAQ,EAAE,MAAM,IAAI,eAAe,WAAW,EAAA;AAAA,UAAE;AAAA,QACjD,CACA;AAAA,MACF;AAAA,IAAA,CACA;AAAA,EACF;AACD;"}
@@ -1 +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,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,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,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
+ {"version":3,"file":"CreateEntityInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfig, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { CreateEntityRelationInputProvider } from './CreateEntityRelationInputProvider'\nimport { Authorizator } from '../../acl'\n\nexport class CreateEntityInputFieldVisitor\n\timplements Model.ColumnVisitor<GraphQLInputFieldConfig | undefined>, Model.RelationByGenericTypeVisitor<GraphQLInputFieldConfig | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly createEntityRelationInputProvider: CreateEntityRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn({ entity, column }: Model.ColumnContext): GraphQLInputFieldConfig | undefined {\n\t\tif (entity.primary === column.name && !this.authorizator.isCustomPrimaryAllowed(entity.name)) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getFieldPermissions(Acl.Operation.create, entity.name, column.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\treturn { type }\n\t}\n\n\tpublic visitHasOne({ entity, relation }: Model.AnyHasOneRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn { type }\n\t}\n\n\tpublic visitHasMany({ entity, relation }: Model.AnyHasManyRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(type)),\n\t\t}\n\t}\n}\n"],"names":["schema","Acl","GraphQLList","GraphQLNonNull"],"mappings":";;;;AAMO,MAAM,8BAEb;AAAA,EACC,YACkBA,SACA,cACA,oBACA,mCAChB;AAJgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EACf;AAAA,EAEI,YAAY,EAAE,QAAQ,UAAoE;AAChG,QAAI,OAAO,YAAY,OAAO,QAAQ,CAAC,KAAK,aAAa,uBAAuB,OAAO,IAAI,GAAG;AAC7F,aAAO;AAAA,IACR;AACA,QAAI,KAAK,aAAa,oBAAoBC,OAAAA,IAAI,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AACnG,aAAO;AAAA,IACR;AACA,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,YAAY,EAAE,QAAQ,YAAiF;AAC7G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,aAAa,EAAE,QAAQ,YAAkF;AAC/G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAIC,QAAAA,YAAY,IAAIC,QAAAA,eAAe,IAAI,CAAC;AAAA,IAAA;AAAA,EAEhD;AACD;;"}
@@ -1 +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,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,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,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;"}
1
+ {"version":3,"file":"CreateEntityInputFieldVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfig, GraphQLList, GraphQLNonNull } from 'graphql'\nimport { Acl, Model } from '@contember/schema'\nimport { ColumnTypeResolver } from '../ColumnTypeResolver'\nimport { CreateEntityRelationInputProvider } from './CreateEntityRelationInputProvider'\nimport { Authorizator } from '../../acl'\n\nexport class CreateEntityInputFieldVisitor\n\timplements Model.ColumnVisitor<GraphQLInputFieldConfig | undefined>, Model.RelationByGenericTypeVisitor<GraphQLInputFieldConfig | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly createEntityRelationInputProvider: CreateEntityRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn({ entity, column }: Model.ColumnContext): GraphQLInputFieldConfig | undefined {\n\t\tif (entity.primary === column.name && !this.authorizator.isCustomPrimaryAllowed(entity.name)) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (this.authorizator.getFieldPermissions(Acl.Operation.create, entity.name, column.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst [type] = this.columnTypeResolver.getType(column)\n\t\treturn { type }\n\t}\n\n\tpublic visitHasOne({ entity, relation }: Model.AnyHasOneRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn { type }\n\t}\n\n\tpublic visitHasMany({ entity, relation }: Model.AnyHasManyRelationContext): GraphQLInputFieldConfig | undefined {\n\t\tconst type = this.createEntityRelationInputProvider.getCreateEntityRelationInput(entity.name, relation.name)\n\t\tif (type === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\ttype: new GraphQLList(new GraphQLNonNull(type)),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAMO,MAAM,8BAEb;AAAA,EACC,YACkB,QACA,cACA,oBACA,mCAChB;AAJgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oCAAA;AAAA,EACf;AAAA,EAEI,YAAY,EAAE,QAAQ,UAAoE;AAChG,QAAI,OAAO,YAAY,OAAO,QAAQ,CAAC,KAAK,aAAa,uBAAuB,OAAO,IAAI,GAAG;AAC7F,aAAO;AAAA,IACR;AACA,QAAI,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM;AACnG,aAAO;AAAA,IACR;AACA,UAAM,CAAC,IAAI,IAAI,KAAK,mBAAmB,QAAQ,MAAM;AACrD,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,YAAY,EAAE,QAAQ,YAAiF;AAC7G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO,EAAE,KAAA;AAAA,EACV;AAAA,EAEO,aAAa,EAAE,QAAQ,YAAkF;AAC/G,UAAM,OAAO,KAAK,kCAAkC,6BAA6B,OAAO,MAAM,SAAS,IAAI;AAC3G,QAAI,SAAS,QAAW;AACvB,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,MAAM,IAAI,YAAY,IAAI,eAAe,IAAI,CAAC;AAAA,IAAA;AAAA,EAEhD;AACD;"}
@@ -1 +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,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,gB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":3,"file":"CreateEntityRelationAllowedOperationsVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class CreateEntityRelationAllowedOperationsVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByTypeVisitor<Input.CreateRelationOperation[]>\n{\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetEntity, targetRelation }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, entity, relation }: Model.ManyHasOneContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasOneInverse({ targetEntity, targetRelation, relation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (!targetRelation || targetRelation.nullable || relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.CreateRelationOperation[] {\n\t\tconst result: Input.CreateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canCreateOwning = this.authorizator.getFieldPermissions(Acl.Operation.create, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connect)\n\t\t}\n\t\tif (canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.create)\n\t\t}\n\t\tif (canReadTargetEntity && canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":["ImplementationException","Input","Acl"],"mappings":";;;;AAIO,MAAM,6CAEb;AAAA,EACC,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAA6B;AAAA,EAE1D,cAAqB;AACpB,UAAM,IAAIA,UAAAA,wBAAwB,2EAA2E;AAAA,EAC9G;AAAA,EAEO,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,uBAAuB,EAAE,QAAQ,cAAc,YAA4C;AACjG,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,gBAAgB,EAAE,cAAc,kBAA2C;AACjF,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,gBAAgB,EAAE,cAAc,QAAQ,YAAqC;AACnF,WAAO,KAAK,qBAAqB,cAAc,QA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/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;"}
1
+ {"version":3,"file":"CreateEntityRelationAllowedOperationsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\n\nexport class CreateEntityRelationAllowedOperationsVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByTypeVisitor<Input.CreateRelationOperation[]>\n{\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetEntity, targetRelation }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, entity, relation }: Model.ManyHasOneContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasOneInverse({ targetEntity, targetRelation, relation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (!targetRelation || targetRelation.nullable || relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.CreateRelationOperation.create)\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.CreateRelationOperation[] {\n\t\tconst result: Input.CreateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canCreateOwning = this.authorizator.getFieldPermissions(Acl.Operation.create, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connect)\n\t\t}\n\t\tif (canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.create)\n\t\t}\n\t\tif (canReadTargetEntity && canCreateTargetEntity && canCreateOwning) {\n\t\t\tresult.push(Input.CreateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,6CAEb;AAAA,EACC,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAA6B;AAAA,EAE1D,cAAqB;AACpB,UAAM,IAAI,wBAAwB,2EAA2E;AAAA,EAC9G;AAAA,EAEO,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,uBAAuB,EAAE,QAAQ,cAAc,YAA4C;AACjG,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,gBAAgB,EAAE,cAAc,kBAA2C;AACjF,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,gBAAgB,EAAE,cAAc,QAAQ,YAAqC;AACnF,WAAO,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAAA,EAChE;AAAA,EAEO,sBAAsB,EAAE,cAAc,gBAAgB,YAA2C;AACvG,UAAM,aAAa,KAAK,qBAAqB,cAAc,cAAc,cAAc;AACvF,QAAI,SAAS,YAAY,eAAe,UAAU;AACjD,aAAO;AAAA,IACR;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,OAAO,MAAM,wBAAwB,MAAM;AAAA,EAC3E;AAAA,EAEO,qBAAqB,EAAE,cAAc,QAAQ,UAAU,kBAAgD;AAC7G,UAAM,aAAa,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAC3E,QAAI,CAAC,kBAAkB,eAAe,YAAY,SAAS,UAAU;AACpE,aAAO;AAAA,IACR;AACA,WAAO,WAAW,OAAO,CAAA,OAAM,OAAO,MAAM,wBAAwB,MAAM;AAAA,EAC3E;AAAA,EAEQ,qBACP,cACA,cACA,gBACkC;AAClC,UAAM,SAA0C,CAAA;AAEhD,UAAM,sBAAsB,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM;AAC7G,UAAM,wBAAwB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AACjH,UAAM,kBAAkB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,MAAM,eAAe,IAAI,MAAM;AAEhI,QAAI,uBAAuB,iBAAiB;AAC3C,aAAO,KAAK,MAAM,wBAAwB,OAAO;AAAA,IAClD;AACA,QAAI,yBAAyB,iBAAiB;AAC7C,aAAO,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,uBAAuB,yBAAyB,iBAAiB;AACpE,aAAO,KAAK,MAAM,wBAAwB,eAAe;AAAA,IAC1D;AAEA,WAAO;AAAA,EACR;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CreateEntityRelationInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLString } from 'graphql'\nimport { Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { Accessor, Interface } from '../../utils'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { CreateEntityRelationAllowedOperationsVisitor } from './CreateEntityRelationAllowedOperationsVisitor'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider'\n\nexport class CreateEntityRelationInputFieldVisitor implements\n\tModel.ColumnVisitor<never>,\n\tModel.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined> {\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t\tprivate readonly createEntityRelationAllowedOperationsVisitor: CreateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne(context: Model.ManyHasOneContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, false)\n\t}\n\n\tpublic visitHasMany(context: Model.OneHasManyContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, true)\n\t}\n\n\tpublic createInputObject(\n\t\t{ entity, relation, targetEntity, targetRelation }: Model.AnyRelationContext,\n\t\twithAliasField: boolean,\n\t): GraphQLInputObjectType | undefined {\n\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.createEntityRelationAllowedOperationsVisitor,\n\t\t)\n\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connect) && uniqueWhere) {\n\t\t\tfields[Input.CreateRelationOperation.connect] = {\n\t\t\t\ttype: uniqueWhere,\n\t\t\t}\n\t\t}\n\n\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.create) && createInput !== undefined) {\n\t\t\tfields[Input.CreateRelationOperation.create] = {\n\t\t\t\ttype: createInput,\n\t\t\t}\n\t\t}\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connectOrCreate) && uniqueWhere !== undefined && createInput !== undefined) {\n\t\t\tconst connectOrCreateInput = this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name)\n\t\t\tif (connectOrCreateInput) {\n\t\t\t\tfields[Input.CreateRelationOperation.connectOrCreate] = {\n\t\t\t\t\ttype: connectOrCreateInput,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (Object.keys(fields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Create${relation.name}EntityRelationInput`,\n\t\t\tfields: () => withAliasField\n\t\t\t\t? {\n\t\t\t\t\t...fields,\n\t\t\t\t\talias: { type: GraphQLString },\n\t\t\t\t\t }\n\t\t\t\t: fields,\n\t\t})\n\t}\n}\n"],"names":["schema","ImplementationException","acceptFieldVisitor","Input","GraphQLInputObjectType","GqlTypeName","GraphQLString"],"mappings":";;;;;;;AAWO,MAAM,sCAE2D;AAAA,EAEvE,YACkBA,SACA,kBACA,mCACA,8CACA,sCAChB;AALgB,SAAA,SAAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AACA,SAAA,+CAAA;AACA,SAAA,uCAAA;AAAA,EAAA;AAAA,EAGX,cAAqB;AACrB,UAAA,IAAIC,kCAAwB,oEAAoE;AAAA,EAAA;AAAA,EAGhG,YAAY,SAAsE;AACjF,WAAA,KAAK,kBAAkB,SAAS,KAAK;AAAA,EAAA;AAAA,EAGtC,aAAa,SAAsE;AAClF,WAAA,KAAK,kBAAkB,SAAS,IAAI;AAAA,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,EAAA;AAEH;;"}
1
+ {"version":3,"file":"CreateEntityRelationInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/CreateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import { GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLString } from 'graphql'\nimport { Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { Accessor, Interface } from '../../utils'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { CreateEntityRelationAllowedOperationsVisitor } from './CreateEntityRelationAllowedOperationsVisitor'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { ImplementationException } from '../../exception'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider'\n\nexport class CreateEntityRelationInputFieldVisitor\n\timplements Model.ColumnVisitor<never>, Model.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined>\n{\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly createEntityInputProviderAccessor: Accessor<Interface<EntityInputProvider<EntityInputType.create>>>,\n\t\tprivate readonly createEntityRelationAllowedOperationsVisitor: CreateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {}\n\n\tpublic visitColumn(): never {\n\t\tthrow new ImplementationException('CreateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne(context: Model.ManyHasOneContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, false)\n\t}\n\n\tpublic visitHasMany(context: Model.OneHasManyContext): GraphQLInputObjectType | undefined {\n\t\treturn this.createInputObject(context, true)\n\t}\n\n\tpublic createInputObject(\n\t\t{ entity, relation, targetEntity, targetRelation }: Model.AnyRelationContext,\n\t\twithAliasField: boolean,\n\t): GraphQLInputObjectType | undefined {\n\t\tconst targetName = targetRelation ? targetRelation.name : undefined\n\t\tconst fields: GraphQLInputFieldConfigMap = {}\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.createEntityRelationAllowedOperationsVisitor,\n\t\t)\n\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connect) && uniqueWhere) {\n\t\t\tfields[Input.CreateRelationOperation.connect] = {\n\t\t\t\ttype: uniqueWhere,\n\t\t\t}\n\t\t}\n\n\t\tconst createInput = this.createEntityInputProviderAccessor.get().getInput(targetEntity.name, targetName)\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.create) && createInput !== undefined) {\n\t\t\tfields[Input.CreateRelationOperation.create] = {\n\t\t\t\ttype: createInput,\n\t\t\t}\n\t\t}\n\t\tif (allowedOperations.includes(Input.CreateRelationOperation.connectOrCreate) && uniqueWhere !== undefined && createInput !== undefined) {\n\t\t\tconst connectOrCreateInput = this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name)\n\t\t\tif (connectOrCreateInput) {\n\t\t\t\tfields[Input.CreateRelationOperation.connectOrCreate] = {\n\t\t\t\t\ttype: connectOrCreateInput,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (Object.keys(fields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Create${relation.name}EntityRelationInput`,\n\t\t\tfields: () =>\n\t\t\t\twithAliasField\n\t\t\t\t\t? {\n\t\t\t\t\t\t...fields,\n\t\t\t\t\t\talias: { type: GraphQLString },\n\t\t\t\t\t}\n\t\t\t\t\t: fields,\n\t\t})\n\t}\n}\n"],"names":["schema","ImplementationException","acceptFieldVisitor","Input","GraphQLInputObjectType","GqlTypeName","GraphQLString"],"mappings":";;;;;;;AAWO,MAAM,s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