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

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":"MutationResolver.js","sources":["../../../../../packages/engine-content-api/src/resolvers/MutationResolver.ts"],"sourcesContent":["import { Input, Model, Result, Value } from '@contember/schema'\nimport {\n\tAfterCommitEvent,\n\tBeforeCommitEvent,\n\tConstraintType,\n\tconvertError,\n\tgetInsertPrimary,\n\tInputErrorKind,\n\tMapper,\n\tMapperFactory,\n\tMutationResultHint,\n\tMutationResultList,\n\tMutationResultType,\n\ttryMutation,\n} from '../mapper'\nimport { ValidationResolver } from './ValidationResolver'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { GraphQlQueryAstFactory } from './GraphQlQueryAstFactory'\nimport { ImplementationException } from '../exception'\nimport { DatabaseMetadata, retryTransaction } from '@contember/database'\nimport { Operation, readOperationMeta } from '../schema'\nimport { assertNever } from '../utils'\nimport { InputPreValidator } from '../input-validation'\nimport { ObjectNode } from '../inputProcessing'\nimport { executeReadOperations } from './ReadHelpers'\nimport { logger } from '@contember/logger'\n\ntype WithoutNode<T extends { node: any }> = Pick<T, Exclude<keyof T, 'node'>>\n\ntype TransactionOptions = {\n\tdeferForeignKeyConstraints?: boolean\n\tdeferUniqueConstraints?: boolean\n}\n\nexport class MutationResolver {\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly mapperFactory: MapperFactory,\n\t\tprivate readonly inputValidator: InputPreValidator,\n\t\tprivate readonly graphqlQueryAstFactory: GraphQlQueryAstFactory,\n\t\tprivate readonly schemaDatabaseMetadata: DatabaseMetadata,\n\t) {}\n\n\tpublic async resolveTransaction(info: GraphQLResolveInfo, options: TransactionOptions): Promise<Result.TransactionResult> {\n\t\tconst queryAst = this.graphqlQueryAstFactory.create(info, (node, path) => {\n\t\t\treturn (\n\t\t\t\t(path.length === 1 && !['ok', 'validation', 'errorMessage', 'errors'].includes(node.name.value)) ||\n\t\t\t\t(path.length === 2 && node.name.value === 'node') ||\n\t\t\t\tpath.length > 2 ||\n\t\t\t\tpath.length === 0 ||\n\t\t\t\t(path.length > 1 && path[1] === 'query')\n\t\t\t)\n\t\t})\n\t\tconst fields = GraphQlQueryAstFactory.resolveObjectType(info.returnType).getFields()\n\n\t\tconst prefixErrors = <T extends { path: Result.PathFragment[]; paths?: Result.PathFragment[][] }>(\n\t\t\terrors: T[],\n\t\t\tfield: string,\n\t\t): T[] =>\n\t\t\terrors.map(it => ({\n\t\t\t\t...it,\n\t\t\t\tpath: [{ __typename: '_FieldPathFragment', field }, ...it.path],\n\t\t\t\tpaths: it.paths\n\t\t\t\t\t? (it.paths.length === 0 ? [[]] : it.paths)?.map(it => [{ __typename: '_FieldPathFragment', field }, ...it])\n\t\t\t\t\t: undefined,\n\t\t\t}))\n\n\t\treturn this.transaction(async mapper => {\n\t\t\tif (options?.deferForeignKeyConstraints) {\n\t\t\t\tlogger.debug('MutationResolver: deferring foreign constraints')\n\t\t\t\tawait mapper.constraintHelper.setConstraintsDeferred('foreignKey')\n\t\t\t}\n\t\t\tif (options?.deferUniqueConstraints) {\n\t\t\t\tlogger.debug('MutationResolver: deferring unique constraints')\n\t\t\t\tawait mapper.constraintHelper.setConstraintsDeferred('unique')\n\t\t\t}\n\t\t\tconst validationResult: Record<string, Result.MutationFieldResult> = {}\n\t\t\tconst validationErrors: Result.ValidationError[] = []\n\t\t\tfor (const field of queryAst.fields) {\n\t\t\t\tif (field.name === 'query' || field.name === '__typename') {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (!(field instanceof ObjectNode)) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\t\t\t\tconst fieldConfig = fields[field.name]\n\t\t\t\tif (!fieldConfig) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\t\t\t\tconst meta = readOperationMeta(fieldConfig.extensions)\n\n\t\t\t\tconst result: Result.ValidationResult | null = await (() => {\n\t\t\t\t\tswitch (meta.operation) {\n\t\t\t\t\t\tcase Operation.create:\n\t\t\t\t\t\t\treturn this.validateCreate(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.update:\n\t\t\t\t\t\t\treturn this.validateUpdate(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.upsert:\n\t\t\t\t\t\t\treturn this.validateUpsert(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.delete:\n\t\t\t\t\t\t\treturn null\n\t\t\t\t\t\tcase Operation.get:\n\t\t\t\t\t\tcase Operation.paginate:\n\t\t\t\t\t\tcase Operation.list:\n\t\t\t\t\t\t\tthrow new ImplementationException(`Invalid OperationMeta: ${String(meta)}`)\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(meta.operation)\n\t\t\t\t})()\n\t\t\t\tif (result !== null) {\n\t\t\t\t\tvalidationResult[field.alias] = {\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\tvalidation: result,\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\terrorMessage: this.stringifyValidationErrors(result.errors),\n\t\t\t\t\t\tnode: null,\n\t\t\t\t\t}\n\t\t\t\t\tvalidationErrors.push(...prefixErrors(result.errors, field.alias))\n\t\t\t\t} else {\n\t\t\t\t\tvalidationResult[field.alias] = { ok: false, errors: [], validation: { valid: true, errors: [] }, node: null }\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (validationErrors.length) {\n\t\t\t\treturn {\n\t\t\t\t\t__typename: 'MutationTransaction',\n\t\t\t\t\tok: false,\n\t\t\t\t\terrorMessage: this.stringifyValidationErrors(validationErrors),\n\t\t\t\t\terrors: [],\n\t\t\t\t\tvalidation: {\n\t\t\t\t\t\tvalid: false,\n\t\t\t\t\t\terrors: validationErrors,\n\t\t\t\t\t},\n\t\t\t\t\t...validationResult,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst trxResult: Record<string, any> = {}\n\t\t\tfor (const field of queryAst.fields) {\n\t\t\t\tif (field.name === '__typename') {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (!(field instanceof ObjectNode)) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\t\t\t\tconst fieldConfig = fields[field.name]\n\t\t\t\tif (!fieldConfig) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\t\t\t\tif (field.name === 'query') {\n\t\t\t\t\ttrxResult[field.alias] = await executeReadOperations(\n\t\t\t\t\t\tfield,\n\t\t\t\t\t\tGraphQlQueryAstFactory.resolveObjectType(fieldConfig.type).getFields(),\n\t\t\t\t\t\tmapper,\n\t\t\t\t\t)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tconst meta = readOperationMeta(fieldConfig.extensions)\n\t\t\t\tlogger.debug('MutationResolver: Resolving a field', { field: field.alias })\n\t\t\t\tconst result: {\n\t\t\t\t\tok: boolean\n\t\t\t\t\tvalidation?: Result.ValidationResult\n\t\t\t\t\terrors: Result.ExecutionError[]\n\t\t\t\t} = await (() => {\n\t\t\t\t\tswitch (meta.operation) {\n\t\t\t\t\t\tcase Operation.create:\n\t\t\t\t\t\t\treturn this.resolveCreateInternal(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.update:\n\t\t\t\t\t\t\treturn this.resolveUpdateInternal(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.delete:\n\t\t\t\t\t\t\treturn this.resolveDeleteInternal(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.upsert:\n\t\t\t\t\t\t\treturn this.resolveUpsertInternal(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.get:\n\t\t\t\t\t\tcase Operation.paginate:\n\t\t\t\t\t\tcase Operation.list:\n\t\t\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(meta.operation)\n\t\t\t\t})()\n\n\t\t\t\tif (!result.ok) {\n\t\t\t\t\tlogger.debug('MutationResolver: Field evaluation failed', { result, field: field.alias })\n\t\t\t\t\tconst validationErrors = result.validation ? prefixErrors(result.validation.errors, field.alias) : []\n\t\t\t\t\tconst executionErrors = prefixErrors(result.errors, field.alias)\n\t\t\t\t\treturn {\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\terrors: executionErrors,\n\t\t\t\t\t\tvalidation: result.validation\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tvalid: result.validation.valid,\n\t\t\t\t\t\t\t\terrors: validationErrors,\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: { valid: true, errors: [] },\n\t\t\t\t\t\terrorMessage: [\n\t\t\t\t\t\t\tthis.stringifyValidationErrors(validationErrors),\n\t\t\t\t\t\t\tthis.stringifyExecutionErrors(executionErrors),\n\t\t\t\t\t\t]\n\t\t\t\t\t\t\t.filter(it => it !== undefined)\n\t\t\t\t\t\t\t.join('\\n'),\n\t\t\t\t\t\t...validationResult,\n\t\t\t\t\t\t[field.alias]: result,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttrxResult[field.alias] = result\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t__typename: 'MutationTransaction',\n\t\t\t\tok: true,\n\t\t\t\terrors: [],\n\t\t\t\tvalidation: { valid: true, errors: [] },\n\t\t\t\t...trxResult,\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic async resolveUpdate(\n\t\tentity: Model.Entity,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<WithoutNode<Result.UpdateResult>> {\n\t\tconst queryAst = this.createQueryAst(info)\n\t\treturn this.transaction(async mapper => {\n\t\t\tconst validation = await this.validateUpdate(mapper, entity, queryAst)\n\t\t\tif (validation !== null) {\n\t\t\t\treturn { ok: false, validation, errors: [], errorMessage: this.stringifyValidationErrors(validation.errors) }\n\t\t\t}\n\t\t\treturn await this.resolveUpdateInternal(mapper, entity, queryAst)\n\t\t})\n\t}\n\n\tprivate async validateUpdate(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.UpdateInput>,\n\t): Promise<Result.ValidationResult | null> {\n\t\tconst input = queryAst.args\n\t\tconst validationResult = await this.inputValidator.validateUpdate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\twhere: input.by,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t})\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate async resolveUpdateInternal(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.UpdateInput>,\n\t): Promise<WithoutNode<Result.UpdateResult>> {\n\t\tconst input = queryAst.args\n\t\tconst result = await mapper.update(entity, input.by, input.data, input.filter)\n\t\tconst errorResponse = this.createErrorResponse(result)\n\t\tif (errorResponse) {\n\t\t\treturn errorResponse\n\t\t}\n\n\t\tconst nodes = await this.resolveResultNodes(mapper, entity, input.by, queryAst)\n\t\treturn {\n\t\t\tok: true,\n\t\t\tvalidation: {\n\t\t\t\tvalid: true,\n\t\t\t\terrors: [],\n\t\t\t},\n\t\t\terrors: [],\n\t\t\t...nodes,\n\t\t}\n\t}\n\n\tpublic async resolveCreate(\n\t\tentity: Model.Entity,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<WithoutNode<Result.CreateResult>> {\n\t\tconst queryAst = this.createQueryAst(info)\n\t\treturn this.transaction(async mapper => {\n\t\t\tconst validation = await this.validateCreate(mapper, entity, queryAst)\n\t\t\tif (validation !== null) {\n\t\t\t\treturn { ok: false, validation, errors: [], errorMessage: this.stringifyValidationErrors(validation.errors) }\n\t\t\t}\n\t\t\treturn await this.resolveCreateInternal(mapper, entity, queryAst)\n\t\t})\n\t}\n\n\tprivate async validateCreate(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.CreateInput>,\n\t): Promise<Result.ValidationResult | null> {\n\t\tconst input = queryAst.args\n\t\tconst validationResult = await this.inputValidator.validateCreate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t\toverRelation: null,\n\t\t})\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate async resolveCreateInternal(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.CreateInput>,\n\t): Promise<WithoutNode<Result.CreateResult>> {\n\t\tconst input = queryAst.args\n\t\tconst result = await mapper.insert(entity, input.data)\n\t\tconst errorResponse = this.createErrorResponse(result)\n\t\tif (errorResponse) {\n\t\t\treturn errorResponse\n\t\t}\n\t\tconst primary = getInsertPrimary(result)\n\t\tif (!primary) {\n\t\t\tthrow new ImplementationException('MutationResolver::resolveCreateInternal does not handle result properly')\n\t\t}\n\n\t\tconst nodes = await this.resolveResultNodes(mapper, entity, { [entity.primary]: primary }, queryAst)\n\t\treturn {\n\t\t\tok: true,\n\t\t\tvalidation: {\n\t\t\t\tvalid: true,\n\t\t\t\terrors: [],\n\t\t\t},\n\t\t\terrors: [],\n\t\t\t...nodes,\n\t\t}\n\t}\n\n\tpublic async resolveUpsert(\n\t\tentity: Model.Entity,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<WithoutNode<Result.UpsertResult>> {\n\t\tconst queryAst = this.createQueryAst(info)\n\t\treturn this.transaction(async mapper => {\n\t\t\tconst validation = await this.validateUpsert(mapper, entity, queryAst)\n\t\t\tif (validation !== null) {\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\tvalidation,\n\t\t\t\t\terrors: [],\n\t\t\t\t\terrorMessage: this.stringifyValidationErrors(validation.errors),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn await this.resolveUpsertInternal(mapper, entity, queryAst)\n\t\t})\n\t}\n\n\tprivate async validateUpsert(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.UpsertInput>,\n\t): Promise<Result.ValidationResult | null> {\n\t\tconst input = queryAst.args\n\t\tconst validationResult = [\n\t\t\t...(await this.inputValidator.validateCreate({\n\t\t\t\tmapper,\n\t\t\t\tentity,\n\t\t\t\tdata: input.create,\n\t\t\t\tpath: [],\n\t\t\t\toverRelation: null,\n\t\t\t})),\n\t\t\t...(await this.inputValidator.validateUpdate({\n\t\t\t\tmapper,\n\t\t\t\tentity,\n\t\t\t\tdata: input.update,\n\t\t\t\twhere: input.by,\n\t\t\t\tpath: [],\n\t\t\t})),\n\t\t]\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate async resolveUpsertInternal(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.UpsertInput>,\n\t): Promise<WithoutNode<Result.UpsertResult>> {\n\t\tconst input = queryAst.args\n\t\tconst result = await mapper.upsert(entity, input.by, input.update, input.create, input.filter)\n\t\tconst errorResponse = this.createErrorResponse(result)\n\t\tif (errorResponse) {\n\t\t\treturn errorResponse\n\t\t}\n\t\tconst primary = getInsertPrimary(result)\n\t\tconst byResolved = primary ? { [entity.primary]: primary } : input.by\n\t\tif (!byResolved) {\n\t\t\tthrow new ImplementationException('MutationResolver::resolveUpsertInternal does not handle result properly')\n\t\t}\n\n\t\tconst nodes = await this.resolveResultNodes(mapper, entity, byResolved, queryAst)\n\t\treturn {\n\t\t\tok: true,\n\t\t\tvalidation: {\n\t\t\t\tvalid: true,\n\t\t\t\terrors: [],\n\t\t\t},\n\t\t\terrors: [],\n\t\t\t...nodes,\n\t\t}\n\t}\n\n\tpublic async resolveDelete(\n\t\tentity: Model.Entity,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<WithoutNode<Result.DeleteResult>> {\n\t\tconst queryAst = this.createQueryAst(info)\n\t\treturn this.transaction(async mapper => {\n\t\t\treturn await this.resolveDeleteInternal(mapper, entity, queryAst)\n\t\t})\n\t}\n\n\tprivate async resolveDeleteInternal(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.DeleteInput>,\n\t): Promise<WithoutNode<Result.DeleteResult>> {\n\t\tconst input = queryAst.args\n\n\t\tconst nodes = await this.resolveResultNodes(mapper, entity, input.by, queryAst)\n\n\t\tconst result = await mapper.delete(entity, queryAst.args.by, queryAst.args.filter)\n\t\tif (\n\t\t\tresult.length >= 1 &&\n\t\t\t(result[0].result === MutationResultType.ok || result[0].result === MutationResultType.nothingToDo)\n\t\t) {\n\t\t\treturn { ok: true, errors: [], ...nodes }\n\t\t} else {\n\t\t\tconst errors = this.convertResultToErrors(result)\n\t\t\treturn { ok: false, errors, errorMessage: this.stringifyExecutionErrors(errors) }\n\t\t}\n\t}\n\n\tprivate createQueryAst(info: GraphQLResolveInfo) {\n\t\tconst queryAst = this.graphqlQueryAstFactory.create(info, (node, path) => {\n\t\t\treturn path.length !== 1 || node.name.value === 'node'\n\t\t})\n\t\treturn queryAst\n\t}\n\n\tprivate async resolveResultNodes(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\twhere: Input.UniqueWhere,\n\t\tqueryAst: ObjectNode,\n\t): Promise<Record<string, Value.Object>> {\n\t\tconst nodeQuery = queryAst.findFieldByName('node')\n\t\tlet nodes: Record<string, any> = {}\n\t\tfor (const singleNodeQuery of nodeQuery) {\n\t\t\tif (!(singleNodeQuery instanceof ObjectNode)) {\n\t\t\t\tthrow new Error('MutationResolver: expected ObjectNode')\n\t\t\t}\n\t\t\tconst objectWithArgs = singleNodeQuery.withArgs({ by: where })\n\t\t\tnodes[singleNodeQuery.alias] = await mapper.selectUnique(entity, objectWithArgs, [])\n\t\t}\n\t\treturn nodes\n\t}\n\n\tprivate async transaction<R extends { ok: boolean }>(\n\t\tcb: (mapper: Mapper) => Promise<R>,\n\t): Promise<R> {\n\t\treturn await retryTransaction(\n\t\t\tasync () => {\n\t\t\t\treturn await this.mapperFactory.transaction(async mapper => {\n\t\t\t\t\tlogger.debug('MutationResolver: Starting mutation transaction')\n\t\t\t\t\tconst result = await cb(mapper)\n\t\t\t\t\tif (!result.ok) {\n\t\t\t\t\t\tlogger.debug('MutationResolver: Transaction failed, rolling back', { result })\n\t\t\t\t\t\tawait mapper.db.connection.rollback()\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait mapper.eventManager.fire(new BeforeCommitEvent())\n\t\t\t\t\t\t\tlogger.debug('MutationResolver: Transaction ok, committing')\n\t\t\t\t\t\t\tawait mapper.db.connection.commit()\n\t\t\t\t\t\t\tawait mapper.eventManager.fire(new AfterCommitEvent())\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait mapper.db.connection.rollback()\n\t\t\t\t\t\t\t} catch {}\n\t\t\t\t\t\t\tconst err = convertError(this.schema, this.schemaDatabaseMetadata, e)\n\t\t\t\t\t\t\tconst errorResponse = this.createErrorResponse([err])\n\t\t\t\t\t\t\tif (!errorResponse) {\n\t\t\t\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn { ...result, ...errorResponse }\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\treturn result\n\t\t\t\t})\n\t\t\t},\n\t\t\tmessage => logger.warn(message),\n\t\t\t{\n\t\t\t\tmaxAttempts: 15,\n\t\t\t\tminTimeout: 10,\n\t\t\t\tmaxTimeout: 1000,\n\t\t\t},\n\t\t)\n\n\t}\n\n\tprivate createErrorResponse(result: MutationResultList) {\n\t\tconst errors = this.convertResultToErrors(result)\n\t\tif (errors.length > 0) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\tvalidation: { valid: true, errors: [] },\n\t\t\t\terrors,\n\t\t\t\terrorMessage: this.stringifyExecutionErrors(errors),\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate convertResultToErrors(result: MutationResultList): Result.ExecutionError[] {\n\t\tconst errors = result.filter(\n\t\t\tit =>\n\t\t\t\t![MutationResultType.ok, MutationResultType.nothingToDo, MutationResultType.validationError].includes(\n\t\t\t\t\tit.result,\n\t\t\t\t),\n\t\t)\n\n\t\tlet hasSqlError = false\n\t\tconst filteredErrors: MutationResultList = []\n\t\tfor (const error of errors) {\n\t\t\tif (error.hints.includes(MutationResultHint.subSequentSqlError) && hasSqlError) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (error.hints.includes(MutationResultHint.sqlError)) {\n\t\t\t\thasSqlError = true\n\t\t\t}\n\t\t\tfilteredErrors.push(error)\n\t\t}\n\n\t\treturn filteredErrors.map(it => {\n\t\t\tconst paths = it.paths.map(path =>\n\t\t\t\tpath.map(it => ({\n\t\t\t\t\t...it,\n\t\t\t\t\t__typename: 'field' in it ? '_FieldPathFragment' : '_IndexPathFragment',\n\t\t\t\t})),\n\t\t\t)\n\t\t\tconst path = paths[0] || []\n\t\t\tswitch (it.result) {\n\t\t\t\tcase MutationResultType.constraintViolationError:\n\t\t\t\t\tswitch (it.constraint) {\n\t\t\t\t\t\tcase ConstraintType.notNull:\n\t\t\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.NotNullConstraintViolation, message: it.message }\n\t\t\t\t\t\tcase ConstraintType.foreignKey:\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\tpaths,\n\t\t\t\t\t\t\t\ttype: Result.ExecutionErrorType.ForeignKeyConstraintViolation,\n\t\t\t\t\t\t\t\tmessage: it.message,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tcase ConstraintType.uniqueKey:\n\t\t\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.UniqueConstraintViolation, message: it.message }\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(it.constraint)\n\t\t\t\t\t}\n\t\t\t\tcase MutationResultType.noResultError:\n\t\t\t\tcase MutationResultType.notFoundError:\n\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.NotFoundOrDenied, message: it.message }\n\t\t\t\tcase MutationResultType.inputError:\n\t\t\t\t\tswitch (it.kind) {\n\t\t\t\t\t\tcase InputErrorKind.nonUniqueWhere:\n\t\t\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.NonUniqueWhereInput, message: it.message }\n\t\t\t\t\t\tcase InputErrorKind.invalidData:\n\t\t\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.InvalidDataInput, message: it.message }\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(it.kind)\n\t\t\t\t\t}\n\n\t\t\t\tcase MutationResultType.sqlError:\n\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.SqlError, message: it.message }\n\t\t\t\tcase MutationResultType.ok:\n\t\t\t\tcase MutationResultType.nothingToDo:\n\t\t\t\t\tthrow new ImplementationException('MutationResolver: unexpected MutationResultType')\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(it)\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate stringifyValidationErrors(validationErrors: Result.ValidationError[]): string | undefined {\n\t\tif (validationErrors.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn (\n\t\t\t'Validation has failed:\\n' +\n\t\t\tvalidationErrors.map(it => `${this.stringifyPath(it.path)}: ${it.message.text}`).join('\\n')\n\t\t)\n\t}\n\n\tprivate stringifyExecutionErrors(executionErrors: Result.ExecutionError[]): string | undefined {\n\t\tif (executionErrors.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn (\n\t\t\t'Execution has failed:\\n' +\n\t\t\texecutionErrors.map(it => `${this.stringifyPath(it.paths[0] || [])}: ${it.type} (${it.message || ''})`)\n\t\t)\n\t}\n\n\tprivate stringifyPath(path: Result.PathFragment[]): string {\n\t\tif (path.length === 0) {\n\t\t\treturn 'unknown field'\n\t\t}\n\t\treturn path\n\t\t\t.map(it => {\n\t\t\t\tif ('field' in it) {\n\t\t\t\t\treturn it.field\n\t\t\t\t}\n\t\t\t\tif ('alias' in it && it.alias) {\n\t\t\t\t\treturn `${it.index}(${it.alias})`\n\t\t\t\t}\n\t\t\t\treturn it.index\n\t\t\t})\n\t\t\t.join('.')\n\t}\n}\n"],"names":["it","validationErrors","path"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkCO,MAAM,iB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,MAAM,GAAG,OAAO;AAC9B,eAAO,GAAG,GAAG,KAAK,IAAI,GAAG,KAAK;AAAA,MAC/B;AACA,aAAO,GAAG;AAAA,IAAA,CACV,EACA,KAAK,GAAG;AAAA,EACX;AACD;"}
1
+ {"version":3,"file":"MutationResolver.js","sources":["../../../../../packages/engine-content-api/src/resolvers/MutationResolver.ts"],"sourcesContent":["import { Input, Model, Result, Value } from '@contember/schema'\nimport {\n\tAfterCommitEvent,\n\tBeforeCommitEvent,\n\tConstraintType,\n\tconvertError,\n\tgetInsertPrimary,\n\tInputErrorKind,\n\tMapper,\n\tMapperFactory,\n\tMutationResultHint,\n\tMutationResultList,\n\tMutationResultType,\n\ttryMutation,\n} from '../mapper'\nimport { ValidationResolver } from './ValidationResolver'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { GraphQlQueryAstFactory } from './GraphQlQueryAstFactory'\nimport { ImplementationException } from '../exception'\nimport { DatabaseMetadata, retryTransaction } from '@contember/database'\nimport { Operation, readOperationMeta } from '../schema'\nimport { assertNever } from '../utils'\nimport { InputPreValidator } from '../input-validation'\nimport { ObjectNode } from '../inputProcessing'\nimport { executeReadOperations } from './ReadHelpers'\nimport { logger } from '@contember/logger'\n\ntype WithoutNode<T extends { node: any }> = Pick<T, Exclude<keyof T, 'node'>>\n\ntype TransactionOptions = {\n\tdeferForeignKeyConstraints?: boolean\n\tdeferUniqueConstraints?: boolean\n}\n\nexport class MutationResolver {\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly mapperFactory: MapperFactory,\n\t\tprivate readonly inputValidator: InputPreValidator,\n\t\tprivate readonly graphqlQueryAstFactory: GraphQlQueryAstFactory,\n\t\tprivate readonly schemaDatabaseMetadata: DatabaseMetadata,\n\t) {}\n\n\tpublic async resolveTransaction(info: GraphQLResolveInfo, options: TransactionOptions): Promise<Result.TransactionResult> {\n\t\tconst queryAst = this.graphqlQueryAstFactory.create(info, (node, path) => {\n\t\t\treturn (\n\t\t\t\t(path.length === 1 && !['ok', 'validation', 'errorMessage', 'errors'].includes(node.name.value)) ||\n\t\t\t\t(path.length === 2 && node.name.value === 'node') ||\n\t\t\t\tpath.length > 2 ||\n\t\t\t\tpath.length === 0 ||\n\t\t\t\t(path.length > 1 && path[1] === 'query')\n\t\t\t)\n\t\t})\n\t\tconst fields = GraphQlQueryAstFactory.resolveObjectType(info.returnType).getFields()\n\n\t\tconst prefixErrors = <T extends { path: Result.PathFragment[]; paths?: Result.PathFragment[][] }>(\n\t\t\terrors: T[],\n\t\t\tfield: string,\n\t\t): T[] =>\n\t\t\terrors.map(it => ({\n\t\t\t\t...it,\n\t\t\t\tpath: [{ __typename: '_FieldPathFragment', field }, ...it.path],\n\t\t\t\tpaths: it.paths\n\t\t\t\t\t? (it.paths.length === 0 ? [[]] : it.paths)?.map(it => [{ __typename: '_FieldPathFragment', field }, ...it])\n\t\t\t\t\t: undefined,\n\t\t\t}))\n\n\t\treturn this.transaction(async mapper => {\n\t\t\tif (options?.deferForeignKeyConstraints) {\n\t\t\t\tlogger.debug('MutationResolver: deferring foreign constraints')\n\t\t\t\tawait mapper.constraintHelper.setConstraintsDeferred('foreignKey')\n\t\t\t}\n\t\t\tif (options?.deferUniqueConstraints) {\n\t\t\t\tlogger.debug('MutationResolver: deferring unique constraints')\n\t\t\t\tawait mapper.constraintHelper.setConstraintsDeferred('unique')\n\t\t\t}\n\t\t\tconst validationResult: Record<string, Result.MutationFieldResult> = {}\n\t\t\tconst validationErrors: Result.ValidationError[] = []\n\t\t\tfor (const field of queryAst.fields) {\n\t\t\t\tif (field.name === 'query' || field.name === '__typename') {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (!(field instanceof ObjectNode)) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\t\t\t\tconst fieldConfig = fields[field.name]\n\t\t\t\tif (!fieldConfig) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\t\t\t\tconst meta = readOperationMeta(fieldConfig.extensions)\n\n\t\t\t\tconst result: Result.ValidationResult | null = await (() => {\n\t\t\t\t\tswitch (meta.operation) {\n\t\t\t\t\t\tcase Operation.create:\n\t\t\t\t\t\t\treturn this.validateCreate(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.update:\n\t\t\t\t\t\t\treturn this.validateUpdate(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.upsert:\n\t\t\t\t\t\t\treturn this.validateUpsert(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.delete:\n\t\t\t\t\t\t\treturn null\n\t\t\t\t\t\tcase Operation.get:\n\t\t\t\t\t\tcase Operation.paginate:\n\t\t\t\t\t\tcase Operation.list:\n\t\t\t\t\t\t\tthrow new ImplementationException(`Invalid OperationMeta: ${String(meta)}`)\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(meta.operation)\n\t\t\t\t})()\n\t\t\t\tif (result !== null) {\n\t\t\t\t\tvalidationResult[field.alias] = {\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\tvalidation: result,\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\terrorMessage: this.stringifyValidationErrors(result.errors),\n\t\t\t\t\t\tnode: null,\n\t\t\t\t\t}\n\t\t\t\t\tvalidationErrors.push(...prefixErrors(result.errors, field.alias))\n\t\t\t\t} else {\n\t\t\t\t\tvalidationResult[field.alias] = { ok: false, errors: [], validation: { valid: true, errors: [] }, node: null }\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (validationErrors.length) {\n\t\t\t\treturn {\n\t\t\t\t\t__typename: 'MutationTransaction',\n\t\t\t\t\tok: false,\n\t\t\t\t\terrorMessage: this.stringifyValidationErrors(validationErrors),\n\t\t\t\t\terrors: [],\n\t\t\t\t\tvalidation: {\n\t\t\t\t\t\tvalid: false,\n\t\t\t\t\t\terrors: validationErrors,\n\t\t\t\t\t},\n\t\t\t\t\t...validationResult,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst trxResult: Record<string, any> = {}\n\t\t\tfor (const field of queryAst.fields) {\n\t\t\t\tif (field.name === '__typename') {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (!(field instanceof ObjectNode)) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\t\t\t\tconst fieldConfig = fields[field.name]\n\t\t\t\tif (!fieldConfig) {\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t}\n\t\t\t\tif (field.name === 'query') {\n\t\t\t\t\ttrxResult[field.alias] = await executeReadOperations(\n\t\t\t\t\t\tfield,\n\t\t\t\t\t\tGraphQlQueryAstFactory.resolveObjectType(fieldConfig.type).getFields(),\n\t\t\t\t\t\tmapper,\n\t\t\t\t\t)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tconst meta = readOperationMeta(fieldConfig.extensions)\n\t\t\t\tlogger.debug('MutationResolver: Resolving a field', { field: field.alias })\n\t\t\t\tconst result: {\n\t\t\t\t\tok: boolean\n\t\t\t\t\tvalidation?: Result.ValidationResult\n\t\t\t\t\terrors: Result.ExecutionError[]\n\t\t\t\t} = await (() => {\n\t\t\t\t\tswitch (meta.operation) {\n\t\t\t\t\t\tcase Operation.create:\n\t\t\t\t\t\t\treturn this.resolveCreateInternal(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.update:\n\t\t\t\t\t\t\treturn this.resolveUpdateInternal(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.delete:\n\t\t\t\t\t\t\treturn this.resolveDeleteInternal(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.upsert:\n\t\t\t\t\t\t\treturn this.resolveUpsertInternal(mapper, meta.entity, field)\n\t\t\t\t\t\tcase Operation.get:\n\t\t\t\t\t\tcase Operation.paginate:\n\t\t\t\t\t\tcase Operation.list:\n\t\t\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(meta.operation)\n\t\t\t\t})()\n\n\t\t\t\tif (!result.ok) {\n\t\t\t\t\tlogger.debug('MutationResolver: Field evaluation failed', { result, field: field.alias })\n\t\t\t\t\tconst validationErrors = result.validation ? prefixErrors(result.validation.errors, field.alias) : []\n\t\t\t\t\tconst executionErrors = prefixErrors(result.errors, field.alias)\n\t\t\t\t\treturn {\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\terrors: executionErrors,\n\t\t\t\t\t\tvalidation: result.validation\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tvalid: result.validation.valid,\n\t\t\t\t\t\t\t\terrors: validationErrors,\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: { valid: true, errors: [] },\n\t\t\t\t\t\terrorMessage: [\n\t\t\t\t\t\t\tthis.stringifyValidationErrors(validationErrors),\n\t\t\t\t\t\t\tthis.stringifyExecutionErrors(executionErrors),\n\t\t\t\t\t\t]\n\t\t\t\t\t\t\t.filter(it => it !== undefined)\n\t\t\t\t\t\t\t.join('\\n'),\n\t\t\t\t\t\t...validationResult,\n\t\t\t\t\t\t[field.alias]: result,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttrxResult[field.alias] = result\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t__typename: 'MutationTransaction',\n\t\t\t\tok: true,\n\t\t\t\terrors: [],\n\t\t\t\tvalidation: { valid: true, errors: [] },\n\t\t\t\t...trxResult,\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic async resolveUpdate(\n\t\tentity: Model.Entity,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<WithoutNode<Result.UpdateResult>> {\n\t\tconst queryAst = this.createQueryAst(info)\n\t\treturn this.transaction(async mapper => {\n\t\t\tconst validation = await this.validateUpdate(mapper, entity, queryAst)\n\t\t\tif (validation !== null) {\n\t\t\t\treturn { ok: false, validation, errors: [], errorMessage: this.stringifyValidationErrors(validation.errors) }\n\t\t\t}\n\t\t\treturn await this.resolveUpdateInternal(mapper, entity, queryAst)\n\t\t})\n\t}\n\n\tprivate async validateUpdate(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.UpdateInput>,\n\t): Promise<Result.ValidationResult | null> {\n\t\tconst input = queryAst.args\n\t\tconst validationResult = await this.inputValidator.validateUpdate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\twhere: input.by,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t})\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate async resolveUpdateInternal(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.UpdateInput>,\n\t): Promise<WithoutNode<Result.UpdateResult>> {\n\t\tconst input = queryAst.args\n\t\tconst result = await mapper.update(entity, input.by, input.data, input.filter)\n\t\tconst errorResponse = this.createErrorResponse(result)\n\t\tif (errorResponse) {\n\t\t\treturn errorResponse\n\t\t}\n\n\t\tconst nodes = await this.resolveResultNodes(mapper, entity, input.by, queryAst)\n\t\treturn {\n\t\t\tok: true,\n\t\t\tvalidation: {\n\t\t\t\tvalid: true,\n\t\t\t\terrors: [],\n\t\t\t},\n\t\t\terrors: [],\n\t\t\t...nodes,\n\t\t}\n\t}\n\n\tpublic async resolveCreate(\n\t\tentity: Model.Entity,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<WithoutNode<Result.CreateResult>> {\n\t\tconst queryAst = this.createQueryAst(info)\n\t\treturn this.transaction(async mapper => {\n\t\t\tconst validation = await this.validateCreate(mapper, entity, queryAst)\n\t\t\tif (validation !== null) {\n\t\t\t\treturn { ok: false, validation, errors: [], errorMessage: this.stringifyValidationErrors(validation.errors) }\n\t\t\t}\n\t\t\treturn await this.resolveCreateInternal(mapper, entity, queryAst)\n\t\t})\n\t}\n\n\tprivate async validateCreate(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.CreateInput>,\n\t): Promise<Result.ValidationResult | null> {\n\t\tconst input = queryAst.args\n\t\tconst validationResult = await this.inputValidator.validateCreate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t\toverRelation: null,\n\t\t})\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate async resolveCreateInternal(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.CreateInput>,\n\t): Promise<WithoutNode<Result.CreateResult>> {\n\t\tconst input = queryAst.args\n\t\tconst result = await mapper.insert(entity, input.data)\n\t\tconst errorResponse = this.createErrorResponse(result)\n\t\tif (errorResponse) {\n\t\t\treturn errorResponse\n\t\t}\n\t\tconst primary = getInsertPrimary(result)\n\t\tif (!primary) {\n\t\t\tthrow new ImplementationException('MutationResolver::resolveCreateInternal does not handle result properly')\n\t\t}\n\n\t\tconst nodes = await this.resolveResultNodes(mapper, entity, { [entity.primary]: primary }, queryAst)\n\t\treturn {\n\t\t\tok: true,\n\t\t\tvalidation: {\n\t\t\t\tvalid: true,\n\t\t\t\terrors: [],\n\t\t\t},\n\t\t\terrors: [],\n\t\t\t...nodes,\n\t\t}\n\t}\n\n\tpublic async resolveUpsert(\n\t\tentity: Model.Entity,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<WithoutNode<Result.UpsertResult>> {\n\t\tconst queryAst = this.createQueryAst(info)\n\t\treturn this.transaction(async mapper => {\n\t\t\tconst validation = await this.validateUpsert(mapper, entity, queryAst)\n\t\t\tif (validation !== null) {\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\tvalidation,\n\t\t\t\t\terrors: [],\n\t\t\t\t\terrorMessage: this.stringifyValidationErrors(validation.errors),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn await this.resolveUpsertInternal(mapper, entity, queryAst)\n\t\t})\n\t}\n\n\tprivate async validateUpsert(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.UpsertInput>,\n\t): Promise<Result.ValidationResult | null> {\n\t\tconst input = queryAst.args\n\t\tconst validationResult = [\n\t\t\t...(await this.inputValidator.validateCreate({\n\t\t\t\tmapper,\n\t\t\t\tentity,\n\t\t\t\tdata: input.create,\n\t\t\t\tpath: [],\n\t\t\t\toverRelation: null,\n\t\t\t})),\n\t\t\t...(await this.inputValidator.validateUpdate({\n\t\t\t\tmapper,\n\t\t\t\tentity,\n\t\t\t\tdata: input.update,\n\t\t\t\twhere: input.by,\n\t\t\t\tpath: [],\n\t\t\t})),\n\t\t]\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate async resolveUpsertInternal(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.UpsertInput>,\n\t): Promise<WithoutNode<Result.UpsertResult>> {\n\t\tconst input = queryAst.args\n\t\tconst result = await mapper.upsert(entity, input.by, input.update, input.create, input.filter)\n\t\tconst errorResponse = this.createErrorResponse(result)\n\t\tif (errorResponse) {\n\t\t\treturn errorResponse\n\t\t}\n\t\tconst primary = getInsertPrimary(result)\n\t\tconst byResolved = primary ? { [entity.primary]: primary } : input.by\n\t\tif (!byResolved) {\n\t\t\tthrow new ImplementationException('MutationResolver::resolveUpsertInternal does not handle result properly')\n\t\t}\n\n\t\tconst nodes = await this.resolveResultNodes(mapper, entity, byResolved, queryAst)\n\t\treturn {\n\t\t\tok: true,\n\t\t\tvalidation: {\n\t\t\t\tvalid: true,\n\t\t\t\terrors: [],\n\t\t\t},\n\t\t\terrors: [],\n\t\t\t...nodes,\n\t\t}\n\t}\n\n\tpublic async resolveDelete(\n\t\tentity: Model.Entity,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<WithoutNode<Result.DeleteResult>> {\n\t\tconst queryAst = this.createQueryAst(info)\n\t\treturn this.transaction(async mapper => {\n\t\t\treturn await this.resolveDeleteInternal(mapper, entity, queryAst)\n\t\t})\n\t}\n\n\tprivate async resolveDeleteInternal(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\tqueryAst: ObjectNode<Input.DeleteInput>,\n\t): Promise<WithoutNode<Result.DeleteResult>> {\n\t\tconst input = queryAst.args\n\n\t\tconst nodes = await this.resolveResultNodes(mapper, entity, input.by, queryAst)\n\n\t\tconst result = await mapper.delete(entity, queryAst.args.by, queryAst.args.filter)\n\t\tif (\n\t\t\tresult.length >= 1 &&\n\t\t\t(result[0].result === MutationResultType.ok || result[0].result === MutationResultType.nothingToDo)\n\t\t) {\n\t\t\treturn { ok: true, errors: [], ...nodes }\n\t\t} else {\n\t\t\tconst errors = this.convertResultToErrors(result)\n\t\t\treturn { ok: false, errors, errorMessage: this.stringifyExecutionErrors(errors) }\n\t\t}\n\t}\n\n\tprivate createQueryAst(info: GraphQLResolveInfo) {\n\t\tconst queryAst = this.graphqlQueryAstFactory.create(info, (node, path) => {\n\t\t\treturn path.length !== 1 || node.name.value === 'node'\n\t\t})\n\t\treturn queryAst\n\t}\n\n\tprivate async resolveResultNodes(\n\t\tmapper: Mapper,\n\t\tentity: Model.Entity,\n\t\twhere: Input.UniqueWhere,\n\t\tqueryAst: ObjectNode,\n\t): Promise<Record<string, Value.Object>> {\n\t\tconst nodeQuery = queryAst.findFieldByName('node')\n\t\tlet nodes: Record<string, any> = {}\n\t\tfor (const singleNodeQuery of nodeQuery) {\n\t\t\tif (!(singleNodeQuery instanceof ObjectNode)) {\n\t\t\t\tthrow new Error('MutationResolver: expected ObjectNode')\n\t\t\t}\n\t\t\tconst objectWithArgs = singleNodeQuery.withArgs({ by: where })\n\t\t\tnodes[singleNodeQuery.alias] = await mapper.selectUnique(entity, objectWithArgs, [])\n\t\t}\n\t\treturn nodes\n\t}\n\n\tprivate async transaction<R extends { ok: boolean }>(\n\t\tcb: (mapper: Mapper) => Promise<R>,\n\t): Promise<R> {\n\t\treturn await retryTransaction(\n\t\t\tasync () => {\n\t\t\t\treturn await this.mapperFactory.transaction(async mapper => {\n\t\t\t\t\tlogger.debug('MutationResolver: Starting mutation transaction')\n\t\t\t\t\tconst result = await cb(mapper)\n\t\t\t\t\tif (!result.ok) {\n\t\t\t\t\t\tlogger.debug('MutationResolver: Transaction failed, rolling back', { result })\n\t\t\t\t\t\tawait mapper.db.connection.rollback()\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait mapper.eventManager.fire(new BeforeCommitEvent())\n\t\t\t\t\t\t\tlogger.debug('MutationResolver: Transaction ok, committing')\n\t\t\t\t\t\t\tawait mapper.db.connection.commit()\n\t\t\t\t\t\t\tawait mapper.eventManager.fire(new AfterCommitEvent())\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait mapper.db.connection.rollback()\n\t\t\t\t\t\t\t} catch {}\n\t\t\t\t\t\t\tconst err = convertError(this.schema, this.schemaDatabaseMetadata, e)\n\t\t\t\t\t\t\tconst errorResponse = this.createErrorResponse([err])\n\t\t\t\t\t\t\tif (!errorResponse) {\n\t\t\t\t\t\t\t\tthrow new ImplementationException()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn { ...result, ...errorResponse }\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\treturn result\n\t\t\t\t})\n\t\t\t},\n\t\t\tmessage => logger.warn(message),\n\t\t\t{\n\t\t\t\tmaxAttempts: 15,\n\t\t\t\tminTimeout: 10,\n\t\t\t\tmaxTimeout: 1000,\n\t\t\t},\n\t\t)\n\n\t}\n\n\tprivate createErrorResponse(result: MutationResultList) {\n\t\tconst errors = this.convertResultToErrors(result)\n\t\tif (errors.length > 0) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\tvalidation: { valid: true, errors: [] },\n\t\t\t\terrors,\n\t\t\t\terrorMessage: this.stringifyExecutionErrors(errors),\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate convertResultToErrors(result: MutationResultList): Result.ExecutionError[] {\n\t\tconst errors = result.filter(\n\t\t\tit =>\n\t\t\t\t![MutationResultType.ok, MutationResultType.nothingToDo, MutationResultType.validationError].includes(\n\t\t\t\t\tit.result,\n\t\t\t\t),\n\t\t)\n\n\t\tlet hasSqlError = false\n\t\tconst filteredErrors: MutationResultList = []\n\t\tfor (const error of errors) {\n\t\t\tif (error.hints.includes(MutationResultHint.subSequentSqlError) && hasSqlError) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (error.hints.includes(MutationResultHint.sqlError)) {\n\t\t\t\thasSqlError = true\n\t\t\t}\n\t\t\tfilteredErrors.push(error)\n\t\t}\n\n\t\treturn filteredErrors.map(it => {\n\t\t\tconst paths = it.paths.map(path =>\n\t\t\t\tpath.map(it => ({\n\t\t\t\t\t...it,\n\t\t\t\t\t__typename: 'field' in it ? '_FieldPathFragment' : '_IndexPathFragment',\n\t\t\t\t})),\n\t\t\t)\n\t\t\tconst path = paths[0] || []\n\t\t\tswitch (it.result) {\n\t\t\t\tcase MutationResultType.constraintViolationError:\n\t\t\t\t\tswitch (it.constraint) {\n\t\t\t\t\t\tcase ConstraintType.notNull:\n\t\t\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.NotNullConstraintViolation, message: it.message }\n\t\t\t\t\t\tcase ConstraintType.foreignKey:\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\tpaths,\n\t\t\t\t\t\t\t\ttype: Result.ExecutionErrorType.ForeignKeyConstraintViolation,\n\t\t\t\t\t\t\t\tmessage: it.message,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tcase ConstraintType.uniqueKey:\n\t\t\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.UniqueConstraintViolation, message: it.message }\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(it.constraint)\n\t\t\t\t\t}\n\t\t\t\tcase MutationResultType.noResultError:\n\t\t\t\tcase MutationResultType.notFoundError:\n\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.NotFoundOrDenied, message: it.message }\n\t\t\t\tcase MutationResultType.inputError:\n\t\t\t\t\tswitch (it.kind) {\n\t\t\t\t\t\tcase InputErrorKind.nonUniqueWhere:\n\t\t\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.NonUniqueWhereInput, message: it.message }\n\t\t\t\t\t\tcase InputErrorKind.invalidData:\n\t\t\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.InvalidDataInput, message: it.message }\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(it.kind)\n\t\t\t\t\t}\n\n\t\t\t\tcase MutationResultType.sqlError:\n\t\t\t\t\treturn { path, paths, type: Result.ExecutionErrorType.SqlError, message: it.message }\n\t\t\t\tcase MutationResultType.ok:\n\t\t\t\tcase MutationResultType.nothingToDo:\n\t\t\t\t\tthrow new ImplementationException('MutationResolver: unexpected MutationResultType')\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(it)\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate stringifyValidationErrors(validationErrors: Result.ValidationError[]): string | undefined {\n\t\tif (validationErrors.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn (\n\t\t\t'Validation has failed:\\n' +\n\t\t\tvalidationErrors.map(it => `${this.stringifyPath(it.path)}: ${it.message.text}`).join('\\n')\n\t\t)\n\t}\n\n\tprivate stringifyExecutionErrors(executionErrors: Result.ExecutionError[]): string | undefined {\n\t\tif (executionErrors.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn (\n\t\t\t'Execution has failed:\\n' +\n\t\t\texecutionErrors.map(it => `${this.stringifyPath(it.paths[0] || [])}: ${it.type} (${it.message || ''})`)\n\t\t)\n\t}\n\n\tprivate stringifyPath(path: Result.PathFragment[]): string {\n\t\tif (path.length === 0) {\n\t\t\treturn 'unknown field'\n\t\t}\n\t\treturn path\n\t\t\t.map(it => {\n\t\t\t\tif ('field' in it) {\n\t\t\t\t\treturn it.field\n\t\t\t\t}\n\t\t\t\tif ('alias' in it && it.alias) {\n\t\t\t\t\treturn `${it.index}(${it.alias})`\n\t\t\t\t}\n\t\t\t\treturn it.index\n\t\t\t})\n\t\t\t.join('.')\n\t}\n}\n"],"names":["it","validationErrors","path"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkCO,MAAM,iBAAiB;AAAA,EAC7B,YACkB,QACA,eACA,gBACA,wBACA,wBAChB;AALgB,SAAA,SAAA;AACA,SAAA,gBAAA;AACA,SAAA,iBAAA;AACA,SAAA,yBAAA;AACA,SAAA,yBAAA;AAAA,EAAA;AAAA,EAGlB,MAAa,mBAAmB,MAA0B,SAAgE;AACzH,UAAM,WAAW,KAAK,uBAAuB,OAAO,MAAM,CAAC,MAAM,SAAS;AACzE,aACE,KAAK,WAAW,KAAK,CAAC,CAAC,MAAM,cAAc,gBAAgB,QAAQ,EAAE,SAAS,KAAK,KAAK,KAAK,KAC7F,KAAK,WAAW,KAAK,KAAK,KAAK,UAAU,UAC1C,KAAK,SAAS,KACd,KAAK,WAAW,KACf,KAAK,SAAS,KAAK,KAAK,CAAC,MAAM;AAAA,IAAA,CAEjC;AACD,UAAM,SAAS,uBAAuB,kBAAkB,KAAK,UAAU,EAAE,UAAU;AAEnF,UAAM,eAAe,CACpB,QACA,UAEA,OAAO,IAAI,CAAO,QAAA;AAAA,MACjB,GAAG;AAAA,MACH,MAAM,CAAC,EAAE,YAAY,sBAAsB,SAAS,GAAG,GAAG,IAAI;AAAA,MAC9D,OAAO,GAAG,SACN,GAAG,MAAM,WAAW,IAAI,CAAC,CAAE,CAAA,IAAI,GAAG,QAAQ,IAAI,CAAAA,QAAM,CAAC,EAAE,YAAY,sBAAsB,SAAS,GAAGA,GAAE,CAAC,IACzG;AAAA,IAAA,EACF;AAEI,WAAA,KAAK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AAG,IAAI,CAAC,KAAK,GAAG,QAAQ,IAAI,EAAE,EAAE,KAAK,IAAI;AAAA,EAAA;AAAA,EAIpF,yBAAyB,iBAA8D;AAC1F,QAAA,gBAAgB,WAAW,GAAG;AAC1B,aAAA;AAAA,IAAA;AAGP,WAAA,4BACA,gBAAgB,IAAI,CAAA,OAAM,GAAG,KAAK,cAAc,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,IAAI,KAAK,GAAG,WAAW,EAAE,GAAG;AAAA,EAAA;AAAA,EAIhG,cAAc,MAAqC;AACtD,QAAA,KAAK,WAAW,GAAG;AACf,aAAA;AAAA,IAAA;AAED,WAAA,KACL,IAAI,CAAM,OAAA;AACV,UAAI,WAAW,IAAI;AAClB,eAAO,GAAG;AAAA,MAAA;AAEP,UAAA,WAAW,MAAM,GAAG,OAAO;AAC9B,eAAO,GAAG,GAAG,KAAK,IAAI,GAAG,KAAK;AAAA,MAAA;AAE/B,aAAO,GAAG;AAAA,IAAA,CACV,EACA,KAAK,GAAG;AAAA,EAAA;AAEZ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ReadHelpers.cjs","sources":["../../../../../packages/engine-content-api/src/resolvers/ReadHelpers.ts"],"sourcesContent":["import { Input, Model } from '@contember/schema'\nimport { Mapper } from '../mapper'\nimport { ObjectNode } from '../inputProcessing'\nimport { assertNever, createPaginationHelper } from '../utils'\nimport { ImplementationException } from '../exception'\nimport { Operation, readOperationMeta } from '../schema'\nimport { GraphQLFieldMap } from 'graphql'\n\nexport const paginate = async (\n\tmapper: Mapper,\n\tentity: Model.Entity,\n\tqueryAst: ObjectNode<Input.PaginationQueryInput>,\n) => {\n\tconst paginationHelper = createPaginationHelper(queryAst)\n\tconst totalCount = paginationHelper.requiresTotalCount\n\t\t? await mapper.count(entity, queryAst.args.filter || {})\n\t\t: undefined\n\tconst nodes = paginationHelper.nodeField ? await mapper.select(entity, paginationHelper.nodeField, []) : undefined\n\n\treturn paginationHelper.createResponse(totalCount, nodes)\n}\n\nexport const executeReadOperations = async (\n\tqueryAst: ObjectNode,\n\tfields: GraphQLFieldMap<any, any>,\n\tmapper: Mapper,\n): Promise<Record<string, any>> => {\n\tconst trxResult: Record<string, any> = {}\n\n\t// todo execute in parallel\n\tfor (const field of queryAst.fields) {\n\t\tif (!(field instanceof ObjectNode)) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tconst fieldConfig = fields[field.name]\n\t\tconst meta = readOperationMeta(fieldConfig.extensions)\n\t\ttrxResult[field.alias] = await (() => {\n\t\t\tswitch (meta.operation) {\n\t\t\t\tcase Operation.get:\n\t\t\t\t\treturn mapper.selectUnique(meta.entity, field, [])\n\t\t\t\tcase Operation.list:\n\t\t\t\t\treturn mapper.select(meta.entity, field, [])\n\t\t\t\tcase Operation.paginate:\n\t\t\t\t\treturn paginate(mapper, meta.entity, field)\n\t\t\t\tcase Operation.create:\n\t\t\t\tcase Operation.update:\n\t\t\t\tcase Operation.delete:\n\t\t\t\tcase Operation.upsert:\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t}\n\t\t\treturn assertNever(meta.operation)\n\t\t})()\n\t}\n\treturn trxResult\n}\n"],"names":["createPaginationHelper","ObjectNode","ImplementationException","readOperationMeta","Operation","assertNever"],"mappings":";;;;;;;;;;;;;;AAQO,MAAM,WAAW,OACvB,QACA,QACA,aACI;AACE,QAAA,mBAAmBA,uCAAuB,QAAQ;AACxD,QAAM,aAAa,iBAAiB,qBACjC,MAAM,OAAO,MAAM,QAAQ,SAAS,KAAK,UAAU,CAAA,CAAE,IACrD;AACG,QAAA,QAAQ,iBAAiB,YAAY,MAAM,OAAO,OAAO,QAAQ,iBAAiB,WAAW,EAAE,IAAI;AAElG,SAAA,iBAAiB,eAAe,YAAY,KAAK;AACzD;AAEO,MAAM,wBAAwB,OACpC,UACA,QACA,WACkC;AAClC,QAAM,YAAiC,CAAA;AAG5B,aAAA,SAAS,SAAS,QAAQ;AAChC,QAAA,EAAE,iBAAiBC,WAAAA,aAAa;AACnC,YAAM,IAAIC,UAAwB,wBAAA;AAAA,IACnC;AACM,UAAA,cAAc,OAAO,MAAM,IAAI;AAC/B,UAAA,OAAOC,mBAAAA,kBAAkB,YAAY,UAAU;AACrD,cAAU,MAAM,KAAK,IAAI,OAAO,MAAM;AACrC,cAAQ,KAAK,WAAW;AAAA,QACvB,KAAKC,mBAAU,UAAA;AACd,iBAAO,OAAO,aAAa,KAAK,QAAQ,OAAO,CAAA,CAAE;AAAA,QAClD,KAAKA,mBAAU,UAAA;AACd,iBAAO,OAAO,OAAO,KAAK,QAAQ,OAAO,CAAA,CAAE;AAAA,QAC5C,KAAKA,mBAAU,UAAA;AACd,iBAAO,SAAS,QAAQ,KAAK,QAAQ,KAAK;AAAA,QAC3C,KAAKA,mBAAAA,UAAU;AAAA,QACf,KAAKA,mBAAAA,UAAU;AAAA,QACf,KAAKA,mBAAAA,UAAU;AAAA,QACf,KAAKA,mBAAU,UAAA;AACd,gBAAM,IAAIF,UAAwB,wBAAA;AAAA,MACpC;AACO,aAAAG,YAAA,YAAY,KAAK,SAAS;AAAA,IAAA;EAEnC;AACO,SAAA;AACR;;;"}
1
+ {"version":3,"file":"ReadHelpers.cjs","sources":["../../../../../packages/engine-content-api/src/resolvers/ReadHelpers.ts"],"sourcesContent":["import { Input, Model } from '@contember/schema'\nimport { Mapper } from '../mapper'\nimport { ObjectNode } from '../inputProcessing'\nimport { assertNever, createPaginationHelper } from '../utils'\nimport { ImplementationException } from '../exception'\nimport { Operation, readOperationMeta } from '../schema'\nimport { GraphQLFieldMap } from 'graphql'\n\nexport const paginate = async (\n\tmapper: Mapper,\n\tentity: Model.Entity,\n\tqueryAst: ObjectNode<Input.PaginationQueryInput>,\n) => {\n\tconst paginationHelper = createPaginationHelper(queryAst)\n\tconst totalCount = paginationHelper.requiresTotalCount\n\t\t? await mapper.count(entity, queryAst.args.filter || {})\n\t\t: undefined\n\tconst nodes = paginationHelper.nodeField ? await mapper.select(entity, paginationHelper.nodeField, []) : undefined\n\n\treturn paginationHelper.createResponse(totalCount, nodes)\n}\n\nexport const executeReadOperations = async (\n\tqueryAst: ObjectNode,\n\tfields: GraphQLFieldMap<any, any>,\n\tmapper: Mapper,\n): Promise<Record<string, any>> => {\n\tconst trxResult: Record<string, any> = {}\n\n\t// todo execute in parallel\n\tfor (const field of queryAst.fields) {\n\t\tif (!(field instanceof ObjectNode)) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tconst fieldConfig = fields[field.name]\n\t\tconst meta = readOperationMeta(fieldConfig.extensions)\n\t\ttrxResult[field.alias] = await (() => {\n\t\t\tswitch (meta.operation) {\n\t\t\t\tcase Operation.get:\n\t\t\t\t\treturn mapper.selectUnique(meta.entity, field, [])\n\t\t\t\tcase Operation.list:\n\t\t\t\t\treturn mapper.select(meta.entity, field, [])\n\t\t\t\tcase Operation.paginate:\n\t\t\t\t\treturn paginate(mapper, meta.entity, field)\n\t\t\t\tcase Operation.create:\n\t\t\t\tcase Operation.update:\n\t\t\t\tcase Operation.delete:\n\t\t\t\tcase Operation.upsert:\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t}\n\t\t\treturn assertNever(meta.operation)\n\t\t})()\n\t}\n\treturn trxResult\n}\n"],"names":["createPaginationHelper","ObjectNode","ImplementationException","readOperationMeta","Operation","assertNever"],"mappings":";;;;;;;;;;;;;;AAQO,MAAM,WAAW,OACvB,QACA,QACA,aACI;AACE,QAAA,mBAAmBA,uCAAuB,QAAQ;AACxD,QAAM,aAAa,iBAAiB,qBACjC,MAAM,OAAO,MAAM,QAAQ,SAAS,KAAK,UAAU,CAAE,CAAA,IACrD;AACG,QAAA,QAAQ,iBAAiB,YAAY,MAAM,OAAO,OAAO,QAAQ,iBAAiB,WAAW,CAAE,CAAA,IAAI;AAElG,SAAA,iBAAiB,eAAe,YAAY,KAAK;AACzD;AAEO,MAAM,wBAAwB,OACpC,UACA,QACA,WACkC;AAClC,QAAM,YAAiC,CAAC;AAG7B,aAAA,SAAS,SAAS,QAAQ;AAChC,QAAA,EAAE,iBAAiBC,WAAAA,aAAa;AACnC,YAAM,IAAIC,UAAAA,wBAAwB;AAAA,IAAA;AAE7B,UAAA,cAAc,OAAO,MAAM,IAAI;AAC/B,UAAA,OAAOC,mBAAAA,kBAAkB,YAAY,UAAU;AACrD,cAAU,MAAM,KAAK,IAAI,OAAO,MAAM;AACrC,cAAQ,KAAK,WAAW;AAAA,QACvB,KAAKC,mBAAU,UAAA;AACd,iBAAO,OAAO,aAAa,KAAK,QAAQ,OAAO,CAAA,CAAE;AAAA,QAClD,KAAKA,mBAAU,UAAA;AACd,iBAAO,OAAO,OAAO,KAAK,QAAQ,OAAO,CAAA,CAAE;AAAA,QAC5C,KAAKA,mBAAU,UAAA;AACd,iBAAO,SAAS,QAAQ,KAAK,QAAQ,KAAK;AAAA,QAC3C,KAAKA,mBAAU,UAAA;AAAA,QACf,KAAKA,mBAAU,UAAA;AAAA,QACf,KAAKA,mBAAU,UAAA;AAAA,QACf,KAAKA,mBAAU,UAAA;AACd,gBAAM,IAAIF,UAAAA,wBAAwB;AAAA,MAAA;AAE7B,aAAAG,YAAA,YAAY,KAAK,SAAS;AAAA,IAAA,GAC/B;AAAA,EAAA;AAEG,SAAA;AACR;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ReadHelpers.js","sources":["../../../../../packages/engine-content-api/src/resolvers/ReadHelpers.ts"],"sourcesContent":["import { Input, Model } from '@contember/schema'\nimport { Mapper } from '../mapper'\nimport { ObjectNode } from '../inputProcessing'\nimport { assertNever, createPaginationHelper } from '../utils'\nimport { ImplementationException } from '../exception'\nimport { Operation, readOperationMeta } from '../schema'\nimport { GraphQLFieldMap } from 'graphql'\n\nexport const paginate = async (\n\tmapper: Mapper,\n\tentity: Model.Entity,\n\tqueryAst: ObjectNode<Input.PaginationQueryInput>,\n) => {\n\tconst paginationHelper = createPaginationHelper(queryAst)\n\tconst totalCount = paginationHelper.requiresTotalCount\n\t\t? await mapper.count(entity, queryAst.args.filter || {})\n\t\t: undefined\n\tconst nodes = paginationHelper.nodeField ? await mapper.select(entity, paginationHelper.nodeField, []) : undefined\n\n\treturn paginationHelper.createResponse(totalCount, nodes)\n}\n\nexport const executeReadOperations = async (\n\tqueryAst: ObjectNode,\n\tfields: GraphQLFieldMap<any, any>,\n\tmapper: Mapper,\n): Promise<Record<string, any>> => {\n\tconst trxResult: Record<string, any> = {}\n\n\t// todo execute in parallel\n\tfor (const field of queryAst.fields) {\n\t\tif (!(field instanceof ObjectNode)) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tconst fieldConfig = fields[field.name]\n\t\tconst meta = readOperationMeta(fieldConfig.extensions)\n\t\ttrxResult[field.alias] = await (() => {\n\t\t\tswitch (meta.operation) {\n\t\t\t\tcase Operation.get:\n\t\t\t\t\treturn mapper.selectUnique(meta.entity, field, [])\n\t\t\t\tcase Operation.list:\n\t\t\t\t\treturn mapper.select(meta.entity, field, [])\n\t\t\t\tcase Operation.paginate:\n\t\t\t\t\treturn paginate(mapper, meta.entity, field)\n\t\t\t\tcase Operation.create:\n\t\t\t\tcase Operation.update:\n\t\t\t\tcase Operation.delete:\n\t\t\t\tcase Operation.upsert:\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t}\n\t\t\treturn assertNever(meta.operation)\n\t\t})()\n\t}\n\treturn trxResult\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAQO,MAAM,WAAW,OACvB,QACA,QACA,aACI;AACE,QAAA,mBAAmB,uBAAuB,QAAQ;AACxD,QAAM,aAAa,iBAAiB,qBACjC,MAAM,OAAO,MAAM,QAAQ,SAAS,KAAK,UAAU,CAAA,CAAE,IACrD;AACG,QAAA,QAAQ,iBAAiB,YAAY,MAAM,OAAO,OAAO,QAAQ,iBAAiB,WAAW,EAAE,IAAI;AAElG,SAAA,iBAAiB,eAAe,YAAY,KAAK;AACzD;AAEO,MAAM,wBAAwB,OACpC,UACA,QACA,WACkC;AAClC,QAAM,YAAiC,CAAA;AAG5B,aAAA,SAAS,SAAS,QAAQ;AAChC,QAAA,EAAE,iBAAiB,aAAa;AACnC,YAAM,IAAI,wBAAwB;AAAA,IACnC;AACM,UAAA,cAAc,OAAO,MAAM,IAAI;AAC/B,UAAA,OAAO,kBAAkB,YAAY,UAAU;AACrD,cAAU,MAAM,KAAK,IAAI,OAAO,MAAM;AACrC,cAAQ,KAAK,WAAW;AAAA,QACvB,KAAK,UAAU;AACd,iBAAO,OAAO,aAAa,KAAK,QAAQ,OAAO,CAAA,CAAE;AAAA,QAClD,KAAK,UAAU;AACd,iBAAO,OAAO,OAAO,KAAK,QAAQ,OAAO,CAAA,CAAE;AAAA,QAC5C,KAAK,UAAU;AACd,iBAAO,SAAS,QAAQ,KAAK,QAAQ,KAAK;AAAA,QAC3C,KAAK,UAAU;AAAA,QACf,KAAK,UAAU;AAAA,QACf,KAAK,UAAU;AAAA,QACf,KAAK,UAAU;AACd,gBAAM,IAAI,wBAAwB;AAAA,MACpC;AACO,aAAA,YAAY,KAAK,SAAS;AAAA,IAAA;EAEnC;AACO,SAAA;AACR;"}
1
+ {"version":3,"file":"ReadHelpers.js","sources":["../../../../../packages/engine-content-api/src/resolvers/ReadHelpers.ts"],"sourcesContent":["import { Input, Model } from '@contember/schema'\nimport { Mapper } from '../mapper'\nimport { ObjectNode } from '../inputProcessing'\nimport { assertNever, createPaginationHelper } from '../utils'\nimport { ImplementationException } from '../exception'\nimport { Operation, readOperationMeta } from '../schema'\nimport { GraphQLFieldMap } from 'graphql'\n\nexport const paginate = async (\n\tmapper: Mapper,\n\tentity: Model.Entity,\n\tqueryAst: ObjectNode<Input.PaginationQueryInput>,\n) => {\n\tconst paginationHelper = createPaginationHelper(queryAst)\n\tconst totalCount = paginationHelper.requiresTotalCount\n\t\t? await mapper.count(entity, queryAst.args.filter || {})\n\t\t: undefined\n\tconst nodes = paginationHelper.nodeField ? await mapper.select(entity, paginationHelper.nodeField, []) : undefined\n\n\treturn paginationHelper.createResponse(totalCount, nodes)\n}\n\nexport const executeReadOperations = async (\n\tqueryAst: ObjectNode,\n\tfields: GraphQLFieldMap<any, any>,\n\tmapper: Mapper,\n): Promise<Record<string, any>> => {\n\tconst trxResult: Record<string, any> = {}\n\n\t// todo execute in parallel\n\tfor (const field of queryAst.fields) {\n\t\tif (!(field instanceof ObjectNode)) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tconst fieldConfig = fields[field.name]\n\t\tconst meta = readOperationMeta(fieldConfig.extensions)\n\t\ttrxResult[field.alias] = await (() => {\n\t\t\tswitch (meta.operation) {\n\t\t\t\tcase Operation.get:\n\t\t\t\t\treturn mapper.selectUnique(meta.entity, field, [])\n\t\t\t\tcase Operation.list:\n\t\t\t\t\treturn mapper.select(meta.entity, field, [])\n\t\t\t\tcase Operation.paginate:\n\t\t\t\t\treturn paginate(mapper, meta.entity, field)\n\t\t\t\tcase Operation.create:\n\t\t\t\tcase Operation.update:\n\t\t\t\tcase Operation.delete:\n\t\t\t\tcase Operation.upsert:\n\t\t\t\t\tthrow new ImplementationException()\n\t\t\t}\n\t\t\treturn assertNever(meta.operation)\n\t\t})()\n\t}\n\treturn trxResult\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAQO,MAAM,WAAW,OACvB,QACA,QACA,aACI;AACE,QAAA,mBAAmB,uBAAuB,QAAQ;AACxD,QAAM,aAAa,iBAAiB,qBACjC,MAAM,OAAO,MAAM,QAAQ,SAAS,KAAK,UAAU,CAAE,CAAA,IACrD;AACG,QAAA,QAAQ,iBAAiB,YAAY,MAAM,OAAO,OAAO,QAAQ,iBAAiB,WAAW,CAAE,CAAA,IAAI;AAElG,SAAA,iBAAiB,eAAe,YAAY,KAAK;AACzD;AAEO,MAAM,wBAAwB,OACpC,UACA,QACA,WACkC;AAClC,QAAM,YAAiC,CAAC;AAG7B,aAAA,SAAS,SAAS,QAAQ;AAChC,QAAA,EAAE,iBAAiB,aAAa;AACnC,YAAM,IAAI,wBAAwB;AAAA,IAAA;AAE7B,UAAA,cAAc,OAAO,MAAM,IAAI;AAC/B,UAAA,OAAO,kBAAkB,YAAY,UAAU;AACrD,cAAU,MAAM,KAAK,IAAI,OAAO,MAAM;AACrC,cAAQ,KAAK,WAAW;AAAA,QACvB,KAAK,UAAU;AACd,iBAAO,OAAO,aAAa,KAAK,QAAQ,OAAO,CAAA,CAAE;AAAA,QAClD,KAAK,UAAU;AACd,iBAAO,OAAO,OAAO,KAAK,QAAQ,OAAO,CAAA,CAAE;AAAA,QAC5C,KAAK,UAAU;AACd,iBAAO,SAAS,QAAQ,KAAK,QAAQ,KAAK;AAAA,QAC3C,KAAK,UAAU;AAAA,QACf,KAAK,UAAU;AAAA,QACf,KAAK,UAAU;AAAA,QACf,KAAK,UAAU;AACd,gBAAM,IAAI,wBAAwB;AAAA,MAAA;AAE7B,aAAA,YAAY,KAAK,SAAS;AAAA,IAAA,GAC/B;AAAA,EAAA;AAEG,SAAA;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ReadResolver.cjs","sources":["../../../../../packages/engine-content-api/src/resolvers/ReadResolver.ts"],"sourcesContent":["import { Input, Model } from '@contember/schema'\nimport { MapperFactory } from '../mapper'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { GraphQlQueryAstFactory } from './GraphQlQueryAstFactory'\nimport { ObjectNode } from '../inputProcessing'\nimport { executeReadOperations, paginate } from './ReadHelpers'\n\nexport class ReadResolver {\n\tconstructor(\n\t\tprivate readonly mapperFactory: MapperFactory,\n\t\tprivate readonly queryAstFactory: GraphQlQueryAstFactory,\n\t) {}\n\n\tpublic async resolveQuery(info: GraphQLResolveInfo) {\n\t\tconst queryAst = this.queryAstFactory.create(info)\n\t\tconst fields = GraphQlQueryAstFactory.resolveObjectType(info.returnType).getFields()\n\t\tconst mapper = this.mapperFactory.create()\n\t\treturn executeReadOperations(queryAst, fields, mapper)\n\t}\n\n\tpublic async resolveTransaction(info: GraphQLResolveInfo) {\n\t\tconst queryAst = this.queryAstFactory.create(info)\n\t\tconst fields = GraphQlQueryAstFactory.resolveObjectType(info.returnType).getFields()\n\n\t\treturn this.mapperFactory.transaction(async mapper => {\n\t\t\treturn executeReadOperations(queryAst, fields, mapper)\n\t\t})\n\t}\n\n\tpublic async resolveListQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.ListQueryInput> = this.queryAstFactory.create(info)\n\t\treturn await this.mapperFactory.create().select(entity, queryAst, [])\n\t}\n\n\tpublic async resolveGetQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.UniqueQueryInput> = this.queryAstFactory.create(info)\n\t\treturn await this.mapperFactory.create().selectUnique(entity, queryAst, [])\n\t}\n\n\tpublic async resolvePaginationQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.PaginationQueryInput> = this.queryAstFactory.create(info)\n\t\tconst mapper = this.mapperFactory.create()\n\t\treturn await paginate(mapper, entity, queryAst)\n\t}\n}\n"],"names":["GraphQlQueryAstFactory","executeReadOperations","paginate"],"mappings":";;;;AAOO,MAAM,aAAa;AAAA,EACzB,YACkB,eACA,iBAChB;AAFgB,SAAA,gBAAA;AACA,SAAA,kBAAA;AAAA,EACf;AAAA,EAEH,MAAa,aAAa,MAA0B;AACnD,UAAM,WAAW,KAAK,gBAAgB,OAAO,IAAI;AACjD,UAAM,SAASA,uBAAAA,uBAAuB,kBAAkB,KAAK,UAAU,EAAE;AACnE,UAAA,SAAS,KAAK,cAAc,OAAO;AAClC,WAAAC,kCAAsB,UAAU,QAAQ,MAAM;AAAA,EACtD;AAAA,EAEA,MAAa,mBAAmB,MAA0B;AACzD,UAAM,WAAW,KAAK,gBAAgB,OAAO,IAAI;AACjD,UAAM,SAASD,uBAAAA,uBAAuB,kBAAkB,KAAK,UAAU,EAAE;AAEzE,WAAO,KAAK,cAAc,YAAY,OAAM,WAAU;AAC9C,aAAAC,kCAAsB,UAAU,QAAQ,MAAM;AAAA,IAAA,CACrD;AAAA,EACF;AAAA,EAEA,MAAa,iBAAiB,QAAsB,MAA0B;AAC7E,UAAM,WAA6C,KAAK,gBAAgB,OAAO,IAAI;AAC5E,WAAA,MAAM,KAAK,cAAc,OAAA,EAAS,OAAO,QAAQ,UAAU,CAAA,CAAE;AAAA,EACrE;AAAA,EAEA,MAAa,gBAAgB,QAAsB,MAA0B;AAC5E,UAAM,WAA+C,KAAK,gBAAgB,OAAO,IAAI;AAC9E,WAAA,MAAM,KAAK,cAAc,OAAA,EAAS,aAAa,QAAQ,UAAU,CAAA,CAAE;AAAA,EAC3E;AAAA,EAEA,MAAa,uBAAuB,QAAsB,MAA0B;AACnF,UAAM,WAAmD,KAAK,gBAAgB,OAAO,IAAI;AACnF,UAAA,SAAS,KAAK,cAAc,OAAO;AACzC,WAAO,MAAMC,YAAAA,SAAS,QAAQ,QAAQ,QAAQ;AAAA,EAC/C;AACD;;"}
1
+ {"version":3,"file":"ReadResolver.cjs","sources":["../../../../../packages/engine-content-api/src/resolvers/ReadResolver.ts"],"sourcesContent":["import { Input, Model } from '@contember/schema'\nimport { MapperFactory } from '../mapper'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { GraphQlQueryAstFactory } from './GraphQlQueryAstFactory'\nimport { ObjectNode } from '../inputProcessing'\nimport { executeReadOperations, paginate } from './ReadHelpers'\n\nexport class ReadResolver {\n\tconstructor(\n\t\tprivate readonly mapperFactory: MapperFactory,\n\t\tprivate readonly queryAstFactory: GraphQlQueryAstFactory,\n\t) {}\n\n\tpublic async resolveQuery(info: GraphQLResolveInfo) {\n\t\tconst queryAst = this.queryAstFactory.create(info)\n\t\tconst fields = GraphQlQueryAstFactory.resolveObjectType(info.returnType).getFields()\n\t\tconst mapper = this.mapperFactory.create()\n\t\treturn executeReadOperations(queryAst, fields, mapper)\n\t}\n\n\tpublic async resolveTransaction(info: GraphQLResolveInfo) {\n\t\tconst queryAst = this.queryAstFactory.create(info)\n\t\tconst fields = GraphQlQueryAstFactory.resolveObjectType(info.returnType).getFields()\n\n\t\treturn this.mapperFactory.transaction(async mapper => {\n\t\t\treturn executeReadOperations(queryAst, fields, mapper)\n\t\t})\n\t}\n\n\tpublic async resolveListQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.ListQueryInput> = this.queryAstFactory.create(info)\n\t\treturn await this.mapperFactory.create().select(entity, queryAst, [])\n\t}\n\n\tpublic async resolveGetQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.UniqueQueryInput> = this.queryAstFactory.create(info)\n\t\treturn await this.mapperFactory.create().selectUnique(entity, queryAst, [])\n\t}\n\n\tpublic async resolvePaginationQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.PaginationQueryInput> = this.queryAstFactory.create(info)\n\t\tconst mapper = this.mapperFactory.create()\n\t\treturn await paginate(mapper, entity, queryAst)\n\t}\n}\n"],"names":["GraphQlQueryAstFactory","executeReadOperations","paginate"],"mappings":";;;;AAOO,MAAM,aAAa;AAAA,EACzB,YACkB,eACA,iBAChB;AAFgB,SAAA,gBAAA;AACA,SAAA,kBAAA;AAAA,EAAA;AAAA,EAGlB,MAAa,aAAa,MAA0B;AACnD,UAAM,WAAW,KAAK,gBAAgB,OAAO,IAAI;AACjD,UAAM,SAASA,uBAAAA,uBAAuB,kBAAkB,KAAK,UAAU,EAAE,UAAU;AAC7E,UAAA,SAAS,KAAK,cAAc,OAAO;AAClC,WAAAC,kCAAsB,UAAU,QAAQ,MAAM;AAAA,EAAA;AAAA,EAGtD,MAAa,mBAAmB,MAA0B;AACzD,UAAM,WAAW,KAAK,gBAAgB,OAAO,IAAI;AACjD,UAAM,SAASD,uBAAAA,uBAAuB,kBAAkB,KAAK,UAAU,EAAE,UAAU;AAEnF,WAAO,KAAK,cAAc,YAAY,OAAM,WAAU;AAC9C,aAAAC,kCAAsB,UAAU,QAAQ,MAAM;AAAA,IAAA,CACrD;AAAA,EAAA;AAAA,EAGF,MAAa,iBAAiB,QAAsB,MAA0B;AAC7E,UAAM,WAA6C,KAAK,gBAAgB,OAAO,IAAI;AAC5E,WAAA,MAAM,KAAK,cAAc,OAAA,EAAS,OAAO,QAAQ,UAAU,EAAE;AAAA,EAAA;AAAA,EAGrE,MAAa,gBAAgB,QAAsB,MAA0B;AAC5E,UAAM,WAA+C,KAAK,gBAAgB,OAAO,IAAI;AAC9E,WAAA,MAAM,KAAK,cAAc,OAAA,EAAS,aAAa,QAAQ,UAAU,EAAE;AAAA,EAAA;AAAA,EAG3E,MAAa,uBAAuB,QAAsB,MAA0B;AACnF,UAAM,WAAmD,KAAK,gBAAgB,OAAO,IAAI;AACnF,UAAA,SAAS,KAAK,cAAc,OAAO;AACzC,WAAO,MAAMC,YAAA,SAAS,QAAQ,QAAQ,QAAQ;AAAA,EAAA;AAEhD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ReadResolver.js","sources":["../../../../../packages/engine-content-api/src/resolvers/ReadResolver.ts"],"sourcesContent":["import { Input, Model } from '@contember/schema'\nimport { MapperFactory } from '../mapper'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { GraphQlQueryAstFactory } from './GraphQlQueryAstFactory'\nimport { ObjectNode } from '../inputProcessing'\nimport { executeReadOperations, paginate } from './ReadHelpers'\n\nexport class ReadResolver {\n\tconstructor(\n\t\tprivate readonly mapperFactory: MapperFactory,\n\t\tprivate readonly queryAstFactory: GraphQlQueryAstFactory,\n\t) {}\n\n\tpublic async resolveQuery(info: GraphQLResolveInfo) {\n\t\tconst queryAst = this.queryAstFactory.create(info)\n\t\tconst fields = GraphQlQueryAstFactory.resolveObjectType(info.returnType).getFields()\n\t\tconst mapper = this.mapperFactory.create()\n\t\treturn executeReadOperations(queryAst, fields, mapper)\n\t}\n\n\tpublic async resolveTransaction(info: GraphQLResolveInfo) {\n\t\tconst queryAst = this.queryAstFactory.create(info)\n\t\tconst fields = GraphQlQueryAstFactory.resolveObjectType(info.returnType).getFields()\n\n\t\treturn this.mapperFactory.transaction(async mapper => {\n\t\t\treturn executeReadOperations(queryAst, fields, mapper)\n\t\t})\n\t}\n\n\tpublic async resolveListQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.ListQueryInput> = this.queryAstFactory.create(info)\n\t\treturn await this.mapperFactory.create().select(entity, queryAst, [])\n\t}\n\n\tpublic async resolveGetQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.UniqueQueryInput> = this.queryAstFactory.create(info)\n\t\treturn await this.mapperFactory.create().selectUnique(entity, queryAst, [])\n\t}\n\n\tpublic async resolvePaginationQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.PaginationQueryInput> = this.queryAstFactory.create(info)\n\t\tconst mapper = this.mapperFactory.create()\n\t\treturn await paginate(mapper, entity, queryAst)\n\t}\n}\n"],"names":[],"mappings":";;AAOO,MAAM,aAAa;AAAA,EACzB,YACkB,eACA,iBAChB;AAFgB,SAAA,gBAAA;AACA,SAAA,kBAAA;AAAA,EACf;AAAA,EAEH,MAAa,aAAa,MAA0B;AACnD,UAAM,WAAW,KAAK,gBAAgB,OAAO,IAAI;AACjD,UAAM,SAAS,uBAAuB,kBAAkB,KAAK,UAAU,EAAE;AACnE,UAAA,SAAS,KAAK,cAAc,OAAO;AAClC,WAAA,sBAAsB,UAAU,QAAQ,MAAM;AAAA,EACtD;AAAA,EAEA,MAAa,mBAAmB,MAA0B;AACzD,UAAM,WAAW,KAAK,gBAAgB,OAAO,IAAI;AACjD,UAAM,SAAS,uBAAuB,kBAAkB,KAAK,UAAU,EAAE;AAEzE,WAAO,KAAK,cAAc,YAAY,OAAM,WAAU;AAC9C,aAAA,sBAAsB,UAAU,QAAQ,MAAM;AAAA,IAAA,CACrD;AAAA,EACF;AAAA,EAEA,MAAa,iBAAiB,QAAsB,MAA0B;AAC7E,UAAM,WAA6C,KAAK,gBAAgB,OAAO,IAAI;AAC5E,WAAA,MAAM,KAAK,cAAc,OAAA,EAAS,OAAO,QAAQ,UAAU,CAAA,CAAE;AAAA,EACrE;AAAA,EAEA,MAAa,gBAAgB,QAAsB,MAA0B;AAC5E,UAAM,WAA+C,KAAK,gBAAgB,OAAO,IAAI;AAC9E,WAAA,MAAM,KAAK,cAAc,OAAA,EAAS,aAAa,QAAQ,UAAU,CAAA,CAAE;AAAA,EAC3E;AAAA,EAEA,MAAa,uBAAuB,QAAsB,MAA0B;AACnF,UAAM,WAAmD,KAAK,gBAAgB,OAAO,IAAI;AACnF,UAAA,SAAS,KAAK,cAAc,OAAO;AACzC,WAAO,MAAM,SAAS,QAAQ,QAAQ,QAAQ;AAAA,EAC/C;AACD;"}
1
+ {"version":3,"file":"ReadResolver.js","sources":["../../../../../packages/engine-content-api/src/resolvers/ReadResolver.ts"],"sourcesContent":["import { Input, Model } from '@contember/schema'\nimport { MapperFactory } from '../mapper'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { GraphQlQueryAstFactory } from './GraphQlQueryAstFactory'\nimport { ObjectNode } from '../inputProcessing'\nimport { executeReadOperations, paginate } from './ReadHelpers'\n\nexport class ReadResolver {\n\tconstructor(\n\t\tprivate readonly mapperFactory: MapperFactory,\n\t\tprivate readonly queryAstFactory: GraphQlQueryAstFactory,\n\t) {}\n\n\tpublic async resolveQuery(info: GraphQLResolveInfo) {\n\t\tconst queryAst = this.queryAstFactory.create(info)\n\t\tconst fields = GraphQlQueryAstFactory.resolveObjectType(info.returnType).getFields()\n\t\tconst mapper = this.mapperFactory.create()\n\t\treturn executeReadOperations(queryAst, fields, mapper)\n\t}\n\n\tpublic async resolveTransaction(info: GraphQLResolveInfo) {\n\t\tconst queryAst = this.queryAstFactory.create(info)\n\t\tconst fields = GraphQlQueryAstFactory.resolveObjectType(info.returnType).getFields()\n\n\t\treturn this.mapperFactory.transaction(async mapper => {\n\t\t\treturn executeReadOperations(queryAst, fields, mapper)\n\t\t})\n\t}\n\n\tpublic async resolveListQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.ListQueryInput> = this.queryAstFactory.create(info)\n\t\treturn await this.mapperFactory.create().select(entity, queryAst, [])\n\t}\n\n\tpublic async resolveGetQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.UniqueQueryInput> = this.queryAstFactory.create(info)\n\t\treturn await this.mapperFactory.create().selectUnique(entity, queryAst, [])\n\t}\n\n\tpublic async resolvePaginationQuery(entity: Model.Entity, info: GraphQLResolveInfo) {\n\t\tconst queryAst: ObjectNode<Input.PaginationQueryInput> = this.queryAstFactory.create(info)\n\t\tconst mapper = this.mapperFactory.create()\n\t\treturn await paginate(mapper, entity, queryAst)\n\t}\n}\n"],"names":[],"mappings":";;AAOO,MAAM,aAAa;AAAA,EACzB,YACkB,eACA,iBAChB;AAFgB,SAAA,gBAAA;AACA,SAAA,kBAAA;AAAA,EAAA;AAAA,EAGlB,MAAa,aAAa,MAA0B;AACnD,UAAM,WAAW,KAAK,gBAAgB,OAAO,IAAI;AACjD,UAAM,SAAS,uBAAuB,kBAAkB,KAAK,UAAU,EAAE,UAAU;AAC7E,UAAA,SAAS,KAAK,cAAc,OAAO;AAClC,WAAA,sBAAsB,UAAU,QAAQ,MAAM;AAAA,EAAA;AAAA,EAGtD,MAAa,mBAAmB,MAA0B;AACzD,UAAM,WAAW,KAAK,gBAAgB,OAAO,IAAI;AACjD,UAAM,SAAS,uBAAuB,kBAAkB,KAAK,UAAU,EAAE,UAAU;AAEnF,WAAO,KAAK,cAAc,YAAY,OAAM,WAAU;AAC9C,aAAA,sBAAsB,UAAU,QAAQ,MAAM;AAAA,IAAA,CACrD;AAAA,EAAA;AAAA,EAGF,MAAa,iBAAiB,QAAsB,MAA0B;AAC7E,UAAM,WAA6C,KAAK,gBAAgB,OAAO,IAAI;AAC5E,WAAA,MAAM,KAAK,cAAc,OAAA,EAAS,OAAO,QAAQ,UAAU,EAAE;AAAA,EAAA;AAAA,EAGrE,MAAa,gBAAgB,QAAsB,MAA0B;AAC5E,UAAM,WAA+C,KAAK,gBAAgB,OAAO,IAAI;AAC9E,WAAA,MAAM,KAAK,cAAc,OAAA,EAAS,aAAa,QAAQ,UAAU,EAAE;AAAA,EAAA;AAAA,EAG3E,MAAa,uBAAuB,QAAsB,MAA0B;AACnF,UAAM,WAAmD,KAAK,gBAAgB,OAAO,IAAI;AACnF,UAAA,SAAS,KAAK,cAAc,OAAO;AACzC,WAAO,MAAM,SAAS,QAAQ,QAAQ,QAAQ;AAAA,EAAA;AAEhD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationResolver.cjs","sources":["../../../../../packages/engine-content-api/src/resolvers/ValidationResolver.ts"],"sourcesContent":["import { Input, Model, Result } from '@contember/schema'\nimport { assertNever } from '../utils'\nimport { InputPreValidator, ValidationResult } from '../input-validation'\nimport { MapperFactory } from '../mapper'\n\nexport class ValidationResolver {\n\tconstructor(\n\t\tprivate readonly mapperFactory: MapperFactory,\n\t\tprivate readonly inputValidator: InputPreValidator,\n\t) {}\n\n\tpublic async validateUpdate(entity: Model.Entity, input: Input.UpdateInput): Promise<Result.ValidationResult> {\n\t\tconst mapper = this.mapperFactory.create()\n\t\tconst validationResult = await this.inputValidator.validateUpdate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\twhere: input.by,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t})\n\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tpublic async validateCreate(entity: Model.Entity, input: Input.CreateInput): Promise<Result.ValidationResult> {\n\t\tconst mapper = this.mapperFactory.create()\n\t\tconst validationResult = await this.inputValidator.validateCreate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t\toverRelation: null,\n\t\t})\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tpublic static createValidationResponse(validationResult: ValidationResult): Result.ValidationResult {\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\terrors: validationResult.map(it => ({\n\t\t\t\tmessage: it.message,\n\t\t\t\tpath: it.path.map(part => {\n\t\t\t\t\tif ('field' in part) {\n\t\t\t\t\t\treturn { __typename: '_FieldPathFragment', ...part }\n\t\t\t\t\t}\n\t\t\t\t\tif ('index' in part) {\n\t\t\t\t\t\treturn { __typename: '_IndexPathFragment', ...part }\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(part)\n\t\t\t\t}),\n\t\t\t})),\n\t\t}\n\t}\n}\n"],"names":["assertNever"],"mappings":";;;;AAKO,MAAM,mBAAmB;AAAA,EAC/B,YACkB,eACA,gBAChB;AAFgB,SAAA,gBAAA;AACA,SAAA,iBAAA;AAAA,EACf;AAAA,EAEH,MAAa,eAAe,QAAsB,OAA4D;AACvG,UAAA,SAAS,KAAK,cAAc,OAAO;AACzC,UAAM,mBAAmB,MAAM,KAAK,eAAe,eAAe;AAAA,MACjE;AAAA,MACA;AAAA,MACA,OAAO,MAAM;AAAA,MACb,MAAM,MAAM;AAAA,MACZ,MAAM,CAAC;AAAA,IAAA,CACP;AAEG,QAAA,iBAAiB,SAAS,GAAG;AACzB,aAAA,mBAAmB,yBAAyB,gBAAgB;AAAA,IACpE;AACO,WAAA;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AAAA,EAEA,MAAa,eAAe,QAAsB,OAA4D;AACvG,UAAA,SAAS,KAAK,cAAc,OAAO;AACzC,UAAM,mBAAmB,MAAM,KAAK,eAAe,eAAe;AAAA,MACjE;AAAA,MACA;AAAA,MACA,MAAM,MAAM;AAAA,MACZ,MAAM,CAAC;AAAA,MACP,cAAc;AAAA,IAAA,CACd;AACG,QAAA,iBAAiB,SAAS,GAAG;AACzB,aAAA,mBAAmB,yBAAyB,gBAAgB;AAAA,IACpE;AACO,WAAA;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AAAA,EAEA,OAAc,yBAAyB,kBAA6D;AAC5F,WAAA;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,iBAAiB,IAAI,CAAO,QAAA;AAAA,QACnC,SAAS,GAAG;AAAA,QACZ,MAAM,GAAG,KAAK,IAAI,CAAQ,SAAA;AACzB,cAAI,WAAW,MAAM;AACpB,mBAAO,EAAE,YAAY,sBAAsB,GAAG,KAAK;AAAA,UACpD;AACA,cAAI,WAAW,MAAM;AACpB,mBAAO,EAAE,YAAY,sBAAsB,GAAG,KAAK;AAAA,UACpD;AACA,iBAAOA,YAAAA,YAAgB;AAAA,QAAA,CACvB;AAAA,MAAA,EACA;AAAA,IAAA;AAAA,EAEJ;AACD;;"}
1
+ {"version":3,"file":"ValidationResolver.cjs","sources":["../../../../../packages/engine-content-api/src/resolvers/ValidationResolver.ts"],"sourcesContent":["import { Input, Model, Result } from '@contember/schema'\nimport { assertNever } from '../utils'\nimport { InputPreValidator, ValidationResult } from '../input-validation'\nimport { MapperFactory } from '../mapper'\n\nexport class ValidationResolver {\n\tconstructor(\n\t\tprivate readonly mapperFactory: MapperFactory,\n\t\tprivate readonly inputValidator: InputPreValidator,\n\t) {}\n\n\tpublic async validateUpdate(entity: Model.Entity, input: Input.UpdateInput): Promise<Result.ValidationResult> {\n\t\tconst mapper = this.mapperFactory.create()\n\t\tconst validationResult = await this.inputValidator.validateUpdate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\twhere: input.by,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t})\n\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tpublic async validateCreate(entity: Model.Entity, input: Input.CreateInput): Promise<Result.ValidationResult> {\n\t\tconst mapper = this.mapperFactory.create()\n\t\tconst validationResult = await this.inputValidator.validateCreate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t\toverRelation: null,\n\t\t})\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tpublic static createValidationResponse(validationResult: ValidationResult): Result.ValidationResult {\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\terrors: validationResult.map(it => ({\n\t\t\t\tmessage: it.message,\n\t\t\t\tpath: it.path.map(part => {\n\t\t\t\t\tif ('field' in part) {\n\t\t\t\t\t\treturn { __typename: '_FieldPathFragment', ...part }\n\t\t\t\t\t}\n\t\t\t\t\tif ('index' in part) {\n\t\t\t\t\t\treturn { __typename: '_IndexPathFragment', ...part }\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(part)\n\t\t\t\t}),\n\t\t\t})),\n\t\t}\n\t}\n}\n"],"names":["assertNever"],"mappings":";;;;AAKO,MAAM,mBAAmB;AAAA,EAC/B,YACkB,eACA,gBAChB;AAFgB,SAAA,gBAAA;AACA,SAAA,iBAAA;AAAA,EAAA;AAAA,EAGlB,MAAa,eAAe,QAAsB,OAA4D;AACvG,UAAA,SAAS,KAAK,cAAc,OAAO;AACzC,UAAM,mBAAmB,MAAM,KAAK,eAAe,eAAe;AAAA,MACjE;AAAA,MACA;AAAA,MACA,OAAO,MAAM;AAAA,MACb,MAAM,MAAM;AAAA,MACZ,MAAM,CAAA;AAAA,IAAC,CACP;AAEG,QAAA,iBAAiB,SAAS,GAAG;AACzB,aAAA,mBAAmB,yBAAyB,gBAAgB;AAAA,IAAA;AAE7D,WAAA;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,CAAA;AAAA,IACT;AAAA,EAAA;AAAA,EAGD,MAAa,eAAe,QAAsB,OAA4D;AACvG,UAAA,SAAS,KAAK,cAAc,OAAO;AACzC,UAAM,mBAAmB,MAAM,KAAK,eAAe,eAAe;AAAA,MACjE;AAAA,MACA;AAAA,MACA,MAAM,MAAM;AAAA,MACZ,MAAM,CAAC;AAAA,MACP,cAAc;AAAA,IAAA,CACd;AACG,QAAA,iBAAiB,SAAS,GAAG;AACzB,aAAA,mBAAmB,yBAAyB,gBAAgB;AAAA,IAAA;AAE7D,WAAA;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,CAAA;AAAA,IACT;AAAA,EAAA;AAAA,EAGD,OAAc,yBAAyB,kBAA6D;AAC5F,WAAA;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,iBAAiB,IAAI,CAAO,QAAA;AAAA,QACnC,SAAS,GAAG;AAAA,QACZ,MAAM,GAAG,KAAK,IAAI,CAAQ,SAAA;AACzB,cAAI,WAAW,MAAM;AACpB,mBAAO,EAAE,YAAY,sBAAsB,GAAG,KAAK;AAAA,UAAA;AAEpD,cAAI,WAAW,MAAM;AACpB,mBAAO,EAAE,YAAY,sBAAsB,GAAG,KAAK;AAAA,UAAA;AAEpD,iBAAOA,wBAAgB;AAAA,QACvB,CAAA;AAAA,MAAA,EACA;AAAA,IACH;AAAA,EAAA;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationResolver.js","sources":["../../../../../packages/engine-content-api/src/resolvers/ValidationResolver.ts"],"sourcesContent":["import { Input, Model, Result } from '@contember/schema'\nimport { assertNever } from '../utils'\nimport { InputPreValidator, ValidationResult } from '../input-validation'\nimport { MapperFactory } from '../mapper'\n\nexport class ValidationResolver {\n\tconstructor(\n\t\tprivate readonly mapperFactory: MapperFactory,\n\t\tprivate readonly inputValidator: InputPreValidator,\n\t) {}\n\n\tpublic async validateUpdate(entity: Model.Entity, input: Input.UpdateInput): Promise<Result.ValidationResult> {\n\t\tconst mapper = this.mapperFactory.create()\n\t\tconst validationResult = await this.inputValidator.validateUpdate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\twhere: input.by,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t})\n\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tpublic async validateCreate(entity: Model.Entity, input: Input.CreateInput): Promise<Result.ValidationResult> {\n\t\tconst mapper = this.mapperFactory.create()\n\t\tconst validationResult = await this.inputValidator.validateCreate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t\toverRelation: null,\n\t\t})\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tpublic static createValidationResponse(validationResult: ValidationResult): Result.ValidationResult {\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\terrors: validationResult.map(it => ({\n\t\t\t\tmessage: it.message,\n\t\t\t\tpath: it.path.map(part => {\n\t\t\t\t\tif ('field' in part) {\n\t\t\t\t\t\treturn { __typename: '_FieldPathFragment', ...part }\n\t\t\t\t\t}\n\t\t\t\t\tif ('index' in part) {\n\t\t\t\t\t\treturn { __typename: '_IndexPathFragment', ...part }\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(part)\n\t\t\t\t}),\n\t\t\t})),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAKO,MAAM,mBAAmB;AAAA,EAC/B,YACkB,eACA,gBAChB;AAFgB,SAAA,gBAAA;AACA,SAAA,iBAAA;AAAA,EACf;AAAA,EAEH,MAAa,eAAe,QAAsB,OAA4D;AACvG,UAAA,SAAS,KAAK,cAAc,OAAO;AACzC,UAAM,mBAAmB,MAAM,KAAK,eAAe,eAAe;AAAA,MACjE;AAAA,MACA;AAAA,MACA,OAAO,MAAM;AAAA,MACb,MAAM,MAAM;AAAA,MACZ,MAAM,CAAC;AAAA,IAAA,CACP;AAEG,QAAA,iBAAiB,SAAS,GAAG;AACzB,aAAA,mBAAmB,yBAAyB,gBAAgB;AAAA,IACpE;AACO,WAAA;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AAAA,EAEA,MAAa,eAAe,QAAsB,OAA4D;AACvG,UAAA,SAAS,KAAK,cAAc,OAAO;AACzC,UAAM,mBAAmB,MAAM,KAAK,eAAe,eAAe;AAAA,MACjE;AAAA,MACA;AAAA,MACA,MAAM,MAAM;AAAA,MACZ,MAAM,CAAC;AAAA,MACP,cAAc;AAAA,IAAA,CACd;AACG,QAAA,iBAAiB,SAAS,GAAG;AACzB,aAAA,mBAAmB,yBAAyB,gBAAgB;AAAA,IACpE;AACO,WAAA;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AAAA,EAEA,OAAc,yBAAyB,kBAA6D;AAC5F,WAAA;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,iBAAiB,IAAI,CAAO,QAAA;AAAA,QACnC,SAAS,GAAG;AAAA,QACZ,MAAM,GAAG,KAAK,IAAI,CAAQ,SAAA;AACzB,cAAI,WAAW,MAAM;AACpB,mBAAO,EAAE,YAAY,sBAAsB,GAAG,KAAK;AAAA,UACpD;AACA,cAAI,WAAW,MAAM;AACpB,mBAAO,EAAE,YAAY,sBAAsB,GAAG,KAAK;AAAA,UACpD;AACA,iBAAO,YAAgB;AAAA,QAAA,CACvB;AAAA,MAAA,EACA;AAAA,IAAA;AAAA,EAEJ;AACD;"}
1
+ {"version":3,"file":"ValidationResolver.js","sources":["../../../../../packages/engine-content-api/src/resolvers/ValidationResolver.ts"],"sourcesContent":["import { Input, Model, Result } from '@contember/schema'\nimport { assertNever } from '../utils'\nimport { InputPreValidator, ValidationResult } from '../input-validation'\nimport { MapperFactory } from '../mapper'\n\nexport class ValidationResolver {\n\tconstructor(\n\t\tprivate readonly mapperFactory: MapperFactory,\n\t\tprivate readonly inputValidator: InputPreValidator,\n\t) {}\n\n\tpublic async validateUpdate(entity: Model.Entity, input: Input.UpdateInput): Promise<Result.ValidationResult> {\n\t\tconst mapper = this.mapperFactory.create()\n\t\tconst validationResult = await this.inputValidator.validateUpdate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\twhere: input.by,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t})\n\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tpublic async validateCreate(entity: Model.Entity, input: Input.CreateInput): Promise<Result.ValidationResult> {\n\t\tconst mapper = this.mapperFactory.create()\n\t\tconst validationResult = await this.inputValidator.validateCreate({\n\t\t\tmapper,\n\t\t\tentity,\n\t\t\tdata: input.data,\n\t\t\tpath: [],\n\t\t\toverRelation: null,\n\t\t})\n\t\tif (validationResult.length > 0) {\n\t\t\treturn ValidationResolver.createValidationResponse(validationResult)\n\t\t}\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tpublic static createValidationResponse(validationResult: ValidationResult): Result.ValidationResult {\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\terrors: validationResult.map(it => ({\n\t\t\t\tmessage: it.message,\n\t\t\t\tpath: it.path.map(part => {\n\t\t\t\t\tif ('field' in part) {\n\t\t\t\t\t\treturn { __typename: '_FieldPathFragment', ...part }\n\t\t\t\t\t}\n\t\t\t\t\tif ('index' in part) {\n\t\t\t\t\t\treturn { __typename: '_IndexPathFragment', ...part }\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(part)\n\t\t\t\t}),\n\t\t\t})),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAKO,MAAM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AA,QACvB,CAAA;AAAA,MAAA,EACA;AAAA,IACH;AAAA,EAAA;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnTypeResolver.cjs","sources":["../../../../../packages/engine-content-api/src/schema/ColumnTypeResolver.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLEnumType, GraphQLFloat, GraphQLInt, GraphQLScalarType, GraphQLString } from 'graphql'\nimport { Model } from '@contember/schema'\nimport { EnumsProvider } from './EnumsProvider'\nimport { CustomTypesProvider } from './CustomTypesProvider'\nimport { ImplementationException } from '../exception'\nimport { singletonFactory } from '../utils'\n\ntype ScalarType = Exclude<Model.ColumnType, Model.ColumnType.Enum>\n\nexport class ColumnTypeResolver {\n\tprivate schema: Model.Schema\n\tprivate enumsProvider: EnumsProvider\n\n\tprivate readonly aliasedTypes = singletonFactory<{ scalar: GraphQLScalarType; base: ScalarType }, string, ScalarType>(\n\t\tthis.createAliasedType.bind(this),\n\t)\n\n\tconstructor(\n\t\tschema: Model.Schema,\n\t\tenumsProvider: EnumsProvider,\n\t\tprivate readonly customTypeProvider: CustomTypesProvider,\n\t) {\n\t\tthis.schema = schema\n\t\tthis.enumsProvider = enumsProvider\n\t}\n\n\tprivate createAliasedType(name: string, baseType: ScalarType): { scalar: GraphQLScalarType; base: ScalarType } {\n\t\tconst baseGraphqlType = this.getScalarType(baseType)\n\t\treturn {\n\t\t\tscalar: new GraphQLScalarType({\n\t\t\t\t...baseGraphqlType.toConfig(),\n\t\t\t\tname,\n\t\t\t\tdescription: null,\n\t\t\t}),\n\t\t\tbase: baseType,\n\t\t}\n\t}\n\n\tpublic getType(column: Model.AnyColumn): GraphQLScalarType | GraphQLEnumType {\n\t\tif (column.typeAlias) {\n\t\t\tif (column.type === Model.ColumnType.Enum) {\n\t\t\t\tthrow new Error('GraphQL type alias cannot be specified for enum type')\n\t\t\t}\n\t\t\tconst { scalar, base } = this.aliasedTypes(column.typeAlias, column.type)\n\t\t\tif (base !== column.type) {\n\t\t\t\tthrow new Error('GraphQL type alias with different base type found')\n\t\t\t}\n\t\t\treturn scalar\n\t\t}\n\t\treturn this.resolveType(column)\n\t}\n\n\tprivate resolveType(column: Model.AnyColumn): GraphQLScalarType | GraphQLEnumType {\n\t\tswitch (column.type) {\n\t\t\tcase Model.ColumnType.Enum:\n\t\t\t\tif (this.enumsProvider.hasEnum(column.columnType)) {\n\t\t\t\t\treturn this.enumsProvider.getEnum(column.columnType)\n\t\t\t\t}\n\t\t\t\tthrow new Error(`Undefined enum ${column.columnType}`)\n\t\t\tdefault:\n\t\t\t\treturn this.getScalarType(column.type)\n\t\t}\n\t}\n\n\tpublic getScalarType(type: ScalarType): GraphQLScalarType {\n\t\tswitch (type) {\n\t\t\tcase Model.ColumnType.Int:\n\t\t\t\treturn GraphQLInt\n\t\t\tcase Model.ColumnType.String:\n\t\t\t\treturn GraphQLString\n\t\t\tcase Model.ColumnType.Uuid:\n\t\t\t\treturn this.customTypeProvider.uuidType\n\t\t\tcase Model.ColumnType.Double:\n\t\t\t\treturn GraphQLFloat\n\t\t\tcase Model.ColumnType.Bool:\n\t\t\t\treturn GraphQLBoolean\n\t\t\tcase Model.ColumnType.DateTime:\n\t\t\t\treturn this.customTypeProvider.dateTimeType\n\t\t\tcase Model.ColumnType.Date:\n\t\t\t\treturn this.customTypeProvider.dateType\n\t\t\tcase Model.ColumnType.Json:\n\t\t\t\treturn this.customTypeProvider.jsonType\n\t\t\tdefault:\n\t\t\t\t(({}: never): never => {\n\t\t\t\t\tthrow new ImplementationException('Invalid column type')\n\t\t\t\t})(type)\n\t\t}\n\t}\n}\n"],"names":["schema","singletonFactory","GraphQLScalarType","Model","GraphQLInt","GraphQLString","GraphQLFloat","GraphQLBoolean","ImplementationException"],"mappings":";;;;;;;;;;AASO,MAAM,mBAAmB;AAAA,EAQ/B,YACCA,SACA,eACiB,oBAChB;AADgB,SAAA,qBAAA;AAVV,kBAAA,MAAA,QAAA;AACA,kBAAA,MAAA,eAAA;AAER,kBAAA,MAAiB,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AAAA,MAChC,KAAKA,OAAAA,MAAM,WAAW;AACd,eAAAG;MACR,KAAKH,OAAAA,MAAM,WAAW;AACd,eAAAI;MACR,KAAKJ,OAAAA,MAAM,WAAW;AACrB,eAAO,KAAK,mBAAmB;AAAA,MAChC,KAAKA,OAAAA,MAAM,WAAW;AACrB,eAAO,KAAK,mBAAmB;AAAA,MAChC,KAAKA,OAAAA,MAAM,WAAW;AACrB,eAAO,KAAK,mBAAmB;AAAA,MAChC;AACE,SAAA,CAAC,CAAA,MAAqB;AAChB,gBAAA,IAAIK,UAAAA,wBAAwB,qBAAqB;AAAA,WACrD,IAAI;AAAA,IACT;AAAA,EACD;AACD;;"}
1
+ {"version":3,"file":"ColumnTypeResolver.cjs","sources":["../../../../../packages/engine-content-api/src/schema/ColumnTypeResolver.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLEnumType, GraphQLFloat, GraphQLInt, GraphQLScalarType, GraphQLString } from 'graphql'\nimport { Model } from '@contember/schema'\nimport { EnumsProvider } from './EnumsProvider'\nimport { CustomTypesProvider } from './CustomTypesProvider'\nimport { ImplementationException } from '../exception'\nimport { singletonFactory } from '../utils'\n\ntype ScalarType = Exclude<Model.ColumnType, Model.ColumnType.Enum>\n\nexport class ColumnTypeResolver {\n\tprivate schema: Model.Schema\n\tprivate enumsProvider: EnumsProvider\n\n\tprivate readonly aliasedTypes = singletonFactory<{ scalar: GraphQLScalarType; base: ScalarType }, string, ScalarType>(\n\t\tthis.createAliasedType.bind(this),\n\t)\n\n\tconstructor(\n\t\tschema: Model.Schema,\n\t\tenumsProvider: EnumsProvider,\n\t\tprivate readonly customTypeProvider: CustomTypesProvider,\n\t) {\n\t\tthis.schema = schema\n\t\tthis.enumsProvider = enumsProvider\n\t}\n\n\tprivate createAliasedType(name: string, baseType: ScalarType): { scalar: GraphQLScalarType; base: ScalarType } {\n\t\tconst baseGraphqlType = this.getScalarType(baseType)\n\t\treturn {\n\t\t\tscalar: new GraphQLScalarType({\n\t\t\t\t...baseGraphqlType.toConfig(),\n\t\t\t\tname,\n\t\t\t\tdescription: null,\n\t\t\t}),\n\t\t\tbase: baseType,\n\t\t}\n\t}\n\n\tpublic getType(column: Model.AnyColumn): GraphQLScalarType | GraphQLEnumType {\n\t\tif (column.typeAlias) {\n\t\t\tif (column.type === Model.ColumnType.Enum) {\n\t\t\t\tthrow new Error('GraphQL type alias cannot be specified for enum type')\n\t\t\t}\n\t\t\tconst { scalar, base } = this.aliasedTypes(column.typeAlias, column.type)\n\t\t\tif (base !== column.type) {\n\t\t\t\tthrow new Error('GraphQL type alias with different base type found')\n\t\t\t}\n\t\t\treturn scalar\n\t\t}\n\t\treturn this.resolveType(column)\n\t}\n\n\tprivate resolveType(column: Model.AnyColumn): GraphQLScalarType | GraphQLEnumType {\n\t\tswitch (column.type) {\n\t\t\tcase Model.ColumnType.Enum:\n\t\t\t\tif (this.enumsProvider.hasEnum(column.columnType)) {\n\t\t\t\t\treturn this.enumsProvider.getEnum(column.columnType)\n\t\t\t\t}\n\t\t\t\tthrow new Error(`Undefined enum ${column.columnType}`)\n\t\t\tdefault:\n\t\t\t\treturn this.getScalarType(column.type)\n\t\t}\n\t}\n\n\tpublic getScalarType(type: ScalarType): GraphQLScalarType {\n\t\tswitch (type) {\n\t\t\tcase Model.ColumnType.Int:\n\t\t\t\treturn GraphQLInt\n\t\t\tcase Model.ColumnType.String:\n\t\t\t\treturn GraphQLString\n\t\t\tcase Model.ColumnType.Uuid:\n\t\t\t\treturn this.customTypeProvider.uuidType\n\t\t\tcase Model.ColumnType.Double:\n\t\t\t\treturn GraphQLFloat\n\t\t\tcase Model.ColumnType.Bool:\n\t\t\t\treturn GraphQLBoolean\n\t\t\tcase Model.ColumnType.DateTime:\n\t\t\t\treturn this.customTypeProvider.dateTimeType\n\t\t\tcase Model.ColumnType.Date:\n\t\t\t\treturn this.customTypeProvider.dateType\n\t\t\tcase Model.ColumnType.Json:\n\t\t\t\treturn this.customTypeProvider.jsonType\n\t\t\tdefault:\n\t\t\t\t(({}: never): never => {\n\t\t\t\t\tthrow new ImplementationException('Invalid column type')\n\t\t\t\t})(type)\n\t\t}\n\t}\n}\n"],"names":["schema","singletonFactory","GraphQLScalarType","Model","GraphQLInt","GraphQLString","GraphQLFloat","GraphQLBoolean","ImplementationException"],"mappings":";;;;;;;;;;AASO,MAAM,mBAAmB;AAAA,EAQ/B,YACCA,SACA,eACiB,oBAChB;AADgB,SAAA,qBAAA;AAVV,kBAAA,MAAA,QAAA;AACA,kBAAA,MAAA,eAAA;AAER,kBAAA,MAAiB,gBAAeC,iBAAA;AAAA,MAC/B,KAAK,kBAAkB,KAAK,IAAI;AAAA,IAAA,CACjC;AAOC,SAAK,SAASD;AACd,SAAK,gBAAgB;AAAA,EAAA;AAAA,EAGd,kBAAkB,MAAc,UAAuE;AACxG,UAAA,kBAAkB,KAAK,cAAc,QAAQ;AAC5C,WAAA;AAAA,MACN,QAAQ,IAAIE,QAAAA,kBAAkB;AAAA,QAC7B,GAAG,gBAAgB,SAAS;AAAA,QAC5B;AAAA,QACA,aAAa;AAAA,MAAA,CACb;AAAA,MACD,MAAM;AAAA,IACP;AAAA,EAAA;AAAA,EAGM,QAAQ,QAA8D;AAC5E,QAAI,OAAO,WAAW;AACrB,UAAI,OAAO,SAASC,aAAM,WAAW,MAAM;AACpC,cAAA,IAAI,MAAM,sDAAsD;AAAA,MAAA;AAEjE,YAAA,EAAE,QAAQ,KAAK,IAAI,KAAK,aAAa,OAAO,WAAW,OAAO,IAAI;AACpE,UAAA,SAAS,OAAO,MAAM;AACnB,cAAA,IAAI,MAAM,mDAAmD;AAAA,MAAA;AAE7D,aAAA;AAAA,IAAA;AAED,WAAA,KAAK,YAAY,MAAM;AAAA,EAAA;AAAA,EAGvB,YAAY,QAA8D;AACjF,YAAQ,OAAO,MAAM;AAAA,MACpB,KAAKA,OAAAA,MAAM,WAAW;AACrB,YAAI,KAAK,cAAc,QAAQ,OAAO,UAAU,GAAG;AAClD,iBAAO,KAAK,cAAc,QAAQ,OAAO,UAAU;AAAA,QAAA;AAEpD,cAAM,IAAI,MAAM,kBAAkB,OAAO,UAAU,EAAE;AAAA,MACtD;AACQ,eAAA,KAAK,cAAc,OAAO,IAAI;AAAA,IAAA;AAAA,EACvC;AAAA,EAGM,cAAc,MAAqC;AACzD,YAAQ,MAAM;AAAA,MACb,KAAKA,OAAAA,MAAM,WAAW;AACd,eAAAC,QAAA;AAAA,MACR,KAAKD,OAAAA,MAAM,WAAW;AACd,eAAAE,QAAA;AAAA,MACR,KAAKF,OAAAA,MAAM,WAAW;AACrB,eAAO,KAAK,mBAAmB;AAAA,MAChC,KAAKA,OAAAA,MAAM,WAAW;AACd,eAAAG,QAAA;AAAA,MACR,KAAKH,OAAAA,MAAM,WAAW;AACd,eAAAI,QAAA;AAAA,MACR,KAAKJ,OAAAA,MAAM,WAAW;AACrB,eAAO,KAAK,mBAAmB;AAAA,MAChC,KAAKA,OAAAA,MAAM,WAAW;AACrB,eAAO,KAAK,mBAAmB;AAAA,MAChC,KAAKA,OAAAA,MAAM,WAAW;AACrB,eAAO,KAAK,mBAAmB;AAAA,MAChC;AACE,SAAA,CAAC,CAAA,MAAqB;AAChB,gBAAA,IAAIK,kCAAwB,qBAAqB;AAAA,WACrD,IAAI;AAAA,IAAA;AAAA,EACT;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnTypeResolver.js","sources":["../../../../../packages/engine-content-api/src/schema/ColumnTypeResolver.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLEnumType, GraphQLFloat, GraphQLInt, GraphQLScalarType, GraphQLString } from 'graphql'\nimport { Model } from '@contember/schema'\nimport { EnumsProvider } from './EnumsProvider'\nimport { CustomTypesProvider } from './CustomTypesProvider'\nimport { ImplementationException } from '../exception'\nimport { singletonFactory } from '../utils'\n\ntype ScalarType = Exclude<Model.ColumnType, Model.ColumnType.Enum>\n\nexport class ColumnTypeResolver {\n\tprivate schema: Model.Schema\n\tprivate enumsProvider: EnumsProvider\n\n\tprivate readonly aliasedTypes = singletonFactory<{ scalar: GraphQLScalarType; base: ScalarType }, string, ScalarType>(\n\t\tthis.createAliasedType.bind(this),\n\t)\n\n\tconstructor(\n\t\tschema: Model.Schema,\n\t\tenumsProvider: EnumsProvider,\n\t\tprivate readonly customTypeProvider: CustomTypesProvider,\n\t) {\n\t\tthis.schema = schema\n\t\tthis.enumsProvider = enumsProvider\n\t}\n\n\tprivate createAliasedType(name: string, baseType: ScalarType): { scalar: GraphQLScalarType; base: ScalarType } {\n\t\tconst baseGraphqlType = this.getScalarType(baseType)\n\t\treturn {\n\t\t\tscalar: new GraphQLScalarType({\n\t\t\t\t...baseGraphqlType.toConfig(),\n\t\t\t\tname,\n\t\t\t\tdescription: null,\n\t\t\t}),\n\t\t\tbase: baseType,\n\t\t}\n\t}\n\n\tpublic getType(column: Model.AnyColumn): GraphQLScalarType | GraphQLEnumType {\n\t\tif (column.typeAlias) {\n\t\t\tif (column.type === Model.ColumnType.Enum) {\n\t\t\t\tthrow new Error('GraphQL type alias cannot be specified for enum type')\n\t\t\t}\n\t\t\tconst { scalar, base } = this.aliasedTypes(column.typeAlias, column.type)\n\t\t\tif (base !== column.type) {\n\t\t\t\tthrow new Error('GraphQL type alias with different base type found')\n\t\t\t}\n\t\t\treturn scalar\n\t\t}\n\t\treturn this.resolveType(column)\n\t}\n\n\tprivate resolveType(column: Model.AnyColumn): GraphQLScalarType | GraphQLEnumType {\n\t\tswitch (column.type) {\n\t\t\tcase Model.ColumnType.Enum:\n\t\t\t\tif (this.enumsProvider.hasEnum(column.columnType)) {\n\t\t\t\t\treturn this.enumsProvider.getEnum(column.columnType)\n\t\t\t\t}\n\t\t\t\tthrow new Error(`Undefined enum ${column.columnType}`)\n\t\t\tdefault:\n\t\t\t\treturn this.getScalarType(column.type)\n\t\t}\n\t}\n\n\tpublic getScalarType(type: ScalarType): GraphQLScalarType {\n\t\tswitch (type) {\n\t\t\tcase Model.ColumnType.Int:\n\t\t\t\treturn GraphQLInt\n\t\t\tcase Model.ColumnType.String:\n\t\t\t\treturn GraphQLString\n\t\t\tcase Model.ColumnType.Uuid:\n\t\t\t\treturn this.customTypeProvider.uuidType\n\t\t\tcase Model.ColumnType.Double:\n\t\t\t\treturn GraphQLFloat\n\t\t\tcase Model.ColumnType.Bool:\n\t\t\t\treturn GraphQLBoolean\n\t\t\tcase Model.ColumnType.DateTime:\n\t\t\t\treturn this.customTypeProvider.dateTimeType\n\t\t\tcase Model.ColumnType.Date:\n\t\t\t\treturn this.customTypeProvider.dateType\n\t\t\tcase Model.ColumnType.Json:\n\t\t\t\treturn this.customTypeProvider.jsonType\n\t\t\tdefault:\n\t\t\t\t(({}: never): never => {\n\t\t\t\t\tthrow new ImplementationException('Invalid column type')\n\t\t\t\t})(type)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AASO,MAAM,mBAAmB;AAAA,EAQ/B,YACC,QACA,eACiB,oBAChB;AADgB,SAAA,qBAAA;AAVV,kBAAA,MAAA,QAAA;AACA,kBAAA,MAAA,eAAA;AAER,kBAAA,MAAiB,gBAAe;AAAA,MAC/B,KAAK,kBAAkB,KAAK,IAAI;AAAA,IAAA,CACjC;AAOC,SAAK,SAAS;AACd,SAAK,gBAAgB;AAAA,EACtB;AAAA,EAEQ,kBAAkB,MAAc,UAAuE;AACxG,UAAA,kBAAkB,KAAK,cAAc,QAAQ;AAC5C,WAAA;AAAA,MACN,QAAQ,IAAI,kBAAkB;AAAA,QAC7B,GAAG,gBAAgB,SAAS;AAAA,QAC5B;AAAA,QACA,aAAa;AAAA,MAAA,CACb;AAAA,MACD,MAAM;AAAA,IAAA;AAAA,EAER;AAAA,EAEO,QAAQ,QAA8D;AAC5E,QAAI,OAAO,WAAW;AACrB,UAAI,OAAO,SAAS,MAAM,WAAW,MAAM;AACpC,cAAA,IAAI,MAAM,sDAAsD;AAAA,MACvE;AACM,YAAA,EAAE,QAAQ,KAAK,IAAI,KAAK,aAAa,OAAO,WAAW,OAAO,IAAI;AACpE,UAAA,SAAS,OAAO,MAAM;AACnB,cAAA,IAAI,MAAM,mDAAmD;AAAA,MACpE;AACO,aAAA;AAAA,IACR;AACO,WAAA,KAAK,YAAY,MAAM;AAAA,EAC/B;AAAA,EAEQ,YAAY,QAA8D;AACjF,YAAQ,OAAO,MAAM;AAAA,MACpB,KAAK,MAAM,WAAW;AACrB,YAAI,KAAK,cAAc,QAAQ,OAAO,UAAU,GAAG;AAClD,iBAAO,KAAK,cAAc,QAAQ,OAAO,UAAU;AAAA,QACpD;AACA,cAAM,IAAI,MAAM,kBAAkB,OAAO,UAAU,EAAE;AAAA,MACtD;AACQ,eAAA,KAAK,cAAc,OAAO,IAAI;AAAA,IACvC;AAAA,EACD;AAAA,EAEO,cAAc,MAAqC;AACzD,YAAQ,MAAM;AAAA,MACb,KAAK,MAAM,WAAW;AACd,eAAA;AAAA,MACR,KAAK,MAAM,WAAW;AACd,eAAA;AAAA,MACR,KAAK,MAAM,WAAW;AACrB,eAAO,KAAK,mBAAmB;AAAA,MAChC,KAAK,MAAM,WAAW;AACd,eAAA;AAAA,MACR,KAAK,MAAM,WAAW;AACd,eAAA;AAAA,MACR,KAAK,MAAM,WAAW;AACrB,eAAO,KAAK,mBAAmB;AAAA,MAChC,KAAK,MAAM,WAAW;AACrB,eAAO,KAAK,mBAAmB;AAAA,MAChC,KAAK,MAAM,WAAW;AACrB,eAAO,KAAK,mBAAmB;AAAA,MAChC;AACE,SAAA,CAAC,CAAA,MAAqB;AAChB,gBAAA,IAAI,wBAAwB,qBAAqB;AAAA,WACrD,IAAI;AAAA,IACT;AAAA,EACD;AACD;"}
1
+ {"version":3,"file":"ColumnTypeResolver.js","sources":["../../../../../packages/engine-content-api/src/schema/ColumnTypeResolver.ts"],"sourcesContent":["import { GraphQLBoolean, GraphQLEnumType, GraphQLFloat, GraphQLInt, GraphQLScalarType, GraphQLString } from 'graphql'\nimport { Model } from '@contember/schema'\nimport { EnumsProvider } from './EnumsProvider'\nimport { CustomTypesProvider } from './CustomTypesProvider'\nimport { ImplementationException } from '../exception'\nimport { singletonFactory } from '../utils'\n\ntype ScalarType = Exclude<Model.ColumnType, Model.ColumnType.Enum>\n\nexport class ColumnTypeResolver {\n\tprivate schema: Model.Schema\n\tprivate enumsProvider: EnumsProvider\n\n\tprivate readonly aliasedTypes = singletonFactory<{ scalar: GraphQLScalarType; base: ScalarType }, string, ScalarType>(\n\t\tthis.createAliasedType.bind(this),\n\t)\n\n\tconstructor(\n\t\tschema: Model.Schema,\n\t\tenumsProvider: EnumsProvider,\n\t\tprivate readonly customTypeProvider: CustomTypesProvider,\n\t) {\n\t\tthis.schema = schema\n\t\tthis.enumsProvider = enumsProvider\n\t}\n\n\tprivate createAliasedType(name: string, baseType: ScalarType): { scalar: GraphQLScalarType; base: ScalarType } {\n\t\tconst baseGraphqlType = this.getScalarType(baseType)\n\t\treturn {\n\t\t\tscalar: new GraphQLScalarType({\n\t\t\t\t...baseGraphqlType.toConfig(),\n\t\t\t\tname,\n\t\t\t\tdescription: null,\n\t\t\t}),\n\t\t\tbase: baseType,\n\t\t}\n\t}\n\n\tpublic getType(column: Model.AnyColumn): GraphQLScalarType | GraphQLEnumType {\n\t\tif (column.typeAlias) {\n\t\t\tif (column.type === Model.ColumnType.Enum) {\n\t\t\t\tthrow new Error('GraphQL type alias cannot be specified for enum type')\n\t\t\t}\n\t\t\tconst { scalar, base } = this.aliasedTypes(column.typeAlias, column.type)\n\t\t\tif (base !== column.type) {\n\t\t\t\tthrow new Error('GraphQL type alias with different base type found')\n\t\t\t}\n\t\t\treturn scalar\n\t\t}\n\t\treturn this.resolveType(column)\n\t}\n\n\tprivate resolveType(column: Model.AnyColumn): GraphQLScalarType | GraphQLEnumType {\n\t\tswitch (column.type) {\n\t\t\tcase Model.ColumnType.Enum:\n\t\t\t\tif (this.enumsProvider.hasEnum(column.columnType)) {\n\t\t\t\t\treturn this.enumsProvider.getEnum(column.columnType)\n\t\t\t\t}\n\t\t\t\tthrow new Error(`Undefined enum ${column.columnType}`)\n\t\t\tdefault:\n\t\t\t\treturn this.getScalarType(column.type)\n\t\t}\n\t}\n\n\tpublic getScalarType(type: ScalarType): GraphQLScalarType {\n\t\tswitch (type) {\n\t\t\tcase Model.ColumnType.Int:\n\t\t\t\treturn GraphQLInt\n\t\t\tcase Model.ColumnType.String:\n\t\t\t\treturn GraphQLString\n\t\t\tcase Model.ColumnType.Uuid:\n\t\t\t\treturn this.customTypeProvider.uuidType\n\t\t\tcase Model.ColumnType.Double:\n\t\t\t\treturn GraphQLFloat\n\t\t\tcase Model.ColumnType.Bool:\n\t\t\t\treturn GraphQLBoolean\n\t\t\tcase Model.ColumnType.DateTime:\n\t\t\t\treturn this.customTypeProvider.dateTimeType\n\t\t\tcase Model.ColumnType.Date:\n\t\t\t\treturn this.customTypeProvider.dateType\n\t\t\tcase Model.ColumnType.Json:\n\t\t\t\treturn this.customTypeProvider.jsonType\n\t\t\tdefault:\n\t\t\t\t(({}: never): never => {\n\t\t\t\t\tthrow new ImplementationException('Invalid column type')\n\t\t\t\t})(type)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AASO,MAAM,mBAAmB;AAAA,EAQ/B,YACC,QACA,eACiB,oBAChB;AADgB,SAAA,qBAAA;AAVV,kBAAA,MAAA,QAAA;AACA,kBAAA,MAAA,eAAA;AAER,kBAAA,MAAiB,gBAAe;AAAA,MAC/B,KAAK,kBAAkB,KAAK,IAAI;AAAA,IAAA,CACjC;AAOC,SAAK,SAAS;AACd,SAAK,gBAAgB;AAAA,EAAA;AAAA,EAGd,kBAAkB,MAAc,UAAuE;AACxG,UAAA,kBAAkB,KAAK,cAAc,QAAQ;AAC5C,WAAA;AAAA,MACN,QAAQ,IAAI,kBAAkB;AAAA,QAC7B,GAAG,gBAAgB,SAAS;AAAA,QAC5B;AAAA,QACA,aAAa;AAAA,MAAA,CACb;AAAA,MACD,MAAM;AAAA,IACP;AAAA,EAAA;AAAA,EAGM,QAAQ,QAA8D;AAC5E,QAAI,OAA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../../../../../packages/engine-content-api/src/schema/ConditionTypeProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLScalarType,\n\tGraphQLString,\n} from 'graphql'\nimport { singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { GqlTypeName } from './utils'\n\nexport class ConditionTypeProvider {\n\tprivate conditions = singletonFactory<GraphQLInputObjectType, string, GraphQLScalarType | GraphQLEnumType>(\n\t\t(name, type) => this.createCondition(type),\n\t)\n\n\tconstructor(private readonly columnTypeResolver: ColumnTypeResolver) {}\n\n\tpublic getCondition(column: Model.AnyColumn): GraphQLInputObjectType {\n\t\tconst basicType = this.columnTypeResolver.getType(column)\n\t\treturn this.conditions(basicType.name, basicType)\n\t}\n\n\tprivate createCondition(type: GraphQLScalarType | GraphQLEnumType): GraphQLInputObjectType {\n\t\tconst suffix =\n\t\t\ttypeof type === 'object' && type.constructor && type.constructor.name === 'GraphQLEnumType' ? 'Enum' : ''\n\t\tconst condition: GraphQLInputObjectType = new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${type.name}${suffix}Condition`,\n\t\t\tfields: (): GraphQLInputFieldConfigMap => {\n\t\t\t\tconst conditions: GraphQLInputFieldConfigMap = {\n\t\t\t\t\tand: { type: new GraphQLList(new GraphQLNonNull(condition)) },\n\t\t\t\t\tor: { type: new GraphQLList(new GraphQLNonNull(condition)) },\n\t\t\t\t\tnot: { type: condition },\n\n\t\t\t\t\tnull: { type: GraphQLBoolean },\n\t\t\t\t\tisNull: { type: GraphQLBoolean },\n\t\t\t\t}\n\t\t\t\tif (type.name !== 'Json') {\n\t\t\t\t\tconditions.eq = { type }\n\t\t\t\t\tconditions.notEq = { type }\n\t\t\t\t\tconditions.in = { type: new GraphQLList(new GraphQLNonNull(type)) }\n\t\t\t\t\tconditions.notIn = { type: new GraphQLList(new GraphQLNonNull(type)) }\n\t\t\t\t\tconditions.lt = { type: type }\n\t\t\t\t\tconditions.lte = { type: type }\n\t\t\t\t\tconditions.gt = { type: type }\n\t\t\t\t\tconditions.gte = { type: type }\n\t\t\t\t}\n\t\t\t\tif (type.name === 'String') {\n\t\t\t\t\tconditions.contains = { type: GraphQLString }\n\t\t\t\t\tconditions.startsWith = { type: GraphQLString }\n\t\t\t\t\tconditions.endsWith = { type: GraphQLString }\n\n\t\t\t\t\tconditions.containsCI = { type: GraphQLString }\n\t\t\t\t\tconditions.startsWithCI = { type: GraphQLString }\n\t\t\t\t\tconditions.endsWithCI = { type: GraphQLString }\n\t\t\t\t}\n\t\t\t\treturn conditions\n\t\t\t},\n\t\t})\n\t\treturn condition\n\t}\n}\n"],"names":["singletonFactory","GraphQLInputObjectType","GqlTypeName","GraphQLList","GraphQLNonNull","GraphQLBoolean","GraphQLString"],"mappings":";;;;;;;;;AAeO,MAAM,sBAAsB;AAAA,EAKlC,YAA6B,oBAAwC;AAAxC,SAAA,qBAAA;AAJ7B,kBAAA,MAAQ,cAAaA,iBAAA;AAAA,MACpB,CAAC,MAAM,SAAS,KAAK,gBAAgB,IAAI;AAAA,IAAA,CAC1C;AAAA,EAEsE;AAAA,EAE/D,aAAa,QAAiD;AACpE,UAAM,YAAY,KAAK,mBAAmB,QAAQ,MAAM;AACxD,WAAO,KAAK,WAAW,UAAU,MAAM,SAAS;AAAA,EACjD;AAAA,EAEQ,gBAAgB,MAAmE;AACpF,UAAA,SACL,OAAO,SAAS,YAAY,KAAK,eAAe,KAAK,YAAY,SAAS,oBAAoB,SAAS;AAClG,UAAA,YAAoC,IAAIC,+BAAuB;AAAA,MACpE,MAAMC,MAAA,cAAc,KAAK,IAAI,GAAG,MAAM;AAAA,MACtC,QAAQ,MAAkC;AACzC,cAAM,aAAyC;AAAA,UAC9C,KAAK,EAAE,MAAM,IAAIC,QAAAA,YAAY,IAAIC,QAAA,eAAe,SAAS,CAAC,EAAE;AAAA,UAC5D,IAAI,EAAE,MAAM,IAAID,QAAAA,YAAY,IAAIC,QAAA,eAAe,SAAS,CAAC,EAAE;AAAA,UAC3D,KAAK,EAAE,MAAM,UAAU;AAAA,UAEvB,MAAM,EAAE,MAAMC,uBAAe;AAAA,UAC7B,QAAQ,EAAE,MAAMA,uBAAe;AAAA,QAAA;AAE5B,YAAA,KAAK,SAAS,QAAQ;AACd,qBAAA,KAAK,EAAE;AACP,qBAAA,QAAQ,EAAE;AACV,qBAAA,KAAK,EAAE,MAAM,IAAIF,oBAAY,IAAIC,QAAA,eAAe,IAAI,CAAC;AACrD,qBAAA,QAAQ,EAAE,MAAM,IAAID,oBAAY,IAAIC,QAAA,eAAe,IAAI,CAAC;AACxD,qBAAA,KAAK,EAAE;AACP,qBAAA,MAAM,EAAE;AACR,qBAAA,KAAK,EAAE;AACP,qBAAA,MAAM,EAAE;QACpB;AACI,YAAA,KAAK,SAAS,UAAU;AAChB,qBAAA,WAAW,EAAE,MAAME,QAAc,cAAA;AACjC,qBAAA,aAAa,EAAE,MAAMA,QAAc,cAAA;AACnC,qBAAA,WAAW,EAAE,MAAMA,QAAc,cAAA;AAEjC,qBAAA,aAAa,EAAE,MAAMA,QAAc,cAAA;AACnC,qBAAA,eAAe,EAAE,MAAMA,QAAc,cAAA;AACrC,qBAAA,aAAa,EAAE,MAAMA,QAAc,cAAA;AAAA,QAC/C;AACO,eAAA;AAAA,MACR;AAAA,IAAA,CACA;AACM,WAAA;AAAA,EACR;AACD;;"}
1
+ {"version":3,"file":"ConditionTypeProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/ConditionTypeProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLScalarType,\n\tGraphQLString,\n} from 'graphql'\nimport { singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { GqlTypeName } from './utils'\n\nexport class ConditionTypeProvider {\n\tprivate conditions = singletonFactory<GraphQLInputObjectType, string, GraphQLScalarType | GraphQLEnumType>(\n\t\t(name, type) => this.createCondition(type),\n\t)\n\n\tconstructor(private readonly columnTypeResolver: ColumnTypeResolver) {}\n\n\tpublic getCondition(column: Model.AnyColumn): GraphQLInputObjectType {\n\t\tconst basicType = this.columnTypeResolver.getType(column)\n\t\treturn this.conditions(basicType.name, basicType)\n\t}\n\n\tprivate createCondition(type: GraphQLScalarType | GraphQLEnumType): GraphQLInputObjectType {\n\t\tconst suffix =\n\t\t\ttypeof type === 'object' && type.constructor && type.constructor.name === 'GraphQLEnumType' ? 'Enum' : ''\n\t\tconst condition: GraphQLInputObjectType = new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${type.name}${suffix}Condition`,\n\t\t\tfields: (): GraphQLInputFieldConfigMap => {\n\t\t\t\tconst conditions: GraphQLInputFieldConfigMap = {\n\t\t\t\t\tand: { type: new GraphQLList(new GraphQLNonNull(condition)) },\n\t\t\t\t\tor: { type: new GraphQLList(new GraphQLNonNull(condition)) },\n\t\t\t\t\tnot: { type: condition },\n\n\t\t\t\t\tnull: { type: GraphQLBoolean },\n\t\t\t\t\tisNull: { type: GraphQLBoolean },\n\t\t\t\t}\n\t\t\t\tif (type.name !== 'Json') {\n\t\t\t\t\tconditions.eq = { type }\n\t\t\t\t\tconditions.notEq = { type }\n\t\t\t\t\tconditions.in = { type: new GraphQLList(new GraphQLNonNull(type)) }\n\t\t\t\t\tconditions.notIn = { type: new GraphQLList(new GraphQLNonNull(type)) }\n\t\t\t\t\tconditions.lt = { type: type }\n\t\t\t\t\tconditions.lte = { type: type }\n\t\t\t\t\tconditions.gt = { type: type }\n\t\t\t\t\tconditions.gte = { type: type }\n\t\t\t\t}\n\t\t\t\tif (type.name === 'String') {\n\t\t\t\t\tconditions.contains = { type: GraphQLString }\n\t\t\t\t\tconditions.startsWith = { type: GraphQLString }\n\t\t\t\t\tconditions.endsWith = { type: GraphQLString }\n\n\t\t\t\t\tconditions.containsCI = { type: GraphQLString }\n\t\t\t\t\tconditions.startsWithCI = { type: GraphQLString }\n\t\t\t\t\tconditions.endsWithCI = { type: GraphQLString }\n\t\t\t\t}\n\t\t\t\treturn conditions\n\t\t\t},\n\t\t})\n\t\treturn condition\n\t}\n}\n"],"names":["singletonFactory","GraphQLInputObjectType","GqlTypeName","GraphQLList","GraphQLNonNull","GraphQLBoolean","GraphQLString"],"mappings":";;;;;;;;;AAeO,MAAM,sBAAsB;AAAA,EAKlC,YAA6B,oBAAwC;AAAxC,SAAA,qBAAA;AAJ7B,kBAAA,MAAQ,cAAaA,iBAAA;AAAA,MACpB,CAAC,MAAM,SAAS,KAAK,gBAAgB,IAAI;AAAA,IAAA,CAC1C;AAAA,EAAA;AAAA,EAIO,aAAa,QAAiD;AACpE,UAAM,YAAY,KAAK,mBAAmB,QAAQ,MAAM;AACxD,WAAO,KAAK,WAAW,UAAU,MAAM,SAAS;AAAA,EAAA;AAAA,EAGzC,gBAAgB,MAAmE;AACpF,UAAA,SACL,OAAO,SAAS,YAAY,KAAK,eAAe,KAAK,YAAY,SAAS,oBAAoB,SAAS;AAClG,UAAA,YAAoC,IAAIC,+BAAuB;AAAA,MACpE,MAAMC,MAAA,cAAc,KAAK,IAAI,GAAG,MAAM;AAAA,MACtC,QAAQ,MAAkC;AACzC,cAAM,aAAyC;AAAA,UAC9C,KAAK,EAAE,MAAM,IAAIC,QAAAA,YAAY,IAAIC,QAAA,eAAe,SAAS,CAAC,EAAE;AAAA,UAC5D,IAAI,EAAE,MAAM,IAAID,QAAAA,YAAY,IAAIC,QAAA,eAAe,SAAS,CAAC,EAAE;AAAA,UAC3D,KAAK,EAAE,MAAM,UAAU;AAAA,UAEvB,MAAM,EAAE,MAAMC,uBAAe;AAAA,UAC7B,QAAQ,EAAE,MAAMA,QAAe,eAAA;AAAA,QAChC;AACI,YAAA,KAAK,SAAS,QAAQ;AACd,qBAAA,KAAK,EAAE,KAAK;AACZ,qBAAA,QAAQ,EAAE,KAAK;AACf,qBAAA,KAAK,EAAE,MAAM,IAAIF,oBAAY,IAAIC,QAAA,eAAe,IAAI,CAAC,EAAE;AACvD,qBAAA,QAAQ,EAAE,MAAM,IAAID,oBAAY,IAAIC,QAAA,eAAe,IAAI,CAAC,EAAE;AAC1D,qBAAA,KAAK,EAAE,KAAW;AAClB,qBAAA,MAAM,EAAE,KAAW;AACnB,qBAAA,KAAK,EAAE,KAAW;AAClB,qBAAA,MAAM,EAAE,KAAW;AAAA,QAAA;AAE3B,YAAA,KAAK,SAAS,UAAU;AAChB,qBAAA,WAAW,EAAE,MAAME,sBAAc;AACjC,qBAAA,aAAa,EAAE,MAAMA,sBAAc;AACnC,qBAAA,WAAW,EAAE,MAAMA,sBAAc;AAEjC,qBAAA,aAAa,EAAE,MAAMA,sBAAc;AACnC,qBAAA,eAAe,EAAE,MAAMA,sBAAc;AACrC,qBAAA,aAAa,EAAE,MAAMA,sBAAc;AAAA,QAAA;AAExC,eAAA;AAAA,MAAA;AAAA,IACR,CACA;AACM,WAAA;AAAA,EAAA;AAET;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConditionTypeProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/ConditionTypeProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLScalarType,\n\tGraphQLString,\n} from 'graphql'\nimport { singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { GqlTypeName } from './utils'\n\nexport class ConditionTypeProvider {\n\tprivate conditions = singletonFactory<GraphQLInputObjectType, string, GraphQLScalarType | GraphQLEnumType>(\n\t\t(name, type) => this.createCondition(type),\n\t)\n\n\tconstructor(private readonly columnTypeResolver: ColumnTypeResolver) {}\n\n\tpublic getCondition(column: Model.AnyColumn): GraphQLInputObjectType {\n\t\tconst basicType = this.columnTypeResolver.getType(column)\n\t\treturn this.conditions(basicType.name, basicType)\n\t}\n\n\tprivate createCondition(type: GraphQLScalarType | GraphQLEnumType): GraphQLInputObjectType {\n\t\tconst suffix =\n\t\t\ttypeof type === 'object' && type.constructor && type.constructor.name === 'GraphQLEnumType' ? 'Enum' : ''\n\t\tconst condition: GraphQLInputObjectType = new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${type.name}${suffix}Condition`,\n\t\t\tfields: (): GraphQLInputFieldConfigMap => {\n\t\t\t\tconst conditions: GraphQLInputFieldConfigMap = {\n\t\t\t\t\tand: { type: new GraphQLList(new GraphQLNonNull(condition)) },\n\t\t\t\t\tor: { type: new GraphQLList(new GraphQLNonNull(condition)) },\n\t\t\t\t\tnot: { type: condition },\n\n\t\t\t\t\tnull: { type: GraphQLBoolean },\n\t\t\t\t\tisNull: { type: GraphQLBoolean },\n\t\t\t\t}\n\t\t\t\tif (type.name !== 'Json') {\n\t\t\t\t\tconditions.eq = { type }\n\t\t\t\t\tconditions.notEq = { type }\n\t\t\t\t\tconditions.in = { type: new GraphQLList(new GraphQLNonNull(type)) }\n\t\t\t\t\tconditions.notIn = { type: new GraphQLList(new GraphQLNonNull(type)) }\n\t\t\t\t\tconditions.lt = { type: type }\n\t\t\t\t\tconditions.lte = { type: type }\n\t\t\t\t\tconditions.gt = { type: type }\n\t\t\t\t\tconditions.gte = { type: type }\n\t\t\t\t}\n\t\t\t\tif (type.name === 'String') {\n\t\t\t\t\tconditions.contains = { type: GraphQLString }\n\t\t\t\t\tconditions.startsWith = { type: GraphQLString }\n\t\t\t\t\tconditions.endsWith = { type: GraphQLString }\n\n\t\t\t\t\tconditions.containsCI = { type: GraphQLString }\n\t\t\t\t\tconditions.startsWithCI = { type: GraphQLString }\n\t\t\t\t\tconditions.endsWithCI = { type: GraphQLString }\n\t\t\t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A,KAAK,SAAS,UAAU;AAChB,qBAAA,WAAW,EAAE,MAAM,cAAc;AACjC,qBAAA,aAAa,EAAE,MAAM,cAAc;AACnC,qBAAA,WAAW,EAAE,MAAM,cAAc;AAEjC,qBAAA,aAAa,EAAE,MAAM,cAAc;AACnC,qBAAA,eAAe,EAAE,MAAM,cAAc;AACrC,qBAAA,aAAa,EAAE,MAAM,cAAc;AAAA,QAC/C;AACO,eAAA;AAAA,MACR;AAAA,IAAA,CACA;AACM,WAAA;AAAA,EACR;AACD;"}
1
+ {"version":3,"file":"ConditionTypeProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/ConditionTypeProvider.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport {\n\tGraphQLBoolean,\n\tGraphQLEnumType,\n\tGraphQLInputFieldConfigMap,\n\tGraphQLInputObjectType,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLScalarType,\n\tGraphQLString,\n} from 'graphql'\nimport { singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { GqlTypeName } from './utils'\n\nexport class ConditionTypeProvider {\n\tprivate conditions = singletonFactory<GraphQLInputObjectType, string, GraphQLScalarType | GraphQLEnumType>(\n\t\t(name, type) => this.createCondition(type),\n\t)\n\n\tconstructor(private readonly columnTypeResolver: ColumnTypeResolver) {}\n\n\tpublic getCondition(column: Model.AnyColumn): GraphQLInputObjectType {\n\t\tconst basicType = this.columnTypeResolver.getType(column)\n\t\treturn this.conditions(basicType.name, basicType)\n\t}\n\n\tprivate createCondition(type: GraphQLScalarType | GraphQLEnumType): GraphQLInputObjectType {\n\t\tconst suffix =\n\t\t\ttypeof type === 'object' && type.constructor && type.constructor.name === 'GraphQLEnumType' ? 'Enum' : ''\n\t\tconst condition: GraphQLInputObjectType = new GraphQLInputObjectType({\n\t\t\tname: GqlTypeName`${type.name}${suffix}Condition`,\n\t\t\tfields: (): GraphQLInputFieldConfigMap => {\n\t\t\t\tconst conditions: GraphQLInputFieldConfigMap = {\n\t\t\t\t\tand: { type: new GraphQLList(new GraphQLNonNull(condition)) },\n\t\t\t\t\tor: { type: new GraphQLList(new GraphQLNonNull(condition)) },\n\t\t\t\t\tnot: { type: condition },\n\n\t\t\t\t\tnull: { type: GraphQLBoolean },\n\t\t\t\t\tisNull: { type: GraphQLBoolean },\n\t\t\t\t}\n\t\t\t\tif (type.name !== 'Json') {\n\t\t\t\t\tconditions.eq = { type }\n\t\t\t\t\tconditions.notEq = { type }\n\t\t\t\t\tconditions.in = { type: new GraphQLList(new GraphQLNonNull(type)) }\n\t\t\t\t\tconditions.notIn = { type: new GraphQLList(new GraphQLNonNull(type)) }\n\t\t\t\t\tconditions.lt = { type: type }\n\t\t\t\t\tconditions.lte = { type: type }\n\t\t\t\t\tconditions.gt = { type: type }\n\t\t\t\t\tconditions.gte = { type: type }\n\t\t\t\t}\n\t\t\t\tif (type.name === 'String') {\n\t\t\t\t\tconditions.contains = { type: GraphQLString }\n\t\t\t\t\tconditions.startsWith = { type: GraphQLString }\n\t\t\t\t\tconditions.endsWith = { type: GraphQLString }\n\n\t\t\t\t\tconditions.containsCI = { type: GraphQLString }\n\t\t\t\t\tconditions.startsWithCI = { type: GraphQLString }\n\t\t\t\t\tconditions.endsWithCI = { type: GraphQLString }\n\t\t\t\t}\n\t\t\t\treturn conditions\n\t\t\t},\n\t\t})\n\t\treturn condition\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAeO,MAAM,sBAAsB;AAAA,EAKlC,YAA6B,oBAAwC;AAAxC,SAAA,qBAAA;AAJ7B,kBAAA,MAAQ,cAAa;AAAA,MACpB,CAAC,MAAM,SAAS,KAAK,gBAAgB,IAAI;AAAA,IAAA,CAC1C;AAAA,EAAA;AAAA,EAIO,aAAa,QAAiD;AACpE,UAAM,YAAY,KAAK,mBAAmB,QAAQ,MAAM;AACxD,WAAO,KAAK,WAAW,UAAU,MAAM,SAAS;AAAA,EAAA;AAAA,EAGzC,gBAAgB,MAAmE;AACpF,UAA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","sources":["../../../../../packages/engine-content-api/src/schema/CustomTypesProvider.ts"],"sourcesContent":["import { GraphQLScalarType, Kind } from 'graphql'\nimport { JSONType, UuidType } from '@contember/graphql-utils'\n\n\nexport class CustomTypesProvider {\n\tpublic readonly uuidType: GraphQLScalarType = UuidType\n\n\t//todo: implement serialize, parseValue and parseLiteral properly\n\tpublic readonly dateType: GraphQLScalarType = new GraphQLScalarType({\n\t\tname: 'Date',\n\t\tserialize: str => String(str),\n\t\tparseValue: str => String(str),\n\t\tparseLiteral: function parseLiteral(ast) {\n\t\t\treturn ast.kind === Kind.STRING ? ast.value : undefined\n\t\t},\n\t})\n\tpublic readonly dateTimeType: GraphQLScalarType = new GraphQLScalarType({\n\t\tname: 'DateTime',\n\t\tserialize: str => String(str),\n\t\tparseValue: str => String(str),\n\t\tparseLiteral: function parseLiteral(ast) {\n\t\t\treturn ast.kind === Kind.STRING ? ast.value : undefined\n\t\t},\n\t})\n\tpublic readonly jsonType: GraphQLScalarType = JSONType\n}\n"],"names":["UuidType","GraphQLScalarType","Kind","JSONType"],"mappings":";;;;;;;AAIO,MAAM,oBAAoB;AAAA,EAA1B,cAAA;AACN,kBAAA,MAAgB,YAA8BA,aAAAA,QAAA;AAG9B,kBAAA,MAAA,YAA8B,IAAIC,0BAAkB;AAAA,MACnE,MAAM;AAAA,MACN,WAAW,CAAO,QAAA,OAAO,GAAG;AAAA,MAC5B,YAAY,CAAO,QAAA,OAAO,GAAG;AAAA,MAC7B,cAAc,SAAS,aAAa,KAAK;AACxC,eAAO,IAAI,SAASC,QAAK,KAAA,SAAS,IAAI,QAAQ;AAAA,MAC/C;AAAA,IACA,CAAA,CAAA;AACe,kBAAA,MAAA,gBAAkC,IAAID,0BAAkB;AAAA,MACvE,MAAM;AAAA,MACN,WAAW,CAAO,QAAA,OAAO,GAAG;AAAA,MAC5B,YAAY,CAAO,QAAA,OAAO,GAAG;AAAA,MAC7B,cAAc,SAAS,aAAa,KAAK;AACxC,eAAO,IAAI,SAASC,QAAK,KAAA,SAAS,IAAI,QAAQ;AAAA,MAC/C;AAAA,IACA,CAAA,CAAA;AACD,kBAAA,MAAgB,YAA8BC,aAAAA,QAAA;AAAA,EAAA;AAC/C;;"}
1
+ {"version":3,"file":"CustomTypesProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/CustomTypesProvider.ts"],"sourcesContent":["import { GraphQLScalarType, Kind } from 'graphql'\nimport { JSONType, UuidType } from '@contember/graphql-utils'\n\n\nexport class CustomTypesProvider {\n\tpublic readonly uuidType: GraphQLScalarType = UuidType\n\n\t//todo: implement serialize, parseValue and parseLiteral properly\n\tpublic readonly dateType: GraphQLScalarType = new GraphQLScalarType({\n\t\tname: 'Date',\n\t\tserialize: str => String(str),\n\t\tparseValue: str => String(str),\n\t\tparseLiteral: function parseLiteral(ast) {\n\t\t\treturn ast.kind === Kind.STRING ? ast.value : undefined\n\t\t},\n\t})\n\tpublic readonly dateTimeType: GraphQLScalarType = new GraphQLScalarType({\n\t\tname: 'DateTime',\n\t\tserialize: str => String(str),\n\t\tparseValue: str => String(str),\n\t\tparseLiteral: function parseLiteral(ast) {\n\t\t\treturn ast.kind === Kind.STRING ? ast.value : undefined\n\t\t},\n\t})\n\tpublic readonly jsonType: GraphQLScalarType = JSONType\n}\n"],"names":["UuidType","GraphQLScalarType","Kind","JSONType"],"mappings":";;;;;;;AAIO,MAAM,oBAAoB;AAAA,EAA1B,cAAA;AACN,kBAAA,MAAgB,YAA8BA,qBAAA;AAG9B,kBAAA,MAAA,YAA8B,IAAIC,0BAAkB;AAAA,MACnE,MAAM;AAAA,MACN,WAAW,CAAO,QAAA,OAAO,GAAG;AAAA,MAC5B,YAAY,CAAO,QAAA,OAAO,GAAG;AAAA,MAC7B,cAAc,SAAS,aAAa,KAAK;AACxC,eAAO,IAAI,SAASC,QAAK,KAAA,SAAS,IAAI,QAAQ;AAAA,MAAA;AAAA,IAC/C,CACA,CAAA;AACe,kBAAA,MAAA,gBAAkC,IAAID,0BAAkB;AAAA,MACvE,MAAM;AAAA,MACN,WAAW,CAAO,QAAA,OAAO,GAAG;AAAA,MAC5B,YAAY,CAAO,QAAA,OAAO,GAAG;AAAA,MAC7B,cAAc,SAAS,aAAa,KAAK;AACxC,eAAO,IAAI,SAASC,QAAK,KAAA,SAAS,IAAI,QAAQ;AAAA,MAAA;AAAA,IAC/C,CACA,CAAA;AACD,kBAAA,MAAgB,YAA8BC,qBAAA;AAAA,EAAA;AAC/C;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CustomTypesProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/CustomTypesProvider.ts"],"sourcesContent":["import { GraphQLScalarType, Kind } from 'graphql'\nimport { JSONType, UuidType } from '@contember/graphql-utils'\n\n\nexport class CustomTypesProvider {\n\tpublic readonly uuidType: GraphQLScalarType = UuidType\n\n\t//todo: implement serialize, parseValue and parseLiteral properly\n\tpublic readonly dateType: GraphQLScalarType = new GraphQLScalarType({\n\t\tname: 'Date',\n\t\tserialize: str => String(str),\n\t\tparseValue: str => String(str),\n\t\tparseLiteral: function parseLiteral(ast) {\n\t\t\treturn ast.kind === Kind.STRING ? ast.value : undefined\n\t\t},\n\t})\n\tpublic readonly dateTimeType: GraphQLScalarType = new GraphQLScalarType({\n\t\tname: 'DateTime',\n\t\tserialize: str => String(str),\n\t\tparseValue: str => String(str),\n\t\tparseLiteral: function parseLiteral(ast) {\n\t\t\treturn ast.kind === Kind.STRING ? ast.value : undefined\n\t\t},\n\t})\n\tpublic readonly jsonType: GraphQLScalarType = JSONType\n}\n"],"names":[],"mappings":";;;;;AAIO,MAAM,oBAAoB;AAAA,EAA1B,cAAA;AACN,kBAAA,MAAgB,YAA8B,QAAA;AAG9B,kBAAA,MAAA,YAA8B,IAAI,kBAAkB;AAAA,MACnE,MAAM;AAAA,MACN,WAAW,CAAO,QAAA,OAAO,GAAG;AAAA,MAC5B,YAAY,CAAO,QAAA,OAAO,GAAG;AAAA,MAC7B,cAAc,SAAS,aAAa,KAAK;AACxC,eAAO,IAAI,SAAS,KAAK,SAAS,IAAI,QAAQ;AAAA,MAC/C;AAAA,IACA,CAAA,CAAA;AACe,kBAAA,MAAA,gBAAkC,IAAI,kBAAkB;AAAA,MACvE,MAAM;AAAA,MACN,WAAW,CAAO,QAAA,OAAO,GAAG;AAAA,MAC5B,YAAY,CAAO,QAAA,OAAO,GAAG;AAAA,MAC7B,cAAc,SAAS,aAAa,KAAK;AACxC,eAAO,IAAI,SAAS,KAAK,SAAS,IAAI,QAAQ;AAAA,MAC/C;AAAA,IACA,CAAA,CAAA;AACD,kBAAA,MAAgB,YAA8B,QAAA;AAAA,EAAA;AAC/C;"}
1
+ {"version":3,"file":"CustomTypesProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/CustomTypesProvider.ts"],"sourcesContent":["import { GraphQLScalarType, Kind } from 'graphql'\nimport { JSONType, UuidType } from '@contember/graphql-utils'\n\n\nexport class CustomTypesProvider {\n\tpublic readonly uuidType: GraphQLScalarType = UuidType\n\n\t//todo: implement serialize, parseValue and parseLiteral properly\n\tpublic readonly dateType: GraphQLScalarType = new GraphQLScalarType({\n\t\tname: 'Date',\n\t\tserialize: str => String(str),\n\t\tparseValue: str => String(str),\n\t\tparseLiteral: function parseLiteral(ast) {\n\t\t\treturn ast.kind === Kind.STRING ? ast.value : undefined\n\t\t},\n\t})\n\tpublic readonly dateTimeType: GraphQLScalarType = new GraphQLScalarType({\n\t\tname: 'DateTime',\n\t\tserialize: str => String(str),\n\t\tparseValue: str => String(str),\n\t\tparseLiteral: function parseLiteral(ast) {\n\t\t\treturn ast.kind === Kind.STRING ? ast.value : undefined\n\t\t},\n\t})\n\tpublic readonly jsonType: GraphQLScalarType = JSONType\n}\n"],"names":[],"mappings":";;;;;AAIO,MAAM,oBAAoB;AAAA,EAA1B,cAAA;AACN,kBAAA,MAAgB,YAA8B,QAAA;AAG9B,kBAAA,MAAA,YAA8B,IAAI,kBAAkB;AAAA,MACnE,MAAM;AAAA,MACN,WAAW,CAAO,QAAA,OAAO,GAAG;AAAA,MAC5B,YAAY,CAAO,QAAA,OAAO,GAAG;AAAA,MAC7B,cAAc,SAAS,aAAa,KAAK;AACxC,eAAO,IAAI,SAAS,KAAK,SAAS,IAAI,QAAQ;AAAA,MAAA;AAAA,IAC/C,CACA,CAAA;AACe,kBAAA,MAAA,gBAAkC,IAAI,kBAAkB;AAAA,MACvE,MAAM;AAAA,MACN,WAAW,CAAO,QAAA,OAAO,GAAG;AAAA,MAC5B,YAAY,CAAO,QAAA,OAAO,GAAG;AAAA,MAC7B,cAAc,SAAS,aAAa,KAAK;AACxC,eAAO,IAAI,SAAS,KAAK,SAAS,IAAI,QAAQ;AAAA,MAAA;AAAA,IAC/C,CACA,CAAA;AACD,kBAAA,MAAgB,YAA8B,QAAA;AAAA,EAAA;AAC/C;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityTypeProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/EntityTypeProvider.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLFieldConfig,\n\tGraphQLInt,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLObjectType,\n\tGraphQLObjectTypeConfig,\n\tGraphQLOutputType,\n} from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getEntity as getEntityFromSchema } from '@contember/schema-utils'\nimport { singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { FieldArgsVisitor, FieldTypeVisitor } from './entities'\nimport { aliasAwareResolver, GqlTypeName } from './utils'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { Authorizator } from '../acl'\nimport { FieldAccessVisitor } from './FieldAccessVisitor'\nimport { OrderByTypeProvider } from './OrderByTypeProvider'\nimport { EntityFieldsProvider } from '../extensions'\nimport { ImplementationException } from '../exception'\n\nexport class EntityTypeProvider {\n\tprivate entities = singletonFactory(name => this.createEntity(name))\n\tprivate connections = singletonFactory(name => this.createConnection(name))\n\tprivate PageInfo = new GraphQLObjectType({\n\t\tname: 'PageInfo',\n\t\tfields: {\n\t\t\ttotalCount: { type: new GraphQLNonNull(GraphQLInt) },\n\t\t},\n\t})\n\n\tprivate fieldMeta = new GraphQLObjectType({\n\t\tname: 'FieldMeta',\n\t\tfields: {\n\t\t\t[Input.FieldMeta.readable]: { type: GraphQLBoolean, resolve: aliasAwareResolver },\n\t\t\t[Input.FieldMeta.updatable]: { type: GraphQLBoolean, resolve: aliasAwareResolver },\n\t\t},\n\t})\n\tprivate readonly entityFieldProviders: { [key: string]: EntityFieldsProvider } = {}\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t) {\n\t}\n\n\tpublic registerEntityFieldProvider(key: string, provider: EntityFieldsProvider): void {\n\t\tthis.entityFieldProviders[key] = provider\n\t}\n\n\tpublic getEntity(entityName: string): GraphQLObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.entities(entityName)\n\t}\n\n\tpublic getConnection(entityName: string): GraphQLObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.connections(entityName)\n\t}\n\n\tprivate createEntity(entityName: string) {\n\t\treturn new GraphQLObjectType({\n\t\t\tname: GqlTypeName`${entityName}`,\n\t\t\tfields: () => this.getEntityFields(entityName),\n\t\t} as GraphQLObjectTypeConfig<any, any>)\n\t}\n\n\tprivate getEntityFields(entityName: string) {\n\t\tconst entity = getEntityFromSchema(this.schema, entityName)\n\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\tconst accessibleFields = Object.values(entity.fields).filter(field =>\n\t\t\tacceptFieldVisitor(this.schema, entity, field.name, accessVisitor),\n\t\t)\n\t\tconst metaFields: { [field: string]: GraphQLFieldConfig<any, any> } = {}\n\t\tfor (const field of accessibleFields) {\n\t\t\tmetaFields[field.name] = {\n\t\t\t\ttype: this.fieldMeta,\n\t\t\t\tresolve: aliasAwareResolver,\n\t\t\t}\n\t\t}\n\n\t\tconst metaField = {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: GqlTypeName`${entityName}Meta`,\n\t\t\t\tfields: metaFields,\n\t\t\t}),\n\t\t\tresolve: aliasAwareResolver,\n\t\t}\n\n\t\tlet fields: { [field: string]: GraphQLFieldConfig<any, any> } = {\n\t\t\t_meta: metaField,\n\t\t}\n\n\t\tfor (const field of accessibleFields) {\n\t\t\tconst fieldTypeVisitor = new FieldTypeVisitor(this.columnTypeResolver, this, this.authorizator)\n\t\t\tconst type: GraphQLOutputType = acceptFieldVisitor(this.schema, entity, field.name, fieldTypeVisitor)\n\n\t\t\tconst fieldArgsVisitor = new FieldArgsVisitor(this.whereTypeProvider, this.orderByTypeProvider)\n\t\t\tfields[field.name] = {\n\t\t\t\ttype,\n\t\t\t\targs: acceptFieldVisitor(this.schema, entity, field.name, fieldArgsVisitor),\n\t\t\t\tresolve: aliasAwareResolver,\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, provider] of Object.entries(this.entityFieldProviders)) {\n\t\t\tfields = {\n\t\t\t\t...fields,\n\t\t\t\t...provider.getFields(entity, accessibleFields),\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate createConnection(entityName: string) {\n\t\tconst entityType = this.getEntity(entityName)\n\t\treturn new GraphQLObjectType({\n\t\t\tname: GqlTypeName`${entityName}Connection`,\n\t\t\tfields: {\n\t\t\t\tpageInfo: {\n\t\t\t\t\ttype: new GraphQLNonNull(this.PageInfo),\n\t\t\t\t},\n\t\t\t\tedges: {\n\t\t\t\t\ttype: new GraphQLNonNull(\n\t\t\t\t\t\tnew GraphQLList(\n\t\t\t\t\t\t\tnew GraphQLNonNull(\n\t\t\t\t\t\t\t\tnew GraphQLObjectType({\n\t\t\t\t\t\t\t\t\tname: GqlTypeName`${entityName}Edge`,\n\t\t\t\t\t\t\t\t\tfields: {\n\t\t\t\t\t\t\t\t\t\tnode: {\n\t\t\t\t\t\t\t\t\t\t\ttype: new GraphQLNonNull(entityType),\n\t\t\t\t\t\t\t\t\t\t\t// resolve: aliasAwareResolver,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t// resolve: aliasAwareResolver,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t}\n}\n"],"names":["schema","singletonFactory","GraphQLObjectType","GraphQLNonNull","GraphQLInt","Input","GraphQLBoolean","aliasAwareResolver","Acl","ImplementationException","GqlTypeName","getEntityFromSchema","FieldAccessVisitor","acceptFieldVisitor","FieldTypeVisitor","FieldArgsVisitor","GraphQLList"],"mappings":";;;;;;;;;;;;;;AAuBO,MAAM,mBAAmB;AAAA,EAmB/B,YACkBA,UACA,cACA,oBACA,mBACA,qBAChB;AALgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oBAAA;AACA,SAAA,sBAAA;AAvBlB,kBAAA,MAAQ,YAAWC,kCAAiB,CAAA,SAAQ,KAAK,aAAa,IAAI,CAAC,CAAA;AACnE,kBAAA,MAAQ,eAAcA,kCAAiB,CAAA,SAAQ,KAAK,iBAAiB,IAAI,CAAC,CAAA;AAClE,kBAAA,MAAA,YAAW,IAAIC,0BAAkB;AAAA,MACxC,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,YAAY,EAAE,MAAM,IAAIC,QAAA,eAAeC,QAAU,UAAA,EAAE;AAAA,MACpD;AAAA,IACA,CAAA,CAAA;AAEO,kBAAA,MAAA,aAAY,IAAI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ACA,OAAO;AAAA,UACN,MAAM,IAAIA,QAAA;AAAA,YACT,IAAIa,QAAA;AAAA,cACH,IAAIb,QAAA;AAAA,gBACH,IAAID,0BAAkB;AAAA,kBACrB,MAAMQ,oBAAc,UAAU;AAAA,kBAC9B,QAAQ;AAAA,oBACP,MAAM;AAAA,sBACL,MAAM,IAAIP,QAAA,eAAe,UAAU;AAAA;AAAA,oBAEpC;AAAA,kBACD;AAAA,gBAAA,CACA;AAAA,cACF;AAAA,YACD;AAAA,UACD;AAAA;AAAA,QAED;AAAA,MACD;AAAA,IAAA,CACA;AAAA,EACF;AACD;;"}
1
+ {"version":3,"file":"EntityTypeProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/EntityTypeProvider.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLFieldConfig,\n\tGraphQLInt,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLObjectType,\n\tGraphQLObjectTypeConfig,\n\tGraphQLOutputType,\n} from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getEntity as getEntityFromSchema } from '@contember/schema-utils'\nimport { singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { FieldArgsVisitor, FieldTypeVisitor } from './entities'\nimport { aliasAwareResolver, GqlTypeName } from './utils'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { Authorizator } from '../acl'\nimport { FieldAccessVisitor } from './FieldAccessVisitor'\nimport { OrderByTypeProvider } from './OrderByTypeProvider'\nimport { EntityFieldsProvider } from '../extensions'\nimport { ImplementationException } from '../exception'\n\nexport class EntityTypeProvider {\n\tprivate entities = singletonFactory(name => this.createEntity(name))\n\tprivate connections = singletonFactory(name => this.createConnection(name))\n\tprivate PageInfo = new GraphQLObjectType({\n\t\tname: 'PageInfo',\n\t\tfields: {\n\t\t\ttotalCount: { type: new GraphQLNonNull(GraphQLInt) },\n\t\t},\n\t})\n\n\tprivate fieldMeta = new GraphQLObjectType({\n\t\tname: 'FieldMeta',\n\t\tfields: {\n\t\t\t[Input.FieldMeta.readable]: { type: GraphQLBoolean, resolve: aliasAwareResolver },\n\t\t\t[Input.FieldMeta.updatable]: { type: GraphQLBoolean, resolve: aliasAwareResolver },\n\t\t},\n\t})\n\tprivate readonly entityFieldProviders: { [key: string]: EntityFieldsProvider } = {}\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t) {\n\t}\n\n\tpublic registerEntityFieldProvider(key: string, provider: EntityFieldsProvider): void {\n\t\tthis.entityFieldProviders[key] = provider\n\t}\n\n\tpublic getEntity(entityName: string): GraphQLObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.entities(entityName)\n\t}\n\n\tpublic getConnection(entityName: string): GraphQLObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.connections(entityName)\n\t}\n\n\tprivate createEntity(entityName: string) {\n\t\treturn new GraphQLObjectType({\n\t\t\tname: GqlTypeName`${entityName}`,\n\t\t\tfields: () => this.getEntityFields(entityName),\n\t\t} as GraphQLObjectTypeConfig<any, any>)\n\t}\n\n\tprivate getEntityFields(entityName: string) {\n\t\tconst entity = getEntityFromSchema(this.schema, entityName)\n\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\tconst accessibleFields = Object.values(entity.fields).filter(field =>\n\t\t\tacceptFieldVisitor(this.schema, entity, field.name, accessVisitor),\n\t\t)\n\t\tconst metaFields: { [field: string]: GraphQLFieldConfig<any, any> } = {}\n\t\tfor (const field of accessibleFields) {\n\t\t\tmetaFields[field.name] = {\n\t\t\t\ttype: this.fieldMeta,\n\t\t\t\tresolve: aliasAwareResolver,\n\t\t\t}\n\t\t}\n\n\t\tconst metaField = {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: GqlTypeName`${entityName}Meta`,\n\t\t\t\tfields: metaFields,\n\t\t\t}),\n\t\t\tresolve: aliasAwareResolver,\n\t\t}\n\n\t\tlet fields: { [field: string]: GraphQLFieldConfig<any, any> } = {\n\t\t\t_meta: metaField,\n\t\t}\n\n\t\tfor (const field of accessibleFields) {\n\t\t\tconst fieldTypeVisitor = new FieldTypeVisitor(this.columnTypeResolver, this, this.authorizator)\n\t\t\tconst type: GraphQLOutputType = acceptFieldVisitor(this.schema, entity, field.name, fieldTypeVisitor)\n\n\t\t\tconst fieldArgsVisitor = new FieldArgsVisitor(this.whereTypeProvider, this.orderByTypeProvider)\n\t\t\tfields[field.name] = {\n\t\t\t\ttype,\n\t\t\t\targs: acceptFieldVisitor(this.schema, entity, field.name, fieldArgsVisitor),\n\t\t\t\tresolve: aliasAwareResolver,\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, provider] of Object.entries(this.entityFieldProviders)) {\n\t\t\tfields = {\n\t\t\t\t...fields,\n\t\t\t\t...provider.getFields(entity, accessibleFields),\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate createConnection(entityName: string) {\n\t\tconst entityType = this.getEntity(entityName)\n\t\treturn new GraphQLObjectType({\n\t\t\tname: GqlTypeName`${entityName}Connection`,\n\t\t\tfields: {\n\t\t\t\tpageInfo: {\n\t\t\t\t\ttype: new GraphQLNonNull(this.PageInfo),\n\t\t\t\t},\n\t\t\t\tedges: {\n\t\t\t\t\ttype: new GraphQLNonNull(\n\t\t\t\t\t\tnew GraphQLList(\n\t\t\t\t\t\t\tnew GraphQLNonNull(\n\t\t\t\t\t\t\t\tnew GraphQLObjectType({\n\t\t\t\t\t\t\t\t\tname: GqlTypeName`${entityName}Edge`,\n\t\t\t\t\t\t\t\t\tfields: {\n\t\t\t\t\t\t\t\t\t\tnode: {\n\t\t\t\t\t\t\t\t\t\t\ttype: new GraphQLNonNull(entityType),\n\t\t\t\t\t\t\t\t\t\t\t// resolve: aliasAwareResolver,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t// resolve: aliasAwareResolver,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t}\n}\n"],"names":["schema","singletonFactory","GraphQLObjectType","GraphQLNonNull","GraphQLInt","Input","GraphQLBoolean","aliasAwareResolver","Acl","ImplementationException","GqlTypeName","getEntityFromSchema","FieldAccessVisitor","acceptFieldVisitor","FieldTypeVisitor","FieldArgsVisitor","GraphQLList"],"mappings":";;;;;;;;;;;;;;AAuBO,MAAM,mBAAmB;AAAA,EAmB/B,YACkBA,UACA,cACA,oBACA,mBACA,qBAChB;AALgB,SAAA,SAAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oBAAA;AACA,SAAA,sBAAA;AAvBlB,kBAAA,MAAQ,YAAWC,kCAAiB,CAAA,SAAQ,KAAK,aAAa,IAAI,CAAC,CAAA;AACnE,kBAAA,MAAQ,eAAcA,kCAAiB,CAAA,SAAQ,KAAK,iBAAiB,IAAI,CAAC,CAAA;AAClE,kBAAA,MAAA,YAAW,IAAIC,0BAAkB;AAAA,MACxC,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,YAAY,EAAE,MAAM,IAAIC,QAAAA,eAAeC,QAAAA,UAAU,EAAE;AAAA,MAAA;AAAA,IACpD,CACA,CAAA;AAEO,kBAAA,MAAA,aAAY,IAAIF,0BAAkB;AAAA,MACzC,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,CAACG,OAAAA,MAAM,UAAU,QAAQ,GAAG,EAAE,MAAMC,QAAgB,gBAAA,SAASC,yBA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,MAAMQ,oBAAc,UAAU;AAAA,kBAC9B,QAAQ;AAAA,oBACP,MAAM;AAAA,sBACL,MAAM,IAAIP,QAAAA,eAAe,UAAU;AAAA;AAAA,oBAAA;AAAA,kBAEpC;AAAA,gBAED,CAAA;AAAA,cAAA;AAAA,YACF;AAAA,UACD;AAAA;AAAA,QACD;AAAA,MAED;AAAA,IACD,CACA;AAAA,EAAA;AAEH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityTypeProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/EntityTypeProvider.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLFieldConfig,\n\tGraphQLInt,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLObjectType,\n\tGraphQLObjectTypeConfig,\n\tGraphQLOutputType,\n} from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getEntity as getEntityFromSchema } from '@contember/schema-utils'\nimport { singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { FieldArgsVisitor, FieldTypeVisitor } from './entities'\nimport { aliasAwareResolver, GqlTypeName } from './utils'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { Authorizator } from '../acl'\nimport { FieldAccessVisitor } from './FieldAccessVisitor'\nimport { OrderByTypeProvider } from './OrderByTypeProvider'\nimport { EntityFieldsProvider } from '../extensions'\nimport { ImplementationException } from '../exception'\n\nexport class EntityTypeProvider {\n\tprivate entities = singletonFactory(name => this.createEntity(name))\n\tprivate connections = singletonFactory(name => this.createConnection(name))\n\tprivate PageInfo = new GraphQLObjectType({\n\t\tname: 'PageInfo',\n\t\tfields: {\n\t\t\ttotalCount: { type: new GraphQLNonNull(GraphQLInt) },\n\t\t},\n\t})\n\n\tprivate fieldMeta = new GraphQLObjectType({\n\t\tname: 'FieldMeta',\n\t\tfields: {\n\t\t\t[Input.FieldMeta.readable]: { type: GraphQLBoolean, resolve: aliasAwareResolver },\n\t\t\t[Input.FieldMeta.updatable]: { type: GraphQLBoolean, resolve: aliasAwareResolver },\n\t\t},\n\t})\n\tprivate readonly entityFieldProviders: { [key: string]: EntityFieldsProvider } = {}\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t) {\n\t}\n\n\tpublic registerEntityFieldProvider(key: string, provider: EntityFieldsProvider): void {\n\t\tthis.entityFieldProviders[key] = provider\n\t}\n\n\tpublic getEntity(entityName: string): GraphQLObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.entities(entityName)\n\t}\n\n\tpublic getConnection(entityName: string): GraphQLObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.connections(entityName)\n\t}\n\n\tprivate createEntity(entityName: string) {\n\t\treturn new GraphQLObjectType({\n\t\t\tname: GqlTypeName`${entityName}`,\n\t\t\tfields: () => this.getEntityFields(entityName),\n\t\t} as GraphQLObjectTypeConfig<any, any>)\n\t}\n\n\tprivate getEntityFields(entityName: string) {\n\t\tconst entity = getEntityFromSchema(this.schema, entityName)\n\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\tconst accessibleFields = Object.values(entity.fields).filter(field =>\n\t\t\tacceptFieldVisitor(this.schema, entity, field.name, accessVisitor),\n\t\t)\n\t\tconst metaFields: { [field: string]: GraphQLFieldConfig<any, any> } = {}\n\t\tfor (const field of accessibleFields) {\n\t\t\tmetaFields[field.name] = {\n\t\t\t\ttype: this.fieldMeta,\n\t\t\t\tresolve: aliasAwareResolver,\n\t\t\t}\n\t\t}\n\n\t\tconst metaField = {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: GqlTypeName`${entityName}Meta`,\n\t\t\t\tfields: metaFields,\n\t\t\t}),\n\t\t\tresolve: aliasAwareResolver,\n\t\t}\n\n\t\tlet fields: { [field: string]: GraphQLFieldConfig<any, any> } = {\n\t\t\t_meta: metaField,\n\t\t}\n\n\t\tfor (const field of accessibleFields) {\n\t\t\tconst fieldTypeVisitor = new FieldTypeVisitor(this.columnTypeResolver, this, this.authorizator)\n\t\t\tconst type: GraphQLOutputType = acceptFieldVisitor(this.schema, entity, field.name, fieldTypeVisitor)\n\n\t\t\tconst fieldArgsVisitor = new FieldArgsVisitor(this.whereTypeProvider, this.orderByTypeProvider)\n\t\t\tfields[field.name] = {\n\t\t\t\ttype,\n\t\t\t\targs: acceptFieldVisitor(this.schema, entity, field.name, fieldArgsVisitor),\n\t\t\t\tresolve: aliasAwareResolver,\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, provider] of Object.entries(this.entityFieldProviders)) {\n\t\t\tfields = {\n\t\t\t\t...fields,\n\t\t\t\t...provider.getFields(entity, accessibleFields),\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate createConnection(entityName: string) {\n\t\tconst entityType = this.getEntity(entityName)\n\t\treturn new GraphQLObjectType({\n\t\t\tname: GqlTypeName`${entityName}Connection`,\n\t\t\tfields: {\n\t\t\t\tpageInfo: {\n\t\t\t\t\ttype: new GraphQLNonNull(this.PageInfo),\n\t\t\t\t},\n\t\t\t\tedges: {\n\t\t\t\t\ttype: new GraphQLNonNull(\n\t\t\t\t\t\tnew GraphQLList(\n\t\t\t\t\t\t\tnew GraphQLNonNull(\n\t\t\t\t\t\t\t\tnew GraphQLObjectType({\n\t\t\t\t\t\t\t\t\tname: GqlTypeName`${entityName}Edge`,\n\t\t\t\t\t\t\t\t\tfields: {\n\t\t\t\t\t\t\t\t\t\tnode: {\n\t\t\t\t\t\t\t\t\t\t\ttype: new GraphQLNonNull(entityType),\n\t\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YAAM,mBAAmB,IAAI,iBAAiB,KAAK,mBAAmB,KAAK,mBAAmB;AACvF,aAAA,MAAM,IAAI,IAAI;AAAA,QACpB;AAAA,QACA,MAAM,mBAAmB,KAAK,QAAQ,QAAQ,MAAM,MAAM,gBAAgB;AAAA,QAC1E,SAAS;AAAA,MAAA;AAAA,IAEX;AAEW,eAAA,CAAC,KAAK,QAAQ,KAAK,OAAO,QAAQ,KAAK,oBAAoB,GAAG;AAC/D,eAAA;AAAA,QACR,GAAG;AAAA,QACH,GAAG,SAAS,UAAU,QAAQ,gBAAgB;AAAA,MAAA;AAAA,IAEhD;AACO,WAAA;AAAA,EACR;AAAA,EAEQ,iBAAiB,YAAoB;AACtC,UAAA,aAAa,KAAK,UAAU,UAAU;AAC5C,WAAO,IAAI,kBAAkB;AAAA,MAC5B,MAAM,cAAc,UAAU;AAAA,MAC9B,QAAQ;AAAA,QACP,UAAU;AAAA,UACT,MAAM,IAAI,eAAe,KAAK,QAAQ;AAAA,QACvC;AAAA,QACA,OAAO;AAAA,UACN,MAAM,IAAI;AAAA,YACT,IAAI;AAAA,cACH,IAAI;AAAA,gBACH,IAAI,kBAAkB;AAAA,kBACrB,MAAM,cAAc,UAAU;AAAA,kBAC9B,QAAQ;AAAA,oBACP,MAAM;AAAA,sBACL,MAAM,IAAI,eAAe,UAAU;AAAA;AAAA,oBAEpC;AAAA,kBACD;AAAA,gBAAA,CACA;AAAA,cACF;AAAA,YACD;AAAA,UACD;AAAA;AAAA,QAED;AAAA,MACD;AAAA,IAAA,CACA;AAAA,EACF;AACD;"}
1
+ {"version":3,"file":"EntityTypeProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/EntityTypeProvider.ts"],"sourcesContent":["import {\n\tGraphQLBoolean,\n\tGraphQLFieldConfig,\n\tGraphQLInt,\n\tGraphQLList,\n\tGraphQLNonNull,\n\tGraphQLObjectType,\n\tGraphQLObjectTypeConfig,\n\tGraphQLOutputType,\n} from 'graphql'\nimport { Acl, Input, Model } from '@contember/schema'\nimport { acceptFieldVisitor, getEntity as getEntityFromSchema } from '@contember/schema-utils'\nimport { singletonFactory } from '../utils'\nimport { ColumnTypeResolver } from './ColumnTypeResolver'\nimport { FieldArgsVisitor, FieldTypeVisitor } from './entities'\nimport { aliasAwareResolver, GqlTypeName } from './utils'\nimport { WhereTypeProvider } from './WhereTypeProvider'\nimport { Authorizator } from '../acl'\nimport { FieldAccessVisitor } from './FieldAccessVisitor'\nimport { OrderByTypeProvider } from './OrderByTypeProvider'\nimport { EntityFieldsProvider } from '../extensions'\nimport { ImplementationException } from '../exception'\n\nexport class EntityTypeProvider {\n\tprivate entities = singletonFactory(name => this.createEntity(name))\n\tprivate connections = singletonFactory(name => this.createConnection(name))\n\tprivate PageInfo = new GraphQLObjectType({\n\t\tname: 'PageInfo',\n\t\tfields: {\n\t\t\ttotalCount: { type: new GraphQLNonNull(GraphQLInt) },\n\t\t},\n\t})\n\n\tprivate fieldMeta = new GraphQLObjectType({\n\t\tname: 'FieldMeta',\n\t\tfields: {\n\t\t\t[Input.FieldMeta.readable]: { type: GraphQLBoolean, resolve: aliasAwareResolver },\n\t\t\t[Input.FieldMeta.updatable]: { type: GraphQLBoolean, resolve: aliasAwareResolver },\n\t\t},\n\t})\n\tprivate readonly entityFieldProviders: { [key: string]: EntityFieldsProvider } = {}\n\n\tconstructor(\n\t\tprivate readonly schema: Model.Schema,\n\t\tprivate readonly authorizator: Authorizator,\n\t\tprivate readonly columnTypeResolver: ColumnTypeResolver,\n\t\tprivate readonly whereTypeProvider: WhereTypeProvider,\n\t\tprivate readonly orderByTypeProvider: OrderByTypeProvider,\n\t) {\n\t}\n\n\tpublic registerEntityFieldProvider(key: string, provider: EntityFieldsProvider): void {\n\t\tthis.entityFieldProviders[key] = provider\n\t}\n\n\tpublic getEntity(entityName: string): GraphQLObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.entities(entityName)\n\t}\n\n\tpublic getConnection(entityName: string): GraphQLObjectType {\n\t\tif (this.authorizator.getEntityPermission(Acl.Operation.read, entityName) === 'no') {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\treturn this.connections(entityName)\n\t}\n\n\tprivate createEntity(entityName: string) {\n\t\treturn new GraphQLObjectType({\n\t\t\tname: GqlTypeName`${entityName}`,\n\t\t\tfields: () => this.getEntityFields(entityName),\n\t\t} as GraphQLObjectTypeConfig<any, any>)\n\t}\n\n\tprivate getEntityFields(entityName: string) {\n\t\tconst entity = getEntityFromSchema(this.schema, entityName)\n\t\tconst accessVisitor = new FieldAccessVisitor(Acl.Operation.read, this.authorizator)\n\t\tconst accessibleFields = Object.values(entity.fields).filter(field =>\n\t\t\tacceptFieldVisitor(this.schema, entity, field.name, accessVisitor),\n\t\t)\n\t\tconst metaFields: { [field: string]: GraphQLFieldConfig<any, any> } = {}\n\t\tfor (const field of accessibleFields) {\n\t\t\tmetaFields[field.name] = {\n\t\t\t\ttype: this.fieldMeta,\n\t\t\t\tresolve: aliasAwareResolver,\n\t\t\t}\n\t\t}\n\n\t\tconst metaField = {\n\t\t\ttype: new GraphQLObjectType({\n\t\t\t\tname: GqlTypeName`${entityName}Meta`,\n\t\t\t\tfields: metaFields,\n\t\t\t}),\n\t\t\tresolve: aliasAwareResolver,\n\t\t}\n\n\t\tlet fields: { [field: string]: GraphQLFieldConfig<any, any> } = {\n\t\t\t_meta: metaField,\n\t\t}\n\n\t\tfor (const field of accessibleFields) {\n\t\t\tconst fieldTypeVisitor = new FieldTypeVisitor(this.columnTypeResolver, this, this.authorizator)\n\t\t\tconst type: GraphQLOutputType = acceptFieldVisitor(this.schema, entity, field.name, fieldTypeVisitor)\n\n\t\t\tconst fieldArgsVisitor = new FieldArgsVisitor(this.whereTypeProvider, this.orderByTypeProvider)\n\t\t\tfields[field.name] = {\n\t\t\t\ttype,\n\t\t\t\targs: acceptFieldVisitor(this.schema, entity, field.name, fieldArgsVisitor),\n\t\t\t\tresolve: aliasAwareResolver,\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, provider] of Object.entries(this.entityFieldProviders)) {\n\t\t\tfields = {\n\t\t\t\t...fields,\n\t\t\t\t...provider.getFields(entity, accessibleFields),\n\t\t\t}\n\t\t}\n\t\treturn fields\n\t}\n\n\tprivate createConnection(entityName: string) {\n\t\tconst entityType = this.getEntity(entityName)\n\t\treturn new GraphQLObjectType({\n\t\t\tname: GqlTypeName`${entityName}Connection`,\n\t\t\tfields: {\n\t\t\t\tpageInfo: {\n\t\t\t\t\ttype: new GraphQLNonNull(this.PageInfo),\n\t\t\t\t},\n\t\t\t\tedges: {\n\t\t\t\t\ttype: new GraphQLNonNull(\n\t\t\t\t\t\tnew GraphQLList(\n\t\t\t\t\t\t\tnew GraphQLNonNull(\n\t\t\t\t\t\t\t\tnew GraphQLObjectType({\n\t\t\t\t\t\t\t\t\tname: GqlTypeName`${entityName}Edge`,\n\t\t\t\t\t\t\t\t\tfields: {\n\t\t\t\t\t\t\t\t\t\tnode: {\n\t\t\t\t\t\t\t\t\t\t\ttype: new GraphQLNonNull(entityType),\n\t\t\t\t\t\t\t\t\t\t\t// resolve: aliasAwareResolver,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t// resolve: aliasAwareResolver,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t}\n}\n"],"names":["getEntityFromSchema"],"mappings":";;;;;;;;;;;;AAuBO,MAAM,mBAAmB;AAAA,EAmB/B,YACkB,QACA,cACA,oBACA,mBACA,qBAChB;AALgB,SAAA,SAAA;AACA,SAAA,eAAA;AACA,SAAA,qBAAA;AACA,SAAA,oBAAA;AACA,SAAA,sBAAA;AAvBlB,kBAAA,MAAQ,YAAW,iBAAiB,CAAA,SAAQ,KAAK,aAAa,IAAI,CAAC,CAAA;AAC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9B,QAAQ;AAAA,QACP,UAAU;AAAA,UACT,MAAM,IAAI,eAAe,KAAK,QAAQ;AAAA,QACvC;AAAA,QACA,OAAO;AAAA,UACN,MAAM,IAAI;AAAA,YACT,IAAI;AAAA,cACH,IAAI;AAAA,gBACH,IAAI,kBAAkB;AAAA,kBACrB,MAAM,cAAc,UAAU;AAAA,kBAC9B,QAAQ;AAAA,oBACP,MAAM;AAAA,sBACL,MAAM,IAAI,eAAe,UAAU;AAAA;AAAA,oBAAA;AAAA,kBAEpC;AAAA,gBAED,CAAA;AAAA,cAAA;AAAA,YACF;AAAA,UACD;AAAA;AAAA,QACD;AAAA,MAED;AAAA,IACD,CACA;AAAA,EAAA;AAEH;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnumsProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/EnumsProvider.ts"],"sourcesContent":["import { GraphQLEnumType, GraphQLEnumValueConfigMap } from 'graphql'\nimport { Model } from '@contember/schema'\nimport { capitalizeFirstLetter, singletonFactory } from '../utils'\n\nexport class EnumsProvider {\n\tprivate schema: Model.Schema\n\n\tprivate enums = singletonFactory(name => this.createEnum(name))\n\n\tconstructor(schema: Model.Schema) {\n\t\tthis.schema = schema\n\t}\n\n\tpublic getEnum(name: string): GraphQLEnumType {\n\t\treturn this.enums(name)\n\t}\n\n\tpublic hasEnum(name: string): boolean {\n\t\treturn this.schema.enums[name] !== undefined\n\t}\n\n\tprivate createEnum(name: string): GraphQLEnumType {\n\t\tconst valuesConfig: GraphQLEnumValueConfigMap = {}\n\t\tfor (const val of this.schema.enums[name]) {\n\t\t\tvaluesConfig[val] = { value: val }\n\t\t}\n\n\t\treturn new GraphQLEnumType({\n\t\t\tname: capitalizeFirstLetter(name),\n\t\t\tvalues: valuesConfig,\n\t\t})\n\t}\n}\n"],"names":["singletonFactory","GraphQLEnumType","capitalizeFirstLetter"],"mappings":";;;;;;;;;AAIO,MAAM,cAAc;AAAA,EAK1B,YAAY,QAAsB;AAJ1B,kBAAA,MAAA,QAAA;AAER,kBAAA,MAAQ,SAAQA,kCAAiB,CAAA,SAAQ,KAAK,WAAW,IAAI,CAAC,CAAA;AAG7D,SAAK,SAAS;AAAA,EACf;AAAA,EAEO,QAAQ,MAA+B;AACtC,WAAA,KAAK,MAAM,IAAI;AAAA,EACvB;AAAA,EAEO,QAAQ,MAAuB;AACrC,WAAO,KAAK,OAAO,MAAM,IAAI,MAAM;AAAA,EACpC;AAAA,EAEQ,WAAW,MAA+B;AACjD,UAAM,eAA0C,CAAA;AAChD,eAAW,OAAO,KAAK,OAAO,MAAM,IAAI,GAAG;AAC1C,mBAAa,GAAG,IAAI,EAAE,OAAO,IAAI;AAAA,IAClC;AAEA,WAAO,IAAIC,QAAAA,gBAAgB;AAAA,MAC1B,MAAMC,8BAAsB,IAAI;AAAA,MAChC,QAAQ;AAAA,IAAA,CACR;AAAA,EACF;AACD;;"}
1
+ {"version":3,"file":"EnumsProvider.cjs","sources":["../../../../../packages/engine-content-api/src/schema/EnumsProvider.ts"],"sourcesContent":["import { GraphQLEnumType, GraphQLEnumValueConfigMap } from 'graphql'\nimport { Model } from '@contember/schema'\nimport { capitalizeFirstLetter, singletonFactory } from '../utils'\n\nexport class EnumsProvider {\n\tprivate schema: Model.Schema\n\n\tprivate enums = singletonFactory(name => this.createEnum(name))\n\n\tconstructor(schema: Model.Schema) {\n\t\tthis.schema = schema\n\t}\n\n\tpublic getEnum(name: string): GraphQLEnumType {\n\t\treturn this.enums(name)\n\t}\n\n\tpublic hasEnum(name: string): boolean {\n\t\treturn this.schema.enums[name] !== undefined\n\t}\n\n\tprivate createEnum(name: string): GraphQLEnumType {\n\t\tconst valuesConfig: GraphQLEnumValueConfigMap = {}\n\t\tfor (const val of this.schema.enums[name]) {\n\t\t\tvaluesConfig[val] = { value: val }\n\t\t}\n\n\t\treturn new GraphQLEnumType({\n\t\t\tname: capitalizeFirstLetter(name),\n\t\t\tvalues: valuesConfig,\n\t\t})\n\t}\n}\n"],"names":["singletonFactory","GraphQLEnumType","capitalizeFirstLetter"],"mappings":";;;;;;;;;AAIO,MAAM,cAAc;AAAA,EAK1B,YAAY,QAAsB;AAJ1B,kBAAA,MAAA,QAAA;AAER,kBAAA,MAAQ,SAAQA,kCAAiB,CAAA,SAAQ,KAAK,WAAW,IAAI,CAAC,CAAA;AAG7D,SAAK,SAAS;AAAA,EAAA;AAAA,EAGR,QAAQ,MAA+B;AACtC,WAAA,KAAK,MAAM,IAAI;AAAA,EAAA;AAAA,EAGhB,QAAQ,MAAuB;AACrC,WAAO,KAAK,OAAO,MAAM,IAAI,MAAM;AAAA,EAAA;AAAA,EAG5B,WAAW,MAA+B;AACjD,UAAM,eAA0C,CAAC;AACjD,eAAW,OAAO,KAAK,OAAO,MAAM,IAAI,GAAG;AAC1C,mBAAa,GAAG,IAAI,EAAE,OAAO,IAAI;AAAA,IAAA;AAGlC,WAAO,IAAIC,QAAAA,gBAAgB;AAAA,MAC1B,MAAMC,8BAAsB,IAAI;AAAA,MAChC,QAAQ;AAAA,IAAA,CACR;AAAA,EAAA;AAEH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnumsProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/EnumsProvider.ts"],"sourcesContent":["import { GraphQLEnumType, GraphQLEnumValueConfigMap } from 'graphql'\nimport { Model } from '@contember/schema'\nimport { capitalizeFirstLetter, singletonFactory } from '../utils'\n\nexport class EnumsProvider {\n\tprivate schema: Model.Schema\n\n\tprivate enums = singletonFactory(name => this.createEnum(name))\n\n\tconstructor(schema: Model.Schema) {\n\t\tthis.schema = schema\n\t}\n\n\tpublic getEnum(name: string): GraphQLEnumType {\n\t\treturn this.enums(name)\n\t}\n\n\tpublic hasEnum(name: string): boolean {\n\t\treturn this.schema.enums[name] !== undefined\n\t}\n\n\tprivate createEnum(name: string): GraphQLEnumType {\n\t\tconst valuesConfig: GraphQLEnumValueConfigMap = {}\n\t\tfor (const val of this.schema.enums[name]) {\n\t\t\tvaluesConfig[val] = { value: val }\n\t\t}\n\n\t\treturn new GraphQLEnumType({\n\t\t\tname: capitalizeFirstLetter(name),\n\t\t\tvalues: valuesConfig,\n\t\t})\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAIO,MAAM,cAAc;AAAA,EAK1B,YAAY,QAAsB;AAJ1B,kBAAA,MAAA,QAAA;AAER,kBAAA,MAAQ,SAAQ,iBAAiB,CAAA,SAAQ,KAAK,WAAW,IAAI,CAAC,CAAA;AAG7D,SAAK,SAAS;AAAA,EACf;AAAA,EAEO,QAAQ,MAA+B;AACtC,WAAA,KAAK,MAAM,IAAI;AAAA,EACvB;AAAA,EAEO,QAAQ,MAAuB;AACrC,WAAO,KAAK,OAAO,MAAM,IAAI,MAAM;AAAA,EACpC;AAAA,EAEQ,WAAW,MAA+B;AACjD,UAAM,eAA0C,CAAA;AAChD,eAAW,OAAO,KAAK,OAAO,MAAM,IAAI,GAAG;AAC1C,mBAAa,GAAG,IAAI,EAAE,OAAO,IAAI;AAAA,IAClC;AAEA,WAAO,IAAI,gBAAgB;AAAA,MAC1B,MAAM,sBAAsB,IAAI;AAAA,MAChC,QAAQ;AAAA,IAAA,CACR;AAAA,EACF;AACD;"}
1
+ {"version":3,"file":"EnumsProvider.js","sources":["../../../../../packages/engine-content-api/src/schema/EnumsProvider.ts"],"sourcesContent":["import { GraphQLEnumType, GraphQLEnumValueConfigMap } from 'graphql'\nimport { Model } from '@contember/schema'\nimport { capitalizeFirstLetter, singletonFactory } from '../utils'\n\nexport class EnumsProvider {\n\tprivate schema: Model.Schema\n\n\tprivate enums = singletonFactory(name => this.createEnum(name))\n\n\tconstructor(schema: Model.Schema) {\n\t\tthis.schema = schema\n\t}\n\n\tpublic getEnum(name: string): GraphQLEnumType {\n\t\treturn this.enums(name)\n\t}\n\n\tpublic hasEnum(name: string): boolean {\n\t\treturn this.schema.enums[name] !== undefined\n\t}\n\n\tprivate createEnum(name: string): GraphQLEnumType {\n\t\tconst valuesConfig: GraphQLEnumValueConfigMap = {}\n\t\tfor (const val of this.schema.enums[name]) {\n\t\t\tvaluesConfig[val] = { value: val }\n\t\t}\n\n\t\treturn new GraphQLEnumType({\n\t\t\tname: capitalizeFirstLetter(name),\n\t\t\tvalues: valuesConfig,\n\t\t})\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAIO,MAAM,cAAc;AAAA,EAK1B,YAAY,QAAsB;AAJ1B,kBAAA,MAAA,QAAA;AAER,kBAAA,MAAQ,SAAQ,iBAAiB,CAAA,SAAQ,KAAK,WAAW,IAAI,CAAC,CAAA;AAG7D,SAAK,SAAS;AAAA,EAAA;AAAA,EAGR,QAAQ,MAA+B;AACtC,WAAA,KAAK,MAAM,IAAI;AAAA,EAAA;AAAA,EAGhB,QAAQ,MAAuB;AACrC,WAAO,KAAK,OAAO,MAAM,IAAI,MAAM;AAAA,EAAA;AAAA,EAG5B,WAAW,MAA+B;AACjD,UAAM,eAA0C,CAAC;AACjD,eAAW,OAAO,KAAK,OAAO,MAAM,IAAI,GAAG;AAC1C,mBAAa,GAAG,IAAI,EAAE,OAAO,IAAI;AAAA,IAAA;AAGlC,WAAO,IAAI,gBAAgB;AAAA,MAC1B,MAAM,sBAAsB,IAAI;AAAA,MAChC,QAAQ;AAAA,IAAA,CACR;AAAA,EAAA;AAEH;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldAccessVisitor.cjs","sources":["../../../../../packages/engine-content-api/src/schema/FieldAccessVisitor.ts"],"sourcesContent":["import { Acl, Model } from '@contember/schema'\nimport { Authorizator } from '../acl'\n\nexport class FieldAccessVisitor implements Model.ColumnVisitor<boolean>, Model.RelationVisitor<boolean> {\n\tconstructor(\n\t\tprivate readonly operation: Acl.Operation.create | Acl.Operation.read | Acl.Operation.update,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {}\n\n\tvisitColumn({ column, entity }: Model.ColumnContext) {\n\t\treturn this.authorizator.getFieldPermissions(this.operation, entity.name, column.name) !== 'no'\n\t}\n\n\tvisitRelation({ targetEntity }: Model.AnyRelationContext) {\n\t\treturn this.authorizator.getEntityPermission(this.operation, targetEntity.name) !== 'no'\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,mBAA2F;AAAA,EACvG,YACkB,WACA,cAChB;AAFgB,SAAA,YAAA;AACA,SAAA,eAAA;AAAA,EACf;AAAA,EAEH,YAAY,EAAE,QAAQ,UAA+B;AAC7C,WAAA,KAAK,aAAa,oBAAoB,KAAK,WAAW,OAAO,MAAM,OAAO,IAAI,MAAM;AAAA,EAC5F;AAAA,EAEA,cAAc,EAAE,gBAA0C;AACzD,WAAO,KAAK,aAAa,oBAAoB,KAAK,WAAW,aAAa,IAAI,MAAM;AAAA,EACrF;AACD;;"}
1
+ {"version":3,"file":"FieldAccessVisitor.cjs","sources":["../../../../../packages/engine-content-api/src/schema/FieldAccessVisitor.ts"],"sourcesContent":["import { Acl, Model } from '@contember/schema'\nimport { Authorizator } from '../acl'\n\nexport class FieldAccessVisitor implements Model.ColumnVisitor<boolean>, Model.RelationVisitor<boolean> {\n\tconstructor(\n\t\tprivate readonly operation: Acl.Operation.create | Acl.Operation.read | Acl.Operation.update,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {}\n\n\tvisitColumn({ column, entity }: Model.ColumnContext) {\n\t\treturn this.authorizator.getFieldPermissions(this.operation, entity.name, column.name) !== 'no'\n\t}\n\n\tvisitRelation({ targetEntity }: Model.AnyRelationContext) {\n\t\treturn this.authorizator.getEntityPermission(this.operation, targetEntity.name) !== 'no'\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,mBAA2F;AAAA,EACvG,YACkB,WACA,cAChB;AAFgB,SAAA,YAAA;AACA,SAAA,eAAA;AAAA,EAAA;AAAA,EAGlB,YAAY,EAAE,QAAQ,UAA+B;AAC7C,WAAA,KAAK,aAAa,oBAAoB,KAAK,WAAW,OAAO,MAAM,OAAO,IAAI,MAAM;AAAA,EAAA;AAAA,EAG5F,cAAc,EAAE,gBAA0C;AACzD,WAAO,KAAK,aAAa,oBAAoB,KAAK,WAAW,aAAa,IAAI,MAAM;AAAA,EAAA;AAEtF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldAccessVisitor.js","sources":["../../../../../packages/engine-content-api/src/schema/FieldAccessVisitor.ts"],"sourcesContent":["import { Acl, Model } from '@contember/schema'\nimport { Authorizator } from '../acl'\n\nexport class FieldAccessVisitor implements Model.ColumnVisitor<boolean>, Model.RelationVisitor<boolean> {\n\tconstructor(\n\t\tprivate readonly operation: Acl.Operation.create | Acl.Operation.read | Acl.Operation.update,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {}\n\n\tvisitColumn({ column, entity }: Model.ColumnContext) {\n\t\treturn this.authorizator.getFieldPermissions(this.operation, entity.name, column.name) !== 'no'\n\t}\n\n\tvisitRelation({ targetEntity }: Model.AnyRelationContext) {\n\t\treturn this.authorizator.getEntityPermission(this.operation, targetEntity.name) !== 'no'\n\t}\n}\n"],"names":[],"mappings":"AAGO,MAAM,mBAA2F;AAAA,EACvG,YACkB,WACA,cAChB;AAFgB,SAAA,YAAA;AACA,SAAA,eAAA;AAAA,EACf;AAAA,EAEH,YAAY,EAAE,QAAQ,UAA+B;AAC7C,WAAA,KAAK,aAAa,oBAAoB,KAAK,WAAW,OAAO,MAAM,OAAO,IAAI,MAAM;AAAA,EAC5F;AAAA,EAEA,cAAc,EAAE,gBAA0C;AACzD,WAAO,KAAK,aAAa,oBAAoB,KAAK,WAAW,aAAa,IAAI,MAAM;AAAA,EACrF;AACD;"}
1
+ {"version":3,"file":"FieldAccessVisitor.js","sources":["../../../../../packages/engine-content-api/src/schema/FieldAccessVisitor.ts"],"sourcesContent":["import { Acl, Model } from '@contember/schema'\nimport { Authorizator } from '../acl'\n\nexport class FieldAccessVisitor implements Model.ColumnVisitor<boolean>, Model.RelationVisitor<boolean> {\n\tconstructor(\n\t\tprivate readonly operation: Acl.Operation.create | Acl.Operation.read | Acl.Operation.update,\n\t\tprivate readonly authorizator: Authorizator,\n\t) {}\n\n\tvisitColumn({ column, entity }: Model.ColumnContext) {\n\t\treturn this.authorizator.getFieldPermissions(this.operation, entity.name, column.name) !== 'no'\n\t}\n\n\tvisitRelation({ targetEntity }: Model.AnyRelationContext) {\n\t\treturn this.authorizator.getEntityPermission(this.operation, targetEntity.name) !== 'no'\n\t}\n}\n"],"names":[],"mappings":"AAGO,MAAM,mBAA2F;AAAA,EACvG,YACkB,WACA,cAChB;AAFgB,SAAA,YAAA;AACA,SAAA,eAAA;AAAA,EAAA;AAAA,EAGlB,YAAY,EAAE,QAAQ,UAA+B;AAC7C,WAAA,KAAK,aAAa,oBAAoB,KAAK,WAAW,OAAO,MAAM,OAAO,IAAI,MAAM;AAAA,EAAA;AAAA,EAG5F,cAAc,EAAE,gBAA0C;AACzD,WAAO,KAAK,aAAa,oBAAoB,KAAK,WAAW,aAAa,IAAI,MAAM;AAAA,EAAA;AAEtF;"}