@webiny/api-headless-cms 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2

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 (786) 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.js +14 -7
  11. package/crud/contentEntry/entryDataValidation.js.map +1 -1
  12. package/crud/contentEntry/references/validateEntries.d.ts +1 -1
  13. package/crud/contentEntry/references/validateEntries.js +17 -7
  14. package/crud/contentEntry/references/validateEntries.js.map +1 -1
  15. package/domain/contentModel/schemas.d.ts +2 -0
  16. package/domain/contentModel/schemas.js +1 -0
  17. package/domain/contentModel/schemas.js.map +1 -1
  18. package/domain/contentModel/validation/dateExpressions.d.ts +6 -0
  19. package/domain/contentModel/validation/dateExpressions.js +27 -0
  20. package/domain/contentModel/validation/dateExpressions.js.map +1 -0
  21. package/domain/contentModel/validation/modelFields.js +23 -15
  22. package/domain/contentModel/validation/modelFields.js.map +1 -1
  23. package/export/abstractions.d.ts +9 -0
  24. package/export/abstractions.js +6 -0
  25. package/export/abstractions.js.map +1 -0
  26. package/export/crud/exporting.js +8 -2
  27. package/export/crud/exporting.js.map +1 -1
  28. package/export/crud/importing.js +13 -4
  29. package/export/crud/importing.js.map +1 -1
  30. package/export/crud/imports/importGroups.js +23 -23
  31. package/export/crud/imports/importGroups.js.map +1 -1
  32. package/export/crud/imports/importModels.js +25 -22
  33. package/export/crud/imports/importModels.js.map +1 -1
  34. package/export/graphql/index.d.ts +2 -3
  35. package/export/graphql/index.js +6 -10
  36. package/export/graphql/index.js.map +1 -1
  37. package/exports/api/cms/entry.d.ts +5 -0
  38. package/exports/api/cms/entry.js +5 -0
  39. package/exports/api/cms/storage.d.ts +0 -1
  40. package/exports/api/cms/storage.js +0 -1
  41. package/features/ai/DescribeContentModelTool.d.ts +60 -0
  42. package/features/ai/DescribeContentModelTool.js +69 -0
  43. package/features/ai/DescribeContentModelTool.js.map +1 -0
  44. package/features/ai/ListContentModelsTool.d.ts +46 -0
  45. package/features/ai/ListContentModelsTool.js +53 -0
  46. package/features/ai/ListContentModelsTool.js.map +1 -0
  47. package/features/ai/QueryEntriesTool.d.ts +80 -0
  48. package/features/ai/QueryEntriesTool.js +99 -0
  49. package/features/ai/QueryEntriesTool.js.map +1 -0
  50. package/features/ai/feature.d.ts +8 -0
  51. package/features/ai/feature.js +15 -0
  52. package/features/ai/feature.js.map +1 -0
  53. package/features/ai/index.d.ts +4 -0
  54. package/features/ai/index.js +4 -0
  55. package/features/contentEntry/ContentEntriesFeature.js +8 -4
  56. package/features/contentEntry/ContentEntriesFeature.js.map +1 -1
  57. package/features/contentEntry/CreateEntry/CreateEntryRepository.d.ts +6 -4
  58. package/features/contentEntry/CreateEntry/CreateEntryRepository.js +7 -8
  59. package/features/contentEntry/CreateEntry/CreateEntryRepository.js.map +1 -1
  60. package/features/contentEntry/CreateEntry/CreateEntryUseCase.d.ts +5 -3
  61. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js +4 -5
  62. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js.map +1 -1
  63. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.d.ts +6 -4
  64. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js +7 -8
  65. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js.map +1 -1
  66. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.d.ts +5 -5
  67. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js +8 -17
  68. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js.map +1 -1
  69. package/features/contentEntry/CreateEntryRevisionFrom/abstractions.d.ts +2 -0
  70. package/features/contentEntry/CreateEntryRevisionFrom/abstractions.js.map +1 -1
  71. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.d.ts +6 -4
  72. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js +7 -8
  73. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js.map +1 -1
  74. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.d.ts +5 -3
  75. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js +4 -5
  76. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js.map +1 -1
  77. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.d.ts +6 -4
  78. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js +9 -11
  79. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js.map +1 -1
  80. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.d.ts +5 -3
  81. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js +4 -5
  82. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js.map +1 -1
  83. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.d.ts +3 -3
  84. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js +5 -5
  85. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js.map +1 -1
  86. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.d.ts +6 -4
  87. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js +7 -8
  88. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js.map +1 -1
  89. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.d.ts +5 -3
  90. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js +4 -5
  91. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js.map +1 -1
  92. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.d.ts +6 -4
  93. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js +8 -9
  94. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js.map +1 -1
  95. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.d.ts +5 -3
  96. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js +13 -13
  97. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js.map +1 -1
  98. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.d.ts +17 -0
  99. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.js +83 -0
  100. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.js.map +1 -0
  101. package/features/contentEntry/DuplicateEntry/abstractions.d.ts +47 -0
  102. package/features/contentEntry/DuplicateEntry/abstractions.js +5 -0
  103. package/features/contentEntry/DuplicateEntry/abstractions.js.map +1 -0
  104. package/features/contentEntry/DuplicateEntry/events.d.ts +41 -0
  105. package/features/contentEntry/DuplicateEntry/events.js +32 -0
  106. package/features/contentEntry/DuplicateEntry/events.js.map +1 -0
  107. package/features/contentEntry/{UpdateRevision → DuplicateEntry}/feature.d.ts +1 -1
  108. package/features/contentEntry/DuplicateEntry/feature.js +11 -0
  109. package/features/contentEntry/DuplicateEntry/feature.js.map +1 -0
  110. package/features/contentEntry/DuplicateEntry/index.d.ts +2 -0
  111. package/features/contentEntry/DuplicateEntry/index.js +2 -0
  112. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.d.ts +7 -0
  113. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.js +12 -0
  114. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.js.map +1 -0
  115. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.d.ts +10 -0
  116. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.js +25 -0
  117. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.js.map +1 -0
  118. package/features/contentEntry/EntryEventPublisher/abstractions.d.ts +16 -0
  119. package/features/contentEntry/EntryEventPublisher/abstractions.js +5 -0
  120. package/features/contentEntry/EntryEventPublisher/abstractions.js.map +1 -0
  121. package/features/contentEntry/EntryEventPublisher/feature.d.ts +4 -0
  122. package/features/contentEntry/EntryEventPublisher/feature.js +11 -0
  123. package/features/contentEntry/EntryEventPublisher/feature.js.map +1 -0
  124. package/features/contentEntry/EntryEventPublisher/index.d.ts +2 -0
  125. package/features/contentEntry/EntryEventPublisher/index.js +2 -0
  126. package/features/contentEntry/EntrySystemField/abstractions.d.ts +14 -0
  127. package/features/contentEntry/EntrySystemField/abstractions.js +5 -0
  128. package/features/contentEntry/EntrySystemField/abstractions.js.map +1 -0
  129. package/features/contentEntry/EntrySystemField/index.d.ts +1 -0
  130. package/features/contentEntry/EntrySystemField/index.js +1 -0
  131. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.d.ts +6 -4
  132. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js +7 -8
  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 +6 -4
  144. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js +8 -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 +6 -4
  153. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js +8 -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 +6 -4
  168. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js +7 -8
  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 +6 -4
  174. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js +8 -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 +6 -4
  180. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js +8 -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 +6 -4
  186. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js +7 -8
  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 +6 -4
  192. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js +8 -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/GetUniqueFieldValues/GetUniqueFieldValuesRepository.d.ts +6 -4
  198. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js +7 -8
  199. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js.map +1 -1
  200. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.d.ts +6 -2
  201. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js +8 -6
  202. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js.map +1 -1
  203. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.d.ts +3 -1
  204. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js +1 -3
  205. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js.map +1 -1
  206. package/features/contentEntry/ListEntries/ListEntriesRepository.d.ts +6 -4
  207. package/features/contentEntry/ListEntries/ListEntriesRepository.js +8 -9
  208. package/features/contentEntry/ListEntries/ListEntriesRepository.js.map +1 -1
  209. package/features/contentEntry/ListEntries/ListEntriesUseCase.d.ts +3 -1
  210. package/features/contentEntry/ListEntries/ListEntriesUseCase.js +2 -3
  211. package/features/contentEntry/ListEntries/ListEntriesUseCase.js.map +1 -1
  212. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.d.ts +3 -1
  213. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js +1 -3
  214. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js.map +1 -1
  215. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.d.ts +3 -1
  216. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js +1 -3
  217. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js.map +1 -1
  218. package/features/contentEntry/MoveEntry/MoveEntryRepository.d.ts +6 -4
  219. package/features/contentEntry/MoveEntry/MoveEntryRepository.js +7 -8
  220. package/features/contentEntry/MoveEntry/MoveEntryRepository.js.map +1 -1
  221. package/features/contentEntry/MoveEntry/MoveEntryUseCase.d.ts +5 -3
  222. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js +13 -7
  223. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js.map +1 -1
  224. package/features/contentEntry/PublishEntry/PublishEntryRepository.d.ts +7 -5
  225. package/features/contentEntry/PublishEntry/PublishEntryRepository.js +8 -9
  226. package/features/contentEntry/PublishEntry/PublishEntryRepository.js.map +1 -1
  227. package/features/contentEntry/PublishEntry/PublishEntryUseCase.d.ts +7 -7
  228. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js +13 -16
  229. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js.map +1 -1
  230. package/features/contentEntry/PublishEntry/abstractions.d.ts +8 -1
  231. package/features/contentEntry/PublishEntry/abstractions.js.map +1 -1
  232. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.d.ts +8 -4
  233. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js +11 -9
  234. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js.map +1 -1
  235. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.d.ts +5 -3
  236. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js +7 -6
  237. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js.map +1 -1
  238. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.d.ts +6 -4
  239. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js +7 -8
  240. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js.map +1 -1
  241. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.d.ts +5 -3
  242. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js +4 -5
  243. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js.map +1 -1
  244. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.d.ts +6 -4
  245. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js +7 -8
  246. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js.map +1 -1
  247. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.d.ts +5 -3
  248. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js +7 -6
  249. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js.map +1 -1
  250. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.d.ts +7 -5
  251. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js +7 -8
  252. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js.map +1 -1
  253. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.d.ts +5 -3
  254. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js +7 -6
  255. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js.map +1 -1
  256. package/features/contentEntry/UpdateEntrySystem/UpdateEntrySystemUseCase.d.ts +19 -0
  257. package/features/contentEntry/UpdateEntrySystem/UpdateEntrySystemUseCase.js +70 -0
  258. package/features/contentEntry/UpdateEntrySystem/UpdateEntrySystemUseCase.js.map +1 -0
  259. package/features/contentEntry/UpdateEntrySystem/abstractions.d.ts +24 -0
  260. package/features/contentEntry/UpdateEntrySystem/abstractions.js +5 -0
  261. package/features/contentEntry/UpdateEntrySystem/abstractions.js.map +1 -0
  262. package/features/contentEntry/UpdateEntrySystem/events.d.ts +29 -0
  263. package/features/contentEntry/UpdateEntrySystem/events.js +23 -0
  264. package/features/contentEntry/UpdateEntrySystem/events.js.map +1 -0
  265. package/features/contentEntry/UpdateEntrySystem/feature.d.ts +4 -0
  266. package/features/contentEntry/UpdateEntrySystem/feature.js +11 -0
  267. package/features/contentEntry/UpdateEntrySystem/feature.js.map +1 -0
  268. package/features/contentEntry/UpdateEntrySystem/index.d.ts +2 -0
  269. package/features/contentEntry/UpdateEntrySystem/index.js +2 -0
  270. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.d.ts +6 -4
  271. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js +6 -7
  272. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js.map +1 -1
  273. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.d.ts +3 -1
  274. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js +2 -3
  275. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js.map +1 -1
  276. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.d.ts +3 -1
  277. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js +1 -3
  278. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js.map +1 -1
  279. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.d.ts +8 -4
  280. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js +41 -16
  281. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js.map +1 -1
  282. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/abstractions.d.ts +17 -1
  283. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/abstractions.js.map +1 -1
  284. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.d.ts +8 -4
  285. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js +23 -18
  286. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js.map +1 -1
  287. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/abstractions.d.ts +15 -1
  288. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/abstractions.js.map +1 -1
  289. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.d.ts +8 -4
  290. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js +18 -15
  291. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js.map +1 -1
  292. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/abstractions.d.ts +13 -1
  293. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/abstractions.js.map +1 -1
  294. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.d.ts +9 -7
  295. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js +18 -20
  296. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js.map +1 -1
  297. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/abstractions.d.ts +14 -2
  298. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/abstractions.js.map +1 -1
  299. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.d.ts +8 -4
  300. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js +67 -31
  301. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js.map +1 -1
  302. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/abstractions.d.ts +15 -1
  303. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/abstractions.js.map +1 -1
  304. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.d.ts +24 -0
  305. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.js +13 -0
  306. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.js.map +1 -0
  307. package/features/contentModel/CreateModel/CreateModelRepository.d.ts +5 -6
  308. package/features/contentModel/CreateModel/CreateModelRepository.js +9 -12
  309. package/features/contentModel/CreateModel/CreateModelRepository.js.map +1 -1
  310. package/features/contentModel/CreateModel/CreateModelUseCase.js +2 -2
  311. package/features/contentModel/CreateModel/CreateModelUseCase.js.map +1 -1
  312. package/features/contentModel/CreateModel/abstractions.d.ts +1 -1
  313. package/features/contentModel/CreateModel/abstractions.js.map +1 -1
  314. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.d.ts +5 -6
  315. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js +9 -12
  316. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js.map +1 -1
  317. package/features/contentModel/CreateModelFrom/CreateModelFromUseCase.js +2 -2
  318. package/features/contentModel/CreateModelFrom/CreateModelFromUseCase.js.map +1 -1
  319. package/features/contentModel/CreateModelFrom/abstractions.d.ts +1 -1
  320. package/features/contentModel/CreateModelFrom/abstractions.js.map +1 -1
  321. package/features/contentModel/DeleteModel/DeleteModelRepository.d.ts +3 -3
  322. package/features/contentModel/DeleteModel/DeleteModelRepository.js +5 -5
  323. package/features/contentModel/DeleteModel/DeleteModelRepository.js.map +1 -1
  324. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.d.ts +9 -3
  325. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js +36 -18
  326. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js.map +1 -1
  327. package/features/contentModel/ModelToAstConverter/ModelToAstConverter.d.ts +1 -1
  328. package/features/contentModel/ModelToAstConverter/ModelToAstConverter.js.map +1 -1
  329. package/features/contentModel/ModelToAstConverter/abstractions.d.ts +1 -1
  330. package/features/contentModel/ModelToAstConverter/abstractions.js.map +1 -1
  331. package/features/contentModel/UpdateModel/UpdateModelRepository.d.ts +7 -4
  332. package/features/contentModel/UpdateModel/UpdateModelRepository.js +10 -6
  333. package/features/contentModel/UpdateModel/UpdateModelRepository.js.map +1 -1
  334. package/features/contentModel/UpdateModel/UpdateModelUseCase.js.map +1 -1
  335. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js +1 -1
  336. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js.map +1 -1
  337. package/features/contentModel/shared/ModelsFetcher.d.ts +9 -8
  338. package/features/contentModel/shared/ModelsFetcher.js +5 -5
  339. package/features/contentModel/shared/ModelsFetcher.js.map +1 -1
  340. package/features/contentModel/shared/PluginModelsProvider.d.ts +9 -5
  341. package/features/contentModel/shared/PluginModelsProvider.js +11 -15
  342. package/features/contentModel/shared/PluginModelsProvider.js.map +1 -1
  343. package/features/contentModel/shared/abstractions.d.ts +10 -0
  344. package/features/contentModel/shared/abstractions.js +2 -1
  345. package/features/contentModel/shared/abstractions.js.map +1 -1
  346. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.d.ts +11 -7
  347. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js +19 -19
  348. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js.map +1 -1
  349. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.d.ts +6 -2
  350. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js +9 -8
  351. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js.map +1 -1
  352. package/features/contentModelGroup/CreateGroup/abstractions.d.ts +1 -1
  353. package/features/contentModelGroup/CreateGroup/abstractions.js.map +1 -1
  354. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.d.ts +8 -4
  355. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js +11 -9
  356. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js.map +1 -1
  357. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.d.ts +3 -1
  358. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js +2 -3
  359. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js.map +1 -1
  360. package/features/contentModelGroup/GetGroup/GetGroupRepository.d.ts +6 -4
  361. package/features/contentModelGroup/GetGroup/GetGroupRepository.js +9 -9
  362. package/features/contentModelGroup/GetGroup/GetGroupRepository.js.map +1 -1
  363. package/features/contentModelGroup/GetGroup/GetGroupUseCase.d.ts +3 -1
  364. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js +2 -3
  365. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js.map +1 -1
  366. package/features/contentModelGroup/ListGroups/ListGroupsRepository.d.ts +6 -4
  367. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js +9 -9
  368. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js.map +1 -1
  369. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.d.ts +3 -1
  370. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js +2 -3
  371. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js.map +1 -1
  372. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.d.ts +6 -4
  373. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js +7 -8
  374. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js.map +1 -1
  375. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.d.ts +3 -1
  376. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js +2 -3
  377. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js.map +1 -1
  378. package/features/contentModelGroup/shared/PluginGroupsProvider.d.ts +6 -4
  379. package/features/contentModelGroup/shared/PluginGroupsProvider.js +13 -11
  380. package/features/contentModelGroup/shared/PluginGroupsProvider.js.map +1 -1
  381. package/features/contentModelGroup/shared/abstractions.d.ts +10 -0
  382. package/features/contentModelGroup/shared/abstractions.js +2 -1
  383. package/features/contentModelGroup/shared/abstractions.js.map +1 -1
  384. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.d.ts +2 -2
  385. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.js.map +1 -1
  386. package/features/graphql/fields/base/AssetToGraphQL.d.ts +1 -1
  387. package/features/graphql/fields/base/AssetToGraphQL.js +7 -2
  388. package/features/graphql/fields/base/AssetToGraphQL.js.map +1 -1
  389. package/features/graphql/fields/base/DynamicZoneToGraphQL.js.map +1 -1
  390. package/features/graphql/fields/base/RefToGraphQL.d.ts +1 -1
  391. package/features/graphql/fields/base/RefToGraphQL.js +14 -8
  392. package/features/graphql/fields/base/RefToGraphQL.js.map +1 -1
  393. package/features/graphql/fields/base/richText/richTextResolver.d.ts +1 -1
  394. package/features/graphql/fields/base/richText/richTextResolver.js.map +1 -1
  395. package/features/modelBuilder/abstractions.d.ts +4 -0
  396. package/features/modelBuilder/abstractions.js.map +1 -1
  397. package/features/modelBuilder/feature.js +1 -8
  398. package/features/modelBuilder/feature.js.map +1 -1
  399. package/features/modelBuilder/fields/DataFieldBuilder.d.ts +17 -0
  400. package/features/modelBuilder/fields/DataFieldBuilder.js +6 -0
  401. package/features/modelBuilder/fields/DataFieldBuilder.js.map +1 -1
  402. package/features/modelBuilder/fields/DateTimeFieldType.js +27 -12
  403. package/features/modelBuilder/fields/DateTimeFieldType.js.map +1 -1
  404. package/features/modelBuilder/fields/TextFieldType.d.ts +3 -1
  405. package/features/modelBuilder/fields/TextFieldType.js +1 -3
  406. package/features/modelBuilder/fields/TextFieldType.js.map +1 -1
  407. package/features/modelBuilder/fields/fieldTypeValidator.d.ts +5 -3
  408. package/features/modelBuilder/models/ModelBuilder.d.ts +8 -0
  409. package/features/modelBuilder/models/ModelBuilder.js +1 -0
  410. package/features/modelBuilder/models/ModelBuilder.js.map +1 -1
  411. package/features/modelBuilder/models/ModelsProvider.d.ts +1 -3
  412. package/features/modelBuilder/models/ModelsProvider.js +2 -7
  413. package/features/modelBuilder/models/ModelsProvider.js.map +1 -1
  414. package/features/modelBuilder/models/PrivateModelBuilder.d.ts +5 -0
  415. package/features/modelBuilder/models/PrivateModelBuilder.js +12 -1
  416. package/features/modelBuilder/models/PrivateModelBuilder.js.map +1 -1
  417. package/features/shared/abstractions.d.ts +8 -16
  418. package/features/shared/abstractions.js +2 -3
  419. package/features/shared/abstractions.js.map +1 -1
  420. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.d.ts +8 -0
  421. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js +5 -0
  422. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js.map +1 -0
  423. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.d.ts +8 -0
  424. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js +5 -0
  425. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js.map +1 -0
  426. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.d.ts +8 -0
  427. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js +5 -0
  428. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js.map +1 -0
  429. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.d.ts +8 -0
  430. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js +5 -0
  431. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js.map +1 -0
  432. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.d.ts +8 -0
  433. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js +5 -0
  434. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js.map +1 -0
  435. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.d.ts +8 -0
  436. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js +5 -0
  437. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js.map +1 -0
  438. package/features/shared/storageOperations/entry/GetEntryStorageOperation.d.ts +8 -0
  439. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js +5 -0
  440. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js.map +1 -0
  441. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.d.ts +8 -0
  442. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js +5 -0
  443. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js.map +1 -0
  444. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.d.ts +8 -0
  445. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js +5 -0
  446. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js.map +1 -0
  447. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.d.ts +8 -0
  448. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js +5 -0
  449. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js.map +1 -0
  450. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.d.ts +8 -0
  451. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js +5 -0
  452. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js.map +1 -0
  453. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.d.ts +8 -0
  454. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js +5 -0
  455. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js.map +1 -0
  456. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.d.ts +8 -0
  457. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js +5 -0
  458. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js.map +1 -0
  459. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.d.ts +8 -0
  460. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js +5 -0
  461. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js.map +1 -0
  462. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.d.ts +8 -0
  463. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js +5 -0
  464. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js.map +1 -0
  465. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.d.ts +8 -0
  466. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js +5 -0
  467. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js.map +1 -0
  468. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.d.ts +8 -0
  469. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js +5 -0
  470. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js.map +1 -0
  471. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.d.ts +8 -0
  472. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js +5 -0
  473. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js.map +1 -0
  474. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.d.ts +8 -0
  475. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js +5 -0
  476. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js.map +1 -0
  477. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.d.ts +8 -0
  478. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js +5 -0
  479. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js.map +1 -0
  480. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.d.ts +8 -0
  481. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js +5 -0
  482. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js.map +1 -0
  483. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.d.ts +8 -0
  484. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js +5 -0
  485. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js.map +1 -0
  486. package/features/shared/storageOperations/group/CreateGroupStorageOperation.d.ts +8 -0
  487. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js +5 -0
  488. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js.map +1 -0
  489. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.d.ts +8 -0
  490. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js +5 -0
  491. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js.map +1 -0
  492. package/features/shared/storageOperations/group/GetGroupStorageOperation.d.ts +8 -0
  493. package/features/shared/storageOperations/group/GetGroupStorageOperation.js +5 -0
  494. package/features/shared/storageOperations/group/GetGroupStorageOperation.js.map +1 -0
  495. package/features/shared/storageOperations/group/ListGroupsStorageOperation.d.ts +8 -0
  496. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js +5 -0
  497. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js.map +1 -0
  498. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.d.ts +8 -0
  499. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js +5 -0
  500. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js.map +1 -0
  501. package/features/shared/storageOperations/index.d.ts +32 -0
  502. package/features/shared/storageOperations/index.js +32 -0
  503. package/features/shared/storageOperations/model/CreateModelStorageOperation.d.ts +8 -0
  504. package/features/shared/storageOperations/model/CreateModelStorageOperation.js +5 -0
  505. package/features/shared/storageOperations/model/CreateModelStorageOperation.js.map +1 -0
  506. package/features/shared/storageOperations/model/DeleteModelStorageOperation.d.ts +8 -0
  507. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js +5 -0
  508. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js.map +1 -0
  509. package/features/shared/storageOperations/model/GetModelStorageOperation.d.ts +8 -0
  510. package/features/shared/storageOperations/model/GetModelStorageOperation.js +5 -0
  511. package/features/shared/storageOperations/model/GetModelStorageOperation.js.map +1 -0
  512. package/features/shared/storageOperations/model/ListModelsStorageOperation.d.ts +8 -0
  513. package/features/shared/storageOperations/model/ListModelsStorageOperation.js +5 -0
  514. package/features/shared/storageOperations/model/ListModelsStorageOperation.js.map +1 -0
  515. package/features/shared/storageOperations/model/UpdateModelStorageOperation.d.ts +8 -0
  516. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js +5 -0
  517. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js.map +1 -0
  518. package/features/validation/abstractions/CmsModelFieldValidator.d.ts +5 -0
  519. package/features/validation/abstractions/CmsModelFieldValidator.js.map +1 -1
  520. package/features/validation/validators/DateGteValidator.d.ts +2 -0
  521. package/features/validation/validators/DateGteValidator.js +12 -2
  522. package/features/validation/validators/DateGteValidator.js.map +1 -1
  523. package/features/validation/validators/DateLteValidator.d.ts +2 -0
  524. package/features/validation/validators/DateLteValidator.js +12 -2
  525. package/features/validation/validators/DateLteValidator.js.map +1 -1
  526. package/features/validation/validators/dateLimit.d.ts +9 -0
  527. package/features/validation/validators/dateLimit.js +18 -0
  528. package/features/validation/validators/dateLimit.js.map +1 -0
  529. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
  530. package/fieldConverters/abstractions.d.ts +14 -0
  531. package/fieldConverters/abstractions.js +13 -0
  532. package/fieldConverters/abstractions.js.map +1 -0
  533. package/graphql/CmsGraphQLSchemaFactory.d.ts +8 -0
  534. package/graphql/CmsGraphQLSchemaFactory.js +5 -0
  535. package/graphql/CmsGraphQLSchemaFactory.js.map +1 -0
  536. package/graphql/CmsSchemaExecutor.d.ts +10 -0
  537. package/graphql/CmsSchemaExecutor.js +5 -0
  538. package/graphql/CmsSchemaExecutor.js.map +1 -0
  539. package/graphql/buildSchemaPlugins.d.ts +2 -1
  540. package/graphql/buildSchemaPlugins.js +1 -3
  541. package/graphql/buildSchemaPlugins.js.map +1 -1
  542. package/graphql/checkEndpointAccess.js +5 -2
  543. package/graphql/checkEndpointAccess.js.map +1 -1
  544. package/graphql/createExecutableSchema.d.ts +1 -1
  545. package/graphql/createExecutableSchema.js +1 -1
  546. package/graphql/createExecutableSchema.js.map +1 -1
  547. package/graphql/generateSchema.d.ts +2 -1
  548. package/graphql/generateSchema.js +14 -5
  549. package/graphql/generateSchema.js.map +1 -1
  550. package/graphql/getSchema.js +7 -2
  551. package/graphql/getSchema.js.map +1 -1
  552. package/graphql/scalars/RevisionIdScalarPlugin.d.ts +1 -1
  553. package/graphql/scalars/RevisionIdScalarPlugin.js.map +1 -1
  554. package/graphql/schema/baseContentSchema.d.ts +1 -6
  555. package/graphql/schema/baseContentSchema.js +5 -8
  556. package/graphql/schema/baseContentSchema.js.map +1 -1
  557. package/graphql/schema/baseSchema.d.ts +2 -2
  558. package/graphql/schema/baseSchema.js +3 -18
  559. package/graphql/schema/baseSchema.js.map +1 -1
  560. package/graphql/schema/cms/CmsBaseErrorTypeFactory.d.ts +15 -0
  561. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js +25 -0
  562. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js.map +1 -0
  563. package/graphql/schema/cms/createEntryResolver.js +2 -2
  564. package/graphql/schema/cms/createEntryResolver.js.map +1 -1
  565. package/graphql/schema/cms/deleteEntryResolver.js +2 -2
  566. package/graphql/schema/cms/deleteEntryResolver.js.map +1 -1
  567. package/graphql/schema/cms/getEntryResolver.js +2 -2
  568. package/graphql/schema/cms/getEntryResolver.js.map +1 -1
  569. package/graphql/schema/cms/helpers/getModel.d.ts +0 -3
  570. package/graphql/schema/cms/helpers/getModel.js +5 -3
  571. package/graphql/schema/cms/helpers/getModel.js.map +1 -1
  572. package/graphql/schema/cms/listEntriesResolver.js +2 -2
  573. package/graphql/schema/cms/listEntriesResolver.js.map +1 -1
  574. package/graphql/schema/cms/publishEntryResolver.js +2 -2
  575. package/graphql/schema/cms/publishEntryResolver.js.map +1 -1
  576. package/graphql/schema/cms/resolvers/createEntry.d.ts +3 -2
  577. package/graphql/schema/cms/resolvers/createEntry.js +5 -1
  578. package/graphql/schema/cms/resolvers/createEntry.js.map +1 -1
  579. package/graphql/schema/cms/resolvers/deleteEntryRevision.d.ts +3 -2
  580. package/graphql/schema/cms/resolvers/deleteEntryRevision.js +5 -1
  581. package/graphql/schema/cms/resolvers/deleteEntryRevision.js.map +1 -1
  582. package/graphql/schema/cms/resolvers/getEntry.d.ts +3 -2
  583. package/graphql/schema/cms/resolvers/getEntry.js +5 -1
  584. package/graphql/schema/cms/resolvers/getEntry.js.map +1 -1
  585. package/graphql/schema/cms/resolvers/getModel.d.ts +3 -2
  586. package/graphql/schema/cms/resolvers/getModel.js +5 -1
  587. package/graphql/schema/cms/resolvers/getModel.js.map +1 -1
  588. package/graphql/schema/cms/resolvers/listEntries.d.ts +3 -2
  589. package/graphql/schema/cms/resolvers/listEntries.js +5 -1
  590. package/graphql/schema/cms/resolvers/listEntries.js.map +1 -1
  591. package/graphql/schema/cms/resolvers/mutationCms.d.ts +3 -2
  592. package/graphql/schema/cms/resolvers/mutationCms.js +5 -1
  593. package/graphql/schema/cms/resolvers/mutationCms.js.map +1 -1
  594. package/graphql/schema/cms/resolvers/publishEntryRevision.d.ts +3 -2
  595. package/graphql/schema/cms/resolvers/publishEntryRevision.js +5 -1
  596. package/graphql/schema/cms/resolvers/publishEntryRevision.js.map +1 -1
  597. package/graphql/schema/cms/resolvers/queryCms.d.ts +3 -2
  598. package/graphql/schema/cms/resolvers/queryCms.js +5 -1
  599. package/graphql/schema/cms/resolvers/queryCms.js.map +1 -1
  600. package/graphql/schema/cms/resolvers/unpublishEntryRevision.d.ts +3 -2
  601. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js +5 -1
  602. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js.map +1 -1
  603. package/graphql/schema/cms/resolvers/updateEntryRevision.d.ts +3 -2
  604. package/graphql/schema/cms/resolvers/updateEntryRevision.js +5 -1
  605. package/graphql/schema/cms/resolvers/updateEntryRevision.js.map +1 -1
  606. package/graphql/schema/cms/typeDefs/mutation.d.ts +3 -2
  607. package/graphql/schema/cms/typeDefs/mutation.js +5 -1
  608. package/graphql/schema/cms/typeDefs/mutation.js.map +1 -1
  609. package/graphql/schema/cms/typeDefs/query.d.ts +3 -2
  610. package/graphql/schema/cms/typeDefs/query.js +5 -1
  611. package/graphql/schema/cms/typeDefs/query.js.map +1 -1
  612. package/graphql/schema/cms/typeDefs/responses.d.ts +3 -2
  613. package/graphql/schema/cms/typeDefs/responses.js +5 -1
  614. package/graphql/schema/cms/typeDefs/responses.js.map +1 -1
  615. package/graphql/schema/cms/unpublishEntryResolver.js +2 -2
  616. package/graphql/schema/cms/unpublishEntryResolver.js.map +1 -1
  617. package/graphql/schema/cms/updateEntryResolver.js +2 -2
  618. package/graphql/schema/cms/updateEntryResolver.js.map +1 -1
  619. package/graphql/schema/contentEntries.js +60 -34
  620. package/graphql/schema/contentEntries.js.map +1 -1
  621. package/graphql/schema/contentModelGroups.js +39 -18
  622. package/graphql/schema/contentModelGroups.js.map +1 -1
  623. package/graphql/schema/contentModels.js +32 -15
  624. package/graphql/schema/contentModels.js.map +1 -1
  625. package/graphql/schema/createFieldResolvers.d.ts +1 -1
  626. package/graphql/schema/createFieldResolvers.js.map +1 -1
  627. package/graphql/schema/createManageResolvers.js +7 -3
  628. package/graphql/schema/createManageResolvers.js.map +1 -1
  629. package/graphql/schema/createManageSDL.js +2 -0
  630. package/graphql/schema/createManageSDL.js.map +1 -1
  631. package/graphql/schema/resolvers/manage/resolveCreate.js +5 -3
  632. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
  633. package/graphql/schema/resolvers/manage/resolveCreateFrom.js +5 -3
  634. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
  635. package/graphql/schema/resolvers/manage/resolveDelete.js +9 -4
  636. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
  637. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +5 -3
  638. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -1
  639. package/graphql/schema/resolvers/manage/resolveDuplicate.d.ts +7 -0
  640. package/graphql/schema/resolvers/manage/resolveDuplicate.js +11 -0
  641. package/graphql/schema/resolvers/manage/resolveDuplicate.js.map +1 -0
  642. package/graphql/schema/resolvers/manage/resolveGet.js +11 -6
  643. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
  644. package/graphql/schema/resolvers/manage/resolveGetByIds.js +5 -3
  645. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
  646. package/graphql/schema/resolvers/manage/resolveGetRevisions.js +5 -3
  647. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
  648. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +5 -3
  649. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -1
  650. package/graphql/schema/resolvers/manage/resolveList.js +5 -3
  651. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
  652. package/graphql/schema/resolvers/manage/resolveListDeleted.js +5 -3
  653. package/graphql/schema/resolvers/manage/resolveListDeleted.js.map +1 -1
  654. package/graphql/schema/resolvers/manage/resolveMove.js +4 -2
  655. package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -1
  656. package/graphql/schema/resolvers/manage/resolvePublish.js +5 -3
  657. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
  658. package/graphql/schema/resolvers/manage/resolveRepublish.js +5 -3
  659. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
  660. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js +5 -3
  661. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js.map +1 -1
  662. package/graphql/schema/resolvers/manage/resolveUnpublish.js +5 -3
  663. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
  664. package/graphql/schema/resolvers/manage/resolveUpdate.js +5 -3
  665. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
  666. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js +5 -3
  667. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js.map +1 -1
  668. package/graphql/schema/resolvers/manage/resolveValidate.js +5 -3
  669. package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -1
  670. package/graphql/schema/resolvers/preview/resolveGet.js +6 -3
  671. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
  672. package/graphql/schema/resolvers/preview/resolveList.js +5 -3
  673. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
  674. package/graphql/schema/resolvers/read/resolveGet.js +5 -2
  675. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
  676. package/graphql/schema/resolvers/read/resolveList.js +5 -3
  677. package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
  678. package/graphql/schema/resolvers/singular/resolveGet.js +1 -1
  679. package/graphql/schema/resolvers/singular/resolveGet.js.map +1 -1
  680. package/graphql/schema/resolvers/singular/resolveUpdate.js +1 -1
  681. package/graphql/schema/resolvers/singular/resolveUpdate.js.map +1 -1
  682. package/graphql/schema/schemaPlugins.d.ts +2 -1
  683. package/graphql/schema/schemaPlugins.js +2 -4
  684. package/graphql/schema/schemaPlugins.js.map +1 -1
  685. package/index.d.ts +7 -3
  686. package/index.js +4 -2
  687. package/legacy/abstractions.js.map +1 -1
  688. package/package.json +21 -24
  689. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.d.ts +2 -2
  690. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js +1 -1
  691. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js.map +1 -1
  692. package/plugins/index.d.ts +0 -1
  693. package/plugins/index.js +0 -1
  694. package/types/index.d.ts +0 -1
  695. package/types/modelField.d.ts +11 -0
  696. package/types/types.d.ts +19 -291
  697. package/types/types.js.map +1 -1
  698. package/utils/converters/ConverterCollection.d.ts +2 -2
  699. package/utils/converters/ConverterCollection.js +1 -3
  700. package/utils/converters/ConverterCollection.js.map +1 -1
  701. package/utils/converters/valueKeyFromStorageConverter.d.ts +2 -2
  702. package/utils/converters/valueKeyFromStorageConverter.js +2 -2
  703. package/utils/converters/valueKeyFromStorageConverter.js.map +1 -1
  704. package/utils/converters/valueKeyStorageConverter.js +4 -2
  705. package/utils/converters/valueKeyStorageConverter.js.map +1 -1
  706. package/utils/converters/valueKeyToStorageConverter.d.ts +2 -2
  707. package/utils/converters/valueKeyToStorageConverter.js +2 -2
  708. package/utils/converters/valueKeyToStorageConverter.js.map +1 -1
  709. package/utils/createModelField.js +2 -1
  710. package/utils/createModelField.js.map +1 -1
  711. package/utils/createModelSchemaKey.d.ts +8 -0
  712. package/utils/createModelSchemaKey.js +18 -0
  713. package/utils/createModelSchemaKey.js.map +1 -0
  714. package/utils/getSchemaFromFieldPlugins.d.ts +2 -2
  715. package/utils/getSchemaFromFieldPlugins.js.map +1 -1
  716. package/utils/isHeadlessCmsReady.d.ts +1 -1
  717. package/utils/isHeadlessCmsReady.js +3 -2
  718. package/utils/isHeadlessCmsReady.js.map +1 -1
  719. package/abstractions/entryHooks/OnEntryBeforeCreate.d.ts +0 -8
  720. package/abstractions/entryHooks/OnEntryBeforeCreate.js +0 -5
  721. package/abstractions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  722. package/abstractions/entryHooks/index.d.ts +0 -1
  723. package/abstractions/entryHooks/index.js +0 -1
  724. package/abstractions/index.d.ts +0 -1
  725. package/abstractions/index.js +0 -1
  726. package/context.d.ts +0 -3
  727. package/context.js +0 -131
  728. package/context.js.map +0 -1
  729. package/crud/contentEntry.crud.d.ts +0 -6
  730. package/crud/contentEntry.crud.js +0 -307
  731. package/crud/contentEntry.crud.js.map +0 -1
  732. package/crud/contentModel.crud.d.ts +0 -5
  733. package/crud/contentModel.crud.js +0 -77
  734. package/crud/contentModel.crud.js.map +0 -1
  735. package/crud/contentModelGroup.crud.d.ts +0 -5
  736. package/crud/contentModelGroup.crud.js +0 -74
  737. package/crud/contentModelGroup.crud.js.map +0 -1
  738. package/extension.d.ts +0 -3
  739. package/extension.js +0 -19
  740. package/extension.js.map +0 -1
  741. package/extensions/entryHooks/OnEntryBeforeCreate.d.ts +0 -4
  742. package/extensions/entryHooks/OnEntryBeforeCreate.js +0 -21
  743. package/extensions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  744. package/extensions/entryHooks/index.d.ts +0 -1
  745. package/extensions/entryHooks/index.js +0 -1
  746. package/extensions/index.d.ts +0 -5
  747. package/extensions/index.js +0 -7
  748. package/extensions/index.js.map +0 -1
  749. package/features/contentEntry/UpdateRevision/UpdateRevisionRepository.d.ts +0 -14
  750. package/features/contentEntry/UpdateRevision/UpdateRevisionRepository.js +0 -34
  751. package/features/contentEntry/UpdateRevision/UpdateRevisionRepository.js.map +0 -1
  752. package/features/contentEntry/UpdateRevision/abstractions.d.ts +0 -10
  753. package/features/contentEntry/UpdateRevision/abstractions.js +0 -5
  754. package/features/contentEntry/UpdateRevision/abstractions.js.map +0 -1
  755. package/features/contentEntry/UpdateRevision/feature.js +0 -11
  756. package/features/contentEntry/UpdateRevision/feature.js.map +0 -1
  757. package/features/contentEntry/UpdateRevision/index.d.ts +0 -1
  758. package/features/contentEntry/UpdateRevision/index.js +0 -1
  759. package/graphql/graphQLHandlerFactory.d.ts +0 -5
  760. package/graphql/graphQLHandlerFactory.js +0 -22
  761. package/graphql/graphQLHandlerFactory.js.map +0 -1
  762. package/graphql/handleRequest.d.ts +0 -11
  763. package/graphql/handleRequest.js +0 -62
  764. package/graphql/handleRequest.js.map +0 -1
  765. package/graphql/index.d.ts +0 -4
  766. package/graphql/index.js +0 -11
  767. package/graphql/index.js.map +0 -1
  768. package/graphql/schema/cms/index.d.ts +0 -2
  769. package/graphql/schema/cms/index.js +0 -25
  770. package/graphql/schema/cms/index.js.map +0 -1
  771. package/parameters/context.d.ts +0 -2
  772. package/parameters/context.js +0 -7
  773. package/parameters/context.js.map +0 -1
  774. package/parameters/header.d.ts +0 -2
  775. package/parameters/header.js +0 -13
  776. package/parameters/header.js.map +0 -1
  777. package/parameters/index.d.ts +0 -3
  778. package/parameters/index.js +0 -3
  779. package/parameters/path.d.ts +0 -2
  780. package/parameters/path.js +0 -12
  781. package/parameters/path.js.map +0 -1
  782. package/plugins/CmsParametersPlugin.d.ts +0 -18
  783. package/plugins/CmsParametersPlugin.js +0 -16
  784. package/plugins/CmsParametersPlugin.js.map +0 -1
  785. package/types/context.d.ts +0 -110
  786. package/types/context.js +0 -0
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const ListGroupsStorageOperation = createAbstraction("Cms/Group/ListGroupsStorageOperation");
3
+ export { ListGroupsStorageOperation };
4
+
5
+ //# sourceMappingURL=ListGroupsStorageOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/shared/storageOperations/group/ListGroupsStorageOperation.js","sources":["../../../../../src/features/shared/storageOperations/group/ListGroupsStorageOperation.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsGroup, CmsGroupStorageOperationsListParams } from \"~/types/index.js\";\n\nexport interface IListGroupsStorageOperation {\n execute(params: CmsGroupStorageOperationsListParams): Promise<CmsGroup[]>;\n}\n\nexport const ListGroupsStorageOperation = createAbstraction<IListGroupsStorageOperation>(\n \"Cms/Group/ListGroupsStorageOperation\"\n);\n\nexport namespace ListGroupsStorageOperation {\n export type Interface = IListGroupsStorageOperation;\n}\n"],"names":["ListGroupsStorageOperation","createAbstraction"],"mappings":";AAOO,MAAMA,6BAA6BC,kBACtC"}
@@ -0,0 +1,8 @@
1
+ import type { CmsGroupStorageOperationsUpdateParams } from "../../../../types/index.js";
2
+ export interface IUpdateGroupStorageOperation {
3
+ execute(params: CmsGroupStorageOperationsUpdateParams): Promise<void>;
4
+ }
5
+ export declare const UpdateGroupStorageOperation: import("@webiny/di").Abstraction<IUpdateGroupStorageOperation>;
6
+ export declare namespace UpdateGroupStorageOperation {
7
+ type Interface = IUpdateGroupStorageOperation;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const UpdateGroupStorageOperation = createAbstraction("Cms/Group/UpdateGroupStorageOperation");
3
+ export { UpdateGroupStorageOperation };
4
+
5
+ //# sourceMappingURL=UpdateGroupStorageOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/shared/storageOperations/group/UpdateGroupStorageOperation.js","sources":["../../../../../src/features/shared/storageOperations/group/UpdateGroupStorageOperation.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsGroupStorageOperationsUpdateParams } from \"~/types/index.js\";\n\nexport interface IUpdateGroupStorageOperation {\n execute(params: CmsGroupStorageOperationsUpdateParams): Promise<void>;\n}\n\nexport const UpdateGroupStorageOperation = createAbstraction<IUpdateGroupStorageOperation>(\n \"Cms/Group/UpdateGroupStorageOperation\"\n);\n\nexport namespace UpdateGroupStorageOperation {\n export type Interface = IUpdateGroupStorageOperation;\n}\n"],"names":["UpdateGroupStorageOperation","createAbstraction"],"mappings":";AAOO,MAAMA,8BAA8BC,kBACvC"}
@@ -0,0 +1,32 @@
1
+ export { GetGroupStorageOperation } from "./group/GetGroupStorageOperation.js";
2
+ export { ListGroupsStorageOperation } from "./group/ListGroupsStorageOperation.js";
3
+ export { CreateGroupStorageOperation } from "./group/CreateGroupStorageOperation.js";
4
+ export { UpdateGroupStorageOperation } from "./group/UpdateGroupStorageOperation.js";
5
+ export { DeleteGroupStorageOperation } from "./group/DeleteGroupStorageOperation.js";
6
+ export { GetModelStorageOperation } from "./model/GetModelStorageOperation.js";
7
+ export { ListModelsStorageOperation } from "./model/ListModelsStorageOperation.js";
8
+ export { CreateModelStorageOperation } from "./model/CreateModelStorageOperation.js";
9
+ export { UpdateModelStorageOperation } from "./model/UpdateModelStorageOperation.js";
10
+ export { DeleteModelStorageOperation } from "./model/DeleteModelStorageOperation.js";
11
+ export { CreateEntryStorageOperation } from "./entry/CreateEntryStorageOperation.js";
12
+ export { CreateEntryRevisionFromStorageOperation } from "./entry/CreateEntryRevisionFromStorageOperation.js";
13
+ export { UpdateEntryStorageOperation } from "./entry/UpdateEntryStorageOperation.js";
14
+ export { DeleteEntryStorageOperation } from "./entry/DeleteEntryStorageOperation.js";
15
+ export { DeleteEntryRevisionStorageOperation } from "./entry/DeleteEntryRevisionStorageOperation.js";
16
+ export { DeleteMultipleEntriesStorageOperation } from "./entry/DeleteMultipleEntriesStorageOperation.js";
17
+ export { MoveToBinStorageOperation } from "./entry/MoveToBinStorageOperation.js";
18
+ export { RestoreFromBinStorageOperation } from "./entry/RestoreFromBinStorageOperation.js";
19
+ export { PublishEntryStorageOperation } from "./entry/PublishEntryStorageOperation.js";
20
+ export { UnpublishEntryStorageOperation } from "./entry/UnpublishEntryStorageOperation.js";
21
+ export { MoveEntryStorageOperation } from "./entry/MoveEntryStorageOperation.js";
22
+ export { GetEntryStorageOperation } from "./entry/GetEntryStorageOperation.js";
23
+ export { ListEntriesStorageOperation } from "./entry/ListEntriesStorageOperation.js";
24
+ export { GetEntriesByIdsStorageOperation } from "./entry/GetEntriesByIdsStorageOperation.js";
25
+ export { GetLatestEntriesByIdsStorageOperation } from "./entry/GetLatestEntriesByIdsStorageOperation.js";
26
+ export { GetPublishedEntriesByIdsStorageOperation } from "./entry/GetPublishedEntriesByIdsStorageOperation.js";
27
+ export { GetRevisionsStorageOperation } from "./entry/GetRevisionsStorageOperation.js";
28
+ export { GetRevisionByIdStorageOperation } from "./entry/GetRevisionByIdStorageOperation.js";
29
+ export { GetPublishedRevisionByEntryIdStorageOperation } from "./entry/GetPublishedRevisionByEntryIdStorageOperation.js";
30
+ export { GetLatestRevisionByEntryIdStorageOperation } from "./entry/GetLatestRevisionByEntryIdStorageOperation.js";
31
+ export { GetPreviousRevisionStorageOperation } from "./entry/GetPreviousRevisionStorageOperation.js";
32
+ export { GetUniqueFieldValuesStorageOperation } from "./entry/GetUniqueFieldValuesStorageOperation.js";
@@ -0,0 +1,32 @@
1
+ export { GetGroupStorageOperation } from "./group/GetGroupStorageOperation.js";
2
+ export { ListGroupsStorageOperation } from "./group/ListGroupsStorageOperation.js";
3
+ export { CreateGroupStorageOperation } from "./group/CreateGroupStorageOperation.js";
4
+ export { UpdateGroupStorageOperation } from "./group/UpdateGroupStorageOperation.js";
5
+ export { DeleteGroupStorageOperation } from "./group/DeleteGroupStorageOperation.js";
6
+ export { GetModelStorageOperation } from "./model/GetModelStorageOperation.js";
7
+ export { ListModelsStorageOperation } from "./model/ListModelsStorageOperation.js";
8
+ export { CreateModelStorageOperation } from "./model/CreateModelStorageOperation.js";
9
+ export { UpdateModelStorageOperation } from "./model/UpdateModelStorageOperation.js";
10
+ export { DeleteModelStorageOperation } from "./model/DeleteModelStorageOperation.js";
11
+ export { CreateEntryStorageOperation } from "./entry/CreateEntryStorageOperation.js";
12
+ export { CreateEntryRevisionFromStorageOperation } from "./entry/CreateEntryRevisionFromStorageOperation.js";
13
+ export { UpdateEntryStorageOperation } from "./entry/UpdateEntryStorageOperation.js";
14
+ export { DeleteEntryStorageOperation } from "./entry/DeleteEntryStorageOperation.js";
15
+ export { DeleteEntryRevisionStorageOperation } from "./entry/DeleteEntryRevisionStorageOperation.js";
16
+ export { DeleteMultipleEntriesStorageOperation } from "./entry/DeleteMultipleEntriesStorageOperation.js";
17
+ export { MoveToBinStorageOperation } from "./entry/MoveToBinStorageOperation.js";
18
+ export { RestoreFromBinStorageOperation } from "./entry/RestoreFromBinStorageOperation.js";
19
+ export { PublishEntryStorageOperation } from "./entry/PublishEntryStorageOperation.js";
20
+ export { UnpublishEntryStorageOperation } from "./entry/UnpublishEntryStorageOperation.js";
21
+ export { MoveEntryStorageOperation } from "./entry/MoveEntryStorageOperation.js";
22
+ export { GetEntryStorageOperation } from "./entry/GetEntryStorageOperation.js";
23
+ export { ListEntriesStorageOperation } from "./entry/ListEntriesStorageOperation.js";
24
+ export { GetEntriesByIdsStorageOperation } from "./entry/GetEntriesByIdsStorageOperation.js";
25
+ export { GetLatestEntriesByIdsStorageOperation } from "./entry/GetLatestEntriesByIdsStorageOperation.js";
26
+ export { GetPublishedEntriesByIdsStorageOperation } from "./entry/GetPublishedEntriesByIdsStorageOperation.js";
27
+ export { GetRevisionsStorageOperation } from "./entry/GetRevisionsStorageOperation.js";
28
+ export { GetRevisionByIdStorageOperation } from "./entry/GetRevisionByIdStorageOperation.js";
29
+ export { GetPublishedRevisionByEntryIdStorageOperation } from "./entry/GetPublishedRevisionByEntryIdStorageOperation.js";
30
+ export { GetLatestRevisionByEntryIdStorageOperation } from "./entry/GetLatestRevisionByEntryIdStorageOperation.js";
31
+ export { GetPreviousRevisionStorageOperation } from "./entry/GetPreviousRevisionStorageOperation.js";
32
+ export { GetUniqueFieldValuesStorageOperation } from "./entry/GetUniqueFieldValuesStorageOperation.js";
@@ -0,0 +1,8 @@
1
+ import type { StorageCmsModel, CmsModelStorageOperationsCreateParams } from "../../../../types/index.js";
2
+ export interface ICreateModelStorageOperation {
3
+ execute(params: CmsModelStorageOperationsCreateParams): Promise<StorageCmsModel>;
4
+ }
5
+ export declare const CreateModelStorageOperation: import("@webiny/di").Abstraction<ICreateModelStorageOperation>;
6
+ export declare namespace CreateModelStorageOperation {
7
+ type Interface = ICreateModelStorageOperation;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CreateModelStorageOperation = createAbstraction("Cms/Model/CreateModelStorageOperation");
3
+ export { CreateModelStorageOperation };
4
+
5
+ //# sourceMappingURL=CreateModelStorageOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/shared/storageOperations/model/CreateModelStorageOperation.js","sources":["../../../../../src/features/shared/storageOperations/model/CreateModelStorageOperation.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { StorageCmsModel, CmsModelStorageOperationsCreateParams } from \"~/types/index.js\";\n\nexport interface ICreateModelStorageOperation {\n execute(params: CmsModelStorageOperationsCreateParams): Promise<StorageCmsModel>;\n}\n\nexport const CreateModelStorageOperation = createAbstraction<ICreateModelStorageOperation>(\n \"Cms/Model/CreateModelStorageOperation\"\n);\n\nexport namespace CreateModelStorageOperation {\n export type Interface = ICreateModelStorageOperation;\n}\n"],"names":["CreateModelStorageOperation","createAbstraction"],"mappings":";AAOO,MAAMA,8BAA8BC,kBACvC"}
@@ -0,0 +1,8 @@
1
+ import type { CmsModelStorageOperationsDeleteParams } from "../../../../types/index.js";
2
+ export interface IDeleteModelStorageOperation {
3
+ execute(params: CmsModelStorageOperationsDeleteParams): Promise<void>;
4
+ }
5
+ export declare const DeleteModelStorageOperation: import("@webiny/di").Abstraction<IDeleteModelStorageOperation>;
6
+ export declare namespace DeleteModelStorageOperation {
7
+ type Interface = IDeleteModelStorageOperation;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const DeleteModelStorageOperation = createAbstraction("Cms/Model/DeleteModelStorageOperation");
3
+ export { DeleteModelStorageOperation };
4
+
5
+ //# sourceMappingURL=DeleteModelStorageOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/shared/storageOperations/model/DeleteModelStorageOperation.js","sources":["../../../../../src/features/shared/storageOperations/model/DeleteModelStorageOperation.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsModelStorageOperationsDeleteParams } from \"~/types/index.js\";\n\nexport interface IDeleteModelStorageOperation {\n execute(params: CmsModelStorageOperationsDeleteParams): Promise<void>;\n}\n\nexport const DeleteModelStorageOperation = createAbstraction<IDeleteModelStorageOperation>(\n \"Cms/Model/DeleteModelStorageOperation\"\n);\n\nexport namespace DeleteModelStorageOperation {\n export type Interface = IDeleteModelStorageOperation;\n}\n"],"names":["DeleteModelStorageOperation","createAbstraction"],"mappings":";AAOO,MAAMA,8BAA8BC,kBACvC"}
@@ -0,0 +1,8 @@
1
+ import type { StorageCmsModel, CmsModelStorageOperationsGetParams } from "../../../../types/index.js";
2
+ export interface IGetModelStorageOperation {
3
+ execute(params: CmsModelStorageOperationsGetParams): Promise<StorageCmsModel | null>;
4
+ }
5
+ export declare const GetModelStorageOperation: import("@webiny/di").Abstraction<IGetModelStorageOperation>;
6
+ export declare namespace GetModelStorageOperation {
7
+ type Interface = IGetModelStorageOperation;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const GetModelStorageOperation = createAbstraction("Cms/Model/GetModelStorageOperation");
3
+ export { GetModelStorageOperation };
4
+
5
+ //# sourceMappingURL=GetModelStorageOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/shared/storageOperations/model/GetModelStorageOperation.js","sources":["../../../../../src/features/shared/storageOperations/model/GetModelStorageOperation.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { StorageCmsModel, CmsModelStorageOperationsGetParams } from \"~/types/index.js\";\n\nexport interface IGetModelStorageOperation {\n execute(params: CmsModelStorageOperationsGetParams): Promise<StorageCmsModel | null>;\n}\n\nexport const GetModelStorageOperation = createAbstraction<IGetModelStorageOperation>(\n \"Cms/Model/GetModelStorageOperation\"\n);\n\nexport namespace GetModelStorageOperation {\n export type Interface = IGetModelStorageOperation;\n}\n"],"names":["GetModelStorageOperation","createAbstraction"],"mappings":";AAOO,MAAMA,2BAA2BC,kBACpC"}
@@ -0,0 +1,8 @@
1
+ import type { StorageCmsModel, CmsModelStorageOperationsListParams } from "../../../../types/index.js";
2
+ export interface IListModelsStorageOperation {
3
+ execute(params: CmsModelStorageOperationsListParams): Promise<StorageCmsModel[]>;
4
+ }
5
+ export declare const ListModelsStorageOperation: import("@webiny/di").Abstraction<IListModelsStorageOperation>;
6
+ export declare namespace ListModelsStorageOperation {
7
+ type Interface = IListModelsStorageOperation;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const ListModelsStorageOperation = createAbstraction("Cms/Model/ListModelsStorageOperation");
3
+ export { ListModelsStorageOperation };
4
+
5
+ //# sourceMappingURL=ListModelsStorageOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/shared/storageOperations/model/ListModelsStorageOperation.js","sources":["../../../../../src/features/shared/storageOperations/model/ListModelsStorageOperation.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { StorageCmsModel, CmsModelStorageOperationsListParams } from \"~/types/index.js\";\n\nexport interface IListModelsStorageOperation {\n execute(params: CmsModelStorageOperationsListParams): Promise<StorageCmsModel[]>;\n}\n\nexport const ListModelsStorageOperation = createAbstraction<IListModelsStorageOperation>(\n \"Cms/Model/ListModelsStorageOperation\"\n);\n\nexport namespace ListModelsStorageOperation {\n export type Interface = IListModelsStorageOperation;\n}\n"],"names":["ListModelsStorageOperation","createAbstraction"],"mappings":";AAOO,MAAMA,6BAA6BC,kBACtC"}
@@ -0,0 +1,8 @@
1
+ import type { StorageCmsModel, CmsModelStorageOperationsUpdateParams } from "../../../../types/index.js";
2
+ export interface IUpdateModelStorageOperation {
3
+ execute(params: CmsModelStorageOperationsUpdateParams): Promise<StorageCmsModel>;
4
+ }
5
+ export declare const UpdateModelStorageOperation: import("@webiny/di").Abstraction<IUpdateModelStorageOperation>;
6
+ export declare namespace UpdateModelStorageOperation {
7
+ type Interface = IUpdateModelStorageOperation;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const UpdateModelStorageOperation = createAbstraction("Cms/Model/UpdateModelStorageOperation");
3
+ export { UpdateModelStorageOperation };
4
+
5
+ //# sourceMappingURL=UpdateModelStorageOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/shared/storageOperations/model/UpdateModelStorageOperation.js","sources":["../../../../../src/features/shared/storageOperations/model/UpdateModelStorageOperation.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { StorageCmsModel, CmsModelStorageOperationsUpdateParams } from \"~/types/index.js\";\n\nexport interface IUpdateModelStorageOperation {\n execute(params: CmsModelStorageOperationsUpdateParams): Promise<StorageCmsModel>;\n}\n\nexport const UpdateModelStorageOperation = createAbstraction<IUpdateModelStorageOperation>(\n \"Cms/Model/UpdateModelStorageOperation\"\n);\n\nexport namespace UpdateModelStorageOperation {\n export type Interface = IUpdateModelStorageOperation;\n}\n"],"names":["UpdateModelStorageOperation","createAbstraction"],"mappings":";AAOO,MAAMA,8BAA8BC,kBACvC"}
@@ -2,6 +2,11 @@ import type { CmsModelFieldValidatorValidateParams } from "../../../types/index.
2
2
  export interface ICmsModelFieldValidator {
3
3
  readonly name: string;
4
4
  validate(params: CmsModelFieldValidatorValidateParams): Promise<boolean>;
5
+ /**
6
+ * The message for a value that failed, when the validator fills in variables of its own.
7
+ * Without it, the validator's message is used as it is.
8
+ */
9
+ formatMessage?(message: string, params: CmsModelFieldValidatorValidateParams): string;
5
10
  }
6
11
  export declare const CmsModelFieldValidator: import("@webiny/di").Abstraction<ICmsModelFieldValidator>;
7
12
  export declare namespace CmsModelFieldValidator {
@@ -1 +1 @@
1
- {"version":3,"file":"features/validation/abstractions/CmsModelFieldValidator.js","sources":["../../../../src/features/validation/abstractions/CmsModelFieldValidator.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/createAbstraction.js\";\nimport type { CmsModelFieldValidatorValidateParams } from \"~/types/index.js\";\n\nexport interface ICmsModelFieldValidator {\n readonly name: string;\n validate(params: CmsModelFieldValidatorValidateParams): Promise<boolean>;\n}\n\nexport const CmsModelFieldValidator = createAbstraction<ICmsModelFieldValidator>(\n \"Cms/Model/Field/Validator\"\n);\n\nexport namespace CmsModelFieldValidator {\n export type Interface = ICmsModelFieldValidator;\n export type Params = CmsModelFieldValidatorValidateParams;\n export type Response = Promise<boolean>;\n}\n"],"names":["CmsModelFieldValidator","createAbstraction"],"mappings":";AAQO,MAAMA,yBAAyBC,kBAClC"}
1
+ {"version":3,"file":"features/validation/abstractions/CmsModelFieldValidator.js","sources":["../../../../src/features/validation/abstractions/CmsModelFieldValidator.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/createAbstraction.js\";\nimport type { CmsModelFieldValidatorValidateParams } from \"~/types/index.js\";\n\nexport interface ICmsModelFieldValidator {\n readonly name: string;\n validate(params: CmsModelFieldValidatorValidateParams): Promise<boolean>;\n /**\n * The message for a value that failed, when the validator fills in variables of its own.\n * Without it, the validator's message is used as it is.\n */\n formatMessage?(message: string, params: CmsModelFieldValidatorValidateParams): string;\n}\n\nexport const CmsModelFieldValidator = createAbstraction<ICmsModelFieldValidator>(\n \"Cms/Model/Field/Validator\"\n);\n\nexport namespace CmsModelFieldValidator {\n export type Interface = ICmsModelFieldValidator;\n export type Params = CmsModelFieldValidatorValidateParams;\n export type Response = Promise<boolean>;\n}\n"],"names":["CmsModelFieldValidator","createAbstraction"],"mappings":";AAaO,MAAMA,yBAAyBC,kBAClC"}
@@ -3,6 +3,8 @@ import type { CmsModelFieldValidatorValidateParams } from "../../../types/types.
3
3
  declare class DateGteValidatorImpl implements CmsModelFieldValidator.Interface {
4
4
  readonly name = "dateGte";
5
5
  validate({ value, validator }: CmsModelFieldValidatorValidateParams): Promise<boolean>;
6
+ /** A message's `{date}` is the limit, as `2008-10-19`. */
7
+ formatMessage(message: string, { validator }: CmsModelFieldValidatorValidateParams): string;
6
8
  }
7
9
  export declare const DateGteValidator: typeof DateGteValidatorImpl & {
8
10
  __abstraction: import("@webiny/di").Abstraction<import("../abstractions/CmsModelFieldValidator.js").ICmsModelFieldValidator>;
@@ -1,12 +1,22 @@
1
1
  import { validation } from "@webiny/validation";
2
2
  import { CmsModelFieldValidator } from "../abstractions/CmsModelFieldValidator.js";
3
+ import { formatDateLimitMessage, getDateLimit } from "./dateLimit.js";
3
4
  class DateGteValidatorImpl {
4
5
  async validate({ value, validator }) {
5
- const { value: gteValue, type } = validator.settings || {};
6
+ const { expression, type } = validator.settings || {};
7
+ let gteValue;
8
+ try {
9
+ gteValue = getDateLimit(validator.settings, "gte");
10
+ } catch {
11
+ return false;
12
+ }
6
13
  if (void 0 === gteValue) return true;
7
- if ("time" === type) return validation.validate(value, `timeGte:${gteValue}`).then((v)=>true === v).catch(()=>false);
14
+ if ("time" === type && "string" != typeof expression) return validation.validate(value, `timeGte:${gteValue}`).then((v)=>true === v).catch(()=>false);
8
15
  return validation.validate(value, `dateGte:${gteValue}`).then((v)=>true === v).catch(()=>false);
9
16
  }
17
+ formatMessage(message, { validator }) {
18
+ return formatDateLimitMessage(message, validator.settings, "gte");
19
+ }
10
20
  constructor(){
11
21
  this.name = "dateGte";
12
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"features/validation/validators/DateGteValidator.js","sources":["../../../../src/features/validation/validators/DateGteValidator.ts"],"sourcesContent":["import { validation } from \"@webiny/validation\";\nimport { CmsModelFieldValidator } from \"../abstractions/CmsModelFieldValidator.js\";\nimport type { CmsModelFieldValidatorValidateParams } from \"~/types/types.js\";\n\nclass DateGteValidatorImpl implements CmsModelFieldValidator.Interface {\n public readonly name = \"dateGte\";\n\n public async validate({\n value,\n validator\n }: CmsModelFieldValidatorValidateParams): Promise<boolean> {\n const { value: gteValue, type } = validator.settings || {};\n if (typeof gteValue === \"undefined\") {\n return true;\n } else if (type === \"time\") {\n return validation\n .validate(value, `timeGte:${gteValue}`)\n .then(v => v === true)\n .catch(() => false);\n }\n return validation\n .validate(value, `dateGte:${gteValue}`)\n .then(v => v === true)\n .catch(() => false);\n }\n}\n\nexport const DateGteValidator = CmsModelFieldValidator.createImplementation({\n implementation: DateGteValidatorImpl,\n dependencies: []\n});\n"],"names":["DateGteValidatorImpl","value","validator","gteValue","type","validation","v","DateGteValidator","CmsModelFieldValidator"],"mappings":";;AAIA,MAAMA;IAGF,MAAa,SAAS,EAClBC,KAAK,EACLC,SAAS,EAC0B,EAAoB;QACvD,MAAM,EAAE,OAAOC,QAAQ,EAAEC,IAAI,EAAE,GAAGF,UAAU,QAAQ,IAAI,CAAC;QACzD,IAAI,AAAoB,WAAbC,UACP,OAAO;QACJ,IAAIC,AAAS,WAATA,MACP,OAAOC,WAAAA,QACM,CAACJ,OAAO,CAAC,QAAQ,EAAEE,UAAU,EACrC,IAAI,CAACG,CAAAA,IAAKA,AAAM,SAANA,GACV,KAAK,CAAC,IAAM;QAErB,OAAOD,WAAAA,QACM,CAACJ,OAAO,CAAC,QAAQ,EAAEE,UAAU,EACrC,IAAI,CAACG,CAAAA,IAAKA,AAAM,SAANA,GACV,KAAK,CAAC,IAAM;IACrB;;aAnBgB,IAAI,GAAG;;AAoB3B;AAEO,MAAMC,mBAAmBC,uBAAuB,oBAAoB,CAAC;IACxE,gBAAgBR;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/validation/validators/DateGteValidator.js","sources":["../../../../src/features/validation/validators/DateGteValidator.ts"],"sourcesContent":["import { validation } from \"@webiny/validation\";\nimport { CmsModelFieldValidator } from \"../abstractions/CmsModelFieldValidator.js\";\nimport type { CmsModelFieldValidatorValidateParams } from \"~/types/types.js\";\nimport { formatDateLimitMessage, getDateLimit } from \"./dateLimit.js\";\n\nclass DateGteValidatorImpl implements CmsModelFieldValidator.Interface {\n public readonly name = \"dateGte\";\n\n public async validate({\n value,\n validator\n }: CmsModelFieldValidatorValidateParams): Promise<boolean> {\n const { expression, type } = validator.settings || {};\n let gteValue: unknown;\n try {\n gteValue = getDateLimit(validator.settings, \"gte\");\n } catch {\n return false;\n }\n if (typeof gteValue === \"undefined\") {\n return true;\n } else if (type === \"time\" && typeof expression !== \"string\") {\n return validation\n .validate(value, `timeGte:${gteValue}`)\n .then(v => v === true)\n .catch(() => false);\n }\n return validation\n .validate(value, `dateGte:${gteValue}`)\n .then(v => v === true)\n .catch(() => false);\n }\n\n /** A message's `{date}` is the limit, as `2008-10-19`. */\n public formatMessage(message: string, { validator }: CmsModelFieldValidatorValidateParams) {\n return formatDateLimitMessage(message, validator.settings, \"gte\");\n }\n}\n\nexport const DateGteValidator = CmsModelFieldValidator.createImplementation({\n implementation: DateGteValidatorImpl,\n dependencies: []\n});\n"],"names":["DateGteValidatorImpl","value","validator","expression","type","gteValue","getDateLimit","validation","v","message","formatDateLimitMessage","DateGteValidator","CmsModelFieldValidator"],"mappings":";;;AAKA,MAAMA;IAGF,MAAa,SAAS,EAClBC,KAAK,EACLC,SAAS,EAC0B,EAAoB;QACvD,MAAM,EAAEC,UAAU,EAAEC,IAAI,EAAE,GAAGF,UAAU,QAAQ,IAAI,CAAC;QACpD,IAAIG;QACJ,IAAI;YACAA,WAAWC,aAAaJ,UAAU,QAAQ,EAAE;QAChD,EAAE,OAAM;YACJ,OAAO;QACX;QACA,IAAI,AAAoB,WAAbG,UACP,OAAO;QACJ,IAAID,AAAS,WAATA,QAAmB,AAAsB,YAAtB,OAAOD,YACjC,OAAOI,WAAAA,QACM,CAACN,OAAO,CAAC,QAAQ,EAAEI,UAAU,EACrC,IAAI,CAACG,CAAAA,IAAKA,AAAM,SAANA,GACV,KAAK,CAAC,IAAM;QAErB,OAAOD,WAAAA,QACM,CAACN,OAAO,CAAC,QAAQ,EAAEI,UAAU,EACrC,IAAI,CAACG,CAAAA,IAAKA,AAAM,SAANA,GACV,KAAK,CAAC,IAAM;IACrB;IAGO,cAAcC,OAAe,EAAE,EAAEP,SAAS,EAAwC,EAAE;QACvF,OAAOQ,uBAAuBD,SAASP,UAAU,QAAQ,EAAE;IAC/D;;aA9BgB,IAAI,GAAG;;AA+B3B;AAEO,MAAMS,mBAAmBC,uBAAuB,oBAAoB,CAAC;IACxE,gBAAgBZ;IAChB,cAAc,EAAE;AACpB"}
@@ -3,6 +3,8 @@ import type { CmsModelFieldValidatorValidateParams } from "../../../types/types.
3
3
  declare class DateLteValidatorImpl implements CmsModelFieldValidator.Interface {
4
4
  readonly name = "dateLte";
5
5
  validate({ value, validator }: CmsModelFieldValidatorValidateParams): Promise<boolean>;
6
+ /** A message's `{date}` is the limit, as `2008-10-19`. */
7
+ formatMessage(message: string, { validator }: CmsModelFieldValidatorValidateParams): string;
6
8
  }
7
9
  export declare const DateLteValidator: typeof DateLteValidatorImpl & {
8
10
  __abstraction: import("@webiny/di").Abstraction<import("../abstractions/CmsModelFieldValidator.js").ICmsModelFieldValidator>;
@@ -1,12 +1,22 @@
1
1
  import { validation } from "@webiny/validation";
2
2
  import { CmsModelFieldValidator } from "../abstractions/CmsModelFieldValidator.js";
3
+ import { formatDateLimitMessage, getDateLimit } from "./dateLimit.js";
3
4
  class DateLteValidatorImpl {
4
5
  async validate({ value, validator }) {
5
- const { value: lteValue, type } = validator.settings || {};
6
+ const { expression, type } = validator.settings || {};
7
+ let lteValue;
8
+ try {
9
+ lteValue = getDateLimit(validator.settings, "lte");
10
+ } catch {
11
+ return false;
12
+ }
6
13
  if (void 0 === lteValue) return true;
7
- if ("time" === type) return validation.validate(value, `timeLte:${lteValue}`).then((v)=>true === v).catch(()=>false);
14
+ if ("time" === type && "string" != typeof expression) return validation.validate(value, `timeLte:${lteValue}`).then((v)=>true === v).catch(()=>false);
8
15
  return validation.validate(value, `dateLte:${lteValue}`).then((v)=>true === v).catch(()=>false);
9
16
  }
17
+ formatMessage(message, { validator }) {
18
+ return formatDateLimitMessage(message, validator.settings, "lte");
19
+ }
10
20
  constructor(){
11
21
  this.name = "dateLte";
12
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"features/validation/validators/DateLteValidator.js","sources":["../../../../src/features/validation/validators/DateLteValidator.ts"],"sourcesContent":["import { validation } from \"@webiny/validation\";\nimport { CmsModelFieldValidator } from \"../abstractions/CmsModelFieldValidator.js\";\nimport type { CmsModelFieldValidatorValidateParams } from \"~/types/types.js\";\n\nclass DateLteValidatorImpl implements CmsModelFieldValidator.Interface {\n public readonly name = \"dateLte\";\n\n public async validate({\n value,\n validator\n }: CmsModelFieldValidatorValidateParams): Promise<boolean> {\n const { value: lteValue, type } = validator.settings || {};\n if (typeof lteValue === \"undefined\") {\n return true;\n } else if (type === \"time\") {\n return validation\n .validate(value, `timeLte:${lteValue}`)\n .then(v => v === true)\n .catch(() => false);\n }\n return validation\n .validate(value, `dateLte:${lteValue}`)\n .then(v => v === true)\n .catch(() => false);\n }\n}\n\nexport const DateLteValidator = CmsModelFieldValidator.createImplementation({\n implementation: DateLteValidatorImpl,\n dependencies: []\n});\n"],"names":["DateLteValidatorImpl","value","validator","lteValue","type","validation","v","DateLteValidator","CmsModelFieldValidator"],"mappings":";;AAIA,MAAMA;IAGF,MAAa,SAAS,EAClBC,KAAK,EACLC,SAAS,EAC0B,EAAoB;QACvD,MAAM,EAAE,OAAOC,QAAQ,EAAEC,IAAI,EAAE,GAAGF,UAAU,QAAQ,IAAI,CAAC;QACzD,IAAI,AAAoB,WAAbC,UACP,OAAO;QACJ,IAAIC,AAAS,WAATA,MACP,OAAOC,WAAAA,QACM,CAACJ,OAAO,CAAC,QAAQ,EAAEE,UAAU,EACrC,IAAI,CAACG,CAAAA,IAAKA,AAAM,SAANA,GACV,KAAK,CAAC,IAAM;QAErB,OAAOD,WAAAA,QACM,CAACJ,OAAO,CAAC,QAAQ,EAAEE,UAAU,EACrC,IAAI,CAACG,CAAAA,IAAKA,AAAM,SAANA,GACV,KAAK,CAAC,IAAM;IACrB;;aAnBgB,IAAI,GAAG;;AAoB3B;AAEO,MAAMC,mBAAmBC,uBAAuB,oBAAoB,CAAC;IACxE,gBAAgBR;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/validation/validators/DateLteValidator.js","sources":["../../../../src/features/validation/validators/DateLteValidator.ts"],"sourcesContent":["import { validation } from \"@webiny/validation\";\nimport { CmsModelFieldValidator } from \"../abstractions/CmsModelFieldValidator.js\";\nimport type { CmsModelFieldValidatorValidateParams } from \"~/types/types.js\";\nimport { formatDateLimitMessage, getDateLimit } from \"./dateLimit.js\";\n\nclass DateLteValidatorImpl implements CmsModelFieldValidator.Interface {\n public readonly name = \"dateLte\";\n\n public async validate({\n value,\n validator\n }: CmsModelFieldValidatorValidateParams): Promise<boolean> {\n const { expression, type } = validator.settings || {};\n let lteValue: unknown;\n try {\n lteValue = getDateLimit(validator.settings, \"lte\");\n } catch {\n return false;\n }\n if (typeof lteValue === \"undefined\") {\n return true;\n } else if (type === \"time\" && typeof expression !== \"string\") {\n return validation\n .validate(value, `timeLte:${lteValue}`)\n .then(v => v === true)\n .catch(() => false);\n }\n return validation\n .validate(value, `dateLte:${lteValue}`)\n .then(v => v === true)\n .catch(() => false);\n }\n\n /** A message's `{date}` is the limit, as `2008-10-19`. */\n public formatMessage(message: string, { validator }: CmsModelFieldValidatorValidateParams) {\n return formatDateLimitMessage(message, validator.settings, \"lte\");\n }\n}\n\nexport const DateLteValidator = CmsModelFieldValidator.createImplementation({\n implementation: DateLteValidatorImpl,\n dependencies: []\n});\n"],"names":["DateLteValidatorImpl","value","validator","expression","type","lteValue","getDateLimit","validation","v","message","formatDateLimitMessage","DateLteValidator","CmsModelFieldValidator"],"mappings":";;;AAKA,MAAMA;IAGF,MAAa,SAAS,EAClBC,KAAK,EACLC,SAAS,EAC0B,EAAoB;QACvD,MAAM,EAAEC,UAAU,EAAEC,IAAI,EAAE,GAAGF,UAAU,QAAQ,IAAI,CAAC;QACpD,IAAIG;QACJ,IAAI;YACAA,WAAWC,aAAaJ,UAAU,QAAQ,EAAE;QAChD,EAAE,OAAM;YACJ,OAAO;QACX;QACA,IAAI,AAAoB,WAAbG,UACP,OAAO;QACJ,IAAID,AAAS,WAATA,QAAmB,AAAsB,YAAtB,OAAOD,YACjC,OAAOI,WAAAA,QACM,CAACN,OAAO,CAAC,QAAQ,EAAEI,UAAU,EACrC,IAAI,CAACG,CAAAA,IAAKA,AAAM,SAANA,GACV,KAAK,CAAC,IAAM;QAErB,OAAOD,WAAAA,QACM,CAACN,OAAO,CAAC,QAAQ,EAAEI,UAAU,EACrC,IAAI,CAACG,CAAAA,IAAKA,AAAM,SAANA,GACV,KAAK,CAAC,IAAM;IACrB;IAGO,cAAcC,OAAe,EAAE,EAAEP,SAAS,EAAwC,EAAE;QACvF,OAAOQ,uBAAuBD,SAASP,UAAU,QAAQ,EAAE;IAC/D;;aA9BgB,IAAI,GAAG;;AA+B3B;AAEO,MAAMS,mBAAmBC,uBAAuB,oBAAoB,CAAC;IACxE,gBAAgBZ;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The limit a `dateGte`/`dateLte` validator stands for: its fixed value, or its expression
3
+ * worked out against "today". The server can't know the user's timezone, so a lower limit uses
4
+ * the earliest date on Earth and an upper limit the latest: a date the user's own today allows
5
+ * always passes. Throws when an expression can't be read.
6
+ */
7
+ export declare function getDateLimit(settings: Record<string, any> | undefined, limit: "gte" | "lte"): unknown;
8
+ /** Puts the limit into a message's `{date}`, as it is stored (`2008-10-19`). */
9
+ export declare function formatDateLimitMessage(message: string, settings: Record<string, any> | undefined, limit: "gte" | "lte"): string;
@@ -0,0 +1,18 @@
1
+ import { getLenientToday, resolveDateExpression } from "@webiny/utils";
2
+ function getDateLimit(settings, limit) {
3
+ const { value, expression } = settings || {};
4
+ if ("string" == typeof expression) return resolveDateExpression(expression, getLenientToday(limit));
5
+ return value;
6
+ }
7
+ function formatDateLimitMessage(message, settings, limit) {
8
+ let date;
9
+ try {
10
+ date = getDateLimit(settings, limit);
11
+ } catch {
12
+ return message;
13
+ }
14
+ return null == date ? message : message.replace(/\{date}/g, String(date));
15
+ }
16
+ export { formatDateLimitMessage, getDateLimit };
17
+
18
+ //# sourceMappingURL=dateLimit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/validation/validators/dateLimit.js","sources":["../../../../src/features/validation/validators/dateLimit.ts"],"sourcesContent":["import { getLenientToday, resolveDateExpression } from \"@webiny/utils\";\n\n/**\n * The limit a `dateGte`/`dateLte` validator stands for: its fixed value, or its expression\n * worked out against \"today\". The server can't know the user's timezone, so a lower limit uses\n * the earliest date on Earth and an upper limit the latest: a date the user's own today allows\n * always passes. Throws when an expression can't be read.\n */\nexport function getDateLimit(\n settings: Record<string, any> | undefined,\n limit: \"gte\" | \"lte\"\n): unknown {\n const { value, expression } = settings || {};\n if (typeof expression === \"string\") {\n return resolveDateExpression(expression, getLenientToday(limit));\n }\n return value;\n}\n\n/** Puts the limit into a message's `{date}`, as it is stored (`2008-10-19`). */\nexport function formatDateLimitMessage(\n message: string,\n settings: Record<string, any> | undefined,\n limit: \"gte\" | \"lte\"\n): string {\n let date: unknown;\n try {\n date = getDateLimit(settings, limit);\n } catch {\n return message;\n }\n return date == null ? message : message.replace(/\\{date}/g, String(date));\n}\n"],"names":["getDateLimit","settings","limit","value","expression","resolveDateExpression","getLenientToday","formatDateLimitMessage","message","date","String"],"mappings":";AAQO,SAASA,aACZC,QAAyC,EACzCC,KAAoB;IAEpB,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGH,YAAY,CAAC;IAC3C,IAAI,AAAsB,YAAtB,OAAOG,YACP,OAAOC,sBAAsBD,YAAYE,gBAAgBJ;IAE7D,OAAOC;AACX;AAGO,SAASI,uBACZC,OAAe,EACfP,QAAyC,EACzCC,KAAoB;IAEpB,IAAIO;IACJ,IAAI;QACAA,OAAOT,aAAaC,UAAUC;IAClC,EAAE,OAAM;QACJ,OAAOM;IACX;IACA,OAAOC,AAAQ,QAARA,OAAeD,UAAUA,QAAQ,OAAO,CAAC,YAAYE,OAAOD;AACvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js","sources":["../../src/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { ConvertParams } from \"~/plugins/CmsModelFieldConverterPlugin.js\";\nimport { CmsModelFieldConverterPlugin } from \"~/plugins/CmsModelFieldConverterPlugin.js\";\nimport type {\n CmsDynamicZoneTemplate,\n CmsEntryValues,\n CmsModelDynamicZoneField\n} from \"~/types/index.js\";\nimport type { ConverterCollection } from \"~/utils/converters/ConverterCollection.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\ntype DynamicZoneValue = GenericRecord<string>;\n\ninterface ProcessValue {\n templates: CmsDynamicZoneTemplate[];\n value: DynamicZoneValue | null;\n converterCollection: ConverterCollection;\n}\n\nexport class CmsModelDynamicZoneFieldConverterPlugin extends CmsModelFieldConverterPlugin {\n public override name = \"cms.field.converter.dynamicZone\";\n\n public override getFieldType(): string {\n return \"dynamicZone\";\n }\n\n private getTemplates(field: CmsModelDynamicZoneField): CmsDynamicZoneTemplate[] {\n return field.settings?.templates || [];\n }\n\n public override convertToStorage(\n params: ConvertParams<CmsModelDynamicZoneField>\n ): CmsEntryValues {\n const { field, value, converterCollection } = params;\n\n const templates = this.getTemplates(field);\n\n if (templates.length === 0) {\n return {};\n }\n\n if (field.list) {\n if (Array.isArray(value)) {\n return {\n [field.storageId]: value.map(item => {\n return this.processToStorage({\n templates,\n converterCollection,\n value: item\n });\n })\n };\n }\n\n // If a multi-value dynamic zone receives anything other than an array, ignore the value.\n return {};\n }\n\n // If a single-value dynamic zone receives an array, ignore the value.\n if (Array.isArray(value)) {\n return {};\n }\n\n const processedValue = this.processToStorage({\n templates,\n converterCollection,\n value\n });\n\n return {\n [field.storageId]: processedValue\n };\n }\n\n private processToStorage(params: ProcessValue) {\n const { templates, converterCollection } = params;\n const { value } = params;\n if (value === null || value === undefined) {\n return undefined;\n }\n\n const templateId = value._templateId;\n const template = templates.find(t => {\n return templateId === t.id;\n });\n\n if (!template) {\n return undefined;\n }\n\n return template.fields.reduce<GenericRecord<string>>(\n (values, field) => {\n const converter = converterCollection.getConverter(field.type);\n const converted = converter.convertToStorage({\n field,\n value: value ? value[field.fieldId] : undefined\n });\n Object.assign(values, converted);\n return values;\n },\n {\n _templateId: template.id,\n ...(value._id ? { _id: value._id } : {})\n }\n );\n }\n\n public override convertFromStorage(\n params: ConvertParams<CmsModelDynamicZoneField>\n ): CmsEntryValues {\n const { field, value, converterCollection } = params;\n\n const templates = this.getTemplates(field);\n\n if (templates.length === 0) {\n return {};\n }\n\n if (field.list) {\n const arrayValue = Array.isArray(value) ? value : [];\n\n return {\n [field.fieldId]: arrayValue\n .map(item => {\n return this.processFromStorage({\n templates,\n converterCollection,\n value: item\n });\n })\n .filter(Boolean)\n };\n }\n\n if (Array.isArray(value)) {\n throw new WebinyError(\n `Dynamic zone field \"${field.fieldId}\" is expecting a non-array value.`,\n \"DYNAMIC_ZONE_EXPECTING_NON_ARRAY_VALUE\",\n {\n field,\n value\n }\n );\n }\n\n const processedValue = this.processFromStorage({\n templates,\n converterCollection,\n value\n });\n\n return {\n [field.fieldId]: processedValue\n };\n }\n\n private processFromStorage(params: ProcessValue) {\n const { templates, value, converterCollection } = params;\n if (value === null || value === undefined) {\n return undefined;\n }\n\n const { _templateId } = value;\n\n const template = templates.find(t => t.id === _templateId);\n if (!template) {\n // TODO Should we just return undefined?\n console.warn({\n message: \"Unknown template - converting from storage.\",\n code: \"UNKNOWN_TEMPLATE\",\n data: {\n templateId: _templateId\n }\n });\n return undefined;\n }\n\n return template.fields.reduce<GenericRecord<string>>(\n (values, field) => {\n const converter = converterCollection.getConverter(field.type);\n const converted = converter.convertFromStorage({\n field,\n value: value[field.storageId]\n });\n Object.assign(values, converted);\n return values;\n },\n {\n _templateId: template.id,\n ...(value._id ? { _id: value._id } : {})\n }\n );\n }\n}\n"],"names":["CmsModelDynamicZoneFieldConverterPlugin","CmsModelFieldConverterPlugin","field","params","value","converterCollection","templates","Array","item","processedValue","templateId","template","t","values","converter","converted","undefined","Object","arrayValue","Boolean","WebinyError","_templateId","console"],"mappings":";;AAmBO,MAAMA,gDAAgDC;IAGzC,eAAuB;QACnC,OAAO;IACX;IAEQ,aAAaC,KAA+B,EAA4B;QAC5E,OAAOA,MAAM,QAAQ,EAAE,aAAa,EAAE;IAC1C;IAEgB,iBACZC,MAA+C,EACjC;QACd,MAAM,EAAED,KAAK,EAAEE,KAAK,EAAEC,mBAAmB,EAAE,GAAGF;QAE9C,MAAMG,YAAY,IAAI,CAAC,YAAY,CAACJ;QAEpC,IAAII,AAAqB,MAArBA,UAAU,MAAM,EAChB,OAAO,CAAC;QAGZ,IAAIJ,MAAM,IAAI,EAAE;YACZ,IAAIK,MAAM,OAAO,CAACH,QACd,OAAO;gBACH,CAACF,MAAM,SAAS,CAAC,EAAEE,MAAM,GAAG,CAACI,CAAAA,OAClB,IAAI,CAAC,gBAAgB,CAAC;wBACzBF;wBACAD;wBACA,OAAOG;oBACX;YAER;YAIJ,OAAO,CAAC;QACZ;QAGA,IAAID,MAAM,OAAO,CAACH,QACd,OAAO,CAAC;QAGZ,MAAMK,iBAAiB,IAAI,CAAC,gBAAgB,CAAC;YACzCH;YACAD;YACAD;QACJ;QAEA,OAAO;YACH,CAACF,MAAM,SAAS,CAAC,EAAEO;QACvB;IACJ;IAEQ,iBAAiBN,MAAoB,EAAE;QAC3C,MAAM,EAAEG,SAAS,EAAED,mBAAmB,EAAE,GAAGF;QAC3C,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,IAAIC,QAAAA,OACA;QAGJ,MAAMM,aAAaN,MAAM,WAAW;QACpC,MAAMO,WAAWL,UAAU,IAAI,CAACM,CAAAA,IACrBF,eAAeE,EAAE,EAAE;QAG9B,IAAI,CAACD,UACD;QAGJ,OAAOA,SAAS,MAAM,CAAC,MAAM,CACzB,CAACE,QAAQX;YACL,MAAMY,YAAYT,oBAAoB,YAAY,CAACH,MAAM,IAAI;YAC7D,MAAMa,YAAYD,UAAU,gBAAgB,CAAC;gBACzCZ;gBACA,OAAOE,QAAQA,KAAK,CAACF,MAAM,OAAO,CAAC,GAAGc;YAC1C;YACAC,OAAO,MAAM,CAACJ,QAAQE;YACtB,OAAOF;QACX,GACA;YACI,aAAaF,SAAS,EAAE;YACxB,GAAIP,MAAM,GAAG,GAAG;gBAAE,KAAKA,MAAM,GAAG;YAAC,IAAI,CAAC,CAAC;QAC3C;IAER;IAEgB,mBACZD,MAA+C,EACjC;QACd,MAAM,EAAED,KAAK,EAAEE,KAAK,EAAEC,mBAAmB,EAAE,GAAGF;QAE9C,MAAMG,YAAY,IAAI,CAAC,YAAY,CAACJ;QAEpC,IAAII,AAAqB,MAArBA,UAAU,MAAM,EAChB,OAAO,CAAC;QAGZ,IAAIJ,MAAM,IAAI,EAAE;YACZ,MAAMgB,aAAaX,MAAM,OAAO,CAACH,SAASA,QAAQ,EAAE;YAEpD,OAAO;gBACH,CAACF,MAAM,OAAO,CAAC,EAAEgB,WACZ,GAAG,CAACV,CAAAA,OACM,IAAI,CAAC,kBAAkB,CAAC;wBAC3BF;wBACAD;wBACA,OAAOG;oBACX,IAEH,MAAM,CAACW;YAChB;QACJ;QAEA,IAAIZ,MAAM,OAAO,CAACH,QACd,MAAM,IAAIgB,MACN,CAAC,oBAAoB,EAAElB,MAAM,OAAO,CAAC,iCAAiC,CAAC,EACvE,0CACA;YACIA;YACAE;QACJ;QAIR,MAAMK,iBAAiB,IAAI,CAAC,kBAAkB,CAAC;YAC3CH;YACAD;YACAD;QACJ;QAEA,OAAO;YACH,CAACF,MAAM,OAAO,CAAC,EAAEO;QACrB;IACJ;IAEQ,mBAAmBN,MAAoB,EAAE;QAC7C,MAAM,EAAEG,SAAS,EAAEF,KAAK,EAAEC,mBAAmB,EAAE,GAAGF;QAClD,IAAIC,QAAAA,OACA;QAGJ,MAAM,EAAEiB,WAAW,EAAE,GAAGjB;QAExB,MAAMO,WAAWL,UAAU,IAAI,CAACM,CAAAA,IAAKA,EAAE,EAAE,KAAKS;QAC9C,IAAI,CAACV,UAAU,YAEXW,QAAQ,IAAI,CAAC;YACT,SAAS;YACT,MAAM;YACN,MAAM;gBACF,YAAYD;YAChB;QACJ;QAIJ,OAAOV,SAAS,MAAM,CAAC,MAAM,CACzB,CAACE,QAAQX;YACL,MAAMY,YAAYT,oBAAoB,YAAY,CAACH,MAAM,IAAI;YAC7D,MAAMa,YAAYD,UAAU,kBAAkB,CAAC;gBAC3CZ;gBACA,OAAOE,KAAK,CAACF,MAAM,SAAS,CAAC;YACjC;YACAe,OAAO,MAAM,CAACJ,QAAQE;YACtB,OAAOF;QACX,GACA;YACI,aAAaF,SAAS,EAAE;YACxB,GAAIP,MAAM,GAAG,GAAG;gBAAE,KAAKA,MAAM,GAAG;YAAC,IAAI,CAAC,CAAC;QAC3C;IAER;;QA7KG,qBACa,IAAI,GAAG;;AA6K3B"}
1
+ {"version":3,"file":"fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js","sources":["../../src/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { ConvertParams } from \"~/plugins/CmsModelFieldConverterPlugin.js\";\nimport { CmsModelFieldConverterPlugin } from \"~/plugins/CmsModelFieldConverterPlugin.js\";\nimport type {\n CmsDynamicZoneTemplate,\n CmsEntryValues,\n CmsModelDynamicZoneField\n} from \"~/types/index.js\";\nimport type { ConverterCollection } from \"~/utils/converters/ConverterCollection.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\ntype DynamicZoneValue = GenericRecord<string>;\n\ninterface ProcessValue {\n templates: CmsDynamicZoneTemplate[];\n value: DynamicZoneValue | null;\n converterCollection: ConverterCollection;\n}\n\nexport class CmsModelDynamicZoneFieldConverterPlugin extends CmsModelFieldConverterPlugin {\n public override name = \"cms.field.converter.dynamicZone\";\n\n public override getFieldType(): string {\n return \"dynamicZone\";\n }\n\n private getTemplates(field: CmsModelDynamicZoneField): CmsDynamicZoneTemplate[] {\n return field.settings?.templates || [];\n }\n\n public override convertToStorage(\n params: ConvertParams<CmsModelDynamicZoneField>\n ): CmsEntryValues {\n const { field, value, converterCollection } = params;\n\n const templates = this.getTemplates(field);\n\n if (templates.length === 0) {\n return {};\n }\n\n if (field.list) {\n if (Array.isArray(value)) {\n return {\n [field.storageId]: value.map(item => {\n return this.processToStorage({\n templates,\n converterCollection,\n value: item\n });\n })\n };\n }\n\n // If a multi-value dynamic zone receives anything other than an array, ignore the value.\n return {};\n }\n\n // If a single-value dynamic zone receives an array, ignore the value.\n if (Array.isArray(value)) {\n return {};\n }\n\n const processedValue = this.processToStorage({\n templates,\n converterCollection,\n value\n });\n\n return {\n [field.storageId]: processedValue\n };\n }\n\n private processToStorage(params: ProcessValue) {\n const { templates, converterCollection } = params;\n const { value } = params;\n if (value === null || value === undefined) {\n return undefined;\n }\n\n const templateId = value._templateId;\n const template = templates.find(t => {\n return templateId === t.id;\n });\n\n if (!template) {\n return undefined;\n }\n\n return template.fields.reduce<GenericRecord<string>>(\n (values, field) => {\n const converter = converterCollection.getConverter(field.type);\n const converted = converter.convertToStorage({\n field,\n value: value ? value[field.fieldId] : undefined\n });\n Object.assign(values, converted);\n return values;\n },\n {\n _templateId: template.id,\n ...(value._id ? { _id: value._id } : {})\n }\n );\n }\n\n public override convertFromStorage(\n params: ConvertParams<CmsModelDynamicZoneField>\n ): CmsEntryValues {\n const { field, value, converterCollection } = params;\n\n const templates = this.getTemplates(field);\n\n if (templates.length === 0) {\n return {};\n }\n\n if (field.list) {\n const arrayValue = Array.isArray(value) ? value : [];\n\n return {\n [field.fieldId]: arrayValue\n .map(item => {\n return this.processFromStorage({\n templates,\n converterCollection,\n value: item\n });\n })\n .filter(Boolean)\n };\n }\n\n if (Array.isArray(value)) {\n throw new WebinyError(\n `Dynamic zone field \"${field.fieldId}\" is expecting a non-array value.`,\n \"DYNAMIC_ZONE_EXPECTING_NON_ARRAY_VALUE\",\n {\n field,\n value\n }\n );\n }\n\n const processedValue = this.processFromStorage({\n templates,\n converterCollection,\n value\n });\n\n return {\n [field.fieldId]: processedValue\n };\n }\n\n private processFromStorage(params: ProcessValue) {\n const { templates, value, converterCollection } = params;\n if (value === null || value === undefined) {\n return undefined;\n }\n\n const { _templateId } = value;\n\n const template = templates.find(t => t.id === _templateId);\n if (!template) {\n /**\n * The template might have been removed from the model after the entry was stored.\n * We skip the value instead of failing, so the rest of the entry can still be read.\n */\n console.warn({\n message: \"Unknown template - converting from storage.\",\n code: \"UNKNOWN_TEMPLATE\",\n data: {\n templateId: _templateId\n }\n });\n return undefined;\n }\n\n return template.fields.reduce<GenericRecord<string>>(\n (values, field) => {\n const converter = converterCollection.getConverter(field.type);\n const converted = converter.convertFromStorage({\n field,\n value: value[field.storageId]\n });\n Object.assign(values, converted);\n return values;\n },\n {\n _templateId: template.id,\n ...(value._id ? { _id: value._id } : {})\n }\n );\n }\n}\n"],"names":["CmsModelDynamicZoneFieldConverterPlugin","CmsModelFieldConverterPlugin","field","params","value","converterCollection","templates","Array","item","processedValue","templateId","template","t","values","converter","converted","undefined","Object","arrayValue","Boolean","WebinyError","_templateId","console"],"mappings":";;AAmBO,MAAMA,gDAAgDC;IAGzC,eAAuB;QACnC,OAAO;IACX;IAEQ,aAAaC,KAA+B,EAA4B;QAC5E,OAAOA,MAAM,QAAQ,EAAE,aAAa,EAAE;IAC1C;IAEgB,iBACZC,MAA+C,EACjC;QACd,MAAM,EAAED,KAAK,EAAEE,KAAK,EAAEC,mBAAmB,EAAE,GAAGF;QAE9C,MAAMG,YAAY,IAAI,CAAC,YAAY,CAACJ;QAEpC,IAAII,AAAqB,MAArBA,UAAU,MAAM,EAChB,OAAO,CAAC;QAGZ,IAAIJ,MAAM,IAAI,EAAE;YACZ,IAAIK,MAAM,OAAO,CAACH,QACd,OAAO;gBACH,CAACF,MAAM,SAAS,CAAC,EAAEE,MAAM,GAAG,CAACI,CAAAA,OAClB,IAAI,CAAC,gBAAgB,CAAC;wBACzBF;wBACAD;wBACA,OAAOG;oBACX;YAER;YAIJ,OAAO,CAAC;QACZ;QAGA,IAAID,MAAM,OAAO,CAACH,QACd,OAAO,CAAC;QAGZ,MAAMK,iBAAiB,IAAI,CAAC,gBAAgB,CAAC;YACzCH;YACAD;YACAD;QACJ;QAEA,OAAO;YACH,CAACF,MAAM,SAAS,CAAC,EAAEO;QACvB;IACJ;IAEQ,iBAAiBN,MAAoB,EAAE;QAC3C,MAAM,EAAEG,SAAS,EAAED,mBAAmB,EAAE,GAAGF;QAC3C,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,IAAIC,QAAAA,OACA;QAGJ,MAAMM,aAAaN,MAAM,WAAW;QACpC,MAAMO,WAAWL,UAAU,IAAI,CAACM,CAAAA,IACrBF,eAAeE,EAAE,EAAE;QAG9B,IAAI,CAACD,UACD;QAGJ,OAAOA,SAAS,MAAM,CAAC,MAAM,CACzB,CAACE,QAAQX;YACL,MAAMY,YAAYT,oBAAoB,YAAY,CAACH,MAAM,IAAI;YAC7D,MAAMa,YAAYD,UAAU,gBAAgB,CAAC;gBACzCZ;gBACA,OAAOE,QAAQA,KAAK,CAACF,MAAM,OAAO,CAAC,GAAGc;YAC1C;YACAC,OAAO,MAAM,CAACJ,QAAQE;YACtB,OAAOF;QACX,GACA;YACI,aAAaF,SAAS,EAAE;YACxB,GAAIP,MAAM,GAAG,GAAG;gBAAE,KAAKA,MAAM,GAAG;YAAC,IAAI,CAAC,CAAC;QAC3C;IAER;IAEgB,mBACZD,MAA+C,EACjC;QACd,MAAM,EAAED,KAAK,EAAEE,KAAK,EAAEC,mBAAmB,EAAE,GAAGF;QAE9C,MAAMG,YAAY,IAAI,CAAC,YAAY,CAACJ;QAEpC,IAAII,AAAqB,MAArBA,UAAU,MAAM,EAChB,OAAO,CAAC;QAGZ,IAAIJ,MAAM,IAAI,EAAE;YACZ,MAAMgB,aAAaX,MAAM,OAAO,CAACH,SAASA,QAAQ,EAAE;YAEpD,OAAO;gBACH,CAACF,MAAM,OAAO,CAAC,EAAEgB,WACZ,GAAG,CAACV,CAAAA,OACM,IAAI,CAAC,kBAAkB,CAAC;wBAC3BF;wBACAD;wBACA,OAAOG;oBACX,IAEH,MAAM,CAACW;YAChB;QACJ;QAEA,IAAIZ,MAAM,OAAO,CAACH,QACd,MAAM,IAAIgB,MACN,CAAC,oBAAoB,EAAElB,MAAM,OAAO,CAAC,iCAAiC,CAAC,EACvE,0CACA;YACIA;YACAE;QACJ;QAIR,MAAMK,iBAAiB,IAAI,CAAC,kBAAkB,CAAC;YAC3CH;YACAD;YACAD;QACJ;QAEA,OAAO;YACH,CAACF,MAAM,OAAO,CAAC,EAAEO;QACrB;IACJ;IAEQ,mBAAmBN,MAAoB,EAAE;QAC7C,MAAM,EAAEG,SAAS,EAAEF,KAAK,EAAEC,mBAAmB,EAAE,GAAGF;QAClD,IAAIC,QAAAA,OACA;QAGJ,MAAM,EAAEiB,WAAW,EAAE,GAAGjB;QAExB,MAAMO,WAAWL,UAAU,IAAI,CAACM,CAAAA,IAAKA,EAAE,EAAE,KAAKS;QAC9C,IAAI,CAACV,UAAU,YAKXW,QAAQ,IAAI,CAAC;YACT,SAAS;YACT,MAAM;YACN,MAAM;gBACF,YAAYD;YAChB;QACJ;QAIJ,OAAOV,SAAS,MAAM,CAAC,MAAM,CACzB,CAACE,QAAQX;YACL,MAAMY,YAAYT,oBAAoB,YAAY,CAACH,MAAM,IAAI;YAC7D,MAAMa,YAAYD,UAAU,kBAAkB,CAAC;gBAC3CZ;gBACA,OAAOE,KAAK,CAACF,MAAM,SAAS,CAAC;YACjC;YACAe,OAAO,MAAM,CAACJ,QAAQE;YACtB,OAAOF;QACX,GACA;YACI,aAAaF,SAAS,EAAE;YACxB,GAAIP,MAAM,GAAG,GAAG;gBAAE,KAAKA,MAAM,GAAG;YAAC,IAAI,CAAC,CAAC;QAC3C;IAER;;QAhLG,qBACa,IAAI,GAAG;;AAgL3B"}
@@ -0,0 +1,14 @@
1
+ import type { Container } from "@webiny/di";
2
+ import type { CmsModelFieldConverterPlugin } from "../plugins/CmsModelFieldConverterPlugin.js";
3
+ /**
4
+ * Multi-instance DI token for CMS field value converters (fieldId <-> storageId).
5
+ * Replaces reading CmsModelFieldConverterPlugin instances from the plugins container.
6
+ */
7
+ export declare const CmsFieldConverter: import("@webiny/di").Abstraction<CmsModelFieldConverterPlugin>;
8
+ export declare namespace CmsFieldConverter {
9
+ type Interface = CmsModelFieldConverterPlugin;
10
+ }
11
+ /**
12
+ * Registers the built-in field converters as CmsFieldConverter implementations.
13
+ */
14
+ export declare const registerFieldConverters: (container: Container) => void;
@@ -0,0 +1,13 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ import { CmsModelObjectFieldConverterPlugin } from "./CmsModelObjectFieldConverterPlugin.js";
3
+ import { CmsModelDefaultFieldConverterPlugin } from "./CmsModelDefaultFieldConverterPlugin.js";
4
+ import { CmsModelDynamicZoneFieldConverterPlugin } from "./CmsModelDynamicZoneFieldConverterPlugin.js";
5
+ const CmsFieldConverter = createAbstraction("CmsFieldConverter");
6
+ const registerFieldConverters = (container)=>{
7
+ container.registerInstance(CmsFieldConverter, new CmsModelObjectFieldConverterPlugin());
8
+ container.registerInstance(CmsFieldConverter, new CmsModelDynamicZoneFieldConverterPlugin());
9
+ container.registerInstance(CmsFieldConverter, new CmsModelDefaultFieldConverterPlugin());
10
+ };
11
+ export { CmsFieldConverter, registerFieldConverters };
12
+
13
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fieldConverters/abstractions.js","sources":["../../src/fieldConverters/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Container } from \"@webiny/di\";\nimport type { CmsModelFieldConverterPlugin } from \"~/plugins/CmsModelFieldConverterPlugin.js\";\nimport { CmsModelObjectFieldConverterPlugin } from \"~/fieldConverters/CmsModelObjectFieldConverterPlugin.js\";\nimport { CmsModelDefaultFieldConverterPlugin } from \"~/fieldConverters/CmsModelDefaultFieldConverterPlugin.js\";\nimport { CmsModelDynamicZoneFieldConverterPlugin } from \"~/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js\";\n\n/**\n * Multi-instance DI token for CMS field value converters (fieldId <-> storageId).\n * Replaces reading CmsModelFieldConverterPlugin instances from the plugins container.\n */\nexport const CmsFieldConverter =\n createAbstraction<CmsModelFieldConverterPlugin>(\"CmsFieldConverter\");\n\nexport namespace CmsFieldConverter {\n export type Interface = CmsModelFieldConverterPlugin;\n}\n\n/**\n * Registers the built-in field converters as CmsFieldConverter implementations.\n */\nexport const registerFieldConverters = (container: Container): void => {\n container.registerInstance(CmsFieldConverter, new CmsModelObjectFieldConverterPlugin());\n container.registerInstance(CmsFieldConverter, new CmsModelDynamicZoneFieldConverterPlugin());\n container.registerInstance(CmsFieldConverter, new CmsModelDefaultFieldConverterPlugin());\n};\n"],"names":["CmsFieldConverter","createAbstraction","registerFieldConverters","container","CmsModelObjectFieldConverterPlugin","CmsModelDynamicZoneFieldConverterPlugin","CmsModelDefaultFieldConverterPlugin"],"mappings":";;;;AAWO,MAAMA,oBACTC,kBAAgD;AAS7C,MAAMC,0BAA0B,CAACC;IACpCA,UAAU,gBAAgB,CAACH,mBAAmB,IAAII;IAClDD,UAAU,gBAAgB,CAACH,mBAAmB,IAAIK;IAClDF,UAAU,gBAAgB,CAACH,mBAAmB,IAAIM;AACtD"}
@@ -0,0 +1,8 @@
1
+ import type { ICmsGraphQLSchemaPlugin } from "../plugins/index.js";
2
+ export interface ICmsGraphQLSchemaFactory {
3
+ execute(): ICmsGraphQLSchemaPlugin<any>[] | Promise<ICmsGraphQLSchemaPlugin<any>[]>;
4
+ }
5
+ export declare const CmsGraphQLSchemaFactory: import("@webiny/di").Abstraction<ICmsGraphQLSchemaFactory>;
6
+ export declare namespace CmsGraphQLSchemaFactory {
7
+ type Interface = ICmsGraphQLSchemaFactory;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsGraphQLSchemaFactory = createAbstraction("CmsGraphQLSchemaFactory");
3
+ export { CmsGraphQLSchemaFactory };
4
+
5
+ //# sourceMappingURL=CmsGraphQLSchemaFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql/CmsGraphQLSchemaFactory.js","sources":["../../src/graphql/CmsGraphQLSchemaFactory.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\n\nexport interface ICmsGraphQLSchemaFactory {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n execute(): ICmsGraphQLSchemaPlugin<any>[] | Promise<ICmsGraphQLSchemaPlugin<any>[]>;\n}\n\nexport const CmsGraphQLSchemaFactory =\n createAbstraction<ICmsGraphQLSchemaFactory>(\"CmsGraphQLSchemaFactory\");\n\nexport namespace CmsGraphQLSchemaFactory {\n export type Interface = ICmsGraphQLSchemaFactory;\n}\n"],"names":["CmsGraphQLSchemaFactory","createAbstraction"],"mappings":";AAQO,MAAMA,0BACTC,kBAA4C"}
@@ -0,0 +1,10 @@
1
+ import type { ApiEndpoint } from "../types/index.js";
2
+ import type { GraphQLRequestBody } from "@webiny/api-graphql/types.js";
3
+ import type { ExecutionResult } from "graphql";
4
+ export interface ICmsSchemaExecutor {
5
+ execute(type: ApiEndpoint, body: GraphQLRequestBody | GraphQLRequestBody[]): Promise<ExecutionResult | ExecutionResult[]>;
6
+ }
7
+ export declare const CmsSchemaExecutor: import("@webiny/di").Abstraction<ICmsSchemaExecutor>;
8
+ export declare namespace CmsSchemaExecutor {
9
+ type Interface = ICmsSchemaExecutor;
10
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsSchemaExecutor = createAbstraction("CmsSchemaExecutor");
3
+ export { CmsSchemaExecutor };
4
+
5
+ //# sourceMappingURL=CmsSchemaExecutor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql/CmsSchemaExecutor.js","sources":["../../src/graphql/CmsSchemaExecutor.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { ApiEndpoint } from \"~/types/index.js\";\nimport type { GraphQLRequestBody } from \"@webiny/api-graphql/types.js\";\nimport type { ExecutionResult } from \"graphql\";\n\nexport interface ICmsSchemaExecutor {\n execute(\n type: ApiEndpoint,\n body: GraphQLRequestBody | GraphQLRequestBody[]\n ): Promise<ExecutionResult | ExecutionResult[]>;\n}\n\nexport const CmsSchemaExecutor = createAbstraction<ICmsSchemaExecutor>(\"CmsSchemaExecutor\");\n\nexport namespace CmsSchemaExecutor {\n export type Interface = ICmsSchemaExecutor;\n}\n"],"names":["CmsSchemaExecutor","createAbstraction"],"mappings":";AAYO,MAAMA,oBAAoBC,kBAAsC"}
@@ -1,4 +1,4 @@
1
- import type { CmsContext, CmsModel } from "../types/index.js";
1
+ import type { ApiEndpoint, CmsContext, CmsModel } from "../types/index.js";
2
2
  import type { ICmsGraphQLSchemaPlugin } from "../plugins/index.js";
3
3
  /**
4
4
  * This factory is called whenever we need to generate graphql-schema plugins using the current context.
@@ -6,6 +6,7 @@ import type { ICmsGraphQLSchemaPlugin } from "../plugins/index.js";
6
6
  interface BuildSchemaPluginsParams {
7
7
  context: CmsContext;
8
8
  models: CmsModel[];
9
+ type: ApiEndpoint | null;
9
10
  }
10
11
  export declare const buildSchemaPlugins: (params: BuildSchemaPluginsParams) => Promise<ICmsGraphQLSchemaPlugin[]>;
11
12
  export {};
@@ -4,9 +4,7 @@ import { createGroupsSchema } from "./schema/contentModelGroups.js";
4
4
  import { createBaseContentSchema } from "./schema/baseContentSchema.js";
5
5
  import { generateSchemaPlugins } from "./schema/schemaPlugins.js";
6
6
  const buildSchemaPlugins = async (params)=>[
7
- createBaseContentSchema({
8
- context: params.context
9
- }),
7
+ createBaseContentSchema(),
10
8
  createModelsSchema({
11
9
  context: params.context
12
10
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/buildSchemaPlugins.js","sources":["../../src/graphql/buildSchemaPlugins.ts"],"sourcesContent":["import type { CmsContext, CmsModel } from \"~/types/index.js\";\nimport { createModelsSchema } from \"./schema/contentModels.js\";\nimport { createContentEntriesSchema } from \"./schema/contentEntries.js\";\nimport { createGroupsSchema } from \"./schema/contentModelGroups.js\";\nimport { createBaseContentSchema } from \"./schema/baseContentSchema.js\";\nimport { generateSchemaPlugins } from \"./schema/schemaPlugins.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\n\n/**\n * This factory is called whenever we need to generate graphql-schema plugins using the current context.\n */\ninterface BuildSchemaPluginsParams {\n context: CmsContext;\n models: CmsModel[];\n}\nexport const buildSchemaPlugins = async (\n params: BuildSchemaPluginsParams\n): Promise<ICmsGraphQLSchemaPlugin[]> => {\n return [\n // Base GQL types and scalars\n createBaseContentSchema({\n context: params.context\n }),\n createModelsSchema({\n context: params.context\n }),\n createContentEntriesSchema({\n context: params.context\n }),\n createGroupsSchema({\n context: params.context\n }),\n // Dynamic schema\n ...(await generateSchemaPlugins(params))\n ].filter(Boolean);\n};\n"],"names":["buildSchemaPlugins","params","createBaseContentSchema","createModelsSchema","createContentEntriesSchema","createGroupsSchema","generateSchemaPlugins","Boolean"],"mappings":";;;;;AAeO,MAAMA,qBAAqB,OAC9BC,SAEO;QAEHC,wBAAwB;YACpB,SAASD,OAAO,OAAO;QAC3B;QACAE,mBAAmB;YACf,SAASF,OAAO,OAAO;QAC3B;QACAG,2BAA2B;YACvB,SAASH,OAAO,OAAO;QAC3B;QACAI,mBAAmB;YACf,SAASJ,OAAO,OAAO;QAC3B;WAEI,MAAMK,sBAAsBL;KACnC,CAAC,MAAM,CAACM"}
1
+ {"version":3,"file":"graphql/buildSchemaPlugins.js","sources":["../../src/graphql/buildSchemaPlugins.ts"],"sourcesContent":["import type { ApiEndpoint, CmsContext, CmsModel } from \"~/types/index.js\";\nimport { createModelsSchema } from \"./schema/contentModels.js\";\nimport { createContentEntriesSchema } from \"./schema/contentEntries.js\";\nimport { createGroupsSchema } from \"./schema/contentModelGroups.js\";\nimport { createBaseContentSchema } from \"./schema/baseContentSchema.js\";\nimport { generateSchemaPlugins } from \"./schema/schemaPlugins.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\n\n/**\n * This factory is called whenever we need to generate graphql-schema plugins using the current context.\n */\ninterface BuildSchemaPluginsParams {\n context: CmsContext;\n models: CmsModel[];\n type: ApiEndpoint | null;\n}\nexport const buildSchemaPlugins = async (\n params: BuildSchemaPluginsParams\n): Promise<ICmsGraphQLSchemaPlugin[]> => {\n return [\n // Base GQL types and scalars\n createBaseContentSchema(),\n createModelsSchema({\n context: params.context\n }),\n createContentEntriesSchema({\n context: params.context\n }),\n createGroupsSchema({\n context: params.context\n }),\n // Dynamic schema\n ...(await generateSchemaPlugins(params))\n ].filter(Boolean);\n};\n"],"names":["buildSchemaPlugins","params","createBaseContentSchema","createModelsSchema","createContentEntriesSchema","createGroupsSchema","generateSchemaPlugins","Boolean"],"mappings":";;;;;AAgBO,MAAMA,qBAAqB,OAC9BC,SAEO;QAEHC;QACAC,mBAAmB;YACf,SAASF,OAAO,OAAO;QAC3B;QACAG,2BAA2B;YACvB,SAASH,OAAO,OAAO;QAC3B;QACAI,mBAAmB;YACf,SAASJ,OAAO,OAAO;QAC3B;WAEI,MAAMK,sBAAsBL;KACnC,CAAC,MAAM,CAACM"}
@@ -1,7 +1,10 @@
1
+ import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/abstractions.js";
1
2
  import { NotAuthorizedError } from "../utils/errors.js";
3
+ import { HeadlessCmsEndpointConfig } from "../HeadlessCmsEndpointConfig.js";
2
4
  const checkEndpointAccess = async (context)=>{
3
- const permission = await context.security.getPermission(`cms.endpoint.${context.cms.type}`);
4
- if (!permission) throw new NotAuthorizedError(`Not allowed to access "${context.cms.type}" endpoint.`);
5
+ const endpointType = context.container.resolve(HeadlessCmsEndpointConfig).type;
6
+ const permission = await context.container.resolve(IdentityContext).getPermission(`cms.endpoint.${endpointType}`);
7
+ if (!permission) throw new NotAuthorizedError(`Not allowed to access "${endpointType}" endpoint.`);
5
8
  };
6
9
  export { checkEndpointAccess };
7
10
 
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/checkEndpointAccess.js","sources":["../../src/graphql/checkEndpointAccess.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport { NotAuthorizedError } from \"~/utils/errors.js\";\n\nexport const checkEndpointAccess = async (context: CmsContext): Promise<void> => {\n const permission = await context.security.getPermission(`cms.endpoint.${context.cms.type}`);\n if (!permission) {\n throw new NotAuthorizedError(`Not allowed to access \"${context.cms.type}\" endpoint.`);\n }\n};\n"],"names":["checkEndpointAccess","context","permission","NotAuthorizedError"],"mappings":";AAGO,MAAMA,sBAAsB,OAAOC;IACtC,MAAMC,aAAa,MAAMD,QAAQ,QAAQ,CAAC,aAAa,CAAC,CAAC,aAAa,EAAEA,QAAQ,GAAG,CAAC,IAAI,EAAE;IAC1F,IAAI,CAACC,YACD,MAAM,IAAIC,mBAAmB,CAAC,uBAAuB,EAAEF,QAAQ,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC;AAE5F"}
1
+ {"version":3,"file":"graphql/checkEndpointAccess.js","sources":["../../src/graphql/checkEndpointAccess.ts"],"sourcesContent":["import { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/abstractions.js\";\nimport type { CmsContext } from \"~/types/index.js\";\nimport { NotAuthorizedError } from \"~/utils/errors.js\";\nimport { HeadlessCmsEndpointConfig } from \"~/HeadlessCmsEndpointConfig.js\";\n\nexport const checkEndpointAccess = async (context: CmsContext): Promise<void> => {\n const endpointType = context.container.resolve(HeadlessCmsEndpointConfig).type;\n const permission = await context.container\n .resolve(IdentityContext)\n .getPermission(`cms.endpoint.${endpointType}`);\n if (!permission) {\n throw new NotAuthorizedError(`Not allowed to access \"${endpointType}\" endpoint.`);\n }\n};\n"],"names":["checkEndpointAccess","context","endpointType","HeadlessCmsEndpointConfig","permission","IdentityContext","NotAuthorizedError"],"mappings":";;;AAKO,MAAMA,sBAAsB,OAAOC;IACtC,MAAMC,eAAeD,QAAQ,SAAS,CAAC,OAAO,CAACE,2BAA2B,IAAI;IAC9E,MAAMC,aAAa,MAAMH,QAAQ,SAAS,CACrC,OAAO,CAACI,iBACR,aAAa,CAAC,CAAC,aAAa,EAAEH,cAAc;IACjD,IAAI,CAACE,YACD,MAAM,IAAIE,mBAAmB,CAAC,uBAAuB,EAAEJ,aAAa,WAAW,CAAC;AAExF"}
@@ -1,7 +1,7 @@
1
1
  import type { ICmsGraphQLSchemaPlugin } from "../plugins/index.js";
2
2
  import type { GraphQLSchema } from "graphql";
3
3
  interface Params {
4
- plugins: ICmsGraphQLSchemaPlugin[];
4
+ plugins: ICmsGraphQLSchemaPlugin<any>[];
5
5
  }
6
6
  export declare const assertFieldDescriptionsAreStrings: (schema: GraphQLSchema) => void;
7
7
  export declare const createExecutableSchema: (params: Params) => GraphQLSchema;