@contember/engine-content-api 2.0.0-alpha.32 → 2.0.0-alpha.36

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 (661) hide show
  1. package/dist/development/src/ExecutionContainer.cjs.map +1 -1
  2. package/dist/development/src/ExecutionContainer.js.map +1 -1
  3. package/dist/development/src/acl/Authorizator.cjs.map +1 -1
  4. package/dist/development/src/acl/Authorizator.js.map +1 -1
  5. package/dist/development/src/acl/EvaluatedPredicateReplacer.cjs.map +1 -1
  6. package/dist/development/src/acl/EvaluatedPredicateReplacer.js.map +1 -1
  7. package/dist/development/src/acl/PermissionFactory.cjs.map +1 -1
  8. package/dist/development/src/acl/PermissionFactory.js.map +1 -1
  9. package/dist/development/src/acl/PredicateFactory.cjs.map +1 -1
  10. package/dist/development/src/acl/PredicateFactory.js.map +1 -1
  11. package/dist/development/src/acl/PredicatesInjector.cjs.map +1 -1
  12. package/dist/development/src/acl/PredicatesInjector.js.map +1 -1
  13. package/dist/development/src/acl/VariableInjector.cjs.map +1 -1
  14. package/dist/development/src/acl/VariableInjector.js.map +1 -1
  15. package/dist/development/src/acl/VariableUtils.cjs.map +1 -1
  16. package/dist/development/src/acl/VariableUtils.js.map +1 -1
  17. package/dist/development/src/exception.cjs.map +1 -1
  18. package/dist/development/src/exception.js.map +1 -1
  19. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.cjs.map +1 -1
  20. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.js.map +1 -1
  21. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs.map +1 -1
  22. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js.map +1 -1
  23. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
  24. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js.map +1 -1
  25. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.cjs.map +1 -1
  26. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.js.map +1 -1
  27. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs.map +1 -1
  28. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js.map +1 -1
  29. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.cjs.map +1 -1
  30. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.js.map +1 -1
  31. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs.map +1 -1
  32. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js.map +1 -1
  33. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.cjs.map +1 -1
  34. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.js.map +1 -1
  35. package/dist/development/src/input-validation/ColumnValueResolver.cjs.map +1 -1
  36. package/dist/development/src/input-validation/ColumnValueResolver.js.map +1 -1
  37. package/dist/development/src/input-validation/EntityRulesResolver.cjs.map +1 -1
  38. package/dist/development/src/input-validation/EntityRulesResolver.js.map +1 -1
  39. package/dist/development/src/input-validation/QueryAstFactory.cjs.map +1 -1
  40. package/dist/development/src/input-validation/QueryAstFactory.js.map +1 -1
  41. package/dist/development/src/input-validation/ValidationContext.cjs.map +1 -1
  42. package/dist/development/src/input-validation/ValidationContext.js.map +1 -1
  43. package/dist/development/src/input-validation/ValidationDataSelector.cjs.map +1 -1
  44. package/dist/development/src/input-validation/ValidationDataSelector.js.map +1 -1
  45. package/dist/development/src/input-validation/ValidationEvaluation.cjs.map +1 -1
  46. package/dist/development/src/input-validation/ValidationEvaluation.js.map +1 -1
  47. package/dist/development/src/input-validation/ValidationPath.cjs.map +1 -1
  48. package/dist/development/src/input-validation/ValidationPath.js.map +1 -1
  49. package/dist/development/src/input-validation/dependencies/DependencyCollector.cjs.map +1 -1
  50. package/dist/development/src/input-validation/dependencies/DependencyCollector.js.map +1 -1
  51. package/dist/development/src/input-validation/dependencies/DependencyMerger.cjs.map +1 -1
  52. package/dist/development/src/input-validation/dependencies/DependencyMerger.js.map +1 -1
  53. package/dist/development/src/input-validation/preValidation/CreateInputPreValidationProcessor.cjs.map +1 -1
  54. package/dist/development/src/input-validation/preValidation/CreateInputPreValidationProcessor.js.map +1 -1
  55. package/dist/development/src/input-validation/preValidation/InputPreValidator.cjs.map +1 -1
  56. package/dist/development/src/input-validation/preValidation/InputPreValidator.js.map +1 -1
  57. package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs.map +1 -1
  58. package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js.map +1 -1
  59. package/dist/development/src/inputProcessing/CreateInputVisitor.cjs.map +1 -1
  60. package/dist/development/src/inputProcessing/CreateInputVisitor.js.map +1 -1
  61. package/dist/development/src/inputProcessing/FieldNode.cjs.map +1 -1
  62. package/dist/development/src/inputProcessing/FieldNode.js.map +1 -1
  63. package/dist/development/src/inputProcessing/ObjectNode.cjs.map +1 -1
  64. package/dist/development/src/inputProcessing/ObjectNode.js.map +1 -1
  65. package/dist/development/src/inputProcessing/UniqueWhereExpander.cjs.map +1 -1
  66. package/dist/development/src/inputProcessing/UniqueWhereExpander.js.map +1 -1
  67. package/dist/development/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
  68. package/dist/development/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
  69. package/dist/development/src/introspection/IntrospectionSchemaDefinitionFactory.cjs.map +1 -1
  70. package/dist/development/src/introspection/IntrospectionSchemaDefinitionFactory.js.map +1 -1
  71. package/dist/development/src/introspection/IntrospectionSchemaFactory.cjs.map +1 -1
  72. package/dist/development/src/introspection/IntrospectionSchemaFactory.js.map +1 -1
  73. package/dist/development/src/introspection/introspection.schema.cjs.map +1 -1
  74. package/dist/development/src/introspection/introspection.schema.js.map +1 -1
  75. package/dist/development/src/mapper/CheckedPrimary.cjs.map +1 -1
  76. package/dist/development/src/mapper/CheckedPrimary.js.map +1 -1
  77. package/dist/development/src/mapper/ColumnValue.cjs.map +1 -1
  78. package/dist/development/src/mapper/ColumnValue.js.map +1 -1
  79. package/dist/development/src/mapper/ErrorUtils.cjs.map +1 -1
  80. package/dist/development/src/mapper/ErrorUtils.js.map +1 -1
  81. package/dist/development/src/mapper/EventManager.cjs.map +1 -1
  82. package/dist/development/src/mapper/EventManager.js.map +1 -1
  83. package/dist/development/src/mapper/JunctionTableManager.cjs.map +1 -1
  84. package/dist/development/src/mapper/JunctionTableManager.js.map +1 -1
  85. package/dist/development/src/mapper/Mapper.cjs.map +1 -1
  86. package/dist/development/src/mapper/Mapper.js.map +1 -1
  87. package/dist/development/src/mapper/MapperFactory.cjs.map +1 -1
  88. package/dist/development/src/mapper/MapperFactory.js.map +1 -1
  89. package/dist/development/src/mapper/MutationProcessorHelper.cjs.map +1 -1
  90. package/dist/development/src/mapper/MutationProcessorHelper.js.map +1 -1
  91. package/dist/development/src/mapper/Result.cjs.map +1 -1
  92. package/dist/development/src/mapper/Result.js.map +1 -1
  93. package/dist/development/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
  94. package/dist/development/src/mapper/delete/DeleteExecutor.js.map +1 -1
  95. package/dist/development/src/mapper/delete/DeleteState.cjs.map +1 -1
  96. package/dist/development/src/mapper/delete/DeleteState.js.map +1 -1
  97. package/dist/development/src/mapper/delete/DeletedEntitiesStorage.cjs.map +1 -1
  98. package/dist/development/src/mapper/delete/DeletedEntitiesStorage.js.map +1 -1
  99. package/dist/development/src/mapper/delete/helpers.cjs.map +1 -1
  100. package/dist/development/src/mapper/delete/helpers.js.map +1 -1
  101. package/dist/development/src/mapper/insert/InsertBuilder.cjs.map +1 -1
  102. package/dist/development/src/mapper/insert/InsertBuilder.js.map +1 -1
  103. package/dist/development/src/mapper/insert/InsertBuilderFactory.cjs.map +1 -1
  104. package/dist/development/src/mapper/insert/InsertBuilderFactory.js.map +1 -1
  105. package/dist/development/src/mapper/insert/Inserter.cjs.map +1 -1
  106. package/dist/development/src/mapper/insert/Inserter.js.map +1 -1
  107. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
  108. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
  109. package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -1
  110. package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -1
  111. package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -1
  112. package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -1
  113. package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -1
  114. package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -1
  115. package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -1
  116. package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -1
  117. package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -1
  118. package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -1
  119. package/dist/development/src/mapper/select/ConditionBuilder.cjs.map +1 -1
  120. package/dist/development/src/mapper/select/ConditionBuilder.js.map +1 -1
  121. package/dist/development/src/mapper/select/JoinBuilder.cjs.map +1 -1
  122. package/dist/development/src/mapper/select/JoinBuilder.js.map +1 -1
  123. package/dist/development/src/mapper/select/JoinVisitor.cjs.map +1 -1
  124. package/dist/development/src/mapper/select/JoinVisitor.js.map +1 -1
  125. package/dist/development/src/mapper/select/OrderByBuilder.cjs.map +1 -1
  126. package/dist/development/src/mapper/select/OrderByBuilder.js.map +1 -1
  127. package/dist/development/src/mapper/select/OrderByHelper.cjs.map +1 -1
  128. package/dist/development/src/mapper/select/OrderByHelper.js.map +1 -1
  129. package/dist/development/src/mapper/select/Path.cjs.map +1 -1
  130. package/dist/development/src/mapper/select/Path.js.map +1 -1
  131. package/dist/development/src/mapper/select/RelationFetcher.cjs.map +1 -1
  132. package/dist/development/src/mapper/select/RelationFetcher.js.map +1 -1
  133. package/dist/development/src/mapper/select/SelectBuilder.cjs.map +1 -1
  134. package/dist/development/src/mapper/select/SelectBuilder.js.map +1 -1
  135. package/dist/development/src/mapper/select/SelectHydrator.cjs.map +1 -1
  136. package/dist/development/src/mapper/select/SelectHydrator.js.map +1 -1
  137. package/dist/development/src/mapper/select/WhereBuilder.cjs.map +1 -1
  138. package/dist/development/src/mapper/select/WhereBuilder.js.map +1 -1
  139. package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
  140. package/dist/development/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
  141. package/dist/development/src/mapper/select/handlers/FieldsVisitorFactory.cjs.map +1 -1
  142. package/dist/development/src/mapper/select/handlers/FieldsVisitorFactory.js.map +1 -1
  143. package/dist/development/src/mapper/select/handlers/MetaHandler.cjs.map +1 -1
  144. package/dist/development/src/mapper/select/handlers/MetaHandler.js.map +1 -1
  145. package/dist/development/src/mapper/select/optimizer/ConditionOptimizer.cjs.map +1 -1
  146. package/dist/development/src/mapper/select/optimizer/ConditionOptimizer.js.map +1 -1
  147. package/dist/development/src/mapper/select/optimizer/WhereOptimizer.cjs.map +1 -1
  148. package/dist/development/src/mapper/select/optimizer/WhereOptimizer.js.map +1 -1
  149. package/dist/development/src/mapper/select/optimizer/WhereReplacer.cjs.map +1 -1
  150. package/dist/development/src/mapper/select/optimizer/WhereReplacer.js.map +1 -1
  151. package/dist/development/src/mapper/select/optimizer/helpers.cjs.map +1 -1
  152. package/dist/development/src/mapper/select/optimizer/helpers.js.map +1 -1
  153. package/dist/development/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
  154. package/dist/development/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
  155. package/dist/development/src/mapper/update/UpdateBuilder.cjs.map +1 -1
  156. package/dist/development/src/mapper/update/UpdateBuilder.js.map +1 -1
  157. package/dist/development/src/mapper/update/UpdateBuilderFactory.cjs.map +1 -1
  158. package/dist/development/src/mapper/update/UpdateBuilderFactory.js.map +1 -1
  159. package/dist/development/src/mapper/update/Updater.cjs.map +1 -1
  160. package/dist/development/src/mapper/update/Updater.js.map +1 -1
  161. package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -1
  162. package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -1
  163. package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -1
  164. package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -1
  165. package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -1
  166. package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -1
  167. package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -1
  168. package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -1
  169. package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -1
  170. package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -1
  171. package/dist/development/src/resolvers/GraphQlQueryAstFactory.cjs.map +1 -1
  172. package/dist/development/src/resolvers/GraphQlQueryAstFactory.js.map +1 -1
  173. package/dist/development/src/resolvers/MutationResolver.cjs.map +1 -1
  174. package/dist/development/src/resolvers/MutationResolver.js.map +1 -1
  175. package/dist/development/src/resolvers/ReadHelpers.cjs.map +1 -1
  176. package/dist/development/src/resolvers/ReadHelpers.js.map +1 -1
  177. package/dist/development/src/resolvers/ReadResolver.cjs.map +1 -1
  178. package/dist/development/src/resolvers/ReadResolver.js.map +1 -1
  179. package/dist/development/src/resolvers/ValidationResolver.cjs.map +1 -1
  180. package/dist/development/src/resolvers/ValidationResolver.js.map +1 -1
  181. package/dist/development/src/schema/ColumnTypeResolver.cjs.map +1 -1
  182. package/dist/development/src/schema/ColumnTypeResolver.js.map +1 -1
  183. package/dist/development/src/schema/ConditionTypeProvider.cjs.map +1 -1
  184. package/dist/development/src/schema/ConditionTypeProvider.js.map +1 -1
  185. package/dist/development/src/schema/CustomTypesProvider.cjs.map +1 -1
  186. package/dist/development/src/schema/CustomTypesProvider.js.map +1 -1
  187. package/dist/development/src/schema/EntityTypeProvider.cjs.map +1 -1
  188. package/dist/development/src/schema/EntityTypeProvider.js.map +1 -1
  189. package/dist/development/src/schema/EnumsProvider.cjs.map +1 -1
  190. package/dist/development/src/schema/EnumsProvider.js.map +1 -1
  191. package/dist/development/src/schema/FieldAccessVisitor.cjs.map +1 -1
  192. package/dist/development/src/schema/FieldAccessVisitor.js.map +1 -1
  193. package/dist/development/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
  194. package/dist/development/src/schema/GraphQlSchemaBuilder.js.map +1 -1
  195. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
  196. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
  197. package/dist/development/src/schema/MutationProvider.cjs.map +1 -1
  198. package/dist/development/src/schema/MutationProvider.js.map +1 -1
  199. package/dist/development/src/schema/OperationExtension.cjs.map +1 -1
  200. package/dist/development/src/schema/OperationExtension.js.map +1 -1
  201. package/dist/development/src/schema/OrderByTypeProvider.cjs.map +1 -1
  202. package/dist/development/src/schema/OrderByTypeProvider.js.map +1 -1
  203. package/dist/development/src/schema/PaginatedFieldConfigFactory.cjs.map +1 -1
  204. package/dist/development/src/schema/PaginatedFieldConfigFactory.js.map +1 -1
  205. package/dist/development/src/schema/QueryProvider.cjs.map +1 -1
  206. package/dist/development/src/schema/QueryProvider.js.map +1 -1
  207. package/dist/development/src/schema/ResultSchemaTypeProvider.cjs.map +1 -1
  208. package/dist/development/src/schema/ResultSchemaTypeProvider.js.map +1 -1
  209. package/dist/development/src/schema/ValidationQueriesProvider.cjs.map +1 -1
  210. package/dist/development/src/schema/ValidationQueriesProvider.js.map +1 -1
  211. package/dist/development/src/schema/WhereTypeProvider.cjs.map +1 -1
  212. package/dist/development/src/schema/WhereTypeProvider.js.map +1 -1
  213. package/dist/development/src/schema/entities/FieldArgsVisitor.cjs.map +1 -1
  214. package/dist/development/src/schema/entities/FieldArgsVisitor.js.map +1 -1
  215. package/dist/development/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
  216. package/dist/development/src/schema/entities/FieldTypeVisitor.js.map +1 -1
  217. package/dist/development/src/schema/mutations/ConnectOrCreateRelationInputProvider.cjs.map +1 -1
  218. package/dist/development/src/schema/mutations/ConnectOrCreateRelationInputProvider.js.map +1 -1
  219. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
  220. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
  221. package/dist/development/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
  222. package/dist/development/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.js.map +1 -1
  223. package/dist/development/src/schema/mutations/CreateEntityRelationInputFieldVisitor.cjs.map +1 -1
  224. package/dist/development/src/schema/mutations/CreateEntityRelationInputFieldVisitor.js.map +1 -1
  225. package/dist/development/src/schema/mutations/CreateEntityRelationInputProvider.cjs.map +1 -1
  226. package/dist/development/src/schema/mutations/CreateEntityRelationInputProvider.js.map +1 -1
  227. package/dist/development/src/schema/mutations/EntityInputProvider.cjs.map +1 -1
  228. package/dist/development/src/schema/mutations/EntityInputProvider.js.map +1 -1
  229. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
  230. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
  231. package/dist/development/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
  232. package/dist/development/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.js.map +1 -1
  233. package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
  234. package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js.map +1 -1
  235. package/dist/development/src/schema/mutations/UpdateEntityRelationInputProvider.cjs.map +1 -1
  236. package/dist/development/src/schema/mutations/UpdateEntityRelationInputProvider.js.map +1 -1
  237. package/dist/development/src/schema/utils.cjs.map +1 -1
  238. package/dist/development/src/schema/utils.js.map +1 -1
  239. package/dist/development/src/utils/Mutex.cjs.map +1 -1
  240. package/dist/development/src/utils/Mutex.js.map +1 -1
  241. package/dist/development/src/utils/ResolveInfoUtils.cjs.map +1 -1
  242. package/dist/development/src/utils/ResolveInfoUtils.js.map +1 -1
  243. package/dist/development/src/utils/accessor.cjs.map +1 -1
  244. package/dist/development/src/utils/accessor.js.map +1 -1
  245. package/dist/development/src/utils/isIt.cjs.map +1 -1
  246. package/dist/development/src/utils/isIt.js.map +1 -1
  247. package/dist/development/src/utils/object.cjs.map +1 -1
  248. package/dist/development/src/utils/object.js.map +1 -1
  249. package/dist/development/src/utils/paginationUtils.cjs.map +1 -1
  250. package/dist/development/src/utils/paginationUtils.js.map +1 -1
  251. package/dist/development/src/utils/singletonFactory.cjs.map +1 -1
  252. package/dist/development/src/utils/singletonFactory.js.map +1 -1
  253. package/dist/development/src/utils/uniqueWhereFields.cjs.map +1 -1
  254. package/dist/development/src/utils/uniqueWhereFields.js.map +1 -1
  255. package/dist/production/src/ExecutionContainer.cjs.map +1 -1
  256. package/dist/production/src/ExecutionContainer.js.map +1 -1
  257. package/dist/production/src/acl/Authorizator.cjs.map +1 -1
  258. package/dist/production/src/acl/Authorizator.js.map +1 -1
  259. package/dist/production/src/acl/EvaluatedPredicateReplacer.cjs.map +1 -1
  260. package/dist/production/src/acl/EvaluatedPredicateReplacer.js.map +1 -1
  261. package/dist/production/src/acl/PermissionFactory.cjs.map +1 -1
  262. package/dist/production/src/acl/PermissionFactory.js.map +1 -1
  263. package/dist/production/src/acl/PredicateFactory.cjs.map +1 -1
  264. package/dist/production/src/acl/PredicateFactory.js.map +1 -1
  265. package/dist/production/src/acl/PredicatesInjector.cjs.map +1 -1
  266. package/dist/production/src/acl/PredicatesInjector.js.map +1 -1
  267. package/dist/production/src/acl/VariableInjector.cjs.map +1 -1
  268. package/dist/production/src/acl/VariableInjector.js.map +1 -1
  269. package/dist/production/src/acl/VariableUtils.cjs.map +1 -1
  270. package/dist/production/src/acl/VariableUtils.js.map +1 -1
  271. package/dist/production/src/exception.cjs.map +1 -1
  272. package/dist/production/src/exception.js.map +1 -1
  273. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.cjs.map +1 -1
  274. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.js.map +1 -1
  275. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs.map +1 -1
  276. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js.map +1 -1
  277. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
  278. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js.map +1 -1
  279. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.cjs.map +1 -1
  280. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.js.map +1 -1
  281. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs.map +1 -1
  282. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js.map +1 -1
  283. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.cjs.map +1 -1
  284. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.js.map +1 -1
  285. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs.map +1 -1
  286. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js.map +1 -1
  287. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.cjs.map +1 -1
  288. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.js.map +1 -1
  289. package/dist/production/src/input-validation/ColumnValueResolver.cjs.map +1 -1
  290. package/dist/production/src/input-validation/ColumnValueResolver.js.map +1 -1
  291. package/dist/production/src/input-validation/EntityRulesResolver.cjs.map +1 -1
  292. package/dist/production/src/input-validation/EntityRulesResolver.js.map +1 -1
  293. package/dist/production/src/input-validation/QueryAstFactory.cjs.map +1 -1
  294. package/dist/production/src/input-validation/QueryAstFactory.js.map +1 -1
  295. package/dist/production/src/input-validation/ValidationContext.cjs.map +1 -1
  296. package/dist/production/src/input-validation/ValidationContext.js.map +1 -1
  297. package/dist/production/src/input-validation/ValidationDataSelector.cjs.map +1 -1
  298. package/dist/production/src/input-validation/ValidationDataSelector.js.map +1 -1
  299. package/dist/production/src/input-validation/ValidationEvaluation.cjs.map +1 -1
  300. package/dist/production/src/input-validation/ValidationEvaluation.js.map +1 -1
  301. package/dist/production/src/input-validation/ValidationPath.cjs.map +1 -1
  302. package/dist/production/src/input-validation/ValidationPath.js.map +1 -1
  303. package/dist/production/src/input-validation/dependencies/DependencyCollector.cjs.map +1 -1
  304. package/dist/production/src/input-validation/dependencies/DependencyCollector.js.map +1 -1
  305. package/dist/production/src/input-validation/dependencies/DependencyMerger.cjs.map +1 -1
  306. package/dist/production/src/input-validation/dependencies/DependencyMerger.js.map +1 -1
  307. package/dist/production/src/input-validation/preValidation/CreateInputPreValidationProcessor.cjs.map +1 -1
  308. package/dist/production/src/input-validation/preValidation/CreateInputPreValidationProcessor.js.map +1 -1
  309. package/dist/production/src/input-validation/preValidation/InputPreValidator.cjs.map +1 -1
  310. package/dist/production/src/input-validation/preValidation/InputPreValidator.js.map +1 -1
  311. package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs.map +1 -1
  312. package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js.map +1 -1
  313. package/dist/production/src/inputProcessing/CreateInputVisitor.cjs.map +1 -1
  314. package/dist/production/src/inputProcessing/CreateInputVisitor.js.map +1 -1
  315. package/dist/production/src/inputProcessing/FieldNode.cjs.map +1 -1
  316. package/dist/production/src/inputProcessing/FieldNode.js.map +1 -1
  317. package/dist/production/src/inputProcessing/ObjectNode.cjs.map +1 -1
  318. package/dist/production/src/inputProcessing/ObjectNode.js.map +1 -1
  319. package/dist/production/src/inputProcessing/UniqueWhereExpander.cjs.map +1 -1
  320. package/dist/production/src/inputProcessing/UniqueWhereExpander.js.map +1 -1
  321. package/dist/production/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
  322. package/dist/production/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
  323. package/dist/production/src/introspection/IntrospectionSchemaDefinitionFactory.cjs.map +1 -1
  324. package/dist/production/src/introspection/IntrospectionSchemaDefinitionFactory.js.map +1 -1
  325. package/dist/production/src/introspection/IntrospectionSchemaFactory.cjs.map +1 -1
  326. package/dist/production/src/introspection/IntrospectionSchemaFactory.js.map +1 -1
  327. package/dist/production/src/introspection/introspection.schema.cjs.map +1 -1
  328. package/dist/production/src/introspection/introspection.schema.js.map +1 -1
  329. package/dist/production/src/mapper/CheckedPrimary.cjs.map +1 -1
  330. package/dist/production/src/mapper/CheckedPrimary.js.map +1 -1
  331. package/dist/production/src/mapper/ColumnValue.cjs.map +1 -1
  332. package/dist/production/src/mapper/ColumnValue.js.map +1 -1
  333. package/dist/production/src/mapper/ErrorUtils.cjs.map +1 -1
  334. package/dist/production/src/mapper/ErrorUtils.js.map +1 -1
  335. package/dist/production/src/mapper/EventManager.cjs.map +1 -1
  336. package/dist/production/src/mapper/EventManager.js.map +1 -1
  337. package/dist/production/src/mapper/JunctionTableManager.cjs.map +1 -1
  338. package/dist/production/src/mapper/JunctionTableManager.js.map +1 -1
  339. package/dist/production/src/mapper/Mapper.cjs.map +1 -1
  340. package/dist/production/src/mapper/Mapper.js.map +1 -1
  341. package/dist/production/src/mapper/MapperFactory.cjs.map +1 -1
  342. package/dist/production/src/mapper/MapperFactory.js.map +1 -1
  343. package/dist/production/src/mapper/MutationProcessorHelper.cjs.map +1 -1
  344. package/dist/production/src/mapper/MutationProcessorHelper.js.map +1 -1
  345. package/dist/production/src/mapper/Result.cjs.map +1 -1
  346. package/dist/production/src/mapper/Result.js.map +1 -1
  347. package/dist/production/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
  348. package/dist/production/src/mapper/delete/DeleteExecutor.js.map +1 -1
  349. package/dist/production/src/mapper/delete/DeleteState.cjs.map +1 -1
  350. package/dist/production/src/mapper/delete/DeleteState.js.map +1 -1
  351. package/dist/production/src/mapper/delete/DeletedEntitiesStorage.cjs.map +1 -1
  352. package/dist/production/src/mapper/delete/DeletedEntitiesStorage.js.map +1 -1
  353. package/dist/production/src/mapper/delete/helpers.cjs.map +1 -1
  354. package/dist/production/src/mapper/delete/helpers.js.map +1 -1
  355. package/dist/production/src/mapper/insert/InsertBuilder.cjs.map +1 -1
  356. package/dist/production/src/mapper/insert/InsertBuilder.js.map +1 -1
  357. package/dist/production/src/mapper/insert/InsertBuilderFactory.cjs.map +1 -1
  358. package/dist/production/src/mapper/insert/InsertBuilderFactory.js.map +1 -1
  359. package/dist/production/src/mapper/insert/Inserter.cjs.map +1 -1
  360. package/dist/production/src/mapper/insert/Inserter.js.map +1 -1
  361. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
  362. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
  363. package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -1
  364. package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -1
  365. package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -1
  366. package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -1
  367. package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -1
  368. package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -1
  369. package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -1
  370. package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -1
  371. package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -1
  372. package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -1
  373. package/dist/production/src/mapper/select/ConditionBuilder.cjs.map +1 -1
  374. package/dist/production/src/mapper/select/ConditionBuilder.js.map +1 -1
  375. package/dist/production/src/mapper/select/JoinBuilder.cjs.map +1 -1
  376. package/dist/production/src/mapper/select/JoinBuilder.js.map +1 -1
  377. package/dist/production/src/mapper/select/JoinVisitor.cjs.map +1 -1
  378. package/dist/production/src/mapper/select/JoinVisitor.js.map +1 -1
  379. package/dist/production/src/mapper/select/OrderByBuilder.cjs.map +1 -1
  380. package/dist/production/src/mapper/select/OrderByBuilder.js.map +1 -1
  381. package/dist/production/src/mapper/select/OrderByHelper.cjs.map +1 -1
  382. package/dist/production/src/mapper/select/OrderByHelper.js.map +1 -1
  383. package/dist/production/src/mapper/select/Path.cjs.map +1 -1
  384. package/dist/production/src/mapper/select/Path.js.map +1 -1
  385. package/dist/production/src/mapper/select/RelationFetcher.cjs.map +1 -1
  386. package/dist/production/src/mapper/select/RelationFetcher.js.map +1 -1
  387. package/dist/production/src/mapper/select/SelectBuilder.cjs.map +1 -1
  388. package/dist/production/src/mapper/select/SelectBuilder.js.map +1 -1
  389. package/dist/production/src/mapper/select/SelectHydrator.cjs.map +1 -1
  390. package/dist/production/src/mapper/select/SelectHydrator.js.map +1 -1
  391. package/dist/production/src/mapper/select/WhereBuilder.cjs.map +1 -1
  392. package/dist/production/src/mapper/select/WhereBuilder.js.map +1 -1
  393. package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
  394. package/dist/production/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
  395. package/dist/production/src/mapper/select/handlers/FieldsVisitorFactory.cjs.map +1 -1
  396. package/dist/production/src/mapper/select/handlers/FieldsVisitorFactory.js.map +1 -1
  397. package/dist/production/src/mapper/select/handlers/MetaHandler.cjs.map +1 -1
  398. package/dist/production/src/mapper/select/handlers/MetaHandler.js.map +1 -1
  399. package/dist/production/src/mapper/select/optimizer/ConditionOptimizer.cjs.map +1 -1
  400. package/dist/production/src/mapper/select/optimizer/ConditionOptimizer.js.map +1 -1
  401. package/dist/production/src/mapper/select/optimizer/WhereOptimizer.cjs.map +1 -1
  402. package/dist/production/src/mapper/select/optimizer/WhereOptimizer.js.map +1 -1
  403. package/dist/production/src/mapper/select/optimizer/WhereReplacer.cjs.map +1 -1
  404. package/dist/production/src/mapper/select/optimizer/WhereReplacer.js.map +1 -1
  405. package/dist/production/src/mapper/select/optimizer/helpers.cjs.map +1 -1
  406. package/dist/production/src/mapper/select/optimizer/helpers.js.map +1 -1
  407. package/dist/production/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
  408. package/dist/production/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
  409. package/dist/production/src/mapper/update/UpdateBuilder.cjs.map +1 -1
  410. package/dist/production/src/mapper/update/UpdateBuilder.js.map +1 -1
  411. package/dist/production/src/mapper/update/UpdateBuilderFactory.cjs.map +1 -1
  412. package/dist/production/src/mapper/update/UpdateBuilderFactory.js.map +1 -1
  413. package/dist/production/src/mapper/update/Updater.cjs.map +1 -1
  414. package/dist/production/src/mapper/update/Updater.js.map +1 -1
  415. package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -1
  416. package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -1
  417. package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -1
  418. package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -1
  419. package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -1
  420. package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -1
  421. package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -1
  422. package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -1
  423. package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -1
  424. package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -1
  425. package/dist/production/src/resolvers/GraphQlQueryAstFactory.cjs.map +1 -1
  426. package/dist/production/src/resolvers/GraphQlQueryAstFactory.js.map +1 -1
  427. package/dist/production/src/resolvers/MutationResolver.cjs.map +1 -1
  428. package/dist/production/src/resolvers/MutationResolver.js.map +1 -1
  429. package/dist/production/src/resolvers/ReadHelpers.cjs.map +1 -1
  430. package/dist/production/src/resolvers/ReadHelpers.js.map +1 -1
  431. package/dist/production/src/resolvers/ReadResolver.cjs.map +1 -1
  432. package/dist/production/src/resolvers/ReadResolver.js.map +1 -1
  433. package/dist/production/src/resolvers/ValidationResolver.cjs.map +1 -1
  434. package/dist/production/src/resolvers/ValidationResolver.js.map +1 -1
  435. package/dist/production/src/schema/ColumnTypeResolver.cjs.map +1 -1
  436. package/dist/production/src/schema/ColumnTypeResolver.js.map +1 -1
  437. package/dist/production/src/schema/ConditionTypeProvider.cjs.map +1 -1
  438. package/dist/production/src/schema/ConditionTypeProvider.js.map +1 -1
  439. package/dist/production/src/schema/CustomTypesProvider.cjs.map +1 -1
  440. package/dist/production/src/schema/CustomTypesProvider.js.map +1 -1
  441. package/dist/production/src/schema/EntityTypeProvider.cjs.map +1 -1
  442. package/dist/production/src/schema/EntityTypeProvider.js.map +1 -1
  443. package/dist/production/src/schema/EnumsProvider.cjs.map +1 -1
  444. package/dist/production/src/schema/EnumsProvider.js.map +1 -1
  445. package/dist/production/src/schema/FieldAccessVisitor.cjs.map +1 -1
  446. package/dist/production/src/schema/FieldAccessVisitor.js.map +1 -1
  447. package/dist/production/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
  448. package/dist/production/src/schema/GraphQlSchemaBuilder.js.map +1 -1
  449. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
  450. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
  451. package/dist/production/src/schema/MutationProvider.cjs.map +1 -1
  452. package/dist/production/src/schema/MutationProvider.js.map +1 -1
  453. package/dist/production/src/schema/OperationExtension.cjs.map +1 -1
  454. package/dist/production/src/schema/OperationExtension.js.map +1 -1
  455. package/dist/production/src/schema/OrderByTypeProvider.cjs.map +1 -1
  456. package/dist/production/src/schema/OrderByTypeProvider.js.map +1 -1
  457. package/dist/production/src/schema/PaginatedFieldConfigFactory.cjs.map +1 -1
  458. package/dist/production/src/schema/PaginatedFieldConfigFactory.js.map +1 -1
  459. package/dist/production/src/schema/QueryProvider.cjs.map +1 -1
  460. package/dist/production/src/schema/QueryProvider.js.map +1 -1
  461. package/dist/production/src/schema/ResultSchemaTypeProvider.cjs.map +1 -1
  462. package/dist/production/src/schema/ResultSchemaTypeProvider.js.map +1 -1
  463. package/dist/production/src/schema/ValidationQueriesProvider.cjs.map +1 -1
  464. package/dist/production/src/schema/ValidationQueriesProvider.js.map +1 -1
  465. package/dist/production/src/schema/WhereTypeProvider.cjs.map +1 -1
  466. package/dist/production/src/schema/WhereTypeProvider.js.map +1 -1
  467. package/dist/production/src/schema/entities/FieldArgsVisitor.cjs.map +1 -1
  468. package/dist/production/src/schema/entities/FieldArgsVisitor.js.map +1 -1
  469. package/dist/production/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
  470. package/dist/production/src/schema/entities/FieldTypeVisitor.js.map +1 -1
  471. package/dist/production/src/schema/mutations/ConnectOrCreateRelationInputProvider.cjs.map +1 -1
  472. package/dist/production/src/schema/mutations/ConnectOrCreateRelationInputProvider.js.map +1 -1
  473. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
  474. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
  475. package/dist/production/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
  476. package/dist/production/src/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.js.map +1 -1
  477. package/dist/production/src/schema/mutations/CreateEntityRelationInputFieldVisitor.cjs.map +1 -1
  478. package/dist/production/src/schema/mutations/CreateEntityRelationInputFieldVisitor.js.map +1 -1
  479. package/dist/production/src/schema/mutations/CreateEntityRelationInputProvider.cjs.map +1 -1
  480. package/dist/production/src/schema/mutations/CreateEntityRelationInputProvider.js.map +1 -1
  481. package/dist/production/src/schema/mutations/EntityInputProvider.cjs.map +1 -1
  482. package/dist/production/src/schema/mutations/EntityInputProvider.js.map +1 -1
  483. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
  484. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
  485. package/dist/production/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.cjs.map +1 -1
  486. package/dist/production/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.js.map +1 -1
  487. package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
  488. package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js.map +1 -1
  489. package/dist/production/src/schema/mutations/UpdateEntityRelationInputProvider.cjs.map +1 -1
  490. package/dist/production/src/schema/mutations/UpdateEntityRelationInputProvider.js.map +1 -1
  491. package/dist/production/src/schema/utils.cjs.map +1 -1
  492. package/dist/production/src/schema/utils.js.map +1 -1
  493. package/dist/production/src/utils/Mutex.cjs.map +1 -1
  494. package/dist/production/src/utils/Mutex.js.map +1 -1
  495. package/dist/production/src/utils/ResolveInfoUtils.cjs.map +1 -1
  496. package/dist/production/src/utils/ResolveInfoUtils.js.map +1 -1
  497. package/dist/production/src/utils/accessor.cjs.map +1 -1
  498. package/dist/production/src/utils/accessor.js.map +1 -1
  499. package/dist/production/src/utils/isIt.cjs.map +1 -1
  500. package/dist/production/src/utils/isIt.js.map +1 -1
  501. package/dist/production/src/utils/object.cjs.map +1 -1
  502. package/dist/production/src/utils/object.js.map +1 -1
  503. package/dist/production/src/utils/paginationUtils.cjs.map +1 -1
  504. package/dist/production/src/utils/paginationUtils.js.map +1 -1
  505. package/dist/production/src/utils/singletonFactory.cjs.map +1 -1
  506. package/dist/production/src/utils/singletonFactory.js.map +1 -1
  507. package/dist/production/src/utils/uniqueWhereFields.cjs.map +1 -1
  508. package/dist/production/src/utils/uniqueWhereFields.js.map +1 -1
  509. package/dist/tests/src/assert.d.ts +5 -0
  510. package/dist/tests/src/assert.d.ts.map +1 -0
  511. package/dist/tests/tsconfig.tsbuildinfo +1 -1
  512. package/dist/types/tsconfig.tsbuildinfo +1 -1
  513. package/graphql.codegen.yml +1 -1
  514. package/package.json +11 -11
  515. package/tests/cases/bugs/bug-filter-or.test.ts +1 -1
  516. package/tests/cases/bugs/bug-update-by-nested-unique.test.ts +1 -1
  517. package/tests/cases/bugs/bug102.test.ts +1 -1
  518. package/tests/cases/integration/graphQlRequests/delete/aclDelete.test.ts +1 -1
  519. package/tests/cases/integration/graphQlRequests/delete/additionalDeleteFilter.test.ts +1 -1
  520. package/tests/cases/integration/graphQlRequests/delete/cascadeDelete.test.ts +1 -1
  521. package/tests/cases/integration/graphQlRequests/delete/deleteById.test.ts +1 -1
  522. package/tests/cases/integration/graphQlRequests/delete/orphanRemoval.test.ts +1 -1
  523. package/tests/cases/integration/graphQlRequests/delete/restrictOnDelete.test.ts +1 -1
  524. package/tests/cases/integration/graphQlRequests/delete/setNullOnDelete.test.ts +1 -1
  525. package/tests/cases/integration/graphQlRequests/insert/acl/setField.test.ts +1 -1
  526. package/tests/cases/integration/graphQlRequests/insert/aclInsert.test.ts +1 -1
  527. package/tests/cases/integration/graphQlRequests/insert/basicInsert.test.ts +1 -1
  528. package/tests/cases/integration/graphQlRequests/insert/insertCustomId.test.ts +1 -1
  529. package/tests/cases/integration/graphQlRequests/insert/manyHasManyInverse/create.test.ts +1 -1
  530. package/tests/cases/integration/graphQlRequests/insert/manyHasManyOwning/create.test.ts +1 -1
  531. package/tests/cases/integration/graphQlRequests/insert/manyHasOne/connectOrCreate.test.ts +1 -1
  532. package/tests/cases/integration/graphQlRequests/insert/manyHasOne/create.test.ts +1 -1
  533. package/tests/cases/integration/graphQlRequests/insert/oneHasMany/connect.test.ts +1 -1
  534. package/tests/cases/integration/graphQlRequests/insert/oneHasMany/create.test.ts +1 -1
  535. package/tests/cases/integration/graphQlRequests/insert/oneHasOneInverse/create.test.ts +1 -1
  536. package/tests/cases/integration/graphQlRequests/insert/oneHasOneOwning/create.test.ts +1 -1
  537. package/tests/cases/integration/graphQlRequests/insert/oneHasOneOwning/empty.test.ts +1 -1
  538. package/tests/cases/integration/graphQlRequests/insert/validation/toBeFixed.test.ts +1 -1
  539. package/tests/cases/integration/graphQlRequests/query/acl/differentRowAndFieldPredicate.test.ts +1 -1
  540. package/tests/cases/integration/graphQlRequests/query/acl/fieldRestrictedByLocale.test.ts +1 -1
  541. package/tests/cases/integration/graphQlRequests/query/acl/isNullAcl.test.ts +1 -1
  542. package/tests/cases/integration/graphQlRequests/query/acl/nestedPredicate.test.ts +1 -1
  543. package/tests/cases/integration/graphQlRequests/query/acl/orPredicate.test.ts +1 -1
  544. package/tests/cases/integration/graphQlRequests/query/acl/predicateElimination.test.ts +1 -1
  545. package/tests/cases/integration/graphQlRequests/query/acl/relationAcl.test.ts +1 -1
  546. package/tests/cases/integration/graphQlRequests/query/acl/rowPredicateSubset.test.ts +1 -1
  547. package/tests/cases/integration/graphQlRequests/query/acl/sameRowAndFieldPredicate.test.ts +1 -1
  548. package/tests/cases/integration/graphQlRequests/query/filter/backReferencedFilter.test.ts +1 -1
  549. package/tests/cases/integration/graphQlRequests/query/filter/complexCondition.test.ts +1 -1
  550. package/tests/cases/integration/graphQlRequests/query/filter/composedFilter.test.ts +1 -1
  551. package/tests/cases/integration/graphQlRequests/query/filter/containsQuery.test.ts +1 -1
  552. package/tests/cases/integration/graphQlRequests/query/filter/manyHasManyOwnerRelation.test.ts +1 -1
  553. package/tests/cases/integration/graphQlRequests/query/filter/manyHasOneRelation.test.ts +1 -1
  554. package/tests/cases/integration/graphQlRequests/query/filter/oneHasManyRelation.test.ts +1 -1
  555. package/tests/cases/integration/graphQlRequests/query/formatting/dateFormat.test.ts +1 -1
  556. package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/alias.test.ts +1 -1
  557. package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/fragments.test.ts +1 -1
  558. package/tests/cases/integration/graphQlRequests/query/misc/aliasedType.test.ts +1 -1
  559. package/tests/cases/integration/graphQlRequests/query/misc/longAliasHash.test.ts +1 -1
  560. package/tests/cases/integration/graphQlRequests/query/misc/reducedHasMany.test.ts +1 -1
  561. package/tests/cases/integration/graphQlRequests/query/misc/transaction.test.ts +1 -1
  562. package/tests/cases/integration/graphQlRequests/query/pagination/hasManyLimit.test.ts +1 -1
  563. package/tests/cases/integration/graphQlRequests/query/pagination/paginate.test.ts +1 -1
  564. package/tests/cases/integration/graphQlRequests/query/pagination/paginateAliased.test.ts +1 -1
  565. package/tests/cases/integration/graphQlRequests/query/pagination/simpleLimit.test.ts +1 -1
  566. package/tests/cases/integration/graphQlRequests/query/relations/advanced.test.ts +1 -1
  567. package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyInverse.test.ts +1 -1
  568. package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyOwning.test.ts +2 -2
  569. package/tests/cases/integration/graphQlRequests/query/relations/manyHasOne.test.ts +1 -1
  570. package/tests/cases/integration/graphQlRequests/query/relations/oneHasMany.test.ts +1 -1
  571. package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneInverse.test.ts +1 -1
  572. package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneOwner.test.ts +1 -1
  573. package/tests/cases/integration/graphQlRequests/query/sorting/byRelations.test.ts +1 -1
  574. package/tests/cases/integration/graphQlRequests/query/sorting/defaultOrdering.test.ts +1 -1
  575. package/tests/cases/integration/graphQlRequests/query/sorting/orderBy.test.ts +1 -1
  576. package/tests/cases/integration/graphQlRequests/query/sorting/randomSort.test.ts +1 -1
  577. package/tests/cases/integration/graphQlRequests/query/sorting/sortNulls.test.ts +1 -1
  578. package/tests/cases/integration/graphQlRequests/query/sorting/sortedHasMany.test.ts +1 -1
  579. package/tests/cases/integration/graphQlRequests/query/unique/basicQueryById.test.ts +1 -1
  580. package/tests/cases/integration/graphQlRequests/query/unique/composedUnique.test.ts +1 -1
  581. package/tests/cases/integration/graphQlRequests/query/unique/oneHasManyUnique.test.ts +1 -1
  582. package/tests/cases/integration/graphQlRequests/query/unique/uniqueWithFilter.test.ts +1 -1
  583. package/tests/cases/integration/graphQlRequests/query/view/view.test.ts +1 -1
  584. package/tests/cases/integration/graphQlRequests/update/acl/aclUpdate.test.ts +1 -1
  585. package/tests/cases/integration/graphQlRequests/update/additionalFilter.test.ts +1 -1
  586. package/tests/cases/integration/graphQlRequests/update/basic/columnUpdate.test.ts +1 -1
  587. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/connect.test.ts +1 -1
  588. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/create.test.ts +1 -1
  589. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/delete.test.ts +1 -1
  590. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/disconnect.test.ts +1 -1
  591. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/update.test.ts +1 -1
  592. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/upsert.test.ts +1 -1
  593. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/connect.test.ts +1 -1
  594. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/connectOrCreate.test.ts +1 -1
  595. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/create.test.ts +1 -1
  596. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/delete.test.ts +1 -1
  597. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/disconnect.test.ts +1 -1
  598. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/update.test.ts +1 -1
  599. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/upsert.test.ts +1 -1
  600. package/tests/cases/integration/graphQlRequests/update/manyHasOne/connect.test.ts +1 -1
  601. package/tests/cases/integration/graphQlRequests/update/manyHasOne/create.test.ts +1 -1
  602. package/tests/cases/integration/graphQlRequests/update/manyHasOne/delete.test.ts +1 -1
  603. package/tests/cases/integration/graphQlRequests/update/manyHasOne/disconnect.test.ts +1 -1
  604. package/tests/cases/integration/graphQlRequests/update/manyHasOne/update.test.ts +1 -1
  605. package/tests/cases/integration/graphQlRequests/update/manyHasOne/upsert.test.ts +1 -1
  606. package/tests/cases/integration/graphQlRequests/update/oneHasMany/combination.test.ts +1 -1
  607. package/tests/cases/integration/graphQlRequests/update/oneHasMany/connect.test.ts +1 -1
  608. package/tests/cases/integration/graphQlRequests/update/oneHasMany/connectOrCreate.test.ts +1 -1
  609. package/tests/cases/integration/graphQlRequests/update/oneHasMany/create.test.ts +1 -1
  610. package/tests/cases/integration/graphQlRequests/update/oneHasMany/delete.test.ts +1 -1
  611. package/tests/cases/integration/graphQlRequests/update/oneHasMany/disconnect.test.ts +1 -1
  612. package/tests/cases/integration/graphQlRequests/update/oneHasMany/update.test.ts +1 -1
  613. package/tests/cases/integration/graphQlRequests/update/oneHasMany/upsert.test.ts +1 -1
  614. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/connect.test.ts +1 -1
  615. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/create.test.ts +1 -1
  616. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/delete.test.ts +1 -1
  617. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/disconnect.test.ts +1 -1
  618. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/update.test.ts +1 -1
  619. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/upsert.test.ts +1 -1
  620. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connect.test.ts +1 -1
  621. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connectOrCreate.test.ts +1 -1
  622. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/create.test.ts +1 -1
  623. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/delete.test.ts +1 -1
  624. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/disconnect.test.ts +1 -1
  625. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/update.test.ts +1 -1
  626. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/upsert.test.ts +1 -1
  627. package/tests/cases/integration/graphQlRequests/update/queryPortal.test.ts +1 -1
  628. package/tests/cases/integration/graphQlRequests/update/transaction.test.ts +1 -1
  629. package/tests/cases/integration/graphQlRequests/update/validation/toBeFixed.test.ts +1 -1
  630. package/tests/cases/integration/graphQlRequests/upsert/basicUpsert.test.ts +1 -1
  631. package/tests/cases/integration/graphQlRequests/validation/conditions.test.ts +1 -1
  632. package/tests/cases/integration/graphQlRequests/validation/nestedValidation.test.ts +1 -1
  633. package/tests/cases/integration/graphQlRequests/validation/optionalAssert.test.ts +1 -1
  634. package/tests/cases/integration/graphQlRequests/validation/required.test.ts +1 -1
  635. package/tests/cases/integration/graphQlRequests/validation/requiredWhen.test.ts +1 -1
  636. package/tests/cases/integration/graphQlRequests/validation/rules/andRule.test.ts +1 -1
  637. package/tests/cases/integration/graphQlRequests/validation/rules/lengthRangeRule.test.ts +1 -1
  638. package/tests/cases/integration/graphQlRequests/validation/rules/maxLengthRule.test.ts +1 -1
  639. package/tests/cases/integration/graphQlRequests/validation/rules/minLength.test.ts +1 -1
  640. package/tests/cases/integration/graphQlRequests/validation/rules/notEmptyRule.test.ts +1 -1
  641. package/tests/cases/integration/graphQlRequests/validation/rules/notRule.test.ts +1 -1
  642. package/tests/cases/integration/graphQlRequests/validation/rules/orRule.test.ts +1 -1
  643. package/tests/cases/integration/graphQlRequests/validation/rules/patternRule.test.ts +1 -2
  644. package/tests/cases/integration/graphQlRequests/validation/rules/rangeRule.test.ts +1 -1
  645. package/tests/cases/integration/graphQlSchema/graphQlSchemaBuilder.test.ts +4 -4
  646. package/tests/cases/integration/graphQlSchema/schema-acl-create-only.gql +28 -28
  647. package/tests/cases/integration/graphQlSchema/schema-new-builder.gql +108 -108
  648. package/tests/cases/unit/aclVariablesFactory.test.ts +5 -5
  649. package/tests/cases/unit/conditionOptimizer.test.ts +7 -1
  650. package/tests/cases/unit/inputPreValidator.test.ts +2 -1
  651. package/tests/cases/unit/inputValidation.test.ts +7 -6
  652. package/tests/cases/unit/orderbyHelper.test.ts +3 -2
  653. package/tests/cases/unit/permissionMerger.test.ts +2 -1
  654. package/tests/cases/unit/predicatesFactory.test.ts +2 -1
  655. package/tests/cases/unit/predicatesInjector.test.ts +2 -1
  656. package/tests/cases/unit/uuidType.test.ts +5 -5
  657. package/tests/cases/unit/variableInjector.test.ts +2 -1
  658. package/tests/cases/unit/whereBuilder.test.ts +2 -1
  659. package/tests/cases/unit/whereOptimizer.test.ts +2 -1
  660. package/tests/src/assert.ts +10 -0
  661. package/tests/src/testGraphql.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateEntityRelationAllowedOperationsVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\n\nexport class UpdateEntityRelationAllowedOperationsVisitor implements\n\tModel.ColumnVisitor<never>,\n\tModel.RelationByTypeVisitor<Input.UpdateRelationOperation[]> {\n\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetRelation, targetEntity }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, relation, entity }: Model.ManyHasOneContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst forbiddenOperations = [Input.UpdateRelationOperation.disconnect]\n\t\tif (relation.joiningColumn.onDelete !== Model.OnDelete.cascade) {\n\t\t\tforbiddenOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => !forbiddenOperations.includes(it))\n\t}\n\n\tpublic visitOneHasOneInverse({ relation, targetEntity, targetRelation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.UpdateRelationOperation.update)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable || !targetRelation || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst allowedOperations = [Input.UpdateRelationOperation.update]\n\t\tif (relation.joiningColumn.onDelete === Model.OnDelete.cascade) {\n\t\t\tallowedOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => allowedOperations.includes(it))\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.UpdateRelationOperation[] {\n\t\tconst result: Input.UpdateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canUpdateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.update, targetEntity.name) !== 'no'\n\t\tconst canDeleteTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.delete, targetEntity.name) !== 'no'\n\t\tconst canUpdateOwningRelation = this.authorizator.getFieldPermissions(Acl.Operation.update, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connect)\n\t\t\tresult.push(Input.UpdateRelationOperation.disconnect)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.create)\n\t\t}\n\t\tif (canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.update)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.upsert)\n\t\t}\n\t\tif (canDeleteTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\tif (canReadTargetEntity && canUpdateOwningRelation && canCreateTargetEntity) {\n\t\t\t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AyB;AACvE,aAAA,KAAKA,OAAAA,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,yBAAyB,yBAAyB;AAC9C,aAAA,KAAKA,OAAAA,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACI,QAAA,uBAAuB,2BAA2B,uBAAuB;AACrE,aAAA,KAAKA,OAAAA,MAAM,wBAAwB,eAAe;AAAA,IAC1D;AAEO,WAAA;AAAA,EACR;AACD;;"}
1
+ {"version":3,"file":"UpdateEntityRelationAllowedOperationsVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\n\nexport class UpdateEntityRelationAllowedOperationsVisitor implements\n\tModel.ColumnVisitor<never>,\n\tModel.RelationByTypeVisitor<Input.UpdateRelationOperation[]> {\n\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetRelation, targetEntity }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, relation, entity }: Model.ManyHasOneContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst forbiddenOperations = [Input.UpdateRelationOperation.disconnect]\n\t\tif (relation.joiningColumn.onDelete !== Model.OnDelete.cascade) {\n\t\t\tforbiddenOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => !forbiddenOperations.includes(it))\n\t}\n\n\tpublic visitOneHasOneInverse({ relation, targetEntity, targetRelation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.UpdateRelationOperation.update)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable || !targetRelation || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst allowedOperations = [Input.UpdateRelationOperation.update]\n\t\tif (relation.joiningColumn.onDelete === Model.OnDelete.cascade) {\n\t\t\tallowedOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => allowedOperations.includes(it))\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.UpdateRelationOperation[] {\n\t\tconst result: Input.UpdateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canUpdateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.update, targetEntity.name) !== 'no'\n\t\tconst canDeleteTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.delete, targetEntity.name) !== 'no'\n\t\tconst canUpdateOwningRelation = this.authorizator.getFieldPermissions(Acl.Operation.update, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connect)\n\t\t\tresult.push(Input.UpdateRelationOperation.disconnect)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.create)\n\t\t}\n\t\tif (canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.update)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.upsert)\n\t\t}\n\t\tif (canDeleteTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\tif (canReadTargetEntity && canUpdateOwningRelation && canCreateTargetEntity) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":["Input","Model","Acl"],"mappings":";;;AAGO,MAAM,6CAEiD;AAAA,EAE7D,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAAA;AAAA,EAE7B,cAAqB;AACd,UAAA,IAAI,MAAM,2EAA2E;AAAA,EAAA;AAAA,EAGrF,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,gBAAgB,gBAAyC;AACjF,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAAA;AAAA,EAGrE,gBAAgB,EAAE,cAAc,UAAU,UAAmC;AACnF,UAAM,aAAa,KAAK,qBAAqB,cAAc,QAAQ,QAAQ;AAC3E,QAAI,SAAS,UAAU;AACf,aAAA;AAAA,IAAA;AAER,UAAM,sBAAsB,CAACA,aAAM,wBAAwB,UAAU;AACrE,QAAI,SAAS,cAAc,aAAaC,OAAA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G,UAAA,0BAA0B,KAAK,aAAa,oBAAoBA,OAAAA,IAAI,UAAU,QAAQ,aAAa,MAAM,eAAe,IAAI,MAAM;AAExI,QAAI,uBAAuB,yBAAyB;AAC5C,aAAA,KAAKF,aAAM,wBAAwB,OAAO;AAC1C,aAAA,KAAKA,aAAM,wBAAwB,UAAU;AAAA,IAAA;AAErD,QAAI,yBAAyB,yBAAyB;AAC9C,aAAA,KAAKA,aAAM,wBAAwB,MAAM;AAAA,IAAA;AAEjD,QAAI,yBAAyB,yBAAyB;AAC9C,aAAA,KAAKA,aAAM,wBAAwB,MAAM;AAAA,IAAA;AAE7C,QAAA,yBAAyB,yBAAyB,yBAAyB;AACvE,aAAA,KAAKA,aAAM,wBAAwB,MAAM;AAAA,IAAA;AAEjD,QAAI,yBAAyB,yBAAyB;AAC9C,aAAA,KAAKA,aAAM,wBAAwB,MAAM;AAAA,IAAA;AAE7C,QAAA,uBAAuB,2BAA2B,uBAAuB;AACrE,aAAA,KAAKA,aAAM,wBAAwB,eAAe;AAAA,IAAA;AAGnD,WAAA;AAAA,EAAA;AAET;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateEntityRelationAllowedOperationsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\n\nexport class UpdateEntityRelationAllowedOperationsVisitor implements\n\tModel.ColumnVisitor<never>,\n\tModel.RelationByTypeVisitor<Input.UpdateRelationOperation[]> {\n\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetRelation, targetEntity }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, relation, entity }: Model.ManyHasOneContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst forbiddenOperations = [Input.UpdateRelationOperation.disconnect]\n\t\tif (relation.joiningColumn.onDelete !== Model.OnDelete.cascade) {\n\t\t\tforbiddenOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => !forbiddenOperations.includes(it))\n\t}\n\n\tpublic visitOneHasOneInverse({ relation, targetEntity, targetRelation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.UpdateRelationOperation.update)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable || !targetRelation || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst allowedOperations = [Input.UpdateRelationOperation.update]\n\t\tif (relation.joiningColumn.onDelete === Model.OnDelete.cascade) {\n\t\t\tallowedOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => allowedOperations.includes(it))\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.UpdateRelationOperation[] {\n\t\tconst result: Input.UpdateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canUpdateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.update, targetEntity.name) !== 'no'\n\t\tconst canDeleteTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.delete, targetEntity.name) !== 'no'\n\t\tconst canUpdateOwningRelation = this.authorizator.getFieldPermissions(Acl.Operation.update, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connect)\n\t\t\tresult.push(Input.UpdateRelationOperation.disconnect)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.create)\n\t\t}\n\t\tif (canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.update)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.upsert)\n\t\t}\n\t\tif (canDeleteTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\tif (canReadTargetEntity && canUpdateOwningRelation && canCreateTargetEntity) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,6CAEiD;AAAA,EAE7D,YAA6B,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAA6B;AAAA,EAE1D,cAAqB;AACd,UAAA,IAAI,MAAM,2EAA2E;AAAA,EAC5F;AAAA,EAEO,wBAAwB,EAAE,cAAc,kBAAmD;AACjG,WAAO,KAAK,qBAAqB,cAAc,cAAc,cAAc;AAAA,EAC5E;AAAA,EAEO,uBAAuB,EAAE,QAAQ,cAAc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A0C,CAAA;AAE1C,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,wBAAwB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AAC3G,UAAA,wBAAwB,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,IAAI,MAAM;AAC3G,UAAA,0BAA0B,KAAK,aAAa,oBAAoB,IAAI,UAAU,QAAQ,aAAa,MAAM,eAAe,IAAI,MAAM;AAExI,QAAI,uBAAuB,yBAAyB;AAC5C,aAAA,KAAK,MAAM,wBAAwB,OAAO;AAC1C,aAAA,KAAK,MAAM,wBAAwB,UAAU;AAAA,IACrD;AACA,QAAI,yBAAyB,yBAAyB;AAC9C,aAAA,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,yBAAyB,yBAAyB;AAC9C,aAAA,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACI,QAAA,yBAAyB,yBAAyB,yBAAyB;AACvE,aAAA,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACA,QAAI,yBAAyB,yBAAyB;AAC9C,aAAA,KAAK,MAAM,wBAAwB,MAAM;AAAA,IACjD;AACI,QAAA,uBAAuB,2BAA2B,uBAAuB;AACrE,aAAA,KAAK,MAAM,wBAAwB,eAAe;AAAA,IAC1D;AAEO,WAAA;AAAA,EACR;AACD;"}
1
+ {"version":3,"file":"UpdateEntityRelationAllowedOperationsVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.ts"],"sourcesContent":["import { Acl, Input, Model } from '@contember/schema'\nimport { Authorizator } from '../../acl'\n\nexport class UpdateEntityRelationAllowedOperationsVisitor implements\n\tModel.ColumnVisitor<never>,\n\tModel.RelationByTypeVisitor<Input.UpdateRelationOperation[]> {\n\n\tconstructor(private readonly authorizator: Authorizator) {}\n\n\tvisitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationAllowedOperationsVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitManyHasManyInverse({ targetEntity, targetRelation }: Model.ManyHasManyInverseContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasManyOwning({ entity, targetEntity, relation }: Model.ManyHasManyOwningContext) {\n\t\treturn this.getAllowedOperations(targetEntity, entity, relation)\n\t}\n\n\tpublic visitOneHasMany({ targetRelation, targetEntity }: Model.OneHasManyContext) {\n\t\treturn this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t}\n\n\tpublic visitManyHasOne({ targetEntity, relation, entity }: Model.ManyHasOneContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst forbiddenOperations = [Input.UpdateRelationOperation.disconnect]\n\t\tif (relation.joiningColumn.onDelete !== Model.OnDelete.cascade) {\n\t\t\tforbiddenOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => !forbiddenOperations.includes(it))\n\t}\n\n\tpublic visitOneHasOneInverse({ relation, targetEntity, targetRelation }: Model.OneHasOneInverseContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, targetEntity, targetRelation)\n\t\tif (relation.nullable || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\treturn operations.filter(it => it === Input.UpdateRelationOperation.update)\n\t}\n\n\tpublic visitOneHasOneOwning({ targetEntity, entity, relation, targetRelation }: Model.OneHasOneOwningContext) {\n\t\tconst operations = this.getAllowedOperations(targetEntity, entity, relation)\n\t\tif (relation.nullable || !targetRelation || targetRelation.nullable) {\n\t\t\treturn operations\n\t\t}\n\t\tconst allowedOperations = [Input.UpdateRelationOperation.update]\n\t\tif (relation.joiningColumn.onDelete === Model.OnDelete.cascade) {\n\t\t\tallowedOperations.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\treturn operations.filter(it => allowedOperations.includes(it))\n\t}\n\n\tprivate getAllowedOperations(\n\t\ttargetEntity: Model.Entity,\n\t\towningEntity: Model.Entity,\n\t\towningRelation: Model.Relation,\n\t): Input.UpdateRelationOperation[] {\n\t\tconst result: Input.UpdateRelationOperation[] = []\n\n\t\tconst canReadTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) !== 'no'\n\t\tconst canCreateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.create, targetEntity.name) !== 'no'\n\t\tconst canUpdateTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.update, targetEntity.name) !== 'no'\n\t\tconst canDeleteTargetEntity = this.authorizator.getEntityPermission(Acl.Operation.delete, targetEntity.name) !== 'no'\n\t\tconst canUpdateOwningRelation = this.authorizator.getFieldPermissions(Acl.Operation.update, owningEntity.name, owningRelation.name) !== 'no'\n\n\t\tif (canReadTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connect)\n\t\t\tresult.push(Input.UpdateRelationOperation.disconnect)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.create)\n\t\t}\n\t\tif (canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.update)\n\t\t}\n\t\tif (canCreateTargetEntity && canUpdateTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.upsert)\n\t\t}\n\t\tif (canDeleteTargetEntity && canUpdateOwningRelation) {\n\t\t\tresult.push(Input.UpdateRelationOperation.delete)\n\t\t}\n\t\tif (canReadTargetEntity && canUpdateOwningRelation && canCreateTargetEntity) {\n\t\t\tresult.push(Input.UpdateRelationOperation.connectOrCreate)\n\t\t}\n\n\t\treturn result\n\t}\n}\n"],"names":[],"m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wB,eAAe;AAAA,IAAA;AAGnD,WAAA;AAAA,EAAA;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateEntityRelationInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLInputFieldConfig,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType, GraphQLNonNull,\n\tGraphQLString,\n} from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { Accessor, filterObject } from '../../utils'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationAllowedOperationsVisitor } from './UpdateEntityRelationAllowedOperationsVisitor'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider'\n\nexport class UpdateEntityRelationInputFieldVisitor implements Model.ColumnVisitor<never>,\n\tModel.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined> {\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly updateEntityInputProviderAccessor: Accessor<EntityInputProvider<EntityInputType.update>>,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityRelationAllowedOperationsVisitor: UpdateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {\n\t}\n\n\tpublic visitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne({ targetRelation, targetEntity, relation, entity }: Model.AnyHasOneRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\t\tconst updateInput = updateInputType ? { type: updateInputType } : undefined\n\n\t\tconst upsertInput = updateInputType && createInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst booleanInput = {\n\t\t\ttype: GraphQLBoolean,\n\t\t}\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: booleanInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: booleanInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => filteredFields,\n\t\t})\n\t}\n\n\tpublic visitHasMany({ entity, relation, targetEntity, targetRelation }: Model.AnyHasManyRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\n\t\tconst updateSpecifiedInput = updateInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tdata: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst upsertInput = updateInputType && createInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateSpecifiedInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: whereInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => ({\n\t\t\t\t...filteredFields,\n\t\t\t\talias: { type: GraphQLString },\n\t\t\t}),\n\t\t})\n\t}\n\n\tprivate filterAllowedOperations(\n\t\tentity: Model.Entity,\n\t\trelation: Model.Relation,\n\t\tgraphQlFields: { [key: string]: GraphQLInputFieldConfig | undefined },\n\t): GraphQLInputFieldConfigMap {\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.updateEntityRelationAllowedOperationsVisitor,\n\t\t)\n\t\treturn filterObject(\n\t\t\tgraphQlFields,\n\t\t\t(key, value): value is GraphQLInputFieldConfig =>\n\t\t\t\tallowedOperations.includes(key as Input.UpdateRelationOperation) && value !== undefined,\n\t\t)\n\t}\n\n\tprivate createUniqueWhereInput(targetEntity: Model.Entity): GraphQLInputObjectType | undefined {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (!uniqueWhere) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn uniqueWhere\n\t}\n}\n"],"names":["schema","GraphQLInputObjectType","GqlTypeName","GraphQLNonNull","GraphQLBoolean","Input","GraphQLString","acceptFieldVisitor","filterObject","Acl","ImplementationException"],"mappings":";;;;;;;;AAkBO,MAAM,sCAC2D;AAAA,EAEvE,YACkBA,SACA,cACA,kBACA,mCACA,2BACA,8CACA,sCAChB;AAPgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AACA,SAAA,4BAAA;AACA,SAAA,+CAAA;AACA,SAAA,uCAAA;AAAA,EAElB;AAAA,EAEO,cAAqB;AACrB,UAAA,IAAI,MAAM,oEAAoE;AAAA,EACrF;AAAA,EAEO,YAAY,EAAE,gBAAgB,cAAc,UAAU,UAA0C;AAChG,UAAA,kBAAkB,iBAAiB,eAAe,OAAO;AAEzD,UAAA,iBAAiB,KAAK,uBAAuB,YAAY;AAC/D,UAAM,aAAa,iBAAiB,EAAE,MAAM,mBAAmB;AAE/D,UAAM,kBAAkB,KAAK,0BAA0B,SAAS,aAAa,MAAM,eAAe;AAClG,UAAM,cAAc,kBAAkB,EAAE,MAAM,oBAAoB;AAE5D,UAAA,kBAAkB,KAAK,kCAAkC,IAAA,EAAM,SAAS,aAAa,MAAM,eAAe;AAChH,UAAM,cAAc,kBAAkB,EAAG,MAAM,oBAAoB;AAE7D,UAAA,cAAc,mBAAmB,kBACpC;AAAA,MACD,MAAM,IAAIC,QAAAA,uBAAuB;AAAA,QAChC,MAAMC,MAAAA,cAAc,OAAO,IAAI,SAAS,SAAS,IAAI;AAAA,QACrD,QAAQ,OAAO;AAAA,UACd,QAAQ,EAAE,MAAM,IAAIC,QAAA,eAAe,eAAe,EAAE;AAAA,UACpD,QAAQ,EAAE,MAAM,IAAIA,QAAA,eAAe,eAAe,EAAE;AAAA,QAAA;AAAA,MACrD,CACA;AAAA,IAEA,IAAA;AAEH,UAAM,eAAe;AAAA,MACpB,MAAMC,QAAA;AAAA,IAAA;AAGP,UAAM,uBAAuB,eAAe,iBACzC,EAAE,MA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uBAAuB;AAAA,MACjC,MAAMC,MAAAA,cAAc,OAAO,IAAI,SAAS,SAAS,IAAI;AAAA,MACrD,QAAQ,OAAO;AAAA,QACd,GAAG;AAAA,QACH,OAAO,EAAE,MAAMI,sBAAc;AAAA,MAAA;AAAA,IAC9B,CACA;AAAA,EACF;AAAA,EAEQ,wBACP,QACA,UACA,eAC6B;AAC7B,UAAM,oBAAoBC,YAAA;AAAA,MACzB,KAAK;AAAA,MACL;AAAA,MACA,SAAS;AAAA,MACT,KAAK;AAAA,IAAA;AAEC,WAAAC,OAAA;AAAA,MACN;AAAA,MACA,CAAC,KAAK,UACL,kBAAkB,SAAS,GAAoC,KAAK,UAAU;AAAA,IAAA;AAAA,EAEjF;AAAA,EAEQ,uBAAuB,cAAgE;AAC1F,QAAA,KAAK,aAAa,oBAAoBC,OAAA,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM,MAAM;AACnF,aAAA;AAAA,IACR;AACA,UAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,QAAI,CAAC,aAAa;AACjB,YAAM,IAAIC,UAAwB,wBAAA;AAAA,IACnC;AACO,WAAA;AAAA,EACR;AACD;;"}
1
+ {"version":3,"file":"UpdateEntityRelationInputFieldVisitor.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLInputFieldConfig,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType, GraphQLNonNull,\n\tGraphQLString,\n} from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { Accessor, filterObject } from '../../utils'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationAllowedOperationsVisitor } from './UpdateEntityRelationAllowedOperationsVisitor'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider'\n\nexport class UpdateEntityRelationInputFieldVisitor implements Model.ColumnVisitor<never>,\n\tModel.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined> {\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly updateEntityInputProviderAccessor: Accessor<EntityInputProvider<EntityInputType.update>>,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityRelationAllowedOperationsVisitor: UpdateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {\n\t}\n\n\tpublic visitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne({ targetRelation, targetEntity, relation, entity }: Model.AnyHasOneRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\t\tconst updateInput = updateInputType ? { type: updateInputType } : undefined\n\n\t\tconst upsertInput = updateInputType && createInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst booleanInput = {\n\t\t\ttype: GraphQLBoolean,\n\t\t}\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: booleanInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: booleanInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => filteredFields,\n\t\t})\n\t}\n\n\tpublic visitHasMany({ entity, relation, targetEntity, targetRelation }: Model.AnyHasManyRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\n\t\tconst updateSpecifiedInput = updateInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tdata: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst upsertInput = updateInputType && createInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateSpecifiedInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: whereInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => ({\n\t\t\t\t...filteredFields,\n\t\t\t\talias: { type: GraphQLString },\n\t\t\t}),\n\t\t})\n\t}\n\n\tprivate filterAllowedOperations(\n\t\tentity: Model.Entity,\n\t\trelation: Model.Relation,\n\t\tgraphQlFields: { [key: string]: GraphQLInputFieldConfig | undefined },\n\t): GraphQLInputFieldConfigMap {\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.updateEntityRelationAllowedOperationsVisitor,\n\t\t)\n\t\treturn filterObject(\n\t\t\tgraphQlFields,\n\t\t\t(key, value): value is GraphQLInputFieldConfig =>\n\t\t\t\tallowedOperations.includes(key as Input.UpdateRelationOperation) && value !== undefined,\n\t\t)\n\t}\n\n\tprivate createUniqueWhereInput(targetEntity: Model.Entity): GraphQLInputObjectType | undefined {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (!uniqueWhere) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn uniqueWhere\n\t}\n}\n"],"names":["schema","GraphQLInputObjectType","GqlTypeName","GraphQLNonNull","GraphQLBoolean","Input","GraphQLString","acceptFieldVisitor","filterObject","Acl","ImplementationException"],"mappings":";;;;;;;;AAkBO,MAAM,sCAC2D;AAAA,EAEvE,YACkBA,SACA,cACA,kBACA,mCACA,2BACA,8CACA,sCAChB;AAPgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AACA,SAAA,4BAAA;AACA,SAAA,+CAAA;AACA,SAAA,uCAAA;AAAA,EAAA;AAAA,EAIX,cAAqB;AACrB,UAAA,IAAI,MAAM,oEAAoE;AAAA,EAAA;AAAA,EAG9E,YAAY,EAAE,gBAAgB,cAAc,UAAU,UAA0C;AAChG,UAAA,kBAAkB,iBAAiB,eAAe,OAAO;AAEzD,UAAA,iBAAiB,KAAK,uBAAuB,YAAY;AAC/D,UAAM,aAAa,iBAAiB,EAAE,MAA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;AAER,UAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,QAAI,CAAC,aAAa;AACjB,YAAM,IAAIC,UAAAA,wBAAwB;AAAA,IAAA;AAE5B,WAAA;AAAA,EAAA;AAET;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateEntityRelationInputFieldVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLInputFieldConfig,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType, GraphQLNonNull,\n\tGraphQLString,\n} from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { Accessor, filterObject } from '../../utils'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationAllowedOperationsVisitor } from './UpdateEntityRelationAllowedOperationsVisitor'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider'\n\nexport class UpdateEntityRelationInputFieldVisitor implements Model.ColumnVisitor<never>,\n\tModel.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined> {\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly updateEntityInputProviderAccessor: Accessor<EntityInputProvider<EntityInputType.update>>,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityRelationAllowedOperationsVisitor: UpdateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {\n\t}\n\n\tpublic visitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne({ targetRelation, targetEntity, relation, entity }: Model.AnyHasOneRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\t\tconst updateInput = updateInputType ? { type: updateInputType } : undefined\n\n\t\tconst upsertInput = updateInputType && createInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst booleanInput = {\n\t\t\ttype: GraphQLBoolean,\n\t\t}\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: booleanInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: booleanInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => filteredFields,\n\t\t})\n\t}\n\n\tpublic visitHasMany({ entity, relation, targetEntity, targetRelation }: Model.AnyHasManyRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\n\t\tconst updateSpecifiedInput = updateInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tdata: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst upsertInput = updateInputType && createInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateSpecifiedInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: whereInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => ({\n\t\t\t\t...filteredFields,\n\t\t\t\talias: { type: GraphQLString },\n\t\t\t}),\n\t\t})\n\t}\n\n\tprivate filterAllowedOperations(\n\t\tentity: Model.Entity,\n\t\trelation: Model.Relation,\n\t\tgraphQlFields: { [key: string]: GraphQLInputFieldConfig | undefined },\n\t): GraphQLInputFieldConfigMap {\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.updateEntityRelationAllowedOperationsVisitor,\n\t\t)\n\t\treturn filterObject(\n\t\t\tgraphQlFields,\n\t\t\t(key, value): value is GraphQLInputFieldConfig =>\n\t\t\t\tallowedOperations.includes(key as Input.UpdateRelationOperation) && value !== undefined,\n\t\t)\n\t}\n\n\tprivate createUniqueWhereInput(targetEntity: Model.Entity): GraphQLInputObjectType | undefined {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity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C7B,UAAM,oBAAoB;AAAA,MACzB,KAAK;AAAA,MACL;AAAA,MACA,SAAS;AAAA,MACT,KAAK;AAAA,IAAA;AAEC,WAAA;AAAA,MACN;AAAA,MACA,CAAC,KAAK,UACL,kBAAkB,SAAS,GAAoC,KAAK,UAAU;AAAA,IAAA;AAAA,EAEjF;AAAA,EAEQ,uBAAuB,cAAgE;AAC1F,QAAA,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM,MAAM;AACnF,aAAA;AAAA,IACR;AACA,UAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,QAAI,CAAC,aAAa;AACjB,YAAM,IAAI,wBAAwB;AAAA,IACnC;AACO,WAAA;AAAA,EACR;AACD;"}
1
+ {"version":3,"file":"UpdateEntityRelationInputFieldVisitor.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLInputFieldConfig,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType, GraphQLNonNull,\n\tGraphQLString,\n} from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { GqlTypeName } from '../utils'\nimport { WhereTypeProvider } from '../WhereTypeProvider'\nimport { Accessor, filterObject } from '../../utils'\nimport { EntityInputProvider, EntityInputType } from './EntityInputProvider'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationAllowedOperationsVisitor } from './UpdateEntityRelationAllowedOperationsVisitor'\nimport { Authorizator } from '../../acl'\nimport { ImplementationException } from '../../exception'\nimport { ConnectOrCreateRelationInputProvider } from './ConnectOrCreateRelationInputProvider'\n\nexport class UpdateEntityRelationInputFieldVisitor implements Model.ColumnVisitor<never>,\n\tModel.RelationByGenericTypeVisitor<GraphQLInputObjectType | undefined> {\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly whereTypeBuilder: WhereTypeProvider,\n\t\tprivate readonly updateEntityInputProviderAccessor: Accessor<EntityInputProvider<EntityInputType.update>>,\n\t\tprivate readonly createEntityInputProvider: EntityInputProvider<EntityInputType.create>,\n\t\tprivate readonly updateEntityRelationAllowedOperationsVisitor: UpdateEntityRelationAllowedOperationsVisitor,\n\t\tprivate readonly connectOrCreateRelationInputProvider: ConnectOrCreateRelationInputProvider,\n\t) {\n\t}\n\n\tpublic visitColumn(): never {\n\t\tthrow new Error('UpdateEntityRelationInputFieldVisitor: Not applicable for a column')\n\t}\n\n\tpublic visitHasOne({ targetRelation, targetEntity, relation, entity }: Model.AnyHasOneRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\t\tconst updateInput = updateInputType ? { type: updateInputType } : undefined\n\n\t\tconst upsertInput = updateInputType && createInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst booleanInput = {\n\t\t\ttype: GraphQLBoolean,\n\t\t}\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: booleanInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: booleanInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => filteredFields,\n\t\t})\n\t}\n\n\tpublic visitHasMany({ entity, relation, targetEntity, targetRelation }: Model.AnyHasManyRelationContext) {\n\t\tconst withoutRelation = targetRelation ? targetRelation.name : undefined\n\n\t\tconst whereInputType = this.createUniqueWhereInput(targetEntity)\n\t\tconst whereInput = whereInputType ? { type: whereInputType } : undefined\n\n\t\tconst createInputType = this.createEntityInputProvider.getInput(targetEntity.name, withoutRelation)\n\t\tconst createInput = createInputType ? { type: createInputType } : undefined\n\n\t\tconst updateInputType = this.updateEntityInputProviderAccessor.get().getInput(targetEntity.name, withoutRelation)\n\n\t\tconst updateSpecifiedInput = updateInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tdata: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst upsertInput = updateInputType && createInputType && whereInputType\n\t\t\t? {\n\t\t\t\ttype: new GraphQLInputObjectType({\n\t\t\t\t\tname: GqlTypeName`${entity.name}Upsert${relation.name}RelationInput`,\n\t\t\t\t\tfields: () => ({\n\t\t\t\t\t\tby: { type: new GraphQLNonNull(whereInputType) },\n\t\t\t\t\t\tupdate: { type: new GraphQLNonNull(updateInputType) },\n\t\t\t\t\t\tcreate: { type: new GraphQLNonNull(createInputType) },\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}\n\t\t\t: undefined\n\n\t\tconst connectOrCreateInput = createInput && whereInputType\n\t\t\t? { type: this.connectOrCreateRelationInputProvider.getInput(entity.name, relation.name) }\n\t\t\t: undefined\n\n\t\tconst fields = {\n\t\t\t[Input.UpdateRelationOperation.create]: createInput,\n\t\t\t[Input.UpdateRelationOperation.update]: updateSpecifiedInput,\n\t\t\t[Input.UpdateRelationOperation.upsert]: upsertInput,\n\t\t\t[Input.UpdateRelationOperation.connect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.connectOrCreate]: connectOrCreateInput,\n\t\t\t[Input.UpdateRelationOperation.disconnect]: whereInput,\n\t\t\t[Input.UpdateRelationOperation.delete]: whereInput,\n\t\t}\n\n\t\tconst filteredFields = this.filterAllowedOperations(entity, relation, fields)\n\t\tif (Object.keys(filteredFields).length === 0) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${entity.name}Update${relation.name}EntityRelationInput`,\n\t\t\tfields: () => ({\n\t\t\t\t...filteredFields,\n\t\t\t\talias: { type: GraphQLString },\n\t\t\t}),\n\t\t})\n\t}\n\n\tprivate filterAllowedOperations(\n\t\tentity: Model.Entity,\n\t\trelation: Model.Relation,\n\t\tgraphQlFields: { [key: string]: GraphQLInputFieldConfig | undefined },\n\t): GraphQLInputFieldConfigMap {\n\t\tconst allowedOperations = acceptFieldVisitor(\n\t\t\tthis.schema,\n\t\t\tentity,\n\t\t\trelation.name,\n\t\t\tthis.updateEntityRelationAllowedOperationsVisitor,\n\t\t)\n\t\treturn filterObject(\n\t\t\tgraphQlFields,\n\t\t\t(key, value): value is GraphQLInputFieldConfig =>\n\t\t\t\tallowedOperations.includes(key as Input.UpdateRelationOperation) && value !== undefined,\n\t\t)\n\t}\n\n\tprivate createUniqueWhereInput(targetEntity: Model.Entity): GraphQLInputObjectType | undefined {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, targetEntity.name) === 'no') {\n\t\t\treturn undefined\n\t\t}\n\t\tconst uniqueWhere = this.whereTypeBuilder.getEntityUniqueWhereType(targetEntity.name)\n\t\tif (!uniqueWhere) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn uniqueWhere\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAkBO,MAAM,sCAC2D;AAAA,EAEvE,YACkB,QACA,cACA,kBACA,mCACA,2BACA,8CACA,sCAChB;AAPgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,oCAAA;AACA,SAAA,4BAAA;AACA,SAAA,+CAAA;AACA,SAAA,uCAAA;AAAA,EAAA;AAAA,EAIX,cAAqB;AACrB,UAAA,IAAI,MAAM,oEAAoE;AAAA,EAAA;AAAA,EAG9E,YAAY,EAAE,gBAAgB,cAAc,UAAU,UAA0C;AAChG,UAAA,kBAAkB,iBAAiB,eAAe,OAAO;AAEzD,UAAA,iBAAiB,KAAK,uBAAuB,YAAY;AAC/D,UAAM,aAAa,iBAAiB,EAAE,MAAM,mBAAmB;AAE/D,UAAM,kBAAkB,KAAK,0BAA0B,SAAS,aAAa,MAAM,eAAe;AAClG,UAAM,cAAc,kBAAkB,EAAE,MAAM,oBAAoB;AAE5D,UAAA,kBAAkB,KAAK,kCAAkC,MAAM,SAAS,aAAa,MAAM,eAAe;AAChH,UAAM,cAAc,kBAAkB,EAAG,MAAM,oBAAoB;AAE7D,UAAA,cAAc,mBAAmB,kBACpC;AAAA,MACD,MAAM,IAAI,uBAAuB;AAAA,QAChC,MAAM,cAAc,OAAO,IAAI,SAAS,SAAS,IAAI;AAAA,QACrD,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,EAAE,WAAW,GAAG;AACtC,aAAA;AAAA,IAAA;AAGR,WAAO,IAAI,uBAAuB;AAAA,MACjC,MAAM,cAAc,OAAO,IAAI,SAAS,SAAS,IAAI;AAAA,MACrD,QAAQ,OAAO;AAAA,QACd,GAAG;AAAA,QACH,OAAO,EAAE,MAAM,cAAc;AAAA,MAC9B;AAAA,IAAA,CACA;AAAA,EAAA;AAAA,EAGM,wBACP,QACA,UACA,eAC6B;AAC7B,UAAM,oBAAoB;AAAA,MACzB,KAAK;AAAA,MACL;AAAA,MACA,SAAS;AAAA,MACT,KAAK;AAAA,IACN;AACO,WAAA;AAAA,MACN;AAAA,MACA,CAAC,KAAK,UACL,kBAAkB,SAAS,GAAoC,KAAK,UAAU;AAAA,IAChF;AAAA,EAAA;AAAA,EAGO,uBAAuB,cAAgE;AAC1F,QAAA,KAAK,aAAa,oBAAoB,IAAI,UAAU,MAAM,aAAa,IAAI,MAAM,MAAM;AACnF,aAAA;AAAA,IAAA;AAER,UAAM,cAAc,KAAK,iBAAiB,yBAAyB,aAAa,IAAI;AACpF,QAAI,CAAC,aAAa;AACjB,YAAM,IAAI,wBAAwB;AAAA,IAAA;AAE5B,WAAA;AAAA,EAAA;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateEntityRelationInputProvider.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputProvider.ts"],"sourcesContent":["import { singletonFactory } from '../../utils'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationInputFieldVisitor } from './UpdateEntityRelationInputFieldVisitor'\nimport { Model } from '@contember/schema'\n\nexport class UpdateEntityRelationInputProvider {\n\tprivate updateEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\trelationName: string\n\t\t}\n\t>(id => this.createUpdateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly updateEntityRelationInputFieldVisitor: UpdateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getUpdateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.updateEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createUpdateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.updateEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":["singletonFactory","acceptFieldVisitor"],"mappings":";;;;;;;AAMO,MAAM,kCAAkC;AAAA,EAS9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAVV,kBAAA,MAAA,8BAA6BA,kCAMnC,CAAM,OAAA,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAKzE;AAAA,EAEI,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,aAAc,CAAA;AAAA,EACpE;AAAA,EAEQ,gCACP,YACA,cACqC;AACrC,WAAOC,YAAAA,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAC5G;AACD;;"}
1
+ {"version":3,"file":"UpdateEntityRelationInputProvider.cjs","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputProvider.ts"],"sourcesContent":["import { singletonFactory } from '../../utils'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationInputFieldVisitor } from './UpdateEntityRelationInputFieldVisitor'\nimport { Model } from '@contember/schema'\n\nexport class UpdateEntityRelationInputProvider {\n\tprivate updateEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\trelationName: string\n\t\t}\n\t>(id => this.createUpdateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly updateEntityRelationInputFieldVisitor: UpdateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getUpdateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.updateEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createUpdateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.updateEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":["singletonFactory","acceptFieldVisitor"],"mappings":";;;;;;;AAMO,MAAM,kCAAkC;AAAA,EAS9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAVV,kBAAA,MAAA,8BAA6BA,kCAMnC,CAAM,OAAA,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAAA;AAAA,EAOrE,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,cAAc;AAAA,EAAA;AAAA,EAG5D,gCACP,YACA,cACqC;AACrC,WAAOC,YAAAA,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAAA;AAE7G;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateEntityRelationInputProvider.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputProvider.ts"],"sourcesContent":["import { singletonFactory } from '../../utils'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationInputFieldVisitor } from './UpdateEntityRelationInputFieldVisitor'\nimport { Model } from '@contember/schema'\n\nexport class UpdateEntityRelationInputProvider {\n\tprivate updateEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\trelationName: string\n\t\t}\n\t>(id => this.createUpdateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly updateEntityRelationInputFieldVisitor: UpdateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getUpdateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.updateEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createUpdateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.updateEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,kCAAkC;AAAA,EAS9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAVV,kBAAA,MAAA,8BAA6B,iBAMnC,CAAM,OAAA,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAKzE;AAAA,EAEI,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,aAAc,CAAA;AAAA,EACpE;AAAA,EAEQ,gCACP,YACA,cACqC;AACrC,WAAO,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAC5G;AACD;"}
1
+ {"version":3,"file":"UpdateEntityRelationInputProvider.js","sources":["../../../../../../packages/engine-content-api/src/schema/mutations/UpdateEntityRelationInputProvider.ts"],"sourcesContent":["import { singletonFactory } from '../../utils'\nimport { GraphQLInputObjectType } from 'graphql'\nimport { acceptFieldVisitor } from '@contember/schema-utils'\nimport { UpdateEntityRelationInputFieldVisitor } from './UpdateEntityRelationInputFieldVisitor'\nimport { Model } from '@contember/schema'\n\nexport class UpdateEntityRelationInputProvider {\n\tprivate updateEntityRelationInputs = singletonFactory<\n\t\tGraphQLInputObjectType | undefined,\n\t\t{\n\t\t\tentityName: string\n\t\t\trelationName: string\n\t\t}\n\t>(id => this.createUpdateEntityRelationInput(id.entityName, id.relationName))\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly updateEntityRelationInputFieldVisitor: UpdateEntityRelationInputFieldVisitor,\n\t) {}\n\n\tpublic getUpdateEntityRelationInput(entityName: string, relationName: string): GraphQLInputObjectType | undefined {\n\t\treturn this.updateEntityRelationInputs({ entityName, relationName })\n\t}\n\n\tprivate createUpdateEntityRelationInput(\n\t\tentityName: string,\n\t\trelationName: string,\n\t): GraphQLInputObjectType | undefined {\n\t\treturn acceptFieldVisitor(this.schema, entityName, relationName, this.updateEntityRelationInputFieldVisitor)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,kCAAkC;AAAA,EAS9C,YACkB,QACA,uCAChB;AAFgB,SAAA,SAAA;AACA,SAAA,wCAAA;AAVV,kBAAA,MAAA,8BAA6B,iBAMnC,CAAM,OAAA,KAAK,gCAAgC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAAA,EAAA;AAAA,EAOrE,6BAA6B,YAAoB,cAA0D;AACjH,WAAO,KAAK,2BAA2B,EAAE,YAAY,cAAc;AAAA,EAAA;AAAA,EAG5D,gCACP,YACA,cACqC;AACrC,WAAO,mBAAmB,KAAK,QAAQ,YAAY,cAAc,KAAK,qCAAqC;AAAA,EAAA;AAE7G;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","sources":["../../../../../packages/engine-content-api/src/schema/utils.ts"],"sourcesContent":["import { capitalizeFirstLetter } from '../utils'\nimport { GraphQLFieldResolver } from 'graphql'\n\nexport const GqlTypeName = (strings: TemplateStringsArray, ...values: string[]) => {\n\treturn strings.reduce((combined, string, i) => {\n\t\treturn combined + string + (i < values.length ? capitalizeFirstLetter(values[i]) : '')\n\t}, '')\n}\n\nexport const aliasAwareResolver: GraphQLFieldResolver<any, any> = (source, args, context, info) => {\n\tif (!info.path) {\n\t\treturn undefined\n\t}\n\treturn source[info.path.key]\n}\n"],"names":["strings","capitalizeFirstLetter"],"mappings":";;;;AAGa,MAAA,cAAc,CAACA,cAAkC,WAAqB;AAClF,SAAOA,UAAQ,OAAO,CAAC,UAAU,QAAQ,MAAM;AACvC,WAAA,WAAW,UAAU,IAAI,OAAO,SAASC,QAAsB,sBAAA,OAAO,CAAC,CAAC,IAAI;AAAA,KACjF,EAAE;AACN;AAEO,MAAM,qBAAqD,CAAC,QAAQ,MAAM,SAAS,SAAS;AAC9F,MAAA,CAAC,KAAK,MAAM;AACR,WAAA;AAAA,EACR;AACO,SAAA,OAAO,KAAK,KAAK,GAAG;AAC5B;;;"}
1
+ {"version":3,"file":"utils.cjs","sources":["../../../../../packages/engine-content-api/src/schema/utils.ts"],"sourcesContent":["import { capitalizeFirstLetter } from '../utils'\nimport { GraphQLFieldResolver } from 'graphql'\n\nexport const GqlTypeName = (strings: TemplateStringsArray, ...values: string[]) => {\n\treturn strings.reduce((combined, string, i) => {\n\t\treturn combined + string + (i < values.length ? capitalizeFirstLetter(values[i]) : '')\n\t}, '')\n}\n\nexport const aliasAwareResolver: GraphQLFieldResolver<any, any> = (source, args, context, info) => {\n\tif (!info.path) {\n\t\treturn undefined\n\t}\n\treturn source[info.path.key]\n}\n"],"names":["strings","capitalizeFirstLetter"],"mappings":";;;;AAGa,MAAA,cAAc,CAACA,cAAkC,WAAqB;AAClF,SAAOA,UAAQ,OAAO,CAAC,UAAU,QAAQ,MAAM;AACvC,WAAA,WAAW,UAAU,IAAI,OAAO,SAASC,QAAsB,sBAAA,OAAO,CAAC,CAAC,IAAI;AAAA,KACjF,EAAE;AACN;AAEO,MAAM,qBAAqD,CAAC,QAAQ,MAAM,SAAS,SAAS;AAC9F,MAAA,CAAC,KAAK,MAAM;AACR,WAAA;AAAA,EAAA;AAED,SAAA,OAAO,KAAK,KAAK,GAAG;AAC5B;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../packages/engine-content-api/src/schema/utils.ts"],"sourcesContent":["import { capitalizeFirstLetter } from '../utils'\nimport { GraphQLFieldResolver } from 'graphql'\n\nexport const GqlTypeName = (strings: TemplateStringsArray, ...values: string[]) => {\n\treturn strings.reduce((combined, string, i) => {\n\t\treturn combined + string + (i < values.length ? capitalizeFirstLetter(values[i]) : '')\n\t}, '')\n}\n\nexport const aliasAwareResolver: GraphQLFieldResolver<any, any> = (source, args, context, info) => {\n\tif (!info.path) {\n\t\treturn undefined\n\t}\n\treturn source[info.path.key]\n}\n"],"names":[],"mappings":";;AAGa,MAAA,cAAc,CAAC,YAAkC,WAAqB;AAClF,SAAO,QAAQ,OAAO,CAAC,UAAU,QAAQ,MAAM;AACvC,WAAA,WAAW,UAAU,IAAI,OAAO,SAAS,sBAAsB,OAAO,CAAC,CAAC,IAAI;AAAA,KACjF,EAAE;AACN;AAEO,MAAM,qBAAqD,CAAC,QAAQ,MAAM,SAAS,SAAS;AAC9F,MAAA,CAAC,KAAK,MAAM;AACR,WAAA;AAAA,EACR;AACO,SAAA,OAAO,KAAK,KAAK,GAAG;AAC5B;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../packages/engine-content-api/src/schema/utils.ts"],"sourcesContent":["import { capitalizeFirstLetter } from '../utils'\nimport { GraphQLFieldResolver } from 'graphql'\n\nexport const GqlTypeName = (strings: TemplateStringsArray, ...values: string[]) => {\n\treturn strings.reduce((combined, string, i) => {\n\t\treturn combined + string + (i < values.length ? capitalizeFirstLetter(values[i]) : '')\n\t}, '')\n}\n\nexport const aliasAwareResolver: GraphQLFieldResolver<any, any> = (source, args, context, info) => {\n\tif (!info.path) {\n\t\treturn undefined\n\t}\n\treturn source[info.path.key]\n}\n"],"names":[],"mappings":";;AAGa,MAAA,cAAc,CAAC,YAAkC,WAAqB;AAClF,SAAO,QAAQ,OAAO,CAAC,UAAU,QAAQ,MAAM;AACvC,WAAA,WAAW,UAAU,IAAI,OAAO,SAAS,sBAAsB,OAAO,CAAC,CAAC,IAAI;AAAA,KACjF,EAAE;AACN;AAEO,MAAM,qBAAqD,CAAC,QAAQ,MAAM,SAAS,SAAS;AAC9F,MAAA,CAAC,KAAK,MAAM;AACR,WAAA;AAAA,EAAA;AAED,SAAA,OAAO,KAAK,KAAK,GAAG;AAC5B;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Mutex.cjs","sources":["../../../../../packages/engine-content-api/src/utils/Mutex.ts"],"sourcesContent":["export class Mutex {\n\tprivate resolvers: (() => void)[] = []\n\n\tprivate locked = false\n\n\tpublic async execute<T>(cb: () => T): Promise<T> {\n\t\tawait this.lock()\n\t\ttry {\n\t\t\treturn await cb()\n\t\t} finally {\n\t\t\tthis.release()\n\t\t}\n\t}\n\n\tprivate lock(): Promise<void> {\n\t\tif (!this.locked) {\n\t\t\tthis.locked = true\n\t\t\treturn Promise.resolve()\n\t\t}\n\t\treturn new Promise(resolve => this.resolvers.push(resolve))\n\t}\n\n\tprivate release(): void {\n\t\tconst nextResolver = this.resolvers.shift()\n\t\tif (nextResolver) {\n\t\t\tnextResolver()\n\t\t} else {\n\t\t\tthis.locked = false\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAO,MAAM,MAAM;AAAA,EAAZ,cAAA;AACN,kBAAA,MAAQ,aAA4B,CAAA,CAAC;AAErC,kBAAA,MAAQ,UAAS,KAAA;AAAA,EAAA;AAAA,EAEjB,MAAa,QAAW,IAAyB;AAChD,UAAM,KAAK;AACP,QAAA;AACH,aAAO,MAAM,GAAG;AAAA,IAAA,UACf;AACD,WAAK,QAAQ;AAAA,IACd;AAAA,EACD;AAAA,EAEQ,OAAsB;AACzB,QAAA,CAAC,KAAK,QAAQ;AACjB,WAAK,SAAS;AACd,aAAO,QAAQ;IAChB;AACA,WAAO,IAAI,QAAQ,CAAA,YAAW,KAAK,UAAU,KAAK,OAAO,CAAC;AAAA,EAC3D;AAAA,EAEQ,UAAgB;AACjB,UAAA,eAAe,KAAK,UAAU,MAAM;AAC1C,QAAI,cAAc;AACJ;IAAA,OACP;AACN,WAAK,SAAS;AAAA,IACf;AAAA,EACD;AACD;;"}
1
+ {"version":3,"file":"Mutex.cjs","sources":["../../../../../packages/engine-content-api/src/utils/Mutex.ts"],"sourcesContent":["export class Mutex {\n\tprivate resolvers: (() => void)[] = []\n\n\tprivate locked = false\n\n\tpublic async execute<T>(cb: () => T): Promise<T> {\n\t\tawait this.lock()\n\t\ttry {\n\t\t\treturn await cb()\n\t\t} finally {\n\t\t\tthis.release()\n\t\t}\n\t}\n\n\tprivate lock(): Promise<void> {\n\t\tif (!this.locked) {\n\t\t\tthis.locked = true\n\t\t\treturn Promise.resolve()\n\t\t}\n\t\treturn new Promise(resolve => this.resolvers.push(resolve))\n\t}\n\n\tprivate release(): void {\n\t\tconst nextResolver = this.resolvers.shift()\n\t\tif (nextResolver) {\n\t\t\tnextResolver()\n\t\t} else {\n\t\t\tthis.locked = false\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAO,MAAM,MAAM;AAAA,EAAZ,cAAA;AACN,kBAAA,MAAQ,aAA4B,EAAC;AAErC,kBAAA,MAAQ,UAAS,KAAA;AAAA,EAAA;AAAA,EAEjB,MAAa,QAAW,IAAyB;AAChD,UAAM,KAAK,KAAK;AACZ,QAAA;AACH,aAAO,MAAM,GAAG;AAAA,IAAA,UACf;AACD,WAAK,QAAQ;AAAA,IAAA;AAAA,EACd;AAAA,EAGO,OAAsB;AACzB,QAAA,CAAC,KAAK,QAAQ;AACjB,WAAK,SAAS;AACd,aAAO,QAAQ,QAAQ;AAAA,IAAA;AAExB,WAAO,IAAI,QAAQ,CAAA,YAAW,KAAK,UAAU,KAAK,OAAO,CAAC;AAAA,EAAA;AAAA,EAGnD,UAAgB;AACjB,UAAA,eAAe,KAAK,UAAU,MAAM;AAC1C,QAAI,cAAc;AACJ,mBAAA;AAAA,IAAA,OACP;AACN,WAAK,SAAS;AAAA,IAAA;AAAA,EACf;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Mutex.js","sources":["../../../../../packages/engine-content-api/src/utils/Mutex.ts"],"sourcesContent":["export class Mutex {\n\tprivate resolvers: (() => void)[] = []\n\n\tprivate locked = false\n\n\tpublic async execute<T>(cb: () => T): Promise<T> {\n\t\tawait this.lock()\n\t\ttry {\n\t\t\treturn await cb()\n\t\t} finally {\n\t\t\tthis.release()\n\t\t}\n\t}\n\n\tprivate lock(): Promise<void> {\n\t\tif (!this.locked) {\n\t\t\tthis.locked = true\n\t\t\treturn Promise.resolve()\n\t\t}\n\t\treturn new Promise(resolve => this.resolvers.push(resolve))\n\t}\n\n\tprivate release(): void {\n\t\tconst nextResolver = this.resolvers.shift()\n\t\tif (nextResolver) {\n\t\t\tnextResolver()\n\t\t} else {\n\t\t\tthis.locked = false\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAAO,MAAM,MAAM;AAAA,EAAZ,cAAA;AACN,kBAAA,MAAQ,aAA4B,CAAA,CAAC;AAErC,kBAAA,MAAQ,UAAS,KAAA;AAAA,EAAA;AAAA,EAEjB,MAAa,QAAW,IAAyB;AAChD,UAAM,KAAK;AACP,QAAA;AACH,aAAO,MAAM,GAAG;AAAA,IAAA,UACf;AACD,WAAK,QAAQ;AAAA,IACd;AAAA,EACD;AAAA,EAEQ,OAAsB;AACzB,QAAA,CAAC,KAAK,QAAQ;AACjB,WAAK,SAAS;AACd,aAAO,QAAQ;IAChB;AACA,WAAO,IAAI,QAAQ,CAAA,YAAW,KAAK,UAAU,KAAK,OAAO,CAAC;AAAA,EAC3D;AAAA,EAEQ,UAAgB;AACjB,UAAA,eAAe,KAAK,UAAU,MAAM;AAC1C,QAAI,cAAc;AACJ;IAAA,OACP;AACN,WAAK,SAAS;AAAA,IACf;AAAA,EACD;AACD;"}
1
+ {"version":3,"file":"Mutex.js","sources":["../../../../../packages/engine-content-api/src/utils/Mutex.ts"],"sourcesContent":["export class Mutex {\n\tprivate resolvers: (() => void)[] = []\n\n\tprivate locked = false\n\n\tpublic async execute<T>(cb: () => T): Promise<T> {\n\t\tawait this.lock()\n\t\ttry {\n\t\t\treturn await cb()\n\t\t} finally {\n\t\t\tthis.release()\n\t\t}\n\t}\n\n\tprivate lock(): Promise<void> {\n\t\tif (!this.locked) {\n\t\t\tthis.locked = true\n\t\t\treturn Promise.resolve()\n\t\t}\n\t\treturn new Promise(resolve => this.resolvers.push(resolve))\n\t}\n\n\tprivate release(): void {\n\t\tconst nextResolver = this.resolvers.shift()\n\t\tif (nextResolver) {\n\t\t\tnextResolver()\n\t\t} else {\n\t\t\tthis.locked = false\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAAO,MAAM,MAAM;AAAA,EAAZ,cAAA;AACN,kBAAA,MAAQ,aAA4B,EAAC;AAErC,kBAAA,MAAQ,UAAS,KAAA;AAAA,EAAA;AAAA,EAEjB,MAAa,QAAW,IAAyB;AAChD,UAAM,KAAK,KAAK;AACZ,QAAA;AACH,aAAO,MAAM,GAAG;AAAA,IAAA,UACf;AACD,WAAK,QAAQ;AAAA,IAAA;AAAA,EACd;AAAA,EAGO,OAAsB;AACzB,QAAA,CAAC,KAAK,QAAQ;AACjB,WAAK,SAAS;AACd,aAAO,QAAQ,QAAQ;AAAA,IAAA;AAExB,WAAO,IAAI,QAAQ,CAAA,YAAW,KAAK,UAAU,KAAK,OAAO,CAAC;AAAA,EAAA;AAAA,EAGnD,UAAgB;AACjB,UAAA,eAAe,KAAK,UAAU,MAAM;AAC1C,QAAI,cAAc;AACJ,mBAAA;AAAA,IAAA,OACP;AACN,WAAK,SAAS;AAAA,IAAA;AAAA,EACf;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ResolveInfoUtils.cjs","sources":["../../../../../packages/engine-content-api/src/utils/ResolveInfoUtils.ts"],"sourcesContent":["import { FieldNode as GraphQlFieldNode, GraphQLResolveInfo, SelectionSetNode } from 'graphql'\n\nexport class ResolveInfoUtils {\n\tpublic static extractFieldNode(info: GraphQLResolveInfo): GraphQlFieldNode {\n\t\tconst newGraphQlFieldNodes = [...info.fieldNodes]\n\t\twhile (newGraphQlFieldNodes.length > 1) {\n\t\t\tnewGraphQlFieldNodes.push(\n\t\t\t\tResolveInfoUtils.mergeFieldNodes(\n\t\t\t\t\tnewGraphQlFieldNodes.pop() as GraphQlFieldNode,\n\t\t\t\t\tnewGraphQlFieldNodes.pop() as GraphQlFieldNode,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t\treturn newGraphQlFieldNodes[0]\n\t}\n\n\tprivate static mergeFieldNodes(dest: GraphQlFieldNode, src: GraphQlFieldNode): GraphQlFieldNode {\n\t\treturn {\n\t\t\t...dest,\n\t\t\tselectionSet: {\n\t\t\t\t...(dest.selectionSet as SelectionSetNode),\n\t\t\t\tselections: [\n\t\t\t\t\t...(dest.selectionSet ? dest.selectionSet.selections : []),\n\t\t\t\t\t...(src.selectionSet ? src.selectionSet.selections : []),\n\t\t\t\t],\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAEO,MAAM,iBAAiB;AAAA,EAC7B,OAAc,iBAAiB,MAA4C;AAC1E,UAAM,uBAAuB,CAAC,GAAG,KAAK,UAAU;AACzC,WAAA,qBAAqB,SAAS,GAAG;AAClB,2BAAA;AAAA,QACpB,iBAAiB;AAAA,UAChB,qBAAqB,IAAI;AAAA,UACzB,qBAAqB,IAAI;AAAA,QAC1B;AAAA,MAAA;AAAA,IAEF;AACA,WAAO,qBAAqB,CAAC;AAAA,EAC9B;AAAA,EAEA,OAAe,gBAAgB,MAAwB,KAAyC;AACxF,WAAA;AAAA,MACN,GAAG;AAAA,MACH,cAAc;AAAA,QACb,GAAI,KAAK;AAAA,QACT,YAAY;AAAA,UACX,GAAI,KAAK,eAAe,KAAK,aAAa,aAAa,CAAC;AAAA,UACxD,GAAI,IAAI,eAAe,IAAI,aAAa,aAAa,CAAC;AAAA,QACvD;AAAA,MACD;AAAA,IAAA;AAAA,EAEF;AACD;;"}
1
+ {"version":3,"file":"ResolveInfoUtils.cjs","sources":["../../../../../packages/engine-content-api/src/utils/ResolveInfoUtils.ts"],"sourcesContent":["import { FieldNode as GraphQlFieldNode, GraphQLResolveInfo, SelectionSetNode } from 'graphql'\n\nexport class ResolveInfoUtils {\n\tpublic static extractFieldNode(info: GraphQLResolveInfo): GraphQlFieldNode {\n\t\tconst newGraphQlFieldNodes = [...info.fieldNodes]\n\t\twhile (newGraphQlFieldNodes.length > 1) {\n\t\t\tnewGraphQlFieldNodes.push(\n\t\t\t\tResolveInfoUtils.mergeFieldNodes(\n\t\t\t\t\tnewGraphQlFieldNodes.pop() as GraphQlFieldNode,\n\t\t\t\t\tnewGraphQlFieldNodes.pop() as GraphQlFieldNode,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t\treturn newGraphQlFieldNodes[0]\n\t}\n\n\tprivate static mergeFieldNodes(dest: GraphQlFieldNode, src: GraphQlFieldNode): GraphQlFieldNode {\n\t\treturn {\n\t\t\t...dest,\n\t\t\tselectionSet: {\n\t\t\t\t...(dest.selectionSet as SelectionSetNode),\n\t\t\t\tselections: [\n\t\t\t\t\t...(dest.selectionSet ? dest.selectionSet.selections : []),\n\t\t\t\t\t...(src.selectionSet ? src.selectionSet.selections : []),\n\t\t\t\t],\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAEO,MAAM,iBAAiB;AAAA,EAC7B,OAAc,iBAAiB,MAA4C;AAC1E,UAAM,uBAAuB,CAAC,GAAG,KAAK,UAAU;AACzC,WAAA,qBAAqB,SAAS,GAAG;AAClB,2BAAA;AAAA,QACpB,iBAAiB;AAAA,UAChB,qBAAqB,IAAI;AAAA,UACzB,qBAAqB,IAAI;AAAA,QAAA;AAAA,MAE3B;AAAA,IAAA;AAED,WAAO,qBAAqB,CAAC;AAAA,EAAA;AAAA,EAG9B,OAAe,gBAAgB,MAAwB,KAAyC;AACxF,WAAA;AAAA,MACN,GAAG;AAAA,MACH,cAAc;AAAA,QACb,GAAI,KAAK;AAAA,QACT,YAAY;AAAA,UACX,GAAI,KAAK,eAAe,KAAK,aAAa,aAAa,CAAC;AAAA,UACxD,GAAI,IAAI,eAAe,IAAI,aAAa,aAAa,CAAA;AAAA,QAAC;AAAA,MACvD;AAAA,IAEF;AAAA,EAAA;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ResolveInfoUtils.js","sources":["../../../../../packages/engine-content-api/src/utils/ResolveInfoUtils.ts"],"sourcesContent":["import { FieldNode as GraphQlFieldNode, GraphQLResolveInfo, SelectionSetNode } from 'graphql'\n\nexport class ResolveInfoUtils {\n\tpublic static extractFieldNode(info: GraphQLResolveInfo): GraphQlFieldNode {\n\t\tconst newGraphQlFieldNodes = [...info.fieldNodes]\n\t\twhile (newGraphQlFieldNodes.length > 1) {\n\t\t\tnewGraphQlFieldNodes.push(\n\t\t\t\tResolveInfoUtils.mergeFieldNodes(\n\t\t\t\t\tnewGraphQlFieldNodes.pop() as GraphQlFieldNode,\n\t\t\t\t\tnewGraphQlFieldNodes.pop() as GraphQlFieldNode,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t\treturn newGraphQlFieldNodes[0]\n\t}\n\n\tprivate static mergeFieldNodes(dest: GraphQlFieldNode, src: GraphQlFieldNode): GraphQlFieldNode {\n\t\treturn {\n\t\t\t...dest,\n\t\t\tselectionSet: {\n\t\t\t\t...(dest.selectionSet as SelectionSetNode),\n\t\t\t\tselections: [\n\t\t\t\t\t...(dest.selectionSet ? dest.selectionSet.selections : []),\n\t\t\t\t\t...(src.selectionSet ? src.selectionSet.selections : []),\n\t\t\t\t],\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAEO,MAAM,iBAAiB;AAAA,EAC7B,OAAc,iBAAiB,MAA4C;AAC1E,UAAM,uBAAuB,CAAC,GAAG,KAAK,UAAU;AACzC,WAAA,qBAAqB,SAAS,GAAG;AAClB,2BAAA;AAAA,QACpB,iBAAiB;AAAA,UAChB,qBAAqB,IAAI;AAAA,UACzB,qBAAqB,IAAI;AAAA,QAC1B;AAAA,MAAA;AAAA,IAEF;AACA,WAAO,qBAAqB,CAAC;AAAA,EAC9B;AAAA,EAEA,OAAe,gBAAgB,MAAwB,KAAyC;AACxF,WAAA;AAAA,MACN,GAAG;AAAA,MACH,cAAc;AAAA,QACb,GAAI,KAAK;AAAA,QACT,YAAY;AAAA,UACX,GAAI,KAAK,eAAe,KAAK,aAAa,aAAa,CAAC;AAAA,UACxD,GAAI,IAAI,eAAe,IAAI,aAAa,aAAa,CAAC;AAAA,QACvD;AAAA,MACD;AAAA,IAAA;AAAA,EAEF;AACD;"}
1
+ {"version":3,"file":"ResolveInfoUtils.js","sources":["../../../../../packages/engine-content-api/src/utils/ResolveInfoUtils.ts"],"sourcesContent":["import { FieldNode as GraphQlFieldNode, GraphQLResolveInfo, SelectionSetNode } from 'graphql'\n\nexport class ResolveInfoUtils {\n\tpublic static extractFieldNode(info: GraphQLResolveInfo): GraphQlFieldNode {\n\t\tconst newGraphQlFieldNodes = [...info.fieldNodes]\n\t\twhile (newGraphQlFieldNodes.length > 1) {\n\t\t\tnewGraphQlFieldNodes.push(\n\t\t\t\tResolveInfoUtils.mergeFieldNodes(\n\t\t\t\t\tnewGraphQlFieldNodes.pop() as GraphQlFieldNode,\n\t\t\t\t\tnewGraphQlFieldNodes.pop() as GraphQlFieldNode,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t\treturn newGraphQlFieldNodes[0]\n\t}\n\n\tprivate static mergeFieldNodes(dest: GraphQlFieldNode, src: GraphQlFieldNode): GraphQlFieldNode {\n\t\treturn {\n\t\t\t...dest,\n\t\t\tselectionSet: {\n\t\t\t\t...(dest.selectionSet as SelectionSetNode),\n\t\t\t\tselections: [\n\t\t\t\t\t...(dest.selectionSet ? dest.selectionSet.selections : []),\n\t\t\t\t\t...(src.selectionSet ? src.selectionSet.selections : []),\n\t\t\t\t],\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAEO,MAAM,iBAAiB;AAAA,EAC7B,OAAc,iBAAiB,MAA4C;AAC1E,UAAM,uBAAuB,CAAC,GAAG,KAAK,UAAU;AACzC,WAAA,qBAAqB,SAAS,GAAG;AAClB,2BAAA;AAAA,QACpB,iBAAiB;AAAA,UAChB,qBAAqB,IAAI;AAAA,UACzB,qBAAqB,IAAI;AAAA,QAAA;AAAA,MAE3B;AAAA,IAAA;AAED,WAAO,qBAAqB,CAAC;AAAA,EAAA;AAAA,EAG9B,OAAe,gBAAgB,MAAwB,KAAyC;AACxF,WAAA;AAAA,MACN,GAAG;AAAA,MACH,cAAc;AAAA,QACb,GAAI,KAAK;AAAA,QACT,YAAY;AAAA,UACX,GAAI,KAAK,eAAe,KAAK,aAAa,aAAa,CAAC;AAAA,UACxD,GAAI,IAAI,eAAe,IAAI,aAAa,aAAa,CAAA;AAAA,QAAC;AAAA,MACvD;AAAA,IAEF;AAAA,EAAA;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"accessor.cjs","sources":["../../../../../packages/engine-content-api/src/utils/accessor.ts"],"sourcesContent":["import { ImplementationException } from '../exception'\nimport { Interface } from './Interface'\n\nexport class Accessor<T> {\n\tprivate val: T | undefined\n\n\tget(): Interface<T> {\n\t\tif (!this.val) {\n\t\t\tthrow new ImplementationException('Accessor value is not set')\n\t\t}\n\n\t\treturn this.val\n\t}\n\n\tset(val: Interface<T>): void {\n\t\tthis.val = val\n\t}\n}\n"],"names":["ImplementationException"],"mappings":";;;;;;AAGO,MAAM,SAAY;AAAA,EAAlB,cAAA;AACE,kBAAA,MAAA,KAAA;AAAA,EAAA;AAAA,EAER,MAAoB;AACf,QAAA,CAAC,KAAK,KAAK;AACR,YAAA,IAAIA,UAAAA,wBAAwB,2BAA2B;AAAA,IAC9D;AAEA,WAAO,KAAK;AAAA,EACb;AAAA,EAEA,IAAI,KAAyB;AAC5B,SAAK,MAAM;AAAA,EACZ;AACD;;"}
1
+ {"version":3,"file":"accessor.cjs","sources":["../../../../../packages/engine-content-api/src/utils/accessor.ts"],"sourcesContent":["import { ImplementationException } from '../exception'\nimport { Interface } from './Interface'\n\nexport class Accessor<T> {\n\tprivate val: T | undefined\n\n\tget(): Interface<T> {\n\t\tif (!this.val) {\n\t\t\tthrow new ImplementationException('Accessor value is not set')\n\t\t}\n\n\t\treturn this.val\n\t}\n\n\tset(val: Interface<T>): void {\n\t\tthis.val = val\n\t}\n}\n"],"names":["ImplementationException"],"mappings":";;;;;;AAGO,MAAM,SAAY;AAAA,EAAlB,cAAA;AACE,kBAAA,MAAA,KAAA;AAAA,EAAA;AAAA,EAER,MAAoB;AACf,QAAA,CAAC,KAAK,KAAK;AACR,YAAA,IAAIA,kCAAwB,2BAA2B;AAAA,IAAA;AAG9D,WAAO,KAAK;AAAA,EAAA;AAAA,EAGb,IAAI,KAAyB;AAC5B,SAAK,MAAM;AAAA,EAAA;AAEb;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"accessor.js","sources":["../../../../../packages/engine-content-api/src/utils/accessor.ts"],"sourcesContent":["import { ImplementationException } from '../exception'\nimport { Interface } from './Interface'\n\nexport class Accessor<T> {\n\tprivate val: T | undefined\n\n\tget(): Interface<T> {\n\t\tif (!this.val) {\n\t\t\tthrow new ImplementationException('Accessor value is not set')\n\t\t}\n\n\t\treturn this.val\n\t}\n\n\tset(val: Interface<T>): void {\n\t\tthis.val = val\n\t}\n}\n"],"names":[],"mappings":";;;;AAGO,MAAM,SAAY;AAAA,EAAlB,cAAA;AACE,kBAAA,MAAA,KAAA;AAAA,EAAA;AAAA,EAER,MAAoB;AACf,QAAA,CAAC,KAAK,KAAK;AACR,YAAA,IAAI,wBAAwB,2BAA2B;AAAA,IAC9D;AAEA,WAAO,KAAK;AAAA,EACb;AAAA,EAEA,IAAI,KAAyB;AAC5B,SAAK,MAAM;AAAA,EACZ;AACD;"}
1
+ {"version":3,"file":"accessor.js","sources":["../../../../../packages/engine-content-api/src/utils/accessor.ts"],"sourcesContent":["import { ImplementationException } from '../exception'\nimport { Interface } from './Interface'\n\nexport class Accessor<T> {\n\tprivate val: T | undefined\n\n\tget(): Interface<T> {\n\t\tif (!this.val) {\n\t\t\tthrow new ImplementationException('Accessor value is not set')\n\t\t}\n\n\t\treturn this.val\n\t}\n\n\tset(val: Interface<T>): void {\n\t\tthis.val = val\n\t}\n}\n"],"names":[],"mappings":";;;;AAGO,MAAM,SAAY;AAAA,EAAlB,cAAA;AACE,kBAAA,MAAA,KAAA;AAAA,EAAA;AAAA,EAER,MAAoB;AACf,QAAA,CAAC,KAAK,KAAK;AACR,YAAA,IAAI,wBAAwB,2BAA2B;AAAA,IAAA;AAG9D,WAAO,KAAK;AAAA,EAAA;AAAA,EAGb,IAAI,KAAyB;AAC5B,SAAK,MAAM;AAAA,EAAA;AAEb;"}
@@ -1 +1 @@
1
- {"version":3,"file":"isIt.cjs","sources":["../../../../../packages/engine-content-api/src/utils/isIt.ts"],"sourcesContent":["export const isIt = <T extends object, P extends keyof T = keyof T>(val: any, property: P, value?: T[P]): val is T => {\n\tif (value !== undefined) {\n\t\treturn val[property] === value\n\t}\n\treturn val[property] !== undefined\n}\n"],"names":[],"mappings":";;AAAO,MAAM,OAAO,CAAgD,KAAU,UAAa,UAA2B;AACrH,MAAI,UAAU,QAAW;AACjB,WAAA,IAAI,QAAQ,MAAM;AAAA,EAC1B;AACO,SAAA,IAAI,QAAQ,MAAM;AAC1B;;"}
1
+ {"version":3,"file":"isIt.cjs","sources":["../../../../../packages/engine-content-api/src/utils/isIt.ts"],"sourcesContent":["export const isIt = <T extends object, P extends keyof T = keyof T>(val: any, property: P, value?: T[P]): val is T => {\n\tif (value !== undefined) {\n\t\treturn val[property] === value\n\t}\n\treturn val[property] !== undefined\n}\n"],"names":[],"mappings":";;AAAO,MAAM,OAAO,CAAgD,KAAU,UAAa,UAA2B;AACrH,MAAI,UAAU,QAAW;AACjB,WAAA,IAAI,QAAQ,MAAM;AAAA,EAAA;AAEnB,SAAA,IAAI,QAAQ,MAAM;AAC1B;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"isIt.js","sources":["../../../../../packages/engine-content-api/src/utils/isIt.ts"],"sourcesContent":["export const isIt = <T extends object, P extends keyof T = keyof T>(val: any, property: P, value?: T[P]): val is T => {\n\tif (value !== undefined) {\n\t\treturn val[property] === value\n\t}\n\treturn val[property] !== undefined\n}\n"],"names":[],"mappings":"AAAO,MAAM,OAAO,CAAgD,KAAU,UAAa,UAA2B;AACrH,MAAI,UAAU,QAAW;AACjB,WAAA,IAAI,QAAQ,MAAM;AAAA,EAC1B;AACO,SAAA,IAAI,QAAQ,MAAM;AAC1B;"}
1
+ {"version":3,"file":"isIt.js","sources":["../../../../../packages/engine-content-api/src/utils/isIt.ts"],"sourcesContent":["export const isIt = <T extends object, P extends keyof T = keyof T>(val: any, property: P, value?: T[P]): val is T => {\n\tif (value !== undefined) {\n\t\treturn val[property] === value\n\t}\n\treturn val[property] !== undefined\n}\n"],"names":[],"mappings":"AAAO,MAAM,OAAO,CAAgD,KAAU,UAAa,UAA2B;AACrH,MAAI,UAAU,QAAW;AACjB,WAAA,IAAI,QAAQ,MAAM;AAAA,EAAA;AAEnB,SAAA,IAAI,QAAQ,MAAM;AAC1B;"}
@@ -1 +1 @@
1
- {"version":3,"file":"object.cjs","sources":["../../../../../packages/engine-content-api/src/utils/object.ts"],"sourcesContent":["type TypeGuard<Input, Result extends { [K in keyof Input]: Input[K] }> = <K extends keyof Input>(\n\tkey: K,\n\tvalue: Input[K],\n\tobject: Input,\n) => value is Result[K]\ntype Filter<Input> = <K extends keyof Input>(key: K, value: Input[K], object: Input) => boolean\n\nfunction filterObject<Input extends {}, Result extends { [Key in keyof Input]: Input[Key] } = Input>(\n\tobject: Input,\n\tcallback: TypeGuard<Input, Result> | Filter<Input>,\n): Result {\n\treturn Object.fromEntries(Object.entries(object)\n\t\t.filter(([key, value]) => (callback as any)(key, value, object)),\n\t) as Result\n}\n\nfunction mapObject<Input, Result>(\n\tinput: { [key: string]: Input },\n\tcallback: (value: Input, key: string) => Result,\n): { [key: string]: Result } {\n\treturn Object.fromEntries(\n\t\tObject.entries(input).map(([key, value]) => [key, callback(value, key)]),\n\t)\n}\n\nexport { filterObject, mapObject }\n"],"names":[],"mappings":";;AAOA,SAAS,aACR,QACA,UACS;AACT,SAAO,OAAO;AAAA,IAAY,OAAO,QAAQ,MAAM,EAC7C,OAAO,CAAC,CAAC,KAAK,KAAK,MAAO,SAAiB,KAAK,OAAO,MAAM,CAAC;AAAA,EAAA;AAEjE;AAEA,SAAS,UACR,OACA,UAC4B;AAC5B,SAAO,OAAO;AAAA,IACb,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO,GAAG,CAAC,CAAC;AAAA,EAAA;AAEzE;;;"}
1
+ {"version":3,"file":"object.cjs","sources":["../../../../../packages/engine-content-api/src/utils/object.ts"],"sourcesContent":["type TypeGuard<Input, Result extends { [K in keyof Input]: Input[K] }> = <K extends keyof Input>(\n\tkey: K,\n\tvalue: Input[K],\n\tobject: Input,\n) => value is Result[K]\ntype Filter<Input> = <K extends keyof Input>(key: K, value: Input[K], object: Input) => boolean\n\nfunction filterObject<Input extends {}, Result extends { [Key in keyof Input]: Input[Key] } = Input>(\n\tobject: Input,\n\tcallback: TypeGuard<Input, Result> | Filter<Input>,\n): Result {\n\treturn Object.fromEntries(Object.entries(object)\n\t\t.filter(([key, value]) => (callback as any)(key, value, object)),\n\t) as Result\n}\n\nfunction mapObject<Input, Result>(\n\tinput: { [key: string]: Input },\n\tcallback: (value: Input, key: string) => Result,\n): { [key: string]: Result } {\n\treturn Object.fromEntries(\n\t\tObject.entries(input).map(([key, value]) => [key, callback(value, key)]),\n\t)\n}\n\nexport { filterObject, mapObject }\n"],"names":[],"mappings":";;AAOA,SAAS,aACR,QACA,UACS;AACT,SAAO,OAAO;AAAA,IAAY,OAAO,QAAQ,MAAM,EAC7C,OAAO,CAAC,CAAC,KAAK,KAAK,MAAO,SAAiB,KAAK,OAAO,MAAM,CAAC;AAAA,EAChE;AACD;AAEA,SAAS,UACR,OACA,UAC4B;AAC5B,SAAO,OAAO;AAAA,IACb,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO,GAAG,CAAC,CAAC;AAAA,EACxE;AACD;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"object.js","sources":["../../../../../packages/engine-content-api/src/utils/object.ts"],"sourcesContent":["type TypeGuard<Input, Result extends { [K in keyof Input]: Input[K] }> = <K extends keyof Input>(\n\tkey: K,\n\tvalue: Input[K],\n\tobject: Input,\n) => value is Result[K]\ntype Filter<Input> = <K extends keyof Input>(key: K, value: Input[K], object: Input) => boolean\n\nfunction filterObject<Input extends {}, Result extends { [Key in keyof Input]: Input[Key] } = Input>(\n\tobject: Input,\n\tcallback: TypeGuard<Input, Result> | Filter<Input>,\n): Result {\n\treturn Object.fromEntries(Object.entries(object)\n\t\t.filter(([key, value]) => (callback as any)(key, value, object)),\n\t) as Result\n}\n\nfunction mapObject<Input, Result>(\n\tinput: { [key: string]: Input },\n\tcallback: (value: Input, key: string) => Result,\n): { [key: string]: Result } {\n\treturn Object.fromEntries(\n\t\tObject.entries(input).map(([key, value]) => [key, callback(value, key)]),\n\t)\n}\n\nexport { filterObject, mapObject }\n"],"names":[],"mappings":"AAOA,SAAS,aACR,QACA,UACS;AACT,SAAO,OAAO;AAAA,IAAY,OAAO,QAAQ,MAAM,EAC7C,OAAO,CAAC,CAAC,KAAK,KAAK,MAAO,SAAiB,KAAK,OAAO,MAAM,CAAC;AAAA,EAAA;AAEjE;AAEA,SAAS,UACR,OACA,UAC4B;AAC5B,SAAO,OAAO;AAAA,IACb,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO,GAAG,CAAC,CAAC;AAAA,EAAA;AAEzE;"}
1
+ {"version":3,"file":"object.js","sources":["../../../../../packages/engine-content-api/src/utils/object.ts"],"sourcesContent":["type TypeGuard<Input, Result extends { [K in keyof Input]: Input[K] }> = <K extends keyof Input>(\n\tkey: K,\n\tvalue: Input[K],\n\tobject: Input,\n) => value is Result[K]\ntype Filter<Input> = <K extends keyof Input>(key: K, value: Input[K], object: Input) => boolean\n\nfunction filterObject<Input extends {}, Result extends { [Key in keyof Input]: Input[Key] } = Input>(\n\tobject: Input,\n\tcallback: TypeGuard<Input, Result> | Filter<Input>,\n): Result {\n\treturn Object.fromEntries(Object.entries(object)\n\t\t.filter(([key, value]) => (callback as any)(key, value, object)),\n\t) as Result\n}\n\nfunction mapObject<Input, Result>(\n\tinput: { [key: string]: Input },\n\tcallback: (value: Input, key: string) => Result,\n): { [key: string]: Result } {\n\treturn Object.fromEntries(\n\t\tObject.entries(input).map(([key, value]) => [key, callback(value, key)]),\n\t)\n}\n\nexport { filterObject, mapObject }\n"],"names":[],"mappings":"AAOA,SAAS,aACR,QACA,UACS;AACT,SAAO,OAAO;AAAA,IAAY,OAAO,QAAQ,MAAM,EAC7C,OAAO,CAAC,CAAC,KAAK,KAAK,MAAO,SAAiB,KAAK,OAAO,MAAM,CAAC;AAAA,EAChE;AACD;AAEA,SAAS,UACR,OACA,UAC4B;AAC5B,SAAO,OAAO;AAAA,IACb,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO,GAAG,CAAC,CAAC;AAAA,EACxE;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"paginationUtils.cjs","sources":["../../../../../packages/engine-content-api/src/utils/paginationUtils.ts"],"sourcesContent":["import { ObjectNode } from '../inputProcessing'\nimport { Input } from '@contember/schema'\n\nexport class PaginationHelper {\n\tconstructor(\n\t\tpublic readonly pageInfoField: ObjectNode | undefined,\n\t\tpublic readonly nodeField: ObjectNode | undefined,\n\t) {}\n\n\tget requiresTotalCount() {\n\t\treturn this.pageInfoField !== undefined\n\t}\n\n\tget requiresNodes() {\n\t\treturn this.nodeField !== undefined\n\t}\n\n\tpublic createResponse(totalCount?: number, nodes?: Record<string, any>[]): any {\n\t\tconst hasTotalCount = totalCount !== undefined\n\t\tif (this.requiresTotalCount && !hasTotalCount) {\n\t\t\tthrow new Error('totalCount is required')\n\t\t}\n\t\tconst hasNodes = nodes !== undefined\n\t\tif (this.requiresNodes && !hasNodes) {\n\t\t\tthrow new Error('nodes are required')\n\t\t}\n\t\treturn {\n\t\t\tpageInfo: { totalCount },\n\t\t\tedges: nodes?.map(it => ({ node: it })),\n\t\t}\n\t}\n}\nexport const createPaginationHelper = (queryAst: ObjectNode<Input.PaginationQueryInput>) => {\n\tconst pageInfoField = queryAst.findFieldByName('pageInfo')[0] as ObjectNode | undefined\n\n\tconst edges = queryAst.findFieldByName('edges')\n\tif (edges.length > 1) {\n\t\tthrow new Error('You cannot fetch edges more than once')\n\t}\n\tconst edgeField = edges?.[0] as ObjectNode | undefined\n\tconst nodes = edgeField?.findFieldByName('node') || []\n\tif (nodes.length > 1) {\n\t\tthrow new Error('You cannot fetch node more than once')\n\t}\n\tconst nodeField = (nodes?.[0] as ObjectNode | undefined)?.withArgs({\n\t\tfilter: queryAst.args.filter,\n\t\torderBy: queryAst.args.orderBy,\n\t\tlimit: queryAst.args.first,\n\t\toffset: queryAst.args.skip,\n\t})\n\treturn new PaginationHelper(pageInfoField, nodeField)\n}\n"],"names":[],"mappings":";;AAGO,MAAM,iBAAiB;AAAA,EAC7B,YACiB,eACA,WACf;AAFe,SAAA,gBAAA;AACA,SAAA,YAAA;AAAA,EACd;AAAA,EAEH,IAAI,qBAAqB;AACxB,WAAO,KAAK,kBAAkB;AAAA,EAC/B;AAAA,EAEA,IAAI,gBAAgB;AACnB,WAAO,KAAK,cAAc;AAAA,EAC3B;AAAA,EAEO,eAAe,YAAqB,OAAoC;AAC9E,UAAM,gBAAgB,eAAe;AACjC,QAAA,KAAK,sBAAsB,CAAC,eAAe;AACxC,YAAA,IAAI,MAAM,wBAAwB;AAAA,IACzC;AACA,UAAM,WAAW,UAAU;AACvB,QAAA,KAAK,iBAAiB,CAAC,UAAU;AAC9B,YAAA,IAAI,MAAM,oBAAoB;AAAA,IACrC;AACO,WAAA;AAAA,MACN,UAAU,EAAE,WAAW;AAAA,MACvB,OAAO,OAAO,IAAI,SAAO,EAAE,MAAM,KAAK;AAAA,IAAA;AAAA,EAExC;AACD;AACa,MAAA,yBAAyB,CAAC,aAAqD;AAC3F,QAAM,gBAAgB,SAAS,gBAAgB,UAAU,EAAE,CAAC;AAEtD,QAAA,QAAQ,SAAS,gBAAgB,OAAO;AAC1C,MAAA,MAAM,SAAS,GAAG;AACf,UAAA,IAAI,MAAM,uCAAuC;AAAA,EACxD;AACM,QAAA,YAAY,QAAQ,CAAC;AAC3B,QAAM,QAAQ,WAAW,gBAAgB,MAAM,KAAK,CAAA;AAChD,MAAA,MAAM,SAAS,GAAG;AACf,UAAA,IAAI,MAAM,sCAAsC;AAAA,EACvD;AACA,QAAM,YAAa,QAAQ,CAAC,GAA8B,SAAS;AAAA,IAClE,QAAQ,SAAS,KAAK;AAAA,IACtB,SAAS,SAAS,KAAK;AAAA,IACvB,OAAO,SAAS,KAAK;AAAA,IACrB,QAAQ,SAAS,KAAK;AAAA,EAAA,CACtB;AACM,SAAA,IAAI,iBAAiB,eAAe,SAAS;AACrD;;;"}
1
+ {"version":3,"file":"paginationUtils.cjs","sources":["../../../../../packages/engine-content-api/src/utils/paginationUtils.ts"],"sourcesContent":["import { ObjectNode } from '../inputProcessing'\nimport { Input } from '@contember/schema'\n\nexport class PaginationHelper {\n\tconstructor(\n\t\tpublic readonly pageInfoField: ObjectNode | undefined,\n\t\tpublic readonly nodeField: ObjectNode | undefined,\n\t) {}\n\n\tget requiresTotalCount() {\n\t\treturn this.pageInfoField !== undefined\n\t}\n\n\tget requiresNodes() {\n\t\treturn this.nodeField !== undefined\n\t}\n\n\tpublic createResponse(totalCount?: number, nodes?: Record<string, any>[]): any {\n\t\tconst hasTotalCount = totalCount !== undefined\n\t\tif (this.requiresTotalCount && !hasTotalCount) {\n\t\t\tthrow new Error('totalCount is required')\n\t\t}\n\t\tconst hasNodes = nodes !== undefined\n\t\tif (this.requiresNodes && !hasNodes) {\n\t\t\tthrow new Error('nodes are required')\n\t\t}\n\t\treturn {\n\t\t\tpageInfo: { totalCount },\n\t\t\tedges: nodes?.map(it => ({ node: it })),\n\t\t}\n\t}\n}\nexport const createPaginationHelper = (queryAst: ObjectNode<Input.PaginationQueryInput>) => {\n\tconst pageInfoField = queryAst.findFieldByName('pageInfo')[0] as ObjectNode | undefined\n\n\tconst edges = queryAst.findFieldByName('edges')\n\tif (edges.length > 1) {\n\t\tthrow new Error('You cannot fetch edges more than once')\n\t}\n\tconst edgeField = edges?.[0] as ObjectNode | undefined\n\tconst nodes = edgeField?.findFieldByName('node') || []\n\tif (nodes.length > 1) {\n\t\tthrow new Error('You cannot fetch node more than once')\n\t}\n\tconst nodeField = (nodes?.[0] as ObjectNode | undefined)?.withArgs({\n\t\tfilter: queryAst.args.filter,\n\t\torderBy: queryAst.args.orderBy,\n\t\tlimit: queryAst.args.first,\n\t\toffset: queryAst.args.skip,\n\t})\n\treturn new PaginationHelper(pageInfoField, nodeField)\n}\n"],"names":[],"mappings":";;AAGO,MAAM,iBAAiB;AAAA,EAC7B,YACiB,eACA,WACf;AAFe,SAAA,gBAAA;AACA,SAAA,YAAA;AAAA,EAAA;AAAA,EAGjB,IAAI,qBAAqB;AACxB,WAAO,KAAK,kBAAkB;AAAA,EAAA;AAAA,EAG/B,IAAI,gBAAgB;AACnB,WAAO,KAAK,cAAc;AAAA,EAAA;AAAA,EAGpB,eAAe,YAAqB,OAAoC;AAC9E,UAAM,gBAAgB,eAAe;AACjC,QAAA,KAAK,sBAAsB,CAAC,eAAe;AACxC,YAAA,IAAI,MAAM,wBAAwB;AAAA,IAAA;AAEzC,UAAM,WAAW,UAAU;AACvB,QAAA,KAAK,iBAAiB,CAAC,UAAU;AAC9B,YAAA,IAAI,MAAM,oBAAoB;AAAA,IAAA;AAE9B,WAAA;AAAA,MACN,UAAU,EAAE,WAAW;AAAA,MACvB,OAAO,OAAO,IAAI,SAAO,EAAE,MAAM,KAAK;AAAA,IACvC;AAAA,EAAA;AAEF;AACa,MAAA,yBAAyB,CAAC,aAAqD;AAC3F,QAAM,gBAAgB,SAAS,gBAAgB,UAAU,EAAE,CAAC;AAEtD,QAAA,QAAQ,SAAS,gBAAgB,OAAO;AAC1C,MAAA,MAAM,SAAS,GAAG;AACf,UAAA,IAAI,MAAM,uCAAuC;AAAA,EAAA;AAElD,QAAA,YAAY,QAAQ,CAAC;AAC3B,QAAM,QAAQ,WAAW,gBAAgB,MAAM,KAAK,CAAC;AACjD,MAAA,MAAM,SAAS,GAAG;AACf,UAAA,IAAI,MAAM,sCAAsC;AAAA,EAAA;AAEvD,QAAM,YAAa,QAAQ,CAAC,GAA8B,SAAS;AAAA,IAClE,QAAQ,SAAS,KAAK;AAAA,IACtB,SAAS,SAAS,KAAK;AAAA,IACvB,OAAO,SAAS,KAAK;AAAA,IACrB,QAAQ,SAAS,KAAK;AAAA,EAAA,CACtB;AACM,SAAA,IAAI,iBAAiB,eAAe,SAAS;AACrD;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"paginationUtils.js","sources":["../../../../../packages/engine-content-api/src/utils/paginationUtils.ts"],"sourcesContent":["import { ObjectNode } from '../inputProcessing'\nimport { Input } from '@contember/schema'\n\nexport class PaginationHelper {\n\tconstructor(\n\t\tpublic readonly pageInfoField: ObjectNode | undefined,\n\t\tpublic readonly nodeField: ObjectNode | undefined,\n\t) {}\n\n\tget requiresTotalCount() {\n\t\treturn this.pageInfoField !== undefined\n\t}\n\n\tget requiresNodes() {\n\t\treturn this.nodeField !== undefined\n\t}\n\n\tpublic createResponse(totalCount?: number, nodes?: Record<string, any>[]): any {\n\t\tconst hasTotalCount = totalCount !== undefined\n\t\tif (this.requiresTotalCount && !hasTotalCount) {\n\t\t\tthrow new Error('totalCount is required')\n\t\t}\n\t\tconst hasNodes = nodes !== undefined\n\t\tif (this.requiresNodes && !hasNodes) {\n\t\t\tthrow new Error('nodes are required')\n\t\t}\n\t\treturn {\n\t\t\tpageInfo: { totalCount },\n\t\t\tedges: nodes?.map(it => ({ node: it })),\n\t\t}\n\t}\n}\nexport const createPaginationHelper = (queryAst: ObjectNode<Input.PaginationQueryInput>) => {\n\tconst pageInfoField = queryAst.findFieldByName('pageInfo')[0] as ObjectNode | undefined\n\n\tconst edges = queryAst.findFieldByName('edges')\n\tif (edges.length > 1) {\n\t\tthrow new Error('You cannot fetch edges more than once')\n\t}\n\tconst edgeField = edges?.[0] as ObjectNode | undefined\n\tconst nodes = edgeField?.findFieldByName('node') || []\n\tif (nodes.length > 1) {\n\t\tthrow new Error('You cannot fetch node more than once')\n\t}\n\tconst nodeField = (nodes?.[0] as ObjectNode | undefined)?.withArgs({\n\t\tfilter: queryAst.args.filter,\n\t\torderBy: queryAst.args.orderBy,\n\t\tlimit: queryAst.args.first,\n\t\toffset: queryAst.args.skip,\n\t})\n\treturn new PaginationHelper(pageInfoField, nodeField)\n}\n"],"names":[],"mappings":"AAGO,MAAM,iBAAiB;AAAA,EAC7B,YACiB,eACA,WACf;AAFe,SAAA,gBAAA;AACA,SAAA,YAAA;AAAA,EACd;AAAA,EAEH,IAAI,qBAAqB;AACxB,WAAO,KAAK,kBAAkB;AAAA,EAC/B;AAAA,EAEA,IAAI,gBAAgB;AACnB,WAAO,KAAK,cAAc;AAAA,EAC3B;AAAA,EAEO,eAAe,YAAqB,OAAoC;AAC9E,UAAM,gBAAgB,eAAe;AACjC,QAAA,KAAK,sBAAsB,CAAC,eAAe;AACxC,YAAA,IAAI,MAAM,wBAAwB;AAAA,IACzC;AACA,UAAM,WAAW,UAAU;AACvB,QAAA,KAAK,iBAAiB,CAAC,UAAU;AAC9B,YAAA,IAAI,MAAM,oBAAoB;AAAA,IACrC;AACO,WAAA;AAAA,MACN,UAAU,EAAE,WAAW;AAAA,MACvB,OAAO,OAAO,IAAI,SAAO,EAAE,MAAM,KAAK;AAAA,IAAA;AAAA,EAExC;AACD;AACa,MAAA,yBAAyB,CAAC,aAAqD;AAC3F,QAAM,gBAAgB,SAAS,gBAAgB,UAAU,EAAE,CAAC;AAEtD,QAAA,QAAQ,SAAS,gBAAgB,OAAO;AAC1C,MAAA,MAAM,SAAS,GAAG;AACf,UAAA,IAAI,MAAM,uCAAuC;AAAA,EACxD;AACM,QAAA,YAAY,QAAQ,CAAC;AAC3B,QAAM,QAAQ,WAAW,gBAAgB,MAAM,KAAK,CAAA;AAChD,MAAA,MAAM,SAAS,GAAG;AACf,UAAA,IAAI,MAAM,sCAAsC;AAAA,EACvD;AACA,QAAM,YAAa,QAAQ,CAAC,GAA8B,SAAS;AAAA,IAClE,QAAQ,SAAS,KAAK;AAAA,IACtB,SAAS,SAAS,KAAK;AAAA,IACvB,OAAO,SAAS,KAAK;AAAA,IACrB,QAAQ,SAAS,KAAK;AAAA,EAAA,CACtB;AACM,SAAA,IAAI,iBAAiB,eAAe,SAAS;AACrD;"}
1
+ {"version":3,"file":"paginationUtils.js","sources":["../../../../../packages/engine-content-api/src/utils/paginationUtils.ts"],"sourcesContent":["import { ObjectNode } from '../inputProcessing'\nimport { Input } from '@contember/schema'\n\nexport class PaginationHelper {\n\tconstructor(\n\t\tpublic readonly pageInfoField: ObjectNode | undefined,\n\t\tpublic readonly nodeField: ObjectNode | undefined,\n\t) {}\n\n\tget requiresTotalCount() {\n\t\treturn this.pageInfoField !== undefined\n\t}\n\n\tget requiresNodes() {\n\t\treturn this.nodeField !== undefined\n\t}\n\n\tpublic createResponse(totalCount?: number, nodes?: Record<string, any>[]): any {\n\t\tconst hasTotalCount = totalCount !== undefined\n\t\tif (this.requiresTotalCount && !hasTotalCount) {\n\t\t\tthrow new Error('totalCount is required')\n\t\t}\n\t\tconst hasNodes = nodes !== undefined\n\t\tif (this.requiresNodes && !hasNodes) {\n\t\t\tthrow new Error('nodes are required')\n\t\t}\n\t\treturn {\n\t\t\tpageInfo: { totalCount },\n\t\t\tedges: nodes?.map(it => ({ node: it })),\n\t\t}\n\t}\n}\nexport const createPaginationHelper = (queryAst: ObjectNode<Input.PaginationQueryInput>) => {\n\tconst pageInfoField = queryAst.findFieldByName('pageInfo')[0] as ObjectNode | undefined\n\n\tconst edges = queryAst.findFieldByName('edges')\n\tif (edges.length > 1) {\n\t\tthrow new Error('You cannot fetch edges more than once')\n\t}\n\tconst edgeField = edges?.[0] as ObjectNode | undefined\n\tconst nodes = edgeField?.findFieldByName('node') || []\n\tif (nodes.length > 1) {\n\t\tthrow new Error('You cannot fetch node more than once')\n\t}\n\tconst nodeField = (nodes?.[0] as ObjectNode | undefined)?.withArgs({\n\t\tfilter: queryAst.args.filter,\n\t\torderBy: queryAst.args.orderBy,\n\t\tlimit: queryAst.args.first,\n\t\toffset: queryAst.args.skip,\n\t})\n\treturn new PaginationHelper(pageInfoField, nodeField)\n}\n"],"names":[],"mappings":"AAGO,MAAM,iBAAiB;AAAA,EAC7B,YACiB,eACA,WACf;AAFe,SAAA,gBAAA;AACA,SAAA,YAAA;AAAA,EAAA;AAAA,EAGjB,IAAI,qBAAqB;AACxB,WAAO,KAAK,kBAAkB;AAAA,EAAA;AAAA,EAG/B,IAAI,gBAAgB;AACnB,WAAO,KAAK,cAAc;AAAA,EAAA;AAAA,EAGpB,eAAe,YAAqB,OAAoC;AAC9E,UAAM,gBAAgB,eAAe;AACjC,QAAA,KAAK,sBAAsB,CAAC,eAAe;AACxC,YAAA,IAAI,MAAM,wBAAwB;AAAA,IAAA;AAEzC,UAAM,WAAW,UAAU;AACvB,QAAA,KAAK,iBAAiB,CAAC,UAAU;AAC9B,YAAA,IAAI,MAAM,oBAAoB;AAAA,IAAA;AAE9B,WAAA;AAAA,MACN,UAAU,EAAE,WAAW;AAAA,MACvB,OAAO,OAAO,IAAI,SAAO,EAAE,MAAM,KAAK;AAAA,IACvC;AAAA,EAAA;AAEF;AACa,MAAA,yBAAyB,CAAC,aAAqD;AAC3F,QAAM,gBAAgB,SAAS,gBAAgB,UAAU,EAAE,CAAC;AAEtD,QAAA,QAAQ,SAAS,gBAAgB,OAAO;AAC1C,MAAA,MAAM,SAAS,GAAG;AACf,UAAA,IAAI,MAAM,uCAAuC;AAAA,EAAA;AAElD,QAAA,YAAY,QAAQ,CAAC;AAC3B,QAAM,QAAQ,WAAW,gBAAgB,MAAM,KAAK,CAAC;AACjD,MAAA,MAAM,SAAS,GAAG;AACf,UAAA,IAAI,MAAM,sCAAsC;AAAA,EAAA;AAEvD,QAAM,YAAa,QAAQ,CAAC,GAA8B,SAAS;AAAA,IAClE,QAAQ,SAAS,KAAK;AAAA,IACtB,SAAS,SAAS,KAAK;AAAA,IACvB,OAAO,SAAS,KAAK;AAAA,IACrB,QAAQ,SAAS,KAAK;AAAA,EAAA,CACtB;AACM,SAAA,IAAI,iBAAiB,eAAe,SAAS;AACrD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"singletonFactory.cjs","sources":["../../../../../packages/engine-content-api/src/utils/singletonFactory.ts"],"sourcesContent":["import { ImplementationException } from '../exception'\n\nexport const singletonFactory = <T, Id = string, Args = undefined>(cb: (id: Id, args: Args) => T) => {\n\tconst created = new Map<string, T>()\n\tconst recursionGuard: string[] = []\n\treturn (name: Id, args?: Args): T => {\n\t\tconst idString = typeof name === 'string' ? name : JSON.stringify(name)\n\t\tconst createdVal = created.get(idString)\n\t\tif (createdVal) {\n\t\t\treturn createdVal\n\t\t}\n\t\tif (recursionGuard.includes(idString)) {\n\t\t\tthrow new Error(`Recursion for ${idString} detected`)\n\t\t}\n\t\trecursionGuard.push(idString)\n\t\tconst val = cb(name, args as Args)\n\t\tif (recursionGuard.pop() !== idString) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tcreated.set(idString, val)\n\n\t\treturn val\n\t}\n}\n"],"names":["ImplementationException"],"mappings":";;;AAEa,MAAA,mBAAmB,CAAmC,OAAkC;AAC9F,QAAA,8BAAc;AACpB,QAAM,iBAA2B,CAAA;AAC1B,SAAA,CAAC,MAAU,SAAmB;AACpC,UAAM,WAAW,OAAO,SAAS,WAAW,OAAO,KAAK,UAAU,IAAI;AAChE,UAAA,aAAa,QAAQ,IAAI,QAAQ;AACvC,QAAI,YAAY;AACR,aAAA;AAAA,IACR;AACI,QAAA,eAAe,SAAS,QAAQ,GAAG;AACtC,YAAM,IAAI,MAAM,iBAAiB,QAAQ,WAAW;AAAA,IACrD;AACA,mBAAe,KAAK,QAAQ;AACtB,UAAA,MAAM,GAAG,MAAM,IAAY;AAC7B,QAAA,eAAe,IAAI,MAAM,UAAU;AACtC,YAAM,IAAIA,UAAwB,wBAAA;AAAA,IACnC;AACQ,YAAA,IAAI,UAAU,GAAG;AAElB,WAAA;AAAA,EAAA;AAET;;"}
1
+ {"version":3,"file":"singletonFactory.cjs","sources":["../../../../../packages/engine-content-api/src/utils/singletonFactory.ts"],"sourcesContent":["import { ImplementationException } from '../exception'\n\nexport const singletonFactory = <T, Id = string, Args = undefined>(cb: (id: Id, args: Args) => T) => {\n\tconst created = new Map<string, T>()\n\tconst recursionGuard: string[] = []\n\treturn (name: Id, args?: Args): T => {\n\t\tconst idString = typeof name === 'string' ? name : JSON.stringify(name)\n\t\tconst createdVal = created.get(idString)\n\t\tif (createdVal) {\n\t\t\treturn createdVal\n\t\t}\n\t\tif (recursionGuard.includes(idString)) {\n\t\t\tthrow new Error(`Recursion for ${idString} detected`)\n\t\t}\n\t\trecursionGuard.push(idString)\n\t\tconst val = cb(name, args as Args)\n\t\tif (recursionGuard.pop() !== idString) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tcreated.set(idString, val)\n\n\t\treturn val\n\t}\n}\n"],"names":["ImplementationException"],"mappings":";;;AAEa,MAAA,mBAAmB,CAAmC,OAAkC;AAC9F,QAAA,8BAAc,IAAe;AACnC,QAAM,iBAA2B,CAAC;AAC3B,SAAA,CAAC,MAAU,SAAmB;AACpC,UAAM,WAAW,OAAO,SAAS,WAAW,OAAO,KAAK,UAAU,IAAI;AAChE,UAAA,aAAa,QAAQ,IAAI,QAAQ;AACvC,QAAI,YAAY;AACR,aAAA;AAAA,IAAA;AAEJ,QAAA,eAAe,SAAS,QAAQ,GAAG;AACtC,YAAM,IAAI,MAAM,iBAAiB,QAAQ,WAAW;AAAA,IAAA;AAErD,mBAAe,KAAK,QAAQ;AACtB,UAAA,MAAM,GAAG,MAAM,IAAY;AAC7B,QAAA,eAAe,IAAI,MAAM,UAAU;AACtC,YAAM,IAAIA,UAAAA,wBAAwB;AAAA,IAAA;AAE3B,YAAA,IAAI,UAAU,GAAG;AAElB,WAAA;AAAA,EACR;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"singletonFactory.js","sources":["../../../../../packages/engine-content-api/src/utils/singletonFactory.ts"],"sourcesContent":["import { ImplementationException } from '../exception'\n\nexport const singletonFactory = <T, Id = string, Args = undefined>(cb: (id: Id, args: Args) => T) => {\n\tconst created = new Map<string, T>()\n\tconst recursionGuard: string[] = []\n\treturn (name: Id, args?: Args): T => {\n\t\tconst idString = typeof name === 'string' ? name : JSON.stringify(name)\n\t\tconst createdVal = created.get(idString)\n\t\tif (createdVal) {\n\t\t\treturn createdVal\n\t\t}\n\t\tif (recursionGuard.includes(idString)) {\n\t\t\tthrow new Error(`Recursion for ${idString} detected`)\n\t\t}\n\t\trecursionGuard.push(idString)\n\t\tconst val = cb(name, args as Args)\n\t\tif (recursionGuard.pop() !== idString) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tcreated.set(idString, val)\n\n\t\treturn val\n\t}\n}\n"],"names":[],"mappings":";AAEa,MAAA,mBAAmB,CAAmC,OAAkC;AAC9F,QAAA,8BAAc;AACpB,QAAM,iBAA2B,CAAA;AAC1B,SAAA,CAAC,MAAU,SAAmB;AACpC,UAAM,WAAW,OAAO,SAAS,WAAW,OAAO,KAAK,UAAU,IAAI;AAChE,UAAA,aAAa,QAAQ,IAAI,QAAQ;AACvC,QAAI,YAAY;AACR,aAAA;AAAA,IACR;AACI,QAAA,eAAe,SAAS,QAAQ,GAAG;AACtC,YAAM,IAAI,MAAM,iBAAiB,QAAQ,WAAW;AAAA,IACrD;AACA,mBAAe,KAAK,QAAQ;AACtB,UAAA,MAAM,GAAG,MAAM,IAAY;AAC7B,QAAA,eAAe,IAAI,MAAM,UAAU;AACtC,YAAM,IAAI,wBAAwB;AAAA,IACnC;AACQ,YAAA,IAAI,UAAU,GAAG;AAElB,WAAA;AAAA,EAAA;AAET;"}
1
+ {"version":3,"file":"singletonFactory.js","sources":["../../../../../packages/engine-content-api/src/utils/singletonFactory.ts"],"sourcesContent":["import { ImplementationException } from '../exception'\n\nexport const singletonFactory = <T, Id = string, Args = undefined>(cb: (id: Id, args: Args) => T) => {\n\tconst created = new Map<string, T>()\n\tconst recursionGuard: string[] = []\n\treturn (name: Id, args?: Args): T => {\n\t\tconst idString = typeof name === 'string' ? name : JSON.stringify(name)\n\t\tconst createdVal = created.get(idString)\n\t\tif (createdVal) {\n\t\t\treturn createdVal\n\t\t}\n\t\tif (recursionGuard.includes(idString)) {\n\t\t\tthrow new Error(`Recursion for ${idString} detected`)\n\t\t}\n\t\trecursionGuard.push(idString)\n\t\tconst val = cb(name, args as Args)\n\t\tif (recursionGuard.pop() !== idString) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tcreated.set(idString, val)\n\n\t\treturn val\n\t}\n}\n"],"names":[],"mappings":";AAEa,MAAA,mBAAmB,CAAmC,OAAkC;AAC9F,QAAA,8BAAc,IAAe;AACnC,QAAM,iBAA2B,CAAC;AAC3B,SAAA,CAAC,MAAU,SAAmB;AACpC,UAAM,WAAW,OAAO,SAAS,WAAW,OAAO,KAAK,UAAU,IAAI;AAChE,UAAA,aAAa,QAAQ,IAAI,QAAQ;AACvC,QAAI,YAAY;AACR,aAAA;AAAA,IAAA;AAEJ,QAAA,eAAe,SAAS,QAAQ,GAAG;AACtC,YAAM,IAAI,MAAM,iBAAiB,QAAQ,WAAW;AAAA,IAAA;AAErD,mBAAe,KAAK,QAAQ;AACtB,UAAA,MAAM,GAAG,MAAM,IAAY;AAC7B,QAAA,eAAe,IAAI,MAAM,UAAU;AACtC,YAAM,IAAI,wBAAwB;AAAA,IAAA;AAE3B,YAAA,IAAI,UAAU,GAAG;AAElB,WAAA;AAAA,EACR;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"uniqueWhereFields.cjs","sources":["../../../../../packages/engine-content-api/src/utils/uniqueWhereFields.ts"],"sourcesContent":["import { acceptEveryFieldVisitor } from '@contember/schema-utils'\nimport { Model } from '@contember/schema'\n\ntype SingleUnique = readonly string[]\nexport const getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (SingleUnique)[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...entity.unique.map(it => it.fields), ...relations]\n}\n"],"names":["acceptEveryFieldVisitor"],"mappings":";;;AAIa,MAAA,0BAA0B,CAAC,QAAsB,WAAoD;AACjH,QAAM,YAAY,OAAO;AAAA,IACxBA,YAAA,wBAA8C,QAAQ,QAAQ;AAAA,MAC7D,aAAa,MAAM;AAAA,MACnB,yBAAyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,IAAA,CACtD;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,IAAI,CAAM,OAAA,GAAG,MAAM,GAAG,GAAG,SAAS;AAC9E;;"}
1
+ {"version":3,"file":"uniqueWhereFields.cjs","sources":["../../../../../packages/engine-content-api/src/utils/uniqueWhereFields.ts"],"sourcesContent":["import { acceptEveryFieldVisitor } from '@contember/schema-utils'\nimport { Model } from '@contember/schema'\n\ntype SingleUnique = readonly string[]\nexport const getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (SingleUnique)[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...entity.unique.map(it => it.fields), ...relations]\n}\n"],"names":["acceptEveryFieldVisitor"],"mappings":";;;AAIa,MAAA,0BAA0B,CAAC,QAAsB,WAAoD;AACjH,QAAM,YAAY,OAAO;AAAA,IACxBA,YAAA,wBAA8C,QAAQ,QAAQ;AAAA,MAC7D,aAAa,MAAM;AAAA,MACnB,yBAAyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,eAAe,CAAC,SAAS,IAAI;AAAA,IACtD,CAAA;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,IAAI,CAAM,OAAA,GAAG,MAAM,GAAG,GAAG,SAAS;AAC9E;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"uniqueWhereFields.js","sources":["../../../../../packages/engine-content-api/src/utils/uniqueWhereFields.ts"],"sourcesContent":["import { acceptEveryFieldVisitor } from '@contember/schema-utils'\nimport { Model } from '@contember/schema'\n\ntype SingleUnique = readonly string[]\nexport const getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (SingleUnique)[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...entity.unique.map(it => it.fields), ...relations]\n}\n"],"names":[],"mappings":";AAIa,MAAA,0BAA0B,CAAC,QAAsB,WAAoD;AACjH,QAAM,YAAY,OAAO;AAAA,IACxB,wBAA8C,QAAQ,QAAQ;AAAA,MAC7D,aAAa,MAAM;AAAA,MACnB,yBAAyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,IAAA,CACtD;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,IAAI,CAAM,OAAA,GAAG,MAAM,GAAG,GAAG,SAAS;AAC9E;"}
1
+ {"version":3,"file":"uniqueWhereFields.js","sources":["../../../../../packages/engine-content-api/src/utils/uniqueWhereFields.ts"],"sourcesContent":["import { acceptEveryFieldVisitor } from '@contember/schema-utils'\nimport { Model } from '@contember/schema'\n\ntype SingleUnique = readonly string[]\nexport const getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (SingleUnique)[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...entity.unique.map(it => it.fields), ...relations]\n}\n"],"names":[],"mappings":";AAIa,MAAA,0BAA0B,CAAC,QAAsB,WAAoD;AACjH,QAAM,YAAY,OAAO;AAAA,IACxB,wBAA8C,QAAQ,QAAQ;AAAA,MAC7D,aAAa,MAAM;AAAA,MACnB,yBAAyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,eAAe,CAAC,SAAS,IAAI;AAAA,IACtD,CAAA;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,IAAI,CAAM,OAAA,GAAG,MAAM,GAAG,GAAG,SAAS;AAC9E;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExecutionContainer.cjs","sources":["../../../../packages/engine-content-api/src/ExecutionContainer.ts"],"sourcesContent":["import { PredicateFactory, PredicatesInjector, VariableInjector } from './acl'\nimport {\n\tConditionBuilder,\n\tFieldsVisitorFactory,\n\tJoinBuilder,\n\tMetaHandler,\n\tOrderByBuilder,\n\tRelationFetcher,\n\tWhereBuilder,\n} from './mapper/select'\nimport { UniqueWhereExpander } from './inputProcessing'\nimport { HasManyToHasOneReducer, HasManyToHasOneReducerExecutionHandler } from './extensions'\nimport {\n\tDeleteExecutor,\n\tInsertBuilderFactory,\n\tInserter,\n\tJunctionConnectHandler,\n\tJunctionDisconnectHandler,\n\tJunctionTableManager,\n\tMapperFactory,\n\tPathFactory,\n\tSelectBuilder,\n\tSelectBuilderFactory,\n\tSelectHydrator,\n\tUpdateBuilderFactory,\n\tUpdater,\n} from './mapper'\nimport { Builder } from '@contember/dic'\nimport { Acl, Model, Schema } from '@contember/schema'\nimport { Client, DatabaseMetadata, SelectBuilder as DbSelectBuilder } from '@contember/database'\nimport { Providers } from '@contember/schema-utils'\nimport { PaginatedHasManyExecutionHandler } from './extensions/paginatedHasMany/PaginatedHasManyExecutionHandler'\nimport { PaginatedHasManyFieldProvider } from './extensions/paginatedHasMany/PaginatedHasManyFieldProvider'\nimport { WhereOptimizer } from './mapper/select/optimizer/WhereOptimizer'\nimport { ConditionOptimizer } from './mapper/select/optimizer/ConditionOptimizer'\nimport { GraphQlQueryAstFactory, MutationResolver, ReadResolver, ValidationResolver } from './resolvers'\nimport {\n\tColumnValueResolver,\n\tDependencyCollector,\n\tEntityRulesResolver, InputPreValidator,\n\tQueryAstFactory,\n\tValidationDataSelector,\n} from './input-validation'\n\nexport type ExecutionContainerArgs = {\n\tschema: Schema\n\tschemaMeta: { id?: number }\n\tschemaDatabaseMetadata: DatabaseMetadata\n\tdb: Client\n\tidentityId: string\n\tidentityVariables: Acl.VariablesMap\n\tpermissions: Acl.Permissions\n\tsystemSchema: string\n\tproject: { slug: string }\n\tstage: { id: string; slug: string }\n}\n\nexport interface ExecutionContainer {\n\treadResolver: ReadResolver\n\tmutationResolver: MutationResolver\n\tvalidationResolver: ValidationResolver\n}\n\nexport type ExecutionContainerBuilder = ReturnType<ExecutionContainerFactory['createBuilderInternal']>\nexport type ExecutionContainerHook = (builder: ExecutionContainerBuilder) => ExecutionContainerBuilder\n\nexport class ExecutionContainerFactory {\n\tpublic readonly hooks: ExecutionContainerHook[] = []\n\n\tconstructor(\n\t\tprivate readonly providers: Providers,\n\t) {\n\t}\n\n\tcreateBuilder(args: ExecutionContainerArgs): ExecutionContainerBuilder {\n\t\tconst builder = this.createBuilderInternal(args)\n\t\treturn this.hooks.reduce((acc, cb) => cb(acc), builder)\n\t}\n\n\tcreateBuilderInternal({ permissions, identityVariables, identityId, db, schema, schemaMeta, systemSchema, stage, project, schemaDatabaseMetadata }: ExecutionContainerArgs) {\n\t\treturn new Builder({})\n\t\t\t.addService('systemSchema', () =>\n\t\t\t\tsystemSchema)\n\t\t\t.addService('db', () =>\n\t\t\t\tdb)\n\t\t\t.addService('project', () =>\n\t\t\t\tproject)\n\t\t\t.addService('stage', () =>\n\t\t\t\tstage)\n\t\t\t.addService('schema', () =>\n\t\t\t\tschema)\n\t\t\t.addService('schemaMeta', () =>\n\t\t\t\tschemaMeta)\n\t\t\t.addService('schemaDatabaseMetadata', () =>\n\t\t\t\tschemaDatabaseMetadata)\n\t\t\t.addService('providers', () =>\n\t\t\t\tthis.providers)\n\t\t\t.addService('variableInjector', ({ schema }) =>\n\t\t\t\tnew VariableInjector(schema.model, identityVariables))\n\t\t\t.addService('predicateFactory', ({ variableInjector, schema }) =>\n\t\t\t\tnew PredicateFactory(permissions, schema.model, variableInjector))\n\t\t\t.addService('predicatesInjector', ({ predicateFactory, schema }) =>\n\t\t\t\tnew PredicatesInjector(schema.model, predicateFactory))\n\t\t\t.addService('joinBuilder', ({ schema }) =>\n\t\t\t\tnew JoinBuilder(schema.model))\n\t\t\t.addService('conditionBuilder', () =>\n\t\t\t\tnew ConditionBuilder())\n\t\t\t.addService('pathFactory', () =>\n\t\t\t\tnew PathFactory())\n\t\t\t.addService('whereOptimized', ({ schema }) =>\n\t\t\t\tnew WhereOptimizer(schema.model, new ConditionOptimizer()))\n\t\t\t.addService('whereBuilder', ({ joinBuilder, conditionBuilder, pathFactory, whereOptimized, schema }) =>\n\t\t\t\tnew WhereBuilder(\n\t\t\t\t\tschema.model,\n\t\t\t\t\tjoinBuilder,\n\t\t\t\t\tconditionBuilder,\n\t\t\t\t\tpathFactory,\n\t\t\t\t\twhereOptimized,\n\t\t\t\t\t(schema.settings.content?.useExistsInHasManyFilter ?? schema.settings.useExistsInHasManyFilter) === true,\n\t\t\t\t))\n\t\t\t.addService('orderByBuilder', ({ joinBuilder, schema }) =>\n\t\t\t\tnew OrderByBuilder(schema.model, joinBuilder))\n\t\t\t.addService('relationFetcher', ({ whereBuilder, orderByBuilder, predicatesInjector, pathFactory }) =>\n\t\t\t\tnew RelationFetcher(whereBuilder, orderByBuilder, predicatesInjector, pathFactory))\n\t\t\t.addService('fieldsVisitorFactory', ({ relationFetcher, predicateFactory, schema }) =>\n\t\t\t\tnew FieldsVisitorFactory(relationFetcher, predicateFactory, schema.settings.content ?? {}))\n\t\t\t.addService('metaHandler', ({ whereBuilder, predicateFactory }) =>\n\t\t\t\tnew MetaHandler(whereBuilder, predicateFactory))\n\t\t\t.addService('uniqueWhereExpander', ({ schema }) =>\n\t\t\t\tnew UniqueWhereExpander(schema.model))\n\t\t\t.addService('hasManyToHasOneReducer', ({ uniqueWhereExpander, schema }) =>\n\t\t\t\tnew HasManyToHasOneReducerExecutionHandler(schema.model, uniqueWhereExpander))\n\t\t\t.addService('paginatedHasManyExecutionHandler', ({ relationFetcher, schema }) =>\n\t\t\t\tnew PaginatedHasManyExecutionHandler(schema.model, relationFetcher))\n\t\t\t.addService('selectHandlers', ({ hasManyToHasOneReducer, paginatedHasManyExecutionHandler }) => ({\n\t\t\t\t[HasManyToHasOneReducer.extensionName]: hasManyToHasOneReducer,\n\t\t\t\t[PaginatedHasManyFieldProvider.extensionName]: paginatedHasManyExecutionHandler,\n\t\t\t}))\n\t\t\t.addService('selectBuilderFactory', ({ whereBuilder, orderByBuilder, fieldsVisitorFactory, metaHandler, selectHandlers, pathFactory, predicateFactory, schema }) =>\n\t\t\t\tnew (class implements SelectBuilderFactory {\n\t\t\t\t\tcreate(qb: DbSelectBuilder, hydrator: SelectHydrator, relationPath: Model.AnyRelationContext[]): SelectBuilder {\n\t\t\t\t\t\treturn new SelectBuilder(\n\t\t\t\t\t\t\tschema.model,\n\t\t\t\t\t\t\twhereBuilder,\n\t\t\t\t\t\t\torderByBuilder,\n\t\t\t\t\t\t\tmetaHandler,\n\t\t\t\t\t\t\tqb,\n\t\t\t\t\t\t\thydrator,\n\t\t\t\t\t\t\tfieldsVisitorFactory,\n\t\t\t\t\t\t\tselectHandlers,\n\t\t\t\t\t\t\tpathFactory,\n\t\t\t\t\t\t\trelationPath,\n\t\t\t\t\t\t\tpredicateFactory,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t})())\n\t\t\t.addService('insertBuilderFactory', ({ whereBuilder, pathFactory, schema, predicateFactory }) =>\n\t\t\t\tnew InsertBuilderFactory(schema.model, whereBuilder, pathFactory, predicateFactory))\n\t\t\t.addService('updateBuilderFactory', ({ whereBuilder, pathFactory, schema, predicateFactory }) =>\n\t\t\t\tnew UpdateBuilderFactory(schema.model, whereBuilder, pathFactory, predicateFactory))\n\t\t\t.addService('connectJunctionHandler', () =>\n\t\t\t\tnew JunctionConnectHandler())\n\t\t\t.addService('disconnectJunctionHandler', ({}) =>\n\t\t\t\tnew JunctionDisconnectHandler())\n\t\t\t.addService('junctionTableManager', ({ predicateFactory, whereBuilder, connectJunctionHandler, disconnectJunctionHandler, pathFactory, schema }) =>\n\t\t\t\tnew JunctionTableManager(schema.model, predicateFactory, whereBuilder, connectJunctionHandler, disconnectJunctionHandler, pathFactory))\n\t\t\t.addService('deleteExecutor', ({ predicateFactory, updateBuilderFactory, whereBuilder, pathFactory, schema }) =>\n\t\t\t\tnew DeleteExecutor(schema.model, predicateFactory, whereBuilder, updateBuilderFactory, pathFactory))\n\t\t\t.addService('updater', ({ predicateFactory, updateBuilderFactory, schema, schemaDatabaseMetadata }) =>\n\t\t\t\tnew Updater(schema.model, schemaDatabaseMetadata, predicateFactory, updateBuilderFactory))\n\t\t\t.addService('inserter', ({ insertBuilderFactory, providers, schema, schemaDatabaseMetadata }) =>\n\t\t\t\tnew Inserter(schema.model, schemaDatabaseMetadata, insertBuilderFactory, providers))\n\t\t\t.addService('mapperFactory', ({ predicatesInjector, selectBuilderFactory, uniqueWhereExpander, whereBuilder, junctionTableManager, deleteExecutor, updater, inserter, pathFactory, providers, schema, schemaDatabaseMetadata }) => {\n\t\t\t\treturn new MapperFactory(\n\t\t\t\t\tdb,\n\t\t\t\t\tidentityId,\n\t\t\t\t\tschema.model,\n\t\t\t\t\tschemaDatabaseMetadata,\n\t\t\t\t\tpredicatesInjector,\n\t\t\t\t\tselectBuilderFactory,\n\t\t\t\t\tuniqueWhereExpander,\n\t\t\t\t\twhereBuilder,\n\t\t\t\t\tjunctionTableManager,\n\t\t\t\t\tdeleteExecutor,\n\t\t\t\t\tupdater,\n\t\t\t\t\tinserter,\n\t\t\t\t\tpathFactory,\n\t\t\t\t\tproviders,\n\t\t\t\t)\n\t\t\t})\n\n\t\t\t.addService('queryAstFactory', () =>\n\t\t\t\tnew GraphQlQueryAstFactory())\n\t\t\t.addService('readResolver', ({ mapperFactory, queryAstFactory }) =>\n\t\t\t\tnew ReadResolver(mapperFactory, queryAstFactory))\n\t\t\t.addService('validationDependencyCollector', () =>\n\t\t\t\tnew DependencyCollector())\n\t\t\t.addService('validationQueryAstFactory', ({ schema }) =>\n\t\t\t\tnew QueryAstFactory(schema.model))\n\t\t\t.addService('dataSelector', ({ validationQueryAstFactory, schema }) =>\n\t\t\t\tnew ValidationDataSelector(schema.model, validationQueryAstFactory))\n\t\t\t.addService('columnValueResolver', ({ providers }) =>\n\t\t\t\tnew ColumnValueResolver(providers))\n\t\t\t.addService('entityRulesResolver', ({ schema }) =>\n\t\t\t\tnew EntityRulesResolver(schema.validation, schema.model))\n\t\t\t.addService('inputPreValidator', ({ entityRulesResolver, columnValueResolver, dataSelector, schema }) =>\n\t\t\t\tnew InputPreValidator(schema.model, entityRulesResolver, columnValueResolver, dataSelector))\n\t\t\t.addService('mutationResolver', ({ mapperFactory, inputPreValidator, queryAstFactory, schema, schemaDatabaseMetadata }) =>\n\t\t\t\tnew MutationResolver(schema.model, mapperFactory, inputPreValidator, queryAstFactory, schemaDatabaseMetadata))\n\t\t\t.addService('validationResolver', ({ inputPreValidator, mapperFactory }) =>\n\t\t\t\tnew ValidationResolver(mapperFactory, inputPreValidator))\n\t}\n\n\tpublic create(args: ExecutionContainerArgs): ExecutionContainer {\n\t\treturn this.createBuilder(args).build().pick('validationResolver', 'readResolver', 'mutationResolver')\n\t}\n}\n\n"],"names":["Builder","schema","VariableInjector","PredicateFactory","PredicatesInjector","JoinBuilder","ConditionBuilder","PathFactory","WhereOptimizer","ConditionOptimizer","WhereBuilder","OrderByBuilder","RelationFetcher","FieldsVisitorFactory","MetaHandler","UniqueWhereExpander","HasManyToHasOneReducerExecutionHandler","PaginatedHasManyExecutionHandler","HasManyToHasOneReducer","PaginatedHasManyFieldProvider","SelectBuilder","InsertBuilderFactory","UpdateBuilderFactory","JunctionConnectHandler","JunctionDisconnectHandler","JunctionTableManager","DeleteExecutor","schemaDatabaseMetadata","Updater","Inserter","MapperFactory","GraphQlQueryAstFactory","ReadResolver","DependencyCollector","QueryAstFactory","ValidationDataSelector","ColumnValueResolver","EntityRulesResolver","InputPreValidator","MutationResolver","ValidationResolver"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEO,MAAM,0BAA0B;AAAA,EAGtC,YACkB,WAChB;AADgB,SAAA,YAAA;AAHlB,kBAAA,MAAgB,SAAkC,CAAA,CAAC;AAAA,EAKnD;AAAA,EAEA,cAAc,MAAyD;AAChE,UAAA,UAAU,KAAK,sBAAsB,IAAI;AACxC,WAAA,KAAK,MAAM,OAAO,CAAC,KAAK,OAAO,GAAG,GAAG,GAAG,OAAO;AAAA,EACvD;AAAA,EAEA,sBAAsB,EAAE,aAAa,mBAAmB,YAAY,IAAI,QAAQ,YAAY,cAAc,OAAO,SAAS,uBAAA,GAAkD;AAC3K,WAAO,IAAIA,IAAAA,QAAQ,CAAA,CAAE,EACnB,WAAW,gBAAgB,MAC3B,YAAY,EACZ,WAAW,MAAM,MACjB,EAAE,EACF,WAAW,WAAW,MACtB,OAAO,EACP,WAAW,SAAS,MACpB,KAAK,EACL,WAAW,UAAU,MACrB,MAAM,EACN,WAAW,cAAc,MACzB,UAAU,EACV,WAAW,0BAA0B,MACrC,sBAAsB,EACtB,WAAW,aAAa,MACxB,KAAK,SAAS,EACd,WAAW,oBAAoB,CAAC,EAAE,QAAAC,QAAO,MACzC,IAAIC,kCAAiBD,QAAO,OAAO,iBAAiB,CAAC,EACrD,WAAW,oBAAoB,CAAC,EAAE,kBAAkB,QAAAA,QACpD,MAAA,IAAIE,iBAAAA,iBAAiB,aAAaF,QAAO,OAAO,gBAAgB,CAAC,EACjE,WAAW,sBAAsB,CAAC,EAAE,kBAAkB,QAAAA,QAAAA,MACtD,IAAIG,mBAAmBH,mBAAAA,QAAO,OAAO,gBAAgB,CAAC,EACtD,WAAW,eAAe,CAAC,EAAE,QAAAA,cAC7B,IAAII,wBAAYJ,QAAO,KAAK,CAAC,EAC7B,WAAW,oBAAoB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WAAW,qBAAqB,CAAC,EAAE,qBAAqB,qBAAqB,cAAc,QAAAA,cAC3F,IAAIqC,kBAAA,kBAAkBrC,QAAO,OAAO,qBAAqB,qBAAqB,YAAY,CAAC,EAC3F,WAAW,oBAAoB,CAAC,EAAE,eAAe,mBAAmB,iBAAiB,QAAAA,SAAQ,wBAAA0B,wBAAuB,MACpH,IAAIY,iBAAA,iBAAiBtC,QAAO,OAAO,eAAe,mBAAmB,iBAAiB0B,uBAAsB,CAAC,EAC7G,WAAW,sBAAsB,CAAC,EAAE,mBAAmB,cAAA,MACvD,IAAIa,mBAAmB,mBAAA,eAAe,iBAAiB,CAAC;AAAA,EAC3D;AAAA,EAEO,OAAO,MAAkD;AACxD,WAAA,KAAK,cAAc,IAAI,EAAE,QAAQ,KAAK,sBAAsB,gBAAgB,kBAAkB;AAAA,EACtG;AACD;;"}
1
+ {"version":3,"file":"ExecutionContainer.cjs","sources":["../../../../packages/engine-content-api/src/ExecutionContainer.ts"],"sourcesContent":["import { PredicateFactory, PredicatesInjector, VariableInjector } from './acl'\nimport {\n\tConditionBuilder,\n\tFieldsVisitorFactory,\n\tJoinBuilder,\n\tMetaHandler,\n\tOrderByBuilder,\n\tRelationFetcher,\n\tWhereBuilder,\n} from './mapper/select'\nimport { UniqueWhereExpander } from './inputProcessing'\nimport { HasManyToHasOneReducer, HasManyToHasOneReducerExecutionHandler } from './extensions'\nimport {\n\tDeleteExecutor,\n\tInsertBuilderFactory,\n\tInserter,\n\tJunctionConnectHandler,\n\tJunctionDisconnectHandler,\n\tJunctionTableManager,\n\tMapperFactory,\n\tPathFactory,\n\tSelectBuilder,\n\tSelectBuilderFactory,\n\tSelectHydrator,\n\tUpdateBuilderFactory,\n\tUpdater,\n} from './mapper'\nimport { Builder } from '@contember/dic'\nimport { Acl, Model, Schema } from '@contember/schema'\nimport { Client, DatabaseMetadata, SelectBuilder as DbSelectBuilder } from '@contember/database'\nimport { Providers } from '@contember/schema-utils'\nimport { PaginatedHasManyExecutionHandler } from './extensions/paginatedHasMany/PaginatedHasManyExecutionHandler'\nimport { PaginatedHasManyFieldProvider } from './extensions/paginatedHasMany/PaginatedHasManyFieldProvider'\nimport { WhereOptimizer } from './mapper/select/optimizer/WhereOptimizer'\nimport { ConditionOptimizer } from './mapper/select/optimizer/ConditionOptimizer'\nimport { GraphQlQueryAstFactory, MutationResolver, ReadResolver, ValidationResolver } from './resolvers'\nimport {\n\tColumnValueResolver,\n\tDependencyCollector,\n\tEntityRulesResolver, InputPreValidator,\n\tQueryAstFactory,\n\tValidationDataSelector,\n} from './input-validation'\n\nexport type ExecutionContainerArgs = {\n\tschema: Schema\n\tschemaMeta: { id?: number }\n\tschemaDatabaseMetadata: DatabaseMetadata\n\tdb: Client\n\tidentityId: string\n\tidentityVariables: Acl.VariablesMap\n\tpermissions: Acl.Permissions\n\tsystemSchema: string\n\tproject: { slug: string }\n\tstage: { id: string; slug: string }\n}\n\nexport interface ExecutionContainer {\n\treadResolver: ReadResolver\n\tmutationResolver: MutationResolver\n\tvalidationResolver: ValidationResolver\n}\n\nexport type ExecutionContainerBuilder = ReturnType<ExecutionContainerFactory['createBuilderInternal']>\nexport type ExecutionContainerHook = (builder: ExecutionContainerBuilder) => ExecutionContainerBuilder\n\nexport class ExecutionContainerFactory {\n\tpublic readonly hooks: ExecutionContainerHook[] = []\n\n\tconstructor(\n\t\tprivate readonly providers: Providers,\n\t) {\n\t}\n\n\tcreateBuilder(args: ExecutionContainerArgs): ExecutionContainerBuilder {\n\t\tconst builder = this.createBuilderInternal(args)\n\t\treturn this.hooks.reduce((acc, cb) => cb(acc), builder)\n\t}\n\n\tcreateBuilderInternal({ permissions, identityVariables, identityId, db, schema, schemaMeta, systemSchema, stage, project, schemaDatabaseMetadata }: ExecutionContainerArgs) {\n\t\treturn new Builder({})\n\t\t\t.addService('systemSchema', () =>\n\t\t\t\tsystemSchema)\n\t\t\t.addService('db', () =>\n\t\t\t\tdb)\n\t\t\t.addService('project', () =>\n\t\t\t\tproject)\n\t\t\t.addService('stage', () =>\n\t\t\t\tstage)\n\t\t\t.addService('schema', () =>\n\t\t\t\tschema)\n\t\t\t.addService('schemaMeta', () =>\n\t\t\t\tschemaMeta)\n\t\t\t.addService('schemaDatabaseMetadata', () =>\n\t\t\t\tschemaDatabaseMetadata)\n\t\t\t.addService('providers', () =>\n\t\t\t\tthis.providers)\n\t\t\t.addService('variableInjector', ({ schema }) =>\n\t\t\t\tnew VariableInjector(schema.model, identityVariables))\n\t\t\t.addService('predicateFactory', ({ variableInjector, schema }) =>\n\t\t\t\tnew PredicateFactory(permissions, schema.model, variableInjector))\n\t\t\t.addService('predicatesInjector', ({ predicateFactory, schema }) =>\n\t\t\t\tnew PredicatesInjector(schema.model, predicateFactory))\n\t\t\t.addService('joinBuilder', ({ schema }) =>\n\t\t\t\tnew JoinBuilder(schema.model))\n\t\t\t.addService('conditionBuilder', () =>\n\t\t\t\tnew ConditionBuilder())\n\t\t\t.addService('pathFactory', () =>\n\t\t\t\tnew PathFactory())\n\t\t\t.addService('whereOptimized', ({ schema }) =>\n\t\t\t\tnew WhereOptimizer(schema.model, new ConditionOptimizer()))\n\t\t\t.addService('whereBuilder', ({ joinBuilder, conditionBuilder, pathFactory, whereOptimized, schema }) =>\n\t\t\t\tnew WhereBuilder(\n\t\t\t\t\tschema.model,\n\t\t\t\t\tjoinBuilder,\n\t\t\t\t\tconditionBuilder,\n\t\t\t\t\tpathFactory,\n\t\t\t\t\twhereOptimized,\n\t\t\t\t\t(schema.settings.content?.useExistsInHasManyFilter ?? schema.settings.useExistsInHasManyFilter) === true,\n\t\t\t\t))\n\t\t\t.addService('orderByBuilder', ({ joinBuilder, schema }) =>\n\t\t\t\tnew OrderByBuilder(schema.model, joinBuilder))\n\t\t\t.addService('relationFetcher', ({ whereBuilder, orderByBuilder, predicatesInjector, pathFactory }) =>\n\t\t\t\tnew RelationFetcher(whereBuilder, orderByBuilder, predicatesInjector, pathFactory))\n\t\t\t.addService('fieldsVisitorFactory', ({ relationFetcher, predicateFactory, schema }) =>\n\t\t\t\tnew FieldsVisitorFactory(relationFetcher, predicateFactory, schema.settings.content ?? {}))\n\t\t\t.addService('metaHandler', ({ whereBuilder, predicateFactory }) =>\n\t\t\t\tnew MetaHandler(whereBuilder, predicateFactory))\n\t\t\t.addService('uniqueWhereExpander', ({ schema }) =>\n\t\t\t\tnew UniqueWhereExpander(schema.model))\n\t\t\t.addService('hasManyToHasOneReducer', ({ uniqueWhereExpander, schema }) =>\n\t\t\t\tnew HasManyToHasOneReducerExecutionHandler(schema.model, uniqueWhereExpander))\n\t\t\t.addService('paginatedHasManyExecutionHandler', ({ relationFetcher, schema }) =>\n\t\t\t\tnew PaginatedHasManyExecutionHandler(schema.model, relationFetcher))\n\t\t\t.addService('selectHandlers', ({ hasManyToHasOneReducer, paginatedHasManyExecutionHandler }) => ({\n\t\t\t\t[HasManyToHasOneReducer.extensionName]: hasManyToHasOneReducer,\n\t\t\t\t[PaginatedHasManyFieldProvider.extensionName]: paginatedHasManyExecutionHandler,\n\t\t\t}))\n\t\t\t.addService('selectBuilderFactory', ({ whereBuilder, orderByBuilder, fieldsVisitorFactory, metaHandler, selectHandlers, pathFactory, predicateFactory, schema }) =>\n\t\t\t\tnew (class implements SelectBuilderFactory {\n\t\t\t\t\tcreate(qb: DbSelectBuilder, hydrator: SelectHydrator, relationPath: Model.AnyRelationContext[]): SelectBuilder {\n\t\t\t\t\t\treturn new SelectBuilder(\n\t\t\t\t\t\t\tschema.model,\n\t\t\t\t\t\t\twhereBuilder,\n\t\t\t\t\t\t\torderByBuilder,\n\t\t\t\t\t\t\tmetaHandler,\n\t\t\t\t\t\t\tqb,\n\t\t\t\t\t\t\thydrator,\n\t\t\t\t\t\t\tfieldsVisitorFactory,\n\t\t\t\t\t\t\tselectHandlers,\n\t\t\t\t\t\t\tpathFactory,\n\t\t\t\t\t\t\trelationPath,\n\t\t\t\t\t\t\tpredicateFactory,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t})())\n\t\t\t.addService('insertBuilderFactory', ({ whereBuilder, pathFactory, schema, predicateFactory }) =>\n\t\t\t\tnew InsertBuilderFactory(schema.model, whereBuilder, pathFactory, predicateFactory))\n\t\t\t.addService('updateBuilderFactory', ({ whereBuilder, pathFactory, schema, predicateFactory }) =>\n\t\t\t\tnew UpdateBuilderFactory(schema.model, whereBuilder, pathFactory, predicateFactory))\n\t\t\t.addService('connectJunctionHandler', () =>\n\t\t\t\tnew JunctionConnectHandler())\n\t\t\t.addService('disconnectJunctionHandler', ({}) =>\n\t\t\t\tnew JunctionDisconnectHandler())\n\t\t\t.addService('junctionTableManager', ({ predicateFactory, whereBuilder, connectJunctionHandler, disconnectJunctionHandler, pathFactory, schema }) =>\n\t\t\t\tnew JunctionTableManager(schema.model, predicateFactory, whereBuilder, connectJunctionHandler, disconnectJunctionHandler, pathFactory))\n\t\t\t.addService('deleteExecutor', ({ predicateFactory, updateBuilderFactory, whereBuilder, pathFactory, schema }) =>\n\t\t\t\tnew DeleteExecutor(schema.model, predicateFactory, whereBuilder, updateBuilderFactory, pathFactory))\n\t\t\t.addService('updater', ({ predicateFactory, updateBuilderFactory, schema, schemaDatabaseMetadata }) =>\n\t\t\t\tnew Updater(schema.model, schemaDatabaseMetadata, predicateFactory, updateBuilderFactory))\n\t\t\t.addService('inserter', ({ insertBuilderFactory, providers, schema, schemaDatabaseMetadata }) =>\n\t\t\t\tnew Inserter(schema.model, schemaDatabaseMetadata, insertBuilderFactory, providers))\n\t\t\t.addService('mapperFactory', ({ predicatesInjector, selectBuilderFactory, uniqueWhereExpander, whereBuilder, junctionTableManager, deleteExecutor, updater, inserter, pathFactory, providers, schema, schemaDatabaseMetadata }) => {\n\t\t\t\treturn new MapperFactory(\n\t\t\t\t\tdb,\n\t\t\t\t\tidentityId,\n\t\t\t\t\tschema.model,\n\t\t\t\t\tschemaDatabaseMetadata,\n\t\t\t\t\tpredicatesInjector,\n\t\t\t\t\tselectBuilderFactory,\n\t\t\t\t\tuniqueWhereExpander,\n\t\t\t\t\twhereBuilder,\n\t\t\t\t\tjunctionTableManager,\n\t\t\t\t\tdeleteExecutor,\n\t\t\t\t\tupdater,\n\t\t\t\t\tinserter,\n\t\t\t\t\tpathFactory,\n\t\t\t\t\tproviders,\n\t\t\t\t)\n\t\t\t})\n\n\t\t\t.addService('queryAstFactory', () =>\n\t\t\t\tnew GraphQlQueryAstFactory())\n\t\t\t.addService('readResolver', ({ mapperFactory, queryAstFactory }) =>\n\t\t\t\tnew ReadResolver(mapperFactory, queryAstFactory))\n\t\t\t.addService('validationDependencyCollector', () =>\n\t\t\t\tnew DependencyCollector())\n\t\t\t.addService('validationQueryAstFactory', ({ schema }) =>\n\t\t\t\tnew QueryAstFactory(schema.model))\n\t\t\t.addService('dataSelector', ({ validationQueryAstFactory, schema }) =>\n\t\t\t\tnew ValidationDataSelector(schema.model, validationQueryAstFactory))\n\t\t\t.addService('columnValueResolver', ({ providers }) =>\n\t\t\t\tnew ColumnValueResolver(providers))\n\t\t\t.addService('entityRulesResolver', ({ schema }) =>\n\t\t\t\tnew EntityRulesResolver(schema.validation, schema.model))\n\t\t\t.addService('inputPreValidator', ({ entityRulesResolver, columnValueResolver, dataSelector, schema }) =>\n\t\t\t\tnew InputPreValidator(schema.model, entityRulesResolver, columnValueResolver, dataSelector))\n\t\t\t.addService('mutationResolver', ({ mapperFactory, inputPreValidator, queryAstFactory, schema, schemaDatabaseMetadata }) =>\n\t\t\t\tnew MutationResolver(schema.model, mapperFactory, inputPreValidator, queryAstFactory, schemaDatabaseMetadata))\n\t\t\t.addService('validationResolver', ({ inputPreValidator, mapperFactory }) =>\n\t\t\t\tnew ValidationResolver(mapperFactory, inputPreValidator))\n\t}\n\n\tpublic create(args: ExecutionContainerArgs): ExecutionContainer {\n\t\treturn this.createBuilder(args).build().pick('validationResolver', 'readResolver', 'mutationResolver')\n\t}\n}\n\n"],"names":["Builder","schema","VariableInjector","PredicateFactory","PredicatesInjector","JoinBuilder","ConditionBuilder","PathFactory","WhereOptimizer","ConditionOptimizer","WhereBuilder","OrderByBuilder","RelationFetcher","FieldsVisitorFactory","MetaHandler","UniqueWhereExpander","HasManyToHasOneReducerExecutionHandler","PaginatedHasManyExecutionHandler","HasManyToHasOneReducer","PaginatedHasManyFieldProvider","SelectBuilder","InsertBuilderFactory","UpdateBuilderFactory","JunctionConnectHandler","JunctionDisconnectHandler","JunctionTableManager","DeleteExecutor","schemaDatabaseMetadata","Updater","Inserter","MapperFactory","GraphQlQueryAstFactory","ReadResolver","DependencyCollector","QueryAstFactory","ValidationDataSelector","ColumnValueResolver","EntityRulesResolver","InputPreValidator","MutationResolver","ValidationResolver"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEO,MAAM,0BAA0B;AAAA,EAGtC,YACkB,WAChB;AADgB,SAAA,YAAA;AAHlB,kBAAA,MAAgB,SAAkC,EAAC;AAAA,EAAA;AAAA,EAOnD,cAAc,MAAyD;AAChE,UAAA,UAAU,KAAK,sBAAsB,IAAI;AACxC,WAAA,KAAK,MAAM,OAAO,CAAC,KAAK,OAAO,GAAG,GAAG,GAAG,OAAO;AAAA,EAAA;AAAA,EAGvD,sBAAsB,EAAE,aAAa,mBAAmB,YAAY,IAAI,QAAQ,YAAY,cAAc,OAAO,SAAS,uBAAA,GAAkD;AAC3K,WAAO,IAAIA,IAAAA,QAAQ,CAAA,CAAE,EACnB,WAAW,gBAAgB,MAC3B,YAAY,EACZ,WAAW,MAAM,MACjB,EAAE,EACF,WAAW,WAAW,MACtB,OAAO,EACP,WAAW,SAAS,MACpB,KAAK,EACL,WAAW,UAAU,MACrB,MAAM,EACN,WAAW,cAAc,MACzB,UAAU,EACV,WAAW,0BAA0B,MACrC,sBAAsB,EACtB,WAAW,aAAa,MACxB,KAAK,SAAS,EACd,WAAW,oBAAoB,CAAC,EAAE,QAAAC,QAAO,MACzC,IAAIC,kCAAiBD,QAAO,OAAO,iBAAiB,CAAC,EACrD,WA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