@contember/engine-content-api 2.0.2 → 2.1.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/dist/development/index.cjs +1 -0
  2. package/dist/development/index.cjs.map +1 -1
  3. package/dist/development/index.js +1 -0
  4. package/dist/development/index.js.map +1 -1
  5. package/dist/development/src/ExecutionContainer.cjs +6 -4
  6. package/dist/development/src/ExecutionContainer.cjs.map +1 -1
  7. package/dist/development/src/ExecutionContainer.js +6 -4
  8. package/dist/development/src/ExecutionContainer.js.map +1 -1
  9. package/dist/development/src/acl/Authorizator.cjs +5 -1
  10. package/dist/development/src/acl/Authorizator.cjs.map +1 -1
  11. package/dist/development/src/acl/Authorizator.js +5 -1
  12. package/dist/development/src/acl/Authorizator.js.map +1 -1
  13. package/dist/development/src/input-validation/ColumnValueResolver.cjs +1 -1
  14. package/dist/development/src/input-validation/ColumnValueResolver.cjs.map +1 -1
  15. package/dist/development/src/input-validation/ColumnValueResolver.js +1 -1
  16. package/dist/development/src/input-validation/ColumnValueResolver.js.map +1 -1
  17. package/dist/development/src/input-validation/dependencies/DependencyCollector.cjs +3 -0
  18. package/dist/development/src/input-validation/dependencies/DependencyCollector.cjs.map +1 -1
  19. package/dist/development/src/input-validation/dependencies/DependencyCollector.js +3 -0
  20. package/dist/development/src/input-validation/dependencies/DependencyCollector.js.map +1 -1
  21. package/dist/development/src/mapper/Mapper.cjs +1 -0
  22. package/dist/development/src/mapper/Mapper.cjs.map +1 -1
  23. package/dist/development/src/mapper/Mapper.js +1 -0
  24. package/dist/development/src/mapper/Mapper.js.map +1 -1
  25. package/dist/development/src/mapper/insert/Inserter.cjs +3 -2
  26. package/dist/development/src/mapper/insert/Inserter.cjs.map +1 -1
  27. package/dist/development/src/mapper/insert/Inserter.js +3 -2
  28. package/dist/development/src/mapper/insert/Inserter.js.map +1 -1
  29. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.cjs +3 -2
  30. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
  31. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.js +3 -2
  32. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
  33. package/dist/development/src/mapper/select/ConditionBuilder.cjs +9 -2
  34. package/dist/development/src/mapper/select/ConditionBuilder.cjs.map +1 -1
  35. package/dist/development/src/mapper/select/ConditionBuilder.js +10 -3
  36. package/dist/development/src/mapper/select/ConditionBuilder.js.map +1 -1
  37. package/dist/development/src/mapper/select/WhereBuilder.cjs +3 -3
  38. package/dist/development/src/mapper/select/WhereBuilder.cjs.map +1 -1
  39. package/dist/development/src/mapper/select/WhereBuilder.js +3 -3
  40. package/dist/development/src/mapper/select/WhereBuilder.js.map +1 -1
  41. package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs +33 -3
  42. package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
  43. package/dist/development/src/mapper/select/handlers/FieldsVisitor.js +33 -3
  44. package/dist/development/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
  45. package/dist/development/src/mapper/select/handlers/FieldsVisitorFactory.cjs +6 -2
  46. package/dist/development/src/mapper/select/handlers/FieldsVisitorFactory.cjs.map +1 -1
  47. package/dist/development/src/mapper/select/handlers/FieldsVisitorFactory.js +6 -2
  48. package/dist/development/src/mapper/select/handlers/FieldsVisitorFactory.js.map +1 -1
  49. package/dist/development/src/resolvers/MutationResolver.cjs +1 -0
  50. package/dist/development/src/resolvers/MutationResolver.cjs.map +1 -1
  51. package/dist/development/src/resolvers/MutationResolver.js +1 -0
  52. package/dist/development/src/resolvers/MutationResolver.js.map +1 -1
  53. package/dist/development/src/resolvers/RefreshViewResolver.cjs +21 -0
  54. package/dist/development/src/resolvers/RefreshViewResolver.cjs.map +1 -0
  55. package/dist/development/src/resolvers/RefreshViewResolver.js +21 -0
  56. package/dist/development/src/resolvers/RefreshViewResolver.js.map +1 -0
  57. package/dist/development/src/schema/ColumnTypeResolver.cjs +9 -0
  58. package/dist/development/src/schema/ColumnTypeResolver.cjs.map +1 -1
  59. package/dist/development/src/schema/ColumnTypeResolver.js +10 -1
  60. package/dist/development/src/schema/ColumnTypeResolver.js.map +1 -1
  61. package/dist/development/src/schema/ConditionTypeProvider.cjs +35 -23
  62. package/dist/development/src/schema/ConditionTypeProvider.cjs.map +1 -1
  63. package/dist/development/src/schema/ConditionTypeProvider.js +36 -24
  64. package/dist/development/src/schema/ConditionTypeProvider.js.map +1 -1
  65. package/dist/development/src/schema/CustomTypesProvider.cjs +30 -0
  66. package/dist/development/src/schema/CustomTypesProvider.cjs.map +1 -1
  67. package/dist/development/src/schema/CustomTypesProvider.js +30 -0
  68. package/dist/development/src/schema/CustomTypesProvider.js.map +1 -1
  69. package/dist/development/src/schema/GraphQlSchemaBuilder.cjs +6 -1
  70. package/dist/development/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
  71. package/dist/development/src/schema/GraphQlSchemaBuilder.js +6 -1
  72. package/dist/development/src/schema/GraphQlSchemaBuilder.js.map +1 -1
  73. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.cjs +2 -1
  74. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
  75. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.js +2 -1
  76. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
  77. package/dist/development/src/schema/OrderByTypeProvider.cjs +6 -1
  78. package/dist/development/src/schema/OrderByTypeProvider.cjs.map +1 -1
  79. package/dist/development/src/schema/OrderByTypeProvider.js +6 -1
  80. package/dist/development/src/schema/OrderByTypeProvider.js.map +1 -1
  81. package/dist/development/src/schema/RefreshViewMutationProvider.cjs +42 -0
  82. package/dist/development/src/schema/RefreshViewMutationProvider.cjs.map +1 -0
  83. package/dist/development/src/schema/RefreshViewMutationProvider.js +42 -0
  84. package/dist/development/src/schema/RefreshViewMutationProvider.js.map +1 -0
  85. package/dist/development/src/schema/WhereTypeProvider.cjs +1 -1
  86. package/dist/development/src/schema/WhereTypeProvider.cjs.map +1 -1
  87. package/dist/development/src/schema/WhereTypeProvider.js +1 -1
  88. package/dist/development/src/schema/WhereTypeProvider.js.map +1 -1
  89. package/dist/development/src/schema/entities/FieldTypeVisitor.cjs +3 -3
  90. package/dist/development/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
  91. package/dist/development/src/schema/entities/FieldTypeVisitor.js +3 -3
  92. package/dist/development/src/schema/entities/FieldTypeVisitor.js.map +1 -1
  93. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.cjs +1 -1
  94. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
  95. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.js +1 -1
  96. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
  97. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs +1 -1
  98. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
  99. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.js +1 -1
  100. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
  101. package/dist/development/src/utils/viewComputedId.cjs +16 -0
  102. package/dist/development/src/utils/viewComputedId.cjs.map +1 -0
  103. package/dist/development/src/utils/viewComputedId.js +16 -0
  104. package/dist/development/src/utils/viewComputedId.js.map +1 -0
  105. package/dist/production/index.cjs +1 -0
  106. package/dist/production/index.cjs.map +1 -1
  107. package/dist/production/index.js +1 -0
  108. package/dist/production/index.js.map +1 -1
  109. package/dist/production/src/ExecutionContainer.cjs +6 -4
  110. package/dist/production/src/ExecutionContainer.cjs.map +1 -1
  111. package/dist/production/src/ExecutionContainer.js +6 -4
  112. package/dist/production/src/ExecutionContainer.js.map +1 -1
  113. package/dist/production/src/acl/Authorizator.cjs +5 -1
  114. package/dist/production/src/acl/Authorizator.cjs.map +1 -1
  115. package/dist/production/src/acl/Authorizator.js +5 -1
  116. package/dist/production/src/acl/Authorizator.js.map +1 -1
  117. package/dist/production/src/input-validation/ColumnValueResolver.cjs +1 -1
  118. package/dist/production/src/input-validation/ColumnValueResolver.cjs.map +1 -1
  119. package/dist/production/src/input-validation/ColumnValueResolver.js +1 -1
  120. package/dist/production/src/input-validation/ColumnValueResolver.js.map +1 -1
  121. package/dist/production/src/input-validation/dependencies/DependencyCollector.cjs +3 -0
  122. package/dist/production/src/input-validation/dependencies/DependencyCollector.cjs.map +1 -1
  123. package/dist/production/src/input-validation/dependencies/DependencyCollector.js +3 -0
  124. package/dist/production/src/input-validation/dependencies/DependencyCollector.js.map +1 -1
  125. package/dist/production/src/mapper/Mapper.cjs +1 -0
  126. package/dist/production/src/mapper/Mapper.cjs.map +1 -1
  127. package/dist/production/src/mapper/Mapper.js +1 -0
  128. package/dist/production/src/mapper/Mapper.js.map +1 -1
  129. package/dist/production/src/mapper/insert/Inserter.cjs +3 -2
  130. package/dist/production/src/mapper/insert/Inserter.cjs.map +1 -1
  131. package/dist/production/src/mapper/insert/Inserter.js +3 -2
  132. package/dist/production/src/mapper/insert/Inserter.js.map +1 -1
  133. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.cjs +3 -2
  134. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
  135. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.js +3 -2
  136. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
  137. package/dist/production/src/mapper/select/ConditionBuilder.cjs +9 -2
  138. package/dist/production/src/mapper/select/ConditionBuilder.cjs.map +1 -1
  139. package/dist/production/src/mapper/select/ConditionBuilder.js +10 -3
  140. package/dist/production/src/mapper/select/ConditionBuilder.js.map +1 -1
  141. package/dist/production/src/mapper/select/WhereBuilder.cjs +3 -3
  142. package/dist/production/src/mapper/select/WhereBuilder.cjs.map +1 -1
  143. package/dist/production/src/mapper/select/WhereBuilder.js +3 -3
  144. package/dist/production/src/mapper/select/WhereBuilder.js.map +1 -1
  145. package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs +33 -3
  146. package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
  147. package/dist/production/src/mapper/select/handlers/FieldsVisitor.js +33 -3
  148. package/dist/production/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
  149. package/dist/production/src/mapper/select/handlers/FieldsVisitorFactory.cjs +6 -2
  150. package/dist/production/src/mapper/select/handlers/FieldsVisitorFactory.cjs.map +1 -1
  151. package/dist/production/src/mapper/select/handlers/FieldsVisitorFactory.js +6 -2
  152. package/dist/production/src/mapper/select/handlers/FieldsVisitorFactory.js.map +1 -1
  153. package/dist/production/src/resolvers/MutationResolver.cjs +1 -0
  154. package/dist/production/src/resolvers/MutationResolver.cjs.map +1 -1
  155. package/dist/production/src/resolvers/MutationResolver.js +1 -0
  156. package/dist/production/src/resolvers/MutationResolver.js.map +1 -1
  157. package/dist/production/src/resolvers/RefreshViewResolver.cjs +21 -0
  158. package/dist/production/src/resolvers/RefreshViewResolver.cjs.map +1 -0
  159. package/dist/production/src/resolvers/RefreshViewResolver.js +21 -0
  160. package/dist/production/src/resolvers/RefreshViewResolver.js.map +1 -0
  161. package/dist/production/src/schema/ColumnTypeResolver.cjs +9 -0
  162. package/dist/production/src/schema/ColumnTypeResolver.cjs.map +1 -1
  163. package/dist/production/src/schema/ColumnTypeResolver.js +10 -1
  164. package/dist/production/src/schema/ColumnTypeResolver.js.map +1 -1
  165. package/dist/production/src/schema/ConditionTypeProvider.cjs +35 -23
  166. package/dist/production/src/schema/ConditionTypeProvider.cjs.map +1 -1
  167. package/dist/production/src/schema/ConditionTypeProvider.js +36 -24
  168. package/dist/production/src/schema/ConditionTypeProvider.js.map +1 -1
  169. package/dist/production/src/schema/CustomTypesProvider.cjs +30 -0
  170. package/dist/production/src/schema/CustomTypesProvider.cjs.map +1 -1
  171. package/dist/production/src/schema/CustomTypesProvider.js +30 -0
  172. package/dist/production/src/schema/CustomTypesProvider.js.map +1 -1
  173. package/dist/production/src/schema/GraphQlSchemaBuilder.cjs +6 -1
  174. package/dist/production/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
  175. package/dist/production/src/schema/GraphQlSchemaBuilder.js +6 -1
  176. package/dist/production/src/schema/GraphQlSchemaBuilder.js.map +1 -1
  177. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.cjs +2 -1
  178. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
  179. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.js +2 -1
  180. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
  181. package/dist/production/src/schema/OrderByTypeProvider.cjs +6 -1
  182. package/dist/production/src/schema/OrderByTypeProvider.cjs.map +1 -1
  183. package/dist/production/src/schema/OrderByTypeProvider.js +6 -1
  184. package/dist/production/src/schema/OrderByTypeProvider.js.map +1 -1
  185. package/dist/production/src/schema/RefreshViewMutationProvider.cjs +42 -0
  186. package/dist/production/src/schema/RefreshViewMutationProvider.cjs.map +1 -0
  187. package/dist/production/src/schema/RefreshViewMutationProvider.js +42 -0
  188. package/dist/production/src/schema/RefreshViewMutationProvider.js.map +1 -0
  189. package/dist/production/src/schema/WhereTypeProvider.cjs +1 -1
  190. package/dist/production/src/schema/WhereTypeProvider.cjs.map +1 -1
  191. package/dist/production/src/schema/WhereTypeProvider.js +1 -1
  192. package/dist/production/src/schema/WhereTypeProvider.js.map +1 -1
  193. package/dist/production/src/schema/entities/FieldTypeVisitor.cjs +3 -3
  194. package/dist/production/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
  195. package/dist/production/src/schema/entities/FieldTypeVisitor.js +3 -3
  196. package/dist/production/src/schema/entities/FieldTypeVisitor.js.map +1 -1
  197. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.cjs +1 -1
  198. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
  199. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.js +1 -1
  200. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
  201. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs +1 -1
  202. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
  203. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.js +1 -1
  204. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
  205. package/dist/production/src/utils/viewComputedId.cjs +16 -0
  206. package/dist/production/src/utils/viewComputedId.cjs.map +1 -0
  207. package/dist/production/src/utils/viewComputedId.js +16 -0
  208. package/dist/production/src/utils/viewComputedId.js.map +1 -0
  209. package/dist/tests/cases/integration/graphQlRequests/validation/utils.d.ts.map +1 -1
  210. package/dist/tests/src/tags.d.ts.map +1 -1
  211. package/dist/tests/src/test.d.ts.map +1 -1
  212. package/dist/tests/src/testGraphql.d.ts.map +1 -1
  213. package/dist/tests/src/testUuid.d.ts.map +1 -1
  214. package/dist/tests/tsconfig.tsbuildinfo +1 -1
  215. package/dist/types/ExecutionContainer.d.ts +8 -2
  216. package/dist/types/ExecutionContainer.d.ts.map +1 -1
  217. package/dist/types/acl/Authorizator.d.ts +3 -1
  218. package/dist/types/acl/Authorizator.d.ts.map +1 -1
  219. package/dist/types/acl/VariableUtils.d.ts.map +1 -1
  220. package/dist/types/input-validation/ValidationContext.d.ts.map +1 -1
  221. package/dist/types/input-validation/ValidationEvaluation.d.ts.map +1 -1
  222. package/dist/types/input-validation/ValidationPath.d.ts.map +1 -1
  223. package/dist/types/introspection/introspection.schema.d.ts.map +1 -1
  224. package/dist/types/mapper/ColumnValue.d.ts.map +1 -1
  225. package/dist/types/mapper/ErrorUtils.d.ts.map +1 -1
  226. package/dist/types/mapper/EventManager.d.ts.map +1 -1
  227. package/dist/types/mapper/MutationProcessorHelper.d.ts.map +1 -1
  228. package/dist/types/mapper/Result.d.ts.map +1 -1
  229. package/dist/types/mapper/delete/helpers.d.ts.map +1 -1
  230. package/dist/types/mapper/insert/Inserter.d.ts +4 -1
  231. package/dist/types/mapper/insert/Inserter.d.ts.map +1 -1
  232. package/dist/types/mapper/insert/SqlCreateInputProcessor.d.ts +4 -1
  233. package/dist/types/mapper/insert/SqlCreateInputProcessor.d.ts.map +1 -1
  234. package/dist/types/mapper/select/ConditionBuilder.d.ts +2 -2
  235. package/dist/types/mapper/select/ConditionBuilder.d.ts.map +1 -1
  236. package/dist/types/mapper/select/handlers/FieldsVisitor.d.ts +4 -1
  237. package/dist/types/mapper/select/handlers/FieldsVisitor.d.ts.map +1 -1
  238. package/dist/types/mapper/select/handlers/FieldsVisitorFactory.d.ts +5 -2
  239. package/dist/types/mapper/select/handlers/FieldsVisitorFactory.d.ts.map +1 -1
  240. package/dist/types/mapper/select/optimizer/WhereReplacer.d.ts.map +1 -1
  241. package/dist/types/mapper/select/optimizer/helpers.d.ts.map +1 -1
  242. package/dist/types/resolvers/ReadHelpers.d.ts.map +1 -1
  243. package/dist/types/resolvers/RefreshViewResolver.d.ts +13 -0
  244. package/dist/types/resolvers/RefreshViewResolver.d.ts.map +1 -0
  245. package/dist/types/schema/ColumnTypeResolver.d.ts +5 -5
  246. package/dist/types/schema/ColumnTypeResolver.d.ts.map +1 -1
  247. package/dist/types/schema/ConditionTypeProvider.d.ts +1 -0
  248. package/dist/types/schema/ConditionTypeProvider.d.ts.map +1 -1
  249. package/dist/types/schema/CustomTypesProvider.d.ts +1 -0
  250. package/dist/types/schema/CustomTypesProvider.d.ts.map +1 -1
  251. package/dist/types/schema/GraphQlSchemaBuilder.d.ts +3 -1
  252. package/dist/types/schema/GraphQlSchemaBuilder.d.ts.map +1 -1
  253. package/dist/types/schema/GraphQlSchemaBuilderFactory.d.ts +3 -0
  254. package/dist/types/schema/GraphQlSchemaBuilderFactory.d.ts.map +1 -1
  255. package/dist/types/schema/OperationExtension.d.ts.map +1 -1
  256. package/dist/types/schema/OrderByTypeProvider.d.ts.map +1 -1
  257. package/dist/types/schema/RefreshViewMutationProvider.d.ts +11 -0
  258. package/dist/types/schema/RefreshViewMutationProvider.d.ts.map +1 -0
  259. package/dist/types/schema/mutations/UpdateEntityInputFieldVisitor.d.ts +1 -1
  260. package/dist/types/schema/utils.d.ts.map +1 -1
  261. package/dist/types/tsconfig.tsbuildinfo +1 -1
  262. package/dist/types/utils/isIt.d.ts.map +1 -1
  263. package/dist/types/utils/paginationUtils.d.ts.map +1 -1
  264. package/dist/types/utils/promises.d.ts.map +1 -1
  265. package/dist/types/utils/singletonFactory.d.ts.map +1 -1
  266. package/dist/types/utils/strings.d.ts.map +1 -1
  267. package/dist/types/utils/tuple.d.ts.map +1 -1
  268. package/dist/types/utils/uniqueWhereFields.d.ts.map +1 -1
  269. package/dist/types/utils/viewComputedId.d.ts +2 -0
  270. package/dist/types/utils/viewComputedId.d.ts.map +1 -0
  271. package/package.json +11 -11
  272. package/src/ExecutionContainer.ts +9 -5
  273. package/src/acl/Authorizator.ts +5 -0
  274. package/src/input-validation/ColumnValueResolver.ts +1 -1
  275. package/src/mapper/insert/Inserter.ts +2 -1
  276. package/src/mapper/insert/SqlCreateInputProcessor.ts +2 -1
  277. package/src/mapper/select/ConditionBuilder.ts +19 -5
  278. package/src/mapper/select/WhereBuilder.ts +3 -3
  279. package/src/mapper/select/handlers/FieldsVisitor.ts +36 -1
  280. package/src/mapper/select/handlers/FieldsVisitorFactory.ts +6 -1
  281. package/src/resolvers/RefreshViewResolver.ts +23 -0
  282. package/src/schema/ColumnTypeResolver.ts +15 -3
  283. package/src/schema/ConditionTypeProvider.ts +40 -25
  284. package/src/schema/CustomTypesProvider.ts +37 -0
  285. package/src/schema/GraphQlSchemaBuilder.ts +8 -0
  286. package/src/schema/GraphQlSchemaBuilderFactory.ts +5 -2
  287. package/src/schema/OrderByTypeProvider.ts +6 -1
  288. package/src/schema/RefreshViewMutationProvider.ts +47 -0
  289. package/src/schema/WhereTypeProvider.ts +1 -1
  290. package/src/schema/entities/FieldTypeVisitor.ts +3 -3
  291. package/src/schema/mutations/CreateEntityInputFieldVisitor.ts +1 -1
  292. package/src/schema/mutations/UpdateEntityInputFieldVisitor.ts +1 -1
  293. package/src/utils/viewComputedId.ts +23 -0
  294. package/tests/cases/integration/graphQlSchema/graphQlSchemaBuilder.test.ts +38 -2
  295. package/tests/cases/integration/graphQlSchema/schema-aliased-type.gql +6 -0
  296. package/tests/cases/integration/graphQlSchema/schema-array.gql +257 -0
  297. package/tests/cases/integration/graphQlSchema/schema-column-types.gql +420 -0
  298. package/tests/src/test.ts +1 -1
@@ -29,6 +29,7 @@ import { PaginatedHasManyFieldProvider } from '../extensions/paginatedHasMany/Pa
29
29
  import { PaginatedHasManyFieldProviderVisitor } from '../extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor'
30
30
  import { Builder } from '@contember/dic'
31
31
  import { ConnectOrCreateRelationInputProvider } from './mutations/ConnectOrCreateRelationInputProvider'
32
+ import { RefreshViewMutationProvider } from './RefreshViewMutationProvider'
32
33
 
33
34
  export class GraphQlSchemaBuilderFactory {
34
35
  constructor() {}
@@ -101,8 +102,10 @@ export class GraphQlSchemaBuilderFactory {
101
102
  new MutationProvider(authorizator, whereTypeProvider, entityTypeProvider, createEntityInputProvider, updateEntityInputProvider, resultSchemaTypeProvider))
102
103
  .addService('validationQueriesProvider', ({ whereTypeProvider, createEntityInputProvider, updateEntityInputProvider, resultSchemaTypeProvider }) =>
103
104
  new ValidationQueriesProvider(whereTypeProvider, createEntityInputProvider, updateEntityInputProvider, resultSchemaTypeProvider))
104
- .addService('graphQlSchemaBuilder', ({ schema, queryProvider, validationQueriesProvider, mutationProvider, resultSchemaTypeProvider }) =>
105
- new GraphQlSchemaBuilder(schema, queryProvider, validationQueriesProvider, mutationProvider, resultSchemaTypeProvider))
105
+ .addService('refreshViewMutationProvider', ({ schema, authorizator }) =>
106
+ new RefreshViewMutationProvider(schema, authorizator))
107
+ .addService('graphQlSchemaBuilder', ({ schema, queryProvider, validationQueriesProvider, mutationProvider, resultSchemaTypeProvider, refreshViewMutationProvider }) =>
108
+ new GraphQlSchemaBuilder(schema, queryProvider, validationQueriesProvider, mutationProvider, resultSchemaTypeProvider, refreshViewMutationProvider))
106
109
  .setupService('createEntityInputProvider', (it, { createEntityInputProviderAccessor }) => {
107
110
  createEntityInputProviderAccessor.set(it)
108
111
  })
@@ -57,7 +57,12 @@ export class OrderByTypeProvider {
57
57
  }
58
58
 
59
59
  const field = acceptFieldVisitor(this.schema, name, fieldName, {
60
- visitColumn: () => ({ type: this.orderDirectionEnum }),
60
+ visitColumn: ({ column }) => {
61
+ if (column.list) {
62
+ return undefined
63
+ }
64
+ return ({ type: this.orderDirectionEnum })
65
+ },
61
66
  visitHasOne: ({ relation }) => ({ type: this.getEntityOrderByType(relation.target) }),
62
67
  visitHasMany: () => undefined,
63
68
  } as Model.FieldVisitor<GraphQLInputFieldConfig | undefined>)
@@ -0,0 +1,47 @@
1
+ import { Model } from '@contember/schema'
2
+ import { GraphQLBoolean, GraphQLEnumType, GraphQLFieldConfig, GraphQLInputObjectType, GraphQLObjectType } from 'graphql'
3
+ import { Context } from '../types'
4
+ import { Authorizator } from '../acl'
5
+
6
+ export class RefreshViewMutationProvider {
7
+ constructor(
8
+ private readonly schema: Model.Schema,
9
+ private readonly authorizator: Authorizator,
10
+ ) {
11
+ }
12
+ getMutation(): GraphQLFieldConfig<any, Context, any> | undefined {
13
+ const materializedViews = Object.values(this.schema.entities)
14
+ .filter(it => it.view?.materialized)
15
+ .filter(it => this.authorizator.isRefreshMaterializedViewAllowed(it.name))
16
+ if (materializedViews.length === 0) {
17
+ return undefined
18
+ }
19
+
20
+ const materializedViewsEnum = new GraphQLEnumType({
21
+ name: '_MaterializedView',
22
+ values: Object.fromEntries(materializedViews.map(it => [it.name, { value: it.name }])),
23
+ })
24
+
25
+ const refreshViewOptions = new GraphQLInputObjectType({
26
+ name: 'RefreshMaterializedViewOptions',
27
+ fields: {
28
+ concurrently: { type: GraphQLBoolean },
29
+ },
30
+ })
31
+ return {
32
+ type: new GraphQLObjectType({
33
+ name: 'RefreshMaterializedViewResponse',
34
+ fields: {
35
+ ok: { type: GraphQLBoolean },
36
+ },
37
+ }),
38
+ args: {
39
+ name: { type: materializedViewsEnum },
40
+ options: { type: refreshViewOptions },
41
+ },
42
+ resolve: async (parent, args, context) => {
43
+ return await context.executionContainer.refreshViewResolver.resolve(args.name, args.options)
44
+ },
45
+ }
46
+ }
47
+ }
@@ -83,7 +83,7 @@ export class WhereTypeProvider {
83
83
  }
84
84
  return { type: uniqueWhere }
85
85
  },
86
- visitColumn: ({ column }) => ({ type: this.columnTypeResolver.getType(column) }),
86
+ visitColumn: ({ column }) => ({ type: this.columnTypeResolver.getType(column)[0] }),
87
87
  })
88
88
  }
89
89
  }
@@ -14,16 +14,16 @@ export class FieldTypeVisitor implements Model.ColumnVisitor<GraphQLOutputType>,
14
14
  }
15
15
 
16
16
  public visitColumn({ column, entity }: Model.ColumnContext): GraphQLOutputType {
17
- const basicType = this.columnTypeResolver.getType(column)
17
+ const [type] = this.columnTypeResolver.getType(column)
18
18
  const fieldPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, column.name)
19
19
  const idPredicate = this.authorizator.getFieldPredicate(Acl.Operation.read, entity.name, entity.primary)
20
20
  if (!fieldPredicate || !idPredicate) {
21
21
  throw new ImplementationException()
22
22
  }
23
23
  if (!column.nullable && (fieldPredicate === true || fieldPredicate === idPredicate)) {
24
- return new GraphQLNonNull(basicType)
24
+ return new GraphQLNonNull(type)
25
25
  }
26
- return basicType
26
+ return type
27
27
  }
28
28
 
29
29
  public visitHasMany({ relation }: Model.AnyHasManyRelationContext): GraphQLOutputType {
@@ -22,7 +22,7 @@ export class CreateEntityInputFieldVisitor implements
22
22
  if (this.authorizator.getFieldPermissions(Acl.Operation.create, entity.name, column.name) === 'no') {
23
23
  return undefined
24
24
  }
25
- const type = this.columnTypeResolver.getType(column)
25
+ const [type] = this.columnTypeResolver.getType(column)
26
26
  return { type }
27
27
  }
28
28
 
@@ -21,7 +21,7 @@ export class UpdateEntityInputFieldVisitor implements
21
21
  if (this.authorizator.getFieldPermissions(Acl.Operation.update, entity.name, column.name) === 'no') {
22
22
  return undefined
23
23
  }
24
- const type = this.columnTypeResolver.getType(column)
24
+ const [type] = this.columnTypeResolver.getType(column)
25
25
  return { type }
26
26
  }
27
27
 
@@ -0,0 +1,23 @@
1
+ import crypto from 'node:crypto'
2
+
3
+ export const viewComputedId = (inputs: (string)[]): string => {
4
+ let uuidBytes: Buffer
5
+ uuidBytes = crypto.createHash('md5').update(inputs.join('\x00')).digest()
6
+
7
+ // Set the version (v8) in the high nibble of byte 6.
8
+ uuidBytes[6] = (uuidBytes[6] & 0x0f) | 0x80 // 0x80 = 1000 0000 (version 8)
9
+
10
+ // Set the variant (RFC 4122) in byte 8.
11
+ uuidBytes[8] = (uuidBytes[8] & 0x3f) | 0x80
12
+
13
+ return formatUUID(uuidBytes)
14
+ }
15
+
16
+ const formatUUID = (buf: Buffer): string => {
17
+ const hex = buf.toString('hex')
18
+ return hex.substring(0, 8)
19
+ + '-' + hex.substring(8, 12)
20
+ + '-' + hex.substring(12, 16)
21
+ + '-' + hex.substring(16, 20)
22
+ + '-' + hex.substring(20)
23
+ }
@@ -29,7 +29,7 @@ const testSchema = async (test: Test) => {
29
29
  const schema = schemaResult instanceof SchemaBuilder ? schemaResult.buildSchema() : schemaResult
30
30
  const schemaWithAcl = { ...schema, acl: { roles: {}, variables: {} } }
31
31
  const permissions = test.permissions(schemaWithAcl)
32
- const authorizator = new Authorizator(permissions, false)
32
+ const authorizator = new Authorizator(permissions, false, false)
33
33
  const graphQlSchemaBuilder = schemaFactory.create(schemaWithAcl, authorizator)
34
34
  const graphQlSchema = graphQlSchemaBuilder.build()
35
35
 
@@ -61,7 +61,26 @@ const testSchema = async (test: Test) => {
61
61
  }
62
62
  }
63
63
  describe('GraphQL schema builder', () => {
64
-
64
+ it('column types', async () => {
65
+ await testSchema({
66
+ schema: () => createSchema({
67
+ Columns: class Columns {
68
+ string = c.stringColumn()
69
+ int = c.intColumn()
70
+ float = c.doubleColumn()
71
+ boolean = c.boolColumn()
72
+ date = c.dateColumn()
73
+ dateTime = c.dateTimeColumn()
74
+ json = c.jsonColumn()
75
+ uuid = c.uuidColumn()
76
+ time = c.timeColumn()
77
+ enum = c.enumColumn(c.createEnum('a', 'b', 'c'))
78
+ },
79
+ }).model,
80
+ permissions: schema => new AllowAllPermissionFactory().create(schema),
81
+ graphQlSchemaFile: 'schema-column-types.gql',
82
+ })
83
+ })
65
84
 
66
85
  it('basic schema', async () => {
67
86
  await testSchema({
@@ -402,6 +421,23 @@ describe('GraphQL schema builder', () => {
402
421
  graphQlSchemaFile: 'schema-no-root-ops.gql',
403
422
  })
404
423
  })
424
+
425
+
426
+ it('array', async () => {
427
+ const schema = createSchema({
428
+ Foo: class Foo {
429
+ stringArrayValue = c.stringColumn().list()
430
+ enumArrayValue = c.enumColumn(c.createEnum('a', 'b', 'c')).list()
431
+ intArrayValue = c.intColumn().list()
432
+ },
433
+ })
434
+
435
+ await testSchema({
436
+ schema: () => schema.model,
437
+ permissions: schema => new AllowAllPermissionFactory().create(schema),
438
+ graphQlSchemaFile: 'schema-array.gql',
439
+ })
440
+ })
405
441
  })
406
442
 
407
443
  namespace ViewEntity {
@@ -70,6 +70,12 @@ input AuthorNameCondition {
70
70
  lte: AuthorName
71
71
  gt: AuthorName
72
72
  gte: AuthorName
73
+ contains: String
74
+ startsWith: String
75
+ endsWith: String
76
+ containsCI: String
77
+ startsWithCI: String
78
+ endsWithCI: String
73
79
  }
74
80
 
75
81
  input AuthorOrderBy {
@@ -0,0 +1,257 @@
1
+ type Query {
2
+ getFoo(by: FooUniqueWhere!, filter: FooWhere): Foo
3
+ listFoo(filter: FooWhere, orderBy: [FooOrderBy!], offset: Int, limit: Int): [Foo!]!
4
+ paginateFoo(filter: FooWhere, orderBy: [FooOrderBy!], skip: Int, first: Int): FooConnection!
5
+ validateCreateFoo(data: FooCreateInput!): _ValidationResult!
6
+ validateUpdateFoo(by: FooUniqueWhere!, data: FooUpdateInput!): _ValidationResult!
7
+ transaction: QueryTransaction
8
+ _info: Info
9
+ }
10
+
11
+ type Foo {
12
+ _meta: FooMeta
13
+ id: UUID!
14
+ stringArrayValue: [String!]
15
+ enumArrayValue: [FooEnumArrayValue!]
16
+ intArrayValue: [Int!]
17
+ }
18
+
19
+ type FooMeta {
20
+ id: FieldMeta
21
+ stringArrayValue: FieldMeta
22
+ enumArrayValue: FieldMeta
23
+ intArrayValue: FieldMeta
24
+ }
25
+
26
+ type FieldMeta {
27
+ readable: Boolean
28
+ updatable: Boolean
29
+ }
30
+
31
+ scalar UUID
32
+
33
+ enum FooEnumArrayValue {
34
+ a
35
+ b
36
+ c
37
+ }
38
+
39
+ input FooUniqueWhere {
40
+ id: UUID
41
+ }
42
+
43
+ input FooWhere {
44
+ id: UUIDCondition
45
+ stringArrayValue: StringListCondition
46
+ enumArrayValue: FooEnumArrayValueEnumListCondition
47
+ intArrayValue: IntListCondition
48
+ and: [FooWhere]
49
+ or: [FooWhere]
50
+ not: FooWhere
51
+ }
52
+
53
+ input UUIDCondition {
54
+ and: [UUIDCondition!]
55
+ or: [UUIDCondition!]
56
+ not: UUIDCondition
57
+ null: Boolean
58
+ isNull: Boolean
59
+ eq: UUID
60
+ notEq: UUID
61
+ in: [UUID!]
62
+ notIn: [UUID!]
63
+ lt: UUID
64
+ lte: UUID
65
+ gt: UUID
66
+ gte: UUID
67
+ }
68
+
69
+ input StringListCondition {
70
+ and: [StringListCondition!]
71
+ or: [StringListCondition!]
72
+ not: StringListCondition
73
+ null: Boolean
74
+ isNull: Boolean
75
+ minLength: Int
76
+ maxLength: Int
77
+ includes: String
78
+ }
79
+
80
+ input FooEnumArrayValueEnumListCondition {
81
+ and: [FooEnumArrayValueEnumListCondition!]
82
+ or: [FooEnumArrayValueEnumListCondition!]
83
+ not: FooEnumArrayValueEnumListCondition
84
+ null: Boolean
85
+ isNull: Boolean
86
+ minLength: Int
87
+ maxLength: Int
88
+ includes: FooEnumArrayValue
89
+ }
90
+
91
+ input IntListCondition {
92
+ and: [IntListCondition!]
93
+ or: [IntListCondition!]
94
+ not: IntListCondition
95
+ null: Boolean
96
+ isNull: Boolean
97
+ minLength: Int
98
+ maxLength: Int
99
+ includes: Int
100
+ }
101
+
102
+ input FooOrderBy {
103
+ _random: Boolean
104
+ _randomSeeded: Int
105
+ id: OrderDirection
106
+ }
107
+
108
+ enum OrderDirection {
109
+ asc
110
+ desc
111
+ ascNullsFirst
112
+ descNullsLast
113
+ }
114
+
115
+ type FooConnection {
116
+ pageInfo: PageInfo!
117
+ edges: [FooEdge!]!
118
+ }
119
+
120
+ type PageInfo {
121
+ totalCount: Int!
122
+ }
123
+
124
+ type FooEdge {
125
+ node: Foo!
126
+ }
127
+
128
+ type _ValidationResult {
129
+ valid: Boolean!
130
+ errors: [_ValidationError!]!
131
+ }
132
+
133
+ type _ValidationError {
134
+ path: [_PathFragment!]!
135
+ message: _ValidationMessage!
136
+ }
137
+
138
+ union _PathFragment = _FieldPathFragment | _IndexPathFragment
139
+
140
+ type _FieldPathFragment {
141
+ field: String!
142
+ }
143
+
144
+ type _IndexPathFragment {
145
+ index: Int!
146
+ alias: String
147
+ }
148
+
149
+ type _ValidationMessage {
150
+ text: String!
151
+ }
152
+
153
+ input FooCreateInput {
154
+ stringArrayValue: [String!]
155
+ enumArrayValue: [FooEnumArrayValue!]
156
+ intArrayValue: [Int!]
157
+ _dummy_field_: Boolean
158
+ }
159
+
160
+ input FooUpdateInput {
161
+ stringArrayValue: [String!]
162
+ enumArrayValue: [FooEnumArrayValue!]
163
+ intArrayValue: [Int!]
164
+ _dummy_field_: Boolean
165
+ }
166
+
167
+ type QueryTransaction {
168
+ getFoo(by: FooUniqueWhere!, filter: FooWhere): Foo
169
+ listFoo(filter: FooWhere, orderBy: [FooOrderBy!], offset: Int, limit: Int): [Foo!]!
170
+ paginateFoo(filter: FooWhere, orderBy: [FooOrderBy!], skip: Int, first: Int): FooConnection!
171
+ validateCreateFoo(data: FooCreateInput!): _ValidationResult!
172
+ validateUpdateFoo(by: FooUniqueWhere!, data: FooUpdateInput!): _ValidationResult!
173
+ }
174
+
175
+ type Info {
176
+ description: String
177
+ }
178
+
179
+ type Mutation {
180
+ createFoo(data: FooCreateInput!): FooCreateResult!
181
+ deleteFoo(by: FooUniqueWhere!, filter: FooWhere): FooDeleteResult!
182
+ updateFoo(by: FooUniqueWhere!, filter: FooWhere, data: FooUpdateInput!): FooUpdateResult!
183
+ upsertFoo(by: FooUniqueWhere!, filter: FooWhere, update: FooUpdateInput!, create: FooCreateInput!): FooUpsertResult!
184
+ transaction(options: MutationTransactionOptions): MutationTransaction!
185
+ query: Query!
186
+ }
187
+
188
+ type FooCreateResult implements MutationResult {
189
+ ok: Boolean!
190
+ errorMessage: String
191
+ errors: [_MutationError!]!
192
+ node: Foo
193
+ validation: _ValidationResult!
194
+ }
195
+
196
+ interface MutationResult {
197
+ ok: Boolean!
198
+ errorMessage: String
199
+ errors: [_MutationError!]!
200
+ }
201
+
202
+ type _MutationError {
203
+ path: [_PathFragment!]! @deprecated(reason: "Use `paths`.")
204
+ paths: [[_PathFragment!]!]!
205
+ type: _MutationErrorType!
206
+ message: String
207
+ }
208
+
209
+ enum _MutationErrorType {
210
+ NotNullConstraintViolation
211
+ UniqueConstraintViolation
212
+ ForeignKeyConstraintViolation
213
+ NotFoundOrDenied
214
+ NonUniqueWhereInput
215
+ InvalidDataInput
216
+ SqlError
217
+ }
218
+
219
+ type FooDeleteResult implements MutationResult {
220
+ ok: Boolean!
221
+ errorMessage: String
222
+ errors: [_MutationError!]!
223
+ node: Foo
224
+ }
225
+
226
+ type FooUpdateResult implements MutationResult {
227
+ ok: Boolean!
228
+ errorMessage: String
229
+ errors: [_MutationError!]!
230
+ node: Foo
231
+ validation: _ValidationResult!
232
+ }
233
+
234
+ type FooUpsertResult implements MutationResult {
235
+ ok: Boolean!
236
+ errorMessage: String
237
+ errors: [_MutationError!]!
238
+ node: Foo
239
+ validation: _ValidationResult!
240
+ }
241
+
242
+ type MutationTransaction {
243
+ ok: Boolean!
244
+ errorMessage: String
245
+ errors: [_MutationError!]!
246
+ validation: _ValidationResult!
247
+ createFoo(data: FooCreateInput!): FooCreateResult!
248
+ deleteFoo(by: FooUniqueWhere!, filter: FooWhere): FooDeleteResult!
249
+ updateFoo(by: FooUniqueWhere!, filter: FooWhere, data: FooUpdateInput!): FooUpdateResult!
250
+ upsertFoo(by: FooUniqueWhere!, filter: FooWhere, update: FooUpdateInput!, create: FooCreateInput!): FooUpsertResult!
251
+ query: Query
252
+ }
253
+
254
+ input MutationTransactionOptions {
255
+ deferForeignKeyConstraints: Boolean
256
+ deferUniqueConstraints: Boolean
257
+ }