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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (873) hide show
  1. package/HeadlessCmsEndpointConfig.d.ts +10 -0
  2. package/HeadlessCmsEndpointConfig.js +5 -0
  3. package/HeadlessCmsEndpointConfig.js.map +1 -0
  4. package/HeadlessCmsFeature.d.ts +10 -0
  5. package/HeadlessCmsFeature.js +168 -0
  6. package/HeadlessCmsFeature.js.map +1 -0
  7. package/createCmsRoute.d.ts +24 -0
  8. package/createCmsRoute.js +47 -0
  9. package/createCmsRoute.js.map +1 -0
  10. package/crud/contentEntry/entryDataValidation.d.ts +1 -1
  11. package/crud/contentEntry/entryDataValidation.js +43 -22
  12. package/crud/contentEntry/entryDataValidation.js.map +1 -1
  13. package/crud/contentEntry/references/validateEntries.d.ts +1 -1
  14. package/crud/contentEntry/references/validateEntries.js +17 -7
  15. package/crud/contentEntry/references/validateEntries.js.map +1 -1
  16. package/crud/contentModel/defaultFields.js +3 -2
  17. package/crud/contentModel/defaultFields.js.map +1 -1
  18. package/domain/contentModel/schemas.d.ts +10 -6
  19. package/domain/contentModel/schemas.js +6 -3
  20. package/domain/contentModel/schemas.js.map +1 -1
  21. package/domain/contentModel/validation/dateExpressions.d.ts +6 -0
  22. package/domain/contentModel/validation/dateExpressions.js +27 -0
  23. package/domain/contentModel/validation/dateExpressions.js.map +1 -0
  24. package/domain/contentModel/validation/modelFields.js +23 -15
  25. package/domain/contentModel/validation/modelFields.js.map +1 -1
  26. package/export/abstractions.d.ts +9 -0
  27. package/export/abstractions.js +6 -0
  28. package/export/abstractions.js.map +1 -0
  29. package/export/crud/exporting.js +8 -2
  30. package/export/crud/exporting.js.map +1 -1
  31. package/export/crud/importing.js +13 -4
  32. package/export/crud/importing.js.map +1 -1
  33. package/export/crud/imports/importGroups.js +23 -23
  34. package/export/crud/imports/importGroups.js.map +1 -1
  35. package/export/crud/imports/importModels.js +25 -22
  36. package/export/crud/imports/importModels.js.map +1 -1
  37. package/export/graphql/index.d.ts +2 -3
  38. package/export/graphql/index.js +6 -10
  39. package/export/graphql/index.js.map +1 -1
  40. package/exports/api/cms/entry.d.ts +2 -0
  41. package/exports/api/cms/entry.js +2 -0
  42. package/exports/api/cms/model.d.ts +4 -1
  43. package/exports/api/cms/model.js +2 -0
  44. package/exports/api/cms/storage.d.ts +0 -1
  45. package/exports/api/cms/storage.js +0 -1
  46. package/features/ai/DescribeContentModelTool.d.ts +60 -0
  47. package/features/ai/DescribeContentModelTool.js +69 -0
  48. package/features/ai/DescribeContentModelTool.js.map +1 -0
  49. package/features/ai/ListContentModelsTool.d.ts +46 -0
  50. package/features/ai/ListContentModelsTool.js +53 -0
  51. package/features/ai/ListContentModelsTool.js.map +1 -0
  52. package/features/ai/QueryEntriesTool.d.ts +80 -0
  53. package/features/ai/QueryEntriesTool.js +99 -0
  54. package/features/ai/QueryEntriesTool.js.map +1 -0
  55. package/features/ai/feature.d.ts +8 -0
  56. package/features/ai/feature.js +15 -0
  57. package/features/ai/feature.js.map +1 -0
  58. package/features/ai/index.d.ts +4 -0
  59. package/features/ai/index.js +4 -0
  60. package/features/contentEntry/ContentEntriesFeature.js +6 -0
  61. package/features/contentEntry/ContentEntriesFeature.js.map +1 -1
  62. package/features/contentEntry/CreateEntry/CreateEntryRepository.d.ts +9 -5
  63. package/features/contentEntry/CreateEntry/CreateEntryRepository.js +13 -9
  64. package/features/contentEntry/CreateEntry/CreateEntryRepository.js.map +1 -1
  65. package/features/contentEntry/CreateEntry/CreateEntryUseCase.d.ts +5 -3
  66. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js +5 -7
  67. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js.map +1 -1
  68. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.d.ts +9 -5
  69. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js +13 -9
  70. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js.map +1 -1
  71. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.d.ts +5 -5
  72. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js +8 -17
  73. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js.map +1 -1
  74. package/features/contentEntry/CreateEntryRevisionFrom/abstractions.d.ts +2 -0
  75. package/features/contentEntry/CreateEntryRevisionFrom/abstractions.js.map +1 -1
  76. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.d.ts +9 -5
  77. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js +13 -9
  78. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js.map +1 -1
  79. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.d.ts +5 -3
  80. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js +4 -5
  81. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js.map +1 -1
  82. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.d.ts +8 -4
  83. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js +12 -9
  84. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js.map +1 -1
  85. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.d.ts +5 -3
  86. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js +4 -5
  87. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js.map +1 -1
  88. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.d.ts +3 -3
  89. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js +5 -5
  90. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js.map +1 -1
  91. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.d.ts +8 -4
  92. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js +14 -9
  93. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js.map +1 -1
  94. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.d.ts +5 -3
  95. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js +4 -5
  96. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js.map +1 -1
  97. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.d.ts +9 -5
  98. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js +12 -9
  99. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js.map +1 -1
  100. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.d.ts +5 -3
  101. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js +4 -5
  102. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js.map +1 -1
  103. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.d.ts +17 -0
  104. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.js +83 -0
  105. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.js.map +1 -0
  106. package/features/contentEntry/DuplicateEntry/abstractions.d.ts +47 -0
  107. package/features/contentEntry/DuplicateEntry/abstractions.js +5 -0
  108. package/features/contentEntry/DuplicateEntry/abstractions.js.map +1 -0
  109. package/features/contentEntry/DuplicateEntry/events.d.ts +41 -0
  110. package/features/contentEntry/DuplicateEntry/events.js +32 -0
  111. package/features/contentEntry/DuplicateEntry/events.js.map +1 -0
  112. package/features/contentEntry/DuplicateEntry/feature.d.ts +4 -0
  113. package/features/contentEntry/DuplicateEntry/feature.js +11 -0
  114. package/features/contentEntry/DuplicateEntry/feature.js.map +1 -0
  115. package/features/contentEntry/DuplicateEntry/index.d.ts +2 -0
  116. package/features/contentEntry/DuplicateEntry/index.js +2 -0
  117. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.d.ts +7 -0
  118. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.js +12 -0
  119. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.js.map +1 -0
  120. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.d.ts +10 -0
  121. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.js +25 -0
  122. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.js.map +1 -0
  123. package/features/contentEntry/EntryEventPublisher/abstractions.d.ts +16 -0
  124. package/features/contentEntry/EntryEventPublisher/abstractions.js +5 -0
  125. package/features/contentEntry/EntryEventPublisher/abstractions.js.map +1 -0
  126. package/features/contentEntry/EntryEventPublisher/feature.d.ts +4 -0
  127. package/features/contentEntry/EntryEventPublisher/feature.js +11 -0
  128. package/features/contentEntry/EntryEventPublisher/feature.js.map +1 -0
  129. package/features/contentEntry/EntryEventPublisher/index.d.ts +2 -0
  130. package/features/contentEntry/EntryEventPublisher/index.js +2 -0
  131. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.d.ts +9 -7
  132. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js +12 -16
  133. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js.map +1 -1
  134. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.d.ts +3 -1
  135. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js +2 -3
  136. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js.map +1 -1
  137. package/features/contentEntry/GetEntry/GetEntryUseCase.d.ts +3 -1
  138. package/features/contentEntry/GetEntry/GetEntryUseCase.js +2 -3
  139. package/features/contentEntry/GetEntry/GetEntryUseCase.js.map +1 -1
  140. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.d.ts +3 -1
  141. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js +2 -3
  142. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js.map +1 -1
  143. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.d.ts +9 -5
  144. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js +12 -9
  145. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js.map +1 -1
  146. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.d.ts +3 -1
  147. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js +2 -3
  148. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js.map +1 -1
  149. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.d.ts +3 -1
  150. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js +2 -3
  151. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js.map +1 -1
  152. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.d.ts +9 -5
  153. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js +12 -9
  154. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js.map +1 -1
  155. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.d.ts +3 -1
  156. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js +2 -3
  157. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js.map +1 -1
  158. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.d.ts +3 -1
  159. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js +1 -3
  160. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js.map +1 -1
  161. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.d.ts +3 -1
  162. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js +2 -3
  163. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js.map +1 -1
  164. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.d.ts +3 -1
  165. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js +2 -3
  166. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js.map +1 -1
  167. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.d.ts +9 -5
  168. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js +12 -9
  169. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js.map +1 -1
  170. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.d.ts +3 -1
  171. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js +2 -3
  172. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js.map +1 -1
  173. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.d.ts +9 -5
  174. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js +12 -9
  175. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js.map +1 -1
  176. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.d.ts +3 -1
  177. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js +2 -3
  178. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js.map +1 -1
  179. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.d.ts +9 -5
  180. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js +12 -9
  181. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js.map +1 -1
  182. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.d.ts +3 -1
  183. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js +2 -3
  184. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js.map +1 -1
  185. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.d.ts +9 -5
  186. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js +12 -9
  187. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js.map +1 -1
  188. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.d.ts +3 -1
  189. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js +1 -3
  190. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js.map +1 -1
  191. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.d.ts +9 -5
  192. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js +12 -9
  193. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js.map +1 -1
  194. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.d.ts +3 -1
  195. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js +2 -3
  196. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js.map +1 -1
  197. package/features/contentEntry/GetSingletonEntry/GetSingletonEntryUseCase.js +1 -3
  198. package/features/contentEntry/GetSingletonEntry/GetSingletonEntryUseCase.js.map +1 -1
  199. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.d.ts +9 -5
  200. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js +12 -9
  201. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js.map +1 -1
  202. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.d.ts +6 -2
  203. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js +8 -6
  204. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js.map +1 -1
  205. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.d.ts +3 -1
  206. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js +1 -3
  207. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js.map +1 -1
  208. package/features/contentEntry/ListEntries/ListEntriesRepository.d.ts +9 -5
  209. package/features/contentEntry/ListEntries/ListEntriesRepository.js +12 -9
  210. package/features/contentEntry/ListEntries/ListEntriesRepository.js.map +1 -1
  211. package/features/contentEntry/ListEntries/ListEntriesUseCase.d.ts +3 -1
  212. package/features/contentEntry/ListEntries/ListEntriesUseCase.js +2 -3
  213. package/features/contentEntry/ListEntries/ListEntriesUseCase.js.map +1 -1
  214. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.d.ts +3 -1
  215. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js +1 -3
  216. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js.map +1 -1
  217. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.d.ts +3 -1
  218. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js +1 -3
  219. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js.map +1 -1
  220. package/features/contentEntry/MoveEntry/MoveEntryRepository.d.ts +9 -5
  221. package/features/contentEntry/MoveEntry/MoveEntryRepository.js +12 -9
  222. package/features/contentEntry/MoveEntry/MoveEntryRepository.js.map +1 -1
  223. package/features/contentEntry/MoveEntry/MoveEntryUseCase.d.ts +5 -3
  224. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js +4 -5
  225. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js.map +1 -1
  226. package/features/contentEntry/PublishEntry/PublishEntryRepository.d.ts +9 -5
  227. package/features/contentEntry/PublishEntry/PublishEntryRepository.js +13 -9
  228. package/features/contentEntry/PublishEntry/PublishEntryRepository.js.map +1 -1
  229. package/features/contentEntry/PublishEntry/PublishEntryUseCase.d.ts +7 -7
  230. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js +13 -16
  231. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js.map +1 -1
  232. package/features/contentEntry/PublishEntry/abstractions.d.ts +8 -1
  233. package/features/contentEntry/PublishEntry/abstractions.js.map +1 -1
  234. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.d.ts +11 -5
  235. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js +17 -10
  236. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js.map +1 -1
  237. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.d.ts +5 -3
  238. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js +7 -6
  239. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js.map +1 -1
  240. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.d.ts +9 -5
  241. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js +13 -9
  242. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js.map +1 -1
  243. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.d.ts +5 -3
  244. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js +4 -5
  245. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js.map +1 -1
  246. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.d.ts +9 -5
  247. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js +13 -9
  248. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js.map +1 -1
  249. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.d.ts +5 -3
  250. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js +7 -6
  251. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js.map +1 -1
  252. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.d.ts +9 -5
  253. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js +13 -9
  254. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js.map +1 -1
  255. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.d.ts +5 -3
  256. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js +7 -6
  257. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js.map +1 -1
  258. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.d.ts +6 -9
  259. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js +7 -17
  260. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js.map +1 -1
  261. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.d.ts +3 -1
  262. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js +2 -3
  263. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js.map +1 -1
  264. package/features/contentEntry/ensureItemIds.d.ts +13 -0
  265. package/features/contentEntry/ensureItemIds.js +22 -0
  266. package/features/contentEntry/ensureItemIds.js.map +1 -0
  267. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.d.ts +6 -2
  268. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js +10 -6
  269. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js.map +1 -1
  270. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.d.ts +10 -6
  271. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js +49 -20
  272. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js.map +1 -1
  273. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/abstractions.d.ts +17 -1
  274. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/abstractions.js.map +1 -1
  275. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.d.ts +8 -4
  276. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js +23 -18
  277. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js.map +1 -1
  278. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/abstractions.d.ts +15 -1
  279. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/abstractions.js.map +1 -1
  280. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.d.ts +8 -4
  281. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js +18 -15
  282. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js.map +1 -1
  283. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/abstractions.d.ts +13 -1
  284. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/abstractions.js.map +1 -1
  285. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.d.ts +9 -7
  286. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js +18 -20
  287. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js.map +1 -1
  288. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/abstractions.d.ts +14 -2
  289. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/abstractions.js.map +1 -1
  290. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.d.ts +10 -4
  291. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js +74 -32
  292. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js.map +1 -1
  293. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/abstractions.d.ts +15 -1
  294. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/abstractions.js.map +1 -1
  295. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.d.ts +24 -0
  296. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.js +13 -0
  297. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.js.map +1 -0
  298. package/features/contentModel/ComponentMapGenerator/ComponentMapGenerator.d.ts +14 -0
  299. package/features/contentModel/ComponentMapGenerator/ComponentMapGenerator.js +32 -0
  300. package/features/contentModel/ComponentMapGenerator/ComponentMapGenerator.js.map +1 -0
  301. package/features/contentModel/ComponentMapGenerator/abstractions.d.ts +8 -0
  302. package/features/contentModel/ComponentMapGenerator/abstractions.js +5 -0
  303. package/features/contentModel/ComponentMapGenerator/abstractions.js.map +1 -0
  304. package/features/contentModel/ComponentMapGenerator/feature.d.ts +4 -0
  305. package/features/contentModel/ComponentMapGenerator/feature.js +11 -0
  306. package/features/contentModel/ComponentMapGenerator/feature.js.map +1 -0
  307. package/features/contentModel/ComponentMapGenerator/index.d.ts +2 -0
  308. package/features/contentModel/ComponentMapGenerator/index.js +2 -0
  309. package/features/contentModel/ContentModelFeature.js +6 -0
  310. package/features/contentModel/ContentModelFeature.js.map +1 -1
  311. package/features/contentModel/CreateModel/CreateModelRepository.d.ts +4 -3
  312. package/features/contentModel/CreateModel/CreateModelRepository.js +6 -5
  313. package/features/contentModel/CreateModel/CreateModelRepository.js.map +1 -1
  314. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.d.ts +4 -3
  315. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js +6 -5
  316. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js.map +1 -1
  317. package/features/contentModel/DeleteModel/DeleteModelRepository.d.ts +6 -4
  318. package/features/contentModel/DeleteModel/DeleteModelRepository.js +10 -6
  319. package/features/contentModel/DeleteModel/DeleteModelRepository.js.map +1 -1
  320. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.d.ts +9 -3
  321. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js +36 -18
  322. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js.map +1 -1
  323. package/features/contentModel/ModelToAstConverter/ModelToAstConverter.d.ts +1 -1
  324. package/features/contentModel/ModelToAstConverter/ModelToAstConverter.js.map +1 -1
  325. package/features/contentModel/ModelToAstConverter/abstractions.d.ts +1 -1
  326. package/features/contentModel/ModelToAstConverter/abstractions.js.map +1 -1
  327. package/features/contentModel/RefModelsGenerator/RefModelsGenerator.d.ts +19 -0
  328. package/features/contentModel/RefModelsGenerator/RefModelsGenerator.js +56 -0
  329. package/features/contentModel/RefModelsGenerator/RefModelsGenerator.js.map +1 -0
  330. package/features/contentModel/RefModelsGenerator/abstractions.d.ts +11 -0
  331. package/features/contentModel/RefModelsGenerator/abstractions.js +5 -0
  332. package/features/contentModel/RefModelsGenerator/abstractions.js.map +1 -0
  333. package/features/contentModel/RefModelsGenerator/feature.d.ts +4 -0
  334. package/features/contentModel/RefModelsGenerator/feature.js +11 -0
  335. package/features/contentModel/RefModelsGenerator/feature.js.map +1 -0
  336. package/features/contentModel/RefModelsGenerator/index.d.ts +2 -0
  337. package/features/contentModel/RefModelsGenerator/index.js +2 -0
  338. package/features/contentModel/UpdateModel/UpdateModelRepository.d.ts +9 -4
  339. package/features/contentModel/UpdateModel/UpdateModelRepository.js +17 -9
  340. package/features/contentModel/UpdateModel/UpdateModelRepository.js.map +1 -1
  341. package/features/contentModel/UpdateModel/UpdateModelUseCase.js +2 -2
  342. package/features/contentModel/UpdateModel/UpdateModelUseCase.js.map +1 -1
  343. package/features/contentModel/UpdateModel/abstractions.d.ts +1 -1
  344. package/features/contentModel/UpdateModel/abstractions.js.map +1 -1
  345. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.d.ts +16 -0
  346. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js +54 -0
  347. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js.map +1 -0
  348. package/features/contentModel/ValuesSelectionGenerator/abstractions.d.ts +8 -0
  349. package/features/contentModel/ValuesSelectionGenerator/abstractions.js +5 -0
  350. package/features/contentModel/ValuesSelectionGenerator/abstractions.js.map +1 -0
  351. package/features/contentModel/ValuesSelectionGenerator/feature.d.ts +4 -0
  352. package/features/contentModel/ValuesSelectionGenerator/feature.js +11 -0
  353. package/features/contentModel/ValuesSelectionGenerator/feature.js.map +1 -0
  354. package/features/contentModel/ValuesSelectionGenerator/index.d.ts +1 -0
  355. package/features/contentModel/ValuesSelectionGenerator/index.js +1 -0
  356. package/features/contentModel/shared/ModelsFetcher.d.ts +9 -8
  357. package/features/contentModel/shared/ModelsFetcher.js +5 -5
  358. package/features/contentModel/shared/ModelsFetcher.js.map +1 -1
  359. package/features/contentModel/shared/PluginModelsProvider.d.ts +9 -5
  360. package/features/contentModel/shared/PluginModelsProvider.js +11 -15
  361. package/features/contentModel/shared/PluginModelsProvider.js.map +1 -1
  362. package/features/contentModel/shared/abstractions.d.ts +10 -0
  363. package/features/contentModel/shared/abstractions.js +2 -1
  364. package/features/contentModel/shared/abstractions.js.map +1 -1
  365. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.d.ts +10 -4
  366. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js +18 -14
  367. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js.map +1 -1
  368. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.d.ts +3 -1
  369. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js +2 -3
  370. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js.map +1 -1
  371. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.d.ts +11 -5
  372. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js +16 -10
  373. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js.map +1 -1
  374. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.d.ts +3 -1
  375. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js +2 -3
  376. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js.map +1 -1
  377. package/features/contentModelGroup/GetGroup/GetGroupRepository.d.ts +6 -4
  378. package/features/contentModelGroup/GetGroup/GetGroupRepository.js +9 -9
  379. package/features/contentModelGroup/GetGroup/GetGroupRepository.js.map +1 -1
  380. package/features/contentModelGroup/GetGroup/GetGroupUseCase.d.ts +3 -1
  381. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js +2 -3
  382. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js.map +1 -1
  383. package/features/contentModelGroup/ListGroups/ListGroupsRepository.d.ts +6 -4
  384. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js +9 -9
  385. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js.map +1 -1
  386. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.d.ts +3 -1
  387. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js +2 -3
  388. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js.map +1 -1
  389. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.d.ts +9 -5
  390. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js +13 -10
  391. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js.map +1 -1
  392. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.d.ts +3 -1
  393. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js +4 -5
  394. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js.map +1 -1
  395. package/features/contentModelGroup/UpdateGroup/abstractions.d.ts +1 -1
  396. package/features/contentModelGroup/UpdateGroup/abstractions.js.map +1 -1
  397. package/features/contentModelGroup/shared/PluginGroupsProvider.d.ts +6 -4
  398. package/features/contentModelGroup/shared/PluginGroupsProvider.js +13 -11
  399. package/features/contentModelGroup/shared/PluginGroupsProvider.js.map +1 -1
  400. package/features/contentModelGroup/shared/abstractions.d.ts +10 -0
  401. package/features/contentModelGroup/shared/abstractions.js +2 -1
  402. package/features/contentModelGroup/shared/abstractions.js.map +1 -1
  403. package/features/graphql/feature.js +2 -0
  404. package/features/graphql/feature.js.map +1 -1
  405. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.d.ts +2 -2
  406. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.js.map +1 -1
  407. package/features/graphql/fields/base/AssetToGraphQL.d.ts +26 -0
  408. package/features/graphql/fields/base/AssetToGraphQL.js +153 -0
  409. package/features/graphql/fields/base/AssetToGraphQL.js.map +1 -0
  410. package/features/graphql/fields/base/DynamicZoneToGraphQL.js +12 -2
  411. package/features/graphql/fields/base/DynamicZoneToGraphQL.js.map +1 -1
  412. package/features/graphql/fields/base/ObjectToGraphQL.js +8 -5
  413. package/features/graphql/fields/base/ObjectToGraphQL.js.map +1 -1
  414. package/features/graphql/fields/base/RefToGraphQL.d.ts +1 -1
  415. package/features/graphql/fields/base/RefToGraphQL.js +25 -9
  416. package/features/graphql/fields/base/RefToGraphQL.js.map +1 -1
  417. package/features/graphql/fields/base/richText/richTextResolver.d.ts +1 -1
  418. package/features/graphql/fields/base/richText/richTextResolver.js.map +1 -1
  419. package/features/modelBuilder/abstractions.d.ts +13 -0
  420. package/features/modelBuilder/abstractions.js.map +1 -1
  421. package/features/modelBuilder/feature.js +3 -8
  422. package/features/modelBuilder/feature.js.map +1 -1
  423. package/features/modelBuilder/fields/AssetFieldType.d.ts +20 -0
  424. package/features/modelBuilder/fields/AssetFieldType.js +46 -0
  425. package/features/modelBuilder/fields/AssetFieldType.js.map +1 -0
  426. package/features/modelBuilder/fields/BaseFieldBuilder.d.ts +3 -1
  427. package/features/modelBuilder/fields/BaseFieldBuilder.js +4 -0
  428. package/features/modelBuilder/fields/BaseFieldBuilder.js.map +1 -1
  429. package/features/modelBuilder/fields/DataFieldBuilder.d.ts +71 -18
  430. package/features/modelBuilder/fields/DataFieldBuilder.js +11 -1
  431. package/features/modelBuilder/fields/DataFieldBuilder.js.map +1 -1
  432. package/features/modelBuilder/fields/DateTimeFieldType.js +27 -12
  433. package/features/modelBuilder/fields/DateTimeFieldType.js.map +1 -1
  434. package/features/modelBuilder/fields/DynamicZoneFieldType.d.ts +1 -0
  435. package/features/modelBuilder/fields/DynamicZoneFieldType.js +10 -9
  436. package/features/modelBuilder/fields/DynamicZoneFieldType.js.map +1 -1
  437. package/features/modelBuilder/fields/TextFieldType.d.ts +3 -1
  438. package/features/modelBuilder/fields/TextFieldType.js +1 -3
  439. package/features/modelBuilder/fields/TextFieldType.js.map +1 -1
  440. package/features/modelBuilder/fields/UiAlertFieldType.js +2 -1
  441. package/features/modelBuilder/fields/UiAlertFieldType.js.map +1 -1
  442. package/features/modelBuilder/fields/UiSeparatorFieldType.js +2 -1
  443. package/features/modelBuilder/fields/UiSeparatorFieldType.js.map +1 -1
  444. package/features/modelBuilder/fields/UiTabsFieldType.d.ts +2 -1
  445. package/features/modelBuilder/fields/UiTabsFieldType.js +6 -3
  446. package/features/modelBuilder/fields/UiTabsFieldType.js.map +1 -1
  447. package/features/modelBuilder/fields/fieldTypeValidator.d.ts +5 -3
  448. package/features/modelBuilder/fields/resolveAssetUrl.d.ts +35 -0
  449. package/features/modelBuilder/fields/resolveAssetUrl.js +26 -0
  450. package/features/modelBuilder/fields/resolveAssetUrl.js.map +1 -0
  451. package/features/modelBuilder/index.d.ts +1 -1
  452. package/features/modelBuilder/models/BaseModelBuilder.d.ts +3 -1
  453. package/features/modelBuilder/models/BaseModelBuilder.js +7 -0
  454. package/features/modelBuilder/models/BaseModelBuilder.js.map +1 -1
  455. package/features/modelBuilder/models/ModelBuilder.d.ts +8 -0
  456. package/features/modelBuilder/models/ModelBuilder.js +1 -0
  457. package/features/modelBuilder/models/ModelBuilder.js.map +1 -1
  458. package/features/modelBuilder/models/ModelsProvider.d.ts +1 -3
  459. package/features/modelBuilder/models/ModelsProvider.js +2 -7
  460. package/features/modelBuilder/models/ModelsProvider.js.map +1 -1
  461. package/features/modelBuilder/models/PrivateModelBuilder.d.ts +5 -0
  462. package/features/modelBuilder/models/PrivateModelBuilder.js +13 -1
  463. package/features/modelBuilder/models/PrivateModelBuilder.js.map +1 -1
  464. package/features/modelBuilder/models/PublicModelBuilder.js +2 -1
  465. package/features/modelBuilder/models/PublicModelBuilder.js.map +1 -1
  466. package/features/runtimeTenant/RuntimeTenant.d.ts +13 -0
  467. package/features/runtimeTenant/RuntimeTenant.js +22 -0
  468. package/features/runtimeTenant/RuntimeTenant.js.map +1 -0
  469. package/features/runtimeTenant/abstractions.d.ts +11 -0
  470. package/features/runtimeTenant/abstractions.js +5 -0
  471. package/features/runtimeTenant/abstractions.js.map +1 -0
  472. package/features/runtimeTenant/index.d.ts +2 -0
  473. package/features/runtimeTenant/index.js +2 -0
  474. package/features/shared/abstractions.d.ts +8 -16
  475. package/features/shared/abstractions.js +2 -3
  476. package/features/shared/abstractions.js.map +1 -1
  477. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.d.ts +8 -0
  478. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js +5 -0
  479. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js.map +1 -0
  480. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.d.ts +8 -0
  481. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js +5 -0
  482. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js.map +1 -0
  483. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.d.ts +8 -0
  484. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js +5 -0
  485. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js.map +1 -0
  486. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.d.ts +8 -0
  487. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js +5 -0
  488. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js.map +1 -0
  489. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.d.ts +8 -0
  490. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js +5 -0
  491. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js.map +1 -0
  492. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.d.ts +8 -0
  493. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js +5 -0
  494. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js.map +1 -0
  495. package/features/shared/storageOperations/entry/GetEntryStorageOperation.d.ts +8 -0
  496. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js +5 -0
  497. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js.map +1 -0
  498. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.d.ts +8 -0
  499. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js +5 -0
  500. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js.map +1 -0
  501. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.d.ts +8 -0
  502. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js +5 -0
  503. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js.map +1 -0
  504. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.d.ts +8 -0
  505. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js +5 -0
  506. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js.map +1 -0
  507. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.d.ts +8 -0
  508. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js +5 -0
  509. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js.map +1 -0
  510. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.d.ts +8 -0
  511. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js +5 -0
  512. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js.map +1 -0
  513. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.d.ts +8 -0
  514. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js +5 -0
  515. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js.map +1 -0
  516. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.d.ts +8 -0
  517. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js +5 -0
  518. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js.map +1 -0
  519. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.d.ts +8 -0
  520. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js +5 -0
  521. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js.map +1 -0
  522. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.d.ts +8 -0
  523. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js +5 -0
  524. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js.map +1 -0
  525. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.d.ts +8 -0
  526. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js +5 -0
  527. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js.map +1 -0
  528. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.d.ts +8 -0
  529. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js +5 -0
  530. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js.map +1 -0
  531. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.d.ts +8 -0
  532. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js +5 -0
  533. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js.map +1 -0
  534. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.d.ts +8 -0
  535. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js +5 -0
  536. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js.map +1 -0
  537. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.d.ts +8 -0
  538. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js +5 -0
  539. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js.map +1 -0
  540. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.d.ts +8 -0
  541. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js +5 -0
  542. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js.map +1 -0
  543. package/features/shared/storageOperations/group/CreateGroupStorageOperation.d.ts +8 -0
  544. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js +5 -0
  545. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js.map +1 -0
  546. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.d.ts +8 -0
  547. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js +5 -0
  548. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js.map +1 -0
  549. package/features/shared/storageOperations/group/GetGroupStorageOperation.d.ts +8 -0
  550. package/features/shared/storageOperations/group/GetGroupStorageOperation.js +5 -0
  551. package/features/shared/storageOperations/group/GetGroupStorageOperation.js.map +1 -0
  552. package/features/shared/storageOperations/group/ListGroupsStorageOperation.d.ts +8 -0
  553. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js +5 -0
  554. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js.map +1 -0
  555. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.d.ts +8 -0
  556. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js +5 -0
  557. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js.map +1 -0
  558. package/features/shared/storageOperations/index.d.ts +32 -0
  559. package/features/shared/storageOperations/index.js +32 -0
  560. package/features/shared/storageOperations/model/CreateModelStorageOperation.d.ts +8 -0
  561. package/features/shared/storageOperations/model/CreateModelStorageOperation.js +5 -0
  562. package/features/shared/storageOperations/model/CreateModelStorageOperation.js.map +1 -0
  563. package/features/shared/storageOperations/model/DeleteModelStorageOperation.d.ts +8 -0
  564. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js +5 -0
  565. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js.map +1 -0
  566. package/features/shared/storageOperations/model/GetModelStorageOperation.d.ts +8 -0
  567. package/features/shared/storageOperations/model/GetModelStorageOperation.js +5 -0
  568. package/features/shared/storageOperations/model/GetModelStorageOperation.js.map +1 -0
  569. package/features/shared/storageOperations/model/ListModelsStorageOperation.d.ts +8 -0
  570. package/features/shared/storageOperations/model/ListModelsStorageOperation.js +5 -0
  571. package/features/shared/storageOperations/model/ListModelsStorageOperation.js.map +1 -0
  572. package/features/shared/storageOperations/model/UpdateModelStorageOperation.d.ts +8 -0
  573. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js +5 -0
  574. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js.map +1 -0
  575. package/features/sortMapper/SortMapper.js +2 -5
  576. package/features/sortMapper/SortMapper.js.map +1 -1
  577. package/features/storage/fields/ObjectStorageTransform.js +27 -7
  578. package/features/storage/fields/ObjectStorageTransform.js.map +1 -1
  579. package/features/validation/abstractions/CmsModelFieldValidator.d.ts +5 -0
  580. package/features/validation/abstractions/CmsModelFieldValidator.js.map +1 -1
  581. package/features/validation/validators/DateGteValidator.d.ts +2 -0
  582. package/features/validation/validators/DateGteValidator.js +12 -2
  583. package/features/validation/validators/DateGteValidator.js.map +1 -1
  584. package/features/validation/validators/DateLteValidator.d.ts +2 -0
  585. package/features/validation/validators/DateLteValidator.js +12 -2
  586. package/features/validation/validators/DateLteValidator.js.map +1 -1
  587. package/features/validation/validators/PatternValidator.js +1 -1
  588. package/features/validation/validators/PatternValidator.js.map +1 -1
  589. package/features/validation/validators/dateLimit.d.ts +9 -0
  590. package/features/validation/validators/dateLimit.js +18 -0
  591. package/features/validation/validators/dateLimit.js.map +1 -0
  592. package/features/whereMapper/WhereMapper.js +7 -5
  593. package/features/whereMapper/WhereMapper.js.map +1 -1
  594. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +15 -5
  595. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
  596. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +8 -2
  597. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -1
  598. package/fieldConverters/abstractions.d.ts +14 -0
  599. package/fieldConverters/abstractions.js +13 -0
  600. package/fieldConverters/abstractions.js.map +1 -0
  601. package/fieldConverters/index.d.ts +1 -1
  602. package/graphql/CmsGraphQLSchemaFactory.d.ts +8 -0
  603. package/graphql/CmsGraphQLSchemaFactory.js +5 -0
  604. package/graphql/CmsGraphQLSchemaFactory.js.map +1 -0
  605. package/graphql/CmsSchemaExecutor.d.ts +10 -0
  606. package/graphql/CmsSchemaExecutor.js +5 -0
  607. package/graphql/CmsSchemaExecutor.js.map +1 -0
  608. package/graphql/buildSchemaPlugins.d.ts +2 -1
  609. package/graphql/buildSchemaPlugins.js +1 -3
  610. package/graphql/buildSchemaPlugins.js.map +1 -1
  611. package/graphql/checkEndpointAccess.js +5 -2
  612. package/graphql/checkEndpointAccess.js.map +1 -1
  613. package/graphql/createExecutableSchema.d.ts +1 -1
  614. package/graphql/createExecutableSchema.js +1 -1
  615. package/graphql/createExecutableSchema.js.map +1 -1
  616. package/graphql/generateSchema.d.ts +2 -1
  617. package/graphql/generateSchema.js +14 -5
  618. package/graphql/generateSchema.js.map +1 -1
  619. package/graphql/getSchema.js +7 -2
  620. package/graphql/getSchema.js.map +1 -1
  621. package/graphql/scalars/RevisionIdScalarPlugin.d.ts +1 -1
  622. package/graphql/scalars/RevisionIdScalarPlugin.js.map +1 -1
  623. package/graphql/schema/baseContentSchema.d.ts +1 -6
  624. package/graphql/schema/baseContentSchema.js +5 -8
  625. package/graphql/schema/baseContentSchema.js.map +1 -1
  626. package/graphql/schema/baseSchema.d.ts +2 -2
  627. package/graphql/schema/baseSchema.js +6 -41
  628. package/graphql/schema/baseSchema.js.map +1 -1
  629. package/graphql/schema/cms/CmsBaseErrorTypeFactory.d.ts +15 -0
  630. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js +25 -0
  631. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js.map +1 -0
  632. package/graphql/schema/cms/createEntryResolver.js +2 -2
  633. package/graphql/schema/cms/createEntryResolver.js.map +1 -1
  634. package/graphql/schema/cms/deleteEntryResolver.js +2 -2
  635. package/graphql/schema/cms/deleteEntryResolver.js.map +1 -1
  636. package/graphql/schema/cms/getEntryResolver.js +5 -4
  637. package/graphql/schema/cms/getEntryResolver.js.map +1 -1
  638. package/graphql/schema/cms/getModelResolver.d.ts +35 -0
  639. package/graphql/schema/cms/getModelResolver.js +49 -0
  640. package/graphql/schema/cms/getModelResolver.js.map +1 -0
  641. package/graphql/schema/cms/helpers/buildFieldsSelection.js +9 -2
  642. package/graphql/schema/cms/helpers/buildFieldsSelection.js.map +1 -1
  643. package/graphql/schema/cms/helpers/expandFieldWildcards.d.ts +2 -0
  644. package/graphql/schema/cms/helpers/expandFieldWildcards.js +13 -0
  645. package/graphql/schema/cms/helpers/expandFieldWildcards.js.map +1 -0
  646. package/graphql/schema/cms/helpers/getModel.d.ts +0 -3
  647. package/graphql/schema/cms/helpers/getModel.js +5 -3
  648. package/graphql/schema/cms/helpers/getModel.js.map +1 -1
  649. package/graphql/schema/cms/helpers/index.d.ts +1 -0
  650. package/graphql/schema/cms/helpers/index.js +1 -0
  651. package/graphql/schema/cms/helpers/transformWhereToNested.js +39 -17
  652. package/graphql/schema/cms/helpers/transformWhereToNested.js.map +1 -1
  653. package/graphql/schema/cms/helpers.d.ts +1 -0
  654. package/graphql/schema/cms/helpers.js +1 -0
  655. package/graphql/schema/cms/listEntriesResolver.js +5 -4
  656. package/graphql/schema/cms/listEntriesResolver.js.map +1 -1
  657. package/graphql/schema/cms/publishEntryResolver.js +2 -2
  658. package/graphql/schema/cms/publishEntryResolver.js.map +1 -1
  659. package/graphql/schema/cms/resolvers/createEntry.d.ts +3 -2
  660. package/graphql/schema/cms/resolvers/createEntry.js +5 -1
  661. package/graphql/schema/cms/resolvers/createEntry.js.map +1 -1
  662. package/graphql/schema/cms/resolvers/deleteEntryRevision.d.ts +3 -2
  663. package/graphql/schema/cms/resolvers/deleteEntryRevision.js +5 -1
  664. package/graphql/schema/cms/resolvers/deleteEntryRevision.js.map +1 -1
  665. package/graphql/schema/cms/resolvers/getEntry.d.ts +3 -2
  666. package/graphql/schema/cms/resolvers/getEntry.js +5 -1
  667. package/graphql/schema/cms/resolvers/getEntry.js.map +1 -1
  668. package/graphql/schema/cms/resolvers/getModel.d.ts +9 -0
  669. package/graphql/schema/cms/resolvers/getModel.js +22 -0
  670. package/graphql/schema/cms/resolvers/getModel.js.map +1 -0
  671. package/graphql/schema/cms/resolvers/index.d.ts +1 -0
  672. package/graphql/schema/cms/resolvers/index.js +1 -0
  673. package/graphql/schema/cms/resolvers/listEntries.d.ts +3 -2
  674. package/graphql/schema/cms/resolvers/listEntries.js +5 -1
  675. package/graphql/schema/cms/resolvers/listEntries.js.map +1 -1
  676. package/graphql/schema/cms/resolvers/mutationCms.d.ts +3 -2
  677. package/graphql/schema/cms/resolvers/mutationCms.js +5 -1
  678. package/graphql/schema/cms/resolvers/mutationCms.js.map +1 -1
  679. package/graphql/schema/cms/resolvers/publishEntryRevision.d.ts +3 -2
  680. package/graphql/schema/cms/resolvers/publishEntryRevision.js +5 -1
  681. package/graphql/schema/cms/resolvers/publishEntryRevision.js.map +1 -1
  682. package/graphql/schema/cms/resolvers/queryCms.d.ts +3 -2
  683. package/graphql/schema/cms/resolvers/queryCms.js +5 -1
  684. package/graphql/schema/cms/resolvers/queryCms.js.map +1 -1
  685. package/graphql/schema/cms/resolvers/unpublishEntryRevision.d.ts +3 -2
  686. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js +5 -1
  687. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js.map +1 -1
  688. package/graphql/schema/cms/resolvers/updateEntryRevision.d.ts +3 -2
  689. package/graphql/schema/cms/resolvers/updateEntryRevision.js +5 -1
  690. package/graphql/schema/cms/resolvers/updateEntryRevision.js.map +1 -1
  691. package/graphql/schema/cms/typeDefs/mutation.d.ts +3 -2
  692. package/graphql/schema/cms/typeDefs/mutation.js +5 -1
  693. package/graphql/schema/cms/typeDefs/mutation.js.map +1 -1
  694. package/graphql/schema/cms/typeDefs/query.d.ts +3 -2
  695. package/graphql/schema/cms/typeDefs/query.js +6 -1
  696. package/graphql/schema/cms/typeDefs/query.js.map +1 -1
  697. package/graphql/schema/cms/typeDefs/responses.d.ts +3 -2
  698. package/graphql/schema/cms/typeDefs/responses.js +10 -1
  699. package/graphql/schema/cms/typeDefs/responses.js.map +1 -1
  700. package/graphql/schema/cms/unpublishEntryResolver.js +2 -2
  701. package/graphql/schema/cms/unpublishEntryResolver.js.map +1 -1
  702. package/graphql/schema/cms/updateEntryResolver.js +2 -2
  703. package/graphql/schema/cms/updateEntryResolver.js.map +1 -1
  704. package/graphql/schema/contentEntries.js +60 -34
  705. package/graphql/schema/contentEntries.js.map +1 -1
  706. package/graphql/schema/contentModelGroups.js +39 -18
  707. package/graphql/schema/contentModelGroups.js.map +1 -1
  708. package/graphql/schema/contentModels.js +70 -16
  709. package/graphql/schema/contentModels.js.map +1 -1
  710. package/graphql/schema/createFieldResolvers.d.ts +1 -1
  711. package/graphql/schema/createFieldResolvers.js.map +1 -1
  712. package/graphql/schema/createManageResolvers.js +7 -3
  713. package/graphql/schema/createManageResolvers.js.map +1 -1
  714. package/graphql/schema/createManageSDL.js +2 -0
  715. package/graphql/schema/createManageSDL.js.map +1 -1
  716. package/graphql/schema/createSingularSDL.js +2 -0
  717. package/graphql/schema/createSingularSDL.js.map +1 -1
  718. package/graphql/schema/resolvers/manage/resolveCreate.js +5 -3
  719. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
  720. package/graphql/schema/resolvers/manage/resolveCreateFrom.js +5 -3
  721. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
  722. package/graphql/schema/resolvers/manage/resolveDelete.js +9 -4
  723. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
  724. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +5 -3
  725. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -1
  726. package/graphql/schema/resolvers/manage/resolveDuplicate.d.ts +7 -0
  727. package/graphql/schema/resolvers/manage/resolveDuplicate.js +11 -0
  728. package/graphql/schema/resolvers/manage/resolveDuplicate.js.map +1 -0
  729. package/graphql/schema/resolvers/manage/resolveGet.js +11 -6
  730. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
  731. package/graphql/schema/resolvers/manage/resolveGetByIds.js +5 -3
  732. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
  733. package/graphql/schema/resolvers/manage/resolveGetRevisions.js +5 -3
  734. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
  735. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +5 -3
  736. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -1
  737. package/graphql/schema/resolvers/manage/resolveList.js +5 -3
  738. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
  739. package/graphql/schema/resolvers/manage/resolveListDeleted.js +5 -3
  740. package/graphql/schema/resolvers/manage/resolveListDeleted.js.map +1 -1
  741. package/graphql/schema/resolvers/manage/resolveMove.js +4 -2
  742. package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -1
  743. package/graphql/schema/resolvers/manage/resolvePublish.js +5 -3
  744. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
  745. package/graphql/schema/resolvers/manage/resolveRepublish.js +5 -3
  746. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
  747. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js +5 -3
  748. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js.map +1 -1
  749. package/graphql/schema/resolvers/manage/resolveUnpublish.js +5 -3
  750. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
  751. package/graphql/schema/resolvers/manage/resolveUpdate.js +5 -3
  752. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
  753. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js +5 -3
  754. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js.map +1 -1
  755. package/graphql/schema/resolvers/manage/resolveValidate.js +5 -3
  756. package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -1
  757. package/graphql/schema/resolvers/preview/resolveGet.js +6 -3
  758. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
  759. package/graphql/schema/resolvers/preview/resolveList.js +5 -3
  760. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
  761. package/graphql/schema/resolvers/read/resolveGet.js +5 -2
  762. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
  763. package/graphql/schema/resolvers/read/resolveList.js +5 -3
  764. package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
  765. package/graphql/schema/resolvers/singular/resolveGet.js +1 -1
  766. package/graphql/schema/resolvers/singular/resolveGet.js.map +1 -1
  767. package/graphql/schema/resolvers/singular/resolveUpdate.js +1 -1
  768. package/graphql/schema/resolvers/singular/resolveUpdate.js.map +1 -1
  769. package/graphql/schema/schemaPlugins.d.ts +2 -1
  770. package/graphql/schema/schemaPlugins.js +2 -4
  771. package/graphql/schema/schemaPlugins.js.map +1 -1
  772. package/index.d.ts +7 -6
  773. package/index.js +4 -22
  774. package/legacy/abstractions.js.map +1 -1
  775. package/package.json +27 -33
  776. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.d.ts +2 -2
  777. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js +1 -1
  778. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js.map +1 -1
  779. package/plugins/CmsModelPlugin.js +2 -1
  780. package/plugins/CmsModelPlugin.js.map +1 -1
  781. package/plugins/index.d.ts +0 -1
  782. package/plugins/index.js +0 -1
  783. package/types/fields/dynamicZoneField.d.ts +3 -2
  784. package/types/index.d.ts +0 -1
  785. package/types/model.d.ts +6 -0
  786. package/types/modelField.d.ts +14 -1
  787. package/types/types.d.ts +11 -290
  788. package/types/types.js.map +1 -1
  789. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.d.ts +28 -0
  790. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js +324 -0
  791. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js.map +1 -0
  792. package/utils/contentModelToJsonSchema/index.d.ts +2 -0
  793. package/utils/contentModelToJsonSchema/index.js +1 -0
  794. package/utils/contentModelToJsonSchema/types.d.ts +24 -0
  795. package/utils/converters/ConverterCollection.d.ts +2 -2
  796. package/utils/converters/ConverterCollection.js +1 -3
  797. package/utils/converters/ConverterCollection.js.map +1 -1
  798. package/utils/converters/valueKeyFromStorageConverter.d.ts +2 -2
  799. package/utils/converters/valueKeyFromStorageConverter.js +2 -2
  800. package/utils/converters/valueKeyFromStorageConverter.js.map +1 -1
  801. package/utils/converters/valueKeyStorageConverter.js +4 -2
  802. package/utils/converters/valueKeyStorageConverter.js.map +1 -1
  803. package/utils/converters/valueKeyToStorageConverter.d.ts +2 -2
  804. package/utils/converters/valueKeyToStorageConverter.js +2 -2
  805. package/utils/converters/valueKeyToStorageConverter.js.map +1 -1
  806. package/utils/createModelField.js +2 -1
  807. package/utils/createModelField.js.map +1 -1
  808. package/utils/createModelSchemaKey.d.ts +8 -0
  809. package/utils/createModelSchemaKey.js +18 -0
  810. package/utils/createModelSchemaKey.js.map +1 -0
  811. package/utils/getSchemaFromFieldPlugins.d.ts +2 -2
  812. package/utils/getSchemaFromFieldPlugins.js.map +1 -1
  813. package/utils/index.d.ts +1 -0
  814. package/utils/index.js +1 -0
  815. package/utils/isHeadlessCmsReady.d.ts +1 -1
  816. package/utils/isHeadlessCmsReady.js +3 -2
  817. package/utils/isHeadlessCmsReady.js.map +1 -1
  818. package/abstractions/entryHooks/OnEntryBeforeCreate.d.ts +0 -8
  819. package/abstractions/entryHooks/OnEntryBeforeCreate.js +0 -5
  820. package/abstractions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  821. package/abstractions/entryHooks/index.d.ts +0 -1
  822. package/abstractions/entryHooks/index.js +0 -1
  823. package/abstractions/index.d.ts +0 -1
  824. package/abstractions/index.js +0 -1
  825. package/context.d.ts +0 -3
  826. package/context.js +0 -131
  827. package/context.js.map +0 -1
  828. package/crud/contentEntry.crud.d.ts +0 -6
  829. package/crud/contentEntry.crud.js +0 -334
  830. package/crud/contentEntry.crud.js.map +0 -1
  831. package/crud/contentModel.crud.d.ts +0 -5
  832. package/crud/contentModel.crud.js +0 -77
  833. package/crud/contentModel.crud.js.map +0 -1
  834. package/crud/contentModelGroup.crud.d.ts +0 -5
  835. package/crud/contentModelGroup.crud.js +0 -74
  836. package/crud/contentModelGroup.crud.js.map +0 -1
  837. package/extensions/entryHooks/OnEntryBeforeCreate.d.ts +0 -4
  838. package/extensions/entryHooks/OnEntryBeforeCreate.js +0 -21
  839. package/extensions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  840. package/extensions/entryHooks/index.d.ts +0 -1
  841. package/extensions/entryHooks/index.js +0 -1
  842. package/extensions/index.d.ts +0 -5
  843. package/extensions/index.js +0 -7
  844. package/extensions/index.js.map +0 -1
  845. package/graphql/graphQLHandlerFactory.d.ts +0 -5
  846. package/graphql/graphQLHandlerFactory.js +0 -22
  847. package/graphql/graphQLHandlerFactory.js.map +0 -1
  848. package/graphql/handleRequest.d.ts +0 -11
  849. package/graphql/handleRequest.js +0 -62
  850. package/graphql/handleRequest.js.map +0 -1
  851. package/graphql/index.d.ts +0 -4
  852. package/graphql/index.js +0 -11
  853. package/graphql/index.js.map +0 -1
  854. package/graphql/schema/cms/index.d.ts +0 -2
  855. package/graphql/schema/cms/index.js +0 -24
  856. package/graphql/schema/cms/index.js.map +0 -1
  857. package/index.js.map +0 -1
  858. package/parameters/context.d.ts +0 -2
  859. package/parameters/context.js +0 -7
  860. package/parameters/context.js.map +0 -1
  861. package/parameters/header.d.ts +0 -2
  862. package/parameters/header.js +0 -13
  863. package/parameters/header.js.map +0 -1
  864. package/parameters/index.d.ts +0 -3
  865. package/parameters/index.js +0 -3
  866. package/parameters/path.d.ts +0 -2
  867. package/parameters/path.js +0 -12
  868. package/parameters/path.js.map +0 -1
  869. package/plugins/CmsParametersPlugin.d.ts +0 -18
  870. package/plugins/CmsParametersPlugin.js +0 -16
  871. package/plugins/CmsParametersPlugin.js.map +0 -1
  872. package/types/context.d.ts +0 -110
  873. /package/{types/context.js → utils/contentModelToJsonSchema/types.js} +0 -0
@@ -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"}
@@ -4,10 +4,7 @@ class SortImpl {
4
4
  const { fields: modelFields, input } = params;
5
5
  if (!input) return;
6
6
  const fields = modelFields.map((field)=>field.fieldId);
7
- const isField = (key)=>{
8
- const field = key.split("_")[0];
9
- return fields.includes(field);
10
- };
7
+ const isField = (key)=>fields.includes(key);
11
8
  return this.mapSort({
12
9
  input,
13
10
  isField
@@ -16,7 +13,7 @@ class SortImpl {
16
13
  mapSort(params) {
17
14
  const { input, isField } = params;
18
15
  return input.map((sort)=>{
19
- const match = sort.match(/^(values_)?([a-zA-Z][a-zA-Z0-9]*)_(ASC|DESC)$/);
16
+ const match = sort.match(/^(values_)?([a-zA-Z][a-zA-Z0-9_]*)_(ASC|DESC)$/);
20
17
  if (!match) return null;
21
18
  const [, hasValues, field, direction] = match;
22
19
  if (hasValues) return sort;
@@ -1 +1 @@
1
- {"version":3,"file":"features/sortMapper/SortMapper.js","sources":["../../../src/features/sortMapper/SortMapper.ts"],"sourcesContent":["/**\n * Used to map sorting for custom CMS Models.\n */\nimport { type CmsEntryListSort } from \"~/types/types.js\";\nimport { CmsSortMapper, ICmsSortMapperParams } from \"./abstractions.js\";\n\ninterface IMapSortParams {\n input: CmsEntryListSort;\n isField: (key: string) => boolean;\n}\n\nclass SortImpl implements CmsSortMapper.Interface {\n map(params: ICmsSortMapperParams): CmsEntryListSort | undefined {\n const { fields: modelFields, input } = params;\n if (!input) {\n return undefined;\n }\n\n const fields = modelFields.map(field => {\n return field.fieldId;\n });\n\n const isField = (key: string): boolean => {\n const field = key.split(\"_\")[0];\n return fields.includes(field);\n };\n\n return this.mapSort({\n input,\n isField\n });\n }\n\n private mapSort(params: IMapSortParams): CmsEntryListSort {\n const { input, isField } = params;\n\n return input\n .map(sort => {\n const match = sort.match(/^(values_)?([a-zA-Z][a-zA-Z0-9]*)_(ASC|DESC)$/);\n if (!match) {\n return null;\n }\n\n const [, hasValues, field, direction] = match;\n\n if (hasValues) {\n return sort;\n }\n\n if (isField(field)) {\n return `values_${field}_${direction}` as unknown as CmsEntryListSort[0];\n }\n\n return sort;\n })\n .filter((item): item is CmsEntryListSort[0] => !!item);\n }\n}\n\nexport const SortMapper = CmsSortMapper.createImplementation({\n implementation: SortImpl,\n dependencies: []\n});\n"],"names":["SortImpl","params","modelFields","input","fields","field","isField","key","sort","match","hasValues","direction","item","SortMapper","CmsSortMapper"],"mappings":";AAWA,MAAMA;IACF,IAAIC,MAA4B,EAAgC;QAC5D,MAAM,EAAE,QAAQC,WAAW,EAAEC,KAAK,EAAE,GAAGF;QACvC,IAAI,CAACE,OACD;QAGJ,MAAMC,SAASF,YAAY,GAAG,CAACG,CAAAA,QACpBA,MAAM,OAAO;QAGxB,MAAMC,UAAU,CAACC;YACb,MAAMF,QAAQE,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE;YAC/B,OAAOH,OAAO,QAAQ,CAACC;QAC3B;QAEA,OAAO,IAAI,CAAC,OAAO,CAAC;YAChBF;YACAG;QACJ;IACJ;IAEQ,QAAQL,MAAsB,EAAoB;QACtD,MAAM,EAAEE,KAAK,EAAEG,OAAO,EAAE,GAAGL;QAE3B,OAAOE,MACF,GAAG,CAACK,CAAAA;YACD,MAAMC,QAAQD,KAAK,KAAK,CAAC;YACzB,IAAI,CAACC,OACD,OAAO;YAGX,MAAM,GAAGC,WAAWL,OAAOM,UAAU,GAAGF;YAExC,IAAIC,WACA,OAAOF;YAGX,IAAIF,QAAQD,QACR,OAAO,CAAC,OAAO,EAAEA,MAAM,CAAC,EAAEM,WAAW;YAGzC,OAAOH;QACX,GACC,MAAM,CAAC,CAACI,OAAsC,CAAC,CAACA;IACzD;AACJ;AAEO,MAAMC,aAAaC,cAAc,oBAAoB,CAAC;IACzD,gBAAgBd;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/sortMapper/SortMapper.js","sources":["../../../src/features/sortMapper/SortMapper.ts"],"sourcesContent":["/**\n * Used to map sorting for custom CMS Models.\n */\nimport { type CmsEntryListSort } from \"~/types/types.js\";\nimport { CmsSortMapper, ICmsSortMapperParams } from \"./abstractions.js\";\n\ninterface IMapSortParams {\n input: CmsEntryListSort;\n isField: (key: string) => boolean;\n}\n\nclass SortImpl implements CmsSortMapper.Interface {\n map(params: ICmsSortMapperParams): CmsEntryListSort | undefined {\n const { fields: modelFields, input } = params;\n if (!input) {\n return undefined;\n }\n\n const fields = modelFields.map(field => {\n return field.fieldId;\n });\n\n /*\n * `mapSort` has already stripped the direction, so what arrives here is a bare fieldId and\n * is compared whole. Taking the segment before the first `_` would fail every fieldId that\n * contains one: `on_sale` would be looked up as `on`.\n */\n const isField = (key: string): boolean => {\n return fields.includes(key);\n };\n\n return this.mapSort({\n input,\n isField\n });\n }\n\n private mapSort(params: IMapSortParams): CmsEntryListSort {\n const { input, isField } = params;\n\n return input\n .map(sort => {\n // `_` is allowed inside the fieldId: excluding it made `on_sale_DESC` unmatchable,\n // and an unmatched directive is dropped from the sort entirely.\n const match = sort.match(/^(values_)?([a-zA-Z][a-zA-Z0-9_]*)_(ASC|DESC)$/);\n if (!match) {\n return null;\n }\n\n const [, hasValues, field, direction] = match;\n\n if (hasValues) {\n return sort;\n }\n\n if (isField(field)) {\n return `values_${field}_${direction}` as unknown as CmsEntryListSort[0];\n }\n\n return sort;\n })\n .filter((item): item is CmsEntryListSort[0] => !!item);\n }\n}\n\nexport const SortMapper = CmsSortMapper.createImplementation({\n implementation: SortImpl,\n dependencies: []\n});\n"],"names":["SortImpl","params","modelFields","input","fields","field","isField","key","sort","match","hasValues","direction","item","SortMapper","CmsSortMapper"],"mappings":";AAWA,MAAMA;IACF,IAAIC,MAA4B,EAAgC;QAC5D,MAAM,EAAE,QAAQC,WAAW,EAAEC,KAAK,EAAE,GAAGF;QACvC,IAAI,CAACE,OACD;QAGJ,MAAMC,SAASF,YAAY,GAAG,CAACG,CAAAA,QACpBA,MAAM,OAAO;QAQxB,MAAMC,UAAU,CAACC,MACNH,OAAO,QAAQ,CAACG;QAG3B,OAAO,IAAI,CAAC,OAAO,CAAC;YAChBJ;YACAG;QACJ;IACJ;IAEQ,QAAQL,MAAsB,EAAoB;QACtD,MAAM,EAAEE,KAAK,EAAEG,OAAO,EAAE,GAAGL;QAE3B,OAAOE,MACF,GAAG,CAACK,CAAAA;YAGD,MAAMC,QAAQD,KAAK,KAAK,CAAC;YACzB,IAAI,CAACC,OACD,OAAO;YAGX,MAAM,GAAGC,WAAWL,OAAOM,UAAU,GAAGF;YAExC,IAAIC,WACA,OAAOF;YAGX,IAAIF,QAAQD,QACR,OAAO,CAAC,OAAO,EAAEA,MAAM,CAAC,EAAEM,WAAW;YAGzC,OAAOH;QACX,GACC,MAAM,CAAC,CAACI,OAAsC,CAAC,CAACA;IACzD;AACJ;AAEO,MAAMC,aAAaC,cAAc,oBAAoB,CAAC;IACzD,gBAAgBd;IAChB,cAAc,EAAE;AACpB"}
@@ -26,20 +26,30 @@ class StorageTransformImpl {
26
26
  const { value, field, getStorageTransform, model } = params;
27
27
  if (!value) return null;
28
28
  const fields = field.settings?.fields || [];
29
- if (field.list) return await p_map(value, (value)=>processValue({
30
- sourceValue: value,
29
+ if (field.list) return await p_map(value, async (itemValue)=>{
30
+ const processed = await processValue({
31
+ sourceValue: itemValue,
31
32
  getStorageTransform,
32
33
  model,
33
34
  operation: "toStorage",
34
35
  fields
35
- }));
36
- return await processValue({
36
+ });
37
+ return itemValue._id ? {
38
+ _id: itemValue._id,
39
+ ...processed
40
+ } : processed;
41
+ });
42
+ const processed = await processValue({
37
43
  sourceValue: value,
38
44
  getStorageTransform,
39
45
  model,
40
46
  operation: "toStorage",
41
47
  fields
42
48
  });
49
+ return value._id ? {
50
+ _id: value._id,
51
+ ...processed
52
+ } : processed;
43
53
  }
44
54
  async fromStorage(params) {
45
55
  const { field, value: input, getStorageTransform, model } = params;
@@ -47,21 +57,31 @@ class StorageTransformImpl {
47
57
  const fields = field.settings?.fields || [];
48
58
  if (field.list) {
49
59
  const values = input;
50
- return await Promise.all(values.map(async (value)=>await processValue({
60
+ return await Promise.all(values.map(async (value)=>{
61
+ const processed = await processValue({
51
62
  sourceValue: value,
52
63
  getStorageTransform,
53
64
  model,
54
65
  operation: "fromStorage",
55
66
  fields
56
- })));
67
+ });
68
+ return value._id ? {
69
+ _id: value._id,
70
+ ...processed
71
+ } : processed;
72
+ }));
57
73
  }
58
- return await processValue({
74
+ const processed = await processValue({
59
75
  sourceValue: input,
60
76
  getStorageTransform,
61
77
  model,
62
78
  operation: "fromStorage",
63
79
  fields
64
80
  });
81
+ return input._id ? {
82
+ _id: input._id,
83
+ ...processed
84
+ } : processed;
65
85
  }
66
86
  constructor(){
67
87
  this.fieldType = "object";
@@ -1 +1 @@
1
- {"version":3,"file":"features/storage/fields/ObjectStorageTransform.js","sources":["../../../../src/features/storage/fields/ObjectStorageTransform.ts"],"sourcesContent":["import pReduce from \"p-reduce\";\nimport pMap from \"p-map\";\nimport type { CmsModel, CmsModelField } from \"~/types/index.js\";\nimport { StorageTransform } from \"../abstractions/StorageTransform.js\";\nimport { getBaseFieldType } from \"~/utils/getBaseFieldType.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\ninterface ProcessValueParams {\n fields: CmsModelField[];\n sourceValue: GenericRecord;\n getStorageTransform: (fieldType: string) => StorageTransform.Interface;\n model: CmsModel;\n operation: \"toStorage\" | \"fromStorage\";\n}\ninterface ProcessValue {\n (params: ProcessValueParams): Promise<GenericRecord>;\n}\n\nconst processValue: ProcessValue = async params => {\n const { fields, sourceValue, getStorageTransform, model, operation } = params;\n return await pReduce(\n fields,\n async (values, field) => {\n const baseType = getBaseFieldType(field);\n const storageTransform = getStorageTransform(baseType);\n if (!storageTransform) {\n throw new Error(`Missing storage transform for field type \"${baseType}\".`);\n }\n const input = sourceValue[field.fieldId];\n const value = await storageTransform[operation]({\n model,\n field,\n value: input,\n getStorageTransform\n });\n return { ...values, [field.fieldId]: value };\n },\n {}\n );\n};\n\nclass StorageTransformImpl implements StorageTransform.Interface {\n public readonly fieldType = \"object\";\n\n public async toStorage(\n params: StorageTransform.ToStorageParams\n ): StorageTransform.ToStorageResponse {\n const { value, field, getStorageTransform, model } = params;\n if (!value) {\n return null;\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n if (field.list) {\n return await pMap(value as GenericRecord[], value =>\n processValue({\n sourceValue: value,\n getStorageTransform,\n model,\n operation: \"toStorage\",\n fields\n })\n );\n }\n\n return await processValue({\n sourceValue: value,\n getStorageTransform,\n model,\n operation: \"toStorage\",\n fields\n });\n }\n\n public async fromStorage(\n params: StorageTransform.FromStorageParams\n ): StorageTransform.FromStorageResponse {\n const { field, value: input, getStorageTransform, model } = params;\n if (!input) {\n return null;\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n if (field.list) {\n const values = input as GenericRecord[];\n\n return await Promise.all(\n values.map(async value => {\n return await processValue({\n sourceValue: value,\n getStorageTransform,\n model,\n operation: \"fromStorage\",\n fields\n });\n })\n );\n }\n\n return await processValue({\n sourceValue: input,\n getStorageTransform,\n model,\n operation: \"fromStorage\",\n fields\n });\n }\n}\n\nexport const ObjectStorageTransform = StorageTransform.createImplementation({\n implementation: StorageTransformImpl,\n dependencies: []\n});\n"],"names":["processValue","params","fields","sourceValue","getStorageTransform","model","operation","pReduce","values","field","baseType","getBaseFieldType","storageTransform","Error","input","value","StorageTransformImpl","pMap","Promise","ObjectStorageTransform","StorageTransform"],"mappings":";;;;AAkBA,MAAMA,eAA6B,OAAMC;IACrC,MAAM,EAAEC,MAAM,EAAEC,WAAW,EAAEC,mBAAmB,EAAEC,KAAK,EAAEC,SAAS,EAAE,GAAGL;IACvE,OAAO,MAAMM,SACTL,QACA,OAAOM,QAAQC;QACX,MAAMC,WAAWC,iBAAiBF;QAClC,MAAMG,mBAAmBR,oBAAoBM;QAC7C,IAAI,CAACE,kBACD,MAAM,IAAIC,MAAM,CAAC,0CAA0C,EAAEH,SAAS,EAAE,CAAC;QAE7E,MAAMI,QAAQX,WAAW,CAACM,MAAM,OAAO,CAAC;QACxC,MAAMM,QAAQ,MAAMH,gBAAgB,CAACN,UAAU,CAAC;YAC5CD;YACAI;YACA,OAAOK;YACPV;QACJ;QACA,OAAO;YAAE,GAAGI,MAAM;YAAE,CAACC,MAAM,OAAO,CAAC,EAAEM;QAAM;IAC/C,GACA,CAAC;AAET;AAEA,MAAMC;IAGF,MAAa,UACTf,MAAwC,EACN;QAClC,MAAM,EAAEc,KAAK,EAAEN,KAAK,EAAEL,mBAAmB,EAAEC,KAAK,EAAE,GAAGJ;QACrD,IAAI,CAACc,OACD,OAAO;QAGX,MAAMb,SAAUO,MAAM,QAAQ,EAAE,UAAU,EAAE;QAE5C,IAAIA,MAAM,IAAI,EACV,OAAO,MAAMQ,MAAKF,OAA0BA,CAAAA,QACxCf,aAAa;gBACT,aAAae;gBACbX;gBACAC;gBACA,WAAW;gBACXH;YACJ;QAIR,OAAO,MAAMF,aAAa;YACtB,aAAae;YACbX;YACAC;YACA,WAAW;YACXH;QACJ;IACJ;IAEA,MAAa,YACTD,MAA0C,EACN;QACpC,MAAM,EAAEQ,KAAK,EAAE,OAAOK,KAAK,EAAEV,mBAAmB,EAAEC,KAAK,EAAE,GAAGJ;QAC5D,IAAI,CAACa,OACD,OAAO;QAGX,MAAMZ,SAAUO,MAAM,QAAQ,EAAE,UAAU,EAAE;QAE5C,IAAIA,MAAM,IAAI,EAAE;YACZ,MAAMD,SAASM;YAEf,OAAO,MAAMI,QAAQ,GAAG,CACpBV,OAAO,GAAG,CAAC,OAAMO,QACN,MAAMf,aAAa;oBACtB,aAAae;oBACbX;oBACAC;oBACA,WAAW;oBACXH;gBACJ;QAGZ;QAEA,OAAO,MAAMF,aAAa;YACtB,aAAac;YACbV;YACAC;YACA,WAAW;YACXH;QACJ;IACJ;;aAlEgB,SAAS,GAAG;;AAmEhC;AAEO,MAAMiB,yBAAyBC,iBAAiB,oBAAoB,CAAC;IACxE,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/storage/fields/ObjectStorageTransform.js","sources":["../../../../src/features/storage/fields/ObjectStorageTransform.ts"],"sourcesContent":["import pReduce from \"p-reduce\";\nimport pMap from \"p-map\";\nimport type { CmsModel, CmsModelField } from \"~/types/index.js\";\nimport { StorageTransform } from \"../abstractions/StorageTransform.js\";\nimport { getBaseFieldType } from \"~/utils/getBaseFieldType.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\ninterface ProcessValueParams {\n fields: CmsModelField[];\n sourceValue: GenericRecord;\n getStorageTransform: (fieldType: string) => StorageTransform.Interface;\n model: CmsModel;\n operation: \"toStorage\" | \"fromStorage\";\n}\ninterface ProcessValue {\n (params: ProcessValueParams): Promise<GenericRecord>;\n}\n\nconst processValue: ProcessValue = async params => {\n const { fields, sourceValue, getStorageTransform, model, operation } = params;\n return await pReduce(\n fields,\n async (values, field) => {\n const baseType = getBaseFieldType(field);\n const storageTransform = getStorageTransform(baseType);\n if (!storageTransform) {\n throw new Error(`Missing storage transform for field type \"${baseType}\".`);\n }\n const input = sourceValue[field.fieldId];\n const value = await storageTransform[operation]({\n model,\n field,\n value: input,\n getStorageTransform\n });\n return { ...values, [field.fieldId]: value };\n },\n {}\n );\n};\n\nclass StorageTransformImpl implements StorageTransform.Interface {\n public readonly fieldType = \"object\";\n\n public async toStorage(\n params: StorageTransform.ToStorageParams\n ): StorageTransform.ToStorageResponse {\n const { value, field, getStorageTransform, model } = params;\n if (!value) {\n return null;\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n if (field.list) {\n return await pMap(value as GenericRecord[], async itemValue => {\n const processed = await processValue({\n sourceValue: itemValue,\n getStorageTransform,\n model,\n operation: \"toStorage\",\n fields\n });\n return itemValue._id ? { _id: itemValue._id, ...processed } : processed;\n });\n }\n\n const processed = await processValue({\n sourceValue: value,\n getStorageTransform,\n model,\n operation: \"toStorage\",\n fields\n });\n return value._id ? { _id: value._id, ...processed } : processed;\n }\n\n public async fromStorage(\n params: StorageTransform.FromStorageParams\n ): StorageTransform.FromStorageResponse {\n const { field, value: input, getStorageTransform, model } = params;\n if (!input) {\n return null;\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n if (field.list) {\n const values = input as GenericRecord[];\n\n return await Promise.all(\n values.map(async value => {\n const processed = await processValue({\n sourceValue: value,\n getStorageTransform,\n model,\n operation: \"fromStorage\",\n fields\n });\n return value._id ? { _id: value._id, ...processed } : processed;\n })\n );\n }\n\n const processed = await processValue({\n sourceValue: input,\n getStorageTransform,\n model,\n operation: \"fromStorage\",\n fields\n });\n return input._id ? { _id: input._id, ...processed } : processed;\n }\n}\n\nexport const ObjectStorageTransform = StorageTransform.createImplementation({\n implementation: StorageTransformImpl,\n dependencies: []\n});\n"],"names":["processValue","params","fields","sourceValue","getStorageTransform","model","operation","pReduce","values","field","baseType","getBaseFieldType","storageTransform","Error","input","value","StorageTransformImpl","pMap","itemValue","processed","Promise","ObjectStorageTransform","StorageTransform"],"mappings":";;;;AAkBA,MAAMA,eAA6B,OAAMC;IACrC,MAAM,EAAEC,MAAM,EAAEC,WAAW,EAAEC,mBAAmB,EAAEC,KAAK,EAAEC,SAAS,EAAE,GAAGL;IACvE,OAAO,MAAMM,SACTL,QACA,OAAOM,QAAQC;QACX,MAAMC,WAAWC,iBAAiBF;QAClC,MAAMG,mBAAmBR,oBAAoBM;QAC7C,IAAI,CAACE,kBACD,MAAM,IAAIC,MAAM,CAAC,0CAA0C,EAAEH,SAAS,EAAE,CAAC;QAE7E,MAAMI,QAAQX,WAAW,CAACM,MAAM,OAAO,CAAC;QACxC,MAAMM,QAAQ,MAAMH,gBAAgB,CAACN,UAAU,CAAC;YAC5CD;YACAI;YACA,OAAOK;YACPV;QACJ;QACA,OAAO;YAAE,GAAGI,MAAM;YAAE,CAACC,MAAM,OAAO,CAAC,EAAEM;QAAM;IAC/C,GACA,CAAC;AAET;AAEA,MAAMC;IAGF,MAAa,UACTf,MAAwC,EACN;QAClC,MAAM,EAAEc,KAAK,EAAEN,KAAK,EAAEL,mBAAmB,EAAEC,KAAK,EAAE,GAAGJ;QACrD,IAAI,CAACc,OACD,OAAO;QAGX,MAAMb,SAAUO,MAAM,QAAQ,EAAE,UAAU,EAAE;QAE5C,IAAIA,MAAM,IAAI,EACV,OAAO,MAAMQ,MAAKF,OAA0B,OAAMG;YAC9C,MAAMC,YAAY,MAAMnB,aAAa;gBACjC,aAAakB;gBACbd;gBACAC;gBACA,WAAW;gBACXH;YACJ;YACA,OAAOgB,UAAU,GAAG,GAAG;gBAAE,KAAKA,UAAU,GAAG;gBAAE,GAAGC,SAAS;YAAC,IAAIA;QAClE;QAGJ,MAAMA,YAAY,MAAMnB,aAAa;YACjC,aAAae;YACbX;YACAC;YACA,WAAW;YACXH;QACJ;QACA,OAAOa,MAAM,GAAG,GAAG;YAAE,KAAKA,MAAM,GAAG;YAAE,GAAGI,SAAS;QAAC,IAAIA;IAC1D;IAEA,MAAa,YACTlB,MAA0C,EACN;QACpC,MAAM,EAAEQ,KAAK,EAAE,OAAOK,KAAK,EAAEV,mBAAmB,EAAEC,KAAK,EAAE,GAAGJ;QAC5D,IAAI,CAACa,OACD,OAAO;QAGX,MAAMZ,SAAUO,MAAM,QAAQ,EAAE,UAAU,EAAE;QAE5C,IAAIA,MAAM,IAAI,EAAE;YACZ,MAAMD,SAASM;YAEf,OAAO,MAAMM,QAAQ,GAAG,CACpBZ,OAAO,GAAG,CAAC,OAAMO;gBACb,MAAMI,YAAY,MAAMnB,aAAa;oBACjC,aAAae;oBACbX;oBACAC;oBACA,WAAW;oBACXH;gBACJ;gBACA,OAAOa,MAAM,GAAG,GAAG;oBAAE,KAAKA,MAAM,GAAG;oBAAE,GAAGI,SAAS;gBAAC,IAAIA;YAC1D;QAER;QAEA,MAAMA,YAAY,MAAMnB,aAAa;YACjC,aAAac;YACbV;YACAC;YACA,WAAW;YACXH;QACJ;QACA,OAAOY,MAAM,GAAG,GAAG;YAAE,KAAKA,MAAM,GAAG;YAAE,GAAGK,SAAS;QAAC,IAAIA;IAC1D;;aAtEgB,SAAS,GAAG;;AAuEhC;AAEO,MAAME,yBAAyBC,iBAAiB,oBAAoB,CAAC;IACxE,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
@@ -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"}
@@ -15,7 +15,7 @@ class PatternValidatorImpl {
15
15
  if (patternValidator) pattern = patternValidator.pattern;
16
16
  }
17
17
  if (!pattern) return true;
18
- return new RegExp(pattern.regex, pattern.flags).test(value);
18
+ return new RegExp(pattern.regex, pattern.flags || void 0).test(value);
19
19
  }
20
20
  }
21
21
  const PatternValidator = CmsModelFieldValidator.createImplementation({
@@ -1 +1 @@
1
- {"version":3,"file":"features/validation/validators/PatternValidator.js","sources":["../../../../src/features/validation/validators/PatternValidator.ts"],"sourcesContent":["import { CmsModelFieldValidator } from \"../abstractions/CmsModelFieldValidator.js\";\nimport { CmsModelFieldPatternValidatorRegistry } from \"../abstractions/CmsModelFieldPatternValidatorRegistry.js\";\nimport type { CmsModelFieldValidatorValidateParams } from \"~/types/types.js\";\n\nclass PatternValidatorImpl implements CmsModelFieldValidator.Interface {\n public readonly name = \"pattern\";\n\n public constructor(\n private readonly patternRegistry: CmsModelFieldPatternValidatorRegistry.Interface\n ) {}\n\n public async validate({\n value,\n validator\n }: CmsModelFieldValidatorValidateParams): Promise<boolean> {\n if (typeof value !== \"string\" || !value) {\n return true;\n }\n\n const { settings } = validator;\n\n let pattern;\n if (settings?.preset === \"custom\") {\n pattern = settings;\n } else if (settings?.preset) {\n const patternValidator = this.patternRegistry.get(settings.preset);\n if (patternValidator) {\n pattern = patternValidator.pattern;\n }\n }\n\n if (!pattern) {\n return true;\n }\n\n return new RegExp(pattern.regex, pattern.flags).test(value);\n }\n}\n\nexport const PatternValidator = CmsModelFieldValidator.createImplementation({\n implementation: PatternValidatorImpl,\n dependencies: [CmsModelFieldPatternValidatorRegistry]\n});\n"],"names":["PatternValidatorImpl","patternRegistry","value","validator","settings","pattern","patternValidator","RegExp","PatternValidator","CmsModelFieldValidator","CmsModelFieldPatternValidatorRegistry"],"mappings":";;AAIA,MAAMA;IAGF,YACqBC,eAAgE,CACnF;aADmBA,eAAe,GAAfA;aAHL,IAAI,GAAG;IAIpB;IAEH,MAAa,SAAS,EAClBC,KAAK,EACLC,SAAS,EAC0B,EAAoB;QACvD,IAAI,AAAiB,YAAjB,OAAOD,SAAsB,CAACA,OAC9B,OAAO;QAGX,MAAM,EAAEE,QAAQ,EAAE,GAAGD;QAErB,IAAIE;QACJ,IAAID,UAAU,WAAW,UACrBC,UAAUD;aACP,IAAIA,UAAU,QAAQ;YACzB,MAAME,mBAAmB,IAAI,CAAC,eAAe,CAAC,GAAG,CAACF,SAAS,MAAM;YACjE,IAAIE,kBACAD,UAAUC,iBAAiB,OAAO;QAE1C;QAEA,IAAI,CAACD,SACD,OAAO;QAGX,OAAO,IAAIE,OAAOF,QAAQ,KAAK,EAAEA,QAAQ,KAAK,EAAE,IAAI,CAACH;IACzD;AACJ;AAEO,MAAMM,mBAAmBC,uBAAuB,oBAAoB,CAAC;IACxE,gBAAgBT;IAChB,cAAc;QAACU;KAAsC;AACzD"}
1
+ {"version":3,"file":"features/validation/validators/PatternValidator.js","sources":["../../../../src/features/validation/validators/PatternValidator.ts"],"sourcesContent":["import { CmsModelFieldValidator } from \"../abstractions/CmsModelFieldValidator.js\";\nimport { CmsModelFieldPatternValidatorRegistry } from \"../abstractions/CmsModelFieldPatternValidatorRegistry.js\";\nimport type { CmsModelFieldValidatorValidateParams } from \"~/types/types.js\";\n\nclass PatternValidatorImpl implements CmsModelFieldValidator.Interface {\n public readonly name = \"pattern\";\n\n public constructor(\n private readonly patternRegistry: CmsModelFieldPatternValidatorRegistry.Interface\n ) {}\n\n public async validate({\n value,\n validator\n }: CmsModelFieldValidatorValidateParams): Promise<boolean> {\n if (typeof value !== \"string\" || !value) {\n return true;\n }\n\n const { settings } = validator;\n\n let pattern;\n if (settings?.preset === \"custom\") {\n pattern = settings;\n } else if (settings?.preset) {\n const patternValidator = this.patternRegistry.get(settings.preset);\n if (patternValidator) {\n pattern = patternValidator.pattern;\n }\n }\n\n if (!pattern) {\n return true;\n }\n\n return new RegExp(pattern.regex, pattern.flags || undefined).test(value);\n }\n}\n\nexport const PatternValidator = CmsModelFieldValidator.createImplementation({\n implementation: PatternValidatorImpl,\n dependencies: [CmsModelFieldPatternValidatorRegistry]\n});\n"],"names":["PatternValidatorImpl","patternRegistry","value","validator","settings","pattern","patternValidator","RegExp","undefined","PatternValidator","CmsModelFieldValidator","CmsModelFieldPatternValidatorRegistry"],"mappings":";;AAIA,MAAMA;IAGF,YACqBC,eAAgE,CACnF;aADmBA,eAAe,GAAfA;aAHL,IAAI,GAAG;IAIpB;IAEH,MAAa,SAAS,EAClBC,KAAK,EACLC,SAAS,EAC0B,EAAoB;QACvD,IAAI,AAAiB,YAAjB,OAAOD,SAAsB,CAACA,OAC9B,OAAO;QAGX,MAAM,EAAEE,QAAQ,EAAE,GAAGD;QAErB,IAAIE;QACJ,IAAID,UAAU,WAAW,UACrBC,UAAUD;aACP,IAAIA,UAAU,QAAQ;YACzB,MAAME,mBAAmB,IAAI,CAAC,eAAe,CAAC,GAAG,CAACF,SAAS,MAAM;YACjE,IAAIE,kBACAD,UAAUC,iBAAiB,OAAO;QAE1C;QAEA,IAAI,CAACD,SACD,OAAO;QAGX,OAAO,IAAIE,OAAOF,QAAQ,KAAK,EAAEA,QAAQ,KAAK,IAAIG,QAAW,IAAI,CAACN;IACtE;AACJ;AAEO,MAAMO,mBAAmBC,uBAAuB,oBAAoB,CAAC;IACxE,gBAAgBV;IAChB,cAAc;QAACW;KAAsC;AACzD"}
@@ -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"}
@@ -9,11 +9,8 @@ class WhereMapperImpl {
9
9
  map(params) {
10
10
  const { fields: modelFields, input } = params;
11
11
  if (!input) return;
12
- const fields = modelFields.map((field)=>field.fieldId);
13
- const isField = (key)=>{
14
- const field = key.split("_")[0];
15
- return fields.includes(field);
16
- };
12
+ const fields = modelFields.map((field)=>field.fieldId).sort((a, b)=>b.length - a.length);
13
+ const isField = (key)=>fields.some((fieldId)=>key === fieldId || key.startsWith(`${fieldId}_`));
17
14
  return this.mapWhere({
18
15
  input,
19
16
  isField
@@ -33,6 +30,11 @@ class WhereMapperImpl {
33
30
  }));
34
31
  continue;
35
32
  }
33
+ if ("values" === key && isPlainObject(value)) {
34
+ if (!out.values) out.values = {};
35
+ Object.assign(out.values, value);
36
+ continue;
37
+ }
36
38
  if (isField(key)) {
37
39
  if (!out.values) out.values = {};
38
40
  out.values[key] = value;
@@ -1 +1 @@
1
- {"version":3,"file":"features/whereMapper/WhereMapper.js","sources":["../../../src/features/whereMapper/WhereMapper.ts"],"sourcesContent":["/**\n * Used to map a model with custom schema with fields in a root to values object.\n * eg. File Manager File model has \"title\" and \"tags\" fields in the root, but they should be\n * mapped to \"values.title\" and \"values.tags\" when creating the entry.\n */\nimport { GenericRecord } from \"@webiny/api/types.js\";\nimport { CmsEntryListWhere } from \"~/types/types.js\";\nimport { CmsWhereMapper, ICmsWhereMapperParams } from \"./abstractions.js\";\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> => {\n if (!value || typeof value !== \"object\") {\n return false;\n } else if (Array.isArray(value)) {\n return false;\n }\n return true;\n};\n\nconst isLogicalKey = (key: string): key is \"AND\" | \"OR\" => {\n return key === \"AND\" || key === \"OR\";\n};\n\ninterface IMapNodeWhereParams {\n input: GenericRecord;\n isField: (key: string) => boolean;\n}\n\nclass WhereMapperImpl implements CmsWhereMapper.Interface {\n map<T extends GenericRecord>(params: ICmsWhereMapperParams<T>): CmsEntryListWhere | undefined {\n const { fields: modelFields, input } = params;\n if (!input) {\n return undefined;\n }\n\n const fields = modelFields.map(field => {\n return field.fieldId;\n });\n\n const isField = (key: string): boolean => {\n const field = key.split(\"_\")[0];\n return fields.includes(field);\n };\n\n return this.mapWhere({\n input,\n isField\n });\n }\n\n private mapWhere(params: IMapNodeWhereParams) {\n const { input, isField } = params;\n const out: CmsEntryListWhere = {};\n\n const keys = Object.keys(input) as (keyof typeof out)[];\n if (keys.length === 0) {\n return out;\n }\n\n for (const key of keys) {\n const value = input[key];\n\n if (isLogicalKey(key)) {\n if (Array.isArray(value)) {\n out[key] = value.filter(isPlainObject).map(child => {\n return this.mapWhere({\n input: child,\n isField\n });\n });\n }\n continue;\n } else if (isField(key)) {\n if (!out.values) {\n out.values = {};\n }\n out.values[key] = value;\n continue;\n }\n\n out[key] = value;\n }\n\n return out;\n }\n}\n\nexport const WhereMapper = CmsWhereMapper.createImplementation({\n implementation: WhereMapperImpl,\n dependencies: []\n});\n"],"names":["isPlainObject","value","Array","isLogicalKey","key","WhereMapperImpl","params","modelFields","input","fields","field","isField","out","keys","Object","child","WhereMapper","CmsWhereMapper"],"mappings":";AASA,MAAMA,gBAAgB,CAACC;IACnB,IAAI,CAACA,SAAS,AAAiB,YAAjB,OAAOA,OACjB,OAAO;IACJ,IAAIC,MAAM,OAAO,CAACD,QACrB,OAAO;IAEX,OAAO;AACX;AAEA,MAAME,eAAe,CAACC,MACXA,AAAQ,UAARA,OAAiBA,AAAQ,SAARA;AAQ5B,MAAMC;IACF,IAA6BC,MAAgC,EAAiC;QAC1F,MAAM,EAAE,QAAQC,WAAW,EAAEC,KAAK,EAAE,GAAGF;QACvC,IAAI,CAACE,OACD;QAGJ,MAAMC,SAASF,YAAY,GAAG,CAACG,CAAAA,QACpBA,MAAM,OAAO;QAGxB,MAAMC,UAAU,CAACP;YACb,MAAMM,QAAQN,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE;YAC/B,OAAOK,OAAO,QAAQ,CAACC;QAC3B;QAEA,OAAO,IAAI,CAAC,QAAQ,CAAC;YACjBF;YACAG;QACJ;IACJ;IAEQ,SAASL,MAA2B,EAAE;QAC1C,MAAM,EAAEE,KAAK,EAAEG,OAAO,EAAE,GAAGL;QAC3B,MAAMM,MAAyB,CAAC;QAEhC,MAAMC,OAAOC,OAAO,IAAI,CAACN;QACzB,IAAIK,AAAgB,MAAhBA,KAAK,MAAM,EACX,OAAOD;QAGX,KAAK,MAAMR,OAAOS,KAAM;YACpB,MAAMZ,QAAQO,KAAK,CAACJ,IAAI;YAExB,IAAID,aAAaC,MAAM;gBACnB,IAAIF,MAAM,OAAO,CAACD,QACdW,GAAG,CAACR,IAAI,GAAGH,MAAM,MAAM,CAACD,eAAe,GAAG,CAACe,CAAAA,QAChC,IAAI,CAAC,QAAQ,CAAC;wBACjB,OAAOA;wBACPJ;oBACJ;gBAGR;YACJ;YAAO,IAAIA,QAAQP,MAAM;gBACrB,IAAI,CAACQ,IAAI,MAAM,EACXA,IAAI,MAAM,GAAG,CAAC;gBAElBA,IAAI,MAAM,CAACR,IAAI,GAAGH;gBAClB;YACJ;YAEAW,GAAG,CAACR,IAAI,GAAGH;QACf;QAEA,OAAOW;IACX;AACJ;AAEO,MAAMI,cAAcC,eAAe,oBAAoB,CAAC;IAC3D,gBAAgBZ;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/whereMapper/WhereMapper.js","sources":["../../../src/features/whereMapper/WhereMapper.ts"],"sourcesContent":["/**\n * Used to map a model with custom schema with fields in a root to values object.\n * eg. File Manager File model has \"title\" and \"tags\" fields in the root, but they should be\n * mapped to \"values.title\" and \"values.tags\" when creating the entry.\n */\nimport { GenericRecord } from \"@webiny/api/types.js\";\nimport { CmsEntryListWhere } from \"~/types/types.js\";\nimport { CmsWhereMapper, ICmsWhereMapperParams } from \"./abstractions.js\";\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> => {\n if (!value || typeof value !== \"object\") {\n return false;\n } else if (Array.isArray(value)) {\n return false;\n }\n return true;\n};\n\nconst isLogicalKey = (key: string): key is \"AND\" | \"OR\" => {\n return key === \"AND\" || key === \"OR\";\n};\n\ninterface IMapNodeWhereParams {\n input: GenericRecord;\n isField: (key: string) => boolean;\n}\n\nclass WhereMapperImpl implements CmsWhereMapper.Interface {\n map<T extends GenericRecord>(params: ICmsWhereMapperParams<T>): CmsEntryListWhere | undefined {\n const { fields: modelFields, input } = params;\n if (!input) {\n return undefined;\n }\n\n /*\n * Longest fieldId first, so a key is attributed to the longest field it could belong to.\n * Taking the segment before the first `_` misreads any fieldId that contains one:\n * `on_sale_contains` resolves to a field named `on`, which does not exist, so the filter\n * silently stays at the top level and the CMS rejects it. Longest-first also keeps a model\n * with both `price` and `price_range` from being mis-routed.\n */\n const fields = modelFields.map(field => field.fieldId).sort((a, b) => b.length - a.length);\n\n const isField = (key: string): boolean => {\n return fields.some(fieldId => key === fieldId || key.startsWith(`${fieldId}_`));\n };\n\n return this.mapWhere({\n input,\n isField\n });\n }\n\n private mapWhere(params: IMapNodeWhereParams) {\n const { input, isField } = params;\n const out: CmsEntryListWhere = {};\n\n const keys = Object.keys(input) as (keyof typeof out)[];\n if (keys.length === 0) {\n return out;\n }\n\n for (const key of keys) {\n const value = input[key];\n\n if (isLogicalKey(key)) {\n if (Array.isArray(value)) {\n out[key] = value.filter(isPlainObject).map(child => {\n return this.mapWhere({\n input: child,\n isField\n });\n });\n }\n continue;\n } else if (key === \"values\" && isPlainObject(value)) {\n /*\n * A caller that already nested its model fields is taken at its word. Merged rather\n * than assigned, so an explicit `values` object and flat field keys can coexist:\n * assigning would drop whichever of the two arrived first.\n */\n if (!out.values) {\n out.values = {};\n }\n Object.assign(out.values, value);\n continue;\n } else if (isField(key)) {\n if (!out.values) {\n out.values = {};\n }\n out.values[key] = value;\n continue;\n }\n\n out[key] = value;\n }\n\n return out;\n }\n}\n\nexport const WhereMapper = CmsWhereMapper.createImplementation({\n implementation: WhereMapperImpl,\n dependencies: []\n});\n"],"names":["isPlainObject","value","Array","isLogicalKey","key","WhereMapperImpl","params","modelFields","input","fields","field","a","b","isField","fieldId","out","keys","Object","child","WhereMapper","CmsWhereMapper"],"mappings":";AASA,MAAMA,gBAAgB,CAACC;IACnB,IAAI,CAACA,SAAS,AAAiB,YAAjB,OAAOA,OACjB,OAAO;IACJ,IAAIC,MAAM,OAAO,CAACD,QACrB,OAAO;IAEX,OAAO;AACX;AAEA,MAAME,eAAe,CAACC,MACXA,AAAQ,UAARA,OAAiBA,AAAQ,SAARA;AAQ5B,MAAMC;IACF,IAA6BC,MAAgC,EAAiC;QAC1F,MAAM,EAAE,QAAQC,WAAW,EAAEC,KAAK,EAAE,GAAGF;QACvC,IAAI,CAACE,OACD;QAUJ,MAAMC,SAASF,YAAY,GAAG,CAACG,CAAAA,QAASA,MAAM,OAAO,EAAE,IAAI,CAAC,CAACC,GAAGC,IAAMA,EAAE,MAAM,GAAGD,EAAE,MAAM;QAEzF,MAAME,UAAU,CAACT,MACNK,OAAO,IAAI,CAACK,CAAAA,UAAWV,QAAQU,WAAWV,IAAI,UAAU,CAAC,GAAGU,QAAQ,CAAC,CAAC;QAGjF,OAAO,IAAI,CAAC,QAAQ,CAAC;YACjBN;YACAK;QACJ;IACJ;IAEQ,SAASP,MAA2B,EAAE;QAC1C,MAAM,EAAEE,KAAK,EAAEK,OAAO,EAAE,GAAGP;QAC3B,MAAMS,MAAyB,CAAC;QAEhC,MAAMC,OAAOC,OAAO,IAAI,CAACT;QACzB,IAAIQ,AAAgB,MAAhBA,KAAK,MAAM,EACX,OAAOD;QAGX,KAAK,MAAMX,OAAOY,KAAM;YACpB,MAAMf,QAAQO,KAAK,CAACJ,IAAI;YAExB,IAAID,aAAaC,MAAM;gBACnB,IAAIF,MAAM,OAAO,CAACD,QACdc,GAAG,CAACX,IAAI,GAAGH,MAAM,MAAM,CAACD,eAAe,GAAG,CAACkB,CAAAA,QAChC,IAAI,CAAC,QAAQ,CAAC;wBACjB,OAAOA;wBACPL;oBACJ;gBAGR;YACJ;YAAO,IAAIT,AAAQ,aAARA,OAAoBJ,cAAcC,QAAQ;gBAMjD,IAAI,CAACc,IAAI,MAAM,EACXA,IAAI,MAAM,GAAG,CAAC;gBAElBE,OAAO,MAAM,CAACF,IAAI,MAAM,EAAEd;gBAC1B;YACJ;YAAO,IAAIY,QAAQT,MAAM;gBACrB,IAAI,CAACW,IAAI,MAAM,EACXA,IAAI,MAAM,GAAG,CAAC;gBAElBA,IAAI,MAAM,CAACX,IAAI,GAAGH;gBAClB;YACJ;YAEAc,GAAG,CAACX,IAAI,GAAGH;QACf;QAEA,OAAOc;IACX;AACJ;AAEO,MAAMI,cAAcC,eAAe,oBAAoB,CAAC;IAC3D,gBAAgBf;IAChB,cAAc,EAAE;AACpB"}
@@ -47,7 +47,10 @@ class CmsModelDynamicZoneFieldConverterPlugin extends CmsModelFieldConverterPlug
47
47
  Object.assign(values, converted);
48
48
  return values;
49
49
  }, {
50
- _templateId: template.id
50
+ _templateId: template.id,
51
+ ...value._id ? {
52
+ _id: value._id
53
+ } : {}
51
54
  });
52
55
  }
53
56
  convertFromStorage(params) {
@@ -61,7 +64,7 @@ class CmsModelDynamicZoneFieldConverterPlugin extends CmsModelFieldConverterPlug
61
64
  templates,
62
65
  converterCollection,
63
66
  value: item
64
- }))
67
+ })).filter(Boolean)
65
68
  };
66
69
  }
67
70
  if (Array.isArray(value)) throw new error(`Dynamic zone field "${field.fieldId}" is expecting a non-array value.`, "DYNAMIC_ZONE_EXPECTING_NON_ARRAY_VALUE", {
@@ -82,8 +85,12 @@ class CmsModelDynamicZoneFieldConverterPlugin extends CmsModelFieldConverterPlug
82
85
  if (null == value) return;
83
86
  const { _templateId } = value;
84
87
  const template = templates.find((t)=>t.id === _templateId);
85
- if (!template) throw new error("Unknown template - converting from storage.", "UNKNOWN_TEMPLATE", {
86
- templateId: _templateId
88
+ if (!template) return void console.warn({
89
+ message: "Unknown template - converting from storage.",
90
+ code: "UNKNOWN_TEMPLATE",
91
+ data: {
92
+ templateId: _templateId
93
+ }
87
94
  });
88
95
  return template.fields.reduce((values, field)=>{
89
96
  const converter = converterCollection.getConverter(field.type);
@@ -94,7 +101,10 @@ class CmsModelDynamicZoneFieldConverterPlugin extends CmsModelFieldConverterPlug
94
101
  Object.assign(values, converted);
95
102
  return values;
96
103
  }, {
97
- _templateId: template.id
104
+ _templateId: template.id,
105
+ ...value._id ? {
106
+ _id: value._id
107
+ } : {}
98
108
  });
99
109
  }
100
110
  constructor(...args){
@@ -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 }\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.map(item => {\n return this.processFromStorage({\n templates,\n converterCollection,\n value: item\n });\n })\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 throw new WebinyError(\n \"Unknown template - converting from storage.\",\n \"UNKNOWN_TEMPLATE\",\n {\n templateId: _templateId\n }\n );\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 }\n );\n }\n}\n"],"names":["CmsModelDynamicZoneFieldConverterPlugin","CmsModelFieldConverterPlugin","field","params","value","converterCollection","templates","Array","item","processedValue","templateId","template","t","values","converter","converted","undefined","Object","arrayValue","WebinyError","_templateId"],"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;QAC5B;IAER;IAEgB,mBACZR,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,WAAW,GAAG,CAACV,CAAAA,OACrB,IAAI,CAAC,kBAAkB,CAAC;wBAC3BF;wBACAD;wBACA,OAAOG;oBACX;YAER;QACJ;QAEA,IAAID,MAAM,OAAO,CAACH,QACd,MAAM,IAAIe,MACN,CAAC,oBAAoB,EAAEjB,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,EAAEgB,WAAW,EAAE,GAAGhB;QAExB,MAAMO,WAAWL,UAAU,IAAI,CAACM,CAAAA,IAAKA,EAAE,EAAE,KAAKQ;QAC9C,IAAI,CAACT,UACD,MAAM,IAAIQ,MACN,+CACA,oBACA;YACI,YAAYC;QAChB;QAIR,OAAOT,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;QAC5B;IAER;;QAvKG,qBACa,IAAI,GAAG;;AAuK3B"}
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"}
@@ -43,6 +43,9 @@ class CmsModelObjectFieldConverterPlugin extends CmsModelFieldConverterPlugin {
43
43
  processChildFieldsToStorage(params) {
44
44
  const { fields, value, converterCollection } = params;
45
45
  if (null == value) return;
46
+ const initial = value._id ? {
47
+ _id: value._id
48
+ } : {};
46
49
  return fields.reduce((output, field)=>{
47
50
  if (void 0 === value[field.fieldId]) return output;
48
51
  const converter = converterCollection.getConverter(field.type);
@@ -55,7 +58,7 @@ class CmsModelObjectFieldConverterPlugin extends CmsModelFieldConverterPlugin {
55
58
  ...output,
56
59
  ...newValue
57
60
  };
58
- }, {});
61
+ }, initial);
59
62
  }
60
63
  convertFromStorage(params) {
61
64
  const { field, value, converterCollection } = params;
@@ -94,6 +97,9 @@ class CmsModelObjectFieldConverterPlugin extends CmsModelFieldConverterPlugin {
94
97
  processChildFieldsFromStorage(params) {
95
98
  const { fields, value, converterCollection } = params;
96
99
  if (null == value) return;
100
+ const initial = value._id ? {
101
+ _id: value._id
102
+ } : {};
97
103
  return fields.reduce((output, field)=>{
98
104
  if (void 0 === value[field.storageId]) return output;
99
105
  const converter = converterCollection.getConverter(field.type);
@@ -107,7 +113,7 @@ class CmsModelObjectFieldConverterPlugin extends CmsModelFieldConverterPlugin {
107
113
  ...output,
108
114
  ...newValue
109
115
  };
110
- }, {});
116
+ }, initial);
111
117
  }
112
118
  constructor(...args){
113
119
  super(...args), this.name = "cms.field.converter.object";