@webiny/api-headless-cms 0.0.0-unstable.7be00a75a9 → 0.0.0-unstable.7c2def32a7

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 (873) hide show
  1. package/HeadlessCmsEndpointConfig.d.ts +10 -0
  2. package/HeadlessCmsEndpointConfig.js +5 -0
  3. package/HeadlessCmsEndpointConfig.js.map +1 -0
  4. package/HeadlessCmsFeature.d.ts +10 -0
  5. package/HeadlessCmsFeature.js +168 -0
  6. package/HeadlessCmsFeature.js.map +1 -0
  7. package/createCmsRoute.d.ts +24 -0
  8. package/createCmsRoute.js +47 -0
  9. package/createCmsRoute.js.map +1 -0
  10. package/crud/contentEntry/entryDataValidation.d.ts +1 -1
  11. package/crud/contentEntry/entryDataValidation.js +43 -22
  12. package/crud/contentEntry/entryDataValidation.js.map +1 -1
  13. package/crud/contentEntry/references/validateEntries.d.ts +1 -1
  14. package/crud/contentEntry/references/validateEntries.js +17 -7
  15. package/crud/contentEntry/references/validateEntries.js.map +1 -1
  16. package/crud/contentModel/defaultFields.js +3 -2
  17. package/crud/contentModel/defaultFields.js.map +1 -1
  18. package/domain/contentModel/schemas.d.ts +10 -6
  19. package/domain/contentModel/schemas.js +6 -3
  20. package/domain/contentModel/schemas.js.map +1 -1
  21. package/domain/contentModel/validation/dateExpressions.d.ts +6 -0
  22. package/domain/contentModel/validation/dateExpressions.js +27 -0
  23. package/domain/contentModel/validation/dateExpressions.js.map +1 -0
  24. package/domain/contentModel/validation/modelFields.js +23 -15
  25. package/domain/contentModel/validation/modelFields.js.map +1 -1
  26. package/export/abstractions.d.ts +9 -0
  27. package/export/abstractions.js +6 -0
  28. package/export/abstractions.js.map +1 -0
  29. package/export/crud/exporting.js +8 -2
  30. package/export/crud/exporting.js.map +1 -1
  31. package/export/crud/importing.js +13 -4
  32. package/export/crud/importing.js.map +1 -1
  33. package/export/crud/imports/importGroups.js +23 -23
  34. package/export/crud/imports/importGroups.js.map +1 -1
  35. package/export/crud/imports/importModels.js +25 -22
  36. package/export/crud/imports/importModels.js.map +1 -1
  37. package/export/graphql/index.d.ts +2 -3
  38. package/export/graphql/index.js +6 -10
  39. package/export/graphql/index.js.map +1 -1
  40. package/exports/api/cms/entry.d.ts +2 -0
  41. package/exports/api/cms/entry.js +2 -0
  42. package/exports/api/cms/model.d.ts +4 -1
  43. package/exports/api/cms/model.js +2 -0
  44. package/exports/api/cms/storage.d.ts +0 -1
  45. package/exports/api/cms/storage.js +0 -1
  46. package/features/ai/DescribeContentModelTool.d.ts +60 -0
  47. package/features/ai/DescribeContentModelTool.js +69 -0
  48. package/features/ai/DescribeContentModelTool.js.map +1 -0
  49. package/features/ai/ListContentModelsTool.d.ts +46 -0
  50. package/features/ai/ListContentModelsTool.js +53 -0
  51. package/features/ai/ListContentModelsTool.js.map +1 -0
  52. package/features/ai/QueryEntriesTool.d.ts +80 -0
  53. package/features/ai/QueryEntriesTool.js +99 -0
  54. package/features/ai/QueryEntriesTool.js.map +1 -0
  55. package/features/ai/feature.d.ts +8 -0
  56. package/features/ai/feature.js +15 -0
  57. package/features/ai/feature.js.map +1 -0
  58. package/features/ai/index.d.ts +4 -0
  59. package/features/ai/index.js +4 -0
  60. package/features/contentEntry/ContentEntriesFeature.js +6 -0
  61. package/features/contentEntry/ContentEntriesFeature.js.map +1 -1
  62. package/features/contentEntry/CreateEntry/CreateEntryRepository.d.ts +9 -5
  63. package/features/contentEntry/CreateEntry/CreateEntryRepository.js +13 -9
  64. package/features/contentEntry/CreateEntry/CreateEntryRepository.js.map +1 -1
  65. package/features/contentEntry/CreateEntry/CreateEntryUseCase.d.ts +5 -3
  66. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js +5 -7
  67. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js.map +1 -1
  68. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.d.ts +9 -5
  69. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js +13 -9
  70. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js.map +1 -1
  71. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.d.ts +5 -5
  72. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js +8 -17
  73. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js.map +1 -1
  74. package/features/contentEntry/CreateEntryRevisionFrom/abstractions.d.ts +2 -0
  75. package/features/contentEntry/CreateEntryRevisionFrom/abstractions.js.map +1 -1
  76. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.d.ts +9 -5
  77. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js +13 -9
  78. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js.map +1 -1
  79. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.d.ts +5 -3
  80. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js +4 -5
  81. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js.map +1 -1
  82. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.d.ts +8 -4
  83. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js +12 -9
  84. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js.map +1 -1
  85. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.d.ts +5 -3
  86. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js +4 -5
  87. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js.map +1 -1
  88. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.d.ts +3 -3
  89. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js +5 -5
  90. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js.map +1 -1
  91. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.d.ts +8 -4
  92. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js +14 -9
  93. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js.map +1 -1
  94. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.d.ts +5 -3
  95. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js +4 -5
  96. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js.map +1 -1
  97. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.d.ts +9 -5
  98. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js +12 -9
  99. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js.map +1 -1
  100. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.d.ts +5 -3
  101. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js +4 -5
  102. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js.map +1 -1
  103. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.d.ts +17 -0
  104. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.js +83 -0
  105. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.js.map +1 -0
  106. package/features/contentEntry/DuplicateEntry/abstractions.d.ts +47 -0
  107. package/features/contentEntry/DuplicateEntry/abstractions.js +5 -0
  108. package/features/contentEntry/DuplicateEntry/abstractions.js.map +1 -0
  109. package/features/contentEntry/DuplicateEntry/events.d.ts +41 -0
  110. package/features/contentEntry/DuplicateEntry/events.js +32 -0
  111. package/features/contentEntry/DuplicateEntry/events.js.map +1 -0
  112. package/features/contentEntry/DuplicateEntry/feature.d.ts +4 -0
  113. package/features/contentEntry/DuplicateEntry/feature.js +11 -0
  114. package/features/contentEntry/DuplicateEntry/feature.js.map +1 -0
  115. package/features/contentEntry/DuplicateEntry/index.d.ts +2 -0
  116. package/features/contentEntry/DuplicateEntry/index.js +2 -0
  117. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.d.ts +7 -0
  118. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.js +12 -0
  119. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.js.map +1 -0
  120. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.d.ts +10 -0
  121. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.js +25 -0
  122. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.js.map +1 -0
  123. package/features/contentEntry/EntryEventPublisher/abstractions.d.ts +16 -0
  124. package/features/contentEntry/EntryEventPublisher/abstractions.js +5 -0
  125. package/features/contentEntry/EntryEventPublisher/abstractions.js.map +1 -0
  126. package/features/contentEntry/EntryEventPublisher/feature.d.ts +4 -0
  127. package/features/contentEntry/EntryEventPublisher/feature.js +11 -0
  128. package/features/contentEntry/EntryEventPublisher/feature.js.map +1 -0
  129. package/features/contentEntry/EntryEventPublisher/index.d.ts +2 -0
  130. package/features/contentEntry/EntryEventPublisher/index.js +2 -0
  131. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.d.ts +9 -7
  132. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js +12 -16
  133. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js.map +1 -1
  134. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.d.ts +3 -1
  135. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js +2 -3
  136. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js.map +1 -1
  137. package/features/contentEntry/GetEntry/GetEntryUseCase.d.ts +3 -1
  138. package/features/contentEntry/GetEntry/GetEntryUseCase.js +2 -3
  139. package/features/contentEntry/GetEntry/GetEntryUseCase.js.map +1 -1
  140. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.d.ts +3 -1
  141. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js +2 -3
  142. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js.map +1 -1
  143. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.d.ts +9 -5
  144. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js +12 -9
  145. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js.map +1 -1
  146. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.d.ts +3 -1
  147. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js +2 -3
  148. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js.map +1 -1
  149. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.d.ts +3 -1
  150. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js +2 -3
  151. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js.map +1 -1
  152. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.d.ts +9 -5
  153. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js +12 -9
  154. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js.map +1 -1
  155. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.d.ts +3 -1
  156. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js +2 -3
  157. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js.map +1 -1
  158. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.d.ts +3 -1
  159. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js +1 -3
  160. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js.map +1 -1
  161. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.d.ts +3 -1
  162. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js +2 -3
  163. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js.map +1 -1
  164. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.d.ts +3 -1
  165. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js +2 -3
  166. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js.map +1 -1
  167. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.d.ts +9 -5
  168. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js +12 -9
  169. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js.map +1 -1
  170. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.d.ts +3 -1
  171. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js +2 -3
  172. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js.map +1 -1
  173. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.d.ts +9 -5
  174. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js +12 -9
  175. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js.map +1 -1
  176. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.d.ts +3 -1
  177. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js +2 -3
  178. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js.map +1 -1
  179. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.d.ts +9 -5
  180. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js +12 -9
  181. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js.map +1 -1
  182. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.d.ts +3 -1
  183. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js +2 -3
  184. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js.map +1 -1
  185. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.d.ts +9 -5
  186. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js +12 -9
  187. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js.map +1 -1
  188. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.d.ts +3 -1
  189. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js +1 -3
  190. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js.map +1 -1
  191. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.d.ts +9 -5
  192. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js +12 -9
  193. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js.map +1 -1
  194. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.d.ts +3 -1
  195. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js +2 -3
  196. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js.map +1 -1
  197. package/features/contentEntry/GetSingletonEntry/GetSingletonEntryUseCase.js +1 -3
  198. package/features/contentEntry/GetSingletonEntry/GetSingletonEntryUseCase.js.map +1 -1
  199. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.d.ts +9 -5
  200. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js +12 -9
  201. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js.map +1 -1
  202. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.d.ts +6 -2
  203. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js +8 -6
  204. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js.map +1 -1
  205. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.d.ts +3 -1
  206. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js +1 -3
  207. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js.map +1 -1
  208. package/features/contentEntry/ListEntries/ListEntriesRepository.d.ts +9 -5
  209. package/features/contentEntry/ListEntries/ListEntriesRepository.js +12 -9
  210. package/features/contentEntry/ListEntries/ListEntriesRepository.js.map +1 -1
  211. package/features/contentEntry/ListEntries/ListEntriesUseCase.d.ts +3 -1
  212. package/features/contentEntry/ListEntries/ListEntriesUseCase.js +2 -3
  213. package/features/contentEntry/ListEntries/ListEntriesUseCase.js.map +1 -1
  214. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.d.ts +3 -1
  215. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js +1 -3
  216. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js.map +1 -1
  217. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.d.ts +3 -1
  218. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js +1 -3
  219. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js.map +1 -1
  220. package/features/contentEntry/MoveEntry/MoveEntryRepository.d.ts +9 -5
  221. package/features/contentEntry/MoveEntry/MoveEntryRepository.js +12 -9
  222. package/features/contentEntry/MoveEntry/MoveEntryRepository.js.map +1 -1
  223. package/features/contentEntry/MoveEntry/MoveEntryUseCase.d.ts +5 -3
  224. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js +4 -5
  225. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js.map +1 -1
  226. package/features/contentEntry/PublishEntry/PublishEntryRepository.d.ts +9 -5
  227. package/features/contentEntry/PublishEntry/PublishEntryRepository.js +13 -9
  228. package/features/contentEntry/PublishEntry/PublishEntryRepository.js.map +1 -1
  229. package/features/contentEntry/PublishEntry/PublishEntryUseCase.d.ts +7 -7
  230. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js +13 -16
  231. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js.map +1 -1
  232. package/features/contentEntry/PublishEntry/abstractions.d.ts +8 -1
  233. package/features/contentEntry/PublishEntry/abstractions.js.map +1 -1
  234. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.d.ts +11 -5
  235. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js +17 -10
  236. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js.map +1 -1
  237. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.d.ts +5 -3
  238. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js +7 -6
  239. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js.map +1 -1
  240. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.d.ts +9 -5
  241. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js +13 -9
  242. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js.map +1 -1
  243. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.d.ts +5 -3
  244. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js +4 -5
  245. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js.map +1 -1
  246. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.d.ts +9 -5
  247. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js +13 -9
  248. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js.map +1 -1
  249. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.d.ts +5 -3
  250. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js +7 -6
  251. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js.map +1 -1
  252. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.d.ts +9 -5
  253. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js +13 -9
  254. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js.map +1 -1
  255. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.d.ts +5 -3
  256. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js +7 -6
  257. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js.map +1 -1
  258. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.d.ts +6 -9
  259. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js +7 -17
  260. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js.map +1 -1
  261. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.d.ts +3 -1
  262. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js +2 -3
  263. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js.map +1 -1
  264. package/features/contentEntry/ensureItemIds.d.ts +13 -0
  265. package/features/contentEntry/ensureItemIds.js +22 -0
  266. package/features/contentEntry/ensureItemIds.js.map +1 -0
  267. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.d.ts +6 -2
  268. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js +10 -6
  269. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js.map +1 -1
  270. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.d.ts +10 -6
  271. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js +49 -20
  272. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js.map +1 -1
  273. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/abstractions.d.ts +17 -1
  274. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/abstractions.js.map +1 -1
  275. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.d.ts +8 -4
  276. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js +23 -18
  277. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js.map +1 -1
  278. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/abstractions.d.ts +15 -1
  279. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/abstractions.js.map +1 -1
  280. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.d.ts +8 -4
  281. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js +18 -15
  282. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js.map +1 -1
  283. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/abstractions.d.ts +13 -1
  284. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/abstractions.js.map +1 -1
  285. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.d.ts +9 -7
  286. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js +18 -20
  287. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js.map +1 -1
  288. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/abstractions.d.ts +14 -2
  289. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/abstractions.js.map +1 -1
  290. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.d.ts +10 -4
  291. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js +74 -32
  292. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js.map +1 -1
  293. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/abstractions.d.ts +15 -1
  294. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/abstractions.js.map +1 -1
  295. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.d.ts +24 -0
  296. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.js +13 -0
  297. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.js.map +1 -0
  298. package/features/contentModel/ComponentMapGenerator/ComponentMapGenerator.d.ts +14 -0
  299. package/features/contentModel/ComponentMapGenerator/ComponentMapGenerator.js +32 -0
  300. package/features/contentModel/ComponentMapGenerator/ComponentMapGenerator.js.map +1 -0
  301. package/features/contentModel/ComponentMapGenerator/abstractions.d.ts +8 -0
  302. package/features/contentModel/ComponentMapGenerator/abstractions.js +5 -0
  303. package/features/contentModel/ComponentMapGenerator/abstractions.js.map +1 -0
  304. package/features/contentModel/ComponentMapGenerator/feature.d.ts +4 -0
  305. package/features/contentModel/ComponentMapGenerator/feature.js +11 -0
  306. package/features/contentModel/ComponentMapGenerator/feature.js.map +1 -0
  307. package/features/contentModel/ComponentMapGenerator/index.d.ts +2 -0
  308. package/features/contentModel/ComponentMapGenerator/index.js +2 -0
  309. package/features/contentModel/ContentModelFeature.js +6 -0
  310. package/features/contentModel/ContentModelFeature.js.map +1 -1
  311. package/features/contentModel/CreateModel/CreateModelRepository.d.ts +4 -3
  312. package/features/contentModel/CreateModel/CreateModelRepository.js +6 -5
  313. package/features/contentModel/CreateModel/CreateModelRepository.js.map +1 -1
  314. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.d.ts +4 -3
  315. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js +6 -5
  316. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js.map +1 -1
  317. package/features/contentModel/DeleteModel/DeleteModelRepository.d.ts +6 -4
  318. package/features/contentModel/DeleteModel/DeleteModelRepository.js +10 -6
  319. package/features/contentModel/DeleteModel/DeleteModelRepository.js.map +1 -1
  320. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.d.ts +9 -3
  321. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js +36 -18
  322. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js.map +1 -1
  323. package/features/contentModel/ModelToAstConverter/ModelToAstConverter.d.ts +1 -1
  324. package/features/contentModel/ModelToAstConverter/ModelToAstConverter.js.map +1 -1
  325. package/features/contentModel/ModelToAstConverter/abstractions.d.ts +1 -1
  326. package/features/contentModel/ModelToAstConverter/abstractions.js.map +1 -1
  327. package/features/contentModel/RefModelsGenerator/RefModelsGenerator.d.ts +19 -0
  328. package/features/contentModel/RefModelsGenerator/RefModelsGenerator.js +56 -0
  329. package/features/contentModel/RefModelsGenerator/RefModelsGenerator.js.map +1 -0
  330. package/features/contentModel/RefModelsGenerator/abstractions.d.ts +11 -0
  331. package/features/contentModel/RefModelsGenerator/abstractions.js +5 -0
  332. package/features/contentModel/RefModelsGenerator/abstractions.js.map +1 -0
  333. package/features/contentModel/RefModelsGenerator/feature.d.ts +4 -0
  334. package/features/contentModel/RefModelsGenerator/feature.js +11 -0
  335. package/features/contentModel/RefModelsGenerator/feature.js.map +1 -0
  336. package/features/contentModel/RefModelsGenerator/index.d.ts +2 -0
  337. package/features/contentModel/RefModelsGenerator/index.js +2 -0
  338. package/features/contentModel/UpdateModel/UpdateModelRepository.d.ts +9 -4
  339. package/features/contentModel/UpdateModel/UpdateModelRepository.js +17 -9
  340. package/features/contentModel/UpdateModel/UpdateModelRepository.js.map +1 -1
  341. package/features/contentModel/UpdateModel/UpdateModelUseCase.js +2 -2
  342. package/features/contentModel/UpdateModel/UpdateModelUseCase.js.map +1 -1
  343. package/features/contentModel/UpdateModel/abstractions.d.ts +1 -1
  344. package/features/contentModel/UpdateModel/abstractions.js.map +1 -1
  345. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.d.ts +16 -0
  346. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js +54 -0
  347. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js.map +1 -0
  348. package/features/contentModel/ValuesSelectionGenerator/abstractions.d.ts +8 -0
  349. package/features/contentModel/ValuesSelectionGenerator/abstractions.js +5 -0
  350. package/features/contentModel/ValuesSelectionGenerator/abstractions.js.map +1 -0
  351. package/features/contentModel/ValuesSelectionGenerator/feature.d.ts +4 -0
  352. package/features/contentModel/ValuesSelectionGenerator/feature.js +11 -0
  353. package/features/contentModel/ValuesSelectionGenerator/feature.js.map +1 -0
  354. package/features/contentModel/ValuesSelectionGenerator/index.d.ts +1 -0
  355. package/features/contentModel/ValuesSelectionGenerator/index.js +1 -0
  356. package/features/contentModel/shared/ModelsFetcher.d.ts +9 -8
  357. package/features/contentModel/shared/ModelsFetcher.js +5 -5
  358. package/features/contentModel/shared/ModelsFetcher.js.map +1 -1
  359. package/features/contentModel/shared/PluginModelsProvider.d.ts +9 -5
  360. package/features/contentModel/shared/PluginModelsProvider.js +11 -15
  361. package/features/contentModel/shared/PluginModelsProvider.js.map +1 -1
  362. package/features/contentModel/shared/abstractions.d.ts +10 -0
  363. package/features/contentModel/shared/abstractions.js +2 -1
  364. package/features/contentModel/shared/abstractions.js.map +1 -1
  365. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.d.ts +10 -4
  366. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js +18 -14
  367. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js.map +1 -1
  368. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.d.ts +3 -1
  369. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js +2 -3
  370. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js.map +1 -1
  371. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.d.ts +11 -5
  372. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js +16 -10
  373. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js.map +1 -1
  374. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.d.ts +3 -1
  375. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js +2 -3
  376. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js.map +1 -1
  377. package/features/contentModelGroup/GetGroup/GetGroupRepository.d.ts +6 -4
  378. package/features/contentModelGroup/GetGroup/GetGroupRepository.js +9 -9
  379. package/features/contentModelGroup/GetGroup/GetGroupRepository.js.map +1 -1
  380. package/features/contentModelGroup/GetGroup/GetGroupUseCase.d.ts +3 -1
  381. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js +2 -3
  382. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js.map +1 -1
  383. package/features/contentModelGroup/ListGroups/ListGroupsRepository.d.ts +6 -4
  384. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js +9 -9
  385. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js.map +1 -1
  386. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.d.ts +3 -1
  387. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js +2 -3
  388. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js.map +1 -1
  389. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.d.ts +9 -5
  390. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js +13 -10
  391. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js.map +1 -1
  392. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.d.ts +3 -1
  393. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js +4 -5
  394. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js.map +1 -1
  395. package/features/contentModelGroup/UpdateGroup/abstractions.d.ts +1 -1
  396. package/features/contentModelGroup/UpdateGroup/abstractions.js.map +1 -1
  397. package/features/contentModelGroup/shared/PluginGroupsProvider.d.ts +6 -4
  398. package/features/contentModelGroup/shared/PluginGroupsProvider.js +13 -11
  399. package/features/contentModelGroup/shared/PluginGroupsProvider.js.map +1 -1
  400. package/features/contentModelGroup/shared/abstractions.d.ts +10 -0
  401. package/features/contentModelGroup/shared/abstractions.js +2 -1
  402. package/features/contentModelGroup/shared/abstractions.js.map +1 -1
  403. package/features/graphql/feature.js +2 -0
  404. package/features/graphql/feature.js.map +1 -1
  405. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.d.ts +2 -2
  406. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.js.map +1 -1
  407. package/features/graphql/fields/base/AssetToGraphQL.d.ts +26 -0
  408. package/features/graphql/fields/base/AssetToGraphQL.js +153 -0
  409. package/features/graphql/fields/base/AssetToGraphQL.js.map +1 -0
  410. package/features/graphql/fields/base/DynamicZoneToGraphQL.js +12 -2
  411. package/features/graphql/fields/base/DynamicZoneToGraphQL.js.map +1 -1
  412. package/features/graphql/fields/base/ObjectToGraphQL.js +8 -5
  413. package/features/graphql/fields/base/ObjectToGraphQL.js.map +1 -1
  414. package/features/graphql/fields/base/RefToGraphQL.d.ts +1 -1
  415. package/features/graphql/fields/base/RefToGraphQL.js +25 -9
  416. package/features/graphql/fields/base/RefToGraphQL.js.map +1 -1
  417. package/features/graphql/fields/base/richText/richTextResolver.d.ts +1 -1
  418. package/features/graphql/fields/base/richText/richTextResolver.js.map +1 -1
  419. package/features/modelBuilder/abstractions.d.ts +13 -0
  420. package/features/modelBuilder/abstractions.js.map +1 -1
  421. package/features/modelBuilder/feature.js +3 -8
  422. package/features/modelBuilder/feature.js.map +1 -1
  423. package/features/modelBuilder/fields/AssetFieldType.d.ts +20 -0
  424. package/features/modelBuilder/fields/AssetFieldType.js +46 -0
  425. package/features/modelBuilder/fields/AssetFieldType.js.map +1 -0
  426. package/features/modelBuilder/fields/BaseFieldBuilder.d.ts +3 -1
  427. package/features/modelBuilder/fields/BaseFieldBuilder.js +4 -0
  428. package/features/modelBuilder/fields/BaseFieldBuilder.js.map +1 -1
  429. package/features/modelBuilder/fields/DataFieldBuilder.d.ts +71 -18
  430. package/features/modelBuilder/fields/DataFieldBuilder.js +11 -1
  431. package/features/modelBuilder/fields/DataFieldBuilder.js.map +1 -1
  432. package/features/modelBuilder/fields/DateTimeFieldType.js +27 -12
  433. package/features/modelBuilder/fields/DateTimeFieldType.js.map +1 -1
  434. package/features/modelBuilder/fields/DynamicZoneFieldType.d.ts +1 -0
  435. package/features/modelBuilder/fields/DynamicZoneFieldType.js +10 -9
  436. package/features/modelBuilder/fields/DynamicZoneFieldType.js.map +1 -1
  437. package/features/modelBuilder/fields/TextFieldType.d.ts +3 -1
  438. package/features/modelBuilder/fields/TextFieldType.js +1 -3
  439. package/features/modelBuilder/fields/TextFieldType.js.map +1 -1
  440. package/features/modelBuilder/fields/UiAlertFieldType.js +2 -1
  441. package/features/modelBuilder/fields/UiAlertFieldType.js.map +1 -1
  442. package/features/modelBuilder/fields/UiSeparatorFieldType.js +2 -1
  443. package/features/modelBuilder/fields/UiSeparatorFieldType.js.map +1 -1
  444. package/features/modelBuilder/fields/UiTabsFieldType.d.ts +2 -1
  445. package/features/modelBuilder/fields/UiTabsFieldType.js +6 -3
  446. package/features/modelBuilder/fields/UiTabsFieldType.js.map +1 -1
  447. package/features/modelBuilder/fields/fieldTypeValidator.d.ts +5 -3
  448. package/features/modelBuilder/fields/resolveAssetUrl.d.ts +35 -0
  449. package/features/modelBuilder/fields/resolveAssetUrl.js +26 -0
  450. package/features/modelBuilder/fields/resolveAssetUrl.js.map +1 -0
  451. package/features/modelBuilder/index.d.ts +1 -1
  452. package/features/modelBuilder/models/BaseModelBuilder.d.ts +3 -1
  453. package/features/modelBuilder/models/BaseModelBuilder.js +7 -0
  454. package/features/modelBuilder/models/BaseModelBuilder.js.map +1 -1
  455. package/features/modelBuilder/models/ModelBuilder.d.ts +8 -0
  456. package/features/modelBuilder/models/ModelBuilder.js +1 -0
  457. package/features/modelBuilder/models/ModelBuilder.js.map +1 -1
  458. package/features/modelBuilder/models/ModelsProvider.d.ts +1 -3
  459. package/features/modelBuilder/models/ModelsProvider.js +2 -7
  460. package/features/modelBuilder/models/ModelsProvider.js.map +1 -1
  461. package/features/modelBuilder/models/PrivateModelBuilder.d.ts +5 -0
  462. package/features/modelBuilder/models/PrivateModelBuilder.js +13 -1
  463. package/features/modelBuilder/models/PrivateModelBuilder.js.map +1 -1
  464. package/features/modelBuilder/models/PublicModelBuilder.js +2 -1
  465. package/features/modelBuilder/models/PublicModelBuilder.js.map +1 -1
  466. package/features/runtimeTenant/RuntimeTenant.d.ts +13 -0
  467. package/features/runtimeTenant/RuntimeTenant.js +22 -0
  468. package/features/runtimeTenant/RuntimeTenant.js.map +1 -0
  469. package/features/runtimeTenant/abstractions.d.ts +11 -0
  470. package/features/runtimeTenant/abstractions.js +5 -0
  471. package/features/runtimeTenant/abstractions.js.map +1 -0
  472. package/features/runtimeTenant/index.d.ts +2 -0
  473. package/features/runtimeTenant/index.js +2 -0
  474. package/features/shared/abstractions.d.ts +8 -16
  475. package/features/shared/abstractions.js +2 -3
  476. package/features/shared/abstractions.js.map +1 -1
  477. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.d.ts +8 -0
  478. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js +5 -0
  479. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js.map +1 -0
  480. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.d.ts +8 -0
  481. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js +5 -0
  482. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js.map +1 -0
  483. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.d.ts +8 -0
  484. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js +5 -0
  485. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js.map +1 -0
  486. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.d.ts +8 -0
  487. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js +5 -0
  488. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js.map +1 -0
  489. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.d.ts +8 -0
  490. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js +5 -0
  491. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js.map +1 -0
  492. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.d.ts +8 -0
  493. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js +5 -0
  494. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js.map +1 -0
  495. package/features/shared/storageOperations/entry/GetEntryStorageOperation.d.ts +8 -0
  496. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js +5 -0
  497. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js.map +1 -0
  498. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.d.ts +8 -0
  499. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js +5 -0
  500. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js.map +1 -0
  501. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.d.ts +8 -0
  502. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js +5 -0
  503. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js.map +1 -0
  504. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.d.ts +8 -0
  505. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js +5 -0
  506. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js.map +1 -0
  507. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.d.ts +8 -0
  508. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js +5 -0
  509. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js.map +1 -0
  510. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.d.ts +8 -0
  511. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js +5 -0
  512. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js.map +1 -0
  513. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.d.ts +8 -0
  514. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js +5 -0
  515. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js.map +1 -0
  516. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.d.ts +8 -0
  517. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js +5 -0
  518. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js.map +1 -0
  519. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.d.ts +8 -0
  520. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js +5 -0
  521. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js.map +1 -0
  522. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.d.ts +8 -0
  523. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js +5 -0
  524. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js.map +1 -0
  525. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.d.ts +8 -0
  526. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js +5 -0
  527. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js.map +1 -0
  528. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.d.ts +8 -0
  529. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js +5 -0
  530. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js.map +1 -0
  531. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.d.ts +8 -0
  532. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js +5 -0
  533. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js.map +1 -0
  534. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.d.ts +8 -0
  535. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js +5 -0
  536. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js.map +1 -0
  537. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.d.ts +8 -0
  538. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js +5 -0
  539. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js.map +1 -0
  540. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.d.ts +8 -0
  541. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js +5 -0
  542. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js.map +1 -0
  543. package/features/shared/storageOperations/group/CreateGroupStorageOperation.d.ts +8 -0
  544. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js +5 -0
  545. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js.map +1 -0
  546. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.d.ts +8 -0
  547. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js +5 -0
  548. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js.map +1 -0
  549. package/features/shared/storageOperations/group/GetGroupStorageOperation.d.ts +8 -0
  550. package/features/shared/storageOperations/group/GetGroupStorageOperation.js +5 -0
  551. package/features/shared/storageOperations/group/GetGroupStorageOperation.js.map +1 -0
  552. package/features/shared/storageOperations/group/ListGroupsStorageOperation.d.ts +8 -0
  553. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js +5 -0
  554. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js.map +1 -0
  555. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.d.ts +8 -0
  556. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js +5 -0
  557. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js.map +1 -0
  558. package/features/shared/storageOperations/index.d.ts +32 -0
  559. package/features/shared/storageOperations/index.js +32 -0
  560. package/features/shared/storageOperations/model/CreateModelStorageOperation.d.ts +8 -0
  561. package/features/shared/storageOperations/model/CreateModelStorageOperation.js +5 -0
  562. package/features/shared/storageOperations/model/CreateModelStorageOperation.js.map +1 -0
  563. package/features/shared/storageOperations/model/DeleteModelStorageOperation.d.ts +8 -0
  564. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js +5 -0
  565. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js.map +1 -0
  566. package/features/shared/storageOperations/model/GetModelStorageOperation.d.ts +8 -0
  567. package/features/shared/storageOperations/model/GetModelStorageOperation.js +5 -0
  568. package/features/shared/storageOperations/model/GetModelStorageOperation.js.map +1 -0
  569. package/features/shared/storageOperations/model/ListModelsStorageOperation.d.ts +8 -0
  570. package/features/shared/storageOperations/model/ListModelsStorageOperation.js +5 -0
  571. package/features/shared/storageOperations/model/ListModelsStorageOperation.js.map +1 -0
  572. package/features/shared/storageOperations/model/UpdateModelStorageOperation.d.ts +8 -0
  573. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js +5 -0
  574. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js.map +1 -0
  575. package/features/sortMapper/SortMapper.js +2 -5
  576. package/features/sortMapper/SortMapper.js.map +1 -1
  577. package/features/storage/fields/ObjectStorageTransform.js +27 -7
  578. package/features/storage/fields/ObjectStorageTransform.js.map +1 -1
  579. package/features/validation/abstractions/CmsModelFieldValidator.d.ts +5 -0
  580. package/features/validation/abstractions/CmsModelFieldValidator.js.map +1 -1
  581. package/features/validation/validators/DateGteValidator.d.ts +2 -0
  582. package/features/validation/validators/DateGteValidator.js +12 -2
  583. package/features/validation/validators/DateGteValidator.js.map +1 -1
  584. package/features/validation/validators/DateLteValidator.d.ts +2 -0
  585. package/features/validation/validators/DateLteValidator.js +12 -2
  586. package/features/validation/validators/DateLteValidator.js.map +1 -1
  587. package/features/validation/validators/PatternValidator.js +1 -1
  588. package/features/validation/validators/PatternValidator.js.map +1 -1
  589. package/features/validation/validators/dateLimit.d.ts +9 -0
  590. package/features/validation/validators/dateLimit.js +18 -0
  591. package/features/validation/validators/dateLimit.js.map +1 -0
  592. package/features/whereMapper/WhereMapper.js +7 -5
  593. package/features/whereMapper/WhereMapper.js.map +1 -1
  594. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +15 -5
  595. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
  596. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +8 -2
  597. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -1
  598. package/fieldConverters/abstractions.d.ts +14 -0
  599. package/fieldConverters/abstractions.js +13 -0
  600. package/fieldConverters/abstractions.js.map +1 -0
  601. package/fieldConverters/index.d.ts +1 -1
  602. package/graphql/CmsGraphQLSchemaFactory.d.ts +8 -0
  603. package/graphql/CmsGraphQLSchemaFactory.js +5 -0
  604. package/graphql/CmsGraphQLSchemaFactory.js.map +1 -0
  605. package/graphql/CmsSchemaExecutor.d.ts +10 -0
  606. package/graphql/CmsSchemaExecutor.js +5 -0
  607. package/graphql/CmsSchemaExecutor.js.map +1 -0
  608. package/graphql/buildSchemaPlugins.d.ts +2 -1
  609. package/graphql/buildSchemaPlugins.js +1 -3
  610. package/graphql/buildSchemaPlugins.js.map +1 -1
  611. package/graphql/checkEndpointAccess.js +5 -2
  612. package/graphql/checkEndpointAccess.js.map +1 -1
  613. package/graphql/createExecutableSchema.d.ts +1 -1
  614. package/graphql/createExecutableSchema.js +1 -1
  615. package/graphql/createExecutableSchema.js.map +1 -1
  616. package/graphql/generateSchema.d.ts +2 -1
  617. package/graphql/generateSchema.js +14 -5
  618. package/graphql/generateSchema.js.map +1 -1
  619. package/graphql/getSchema.js +7 -2
  620. package/graphql/getSchema.js.map +1 -1
  621. package/graphql/scalars/RevisionIdScalarPlugin.d.ts +1 -1
  622. package/graphql/scalars/RevisionIdScalarPlugin.js.map +1 -1
  623. package/graphql/schema/baseContentSchema.d.ts +1 -6
  624. package/graphql/schema/baseContentSchema.js +5 -8
  625. package/graphql/schema/baseContentSchema.js.map +1 -1
  626. package/graphql/schema/baseSchema.d.ts +2 -2
  627. package/graphql/schema/baseSchema.js +6 -41
  628. package/graphql/schema/baseSchema.js.map +1 -1
  629. package/graphql/schema/cms/CmsBaseErrorTypeFactory.d.ts +15 -0
  630. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js +25 -0
  631. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js.map +1 -0
  632. package/graphql/schema/cms/createEntryResolver.js +2 -2
  633. package/graphql/schema/cms/createEntryResolver.js.map +1 -1
  634. package/graphql/schema/cms/deleteEntryResolver.js +2 -2
  635. package/graphql/schema/cms/deleteEntryResolver.js.map +1 -1
  636. package/graphql/schema/cms/getEntryResolver.js +5 -4
  637. package/graphql/schema/cms/getEntryResolver.js.map +1 -1
  638. package/graphql/schema/cms/getModelResolver.d.ts +35 -0
  639. package/graphql/schema/cms/getModelResolver.js +49 -0
  640. package/graphql/schema/cms/getModelResolver.js.map +1 -0
  641. package/graphql/schema/cms/helpers/buildFieldsSelection.js +9 -2
  642. package/graphql/schema/cms/helpers/buildFieldsSelection.js.map +1 -1
  643. package/graphql/schema/cms/helpers/expandFieldWildcards.d.ts +2 -0
  644. package/graphql/schema/cms/helpers/expandFieldWildcards.js +13 -0
  645. package/graphql/schema/cms/helpers/expandFieldWildcards.js.map +1 -0
  646. package/graphql/schema/cms/helpers/getModel.d.ts +0 -3
  647. package/graphql/schema/cms/helpers/getModel.js +5 -3
  648. package/graphql/schema/cms/helpers/getModel.js.map +1 -1
  649. package/graphql/schema/cms/helpers/index.d.ts +1 -0
  650. package/graphql/schema/cms/helpers/index.js +1 -0
  651. package/graphql/schema/cms/helpers/transformWhereToNested.js +39 -17
  652. package/graphql/schema/cms/helpers/transformWhereToNested.js.map +1 -1
  653. package/graphql/schema/cms/helpers.d.ts +1 -0
  654. package/graphql/schema/cms/helpers.js +1 -0
  655. package/graphql/schema/cms/listEntriesResolver.js +5 -4
  656. package/graphql/schema/cms/listEntriesResolver.js.map +1 -1
  657. package/graphql/schema/cms/publishEntryResolver.js +2 -2
  658. package/graphql/schema/cms/publishEntryResolver.js.map +1 -1
  659. package/graphql/schema/cms/resolvers/createEntry.d.ts +3 -2
  660. package/graphql/schema/cms/resolvers/createEntry.js +5 -1
  661. package/graphql/schema/cms/resolvers/createEntry.js.map +1 -1
  662. package/graphql/schema/cms/resolvers/deleteEntryRevision.d.ts +3 -2
  663. package/graphql/schema/cms/resolvers/deleteEntryRevision.js +5 -1
  664. package/graphql/schema/cms/resolvers/deleteEntryRevision.js.map +1 -1
  665. package/graphql/schema/cms/resolvers/getEntry.d.ts +3 -2
  666. package/graphql/schema/cms/resolvers/getEntry.js +5 -1
  667. package/graphql/schema/cms/resolvers/getEntry.js.map +1 -1
  668. package/graphql/schema/cms/resolvers/getModel.d.ts +9 -0
  669. package/graphql/schema/cms/resolvers/getModel.js +22 -0
  670. package/graphql/schema/cms/resolvers/getModel.js.map +1 -0
  671. package/graphql/schema/cms/resolvers/index.d.ts +1 -0
  672. package/graphql/schema/cms/resolvers/index.js +1 -0
  673. package/graphql/schema/cms/resolvers/listEntries.d.ts +3 -2
  674. package/graphql/schema/cms/resolvers/listEntries.js +5 -1
  675. package/graphql/schema/cms/resolvers/listEntries.js.map +1 -1
  676. package/graphql/schema/cms/resolvers/mutationCms.d.ts +3 -2
  677. package/graphql/schema/cms/resolvers/mutationCms.js +5 -1
  678. package/graphql/schema/cms/resolvers/mutationCms.js.map +1 -1
  679. package/graphql/schema/cms/resolvers/publishEntryRevision.d.ts +3 -2
  680. package/graphql/schema/cms/resolvers/publishEntryRevision.js +5 -1
  681. package/graphql/schema/cms/resolvers/publishEntryRevision.js.map +1 -1
  682. package/graphql/schema/cms/resolvers/queryCms.d.ts +3 -2
  683. package/graphql/schema/cms/resolvers/queryCms.js +5 -1
  684. package/graphql/schema/cms/resolvers/queryCms.js.map +1 -1
  685. package/graphql/schema/cms/resolvers/unpublishEntryRevision.d.ts +3 -2
  686. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js +5 -1
  687. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js.map +1 -1
  688. package/graphql/schema/cms/resolvers/updateEntryRevision.d.ts +3 -2
  689. package/graphql/schema/cms/resolvers/updateEntryRevision.js +5 -1
  690. package/graphql/schema/cms/resolvers/updateEntryRevision.js.map +1 -1
  691. package/graphql/schema/cms/typeDefs/mutation.d.ts +3 -2
  692. package/graphql/schema/cms/typeDefs/mutation.js +5 -1
  693. package/graphql/schema/cms/typeDefs/mutation.js.map +1 -1
  694. package/graphql/schema/cms/typeDefs/query.d.ts +3 -2
  695. package/graphql/schema/cms/typeDefs/query.js +6 -1
  696. package/graphql/schema/cms/typeDefs/query.js.map +1 -1
  697. package/graphql/schema/cms/typeDefs/responses.d.ts +3 -2
  698. package/graphql/schema/cms/typeDefs/responses.js +10 -1
  699. package/graphql/schema/cms/typeDefs/responses.js.map +1 -1
  700. package/graphql/schema/cms/unpublishEntryResolver.js +2 -2
  701. package/graphql/schema/cms/unpublishEntryResolver.js.map +1 -1
  702. package/graphql/schema/cms/updateEntryResolver.js +2 -2
  703. package/graphql/schema/cms/updateEntryResolver.js.map +1 -1
  704. package/graphql/schema/contentEntries.js +60 -34
  705. package/graphql/schema/contentEntries.js.map +1 -1
  706. package/graphql/schema/contentModelGroups.js +39 -18
  707. package/graphql/schema/contentModelGroups.js.map +1 -1
  708. package/graphql/schema/contentModels.js +70 -16
  709. package/graphql/schema/contentModels.js.map +1 -1
  710. package/graphql/schema/createFieldResolvers.d.ts +1 -1
  711. package/graphql/schema/createFieldResolvers.js.map +1 -1
  712. package/graphql/schema/createManageResolvers.js +7 -3
  713. package/graphql/schema/createManageResolvers.js.map +1 -1
  714. package/graphql/schema/createManageSDL.js +2 -0
  715. package/graphql/schema/createManageSDL.js.map +1 -1
  716. package/graphql/schema/createSingularSDL.js +2 -0
  717. package/graphql/schema/createSingularSDL.js.map +1 -1
  718. package/graphql/schema/resolvers/manage/resolveCreate.js +5 -3
  719. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
  720. package/graphql/schema/resolvers/manage/resolveCreateFrom.js +5 -3
  721. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
  722. package/graphql/schema/resolvers/manage/resolveDelete.js +9 -4
  723. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
  724. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +5 -3
  725. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -1
  726. package/graphql/schema/resolvers/manage/resolveDuplicate.d.ts +7 -0
  727. package/graphql/schema/resolvers/manage/resolveDuplicate.js +11 -0
  728. package/graphql/schema/resolvers/manage/resolveDuplicate.js.map +1 -0
  729. package/graphql/schema/resolvers/manage/resolveGet.js +11 -6
  730. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
  731. package/graphql/schema/resolvers/manage/resolveGetByIds.js +5 -3
  732. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
  733. package/graphql/schema/resolvers/manage/resolveGetRevisions.js +5 -3
  734. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
  735. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +5 -3
  736. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -1
  737. package/graphql/schema/resolvers/manage/resolveList.js +5 -3
  738. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
  739. package/graphql/schema/resolvers/manage/resolveListDeleted.js +5 -3
  740. package/graphql/schema/resolvers/manage/resolveListDeleted.js.map +1 -1
  741. package/graphql/schema/resolvers/manage/resolveMove.js +4 -2
  742. package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -1
  743. package/graphql/schema/resolvers/manage/resolvePublish.js +5 -3
  744. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
  745. package/graphql/schema/resolvers/manage/resolveRepublish.js +5 -3
  746. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
  747. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js +5 -3
  748. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js.map +1 -1
  749. package/graphql/schema/resolvers/manage/resolveUnpublish.js +5 -3
  750. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
  751. package/graphql/schema/resolvers/manage/resolveUpdate.js +5 -3
  752. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
  753. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js +5 -3
  754. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js.map +1 -1
  755. package/graphql/schema/resolvers/manage/resolveValidate.js +5 -3
  756. package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -1
  757. package/graphql/schema/resolvers/preview/resolveGet.js +6 -3
  758. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
  759. package/graphql/schema/resolvers/preview/resolveList.js +5 -3
  760. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
  761. package/graphql/schema/resolvers/read/resolveGet.js +5 -2
  762. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
  763. package/graphql/schema/resolvers/read/resolveList.js +5 -3
  764. package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
  765. package/graphql/schema/resolvers/singular/resolveGet.js +1 -1
  766. package/graphql/schema/resolvers/singular/resolveGet.js.map +1 -1
  767. package/graphql/schema/resolvers/singular/resolveUpdate.js +1 -1
  768. package/graphql/schema/resolvers/singular/resolveUpdate.js.map +1 -1
  769. package/graphql/schema/schemaPlugins.d.ts +2 -1
  770. package/graphql/schema/schemaPlugins.js +2 -4
  771. package/graphql/schema/schemaPlugins.js.map +1 -1
  772. package/index.d.ts +7 -6
  773. package/index.js +4 -22
  774. package/legacy/abstractions.js.map +1 -1
  775. package/package.json +27 -33
  776. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.d.ts +2 -2
  777. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js +1 -1
  778. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js.map +1 -1
  779. package/plugins/CmsModelPlugin.js +2 -1
  780. package/plugins/CmsModelPlugin.js.map +1 -1
  781. package/plugins/index.d.ts +0 -1
  782. package/plugins/index.js +0 -1
  783. package/types/fields/dynamicZoneField.d.ts +3 -2
  784. package/types/index.d.ts +0 -1
  785. package/types/model.d.ts +6 -0
  786. package/types/modelField.d.ts +14 -1
  787. package/types/types.d.ts +11 -290
  788. package/types/types.js.map +1 -1
  789. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.d.ts +28 -0
  790. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js +324 -0
  791. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js.map +1 -0
  792. package/utils/contentModelToJsonSchema/index.d.ts +2 -0
  793. package/utils/contentModelToJsonSchema/index.js +1 -0
  794. package/utils/contentModelToJsonSchema/types.d.ts +24 -0
  795. package/utils/converters/ConverterCollection.d.ts +2 -2
  796. package/utils/converters/ConverterCollection.js +1 -3
  797. package/utils/converters/ConverterCollection.js.map +1 -1
  798. package/utils/converters/valueKeyFromStorageConverter.d.ts +2 -2
  799. package/utils/converters/valueKeyFromStorageConverter.js +2 -2
  800. package/utils/converters/valueKeyFromStorageConverter.js.map +1 -1
  801. package/utils/converters/valueKeyStorageConverter.js +4 -2
  802. package/utils/converters/valueKeyStorageConverter.js.map +1 -1
  803. package/utils/converters/valueKeyToStorageConverter.d.ts +2 -2
  804. package/utils/converters/valueKeyToStorageConverter.js +2 -2
  805. package/utils/converters/valueKeyToStorageConverter.js.map +1 -1
  806. package/utils/createModelField.js +2 -1
  807. package/utils/createModelField.js.map +1 -1
  808. package/utils/createModelSchemaKey.d.ts +8 -0
  809. package/utils/createModelSchemaKey.js +18 -0
  810. package/utils/createModelSchemaKey.js.map +1 -0
  811. package/utils/getSchemaFromFieldPlugins.d.ts +2 -2
  812. package/utils/getSchemaFromFieldPlugins.js.map +1 -1
  813. package/utils/index.d.ts +1 -0
  814. package/utils/index.js +1 -0
  815. package/utils/isHeadlessCmsReady.d.ts +1 -1
  816. package/utils/isHeadlessCmsReady.js +3 -2
  817. package/utils/isHeadlessCmsReady.js.map +1 -1
  818. package/abstractions/entryHooks/OnEntryBeforeCreate.d.ts +0 -8
  819. package/abstractions/entryHooks/OnEntryBeforeCreate.js +0 -5
  820. package/abstractions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  821. package/abstractions/entryHooks/index.d.ts +0 -1
  822. package/abstractions/entryHooks/index.js +0 -1
  823. package/abstractions/index.d.ts +0 -1
  824. package/abstractions/index.js +0 -1
  825. package/context.d.ts +0 -3
  826. package/context.js +0 -131
  827. package/context.js.map +0 -1
  828. package/crud/contentEntry.crud.d.ts +0 -6
  829. package/crud/contentEntry.crud.js +0 -334
  830. package/crud/contentEntry.crud.js.map +0 -1
  831. package/crud/contentModel.crud.d.ts +0 -5
  832. package/crud/contentModel.crud.js +0 -77
  833. package/crud/contentModel.crud.js.map +0 -1
  834. package/crud/contentModelGroup.crud.d.ts +0 -5
  835. package/crud/contentModelGroup.crud.js +0 -74
  836. package/crud/contentModelGroup.crud.js.map +0 -1
  837. package/extensions/entryHooks/OnEntryBeforeCreate.d.ts +0 -4
  838. package/extensions/entryHooks/OnEntryBeforeCreate.js +0 -21
  839. package/extensions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  840. package/extensions/entryHooks/index.d.ts +0 -1
  841. package/extensions/entryHooks/index.js +0 -1
  842. package/extensions/index.d.ts +0 -5
  843. package/extensions/index.js +0 -7
  844. package/extensions/index.js.map +0 -1
  845. package/graphql/graphQLHandlerFactory.d.ts +0 -5
  846. package/graphql/graphQLHandlerFactory.js +0 -22
  847. package/graphql/graphQLHandlerFactory.js.map +0 -1
  848. package/graphql/handleRequest.d.ts +0 -11
  849. package/graphql/handleRequest.js +0 -62
  850. package/graphql/handleRequest.js.map +0 -1
  851. package/graphql/index.d.ts +0 -4
  852. package/graphql/index.js +0 -11
  853. package/graphql/index.js.map +0 -1
  854. package/graphql/schema/cms/index.d.ts +0 -2
  855. package/graphql/schema/cms/index.js +0 -24
  856. package/graphql/schema/cms/index.js.map +0 -1
  857. package/index.js.map +0 -1
  858. package/parameters/context.d.ts +0 -2
  859. package/parameters/context.js +0 -7
  860. package/parameters/context.js.map +0 -1
  861. package/parameters/header.d.ts +0 -2
  862. package/parameters/header.js +0 -13
  863. package/parameters/header.js.map +0 -1
  864. package/parameters/index.d.ts +0 -3
  865. package/parameters/index.js +0 -3
  866. package/parameters/path.d.ts +0 -2
  867. package/parameters/path.js +0 -12
  868. package/parameters/path.js.map +0 -1
  869. package/plugins/CmsParametersPlugin.d.ts +0 -18
  870. package/plugins/CmsParametersPlugin.js +0 -16
  871. package/plugins/CmsParametersPlugin.js.map +0 -1
  872. package/types/context.d.ts +0 -110
  873. /package/{types/context.js → utils/contentModelToJsonSchema/types.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"features/contentModel/shared/abstractions.js","sources":["../../../../src/features/contentModel/shared/abstractions.ts"],"sourcesContent":["import { createAbstraction, Result } from \"@webiny/feature/api\";\nimport type { CmsModel } from \"~/types/index.js\";\nimport type { ICache } from \"~/utils/caching/types.js\";\nimport { ModelNotFoundError, ModelPersistenceError } from \"~/domain/contentModel/errors.js\";\n\n/**\n * PluginModelsProvider provides access to plugin-defined (code) models.\n */\nexport interface IPluginModelsProvider {\n list(tenant: string): Promise<CmsModel[]>;\n}\n\nexport const PluginModelsProvider =\n createAbstraction<IPluginModelsProvider>(\"PluginModelsProvider\");\n\nexport namespace PluginModelsProvider {\n export type Interface = IPluginModelsProvider;\n}\n\nexport const ModelCache = createAbstraction<ICache<Promise<CmsModel[]>>>(\"ModelCache\");\n\nexport namespace ModelCache {\n export type Interface = ICache<Promise<CmsModel[]>>;\n}\n\n/**\n * ModelsFetcher - Centralized model fetching with caching.\n *\n * This abstraction handles fetching models from both plugins and database,\n * applies access control filtering, and caches the results for optimal performance.\n */\nexport interface IModelsFetcher {\n /**\n * Fetch all accessible models for the current tenant and identity.\n * Results are cached based on tenant + identity.\n */\n fetchAll(): Promise<Result<CmsModel[], ModelsFetcherError>>;\n\n /**\n * Fetch a single model by modelId.\n * Uses the cached fetchAll result.\n */\n fetchById(modelId: string): Promise<Result<CmsModel, ModelsFetcherError>>;\n}\n\nexport interface IModelsFetcherErrors {\n notFound: ModelNotFoundError;\n persistence: ModelPersistenceError;\n}\n\ntype ModelsFetcherError = IModelsFetcherErrors[keyof IModelsFetcherErrors];\n\nexport const ModelsFetcher = createAbstraction<IModelsFetcher>(\"ModelsFetcher\");\n\nexport namespace ModelsFetcher {\n export type Interface = IModelsFetcher;\n export type Error = ModelsFetcherError;\n\n export type FetchAllReturn = Promise<Result<CmsModel[], ModelsFetcherError>>;\n export type FetchByIdReturn = Promise<Result<CmsModel, ModelsFetcherError>>;\n}\n"],"names":["PluginModelsProvider","createAbstraction","ModelCache","ModelsFetcher"],"mappings":";AAYO,MAAMA,uBACTC,kBAAyC;AAMtC,MAAMC,aAAaD,kBAA+C;AAiClE,MAAME,gBAAgBF,kBAAkC"}
1
+ {"version":3,"file":"features/contentModel/shared/abstractions.js","sources":["../../../../src/features/contentModel/shared/abstractions.ts"],"sourcesContent":["import { createAbstraction, Result } from \"@webiny/feature/api\";\nimport type { CmsModel } from \"~/types/index.js\";\nimport type { ICache } from \"~/utils/caching/types.js\";\nimport type { CmsModelPlugin } from \"~/plugins/CmsModelPlugin.js\";\nimport { ModelNotFoundError, ModelPersistenceError } from \"~/domain/contentModel/errors.js\";\n\n/**\n * Multi-instance DI token holding the code-defined CmsModelPlugin instances\n * (previously read from the plugins container via byType). PluginModelsProvider\n * resolves all of these to expose plugin-defined models.\n */\nexport const CmsModelPluginInstance = createAbstraction<CmsModelPlugin>(\"CmsModelPluginInstance\");\n\nexport namespace CmsModelPluginInstance {\n export type Interface = CmsModelPlugin;\n}\n\n/**\n * PluginModelsProvider provides access to plugin-defined (code) models.\n */\nexport interface IPluginModelsProvider {\n list(tenant: string): Promise<CmsModel[]>;\n}\n\nexport const PluginModelsProvider =\n createAbstraction<IPluginModelsProvider>(\"PluginModelsProvider\");\n\nexport namespace PluginModelsProvider {\n export type Interface = IPluginModelsProvider;\n}\n\nexport const ModelCache = createAbstraction<ICache<Promise<CmsModel[]>>>(\"ModelCache\");\n\nexport namespace ModelCache {\n export type Interface = ICache<Promise<CmsModel[]>>;\n}\n\n/**\n * ModelsFetcher - Centralized model fetching with caching.\n *\n * This abstraction handles fetching models from both plugins and database,\n * applies access control filtering, and caches the results for optimal performance.\n */\nexport interface IModelsFetcher {\n /**\n * Fetch all accessible models for the current tenant and identity.\n * Results are cached based on tenant + identity.\n */\n fetchAll(): Promise<Result<CmsModel[], ModelsFetcherError>>;\n\n /**\n * Fetch a single model by modelId.\n * Uses the cached fetchAll result.\n */\n fetchById(modelId: string): Promise<Result<CmsModel, ModelsFetcherError>>;\n}\n\nexport interface IModelsFetcherErrors {\n notFound: ModelNotFoundError;\n persistence: ModelPersistenceError;\n}\n\ntype ModelsFetcherError = IModelsFetcherErrors[keyof IModelsFetcherErrors];\n\nexport const ModelsFetcher = createAbstraction<IModelsFetcher>(\"ModelsFetcher\");\n\nexport namespace ModelsFetcher {\n export type Interface = IModelsFetcher;\n export type Error = ModelsFetcherError;\n\n export type FetchAllReturn = Promise<Result<CmsModel[], ModelsFetcherError>>;\n export type FetchByIdReturn = Promise<Result<CmsModel, ModelsFetcherError>>;\n}\n"],"names":["CmsModelPluginInstance","createAbstraction","PluginModelsProvider","ModelCache","ModelsFetcher"],"mappings":";AAWO,MAAMA,yBAAyBC,kBAAkC;AAajE,MAAMC,uBACTD,kBAAyC;AAMtC,MAAME,aAAaF,kBAA+C;AAiClE,MAAMG,gBAAgBH,kBAAkC"}
@@ -2,8 +2,10 @@ import { Result } from "@webiny/feature/api";
2
2
  import { CreateGroupRepository as RepositoryAbstraction } from "./abstractions.js";
3
3
  import { GroupCache } from "../../../features/contentModelGroup/shared/abstractions.js";
4
4
  import { PluginGroupsProvider } from "../../../features/contentModelGroup/shared/abstractions.js";
5
- import { StorageOperations } from "../../../features/shared/abstractions.js";
5
+ import { ListGroupsStorageOperation } from "../../../features/shared/storageOperations/group/ListGroupsStorageOperation.js";
6
+ import { CreateGroupStorageOperation } from "../../../features/shared/storageOperations/group/CreateGroupStorageOperation.js";
6
7
  import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
8
+ import { StringFormatter } from "@webiny/api-core/features/stringFormatter/index.js";
7
9
  import type { CmsGroup } from "../../../types/index.js";
8
10
  /**
9
11
  * CreateGroupRepository - Validates and persists a new group.
@@ -18,11 +20,15 @@ import type { CmsGroup } from "../../../types/index.js";
18
20
  declare class CreateGroupRepositoryImpl implements RepositoryAbstraction.Interface {
19
21
  private groupCache;
20
22
  private pluginGroupsProvider;
21
- private storageOperations;
23
+ private listGroups;
24
+ private createGroup;
22
25
  private tenantContext;
23
- constructor(groupCache: GroupCache.Interface, pluginGroupsProvider: PluginGroupsProvider.Interface, storageOperations: StorageOperations.Interface, tenantContext: TenantContext.Interface);
26
+ private stringFormatter;
27
+ constructor(groupCache: GroupCache.Interface, pluginGroupsProvider: PluginGroupsProvider.Interface, listGroups: ListGroupsStorageOperation.Interface, createGroup: CreateGroupStorageOperation.Interface, tenantContext: TenantContext.Interface, stringFormatter: StringFormatter.Interface);
24
28
  execute(group: CmsGroup): Promise<Result<void, RepositoryAbstraction.Error>>;
25
29
  private isSlugTaken;
26
30
  }
27
- export declare const CreateGroupRepository: import("@webiny/di").Implementation<typeof CreateGroupRepositoryImpl>;
31
+ export declare const CreateGroupRepository: typeof CreateGroupRepositoryImpl & {
32
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICreateGroupRepository>;
33
+ };
28
34
  export {};
@@ -1,23 +1,26 @@
1
- import { Result, createImplementation } from "@webiny/feature/api";
1
+ import { Result } from "@webiny/feature/api";
2
2
  import { CreateGroupRepository } from "./abstractions.js";
3
3
  import { GroupCache, PluginGroupsProvider } from "../shared/abstractions.js";
4
4
  import { GroupPersistenceError, GroupSlugTakenError } from "../../../domain/contentModelGroup/errors.js";
5
- import { StorageOperations } from "../../shared/abstractions.js";
5
+ import { ListGroupsStorageOperation } from "../../shared/storageOperations/group/ListGroupsStorageOperation.js";
6
+ import { CreateGroupStorageOperation } from "../../shared/storageOperations/group/CreateGroupStorageOperation.js";
6
7
  import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
7
- import { toSlug } from "../../../utils/toSlug.js";
8
+ import { StringFormatter } from "@webiny/api-core/features/stringFormatter/index.js";
8
9
  import { generateAlphaNumericId } from "@webiny/utils";
9
10
  class CreateGroupRepositoryImpl {
10
- constructor(groupCache, pluginGroupsProvider, storageOperations, tenantContext){
11
+ constructor(groupCache, pluginGroupsProvider, listGroups, createGroup, tenantContext, stringFormatter){
11
12
  this.groupCache = groupCache;
12
13
  this.pluginGroupsProvider = pluginGroupsProvider;
13
- this.storageOperations = storageOperations;
14
+ this.listGroups = listGroups;
15
+ this.createGroup = createGroup;
14
16
  this.tenantContext = tenantContext;
17
+ this.stringFormatter = stringFormatter;
15
18
  }
16
19
  async execute(group) {
17
20
  try {
18
21
  const tenant = this.tenantContext.getTenant();
19
22
  if (group.id) {
20
- const existingById = await this.storageOperations.groups.list({
23
+ const existingById = await this.listGroups.execute({
21
24
  where: {
22
25
  tenant: tenant.id,
23
26
  id: group.id
@@ -30,7 +33,7 @@ class CreateGroupRepositoryImpl {
30
33
  const pluginGroups = await this.pluginGroupsProvider.getGroups();
31
34
  const pluginGroupConflict = pluginGroups.find((pg)=>pg.slug === group.slug);
32
35
  if (pluginGroupConflict) return Result.fail(new GroupSlugTakenError(group.slug));
33
- await this.storageOperations.groups.create({
36
+ await this.createGroup.execute({
34
37
  group
35
38
  });
36
39
  this.groupCache.clear();
@@ -41,7 +44,7 @@ class CreateGroupRepositoryImpl {
41
44
  }
42
45
  async isSlugTaken(group, tenant) {
43
46
  if (group.slug && group.slug.trim()) {
44
- const existingBySlug = await this.storageOperations.groups.list({
47
+ const existingBySlug = await this.listGroups.execute({
45
48
  where: {
46
49
  tenant,
47
50
  slug: group.slug
@@ -49,8 +52,8 @@ class CreateGroupRepositoryImpl {
49
52
  });
50
53
  return existingBySlug.length > 0;
51
54
  }
52
- const baseSlug = toSlug(group.name);
53
- const existingBySlug = await this.storageOperations.groups.list({
55
+ const baseSlug = this.stringFormatter.slugify(group.name);
56
+ const existingBySlug = await this.listGroups.execute({
54
57
  where: {
55
58
  tenant,
56
59
  slug: baseSlug
@@ -61,14 +64,15 @@ class CreateGroupRepositoryImpl {
61
64
  return false;
62
65
  }
63
66
  }
64
- const CreateGroupRepository_CreateGroupRepository = createImplementation({
65
- abstraction: CreateGroupRepository,
67
+ const CreateGroupRepository_CreateGroupRepository = CreateGroupRepository.createImplementation({
66
68
  implementation: CreateGroupRepositoryImpl,
67
69
  dependencies: [
68
70
  GroupCache,
69
71
  PluginGroupsProvider,
70
- StorageOperations,
71
- TenantContext
72
+ ListGroupsStorageOperation,
73
+ CreateGroupStorageOperation,
74
+ TenantContext,
75
+ StringFormatter
72
76
  ]
73
77
  });
74
78
  export { CreateGroupRepository_CreateGroupRepository as CreateGroupRepository };
@@ -1 +1 @@
1
- {"version":3,"file":"features/contentModelGroup/CreateGroup/CreateGroupRepository.js","sources":["../../../../src/features/contentModelGroup/CreateGroup/CreateGroupRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { createImplementation } from \"@webiny/feature/api\";\nimport { CreateGroupRepository as RepositoryAbstraction } from \"./abstractions.js\";\nimport { GroupCache } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { PluginGroupsProvider } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { GroupSlugTakenError } from \"~/domain/contentModelGroup/errors.js\";\nimport { GroupPersistenceError } from \"~/domain/contentModelGroup/errors.js\";\nimport { StorageOperations } from \"~/features/shared/abstractions.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { toSlug } from \"~/utils/toSlug.js\";\nimport { generateAlphaNumericId } from \"@webiny/utils\";\nimport type { CmsGroup } from \"~/types/index.js\";\n\n/**\n * CreateGroupRepository - Validates and persists a new group.\n *\n * Responsibilities:\n * - Validate ID uniqueness (if provided)\n * - Validate slug uniqueness (or generate unique slug)\n * - Check for plugin group conflicts\n * - Persist to storage\n * - Clear GroupCache after successful create\n */\nclass CreateGroupRepositoryImpl implements RepositoryAbstraction.Interface {\n public constructor(\n private groupCache: GroupCache.Interface,\n private pluginGroupsProvider: PluginGroupsProvider.Interface,\n private storageOperations: StorageOperations.Interface,\n private tenantContext: TenantContext.Interface\n ) {}\n\n async execute(group: CmsGroup): Promise<Result<void, RepositoryAbstraction.Error>> {\n try {\n const tenant = this.tenantContext.getTenant();\n\n // 1. Validate ID uniqueness (if provided)\n if (group.id) {\n const existingById = await this.storageOperations.groups.list({\n where: {\n tenant: tenant.id,\n id: group.id\n }\n });\n\n if (existingById.length > 0) {\n return Result.fail(new GroupSlugTakenError(group.slug));\n }\n }\n\n // 2. Generate or validate slug\n const slugTaken = await this.isSlugTaken(group, tenant.id);\n if (slugTaken) {\n return Result.fail(new GroupSlugTakenError(group.slug));\n }\n\n // 3. Check for plugin group conflicts\n const pluginGroups = await this.pluginGroupsProvider.getGroups();\n const pluginGroupConflict = pluginGroups.find(pg => pg.slug === group.slug);\n if (pluginGroupConflict) {\n return Result.fail(new GroupSlugTakenError(group.slug));\n }\n\n // 4. Persist to storage\n await this.storageOperations.groups.create({ group });\n\n // 5. Clear cache\n this.groupCache.clear();\n\n return Result.ok();\n } catch (error) {\n return Result.fail(new GroupPersistenceError(error as Error));\n }\n }\n\n private async isSlugTaken(group: CmsGroup, tenant: string): Promise<boolean> {\n // If slug is provided and not empty, validate it\n if (group.slug && group.slug.trim()) {\n const existingBySlug = await this.storageOperations.groups.list({\n where: {\n tenant,\n slug: group.slug\n }\n });\n\n return existingBySlug.length > 0;\n }\n\n // Generate slug from name\n const baseSlug = toSlug(group.name);\n const existingBySlug = await this.storageOperations.groups.list({\n where: {\n tenant,\n slug: baseSlug\n }\n });\n\n if (existingBySlug.length === 0) {\n // No conflict, use base slug\n group.slug = baseSlug;\n } else {\n // Conflict, append random suffix\n group.slug = `${baseSlug}-${generateAlphaNumericId(8)}`;\n }\n\n return false;\n }\n}\n\nexport const CreateGroupRepository = createImplementation({\n abstraction: RepositoryAbstraction,\n implementation: CreateGroupRepositoryImpl,\n dependencies: [GroupCache, PluginGroupsProvider, StorageOperations, TenantContext]\n});\n"],"names":["CreateGroupRepositoryImpl","groupCache","pluginGroupsProvider","storageOperations","tenantContext","group","tenant","existingById","Result","GroupSlugTakenError","slugTaken","pluginGroups","pluginGroupConflict","pg","error","GroupPersistenceError","existingBySlug","baseSlug","toSlug","generateAlphaNumericId","CreateGroupRepository","createImplementation","RepositoryAbstraction","GroupCache","PluginGroupsProvider","StorageOperations","TenantContext"],"mappings":";;;;;;;;AAuBA,MAAMA;IACF,YACYC,UAAgC,EAChCC,oBAAoD,EACpDC,iBAA8C,EAC9CC,aAAsC,CAChD;aAJUH,UAAU,GAAVA;aACAC,oBAAoB,GAApBA;aACAC,iBAAiB,GAAjBA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,KAAe,EAAsD;QAC/E,IAAI;YACA,MAAMC,SAAS,IAAI,CAAC,aAAa,CAAC,SAAS;YAG3C,IAAID,MAAM,EAAE,EAAE;gBACV,MAAME,eAAe,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC;oBAC1D,OAAO;wBACH,QAAQD,OAAO,EAAE;wBACjB,IAAID,MAAM,EAAE;oBAChB;gBACJ;gBAEA,IAAIE,aAAa,MAAM,GAAG,GACtB,OAAOC,OAAO,IAAI,CAAC,IAAIC,oBAAoBJ,MAAM,IAAI;YAE7D;YAGA,MAAMK,YAAY,MAAM,IAAI,CAAC,WAAW,CAACL,OAAOC,OAAO,EAAE;YACzD,IAAII,WACA,OAAOF,OAAO,IAAI,CAAC,IAAIC,oBAAoBJ,MAAM,IAAI;YAIzD,MAAMM,eAAe,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS;YAC9D,MAAMC,sBAAsBD,aAAa,IAAI,CAACE,CAAAA,KAAMA,GAAG,IAAI,KAAKR,MAAM,IAAI;YAC1E,IAAIO,qBACA,OAAOJ,OAAO,IAAI,CAAC,IAAIC,oBAAoBJ,MAAM,IAAI;YAIzD,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC;gBAAEA;YAAM;YAGnD,IAAI,CAAC,UAAU,CAAC,KAAK;YAErB,OAAOG,OAAO,EAAE;QACpB,EAAE,OAAOM,OAAO;YACZ,OAAON,OAAO,IAAI,CAAC,IAAIO,sBAAsBD;QACjD;IACJ;IAEA,MAAc,YAAYT,KAAe,EAAEC,MAAc,EAAoB;QAEzE,IAAID,MAAM,IAAI,IAAIA,MAAM,IAAI,CAAC,IAAI,IAAI;YACjC,MAAMW,iBAAiB,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC;gBAC5D,OAAO;oBACHV;oBACA,MAAMD,MAAM,IAAI;gBACpB;YACJ;YAEA,OAAOW,eAAe,MAAM,GAAG;QACnC;QAGA,MAAMC,WAAWC,OAAOb,MAAM,IAAI;QAClC,MAAMW,iBAAiB,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC;YAC5D,OAAO;gBACHV;gBACA,MAAMW;YACV;QACJ;QAEA,IAAID,AAA0B,MAA1BA,eAAe,MAAM,EAErBX,MAAM,IAAI,GAAGY;aAGbZ,MAAM,IAAI,GAAG,GAAGY,SAAS,CAAC,EAAEE,uBAAuB,IAAI;QAG3D,OAAO;IACX;AACJ;AAEO,MAAMC,8CAAwBC,qBAAqB;IACtD,aAAaC;IACb,gBAAgBtB;IAChB,cAAc;QAACuB;QAAYC;QAAsBC;QAAmBC;KAAc;AACtF"}
1
+ {"version":3,"file":"features/contentModelGroup/CreateGroup/CreateGroupRepository.js","sources":["../../../../src/features/contentModelGroup/CreateGroup/CreateGroupRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { CreateGroupRepository as RepositoryAbstraction } from \"./abstractions.js\";\nimport { GroupCache } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { PluginGroupsProvider } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { GroupSlugTakenError } from \"~/domain/contentModelGroup/errors.js\";\nimport { GroupPersistenceError } from \"~/domain/contentModelGroup/errors.js\";\nimport { ListGroupsStorageOperation } from \"~/features/shared/storageOperations/group/ListGroupsStorageOperation.js\";\nimport { CreateGroupStorageOperation } from \"~/features/shared/storageOperations/group/CreateGroupStorageOperation.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { StringFormatter } from \"@webiny/api-core/features/stringFormatter/index.js\";\nimport { generateAlphaNumericId } from \"@webiny/utils\";\nimport type { CmsGroup } from \"~/types/index.js\";\n\n/**\n * CreateGroupRepository - Validates and persists a new group.\n *\n * Responsibilities:\n * - Validate ID uniqueness (if provided)\n * - Validate slug uniqueness (or generate unique slug)\n * - Check for plugin group conflicts\n * - Persist to storage\n * - Clear GroupCache after successful create\n */\nclass CreateGroupRepositoryImpl implements RepositoryAbstraction.Interface {\n public constructor(\n private groupCache: GroupCache.Interface,\n private pluginGroupsProvider: PluginGroupsProvider.Interface,\n private listGroups: ListGroupsStorageOperation.Interface,\n private createGroup: CreateGroupStorageOperation.Interface,\n private tenantContext: TenantContext.Interface,\n private stringFormatter: StringFormatter.Interface\n ) {}\n\n async execute(group: CmsGroup): Promise<Result<void, RepositoryAbstraction.Error>> {\n try {\n const tenant = this.tenantContext.getTenant();\n\n // 1. Validate ID uniqueness (if provided)\n if (group.id) {\n const existingById = await this.listGroups.execute({\n where: {\n tenant: tenant.id,\n id: group.id\n }\n });\n\n if (existingById.length > 0) {\n return Result.fail(new GroupSlugTakenError(group.slug));\n }\n }\n\n // 2. Generate or validate slug\n const slugTaken = await this.isSlugTaken(group, tenant.id);\n if (slugTaken) {\n return Result.fail(new GroupSlugTakenError(group.slug));\n }\n\n // 3. Check for plugin group conflicts\n const pluginGroups = await this.pluginGroupsProvider.getGroups();\n const pluginGroupConflict = pluginGroups.find(pg => pg.slug === group.slug);\n if (pluginGroupConflict) {\n return Result.fail(new GroupSlugTakenError(group.slug));\n }\n\n // 4. Persist to storage\n await this.createGroup.execute({ group });\n\n // 5. Clear cache\n this.groupCache.clear();\n\n return Result.ok();\n } catch (error) {\n return Result.fail(new GroupPersistenceError(error as Error));\n }\n }\n\n private async isSlugTaken(group: CmsGroup, tenant: string): Promise<boolean> {\n // If slug is provided and not empty, validate it\n if (group.slug && group.slug.trim()) {\n const existingBySlug = await this.listGroups.execute({\n where: {\n tenant,\n slug: group.slug\n }\n });\n\n return existingBySlug.length > 0;\n }\n\n // Generate slug from name\n const baseSlug = this.stringFormatter.slugify(group.name);\n const existingBySlug = await this.listGroups.execute({\n where: {\n tenant,\n slug: baseSlug\n }\n });\n\n if (existingBySlug.length === 0) {\n // No conflict, use base slug\n group.slug = baseSlug;\n } else {\n // Conflict, append random suffix\n group.slug = `${baseSlug}-${generateAlphaNumericId(8)}`;\n }\n\n return false;\n }\n}\n\nexport const CreateGroupRepository = RepositoryAbstraction.createImplementation({\n implementation: CreateGroupRepositoryImpl,\n dependencies: [\n GroupCache,\n PluginGroupsProvider,\n ListGroupsStorageOperation,\n CreateGroupStorageOperation,\n TenantContext,\n StringFormatter\n ]\n});\n"],"names":["CreateGroupRepositoryImpl","groupCache","pluginGroupsProvider","listGroups","createGroup","tenantContext","stringFormatter","group","tenant","existingById","Result","GroupSlugTakenError","slugTaken","pluginGroups","pluginGroupConflict","pg","error","GroupPersistenceError","existingBySlug","baseSlug","generateAlphaNumericId","CreateGroupRepository","RepositoryAbstraction","GroupCache","PluginGroupsProvider","ListGroupsStorageOperation","CreateGroupStorageOperation","TenantContext","StringFormatter"],"mappings":";;;;;;;;;AAuBA,MAAMA;IACF,YACYC,UAAgC,EAChCC,oBAAoD,EACpDC,UAAgD,EAChDC,WAAkD,EAClDC,aAAsC,EACtCC,eAA0C,CACpD;aANUL,UAAU,GAAVA;aACAC,oBAAoB,GAApBA;aACAC,UAAU,GAAVA;aACAC,WAAW,GAAXA;aACAC,aAAa,GAAbA;aACAC,eAAe,GAAfA;IACT;IAEH,MAAM,QAAQC,KAAe,EAAsD;QAC/E,IAAI;YACA,MAAMC,SAAS,IAAI,CAAC,aAAa,CAAC,SAAS;YAG3C,IAAID,MAAM,EAAE,EAAE;gBACV,MAAME,eAAe,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;oBAC/C,OAAO;wBACH,QAAQD,OAAO,EAAE;wBACjB,IAAID,MAAM,EAAE;oBAChB;gBACJ;gBAEA,IAAIE,aAAa,MAAM,GAAG,GACtB,OAAOC,OAAO,IAAI,CAAC,IAAIC,oBAAoBJ,MAAM,IAAI;YAE7D;YAGA,MAAMK,YAAY,MAAM,IAAI,CAAC,WAAW,CAACL,OAAOC,OAAO,EAAE;YACzD,IAAII,WACA,OAAOF,OAAO,IAAI,CAAC,IAAIC,oBAAoBJ,MAAM,IAAI;YAIzD,MAAMM,eAAe,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS;YAC9D,MAAMC,sBAAsBD,aAAa,IAAI,CAACE,CAAAA,KAAMA,GAAG,IAAI,KAAKR,MAAM,IAAI;YAC1E,IAAIO,qBACA,OAAOJ,OAAO,IAAI,CAAC,IAAIC,oBAAoBJ,MAAM,IAAI;YAIzD,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;gBAAEA;YAAM;YAGvC,IAAI,CAAC,UAAU,CAAC,KAAK;YAErB,OAAOG,OAAO,EAAE;QACpB,EAAE,OAAOM,OAAO;YACZ,OAAON,OAAO,IAAI,CAAC,IAAIO,sBAAsBD;QACjD;IACJ;IAEA,MAAc,YAAYT,KAAe,EAAEC,MAAc,EAAoB;QAEzE,IAAID,MAAM,IAAI,IAAIA,MAAM,IAAI,CAAC,IAAI,IAAI;YACjC,MAAMW,iBAAiB,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;gBACjD,OAAO;oBACHV;oBACA,MAAMD,MAAM,IAAI;gBACpB;YACJ;YAEA,OAAOW,eAAe,MAAM,GAAG;QACnC;QAGA,MAAMC,WAAW,IAAI,CAAC,eAAe,CAAC,OAAO,CAACZ,MAAM,IAAI;QACxD,MAAMW,iBAAiB,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACjD,OAAO;gBACHV;gBACA,MAAMW;YACV;QACJ;QAEA,IAAID,AAA0B,MAA1BA,eAAe,MAAM,EAErBX,MAAM,IAAI,GAAGY;aAGbZ,MAAM,IAAI,GAAG,GAAGY,SAAS,CAAC,EAAEC,uBAAuB,IAAI;QAG3D,OAAO;IACX;AACJ;AAEO,MAAMC,8CAAwBC,sBAAAA,oBAA0C,CAAC;IAC5E,gBAAgBtB;IAChB,cAAc;QACVuB;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
@@ -29,5 +29,7 @@ declare class CreateGroupUseCaseImpl implements UseCaseAbstraction.Interface {
29
29
  constructor(eventPublisher: EventPublisher.Interface, repository: CreateGroupRepository.Interface, accessControl: AccessControl.Interface, tenantContext: TenantContext.Interface, identityContext: IdentityContext.Interface, cmsContext: CmsContext.Interface);
30
30
  execute(input: CmsGroupCreateInput): Promise<Result<CmsGroup, UseCaseAbstraction.Error>>;
31
31
  }
32
- export declare const CreateGroupUseCase: import("@webiny/di").Implementation<typeof CreateGroupUseCaseImpl>;
32
+ export declare const CreateGroupUseCase: typeof CreateGroupUseCaseImpl & {
33
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICreateGroupUseCase>;
34
+ };
33
35
  export {};
@@ -1,4 +1,4 @@
1
- import { Result, createImplementation } from "@webiny/feature/api";
1
+ import { Result } from "@webiny/feature/api";
2
2
  import { CreateGroupRepository, CreateGroupUseCase } from "./abstractions.js";
3
3
  import { EventPublisher } from "@webiny/api-core/features/eventPublisher/index.js";
4
4
  import { GroupAfterCreateEvent, GroupBeforeCreateEventEvent, GroupCreateErrorEvent } from "./events.js";
@@ -75,8 +75,7 @@ class CreateGroupUseCaseImpl {
75
75
  }
76
76
  }
77
77
  }
78
- const CreateGroupUseCase_CreateGroupUseCase = createImplementation({
79
- abstraction: CreateGroupUseCase,
78
+ const CreateGroupUseCase_CreateGroupUseCase = CreateGroupUseCase.createImplementation({
80
79
  implementation: CreateGroupUseCaseImpl,
81
80
  dependencies: [
82
81
  EventPublisher,
@@ -1 +1 @@
1
- {"version":3,"file":"features/contentModelGroup/CreateGroup/CreateGroupUseCase.js","sources":["../../../../src/features/contentModelGroup/CreateGroup/CreateGroupUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { createImplementation } from \"@webiny/feature/api\";\nimport { CreateGroupUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { CreateGroupRepository } from \"./abstractions.js\";\nimport { EventPublisher } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { GroupBeforeCreateEventEvent } from \"./events.js\";\nimport { GroupAfterCreateEvent } from \"./events.js\";\nimport { GroupCreateErrorEvent } from \"./events.js\";\nimport { AccessControl } from \"~/features/shared/abstractions.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { CmsContext } from \"~/features/shared/abstractions.js\";\nimport {\n GroupNotAuthorizedError,\n GroupValidationError\n} from \"~/domain/contentModelGroup/errors.js\";\nimport { createZodError } from \"@webiny/utils\";\nimport { mdbid } from \"@webiny/utils\";\nimport { createGroupCreateValidation } from \"~/domain/contentModelGroup/validation.js\";\nimport type { CmsGroup } from \"~/types/index.js\";\nimport type { CmsGroupCreateInput } from \"~/types/index.js\";\n\n/**\n * CreateGroupUseCase - Orchestrates group creation.\n *\n * Responsibilities:\n * - Validate input (Zod)\n * - Create domain group object\n * - Access control checks\n * - Publish before event\n * - Delegate to repository\n * - Publish after event or error event\n */\nclass CreateGroupUseCaseImpl implements UseCaseAbstraction.Interface {\n public constructor(\n private eventPublisher: EventPublisher.Interface,\n private repository: CreateGroupRepository.Interface,\n private accessControl: AccessControl.Interface,\n private tenantContext: TenantContext.Interface,\n private identityContext: IdentityContext.Interface,\n private cmsContext: CmsContext.Interface\n ) {}\n\n async execute(input: CmsGroupCreateInput): Promise<Result<CmsGroup, UseCaseAbstraction.Error>> {\n // Initial access control check\n const canAccess = await this.accessControl.canAccessGroup({ rwd: \"w\" });\n if (!canAccess) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n // Validate input\n const validationResult = await createGroupCreateValidation().safeParseAsync(input);\n if (!validationResult.success) {\n const zodError = createZodError(validationResult.error);\n return Result.fail(\n new GroupValidationError(zodError.message, zodError.data!.invalidFields)\n );\n }\n const data = validationResult.data;\n\n // Create domain group object\n const identity = this.identityContext.getIdentity();\n const tenant = this.tenantContext.getTenant();\n\n const id = data.id || mdbid();\n const group: CmsGroup = {\n ...data,\n id,\n tenant: tenant.id,\n createdOn: new Date().toISOString(),\n savedOn: new Date().toISOString(),\n createdBy: {\n id: identity.id,\n displayName: identity.displayName,\n type: identity.type\n }\n };\n\n // Access control check on created group\n const canAccessGroup = await this.accessControl.canAccessGroup({ group, rwd: \"w\" });\n if (!canAccessGroup) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n try {\n // Publish before event\n await this.eventPublisher.publish(new GroupBeforeCreateEventEvent({ group }));\n\n // Persist via repository\n const result = await this.repository.execute(group);\n if (result.isFail()) {\n // Publish error event\n await this.eventPublisher.publish(\n new GroupCreateErrorEvent({\n input,\n group,\n error: result.error\n })\n );\n return Result.fail(result.error);\n }\n\n // Publish after event\n await this.eventPublisher.publish(new GroupAfterCreateEvent({ group }));\n\n return Result.ok(group);\n } catch (error) {\n // Publish error event for unexpected errors\n await this.eventPublisher.publish(\n new GroupCreateErrorEvent({\n input,\n group,\n error: error as Error\n })\n );\n return Result.fail(error as UseCaseAbstraction.Error);\n }\n }\n}\n\nexport const CreateGroupUseCase = createImplementation({\n abstraction: UseCaseAbstraction,\n implementation: CreateGroupUseCaseImpl,\n dependencies: [\n EventPublisher,\n CreateGroupRepository,\n AccessControl,\n TenantContext,\n IdentityContext,\n CmsContext\n ]\n});\n"],"names":["CreateGroupUseCaseImpl","eventPublisher","repository","accessControl","tenantContext","identityContext","cmsContext","input","canAccess","Result","GroupNotAuthorizedError","validationResult","createGroupCreateValidation","zodError","createZodError","GroupValidationError","data","identity","tenant","id","mdbid","group","Date","canAccessGroup","GroupBeforeCreateEventEvent","result","GroupCreateErrorEvent","GroupAfterCreateEvent","error","CreateGroupUseCase","createImplementation","UseCaseAbstraction","EventPublisher","CreateGroupRepository","AccessControl","TenantContext","IdentityContext","CmsContext"],"mappings":";;;;;;;;;;AAiCA,MAAMA;IACF,YACYC,cAAwC,EACxCC,UAA2C,EAC3CC,aAAsC,EACtCC,aAAsC,EACtCC,eAA0C,EAC1CC,UAAgC,CAC1C;aANUL,cAAc,GAAdA;aACAC,UAAU,GAAVA;aACAC,aAAa,GAAbA;aACAC,aAAa,GAAbA;aACAC,eAAe,GAAfA;aACAC,UAAU,GAAVA;IACT;IAEH,MAAM,QAAQC,KAA0B,EAAuD;QAE3F,MAAMC,YAAY,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;YAAE,KAAK;QAAI;QACrE,IAAI,CAACA,WACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAI3B,MAAMC,mBAAmB,MAAMC,8BAA8B,cAAc,CAACL;QAC5E,IAAI,CAACI,iBAAiB,OAAO,EAAE;YAC3B,MAAME,WAAWC,eAAeH,iBAAiB,KAAK;YACtD,OAAOF,OAAO,IAAI,CACd,IAAIM,qBAAqBF,SAAS,OAAO,EAAEA,SAAS,IAAI,CAAE,aAAa;QAE/E;QACA,MAAMG,OAAOL,iBAAiB,IAAI;QAGlC,MAAMM,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;QACjD,MAAMC,SAAS,IAAI,CAAC,aAAa,CAAC,SAAS;QAE3C,MAAMC,KAAKH,KAAK,EAAE,IAAII;QACtB,MAAMC,QAAkB;YACpB,GAAGL,IAAI;YACPG;YACA,QAAQD,OAAO,EAAE;YACjB,WAAW,IAAII,OAAO,WAAW;YACjC,SAAS,IAAIA,OAAO,WAAW;YAC/B,WAAW;gBACP,IAAIL,SAAS,EAAE;gBACf,aAAaA,SAAS,WAAW;gBACjC,MAAMA,SAAS,IAAI;YACvB;QACJ;QAGA,MAAMM,iBAAiB,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;YAAEF;YAAO,KAAK;QAAI;QACjF,IAAI,CAACE,gBACD,OAAOd,OAAO,IAAI,CAAC,IAAIC;QAG3B,IAAI;YAEA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAIc,4BAA4B;gBAAEH;YAAM;YAG1E,MAAMI,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACJ;YAC7C,IAAII,OAAO,MAAM,IAAI;gBAEjB,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIC,sBAAsB;oBACtBnB;oBACAc;oBACA,OAAOI,OAAO,KAAK;gBACvB;gBAEJ,OAAOhB,OAAO,IAAI,CAACgB,OAAO,KAAK;YACnC;YAGA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAIE,sBAAsB;gBAAEN;YAAM;YAEpE,OAAOZ,OAAO,EAAE,CAACY;QACrB,EAAE,OAAOO,OAAO;YAEZ,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIF,sBAAsB;gBACtBnB;gBACAc;gBACA,OAAOO;YACX;YAEJ,OAAOnB,OAAO,IAAI,CAACmB;QACvB;IACJ;AACJ;AAEO,MAAMC,wCAAqBC,qBAAqB;IACnD,aAAaC;IACb,gBAAgB/B;IAChB,cAAc;QACVgC;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
1
+ {"version":3,"file":"features/contentModelGroup/CreateGroup/CreateGroupUseCase.js","sources":["../../../../src/features/contentModelGroup/CreateGroup/CreateGroupUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { CreateGroupUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { CreateGroupRepository } from \"./abstractions.js\";\nimport { EventPublisher } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { GroupBeforeCreateEventEvent } from \"./events.js\";\nimport { GroupAfterCreateEvent } from \"./events.js\";\nimport { GroupCreateErrorEvent } from \"./events.js\";\nimport { AccessControl } from \"~/features/shared/abstractions.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { CmsContext } from \"~/features/shared/abstractions.js\";\nimport {\n GroupNotAuthorizedError,\n GroupValidationError\n} from \"~/domain/contentModelGroup/errors.js\";\nimport { createZodError } from \"@webiny/utils\";\nimport { mdbid } from \"@webiny/utils\";\nimport { createGroupCreateValidation } from \"~/domain/contentModelGroup/validation.js\";\nimport type { CmsGroup } from \"~/types/index.js\";\nimport type { CmsGroupCreateInput } from \"~/types/index.js\";\n\n/**\n * CreateGroupUseCase - Orchestrates group creation.\n *\n * Responsibilities:\n * - Validate input (Zod)\n * - Create domain group object\n * - Access control checks\n * - Publish before event\n * - Delegate to repository\n * - Publish after event or error event\n */\nclass CreateGroupUseCaseImpl implements UseCaseAbstraction.Interface {\n public constructor(\n private eventPublisher: EventPublisher.Interface,\n private repository: CreateGroupRepository.Interface,\n private accessControl: AccessControl.Interface,\n private tenantContext: TenantContext.Interface,\n private identityContext: IdentityContext.Interface,\n private cmsContext: CmsContext.Interface\n ) {}\n\n async execute(input: CmsGroupCreateInput): Promise<Result<CmsGroup, UseCaseAbstraction.Error>> {\n // Initial access control check\n const canAccess = await this.accessControl.canAccessGroup({ rwd: \"w\" });\n if (!canAccess) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n // Validate input\n const validationResult = await createGroupCreateValidation().safeParseAsync(input);\n if (!validationResult.success) {\n const zodError = createZodError(validationResult.error);\n return Result.fail(\n new GroupValidationError(zodError.message, zodError.data!.invalidFields)\n );\n }\n const data = validationResult.data;\n\n // Create domain group object\n const identity = this.identityContext.getIdentity();\n const tenant = this.tenantContext.getTenant();\n\n const id = data.id || mdbid();\n const group: CmsGroup = {\n ...data,\n id,\n tenant: tenant.id,\n createdOn: new Date().toISOString(),\n savedOn: new Date().toISOString(),\n createdBy: {\n id: identity.id,\n displayName: identity.displayName,\n type: identity.type\n }\n };\n\n // Access control check on created group\n const canAccessGroup = await this.accessControl.canAccessGroup({ group, rwd: \"w\" });\n if (!canAccessGroup) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n try {\n // Publish before event\n await this.eventPublisher.publish(new GroupBeforeCreateEventEvent({ group }));\n\n // Persist via repository\n const result = await this.repository.execute(group);\n if (result.isFail()) {\n // Publish error event\n await this.eventPublisher.publish(\n new GroupCreateErrorEvent({\n input,\n group,\n error: result.error\n })\n );\n return Result.fail(result.error);\n }\n\n // Publish after event\n await this.eventPublisher.publish(new GroupAfterCreateEvent({ group }));\n\n return Result.ok(group);\n } catch (error) {\n // Publish error event for unexpected errors\n await this.eventPublisher.publish(\n new GroupCreateErrorEvent({\n input,\n group,\n error: error as Error\n })\n );\n return Result.fail(error as UseCaseAbstraction.Error);\n }\n }\n}\n\nexport const CreateGroupUseCase = UseCaseAbstraction.createImplementation({\n implementation: CreateGroupUseCaseImpl,\n dependencies: [\n EventPublisher,\n CreateGroupRepository,\n AccessControl,\n TenantContext,\n IdentityContext,\n CmsContext\n ]\n});\n"],"names":["CreateGroupUseCaseImpl","eventPublisher","repository","accessControl","tenantContext","identityContext","cmsContext","input","canAccess","Result","GroupNotAuthorizedError","validationResult","createGroupCreateValidation","zodError","createZodError","GroupValidationError","data","identity","tenant","id","mdbid","group","Date","canAccessGroup","GroupBeforeCreateEventEvent","result","GroupCreateErrorEvent","GroupAfterCreateEvent","error","CreateGroupUseCase","UseCaseAbstraction","EventPublisher","CreateGroupRepository","AccessControl","TenantContext","IdentityContext","CmsContext"],"mappings":";;;;;;;;;;AAgCA,MAAMA;IACF,YACYC,cAAwC,EACxCC,UAA2C,EAC3CC,aAAsC,EACtCC,aAAsC,EACtCC,eAA0C,EAC1CC,UAAgC,CAC1C;aANUL,cAAc,GAAdA;aACAC,UAAU,GAAVA;aACAC,aAAa,GAAbA;aACAC,aAAa,GAAbA;aACAC,eAAe,GAAfA;aACAC,UAAU,GAAVA;IACT;IAEH,MAAM,QAAQC,KAA0B,EAAuD;QAE3F,MAAMC,YAAY,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;YAAE,KAAK;QAAI;QACrE,IAAI,CAACA,WACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAI3B,MAAMC,mBAAmB,MAAMC,8BAA8B,cAAc,CAACL;QAC5E,IAAI,CAACI,iBAAiB,OAAO,EAAE;YAC3B,MAAME,WAAWC,eAAeH,iBAAiB,KAAK;YACtD,OAAOF,OAAO,IAAI,CACd,IAAIM,qBAAqBF,SAAS,OAAO,EAAEA,SAAS,IAAI,CAAE,aAAa;QAE/E;QACA,MAAMG,OAAOL,iBAAiB,IAAI;QAGlC,MAAMM,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;QACjD,MAAMC,SAAS,IAAI,CAAC,aAAa,CAAC,SAAS;QAE3C,MAAMC,KAAKH,KAAK,EAAE,IAAII;QACtB,MAAMC,QAAkB;YACpB,GAAGL,IAAI;YACPG;YACA,QAAQD,OAAO,EAAE;YACjB,WAAW,IAAII,OAAO,WAAW;YACjC,SAAS,IAAIA,OAAO,WAAW;YAC/B,WAAW;gBACP,IAAIL,SAAS,EAAE;gBACf,aAAaA,SAAS,WAAW;gBACjC,MAAMA,SAAS,IAAI;YACvB;QACJ;QAGA,MAAMM,iBAAiB,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;YAAEF;YAAO,KAAK;QAAI;QACjF,IAAI,CAACE,gBACD,OAAOd,OAAO,IAAI,CAAC,IAAIC;QAG3B,IAAI;YAEA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAIc,4BAA4B;gBAAEH;YAAM;YAG1E,MAAMI,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACJ;YAC7C,IAAII,OAAO,MAAM,IAAI;gBAEjB,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIC,sBAAsB;oBACtBnB;oBACAc;oBACA,OAAOI,OAAO,KAAK;gBACvB;gBAEJ,OAAOhB,OAAO,IAAI,CAACgB,OAAO,KAAK;YACnC;YAGA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAIE,sBAAsB;gBAAEN;YAAM;YAEpE,OAAOZ,OAAO,EAAE,CAACY;QACrB,EAAE,OAAOO,OAAO;YAEZ,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIF,sBAAsB;gBACtBnB;gBACAc;gBACA,OAAOO;YACX;YAEJ,OAAOnB,OAAO,IAAI,CAACmB;QACvB;IACJ;AACJ;AAEO,MAAMC,wCAAqBC,mBAAAA,oBAAuC,CAAC;IACtE,gBAAgB9B;IAChB,cAAc;QACV+B;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
@@ -2,8 +2,10 @@ import { Result } from "@webiny/feature/api";
2
2
  import { DeleteGroupRepository as RepositoryAbstraction } from "./abstractions.js";
3
3
  import { GroupCache } from "../../../features/contentModelGroup/shared/abstractions.js";
4
4
  import { PluginGroupsProvider } from "../../../features/contentModelGroup/shared/abstractions.js";
5
- import { StorageOperations } from "../../../features/shared/abstractions.js";
5
+ import { DeleteGroupStorageOperation } from "../../../features/shared/storageOperations/group/DeleteGroupStorageOperation.js";
6
+ import { ListModelsStorageOperation } from "../../../features/shared/storageOperations/model/ListModelsStorageOperation.js";
6
7
  import type { CmsGroup } from "../../../types/index.js";
8
+ import { RuntimeTenant } from "../../../features/runtimeTenant/abstractions.js";
7
9
  /**
8
10
  * DeleteGroupRepository - Validates and performs group deletion.
9
11
  *
@@ -16,9 +18,13 @@ import type { CmsGroup } from "../../../types/index.js";
16
18
  declare class DeleteGroupRepositoryImpl implements RepositoryAbstraction.Interface {
17
19
  private groupCache;
18
20
  private pluginGroupsProvider;
19
- private storageOperations;
20
- constructor(groupCache: GroupCache.Interface, pluginGroupsProvider: PluginGroupsProvider.Interface, storageOperations: StorageOperations.Interface);
21
- execute(group: CmsGroup): Promise<Result<void, RepositoryAbstraction.Error>>;
21
+ private deleteGroup;
22
+ private listModels;
23
+ private runtimeTenant;
24
+ constructor(groupCache: GroupCache.Interface, pluginGroupsProvider: PluginGroupsProvider.Interface, deleteGroup: DeleteGroupStorageOperation.Interface, listModels: ListModelsStorageOperation.Interface, runtimeTenant: RuntimeTenant.Interface);
25
+ execute(initialGroup: CmsGroup): Promise<Result<void, RepositoryAbstraction.Error>>;
22
26
  }
23
- export declare const DeleteGroupRepository: import("@webiny/di").Implementation<typeof DeleteGroupRepositoryImpl>;
27
+ export declare const DeleteGroupRepository: typeof DeleteGroupRepositoryImpl & {
28
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IDeleteGroupRepository>;
29
+ };
24
30
  export {};
@@ -1,27 +1,32 @@
1
- import { Result, createImplementation } from "@webiny/feature/api";
1
+ import { Result } from "@webiny/feature/api";
2
2
  import { DeleteGroupRepository } from "./abstractions.js";
3
3
  import { GroupCache, PluginGroupsProvider } from "../shared/abstractions.js";
4
4
  import { GroupCannotDeleteCodeDefinedError, GroupHasModelsError, GroupPersistenceError } from "../../../domain/contentModelGroup/errors.js";
5
- import { StorageOperations } from "../../shared/abstractions.js";
5
+ import { DeleteGroupStorageOperation } from "../../shared/storageOperations/group/DeleteGroupStorageOperation.js";
6
+ import { ListModelsStorageOperation } from "../../shared/storageOperations/model/ListModelsStorageOperation.js";
7
+ import { RuntimeTenant } from "../../runtimeTenant/abstractions.js";
6
8
  class DeleteGroupRepositoryImpl {
7
- constructor(groupCache, pluginGroupsProvider, storageOperations){
9
+ constructor(groupCache, pluginGroupsProvider, deleteGroup, listModels, runtimeTenant){
8
10
  this.groupCache = groupCache;
9
11
  this.pluginGroupsProvider = pluginGroupsProvider;
10
- this.storageOperations = storageOperations;
12
+ this.deleteGroup = deleteGroup;
13
+ this.listModels = listModels;
14
+ this.runtimeTenant = runtimeTenant;
11
15
  }
12
- async execute(group) {
16
+ async execute(initialGroup) {
17
+ const group = this.runtimeTenant.assign(initialGroup);
13
18
  try {
14
19
  const pluginGroups = await this.pluginGroupsProvider.getGroups();
15
20
  const isPluginGroup = pluginGroups.some((pg)=>pg.slug === group.slug);
16
21
  if (isPluginGroup) return Result.fail(new GroupCannotDeleteCodeDefinedError(group.id));
17
- const models = await this.storageOperations.models.list({
22
+ const models = await this.listModels.execute({
18
23
  where: {
19
24
  tenant: group.tenant
20
25
  }
21
26
  });
22
27
  const items = models.filter((model)=>model.group === group.slug);
23
28
  if (items.length > 0) return Result.fail(new GroupHasModelsError());
24
- await this.storageOperations.groups.delete({
29
+ await this.deleteGroup.execute({
25
30
  group
26
31
  });
27
32
  this.groupCache.clear();
@@ -31,13 +36,14 @@ class DeleteGroupRepositoryImpl {
31
36
  }
32
37
  }
33
38
  }
34
- const DeleteGroupRepository_DeleteGroupRepository = createImplementation({
35
- abstraction: DeleteGroupRepository,
39
+ const DeleteGroupRepository_DeleteGroupRepository = DeleteGroupRepository.createImplementation({
36
40
  implementation: DeleteGroupRepositoryImpl,
37
41
  dependencies: [
38
42
  GroupCache,
39
43
  PluginGroupsProvider,
40
- StorageOperations
44
+ DeleteGroupStorageOperation,
45
+ ListModelsStorageOperation,
46
+ RuntimeTenant
41
47
  ]
42
48
  });
43
49
  export { DeleteGroupRepository_DeleteGroupRepository as DeleteGroupRepository };
@@ -1 +1 @@
1
- {"version":3,"file":"features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js","sources":["../../../../src/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { createImplementation } from \"@webiny/feature/api\";\nimport { DeleteGroupRepository as RepositoryAbstraction } from \"./abstractions.js\";\nimport { GroupCache } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { PluginGroupsProvider } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { GroupCannotDeleteCodeDefinedError } from \"~/domain/contentModelGroup/errors.js\";\nimport { GroupHasModelsError } from \"~/domain/contentModelGroup/errors.js\";\nimport { GroupPersistenceError } from \"~/domain/contentModelGroup/errors.js\";\nimport { StorageOperations } from \"~/features/shared/abstractions.js\";\nimport type { CmsGroup } from \"~/types/index.js\";\n\n/**\n * DeleteGroupRepository - Validates and performs group deletion.\n *\n * Responsibilities:\n * - Check if group is plugin-based (cannot delete)\n * - Check if models reference this group (cannot delete)\n * - Persist deletion to storage\n * - Clear GroupCache after successful deletion\n */\nclass DeleteGroupRepositoryImpl implements RepositoryAbstraction.Interface {\n public constructor(\n private groupCache: GroupCache.Interface,\n private pluginGroupsProvider: PluginGroupsProvider.Interface,\n private storageOperations: StorageOperations.Interface\n ) {}\n\n async execute(group: CmsGroup): Promise<Result<void, RepositoryAbstraction.Error>> {\n try {\n // Check if this is a plugin-based group (cannot be deleted)\n const pluginGroups = await this.pluginGroupsProvider.getGroups();\n const isPluginGroup = pluginGroups.some(pg => pg.slug === group.slug);\n\n if (isPluginGroup) {\n return Result.fail(new GroupCannotDeleteCodeDefinedError(group.id));\n }\n\n // Check if any models reference this group\n const models = await this.storageOperations.models.list({\n where: {\n tenant: group.tenant\n }\n });\n\n const items = models.filter(model => model.group === group.slug);\n if (items.length > 0) {\n return Result.fail(new GroupHasModelsError());\n }\n\n // Perform deletion\n await this.storageOperations.groups.delete({ group });\n\n // Clear cache\n this.groupCache.clear();\n\n return Result.ok();\n } catch (error) {\n return Result.fail(new GroupPersistenceError(error as Error));\n }\n }\n}\n\nexport const DeleteGroupRepository = createImplementation({\n abstraction: RepositoryAbstraction,\n implementation: DeleteGroupRepositoryImpl,\n dependencies: [GroupCache, PluginGroupsProvider, StorageOperations]\n});\n"],"names":["DeleteGroupRepositoryImpl","groupCache","pluginGroupsProvider","storageOperations","group","pluginGroups","isPluginGroup","pg","Result","GroupCannotDeleteCodeDefinedError","models","items","model","GroupHasModelsError","error","GroupPersistenceError","DeleteGroupRepository","createImplementation","RepositoryAbstraction","GroupCache","PluginGroupsProvider","StorageOperations"],"mappings":";;;;;AAoBA,MAAMA;IACF,YACYC,UAAgC,EAChCC,oBAAoD,EACpDC,iBAA8C,CACxD;aAHUF,UAAU,GAAVA;aACAC,oBAAoB,GAApBA;aACAC,iBAAiB,GAAjBA;IACT;IAEH,MAAM,QAAQC,KAAe,EAAsD;QAC/E,IAAI;YAEA,MAAMC,eAAe,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS;YAC9D,MAAMC,gBAAgBD,aAAa,IAAI,CAACE,CAAAA,KAAMA,GAAG,IAAI,KAAKH,MAAM,IAAI;YAEpE,IAAIE,eACA,OAAOE,OAAO,IAAI,CAAC,IAAIC,kCAAkCL,MAAM,EAAE;YAIrE,MAAMM,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC;gBACpD,OAAO;oBACH,QAAQN,MAAM,MAAM;gBACxB;YACJ;YAEA,MAAMO,QAAQD,OAAO,MAAM,CAACE,CAAAA,QAASA,MAAM,KAAK,KAAKR,MAAM,IAAI;YAC/D,IAAIO,MAAM,MAAM,GAAG,GACf,OAAOH,OAAO,IAAI,CAAC,IAAIK;YAI3B,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC;gBAAET;YAAM;YAGnD,IAAI,CAAC,UAAU,CAAC,KAAK;YAErB,OAAOI,OAAO,EAAE;QACpB,EAAE,OAAOM,OAAO;YACZ,OAAON,OAAO,IAAI,CAAC,IAAIO,sBAAsBD;QACjD;IACJ;AACJ;AAEO,MAAME,8CAAwBC,qBAAqB;IACtD,aAAaC;IACb,gBAAgBlB;IAChB,cAAc;QAACmB;QAAYC;QAAsBC;KAAkB;AACvE"}
1
+ {"version":3,"file":"features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js","sources":["../../../../src/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { DeleteGroupRepository as RepositoryAbstraction } from \"./abstractions.js\";\nimport { GroupCache } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { PluginGroupsProvider } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { GroupCannotDeleteCodeDefinedError } from \"~/domain/contentModelGroup/errors.js\";\nimport { GroupHasModelsError } from \"~/domain/contentModelGroup/errors.js\";\nimport { GroupPersistenceError } from \"~/domain/contentModelGroup/errors.js\";\nimport { DeleteGroupStorageOperation } from \"~/features/shared/storageOperations/group/DeleteGroupStorageOperation.js\";\nimport { ListModelsStorageOperation } from \"~/features/shared/storageOperations/model/ListModelsStorageOperation.js\";\nimport type { CmsGroup } from \"~/types/index.js\";\nimport { RuntimeTenant } from \"~/features/runtimeTenant/abstractions.js\";\n\n/**\n * DeleteGroupRepository - Validates and performs group deletion.\n *\n * Responsibilities:\n * - Check if group is plugin-based (cannot delete)\n * - Check if models reference this group (cannot delete)\n * - Persist deletion to storage\n * - Clear GroupCache after successful deletion\n */\nclass DeleteGroupRepositoryImpl implements RepositoryAbstraction.Interface {\n public constructor(\n private groupCache: GroupCache.Interface,\n private pluginGroupsProvider: PluginGroupsProvider.Interface,\n private deleteGroup: DeleteGroupStorageOperation.Interface,\n private listModels: ListModelsStorageOperation.Interface,\n private runtimeTenant: RuntimeTenant.Interface\n ) {}\n\n async execute(initialGroup: CmsGroup): Promise<Result<void, RepositoryAbstraction.Error>> {\n const group = this.runtimeTenant.assign(initialGroup);\n\n try {\n // Check if this is a plugin-based group (cannot be deleted)\n const pluginGroups = await this.pluginGroupsProvider.getGroups();\n const isPluginGroup = pluginGroups.some(pg => pg.slug === group.slug);\n\n if (isPluginGroup) {\n return Result.fail(new GroupCannotDeleteCodeDefinedError(group.id));\n }\n\n // Check if any models reference this group\n const models = await this.listModels.execute({\n where: {\n tenant: group.tenant\n }\n });\n\n const items = models.filter(model => model.group === group.slug);\n if (items.length > 0) {\n return Result.fail(new GroupHasModelsError());\n }\n\n // Perform deletion\n await this.deleteGroup.execute({ group });\n\n // Clear cache\n this.groupCache.clear();\n\n return Result.ok();\n } catch (error) {\n return Result.fail(new GroupPersistenceError(error as Error));\n }\n }\n}\n\nexport const DeleteGroupRepository = RepositoryAbstraction.createImplementation({\n implementation: DeleteGroupRepositoryImpl,\n dependencies: [\n GroupCache,\n PluginGroupsProvider,\n DeleteGroupStorageOperation,\n ListModelsStorageOperation,\n RuntimeTenant\n ]\n});\n"],"names":["DeleteGroupRepositoryImpl","groupCache","pluginGroupsProvider","deleteGroup","listModels","runtimeTenant","initialGroup","group","pluginGroups","isPluginGroup","pg","Result","GroupCannotDeleteCodeDefinedError","models","items","model","GroupHasModelsError","error","GroupPersistenceError","DeleteGroupRepository","RepositoryAbstraction","GroupCache","PluginGroupsProvider","DeleteGroupStorageOperation","ListModelsStorageOperation","RuntimeTenant"],"mappings":";;;;;;;AAqBA,MAAMA;IACF,YACYC,UAAgC,EAChCC,oBAAoD,EACpDC,WAAkD,EAClDC,UAAgD,EAChDC,aAAsC,CAChD;aALUJ,UAAU,GAAVA;aACAC,oBAAoB,GAApBA;aACAC,WAAW,GAAXA;aACAC,UAAU,GAAVA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,YAAsB,EAAsD;QACtF,MAAMC,QAAQ,IAAI,CAAC,aAAa,CAAC,MAAM,CAACD;QAExC,IAAI;YAEA,MAAME,eAAe,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS;YAC9D,MAAMC,gBAAgBD,aAAa,IAAI,CAACE,CAAAA,KAAMA,GAAG,IAAI,KAAKH,MAAM,IAAI;YAEpE,IAAIE,eACA,OAAOE,OAAO,IAAI,CAAC,IAAIC,kCAAkCL,MAAM,EAAE;YAIrE,MAAMM,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;gBACzC,OAAO;oBACH,QAAQN,MAAM,MAAM;gBACxB;YACJ;YAEA,MAAMO,QAAQD,OAAO,MAAM,CAACE,CAAAA,QAASA,MAAM,KAAK,KAAKR,MAAM,IAAI;YAC/D,IAAIO,MAAM,MAAM,GAAG,GACf,OAAOH,OAAO,IAAI,CAAC,IAAIK;YAI3B,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;gBAAET;YAAM;YAGvC,IAAI,CAAC,UAAU,CAAC,KAAK;YAErB,OAAOI,OAAO,EAAE;QACpB,EAAE,OAAOM,OAAO;YACZ,OAAON,OAAO,IAAI,CAAC,IAAIO,sBAAsBD;QACjD;IACJ;AACJ;AAEO,MAAME,8CAAwBC,sBAAAA,oBAA0C,CAAC;IAC5E,gBAAgBpB;IAChB,cAAc;QACVqB;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
@@ -22,5 +22,7 @@ declare class DeleteGroupUseCaseImpl implements UseCaseAbstraction.Interface {
22
22
  constructor(eventPublisher: EventPublisher.Interface, repository: DeleteGroupRepository.Interface, getGroupUseCase: GetGroupUseCase.Interface, accessControl: AccessControl.Interface);
23
23
  execute(groupId: string): Promise<Result<void, UseCaseAbstraction.Error>>;
24
24
  }
25
- export declare const DeleteGroupUseCase: import("@webiny/di").Implementation<typeof DeleteGroupUseCaseImpl>;
25
+ export declare const DeleteGroupUseCase: typeof DeleteGroupUseCaseImpl & {
26
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IDeleteGroupUseCase>;
27
+ };
26
28
  export {};
@@ -1,4 +1,4 @@
1
- import { Result, createImplementation } from "@webiny/feature/api";
1
+ import { Result } from "@webiny/feature/api";
2
2
  import { DeleteGroupRepository, DeleteGroupUseCase } from "./abstractions.js";
3
3
  import { GetGroupUseCase } from "../GetGroup/abstractions.js";
4
4
  import { EventPublisher } from "@webiny/api-core/features/eventPublisher/index.js";
@@ -49,8 +49,7 @@ class DeleteGroupUseCaseImpl {
49
49
  }
50
50
  }
51
51
  }
52
- const DeleteGroupUseCase_DeleteGroupUseCase = createImplementation({
53
- abstraction: DeleteGroupUseCase,
52
+ const DeleteGroupUseCase_DeleteGroupUseCase = DeleteGroupUseCase.createImplementation({
54
53
  implementation: DeleteGroupUseCaseImpl,
55
54
  dependencies: [
56
55
  EventPublisher,
@@ -1 +1 @@
1
- {"version":3,"file":"features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js","sources":["../../../../src/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { createImplementation } from \"@webiny/feature/api\";\nimport { DeleteGroupUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { DeleteGroupRepository } from \"./abstractions.js\";\nimport { GetGroupUseCase } from \"~/features/contentModelGroup/GetGroup/abstractions.js\";\nimport { EventPublisher } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { GroupBeforeDeleteEvent } from \"./events.js\";\nimport { GroupAfterDeleteEvent } from \"./events.js\";\nimport { GroupDeleteErrorEvent } from \"./events.js\";\nimport { AccessControl } from \"~/features/shared/abstractions.js\";\nimport { GroupNotAuthorizedError } from \"~/domain/contentModelGroup/errors.js\";\n\n/**\n * DeleteGroupUseCase - Orchestrates group deletion.\n *\n * Responsibilities:\n * - Fetch original group\n * - Access control checks\n * - Publish before event\n * - Delegate to repository\n * - Publish after event or error event\n */\nclass DeleteGroupUseCaseImpl implements UseCaseAbstraction.Interface {\n public constructor(\n private eventPublisher: EventPublisher.Interface,\n private repository: DeleteGroupRepository.Interface,\n private getGroupUseCase: GetGroupUseCase.Interface,\n private accessControl: AccessControl.Interface\n ) {}\n\n async execute(groupId: string): Promise<Result<void, UseCaseAbstraction.Error>> {\n // Initial access control check\n const canAccess = await this.accessControl.canAccessGroup({ rwd: \"d\" });\n if (!canAccess) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n // Fetch original group\n const getResult = await this.getGroupUseCase.execute(groupId);\n if (getResult.isFail()) {\n return Result.fail(getResult.error);\n }\n const group = getResult.value;\n\n // Access control check on group\n const canAccessGroup = await this.accessControl.canAccessGroup({ group });\n if (!canAccessGroup) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n try {\n // Publish before event\n await this.eventPublisher.publish(\n new GroupBeforeDeleteEvent({\n group\n })\n );\n\n // Persist via repository\n const result = await this.repository.execute(group);\n if (result.isFail()) {\n // Publish error event\n await this.eventPublisher.publish(\n new GroupDeleteErrorEvent({\n group,\n error: result.error\n })\n );\n return Result.fail(result.error);\n }\n\n // Publish after event\n await this.eventPublisher.publish(\n new GroupAfterDeleteEvent({\n group\n })\n );\n\n return Result.ok();\n } catch (error) {\n // Publish error event for unexpected errors\n await this.eventPublisher.publish(\n new GroupDeleteErrorEvent({\n group,\n error: error as Error\n })\n );\n return Result.fail(error as UseCaseAbstraction.Error);\n }\n }\n}\n\nexport const DeleteGroupUseCase = createImplementation({\n abstraction: UseCaseAbstraction,\n implementation: DeleteGroupUseCaseImpl,\n dependencies: [EventPublisher, DeleteGroupRepository, GetGroupUseCase, AccessControl]\n});\n"],"names":["DeleteGroupUseCaseImpl","eventPublisher","repository","getGroupUseCase","accessControl","groupId","canAccess","Result","GroupNotAuthorizedError","getResult","group","canAccessGroup","GroupBeforeDeleteEvent","result","GroupDeleteErrorEvent","GroupAfterDeleteEvent","error","DeleteGroupUseCase","createImplementation","UseCaseAbstraction","EventPublisher","DeleteGroupRepository","GetGroupUseCase","AccessControl"],"mappings":";;;;;;;AAsBA,MAAMA;IACF,YACYC,cAAwC,EACxCC,UAA2C,EAC3CC,eAA0C,EAC1CC,aAAsC,CAChD;aAJUH,cAAc,GAAdA;aACAC,UAAU,GAAVA;aACAC,eAAe,GAAfA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,OAAe,EAAmD;QAE5E,MAAMC,YAAY,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;YAAE,KAAK;QAAI;QACrE,IAAI,CAACA,WACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAI3B,MAAMC,YAAY,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAACJ;QACrD,IAAII,UAAU,MAAM,IAChB,OAAOF,OAAO,IAAI,CAACE,UAAU,KAAK;QAEtC,MAAMC,QAAQD,UAAU,KAAK;QAG7B,MAAME,iBAAiB,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;YAAED;QAAM;QACvE,IAAI,CAACC,gBACD,OAAOJ,OAAO,IAAI,CAAC,IAAIC;QAG3B,IAAI;YAEA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAII,uBAAuB;gBACvBF;YACJ;YAIJ,MAAMG,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACH;YAC7C,IAAIG,OAAO,MAAM,IAAI;gBAEjB,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIC,sBAAsB;oBACtBJ;oBACA,OAAOG,OAAO,KAAK;gBACvB;gBAEJ,OAAON,OAAO,IAAI,CAACM,OAAO,KAAK;YACnC;YAGA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIE,sBAAsB;gBACtBL;YACJ;YAGJ,OAAOH,OAAO,EAAE;QACpB,EAAE,OAAOS,OAAO;YAEZ,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIF,sBAAsB;gBACtBJ;gBACA,OAAOM;YACX;YAEJ,OAAOT,OAAO,IAAI,CAACS;QACvB;IACJ;AACJ;AAEO,MAAMC,wCAAqBC,qBAAqB;IACnD,aAAaC;IACb,gBAAgBnB;IAChB,cAAc;QAACoB;QAAgBC;QAAuBC;QAAiBC;KAAc;AACzF"}
1
+ {"version":3,"file":"features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js","sources":["../../../../src/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { DeleteGroupUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { DeleteGroupRepository } from \"./abstractions.js\";\nimport { GetGroupUseCase } from \"~/features/contentModelGroup/GetGroup/abstractions.js\";\nimport { EventPublisher } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { GroupBeforeDeleteEvent } from \"./events.js\";\nimport { GroupAfterDeleteEvent } from \"./events.js\";\nimport { GroupDeleteErrorEvent } from \"./events.js\";\nimport { AccessControl } from \"~/features/shared/abstractions.js\";\nimport { GroupNotAuthorizedError } from \"~/domain/contentModelGroup/errors.js\";\n\n/**\n * DeleteGroupUseCase - Orchestrates group deletion.\n *\n * Responsibilities:\n * - Fetch original group\n * - Access control checks\n * - Publish before event\n * - Delegate to repository\n * - Publish after event or error event\n */\nclass DeleteGroupUseCaseImpl implements UseCaseAbstraction.Interface {\n public constructor(\n private eventPublisher: EventPublisher.Interface,\n private repository: DeleteGroupRepository.Interface,\n private getGroupUseCase: GetGroupUseCase.Interface,\n private accessControl: AccessControl.Interface\n ) {}\n\n async execute(groupId: string): Promise<Result<void, UseCaseAbstraction.Error>> {\n // Initial access control check\n const canAccess = await this.accessControl.canAccessGroup({ rwd: \"d\" });\n if (!canAccess) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n // Fetch original group\n const getResult = await this.getGroupUseCase.execute(groupId);\n if (getResult.isFail()) {\n return Result.fail(getResult.error);\n }\n const group = getResult.value;\n\n // Access control check on group\n const canAccessGroup = await this.accessControl.canAccessGroup({ group });\n if (!canAccessGroup) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n try {\n // Publish before event\n await this.eventPublisher.publish(\n new GroupBeforeDeleteEvent({\n group\n })\n );\n\n // Persist via repository\n const result = await this.repository.execute(group);\n if (result.isFail()) {\n // Publish error event\n await this.eventPublisher.publish(\n new GroupDeleteErrorEvent({\n group,\n error: result.error\n })\n );\n return Result.fail(result.error);\n }\n\n // Publish after event\n await this.eventPublisher.publish(\n new GroupAfterDeleteEvent({\n group\n })\n );\n\n return Result.ok();\n } catch (error) {\n // Publish error event for unexpected errors\n await this.eventPublisher.publish(\n new GroupDeleteErrorEvent({\n group,\n error: error as Error\n })\n );\n return Result.fail(error as UseCaseAbstraction.Error);\n }\n }\n}\n\nexport const DeleteGroupUseCase = UseCaseAbstraction.createImplementation({\n implementation: DeleteGroupUseCaseImpl,\n dependencies: [EventPublisher, DeleteGroupRepository, GetGroupUseCase, AccessControl]\n});\n"],"names":["DeleteGroupUseCaseImpl","eventPublisher","repository","getGroupUseCase","accessControl","groupId","canAccess","Result","GroupNotAuthorizedError","getResult","group","canAccessGroup","GroupBeforeDeleteEvent","result","GroupDeleteErrorEvent","GroupAfterDeleteEvent","error","DeleteGroupUseCase","UseCaseAbstraction","EventPublisher","DeleteGroupRepository","GetGroupUseCase","AccessControl"],"mappings":";;;;;;;AAqBA,MAAMA;IACF,YACYC,cAAwC,EACxCC,UAA2C,EAC3CC,eAA0C,EAC1CC,aAAsC,CAChD;aAJUH,cAAc,GAAdA;aACAC,UAAU,GAAVA;aACAC,eAAe,GAAfA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,OAAe,EAAmD;QAE5E,MAAMC,YAAY,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;YAAE,KAAK;QAAI;QACrE,IAAI,CAACA,WACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAI3B,MAAMC,YAAY,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAACJ;QACrD,IAAII,UAAU,MAAM,IAChB,OAAOF,OAAO,IAAI,CAACE,UAAU,KAAK;QAEtC,MAAMC,QAAQD,UAAU,KAAK;QAG7B,MAAME,iBAAiB,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;YAAED;QAAM;QACvE,IAAI,CAACC,gBACD,OAAOJ,OAAO,IAAI,CAAC,IAAIC;QAG3B,IAAI;YAEA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAII,uBAAuB;gBACvBF;YACJ;YAIJ,MAAMG,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACH;YAC7C,IAAIG,OAAO,MAAM,IAAI;gBAEjB,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIC,sBAAsB;oBACtBJ;oBACA,OAAOG,OAAO,KAAK;gBACvB;gBAEJ,OAAON,OAAO,IAAI,CAACM,OAAO,KAAK;YACnC;YAGA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIE,sBAAsB;gBACtBL;YACJ;YAGJ,OAAOH,OAAO,EAAE;QACpB,EAAE,OAAOS,OAAO;YAEZ,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIF,sBAAsB;gBACtBJ;gBACA,OAAOM;YACX;YAEJ,OAAOT,OAAO,IAAI,CAACS;QACvB;IACJ;AACJ;AAEO,MAAMC,wCAAqBC,mBAAAA,oBAAuC,CAAC;IACtE,gBAAgBlB;IAChB,cAAc;QAACmB;QAAgBC;QAAuBC;QAAiBC;KAAc;AACzF"}
@@ -4,7 +4,7 @@ import { Result } from "@webiny/feature/api";
4
4
  import { GetGroupRepository as RepositoryAbstraction } from "./abstractions.js";
5
5
  import { GroupCache } from "../../../features/contentModelGroup/shared/abstractions.js";
6
6
  import { PluginGroupsProvider } from "../../../features/contentModelGroup/shared/abstractions.js";
7
- import { StorageOperations } from "../../../features/shared/abstractions.js";
7
+ import { ListGroupsStorageOperation } from "../../../features/shared/storageOperations/group/ListGroupsStorageOperation.js";
8
8
  import { AccessControl } from "../../../features/shared/abstractions.js";
9
9
  import { CmsContext } from "../../../features/shared/abstractions.js";
10
10
  import type { CmsGroup } from "../../../types/index.js";
@@ -21,14 +21,16 @@ import type { CmsGroup } from "../../../types/index.js";
21
21
  declare class GetGroupRepositoryImpl implements RepositoryAbstraction.Interface {
22
22
  private groupCache;
23
23
  private pluginGroupsProvider;
24
- private storageOperations;
24
+ private listGroups;
25
25
  private accessControl;
26
26
  private tenantContext;
27
27
  private identityContext;
28
28
  private cmsContext;
29
- constructor(groupCache: GroupCache.Interface, pluginGroupsProvider: PluginGroupsProvider.Interface, storageOperations: StorageOperations.Interface, accessControl: AccessControl.Interface, tenantContext: TenantContext.Interface, identityContext: IdentityContext.Interface, cmsContext: CmsContext.Interface);
29
+ constructor(groupCache: GroupCache.Interface, pluginGroupsProvider: PluginGroupsProvider.Interface, listGroups: ListGroupsStorageOperation.Interface, accessControl: AccessControl.Interface, tenantContext: TenantContext.Interface, identityContext: IdentityContext.Interface, cmsContext: CmsContext.Interface);
30
30
  execute(groupId: string): Promise<Result<CmsGroup, RepositoryAbstraction.Error>>;
31
31
  private fetchAllGroups;
32
32
  }
33
- export declare const GetGroupRepository: import("@webiny/di").Implementation<typeof GetGroupRepositoryImpl>;
33
+ export declare const GetGroupRepository: typeof GetGroupRepositoryImpl & {
34
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetGroupRepository>;
35
+ };
34
36
  export {};
@@ -1,17 +1,18 @@
1
1
  import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
2
2
  import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
3
- import { Result, createImplementation } from "@webiny/feature/api";
3
+ import { Result } from "@webiny/feature/api";
4
4
  import { GetGroupRepository } from "./abstractions.js";
5
5
  import { GroupCache, PluginGroupsProvider } from "../shared/abstractions.js";
6
6
  import { GroupNotFoundError, GroupPersistenceError } from "../../../domain/contentModelGroup/errors.js";
7
- import { AccessControl, CmsContext, StorageOperations } from "../../shared/abstractions.js";
7
+ import { ListGroupsStorageOperation } from "../../shared/storageOperations/group/ListGroupsStorageOperation.js";
8
+ import { AccessControl, CmsContext } from "../../shared/abstractions.js";
8
9
  import { filterAsync } from "../../../utils/filterAsync.js";
9
10
  import { createCacheKey } from "../../../utils/index.js";
10
11
  class GetGroupRepositoryImpl {
11
- constructor(groupCache, pluginGroupsProvider, storageOperations, accessControl, tenantContext, identityContext, cmsContext){
12
+ constructor(groupCache, pluginGroupsProvider, listGroups, accessControl, tenantContext, identityContext, cmsContext){
12
13
  this.groupCache = groupCache;
13
14
  this.pluginGroupsProvider = pluginGroupsProvider;
14
- this.storageOperations = storageOperations;
15
+ this.listGroups = listGroups;
15
16
  this.accessControl = accessControl;
16
17
  this.tenantContext = tenantContext;
17
18
  this.identityContext = identityContext;
@@ -33,14 +34,14 @@ class GetGroupRepositoryImpl {
33
34
  const dbCacheKey = createCacheKey({
34
35
  tenant
35
36
  });
36
- const databaseGroups = await this.groupCache.getOrSet(dbCacheKey, async ()=>await this.storageOperations.groups.list({
37
+ const databaseGroups = await this.groupCache.getOrSet(dbCacheKey, async ()=>await this.listGroups.execute({
37
38
  where: {
38
39
  tenant
39
40
  }
40
41
  }));
41
42
  const filteredCacheKey = createCacheKey({
42
43
  dbCacheKey: dbCacheKey.get(),
43
- identity: this.cmsContext.security.isAuthorizationEnabled() ? this.identityContext.getIdentity()?.id : void 0
44
+ identity: this.identityContext.isAuthorizationEnabled() ? this.identityContext.getIdentity()?.id : void 0
44
45
  });
45
46
  const filteredDatabaseGroups = await this.groupCache.getOrSet(filteredCacheKey, async ()=>filterAsync(databaseGroups, async (group)=>{
46
47
  if (!group) return false;
@@ -54,13 +55,12 @@ class GetGroupRepositoryImpl {
54
55
  ];
55
56
  }
56
57
  }
57
- const GetGroupRepository_GetGroupRepository = createImplementation({
58
- abstraction: GetGroupRepository,
58
+ const GetGroupRepository_GetGroupRepository = GetGroupRepository.createImplementation({
59
59
  implementation: GetGroupRepositoryImpl,
60
60
  dependencies: [
61
61
  GroupCache,
62
62
  PluginGroupsProvider,
63
- StorageOperations,
63
+ ListGroupsStorageOperation,
64
64
  AccessControl,
65
65
  TenantContext,
66
66
  IdentityContext,
@@ -1 +1 @@
1
- {"version":3,"file":"features/contentModelGroup/GetGroup/GetGroupRepository.js","sources":["../../../../src/features/contentModelGroup/GetGroup/GetGroupRepository.ts"],"sourcesContent":["import { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { Result } from \"@webiny/feature/api\";\nimport { createImplementation } from \"@webiny/feature/api\";\nimport { GetGroupRepository as RepositoryAbstraction } from \"./abstractions.js\";\nimport { GroupCache } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { PluginGroupsProvider } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { GroupNotFoundError } from \"~/domain/contentModelGroup/errors.js\";\nimport { GroupPersistenceError } from \"~/domain/contentModelGroup/errors.js\";\nimport { StorageOperations } from \"~/features/shared/abstractions.js\";\nimport { AccessControl } from \"~/features/shared/abstractions.js\";\nimport { CmsContext } from \"~/features/shared/abstractions.js\";\nimport { filterAsync } from \"~/utils/filterAsync.js\";\nimport { createCacheKey } from \"~/utils/index.js\";\nimport type { CmsGroup } from \"~/types/index.js\";\n\n/**\n * GetGroupRepository - Fetches a single group by ID.\n *\n * Responsibilities:\n * - Create cache keys based on tenant + identity\n * - Provide data loader functions to GroupCache\n * - Fetch from plugin groups + database groups\n * - Apply access control filtering\n * - Return the group or NotFoundError\n */\nclass GetGroupRepositoryImpl implements RepositoryAbstraction.Interface {\n public constructor(\n private groupCache: GroupCache.Interface,\n private pluginGroupsProvider: PluginGroupsProvider.Interface,\n private storageOperations: StorageOperations.Interface,\n private accessControl: AccessControl.Interface,\n private tenantContext: TenantContext.Interface,\n private identityContext: IdentityContext.Interface,\n private cmsContext: CmsContext.Interface\n ) {}\n\n async execute(groupId: string): Promise<Result<CmsGroup, RepositoryAbstraction.Error>> {\n try {\n const tenant = this.tenantContext.getTenant();\n\n // Fetch all groups (plugin + database) with access control filtering\n const groups = await this.fetchAllGroups(tenant.id);\n\n const group = groups.find(g => g.id === groupId);\n\n if (!group) {\n return Result.fail(new GroupNotFoundError(groupId));\n }\n\n return Result.ok(group);\n } catch (error) {\n return Result.fail(new GroupPersistenceError(error as Error));\n }\n }\n\n private async fetchAllGroups(tenant: string): Promise<CmsGroup[]> {\n // 1. Fetch plugin groups (with caching and access control)\n const pluginGroups = await this.pluginGroupsProvider.getGroups();\n\n // 2. Fetch database groups (with caching)\n const dbCacheKey = createCacheKey({ tenant });\n const databaseGroups = await this.groupCache.getOrSet(dbCacheKey, async () => {\n return await this.storageOperations.groups.list({\n where: { tenant }\n });\n });\n\n // 3. Apply access control to database groups (with caching)\n const filteredCacheKey = createCacheKey({\n dbCacheKey: dbCacheKey.get(),\n identity: this.cmsContext.security.isAuthorizationEnabled()\n ? this.identityContext.getIdentity()?.id\n : undefined\n });\n\n const filteredDatabaseGroups = await this.groupCache.getOrSet(\n filteredCacheKey,\n async () => {\n return filterAsync(databaseGroups, async (group?: CmsGroup) => {\n if (!group) {\n return false;\n }\n return this.accessControl.canAccessGroup({ group });\n });\n }\n );\n\n // 4. Merge plugin + database groups\n return [...pluginGroups, ...filteredDatabaseGroups];\n }\n}\n\nexport const GetGroupRepository = createImplementation({\n abstraction: RepositoryAbstraction,\n implementation: GetGroupRepositoryImpl,\n dependencies: [\n GroupCache,\n PluginGroupsProvider,\n StorageOperations,\n AccessControl,\n TenantContext,\n IdentityContext,\n CmsContext\n ]\n});\n"],"names":["GetGroupRepositoryImpl","groupCache","pluginGroupsProvider","storageOperations","accessControl","tenantContext","identityContext","cmsContext","groupId","tenant","groups","group","g","Result","GroupNotFoundError","error","GroupPersistenceError","pluginGroups","dbCacheKey","createCacheKey","databaseGroups","filteredCacheKey","undefined","filteredDatabaseGroups","filterAsync","GetGroupRepository","createImplementation","RepositoryAbstraction","GroupCache","PluginGroupsProvider","StorageOperations","AccessControl","TenantContext","IdentityContext","CmsContext"],"mappings":";;;;;;;;;AA0BA,MAAMA;IACF,YACYC,UAAgC,EAChCC,oBAAoD,EACpDC,iBAA8C,EAC9CC,aAAsC,EACtCC,aAAsC,EACtCC,eAA0C,EAC1CC,UAAgC,CAC1C;aAPUN,UAAU,GAAVA;aACAC,oBAAoB,GAApBA;aACAC,iBAAiB,GAAjBA;aACAC,aAAa,GAAbA;aACAC,aAAa,GAAbA;aACAC,eAAe,GAAfA;aACAC,UAAU,GAAVA;IACT;IAEH,MAAM,QAAQC,OAAe,EAA0D;QACnF,IAAI;YACA,MAAMC,SAAS,IAAI,CAAC,aAAa,CAAC,SAAS;YAG3C,MAAMC,SAAS,MAAM,IAAI,CAAC,cAAc,CAACD,OAAO,EAAE;YAElD,MAAME,QAAQD,OAAO,IAAI,CAACE,CAAAA,IAAKA,EAAE,EAAE,KAAKJ;YAExC,IAAI,CAACG,OACD,OAAOE,OAAO,IAAI,CAAC,IAAIC,mBAAmBN;YAG9C,OAAOK,OAAO,EAAE,CAACF;QACrB,EAAE,OAAOI,OAAO;YACZ,OAAOF,OAAO,IAAI,CAAC,IAAIG,sBAAsBD;QACjD;IACJ;IAEA,MAAc,eAAeN,MAAc,EAAuB;QAE9D,MAAMQ,eAAe,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS;QAG9D,MAAMC,aAAaC,eAAe;YAAEV;QAAO;QAC3C,MAAMW,iBAAiB,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAACF,YAAY,UACvD,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC;gBAC5C,OAAO;oBAAET;gBAAO;YACpB;QAIJ,MAAMY,mBAAmBF,eAAe;YACpC,YAAYD,WAAW,GAAG;YAC1B,UAAU,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,sBAAsB,KACnD,IAAI,CAAC,eAAe,CAAC,WAAW,IAAI,KACpCI;QACV;QAEA,MAAMC,yBAAyB,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CACzDF,kBACA,UACWG,YAAYJ,gBAAgB,OAAOT;gBACtC,IAAI,CAACA,OACD,OAAO;gBAEX,OAAO,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;oBAAEA;gBAAM;YACrD;QAKR,OAAO;eAAIM;eAAiBM;SAAuB;IACvD;AACJ;AAEO,MAAME,wCAAqBC,qBAAqB;IACnD,aAAaC;IACb,gBAAgB3B;IAChB,cAAc;QACV4B;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
1
+ {"version":3,"file":"features/contentModelGroup/GetGroup/GetGroupRepository.js","sources":["../../../../src/features/contentModelGroup/GetGroup/GetGroupRepository.ts"],"sourcesContent":["import { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { Result } from \"@webiny/feature/api\";\nimport { GetGroupRepository as RepositoryAbstraction } from \"./abstractions.js\";\nimport { GroupCache } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { PluginGroupsProvider } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { GroupNotFoundError } from \"~/domain/contentModelGroup/errors.js\";\nimport { GroupPersistenceError } from \"~/domain/contentModelGroup/errors.js\";\nimport { ListGroupsStorageOperation } from \"~/features/shared/storageOperations/group/ListGroupsStorageOperation.js\";\nimport { AccessControl } from \"~/features/shared/abstractions.js\";\nimport { CmsContext } from \"~/features/shared/abstractions.js\";\nimport { filterAsync } from \"~/utils/filterAsync.js\";\nimport { createCacheKey } from \"~/utils/index.js\";\nimport type { CmsGroup } from \"~/types/index.js\";\n\n/**\n * GetGroupRepository - Fetches a single group by ID.\n *\n * Responsibilities:\n * - Create cache keys based on tenant + identity\n * - Provide data loader functions to GroupCache\n * - Fetch from plugin groups + database groups\n * - Apply access control filtering\n * - Return the group or NotFoundError\n */\nclass GetGroupRepositoryImpl implements RepositoryAbstraction.Interface {\n public constructor(\n private groupCache: GroupCache.Interface,\n private pluginGroupsProvider: PluginGroupsProvider.Interface,\n private listGroups: ListGroupsStorageOperation.Interface,\n private accessControl: AccessControl.Interface,\n private tenantContext: TenantContext.Interface,\n private identityContext: IdentityContext.Interface,\n private cmsContext: CmsContext.Interface\n ) {}\n\n async execute(groupId: string): Promise<Result<CmsGroup, RepositoryAbstraction.Error>> {\n try {\n const tenant = this.tenantContext.getTenant();\n\n // Fetch all groups (plugin + database) with access control filtering\n const groups = await this.fetchAllGroups(tenant.id);\n\n const group = groups.find(g => g.id === groupId);\n\n if (!group) {\n return Result.fail(new GroupNotFoundError(groupId));\n }\n\n return Result.ok(group);\n } catch (error) {\n return Result.fail(new GroupPersistenceError(error as Error));\n }\n }\n\n private async fetchAllGroups(tenant: string): Promise<CmsGroup[]> {\n // 1. Fetch plugin groups (with caching and access control)\n const pluginGroups = await this.pluginGroupsProvider.getGroups();\n\n // 2. Fetch database groups (with caching)\n const dbCacheKey = createCacheKey({ tenant });\n const databaseGroups = await this.groupCache.getOrSet(dbCacheKey, async () => {\n return await this.listGroups.execute({\n where: { tenant }\n });\n });\n\n // 3. Apply access control to database groups (with caching)\n const filteredCacheKey = createCacheKey({\n dbCacheKey: dbCacheKey.get(),\n identity: this.identityContext.isAuthorizationEnabled()\n ? this.identityContext.getIdentity()?.id\n : undefined\n });\n\n const filteredDatabaseGroups = await this.groupCache.getOrSet(\n filteredCacheKey,\n async () => {\n return filterAsync(databaseGroups, async (group?: CmsGroup) => {\n if (!group) {\n return false;\n }\n return this.accessControl.canAccessGroup({ group });\n });\n }\n );\n\n // 4. Merge plugin + database groups\n return [...pluginGroups, ...filteredDatabaseGroups];\n }\n}\n\nexport const GetGroupRepository = RepositoryAbstraction.createImplementation({\n implementation: GetGroupRepositoryImpl,\n dependencies: [\n GroupCache,\n PluginGroupsProvider,\n ListGroupsStorageOperation,\n AccessControl,\n TenantContext,\n IdentityContext,\n CmsContext\n ]\n});\n"],"names":["GetGroupRepositoryImpl","groupCache","pluginGroupsProvider","listGroups","accessControl","tenantContext","identityContext","cmsContext","groupId","tenant","groups","group","g","Result","GroupNotFoundError","error","GroupPersistenceError","pluginGroups","dbCacheKey","createCacheKey","databaseGroups","filteredCacheKey","undefined","filteredDatabaseGroups","filterAsync","GetGroupRepository","RepositoryAbstraction","GroupCache","PluginGroupsProvider","ListGroupsStorageOperation","AccessControl","TenantContext","IdentityContext","CmsContext"],"mappings":";;;;;;;;;;AAyBA,MAAMA;IACF,YACYC,UAAgC,EAChCC,oBAAoD,EACpDC,UAAgD,EAChDC,aAAsC,EACtCC,aAAsC,EACtCC,eAA0C,EAC1CC,UAAgC,CAC1C;aAPUN,UAAU,GAAVA;aACAC,oBAAoB,GAApBA;aACAC,UAAU,GAAVA;aACAC,aAAa,GAAbA;aACAC,aAAa,GAAbA;aACAC,eAAe,GAAfA;aACAC,UAAU,GAAVA;IACT;IAEH,MAAM,QAAQC,OAAe,EAA0D;QACnF,IAAI;YACA,MAAMC,SAAS,IAAI,CAAC,aAAa,CAAC,SAAS;YAG3C,MAAMC,SAAS,MAAM,IAAI,CAAC,cAAc,CAACD,OAAO,EAAE;YAElD,MAAME,QAAQD,OAAO,IAAI,CAACE,CAAAA,IAAKA,EAAE,EAAE,KAAKJ;YAExC,IAAI,CAACG,OACD,OAAOE,OAAO,IAAI,CAAC,IAAIC,mBAAmBN;YAG9C,OAAOK,OAAO,EAAE,CAACF;QACrB,EAAE,OAAOI,OAAO;YACZ,OAAOF,OAAO,IAAI,CAAC,IAAIG,sBAAsBD;QACjD;IACJ;IAEA,MAAc,eAAeN,MAAc,EAAuB;QAE9D,MAAMQ,eAAe,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS;QAG9D,MAAMC,aAAaC,eAAe;YAAEV;QAAO;QAC3C,MAAMW,iBAAiB,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAACF,YAAY,UACvD,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;gBACjC,OAAO;oBAAET;gBAAO;YACpB;QAIJ,MAAMY,mBAAmBF,eAAe;YACpC,YAAYD,WAAW,GAAG;YAC1B,UAAU,IAAI,CAAC,eAAe,CAAC,sBAAsB,KAC/C,IAAI,CAAC,eAAe,CAAC,WAAW,IAAI,KACpCI;QACV;QAEA,MAAMC,yBAAyB,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CACzDF,kBACA,UACWG,YAAYJ,gBAAgB,OAAOT;gBACtC,IAAI,CAACA,OACD,OAAO;gBAEX,OAAO,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;oBAAEA;gBAAM;YACrD;QAKR,OAAO;eAAIM;eAAiBM;SAAuB;IACvD;AACJ;AAEO,MAAME,wCAAqBC,mBAAAA,oBAA0C,CAAC;IACzE,gBAAgB1B;IAChB,cAAc;QACV2B;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
@@ -17,5 +17,7 @@ declare class GetGroupUseCaseImpl implements UseCaseAbstraction.Interface {
17
17
  constructor(repository: GetGroupRepository.Interface, accessControl: AccessControl.Interface);
18
18
  execute(groupId: string): Promise<Result<CmsGroup, UseCaseAbstraction.Error>>;
19
19
  }
20
- export declare const GetGroupUseCase: import("@webiny/di").Implementation<typeof GetGroupUseCaseImpl>;
20
+ export declare const GetGroupUseCase: typeof GetGroupUseCaseImpl & {
21
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetGroupUseCase>;
22
+ };
21
23
  export {};
@@ -1,4 +1,4 @@
1
- import { Result, createImplementation } from "@webiny/feature/api";
1
+ import { Result } from "@webiny/feature/api";
2
2
  import { GetGroupRepository, GetGroupUseCase } from "./abstractions.js";
3
3
  import { AccessControl } from "../../shared/abstractions.js";
4
4
  import { GroupNotAuthorizedError } from "../../../domain/contentModelGroup/errors.js";
@@ -15,8 +15,7 @@ class GetGroupUseCaseImpl {
15
15
  return Result.ok(result.value);
16
16
  }
17
17
  }
18
- const GetGroupUseCase_GetGroupUseCase = createImplementation({
19
- abstraction: GetGroupUseCase,
18
+ const GetGroupUseCase_GetGroupUseCase = GetGroupUseCase.createImplementation({
20
19
  implementation: GetGroupUseCaseImpl,
21
20
  dependencies: [
22
21
  GetGroupRepository,
@@ -1 +1 @@
1
- {"version":3,"file":"features/contentModelGroup/GetGroup/GetGroupUseCase.js","sources":["../../../../src/features/contentModelGroup/GetGroup/GetGroupUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { createImplementation } from \"@webiny/feature/api\";\nimport { GetGroupUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { GetGroupRepository } from \"./abstractions.js\";\nimport { AccessControl } from \"~/features/shared/abstractions.js\";\nimport type { CmsGroup } from \"~/types/index.js\";\nimport { GroupNotAuthorizedError } from \"~/domain/contentModelGroup/errors.js\";\n\n/**\n * GetGroupUseCase - Retrieves a single content model group by ID.\n *\n * Responsibilities:\n * - Apply initial access control check\n * - Delegate to repository (which uses GroupCache for plugin + DB groups)\n * - Return the group or appropriate error\n */\nclass GetGroupUseCaseImpl implements UseCaseAbstraction.Interface {\n public constructor(\n private repository: GetGroupRepository.Interface,\n private accessControl: AccessControl.Interface\n ) {}\n\n async execute(groupId: string): Promise<Result<CmsGroup, UseCaseAbstraction.Error>> {\n // Initial access control check (no specific group yet)\n const canAccess = await this.accessControl.canAccessGroup();\n if (!canAccess) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n // Repository uses GroupCache to fetch all groups, then filters by ID\n // GroupCache handles merging plugin + database groups and access control\n const result = await this.repository.execute(groupId);\n\n if (result.isFail()) {\n return Result.fail(result.error);\n }\n\n return Result.ok(result.value);\n }\n}\n\nexport const GetGroupUseCase = createImplementation({\n abstraction: UseCaseAbstraction,\n implementation: GetGroupUseCaseImpl,\n dependencies: [GetGroupRepository, AccessControl]\n});\n"],"names":["GetGroupUseCaseImpl","repository","accessControl","groupId","canAccess","Result","GroupNotAuthorizedError","result","GetGroupUseCase","createImplementation","UseCaseAbstraction","GetGroupRepository","AccessControl"],"mappings":";;;;AAgBA,MAAMA;IACF,YACYC,UAAwC,EACxCC,aAAsC,CAChD;aAFUD,UAAU,GAAVA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,OAAe,EAAuD;QAEhF,MAAMC,YAAY,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc;QACzD,IAAI,CAACA,WACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAK3B,MAAMC,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACJ;QAE7C,IAAII,OAAO,MAAM,IACb,OAAOF,OAAO,IAAI,CAACE,OAAO,KAAK;QAGnC,OAAOF,OAAO,EAAE,CAACE,OAAO,KAAK;IACjC;AACJ;AAEO,MAAMC,kCAAkBC,qBAAqB;IAChD,aAAaC;IACb,gBAAgBV;IAChB,cAAc;QAACW;QAAoBC;KAAc;AACrD"}
1
+ {"version":3,"file":"features/contentModelGroup/GetGroup/GetGroupUseCase.js","sources":["../../../../src/features/contentModelGroup/GetGroup/GetGroupUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { GetGroupUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { GetGroupRepository } from \"./abstractions.js\";\nimport { AccessControl } from \"~/features/shared/abstractions.js\";\nimport type { CmsGroup } from \"~/types/index.js\";\nimport { GroupNotAuthorizedError } from \"~/domain/contentModelGroup/errors.js\";\n\n/**\n * GetGroupUseCase - Retrieves a single content model group by ID.\n *\n * Responsibilities:\n * - Apply initial access control check\n * - Delegate to repository (which uses GroupCache for plugin + DB groups)\n * - Return the group or appropriate error\n */\nclass GetGroupUseCaseImpl implements UseCaseAbstraction.Interface {\n public constructor(\n private repository: GetGroupRepository.Interface,\n private accessControl: AccessControl.Interface\n ) {}\n\n async execute(groupId: string): Promise<Result<CmsGroup, UseCaseAbstraction.Error>> {\n // Initial access control check (no specific group yet)\n const canAccess = await this.accessControl.canAccessGroup();\n if (!canAccess) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n // Repository uses GroupCache to fetch all groups, then filters by ID\n // GroupCache handles merging plugin + database groups and access control\n const result = await this.repository.execute(groupId);\n\n if (result.isFail()) {\n return Result.fail(result.error);\n }\n\n return Result.ok(result.value);\n }\n}\n\nexport const GetGroupUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetGroupUseCaseImpl,\n dependencies: [GetGroupRepository, AccessControl]\n});\n"],"names":["GetGroupUseCaseImpl","repository","accessControl","groupId","canAccess","Result","GroupNotAuthorizedError","result","GetGroupUseCase","UseCaseAbstraction","GetGroupRepository","AccessControl"],"mappings":";;;;AAeA,MAAMA;IACF,YACYC,UAAwC,EACxCC,aAAsC,CAChD;aAFUD,UAAU,GAAVA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,OAAe,EAAuD;QAEhF,MAAMC,YAAY,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc;QACzD,IAAI,CAACA,WACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAK3B,MAAMC,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACJ;QAE7C,IAAII,OAAO,MAAM,IACb,OAAOF,OAAO,IAAI,CAACE,OAAO,KAAK;QAGnC,OAAOF,OAAO,EAAE,CAACE,OAAO,KAAK;IACjC;AACJ;AAEO,MAAMC,kCAAkBC,gBAAAA,oBAAuC,CAAC;IACnE,gBAAgBT;IAChB,cAAc;QAACU;QAAoBC;KAAc;AACrD"}