@webiny/api-headless-cms 6.4.11 → 6.6.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (773) 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 +195 -0
  9. package/HeadlessCmsFeature.js.map +1 -0
  10. package/createCmsRoute.d.ts +26 -0
  11. package/createCmsRoute.js +59 -0
  12. package/createCmsRoute.js.map +1 -0
  13. package/crud/contentEntry/entryDataValidation.d.ts +1 -1
  14. package/crud/contentEntry/entryDataValidation.js +29 -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/defaultFields.js +3 -2
  22. package/crud/contentModel/defaultFields.js.map +1 -1
  23. package/crud/contentModel.crud.js +8 -6
  24. package/crud/contentModel.crud.js.map +1 -1
  25. package/crud/contentModelGroup.crud.js +7 -5
  26. package/crud/contentModelGroup.crud.js.map +1 -1
  27. package/domain/contentModel/schemas.d.ts +2 -0
  28. package/domain/contentModel/schemas.js +4 -2
  29. package/domain/contentModel/schemas.js.map +1 -1
  30. package/domain/contentModel/validation/modelFields.js +21 -15
  31. package/domain/contentModel/validation/modelFields.js.map +1 -1
  32. package/export/abstractions.d.ts +9 -0
  33. package/export/abstractions.js +6 -0
  34. package/export/abstractions.js.map +1 -0
  35. package/export/crud/exporting.js +8 -2
  36. package/export/crud/exporting.js.map +1 -1
  37. package/export/crud/importing.js +13 -4
  38. package/export/crud/importing.js.map +1 -1
  39. package/export/crud/imports/importGroups.js +23 -23
  40. package/export/crud/imports/importGroups.js.map +1 -1
  41. package/export/crud/imports/importModels.js +25 -22
  42. package/export/crud/imports/importModels.js.map +1 -1
  43. package/export/graphql/index.d.ts +2 -3
  44. package/export/graphql/index.js +6 -10
  45. package/export/graphql/index.js.map +1 -1
  46. package/exports/api/cms/model.d.ts +4 -1
  47. package/exports/api/cms/model.js +2 -0
  48. package/exports/api/cms/storage.d.ts +0 -1
  49. package/exports/api/cms/storage.js +0 -1
  50. package/features/ai/DescribeContentModelTool.d.ts +55 -0
  51. package/features/ai/DescribeContentModelTool.js +60 -0
  52. package/features/ai/DescribeContentModelTool.js.map +1 -0
  53. package/features/ai/ListContentModelsTool.d.ts +41 -0
  54. package/features/ai/ListContentModelsTool.js +44 -0
  55. package/features/ai/ListContentModelsTool.js.map +1 -0
  56. package/features/ai/QueryEntriesTool.d.ts +75 -0
  57. package/features/ai/QueryEntriesTool.js +90 -0
  58. package/features/ai/QueryEntriesTool.js.map +1 -0
  59. package/features/ai/feature.d.ts +8 -0
  60. package/features/ai/feature.js +15 -0
  61. package/features/ai/feature.js.map +1 -0
  62. package/features/ai/index.d.ts +4 -0
  63. package/features/ai/index.js +4 -0
  64. package/features/contentEntry/ContentEntriesFeature.js +0 -2
  65. package/features/contentEntry/ContentEntriesFeature.js.map +1 -1
  66. package/features/contentEntry/CreateEntry/CreateEntryRepository.d.ts +7 -7
  67. package/features/contentEntry/CreateEntry/CreateEntryRepository.js +8 -14
  68. package/features/contentEntry/CreateEntry/CreateEntryRepository.js.map +1 -1
  69. package/features/contentEntry/CreateEntry/CreateEntryUseCase.d.ts +3 -1
  70. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js +2 -3
  71. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js.map +1 -1
  72. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.d.ts +7 -7
  73. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js +8 -14
  74. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js.map +1 -1
  75. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.d.ts +3 -1
  76. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js +2 -3
  77. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js.map +1 -1
  78. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.d.ts +7 -7
  79. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js +8 -14
  80. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js.map +1 -1
  81. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.d.ts +3 -1
  82. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js +2 -3
  83. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js.map +1 -1
  84. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.d.ts +6 -6
  85. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js +8 -14
  86. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js.map +1 -1
  87. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.d.ts +3 -1
  88. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js +2 -3
  89. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js.map +1 -1
  90. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.d.ts +3 -3
  91. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js +5 -5
  92. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js.map +1 -1
  93. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.d.ts +6 -6
  94. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js +8 -14
  95. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js.map +1 -1
  96. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.d.ts +3 -1
  97. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js +2 -3
  98. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js.map +1 -1
  99. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.d.ts +7 -7
  100. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js +8 -13
  101. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js.map +1 -1
  102. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.d.ts +3 -1
  103. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js +2 -3
  104. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js.map +1 -1
  105. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.d.ts +9 -7
  106. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js +15 -13
  107. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js.map +1 -1
  108. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.d.ts +3 -1
  109. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js +2 -3
  110. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js.map +1 -1
  111. package/features/contentEntry/GetEntry/GetEntryUseCase.d.ts +3 -1
  112. package/features/contentEntry/GetEntry/GetEntryUseCase.js +2 -3
  113. package/features/contentEntry/GetEntry/GetEntryUseCase.js.map +1 -1
  114. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.d.ts +3 -1
  115. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js +2 -3
  116. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js.map +1 -1
  117. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.d.ts +7 -7
  118. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js +8 -13
  119. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js.map +1 -1
  120. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.d.ts +3 -1
  121. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js +2 -3
  122. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js.map +1 -1
  123. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.d.ts +3 -1
  124. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js +2 -3
  125. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js.map +1 -1
  126. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.d.ts +7 -7
  127. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js +8 -13
  128. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js.map +1 -1
  129. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.d.ts +3 -1
  130. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js +2 -3
  131. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js.map +1 -1
  132. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.d.ts +3 -1
  133. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js +1 -3
  134. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js.map +1 -1
  135. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.d.ts +3 -1
  136. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js +2 -3
  137. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js.map +1 -1
  138. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.d.ts +3 -1
  139. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js +2 -3
  140. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js.map +1 -1
  141. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.d.ts +7 -7
  142. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js +8 -13
  143. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js.map +1 -1
  144. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.d.ts +3 -1
  145. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js +2 -3
  146. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js.map +1 -1
  147. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.d.ts +7 -7
  148. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js +8 -13
  149. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js.map +1 -1
  150. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.d.ts +3 -1
  151. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js +2 -3
  152. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js.map +1 -1
  153. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.d.ts +7 -7
  154. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js +8 -13
  155. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js.map +1 -1
  156. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.d.ts +3 -1
  157. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js +2 -3
  158. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js.map +1 -1
  159. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.d.ts +7 -7
  160. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js +8 -13
  161. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js.map +1 -1
  162. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.d.ts +3 -1
  163. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js +1 -3
  164. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js.map +1 -1
  165. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.d.ts +7 -7
  166. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js +8 -13
  167. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js.map +1 -1
  168. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.d.ts +3 -1
  169. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js +2 -3
  170. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js.map +1 -1
  171. package/features/contentEntry/GetSingletonEntry/GetSingletonEntryUseCase.js +1 -3
  172. package/features/contentEntry/GetSingletonEntry/GetSingletonEntryUseCase.js.map +1 -1
  173. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.d.ts +7 -7
  174. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js +8 -13
  175. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js.map +1 -1
  176. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.d.ts +6 -2
  177. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js +8 -6
  178. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js.map +1 -1
  179. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.d.ts +3 -1
  180. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js +1 -3
  181. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js.map +1 -1
  182. package/features/contentEntry/ListEntries/ListEntriesRepository.d.ts +7 -7
  183. package/features/contentEntry/ListEntries/ListEntriesRepository.js +8 -13
  184. package/features/contentEntry/ListEntries/ListEntriesRepository.js.map +1 -1
  185. package/features/contentEntry/ListEntries/ListEntriesUseCase.d.ts +3 -1
  186. package/features/contentEntry/ListEntries/ListEntriesUseCase.js +2 -3
  187. package/features/contentEntry/ListEntries/ListEntriesUseCase.js.map +1 -1
  188. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.d.ts +3 -1
  189. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js +1 -3
  190. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js.map +1 -1
  191. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.d.ts +3 -1
  192. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js +1 -3
  193. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js.map +1 -1
  194. package/features/contentEntry/MoveEntry/MoveEntryRepository.d.ts +7 -7
  195. package/features/contentEntry/MoveEntry/MoveEntryRepository.js +8 -13
  196. package/features/contentEntry/MoveEntry/MoveEntryRepository.js.map +1 -1
  197. package/features/contentEntry/MoveEntry/MoveEntryUseCase.d.ts +3 -1
  198. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js +2 -3
  199. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js.map +1 -1
  200. package/features/contentEntry/PublishEntry/PublishEntryRepository.d.ts +7 -7
  201. package/features/contentEntry/PublishEntry/PublishEntryRepository.js +8 -14
  202. package/features/contentEntry/PublishEntry/PublishEntryRepository.js.map +1 -1
  203. package/features/contentEntry/PublishEntry/PublishEntryUseCase.d.ts +3 -1
  204. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js +2 -3
  205. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js.map +1 -1
  206. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.d.ts +9 -7
  207. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js +12 -15
  208. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js.map +1 -1
  209. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.d.ts +3 -1
  210. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js +2 -3
  211. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js.map +1 -1
  212. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.d.ts +7 -7
  213. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js +8 -14
  214. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js.map +1 -1
  215. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.d.ts +3 -1
  216. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js +2 -3
  217. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js.map +1 -1
  218. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.d.ts +7 -7
  219. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js +8 -14
  220. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js.map +1 -1
  221. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.d.ts +3 -1
  222. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js +2 -3
  223. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js.map +1 -1
  224. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.d.ts +7 -7
  225. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js +8 -14
  226. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js.map +1 -1
  227. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.d.ts +3 -1
  228. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js +2 -3
  229. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js.map +1 -1
  230. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.d.ts +3 -1
  231. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js +2 -3
  232. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js.map +1 -1
  233. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.d.ts +3 -1
  234. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js +2 -3
  235. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js.map +1 -1
  236. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.d.ts +3 -1
  237. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js +2 -4
  238. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js.map +1 -1
  239. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.d.ts +4 -4
  240. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js +4 -8
  241. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js.map +1 -1
  242. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.d.ts +3 -1
  243. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js +1 -3
  244. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js.map +1 -1
  245. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.d.ts +3 -1
  246. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js +1 -3
  247. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js.map +1 -1
  248. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.d.ts +3 -1
  249. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js +1 -3
  250. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js.map +1 -1
  251. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.d.ts +3 -1
  252. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js +2 -4
  253. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js.map +1 -1
  254. package/features/contentModel/ComponentMapGenerator/ComponentMapGenerator.d.ts +14 -0
  255. package/features/contentModel/ComponentMapGenerator/ComponentMapGenerator.js +32 -0
  256. package/features/contentModel/ComponentMapGenerator/ComponentMapGenerator.js.map +1 -0
  257. package/features/contentModel/ComponentMapGenerator/abstractions.d.ts +8 -0
  258. package/features/contentModel/ComponentMapGenerator/abstractions.js +5 -0
  259. package/features/contentModel/ComponentMapGenerator/abstractions.js.map +1 -0
  260. package/features/contentModel/ComponentMapGenerator/feature.d.ts +4 -0
  261. package/features/contentModel/ComponentMapGenerator/feature.js +11 -0
  262. package/features/contentModel/ComponentMapGenerator/feature.js.map +1 -0
  263. package/features/contentModel/ComponentMapGenerator/index.d.ts +2 -0
  264. package/features/contentModel/ComponentMapGenerator/index.js +2 -0
  265. package/features/contentModel/ContentModelFeature.js +6 -0
  266. package/features/contentModel/ContentModelFeature.js.map +1 -1
  267. package/features/contentModel/CreateModel/CreateModelRepository.d.ts +5 -6
  268. package/features/contentModel/CreateModel/CreateModelRepository.js +9 -12
  269. package/features/contentModel/CreateModel/CreateModelRepository.js.map +1 -1
  270. package/features/contentModel/CreateModel/CreateModelUseCase.js +2 -2
  271. package/features/contentModel/CreateModel/CreateModelUseCase.js.map +1 -1
  272. package/features/contentModel/CreateModel/abstractions.d.ts +1 -1
  273. package/features/contentModel/CreateModel/abstractions.js.map +1 -1
  274. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.d.ts +5 -6
  275. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js +9 -12
  276. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js.map +1 -1
  277. package/features/contentModel/CreateModelFrom/CreateModelFromUseCase.js +2 -2
  278. package/features/contentModel/CreateModelFrom/CreateModelFromUseCase.js.map +1 -1
  279. package/features/contentModel/CreateModelFrom/abstractions.d.ts +1 -1
  280. package/features/contentModel/CreateModelFrom/abstractions.js.map +1 -1
  281. package/features/contentModel/DeleteModel/DeleteModelRepository.d.ts +4 -6
  282. package/features/contentModel/DeleteModel/DeleteModelRepository.js +6 -10
  283. package/features/contentModel/DeleteModel/DeleteModelRepository.js.map +1 -1
  284. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.d.ts +1 -0
  285. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js +11 -8
  286. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js.map +1 -1
  287. package/features/contentModel/RefModelsGenerator/RefModelsGenerator.d.ts +19 -0
  288. package/features/contentModel/RefModelsGenerator/RefModelsGenerator.js +56 -0
  289. package/features/contentModel/RefModelsGenerator/RefModelsGenerator.js.map +1 -0
  290. package/features/contentModel/RefModelsGenerator/abstractions.d.ts +11 -0
  291. package/features/contentModel/RefModelsGenerator/abstractions.js +5 -0
  292. package/features/contentModel/RefModelsGenerator/abstractions.js.map +1 -0
  293. package/features/contentModel/RefModelsGenerator/feature.d.ts +4 -0
  294. package/features/contentModel/RefModelsGenerator/feature.js +11 -0
  295. package/features/contentModel/RefModelsGenerator/feature.js.map +1 -0
  296. package/features/contentModel/RefModelsGenerator/index.d.ts +2 -0
  297. package/features/contentModel/RefModelsGenerator/index.js +2 -0
  298. package/features/contentModel/UpdateModel/UpdateModelRepository.d.ts +7 -6
  299. package/features/contentModel/UpdateModel/UpdateModelRepository.js +12 -12
  300. package/features/contentModel/UpdateModel/UpdateModelRepository.js.map +1 -1
  301. package/features/contentModel/UpdateModel/UpdateModelUseCase.js +2 -2
  302. package/features/contentModel/UpdateModel/UpdateModelUseCase.js.map +1 -1
  303. package/features/contentModel/UpdateModel/abstractions.d.ts +1 -1
  304. package/features/contentModel/UpdateModel/abstractions.js.map +1 -1
  305. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.d.ts +16 -0
  306. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js +53 -0
  307. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js.map +1 -0
  308. package/features/contentModel/ValuesSelectionGenerator/abstractions.d.ts +8 -0
  309. package/features/contentModel/ValuesSelectionGenerator/abstractions.js +5 -0
  310. package/features/contentModel/ValuesSelectionGenerator/abstractions.js.map +1 -0
  311. package/features/contentModel/ValuesSelectionGenerator/feature.d.ts +4 -0
  312. package/features/contentModel/ValuesSelectionGenerator/feature.js +11 -0
  313. package/features/contentModel/ValuesSelectionGenerator/feature.js.map +1 -0
  314. package/features/contentModel/ValuesSelectionGenerator/index.d.ts +1 -0
  315. package/features/contentModel/ValuesSelectionGenerator/index.js +1 -0
  316. package/features/contentModel/shared/ModelsFetcher.d.ts +3 -3
  317. package/features/contentModel/shared/ModelsFetcher.js +5 -5
  318. package/features/contentModel/shared/ModelsFetcher.js.map +1 -1
  319. package/features/contentModel/shared/PluginModelsProvider.d.ts +5 -4
  320. package/features/contentModel/shared/PluginModelsProvider.js +11 -8
  321. package/features/contentModel/shared/PluginModelsProvider.js.map +1 -1
  322. package/features/contentModel/shared/abstractions.d.ts +10 -0
  323. package/features/contentModel/shared/abstractions.js +2 -1
  324. package/features/contentModel/shared/abstractions.js.map +1 -1
  325. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.d.ts +11 -7
  326. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js +19 -19
  327. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js.map +1 -1
  328. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.d.ts +6 -2
  329. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js +9 -8
  330. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js.map +1 -1
  331. package/features/contentModelGroup/CreateGroup/abstractions.d.ts +1 -1
  332. package/features/contentModelGroup/CreateGroup/abstractions.js.map +1 -1
  333. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.d.ts +9 -7
  334. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js +12 -14
  335. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js.map +1 -1
  336. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.d.ts +3 -1
  337. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js +2 -3
  338. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js.map +1 -1
  339. package/features/contentModelGroup/GetGroup/GetGroupRepository.d.ts +6 -4
  340. package/features/contentModelGroup/GetGroup/GetGroupRepository.js +9 -9
  341. package/features/contentModelGroup/GetGroup/GetGroupRepository.js.map +1 -1
  342. package/features/contentModelGroup/GetGroup/GetGroupUseCase.d.ts +3 -1
  343. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js +2 -3
  344. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js.map +1 -1
  345. package/features/contentModelGroup/ListGroups/ListGroupsRepository.d.ts +6 -4
  346. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js +9 -9
  347. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js.map +1 -1
  348. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.d.ts +3 -1
  349. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js +2 -3
  350. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js.map +1 -1
  351. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.d.ts +7 -7
  352. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js +9 -14
  353. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js.map +1 -1
  354. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.d.ts +3 -1
  355. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js +4 -5
  356. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js.map +1 -1
  357. package/features/contentModelGroup/UpdateGroup/abstractions.d.ts +1 -1
  358. package/features/contentModelGroup/UpdateGroup/abstractions.js.map +1 -1
  359. package/features/contentModelGroup/shared/PluginGroupsProvider.d.ts +6 -4
  360. package/features/contentModelGroup/shared/PluginGroupsProvider.js +13 -11
  361. package/features/contentModelGroup/shared/PluginGroupsProvider.js.map +1 -1
  362. package/features/contentModelGroup/shared/abstractions.d.ts +10 -0
  363. package/features/contentModelGroup/shared/abstractions.js +2 -1
  364. package/features/contentModelGroup/shared/abstractions.js.map +1 -1
  365. package/features/graphql/feature.js +2 -0
  366. package/features/graphql/feature.js.map +1 -1
  367. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.d.ts +2 -2
  368. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.js.map +1 -1
  369. package/features/graphql/fields/base/AssetToGraphQL.d.ts +26 -0
  370. package/features/graphql/fields/base/AssetToGraphQL.js +148 -0
  371. package/features/graphql/fields/base/AssetToGraphQL.js.map +1 -0
  372. package/features/graphql/fields/base/DynamicZoneToGraphQL.js +5 -1
  373. package/features/graphql/fields/base/DynamicZoneToGraphQL.js.map +1 -1
  374. package/features/graphql/fields/base/ObjectToGraphQL.js +2 -2
  375. package/features/graphql/fields/base/ObjectToGraphQL.js.map +1 -1
  376. package/features/graphql/fields/base/RefToGraphQL.d.ts +1 -1
  377. package/features/graphql/fields/base/RefToGraphQL.js +10 -18
  378. package/features/graphql/fields/base/RefToGraphQL.js.map +1 -1
  379. package/features/graphql/fields/base/richText/richTextResolver.d.ts +1 -1
  380. package/features/graphql/fields/base/richText/richTextResolver.js.map +1 -1
  381. package/features/modelBuilder/abstractions.d.ts +10 -0
  382. package/features/modelBuilder/abstractions.js.map +1 -1
  383. package/features/modelBuilder/feature.js +2 -0
  384. package/features/modelBuilder/feature.js.map +1 -1
  385. package/features/modelBuilder/fields/AssetFieldType.d.ts +20 -0
  386. package/features/modelBuilder/fields/AssetFieldType.js +46 -0
  387. package/features/modelBuilder/fields/AssetFieldType.js.map +1 -0
  388. package/features/modelBuilder/fields/DataFieldBuilder.d.ts +54 -18
  389. package/features/modelBuilder/fields/DataFieldBuilder.js +3 -0
  390. package/features/modelBuilder/fields/DataFieldBuilder.js.map +1 -1
  391. package/features/modelBuilder/fields/DynamicZoneFieldType.d.ts +1 -0
  392. package/features/modelBuilder/fields/DynamicZoneFieldType.js +2 -6
  393. package/features/modelBuilder/fields/DynamicZoneFieldType.js.map +1 -1
  394. package/features/modelBuilder/fields/TextFieldType.d.ts +3 -1
  395. package/features/modelBuilder/fields/TextFieldType.js +1 -3
  396. package/features/modelBuilder/fields/TextFieldType.js.map +1 -1
  397. package/features/modelBuilder/fields/resolveAssetUrl.d.ts +35 -0
  398. package/features/modelBuilder/fields/resolveAssetUrl.js +26 -0
  399. package/features/modelBuilder/fields/resolveAssetUrl.js.map +1 -0
  400. package/features/modelBuilder/index.d.ts +1 -1
  401. package/features/modelBuilder/models/BaseModelBuilder.d.ts +3 -1
  402. package/features/modelBuilder/models/BaseModelBuilder.js +7 -0
  403. package/features/modelBuilder/models/BaseModelBuilder.js.map +1 -1
  404. package/features/modelBuilder/models/PrivateModelBuilder.js +2 -1
  405. package/features/modelBuilder/models/PrivateModelBuilder.js.map +1 -1
  406. package/features/modelBuilder/models/PublicModelBuilder.js +2 -1
  407. package/features/modelBuilder/models/PublicModelBuilder.js.map +1 -1
  408. package/features/shared/abstractions.d.ts +11 -15
  409. package/features/shared/abstractions.js +3 -3
  410. package/features/shared/abstractions.js.map +1 -1
  411. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.d.ts +8 -0
  412. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js +5 -0
  413. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js.map +1 -0
  414. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.d.ts +8 -0
  415. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js +5 -0
  416. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js.map +1 -0
  417. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.d.ts +8 -0
  418. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js +5 -0
  419. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js.map +1 -0
  420. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.d.ts +8 -0
  421. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js +5 -0
  422. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js.map +1 -0
  423. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.d.ts +8 -0
  424. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js +5 -0
  425. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js.map +1 -0
  426. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.d.ts +8 -0
  427. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js +5 -0
  428. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js.map +1 -0
  429. package/features/shared/storageOperations/entry/GetEntryStorageOperation.d.ts +8 -0
  430. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js +5 -0
  431. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js.map +1 -0
  432. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.d.ts +8 -0
  433. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js +5 -0
  434. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js.map +1 -0
  435. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.d.ts +8 -0
  436. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js +5 -0
  437. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js.map +1 -0
  438. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.d.ts +8 -0
  439. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js +5 -0
  440. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js.map +1 -0
  441. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.d.ts +8 -0
  442. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js +5 -0
  443. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js.map +1 -0
  444. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.d.ts +8 -0
  445. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js +5 -0
  446. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js.map +1 -0
  447. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.d.ts +8 -0
  448. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js +5 -0
  449. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js.map +1 -0
  450. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.d.ts +8 -0
  451. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js +5 -0
  452. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js.map +1 -0
  453. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.d.ts +8 -0
  454. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js +5 -0
  455. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js.map +1 -0
  456. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.d.ts +8 -0
  457. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js +5 -0
  458. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js.map +1 -0
  459. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.d.ts +8 -0
  460. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js +5 -0
  461. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js.map +1 -0
  462. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.d.ts +8 -0
  463. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js +5 -0
  464. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js.map +1 -0
  465. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.d.ts +8 -0
  466. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js +5 -0
  467. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js.map +1 -0
  468. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.d.ts +8 -0
  469. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js +5 -0
  470. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js.map +1 -0
  471. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.d.ts +8 -0
  472. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js +5 -0
  473. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js.map +1 -0
  474. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.d.ts +8 -0
  475. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js +5 -0
  476. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js.map +1 -0
  477. package/features/shared/storageOperations/group/CreateGroupStorageOperation.d.ts +8 -0
  478. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js +5 -0
  479. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js.map +1 -0
  480. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.d.ts +8 -0
  481. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js +5 -0
  482. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js.map +1 -0
  483. package/features/shared/storageOperations/group/GetGroupStorageOperation.d.ts +8 -0
  484. package/features/shared/storageOperations/group/GetGroupStorageOperation.js +5 -0
  485. package/features/shared/storageOperations/group/GetGroupStorageOperation.js.map +1 -0
  486. package/features/shared/storageOperations/group/ListGroupsStorageOperation.d.ts +8 -0
  487. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js +5 -0
  488. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js.map +1 -0
  489. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.d.ts +8 -0
  490. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js +5 -0
  491. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js.map +1 -0
  492. package/features/shared/storageOperations/index.d.ts +32 -0
  493. package/features/shared/storageOperations/index.js +32 -0
  494. package/features/shared/storageOperations/model/CreateModelStorageOperation.d.ts +8 -0
  495. package/features/shared/storageOperations/model/CreateModelStorageOperation.js +5 -0
  496. package/features/shared/storageOperations/model/CreateModelStorageOperation.js.map +1 -0
  497. package/features/shared/storageOperations/model/DeleteModelStorageOperation.d.ts +8 -0
  498. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js +5 -0
  499. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js.map +1 -0
  500. package/features/shared/storageOperations/model/GetModelStorageOperation.d.ts +8 -0
  501. package/features/shared/storageOperations/model/GetModelStorageOperation.js +5 -0
  502. package/features/shared/storageOperations/model/GetModelStorageOperation.js.map +1 -0
  503. package/features/shared/storageOperations/model/ListModelsStorageOperation.d.ts +8 -0
  504. package/features/shared/storageOperations/model/ListModelsStorageOperation.js +5 -0
  505. package/features/shared/storageOperations/model/ListModelsStorageOperation.js.map +1 -0
  506. package/features/shared/storageOperations/model/UpdateModelStorageOperation.d.ts +8 -0
  507. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js +5 -0
  508. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js.map +1 -0
  509. package/features/sortMapper/SortMapper.js +2 -5
  510. package/features/sortMapper/SortMapper.js.map +1 -1
  511. package/features/whereMapper/WhereMapper.js +7 -5
  512. package/features/whereMapper/WhereMapper.js.map +1 -1
  513. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +3 -7
  514. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
  515. package/fieldConverters/abstractions.d.ts +14 -0
  516. package/fieldConverters/abstractions.js +13 -0
  517. package/fieldConverters/abstractions.js.map +1 -0
  518. package/fieldConverters/index.d.ts +1 -1
  519. package/graphql/CmsGraphQLSchemaFactory.d.ts +8 -0
  520. package/graphql/CmsGraphQLSchemaFactory.js +5 -0
  521. package/graphql/CmsGraphQLSchemaFactory.js.map +1 -0
  522. package/graphql/CmsSchemaExecutor.d.ts +10 -0
  523. package/graphql/CmsSchemaExecutor.js +5 -0
  524. package/graphql/CmsSchemaExecutor.js.map +1 -0
  525. package/graphql/buildSchemaPlugins.d.ts +2 -1
  526. package/graphql/buildSchemaPlugins.js +1 -3
  527. package/graphql/buildSchemaPlugins.js.map +1 -1
  528. package/graphql/checkEndpointAccess.js +5 -2
  529. package/graphql/checkEndpointAccess.js.map +1 -1
  530. package/graphql/createExecutableSchema.d.ts +1 -1
  531. package/graphql/createExecutableSchema.js +1 -1
  532. package/graphql/createExecutableSchema.js.map +1 -1
  533. package/graphql/generateSchema.d.ts +2 -1
  534. package/graphql/generateSchema.js +14 -5
  535. package/graphql/generateSchema.js.map +1 -1
  536. package/graphql/getSchema.js +7 -2
  537. package/graphql/getSchema.js.map +1 -1
  538. package/graphql/scalars/RevisionIdScalarPlugin.d.ts +1 -1
  539. package/graphql/scalars/RevisionIdScalarPlugin.js.map +1 -1
  540. package/graphql/schema/baseContentSchema.d.ts +1 -6
  541. package/graphql/schema/baseContentSchema.js +5 -8
  542. package/graphql/schema/baseContentSchema.js.map +1 -1
  543. package/graphql/schema/baseSchema.d.ts +2 -2
  544. package/graphql/schema/baseSchema.js +6 -41
  545. package/graphql/schema/baseSchema.js.map +1 -1
  546. package/graphql/schema/cms/CmsBaseErrorTypeFactory.d.ts +14 -0
  547. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js +21 -0
  548. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js.map +1 -0
  549. package/graphql/schema/cms/createEntryResolver.js +2 -2
  550. package/graphql/schema/cms/createEntryResolver.js.map +1 -1
  551. package/graphql/schema/cms/deleteEntryResolver.js +2 -2
  552. package/graphql/schema/cms/deleteEntryResolver.js.map +1 -1
  553. package/graphql/schema/cms/getEntryResolver.js +5 -4
  554. package/graphql/schema/cms/getEntryResolver.js.map +1 -1
  555. package/graphql/schema/cms/getModelResolver.d.ts +35 -0
  556. package/graphql/schema/cms/getModelResolver.js +49 -0
  557. package/graphql/schema/cms/getModelResolver.js.map +1 -0
  558. package/graphql/schema/cms/helpers/buildFieldsSelection.js +9 -2
  559. package/graphql/schema/cms/helpers/buildFieldsSelection.js.map +1 -1
  560. package/graphql/schema/cms/helpers/expandFieldWildcards.d.ts +2 -0
  561. package/graphql/schema/cms/helpers/expandFieldWildcards.js +13 -0
  562. package/graphql/schema/cms/helpers/expandFieldWildcards.js.map +1 -0
  563. package/graphql/schema/cms/helpers/getModel.d.ts +0 -3
  564. package/graphql/schema/cms/helpers/getModel.js +5 -3
  565. package/graphql/schema/cms/helpers/getModel.js.map +1 -1
  566. package/graphql/schema/cms/helpers/index.d.ts +1 -0
  567. package/graphql/schema/cms/helpers/index.js +1 -0
  568. package/graphql/schema/cms/helpers.d.ts +1 -0
  569. package/graphql/schema/cms/helpers.js +1 -0
  570. package/graphql/schema/cms/listEntriesResolver.js +5 -4
  571. package/graphql/schema/cms/listEntriesResolver.js.map +1 -1
  572. package/graphql/schema/cms/publishEntryResolver.js +2 -2
  573. package/graphql/schema/cms/publishEntryResolver.js.map +1 -1
  574. package/graphql/schema/cms/resolvers/createEntry.d.ts +2 -2
  575. package/graphql/schema/cms/resolvers/createEntry.js +1 -1
  576. package/graphql/schema/cms/resolvers/createEntry.js.map +1 -1
  577. package/graphql/schema/cms/resolvers/deleteEntryRevision.d.ts +2 -2
  578. package/graphql/schema/cms/resolvers/deleteEntryRevision.js +1 -1
  579. package/graphql/schema/cms/resolvers/deleteEntryRevision.js.map +1 -1
  580. package/graphql/schema/cms/resolvers/getEntry.d.ts +2 -2
  581. package/graphql/schema/cms/resolvers/getEntry.js +1 -1
  582. package/graphql/schema/cms/resolvers/getEntry.js.map +1 -1
  583. package/graphql/schema/cms/resolvers/getModel.d.ts +8 -0
  584. package/graphql/schema/cms/resolvers/getModel.js +18 -0
  585. package/graphql/schema/cms/resolvers/getModel.js.map +1 -0
  586. package/graphql/schema/cms/resolvers/index.d.ts +1 -0
  587. package/graphql/schema/cms/resolvers/index.js +1 -0
  588. package/graphql/schema/cms/resolvers/listEntries.d.ts +2 -2
  589. package/graphql/schema/cms/resolvers/listEntries.js +1 -1
  590. package/graphql/schema/cms/resolvers/listEntries.js.map +1 -1
  591. package/graphql/schema/cms/resolvers/mutationCms.d.ts +2 -2
  592. package/graphql/schema/cms/resolvers/mutationCms.js +1 -1
  593. package/graphql/schema/cms/resolvers/mutationCms.js.map +1 -1
  594. package/graphql/schema/cms/resolvers/publishEntryRevision.d.ts +2 -2
  595. package/graphql/schema/cms/resolvers/publishEntryRevision.js +1 -1
  596. package/graphql/schema/cms/resolvers/publishEntryRevision.js.map +1 -1
  597. package/graphql/schema/cms/resolvers/queryCms.d.ts +2 -2
  598. package/graphql/schema/cms/resolvers/queryCms.js +1 -1
  599. package/graphql/schema/cms/resolvers/queryCms.js.map +1 -1
  600. package/graphql/schema/cms/resolvers/unpublishEntryRevision.d.ts +2 -2
  601. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js +1 -1
  602. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js.map +1 -1
  603. package/graphql/schema/cms/resolvers/updateEntryRevision.d.ts +2 -2
  604. package/graphql/schema/cms/resolvers/updateEntryRevision.js +1 -1
  605. package/graphql/schema/cms/resolvers/updateEntryRevision.js.map +1 -1
  606. package/graphql/schema/cms/typeDefs/mutation.d.ts +2 -2
  607. package/graphql/schema/cms/typeDefs/mutation.js +1 -1
  608. package/graphql/schema/cms/typeDefs/mutation.js.map +1 -1
  609. package/graphql/schema/cms/typeDefs/query.d.ts +2 -2
  610. package/graphql/schema/cms/typeDefs/query.js +2 -1
  611. package/graphql/schema/cms/typeDefs/query.js.map +1 -1
  612. package/graphql/schema/cms/typeDefs/responses.d.ts +2 -2
  613. package/graphql/schema/cms/typeDefs/responses.js +6 -1
  614. package/graphql/schema/cms/typeDefs/responses.js.map +1 -1
  615. package/graphql/schema/cms/unpublishEntryResolver.js +2 -2
  616. package/graphql/schema/cms/unpublishEntryResolver.js.map +1 -1
  617. package/graphql/schema/cms/updateEntryResolver.js +2 -2
  618. package/graphql/schema/cms/updateEntryResolver.js.map +1 -1
  619. package/graphql/schema/contentEntries.js +43 -32
  620. package/graphql/schema/contentEntries.js.map +1 -1
  621. package/graphql/schema/contentModelGroups.js +39 -18
  622. package/graphql/schema/contentModelGroups.js.map +1 -1
  623. package/graphql/schema/contentModels.js +68 -16
  624. package/graphql/schema/contentModels.js.map +1 -1
  625. package/graphql/schema/createFieldResolvers.d.ts +1 -1
  626. package/graphql/schema/createFieldResolvers.js.map +1 -1
  627. package/graphql/schema/createManageResolvers.js +4 -2
  628. package/graphql/schema/createManageResolvers.js.map +1 -1
  629. package/graphql/schema/resolvers/manage/resolveCreate.js +5 -3
  630. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
  631. package/graphql/schema/resolvers/manage/resolveCreateFrom.js +5 -3
  632. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
  633. package/graphql/schema/resolvers/manage/resolveDelete.js +9 -4
  634. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
  635. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +5 -3
  636. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -1
  637. package/graphql/schema/resolvers/manage/resolveGet.js +11 -6
  638. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
  639. package/graphql/schema/resolvers/manage/resolveGetByIds.js +5 -3
  640. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
  641. package/graphql/schema/resolvers/manage/resolveGetRevisions.js +5 -3
  642. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
  643. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +5 -3
  644. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -1
  645. package/graphql/schema/resolvers/manage/resolveList.js +5 -3
  646. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
  647. package/graphql/schema/resolvers/manage/resolveListDeleted.js +5 -3
  648. package/graphql/schema/resolvers/manage/resolveListDeleted.js.map +1 -1
  649. package/graphql/schema/resolvers/manage/resolveMove.js +4 -2
  650. package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -1
  651. package/graphql/schema/resolvers/manage/resolvePublish.js +5 -3
  652. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
  653. package/graphql/schema/resolvers/manage/resolveRepublish.js +5 -3
  654. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
  655. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js +5 -3
  656. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js.map +1 -1
  657. package/graphql/schema/resolvers/manage/resolveUnpublish.js +5 -3
  658. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
  659. package/graphql/schema/resolvers/manage/resolveUpdate.js +5 -3
  660. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
  661. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js +5 -3
  662. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js.map +1 -1
  663. package/graphql/schema/resolvers/manage/resolveValidate.js +5 -3
  664. package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -1
  665. package/graphql/schema/resolvers/preview/resolveGet.js +6 -3
  666. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
  667. package/graphql/schema/resolvers/preview/resolveList.js +5 -3
  668. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
  669. package/graphql/schema/resolvers/read/resolveGet.js +5 -2
  670. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
  671. package/graphql/schema/resolvers/read/resolveList.js +5 -3
  672. package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
  673. package/graphql/schema/resolvers/singular/resolveGet.js +1 -1
  674. package/graphql/schema/resolvers/singular/resolveGet.js.map +1 -1
  675. package/graphql/schema/resolvers/singular/resolveUpdate.js +1 -1
  676. package/graphql/schema/resolvers/singular/resolveUpdate.js.map +1 -1
  677. package/graphql/schema/schemaPlugins.d.ts +2 -1
  678. package/graphql/schema/schemaPlugins.js +2 -4
  679. package/graphql/schema/schemaPlugins.js.map +1 -1
  680. package/index.d.ts +7 -6
  681. package/index.js +4 -22
  682. package/legacy/abstractions.js.map +1 -1
  683. package/package.json +23 -29
  684. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.d.ts +2 -2
  685. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js +1 -1
  686. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js.map +1 -1
  687. package/plugins/CmsModelPlugin.js +2 -1
  688. package/plugins/CmsModelPlugin.js.map +1 -1
  689. package/plugins/index.d.ts +0 -1
  690. package/plugins/index.js +0 -1
  691. package/types/fields/dynamicZoneField.d.ts +1 -0
  692. package/types/model.d.ts +6 -0
  693. package/types/modelField.d.ts +2 -0
  694. package/types/types.d.ts +10 -183
  695. package/types/types.js.map +1 -1
  696. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.d.ts +28 -0
  697. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js +324 -0
  698. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js.map +1 -0
  699. package/utils/contentModelToJsonSchema/index.d.ts +2 -0
  700. package/utils/contentModelToJsonSchema/index.js +1 -0
  701. package/utils/contentModelToJsonSchema/types.d.ts +24 -0
  702. package/utils/contentModelToJsonSchema/types.js +0 -0
  703. package/utils/converters/ConverterCollection.d.ts +2 -2
  704. package/utils/converters/ConverterCollection.js +1 -3
  705. package/utils/converters/ConverterCollection.js.map +1 -1
  706. package/utils/converters/valueKeyFromStorageConverter.d.ts +2 -2
  707. package/utils/converters/valueKeyFromStorageConverter.js +2 -2
  708. package/utils/converters/valueKeyFromStorageConverter.js.map +1 -1
  709. package/utils/converters/valueKeyStorageConverter.js +4 -2
  710. package/utils/converters/valueKeyStorageConverter.js.map +1 -1
  711. package/utils/converters/valueKeyToStorageConverter.d.ts +2 -2
  712. package/utils/converters/valueKeyToStorageConverter.js +2 -2
  713. package/utils/converters/valueKeyToStorageConverter.js.map +1 -1
  714. package/utils/getSchemaFromFieldPlugins.d.ts +2 -2
  715. package/utils/getSchemaFromFieldPlugins.js.map +1 -1
  716. package/utils/index.d.ts +1 -0
  717. package/utils/index.js +1 -0
  718. package/utils/isHeadlessCmsReady.d.ts +1 -1
  719. package/utils/isHeadlessCmsReady.js +3 -2
  720. package/utils/isHeadlessCmsReady.js.map +1 -1
  721. package/abstractions/entryHooks/OnEntryBeforeCreate.d.ts +0 -8
  722. package/abstractions/entryHooks/OnEntryBeforeCreate.js +0 -5
  723. package/abstractions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  724. package/abstractions/entryHooks/index.d.ts +0 -1
  725. package/abstractions/entryHooks/index.js +0 -1
  726. package/abstractions/index.d.ts +0 -1
  727. package/abstractions/index.js +0 -1
  728. package/context.d.ts +0 -3
  729. package/context.js +0 -131
  730. package/context.js.map +0 -1
  731. package/extensions/entryHooks/OnEntryBeforeCreate.d.ts +0 -4
  732. package/extensions/entryHooks/OnEntryBeforeCreate.js +0 -21
  733. package/extensions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  734. package/extensions/entryHooks/index.d.ts +0 -1
  735. package/extensions/entryHooks/index.js +0 -1
  736. package/extensions/index.d.ts +0 -5
  737. package/extensions/index.js +0 -7
  738. package/extensions/index.js.map +0 -1
  739. package/features/runtimeTenant/RuntimeTenant.d.ts +0 -13
  740. package/features/runtimeTenant/RuntimeTenant.js +0 -22
  741. package/features/runtimeTenant/RuntimeTenant.js.map +0 -1
  742. package/features/runtimeTenant/abstractions.d.ts +0 -11
  743. package/features/runtimeTenant/abstractions.js +0 -5
  744. package/features/runtimeTenant/abstractions.js.map +0 -1
  745. package/features/runtimeTenant/index.d.ts +0 -2
  746. package/features/runtimeTenant/index.js +0 -2
  747. package/graphql/graphQLHandlerFactory.d.ts +0 -5
  748. package/graphql/graphQLHandlerFactory.js +0 -22
  749. package/graphql/graphQLHandlerFactory.js.map +0 -1
  750. package/graphql/handleRequest.d.ts +0 -11
  751. package/graphql/handleRequest.js +0 -62
  752. package/graphql/handleRequest.js.map +0 -1
  753. package/graphql/index.d.ts +0 -4
  754. package/graphql/index.js +0 -11
  755. package/graphql/index.js.map +0 -1
  756. package/graphql/schema/cms/index.d.ts +0 -2
  757. package/graphql/schema/cms/index.js +0 -24
  758. package/graphql/schema/cms/index.js.map +0 -1
  759. package/index.js.map +0 -1
  760. package/parameters/context.d.ts +0 -2
  761. package/parameters/context.js +0 -7
  762. package/parameters/context.js.map +0 -1
  763. package/parameters/header.d.ts +0 -2
  764. package/parameters/header.js +0 -13
  765. package/parameters/header.js.map +0 -1
  766. package/parameters/index.d.ts +0 -3
  767. package/parameters/index.js +0 -3
  768. package/parameters/path.d.ts +0 -2
  769. package/parameters/path.js +0 -12
  770. package/parameters/path.js.map +0 -1
  771. package/plugins/CmsParametersPlugin.d.ts +0 -18
  772. package/plugins/CmsParametersPlugin.js +0 -16
  773. package/plugins/CmsParametersPlugin.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js","sources":["../../../../../src/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/handler-graphql/responses.js\";\nimport type { CmsEntryResolverFactory as ResolverFactory } from \"~/types/index.js\";\n\ninterface ResolveUpdateRevisionDescriptionArgs {\n revision: string;\n revisionDescription: string | undefined;\n}\ntype ResolveUpdateRevisionDescription = ResolverFactory<any, ResolveUpdateRevisionDescriptionArgs>;\n\nexport const resolveUpdateRevisionDescription: ResolveUpdateRevisionDescription =\n ({ model }) =>\n async (_, args, context) => {\n try {\n const entry = await context.cms.updateRevisionDescription(\n model,\n args.revision,\n args.revisionDescription\n );\n\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"names":["resolveUpdateRevisionDescription","model","_","args","context","entry","Response","e","ErrorResponse"],"mappings":";AASO,MAAMA,mCACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAGC,MAAMC;QACZ,IAAI;YACA,MAAMC,QAAQ,MAAMD,QAAQ,GAAG,CAAC,yBAAyB,CACrDH,OACAE,KAAK,QAAQ,EACbA,KAAK,mBAAmB;YAG5B,OAAO,IAAIG,SAASD;QACxB,EAAE,OAAOE,GAAG;YACR,OAAO,IAAIC,cAAcD;QAC7B;IACJ"}
1
+ {"version":3,"file":"graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js","sources":["../../../../../src/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/api-graphql/responses.js\";\nimport type { CmsEntryResolverFactory as ResolverFactory } from \"~/types/index.js\";\nimport { UpdateRevisionDescriptionUseCase } from \"~/features/contentEntry/UpdateRevisionDescription/index.js\";\n\ninterface ResolveUpdateRevisionDescriptionArgs {\n revision: string;\n revisionDescription: string | undefined;\n}\ntype ResolveUpdateRevisionDescription = ResolverFactory<any, ResolveUpdateRevisionDescriptionArgs>;\n\nexport const resolveUpdateRevisionDescription: ResolveUpdateRevisionDescription =\n ({ model }) =>\n async (_, args, context) => {\n try {\n const result = await context.container\n .resolve(UpdateRevisionDescriptionUseCase)\n .execute(model, args.revision, args.revisionDescription);\n if (result.isFail()) {\n throw result.error;\n }\n return new Response(result.value);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"names":["resolveUpdateRevisionDescription","model","_","args","context","result","UpdateRevisionDescriptionUseCase","Response","e","ErrorResponse"],"mappings":";;AAUO,MAAMA,mCACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAGC,MAAMC;QACZ,IAAI;YACA,MAAMC,SAAS,MAAMD,QAAQ,SAAS,CACjC,OAAO,CAACE,kCACR,OAAO,CAACL,OAAOE,KAAK,QAAQ,EAAEA,KAAK,mBAAmB;YAC3D,IAAIE,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;YAEtB,OAAO,IAAIE,SAASF,OAAO,KAAK;QACpC,EAAE,OAAOG,GAAG;YACR,OAAO,IAAIC,cAAcD;QAC7B;IACJ"}
@@ -1,8 +1,10 @@
1
- import { ErrorResponse, Response } from "@webiny/handler-graphql/responses.js";
1
+ import { ErrorResponse, Response } from "@webiny/api-graphql/responses.js";
2
+ import { ValidateEntryUseCase } from "../../../../features/contentEntry/ValidateEntry/index.js";
2
3
  const resolveValidate = ({ model })=>async (_, args, context)=>{
3
4
  try {
4
- const entry = await context.cms.validateEntry(model, args.revision, args.data);
5
- return new Response(entry);
5
+ const result = await context.container.resolve(ValidateEntryUseCase).execute(model, args.revision, args.data);
6
+ if (result.isFail()) throw result.error;
7
+ return new Response(result.value);
6
8
  } catch (e) {
7
9
  return new ErrorResponse(e);
8
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/resolvers/manage/resolveValidate.js","sources":["../../../../../src/graphql/schema/resolvers/manage/resolveValidate.ts"],"sourcesContent":["import { Response, ErrorResponse } from \"@webiny/handler-graphql/responses.js\";\nimport type {\n CmsEntryResolverFactory as ResolverFactory,\n UpdateCmsEntryInput\n} from \"~/types/index.js\";\n\ninterface ResolveUpdateArgs {\n revision?: string;\n data: UpdateCmsEntryInput;\n}\ntype ResolveValidate = ResolverFactory<any, ResolveUpdateArgs>;\n\nexport const resolveValidate: ResolveValidate =\n ({ model }) =>\n async (_, args: any, context) => {\n try {\n const entry = await context.cms.validateEntry(model, args.revision, args.data);\n\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"names":["resolveValidate","model","_","args","context","entry","Response","e","ErrorResponse"],"mappings":";AAYO,MAAMA,kBACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAGC,MAAWC;QACjB,IAAI;YACA,MAAMC,QAAQ,MAAMD,QAAQ,GAAG,CAAC,aAAa,CAACH,OAAOE,KAAK,QAAQ,EAAEA,KAAK,IAAI;YAE7E,OAAO,IAAIG,SAASD;QACxB,EAAE,OAAOE,GAAG;YACR,OAAO,IAAIC,cAAcD;QAC7B;IACJ"}
1
+ {"version":3,"file":"graphql/schema/resolvers/manage/resolveValidate.js","sources":["../../../../../src/graphql/schema/resolvers/manage/resolveValidate.ts"],"sourcesContent":["import { Response, ErrorResponse } from \"@webiny/api-graphql/responses.js\";\nimport type {\n CmsEntryResolverFactory as ResolverFactory,\n UpdateCmsEntryInput\n} from \"~/types/index.js\";\nimport { ValidateEntryUseCase } from \"~/features/contentEntry/ValidateEntry/index.js\";\n\ninterface ResolveUpdateArgs {\n revision?: string;\n data: UpdateCmsEntryInput;\n}\ntype ResolveValidate = ResolverFactory<any, ResolveUpdateArgs>;\n\nexport const resolveValidate: ResolveValidate =\n ({ model }) =>\n async (_, args: any, context) => {\n try {\n const result = await context.container\n .resolve(ValidateEntryUseCase)\n .execute(model, args.revision, args.data);\n if (result.isFail()) {\n throw result.error;\n }\n return new Response(result.value);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"names":["resolveValidate","model","_","args","context","result","ValidateEntryUseCase","Response","e","ErrorResponse"],"mappings":";;AAaO,MAAMA,kBACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAGC,MAAWC;QACjB,IAAI;YACA,MAAMC,SAAS,MAAMD,QAAQ,SAAS,CACjC,OAAO,CAACE,sBACR,OAAO,CAACL,OAAOE,KAAK,QAAQ,EAAEA,KAAK,IAAI;YAC5C,IAAIE,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;YAEtB,OAAO,IAAIE,SAASF,OAAO,KAAK;QACpC,EAAE,OAAOG,GAAG;YACR,OAAO,IAAIC,cAAcD;QAC7B;IACJ"}
@@ -1,11 +1,14 @@
1
- import { ErrorResponse, Response } from "@webiny/handler-graphql/responses.js";
2
- import { NotFoundError } from "@webiny/handler-graphql";
1
+ import { ErrorResponse, Response } from "@webiny/api-graphql/responses.js";
2
+ import { NotFoundError } from "@webiny/api-graphql";
3
+ import { ListLatestEntriesUseCase } from "../../../../features/contentEntry/ListEntries/index.js";
3
4
  const resolveGet = ({ model })=>async (_, args, context)=>{
4
5
  try {
5
- const [[entry]] = await context.cms.listLatestEntries(model, {
6
+ const result = await context.container.resolve(ListLatestEntriesUseCase).execute(model, {
6
7
  ...args,
7
8
  limit: 1
8
9
  });
10
+ if (result.isFail()) throw result.error;
11
+ const entry = result.value.entries[0];
9
12
  if (!entry) throw new NotFoundError("Entry not found!");
10
13
  return new Response(entry);
11
14
  } catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/resolvers/preview/resolveGet.js","sources":["../../../../../src/graphql/schema/resolvers/preview/resolveGet.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/handler-graphql/responses.js\";\nimport type {\n CmsEntryListParams,\n CmsEntryResolverFactory as ResolverFactory\n} from \"~/types/index.js\";\nimport { NotFoundError } from \"@webiny/handler-graphql\";\n\ntype ResolveGet = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveGet: ResolveGet =\n ({ model }) =>\n async (_: any, args: any, context) => {\n try {\n const [[entry]] = await context.cms.listLatestEntries(model, {\n ...args,\n limit: 1\n });\n if (!entry) {\n throw new NotFoundError(`Entry not found!`);\n }\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"names":["resolveGet","model","_","args","context","entry","NotFoundError","Response","e","ErrorResponse"],"mappings":";;AASO,MAAMA,aACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAQC,MAAWC;QACtB,IAAI;YACA,MAAM,CAAC,CAACC,MAAM,CAAC,GAAG,MAAMD,QAAQ,GAAG,CAAC,iBAAiB,CAACH,OAAO;gBACzD,GAAGE,IAAI;gBACP,OAAO;YACX;YACA,IAAI,CAACE,OACD,MAAM,IAAIC,cAAc;YAE5B,OAAO,IAAIC,SAASF;QACxB,EAAE,OAAOG,GAAG;YACR,OAAO,IAAIC,cAAcD;QAC7B;IACJ"}
1
+ {"version":3,"file":"graphql/schema/resolvers/preview/resolveGet.js","sources":["../../../../../src/graphql/schema/resolvers/preview/resolveGet.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/api-graphql/responses.js\";\nimport { NotFoundError } from \"@webiny/api-graphql\";\nimport type {\n CmsEntryListParams,\n CmsEntryResolverFactory as ResolverFactory\n} from \"~/types/index.js\";\nimport { ListLatestEntriesUseCase } from \"~/features/contentEntry/ListEntries/index.js\";\n\ntype ResolveGet = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveGet: ResolveGet =\n ({ model }) =>\n async (_: any, args: any, context) => {\n try {\n const result = await context.container\n .resolve(ListLatestEntriesUseCase)\n .execute(model, { ...args, limit: 1 });\n if (result.isFail()) {\n throw result.error;\n }\n const entry = result.value.entries[0];\n if (!entry) {\n throw new NotFoundError(`Entry not found!`);\n }\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"names":["resolveGet","model","_","args","context","result","ListLatestEntriesUseCase","entry","NotFoundError","Response","e","ErrorResponse"],"mappings":";;;AAUO,MAAMA,aACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAQC,MAAWC;QACtB,IAAI;YACA,MAAMC,SAAS,MAAMD,QAAQ,SAAS,CACjC,OAAO,CAACE,0BACR,OAAO,CAACL,OAAO;gBAAE,GAAGE,IAAI;gBAAE,OAAO;YAAE;YACxC,IAAIE,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;YAEtB,MAAME,QAAQF,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE;YACrC,IAAI,CAACE,OACD,MAAM,IAAIC,cAAc;YAE5B,OAAO,IAAIC,SAASF;QACxB,EAAE,OAAOG,GAAG;YACR,OAAO,IAAIC,cAAcD;QAC7B;IACJ"}
@@ -1,8 +1,10 @@
1
- import { ListErrorResponse, ListResponse } from "@webiny/handler-graphql/responses.js";
1
+ import { ListErrorResponse, ListResponse } from "@webiny/api-graphql/responses.js";
2
+ import { ListLatestEntriesUseCase } from "../../../../features/contentEntry/ListEntries/index.js";
2
3
  const resolveList = ({ model })=>async (_, args, context)=>{
3
4
  try {
4
- const response = await context.cms.listLatestEntries(model, args);
5
- return new ListResponse(...response);
5
+ const result = await context.container.resolve(ListLatestEntriesUseCase).execute(model, args);
6
+ if (result.isFail()) throw result.error;
7
+ return new ListResponse(result.value.entries, result.value.meta);
6
8
  } catch (e) {
7
9
  return new ListErrorResponse(e);
8
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/resolvers/preview/resolveList.js","sources":["../../../../../src/graphql/schema/resolvers/preview/resolveList.ts"],"sourcesContent":["import { ListResponse, ListErrorResponse } from \"@webiny/handler-graphql/responses.js\";\nimport type {\n CmsEntryMeta,\n CmsEntryResolverFactory as ResolverFactory,\n CmsEntry,\n CmsEntryListParams\n} from \"~/types/index.js\";\n\ntype ResolveList = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveList: ResolveList =\n ({ model }) =>\n async (_: any, args: any, context) => {\n try {\n const response: [CmsEntry[], CmsEntryMeta] = await context.cms.listLatestEntries(\n model,\n args\n );\n\n return new ListResponse(...response);\n } catch (e) {\n return new ListErrorResponse(e);\n }\n };\n"],"names":["resolveList","model","_","args","context","response","ListResponse","e","ListErrorResponse"],"mappings":";AAUO,MAAMA,cACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAQC,MAAWC;QACtB,IAAI;YACA,MAAMC,WAAuC,MAAMD,QAAQ,GAAG,CAAC,iBAAiB,CAC5EH,OACAE;YAGJ,OAAO,IAAIG,gBAAgBD;QAC/B,EAAE,OAAOE,GAAG;YACR,OAAO,IAAIC,kBAAkBD;QACjC;IACJ"}
1
+ {"version":3,"file":"graphql/schema/resolvers/preview/resolveList.js","sources":["../../../../../src/graphql/schema/resolvers/preview/resolveList.ts"],"sourcesContent":["import { ListResponse, ListErrorResponse } from \"@webiny/api-graphql/responses.js\";\nimport type {\n CmsEntryResolverFactory as ResolverFactory,\n CmsEntryListParams\n} from \"~/types/index.js\";\nimport { ListLatestEntriesUseCase } from \"~/features/contentEntry/ListEntries/index.js\";\n\ntype ResolveList = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveList: ResolveList =\n ({ model }) =>\n async (_: any, args: any, context) => {\n try {\n const result = await context.container\n .resolve(ListLatestEntriesUseCase)\n .execute(model, args);\n if (result.isFail()) {\n throw result.error;\n }\n return new ListResponse(result.value.entries, result.value.meta);\n } catch (e) {\n return new ListErrorResponse(e);\n }\n };\n"],"names":["resolveList","model","_","args","context","result","ListLatestEntriesUseCase","ListResponse","e","ListErrorResponse"],"mappings":";;AASO,MAAMA,cACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAQC,MAAWC;QACtB,IAAI;YACA,MAAMC,SAAS,MAAMD,QAAQ,SAAS,CACjC,OAAO,CAACE,0BACR,OAAO,CAACL,OAAOE;YACpB,IAAIE,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;YAEtB,OAAO,IAAIE,aAAaF,OAAO,KAAK,CAAC,OAAO,EAAEA,OAAO,KAAK,CAAC,IAAI;QACnE,EAAE,OAAOG,GAAG;YACR,OAAO,IAAIC,kBAAkBD;QACjC;IACJ"}
@@ -1,11 +1,14 @@
1
- import { ErrorResponse, Response } from "@webiny/handler-graphql/responses.js";
1
+ import { ErrorResponse, Response } from "@webiny/api-graphql/responses.js";
2
2
  import { EntryNotFoundError } from "../../../../domain/contentEntry/errors.js";
3
+ import { ListPublishedEntriesUseCase } from "../../../../features/contentEntry/ListEntries/index.js";
3
4
  const resolveGet = ({ model })=>async (_, args, context)=>{
4
5
  try {
5
- const [[entry]] = await context.cms.listPublishedEntries(model, {
6
+ const result = await context.container.resolve(ListPublishedEntriesUseCase).execute(model, {
6
7
  ...args,
7
8
  limit: 1
8
9
  });
10
+ if (result.isFail()) throw result.error;
11
+ const entry = result.value.entries[0];
9
12
  if (!entry) return new ErrorResponse(new EntryNotFoundError());
10
13
  return new Response(entry);
11
14
  } catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/resolvers/read/resolveGet.js","sources":["../../../../../src/graphql/schema/resolvers/read/resolveGet.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/handler-graphql/responses.js\";\nimport type {\n CmsEntryListParams,\n CmsEntryResolverFactory as ResolverFactory\n} from \"~/types/index.js\";\nimport { EntryNotFoundError } from \"~/domain/contentEntry/errors.js\";\n\ntype ResolveGet = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveGet: ResolveGet =\n ({ model }) =>\n async (_: any, args: any, context) => {\n try {\n const [[entry]] = await context.cms.listPublishedEntries(model, {\n ...args,\n limit: 1\n });\n if (!entry) {\n return new ErrorResponse(new EntryNotFoundError());\n }\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"names":["resolveGet","model","_","args","context","entry","ErrorResponse","EntryNotFoundError","Response","e"],"mappings":";;AASO,MAAMA,aACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAQC,MAAWC;QACtB,IAAI;YACA,MAAM,CAAC,CAACC,MAAM,CAAC,GAAG,MAAMD,QAAQ,GAAG,CAAC,oBAAoB,CAACH,OAAO;gBAC5D,GAAGE,IAAI;gBACP,OAAO;YACX;YACA,IAAI,CAACE,OACD,OAAO,IAAIC,cAAc,IAAIC;YAEjC,OAAO,IAAIC,SAASH;QACxB,EAAE,OAAOI,GAAG;YACR,OAAO,IAAIH,cAAcG;QAC7B;IACJ"}
1
+ {"version":3,"file":"graphql/schema/resolvers/read/resolveGet.js","sources":["../../../../../src/graphql/schema/resolvers/read/resolveGet.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/api-graphql/responses.js\";\nimport type {\n CmsEntryListParams,\n CmsEntryResolverFactory as ResolverFactory\n} from \"~/types/index.js\";\nimport { EntryNotFoundError } from \"~/domain/contentEntry/errors.js\";\nimport { ListPublishedEntriesUseCase } from \"~/features/contentEntry/ListEntries/index.js\";\n\ntype ResolveGet = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveGet: ResolveGet =\n ({ model }) =>\n async (_: any, args: any, context) => {\n try {\n const result = await context.container\n .resolve(ListPublishedEntriesUseCase)\n .execute(model, { ...args, limit: 1 });\n if (result.isFail()) {\n throw result.error;\n }\n const entry = result.value.entries[0];\n if (!entry) {\n return new ErrorResponse(new EntryNotFoundError());\n }\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"names":["resolveGet","model","_","args","context","result","ListPublishedEntriesUseCase","entry","ErrorResponse","EntryNotFoundError","Response","e"],"mappings":";;;AAUO,MAAMA,aACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAQC,MAAWC;QACtB,IAAI;YACA,MAAMC,SAAS,MAAMD,QAAQ,SAAS,CACjC,OAAO,CAACE,6BACR,OAAO,CAACL,OAAO;gBAAE,GAAGE,IAAI;gBAAE,OAAO;YAAE;YACxC,IAAIE,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;YAEtB,MAAME,QAAQF,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE;YACrC,IAAI,CAACE,OACD,OAAO,IAAIC,cAAc,IAAIC;YAEjC,OAAO,IAAIC,SAASH;QACxB,EAAE,OAAOI,GAAG;YACR,OAAO,IAAIH,cAAcG;QAC7B;IACJ"}
@@ -1,8 +1,10 @@
1
- import { ListErrorResponse, ListResponse } from "@webiny/handler-graphql/responses.js";
1
+ import { ListErrorResponse, ListResponse } from "@webiny/api-graphql/responses.js";
2
+ import { ListPublishedEntriesUseCase } from "../../../../features/contentEntry/ListEntries/index.js";
2
3
  const resolveList = ({ model })=>async (_, args, context)=>{
3
4
  try {
4
- const response = await context.cms.listPublishedEntries(model, args);
5
- return new ListResponse(...response);
5
+ const result = await context.container.resolve(ListPublishedEntriesUseCase).execute(model, args);
6
+ if (result.isFail()) throw result.error;
7
+ return new ListResponse(result.value.entries, result.value.meta);
6
8
  } catch (e) {
7
9
  return new ListErrorResponse(e);
8
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/resolvers/read/resolveList.js","sources":["../../../../../src/graphql/schema/resolvers/read/resolveList.ts"],"sourcesContent":["import { ListResponse, ListErrorResponse } from \"@webiny/handler-graphql/responses.js\";\nimport type {\n CmsEntryMeta,\n CmsEntryResolverFactory as ResolverFactory,\n CmsEntry,\n CmsEntryListParams\n} from \"~/types/index.js\";\n\ntype ResolveList = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveList: ResolveList =\n ({ model }) =>\n async (_: any, args: CmsEntryListParams, context) => {\n try {\n const response: [CmsEntry[], CmsEntryMeta] = await context.cms.listPublishedEntries(\n model,\n args\n );\n\n return new ListResponse(...response);\n } catch (e) {\n return new ListErrorResponse(e);\n }\n };\n"],"names":["resolveList","model","_","args","context","response","ListResponse","e","ListErrorResponse"],"mappings":";AAUO,MAAMA,cACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAQC,MAA0BC;QACrC,IAAI;YACA,MAAMC,WAAuC,MAAMD,QAAQ,GAAG,CAAC,oBAAoB,CAC/EH,OACAE;YAGJ,OAAO,IAAIG,gBAAgBD;QAC/B,EAAE,OAAOE,GAAG;YACR,OAAO,IAAIC,kBAAkBD;QACjC;IACJ"}
1
+ {"version":3,"file":"graphql/schema/resolvers/read/resolveList.js","sources":["../../../../../src/graphql/schema/resolvers/read/resolveList.ts"],"sourcesContent":["import { ListResponse, ListErrorResponse } from \"@webiny/api-graphql/responses.js\";\nimport type {\n CmsEntryResolverFactory as ResolverFactory,\n CmsEntryListParams\n} from \"~/types/index.js\";\nimport { ListPublishedEntriesUseCase } from \"~/features/contentEntry/ListEntries/index.js\";\n\ntype ResolveList = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveList: ResolveList =\n ({ model }) =>\n async (_: any, args: CmsEntryListParams, context) => {\n try {\n const result = await context.container\n .resolve(ListPublishedEntriesUseCase)\n .execute(model, args);\n if (result.isFail()) {\n throw result.error;\n }\n return new ListResponse(result.value.entries, result.value.meta);\n } catch (e) {\n return new ListErrorResponse(e);\n }\n };\n"],"names":["resolveList","model","_","args","context","result","ListPublishedEntriesUseCase","ListResponse","e","ListErrorResponse"],"mappings":";;AASO,MAAMA,cACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAQC,MAA0BC;QACrC,IAAI;YACA,MAAMC,SAAS,MAAMD,QAAQ,SAAS,CACjC,OAAO,CAACE,6BACR,OAAO,CAACL,OAAOE;YACpB,IAAIE,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;YAEtB,OAAO,IAAIE,aAAaF,OAAO,KAAK,CAAC,OAAO,EAAEA,OAAO,KAAK,CAAC,IAAI;QACnE,EAAE,OAAOG,GAAG;YACR,OAAO,IAAIC,kBAAkBD;QACjC;IACJ"}
@@ -1,4 +1,4 @@
1
- import { ErrorResponse, Response } from "@webiny/handler-graphql/responses.js";
1
+ import { ErrorResponse, Response } from "@webiny/api-graphql/responses.js";
2
2
  import { GetSingletonEntryUseCase } from "../../../../features/contentEntry/GetSingletonEntry/index.js";
3
3
  const resolveGet = ({ model })=>async (_, __, context)=>{
4
4
  const getEntry = context.container.resolve(GetSingletonEntryUseCase);
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/resolvers/singular/resolveGet.js","sources":["../../../../../src/graphql/schema/resolvers/singular/resolveGet.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/handler-graphql/responses.js\";\nimport type { CmsEntryResolverFactory as ResolverFactory } from \"~/types/index.js\";\nimport { GetSingletonEntryUseCase } from \"~/features/contentEntry/GetSingletonEntry/index.js\";\n\ninterface ResolveGetArgs {\n revision: string;\n}\n\ntype ResolveGet = ResolverFactory<any, ResolveGetArgs>;\n\nexport const resolveGet: ResolveGet =\n ({ model }) =>\n async (_: unknown, __: unknown, context) => {\n const getEntry = context.container.resolve(GetSingletonEntryUseCase);\n const entry = await getEntry.execute(model);\n if (entry.isFail()) {\n return new ErrorResponse(entry.error);\n }\n\n return new Response(entry.value);\n };\n"],"names":["resolveGet","model","_","__","context","getEntry","GetSingletonEntryUseCase","entry","ErrorResponse","Response"],"mappings":";;AAUO,MAAMA,aACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAYC,IAAaC;QAC5B,MAAMC,WAAWD,QAAQ,SAAS,CAAC,OAAO,CAACE;QAC3C,MAAMC,QAAQ,MAAMF,SAAS,OAAO,CAACJ;QACrC,IAAIM,MAAM,MAAM,IACZ,OAAO,IAAIC,cAAcD,MAAM,KAAK;QAGxC,OAAO,IAAIE,SAASF,MAAM,KAAK;IACnC"}
1
+ {"version":3,"file":"graphql/schema/resolvers/singular/resolveGet.js","sources":["../../../../../src/graphql/schema/resolvers/singular/resolveGet.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/api-graphql/responses.js\";\nimport type { CmsEntryResolverFactory as ResolverFactory } from \"~/types/index.js\";\nimport { GetSingletonEntryUseCase } from \"~/features/contentEntry/GetSingletonEntry/index.js\";\n\ninterface ResolveGetArgs {\n revision: string;\n}\n\ntype ResolveGet = ResolverFactory<any, ResolveGetArgs>;\n\nexport const resolveGet: ResolveGet =\n ({ model }) =>\n async (_: unknown, __: unknown, context) => {\n const getEntry = context.container.resolve(GetSingletonEntryUseCase);\n const entry = await getEntry.execute(model);\n if (entry.isFail()) {\n return new ErrorResponse(entry.error);\n }\n\n return new Response(entry.value);\n };\n"],"names":["resolveGet","model","_","__","context","getEntry","GetSingletonEntryUseCase","entry","ErrorResponse","Response"],"mappings":";;AAUO,MAAMA,aACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAYC,IAAaC;QAC5B,MAAMC,WAAWD,QAAQ,SAAS,CAAC,OAAO,CAACE;QAC3C,MAAMC,QAAQ,MAAMF,SAAS,OAAO,CAACJ;QACrC,IAAIM,MAAM,MAAM,IACZ,OAAO,IAAIC,cAAcD,MAAM,KAAK;QAGxC,OAAO,IAAIE,SAASF,MAAM,KAAK;IACnC"}
@@ -1,4 +1,4 @@
1
- import { ErrorResponse, Response } from "@webiny/handler-graphql/responses.js";
1
+ import { ErrorResponse, Response } from "@webiny/api-graphql/responses.js";
2
2
  import { UpdateSingletonEntryUseCase } from "../../../../features/contentEntry/UpdateSingletonEntry/index.js";
3
3
  const resolveUpdate = ({ model })=>async (_, args, context)=>{
4
4
  const updateEntry = await context.container.resolve(UpdateSingletonEntryUseCase);
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/resolvers/singular/resolveUpdate.js","sources":["../../../../../src/graphql/schema/resolvers/singular/resolveUpdate.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/handler-graphql/responses.js\";\nimport type {\n CmsEntryResolverFactory as ResolverFactory,\n UpdateCmsEntryInput,\n UpdateCmsEntryOptionsInput\n} from \"~/types/index.js\";\nimport { UpdateSingletonEntryUseCase } from \"~/features/contentEntry/UpdateSingletonEntry/index.js\";\n\ninterface ResolveUpdateArgs {\n data: UpdateCmsEntryInput;\n options?: UpdateCmsEntryOptionsInput;\n}\n\ntype ResolveUpdate = ResolverFactory<any, ResolveUpdateArgs>;\n\nexport const resolveUpdate: ResolveUpdate =\n ({ model }) =>\n async (_: unknown, args, context) => {\n const updateEntry = await context.container.resolve(UpdateSingletonEntryUseCase);\n const entry = await updateEntry.execute(model, args.data, args.options);\n\n if (entry.isFail()) {\n return new ErrorResponse(entry.error);\n }\n\n return new Response(entry.value);\n };\n"],"names":["resolveUpdate","model","_","args","context","updateEntry","UpdateSingletonEntryUseCase","entry","ErrorResponse","Response"],"mappings":";;AAeO,MAAMA,gBACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAYC,MAAMC;QACrB,MAAMC,cAAc,MAAMD,QAAQ,SAAS,CAAC,OAAO,CAACE;QACpD,MAAMC,QAAQ,MAAMF,YAAY,OAAO,CAACJ,OAAOE,KAAK,IAAI,EAAEA,KAAK,OAAO;QAEtE,IAAII,MAAM,MAAM,IACZ,OAAO,IAAIC,cAAcD,MAAM,KAAK;QAGxC,OAAO,IAAIE,SAASF,MAAM,KAAK;IACnC"}
1
+ {"version":3,"file":"graphql/schema/resolvers/singular/resolveUpdate.js","sources":["../../../../../src/graphql/schema/resolvers/singular/resolveUpdate.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/api-graphql/responses.js\";\nimport type {\n CmsEntryResolverFactory as ResolverFactory,\n UpdateCmsEntryInput,\n UpdateCmsEntryOptionsInput\n} from \"~/types/index.js\";\nimport { UpdateSingletonEntryUseCase } from \"~/features/contentEntry/UpdateSingletonEntry/index.js\";\n\ninterface ResolveUpdateArgs {\n data: UpdateCmsEntryInput;\n options?: UpdateCmsEntryOptionsInput;\n}\n\ntype ResolveUpdate = ResolverFactory<any, ResolveUpdateArgs>;\n\nexport const resolveUpdate: ResolveUpdate =\n ({ model }) =>\n async (_: unknown, args, context) => {\n const updateEntry = await context.container.resolve(UpdateSingletonEntryUseCase);\n const entry = await updateEntry.execute(model, args.data, args.options);\n\n if (entry.isFail()) {\n return new ErrorResponse(entry.error);\n }\n\n return new Response(entry.value);\n };\n"],"names":["resolveUpdate","model","_","args","context","updateEntry","UpdateSingletonEntryUseCase","entry","ErrorResponse","Response"],"mappings":";;AAeO,MAAMA,gBACT,CAAC,EAAEC,KAAK,EAAE,GACV,OAAOC,GAAYC,MAAMC;QACrB,MAAMC,cAAc,MAAMD,QAAQ,SAAS,CAAC,OAAO,CAACE;QACpD,MAAMC,QAAQ,MAAMF,YAAY,OAAO,CAACJ,OAAOE,KAAK,IAAI,EAAEA,KAAK,OAAO;QAEtE,IAAII,MAAM,MAAM,IACZ,OAAO,IAAIC,cAAcD,MAAM,KAAK;QAGxC,OAAO,IAAIE,SAASF,MAAM,KAAK;IACnC"}
@@ -1,8 +1,9 @@
1
- import type { CmsContext, CmsModel } from "../../types/index.js";
1
+ import type { ApiEndpoint, CmsContext, CmsModel } from "../../types/index.js";
2
2
  import type { ICmsGraphQLSchemaPlugin } from "../../plugins/index.js";
3
3
  interface GenerateSchemaPluginsParams {
4
4
  context: CmsContext;
5
5
  models: CmsModel[];
6
+ type: ApiEndpoint | null;
6
7
  }
7
8
  export declare const generateSchemaPlugins: (params: GenerateSchemaPluginsParams) => Promise<ICmsGraphQLSchemaPlugin[]>;
8
9
  export {};
@@ -10,9 +10,7 @@ import { createSingularSDL } from "./createSingularSDL.js";
10
10
  import { createSingularResolvers } from "./createSingularResolvers.js";
11
11
  import { CmsGraphQLSchemaSorter, CmsModelFieldToGraphQLRegistry } from "../../features/graphql/index.js";
12
12
  const generateSchemaPlugins = async (params)=>{
13
- const { context, models } = params;
14
- const { cms } = context;
15
- const { type } = cms;
13
+ const { context, models, type } = params;
16
14
  if (!type) return [];
17
15
  const fieldRegistry = context.container.resolve(CmsModelFieldToGraphQLRegistry);
18
16
  const sorters = context.container.resolveAll(CmsGraphQLSchemaSorter);
@@ -72,7 +70,7 @@ const generateSchemaPlugins = async (params)=>{
72
70
  fieldRegistry,
73
71
  sorters
74
72
  }),
75
- resolvers: cms.READ ? createReadResolvers({
73
+ resolvers: "read" === type ? createReadResolvers({
76
74
  models,
77
75
  model,
78
76
  fieldRegistry
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/schema/schemaPlugins.js","sources":["../../../src/graphql/schema/schemaPlugins.ts"],"sourcesContent":["import type { ApiEndpoint, CmsContext, CmsModel } from \"~/types/index.js\";\nimport { createManageSDL } from \"./createManageSDL.js\";\nimport { createReadSDL } from \"./createReadSDL.js\";\nimport { createManageResolvers } from \"./createManageResolvers.js\";\nimport { createReadResolvers } from \"./createReadResolvers.js\";\nimport { createPreviewResolvers } from \"./createPreviewResolvers.js\";\nimport { createGraphQLSchemaPluginFromFieldPlugins } from \"~/utils/getSchemaFromFieldPlugins.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { createCmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { CMS_MODEL_SINGLETON_TAG } from \"~/constants.js\";\nimport { createSingularSDL } from \"./createSingularSDL.js\";\nimport { createSingularResolvers } from \"./createSingularResolvers.js\";\nimport {\n CmsGraphQLSchemaSorter,\n CmsModelFieldToGraphQLRegistry\n} from \"~/features/graphql/index.js\";\n\ninterface GenerateSchemaPluginsParams {\n context: CmsContext;\n models: CmsModel[];\n}\n\nexport const generateSchemaPlugins = async (\n params: GenerateSchemaPluginsParams\n): Promise<ICmsGraphQLSchemaPlugin[]> => {\n const { context, models } = params;\n const { cms } = context;\n\n /**\n * If type does not exist, we are not generating schema plugins for models.\n * It should not come to this point, but we check it anyways.\n */\n const { type } = cms;\n if (!type) {\n return [];\n }\n\n const fieldRegistry = context.container.resolve(CmsModelFieldToGraphQLRegistry);\n\n const sorters = context.container.resolveAll(CmsGraphQLSchemaSorter);\n\n const schemaPlugins = createGraphQLSchemaPluginFromFieldPlugins({\n models,\n fieldRegistry,\n type\n });\n\n models.forEach(model => {\n if (model.tags?.includes(CMS_MODEL_SINGLETON_TAG)) {\n /**\n * We always need to send either manage or read.\n */\n const singularType: ApiEndpoint = type === \"manage\" ? \"manage\" : \"read\";\n const plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: createSingularSDL({\n models,\n model,\n fieldRegistry,\n type: singularType\n }),\n resolvers: createSingularResolvers({\n models,\n model,\n fieldRegistry,\n type: singularType\n })\n });\n plugin.name = `headless-cms.graphql.schema.singular.${model.modelId}`;\n schemaPlugins.push(plugin);\n return;\n }\n switch (type) {\n case \"manage\":\n {\n const plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: createManageSDL({\n models,\n model,\n fieldRegistry,\n sorters\n }),\n resolvers: createManageResolvers({\n models,\n model,\n fieldRegistry\n })\n });\n plugin.name = `headless-cms.graphql.schema.manage.${model.modelId}`;\n schemaPlugins.push(plugin);\n }\n\n break;\n case \"preview\":\n case \"read\":\n {\n const plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: createReadSDL({\n models,\n model,\n fieldRegistry,\n sorters\n }),\n resolvers: cms.READ\n ? createReadResolvers({\n models,\n model,\n fieldRegistry\n })\n : createPreviewResolvers({\n models,\n model,\n fieldRegistry\n })\n });\n plugin.name = `headless-cms.graphql.schema.${type}.${model.modelId}`;\n schemaPlugins.push(plugin);\n }\n break;\n default:\n return;\n }\n });\n\n return schemaPlugins.filter(pl => !!pl.schema.typeDefs);\n};\n"],"names":["generateSchemaPlugins","params","context","models","cms","type","fieldRegistry","CmsModelFieldToGraphQLRegistry","sorters","CmsGraphQLSchemaSorter","schemaPlugins","createGraphQLSchemaPluginFromFieldPlugins","model","CMS_MODEL_SINGLETON_TAG","singularType","plugin","createCmsGraphQLSchemaPlugin","createSingularSDL","createSingularResolvers","createManageSDL","createManageResolvers","createReadSDL","createReadResolvers","createPreviewResolvers","pl"],"mappings":";;;;;;;;;;;AAsBO,MAAMA,wBAAwB,OACjCC;IAEA,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGF;IAC5B,MAAM,EAAEG,GAAG,EAAE,GAAGF;IAMhB,MAAM,EAAEG,IAAI,EAAE,GAAGD;IACjB,IAAI,CAACC,MACD,OAAO,EAAE;IAGb,MAAMC,gBAAgBJ,QAAQ,SAAS,CAAC,OAAO,CAACK;IAEhD,MAAMC,UAAUN,QAAQ,SAAS,CAAC,UAAU,CAACO;IAE7C,MAAMC,gBAAgBC,0CAA0C;QAC5DR;QACAG;QACAD;IACJ;IAEAF,OAAO,OAAO,CAACS,CAAAA;QACX,IAAIA,MAAM,IAAI,EAAE,SAASC,0BAA0B;YAI/C,MAAMC,eAA4BT,AAAS,aAATA,OAAoB,WAAW;YACjE,MAAMU,SAASC,6BAA6B;gBACxC,UAAUC,kBAAkB;oBACxBd;oBACAS;oBACAN;oBACA,MAAMQ;gBACV;gBACA,WAAWI,wBAAwB;oBAC/Bf;oBACAS;oBACAN;oBACA,MAAMQ;gBACV;YACJ;YACAC,OAAO,IAAI,GAAG,CAAC,qCAAqC,EAAEH,MAAM,OAAO,EAAE;YACrEF,cAAc,IAAI,CAACK;YACnB;QACJ;QACA,OAAQV;YACJ,KAAK;gBACD;oBACI,MAAMU,SAASC,6BAA6B;wBACxC,UAAUG,gBAAgB;4BACtBhB;4BACAS;4BACAN;4BACAE;wBACJ;wBACA,WAAWY,sBAAsB;4BAC7BjB;4BACAS;4BACAN;wBACJ;oBACJ;oBACAS,OAAO,IAAI,GAAG,CAAC,mCAAmC,EAAEH,MAAM,OAAO,EAAE;oBACnEF,cAAc,IAAI,CAACK;gBACvB;gBAEA;YACJ,KAAK;YACL,KAAK;gBACD;oBACI,MAAMA,SAASC,6BAA6B;wBACxC,UAAUK,cAAc;4BACpBlB;4BACAS;4BACAN;4BACAE;wBACJ;wBACA,WAAWJ,IAAI,IAAI,GACbkB,oBAAoB;4BAChBnB;4BACAS;4BACAN;wBACJ,KACAiB,uBAAuB;4BACnBpB;4BACAS;4BACAN;wBACJ;oBACV;oBACAS,OAAO,IAAI,GAAG,CAAC,4BAA4B,EAAEV,KAAK,CAAC,EAAEO,MAAM,OAAO,EAAE;oBACpEF,cAAc,IAAI,CAACK;gBACvB;gBACA;YACJ;gBACI;QACR;IACJ;IAEA,OAAOL,cAAc,MAAM,CAACc,CAAAA,KAAM,CAAC,CAACA,GAAG,MAAM,CAAC,QAAQ;AAC1D"}
1
+ {"version":3,"file":"graphql/schema/schemaPlugins.js","sources":["../../../src/graphql/schema/schemaPlugins.ts"],"sourcesContent":["import type { ApiEndpoint, CmsContext, CmsModel } from \"~/types/index.js\";\nimport { createManageSDL } from \"./createManageSDL.js\";\nimport { createReadSDL } from \"./createReadSDL.js\";\nimport { createManageResolvers } from \"./createManageResolvers.js\";\nimport { createReadResolvers } from \"./createReadResolvers.js\";\nimport { createPreviewResolvers } from \"./createPreviewResolvers.js\";\nimport { createGraphQLSchemaPluginFromFieldPlugins } from \"~/utils/getSchemaFromFieldPlugins.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { createCmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { CMS_MODEL_SINGLETON_TAG } from \"~/constants.js\";\nimport { createSingularSDL } from \"./createSingularSDL.js\";\nimport { createSingularResolvers } from \"./createSingularResolvers.js\";\nimport {\n CmsGraphQLSchemaSorter,\n CmsModelFieldToGraphQLRegistry\n} from \"~/features/graphql/index.js\";\n\ninterface GenerateSchemaPluginsParams {\n context: CmsContext;\n models: CmsModel[];\n type: ApiEndpoint | null;\n}\n\nexport const generateSchemaPlugins = async (\n params: GenerateSchemaPluginsParams\n): Promise<ICmsGraphQLSchemaPlugin[]> => {\n const { context, models, type } = params;\n\n /**\n * If type does not exist, we are not generating schema plugins for models.\n * It should not come to this point, but we check it anyways.\n */\n if (!type) {\n return [];\n }\n\n const fieldRegistry = context.container.resolve(CmsModelFieldToGraphQLRegistry);\n\n const sorters = context.container.resolveAll(CmsGraphQLSchemaSorter);\n\n const schemaPlugins = createGraphQLSchemaPluginFromFieldPlugins({\n models,\n fieldRegistry,\n type\n });\n\n models.forEach(model => {\n if (model.tags?.includes(CMS_MODEL_SINGLETON_TAG)) {\n /**\n * We always need to send either manage or read.\n */\n const singularType: ApiEndpoint = type === \"manage\" ? \"manage\" : \"read\";\n const plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: createSingularSDL({\n models,\n model,\n fieldRegistry,\n type: singularType\n }),\n resolvers: createSingularResolvers({\n models,\n model,\n fieldRegistry,\n type: singularType\n })\n });\n plugin.name = `headless-cms.graphql.schema.singular.${model.modelId}`;\n schemaPlugins.push(plugin);\n return;\n }\n switch (type) {\n case \"manage\":\n {\n const plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: createManageSDL({\n models,\n model,\n fieldRegistry,\n sorters\n }),\n resolvers: createManageResolvers({\n models,\n model,\n fieldRegistry\n })\n });\n plugin.name = `headless-cms.graphql.schema.manage.${model.modelId}`;\n schemaPlugins.push(plugin);\n }\n\n break;\n case \"preview\":\n case \"read\":\n {\n const plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: createReadSDL({\n models,\n model,\n fieldRegistry,\n sorters\n }),\n resolvers:\n type === \"read\"\n ? createReadResolvers({\n models,\n model,\n fieldRegistry\n })\n : createPreviewResolvers({\n models,\n model,\n fieldRegistry\n })\n });\n plugin.name = `headless-cms.graphql.schema.${type}.${model.modelId}`;\n schemaPlugins.push(plugin);\n }\n break;\n default:\n return;\n }\n });\n\n return schemaPlugins.filter(pl => !!pl.schema.typeDefs);\n};\n"],"names":["generateSchemaPlugins","params","context","models","type","fieldRegistry","CmsModelFieldToGraphQLRegistry","sorters","CmsGraphQLSchemaSorter","schemaPlugins","createGraphQLSchemaPluginFromFieldPlugins","model","CMS_MODEL_SINGLETON_TAG","singularType","plugin","createCmsGraphQLSchemaPlugin","createSingularSDL","createSingularResolvers","createManageSDL","createManageResolvers","createReadSDL","createReadResolvers","createPreviewResolvers","pl"],"mappings":";;;;;;;;;;;AAuBO,MAAMA,wBAAwB,OACjCC;IAEA,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGH;IAMlC,IAAI,CAACG,MACD,OAAO,EAAE;IAGb,MAAMC,gBAAgBH,QAAQ,SAAS,CAAC,OAAO,CAACI;IAEhD,MAAMC,UAAUL,QAAQ,SAAS,CAAC,UAAU,CAACM;IAE7C,MAAMC,gBAAgBC,0CAA0C;QAC5DP;QACAE;QACAD;IACJ;IAEAD,OAAO,OAAO,CAACQ,CAAAA;QACX,IAAIA,MAAM,IAAI,EAAE,SAASC,0BAA0B;YAI/C,MAAMC,eAA4BT,AAAS,aAATA,OAAoB,WAAW;YACjE,MAAMU,SAASC,6BAA6B;gBACxC,UAAUC,kBAAkB;oBACxBb;oBACAQ;oBACAN;oBACA,MAAMQ;gBACV;gBACA,WAAWI,wBAAwB;oBAC/Bd;oBACAQ;oBACAN;oBACA,MAAMQ;gBACV;YACJ;YACAC,OAAO,IAAI,GAAG,CAAC,qCAAqC,EAAEH,MAAM,OAAO,EAAE;YACrEF,cAAc,IAAI,CAACK;YACnB;QACJ;QACA,OAAQV;YACJ,KAAK;gBACD;oBACI,MAAMU,SAASC,6BAA6B;wBACxC,UAAUG,gBAAgB;4BACtBf;4BACAQ;4BACAN;4BACAE;wBACJ;wBACA,WAAWY,sBAAsB;4BAC7BhB;4BACAQ;4BACAN;wBACJ;oBACJ;oBACAS,OAAO,IAAI,GAAG,CAAC,mCAAmC,EAAEH,MAAM,OAAO,EAAE;oBACnEF,cAAc,IAAI,CAACK;gBACvB;gBAEA;YACJ,KAAK;YACL,KAAK;gBACD;oBACI,MAAMA,SAASC,6BAA6B;wBACxC,UAAUK,cAAc;4BACpBjB;4BACAQ;4BACAN;4BACAE;wBACJ;wBACA,WACIH,AAAS,WAATA,OACMiB,oBAAoB;4BAChBlB;4BACAQ;4BACAN;wBACJ,KACAiB,uBAAuB;4BACnBnB;4BACAQ;4BACAN;wBACJ;oBACd;oBACAS,OAAO,IAAI,GAAG,CAAC,4BAA4B,EAAEV,KAAK,CAAC,EAAEO,MAAM,OAAO,EAAE;oBACpEF,cAAc,IAAI,CAACK;gBACvB;gBACA;YACJ;gBACI;QACR;IACJ;IAEA,OAAOL,cAAc,MAAM,CAACc,CAAAA,KAAM,CAAC,CAACA,GAAG,MAAM,CAAC,QAAQ;AAC1D"}
package/index.d.ts CHANGED
@@ -1,15 +1,16 @@
1
- import type { CreateGraphQLParams } from "./graphql/index.js";
2
1
  import { entryFieldFromStorageTransform, entryFromStorageTransform, entryToStorageTransform } from "./utils/entryStorage.js";
3
- import type { Plugin } from "@webiny/plugins/types.js";
2
+ export { HeadlessCmsFeature } from "./HeadlessCmsFeature.js";
3
+ export type { HeadlessCmsConfig } from "./HeadlessCmsFeature.js";
4
4
  export * from "./utils/isHeadlessCmsReady.js";
5
5
  export * from "./utils/createModelField.js";
6
6
  export * from "./graphql/schema/resolvers/manage/normalizeGraphQlInput.js";
7
- export type CreateHeadlessCmsGraphQLParams = CreateGraphQLParams;
8
- export declare const createHeadlessCmsGraphQL: (params?: CreateHeadlessCmsGraphQLParams) => Plugin[];
9
- export declare const createHeadlessCmsContext: () => (import("@webiny/api/index.js").ContextPlugin<import("./types/types.js").CmsContext> | (import("./fieldConverters/CmsModelObjectFieldConverterPlugin.js").CmsModelObjectFieldConverterPlugin | import("./fieldConverters/CmsModelDefaultFieldConverterPlugin.js").CmsModelDefaultFieldConverterPlugin | import("./fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js").CmsModelDynamicZoneFieldConverterPlugin)[])[];
10
7
  export * from "./plugins/index.js";
8
+ export { CmsGraphQLSchemaFactory } from "./graphql/CmsGraphQLSchemaFactory.js";
9
+ export type { ICmsGraphQLSchemaFactory } from "./graphql/CmsGraphQLSchemaFactory.js";
10
+ export { CmsSchemaExecutor } from "./graphql/CmsSchemaExecutor.js";
11
+ export type { ICmsSchemaExecutor } from "./graphql/CmsSchemaExecutor.js";
12
+ export { CmsExport, CmsImport } from "./export/abstractions.js";
11
13
  export * from "./utils/incrementEntryIdVersion.js";
12
- export * from "./graphql/handleRequest.js";
13
14
  export * from "./features/contentEntry/ContentEntryTraverser/ContentEntryTraverser.js";
14
15
  export { ContentEntryTraverserProvider } from "./features/contentEntry/ContentEntryTraverser/abstractions.js";
15
16
  export * from "./utils/contentModelAst/index.js";
package/index.js CHANGED
@@ -1,33 +1,15 @@
1
- import { createGraphQL } from "./graphql/index.js";
2
- import { createContextParameterPlugin, createHeaderParameterPlugin, createPathParameterPlugin } from "./parameters/index.js";
3
- import { createContextPlugin } from "./context.js";
4
- import { createRevisionIdScalarPlugin } from "./graphql/scalars/RevisionIdScalarPlugin.js";
5
- import { createFieldConverters } from "./fieldConverters/index.js";
6
- import { createExportGraphQL } from "./export/index.js";
7
1
  export * from "./utils/isHeadlessCmsReady.js";
8
2
  export * from "./utils/createModelField.js";
9
3
  export * from "./graphql/schema/resolvers/manage/normalizeGraphQlInput.js";
10
4
  export * from "./plugins/index.js";
11
5
  export * from "./utils/incrementEntryIdVersion.js";
12
- export * from "./graphql/handleRequest.js";
13
6
  export * from "./features/contentEntry/ContentEntryTraverser/ContentEntryTraverser.js";
14
7
  export * from "./utils/contentModelAst/index.js";
15
- const createHeadlessCmsGraphQL = (params = {})=>[
16
- ...createRevisionIdScalarPlugin(),
17
- createPathParameterPlugin(),
18
- createHeaderParameterPlugin(),
19
- createContextParameterPlugin(),
20
- ...createGraphQL(params),
21
- createExportGraphQL()
22
- ];
23
- const createHeadlessCmsContext = ()=>[
24
- createContextPlugin(),
25
- createFieldConverters()
26
- ];
27
8
  export { entryFieldFromStorageTransform, entryFromStorageTransform, entryToStorageTransform } from "./utils/entryStorage.js";
9
+ export { HeadlessCmsFeature } from "./HeadlessCmsFeature.js";
10
+ export { CmsGraphQLSchemaFactory } from "./graphql/CmsGraphQLSchemaFactory.js";
11
+ export { CmsSchemaExecutor } from "./graphql/CmsSchemaExecutor.js";
12
+ export { CmsExport, CmsImport } from "./export/abstractions.js";
28
13
  export { ContentEntryTraverserProvider } from "./features/contentEntry/ContentEntryTraverser/abstractions.js";
29
14
  export { CmsWhereMapper } from "./features/whereMapper/abstractions.js";
30
15
  export { CmsSortMapper } from "./features/sortMapper/abstractions.js";
31
- export { createHeadlessCmsContext, createHeadlessCmsGraphQL };
32
-
33
- //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"legacy/abstractions.js","sources":["../../src/legacy/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { PluginsContainer as PluginsContainerType } from \"@webiny/plugins\";\nimport type { CmsEntry, CmsEntryValues, CmsModel, CmsModelField } from \"~/types/index.js\";\n\nexport const PluginsContainer = createAbstraction<PluginsContainerType>(\"PluginsContainer\");\n\nexport namespace PluginsContainer {\n export type Interface = PluginsContainerType;\n}\n\n/**\n * SearchableFieldsProvider - Provides searchable field paths for a model.\n * Legacy abstraction for the getSearchableFields utility function.\n */\nexport interface ISearchableFieldsProvider {\n (params: { fields: CmsModelField[] }): string[];\n}\n\nexport const SearchableFieldsProvider = createAbstraction<ISearchableFieldsProvider>(\n \"SearchableFieldsProvider\"\n);\n\nexport namespace SearchableFieldsProvider {\n export type Interface = ISearchableFieldsProvider;\n}\n\n/**\n * EntryToStorageTransform - Transforms domain entry to storage format.\n * Legacy abstraction for the utility function.\n */\nexport interface IEntryToStorageTransform {\n <T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel,\n entry: CmsEntry<T>\n ): Promise<CmsEntry<T>>;\n}\n\nexport const EntryToStorageTransform =\n createAbstraction<IEntryToStorageTransform>(\"EntryToStorageTransform\");\n\nexport namespace EntryToStorageTransform {\n export type Interface = IEntryToStorageTransform;\n}\n\n/**\n * EntryFromStorageTransform - Transforms storage entry to domain format.\n * Legacy abstraction for the utility function.\n */\nexport interface IEntryFromStorageTransform {\n <T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel,\n entry: CmsEntry<T>\n ): Promise<CmsEntry<T>>;\n}\n\nexport const EntryFromStorageTransform = createAbstraction<IEntryFromStorageTransform>(\n \"EntryFromStorageTransform\"\n);\n\nexport namespace EntryFromStorageTransform {\n export type Interface = IEntryFromStorageTransform;\n}\n"],"names":["PluginsContainer","createAbstraction","SearchableFieldsProvider","EntryToStorageTransform","EntryFromStorageTransform"],"mappings":";AAIO,MAAMA,mBAAmBC,kBAAwC;AAcjE,MAAMC,2BAA2BD,kBACpC;AAkBG,MAAME,0BACTF,kBAA4C;AAiBzC,MAAMG,4BAA4BH,kBACrC"}
1
+ {"version":3,"file":"legacy/abstractions.js","sources":["../../src/legacy/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { PluginsContainer as PluginsContainerType } from \"@webiny/plugins\";\nimport type { CmsEntry, CmsEntryValues, CmsModel, CmsModelField } from \"~/types/index.js\";\n\nexport const PluginsContainer = createAbstraction<PluginsContainerType>(\"PluginsContainer\");\nexport namespace PluginsContainer {\n export type Interface = PluginsContainerType;\n}\n\n/**\n * SearchableFieldsProvider - Provides searchable field paths for a model.\n * Legacy abstraction for the getSearchableFields utility function.\n */\nexport interface ISearchableFieldsProvider {\n (params: { fields: CmsModelField[] }): string[];\n}\n\nexport const SearchableFieldsProvider = createAbstraction<ISearchableFieldsProvider>(\n \"SearchableFieldsProvider\"\n);\n\nexport namespace SearchableFieldsProvider {\n export type Interface = ISearchableFieldsProvider;\n}\n\n/**\n * EntryToStorageTransform - Transforms domain entry to storage format.\n * Legacy abstraction for the utility function.\n */\nexport interface IEntryToStorageTransform {\n <T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel,\n entry: CmsEntry<T>\n ): Promise<CmsEntry<T>>;\n}\n\nexport const EntryToStorageTransform =\n createAbstraction<IEntryToStorageTransform>(\"EntryToStorageTransform\");\n\nexport namespace EntryToStorageTransform {\n export type Interface = IEntryToStorageTransform;\n}\n\n/**\n * EntryFromStorageTransform - Transforms storage entry to domain format.\n * Legacy abstraction for the utility function.\n */\nexport interface IEntryFromStorageTransform {\n <T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel,\n entry: CmsEntry<T>\n ): Promise<CmsEntry<T>>;\n}\n\nexport const EntryFromStorageTransform = createAbstraction<IEntryFromStorageTransform>(\n \"EntryFromStorageTransform\"\n);\n\nexport namespace EntryFromStorageTransform {\n export type Interface = IEntryFromStorageTransform;\n}\n"],"names":["PluginsContainer","createAbstraction","SearchableFieldsProvider","EntryToStorageTransform","EntryFromStorageTransform"],"mappings":";AAIO,MAAMA,mBAAmBC,kBAAwC;AAajE,MAAMC,2BAA2BD,kBACpC;AAkBG,MAAME,0BACTF,kBAA4C;AAiBzC,MAAMG,4BAA4BH,kBACrC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-headless-cms",
3
- "version": "6.4.11",
3
+ "version": "6.6.0-alpha.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -23,47 +23,41 @@
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
25
  "@babel/code-frame": "8.0.0",
26
- "@graphql-tools/merge": "9.2.0",
27
- "@graphql-tools/schema": "10.0.36",
28
- "@webiny/api": "6.4.11",
29
- "@webiny/api-core": "6.4.11",
30
- "@webiny/di": "1.0.2",
31
- "@webiny/error": "6.4.11",
32
- "@webiny/feature": "6.4.11",
33
- "@webiny/handler": "6.4.11",
34
- "@webiny/handler-aws": "6.4.11",
35
- "@webiny/handler-db": "6.4.11",
36
- "@webiny/handler-graphql": "6.4.11",
37
- "@webiny/plugins": "6.4.11",
38
- "@webiny/project": "6.4.11",
39
- "@webiny/utils": "6.4.11",
40
- "@webiny/validation": "6.4.11",
26
+ "@graphql-tools/merge": "9.2.3",
27
+ "@graphql-tools/schema": "10.1.0",
28
+ "@webiny/api": "6.6.0-alpha.1",
29
+ "@webiny/api-core": "6.6.0-alpha.1",
30
+ "@webiny/api-core-testing": "6.6.0-alpha.1",
31
+ "@webiny/api-graphql": "6.6.0-alpha.1",
32
+ "@webiny/di": "1.1.0",
33
+ "@webiny/error": "6.6.0-alpha.1",
34
+ "@webiny/event-handler-core": "6.6.0-alpha.1",
35
+ "@webiny/feature": "6.6.0-alpha.1",
36
+ "@webiny/handler": "6.6.0-alpha.1",
37
+ "@webiny/plugins": "6.6.0-alpha.1",
38
+ "@webiny/utils": "6.6.0-alpha.1",
39
+ "@webiny/validation": "6.6.0-alpha.1",
41
40
  "dot-prop-immutable": "2.1.1",
42
41
  "graphql": "16.14.2",
43
42
  "graphql-tag": "2.12.7",
44
43
  "lodash": "4.18.1",
45
- "p-map": "7.0.5",
44
+ "p-map": "7.0.6",
46
45
  "p-reduce": "3.0.0",
47
46
  "pluralize": "8.0.0",
48
47
  "slugify": "1.6.9",
49
48
  "zod": "4.4.3"
50
49
  },
51
50
  "devDependencies": {
52
- "@types/babel__code-frame": "7.27.0",
53
51
  "@types/pluralize": "0.0.33",
54
- "@webiny/aws-sdk": "6.4.11",
55
- "@webiny/build-tools": "6.4.11",
56
- "@webiny/db-dynamodb": "6.4.11",
57
- "@webiny/handler-db": "6.4.11",
58
- "@webiny/project-utils": "6.4.11",
59
- "@webiny/sdk": "6.4.11",
60
- "@webiny/wcp": "6.4.11",
61
- "apollo-graphql": "0.9.7",
52
+ "@webiny/build-tools": "6.6.0-alpha.1",
53
+ "@webiny/db-dynamodb": "6.6.0-alpha.1",
54
+ "@webiny/sdk": "6.6.0-alpha.1",
55
+ "@webiny/wcp": "6.6.0-alpha.1",
62
56
  "graphql": "16.14.2",
63
- "oxfmt": "0.58.0",
57
+ "oxfmt": "0.64.0",
64
58
  "rimraf": "6.1.3",
65
- "typescript": "6.0.3",
66
- "vitest": "4.1.10",
59
+ "typescript": "7.0.2",
60
+ "vitest": "4.1.11",
67
61
  "write-json-file": "7.0.0"
68
62
  },
69
63
  "publishConfig": {
@@ -1,5 +1,5 @@
1
- import type { GraphQLSchemaPluginConfig as BaseGraphQLSchemaPluginConfig, IGraphQLSchemaPlugin } from "@webiny/handler-graphql";
2
- import { GraphQLSchemaPlugin } from "@webiny/handler-graphql";
1
+ import type { GraphQLSchemaPluginConfig as BaseGraphQLSchemaPluginConfig, IGraphQLSchemaPlugin } from "@webiny/api-graphql";
2
+ import { GraphQLSchemaPlugin } from "@webiny/api-graphql";
3
3
  import type { CmsContext } from "../../types/index.js";
4
4
  export type ICmsGraphQLSchemaPlugin<T extends CmsContext = CmsContext> = IGraphQLSchemaPlugin<T>;
5
5
  export type CmsGraphQLSchemaPluginConfig<T extends CmsContext = CmsContext> = BaseGraphQLSchemaPluginConfig<T>;
@@ -1,4 +1,4 @@
1
- import { GraphQLSchemaPlugin } from "@webiny/handler-graphql";
1
+ import { GraphQLSchemaPlugin } from "@webiny/api-graphql";
2
2
  class CmsGraphQLSchemaPlugin extends GraphQLSchemaPlugin {
3
3
  static{
4
4
  this.type = "cms.graphql.schema";
@@ -1 +1 @@
1
- {"version":3,"file":"plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js","sources":["../../../src/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.ts"],"sourcesContent":["import type {\n GraphQLSchemaPluginConfig as BaseGraphQLSchemaPluginConfig,\n IGraphQLSchemaPlugin\n} from \"@webiny/handler-graphql\";\nimport { GraphQLSchemaPlugin } from \"@webiny/handler-graphql\";\nimport type { CmsContext } from \"~/types/index.js\";\n\nexport type ICmsGraphQLSchemaPlugin<T extends CmsContext = CmsContext> = IGraphQLSchemaPlugin<T>;\n\nexport type CmsGraphQLSchemaPluginConfig<T extends CmsContext = CmsContext> =\n BaseGraphQLSchemaPluginConfig<T>;\n\nexport class CmsGraphQLSchemaPlugin<T extends CmsContext = CmsContext>\n extends GraphQLSchemaPlugin<T>\n implements ICmsGraphQLSchemaPlugin<T>\n{\n public static override readonly type = \"cms.graphql.schema\";\n}\n\nexport const createCmsGraphQLSchemaPlugin = <T extends CmsContext = CmsContext>(\n config: CmsGraphQLSchemaPluginConfig<T>\n): ICmsGraphQLSchemaPlugin<T> => {\n return new CmsGraphQLSchemaPlugin(config);\n};\n"],"names":["CmsGraphQLSchemaPlugin","GraphQLSchemaPlugin","createCmsGraphQLSchemaPlugin","config"],"mappings":";AAYO,MAAMA,+BACDC;;aAGwB,IAAI,GAAG;;AAC3C;AAEO,MAAMC,+BAA+B,CACxCC,SAEO,IAAIH,uBAAuBG"}
1
+ {"version":3,"file":"plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js","sources":["../../../src/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.ts"],"sourcesContent":["import type {\n GraphQLSchemaPluginConfig as BaseGraphQLSchemaPluginConfig,\n IGraphQLSchemaPlugin\n} from \"@webiny/api-graphql\";\nimport { GraphQLSchemaPlugin } from \"@webiny/api-graphql\";\nimport type { CmsContext } from \"~/types/index.js\";\n\nexport type ICmsGraphQLSchemaPlugin<T extends CmsContext = CmsContext> = IGraphQLSchemaPlugin<T>;\n\nexport type CmsGraphQLSchemaPluginConfig<T extends CmsContext = CmsContext> =\n BaseGraphQLSchemaPluginConfig<T>;\n\nexport class CmsGraphQLSchemaPlugin<T extends CmsContext = CmsContext>\n extends GraphQLSchemaPlugin<T>\n implements ICmsGraphQLSchemaPlugin<T>\n{\n public static override readonly type = \"cms.graphql.schema\";\n}\n\nexport const createCmsGraphQLSchemaPlugin = <T extends CmsContext = CmsContext>(\n config: CmsGraphQLSchemaPluginConfig<T>\n): ICmsGraphQLSchemaPlugin<T> => {\n return new CmsGraphQLSchemaPlugin(config);\n};\n"],"names":["CmsGraphQLSchemaPlugin","GraphQLSchemaPlugin","createCmsGraphQLSchemaPlugin","config"],"mappings":";AAYO,MAAMA,+BACDC;;aAGwB,IAAI,GAAG;;AAC3C;AAEO,MAAMC,+BAA+B,CACxCC,SAEO,IAAIH,uBAAuBG"}
@@ -32,7 +32,8 @@ class CmsModelPlugin extends Plugin {
32
32
  name: input.name,
33
33
  pluralApiName,
34
34
  singularApiName,
35
- titleFieldId: "id"
35
+ titleFieldId: "id",
36
+ settings: {}
36
37
  };
37
38
  if (input.noValidate) {
38
39
  delete input["noValidate"];
@@ -1 +1 @@
1
- {"version":3,"file":"plugins/CmsModelPlugin.js","sources":["../../src/plugins/CmsModelPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport lodashCamelCase from \"lodash/camelCase.js\";\nimport camelCase from \"lodash/camelCase.js\";\nimport upperFirst from \"lodash/upperFirst.js\";\nimport pluralize from \"pluralize\";\nimport { Plugin } from \"@webiny/plugins\";\nimport type {\n CmsModel as CmsModelBase,\n CmsModelField as CmsModelFieldBase,\n CmsModelFieldSettings as BaseCmsModelFieldSettings\n} from \"~/types/index.js\";\nimport { createFieldStorageId } from \"~/crud/contentModel/createFieldStorageId.js\";\nimport { validateStorageId } from \"~/crud/contentModel/validateStorageId.js\";\n\nconst createApiName = (name: string) => {\n return upperFirst(camelCase(name));\n};\n\nconst createPluralApiName = (name: string) => {\n return pluralize(createApiName(name));\n};\n\ninterface CmsModelFieldSettings extends Omit<BaseCmsModelFieldSettings, \"fields\"> {\n /**\n * Object field has child fields.\n */\n fields?: CmsModelFieldInput[];\n}\n\ninterface CmsModelFieldInput extends Omit<CmsModelFieldBase, \"storageId\" | \"settings\"> {\n /**\n * If defined, it must be camelCased string.\n * This is for backwards compatibility - before fields had storageId.\n *\n * This should only be populated in old model fields.\n * New ones must have this empty.\n */\n storageId?: string;\n /**\n * We must have a possibility to have a nested field defined without the storageId.\n */\n settings?: CmsModelFieldSettings;\n}\n\nexport interface CmsApiModel extends Omit<\n CmsModelPluginModel,\n \"isPrivate\" | \"fields\" | \"singularApiName\" | \"pluralApiName\" | \"isPlugin\"\n> {\n isPrivate?: never;\n noValidate?: boolean;\n singularApiName?: string;\n pluralApiName?: string;\n fields: CmsModelFieldInput[];\n}\n\nexport interface CmsApiModelFull extends Omit<CmsApiModel, \"fields\"> {\n fields: CmsModelFieldBase[];\n}\n\ninterface CmsPrivateModel extends Omit<\n CmsModelPluginModel,\n | \"isPrivate\"\n | \"singularApiName\"\n | \"pluralApiName\"\n | \"fields\"\n | \"isPlugin\"\n | \"layout\"\n | \"icon\"\n | \"titleFieldId\"\n | \"description\"\n> {\n noValidate?: boolean;\n titleFieldId?: string;\n singularApiName?: never;\n pluralApiName?: never;\n isPrivate: true;\n fields: CmsModelFieldInput[];\n}\n\nexport interface CmsPrivateModelFull extends Omit<\n CmsPrivateModel,\n \"fields\" | \"createdBy\" | \"createdOn\" | \"savedOn\"\n> {\n fields: CmsModelFieldBase[];\n}\n\nexport type CmsModelInput = CmsApiModel | CmsPrivateModel | CmsApiModelFull | CmsPrivateModelFull;\n\nexport interface CmsModelPluginModel extends Omit<CmsModelBase, \"tenant\"> {\n tenant?: string;\n}\n\ninterface CmsModelPluginOptions {\n validateLayout?: boolean;\n}\n\nexport class CmsModelPlugin extends Plugin {\n public static override readonly type: string = \"cms-content-model\";\n public readonly contentModel: CmsModelPluginModel;\n\n private readonly options: CmsModelPluginOptions;\n\n constructor(contentModel: CmsModelInput, options?: CmsModelPluginOptions) {\n super();\n this.options = options || {};\n this.contentModel = this.buildModel(contentModel);\n }\n\n private buildModel(input: CmsModelInput): CmsModelPluginModel {\n const isPrivate = input.isPrivate ?? false;\n\n const singularApiName = input.singularApiName\n ? createApiName(input.singularApiName)\n : createApiName(input.name);\n\n const pluralApiName = input.pluralApiName\n ? createApiName(input.pluralApiName)\n : createPluralApiName(input.name);\n\n const modelPlugin: CmsModelPluginModel = {\n group: input.group ?? \"ungrouped\",\n description: \"\",\n fields: [],\n isPlugin: true,\n isPrivate,\n icon: null,\n layout: [],\n modelId: input.modelId,\n name: input.name,\n pluralApiName,\n singularApiName,\n titleFieldId: \"id\"\n };\n\n if (input.noValidate) {\n /**\n * We can safely ignore this error, because we are sure noValidate is not a model field.\n */\n delete input[\"noValidate\"];\n\n return {\n ...modelPlugin,\n ...input,\n // Since `noValidate` is set, we trust the input, and cast to `CmsModelFieldBase`.\n fields: input.fields as CmsModelFieldBase[],\n pluralApiName,\n singularApiName\n };\n }\n\n const model: CmsModelPluginModel = {\n ...modelPlugin,\n ...input,\n pluralApiName,\n singularApiName,\n fields: this.buildFields(input, input.fields)\n };\n this.validateLayout(model);\n return model;\n }\n\n private buildFields(\n model: CmsModelInput,\n inputFields: CmsModelFieldInput[]\n ): CmsModelFieldBase[] {\n if (inputFields.length === 0) {\n throw new WebinyError(\n `Missing fields for the defined model \"${model.modelId}\".`,\n \"MISSING_FIELDS\",\n {\n model\n }\n );\n }\n const fields: CmsModelFieldBase[] = [];\n const storageIdList: string[] = [];\n const fieldIdList: string[] = [];\n for (const input of inputFields) {\n /**\n * Field must contain an fieldId. It is required in the graphql, but lets check it just in case\n */\n if (!(input.fieldId || \"\").trim()) {\n throw new WebinyError(\n `Field's \"storageId\" is not defined for the content model \"${model.modelId}\".`,\n \"FIELD_ID_ERROR\",\n {\n model,\n field: input\n }\n );\n }\n const fieldId = lodashCamelCase(input.fieldId);\n /**\n * FieldID must be in correct pattern.\n */\n if (fieldId.match(/^[0-9]/) !== null) {\n throw new WebinyError(\n `Field's \"fieldId\" does not match correct pattern in the content model \"${model.modelId}\" - cannot start with a number.`,\n \"FIELD_FIELD_ID_ERROR\",\n {\n model,\n field: input\n }\n );\n }\n /**\n * FieldID also must be camelCased.\n */\n if (fieldId !== input.fieldId) {\n throw new WebinyError(\n `Field's \"fieldId\" must be a camel cased string in the content model \"${model.modelId}\".`,\n \"FIELD_FIELD_ID_ERROR\",\n {\n model,\n field: input\n }\n );\n }\n /**\n * ... and fieldId must be unique.\n */\n if (fieldIdList.includes(fieldId)) {\n throw new WebinyError(\n `Field's \"fieldId\" (id: ${input.id}) is not unique in the content model \"${model.modelId}\".`,\n \"FIELD_ID_NOT_UNIQUE_ERROR\",\n {\n model,\n field: input\n }\n );\n }\n\n let storageId = input.storageId;\n if (storageId) {\n try {\n validateStorageId(storageId);\n } catch (e) {\n throw WebinyError.from(e, {\n data: { model, storageId, field: input }\n });\n }\n } else {\n storageId = createFieldStorageId(input);\n }\n\n /**\n * Fields storageId must be unique.\n */\n if (storageIdList.includes(storageId)) {\n throw new WebinyError(\n `Field's \"storageId\" is not unique in the content model \"${model.modelId}\".`,\n \"STORAGE_ID_ERROR\",\n {\n model,\n field: input\n }\n );\n }\n\n /**\n * We can safely ignore error because we are going through the fields and making sure each has storageId.\n */\n // @ts-expect-error\n let settings: BaseCmsModelFieldSettings = input.settings;\n\n const childFields = settings?.fields || [];\n if (input.type === \"object\" && childFields.length > 0) {\n settings = {\n ...(settings || {}),\n fields: this.buildFields(model, childFields)\n };\n }\n\n const field: CmsModelFieldBase = {\n ...input,\n settings,\n storageId\n };\n /**\n * Add all relevant data to arrays.\n */\n fields.push(field);\n storageIdList.push(field.storageId);\n fieldIdList.push(field.fieldId);\n }\n return fields;\n }\n\n private validateLayout(model: CmsModelPluginModel): void {\n /**\n * Only skip validation if option.validateLayout was set as false, explicitly.\n */\n if (this.options.validateLayout === false) {\n return;\n }\n\n const countFieldInLayout = (fieldId: string, layout: any[][]): number => {\n let total = 0;\n for (const row of layout) {\n for (const cell of row) {\n if (typeof cell === \"string\") {\n if (cell === fieldId) {\n total++;\n }\n } else if (cell && typeof cell === \"object\" && Array.isArray(cell.tabs)) {\n for (const tab of cell.tabs) {\n if (Array.isArray(tab.layout)) {\n total += countFieldInLayout(fieldId, tab.layout);\n }\n }\n }\n }\n }\n return total;\n };\n\n for (const field of model.fields) {\n const total = countFieldInLayout(field.id, model.layout);\n if (total === 1) {\n continue;\n } else if (total > 1) {\n throw new WebinyError(\n `Field \"${field.id}\" is in more than one layout cell.`,\n \"DUPLICATE_FIELD_IN_LAYOUT\",\n {\n model,\n field\n }\n );\n }\n throw new WebinyError(\n `Missing field \"${field.id}\" in layout.`,\n \"MISSING_FIELD_IN_LAYOUT\",\n {\n model,\n field\n }\n );\n }\n }\n}\n\n/**\n * IMPORTANT! This function should NOT be used outside the `api-headless-cms` package!\n * @internal\n */\nexport const createModelPlugin = (\n model: CmsModelInput,\n options?: CmsModelPluginOptions\n): CmsModelPlugin => {\n return new CmsModelPlugin(model, options);\n};\n\n/**\n * IMPORTANT! This function should NOT be used outside the `api-headless-cms` package!\n * @internal\n */\nexport const createPrivateModelPlugin = (\n input: Omit<CmsPrivateModelFull, \"group\" | \"isPrivate\">\n): CmsModelPlugin => {\n return createModelPlugin(\n {\n authorization: false,\n noValidate: true,\n isPrivate: true,\n group: \"private\",\n ...input\n },\n {\n validateLayout: false\n }\n );\n};\n"],"names":["createApiName","name","upperFirst","camelCase","createPluralApiName","pluralize","CmsModelPlugin","Plugin","contentModel","options","input","isPrivate","singularApiName","pluralApiName","modelPlugin","model","inputFields","WebinyError","fields","storageIdList","fieldIdList","fieldId","lodashCamelCase","storageId","validateStorageId","e","createFieldStorageId","settings","childFields","field","countFieldInLayout","layout","total","row","cell","Array","tab","createModelPlugin","createPrivateModelPlugin"],"mappings":"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"}
1
+ {"version":3,"file":"plugins/CmsModelPlugin.js","sources":["../../src/plugins/CmsModelPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport lodashCamelCase from \"lodash/camelCase.js\";\nimport camelCase from \"lodash/camelCase.js\";\nimport upperFirst from \"lodash/upperFirst.js\";\nimport pluralize from \"pluralize\";\nimport { Plugin } from \"@webiny/plugins\";\nimport type {\n CmsModel as CmsModelBase,\n CmsModelField as CmsModelFieldBase,\n CmsModelFieldSettings as BaseCmsModelFieldSettings\n} from \"~/types/index.js\";\nimport { createFieldStorageId } from \"~/crud/contentModel/createFieldStorageId.js\";\nimport { validateStorageId } from \"~/crud/contentModel/validateStorageId.js\";\n\nconst createApiName = (name: string) => {\n return upperFirst(camelCase(name));\n};\n\nconst createPluralApiName = (name: string) => {\n return pluralize(createApiName(name));\n};\n\ninterface CmsModelFieldSettings extends Omit<BaseCmsModelFieldSettings, \"fields\"> {\n /**\n * Object field has child fields.\n */\n fields?: CmsModelFieldInput[];\n}\n\ninterface CmsModelFieldInput extends Omit<CmsModelFieldBase, \"storageId\" | \"settings\"> {\n /**\n * If defined, it must be camelCased string.\n * This is for backwards compatibility - before fields had storageId.\n *\n * This should only be populated in old model fields.\n * New ones must have this empty.\n */\n storageId?: string;\n /**\n * We must have a possibility to have a nested field defined without the storageId.\n */\n settings?: CmsModelFieldSettings;\n}\n\nexport interface CmsApiModel extends Omit<\n CmsModelPluginModel,\n \"isPrivate\" | \"fields\" | \"singularApiName\" | \"pluralApiName\" | \"isPlugin\"\n> {\n isPrivate?: never;\n noValidate?: boolean;\n singularApiName?: string;\n pluralApiName?: string;\n fields: CmsModelFieldInput[];\n}\n\nexport interface CmsApiModelFull extends Omit<CmsApiModel, \"fields\"> {\n fields: CmsModelFieldBase[];\n}\n\ninterface CmsPrivateModel extends Omit<\n CmsModelPluginModel,\n | \"isPrivate\"\n | \"singularApiName\"\n | \"pluralApiName\"\n | \"fields\"\n | \"isPlugin\"\n | \"layout\"\n | \"icon\"\n | \"titleFieldId\"\n | \"description\"\n> {\n noValidate?: boolean;\n titleFieldId?: string;\n singularApiName?: never;\n pluralApiName?: never;\n isPrivate: true;\n fields: CmsModelFieldInput[];\n}\n\nexport interface CmsPrivateModelFull extends Omit<\n CmsPrivateModel,\n \"fields\" | \"createdBy\" | \"createdOn\" | \"savedOn\"\n> {\n fields: CmsModelFieldBase[];\n}\n\nexport type CmsModelInput = CmsApiModel | CmsPrivateModel | CmsApiModelFull | CmsPrivateModelFull;\n\nexport interface CmsModelPluginModel extends Omit<CmsModelBase, \"tenant\"> {\n tenant?: string;\n}\n\ninterface CmsModelPluginOptions {\n validateLayout?: boolean;\n}\n\nexport class CmsModelPlugin extends Plugin {\n public static override readonly type: string = \"cms-content-model\";\n public readonly contentModel: CmsModelPluginModel;\n\n private readonly options: CmsModelPluginOptions;\n\n constructor(contentModel: CmsModelInput, options?: CmsModelPluginOptions) {\n super();\n this.options = options || {};\n this.contentModel = this.buildModel(contentModel);\n }\n\n private buildModel(input: CmsModelInput): CmsModelPluginModel {\n const isPrivate = input.isPrivate ?? false;\n\n const singularApiName = input.singularApiName\n ? createApiName(input.singularApiName)\n : createApiName(input.name);\n\n const pluralApiName = input.pluralApiName\n ? createApiName(input.pluralApiName)\n : createPluralApiName(input.name);\n\n const modelPlugin: CmsModelPluginModel = {\n group: input.group ?? \"ungrouped\",\n description: \"\",\n fields: [],\n isPlugin: true,\n isPrivate,\n icon: null,\n layout: [],\n modelId: input.modelId,\n name: input.name,\n pluralApiName,\n singularApiName,\n titleFieldId: \"id\",\n settings: {}\n };\n\n if (input.noValidate) {\n /**\n * We can safely ignore this error, because we are sure noValidate is not a model field.\n */\n delete input[\"noValidate\"];\n\n return {\n ...modelPlugin,\n ...input,\n // Since `noValidate` is set, we trust the input, and cast to `CmsModelFieldBase`.\n fields: input.fields as CmsModelFieldBase[],\n pluralApiName,\n singularApiName\n };\n }\n\n const model: CmsModelPluginModel = {\n ...modelPlugin,\n ...input,\n pluralApiName,\n singularApiName,\n fields: this.buildFields(input, input.fields)\n };\n this.validateLayout(model);\n return model;\n }\n\n private buildFields(\n model: CmsModelInput,\n inputFields: CmsModelFieldInput[]\n ): CmsModelFieldBase[] {\n if (inputFields.length === 0) {\n throw new WebinyError(\n `Missing fields for the defined model \"${model.modelId}\".`,\n \"MISSING_FIELDS\",\n {\n model\n }\n );\n }\n const fields: CmsModelFieldBase[] = [];\n const storageIdList: string[] = [];\n const fieldIdList: string[] = [];\n for (const input of inputFields) {\n /**\n * Field must contain an fieldId. It is required in the graphql, but lets check it just in case\n */\n if (!(input.fieldId || \"\").trim()) {\n throw new WebinyError(\n `Field's \"storageId\" is not defined for the content model \"${model.modelId}\".`,\n \"FIELD_ID_ERROR\",\n {\n model,\n field: input\n }\n );\n }\n const fieldId = lodashCamelCase(input.fieldId);\n /**\n * FieldID must be in correct pattern.\n */\n if (fieldId.match(/^[0-9]/) !== null) {\n throw new WebinyError(\n `Field's \"fieldId\" does not match correct pattern in the content model \"${model.modelId}\" - cannot start with a number.`,\n \"FIELD_FIELD_ID_ERROR\",\n {\n model,\n field: input\n }\n );\n }\n /**\n * FieldID also must be camelCased.\n */\n if (fieldId !== input.fieldId) {\n throw new WebinyError(\n `Field's \"fieldId\" must be a camel cased string in the content model \"${model.modelId}\".`,\n \"FIELD_FIELD_ID_ERROR\",\n {\n model,\n field: input\n }\n );\n }\n /**\n * ... and fieldId must be unique.\n */\n if (fieldIdList.includes(fieldId)) {\n throw new WebinyError(\n `Field's \"fieldId\" (id: ${input.id}) is not unique in the content model \"${model.modelId}\".`,\n \"FIELD_ID_NOT_UNIQUE_ERROR\",\n {\n model,\n field: input\n }\n );\n }\n\n let storageId = input.storageId;\n if (storageId) {\n try {\n validateStorageId(storageId);\n } catch (e) {\n throw WebinyError.from(e, {\n data: { model, storageId, field: input }\n });\n }\n } else {\n storageId = createFieldStorageId(input);\n }\n\n /**\n * Fields storageId must be unique.\n */\n if (storageIdList.includes(storageId)) {\n throw new WebinyError(\n `Field's \"storageId\" is not unique in the content model \"${model.modelId}\".`,\n \"STORAGE_ID_ERROR\",\n {\n model,\n field: input\n }\n );\n }\n\n /**\n * We can safely ignore error because we are going through the fields and making sure each has storageId.\n */\n // @ts-expect-error\n let settings: BaseCmsModelFieldSettings = input.settings;\n\n const childFields = settings?.fields || [];\n if (input.type === \"object\" && childFields.length > 0) {\n settings = {\n ...(settings || {}),\n fields: this.buildFields(model, childFields)\n };\n }\n\n const field: CmsModelFieldBase = {\n ...input,\n settings,\n storageId\n };\n /**\n * Add all relevant data to arrays.\n */\n fields.push(field);\n storageIdList.push(field.storageId);\n fieldIdList.push(field.fieldId);\n }\n return fields;\n }\n\n private validateLayout(model: CmsModelPluginModel): void {\n /**\n * Only skip validation if option.validateLayout was set as false, explicitly.\n */\n if (this.options.validateLayout === false) {\n return;\n }\n\n const countFieldInLayout = (fieldId: string, layout: any[][]): number => {\n let total = 0;\n for (const row of layout) {\n for (const cell of row) {\n if (typeof cell === \"string\") {\n if (cell === fieldId) {\n total++;\n }\n } else if (cell && typeof cell === \"object\" && Array.isArray(cell.tabs)) {\n for (const tab of cell.tabs) {\n if (Array.isArray(tab.layout)) {\n total += countFieldInLayout(fieldId, tab.layout);\n }\n }\n }\n }\n }\n return total;\n };\n\n for (const field of model.fields) {\n const total = countFieldInLayout(field.id, model.layout);\n if (total === 1) {\n continue;\n } else if (total > 1) {\n throw new WebinyError(\n `Field \"${field.id}\" is in more than one layout cell.`,\n \"DUPLICATE_FIELD_IN_LAYOUT\",\n {\n model,\n field\n }\n );\n }\n throw new WebinyError(\n `Missing field \"${field.id}\" in layout.`,\n \"MISSING_FIELD_IN_LAYOUT\",\n {\n model,\n field\n }\n );\n }\n }\n}\n\n/**\n * IMPORTANT! This function should NOT be used outside the `api-headless-cms` package!\n * @internal\n */\nexport const createModelPlugin = (\n model: CmsModelInput,\n options?: CmsModelPluginOptions\n): CmsModelPlugin => {\n return new CmsModelPlugin(model, options);\n};\n\n/**\n * IMPORTANT! This function should NOT be used outside the `api-headless-cms` package!\n * @internal\n */\nexport const createPrivateModelPlugin = (\n input: Omit<CmsPrivateModelFull, \"group\" | \"isPrivate\">\n): CmsModelPlugin => {\n return createModelPlugin(\n {\n authorization: false,\n noValidate: true,\n isPrivate: true,\n group: \"private\",\n ...input\n },\n {\n validateLayout: false\n }\n );\n};\n"],"names":["createApiName","name","upperFirst","camelCase","createPluralApiName","pluralize","CmsModelPlugin","Plugin","contentModel","options","input","isPrivate","singularApiName","pluralApiName","modelPlugin","model","inputFields","WebinyError","fields","storageIdList","fieldIdList","fieldId","lodashCamelCase","storageId","validateStorageId","e","createFieldStorageId","settings","childFields","field","countFieldInLayout","layout","total","row","cell","Array","tab","createModelPlugin","createPrivateModelPlugin"],"mappings":"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"}
@@ -1,6 +1,5 @@
1
1
  export * from "./CmsGroupPlugin.js";
2
2
  export * from "./CmsModelPlugin.js";
3
- export * from "./CmsParametersPlugin.js";
4
3
  export * from "./CmsModelFieldConverterPlugin.js";
5
4
  export * from "./CmsGraphQLSchemaPlugin/index.js";
6
5
  export * from "./StorageOperationsCmsModelPlugin.js";
package/plugins/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  export * from "./CmsGroupPlugin.js";
2
2
  export * from "./CmsModelPlugin.js";
3
- export * from "./CmsParametersPlugin.js";
4
3
  export * from "./CmsModelFieldConverterPlugin.js";
5
4
  export * from "./CmsGraphQLSchemaPlugin/index.js";
6
5
  export * from "./StorageOperationsCmsModelPlugin.js";
@@ -10,6 +10,7 @@ export interface CmsDynamicZoneTemplate {
10
10
  layout: CmsModelLayoutCell[][];
11
11
  validation: CmsModelFieldValidation[];
12
12
  tags?: string[];
13
+ componentName?: string;
13
14
  }
14
15
  /**
15
16
  * A definition for dynamic-zone field to show possible type of the field in settings.