@webiny/api-headless-cms 6.4.5 → 6.6.0-alpha.0

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 (666) hide show
  1. package/HeadlessCmsContextualSchema.d.ts +16 -0
  2. package/HeadlessCmsContextualSchema.js +32 -0
  3. package/HeadlessCmsContextualSchema.js.map +1 -0
  4. package/HeadlessCmsEndpointConfig.d.ts +10 -0
  5. package/HeadlessCmsEndpointConfig.js +5 -0
  6. package/HeadlessCmsEndpointConfig.js.map +1 -0
  7. package/HeadlessCmsFeature.d.ts +10 -0
  8. package/HeadlessCmsFeature.js +192 -0
  9. package/HeadlessCmsFeature.js.map +1 -0
  10. package/createCmsRoute.d.ts +21 -0
  11. package/createCmsRoute.js +49 -0
  12. package/createCmsRoute.js.map +1 -0
  13. package/crud/contentEntry/entryDataValidation.d.ts +1 -1
  14. package/crud/contentEntry/entryDataValidation.js +2 -15
  15. package/crud/contentEntry/entryDataValidation.js.map +1 -1
  16. package/crud/contentEntry/references/validateEntries.d.ts +1 -1
  17. package/crud/contentEntry/references/validateEntries.js +17 -7
  18. package/crud/contentEntry/references/validateEntries.js.map +1 -1
  19. package/crud/contentEntry.crud.js +22 -20
  20. package/crud/contentEntry.crud.js.map +1 -1
  21. package/crud/contentModel.crud.js +8 -6
  22. package/crud/contentModel.crud.js.map +1 -1
  23. package/crud/contentModelGroup.crud.js +7 -5
  24. package/crud/contentModelGroup.crud.js.map +1 -1
  25. package/domain/contentModel/schemas.d.ts +6 -6
  26. package/domain/contentModel/schemas.js +1 -1
  27. package/domain/contentModel/schemas.js.map +1 -1
  28. package/domain/contentModel/validation/modelFields.js +21 -15
  29. package/domain/contentModel/validation/modelFields.js.map +1 -1
  30. package/export/abstractions.d.ts +9 -0
  31. package/export/abstractions.js +6 -0
  32. package/export/abstractions.js.map +1 -0
  33. package/export/crud/exporting.js +8 -2
  34. package/export/crud/exporting.js.map +1 -1
  35. package/export/crud/importing.js +13 -4
  36. package/export/crud/importing.js.map +1 -1
  37. package/export/crud/imports/importGroups.js +23 -23
  38. package/export/crud/imports/importGroups.js.map +1 -1
  39. package/export/crud/imports/importModels.js +25 -22
  40. package/export/crud/imports/importModels.js.map +1 -1
  41. package/export/graphql/index.d.ts +2 -3
  42. package/export/graphql/index.js +6 -10
  43. package/export/graphql/index.js.map +1 -1
  44. package/exports/api/cms/storage.d.ts +0 -1
  45. package/exports/api/cms/storage.js +0 -1
  46. package/features/contentEntry/CreateEntry/CreateEntryRepository.d.ts +6 -4
  47. package/features/contentEntry/CreateEntry/CreateEntryRepository.js +7 -8
  48. package/features/contentEntry/CreateEntry/CreateEntryRepository.js.map +1 -1
  49. package/features/contentEntry/CreateEntry/CreateEntryUseCase.d.ts +3 -1
  50. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js +2 -3
  51. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js.map +1 -1
  52. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.d.ts +6 -4
  53. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js +7 -8
  54. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js.map +1 -1
  55. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.d.ts +3 -1
  56. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js +2 -3
  57. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js.map +1 -1
  58. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.d.ts +6 -4
  59. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js +7 -8
  60. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js.map +1 -1
  61. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.d.ts +3 -1
  62. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js +2 -3
  63. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js.map +1 -1
  64. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.d.ts +6 -4
  65. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js +7 -8
  66. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js.map +1 -1
  67. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.d.ts +3 -1
  68. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js +2 -3
  69. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js.map +1 -1
  70. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.d.ts +3 -3
  71. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js +5 -5
  72. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js.map +1 -1
  73. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.d.ts +6 -4
  74. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js +7 -8
  75. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js.map +1 -1
  76. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.d.ts +3 -1
  77. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js +2 -3
  78. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js.map +1 -1
  79. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.d.ts +6 -4
  80. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js +7 -8
  81. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js.map +1 -1
  82. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.d.ts +3 -1
  83. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js +2 -3
  84. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js.map +1 -1
  85. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.d.ts +6 -4
  86. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js +7 -8
  87. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js.map +1 -1
  88. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.d.ts +3 -1
  89. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js +2 -3
  90. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js.map +1 -1
  91. package/features/contentEntry/GetEntry/GetEntryUseCase.d.ts +3 -1
  92. package/features/contentEntry/GetEntry/GetEntryUseCase.js +2 -3
  93. package/features/contentEntry/GetEntry/GetEntryUseCase.js.map +1 -1
  94. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.d.ts +3 -1
  95. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js +2 -3
  96. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js.map +1 -1
  97. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.d.ts +6 -4
  98. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js +7 -8
  99. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js.map +1 -1
  100. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.d.ts +3 -1
  101. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js +2 -3
  102. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js.map +1 -1
  103. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.d.ts +3 -1
  104. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js +2 -3
  105. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js.map +1 -1
  106. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.d.ts +6 -4
  107. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js +7 -8
  108. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js.map +1 -1
  109. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.d.ts +3 -1
  110. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js +2 -3
  111. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js.map +1 -1
  112. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.d.ts +3 -1
  113. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js +1 -3
  114. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js.map +1 -1
  115. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.d.ts +3 -1
  116. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js +2 -3
  117. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js.map +1 -1
  118. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.d.ts +3 -1
  119. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js +2 -3
  120. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js.map +1 -1
  121. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.d.ts +6 -4
  122. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js +7 -8
  123. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js.map +1 -1
  124. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.d.ts +3 -1
  125. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js +2 -3
  126. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js.map +1 -1
  127. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.d.ts +6 -4
  128. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js +7 -8
  129. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js.map +1 -1
  130. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.d.ts +3 -1
  131. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js +2 -3
  132. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js.map +1 -1
  133. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.d.ts +6 -4
  134. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js +7 -8
  135. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js.map +1 -1
  136. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.d.ts +3 -1
  137. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js +2 -3
  138. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js.map +1 -1
  139. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.d.ts +6 -4
  140. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js +7 -8
  141. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js.map +1 -1
  142. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.d.ts +3 -1
  143. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js +1 -3
  144. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js.map +1 -1
  145. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.d.ts +6 -4
  146. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js +7 -8
  147. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js.map +1 -1
  148. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.d.ts +3 -1
  149. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js +2 -3
  150. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js.map +1 -1
  151. package/features/contentEntry/GetSingletonEntry/GetSingletonEntryUseCase.js +1 -3
  152. package/features/contentEntry/GetSingletonEntry/GetSingletonEntryUseCase.js.map +1 -1
  153. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.d.ts +6 -4
  154. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js +7 -8
  155. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js.map +1 -1
  156. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.d.ts +6 -2
  157. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js +8 -6
  158. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js.map +1 -1
  159. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.d.ts +3 -1
  160. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js +1 -3
  161. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js.map +1 -1
  162. package/features/contentEntry/ListEntries/ListEntriesRepository.d.ts +6 -4
  163. package/features/contentEntry/ListEntries/ListEntriesRepository.js +7 -8
  164. package/features/contentEntry/ListEntries/ListEntriesRepository.js.map +1 -1
  165. package/features/contentEntry/ListEntries/ListEntriesUseCase.d.ts +3 -1
  166. package/features/contentEntry/ListEntries/ListEntriesUseCase.js +2 -3
  167. package/features/contentEntry/ListEntries/ListEntriesUseCase.js.map +1 -1
  168. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.d.ts +3 -1
  169. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js +1 -3
  170. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js.map +1 -1
  171. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.d.ts +3 -1
  172. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js +1 -3
  173. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js.map +1 -1
  174. package/features/contentEntry/MoveEntry/MoveEntryRepository.d.ts +6 -4
  175. package/features/contentEntry/MoveEntry/MoveEntryRepository.js +7 -8
  176. package/features/contentEntry/MoveEntry/MoveEntryRepository.js.map +1 -1
  177. package/features/contentEntry/MoveEntry/MoveEntryUseCase.d.ts +3 -1
  178. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js +2 -3
  179. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js.map +1 -1
  180. package/features/contentEntry/PublishEntry/PublishEntryRepository.d.ts +6 -4
  181. package/features/contentEntry/PublishEntry/PublishEntryRepository.js +7 -8
  182. package/features/contentEntry/PublishEntry/PublishEntryRepository.js.map +1 -1
  183. package/features/contentEntry/PublishEntry/PublishEntryUseCase.d.ts +3 -1
  184. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js +2 -3
  185. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js.map +1 -1
  186. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.d.ts +8 -4
  187. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js +11 -9
  188. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js.map +1 -1
  189. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.d.ts +3 -1
  190. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js +2 -3
  191. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js.map +1 -1
  192. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.d.ts +6 -4
  193. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js +7 -8
  194. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js.map +1 -1
  195. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.d.ts +3 -1
  196. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js +2 -3
  197. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js.map +1 -1
  198. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.d.ts +6 -4
  199. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js +7 -8
  200. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js.map +1 -1
  201. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.d.ts +3 -1
  202. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js +2 -3
  203. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js.map +1 -1
  204. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.d.ts +6 -4
  205. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js +7 -8
  206. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js.map +1 -1
  207. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.d.ts +3 -1
  208. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js +2 -3
  209. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js.map +1 -1
  210. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.d.ts +3 -1
  211. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js +2 -3
  212. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js.map +1 -1
  213. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.d.ts +3 -1
  214. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js +2 -3
  215. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js.map +1 -1
  216. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.d.ts +3 -1
  217. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js +2 -4
  218. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js.map +1 -1
  219. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.d.ts +4 -4
  220. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js +4 -8
  221. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js.map +1 -1
  222. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.d.ts +3 -1
  223. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js +1 -3
  224. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js.map +1 -1
  225. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.d.ts +3 -1
  226. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js +1 -3
  227. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js.map +1 -1
  228. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.d.ts +3 -1
  229. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js +1 -3
  230. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js.map +1 -1
  231. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.d.ts +3 -1
  232. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js +2 -4
  233. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js.map +1 -1
  234. package/features/contentModel/ContentModelFeature.js +2 -0
  235. package/features/contentModel/ContentModelFeature.js.map +1 -1
  236. package/features/contentModel/CreateModel/CreateModelRepository.d.ts +4 -3
  237. package/features/contentModel/CreateModel/CreateModelRepository.js +6 -5
  238. package/features/contentModel/CreateModel/CreateModelRepository.js.map +1 -1
  239. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.d.ts +4 -3
  240. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js +6 -5
  241. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js.map +1 -1
  242. package/features/contentModel/DeleteModel/DeleteModelRepository.d.ts +3 -3
  243. package/features/contentModel/DeleteModel/DeleteModelRepository.js +5 -5
  244. package/features/contentModel/DeleteModel/DeleteModelRepository.js.map +1 -1
  245. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.d.ts +1 -0
  246. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js +11 -8
  247. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js.map +1 -1
  248. package/features/contentModel/UpdateModel/UpdateModelRepository.d.ts +6 -3
  249. package/features/contentModel/UpdateModel/UpdateModelRepository.js +11 -7
  250. package/features/contentModel/UpdateModel/UpdateModelRepository.js.map +1 -1
  251. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.d.ts +16 -0
  252. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js +51 -0
  253. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js.map +1 -0
  254. package/features/contentModel/ValuesSelectionGenerator/abstractions.d.ts +8 -0
  255. package/features/contentModel/ValuesSelectionGenerator/abstractions.js +5 -0
  256. package/features/contentModel/ValuesSelectionGenerator/abstractions.js.map +1 -0
  257. package/features/contentModel/ValuesSelectionGenerator/feature.d.ts +4 -0
  258. package/features/contentModel/ValuesSelectionGenerator/feature.js +11 -0
  259. package/features/contentModel/ValuesSelectionGenerator/feature.js.map +1 -0
  260. package/features/contentModel/ValuesSelectionGenerator/index.d.ts +1 -0
  261. package/features/contentModel/ValuesSelectionGenerator/index.js +1 -0
  262. package/features/contentModel/shared/ModelsFetcher.d.ts +3 -3
  263. package/features/contentModel/shared/ModelsFetcher.js +5 -5
  264. package/features/contentModel/shared/ModelsFetcher.js.map +1 -1
  265. package/features/contentModel/shared/PluginModelsProvider.d.ts +5 -4
  266. package/features/contentModel/shared/PluginModelsProvider.js +11 -8
  267. package/features/contentModel/shared/PluginModelsProvider.js.map +1 -1
  268. package/features/contentModel/shared/abstractions.d.ts +10 -0
  269. package/features/contentModel/shared/abstractions.js +2 -1
  270. package/features/contentModel/shared/abstractions.js.map +1 -1
  271. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.d.ts +8 -4
  272. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js +13 -11
  273. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js.map +1 -1
  274. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.d.ts +3 -1
  275. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js +2 -3
  276. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js.map +1 -1
  277. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.d.ts +8 -4
  278. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js +11 -9
  279. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js.map +1 -1
  280. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.d.ts +3 -1
  281. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js +2 -3
  282. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js.map +1 -1
  283. package/features/contentModelGroup/GetGroup/GetGroupRepository.d.ts +6 -4
  284. package/features/contentModelGroup/GetGroup/GetGroupRepository.js +9 -9
  285. package/features/contentModelGroup/GetGroup/GetGroupRepository.js.map +1 -1
  286. package/features/contentModelGroup/GetGroup/GetGroupUseCase.d.ts +3 -1
  287. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js +2 -3
  288. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js.map +1 -1
  289. package/features/contentModelGroup/ListGroups/ListGroupsRepository.d.ts +6 -4
  290. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js +9 -9
  291. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js.map +1 -1
  292. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.d.ts +3 -1
  293. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js +2 -3
  294. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js.map +1 -1
  295. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.d.ts +6 -4
  296. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js +7 -8
  297. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js.map +1 -1
  298. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.d.ts +3 -1
  299. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js +2 -3
  300. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js.map +1 -1
  301. package/features/contentModelGroup/shared/PluginGroupsProvider.d.ts +6 -4
  302. package/features/contentModelGroup/shared/PluginGroupsProvider.js +13 -11
  303. package/features/contentModelGroup/shared/PluginGroupsProvider.js.map +1 -1
  304. package/features/contentModelGroup/shared/abstractions.d.ts +10 -0
  305. package/features/contentModelGroup/shared/abstractions.js +2 -1
  306. package/features/contentModelGroup/shared/abstractions.js.map +1 -1
  307. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.d.ts +2 -2
  308. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.js.map +1 -1
  309. package/features/graphql/fields/base/DynamicZoneToGraphQL.js.map +1 -1
  310. package/features/graphql/fields/base/RefToGraphQL.d.ts +1 -1
  311. package/features/graphql/fields/base/RefToGraphQL.js +3 -1
  312. package/features/graphql/fields/base/RefToGraphQL.js.map +1 -1
  313. package/features/graphql/fields/base/richText/richTextResolver.d.ts +1 -1
  314. package/features/graphql/fields/base/richText/richTextResolver.js.map +1 -1
  315. package/features/modelBuilder/fields/BaseFieldBuilder.d.ts +1 -3
  316. package/features/modelBuilder/fields/BaseFieldBuilder.js +0 -4
  317. package/features/modelBuilder/fields/BaseFieldBuilder.js.map +1 -1
  318. package/features/modelBuilder/fields/DataFieldBuilder.d.ts +12 -18
  319. package/features/modelBuilder/fields/DataFieldBuilder.js +1 -2
  320. package/features/modelBuilder/fields/DataFieldBuilder.js.map +1 -1
  321. package/features/modelBuilder/fields/DynamicZoneFieldType.js +3 -8
  322. package/features/modelBuilder/fields/DynamicZoneFieldType.js.map +1 -1
  323. package/features/modelBuilder/fields/TextFieldType.d.ts +3 -1
  324. package/features/modelBuilder/fields/TextFieldType.js +1 -3
  325. package/features/modelBuilder/fields/TextFieldType.js.map +1 -1
  326. package/features/modelBuilder/fields/UiAlertFieldType.js +1 -2
  327. package/features/modelBuilder/fields/UiAlertFieldType.js.map +1 -1
  328. package/features/modelBuilder/fields/UiSeparatorFieldType.js +1 -2
  329. package/features/modelBuilder/fields/UiSeparatorFieldType.js.map +1 -1
  330. package/features/modelBuilder/fields/UiTabsFieldType.d.ts +1 -2
  331. package/features/modelBuilder/fields/UiTabsFieldType.js +3 -6
  332. package/features/modelBuilder/fields/UiTabsFieldType.js.map +1 -1
  333. package/features/shared/abstractions.d.ts +11 -15
  334. package/features/shared/abstractions.js +3 -3
  335. package/features/shared/abstractions.js.map +1 -1
  336. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.d.ts +8 -0
  337. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js +5 -0
  338. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js.map +1 -0
  339. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.d.ts +8 -0
  340. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js +5 -0
  341. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js.map +1 -0
  342. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.d.ts +8 -0
  343. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js +5 -0
  344. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js.map +1 -0
  345. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.d.ts +8 -0
  346. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js +5 -0
  347. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js.map +1 -0
  348. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.d.ts +8 -0
  349. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js +5 -0
  350. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js.map +1 -0
  351. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.d.ts +8 -0
  352. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js +5 -0
  353. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js.map +1 -0
  354. package/features/shared/storageOperations/entry/GetEntryStorageOperation.d.ts +8 -0
  355. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js +5 -0
  356. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js.map +1 -0
  357. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.d.ts +8 -0
  358. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js +5 -0
  359. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js.map +1 -0
  360. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.d.ts +8 -0
  361. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js +5 -0
  362. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js.map +1 -0
  363. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.d.ts +8 -0
  364. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js +5 -0
  365. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js.map +1 -0
  366. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.d.ts +8 -0
  367. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js +5 -0
  368. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js.map +1 -0
  369. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.d.ts +8 -0
  370. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js +5 -0
  371. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js.map +1 -0
  372. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.d.ts +8 -0
  373. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js +5 -0
  374. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js.map +1 -0
  375. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.d.ts +8 -0
  376. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js +5 -0
  377. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js.map +1 -0
  378. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.d.ts +8 -0
  379. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js +5 -0
  380. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js.map +1 -0
  381. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.d.ts +8 -0
  382. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js +5 -0
  383. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js.map +1 -0
  384. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.d.ts +8 -0
  385. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js +5 -0
  386. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js.map +1 -0
  387. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.d.ts +8 -0
  388. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js +5 -0
  389. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js.map +1 -0
  390. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.d.ts +8 -0
  391. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js +5 -0
  392. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js.map +1 -0
  393. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.d.ts +8 -0
  394. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js +5 -0
  395. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js.map +1 -0
  396. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.d.ts +8 -0
  397. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js +5 -0
  398. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js.map +1 -0
  399. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.d.ts +8 -0
  400. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js +5 -0
  401. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js.map +1 -0
  402. package/features/shared/storageOperations/group/CreateGroupStorageOperation.d.ts +8 -0
  403. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js +5 -0
  404. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js.map +1 -0
  405. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.d.ts +8 -0
  406. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js +5 -0
  407. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js.map +1 -0
  408. package/features/shared/storageOperations/group/GetGroupStorageOperation.d.ts +8 -0
  409. package/features/shared/storageOperations/group/GetGroupStorageOperation.js +5 -0
  410. package/features/shared/storageOperations/group/GetGroupStorageOperation.js.map +1 -0
  411. package/features/shared/storageOperations/group/ListGroupsStorageOperation.d.ts +8 -0
  412. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js +5 -0
  413. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js.map +1 -0
  414. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.d.ts +8 -0
  415. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js +5 -0
  416. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js.map +1 -0
  417. package/features/shared/storageOperations/index.d.ts +32 -0
  418. package/features/shared/storageOperations/index.js +32 -0
  419. package/features/shared/storageOperations/model/CreateModelStorageOperation.d.ts +8 -0
  420. package/features/shared/storageOperations/model/CreateModelStorageOperation.js +5 -0
  421. package/features/shared/storageOperations/model/CreateModelStorageOperation.js.map +1 -0
  422. package/features/shared/storageOperations/model/DeleteModelStorageOperation.d.ts +8 -0
  423. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js +5 -0
  424. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js.map +1 -0
  425. package/features/shared/storageOperations/model/GetModelStorageOperation.d.ts +8 -0
  426. package/features/shared/storageOperations/model/GetModelStorageOperation.js +5 -0
  427. package/features/shared/storageOperations/model/GetModelStorageOperation.js.map +1 -0
  428. package/features/shared/storageOperations/model/ListModelsStorageOperation.d.ts +8 -0
  429. package/features/shared/storageOperations/model/ListModelsStorageOperation.js +5 -0
  430. package/features/shared/storageOperations/model/ListModelsStorageOperation.js.map +1 -0
  431. package/features/shared/storageOperations/model/UpdateModelStorageOperation.d.ts +8 -0
  432. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js +5 -0
  433. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js.map +1 -0
  434. package/fieldConverters/abstractions.d.ts +14 -0
  435. package/fieldConverters/abstractions.js +13 -0
  436. package/fieldConverters/abstractions.js.map +1 -0
  437. package/fieldConverters/index.d.ts +1 -1
  438. package/graphql/CmsGraphQLSchemaFactory.d.ts +8 -0
  439. package/graphql/CmsGraphQLSchemaFactory.js +5 -0
  440. package/graphql/CmsGraphQLSchemaFactory.js.map +1 -0
  441. package/graphql/CmsSchemaExecutor.d.ts +10 -0
  442. package/graphql/CmsSchemaExecutor.js +5 -0
  443. package/graphql/CmsSchemaExecutor.js.map +1 -0
  444. package/graphql/buildSchemaPlugins.d.ts +2 -1
  445. package/graphql/buildSchemaPlugins.js +1 -3
  446. package/graphql/buildSchemaPlugins.js.map +1 -1
  447. package/graphql/checkEndpointAccess.js +5 -2
  448. package/graphql/checkEndpointAccess.js.map +1 -1
  449. package/graphql/createExecutableSchema.d.ts +1 -1
  450. package/graphql/createExecutableSchema.js +1 -1
  451. package/graphql/createExecutableSchema.js.map +1 -1
  452. package/graphql/generateSchema.d.ts +2 -1
  453. package/graphql/generateSchema.js +14 -5
  454. package/graphql/generateSchema.js.map +1 -1
  455. package/graphql/getSchema.js +7 -2
  456. package/graphql/getSchema.js.map +1 -1
  457. package/graphql/scalars/RevisionIdScalarPlugin.d.ts +1 -1
  458. package/graphql/scalars/RevisionIdScalarPlugin.js.map +1 -1
  459. package/graphql/schema/baseContentSchema.d.ts +1 -6
  460. package/graphql/schema/baseContentSchema.js +5 -8
  461. package/graphql/schema/baseContentSchema.js.map +1 -1
  462. package/graphql/schema/baseSchema.d.ts +2 -2
  463. package/graphql/schema/baseSchema.js +6 -41
  464. package/graphql/schema/baseSchema.js.map +1 -1
  465. package/graphql/schema/cms/CmsBaseErrorTypeFactory.d.ts +14 -0
  466. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js +21 -0
  467. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js.map +1 -0
  468. package/graphql/schema/cms/createEntryResolver.js +2 -2
  469. package/graphql/schema/cms/createEntryResolver.js.map +1 -1
  470. package/graphql/schema/cms/deleteEntryResolver.js +2 -2
  471. package/graphql/schema/cms/deleteEntryResolver.js.map +1 -1
  472. package/graphql/schema/cms/getEntryResolver.js +2 -2
  473. package/graphql/schema/cms/getEntryResolver.js.map +1 -1
  474. package/graphql/schema/cms/helpers/getModel.d.ts +0 -3
  475. package/graphql/schema/cms/helpers/getModel.js +5 -3
  476. package/graphql/schema/cms/helpers/getModel.js.map +1 -1
  477. package/graphql/schema/cms/helpers/transformWhereToNested.js +17 -39
  478. package/graphql/schema/cms/helpers/transformWhereToNested.js.map +1 -1
  479. package/graphql/schema/cms/listEntriesResolver.js +2 -2
  480. package/graphql/schema/cms/listEntriesResolver.js.map +1 -1
  481. package/graphql/schema/cms/publishEntryResolver.js +2 -2
  482. package/graphql/schema/cms/publishEntryResolver.js.map +1 -1
  483. package/graphql/schema/cms/resolvers/createEntry.d.ts +2 -2
  484. package/graphql/schema/cms/resolvers/createEntry.js +1 -1
  485. package/graphql/schema/cms/resolvers/createEntry.js.map +1 -1
  486. package/graphql/schema/cms/resolvers/deleteEntryRevision.d.ts +2 -2
  487. package/graphql/schema/cms/resolvers/deleteEntryRevision.js +1 -1
  488. package/graphql/schema/cms/resolvers/deleteEntryRevision.js.map +1 -1
  489. package/graphql/schema/cms/resolvers/getEntry.d.ts +2 -2
  490. package/graphql/schema/cms/resolvers/getEntry.js +1 -1
  491. package/graphql/schema/cms/resolvers/getEntry.js.map +1 -1
  492. package/graphql/schema/cms/resolvers/listEntries.d.ts +2 -2
  493. package/graphql/schema/cms/resolvers/listEntries.js +1 -1
  494. package/graphql/schema/cms/resolvers/listEntries.js.map +1 -1
  495. package/graphql/schema/cms/resolvers/mutationCms.d.ts +2 -2
  496. package/graphql/schema/cms/resolvers/mutationCms.js +1 -1
  497. package/graphql/schema/cms/resolvers/mutationCms.js.map +1 -1
  498. package/graphql/schema/cms/resolvers/publishEntryRevision.d.ts +2 -2
  499. package/graphql/schema/cms/resolvers/publishEntryRevision.js +1 -1
  500. package/graphql/schema/cms/resolvers/publishEntryRevision.js.map +1 -1
  501. package/graphql/schema/cms/resolvers/queryCms.d.ts +2 -2
  502. package/graphql/schema/cms/resolvers/queryCms.js +1 -1
  503. package/graphql/schema/cms/resolvers/queryCms.js.map +1 -1
  504. package/graphql/schema/cms/resolvers/unpublishEntryRevision.d.ts +2 -2
  505. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js +1 -1
  506. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js.map +1 -1
  507. package/graphql/schema/cms/resolvers/updateEntryRevision.d.ts +2 -2
  508. package/graphql/schema/cms/resolvers/updateEntryRevision.js +1 -1
  509. package/graphql/schema/cms/resolvers/updateEntryRevision.js.map +1 -1
  510. package/graphql/schema/cms/typeDefs/mutation.d.ts +2 -2
  511. package/graphql/schema/cms/typeDefs/mutation.js +1 -1
  512. package/graphql/schema/cms/typeDefs/mutation.js.map +1 -1
  513. package/graphql/schema/cms/typeDefs/query.d.ts +2 -2
  514. package/graphql/schema/cms/typeDefs/query.js +1 -1
  515. package/graphql/schema/cms/typeDefs/query.js.map +1 -1
  516. package/graphql/schema/cms/typeDefs/responses.d.ts +2 -2
  517. package/graphql/schema/cms/typeDefs/responses.js +1 -1
  518. package/graphql/schema/cms/typeDefs/responses.js.map +1 -1
  519. package/graphql/schema/cms/unpublishEntryResolver.js +2 -2
  520. package/graphql/schema/cms/unpublishEntryResolver.js.map +1 -1
  521. package/graphql/schema/cms/updateEntryResolver.js +2 -2
  522. package/graphql/schema/cms/updateEntryResolver.js.map +1 -1
  523. package/graphql/schema/contentEntries.js +43 -32
  524. package/graphql/schema/contentEntries.js.map +1 -1
  525. package/graphql/schema/contentModelGroups.js +39 -18
  526. package/graphql/schema/contentModelGroups.js.map +1 -1
  527. package/graphql/schema/contentModels.js +37 -16
  528. package/graphql/schema/contentModels.js.map +1 -1
  529. package/graphql/schema/createFieldResolvers.d.ts +1 -1
  530. package/graphql/schema/createFieldResolvers.js.map +1 -1
  531. package/graphql/schema/createManageResolvers.js +4 -2
  532. package/graphql/schema/createManageResolvers.js.map +1 -1
  533. package/graphql/schema/resolvers/manage/resolveCreate.js +5 -3
  534. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
  535. package/graphql/schema/resolvers/manage/resolveCreateFrom.js +5 -3
  536. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
  537. package/graphql/schema/resolvers/manage/resolveDelete.js +9 -4
  538. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
  539. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +5 -3
  540. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -1
  541. package/graphql/schema/resolvers/manage/resolveGet.js +11 -6
  542. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
  543. package/graphql/schema/resolvers/manage/resolveGetByIds.js +5 -3
  544. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
  545. package/graphql/schema/resolvers/manage/resolveGetRevisions.js +5 -3
  546. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
  547. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +5 -3
  548. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -1
  549. package/graphql/schema/resolvers/manage/resolveList.js +5 -3
  550. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
  551. package/graphql/schema/resolvers/manage/resolveListDeleted.js +5 -3
  552. package/graphql/schema/resolvers/manage/resolveListDeleted.js.map +1 -1
  553. package/graphql/schema/resolvers/manage/resolveMove.js +4 -2
  554. package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -1
  555. package/graphql/schema/resolvers/manage/resolvePublish.js +5 -3
  556. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
  557. package/graphql/schema/resolvers/manage/resolveRepublish.js +5 -3
  558. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
  559. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js +5 -3
  560. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js.map +1 -1
  561. package/graphql/schema/resolvers/manage/resolveUnpublish.js +5 -3
  562. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
  563. package/graphql/schema/resolvers/manage/resolveUpdate.js +5 -3
  564. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
  565. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js +5 -3
  566. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js.map +1 -1
  567. package/graphql/schema/resolvers/manage/resolveValidate.js +5 -3
  568. package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -1
  569. package/graphql/schema/resolvers/preview/resolveGet.js +6 -3
  570. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
  571. package/graphql/schema/resolvers/preview/resolveList.js +5 -3
  572. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
  573. package/graphql/schema/resolvers/read/resolveGet.js +5 -2
  574. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
  575. package/graphql/schema/resolvers/read/resolveList.js +5 -3
  576. package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
  577. package/graphql/schema/resolvers/singular/resolveGet.js +1 -1
  578. package/graphql/schema/resolvers/singular/resolveGet.js.map +1 -1
  579. package/graphql/schema/resolvers/singular/resolveUpdate.js +1 -1
  580. package/graphql/schema/resolvers/singular/resolveUpdate.js.map +1 -1
  581. package/graphql/schema/schemaPlugins.d.ts +2 -1
  582. package/graphql/schema/schemaPlugins.js +2 -4
  583. package/graphql/schema/schemaPlugins.js.map +1 -1
  584. package/index.d.ts +7 -6
  585. package/index.js +4 -22
  586. package/legacy/abstractions.js.map +1 -1
  587. package/package.json +22 -27
  588. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.d.ts +2 -2
  589. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js +1 -1
  590. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js.map +1 -1
  591. package/plugins/index.d.ts +0 -1
  592. package/plugins/index.js +0 -1
  593. package/types/fields/dynamicZoneField.d.ts +2 -2
  594. package/types/modelField.d.ts +1 -1
  595. package/types/types.d.ts +10 -183
  596. package/types/types.js.map +1 -1
  597. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.d.ts +28 -0
  598. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js +324 -0
  599. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js.map +1 -0
  600. package/utils/contentModelToJsonSchema/index.d.ts +2 -0
  601. package/utils/contentModelToJsonSchema/index.js +1 -0
  602. package/utils/contentModelToJsonSchema/types.d.ts +24 -0
  603. package/utils/contentModelToJsonSchema/types.js +0 -0
  604. package/utils/converters/ConverterCollection.d.ts +2 -2
  605. package/utils/converters/ConverterCollection.js +1 -3
  606. package/utils/converters/ConverterCollection.js.map +1 -1
  607. package/utils/converters/valueKeyFromStorageConverter.d.ts +2 -2
  608. package/utils/converters/valueKeyFromStorageConverter.js +2 -2
  609. package/utils/converters/valueKeyFromStorageConverter.js.map +1 -1
  610. package/utils/converters/valueKeyStorageConverter.js +4 -2
  611. package/utils/converters/valueKeyStorageConverter.js.map +1 -1
  612. package/utils/converters/valueKeyToStorageConverter.d.ts +2 -2
  613. package/utils/converters/valueKeyToStorageConverter.js +2 -2
  614. package/utils/converters/valueKeyToStorageConverter.js.map +1 -1
  615. package/utils/getSchemaFromFieldPlugins.d.ts +2 -2
  616. package/utils/getSchemaFromFieldPlugins.js.map +1 -1
  617. package/utils/index.d.ts +1 -0
  618. package/utils/index.js +1 -0
  619. package/utils/isHeadlessCmsReady.d.ts +1 -1
  620. package/utils/isHeadlessCmsReady.js +3 -2
  621. package/utils/isHeadlessCmsReady.js.map +1 -1
  622. package/abstractions/entryHooks/OnEntryBeforeCreate.d.ts +0 -8
  623. package/abstractions/entryHooks/OnEntryBeforeCreate.js +0 -5
  624. package/abstractions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  625. package/abstractions/entryHooks/index.d.ts +0 -1
  626. package/abstractions/entryHooks/index.js +0 -1
  627. package/abstractions/index.d.ts +0 -1
  628. package/abstractions/index.js +0 -1
  629. package/context.d.ts +0 -3
  630. package/context.js +0 -131
  631. package/context.js.map +0 -1
  632. package/extensions/entryHooks/OnEntryBeforeCreate.d.ts +0 -4
  633. package/extensions/entryHooks/OnEntryBeforeCreate.js +0 -21
  634. package/extensions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  635. package/extensions/entryHooks/index.d.ts +0 -1
  636. package/extensions/entryHooks/index.js +0 -1
  637. package/extensions/index.d.ts +0 -5
  638. package/extensions/index.js +0 -7
  639. package/extensions/index.js.map +0 -1
  640. package/graphql/graphQLHandlerFactory.d.ts +0 -5
  641. package/graphql/graphQLHandlerFactory.js +0 -22
  642. package/graphql/graphQLHandlerFactory.js.map +0 -1
  643. package/graphql/handleRequest.d.ts +0 -11
  644. package/graphql/handleRequest.js +0 -62
  645. package/graphql/handleRequest.js.map +0 -1
  646. package/graphql/index.d.ts +0 -4
  647. package/graphql/index.js +0 -11
  648. package/graphql/index.js.map +0 -1
  649. package/graphql/schema/cms/index.d.ts +0 -2
  650. package/graphql/schema/cms/index.js +0 -24
  651. package/graphql/schema/cms/index.js.map +0 -1
  652. package/index.js.map +0 -1
  653. package/parameters/context.d.ts +0 -2
  654. package/parameters/context.js +0 -7
  655. package/parameters/context.js.map +0 -1
  656. package/parameters/header.d.ts +0 -2
  657. package/parameters/header.js +0 -13
  658. package/parameters/header.js.map +0 -1
  659. package/parameters/index.d.ts +0 -3
  660. package/parameters/index.js +0 -3
  661. package/parameters/path.d.ts +0 -2
  662. package/parameters/path.js +0 -12
  663. package/parameters/path.js.map +0 -1
  664. package/plugins/CmsParametersPlugin.d.ts +0 -18
  665. package/plugins/CmsParametersPlugin.js +0 -16
  666. package/plugins/CmsParametersPlugin.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/getSchema.js","sources":["../../src/graphql/getSchema.ts"],"sourcesContent":["import { codeFrameColumns } from \"@babel/code-frame\";\nimport WebinyError from \"@webiny/error\";\nimport { generateSchema } from \"./generateSchema.js\";\nimport type { ApiEndpoint, CmsContext } from \"~/types/index.js\";\nimport type { GraphQLSchema } from \"graphql\";\nimport { generateCacheId } from \"./getSchema/generateCacheId.js\";\nimport { generateCacheKey } from \"./getSchema/generateCacheKey.js\";\nimport type { Tenant } from \"@webiny/api-core/types/tenancy.js\";\n\ninterface SchemaCache {\n key: string;\n schema: GraphQLSchema;\n}\n\ninterface GetSchemaParams {\n context: CmsContext;\n type: ApiEndpoint;\n getTenant: () => Tenant;\n}\n\nconst schemaList = new Map<string, SchemaCache>();\n\n/**\n * Gets an existing schema or rewrites existing one or creates a completely new one\n * depending on the schemaId created from type\n */\nexport const getSchema = async (params: GetSchemaParams): Promise<GraphQLSchema> => {\n const { context } = params;\n\n /**\n * We need all the API models.\n * Private models are hidden in the GraphQL, so filter them out.\n */\n const models = await context.security.withoutAuthorization(async () => {\n return await context.cms.listModels({\n includePrivate: false,\n includePlugins: true\n });\n });\n\n const cacheId = generateCacheId(params);\n\n const cacheKey = await generateCacheKey({ ...params, models });\n const cachedSchema = schemaList.get(cacheId);\n if (cachedSchema?.key === cacheKey) {\n return cachedSchema.schema;\n }\n\n try {\n const schema = await generateSchema({\n ...params,\n models\n });\n schemaList.set(cacheId, {\n key: cacheKey,\n schema\n });\n return schema;\n } catch (err) {\n if (!Array.isArray(err.locations)) {\n throw new WebinyError({\n message: err.message,\n code: err.code || \"INVALID_GRAPHQL_SCHEMA_LOCATIONS\",\n data: {\n ...(err.data || {}),\n endpoint: context.cms.type\n }\n });\n }\n const [location] = err.locations;\n\n throw new WebinyError({\n code: \"INVALID_GRAPHQL_SCHEMA\",\n message: err.message,\n data: {\n invalidSegment: codeFrameColumns(err.source.body, {\n start: {\n line: location.line,\n column: location.column\n }\n })\n }\n });\n }\n};\n"],"names":["schemaList","Map","getSchema","params","context","models","cacheId","generateCacheId","cacheKey","generateCacheKey","cachedSchema","schema","generateSchema","err","Array","WebinyError","location","codeFrameColumns"],"mappings":";;;;;AAoBA,MAAMA,aAAa,IAAIC;AAMhB,MAAMC,YAAY,OAAOC;IAC5B,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAMpB,MAAME,SAAS,MAAMD,QAAQ,QAAQ,CAAC,oBAAoB,CAAC,UAChD,MAAMA,QAAQ,GAAG,CAAC,UAAU,CAAC;YAChC,gBAAgB;YAChB,gBAAgB;QACpB;IAGJ,MAAME,UAAUC,gBAAgBJ;IAEhC,MAAMK,WAAW,MAAMC,iBAAiB;QAAE,GAAGN,MAAM;QAAEE;IAAO;IAC5D,MAAMK,eAAeV,WAAW,GAAG,CAACM;IACpC,IAAII,cAAc,QAAQF,UACtB,OAAOE,aAAa,MAAM;IAG9B,IAAI;QACA,MAAMC,SAAS,MAAMC,eAAe;YAChC,GAAGT,MAAM;YACTE;QACJ;QACAL,WAAW,GAAG,CAACM,SAAS;YACpB,KAAKE;YACLG;QACJ;QACA,OAAOA;IACX,EAAE,OAAOE,KAAK;QACV,IAAI,CAACC,MAAM,OAAO,CAACD,IAAI,SAAS,GAC5B,MAAM,IAAIE,MAAY;YAClB,SAASF,IAAI,OAAO;YACpB,MAAMA,IAAI,IAAI,IAAI;YAClB,MAAM;gBACF,GAAIA,IAAI,IAAI,IAAI,CAAC,CAAC;gBAClB,UAAUT,QAAQ,GAAG,CAAC,IAAI;YAC9B;QACJ;QAEJ,MAAM,CAACY,SAAS,GAAGH,IAAI,SAAS;QAEhC,MAAM,IAAIE,MAAY;YAClB,MAAM;YACN,SAASF,IAAI,OAAO;YACpB,MAAM;gBACF,gBAAgBI,iBAAiBJ,IAAI,MAAM,CAAC,IAAI,EAAE;oBAC9C,OAAO;wBACH,MAAMG,SAAS,IAAI;wBACnB,QAAQA,SAAS,MAAM;oBAC3B;gBACJ;YACJ;QACJ;IACJ;AACJ"}
1
+ {"version":3,"file":"graphql/getSchema.js","sources":["../../src/graphql/getSchema.ts"],"sourcesContent":["import { codeFrameColumns } from \"@babel/code-frame\";\nimport WebinyError from \"@webiny/error\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/abstractions.js\";\nimport { generateSchema } from \"./generateSchema.js\";\nimport type { ApiEndpoint, CmsContext } from \"~/types/index.js\";\nimport type { GraphQLSchema } from \"graphql\";\nimport { generateCacheId } from \"./getSchema/generateCacheId.js\";\nimport { generateCacheKey } from \"./getSchema/generateCacheKey.js\";\nimport type { Tenant } from \"@webiny/api-core/types/tenancy.js\";\nimport { ListModelsUseCase } from \"~/features/contentModel/ListModels/index.js\";\nimport { HeadlessCmsEndpointConfig } from \"~/HeadlessCmsEndpointConfig.js\";\n\ninterface SchemaCache {\n key: string;\n schema: GraphQLSchema;\n}\n\ninterface GetSchemaParams {\n context: CmsContext;\n type: ApiEndpoint;\n getTenant: () => Tenant;\n}\n\nconst schemaList = new Map<string, SchemaCache>();\n\n/**\n * Gets an existing schema or rewrites existing one or creates a completely new one\n * depending on the schemaId created from type\n */\nexport const getSchema = async (params: GetSchemaParams): Promise<GraphQLSchema> => {\n const { context } = params;\n\n /**\n * We need all the API models.\n * Private models are hidden in the GraphQL, so filter them out.\n */\n const modelsResult = await context.container\n .resolve(IdentityContext)\n .withoutAuthorization(async () => {\n return context.container.resolve(ListModelsUseCase).execute({\n includePrivate: false,\n includePlugins: true\n });\n });\n if (modelsResult.isFail()) {\n throw modelsResult.error;\n }\n const models = modelsResult.value;\n\n const cacheId = generateCacheId(params);\n\n const cacheKey = await generateCacheKey({ ...params, models });\n const cachedSchema = schemaList.get(cacheId);\n if (cachedSchema?.key === cacheKey) {\n return cachedSchema.schema;\n }\n\n try {\n const schema = await generateSchema({\n ...params,\n models\n });\n schemaList.set(cacheId, {\n key: cacheKey,\n schema\n });\n return schema;\n } catch (err) {\n if (!Array.isArray(err.locations)) {\n throw new WebinyError({\n message: err.message,\n code: err.code || \"INVALID_GRAPHQL_SCHEMA_LOCATIONS\",\n data: {\n ...(err.data || {}),\n endpoint: context.container.resolve(HeadlessCmsEndpointConfig).type\n }\n });\n }\n const [location] = err.locations;\n\n throw new WebinyError({\n code: \"INVALID_GRAPHQL_SCHEMA\",\n message: err.message,\n data: {\n invalidSegment: codeFrameColumns(err.source.body, {\n start: {\n line: location.line,\n column: location.column\n }\n })\n }\n });\n }\n};\n"],"names":["schemaList","Map","getSchema","params","context","modelsResult","IdentityContext","ListModelsUseCase","models","cacheId","generateCacheId","cacheKey","generateCacheKey","cachedSchema","schema","generateSchema","err","Array","WebinyError","HeadlessCmsEndpointConfig","location","codeFrameColumns"],"mappings":";;;;;;;;AAuBA,MAAMA,aAAa,IAAIC;AAMhB,MAAMC,YAAY,OAAOC;IAC5B,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAMpB,MAAME,eAAe,MAAMD,QAAQ,SAAS,CACvC,OAAO,CAACE,iBACR,oBAAoB,CAAC,UACXF,QAAQ,SAAS,CAAC,OAAO,CAACG,mBAAmB,OAAO,CAAC;YACxD,gBAAgB;YAChB,gBAAgB;QACpB;IAER,IAAIF,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;IAE5B,MAAMG,SAASH,aAAa,KAAK;IAEjC,MAAMI,UAAUC,gBAAgBP;IAEhC,MAAMQ,WAAW,MAAMC,iBAAiB;QAAE,GAAGT,MAAM;QAAEK;IAAO;IAC5D,MAAMK,eAAeb,WAAW,GAAG,CAACS;IACpC,IAAII,cAAc,QAAQF,UACtB,OAAOE,aAAa,MAAM;IAG9B,IAAI;QACA,MAAMC,SAAS,MAAMC,eAAe;YAChC,GAAGZ,MAAM;YACTK;QACJ;QACAR,WAAW,GAAG,CAACS,SAAS;YACpB,KAAKE;YACLG;QACJ;QACA,OAAOA;IACX,EAAE,OAAOE,KAAK;QACV,IAAI,CAACC,MAAM,OAAO,CAACD,IAAI,SAAS,GAC5B,MAAM,IAAIE,MAAY;YAClB,SAASF,IAAI,OAAO;YACpB,MAAMA,IAAI,IAAI,IAAI;YAClB,MAAM;gBACF,GAAIA,IAAI,IAAI,IAAI,CAAC,CAAC;gBAClB,UAAUZ,QAAQ,SAAS,CAAC,OAAO,CAACe,2BAA2B,IAAI;YACvE;QACJ;QAEJ,MAAM,CAACC,SAAS,GAAGJ,IAAI,SAAS;QAEhC,MAAM,IAAIE,MAAY;YAClB,MAAM;YACN,SAASF,IAAI,OAAO;YACpB,MAAM;gBACF,gBAAgBK,iBAAiBL,IAAI,MAAM,CAAC,IAAI,EAAE;oBAC9C,OAAO;wBACH,MAAMI,SAAS,IAAI;wBACnB,QAAQA,SAAS,MAAM;oBAC3B;gBACJ;YACJ;QACJ;IACJ;AACJ"}
@@ -1,2 +1,2 @@
1
- import type { GraphQLScalarPlugin } from "@webiny/handler-graphql/types.js";
1
+ import type { GraphQLScalarPlugin } from "@webiny/api-graphql/types.js";
2
2
  export declare const createRevisionIdScalarPlugin: () => GraphQLScalarPlugin[];
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/scalars/RevisionIdScalarPlugin.js","sources":["../../../src/graphql/scalars/RevisionIdScalarPlugin.ts"],"sourcesContent":["import type { GraphQLScalarPlugin } from \"@webiny/handler-graphql/types.js\";\nimport { RevisionIdScalar } from \"~/graphql/scalars/RevisionId.js\";\n\nexport const createRevisionIdScalarPlugin = (): GraphQLScalarPlugin[] => {\n const plugin: GraphQLScalarPlugin = {\n name: \"headlessCms.graphql.revisionIdScalar\",\n type: \"graphql-scalar\",\n scalar: RevisionIdScalar\n };\n return [plugin];\n};\n"],"names":["createRevisionIdScalarPlugin","plugin","RevisionIdScalar"],"mappings":";AAGO,MAAMA,+BAA+B;IACxC,MAAMC,SAA8B;QAChC,MAAM;QACN,MAAM;QACN,QAAQC;IACZ;IACA,OAAO;QAACD;KAAO;AACnB"}
1
+ {"version":3,"file":"graphql/scalars/RevisionIdScalarPlugin.js","sources":["../../../src/graphql/scalars/RevisionIdScalarPlugin.ts"],"sourcesContent":["import type { GraphQLScalarPlugin } from \"@webiny/api-graphql/types.js\";\nimport { RevisionIdScalar } from \"~/graphql/scalars/RevisionId.js\";\n\nexport const createRevisionIdScalarPlugin = (): GraphQLScalarPlugin[] => {\n const plugin: GraphQLScalarPlugin = {\n name: \"headlessCms.graphql.revisionIdScalar\",\n type: \"graphql-scalar\",\n scalar: RevisionIdScalar\n };\n return [plugin];\n};\n"],"names":["createRevisionIdScalarPlugin","plugin","RevisionIdScalar"],"mappings":";AAGO,MAAMA,+BAA+B;IACxC,MAAMC,SAA8B;QAChC,MAAM;QACN,MAAM;QACN,QAAQC;IACZ;IACA,OAAO;QAACD;KAAO;AACnB"}
@@ -1,7 +1,2 @@
1
- import type { CmsContext } from "../../types/index.js";
2
1
  import type { ICmsGraphQLSchemaPlugin } from "../../plugins/index.js";
3
- interface Params {
4
- context: CmsContext;
5
- }
6
- export declare const createBaseContentSchema: ({ context }: Params) => ICmsGraphQLSchemaPlugin;
7
- export {};
2
+ export declare const createBaseContentSchema: () => ICmsGraphQLSchemaPlugin;
@@ -1,10 +1,10 @@
1
- import { AnyScalar, DateScalar, DateTimeScalar, DateTimeZScalar, IconScalar, JsonScalar, LongScalar, NumberScalar, RefInputScalar, TimeScalar } from "@webiny/handler-graphql/builtInTypes/index.js";
1
+ import { AnyScalar, DateScalar, DateTimeScalar, DateTimeZScalar, IconScalar, JsonScalar, LongScalar, NumberScalar, RefInputScalar, TimeScalar } from "@webiny/api-graphql/builtInTypes/index.js";
2
2
  import { createCmsGraphQLSchemaPlugin } from "../../plugins/index.js";
3
- const createBaseContentSchema = ({ context })=>{
4
- const scalars = context.plugins.byType("graphql-scalar").map((item)=>item.scalar);
3
+ import { RevisionIdScalar } from "../scalars/RevisionId.js";
4
+ const createBaseContentSchema = ()=>{
5
5
  const plugin = createCmsGraphQLSchemaPlugin({
6
6
  typeDefs: `
7
- ${scalars.map((scalar)=>`scalar ${scalar.name}`).join(" ")}
7
+ scalar RevisionId
8
8
  scalar JSON
9
9
  scalar Long
10
10
  scalar RefInput
@@ -28,10 +28,7 @@ const createBaseContentSchema = ({ context })=>{
28
28
  }
29
29
  `,
30
30
  resolvers: {
31
- ...scalars.reduce((acc, s)=>{
32
- acc[s.name] = s;
33
- return acc;
34
- }, {}),
31
+ RevisionId: RevisionIdScalar,
35
32
  JSON: JsonScalar,
36
33
  Long: LongScalar,
37
34
  RefInput: RefInputScalar,
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/baseContentSchema.js","sources":["../../../src/graphql/schema/baseContentSchema.ts"],"sourcesContent":["import type { GraphQLScalarPlugin } from \"@webiny/handler-graphql/types.js\";\nimport type { CmsContext } from \"~/types/index.js\";\nimport {\n AnyScalar,\n DateScalar,\n DateTimeScalar,\n DateTimeZScalar,\n JsonScalar,\n LongScalar,\n NumberScalar,\n RefInputScalar,\n TimeScalar,\n IconScalar\n} from \"@webiny/handler-graphql/builtInTypes/index.js\";\nimport type { GraphQLScalarType } from \"graphql\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { createCmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\n\ninterface Params {\n context: CmsContext;\n}\n\nexport const createBaseContentSchema = ({ context }: Params): ICmsGraphQLSchemaPlugin => {\n const scalars = context.plugins\n .byType<GraphQLScalarPlugin>(\"graphql-scalar\")\n .map(item => item.scalar);\n\n const plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n ${scalars.map(scalar => `scalar ${scalar.name}`).join(\" \")}\n scalar JSON\n scalar Long\n scalar RefInput\n scalar Number\n scalar Any\n scalar Date\n scalar DateTime\n scalar DateTimeZ\n scalar Time\n scalar Icon\n\n type Query\n\n type Mutation {\n _empty: String\n }\n\n enum CmsEntryStatusType {\n latest\n published\n }\n `,\n resolvers: {\n ...scalars.reduce<Record<string, GraphQLScalarType>>((acc, s) => {\n acc[s.name] = s;\n return acc;\n }, {}),\n JSON: JsonScalar,\n Long: LongScalar,\n RefInput: RefInputScalar,\n Number: NumberScalar,\n Any: AnyScalar,\n DateTime: DateTimeScalar,\n DateTimeZ: DateTimeZScalar,\n Date: DateScalar,\n Time: TimeScalar,\n Icon: IconScalar,\n Mutation: {\n _empty: () => \"_empty\"\n }\n }\n });\n plugin.name = `headless-cms.graphql.schema.baseContentSchema`;\n\n return plugin;\n};\n"],"names":["createBaseContentSchema","context","scalars","item","plugin","createCmsGraphQLSchemaPlugin","scalar","acc","s","JsonScalar","LongScalar","RefInputScalar","NumberScalar","AnyScalar","DateTimeScalar","DateTimeZScalar","DateScalar","TimeScalar","IconScalar"],"mappings":";;AAsBO,MAAMA,0BAA0B,CAAC,EAAEC,OAAO,EAAU;IACvD,MAAMC,UAAUD,QAAQ,OAAO,CAC1B,MAAM,CAAsB,kBAC5B,GAAG,CAACE,CAAAA,OAAQA,KAAK,MAAM;IAE5B,MAAMC,SAASC,6BAA6B;QACxC,UAAwB,CAAC;YACrB,EAAEH,QAAQ,GAAG,CAACI,CAAAA,SAAU,CAAC,OAAO,EAAEA,OAAO,IAAI,EAAE,EAAE,IAAI,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;QAsB/D,CAAC;QACD,WAAW;YACP,GAAGJ,QAAQ,MAAM,CAAoC,CAACK,KAAKC;gBACvDD,GAAG,CAACC,EAAE,IAAI,CAAC,GAAGA;gBACd,OAAOD;YACX,GAAG,CAAC,EAAE;YACN,MAAME;YACN,MAAMC;YACN,UAAUC;YACV,QAAQC;YACR,KAAKC;YACL,UAAUC;YACV,WAAWC;YACX,MAAMC;YACN,MAAMC;YACN,MAAMC;YACN,UAAU;gBACN,QAAQ,IAAM;YAClB;QACJ;IACJ;IACAd,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}
1
+ {"version":3,"file":"graphql/schema/baseContentSchema.js","sources":["../../../src/graphql/schema/baseContentSchema.ts"],"sourcesContent":["import {\n AnyScalar,\n DateScalar,\n DateTimeScalar,\n DateTimeZScalar,\n JsonScalar,\n LongScalar,\n NumberScalar,\n RefInputScalar,\n TimeScalar,\n IconScalar\n} from \"@webiny/api-graphql/builtInTypes/index.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { createCmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { RevisionIdScalar } from \"~/graphql/scalars/RevisionId.js\";\n\nexport const createBaseContentSchema = (): ICmsGraphQLSchemaPlugin => {\n const plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n scalar RevisionId\n scalar JSON\n scalar Long\n scalar RefInput\n scalar Number\n scalar Any\n scalar Date\n scalar DateTime\n scalar DateTimeZ\n scalar Time\n scalar Icon\n\n type Query\n\n type Mutation {\n _empty: String\n }\n\n enum CmsEntryStatusType {\n latest\n published\n }\n `,\n resolvers: {\n RevisionId: RevisionIdScalar,\n JSON: JsonScalar,\n Long: LongScalar,\n RefInput: RefInputScalar,\n Number: NumberScalar,\n Any: AnyScalar,\n DateTime: DateTimeScalar,\n DateTimeZ: DateTimeZScalar,\n Date: DateScalar,\n Time: TimeScalar,\n Icon: IconScalar,\n Mutation: {\n _empty: () => \"_empty\"\n }\n }\n });\n plugin.name = `headless-cms.graphql.schema.baseContentSchema`;\n\n return plugin;\n};\n"],"names":["createBaseContentSchema","plugin","createCmsGraphQLSchemaPlugin","RevisionIdScalar","JsonScalar","LongScalar","RefInputScalar","NumberScalar","AnyScalar","DateTimeScalar","DateTimeZScalar","DateScalar","TimeScalar","IconScalar"],"mappings":";;;AAgBO,MAAMA,0BAA0B;IACnC,MAAMC,SAASC,6BAA6B;QACxC,UAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;QAuBzB,CAAC;QACD,WAAW;YACP,YAAYC;YACZ,MAAMC;YACN,MAAMC;YACN,UAAUC;YACV,QAAQC;YACR,KAAKC;YACL,UAAUC;YACV,WAAWC;YACX,MAAMC;YACN,MAAMC;YACN,MAAMC;YACN,UAAU;gBACN,QAAQ,IAAM;YAClB;QACJ;IACJ;IACAZ,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}
@@ -1,3 +1,3 @@
1
1
  import type { CmsContext } from "../../types/index.js";
2
- import { ContextPlugin } from "@webiny/api";
3
- export declare const createBaseSchema: () => ContextPlugin<CmsContext>;
2
+ import type { ICmsGraphQLSchemaPlugin } from "../../plugins/index.js";
3
+ export declare const createBaseSchemaPlugins: (_context: CmsContext) => ICmsGraphQLSchemaPlugin[];
@@ -1,25 +1,5 @@
1
1
  import { createCmsGraphQLSchemaPlugin } from "../../plugins/index.js";
2
- import { GraphQLSchemaPlugin } from "@webiny/handler-graphql";
3
- import { ContextPlugin } from "@webiny/api";
4
- import camelCase from "lodash/camelCase.js";
5
- import { CmsModelFieldValidatorRegistry } from "../../features/validation/index.js";
6
- const createSkipValidatorEnum = (container)=>{
7
- const registry = container.resolve(CmsModelFieldValidatorRegistry);
8
- const names = registry.getAll().reduce((collection, validator)=>{
9
- const name = camelCase(validator.name);
10
- if (collection.includes(name)) return collection;
11
- collection.push(name);
12
- return collection;
13
- }, []);
14
- if (0 === names.length) names.push("_empty");
15
- return `
16
- enum SkipValidatorEnum {
17
- ${names.join("\n")}
18
- }
19
- `;
20
- };
21
- const createSchema = (context)=>{
22
- const skipValidatorEnum = createSkipValidatorEnum(context.container);
2
+ const createBaseSchemaPlugins = (_context)=>{
23
3
  const cmsPlugin = createCmsGraphQLSchemaPlugin({
24
4
  typeDefs: `
25
5
  type CmsIdentity {
@@ -89,18 +69,16 @@ const createSchema = (context)=>{
89
69
  folderId_not_in: [ID!]
90
70
  }
91
71
 
92
- ${skipValidatorEnum}
93
-
94
72
  input CreateCmsEntryOptionsInput {
95
- skipValidators: [SkipValidatorEnum!]
73
+ skipValidation: Boolean
96
74
  }
97
75
 
98
76
  input CreateRevisionCmsEntryOptionsInput {
99
- skipValidators: [SkipValidatorEnum!]
77
+ skipValidation: Boolean
100
78
  }
101
79
 
102
80
  input UpdateCmsEntryOptionsInput {
103
- skipValidators: [SkipValidatorEnum!]
81
+ skipValidation: Boolean
104
82
  }
105
83
 
106
84
  input CmsIdentityInput {
@@ -147,23 +125,10 @@ const createSchema = (context)=>{
147
125
  resolvers: {}
148
126
  });
149
127
  cmsPlugin.name = "headless-cms.graphql.schema.base";
150
- const corePlugin = new GraphQLSchemaPlugin({
151
- typeDefs: cmsPlugin.schema.typeDefs,
152
- resolvers: cmsPlugin.schema.resolvers
153
- });
154
- corePlugin.name = "headless-cms.graphql.core.schema.base";
155
128
  return [
156
- cmsPlugin,
157
- corePlugin
129
+ cmsPlugin
158
130
  ];
159
131
  };
160
- const createBaseSchema = ()=>{
161
- const plugin = new ContextPlugin(async (context)=>{
162
- context.plugins.register(...createSchema(context));
163
- });
164
- plugin.name = "headless-cms.graphql.createBaseSchema";
165
- return plugin;
166
- };
167
- export { createBaseSchema };
132
+ export { createBaseSchemaPlugins };
168
133
 
169
134
  //# sourceMappingURL=baseSchema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/baseSchema.js","sources":["../../../src/graphql/schema/baseSchema.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport { createCmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport type { IGraphQLSchemaPlugin } from \"@webiny/handler-graphql\";\nimport { GraphQLSchemaPlugin } from \"@webiny/handler-graphql\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport camelCase from \"lodash/camelCase.js\";\nimport { CmsModelFieldValidatorRegistry } from \"~/features/validation/index.js\";\nimport type { Container } from \"@webiny/di\";\n\nconst createSkipValidatorEnum = (container: Container) => {\n const registry = container.resolve(CmsModelFieldValidatorRegistry);\n const names = registry.getAll().reduce<string[]>((collection, validator) => {\n const name = camelCase(validator.name);\n if (collection.includes(name)) {\n return collection;\n }\n collection.push(name);\n return collection;\n }, []);\n\n if (names.length === 0) {\n names.push(\"_empty\");\n }\n return /* GraphQL */ `\n enum SkipValidatorEnum {\n ${names.join(\"\\n\")}\n }\n `;\n};\n\nconst createSchema = (context: CmsContext): IGraphQLSchemaPlugin<CmsContext>[] => {\n const skipValidatorEnum = createSkipValidatorEnum(context.container);\n\n const cmsPlugin = createCmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n type CmsIdentity {\n id: String\n displayName: String\n type: String\n }\n\n type CmsError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type CmsCursors {\n next: String\n previous: String\n }\n\n type CmsListMeta {\n cursor: String\n hasMoreItems: Boolean\n totalCount: Int\n }\n\n input CmsDeleteEntryOptions {\n # force delete an entry that might have some records left behind in the database\n # see CmsDeleteEntryOptions in types.ts\n force: Boolean\n # permanently delete an entry without moving it to the bin\n permanently: Boolean\n }\n\n type CmsDeleteResponse {\n data: Boolean\n error: CmsError\n }\n\n type CmsDeleteMultipleDataResponse {\n id: ID!\n }\n\n type CmsDeleteMultipleResponse {\n data: [CmsDeleteMultipleDataResponse!]\n error: CmsError\n }\n\n type CmsBooleanResponse {\n data: Boolean\n error: CmsError\n }\n\n # Advanced Content Organization\n type WbyAcoLocation {\n folderId: ID\n }\n\n input WbyAcoLocationInput {\n folderId: ID!\n }\n\n input WbyAcoLocationWhereInput {\n folderId: ID\n folderId_in: [ID!]\n folderId_not: ID\n folderId_not_in: [ID!]\n }\n\n ${skipValidatorEnum}\n\n input CreateCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n input CreateRevisionCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n input UpdateCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n input CmsIdentityInput {\n id: String!\n displayName: String!\n type: String!\n }\n\n type CmsEntryValidationResponseData {\n error: String!\n id: String!\n fieldId: String!\n parents: [String!]!\n }\n\n type CmsEntryValidationResponse {\n data: [CmsEntryValidationResponseData!]\n error: CmsError\n }\n\n type CmsEntrySystem {\n _empty: String\n }\n\n type CmsEntryLive {\n version: Int!\n }\n\n input CmsEntryLiveWhereInput {\n version: Int\n version_gt: Int\n version_gte: Int\n version_lt: Int\n version_lte: Int\n version_not: Int\n version_in: [Int!]\n version_not_in: [Int!]\n }\n\n input ListWhereInputCmsEntrySystem {\n _empty: String\n }\n `,\n resolvers: {}\n });\n cmsPlugin.name = \"headless-cms.graphql.schema.base\";\n const corePlugin = new GraphQLSchemaPlugin<CmsContext>({\n typeDefs: cmsPlugin.schema.typeDefs,\n resolvers: cmsPlugin.schema.resolvers\n });\n corePlugin.name = \"headless-cms.graphql.core.schema.base\";\n /**\n * Due to splitting of CMS and Core schema plugins, we must have both defined for CMS to work.\n */\n return [cmsPlugin, corePlugin];\n};\n\nexport const createBaseSchema = () => {\n const plugin = new ContextPlugin<CmsContext>(async context => {\n context.plugins.register(...createSchema(context));\n });\n\n plugin.name = \"headless-cms.graphql.createBaseSchema\";\n\n return plugin;\n};\n"],"names":["createSkipValidatorEnum","container","registry","CmsModelFieldValidatorRegistry","names","collection","validator","name","camelCase","createSchema","context","skipValidatorEnum","cmsPlugin","createCmsGraphQLSchemaPlugin","corePlugin","GraphQLSchemaPlugin","createBaseSchema","plugin","ContextPlugin"],"mappings":";;;;;AASA,MAAMA,0BAA0B,CAACC;IAC7B,MAAMC,WAAWD,UAAU,OAAO,CAACE;IACnC,MAAMC,QAAQF,SAAS,MAAM,GAAG,MAAM,CAAW,CAACG,YAAYC;QAC1D,MAAMC,OAAOC,UAAUF,UAAU,IAAI;QACrC,IAAID,WAAW,QAAQ,CAACE,OACpB,OAAOF;QAEXA,WAAW,IAAI,CAACE;QAChB,OAAOF;IACX,GAAG,EAAE;IAEL,IAAID,AAAiB,MAAjBA,MAAM,MAAM,EACZA,MAAM,IAAI,CAAC;IAEf,OAAqB,CAAC;;WAEf,EAAEA,MAAM,IAAI,CAAC,MAAM;;IAE1B,CAAC;AACL;AAEA,MAAMK,eAAe,CAACC;IAClB,MAAMC,oBAAoBX,wBAAwBU,QAAQ,SAAS;IAEnE,MAAME,YAAYC,6BAA6B;QAC3C,UAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAoErB,EAAEF,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAsDxB,CAAC;QACD,WAAW,CAAC;IAChB;IACAC,UAAU,IAAI,GAAG;IACjB,MAAME,aAAa,IAAIC,oBAAgC;QACnD,UAAUH,UAAU,MAAM,CAAC,QAAQ;QACnC,WAAWA,UAAU,MAAM,CAAC,SAAS;IACzC;IACAE,WAAW,IAAI,GAAG;IAIlB,OAAO;QAACF;QAAWE;KAAW;AAClC;AAEO,MAAME,mBAAmB;IAC5B,MAAMC,SAAS,IAAIC,cAA0B,OAAMR;QAC/CA,QAAQ,OAAO,CAAC,QAAQ,IAAID,aAAaC;IAC7C;IAEAO,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}
1
+ {"version":3,"file":"graphql/schema/baseSchema.js","sources":["../../../src/graphql/schema/baseSchema.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport { createCmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\n\nexport const createBaseSchemaPlugins = (_context: CmsContext): ICmsGraphQLSchemaPlugin[] => {\n const cmsPlugin = createCmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n type CmsIdentity {\n id: String\n displayName: String\n type: String\n }\n\n type CmsError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type CmsCursors {\n next: String\n previous: String\n }\n\n type CmsListMeta {\n cursor: String\n hasMoreItems: Boolean\n totalCount: Int\n }\n\n input CmsDeleteEntryOptions {\n # force delete an entry that might have some records left behind in the database\n # see CmsDeleteEntryOptions in types.ts\n force: Boolean\n # permanently delete an entry without moving it to the bin\n permanently: Boolean\n }\n\n type CmsDeleteResponse {\n data: Boolean\n error: CmsError\n }\n\n type CmsDeleteMultipleDataResponse {\n id: ID!\n }\n\n type CmsDeleteMultipleResponse {\n data: [CmsDeleteMultipleDataResponse!]\n error: CmsError\n }\n\n type CmsBooleanResponse {\n data: Boolean\n error: CmsError\n }\n\n # Advanced Content Organization\n type WbyAcoLocation {\n folderId: ID\n }\n\n input WbyAcoLocationInput {\n folderId: ID!\n }\n\n input WbyAcoLocationWhereInput {\n folderId: ID\n folderId_in: [ID!]\n folderId_not: ID\n folderId_not_in: [ID!]\n }\n\n input CreateCmsEntryOptionsInput {\n skipValidation: Boolean\n }\n\n input CreateRevisionCmsEntryOptionsInput {\n skipValidation: Boolean\n }\n\n input UpdateCmsEntryOptionsInput {\n skipValidation: Boolean\n }\n\n input CmsIdentityInput {\n id: String!\n displayName: String!\n type: String!\n }\n\n type CmsEntryValidationResponseData {\n error: String!\n id: String!\n fieldId: String!\n parents: [String!]!\n }\n\n type CmsEntryValidationResponse {\n data: [CmsEntryValidationResponseData!]\n error: CmsError\n }\n\n type CmsEntrySystem {\n _empty: String\n }\n\n type CmsEntryLive {\n version: Int!\n }\n\n input CmsEntryLiveWhereInput {\n version: Int\n version_gt: Int\n version_gte: Int\n version_lt: Int\n version_lte: Int\n version_not: Int\n version_in: [Int!]\n version_not_in: [Int!]\n }\n\n input ListWhereInputCmsEntrySystem {\n _empty: String\n }\n `,\n resolvers: {}\n });\n cmsPlugin.name = \"headless-cms.graphql.schema.base\";\n\n return [cmsPlugin];\n};\n"],"names":["createBaseSchemaPlugins","_context","cmsPlugin","createCmsGraphQLSchemaPlugin"],"mappings":";AAIO,MAAMA,0BAA0B,CAACC;IACpC,MAAMC,YAAYC,6BAA6B;QAC3C,UAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwHzB,CAAC;QACD,WAAW,CAAC;IAChB;IACAD,UAAU,IAAI,GAAG;IAEjB,OAAO;QAACA;KAAU;AACtB"}
@@ -0,0 +1,14 @@
1
+ import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.core.js";
2
+ /**
3
+ * Defines the CmsError type in the static schema so that CmsResponseTypeDefsImpl
4
+ * (which references CmsError) can be safely included at schema construction time.
5
+ * CmsError is also defined in the dynamic schema via createBaseSchema() — mergeSchemas
6
+ * handles the duplicate gracefully.
7
+ */
8
+ declare class CmsBaseErrorTypeDefs implements CoreGraphQLSchemaFactory.Interface {
9
+ execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
10
+ }
11
+ export declare const CmsBaseErrorTypeFactory: typeof CmsBaseErrorTypeDefs & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.core.js").ICoreGraphQLSchemaFactory>;
13
+ };
14
+ export {};
@@ -0,0 +1,21 @@
1
+ import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.core.js";
2
+ class CmsBaseErrorTypeDefs {
3
+ async execute(builder) {
4
+ builder.addTypeDefs(`
5
+ type CmsError {
6
+ message: String!
7
+ code: String
8
+ data: JSON
9
+ stack: String
10
+ }
11
+ `);
12
+ return builder;
13
+ }
14
+ }
15
+ const CmsBaseErrorTypeFactory = CoreGraphQLSchemaFactory.createImplementation({
16
+ implementation: CmsBaseErrorTypeDefs,
17
+ dependencies: []
18
+ });
19
+ export { CmsBaseErrorTypeFactory };
20
+
21
+ //# sourceMappingURL=CmsBaseErrorTypeFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql/schema/cms/CmsBaseErrorTypeFactory.js","sources":["../../../../src/graphql/schema/cms/CmsBaseErrorTypeFactory.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.core.js\";\n\n/**\n * Defines the CmsError type in the static schema so that CmsResponseTypeDefsImpl\n * (which references CmsError) can be safely included at schema construction time.\n * CmsError is also defined in the dynamic schema via createBaseSchema() — mergeSchemas\n * handles the duplicate gracefully.\n */\nclass CmsBaseErrorTypeDefs implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addTypeDefs(/* GraphQL */ `\n type CmsError {\n message: String!\n code: String\n data: JSON\n stack: String\n }\n `);\n return builder;\n }\n}\n\nexport const CmsBaseErrorTypeFactory = CoreGraphQLSchemaFactory.createImplementation({\n implementation: CmsBaseErrorTypeDefs,\n dependencies: []\n});\n"],"names":["CmsBaseErrorTypeDefs","builder","CmsBaseErrorTypeFactory","CoreGraphQLSchemaFactory"],"mappings":";AAQA,MAAMA;IACF,MAAM,QACFC,OAA+C,EAChB;QAC/BA,QAAQ,WAAW,CAAe,CAAC;;;;;;;QAOnC,CAAC;QACD,OAAOA;IACX;AACJ;AAEO,MAAMC,0BAA0BC,yBAAyB,oBAAoB,CAAC;IACjF,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
@@ -1,10 +1,10 @@
1
1
  import { buildFieldsSelection, getErrorMessage, getModel } from "./helpers.js";
2
+ import { CmsSchemaExecutor } from "../../CmsSchemaExecutor.js";
2
3
  const createCreateEntryResolver = ()=>async ({ args, context })=>{
3
4
  const { modelId, data, fields } = args;
4
5
  try {
5
6
  const model = await getModel(context, modelId);
6
7
  const apiType = "manage";
7
- const executeSchema = await context.cms.getExecutableSchema(apiType);
8
8
  const fieldsSelection = buildFieldsSelection(fields);
9
9
  const query = `
10
10
  mutation Create${model.singularApiName}($data: ${model.singularApiName}Input!) {
@@ -20,7 +20,7 @@ const createCreateEntryResolver = ()=>async ({ args, context })=>{
20
20
  }
21
21
  }
22
22
  `;
23
- const result = await executeSchema({
23
+ const result = await context.container.resolve(CmsSchemaExecutor).execute(apiType, {
24
24
  query,
25
25
  variables: {
26
26
  data
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/cms/createEntryResolver.js","sources":["../../../../src/graphql/schema/cms/createEntryResolver.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport type { ApiEndpoint } from \"~/types/index.js\";\nimport type { ExecutionResult } from \"graphql\";\nimport { getModel, getErrorMessage, buildFieldsSelection } from \"./helpers.js\";\n\nexport interface CreateEntryArgs {\n modelId: string;\n data: Record<string, unknown>;\n fields: string[];\n}\n\nexport const createCreateEntryResolver = () => {\n return async ({ args, context }: { args: CreateEntryArgs; context: CmsContext }) => {\n const { modelId, data, fields } = args;\n\n try {\n const model = await getModel(context, modelId);\n\n // Use manage API for creating entries.\n const apiType: ApiEndpoint = \"manage\";\n const executeSchema = await context.cms.getExecutableSchema(apiType);\n\n const fieldsSelection = buildFieldsSelection(fields);\n\n const query = /* GraphQL */ `\n mutation Create${model.singularApiName}($data: ${model.singularApiName}Input!) {\n create${model.singularApiName}(data: $data) {\n data {\n ${fieldsSelection}\n }\n error {\n message\n code\n data\n }\n }\n }\n `;\n\n const result = (await executeSchema({\n query,\n variables: { data }\n })) as ExecutionResult;\n\n if (result.errors && result.errors.length > 0) {\n return {\n data: null,\n error: {\n message: result.errors.map(e => e.message).join(\"; \"),\n code: \"CREATE_ENTRY_ERROR\"\n }\n };\n }\n\n const operationName = `create${model.singularApiName}`;\n return result.data?.[operationName] || { data: null, error: null };\n } catch (error) {\n return {\n data: null,\n error: {\n message: getErrorMessage(error, \"Failed to create entry\"),\n code: \"CREATE_ENTRY_ERROR\"\n }\n };\n }\n };\n};\n"],"names":["createCreateEntryResolver","args","context","modelId","data","fields","model","getModel","apiType","executeSchema","fieldsSelection","buildFieldsSelection","query","result","e","operationName","error","getErrorMessage"],"mappings":";AAWO,MAAMA,4BAA4B,IAC9B,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAkD;QAC3E,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGJ;QAElC,IAAI;YACA,MAAMK,QAAQ,MAAMC,SAASL,SAASC;YAGtC,MAAMK,UAAuB;YAC7B,MAAMC,gBAAgB,MAAMP,QAAQ,GAAG,CAAC,mBAAmB,CAACM;YAE5D,MAAME,kBAAkBC,qBAAqBN;YAE7C,MAAMO,QAAsB,CAAC;+BACV,EAAEN,MAAM,eAAe,CAAC,QAAQ,EAAEA,MAAM,eAAe,CAAC;0BAC7D,EAAEA,MAAM,eAAe,CAAC;;4BAEtB,EAAEI,gBAAgB;;;;;;;;;YASlC,CAAC;YAED,MAAMG,SAAU,MAAMJ,cAAc;gBAChCG;gBACA,WAAW;oBAAER;gBAAK;YACtB;YAEA,IAAIS,OAAO,MAAM,IAAIA,OAAO,MAAM,CAAC,MAAM,GAAG,GACxC,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASA,OAAO,MAAM,CAAC,GAAG,CAACC,CAAAA,IAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;oBAChD,MAAM;gBACV;YACJ;YAGJ,MAAMC,gBAAgB,CAAC,MAAM,EAAET,MAAM,eAAe,EAAE;YACtD,OAAOO,OAAO,IAAI,EAAE,CAACE,cAAc,IAAI;gBAAE,MAAM;gBAAM,OAAO;YAAK;QACrE,EAAE,OAAOC,OAAO;YACZ,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASC,gBAAgBD,OAAO;oBAChC,MAAM;gBACV;YACJ;QACJ;IACJ"}
1
+ {"version":3,"file":"graphql/schema/cms/createEntryResolver.js","sources":["../../../../src/graphql/schema/cms/createEntryResolver.ts"],"sourcesContent":["import type { CmsContext, ApiEndpoint } from \"~/types/index.js\";\nimport type { ExecutionResult } from \"graphql\";\nimport { getModel, getErrorMessage, buildFieldsSelection } from \"./helpers.js\";\nimport { CmsSchemaExecutor } from \"~/graphql/CmsSchemaExecutor.js\";\n\nexport interface CreateEntryArgs {\n modelId: string;\n data: Record<string, unknown>;\n fields: string[];\n}\n\nexport const createCreateEntryResolver = () => {\n return async ({ args, context }: { args: CreateEntryArgs; context: CmsContext }) => {\n const { modelId, data, fields } = args;\n\n try {\n const model = await getModel(context, modelId);\n\n // Use manage API for creating entries.\n const apiType: ApiEndpoint = \"manage\";\n\n const fieldsSelection = buildFieldsSelection(fields);\n\n const query = /* GraphQL */ `\n mutation Create${model.singularApiName}($data: ${model.singularApiName}Input!) {\n create${model.singularApiName}(data: $data) {\n data {\n ${fieldsSelection}\n }\n error {\n message\n code\n data\n }\n }\n }\n `;\n\n const result = (await context.container\n .resolve(CmsSchemaExecutor)\n .execute(apiType, { query, variables: { data } })) as ExecutionResult;\n\n if (result.errors && result.errors.length > 0) {\n return {\n data: null,\n error: {\n message: result.errors.map(e => e.message).join(\"; \"),\n code: \"CREATE_ENTRY_ERROR\"\n }\n };\n }\n\n const operationName = `create${model.singularApiName}`;\n return result.data?.[operationName] || { data: null, error: null };\n } catch (error) {\n return {\n data: null,\n error: {\n message: getErrorMessage(error, \"Failed to create entry\"),\n code: \"CREATE_ENTRY_ERROR\"\n }\n };\n }\n };\n};\n"],"names":["createCreateEntryResolver","args","context","modelId","data","fields","model","getModel","apiType","fieldsSelection","buildFieldsSelection","query","result","CmsSchemaExecutor","e","operationName","error","getErrorMessage"],"mappings":";;AAWO,MAAMA,4BAA4B,IAC9B,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAkD;QAC3E,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGJ;QAElC,IAAI;YACA,MAAMK,QAAQ,MAAMC,SAASL,SAASC;YAGtC,MAAMK,UAAuB;YAE7B,MAAMC,kBAAkBC,qBAAqBL;YAE7C,MAAMM,QAAsB,CAAC;+BACV,EAAEL,MAAM,eAAe,CAAC,QAAQ,EAAEA,MAAM,eAAe,CAAC;0BAC7D,EAAEA,MAAM,eAAe,CAAC;;4BAEtB,EAAEG,gBAAgB;;;;;;;;;YASlC,CAAC;YAED,MAAMG,SAAU,MAAMV,QAAQ,SAAS,CAClC,OAAO,CAACW,mBACR,OAAO,CAACL,SAAS;gBAAEG;gBAAO,WAAW;oBAAEP;gBAAK;YAAE;YAEnD,IAAIQ,OAAO,MAAM,IAAIA,OAAO,MAAM,CAAC,MAAM,GAAG,GACxC,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASA,OAAO,MAAM,CAAC,GAAG,CAACE,CAAAA,IAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;oBAChD,MAAM;gBACV;YACJ;YAGJ,MAAMC,gBAAgB,CAAC,MAAM,EAAET,MAAM,eAAe,EAAE;YACtD,OAAOM,OAAO,IAAI,EAAE,CAACG,cAAc,IAAI;gBAAE,MAAM;gBAAM,OAAO;YAAK;QACrE,EAAE,OAAOC,OAAO;YACZ,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASC,gBAAgBD,OAAO;oBAChC,MAAM;gBACV;YACJ;QACJ;IACJ"}
@@ -1,10 +1,10 @@
1
1
  import { getErrorMessage, getModel } from "./helpers.js";
2
+ import { CmsSchemaExecutor } from "../../CmsSchemaExecutor.js";
2
3
  const createDeleteEntryRevisionResolver = ()=>async ({ args, context })=>{
3
4
  const { modelId, revisionId, permanent = false } = args;
4
5
  try {
5
6
  const model = await getModel(context, modelId);
6
7
  const apiType = "manage";
7
- const executeSchema = await context.cms.getExecutableSchema(apiType);
8
8
  const query = `
9
9
  mutation Delete${model.singularApiName}($revisionId: ID!, $options: CmsDeleteEntryOptions) {
10
10
  delete${model.singularApiName}(revision: $revisionId, options: $options) {
@@ -17,7 +17,7 @@ const createDeleteEntryRevisionResolver = ()=>async ({ args, context })=>{
17
17
  }
18
18
  }
19
19
  `;
20
- const result = await executeSchema({
20
+ const result = await context.container.resolve(CmsSchemaExecutor).execute(apiType, {
21
21
  query,
22
22
  variables: {
23
23
  revisionId,
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/cms/deleteEntryResolver.js","sources":["../../../../src/graphql/schema/cms/deleteEntryResolver.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport type { ApiEndpoint } from \"~/types/index.js\";\nimport type { ExecutionResult } from \"graphql\";\nimport { getModel, getErrorMessage } from \"./helpers.js\";\n\nexport interface DeleteEntryRevisionArgs {\n modelId: string;\n revisionId: string;\n permanent?: boolean;\n}\n\nexport const createDeleteEntryRevisionResolver = () => {\n return async ({ args, context }: { args: DeleteEntryRevisionArgs; context: CmsContext }) => {\n const { modelId, revisionId, permanent = false } = args;\n\n try {\n const model = await getModel(context, modelId);\n\n // Use manage API for deleting entries.\n const apiType: ApiEndpoint = \"manage\";\n const executeSchema = await context.cms.getExecutableSchema(apiType);\n\n const query = /* GraphQL */ `\n mutation Delete${model.singularApiName}($revisionId: ID!, $options: CmsDeleteEntryOptions) {\n delete${model.singularApiName}(revision: $revisionId, options: $options) {\n data\n error {\n message\n code\n data\n }\n }\n }\n `;\n\n const result = (await executeSchema({\n query,\n variables: {\n revisionId,\n options: { permanently: permanent }\n }\n })) as ExecutionResult;\n\n if (result.errors && result.errors.length > 0) {\n return {\n data: false,\n error: {\n message: result.errors.map(e => e.message).join(\"; \"),\n code: \"DELETE_ENTRY_ERROR\"\n }\n };\n }\n\n const operationName = `delete${model.singularApiName}`;\n return result.data?.[operationName] || { data: false, error: null };\n } catch (error) {\n return {\n data: false,\n error: {\n message: getErrorMessage(error, \"Failed to delete entry\"),\n code: \"DELETE_ENTRY_ERROR\"\n }\n };\n }\n };\n};\n"],"names":["createDeleteEntryRevisionResolver","args","context","modelId","revisionId","permanent","model","getModel","apiType","executeSchema","query","result","e","operationName","error","getErrorMessage"],"mappings":";AAWO,MAAMA,oCAAoC,IACtC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAA0D;QACnF,MAAM,EAAEC,OAAO,EAAEC,UAAU,EAAEC,YAAY,KAAK,EAAE,GAAGJ;QAEnD,IAAI;YACA,MAAMK,QAAQ,MAAMC,SAASL,SAASC;YAGtC,MAAMK,UAAuB;YAC7B,MAAMC,gBAAgB,MAAMP,QAAQ,GAAG,CAAC,mBAAmB,CAACM;YAE5D,MAAME,QAAsB,CAAC;+BACV,EAAEJ,MAAM,eAAe,CAAC;0BAC7B,EAAEA,MAAM,eAAe,CAAC;;;;;;;;;YAStC,CAAC;YAED,MAAMK,SAAU,MAAMF,cAAc;gBAChCC;gBACA,WAAW;oBACPN;oBACA,SAAS;wBAAE,aAAaC;oBAAU;gBACtC;YACJ;YAEA,IAAIM,OAAO,MAAM,IAAIA,OAAO,MAAM,CAAC,MAAM,GAAG,GACxC,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASA,OAAO,MAAM,CAAC,GAAG,CAACC,CAAAA,IAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;oBAChD,MAAM;gBACV;YACJ;YAGJ,MAAMC,gBAAgB,CAAC,MAAM,EAAEP,MAAM,eAAe,EAAE;YACtD,OAAOK,OAAO,IAAI,EAAE,CAACE,cAAc,IAAI;gBAAE,MAAM;gBAAO,OAAO;YAAK;QACtE,EAAE,OAAOC,OAAO;YACZ,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASC,gBAAgBD,OAAO;oBAChC,MAAM;gBACV;YACJ;QACJ;IACJ"}
1
+ {"version":3,"file":"graphql/schema/cms/deleteEntryResolver.js","sources":["../../../../src/graphql/schema/cms/deleteEntryResolver.ts"],"sourcesContent":["import type { CmsContext, ApiEndpoint } from \"~/types/index.js\";\nimport type { ExecutionResult } from \"graphql\";\nimport { getModel, getErrorMessage } from \"./helpers.js\";\nimport { CmsSchemaExecutor } from \"~/graphql/CmsSchemaExecutor.js\";\n\nexport interface DeleteEntryRevisionArgs {\n modelId: string;\n revisionId: string;\n permanent?: boolean;\n}\n\nexport const createDeleteEntryRevisionResolver = () => {\n return async ({ args, context }: { args: DeleteEntryRevisionArgs; context: CmsContext }) => {\n const { modelId, revisionId, permanent = false } = args;\n\n try {\n const model = await getModel(context, modelId);\n\n // Use manage API for deleting entries.\n const apiType: ApiEndpoint = \"manage\";\n\n const query = /* GraphQL */ `\n mutation Delete${model.singularApiName}($revisionId: ID!, $options: CmsDeleteEntryOptions) {\n delete${model.singularApiName}(revision: $revisionId, options: $options) {\n data\n error {\n message\n code\n data\n }\n }\n }\n `;\n\n const result = (await context.container.resolve(CmsSchemaExecutor).execute(apiType, {\n query,\n variables: { revisionId, options: { permanently: permanent } }\n })) as ExecutionResult;\n\n if (result.errors && result.errors.length > 0) {\n return {\n data: false,\n error: {\n message: result.errors.map(e => e.message).join(\"; \"),\n code: \"DELETE_ENTRY_ERROR\"\n }\n };\n }\n\n const operationName = `delete${model.singularApiName}`;\n return result.data?.[operationName] || { data: false, error: null };\n } catch (error) {\n return {\n data: false,\n error: {\n message: getErrorMessage(error, \"Failed to delete entry\"),\n code: \"DELETE_ENTRY_ERROR\"\n }\n };\n }\n };\n};\n"],"names":["createDeleteEntryRevisionResolver","args","context","modelId","revisionId","permanent","model","getModel","apiType","query","result","CmsSchemaExecutor","e","operationName","error","getErrorMessage"],"mappings":";;AAWO,MAAMA,oCAAoC,IACtC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAA0D;QACnF,MAAM,EAAEC,OAAO,EAAEC,UAAU,EAAEC,YAAY,KAAK,EAAE,GAAGJ;QAEnD,IAAI;YACA,MAAMK,QAAQ,MAAMC,SAASL,SAASC;YAGtC,MAAMK,UAAuB;YAE7B,MAAMC,QAAsB,CAAC;+BACV,EAAEH,MAAM,eAAe,CAAC;0BAC7B,EAAEA,MAAM,eAAe,CAAC;;;;;;;;;YAStC,CAAC;YAED,MAAMI,SAAU,MAAMR,QAAQ,SAAS,CAAC,OAAO,CAACS,mBAAmB,OAAO,CAACH,SAAS;gBAChFC;gBACA,WAAW;oBAAEL;oBAAY,SAAS;wBAAE,aAAaC;oBAAU;gBAAE;YACjE;YAEA,IAAIK,OAAO,MAAM,IAAIA,OAAO,MAAM,CAAC,MAAM,GAAG,GACxC,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASA,OAAO,MAAM,CAAC,GAAG,CAACE,CAAAA,IAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;oBAChD,MAAM;gBACV;YACJ;YAGJ,MAAMC,gBAAgB,CAAC,MAAM,EAAEP,MAAM,eAAe,EAAE;YACtD,OAAOI,OAAO,IAAI,EAAE,CAACG,cAAc,IAAI;gBAAE,MAAM;gBAAO,OAAO;YAAK;QACtE,EAAE,OAAOC,OAAO;YACZ,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASC,gBAAgBD,OAAO;oBAChC,MAAM;gBACV;YACJ;QACJ;IACJ"}
@@ -1,10 +1,10 @@
1
1
  import { buildFieldsSelection, getErrorMessage, getModel } from "./helpers.js";
2
+ import { CmsSchemaExecutor } from "../../CmsSchemaExecutor.js";
2
3
  const createGetEntryResolver = ()=>async ({ args, context })=>{
3
4
  const { modelId, where, fields, preview = false } = args;
4
5
  try {
5
6
  const model = await getModel(context, modelId);
6
7
  const apiType = preview ? "preview" : "read";
7
- const executeSchema = await context.cms.getExecutableSchema(apiType);
8
8
  const fieldsSelection = buildFieldsSelection(fields);
9
9
  const query = `
10
10
  query Get${model.singularApiName}($where: ${model.singularApiName}GetWhereInput!) {
@@ -20,7 +20,7 @@ const createGetEntryResolver = ()=>async ({ args, context })=>{
20
20
  }
21
21
  }
22
22
  `;
23
- const result = await executeSchema({
23
+ const result = await context.container.resolve(CmsSchemaExecutor).execute(apiType, {
24
24
  query,
25
25
  variables: {
26
26
  where
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/cms/getEntryResolver.js","sources":["../../../../src/graphql/schema/cms/getEntryResolver.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport type { ApiEndpoint } from \"~/types/index.js\";\nimport type { ExecutionResult } from \"graphql\";\nimport { getModel, getErrorMessage, buildFieldsSelection } from \"./helpers.js\";\n\nexport interface GetEntryArgs {\n modelId: string;\n where: Record<string, unknown>;\n fields: string[];\n preview?: boolean;\n}\n\nexport const createGetEntryResolver = () => {\n return async ({ args, context }: { args: GetEntryArgs; context: CmsContext }) => {\n const { modelId, where, fields, preview = false } = args;\n\n try {\n const model = await getModel(context, modelId);\n\n // Determine which API to use based on the preview flag.\n // preview=true -> preview API, preview=false -> read API\n const apiType: ApiEndpoint = preview ? \"preview\" : \"read\";\n const executeSchema = await context.cms.getExecutableSchema(apiType);\n\n const fieldsSelection = buildFieldsSelection(fields);\n\n const query = /* GraphQL */ `\n query Get${model.singularApiName}($where: ${model.singularApiName}GetWhereInput!) {\n get${model.singularApiName}(where: $where) {\n data {\n ${fieldsSelection}\n }\n error {\n message\n code\n data\n }\n }\n }\n `;\n\n const result = (await executeSchema({\n query,\n variables: { where }\n })) as ExecutionResult;\n\n if (result.errors && result.errors.length > 0) {\n return {\n data: null,\n error: {\n message: result.errors.map(e => e.message).join(\"; \"),\n code: \"GET_ENTRY_ERROR\"\n }\n };\n }\n\n const operationName = `get${model.singularApiName}`;\n return result.data?.[operationName] || { data: null, error: null };\n } catch (error) {\n return {\n data: null,\n error: {\n message: getErrorMessage(error, \"Failed to get entry\"),\n code: \"GET_ENTRY_ERROR\"\n }\n };\n }\n };\n};\n"],"names":["createGetEntryResolver","args","context","modelId","where","fields","preview","model","getModel","apiType","executeSchema","fieldsSelection","buildFieldsSelection","query","result","e","operationName","error","getErrorMessage"],"mappings":";AAYO,MAAMA,yBAAyB,IAC3B,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAA+C;QACxE,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAEC,MAAM,EAAEC,UAAU,KAAK,EAAE,GAAGL;QAEpD,IAAI;YACA,MAAMM,QAAQ,MAAMC,SAASN,SAASC;YAItC,MAAMM,UAAuBH,UAAU,YAAY;YACnD,MAAMI,gBAAgB,MAAMR,QAAQ,GAAG,CAAC,mBAAmB,CAACO;YAE5D,MAAME,kBAAkBC,qBAAqBP;YAE7C,MAAMQ,QAAsB,CAAC;yBAChB,EAAEN,MAAM,eAAe,CAAC,SAAS,EAAEA,MAAM,eAAe,CAAC;uBAC3D,EAAEA,MAAM,eAAe,CAAC;;4BAEnB,EAAEI,gBAAgB;;;;;;;;;YASlC,CAAC;YAED,MAAMG,SAAU,MAAMJ,cAAc;gBAChCG;gBACA,WAAW;oBAAET;gBAAM;YACvB;YAEA,IAAIU,OAAO,MAAM,IAAIA,OAAO,MAAM,CAAC,MAAM,GAAG,GACxC,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASA,OAAO,MAAM,CAAC,GAAG,CAACC,CAAAA,IAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;oBAChD,MAAM;gBACV;YACJ;YAGJ,MAAMC,gBAAgB,CAAC,GAAG,EAAET,MAAM,eAAe,EAAE;YACnD,OAAOO,OAAO,IAAI,EAAE,CAACE,cAAc,IAAI;gBAAE,MAAM;gBAAM,OAAO;YAAK;QACrE,EAAE,OAAOC,OAAO;YACZ,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASC,gBAAgBD,OAAO;oBAChC,MAAM;gBACV;YACJ;QACJ;IACJ"}
1
+ {"version":3,"file":"graphql/schema/cms/getEntryResolver.js","sources":["../../../../src/graphql/schema/cms/getEntryResolver.ts"],"sourcesContent":["import type { CmsContext, ApiEndpoint } from \"~/types/index.js\";\nimport type { ExecutionResult } from \"graphql\";\nimport { getModel, getErrorMessage, buildFieldsSelection } from \"./helpers.js\";\nimport { CmsSchemaExecutor } from \"~/graphql/CmsSchemaExecutor.js\";\n\nexport interface GetEntryArgs {\n modelId: string;\n where: Record<string, unknown>;\n fields: string[];\n preview?: boolean;\n}\n\nexport const createGetEntryResolver = () => {\n return async ({ args, context }: { args: GetEntryArgs; context: CmsContext }) => {\n const { modelId, where, fields, preview = false } = args;\n\n try {\n const model = await getModel(context, modelId);\n\n // Determine which API to use based on the preview flag.\n // preview=true -> preview API, preview=false -> read API\n const apiType: ApiEndpoint = preview ? \"preview\" : \"read\";\n\n const fieldsSelection = buildFieldsSelection(fields);\n\n const query = /* GraphQL */ `\n query Get${model.singularApiName}($where: ${model.singularApiName}GetWhereInput!) {\n get${model.singularApiName}(where: $where) {\n data {\n ${fieldsSelection}\n }\n error {\n message\n code\n data\n }\n }\n }\n `;\n\n const result = (await context.container\n .resolve(CmsSchemaExecutor)\n .execute(apiType, { query, variables: { where } })) as ExecutionResult;\n\n if (result.errors && result.errors.length > 0) {\n return {\n data: null,\n error: {\n message: result.errors.map(e => e.message).join(\"; \"),\n code: \"GET_ENTRY_ERROR\"\n }\n };\n }\n\n const operationName = `get${model.singularApiName}`;\n return result.data?.[operationName] || { data: null, error: null };\n } catch (error) {\n return {\n data: null,\n error: {\n message: getErrorMessage(error, \"Failed to get entry\"),\n code: \"GET_ENTRY_ERROR\"\n }\n };\n }\n };\n};\n"],"names":["createGetEntryResolver","args","context","modelId","where","fields","preview","model","getModel","apiType","fieldsSelection","buildFieldsSelection","query","result","CmsSchemaExecutor","e","operationName","error","getErrorMessage"],"mappings":";;AAYO,MAAMA,yBAAyB,IAC3B,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAA+C;QACxE,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAEC,MAAM,EAAEC,UAAU,KAAK,EAAE,GAAGL;QAEpD,IAAI;YACA,MAAMM,QAAQ,MAAMC,SAASN,SAASC;YAItC,MAAMM,UAAuBH,UAAU,YAAY;YAEnD,MAAMI,kBAAkBC,qBAAqBN;YAE7C,MAAMO,QAAsB,CAAC;yBAChB,EAAEL,MAAM,eAAe,CAAC,SAAS,EAAEA,MAAM,eAAe,CAAC;uBAC3D,EAAEA,MAAM,eAAe,CAAC;;4BAEnB,EAAEG,gBAAgB;;;;;;;;;YASlC,CAAC;YAED,MAAMG,SAAU,MAAMX,QAAQ,SAAS,CAClC,OAAO,CAACY,mBACR,OAAO,CAACL,SAAS;gBAAEG;gBAAO,WAAW;oBAAER;gBAAM;YAAE;YAEpD,IAAIS,OAAO,MAAM,IAAIA,OAAO,MAAM,CAAC,MAAM,GAAG,GACxC,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASA,OAAO,MAAM,CAAC,GAAG,CAACE,CAAAA,IAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;oBAChD,MAAM;gBACV;YACJ;YAGJ,MAAMC,gBAAgB,CAAC,GAAG,EAAET,MAAM,eAAe,EAAE;YACnD,OAAOM,OAAO,IAAI,EAAE,CAACG,cAAc,IAAI;gBAAE,MAAM;gBAAM,OAAO;YAAK;QACrE,EAAE,OAAOC,OAAO;YACZ,OAAO;gBACH,MAAM;gBACN,OAAO;oBACH,SAASC,gBAAgBD,OAAO;oBAChC,MAAM;gBACV;YACJ;QACJ;IACJ"}
@@ -1,6 +1,3 @@
1
1
  import type { CmsContext } from "../../../../types/index.js";
2
2
  import type { CmsModel } from "../../../../types/index.js";
3
- /**
4
- * Helper to get model by modelId.
5
- */
6
3
  export declare const getModel: (context: CmsContext, modelId: string) => Promise<CmsModel>;
@@ -1,7 +1,9 @@
1
+ import { GetModelUseCase } from "../../../../features/contentModel/GetModel/index.js";
1
2
  const getModel = async (context, modelId)=>{
2
- const model = await context.cms.getModel(modelId);
3
- if (!model) throw new Error(`Model "${modelId}" not found`);
4
- return model;
3
+ const result = await context.container.resolve(GetModelUseCase).execute(modelId);
4
+ if (result.isFail()) throw result.error;
5
+ if (!result.value) throw new Error(`Model "${modelId}" not found`);
6
+ return result.value;
5
7
  };
6
8
  export { getModel };
7
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/cms/helpers/getModel.js","sources":["../../../../../src/graphql/schema/cms/helpers/getModel.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport type { CmsModel } from \"~/types/index.js\";\n\n/**\n * Helper to get model by modelId.\n */\nexport const getModel = async (context: CmsContext, modelId: string): Promise<CmsModel> => {\n const model = await context.cms.getModel(modelId);\n if (!model) {\n throw new Error(`Model \"${modelId}\" not found`);\n }\n return model;\n};\n"],"names":["getModel","context","modelId","model","Error"],"mappings":"AAMO,MAAMA,WAAW,OAAOC,SAAqBC;IAChD,MAAMC,QAAQ,MAAMF,QAAQ,GAAG,CAAC,QAAQ,CAACC;IACzC,IAAI,CAACC,OACD,MAAM,IAAIC,MAAM,CAAC,OAAO,EAAEF,QAAQ,WAAW,CAAC;IAElD,OAAOC;AACX"}
1
+ {"version":3,"file":"graphql/schema/cms/helpers/getModel.js","sources":["../../../../../src/graphql/schema/cms/helpers/getModel.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport type { CmsModel } from \"~/types/index.js\";\nimport { GetModelUseCase } from \"~/features/contentModel/GetModel/index.js\";\n\nexport const getModel = async (context: CmsContext, modelId: string): Promise<CmsModel> => {\n const result = await context.container.resolve(GetModelUseCase).execute(modelId);\n if (result.isFail()) {\n throw result.error;\n }\n if (!result.value) {\n throw new Error(`Model \"${modelId}\" not found`);\n }\n return result.value;\n};\n"],"names":["getModel","context","modelId","result","GetModelUseCase","Error"],"mappings":";AAIO,MAAMA,WAAW,OAAOC,SAAqBC;IAChD,MAAMC,SAAS,MAAMF,QAAQ,SAAS,CAAC,OAAO,CAACG,iBAAiB,OAAO,CAACF;IACxE,IAAIC,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;IAEtB,IAAI,CAACA,OAAO,KAAK,EACb,MAAM,IAAIE,MAAM,CAAC,OAAO,EAAEH,QAAQ,WAAW,CAAC;IAElD,OAAOC,OAAO,KAAK;AACvB"}
@@ -1,48 +1,26 @@
1
- const FORBIDDEN_KEYS = new Set([
2
- "__proto__",
3
- "prototype",
4
- "constructor"
5
- ]);
6
1
  const transformWhereToNested = (where)=>{
7
2
  if (!where) return;
8
- return Object.entries(where).reduce((result, [key, value])=>{
3
+ const result = {};
4
+ for (const [key, value] of Object.entries(where)){
9
5
  if ("AND" === key || "OR" === key) {
10
- if (!Array.isArray(value)) return {
11
- ...result,
12
- [key]: value
13
- };
14
- return {
15
- ...result,
16
- [key]: value.map((item)=>transformWhereToNested(item))
17
- };
6
+ if (Array.isArray(value)) result[key] = value.map((item)=>transformWhereToNested(item));
7
+ else result[key] = value;
8
+ continue;
18
9
  }
19
10
  const dotIndex = key.indexOf(".");
20
- if (-1 === dotIndex) {
21
- if (FORBIDDEN_KEYS.has(key)) throw new Error(`Invalid where key: "${key}".`);
22
- return {
23
- ...result,
24
- [key]: value
25
- };
26
- }
27
- const head = key.slice(0, dotIndex);
28
- const tail = key.slice(dotIndex + 1);
29
- if (FORBIDDEN_KEYS.has(head)) throw new Error(`Invalid where key: "${head}".`);
30
- if (Object.hasOwn(result, head)) return {
31
- ...result,
32
- [head]: {
33
- ...result[head],
34
- ...transformWhereToNested({
35
- [tail]: value
36
- })
37
- }
38
- };
39
- return {
40
- ...result,
41
- [head]: transformWhereToNested({
11
+ if (-1 === dotIndex) result[key] = value;
12
+ else {
13
+ const head = key.slice(0, dotIndex);
14
+ const tail = key.slice(dotIndex + 1);
15
+ if (void 0 === result[head]) result[head] = {};
16
+ const nested = result[head];
17
+ const expanded = transformWhereToNested({
42
18
  [tail]: value
43
- })
44
- };
45
- }, {});
19
+ });
20
+ Object.assign(nested, expanded);
21
+ }
22
+ }
23
+ return result;
46
24
  };
47
25
  export { transformWhereToNested };
48
26
 
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/cms/helpers/transformWhereToNested.js","sources":["../../../../../src/graphql/schema/cms/helpers/transformWhereToNested.ts"],"sourcesContent":["const FORBIDDEN_KEYS = new Set([\"__proto__\", \"prototype\", \"constructor\"]);\n\n/**\n * Transforms a flat where object with dot-notation keys into a nested object.\n * Keys without dots are passed through unchanged.\n * Handles logical operators (AND, OR) recursively.\n *\n * @param where - Where clause object potentially containing dot-notation keys\n * @returns Nested where object compatible with the GraphQL ListWhereInput type\n *\n * @example\n * transformWhereToNested({ \"values.name\": \"Keyboard\", id: \"abc\" })\n * // Returns: { values: { name: \"Keyboard\" }, id: \"abc\" }\n *\n * @example\n * transformWhereToNested({ \"values.price_gt\": 100, \"values.name_contains\": \"board\" })\n * // Returns: { values: { price_gt: 100, name_contains: \"board\" } }\n */\nexport const transformWhereToNested = (\n where?: Record<string, unknown>\n): Record<string, unknown> | undefined => {\n if (!where) {\n return undefined;\n }\n\n return Object.entries(where).reduce<Record<string, unknown>>((result, [key, value]) => {\n if (key === \"AND\" || key === \"OR\") {\n if (!Array.isArray(value)) {\n return {\n ...result,\n [key]: value\n };\n }\n return {\n ...result,\n [key]: value.map(item => transformWhereToNested(item))\n };\n }\n\n const dotIndex = key.indexOf(\".\");\n\n if (dotIndex === -1) {\n if (FORBIDDEN_KEYS.has(key)) {\n throw new Error(`Invalid where key: \"${key}\".`);\n }\n return {\n ...result,\n [key]: value\n };\n }\n\n const head = key.slice(0, dotIndex);\n const tail = key.slice(dotIndex + 1);\n\n if (FORBIDDEN_KEYS.has(head)) {\n throw new Error(`Invalid where key: \"${head}\".`);\n }\n\n if (Object.hasOwn(result, head)) {\n return {\n ...result,\n [head]: {\n ...(result[head] as Record<string, unknown>),\n ...transformWhereToNested({ [tail]: value })\n }\n };\n }\n\n return {\n ...result,\n [head]: transformWhereToNested({ [tail]: value })\n };\n }, {});\n};\n"],"names":["FORBIDDEN_KEYS","Set","transformWhereToNested","where","Object","result","key","value","Array","item","dotIndex","Error","head","tail"],"mappings":"AAAA,MAAMA,iBAAiB,IAAIC,IAAI;IAAC;IAAa;IAAa;CAAc;AAkBjE,MAAMC,yBAAyB,CAClCC;IAEA,IAAI,CAACA,OACD;IAGJ,OAAOC,OAAO,OAAO,CAACD,OAAO,MAAM,CAA0B,CAACE,QAAQ,CAACC,KAAKC,MAAM;QAC9E,IAAID,AAAQ,UAARA,OAAiBA,AAAQ,SAARA,KAAc;YAC/B,IAAI,CAACE,MAAM,OAAO,CAACD,QACf,OAAO;gBACH,GAAGF,MAAM;gBACT,CAACC,IAAI,EAAEC;YACX;YAEJ,OAAO;gBACH,GAAGF,MAAM;gBACT,CAACC,IAAI,EAAEC,MAAM,GAAG,CAACE,CAAAA,OAAQP,uBAAuBO;YACpD;QACJ;QAEA,MAAMC,WAAWJ,IAAI,OAAO,CAAC;QAE7B,IAAII,AAAa,OAAbA,UAAiB;YACjB,IAAIV,eAAe,GAAG,CAACM,MACnB,MAAM,IAAIK,MAAM,CAAC,oBAAoB,EAAEL,IAAI,EAAE,CAAC;YAElD,OAAO;gBACH,GAAGD,MAAM;gBACT,CAACC,IAAI,EAAEC;YACX;QACJ;QAEA,MAAMK,OAAON,IAAI,KAAK,CAAC,GAAGI;QAC1B,MAAMG,OAAOP,IAAI,KAAK,CAACI,WAAW;QAElC,IAAIV,eAAe,GAAG,CAACY,OACnB,MAAM,IAAID,MAAM,CAAC,oBAAoB,EAAEC,KAAK,EAAE,CAAC;QAGnD,IAAIR,OAAO,MAAM,CAACC,QAAQO,OACtB,OAAO;YACH,GAAGP,MAAM;YACT,CAACO,KAAK,EAAE;gBACJ,GAAIP,MAAM,CAACO,KAAK;gBAChB,GAAGV,uBAAuB;oBAAE,CAACW,KAAK,EAAEN;gBAAM,EAAE;YAChD;QACJ;QAGJ,OAAO;YACH,GAAGF,MAAM;YACT,CAACO,KAAK,EAAEV,uBAAuB;gBAAE,CAACW,KAAK,EAAEN;YAAM;QACnD;IACJ,GAAG,CAAC;AACR"}
1
+ {"version":3,"file":"graphql/schema/cms/helpers/transformWhereToNested.js","sources":["../../../../../src/graphql/schema/cms/helpers/transformWhereToNested.ts"],"sourcesContent":["/**\n * Transforms a flat where object with dot-notation keys into a nested object.\n * Keys without dots are passed through unchanged.\n * Handles logical operators (AND, OR) recursively.\n *\n * @param where - Where clause object potentially containing dot-notation keys\n * @returns Nested where object compatible with the GraphQL ListWhereInput type\n *\n * @example\n * transformWhereToNested({ \"values.name\": \"Keyboard\", id: \"abc\" })\n * // Returns: { values: { name: \"Keyboard\" }, id: \"abc\" }\n *\n * @example\n * transformWhereToNested({ \"values.price_gt\": 100, \"values.name_contains\": \"board\" })\n * // Returns: { values: { price_gt: 100, name_contains: \"board\" } }\n */\nexport const transformWhereToNested = (\n where?: Record<string, unknown>\n): Record<string, unknown> | undefined => {\n if (!where) {\n return undefined;\n }\n\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(where)) {\n // Handle logical operators recursively.\n if (key === \"AND\" || key === \"OR\") {\n if (Array.isArray(value)) {\n result[key] = value.map(item =>\n transformWhereToNested(item as Record<string, unknown>)\n );\n } else {\n result[key] = value;\n }\n continue;\n }\n\n const dotIndex = key.indexOf(\".\");\n if (dotIndex === -1) {\n // No dot pass through unchanged.\n result[key] = value;\n } else {\n // Dot-notation key — expand into nested object.\n const head = key.slice(0, dotIndex);\n const tail = key.slice(dotIndex + 1);\n\n if (result[head] === undefined) {\n result[head] = {};\n }\n\n const nested = result[head] as Record<string, unknown>;\n // Recursively expand in case of multiple levels of nesting.\n const expanded = transformWhereToNested({ [tail]: value }) as Record<string, unknown>;\n Object.assign(nested, expanded);\n }\n }\n\n return result;\n};\n"],"names":["transformWhereToNested","where","result","key","value","Object","Array","item","dotIndex","head","tail","undefined","nested","expanded"],"mappings":"AAgBO,MAAMA,yBAAyB,CAClCC;IAEA,IAAI,CAACA,OACD;IAGJ,MAAMC,SAAkC,CAAC;IAEzC,KAAK,MAAM,CAACC,KAAKC,MAAM,IAAIC,OAAO,OAAO,CAACJ,OAAQ;QAE9C,IAAIE,AAAQ,UAARA,OAAiBA,AAAQ,SAARA,KAAc;YAC/B,IAAIG,MAAM,OAAO,CAACF,QACdF,MAAM,CAACC,IAAI,GAAGC,MAAM,GAAG,CAACG,CAAAA,OACpBP,uBAAuBO;iBAG3BL,MAAM,CAACC,IAAI,GAAGC;YAElB;QACJ;QAEA,MAAMI,WAAWL,IAAI,OAAO,CAAC;QAC7B,IAAIK,AAAa,OAAbA,UAEAN,MAAM,CAACC,IAAI,GAAGC;aACX;YAEH,MAAMK,OAAON,IAAI,KAAK,CAAC,GAAGK;YAC1B,MAAME,OAAOP,IAAI,KAAK,CAACK,WAAW;YAElC,IAAIN,AAAiBS,WAAjBT,MAAM,CAACO,KAAK,EACZP,MAAM,CAACO,KAAK,GAAG,CAAC;YAGpB,MAAMG,SAASV,MAAM,CAACO,KAAK;YAE3B,MAAMI,WAAWb,uBAAuB;gBAAE,CAACU,KAAK,EAAEN;YAAM;YACxDC,OAAO,MAAM,CAACO,QAAQC;QAC1B;IACJ;IAEA,OAAOX;AACX"}
@@ -1,10 +1,10 @@
1
1
  import { buildFieldsSelection, getErrorMessage, getModel, transformSortToArray, transformWhereToNested } from "./helpers.js";
2
+ import { CmsSchemaExecutor } from "../../CmsSchemaExecutor.js";
2
3
  const createListEntriesResolver = ()=>async ({ args, context })=>{
3
4
  const { modelId, where, sort, limit, after, search, fields, preview = false } = args;
4
5
  try {
5
6
  const model = await getModel(context, modelId);
6
7
  const apiType = preview ? "preview" : "read";
7
- const executeSchema = await context.cms.getExecutableSchema(apiType);
8
8
  const fieldsSelection = buildFieldsSelection(fields);
9
9
  const transformedSort = transformSortToArray(sort);
10
10
  const transformedWhere = transformWhereToNested(where);
@@ -39,7 +39,7 @@ const createListEntriesResolver = ()=>async ({ args, context })=>{
39
39
  }
40
40
  }
41
41
  `;
42
- const result = await executeSchema({
42
+ const result = await context.container.resolve(CmsSchemaExecutor).execute(apiType, {
43
43
  query,
44
44
  variables: {
45
45
  where: transformedWhere,
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/cms/listEntriesResolver.js","sources":["../../../../src/graphql/schema/cms/listEntriesResolver.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport type { ApiEndpoint } from \"~/types/index.js\";\nimport type { ExecutionResult } from \"graphql\";\nimport {\n getModel,\n getErrorMessage,\n buildFieldsSelection,\n transformSortToArray,\n transformWhereToNested\n} from \"./helpers.js\";\n\nexport interface ListEntriesArgs {\n modelId: string;\n where?: Record<string, unknown>;\n sort?: Record<string, unknown> | string[];\n limit?: number;\n after?: string;\n search?: string;\n fields: string[];\n preview?: boolean;\n}\n\nexport const createListEntriesResolver = () => {\n return async ({ args, context }: { args: ListEntriesArgs; context: CmsContext }) => {\n const { modelId, where, sort, limit, after, search, fields, preview = false } = args;\n\n try {\n const model = await getModel(context, modelId);\n\n // Determine which API to use based on the preview flag.\n // preview=true -> preview API, preview=false -> read API\n const apiType: ApiEndpoint = preview ? \"preview\" : \"read\";\n const executeSchema = await context.cms.getExecutableSchema(apiType);\n\n const fieldsSelection = buildFieldsSelection(fields);\n\n // Transform sort to array format expected by the underlying GraphQL schema.\n // Handles both object format {createdOn: \"desc\"} and array format [\"createdOn_DESC\"].\n const transformedSort = transformSortToArray(sort);\n\n // Transform dot-notation where keys (e.g. \"values.name\") into nested objects\n // (e.g. { values: { name: ... } }) so they match the typed ListWhereInput.\n const transformedWhere = transformWhereToNested(where);\n\n const query = /* GraphQL */ `\n query List${model.pluralApiName}(\n $where: ${model.singularApiName}ListWhereInput\n $sort: [${model.singularApiName}ListSorter!]\n $limit: Int\n $after: String\n $search: String\n ) {\n list${model.pluralApiName}(\n where: $where\n sort: $sort\n limit: $limit\n after: $after\n search: $search\n ) {\n data {\n ${fieldsSelection}\n }\n meta {\n cursor\n hasMoreItems\n totalCount\n }\n error {\n message\n code\n data\n }\n }\n }\n `;\n\n const result = (await executeSchema({\n query,\n variables: { where: transformedWhere, sort: transformedSort, limit, after, search }\n })) as ExecutionResult;\n\n if (result.errors && result.errors.length > 0) {\n return {\n data: [],\n meta: { cursor: null, hasMoreItems: false, totalCount: 0 },\n error: {\n message: result.errors.map(e => e.message).join(\"; \"),\n code: \"LIST_ENTRIES_ERROR\"\n }\n };\n }\n\n const operationName = `list${model.pluralApiName}`;\n return (\n result.data?.[operationName] || {\n data: [],\n meta: { cursor: null, hasMoreItems: false, totalCount: 0 },\n error: null\n }\n );\n } catch (error) {\n return {\n data: [],\n meta: { cursor: null, hasMoreItems: false, totalCount: 0 },\n error: {\n message: getErrorMessage(error, \"Failed to list entries\"),\n code: \"LIST_ENTRIES_ERROR\"\n }\n };\n }\n };\n};\n"],"names":["createListEntriesResolver","args","context","modelId","where","sort","limit","after","search","fields","preview","model","getModel","apiType","executeSchema","fieldsSelection","buildFieldsSelection","transformedSort","transformSortToArray","transformedWhere","transformWhereToNested","query","result","e","operationName","error","getErrorMessage"],"mappings":";AAsBO,MAAMA,4BAA4B,IAC9B,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAkD;QAC3E,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAEC,IAAI,EAAEC,KAAK,EAAEC,KAAK,EAAEC,MAAM,EAAEC,MAAM,EAAEC,UAAU,KAAK,EAAE,GAAGT;QAEhF,IAAI;YACA,MAAMU,QAAQ,MAAMC,SAASV,SAASC;YAItC,MAAMU,UAAuBH,UAAU,YAAY;YACnD,MAAMI,gBAAgB,MAAMZ,QAAQ,GAAG,CAAC,mBAAmB,CAACW;YAE5D,MAAME,kBAAkBC,qBAAqBP;YAI7C,MAAMQ,kBAAkBC,qBAAqBb;YAI7C,MAAMc,mBAAmBC,uBAAuBhB;YAEhD,MAAMiB,QAAsB,CAAC;0BACf,EAAEV,MAAM,aAAa,CAAC;4BACpB,EAAEA,MAAM,eAAe,CAAC;4BACxB,EAAEA,MAAM,eAAe,CAAC;;;;;wBAK5B,EAAEA,MAAM,aAAa,CAAC;;;;;;;;4BAQlB,EAAEI,gBAAgB;;;;;;;;;;;;;;YAclC,CAAC;YAED,MAAMO,SAAU,MAAMR,cAAc;gBAChCO;gBACA,WAAW;oBAAE,OAAOF;oBAAkB,MAAMF;oBAAiBX;oBAAOC;oBAAOC;gBAAO;YACtF;YAEA,IAAIc,OAAO,MAAM,IAAIA,OAAO,MAAM,CAAC,MAAM,GAAG,GACxC,OAAO;gBACH,MAAM,EAAE;gBACR,MAAM;oBAAE,QAAQ;oBAAM,cAAc;oBAAO,YAAY;gBAAE;gBACzD,OAAO;oBACH,SAASA,OAAO,MAAM,CAAC,GAAG,CAACC,CAAAA,IAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;oBAChD,MAAM;gBACV;YACJ;YAGJ,MAAMC,gBAAgB,CAAC,IAAI,EAAEb,MAAM,aAAa,EAAE;YAClD,OACIW,OAAO,IAAI,EAAE,CAACE,cAAc,IAAI;gBAC5B,MAAM,EAAE;gBACR,MAAM;oBAAE,QAAQ;oBAAM,cAAc;oBAAO,YAAY;gBAAE;gBACzD,OAAO;YACX;QAER,EAAE,OAAOC,OAAO;YACZ,OAAO;gBACH,MAAM,EAAE;gBACR,MAAM;oBAAE,QAAQ;oBAAM,cAAc;oBAAO,YAAY;gBAAE;gBACzD,OAAO;oBACH,SAASC,gBAAgBD,OAAO;oBAChC,MAAM;gBACV;YACJ;QACJ;IACJ"}
1
+ {"version":3,"file":"graphql/schema/cms/listEntriesResolver.js","sources":["../../../../src/graphql/schema/cms/listEntriesResolver.ts"],"sourcesContent":["import type { CmsContext, ApiEndpoint } from \"~/types/index.js\";\nimport type { ExecutionResult } from \"graphql\";\nimport {\n getModel,\n getErrorMessage,\n buildFieldsSelection,\n transformSortToArray,\n transformWhereToNested\n} from \"./helpers.js\";\nimport { CmsSchemaExecutor } from \"~/graphql/CmsSchemaExecutor.js\";\n\nexport interface ListEntriesArgs {\n modelId: string;\n where?: Record<string, unknown>;\n sort?: Record<string, unknown> | string[];\n limit?: number;\n after?: string;\n search?: string;\n fields: string[];\n preview?: boolean;\n}\n\nexport const createListEntriesResolver = () => {\n return async ({ args, context }: { args: ListEntriesArgs; context: CmsContext }) => {\n const { modelId, where, sort, limit, after, search, fields, preview = false } = args;\n\n try {\n const model = await getModel(context, modelId);\n\n // Determine which API to use based on the preview flag.\n // preview=true -> preview API, preview=false -> read API\n const apiType: ApiEndpoint = preview ? \"preview\" : \"read\";\n\n const fieldsSelection = buildFieldsSelection(fields);\n\n // Transform sort to array format expected by the underlying GraphQL schema.\n // Handles both object format {createdOn: \"desc\"} and array format [\"createdOn_DESC\"].\n const transformedSort = transformSortToArray(sort);\n\n // Transform dot-notation where keys (e.g. \"values.name\") into nested objects\n // (e.g. { values: { name: ... } }) so they match the typed ListWhereInput.\n const transformedWhere = transformWhereToNested(where);\n\n const query = /* GraphQL */ `\n query List${model.pluralApiName}(\n $where: ${model.singularApiName}ListWhereInput\n $sort: [${model.singularApiName}ListSorter!]\n $limit: Int\n $after: String\n $search: String\n ) {\n list${model.pluralApiName}(\n where: $where\n sort: $sort\n limit: $limit\n after: $after\n search: $search\n ) {\n data {\n ${fieldsSelection}\n }\n meta {\n cursor\n hasMoreItems\n totalCount\n }\n error {\n message\n code\n data\n }\n }\n }\n `;\n\n const result = (await context.container.resolve(CmsSchemaExecutor).execute(apiType, {\n query,\n variables: { where: transformedWhere, sort: transformedSort, limit, after, search }\n })) as ExecutionResult;\n\n if (result.errors && result.errors.length > 0) {\n return {\n data: [],\n meta: { cursor: null, hasMoreItems: false, totalCount: 0 },\n error: {\n message: result.errors.map(e => e.message).join(\"; \"),\n code: \"LIST_ENTRIES_ERROR\"\n }\n };\n }\n\n const operationName = `list${model.pluralApiName}`;\n return (\n result.data?.[operationName] || {\n data: [],\n meta: { cursor: null, hasMoreItems: false, totalCount: 0 },\n error: null\n }\n );\n } catch (error) {\n return {\n data: [],\n meta: { cursor: null, hasMoreItems: false, totalCount: 0 },\n error: {\n message: getErrorMessage(error, \"Failed to list entries\"),\n code: \"LIST_ENTRIES_ERROR\"\n }\n };\n }\n };\n};\n"],"names":["createListEntriesResolver","args","context","modelId","where","sort","limit","after","search","fields","preview","model","getModel","apiType","fieldsSelection","buildFieldsSelection","transformedSort","transformSortToArray","transformedWhere","transformWhereToNested","query","result","CmsSchemaExecutor","e","operationName","error","getErrorMessage"],"mappings":";;AAsBO,MAAMA,4BAA4B,IAC9B,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAkD;QAC3E,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAEC,IAAI,EAAEC,KAAK,EAAEC,KAAK,EAAEC,MAAM,EAAEC,MAAM,EAAEC,UAAU,KAAK,EAAE,GAAGT;QAEhF,IAAI;YACA,MAAMU,QAAQ,MAAMC,SAASV,SAASC;YAItC,MAAMU,UAAuBH,UAAU,YAAY;YAEnD,MAAMI,kBAAkBC,qBAAqBN;YAI7C,MAAMO,kBAAkBC,qBAAqBZ;YAI7C,MAAMa,mBAAmBC,uBAAuBf;YAEhD,MAAMgB,QAAsB,CAAC;0BACf,EAAET,MAAM,aAAa,CAAC;4BACpB,EAAEA,MAAM,eAAe,CAAC;4BACxB,EAAEA,MAAM,eAAe,CAAC;;;;;wBAK5B,EAAEA,MAAM,aAAa,CAAC;;;;;;;;4BAQlB,EAAEG,gBAAgB;;;;;;;;;;;;;;YAclC,CAAC;YAED,MAAMO,SAAU,MAAMnB,QAAQ,SAAS,CAAC,OAAO,CAACoB,mBAAmB,OAAO,CAACT,SAAS;gBAChFO;gBACA,WAAW;oBAAE,OAAOF;oBAAkB,MAAMF;oBAAiBV;oBAAOC;oBAAOC;gBAAO;YACtF;YAEA,IAAIa,OAAO,MAAM,IAAIA,OAAO,MAAM,CAAC,MAAM,GAAG,GACxC,OAAO;gBACH,MAAM,EAAE;gBACR,MAAM;oBAAE,QAAQ;oBAAM,cAAc;oBAAO,YAAY;gBAAE;gBACzD,OAAO;oBACH,SAASA,OAAO,MAAM,CAAC,GAAG,CAACE,CAAAA,IAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;oBAChD,MAAM;gBACV;YACJ;YAGJ,MAAMC,gBAAgB,CAAC,IAAI,EAAEb,MAAM,aAAa,EAAE;YAClD,OACIU,OAAO,IAAI,EAAE,CAACG,cAAc,IAAI;gBAC5B,MAAM,EAAE;gBACR,MAAM;oBAAE,QAAQ;oBAAM,cAAc;oBAAO,YAAY;gBAAE;gBACzD,OAAO;YACX;QAER,EAAE,OAAOC,OAAO;YACZ,OAAO;gBACH,MAAM,EAAE;gBACR,MAAM;oBAAE,QAAQ;oBAAM,cAAc;oBAAO,YAAY;gBAAE;gBACzD,OAAO;oBACH,SAASC,gBAAgBD,OAAO;oBAChC,MAAM;gBACV;YACJ;QACJ;IACJ"}
@@ -1,10 +1,10 @@
1
1
  import { buildFieldsSelection, getErrorMessage, getModel } from "./helpers.js";
2
+ import { CmsSchemaExecutor } from "../../CmsSchemaExecutor.js";
2
3
  const createPublishEntryRevisionResolver = ()=>async ({ args, context })=>{
3
4
  const { modelId, revisionId, fields } = args;
4
5
  try {
5
6
  const model = await getModel(context, modelId);
6
7
  const apiType = "manage";
7
- const executeSchema = await context.cms.getExecutableSchema(apiType);
8
8
  const fieldsSelection = buildFieldsSelection(fields);
9
9
  const query = `
10
10
  mutation Publish${model.singularApiName}($revisionId: ID!) {
@@ -20,7 +20,7 @@ const createPublishEntryRevisionResolver = ()=>async ({ args, context })=>{
20
20
  }
21
21
  }
22
22
  `;
23
- const result = await executeSchema({
23
+ const result = await context.container.resolve(CmsSchemaExecutor).execute(apiType, {
24
24
  query,
25
25
  variables: {
26
26
  revisionId