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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (786) hide show
  1. package/HeadlessCmsEndpointConfig.d.ts +10 -0
  2. package/HeadlessCmsEndpointConfig.js +5 -0
  3. package/HeadlessCmsEndpointConfig.js.map +1 -0
  4. package/HeadlessCmsFeature.d.ts +10 -0
  5. package/HeadlessCmsFeature.js +168 -0
  6. package/HeadlessCmsFeature.js.map +1 -0
  7. package/createCmsRoute.d.ts +24 -0
  8. package/createCmsRoute.js +47 -0
  9. package/createCmsRoute.js.map +1 -0
  10. package/crud/contentEntry/entryDataValidation.js +14 -7
  11. package/crud/contentEntry/entryDataValidation.js.map +1 -1
  12. package/crud/contentEntry/references/validateEntries.d.ts +1 -1
  13. package/crud/contentEntry/references/validateEntries.js +17 -7
  14. package/crud/contentEntry/references/validateEntries.js.map +1 -1
  15. package/domain/contentModel/schemas.d.ts +2 -0
  16. package/domain/contentModel/schemas.js +1 -0
  17. package/domain/contentModel/schemas.js.map +1 -1
  18. package/domain/contentModel/validation/dateExpressions.d.ts +6 -0
  19. package/domain/contentModel/validation/dateExpressions.js +27 -0
  20. package/domain/contentModel/validation/dateExpressions.js.map +1 -0
  21. package/domain/contentModel/validation/modelFields.js +23 -15
  22. package/domain/contentModel/validation/modelFields.js.map +1 -1
  23. package/export/abstractions.d.ts +9 -0
  24. package/export/abstractions.js +6 -0
  25. package/export/abstractions.js.map +1 -0
  26. package/export/crud/exporting.js +8 -2
  27. package/export/crud/exporting.js.map +1 -1
  28. package/export/crud/importing.js +13 -4
  29. package/export/crud/importing.js.map +1 -1
  30. package/export/crud/imports/importGroups.js +23 -23
  31. package/export/crud/imports/importGroups.js.map +1 -1
  32. package/export/crud/imports/importModels.js +25 -22
  33. package/export/crud/imports/importModels.js.map +1 -1
  34. package/export/graphql/index.d.ts +2 -3
  35. package/export/graphql/index.js +6 -10
  36. package/export/graphql/index.js.map +1 -1
  37. package/exports/api/cms/entry.d.ts +5 -0
  38. package/exports/api/cms/entry.js +5 -0
  39. package/exports/api/cms/storage.d.ts +0 -1
  40. package/exports/api/cms/storage.js +0 -1
  41. package/features/ai/DescribeContentModelTool.d.ts +60 -0
  42. package/features/ai/DescribeContentModelTool.js +69 -0
  43. package/features/ai/DescribeContentModelTool.js.map +1 -0
  44. package/features/ai/ListContentModelsTool.d.ts +46 -0
  45. package/features/ai/ListContentModelsTool.js +53 -0
  46. package/features/ai/ListContentModelsTool.js.map +1 -0
  47. package/features/ai/QueryEntriesTool.d.ts +80 -0
  48. package/features/ai/QueryEntriesTool.js +99 -0
  49. package/features/ai/QueryEntriesTool.js.map +1 -0
  50. package/features/ai/feature.d.ts +8 -0
  51. package/features/ai/feature.js +15 -0
  52. package/features/ai/feature.js.map +1 -0
  53. package/features/ai/index.d.ts +4 -0
  54. package/features/ai/index.js +4 -0
  55. package/features/contentEntry/ContentEntriesFeature.js +8 -4
  56. package/features/contentEntry/ContentEntriesFeature.js.map +1 -1
  57. package/features/contentEntry/CreateEntry/CreateEntryRepository.d.ts +6 -4
  58. package/features/contentEntry/CreateEntry/CreateEntryRepository.js +7 -8
  59. package/features/contentEntry/CreateEntry/CreateEntryRepository.js.map +1 -1
  60. package/features/contentEntry/CreateEntry/CreateEntryUseCase.d.ts +5 -3
  61. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js +4 -5
  62. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js.map +1 -1
  63. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.d.ts +6 -4
  64. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js +7 -8
  65. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js.map +1 -1
  66. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.d.ts +5 -5
  67. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js +8 -17
  68. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js.map +1 -1
  69. package/features/contentEntry/CreateEntryRevisionFrom/abstractions.d.ts +2 -0
  70. package/features/contentEntry/CreateEntryRevisionFrom/abstractions.js.map +1 -1
  71. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.d.ts +6 -4
  72. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js +7 -8
  73. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js.map +1 -1
  74. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.d.ts +5 -3
  75. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js +4 -5
  76. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js.map +1 -1
  77. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.d.ts +6 -4
  78. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js +9 -11
  79. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js.map +1 -1
  80. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.d.ts +5 -3
  81. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js +4 -5
  82. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js.map +1 -1
  83. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.d.ts +3 -3
  84. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js +5 -5
  85. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js.map +1 -1
  86. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.d.ts +6 -4
  87. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js +7 -8
  88. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js.map +1 -1
  89. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.d.ts +5 -3
  90. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js +4 -5
  91. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js.map +1 -1
  92. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.d.ts +6 -4
  93. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js +8 -9
  94. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js.map +1 -1
  95. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.d.ts +5 -3
  96. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js +13 -13
  97. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js.map +1 -1
  98. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.d.ts +17 -0
  99. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.js +83 -0
  100. package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.js.map +1 -0
  101. package/features/contentEntry/DuplicateEntry/abstractions.d.ts +47 -0
  102. package/features/contentEntry/DuplicateEntry/abstractions.js +5 -0
  103. package/features/contentEntry/DuplicateEntry/abstractions.js.map +1 -0
  104. package/features/contentEntry/DuplicateEntry/events.d.ts +41 -0
  105. package/features/contentEntry/DuplicateEntry/events.js +32 -0
  106. package/features/contentEntry/DuplicateEntry/events.js.map +1 -0
  107. package/features/contentEntry/{UpdateRevision → DuplicateEntry}/feature.d.ts +1 -1
  108. package/features/contentEntry/DuplicateEntry/feature.js +11 -0
  109. package/features/contentEntry/DuplicateEntry/feature.js.map +1 -0
  110. package/features/contentEntry/DuplicateEntry/index.d.ts +2 -0
  111. package/features/contentEntry/DuplicateEntry/index.js +2 -0
  112. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.d.ts +7 -0
  113. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.js +12 -0
  114. package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.js.map +1 -0
  115. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.d.ts +10 -0
  116. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.js +25 -0
  117. package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.js.map +1 -0
  118. package/features/contentEntry/EntryEventPublisher/abstractions.d.ts +16 -0
  119. package/features/contentEntry/EntryEventPublisher/abstractions.js +5 -0
  120. package/features/contentEntry/EntryEventPublisher/abstractions.js.map +1 -0
  121. package/features/contentEntry/EntryEventPublisher/feature.d.ts +4 -0
  122. package/features/contentEntry/EntryEventPublisher/feature.js +11 -0
  123. package/features/contentEntry/EntryEventPublisher/feature.js.map +1 -0
  124. package/features/contentEntry/EntryEventPublisher/index.d.ts +2 -0
  125. package/features/contentEntry/EntryEventPublisher/index.js +2 -0
  126. package/features/contentEntry/EntrySystemField/abstractions.d.ts +14 -0
  127. package/features/contentEntry/EntrySystemField/abstractions.js +5 -0
  128. package/features/contentEntry/EntrySystemField/abstractions.js.map +1 -0
  129. package/features/contentEntry/EntrySystemField/index.d.ts +1 -0
  130. package/features/contentEntry/EntrySystemField/index.js +1 -0
  131. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.d.ts +6 -4
  132. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js +7 -8
  133. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js.map +1 -1
  134. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.d.ts +3 -1
  135. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js +2 -3
  136. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js.map +1 -1
  137. package/features/contentEntry/GetEntry/GetEntryUseCase.d.ts +3 -1
  138. package/features/contentEntry/GetEntry/GetEntryUseCase.js +2 -3
  139. package/features/contentEntry/GetEntry/GetEntryUseCase.js.map +1 -1
  140. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.d.ts +3 -1
  141. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js +2 -3
  142. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js.map +1 -1
  143. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.d.ts +6 -4
  144. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js +8 -9
  145. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js.map +1 -1
  146. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.d.ts +3 -1
  147. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js +2 -3
  148. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js.map +1 -1
  149. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.d.ts +3 -1
  150. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js +2 -3
  151. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js.map +1 -1
  152. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.d.ts +6 -4
  153. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js +8 -9
  154. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js.map +1 -1
  155. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.d.ts +3 -1
  156. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js +2 -3
  157. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js.map +1 -1
  158. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.d.ts +3 -1
  159. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js +1 -3
  160. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js.map +1 -1
  161. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.d.ts +3 -1
  162. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js +2 -3
  163. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js.map +1 -1
  164. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.d.ts +3 -1
  165. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js +2 -3
  166. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js.map +1 -1
  167. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.d.ts +6 -4
  168. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js +7 -8
  169. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js.map +1 -1
  170. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.d.ts +3 -1
  171. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js +2 -3
  172. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js.map +1 -1
  173. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.d.ts +6 -4
  174. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js +8 -9
  175. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js.map +1 -1
  176. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.d.ts +3 -1
  177. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js +2 -3
  178. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js.map +1 -1
  179. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.d.ts +6 -4
  180. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js +8 -9
  181. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js.map +1 -1
  182. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.d.ts +3 -1
  183. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js +2 -3
  184. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js.map +1 -1
  185. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.d.ts +6 -4
  186. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js +7 -8
  187. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js.map +1 -1
  188. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.d.ts +3 -1
  189. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js +1 -3
  190. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js.map +1 -1
  191. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.d.ts +6 -4
  192. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js +8 -9
  193. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js.map +1 -1
  194. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.d.ts +3 -1
  195. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js +2 -3
  196. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js.map +1 -1
  197. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.d.ts +6 -4
  198. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js +7 -8
  199. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js.map +1 -1
  200. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.d.ts +6 -2
  201. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js +8 -6
  202. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js.map +1 -1
  203. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.d.ts +3 -1
  204. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js +1 -3
  205. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js.map +1 -1
  206. package/features/contentEntry/ListEntries/ListEntriesRepository.d.ts +6 -4
  207. package/features/contentEntry/ListEntries/ListEntriesRepository.js +8 -9
  208. package/features/contentEntry/ListEntries/ListEntriesRepository.js.map +1 -1
  209. package/features/contentEntry/ListEntries/ListEntriesUseCase.d.ts +3 -1
  210. package/features/contentEntry/ListEntries/ListEntriesUseCase.js +2 -3
  211. package/features/contentEntry/ListEntries/ListEntriesUseCase.js.map +1 -1
  212. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.d.ts +3 -1
  213. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js +1 -3
  214. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js.map +1 -1
  215. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.d.ts +3 -1
  216. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js +1 -3
  217. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js.map +1 -1
  218. package/features/contentEntry/MoveEntry/MoveEntryRepository.d.ts +6 -4
  219. package/features/contentEntry/MoveEntry/MoveEntryRepository.js +7 -8
  220. package/features/contentEntry/MoveEntry/MoveEntryRepository.js.map +1 -1
  221. package/features/contentEntry/MoveEntry/MoveEntryUseCase.d.ts +5 -3
  222. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js +13 -7
  223. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js.map +1 -1
  224. package/features/contentEntry/PublishEntry/PublishEntryRepository.d.ts +7 -5
  225. package/features/contentEntry/PublishEntry/PublishEntryRepository.js +8 -9
  226. package/features/contentEntry/PublishEntry/PublishEntryRepository.js.map +1 -1
  227. package/features/contentEntry/PublishEntry/PublishEntryUseCase.d.ts +7 -7
  228. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js +13 -16
  229. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js.map +1 -1
  230. package/features/contentEntry/PublishEntry/abstractions.d.ts +8 -1
  231. package/features/contentEntry/PublishEntry/abstractions.js.map +1 -1
  232. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.d.ts +8 -4
  233. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js +11 -9
  234. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js.map +1 -1
  235. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.d.ts +5 -3
  236. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js +7 -6
  237. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js.map +1 -1
  238. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.d.ts +6 -4
  239. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js +7 -8
  240. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js.map +1 -1
  241. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.d.ts +5 -3
  242. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js +4 -5
  243. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js.map +1 -1
  244. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.d.ts +6 -4
  245. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js +7 -8
  246. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js.map +1 -1
  247. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.d.ts +5 -3
  248. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js +7 -6
  249. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js.map +1 -1
  250. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.d.ts +7 -5
  251. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js +7 -8
  252. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js.map +1 -1
  253. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.d.ts +5 -3
  254. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js +7 -6
  255. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js.map +1 -1
  256. package/features/contentEntry/UpdateEntrySystem/UpdateEntrySystemUseCase.d.ts +19 -0
  257. package/features/contentEntry/UpdateEntrySystem/UpdateEntrySystemUseCase.js +70 -0
  258. package/features/contentEntry/UpdateEntrySystem/UpdateEntrySystemUseCase.js.map +1 -0
  259. package/features/contentEntry/UpdateEntrySystem/abstractions.d.ts +24 -0
  260. package/features/contentEntry/UpdateEntrySystem/abstractions.js +5 -0
  261. package/features/contentEntry/UpdateEntrySystem/abstractions.js.map +1 -0
  262. package/features/contentEntry/UpdateEntrySystem/events.d.ts +29 -0
  263. package/features/contentEntry/UpdateEntrySystem/events.js +23 -0
  264. package/features/contentEntry/UpdateEntrySystem/events.js.map +1 -0
  265. package/features/contentEntry/UpdateEntrySystem/feature.d.ts +4 -0
  266. package/features/contentEntry/UpdateEntrySystem/feature.js +11 -0
  267. package/features/contentEntry/UpdateEntrySystem/feature.js.map +1 -0
  268. package/features/contentEntry/UpdateEntrySystem/index.d.ts +2 -0
  269. package/features/contentEntry/UpdateEntrySystem/index.js +2 -0
  270. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.d.ts +6 -4
  271. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js +6 -7
  272. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js.map +1 -1
  273. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.d.ts +3 -1
  274. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js +2 -3
  275. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js.map +1 -1
  276. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.d.ts +3 -1
  277. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js +1 -3
  278. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js.map +1 -1
  279. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.d.ts +8 -4
  280. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js +41 -16
  281. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js.map +1 -1
  282. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/abstractions.d.ts +17 -1
  283. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/abstractions.js.map +1 -1
  284. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.d.ts +8 -4
  285. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js +23 -18
  286. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js.map +1 -1
  287. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/abstractions.d.ts +15 -1
  288. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/abstractions.js.map +1 -1
  289. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.d.ts +8 -4
  290. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js +18 -15
  291. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js.map +1 -1
  292. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/abstractions.d.ts +13 -1
  293. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/abstractions.js.map +1 -1
  294. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.d.ts +9 -7
  295. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js +18 -20
  296. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js.map +1 -1
  297. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/abstractions.d.ts +14 -2
  298. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/abstractions.js.map +1 -1
  299. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.d.ts +8 -4
  300. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js +67 -31
  301. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js.map +1 -1
  302. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/abstractions.d.ts +15 -1
  303. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/abstractions.js.map +1 -1
  304. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.d.ts +24 -0
  305. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.js +13 -0
  306. package/features/contentEntry/entryDataFactories/hasEntryContentChanged.js.map +1 -0
  307. package/features/contentModel/CreateModel/CreateModelRepository.d.ts +5 -6
  308. package/features/contentModel/CreateModel/CreateModelRepository.js +9 -12
  309. package/features/contentModel/CreateModel/CreateModelRepository.js.map +1 -1
  310. package/features/contentModel/CreateModel/CreateModelUseCase.js +2 -2
  311. package/features/contentModel/CreateModel/CreateModelUseCase.js.map +1 -1
  312. package/features/contentModel/CreateModel/abstractions.d.ts +1 -1
  313. package/features/contentModel/CreateModel/abstractions.js.map +1 -1
  314. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.d.ts +5 -6
  315. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js +9 -12
  316. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js.map +1 -1
  317. package/features/contentModel/CreateModelFrom/CreateModelFromUseCase.js +2 -2
  318. package/features/contentModel/CreateModelFrom/CreateModelFromUseCase.js.map +1 -1
  319. package/features/contentModel/CreateModelFrom/abstractions.d.ts +1 -1
  320. package/features/contentModel/CreateModelFrom/abstractions.js.map +1 -1
  321. package/features/contentModel/DeleteModel/DeleteModelRepository.d.ts +3 -3
  322. package/features/contentModel/DeleteModel/DeleteModelRepository.js +5 -5
  323. package/features/contentModel/DeleteModel/DeleteModelRepository.js.map +1 -1
  324. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.d.ts +9 -3
  325. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js +36 -18
  326. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js.map +1 -1
  327. package/features/contentModel/ModelToAstConverter/ModelToAstConverter.d.ts +1 -1
  328. package/features/contentModel/ModelToAstConverter/ModelToAstConverter.js.map +1 -1
  329. package/features/contentModel/ModelToAstConverter/abstractions.d.ts +1 -1
  330. package/features/contentModel/ModelToAstConverter/abstractions.js.map +1 -1
  331. package/features/contentModel/UpdateModel/UpdateModelRepository.d.ts +7 -4
  332. package/features/contentModel/UpdateModel/UpdateModelRepository.js +10 -6
  333. package/features/contentModel/UpdateModel/UpdateModelRepository.js.map +1 -1
  334. package/features/contentModel/UpdateModel/UpdateModelUseCase.js.map +1 -1
  335. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js +1 -1
  336. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js.map +1 -1
  337. package/features/contentModel/shared/ModelsFetcher.d.ts +9 -8
  338. package/features/contentModel/shared/ModelsFetcher.js +5 -5
  339. package/features/contentModel/shared/ModelsFetcher.js.map +1 -1
  340. package/features/contentModel/shared/PluginModelsProvider.d.ts +9 -5
  341. package/features/contentModel/shared/PluginModelsProvider.js +11 -15
  342. package/features/contentModel/shared/PluginModelsProvider.js.map +1 -1
  343. package/features/contentModel/shared/abstractions.d.ts +10 -0
  344. package/features/contentModel/shared/abstractions.js +2 -1
  345. package/features/contentModel/shared/abstractions.js.map +1 -1
  346. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.d.ts +11 -7
  347. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js +19 -19
  348. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js.map +1 -1
  349. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.d.ts +6 -2
  350. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js +9 -8
  351. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js.map +1 -1
  352. package/features/contentModelGroup/CreateGroup/abstractions.d.ts +1 -1
  353. package/features/contentModelGroup/CreateGroup/abstractions.js.map +1 -1
  354. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.d.ts +8 -4
  355. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js +11 -9
  356. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js.map +1 -1
  357. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.d.ts +3 -1
  358. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js +2 -3
  359. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js.map +1 -1
  360. package/features/contentModelGroup/GetGroup/GetGroupRepository.d.ts +6 -4
  361. package/features/contentModelGroup/GetGroup/GetGroupRepository.js +9 -9
  362. package/features/contentModelGroup/GetGroup/GetGroupRepository.js.map +1 -1
  363. package/features/contentModelGroup/GetGroup/GetGroupUseCase.d.ts +3 -1
  364. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js +2 -3
  365. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js.map +1 -1
  366. package/features/contentModelGroup/ListGroups/ListGroupsRepository.d.ts +6 -4
  367. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js +9 -9
  368. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js.map +1 -1
  369. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.d.ts +3 -1
  370. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js +2 -3
  371. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js.map +1 -1
  372. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.d.ts +6 -4
  373. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js +7 -8
  374. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js.map +1 -1
  375. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.d.ts +3 -1
  376. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js +2 -3
  377. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js.map +1 -1
  378. package/features/contentModelGroup/shared/PluginGroupsProvider.d.ts +6 -4
  379. package/features/contentModelGroup/shared/PluginGroupsProvider.js +13 -11
  380. package/features/contentModelGroup/shared/PluginGroupsProvider.js.map +1 -1
  381. package/features/contentModelGroup/shared/abstractions.d.ts +10 -0
  382. package/features/contentModelGroup/shared/abstractions.js +2 -1
  383. package/features/contentModelGroup/shared/abstractions.js.map +1 -1
  384. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.d.ts +2 -2
  385. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.js.map +1 -1
  386. package/features/graphql/fields/base/AssetToGraphQL.d.ts +1 -1
  387. package/features/graphql/fields/base/AssetToGraphQL.js +7 -2
  388. package/features/graphql/fields/base/AssetToGraphQL.js.map +1 -1
  389. package/features/graphql/fields/base/DynamicZoneToGraphQL.js.map +1 -1
  390. package/features/graphql/fields/base/RefToGraphQL.d.ts +1 -1
  391. package/features/graphql/fields/base/RefToGraphQL.js +14 -8
  392. package/features/graphql/fields/base/RefToGraphQL.js.map +1 -1
  393. package/features/graphql/fields/base/richText/richTextResolver.d.ts +1 -1
  394. package/features/graphql/fields/base/richText/richTextResolver.js.map +1 -1
  395. package/features/modelBuilder/abstractions.d.ts +4 -0
  396. package/features/modelBuilder/abstractions.js.map +1 -1
  397. package/features/modelBuilder/feature.js +1 -8
  398. package/features/modelBuilder/feature.js.map +1 -1
  399. package/features/modelBuilder/fields/DataFieldBuilder.d.ts +17 -0
  400. package/features/modelBuilder/fields/DataFieldBuilder.js +6 -0
  401. package/features/modelBuilder/fields/DataFieldBuilder.js.map +1 -1
  402. package/features/modelBuilder/fields/DateTimeFieldType.js +27 -12
  403. package/features/modelBuilder/fields/DateTimeFieldType.js.map +1 -1
  404. package/features/modelBuilder/fields/TextFieldType.d.ts +3 -1
  405. package/features/modelBuilder/fields/TextFieldType.js +1 -3
  406. package/features/modelBuilder/fields/TextFieldType.js.map +1 -1
  407. package/features/modelBuilder/fields/fieldTypeValidator.d.ts +5 -3
  408. package/features/modelBuilder/models/ModelBuilder.d.ts +8 -0
  409. package/features/modelBuilder/models/ModelBuilder.js +1 -0
  410. package/features/modelBuilder/models/ModelBuilder.js.map +1 -1
  411. package/features/modelBuilder/models/ModelsProvider.d.ts +1 -3
  412. package/features/modelBuilder/models/ModelsProvider.js +2 -7
  413. package/features/modelBuilder/models/ModelsProvider.js.map +1 -1
  414. package/features/modelBuilder/models/PrivateModelBuilder.d.ts +5 -0
  415. package/features/modelBuilder/models/PrivateModelBuilder.js +12 -1
  416. package/features/modelBuilder/models/PrivateModelBuilder.js.map +1 -1
  417. package/features/shared/abstractions.d.ts +8 -16
  418. package/features/shared/abstractions.js +2 -3
  419. package/features/shared/abstractions.js.map +1 -1
  420. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.d.ts +8 -0
  421. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js +5 -0
  422. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js.map +1 -0
  423. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.d.ts +8 -0
  424. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js +5 -0
  425. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js.map +1 -0
  426. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.d.ts +8 -0
  427. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js +5 -0
  428. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js.map +1 -0
  429. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.d.ts +8 -0
  430. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js +5 -0
  431. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js.map +1 -0
  432. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.d.ts +8 -0
  433. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js +5 -0
  434. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js.map +1 -0
  435. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.d.ts +8 -0
  436. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js +5 -0
  437. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js.map +1 -0
  438. package/features/shared/storageOperations/entry/GetEntryStorageOperation.d.ts +8 -0
  439. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js +5 -0
  440. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js.map +1 -0
  441. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.d.ts +8 -0
  442. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js +5 -0
  443. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js.map +1 -0
  444. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.d.ts +8 -0
  445. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js +5 -0
  446. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js.map +1 -0
  447. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.d.ts +8 -0
  448. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js +5 -0
  449. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js.map +1 -0
  450. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.d.ts +8 -0
  451. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js +5 -0
  452. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js.map +1 -0
  453. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.d.ts +8 -0
  454. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js +5 -0
  455. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js.map +1 -0
  456. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.d.ts +8 -0
  457. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js +5 -0
  458. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js.map +1 -0
  459. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.d.ts +8 -0
  460. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js +5 -0
  461. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js.map +1 -0
  462. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.d.ts +8 -0
  463. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js +5 -0
  464. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js.map +1 -0
  465. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.d.ts +8 -0
  466. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js +5 -0
  467. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js.map +1 -0
  468. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.d.ts +8 -0
  469. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js +5 -0
  470. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js.map +1 -0
  471. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.d.ts +8 -0
  472. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js +5 -0
  473. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js.map +1 -0
  474. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.d.ts +8 -0
  475. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js +5 -0
  476. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js.map +1 -0
  477. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.d.ts +8 -0
  478. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js +5 -0
  479. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js.map +1 -0
  480. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.d.ts +8 -0
  481. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js +5 -0
  482. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js.map +1 -0
  483. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.d.ts +8 -0
  484. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js +5 -0
  485. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js.map +1 -0
  486. package/features/shared/storageOperations/group/CreateGroupStorageOperation.d.ts +8 -0
  487. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js +5 -0
  488. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js.map +1 -0
  489. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.d.ts +8 -0
  490. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js +5 -0
  491. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js.map +1 -0
  492. package/features/shared/storageOperations/group/GetGroupStorageOperation.d.ts +8 -0
  493. package/features/shared/storageOperations/group/GetGroupStorageOperation.js +5 -0
  494. package/features/shared/storageOperations/group/GetGroupStorageOperation.js.map +1 -0
  495. package/features/shared/storageOperations/group/ListGroupsStorageOperation.d.ts +8 -0
  496. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js +5 -0
  497. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js.map +1 -0
  498. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.d.ts +8 -0
  499. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js +5 -0
  500. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js.map +1 -0
  501. package/features/shared/storageOperations/index.d.ts +32 -0
  502. package/features/shared/storageOperations/index.js +32 -0
  503. package/features/shared/storageOperations/model/CreateModelStorageOperation.d.ts +8 -0
  504. package/features/shared/storageOperations/model/CreateModelStorageOperation.js +5 -0
  505. package/features/shared/storageOperations/model/CreateModelStorageOperation.js.map +1 -0
  506. package/features/shared/storageOperations/model/DeleteModelStorageOperation.d.ts +8 -0
  507. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js +5 -0
  508. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js.map +1 -0
  509. package/features/shared/storageOperations/model/GetModelStorageOperation.d.ts +8 -0
  510. package/features/shared/storageOperations/model/GetModelStorageOperation.js +5 -0
  511. package/features/shared/storageOperations/model/GetModelStorageOperation.js.map +1 -0
  512. package/features/shared/storageOperations/model/ListModelsStorageOperation.d.ts +8 -0
  513. package/features/shared/storageOperations/model/ListModelsStorageOperation.js +5 -0
  514. package/features/shared/storageOperations/model/ListModelsStorageOperation.js.map +1 -0
  515. package/features/shared/storageOperations/model/UpdateModelStorageOperation.d.ts +8 -0
  516. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js +5 -0
  517. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js.map +1 -0
  518. package/features/validation/abstractions/CmsModelFieldValidator.d.ts +5 -0
  519. package/features/validation/abstractions/CmsModelFieldValidator.js.map +1 -1
  520. package/features/validation/validators/DateGteValidator.d.ts +2 -0
  521. package/features/validation/validators/DateGteValidator.js +12 -2
  522. package/features/validation/validators/DateGteValidator.js.map +1 -1
  523. package/features/validation/validators/DateLteValidator.d.ts +2 -0
  524. package/features/validation/validators/DateLteValidator.js +12 -2
  525. package/features/validation/validators/DateLteValidator.js.map +1 -1
  526. package/features/validation/validators/dateLimit.d.ts +9 -0
  527. package/features/validation/validators/dateLimit.js +18 -0
  528. package/features/validation/validators/dateLimit.js.map +1 -0
  529. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
  530. package/fieldConverters/abstractions.d.ts +14 -0
  531. package/fieldConverters/abstractions.js +13 -0
  532. package/fieldConverters/abstractions.js.map +1 -0
  533. package/graphql/CmsGraphQLSchemaFactory.d.ts +8 -0
  534. package/graphql/CmsGraphQLSchemaFactory.js +5 -0
  535. package/graphql/CmsGraphQLSchemaFactory.js.map +1 -0
  536. package/graphql/CmsSchemaExecutor.d.ts +10 -0
  537. package/graphql/CmsSchemaExecutor.js +5 -0
  538. package/graphql/CmsSchemaExecutor.js.map +1 -0
  539. package/graphql/buildSchemaPlugins.d.ts +2 -1
  540. package/graphql/buildSchemaPlugins.js +1 -3
  541. package/graphql/buildSchemaPlugins.js.map +1 -1
  542. package/graphql/checkEndpointAccess.js +5 -2
  543. package/graphql/checkEndpointAccess.js.map +1 -1
  544. package/graphql/createExecutableSchema.d.ts +1 -1
  545. package/graphql/createExecutableSchema.js +1 -1
  546. package/graphql/createExecutableSchema.js.map +1 -1
  547. package/graphql/generateSchema.d.ts +2 -1
  548. package/graphql/generateSchema.js +14 -5
  549. package/graphql/generateSchema.js.map +1 -1
  550. package/graphql/getSchema.js +7 -2
  551. package/graphql/getSchema.js.map +1 -1
  552. package/graphql/scalars/RevisionIdScalarPlugin.d.ts +1 -1
  553. package/graphql/scalars/RevisionIdScalarPlugin.js.map +1 -1
  554. package/graphql/schema/baseContentSchema.d.ts +1 -6
  555. package/graphql/schema/baseContentSchema.js +5 -8
  556. package/graphql/schema/baseContentSchema.js.map +1 -1
  557. package/graphql/schema/baseSchema.d.ts +2 -2
  558. package/graphql/schema/baseSchema.js +3 -18
  559. package/graphql/schema/baseSchema.js.map +1 -1
  560. package/graphql/schema/cms/CmsBaseErrorTypeFactory.d.ts +15 -0
  561. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js +25 -0
  562. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js.map +1 -0
  563. package/graphql/schema/cms/createEntryResolver.js +2 -2
  564. package/graphql/schema/cms/createEntryResolver.js.map +1 -1
  565. package/graphql/schema/cms/deleteEntryResolver.js +2 -2
  566. package/graphql/schema/cms/deleteEntryResolver.js.map +1 -1
  567. package/graphql/schema/cms/getEntryResolver.js +2 -2
  568. package/graphql/schema/cms/getEntryResolver.js.map +1 -1
  569. package/graphql/schema/cms/helpers/getModel.d.ts +0 -3
  570. package/graphql/schema/cms/helpers/getModel.js +5 -3
  571. package/graphql/schema/cms/helpers/getModel.js.map +1 -1
  572. package/graphql/schema/cms/listEntriesResolver.js +2 -2
  573. package/graphql/schema/cms/listEntriesResolver.js.map +1 -1
  574. package/graphql/schema/cms/publishEntryResolver.js +2 -2
  575. package/graphql/schema/cms/publishEntryResolver.js.map +1 -1
  576. package/graphql/schema/cms/resolvers/createEntry.d.ts +3 -2
  577. package/graphql/schema/cms/resolvers/createEntry.js +5 -1
  578. package/graphql/schema/cms/resolvers/createEntry.js.map +1 -1
  579. package/graphql/schema/cms/resolvers/deleteEntryRevision.d.ts +3 -2
  580. package/graphql/schema/cms/resolvers/deleteEntryRevision.js +5 -1
  581. package/graphql/schema/cms/resolvers/deleteEntryRevision.js.map +1 -1
  582. package/graphql/schema/cms/resolvers/getEntry.d.ts +3 -2
  583. package/graphql/schema/cms/resolvers/getEntry.js +5 -1
  584. package/graphql/schema/cms/resolvers/getEntry.js.map +1 -1
  585. package/graphql/schema/cms/resolvers/getModel.d.ts +3 -2
  586. package/graphql/schema/cms/resolvers/getModel.js +5 -1
  587. package/graphql/schema/cms/resolvers/getModel.js.map +1 -1
  588. package/graphql/schema/cms/resolvers/listEntries.d.ts +3 -2
  589. package/graphql/schema/cms/resolvers/listEntries.js +5 -1
  590. package/graphql/schema/cms/resolvers/listEntries.js.map +1 -1
  591. package/graphql/schema/cms/resolvers/mutationCms.d.ts +3 -2
  592. package/graphql/schema/cms/resolvers/mutationCms.js +5 -1
  593. package/graphql/schema/cms/resolvers/mutationCms.js.map +1 -1
  594. package/graphql/schema/cms/resolvers/publishEntryRevision.d.ts +3 -2
  595. package/graphql/schema/cms/resolvers/publishEntryRevision.js +5 -1
  596. package/graphql/schema/cms/resolvers/publishEntryRevision.js.map +1 -1
  597. package/graphql/schema/cms/resolvers/queryCms.d.ts +3 -2
  598. package/graphql/schema/cms/resolvers/queryCms.js +5 -1
  599. package/graphql/schema/cms/resolvers/queryCms.js.map +1 -1
  600. package/graphql/schema/cms/resolvers/unpublishEntryRevision.d.ts +3 -2
  601. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js +5 -1
  602. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js.map +1 -1
  603. package/graphql/schema/cms/resolvers/updateEntryRevision.d.ts +3 -2
  604. package/graphql/schema/cms/resolvers/updateEntryRevision.js +5 -1
  605. package/graphql/schema/cms/resolvers/updateEntryRevision.js.map +1 -1
  606. package/graphql/schema/cms/typeDefs/mutation.d.ts +3 -2
  607. package/graphql/schema/cms/typeDefs/mutation.js +5 -1
  608. package/graphql/schema/cms/typeDefs/mutation.js.map +1 -1
  609. package/graphql/schema/cms/typeDefs/query.d.ts +3 -2
  610. package/graphql/schema/cms/typeDefs/query.js +5 -1
  611. package/graphql/schema/cms/typeDefs/query.js.map +1 -1
  612. package/graphql/schema/cms/typeDefs/responses.d.ts +3 -2
  613. package/graphql/schema/cms/typeDefs/responses.js +5 -1
  614. package/graphql/schema/cms/typeDefs/responses.js.map +1 -1
  615. package/graphql/schema/cms/unpublishEntryResolver.js +2 -2
  616. package/graphql/schema/cms/unpublishEntryResolver.js.map +1 -1
  617. package/graphql/schema/cms/updateEntryResolver.js +2 -2
  618. package/graphql/schema/cms/updateEntryResolver.js.map +1 -1
  619. package/graphql/schema/contentEntries.js +60 -34
  620. package/graphql/schema/contentEntries.js.map +1 -1
  621. package/graphql/schema/contentModelGroups.js +39 -18
  622. package/graphql/schema/contentModelGroups.js.map +1 -1
  623. package/graphql/schema/contentModels.js +32 -15
  624. package/graphql/schema/contentModels.js.map +1 -1
  625. package/graphql/schema/createFieldResolvers.d.ts +1 -1
  626. package/graphql/schema/createFieldResolvers.js.map +1 -1
  627. package/graphql/schema/createManageResolvers.js +7 -3
  628. package/graphql/schema/createManageResolvers.js.map +1 -1
  629. package/graphql/schema/createManageSDL.js +2 -0
  630. package/graphql/schema/createManageSDL.js.map +1 -1
  631. package/graphql/schema/resolvers/manage/resolveCreate.js +5 -3
  632. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
  633. package/graphql/schema/resolvers/manage/resolveCreateFrom.js +5 -3
  634. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
  635. package/graphql/schema/resolvers/manage/resolveDelete.js +9 -4
  636. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
  637. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +5 -3
  638. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -1
  639. package/graphql/schema/resolvers/manage/resolveDuplicate.d.ts +7 -0
  640. package/graphql/schema/resolvers/manage/resolveDuplicate.js +11 -0
  641. package/graphql/schema/resolvers/manage/resolveDuplicate.js.map +1 -0
  642. package/graphql/schema/resolvers/manage/resolveGet.js +11 -6
  643. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
  644. package/graphql/schema/resolvers/manage/resolveGetByIds.js +5 -3
  645. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
  646. package/graphql/schema/resolvers/manage/resolveGetRevisions.js +5 -3
  647. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
  648. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +5 -3
  649. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -1
  650. package/graphql/schema/resolvers/manage/resolveList.js +5 -3
  651. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
  652. package/graphql/schema/resolvers/manage/resolveListDeleted.js +5 -3
  653. package/graphql/schema/resolvers/manage/resolveListDeleted.js.map +1 -1
  654. package/graphql/schema/resolvers/manage/resolveMove.js +4 -2
  655. package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -1
  656. package/graphql/schema/resolvers/manage/resolvePublish.js +5 -3
  657. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
  658. package/graphql/schema/resolvers/manage/resolveRepublish.js +5 -3
  659. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
  660. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js +5 -3
  661. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js.map +1 -1
  662. package/graphql/schema/resolvers/manage/resolveUnpublish.js +5 -3
  663. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
  664. package/graphql/schema/resolvers/manage/resolveUpdate.js +5 -3
  665. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
  666. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js +5 -3
  667. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js.map +1 -1
  668. package/graphql/schema/resolvers/manage/resolveValidate.js +5 -3
  669. package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -1
  670. package/graphql/schema/resolvers/preview/resolveGet.js +6 -3
  671. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
  672. package/graphql/schema/resolvers/preview/resolveList.js +5 -3
  673. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
  674. package/graphql/schema/resolvers/read/resolveGet.js +5 -2
  675. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
  676. package/graphql/schema/resolvers/read/resolveList.js +5 -3
  677. package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
  678. package/graphql/schema/resolvers/singular/resolveGet.js +1 -1
  679. package/graphql/schema/resolvers/singular/resolveGet.js.map +1 -1
  680. package/graphql/schema/resolvers/singular/resolveUpdate.js +1 -1
  681. package/graphql/schema/resolvers/singular/resolveUpdate.js.map +1 -1
  682. package/graphql/schema/schemaPlugins.d.ts +2 -1
  683. package/graphql/schema/schemaPlugins.js +2 -4
  684. package/graphql/schema/schemaPlugins.js.map +1 -1
  685. package/index.d.ts +7 -3
  686. package/index.js +4 -2
  687. package/legacy/abstractions.js.map +1 -1
  688. package/package.json +21 -24
  689. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.d.ts +2 -2
  690. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js +1 -1
  691. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js.map +1 -1
  692. package/plugins/index.d.ts +0 -1
  693. package/plugins/index.js +0 -1
  694. package/types/index.d.ts +0 -1
  695. package/types/modelField.d.ts +11 -0
  696. package/types/types.d.ts +19 -291
  697. package/types/types.js.map +1 -1
  698. package/utils/converters/ConverterCollection.d.ts +2 -2
  699. package/utils/converters/ConverterCollection.js +1 -3
  700. package/utils/converters/ConverterCollection.js.map +1 -1
  701. package/utils/converters/valueKeyFromStorageConverter.d.ts +2 -2
  702. package/utils/converters/valueKeyFromStorageConverter.js +2 -2
  703. package/utils/converters/valueKeyFromStorageConverter.js.map +1 -1
  704. package/utils/converters/valueKeyStorageConverter.js +4 -2
  705. package/utils/converters/valueKeyStorageConverter.js.map +1 -1
  706. package/utils/converters/valueKeyToStorageConverter.d.ts +2 -2
  707. package/utils/converters/valueKeyToStorageConverter.js +2 -2
  708. package/utils/converters/valueKeyToStorageConverter.js.map +1 -1
  709. package/utils/createModelField.js +2 -1
  710. package/utils/createModelField.js.map +1 -1
  711. package/utils/createModelSchemaKey.d.ts +8 -0
  712. package/utils/createModelSchemaKey.js +18 -0
  713. package/utils/createModelSchemaKey.js.map +1 -0
  714. package/utils/getSchemaFromFieldPlugins.d.ts +2 -2
  715. package/utils/getSchemaFromFieldPlugins.js.map +1 -1
  716. package/utils/isHeadlessCmsReady.d.ts +1 -1
  717. package/utils/isHeadlessCmsReady.js +3 -2
  718. package/utils/isHeadlessCmsReady.js.map +1 -1
  719. package/abstractions/entryHooks/OnEntryBeforeCreate.d.ts +0 -8
  720. package/abstractions/entryHooks/OnEntryBeforeCreate.js +0 -5
  721. package/abstractions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  722. package/abstractions/entryHooks/index.d.ts +0 -1
  723. package/abstractions/entryHooks/index.js +0 -1
  724. package/abstractions/index.d.ts +0 -1
  725. package/abstractions/index.js +0 -1
  726. package/context.d.ts +0 -3
  727. package/context.js +0 -131
  728. package/context.js.map +0 -1
  729. package/crud/contentEntry.crud.d.ts +0 -6
  730. package/crud/contentEntry.crud.js +0 -307
  731. package/crud/contentEntry.crud.js.map +0 -1
  732. package/crud/contentModel.crud.d.ts +0 -5
  733. package/crud/contentModel.crud.js +0 -77
  734. package/crud/contentModel.crud.js.map +0 -1
  735. package/crud/contentModelGroup.crud.d.ts +0 -5
  736. package/crud/contentModelGroup.crud.js +0 -74
  737. package/crud/contentModelGroup.crud.js.map +0 -1
  738. package/extension.d.ts +0 -3
  739. package/extension.js +0 -19
  740. package/extension.js.map +0 -1
  741. package/extensions/entryHooks/OnEntryBeforeCreate.d.ts +0 -4
  742. package/extensions/entryHooks/OnEntryBeforeCreate.js +0 -21
  743. package/extensions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  744. package/extensions/entryHooks/index.d.ts +0 -1
  745. package/extensions/entryHooks/index.js +0 -1
  746. package/extensions/index.d.ts +0 -5
  747. package/extensions/index.js +0 -7
  748. package/extensions/index.js.map +0 -1
  749. package/features/contentEntry/UpdateRevision/UpdateRevisionRepository.d.ts +0 -14
  750. package/features/contentEntry/UpdateRevision/UpdateRevisionRepository.js +0 -34
  751. package/features/contentEntry/UpdateRevision/UpdateRevisionRepository.js.map +0 -1
  752. package/features/contentEntry/UpdateRevision/abstractions.d.ts +0 -10
  753. package/features/contentEntry/UpdateRevision/abstractions.js +0 -5
  754. package/features/contentEntry/UpdateRevision/abstractions.js.map +0 -1
  755. package/features/contentEntry/UpdateRevision/feature.js +0 -11
  756. package/features/contentEntry/UpdateRevision/feature.js.map +0 -1
  757. package/features/contentEntry/UpdateRevision/index.d.ts +0 -1
  758. package/features/contentEntry/UpdateRevision/index.js +0 -1
  759. package/graphql/graphQLHandlerFactory.d.ts +0 -5
  760. package/graphql/graphQLHandlerFactory.js +0 -22
  761. package/graphql/graphQLHandlerFactory.js.map +0 -1
  762. package/graphql/handleRequest.d.ts +0 -11
  763. package/graphql/handleRequest.js +0 -62
  764. package/graphql/handleRequest.js.map +0 -1
  765. package/graphql/index.d.ts +0 -4
  766. package/graphql/index.js +0 -11
  767. package/graphql/index.js.map +0 -1
  768. package/graphql/schema/cms/index.d.ts +0 -2
  769. package/graphql/schema/cms/index.js +0 -25
  770. package/graphql/schema/cms/index.js.map +0 -1
  771. package/parameters/context.d.ts +0 -2
  772. package/parameters/context.js +0 -7
  773. package/parameters/context.js.map +0 -1
  774. package/parameters/header.d.ts +0 -2
  775. package/parameters/header.js +0 -13
  776. package/parameters/header.js.map +0 -1
  777. package/parameters/index.d.ts +0 -3
  778. package/parameters/index.js +0 -3
  779. package/parameters/path.d.ts +0 -2
  780. package/parameters/path.js +0 -12
  781. package/parameters/path.js.map +0 -1
  782. package/plugins/CmsParametersPlugin.d.ts +0 -18
  783. package/plugins/CmsParametersPlugin.js +0 -16
  784. package/plugins/CmsParametersPlugin.js.map +0 -1
  785. package/types/context.d.ts +0 -110
  786. package/types/context.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/feature.js","sources":["../../../src/features/modelBuilder/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { FieldBuilderRegistry } from \"./fields/FieldBuilderRegistry.js\";\nimport { TextFieldType } from \"./fields/TextFieldType.js\";\nimport { LongTextFieldType } from \"./fields/LongTextFieldType.js\";\nimport { RichTextFieldType } from \"./fields/RichTextFieldType.js\";\nimport { ObjectFieldType } from \"./fields/ObjectFieldType.js\";\nimport { RefFieldType } from \"./fields/RefFieldType.js\";\nimport { DynamicZoneFieldType } from \"./fields/DynamicZoneFieldType.js\";\nimport { NumberFieldType } from \"./fields/NumberFieldType.js\";\nimport { BooleanFieldType } from \"./fields/BooleanFieldType.js\";\nimport { FileFieldType } from \"./fields/FileFieldType.js\";\nimport { AssetFieldType } from \"./fields/AssetFieldType.js\";\nimport { DateTimeFieldType } from \"./fields/DateTimeFieldType.js\";\nimport { JsonFieldType } from \"./fields/JsonFieldType.js\";\nimport { SearchableJsonFieldType } from \"./fields/SearchableJsonFieldType.js\";\n// import { LocationFieldType } from \"./fields/LocationFieldType.js\";\nimport { FieldBuilderRegistry as FieldsRegistryAbstraction, ModelFactory } from \"./abstractions.js\";\nimport { AccessControl } from \"~/features/shared/abstractions.js\";\nimport { ModelsProvider as ModelsProviderAbstraction } from \"./models/abstractions.js\";\nimport { ModelsProvider } from \"./models/ModelsProvider.js\";\nimport { UiSeparatorFieldType } from \"./fields/UiSeparatorFieldType.js\";\nimport { UiAlertFieldType } from \"./fields/UiAlertFieldType.js\";\nimport { UiTabsFieldType } from \"./fields/UiTabsFieldType.js\";\n\nexport const ModelBuilderFeature = createFeature({\n name: \"ModelBuilder\",\n register(container) {\n // Register core field types\n container.register(TextFieldType);\n container.register(LongTextFieldType);\n container.register(RichTextFieldType);\n container.register(ObjectFieldType);\n container.register(RefFieldType);\n container.register(DynamicZoneFieldType);\n container.register(NumberFieldType);\n container.register(BooleanFieldType);\n container.register(FileFieldType);\n container.register(AssetFieldType);\n container.register(DateTimeFieldType);\n container.register(JsonFieldType);\n container.register(SearchableJsonFieldType);\n container.register(UiSeparatorFieldType);\n container.register(UiAlertFieldType);\n container.register(UiTabsFieldType);\n // container.register(LocationFieldType);\n\n // Register field builder registry (will automatically get all FieldType implementations)\n container.register(FieldBuilderRegistry).inSingletonScope();\n\n // Register unified models provider\n container.registerFactory(ModelsProviderAbstraction, () => {\n let accessControl: AccessControl.Interface | undefined = undefined;\n try {\n // TODO: add `container.resolveOptional`\n accessControl = container.resolve(AccessControl);\n } catch {\n // It's an optional dependency!\n }\n\n return new ModelsProvider(\n // TODO: introduce a `lazy: true` dependency modifier, which will inject a getter.\n () => container.resolveAll(ModelFactory),\n container.resolve(FieldsRegistryAbstraction),\n accessControl\n );\n });\n }\n});\n"],"names":["ModelBuilderFeature","createFeature","container","TextFieldType","LongTextFieldType","RichTextFieldType","ObjectFieldType","RefFieldType","DynamicZoneFieldType","NumberFieldType","BooleanFieldType","FileFieldType","AssetFieldType","DateTimeFieldType","JsonFieldType","SearchableJsonFieldType","UiSeparatorFieldType","UiAlertFieldType","UiTabsFieldType","FieldBuilderRegistry","ModelsProviderAbstraction","accessControl","AccessControl","ModelsProvider","ModelFactory","FieldsRegistryAbstraction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBO,MAAMA,sBAAsBC,cAAc;IAC7C,MAAM;IACN,UAASC,SAAS;QAEdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;QACnBJ,UAAU,QAAQ,CAACK;QACnBL,UAAU,QAAQ,CAACM;QACnBN,UAAU,QAAQ,CAACO;QACnBP,UAAU,QAAQ,CAACQ;QACnBR,UAAU,QAAQ,CAACS;QACnBT,UAAU,QAAQ,CAACU;QACnBV,UAAU,QAAQ,CAACW;QACnBX,UAAU,QAAQ,CAACY;QACnBZ,UAAU,QAAQ,CAACa;QACnBb,UAAU,QAAQ,CAACc;QACnBd,UAAU,QAAQ,CAACe;QACnBf,UAAU,QAAQ,CAACgB;QAInBhB,UAAU,QAAQ,CAACiB,sBAAsB,gBAAgB;QAGzDjB,UAAU,eAAe,CAACkB,gBAA2B;YACjD,IAAIC;YACJ,IAAI;gBAEAA,gBAAgBnB,UAAU,OAAO,CAACoB;YACtC,EAAE,OAAM,CAER;YAEA,OAAO,IAAIC,iCAEP,IAAMrB,UAAU,UAAU,CAACsB,eAC3BtB,UAAU,OAAO,CAACuB,gDAClBJ;QAER;IACJ;AACJ"}
1
+ {"version":3,"file":"features/modelBuilder/feature.js","sources":["../../../src/features/modelBuilder/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { FieldBuilderRegistry } from \"./fields/FieldBuilderRegistry.js\";\nimport { TextFieldType } from \"./fields/TextFieldType.js\";\nimport { LongTextFieldType } from \"./fields/LongTextFieldType.js\";\nimport { RichTextFieldType } from \"./fields/RichTextFieldType.js\";\nimport { ObjectFieldType } from \"./fields/ObjectFieldType.js\";\nimport { RefFieldType } from \"./fields/RefFieldType.js\";\nimport { DynamicZoneFieldType } from \"./fields/DynamicZoneFieldType.js\";\nimport { NumberFieldType } from \"./fields/NumberFieldType.js\";\nimport { BooleanFieldType } from \"./fields/BooleanFieldType.js\";\nimport { FileFieldType } from \"./fields/FileFieldType.js\";\nimport { AssetFieldType } from \"./fields/AssetFieldType.js\";\nimport { DateTimeFieldType } from \"./fields/DateTimeFieldType.js\";\nimport { JsonFieldType } from \"./fields/JsonFieldType.js\";\nimport { SearchableJsonFieldType } from \"./fields/SearchableJsonFieldType.js\";\n// import { LocationFieldType } from \"./fields/LocationFieldType.js\";\nimport { FieldBuilderRegistry as FieldsRegistryAbstraction, ModelFactory } from \"./abstractions.js\";\nimport { ModelsProvider as ModelsProviderAbstraction } from \"./models/abstractions.js\";\nimport { ModelsProvider } from \"./models/ModelsProvider.js\";\nimport { UiSeparatorFieldType } from \"./fields/UiSeparatorFieldType.js\";\nimport { UiAlertFieldType } from \"./fields/UiAlertFieldType.js\";\nimport { UiTabsFieldType } from \"./fields/UiTabsFieldType.js\";\n\nexport const ModelBuilderFeature = createFeature({\n name: \"ModelBuilder\",\n register(container) {\n // Register core field types\n container.register(TextFieldType);\n container.register(LongTextFieldType);\n container.register(RichTextFieldType);\n container.register(ObjectFieldType);\n container.register(RefFieldType);\n container.register(DynamicZoneFieldType);\n container.register(NumberFieldType);\n container.register(BooleanFieldType);\n container.register(FileFieldType);\n container.register(AssetFieldType);\n container.register(DateTimeFieldType);\n container.register(JsonFieldType);\n container.register(SearchableJsonFieldType);\n container.register(UiSeparatorFieldType);\n container.register(UiAlertFieldType);\n container.register(UiTabsFieldType);\n // container.register(LocationFieldType);\n\n // Register field builder registry (will automatically get all FieldType implementations)\n container.register(FieldBuilderRegistry).inSingletonScope();\n\n // Register unified models provider\n container.registerFactory(ModelsProviderAbstraction, () => {\n return new ModelsProvider(\n // TODO: introduce a `lazy: true` dependency modifier, which will inject a getter.\n () => container.resolveAll(ModelFactory),\n container.resolve(FieldsRegistryAbstraction)\n );\n });\n }\n});\n"],"names":["ModelBuilderFeature","createFeature","container","TextFieldType","LongTextFieldType","RichTextFieldType","ObjectFieldType","RefFieldType","DynamicZoneFieldType","NumberFieldType","BooleanFieldType","FileFieldType","AssetFieldType","DateTimeFieldType","JsonFieldType","SearchableJsonFieldType","UiSeparatorFieldType","UiAlertFieldType","UiTabsFieldType","FieldBuilderRegistry","ModelsProviderAbstraction","ModelsProvider","ModelFactory","FieldsRegistryAbstraction"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBO,MAAMA,sBAAsBC,cAAc;IAC7C,MAAM;IACN,UAASC,SAAS;QAEdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;QACnBJ,UAAU,QAAQ,CAACK;QACnBL,UAAU,QAAQ,CAACM;QACnBN,UAAU,QAAQ,CAACO;QACnBP,UAAU,QAAQ,CAACQ;QACnBR,UAAU,QAAQ,CAACS;QACnBT,UAAU,QAAQ,CAACU;QACnBV,UAAU,QAAQ,CAACW;QACnBX,UAAU,QAAQ,CAACY;QACnBZ,UAAU,QAAQ,CAACa;QACnBb,UAAU,QAAQ,CAACc;QACnBd,UAAU,QAAQ,CAACe;QACnBf,UAAU,QAAQ,CAACgB;QAInBhB,UAAU,QAAQ,CAACiB,sBAAsB,gBAAgB;QAGzDjB,UAAU,eAAe,CAACkB,gBAA2B,IAC1C,IAAIC,iCAEP,IAAMnB,UAAU,UAAU,CAACoB,eAC3BpB,UAAU,OAAO,CAACqB;IAG9B;AACJ"}
@@ -22,6 +22,15 @@ export interface IFieldRendererRegistry {
22
22
  fieldType: "datetime";
23
23
  settings: undefined;
24
24
  };
25
+ /**
26
+ * Picks a day, then a month, then a year. For date-only fields (`dateOnly()`); single-value
27
+ * only, not for `.list()`. It offers only the dates the field's `dateGte`/`dateLte` limits
28
+ * allow; without limits, years run from this year back 120 years.
29
+ */
30
+ birthdayInput: {
31
+ fieldType: "datetime";
32
+ settings: undefined;
33
+ };
25
34
  dateTimeInputs: {
26
35
  fieldType: "datetime";
27
36
  settings?: {
@@ -227,6 +236,14 @@ export declare class DataFieldBuilder<TType extends string = string> extends Bas
227
236
  storageId(id: string): this;
228
237
  defaultValue(value: any): this;
229
238
  list(): this;
239
+ /**
240
+ * Renders the field in the admin app, but doesn't let anyone edit its value.
241
+ * Handy for values your own code owns, like an external ID or a generated slug.
242
+ *
243
+ * Only the admin app honours this. The API doesn't check it, so the field can
244
+ * still be written to over GraphQL.
245
+ */
246
+ disabled(value?: boolean): this;
230
247
  tags(tags: string[]): this;
231
248
  /**
232
249
  * List validators - these methods are available after calling list()
@@ -6,6 +6,7 @@ const rendererNameMap = {
6
6
  checkboxes: "checkboxes",
7
7
  dateTimeInput: "date-time-input",
8
8
  dateTimeInputs: "date-time-inputs",
9
+ birthdayInput: "birthday-input",
9
10
  dynamicZone: "dynamicZone",
10
11
  hidden: "hidden",
11
12
  lexicalEditor: "lexical-text-input",
@@ -80,6 +81,10 @@ class DataFieldBuilder extends BaseFieldBuilder {
80
81
  this.config.list = true;
81
82
  return this;
82
83
  }
84
+ disabled(value = true) {
85
+ this.config.disabled = value;
86
+ return this;
87
+ }
83
88
  tags(tags) {
84
89
  this.config.tags = tags;
85
90
  return this;
@@ -150,6 +155,7 @@ class DataFieldBuilder extends BaseFieldBuilder {
150
155
  validation: this.config.validation || [],
151
156
  listValidation: this.config.listValidation || [],
152
157
  list: this.config.list || false,
158
+ disabled: this.config.disabled || false,
153
159
  predefinedValues: this.config.predefinedValues || {
154
160
  enabled: false,
155
161
  values: []
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/fields/DataFieldBuilder.js","sources":["../../../../src/features/modelBuilder/fields/DataFieldBuilder.ts"],"sourcesContent":["import camelCase from \"lodash/camelCase.js\";\nimport type {\n CmsModelField,\n CmsModelFieldPredefinedValues,\n CmsModelFieldValidation\n} from \"~/types/index.js\";\nimport { getBaseFieldType } from \"~/utils/getBaseFieldType.js\";\nimport { BaseFieldBuilder, type DataFieldBuildResult } from \"./BaseFieldBuilder.js\";\n\nexport interface FieldBuilderConfig extends Omit<\n CmsModelField,\n \"id\" | \"fieldId\" | \"storageId\" | \"type\"\n> {\n _storageId?: string;\n _fieldId?: string;\n description?: string | null;\n note?: string | null;\n}\n\n/**\n * Augmentable renderer registry. Each entry maps a renderer name to its applicable field type(s) and settings.\n */\nexport interface IFieldRendererRegistry {\n switch: {\n fieldType: \"boolean\";\n settings: undefined;\n };\n checkboxes: {\n fieldType: \"text\" | \"number\";\n settings: undefined;\n };\n dateTimeInput: {\n fieldType: \"datetime\";\n settings: undefined;\n };\n dateTimeInputs: {\n fieldType: \"datetime\";\n settings?: {\n addItemLabel?: string;\n };\n };\n dynamicZone: {\n fieldType: \"dynamicZone\";\n settings?: {\n /** Whether the accordion is expanded by default. */\n open?: boolean;\n /** Wrap the zone in a container panel. Set to `false` for a flat inline layout. */\n container?: boolean;\n /** Label for the \"add item\" button (defaults to \"Add Item\"). */\n addItemLabel?: string;\n };\n };\n hidden: {\n fieldType: string;\n settings: undefined;\n };\n lexicalEditor: {\n fieldType: \"rich-text\";\n settings: undefined;\n };\n lexicalEditors: {\n fieldType: \"rich-text\";\n settings?: {\n addItemLabel?: string;\n };\n };\n textarea: {\n fieldType: \"long-text\";\n settings: undefined;\n };\n textareas: {\n fieldType: \"long-text\";\n settings: {\n addItemLabel?: string;\n };\n };\n numberInput: {\n fieldType: \"number\";\n settings: undefined;\n };\n numberInputs: {\n fieldType: \"number\";\n settings?: {\n addItemLabel?: string;\n };\n };\n objectAccordionSingle: {\n fieldType: \"object\";\n settings?: {\n /** Whether the accordion is expanded by default. */\n open?: boolean;\n /** Wrap the object in a container panel. Set to `false` for a flat inline layout. */\n container?: boolean;\n /** Field ID whose value is used as the accordion title, or a function receiving the object data. */\n itemTitle?: string;\n /** Field ID whose value is used as the accordion description, or a function receiving the object data. */\n itemDescription?: string;\n };\n };\n objectAccordionMultiple: {\n fieldType: \"object\";\n settings?: {\n /** Whether each accordion item is expanded by default. */\n open?: boolean;\n /** Wrap the list in a container panel. Set to `false` for a flat inline layout. */\n container?: boolean;\n /** Field ID whose value is used as each item's accordion title. */\n itemTitle?: string;\n /** Field ID whose value is used as each item's accordion description. */\n itemDescription?: string;\n /** Label for the \"add item\" button (defaults to \"Add {fieldLabel}\"). */\n addItemLabel?: string;\n };\n };\n passthrough: {\n fieldType: string;\n settings: undefined;\n };\n radioButtons: {\n fieldType: \"text\" | \"number\";\n settings: undefined;\n };\n refDialogSingle: {\n fieldType: \"ref\";\n settings: undefined;\n };\n refDialogMultiple: {\n fieldType: \"ref\";\n settings?: {\n /** Where newly picked references are inserted: `\"first\"` (top) or `\"last\"` (bottom, default). */\n newItemPosition?: \"first\" | \"last\";\n };\n };\n refAutocompleteSingle: {\n fieldType: \"ref\";\n settings: undefined;\n };\n refAutocompleteMultiple: {\n fieldType: \"ref\";\n settings: undefined;\n };\n refCheckboxes: {\n fieldType: \"ref\";\n settings: undefined;\n };\n refRadioButtons: {\n fieldType: \"ref\";\n settings: undefined;\n };\n select: {\n fieldType: \"text\" | \"number\";\n settings: undefined;\n };\n /** @deprecated Use \"select\" instead. */\n dropdown: {\n fieldType: \"text\" | \"number\";\n settings: undefined;\n };\n tags: {\n fieldType: \"text\";\n settings: undefined;\n };\n textInput: {\n fieldType: \"text\";\n settings: undefined;\n };\n textInputs: {\n fieldType: \"text\";\n settings?: {\n addItemLabel?: string;\n };\n };\n /** @deprecated Use `assetField` instead. */\n file: {\n fieldType: \"file\";\n settings?: {\n /** Only allow image files to be selected. */\n imagesOnly?: boolean;\n };\n };\n /** @deprecated Use `assetFields` instead. */\n files: {\n fieldType: \"file\";\n settings?: {\n /** Only allow image files to be selected. */\n imagesOnly?: boolean;\n };\n };\n assetField: {\n fieldType: \"asset\";\n settings?: {\n /** Only allow image files to be selected. */\n imagesOnly?: boolean;\n /** MIME types or extensions to allow (e.g. `[\"image/png\", \"application/pdf\"]`). Leave empty to allow all. */\n accept?: string[];\n };\n };\n assetFields: {\n fieldType: \"asset\";\n settings?: {\n /** Only allow image files to be selected. */\n imagesOnly?: boolean;\n /** MIME types or extensions to allow (e.g. `[\"image/png\", \"application/pdf\"]`). Leave empty to allow all. */\n accept?: string[];\n };\n };\n uiSeparator: {\n fieldType: \"ui\";\n settings: undefined;\n };\n uiAlert: {\n fieldType: \"ui\";\n settings: {\n type: \"info\" | \"success\" | \"warning\" | \"danger\";\n };\n };\n uiTabs: {\n fieldType: \"ui\";\n settings: undefined;\n };\n}\n\n/**\n * Maps camelCase renderer names (used in the builder API) to the\n * kebab-case names expected by the frontend renderer registry.\n */\nconst rendererNameMap: Record<keyof IFieldRendererRegistry, string> = {\n switch: \"boolean-input\",\n checkboxes: \"checkboxes\",\n dateTimeInput: \"date-time-input\",\n dateTimeInputs: \"date-time-inputs\",\n dynamicZone: \"dynamicZone\",\n hidden: \"hidden\",\n lexicalEditor: \"lexical-text-input\",\n lexicalEditors: \"lexical-text-inputs\",\n textarea: \"long-text-text-area\",\n textareas: \"long-text-inputs\",\n numberInput: \"number-input\",\n numberInputs: \"number-inputs\",\n objectAccordionSingle: \"object-accordion\",\n objectAccordionMultiple: \"objects-accordion\",\n passthrough: \"passthrough\",\n radioButtons: \"radio-buttons\",\n refDialogSingle: \"ref-advanced-single\",\n refDialogMultiple: \"ref-advanced-multiple\",\n refAutocompleteSingle: \"ref-input\",\n refAutocompleteMultiple: \"ref-inputs\",\n refCheckboxes: \"ref-simple-multiple\",\n refRadioButtons: \"ref-simple-single\",\n select: \"select-box\",\n dropdown: \"select-box\",\n tags: \"tags\",\n textInput: \"text-input\",\n textInputs: \"text-inputs\",\n file: \"file-input\",\n files: \"file-inputs\",\n assetField: \"asset-input\",\n assetFields: \"asset-inputs\",\n uiSeparator: \"uiSeparator\",\n uiAlert: \"uiAlert\",\n uiTabs: \"uiTabs\"\n};\n\n/**\n * Resolves a camelCase renderer name to the kebab-case name used by the frontend.\n */\nfunction resolveRendererName(name: string): string {\n return rendererNameMap[name as keyof IFieldRendererRegistry] ?? name;\n}\n\n/**\n * Extracts renderer names valid for the given field type.\n * When TType is a broad `string`, all renderer names are returned.\n */\nexport type FieldRendererName<TType extends string = string> = string extends TType\n ? keyof IFieldRendererRegistry & string\n : {\n [K in keyof IFieldRendererRegistry]: TType extends IFieldRendererRegistry[K][\"fieldType\"]\n ? K\n : never;\n }[keyof IFieldRendererRegistry] &\n string;\n\nexport type FieldRendererSettings<TName extends string> = TName extends keyof IFieldRendererRegistry\n ? IFieldRendererRegistry[TName][\"settings\"]\n : Record<string, any> | undefined;\n\n/**\n * DataFieldBuilder class for data fields that produce CmsModelField instances.\n * Provides storageId, list, validation, renderer, and other data-field methods.\n */\nexport class DataFieldBuilder<TType extends string = string> extends BaseFieldBuilder<TType> {\n protected override config: FieldBuilderConfig;\n\n public constructor(type: TType, label?: string) {\n super(type, label);\n this.config = {\n label: label || \"\",\n validation: [],\n listValidation: [],\n list: false,\n predefinedValues: {\n enabled: false,\n values: []\n },\n help: null,\n placeholder: null,\n description: null,\n note: null,\n renderer: null,\n settings: {},\n tags: []\n };\n }\n\n placeholder(text: string): this {\n this.config.placeholder = text;\n return this;\n }\n\n storageId(id: string): this {\n // We do not allow developers to specify the field type!\n this.config._storageId = id.split(\"@\").pop();\n return this;\n }\n\n defaultValue(value: any): this {\n this.config.settings = { ...this.config.settings, defaultValue: value };\n return this;\n }\n\n list(): this {\n this.config.list = true;\n return this as this;\n }\n\n tags(tags: string[]): this {\n this.config.tags = tags;\n return this;\n }\n\n /**\n * List validators - these methods are available after calling list()\n */\n listMinLength(value: number, message?: string): this {\n return this.listValidation({\n name: \"minLength\",\n message: message || `At least ${value} item(s) required.`,\n settings: { value }\n });\n }\n\n listMaxLength(value: number, message?: string): this {\n return this.listValidation({\n name: \"maxLength\",\n message: message || `At most ${value} item(s) allowed.`,\n settings: { value }\n });\n }\n\n /**\n * Add a validation rule to this field.\n * This method is protected and should only be used by field-specific validator methods.\n * @internal\n */\n protected validation(validation: CmsModelFieldValidation): this {\n this.config.validation = this.config.validation || [];\n this.config.validation.push(validation);\n return this;\n }\n\n /**\n * Add a list validation rule to this field (for list fields).\n * This method is protected and should only be used by field-specific validator methods.\n * @internal\n */\n protected listValidation(validation: CmsModelFieldValidation): this {\n this.config.listValidation = this.config.listValidation || [];\n this.config.listValidation.push(validation);\n return this;\n }\n\n predefinedValues(values: CmsModelFieldPredefinedValues[\"values\"]): this {\n this.config.predefinedValues = {\n enabled: true,\n values\n };\n return this;\n }\n\n renderer<TName extends FieldRendererName<TType>>(\n name: TName,\n ...args: undefined extends FieldRendererSettings<TName>\n ? [settings?: FieldRendererSettings<TName>]\n : FieldRendererSettings<TName> extends undefined\n ? []\n : [settings: FieldRendererSettings<TName>]\n ): this {\n this.config.renderer = {\n name: resolveRendererName(name),\n settings: args[0] ?? null\n };\n return this;\n }\n\n settings(settings: Record<string, any>): this {\n this.config.settings = { ...this.config.settings, ...settings };\n return this;\n }\n\n /**\n * Build the final CmsModelField\n * @internal\n */\n build(): DataFieldBuildResult {\n const fieldId = this.config._fieldId || camelCase(this.config.label);\n const baseType = getBaseFieldType({\n type: this.type\n });\n const storageId = `${baseType}@${this.config._storageId ?? fieldId}`;\n\n return {\n type: \"data\",\n field: {\n id: fieldId,\n fieldId,\n storageId,\n type: this.getFieldType(),\n label: this.config.label,\n validation: this.config.validation || [],\n listValidation: this.config.listValidation || [],\n list: this.config.list || false,\n predefinedValues: this.config.predefinedValues || {\n enabled: false,\n values: []\n },\n help: this.config.help || null,\n placeholder: this.config.placeholder || null,\n description: this.config.description || null,\n note: this.config.note || null,\n renderer: this.config.renderer || null,\n settings: this.config.settings || {},\n tags: this.config.tags || [],\n rules: this.config.rules\n }\n };\n }\n\n private getFieldType(): string {\n if (!this.subType?.length) {\n return this.type;\n }\n return `${this.type}:${this.subType}`;\n }\n}\n"],"names":["rendererNameMap","resolveRendererName","name","DataFieldBuilder","BaseFieldBuilder","type","label","text","id","value","tags","message","validation","values","args","settings","fieldId","camelCase","baseType","getBaseFieldType","storageId"],"mappings":"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"}
1
+ {"version":3,"file":"features/modelBuilder/fields/DataFieldBuilder.js","sources":["../../../../src/features/modelBuilder/fields/DataFieldBuilder.ts"],"sourcesContent":["import camelCase from \"lodash/camelCase.js\";\nimport type {\n CmsModelField,\n CmsModelFieldPredefinedValues,\n CmsModelFieldValidation\n} from \"~/types/index.js\";\nimport { getBaseFieldType } from \"~/utils/getBaseFieldType.js\";\nimport { BaseFieldBuilder, type DataFieldBuildResult } from \"./BaseFieldBuilder.js\";\n\nexport interface FieldBuilderConfig extends Omit<\n CmsModelField,\n \"id\" | \"fieldId\" | \"storageId\" | \"type\"\n> {\n _storageId?: string;\n _fieldId?: string;\n description?: string | null;\n note?: string | null;\n}\n\n/**\n * Augmentable renderer registry. Each entry maps a renderer name to its applicable field type(s) and settings.\n */\nexport interface IFieldRendererRegistry {\n switch: {\n fieldType: \"boolean\";\n settings: undefined;\n };\n checkboxes: {\n fieldType: \"text\" | \"number\";\n settings: undefined;\n };\n dateTimeInput: {\n fieldType: \"datetime\";\n settings: undefined;\n };\n /**\n * Picks a day, then a month, then a year. For date-only fields (`dateOnly()`); single-value\n * only, not for `.list()`. It offers only the dates the field's `dateGte`/`dateLte` limits\n * allow; without limits, years run from this year back 120 years.\n */\n birthdayInput: {\n fieldType: \"datetime\";\n settings: undefined;\n };\n dateTimeInputs: {\n fieldType: \"datetime\";\n settings?: {\n addItemLabel?: string;\n };\n };\n dynamicZone: {\n fieldType: \"dynamicZone\";\n settings?: {\n /** Whether the accordion is expanded by default. */\n open?: boolean;\n /** Wrap the zone in a container panel. Set to `false` for a flat inline layout. */\n container?: boolean;\n /** Label for the \"add item\" button (defaults to \"Add Item\"). */\n addItemLabel?: string;\n };\n };\n hidden: {\n fieldType: string;\n settings: undefined;\n };\n lexicalEditor: {\n fieldType: \"rich-text\";\n settings: undefined;\n };\n lexicalEditors: {\n fieldType: \"rich-text\";\n settings?: {\n addItemLabel?: string;\n };\n };\n textarea: {\n fieldType: \"long-text\";\n settings: undefined;\n };\n textareas: {\n fieldType: \"long-text\";\n settings: {\n addItemLabel?: string;\n };\n };\n numberInput: {\n fieldType: \"number\";\n settings: undefined;\n };\n numberInputs: {\n fieldType: \"number\";\n settings?: {\n addItemLabel?: string;\n };\n };\n objectAccordionSingle: {\n fieldType: \"object\";\n settings?: {\n /** Whether the accordion is expanded by default. */\n open?: boolean;\n /** Wrap the object in a container panel. Set to `false` for a flat inline layout. */\n container?: boolean;\n /** Field ID whose value is used as the accordion title, or a function receiving the object data. */\n itemTitle?: string;\n /** Field ID whose value is used as the accordion description, or a function receiving the object data. */\n itemDescription?: string;\n };\n };\n objectAccordionMultiple: {\n fieldType: \"object\";\n settings?: {\n /** Whether each accordion item is expanded by default. */\n open?: boolean;\n /** Wrap the list in a container panel. Set to `false` for a flat inline layout. */\n container?: boolean;\n /** Field ID whose value is used as each item's accordion title. */\n itemTitle?: string;\n /** Field ID whose value is used as each item's accordion description. */\n itemDescription?: string;\n /** Label for the \"add item\" button (defaults to \"Add {fieldLabel}\"). */\n addItemLabel?: string;\n };\n };\n passthrough: {\n fieldType: string;\n settings: undefined;\n };\n radioButtons: {\n fieldType: \"text\" | \"number\";\n settings: undefined;\n };\n refDialogSingle: {\n fieldType: \"ref\";\n settings: undefined;\n };\n refDialogMultiple: {\n fieldType: \"ref\";\n settings?: {\n /** Where newly picked references are inserted: `\"first\"` (top) or `\"last\"` (bottom, default). */\n newItemPosition?: \"first\" | \"last\";\n };\n };\n refAutocompleteSingle: {\n fieldType: \"ref\";\n settings: undefined;\n };\n refAutocompleteMultiple: {\n fieldType: \"ref\";\n settings: undefined;\n };\n refCheckboxes: {\n fieldType: \"ref\";\n settings: undefined;\n };\n refRadioButtons: {\n fieldType: \"ref\";\n settings: undefined;\n };\n select: {\n fieldType: \"text\" | \"number\";\n settings: undefined;\n };\n /** @deprecated Use \"select\" instead. */\n dropdown: {\n fieldType: \"text\" | \"number\";\n settings: undefined;\n };\n tags: {\n fieldType: \"text\";\n settings: undefined;\n };\n textInput: {\n fieldType: \"text\";\n settings: undefined;\n };\n textInputs: {\n fieldType: \"text\";\n settings?: {\n addItemLabel?: string;\n };\n };\n /** @deprecated Use `assetField` instead. */\n file: {\n fieldType: \"file\";\n settings?: {\n /** Only allow image files to be selected. */\n imagesOnly?: boolean;\n };\n };\n /** @deprecated Use `assetFields` instead. */\n files: {\n fieldType: \"file\";\n settings?: {\n /** Only allow image files to be selected. */\n imagesOnly?: boolean;\n };\n };\n assetField: {\n fieldType: \"asset\";\n settings?: {\n /** Only allow image files to be selected. */\n imagesOnly?: boolean;\n /** MIME types or extensions to allow (e.g. `[\"image/png\", \"application/pdf\"]`). Leave empty to allow all. */\n accept?: string[];\n };\n };\n assetFields: {\n fieldType: \"asset\";\n settings?: {\n /** Only allow image files to be selected. */\n imagesOnly?: boolean;\n /** MIME types or extensions to allow (e.g. `[\"image/png\", \"application/pdf\"]`). Leave empty to allow all. */\n accept?: string[];\n };\n };\n uiSeparator: {\n fieldType: \"ui\";\n settings: undefined;\n };\n uiAlert: {\n fieldType: \"ui\";\n settings: {\n type: \"info\" | \"success\" | \"warning\" | \"danger\";\n };\n };\n uiTabs: {\n fieldType: \"ui\";\n settings: undefined;\n };\n}\n\n/**\n * Maps camelCase renderer names (used in the builder API) to the\n * kebab-case names expected by the frontend renderer registry.\n */\nconst rendererNameMap: Record<keyof IFieldRendererRegistry, string> = {\n switch: \"boolean-input\",\n checkboxes: \"checkboxes\",\n dateTimeInput: \"date-time-input\",\n dateTimeInputs: \"date-time-inputs\",\n birthdayInput: \"birthday-input\",\n dynamicZone: \"dynamicZone\",\n hidden: \"hidden\",\n lexicalEditor: \"lexical-text-input\",\n lexicalEditors: \"lexical-text-inputs\",\n textarea: \"long-text-text-area\",\n textareas: \"long-text-inputs\",\n numberInput: \"number-input\",\n numberInputs: \"number-inputs\",\n objectAccordionSingle: \"object-accordion\",\n objectAccordionMultiple: \"objects-accordion\",\n passthrough: \"passthrough\",\n radioButtons: \"radio-buttons\",\n refDialogSingle: \"ref-advanced-single\",\n refDialogMultiple: \"ref-advanced-multiple\",\n refAutocompleteSingle: \"ref-input\",\n refAutocompleteMultiple: \"ref-inputs\",\n refCheckboxes: \"ref-simple-multiple\",\n refRadioButtons: \"ref-simple-single\",\n select: \"select-box\",\n dropdown: \"select-box\",\n tags: \"tags\",\n textInput: \"text-input\",\n textInputs: \"text-inputs\",\n file: \"file-input\",\n files: \"file-inputs\",\n assetField: \"asset-input\",\n assetFields: \"asset-inputs\",\n uiSeparator: \"uiSeparator\",\n uiAlert: \"uiAlert\",\n uiTabs: \"uiTabs\"\n};\n\n/**\n * Resolves a camelCase renderer name to the kebab-case name used by the frontend.\n */\nfunction resolveRendererName(name: string): string {\n return rendererNameMap[name as keyof IFieldRendererRegistry] ?? name;\n}\n\n/**\n * Extracts renderer names valid for the given field type.\n * When TType is a broad `string`, all renderer names are returned.\n */\nexport type FieldRendererName<TType extends string = string> = string extends TType\n ? keyof IFieldRendererRegistry & string\n : {\n [K in keyof IFieldRendererRegistry]: TType extends IFieldRendererRegistry[K][\"fieldType\"]\n ? K\n : never;\n }[keyof IFieldRendererRegistry] &\n string;\n\nexport type FieldRendererSettings<TName extends string> = TName extends keyof IFieldRendererRegistry\n ? IFieldRendererRegistry[TName][\"settings\"]\n : Record<string, any> | undefined;\n\n/**\n * DataFieldBuilder class for data fields that produce CmsModelField instances.\n * Provides storageId, list, validation, renderer, and other data-field methods.\n */\nexport class DataFieldBuilder<TType extends string = string> extends BaseFieldBuilder<TType> {\n protected override config: FieldBuilderConfig;\n\n public constructor(type: TType, label?: string) {\n super(type, label);\n this.config = {\n label: label || \"\",\n validation: [],\n listValidation: [],\n list: false,\n predefinedValues: {\n enabled: false,\n values: []\n },\n help: null,\n placeholder: null,\n description: null,\n note: null,\n renderer: null,\n settings: {},\n tags: []\n };\n }\n\n placeholder(text: string): this {\n this.config.placeholder = text;\n return this;\n }\n\n storageId(id: string): this {\n // We do not allow developers to specify the field type!\n this.config._storageId = id.split(\"@\").pop();\n return this;\n }\n\n defaultValue(value: any): this {\n this.config.settings = { ...this.config.settings, defaultValue: value };\n return this;\n }\n\n list(): this {\n this.config.list = true;\n return this as this;\n }\n\n /**\n * Renders the field in the admin app, but doesn't let anyone edit its value.\n * Handy for values your own code owns, like an external ID or a generated slug.\n *\n * Only the admin app honours this. The API doesn't check it, so the field can\n * still be written to over GraphQL.\n */\n disabled(value = true): this {\n this.config.disabled = value;\n return this;\n }\n\n tags(tags: string[]): this {\n this.config.tags = tags;\n return this;\n }\n\n /**\n * List validators - these methods are available after calling list()\n */\n listMinLength(value: number, message?: string): this {\n return this.listValidation({\n name: \"minLength\",\n message: message || `At least ${value} item(s) required.`,\n settings: { value }\n });\n }\n\n listMaxLength(value: number, message?: string): this {\n return this.listValidation({\n name: \"maxLength\",\n message: message || `At most ${value} item(s) allowed.`,\n settings: { value }\n });\n }\n\n /**\n * Add a validation rule to this field.\n * This method is protected and should only be used by field-specific validator methods.\n * @internal\n */\n protected validation(validation: CmsModelFieldValidation): this {\n this.config.validation = this.config.validation || [];\n this.config.validation.push(validation);\n return this;\n }\n\n /**\n * Add a list validation rule to this field (for list fields).\n * This method is protected and should only be used by field-specific validator methods.\n * @internal\n */\n protected listValidation(validation: CmsModelFieldValidation): this {\n this.config.listValidation = this.config.listValidation || [];\n this.config.listValidation.push(validation);\n return this;\n }\n\n predefinedValues(values: CmsModelFieldPredefinedValues[\"values\"]): this {\n this.config.predefinedValues = {\n enabled: true,\n values\n };\n return this;\n }\n\n renderer<TName extends FieldRendererName<TType>>(\n name: TName,\n ...args: undefined extends FieldRendererSettings<TName>\n ? [settings?: FieldRendererSettings<TName>]\n : FieldRendererSettings<TName> extends undefined\n ? []\n : [settings: FieldRendererSettings<TName>]\n ): this {\n this.config.renderer = {\n name: resolveRendererName(name),\n settings: args[0] ?? null\n };\n return this;\n }\n\n settings(settings: Record<string, any>): this {\n this.config.settings = { ...this.config.settings, ...settings };\n return this;\n }\n\n /**\n * Build the final CmsModelField\n * @internal\n */\n build(): DataFieldBuildResult {\n const fieldId = this.config._fieldId || camelCase(this.config.label);\n const baseType = getBaseFieldType({\n type: this.type\n });\n const storageId = `${baseType}@${this.config._storageId ?? fieldId}`;\n\n return {\n type: \"data\",\n field: {\n id: fieldId,\n fieldId,\n storageId,\n type: this.getFieldType(),\n label: this.config.label,\n validation: this.config.validation || [],\n listValidation: this.config.listValidation || [],\n list: this.config.list || false,\n disabled: this.config.disabled || false,\n predefinedValues: this.config.predefinedValues || {\n enabled: false,\n values: []\n },\n help: this.config.help || null,\n placeholder: this.config.placeholder || null,\n description: this.config.description || null,\n note: this.config.note || null,\n renderer: this.config.renderer || null,\n settings: this.config.settings || {},\n tags: this.config.tags || [],\n rules: this.config.rules\n }\n };\n }\n\n private getFieldType(): string {\n if (!this.subType?.length) {\n return this.type;\n }\n return `${this.type}:${this.subType}`;\n }\n}\n"],"names":["rendererNameMap","resolveRendererName","name","DataFieldBuilder","BaseFieldBuilder","type","label","text","id","value","tags","message","validation","values","args","settings","fieldId","camelCase","baseType","getBaseFieldType","storageId"],"mappings":"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"}
@@ -1,8 +1,12 @@
1
+ import error from "@webiny/error";
2
+ import { isDateExpression } from "@webiny/utils";
3
+ import { validateDateExpressions } from "../../../domain/contentModel/validation/dateExpressions.js";
1
4
  import { FieldType } from "./abstractions.js";
2
5
  import { DataFieldBuilder } from "./FieldBuilder.js";
3
6
  class DateTimeFieldBuilder extends DataFieldBuilder {
4
7
  constructor(){
5
8
  super("datetime");
9
+ this.withTimezone();
6
10
  }
7
11
  required(message) {
8
12
  return this.validation({
@@ -29,26 +33,37 @@ class DateTimeFieldBuilder extends DataFieldBuilder {
29
33
  return this.dateTimeType("dateTimeWithoutTimezone");
30
34
  }
31
35
  dateGte(value, message) {
32
- const type = this.config.settings?.type || "date";
33
36
  return this.validation({
34
37
  name: "dateGte",
35
- message: message || "Date/time is earlier than the provided one.",
36
- settings: {
37
- value,
38
- type
39
- }
38
+ message: message || "Must be on or after {date}.",
39
+ settings: this.dateLimitSettings(value)
40
40
  });
41
41
  }
42
42
  dateLte(value, message) {
43
- const type = this.config.settings?.type || "date";
44
43
  return this.validation({
45
44
  name: "dateLte",
46
- message: message || "Date/time is later than the provided one.",
47
- settings: {
48
- value,
49
- type
50
- }
45
+ message: message || "Must be on or before {date}.",
46
+ settings: this.dateLimitSettings(value)
47
+ });
48
+ }
49
+ build() {
50
+ const result = super.build();
51
+ validateDateExpressions(result.field);
52
+ return result;
53
+ }
54
+ dateLimitSettings(value) {
55
+ const type = this.config.settings?.type || "date";
56
+ if ("string" == typeof value) return {
57
+ value,
58
+ type
59
+ };
60
+ if (!isDateExpression(value.expression)) throw new error(`Invalid date expression "${value.expression}". Use "today", or "today" plus or minus a number of days, months or years, like "today-18y".`, "INVALID_DATE_EXPRESSION", {
61
+ expression: value.expression
51
62
  });
63
+ return {
64
+ expression: value.expression,
65
+ type
66
+ };
52
67
  }
53
68
  }
54
69
  class DateTimeFieldTypeFactory {
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/fields/DateTimeFieldType.js","sources":["../../../../src/features/modelBuilder/fields/DateTimeFieldType.ts"],"sourcesContent":["import { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport { DataFieldBuilder } from \"./FieldBuilder.js\";\nimport { RequiredValidator, DateGteValidator, DateLteValidator } from \"./fieldTypeValidator.js\";\n\nexport type DateTimeType = \"date\" | \"time\" | \"dateTimeWithTimezone\" | \"dateTimeWithoutTimezone\";\n\nexport interface IDateTimeFieldBuilder\n extends DataFieldBuilder<\"datetime\">, RequiredValidator, DateGteValidator, DateLteValidator {\n dateTimeType(type: DateTimeType): this;\n dateOnly(): this;\n timeOnly(): this;\n withTimezone(): this;\n withoutTimezone(): this;\n}\n\nclass DateTimeFieldBuilder extends DataFieldBuilder<\"datetime\"> implements IDateTimeFieldBuilder {\n public constructor() {\n super(\"datetime\");\n }\n\n required(message?: string): this {\n return this.validation({\n name: \"required\",\n message: message || \"Value is required.\",\n settings: {}\n });\n }\n\n dateTimeType(type: DateTimeType): this {\n this.config.settings = this.config.settings || {};\n this.config.settings.type = type;\n return this;\n }\n\n /**\n * Just a calendar date, no time, no timezone. Useful for things like birthdays, holidays, or due dates where the time of day doesn't matter.\n * Example: 2026-04-30\n */\n dateOnly(): this {\n return this.dateTimeType(\"date\");\n }\n\n /**\n * Time in 24-hours format.\n * Example: 19:35\n */\n timeOnly(): this {\n return this.dateTimeType(\"time\");\n }\n\n /**\n * This is an ISO 8601 datetime with an explicit timezone offset.\n * Example: 2026-04-29T13:25:00+02:00\n */\n withTimezone(): this {\n return this.dateTimeType(\"dateTimeWithTimezone\");\n }\n\n /**\n * This is an ISO 8601 datetime in UTC (Zulu time). \"Z\" means \"this is UTC, no offset.\"\n * Example: 2026-04-30T13:25:00.000Z\n */\n withoutTimezone(): this {\n return this.dateTimeType(\"dateTimeWithoutTimezone\");\n }\n\n dateGte(value: string, message?: string): this {\n const type = this.config.settings?.type || \"date\";\n return this.validation({\n name: \"dateGte\",\n message: message || \"Date/time is earlier than the provided one.\",\n settings: { value, type }\n });\n }\n\n dateLte(value: string, message?: string): this {\n const type = this.config.settings?.type || \"date\";\n return this.validation({\n name: \"dateLte\",\n message: message || \"Date/time is later than the provided one.\",\n settings: { value, type }\n });\n }\n}\n\nclass DateTimeFieldTypeFactory implements IFieldTypeFactory {\n readonly type = \"datetime\";\n\n create(): IDateTimeFieldBuilder {\n return new DateTimeFieldBuilder();\n }\n}\n\nexport const DateTimeFieldType = FieldType.createImplementation({\n implementation: DateTimeFieldTypeFactory,\n dependencies: []\n});\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n datetime(): IDateTimeFieldBuilder;\n }\n}\n"],"names":["DateTimeFieldBuilder","DataFieldBuilder","message","type","value","DateTimeFieldTypeFactory","DateTimeFieldType","FieldType"],"mappings":";;AAeA,MAAMA,6BAA6BC;IAC/B,aAAqB;QACjB,KAAK,CAAC;IACV;IAEA,SAASC,OAAgB,EAAQ;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU,CAAC;QACf;IACJ;IAEA,aAAaC,IAAkB,EAAQ;QACnC,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAGA;QAC5B,OAAO,IAAI;IACf;IAMA,WAAiB;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B;IAMA,WAAiB;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B;IAMA,eAAqB;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B;IAMA,kBAAwB;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B;IAEA,QAAQC,KAAa,EAAEF,OAAgB,EAAQ;QAC3C,MAAMC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ;QAC3C,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASD,WAAW;YACpB,UAAU;gBAAEE;gBAAOD;YAAK;QAC5B;IACJ;IAEA,QAAQC,KAAa,EAAEF,OAAgB,EAAQ;QAC3C,MAAMC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ;QAC3C,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASD,WAAW;YACpB,UAAU;gBAAEE;gBAAOD;YAAK;QAC5B;IACJ;AACJ;AAEA,MAAME;IAGF,SAAgC;QAC5B,OAAO,IAAIL;IACf;;aAJS,IAAI,GAAG;;AAKpB;AAEO,MAAMM,oBAAoBC,UAAU,oBAAoB,CAAC;IAC5D,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/modelBuilder/fields/DateTimeFieldType.js","sources":["../../../../src/features/modelBuilder/fields/DateTimeFieldType.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { isDateExpression, type DateBound } from \"@webiny/utils\";\nimport { validateDateExpressions } from \"~/domain/contentModel/validation/dateExpressions.js\";\nimport { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport { DataFieldBuilder } from \"./FieldBuilder.js\";\nimport { RequiredValidator, DateGteValidator, DateLteValidator } from \"./fieldTypeValidator.js\";\n\nexport type DateTimeType = \"date\" | \"time\" | \"dateTimeWithTimezone\" | \"dateTimeWithoutTimezone\";\n\nexport interface IDateTimeFieldBuilder\n extends DataFieldBuilder<\"datetime\">, RequiredValidator, DateGteValidator, DateLteValidator {\n dateTimeType(type: DateTimeType): this;\n dateOnly(): this;\n timeOnly(): this;\n withTimezone(): this;\n withoutTimezone(): this;\n}\n\nclass DateTimeFieldBuilder extends DataFieldBuilder<\"datetime\"> implements IDateTimeFieldBuilder {\n public constructor() {\n super(\"datetime\");\n /**\n * Without a subtype the GraphQL, storage and admin layers each assume a different\n * format. Default to an ISO datetime with timezone; subtype methods override it.\n */\n this.withTimezone();\n }\n\n required(message?: string): this {\n return this.validation({\n name: \"required\",\n message: message || \"Value is required.\",\n settings: {}\n });\n }\n\n dateTimeType(type: DateTimeType): this {\n this.config.settings = this.config.settings || {};\n this.config.settings.type = type;\n return this;\n }\n\n /**\n * Just a calendar date, no time, no timezone. Useful for things like birthdays, holidays, or due dates where the time of day doesn't matter.\n * Example: 2026-04-30\n *\n * @example\n * fields.datetime().dateOnly()\n * // day, then month, then year; single values only, not for `.list()`.\n * // The picker offers only the dates the `dateGte`/`dateLte` limits allow.\n * fields\n * .datetime()\n * .dateOnly()\n * .dateGte({ expression: \"today-100y\" })\n * .dateLte({ expression: \"today-18y\" }, \"You must be 18 or older.\")\n * .renderer(\"birthdayInput\")\n */\n dateOnly(): this {\n return this.dateTimeType(\"date\");\n }\n\n /**\n * Time in 24-hours format.\n * Example: 19:35\n */\n timeOnly(): this {\n return this.dateTimeType(\"time\");\n }\n\n /**\n * This is an ISO 8601 datetime with an explicit timezone offset.\n * Example: 2026-04-29T13:25:00+02:00\n */\n withTimezone(): this {\n return this.dateTimeType(\"dateTimeWithTimezone\");\n }\n\n /**\n * This is an ISO 8601 datetime in UTC (Zulu time). \"Z\" means \"this is UTC, no offset.\"\n * Example: 2026-04-30T13:25:00.000Z\n */\n withoutTimezone(): this {\n return this.dateTimeType(\"dateTimeWithoutTimezone\");\n }\n\n /**\n * The value must be on or after the given one: a fixed value, or, on a date-only field, an\n * expression worked out from today's date every time the value is checked.\n *\n * Expressions: `today`, or `today` plus or minus a number of days (`d`), months (`m`) or\n * years (`y`). The birthday picker reads these limits, so dates outside them can't be picked.\n *\n * In `message`, `{date}` is the limit as it was worked out. Without a message, the field\n * says \"Must be on or after {date}.\" (`dateLte`: \"Must be on or before {date}.\").\n *\n * @example\n * fields.datetime().dateOnly().dateGte(\"1900-01-01\")\n * // not older than 100 years\n * fields.datetime().dateOnly().dateGte({ expression: \"today-100y\" })\n */\n dateGte(value: DateBound, message?: string): this {\n return this.validation({\n name: \"dateGte\",\n message: message || \"Must be on or after {date}.\",\n settings: this.dateLimitSettings(value)\n });\n }\n\n /**\n * The value must be on or before the given one: a fixed value, or, on a date-only field, an\n * expression worked out from today's date every time the value is checked.\n *\n * @example\n * fields.datetime().dateOnly().dateLte(\"2026-12-31\")\n * // 18 or older\n * fields\n * .datetime()\n * .dateOnly()\n * .dateLte({ expression: \"today-18y\" }, \"You must be 18 or older.\")\n * .renderer(\"birthdayInput\")\n */\n dateLte(value: DateBound, message?: string): this {\n return this.validation({\n name: \"dateLte\",\n message: message || \"Must be on or before {date}.\",\n settings: this.dateLimitSettings(value)\n });\n }\n\n override build() {\n const result = super.build();\n validateDateExpressions(result.field);\n return result;\n }\n\n private dateLimitSettings(value: DateBound): Record<string, string> {\n const type = this.config.settings?.type || \"date\";\n if (typeof value === \"string\") {\n return { value, type };\n }\n if (!isDateExpression(value.expression)) {\n throw new WebinyError(\n `Invalid date expression \"${value.expression}\". Use \"today\", or \"today\" plus or minus a number of days, months or years, like \"today-18y\".`,\n \"INVALID_DATE_EXPRESSION\",\n { expression: value.expression }\n );\n }\n return { expression: value.expression, type };\n }\n}\n\nclass DateTimeFieldTypeFactory implements IFieldTypeFactory {\n readonly type = \"datetime\";\n\n create(): IDateTimeFieldBuilder {\n return new DateTimeFieldBuilder();\n }\n}\n\nexport const DateTimeFieldType = FieldType.createImplementation({\n implementation: DateTimeFieldTypeFactory,\n dependencies: []\n});\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n datetime(): IDateTimeFieldBuilder;\n }\n}\n"],"names":["DateTimeFieldBuilder","DataFieldBuilder","message","type","value","result","validateDateExpressions","isDateExpression","WebinyError","DateTimeFieldTypeFactory","DateTimeFieldType","FieldType"],"mappings":";;;;;AAkBA,MAAMA,6BAA6BC;IAC/B,aAAqB;QACjB,KAAK,CAAC;QAKN,IAAI,CAAC,YAAY;IACrB;IAEA,SAASC,OAAgB,EAAQ;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU,CAAC;QACf;IACJ;IAEA,aAAaC,IAAkB,EAAQ;QACnC,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAGA;QAC5B,OAAO,IAAI;IACf;IAiBA,WAAiB;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B;IAMA,WAAiB;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B;IAMA,eAAqB;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B;IAMA,kBAAwB;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B;IAiBA,QAAQC,KAAgB,EAAEF,OAAgB,EAAQ;QAC9C,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU,IAAI,CAAC,iBAAiB,CAACE;QACrC;IACJ;IAeA,QAAQA,KAAgB,EAAEF,OAAgB,EAAQ;QAC9C,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU,IAAI,CAAC,iBAAiB,CAACE;QACrC;IACJ;IAES,QAAQ;QACb,MAAMC,SAAS,KAAK,CAAC;QACrBC,wBAAwBD,OAAO,KAAK;QACpC,OAAOA;IACX;IAEQ,kBAAkBD,KAAgB,EAA0B;QAChE,MAAMD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ;QAC3C,IAAI,AAAiB,YAAjB,OAAOC,OACP,OAAO;YAAEA;YAAOD;QAAK;QAEzB,IAAI,CAACI,iBAAiBH,MAAM,UAAU,GAClC,MAAM,IAAII,MACN,CAAC,yBAAyB,EAAEJ,MAAM,UAAU,CAAC,6FAA6F,CAAC,EAC3I,2BACA;YAAE,YAAYA,MAAM,UAAU;QAAC;QAGvC,OAAO;YAAE,YAAYA,MAAM,UAAU;YAAED;QAAK;IAChD;AACJ;AAEA,MAAMM;IAGF,SAAgC;QAC5B,OAAO,IAAIT;IACf;;aAJS,IAAI,GAAG;;AAKpB;AAEO,MAAMU,oBAAoBC,UAAU,oBAAoB,CAAC;IAC5D,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
@@ -23,5 +23,7 @@ declare class TextFieldTypeFactory implements IFieldTypeFactory {
23
23
  readonly type = "text";
24
24
  create(): ITextFieldBuilder;
25
25
  }
26
- export declare const TextFieldType: import("@webiny/di").Implementation<typeof TextFieldTypeFactory>;
26
+ export declare const TextFieldType: typeof TextFieldTypeFactory & {
27
+ __abstraction: import("@webiny/di").Abstraction<IFieldTypeFactory>;
28
+ };
27
29
  export {};
@@ -1,4 +1,3 @@
1
- import { createImplementation } from "@webiny/feature/api";
2
1
  import { DataFieldBuilder } from "./FieldBuilder.js";
3
2
  import { FieldType } from "./abstractions.js";
4
3
  var TextFieldType_TextFieldSubTypes = /*#__PURE__*/ function(TextFieldSubTypes) {
@@ -148,8 +147,7 @@ class TextFieldTypeFactory {
148
147
  this.type = "text";
149
148
  }
150
149
  }
151
- const TextFieldType = createImplementation({
152
- abstraction: FieldType,
150
+ const TextFieldType = FieldType.createImplementation({
153
151
  implementation: TextFieldTypeFactory,
154
152
  dependencies: []
155
153
  });
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/fields/TextFieldType.js","sources":["../../../../src/features/modelBuilder/fields/TextFieldType.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/feature/api\";\nimport { DataFieldBuilder } from \"./FieldBuilder.js\";\nimport { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport type { FieldTypeValidator } from \"./fieldTypeValidator.js\";\n\nexport enum TextFieldSubTypes {\n COMPRESSED = \"compressed\",\n ENCRYPTED = \"encrypted\"\n}\n\nexport enum TextFieldTypes {\n TEXT = \"text\",\n COMPRESSED = \"text:compressed\",\n ENCRYPTED = \"text:encrypted\"\n}\n\nexport interface ITextFieldBuilder\n extends\n DataFieldBuilder<\"text\">,\n FieldTypeValidator.Required,\n FieldTypeValidator.MinLength,\n FieldTypeValidator.MaxLength,\n FieldTypeValidator.Pattern,\n FieldTypeValidator.Email,\n FieldTypeValidator.Url,\n FieldTypeValidator.LowerCase,\n FieldTypeValidator.UpperCase,\n FieldTypeValidator.LowerCaseSpace,\n FieldTypeValidator.UpperCaseSpace,\n FieldTypeValidator.Unique {\n compress(): this;\n encrypt(): this;\n}\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n text(): ITextFieldBuilder;\n }\n}\n\nclass TextFieldBuilder extends DataFieldBuilder<\"text\"> implements ITextFieldBuilder {\n public constructor() {\n super(\"text\");\n }\n\n required(message?: string): this {\n return this.validation({\n name: \"required\",\n message: message || \"Value is required.\",\n settings: {}\n });\n }\n\n minLength(value: number, message?: string): this {\n return this.validation({\n name: \"minLength\",\n message: message || \"Value is too short.\",\n settings: { value: String(value) }\n });\n }\n\n maxLength(value: number, message?: string): this {\n return this.validation({\n name: \"maxLength\",\n message: message || \"Value is too long.\",\n settings: { value: String(value) }\n });\n }\n\n pattern(regex: string, flags: string = \"\", message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Invalid value.\",\n settings: {\n preset: \"custom\",\n regex,\n flags\n }\n });\n }\n\n email(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Please enter a valid e-mail.\",\n settings: {\n preset: \"email\",\n regex: null,\n flags: null\n }\n });\n }\n\n url(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Please enter a valid URL.\",\n settings: {\n preset: \"url\",\n regex: null,\n flags: null\n }\n });\n }\n\n lowerCase(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Only lower case characters are allowed.\",\n settings: {\n preset: \"lowerCase\",\n regex: null,\n flags: null\n }\n });\n }\n\n upperCase(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Only upper case characters are allowed.\",\n settings: {\n preset: \"upperCase\",\n regex: null,\n flags: null\n }\n });\n }\n\n lowerCaseSpace(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Only lower case characters and space are allowed.\",\n settings: {\n preset: \"lowerCaseSpace\",\n regex: null,\n flags: null\n }\n });\n }\n\n upperCaseSpace(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Only upper case characters and space are allowed.\",\n settings: {\n preset: \"upperCaseSpace\",\n regex: null,\n flags: null\n }\n });\n }\n\n unique(message?: string): this {\n return this.validation({\n name: \"unique\",\n message: message || \"Value must be unique.\",\n settings: {}\n });\n }\n\n public compress(): this {\n this.setSubType(TextFieldSubTypes.COMPRESSED);\n\n this.settings({\n disableFullTextSearch: true\n });\n\n return this;\n }\n public encrypt(): this {\n this.setSubType(TextFieldSubTypes.ENCRYPTED);\n\n this.settings({\n disableFullTextSearch: true\n });\n\n return this;\n }\n}\n\nclass TextFieldTypeFactory implements IFieldTypeFactory {\n readonly type = \"text\";\n\n create(): ITextFieldBuilder {\n return new TextFieldBuilder();\n }\n}\n\nexport const TextFieldType = createImplementation({\n abstraction: FieldType,\n implementation: TextFieldTypeFactory,\n dependencies: []\n});\n"],"names":["TextFieldSubTypes","TextFieldTypes","TextFieldBuilder","DataFieldBuilder","message","value","String","regex","flags","TextFieldTypeFactory","TextFieldType","createImplementation","FieldType"],"mappings":";;;AAKO,IAAKA,kCAAiBA,WAAAA,GAAAA,SAAjBA,iBAAiB;;;WAAjBA;;AAKL,IAAKC,+BAAcA,WAAAA,GAAAA,SAAdA,cAAc;;;;WAAdA;;AA+BZ,MAAMC,yBAAyBC;IAC3B,aAAqB;QACjB,KAAK,CAAC;IACV;IAEA,SAASC,OAAgB,EAAQ;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU,CAAC;QACf;IACJ;IAEA,UAAUC,KAAa,EAAED,OAAgB,EAAQ;QAC7C,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBAAE,OAAOE,OAAOD;YAAO;QACrC;IACJ;IAEA,UAAUA,KAAa,EAAED,OAAgB,EAAQ;QAC7C,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBAAE,OAAOE,OAAOD;YAAO;QACrC;IACJ;IAEA,QAAQE,KAAa,EAAEC,QAAgB,EAAE,EAAEJ,OAAgB,EAAQ;QAC/D,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACRG;gBACAC;YACJ;QACJ;IACJ;IAEA,MAAMJ,OAAgB,EAAQ;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,IAAIA,OAAgB,EAAQ;QACxB,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,UAAUA,OAAgB,EAAQ;QAC9B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,UAAUA,OAAgB,EAAQ;QAC9B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,eAAeA,OAAgB,EAAQ;QACnC,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,eAAeA,OAAgB,EAAQ;QACnC,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,OAAOA,OAAgB,EAAQ;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU,CAAC;QACf;IACJ;IAEO,WAAiB;QACpB,IAAI,CAAC,UAAU,CAAC;QAEhB,IAAI,CAAC,QAAQ,CAAC;YACV,uBAAuB;QAC3B;QAEA,OAAO,IAAI;IACf;IACO,UAAgB;QACnB,IAAI,CAAC,UAAU,CAAC;QAEhB,IAAI,CAAC,QAAQ,CAAC;YACV,uBAAuB;QAC3B;QAEA,OAAO,IAAI;IACf;AACJ;AAEA,MAAMK;IAGF,SAA4B;QACxB,OAAO,IAAIP;IACf;;aAJS,IAAI,GAAG;;AAKpB;AAEO,MAAMQ,gBAAgBC,qBAAqB;IAC9C,aAAaC;IACb,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/modelBuilder/fields/TextFieldType.js","sources":["../../../../src/features/modelBuilder/fields/TextFieldType.ts"],"sourcesContent":["import { DataFieldBuilder } from \"./FieldBuilder.js\";\nimport { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport type { FieldTypeValidator } from \"./fieldTypeValidator.js\";\n\nexport enum TextFieldSubTypes {\n COMPRESSED = \"compressed\",\n ENCRYPTED = \"encrypted\"\n}\n\nexport enum TextFieldTypes {\n TEXT = \"text\",\n COMPRESSED = \"text:compressed\",\n ENCRYPTED = \"text:encrypted\"\n}\n\nexport interface ITextFieldBuilder\n extends\n DataFieldBuilder<\"text\">,\n FieldTypeValidator.Required,\n FieldTypeValidator.MinLength,\n FieldTypeValidator.MaxLength,\n FieldTypeValidator.Pattern,\n FieldTypeValidator.Email,\n FieldTypeValidator.Url,\n FieldTypeValidator.LowerCase,\n FieldTypeValidator.UpperCase,\n FieldTypeValidator.LowerCaseSpace,\n FieldTypeValidator.UpperCaseSpace,\n FieldTypeValidator.Unique {\n compress(): this;\n encrypt(): this;\n}\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n text(): ITextFieldBuilder;\n }\n}\n\nclass TextFieldBuilder extends DataFieldBuilder<\"text\"> implements ITextFieldBuilder {\n public constructor() {\n super(\"text\");\n }\n\n required(message?: string): this {\n return this.validation({\n name: \"required\",\n message: message || \"Value is required.\",\n settings: {}\n });\n }\n\n minLength(value: number, message?: string): this {\n return this.validation({\n name: \"minLength\",\n message: message || \"Value is too short.\",\n settings: { value: String(value) }\n });\n }\n\n maxLength(value: number, message?: string): this {\n return this.validation({\n name: \"maxLength\",\n message: message || \"Value is too long.\",\n settings: { value: String(value) }\n });\n }\n\n pattern(regex: string, flags: string = \"\", message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Invalid value.\",\n settings: {\n preset: \"custom\",\n regex,\n flags\n }\n });\n }\n\n email(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Please enter a valid e-mail.\",\n settings: {\n preset: \"email\",\n regex: null,\n flags: null\n }\n });\n }\n\n url(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Please enter a valid URL.\",\n settings: {\n preset: \"url\",\n regex: null,\n flags: null\n }\n });\n }\n\n lowerCase(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Only lower case characters are allowed.\",\n settings: {\n preset: \"lowerCase\",\n regex: null,\n flags: null\n }\n });\n }\n\n upperCase(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Only upper case characters are allowed.\",\n settings: {\n preset: \"upperCase\",\n regex: null,\n flags: null\n }\n });\n }\n\n lowerCaseSpace(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Only lower case characters and space are allowed.\",\n settings: {\n preset: \"lowerCaseSpace\",\n regex: null,\n flags: null\n }\n });\n }\n\n upperCaseSpace(message?: string): this {\n return this.validation({\n name: \"pattern\",\n message: message || \"Only upper case characters and space are allowed.\",\n settings: {\n preset: \"upperCaseSpace\",\n regex: null,\n flags: null\n }\n });\n }\n\n unique(message?: string): this {\n return this.validation({\n name: \"unique\",\n message: message || \"Value must be unique.\",\n settings: {}\n });\n }\n\n public compress(): this {\n this.setSubType(TextFieldSubTypes.COMPRESSED);\n\n this.settings({\n disableFullTextSearch: true\n });\n\n return this;\n }\n public encrypt(): this {\n this.setSubType(TextFieldSubTypes.ENCRYPTED);\n\n this.settings({\n disableFullTextSearch: true\n });\n\n return this;\n }\n}\n\nclass TextFieldTypeFactory implements IFieldTypeFactory {\n readonly type = \"text\";\n\n create(): ITextFieldBuilder {\n return new TextFieldBuilder();\n }\n}\n\nexport const TextFieldType = FieldType.createImplementation({\n implementation: TextFieldTypeFactory,\n dependencies: []\n});\n"],"names":["TextFieldSubTypes","TextFieldTypes","TextFieldBuilder","DataFieldBuilder","message","value","String","regex","flags","TextFieldTypeFactory","TextFieldType","FieldType"],"mappings":";;AAIO,IAAKA,kCAAiBA,WAAAA,GAAAA,SAAjBA,iBAAiB;;;WAAjBA;;AAKL,IAAKC,+BAAcA,WAAAA,GAAAA,SAAdA,cAAc;;;;WAAdA;;AA+BZ,MAAMC,yBAAyBC;IAC3B,aAAqB;QACjB,KAAK,CAAC;IACV;IAEA,SAASC,OAAgB,EAAQ;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU,CAAC;QACf;IACJ;IAEA,UAAUC,KAAa,EAAED,OAAgB,EAAQ;QAC7C,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBAAE,OAAOE,OAAOD;YAAO;QACrC;IACJ;IAEA,UAAUA,KAAa,EAAED,OAAgB,EAAQ;QAC7C,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBAAE,OAAOE,OAAOD;YAAO;QACrC;IACJ;IAEA,QAAQE,KAAa,EAAEC,QAAgB,EAAE,EAAEJ,OAAgB,EAAQ;QAC/D,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACRG;gBACAC;YACJ;QACJ;IACJ;IAEA,MAAMJ,OAAgB,EAAQ;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,IAAIA,OAAgB,EAAQ;QACxB,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,UAAUA,OAAgB,EAAQ;QAC9B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,UAAUA,OAAgB,EAAQ;QAC9B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,eAAeA,OAAgB,EAAQ;QACnC,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,eAAeA,OAAgB,EAAQ;QACnC,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU;gBACN,QAAQ;gBACR,OAAO;gBACP,OAAO;YACX;QACJ;IACJ;IAEA,OAAOA,OAAgB,EAAQ;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU,CAAC;QACf;IACJ;IAEO,WAAiB;QACpB,IAAI,CAAC,UAAU,CAAC;QAEhB,IAAI,CAAC,QAAQ,CAAC;YACV,uBAAuB;QAC3B;QAEA,OAAO,IAAI;IACf;IACO,UAAgB;QACnB,IAAI,CAAC,UAAU,CAAC;QAEhB,IAAI,CAAC,QAAQ,CAAC;YACV,uBAAuB;QAC3B;QAEA,OAAO,IAAI;IACf;AACJ;AAEA,MAAMK;IAGF,SAA4B;QACxB,OAAO,IAAIP;IACf;;aAJS,IAAI,GAAG;;AAKpB;AAEO,MAAMQ,gBAAgBC,UAAU,oBAAoB,CAAC;IACxD,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
@@ -2,6 +2,7 @@
2
2
  * Validator interface mixins for type-safe field validators.
3
3
  * These interfaces provide TypeScript autocomplete and type safety for field validation methods.
4
4
  */
5
+ import type { DateBound } from "@webiny/utils";
5
6
  export interface RequiredValidator {
6
7
  required(message?: string): this;
7
8
  }
@@ -50,13 +51,14 @@ export interface LteValidator {
50
51
  lte(value: number, message?: string): this;
51
52
  }
52
53
  /**
53
- * Date/time comparison validators
54
+ * Date/time comparison validators. The limit is a fixed value, or, on a date-only field,
55
+ * `{ expression }` worked out from today's date every time the value is checked.
54
56
  */
55
57
  export interface DateGteValidator {
56
- dateGte(value: string, message?: string): this;
58
+ dateGte(value: DateBound, message?: string): this;
57
59
  }
58
60
  export interface DateLteValidator {
59
- dateLte(value: string, message?: string): this;
61
+ dateLte(value: DateBound, message?: string): this;
60
62
  }
61
63
  /**
62
64
  * Unique value validator (ensures field value is unique across entries)
@@ -4,6 +4,14 @@ import { PublicModelBuilder } from "./PublicModelBuilder.js";
4
4
  export interface IModelBuilderPrivateInput {
5
5
  modelId: string;
6
6
  name: string;
7
+ /**
8
+ * Publish entry lifecycle events (`Cms/Entry/*`) for this model. Defaults to `true`.
9
+ *
10
+ * Set to `false` when the model is used as a storage layer, and your own use cases publish
11
+ * app-specific events. No entry event handlers will run for this model: that includes
12
+ * `Before*` handlers (validation, data modification), audit logs, webhooks, etc.
13
+ */
14
+ lifecycleEvents?: boolean;
7
15
  }
8
16
  export interface IModelBuilderPublicInput {
9
17
  name: string;
@@ -8,6 +8,7 @@ class ModelBuilder {
8
8
  const model = new PrivateModelBuilder(this.registry);
9
9
  model.modelId(input.modelId);
10
10
  model.name(input.name);
11
+ if (false === input.lifecycleEvents) model.disableLifecycleEvents();
11
12
  return model;
12
13
  }
13
14
  public(input) {
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/models/ModelBuilder.js","sources":["../../../../src/features/modelBuilder/models/ModelBuilder.ts"],"sourcesContent":["import { FieldBuilderRegistry } from \"../abstractions.js\";\nimport { PrivateModelBuilder } from \"./PrivateModelBuilder.js\";\nimport { PublicModelBuilder } from \"./PublicModelBuilder.js\";\n\nexport interface IModelBuilderPrivateInput {\n modelId: string;\n name: string;\n}\n\nexport interface IModelBuilderPublicInput {\n name: string;\n modelId: string;\n group: string;\n singularApiName?: string;\n pluralApiName?: string;\n}\n\n/**\n * Entry point builder that allows selecting model type.\n * Call .private() or .public() to get the appropriate typed builder.\n */\nexport class ModelBuilder {\n public constructor(private registry: FieldBuilderRegistry.Interface) {}\n\n /**\n * Create a private model (internal models, no GraphQL API).\n */\n public private(input: IModelBuilderPrivateInput): PrivateModelBuilder {\n const model = new PrivateModelBuilder(this.registry);\n model.modelId(input.modelId);\n model.name(input.name);\n return model;\n }\n\n /**\n * Create a public model (with GraphQL API).\n */\n public public(input: IModelBuilderPublicInput): PublicModelBuilder {\n const model = new PublicModelBuilder(this.registry);\n model.name(input.name);\n model.modelId(input.modelId);\n model.group(input.group);\n if (input.singularApiName) {\n model.singularApiName(input.singularApiName);\n }\n if (input.pluralApiName) {\n model.pluralApiName(input.pluralApiName);\n }\n return model;\n }\n}\n"],"names":["ModelBuilder","registry","input","model","PrivateModelBuilder","PublicModelBuilder"],"mappings":";;AAqBO,MAAMA;IACT,YAA2BC,QAAwC,CAAE;aAA1CA,QAAQ,GAARA;IAA2C;IAK/D,QAAQC,KAAgC,EAAuB;QAClE,MAAMC,QAAQ,IAAIC,oBAAoB,IAAI,CAAC,QAAQ;QACnDD,MAAM,OAAO,CAACD,MAAM,OAAO;QAC3BC,MAAM,IAAI,CAACD,MAAM,IAAI;QACrB,OAAOC;IACX;IAKO,OAAOD,KAA+B,EAAsB;QAC/D,MAAMC,QAAQ,IAAIE,mBAAmB,IAAI,CAAC,QAAQ;QAClDF,MAAM,IAAI,CAACD,MAAM,IAAI;QACrBC,MAAM,OAAO,CAACD,MAAM,OAAO;QAC3BC,MAAM,KAAK,CAACD,MAAM,KAAK;QACvB,IAAIA,MAAM,eAAe,EACrBC,MAAM,eAAe,CAACD,MAAM,eAAe;QAE/C,IAAIA,MAAM,aAAa,EACnBC,MAAM,aAAa,CAACD,MAAM,aAAa;QAE3C,OAAOC;IACX;AACJ"}
1
+ {"version":3,"file":"features/modelBuilder/models/ModelBuilder.js","sources":["../../../../src/features/modelBuilder/models/ModelBuilder.ts"],"sourcesContent":["import { FieldBuilderRegistry } from \"../abstractions.js\";\nimport { PrivateModelBuilder } from \"./PrivateModelBuilder.js\";\nimport { PublicModelBuilder } from \"./PublicModelBuilder.js\";\n\nexport interface IModelBuilderPrivateInput {\n modelId: string;\n name: string;\n /**\n * Publish entry lifecycle events (`Cms/Entry/*`) for this model. Defaults to `true`.\n *\n * Set to `false` when the model is used as a storage layer, and your own use cases publish\n * app-specific events. No entry event handlers will run for this model: that includes\n * `Before*` handlers (validation, data modification), audit logs, webhooks, etc.\n */\n lifecycleEvents?: boolean;\n}\n\nexport interface IModelBuilderPublicInput {\n name: string;\n modelId: string;\n group: string;\n singularApiName?: string;\n pluralApiName?: string;\n}\n\n/**\n * Entry point builder that allows selecting model type.\n * Call .private() or .public() to get the appropriate typed builder.\n */\nexport class ModelBuilder {\n public constructor(private registry: FieldBuilderRegistry.Interface) {}\n\n /**\n * Create a private model (internal models, no GraphQL API).\n */\n public private(input: IModelBuilderPrivateInput): PrivateModelBuilder {\n const model = new PrivateModelBuilder(this.registry);\n model.modelId(input.modelId);\n model.name(input.name);\n if (input.lifecycleEvents === false) {\n model.disableLifecycleEvents();\n }\n return model;\n }\n\n /**\n * Create a public model (with GraphQL API).\n */\n public public(input: IModelBuilderPublicInput): PublicModelBuilder {\n const model = new PublicModelBuilder(this.registry);\n model.name(input.name);\n model.modelId(input.modelId);\n model.group(input.group);\n if (input.singularApiName) {\n model.singularApiName(input.singularApiName);\n }\n if (input.pluralApiName) {\n model.pluralApiName(input.pluralApiName);\n }\n return model;\n }\n}\n"],"names":["ModelBuilder","registry","input","model","PrivateModelBuilder","PublicModelBuilder"],"mappings":";;AA6BO,MAAMA;IACT,YAA2BC,QAAwC,CAAE;aAA1CA,QAAQ,GAARA;IAA2C;IAK/D,QAAQC,KAAgC,EAAuB;QAClE,MAAMC,QAAQ,IAAIC,oBAAoB,IAAI,CAAC,QAAQ;QACnDD,MAAM,OAAO,CAACD,MAAM,OAAO;QAC3BC,MAAM,IAAI,CAACD,MAAM,IAAI;QACrB,IAAIA,AAA0B,UAA1BA,MAAM,eAAe,EACrBC,MAAM,sBAAsB;QAEhC,OAAOA;IACX;IAKO,OAAOD,KAA+B,EAAsB;QAC/D,MAAMC,QAAQ,IAAIE,mBAAmB,IAAI,CAAC,QAAQ;QAClDF,MAAM,IAAI,CAACD,MAAM,IAAI;QACrBC,MAAM,OAAO,CAACD,MAAM,OAAO;QAC3BC,MAAM,KAAK,CAACD,MAAM,KAAK;QACvB,IAAIA,MAAM,eAAe,EACrBC,MAAM,eAAe,CAACD,MAAM,eAAe;QAE/C,IAAIA,MAAM,aAAa,EACnBC,MAAM,aAAa,CAACD,MAAM,aAAa;QAE3C,OAAOC;IACX;AACJ"}
@@ -1,12 +1,10 @@
1
1
  import { ModelsProvider as ProviderAbstraction } from "./abstractions.js";
2
- import { AccessControl } from "../../../features/shared/abstractions.js";
3
2
  import { ModelFactory } from "../abstractions.js";
4
3
  import { FieldBuilderRegistry } from "../abstractions.js";
5
4
  import type { CmsModel } from "../../../types/index.js";
6
5
  export declare class ModelsProvider implements ProviderAbstraction.Interface {
7
6
  private getModels;
8
7
  private fieldsRegistry;
9
- private accessControl;
10
- constructor(getModels: () => ModelFactory.Interface[], fieldsRegistry: FieldBuilderRegistry.Interface, accessControl: AccessControl.Interface | undefined);
8
+ constructor(getModels: () => ModelFactory.Interface[], fieldsRegistry: FieldBuilderRegistry.Interface);
11
9
  list(tenant: string): Promise<CmsModel[]>;
12
10
  }
@@ -1,10 +1,8 @@
1
- import { filterAsync } from "../../../utils/filterAsync.js";
2
1
  import { ModelBuilder } from "./ModelBuilder.js";
3
2
  class ModelsProvider {
4
- constructor(getModels, fieldsRegistry, accessControl){
3
+ constructor(getModels, fieldsRegistry){
5
4
  this.getModels = getModels;
6
5
  this.fieldsRegistry = fieldsRegistry;
7
- this.accessControl = accessControl;
8
6
  }
9
7
  async list(tenant) {
10
8
  const modelImpls = this.getModels();
@@ -20,10 +18,7 @@ class ModelsProvider {
20
18
  });
21
19
  }
22
20
  }
23
- if (!this.accessControl) return allModels;
24
- return filterAsync(allModels, (model)=>this.accessControl.canAccessModel({
25
- model
26
- }));
21
+ return allModels;
27
22
  }
28
23
  }
29
24
  export { ModelsProvider };
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/models/ModelsProvider.js","sources":["../../../../src/features/modelBuilder/models/ModelsProvider.ts"],"sourcesContent":["import { ModelsProvider as ProviderAbstraction } from \"./abstractions.js\";\nimport { AccessControl } from \"~/features/shared/abstractions.js\";\nimport { ModelFactory } from \"../abstractions.js\";\nimport { FieldBuilderRegistry } from \"../abstractions.js\";\nimport type { CmsModel } from \"~/types/index.js\";\nimport { filterAsync } from \"~/utils/filterAsync.js\";\nimport { ModelBuilder } from \"./ModelBuilder.js\";\n\nexport class ModelsProvider implements ProviderAbstraction.Interface {\n public constructor(\n private getModels: () => ModelFactory.Interface[],\n private fieldsRegistry: FieldBuilderRegistry.Interface,\n private accessControl: AccessControl.Interface | undefined\n ) {}\n\n async list(tenant: string): Promise<CmsModel[]> {\n const modelImpls = this.getModels();\n const allModels: CmsModel[] = [];\n\n for (const modelImpl of modelImpls) {\n // Entry builder that determines model type\n const entryBuilder = new ModelBuilder(this.fieldsRegistry);\n\n // Get typed builders (array of private or public builders)\n const typedBuilders = await modelImpl.execute(entryBuilder);\n\n // Process each builder in the array\n for (const typedBuilder of typedBuilders) {\n const modelPlugin = typedBuilder.build();\n\n allModels.push({\n ...modelPlugin.contentModel,\n tenant\n });\n }\n }\n\n if (!this.accessControl) {\n return allModels;\n }\n // Apply access control filtering\n return filterAsync(allModels, model => {\n return this.accessControl!.canAccessModel({ model });\n });\n }\n}\n"],"names":["ModelsProvider","getModels","fieldsRegistry","accessControl","tenant","modelImpls","allModels","modelImpl","entryBuilder","ModelBuilder","typedBuilders","typedBuilder","modelPlugin","filterAsync","model"],"mappings":";;AAQO,MAAMA;IACT,YACYC,SAAyC,EACzCC,cAA8C,EAC9CC,aAAkD,CAC5D;aAHUF,SAAS,GAATA;aACAC,cAAc,GAAdA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,KAAKC,MAAc,EAAuB;QAC5C,MAAMC,aAAa,IAAI,CAAC,SAAS;QACjC,MAAMC,YAAwB,EAAE;QAEhC,KAAK,MAAMC,aAAaF,WAAY;YAEhC,MAAMG,eAAe,IAAIC,aAAa,IAAI,CAAC,cAAc;YAGzD,MAAMC,gBAAgB,MAAMH,UAAU,OAAO,CAACC;YAG9C,KAAK,MAAMG,gBAAgBD,cAAe;gBACtC,MAAME,cAAcD,aAAa,KAAK;gBAEtCL,UAAU,IAAI,CAAC;oBACX,GAAGM,YAAY,YAAY;oBAC3BR;gBACJ;YACJ;QACJ;QAEA,IAAI,CAAC,IAAI,CAAC,aAAa,EACnB,OAAOE;QAGX,OAAOO,YAAYP,WAAWQ,CAAAA,QACnB,IAAI,CAAC,aAAa,CAAE,cAAc,CAAC;gBAAEA;YAAM;IAE1D;AACJ"}
1
+ {"version":3,"file":"features/modelBuilder/models/ModelsProvider.js","sources":["../../../../src/features/modelBuilder/models/ModelsProvider.ts"],"sourcesContent":["import { ModelsProvider as ProviderAbstraction } from \"./abstractions.js\";\nimport { ModelFactory } from \"../abstractions.js\";\nimport { FieldBuilderRegistry } from \"../abstractions.js\";\nimport type { CmsModel } from \"~/types/index.js\";\nimport { ModelBuilder } from \"./ModelBuilder.js\";\n\nexport class ModelsProvider implements ProviderAbstraction.Interface {\n public constructor(\n private getModels: () => ModelFactory.Interface[],\n private fieldsRegistry: FieldBuilderRegistry.Interface\n ) {}\n\n async list(tenant: string): Promise<CmsModel[]> {\n const modelImpls = this.getModels();\n const allModels: CmsModel[] = [];\n\n for (const modelImpl of modelImpls) {\n // Entry builder that determines model type\n const entryBuilder = new ModelBuilder(this.fieldsRegistry);\n\n // Get typed builders (array of private or public builders)\n const typedBuilders = await modelImpl.execute(entryBuilder);\n\n // Process each builder in the array\n for (const typedBuilder of typedBuilders) {\n const modelPlugin = typedBuilder.build();\n\n allModels.push({\n ...modelPlugin.contentModel,\n tenant\n });\n }\n }\n\n // No access control here: see PluginModelsProvider for why the model list is not filtered.\n return allModels;\n }\n}\n"],"names":["ModelsProvider","getModels","fieldsRegistry","tenant","modelImpls","allModels","modelImpl","entryBuilder","ModelBuilder","typedBuilders","typedBuilder","modelPlugin"],"mappings":";AAMO,MAAMA;IACT,YACYC,SAAyC,EACzCC,cAA8C,CACxD;aAFUD,SAAS,GAATA;aACAC,cAAc,GAAdA;IACT;IAEH,MAAM,KAAKC,MAAc,EAAuB;QAC5C,MAAMC,aAAa,IAAI,CAAC,SAAS;QACjC,MAAMC,YAAwB,EAAE;QAEhC,KAAK,MAAMC,aAAaF,WAAY;YAEhC,MAAMG,eAAe,IAAIC,aAAa,IAAI,CAAC,cAAc;YAGzD,MAAMC,gBAAgB,MAAMH,UAAU,OAAO,CAACC;YAG9C,KAAK,MAAMG,gBAAgBD,cAAe;gBACtC,MAAME,cAAcD,aAAa,KAAK;gBAEtCL,UAAU,IAAI,CAAC;oBACX,GAAGM,YAAY,YAAY;oBAC3BR;gBACJ;YACJ;QACJ;QAGA,OAAOE;IACX;AACJ"}
@@ -1,4 +1,9 @@
1
1
  import { BaseModelBuilder } from "./BaseModelBuilder.js";
2
2
  export declare class PrivateModelBuilder extends BaseModelBuilder {
3
+ private lifecycleEvents;
4
+ /**
5
+ * @internal Use `builder.private({ lifecycleEvents: false })` instead.
6
+ */
7
+ disableLifecycleEvents(): this;
3
8
  build(): import("~/plugins/CmsModelPlugin.js").CmsModelPlugin;
4
9
  }
@@ -1,11 +1,19 @@
1
1
  import { createPrivateModelPlugin } from "../../../plugins/CmsModelPlugin.js";
2
2
  import { BaseModelBuilder } from "./BaseModelBuilder.js";
3
3
  class PrivateModelBuilder extends BaseModelBuilder {
4
+ disableLifecycleEvents() {
5
+ this.lifecycleEvents = false;
6
+ return this;
7
+ }
4
8
  build() {
5
9
  if (!this.config.modelId) throw new Error("modelId is required");
6
10
  if (!this.config.name) throw new Error("name is required");
7
11
  if (0 === this.fieldBuildersMap.size) throw new Error("fields are required");
8
12
  const { fields } = this.buildFields();
13
+ const settings = {
14
+ ...this.config.settings || {}
15
+ };
16
+ if (!this.lifecycleEvents) settings.lifecycleEvents = false;
9
17
  return createPrivateModelPlugin({
10
18
  modelId: this.config.modelId,
11
19
  name: this.config.name,
@@ -13,9 +21,12 @@ class PrivateModelBuilder extends BaseModelBuilder {
13
21
  authorization: false,
14
22
  noValidate: true,
15
23
  tags: this.getTags(),
16
- settings: this.config.settings || {}
24
+ settings
17
25
  });
18
26
  }
27
+ constructor(...args){
28
+ super(...args), this.lifecycleEvents = true;
29
+ }
19
30
  }
20
31
  export { PrivateModelBuilder };
21
32
 
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/models/PrivateModelBuilder.js","sources":["../../../../src/features/modelBuilder/models/PrivateModelBuilder.ts"],"sourcesContent":["import { createPrivateModelPlugin } from \"~/plugins/CmsModelPlugin.js\";\nimport { BaseModelBuilder } from \"./BaseModelBuilder.js\";\n\nexport class PrivateModelBuilder extends BaseModelBuilder {\n public build() {\n if (!this.config.modelId) {\n throw new Error(\"modelId is required\");\n }\n if (!this.config.name) {\n throw new Error(\"name is required\");\n }\n if (this.fieldBuildersMap.size === 0) {\n throw new Error(\"fields are required\");\n }\n\n // Build all fields from field builders (layout replacements ignored for private models)\n const { fields } = this.buildFields();\n\n return createPrivateModelPlugin({\n modelId: this.config.modelId,\n name: this.config.name,\n fields,\n authorization: false,\n noValidate: true,\n tags: this.getTags(),\n settings: this.config.settings || {}\n });\n }\n}\n"],"names":["PrivateModelBuilder","BaseModelBuilder","Error","fields","createPrivateModelPlugin"],"mappings":";;AAGO,MAAMA,4BAA4BC;IAC9B,QAAQ;QACX,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EACpB,MAAM,IAAIC,MAAM;QAEpB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EACjB,MAAM,IAAIA,MAAM;QAEpB,IAAI,AAA+B,MAA/B,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAC1B,MAAM,IAAIA,MAAM;QAIpB,MAAM,EAAEC,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW;QAEnC,OAAOC,yBAAyB;YAC5B,SAAS,IAAI,CAAC,MAAM,CAAC,OAAO;YAC5B,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI;YACtBD;YACA,eAAe;YACf,YAAY;YACZ,MAAM,IAAI,CAAC,OAAO;YAClB,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC;QACvC;IACJ;AACJ"}
1
+ {"version":3,"file":"features/modelBuilder/models/PrivateModelBuilder.js","sources":["../../../../src/features/modelBuilder/models/PrivateModelBuilder.ts"],"sourcesContent":["import { createPrivateModelPlugin } from \"~/plugins/CmsModelPlugin.js\";\nimport { BaseModelBuilder } from \"./BaseModelBuilder.js\";\n\nexport class PrivateModelBuilder extends BaseModelBuilder {\n private lifecycleEvents = true;\n\n /**\n * @internal Use `builder.private({ lifecycleEvents: false })` instead.\n */\n public disableLifecycleEvents(): this {\n this.lifecycleEvents = false;\n return this;\n }\n\n public build() {\n if (!this.config.modelId) {\n throw new Error(\"modelId is required\");\n }\n if (!this.config.name) {\n throw new Error(\"name is required\");\n }\n if (this.fieldBuildersMap.size === 0) {\n throw new Error(\"fields are required\");\n }\n\n // Build all fields from field builders (layout replacements ignored for private models)\n const { fields } = this.buildFields();\n\n const settings = { ...(this.config.settings || {}) };\n if (!this.lifecycleEvents) {\n settings.lifecycleEvents = false;\n }\n\n return createPrivateModelPlugin({\n modelId: this.config.modelId,\n name: this.config.name,\n fields,\n authorization: false,\n noValidate: true,\n tags: this.getTags(),\n settings\n });\n }\n}\n"],"names":["PrivateModelBuilder","BaseModelBuilder","Error","fields","settings","createPrivateModelPlugin"],"mappings":";;AAGO,MAAMA,4BAA4BC;IAM9B,yBAA+B;QAClC,IAAI,CAAC,eAAe,GAAG;QACvB,OAAO,IAAI;IACf;IAEO,QAAQ;QACX,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EACpB,MAAM,IAAIC,MAAM;QAEpB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EACjB,MAAM,IAAIA,MAAM;QAEpB,IAAI,AAA+B,MAA/B,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAC1B,MAAM,IAAIA,MAAM;QAIpB,MAAM,EAAEC,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW;QAEnC,MAAMC,WAAW;YAAE,GAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC;QAAE;QACnD,IAAI,CAAC,IAAI,CAAC,eAAe,EACrBA,SAAS,eAAe,GAAG;QAG/B,OAAOC,yBAAyB;YAC5B,SAAS,IAAI,CAAC,MAAM,CAAC,OAAO;YAC5B,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI;YACtBF;YACA,eAAe;YACf,YAAY;YACZ,MAAM,IAAI,CAAC,OAAO;YAClBC;QACJ;IACJ;;QAvCG,qBACK,eAAe,GAAG;;AAuC9B"}
@@ -1,20 +1,12 @@
1
- import type { CmsContext as CmsCtx, HeadlessCmsStorageOperations as StorageOps } from "../../types/types.js";
1
+ import type { CmsContext as CmsCtx, CmsEntryValues, StorageOperationsCmsModel } from "../../types/types.js";
2
+ import type { CmsModel } from "../../types/model.js";
2
3
  import type { AccessControl as AccessControlClass } from "../../crud/AccessControl/AccessControl.js";
3
- /**
4
- * StorageOperations abstraction for legacy storage operations.
5
- * The legacy implementation will be registered using container.registerInstance.
6
- */
7
- export declare const StorageOperations: import("@webiny/di").Abstraction<StorageOps<CmsCtx>>;
8
- export declare namespace StorageOperations {
9
- type Interface = StorageOps;
10
- }
11
- export interface IHeadlessCmsStorageOperationsFactory<T> {
12
- create(context: T): Promise<StorageOps>;
4
+ export interface ICmsStorageModelProvider {
5
+ getModel<T extends CmsEntryValues = CmsEntryValues>(model: CmsModel): StorageOperationsCmsModel<T>;
13
6
  }
14
- export declare const StorageOperationsFactory: import("@webiny/di").Abstraction<IHeadlessCmsStorageOperationsFactory<any>>;
15
- export declare namespace StorageOperationsFactory {
16
- type Interface<T extends CmsCtx = CmsCtx> = IHeadlessCmsStorageOperationsFactory<T>;
17
- type Result = StorageOps;
7
+ export declare const CmsStorageModelProvider: import("@webiny/di").Abstraction<ICmsStorageModelProvider>;
8
+ export declare namespace CmsStorageModelProvider {
9
+ type Interface = ICmsStorageModelProvider;
18
10
  }
19
11
  /**
20
12
  * AccessControl abstraction for legacy access control.
@@ -28,7 +20,7 @@ export declare namespace AccessControl {
28
20
  * CmsContext abstraction for legacy CMS context.
29
21
  * The legacy implementation will be registered using container.registerInstance.
30
22
  */
31
- export declare const CmsContext: import("@webiny/di").Abstraction<CmsCtx>;
23
+ export declare const CmsContext: import("@webiny/di").Abstraction<import("@webiny/api/types").Context>;
32
24
  export declare namespace CmsContext {
33
25
  type Interface = CmsCtx;
34
26
  }
@@ -1,8 +1,7 @@
1
1
  import { createAbstraction } from "@webiny/feature/api";
2
- const StorageOperations = createAbstraction("StorageOperations");
3
- const StorageOperationsFactory = createAbstraction("Cms/StorageOperationsFactory");
2
+ const CmsStorageModelProvider = createAbstraction("CmsStorageModelProvider");
4
3
  const AccessControl = createAbstraction("AccessControl");
5
4
  const CmsContext = createAbstraction("CmsContext");
6
- export { AccessControl, CmsContext, StorageOperations, StorageOperationsFactory };
5
+ export { AccessControl, CmsContext, CmsStorageModelProvider };
7
6
 
8
7
  //# sourceMappingURL=abstractions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"features/shared/abstractions.js","sources":["../../../src/features/shared/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type {\n CmsContext as CmsCtx,\n HeadlessCmsStorageOperations as StorageOps\n} from \"~/types/types.js\";\nimport type { AccessControl as AccessControlClass } from \"~/crud/AccessControl/AccessControl.js\";\n\n/**\n * StorageOperations abstraction for legacy storage operations.\n * The legacy implementation will be registered using container.registerInstance.\n */\nexport const StorageOperations = createAbstraction<StorageOps>(\"StorageOperations\");\n\nexport namespace StorageOperations {\n export type Interface = StorageOps;\n}\n\nexport interface IHeadlessCmsStorageOperationsFactory<T> {\n create(context: T): Promise<StorageOps>;\n}\n\nexport const StorageOperationsFactory = createAbstraction<\n IHeadlessCmsStorageOperationsFactory<any>\n>(\"Cms/StorageOperationsFactory\");\n\nexport namespace StorageOperationsFactory {\n export type Interface<T extends CmsCtx = CmsCtx> = IHeadlessCmsStorageOperationsFactory<T>;\n export type Result = StorageOps;\n}\n\n/**\n * AccessControl abstraction for legacy access control.\n * The legacy implementation will be registered using container.registerInstance.\n */\nexport const AccessControl = createAbstraction<AccessControlClass>(\"AccessControl\");\n\nexport namespace AccessControl {\n export type Interface = AccessControlClass;\n}\n\n/**\n * CmsContext abstraction for legacy CMS context.\n * The legacy implementation will be registered using container.registerInstance.\n */\nexport const CmsContext = createAbstraction<CmsCtx>(\"CmsContext\");\n\nexport namespace CmsContext {\n export type Interface = CmsCtx;\n}\n\nexport interface IAccessControl {\n canAccessModel(params: { model: any }): Promise<boolean>;\n canAccessGroup(params: { group: any }): Promise<boolean>;\n}\n"],"names":["StorageOperations","createAbstraction","StorageOperationsFactory","AccessControl","CmsContext"],"mappings":";AAWO,MAAMA,oBAAoBC,kBAA8B;AAUxD,MAAMC,2BAA2BD,kBAEtC;AAWK,MAAME,gBAAgBF,kBAAsC;AAU5D,MAAMG,aAAaH,kBAA0B"}
1
+ {"version":3,"file":"features/shared/abstractions.js","sources":["../../../src/features/shared/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type {\n CmsContext as CmsCtx,\n CmsEntryValues,\n StorageOperationsCmsModel\n} from \"~/types/types.js\";\nimport type { CmsModel } from \"~/types/model.js\";\nimport type { AccessControl as AccessControlClass } from \"~/crud/AccessControl/AccessControl.js\";\n\nexport interface ICmsStorageModelProvider {\n getModel<T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel\n ): StorageOperationsCmsModel<T>;\n}\n\nexport const CmsStorageModelProvider =\n createAbstraction<ICmsStorageModelProvider>(\"CmsStorageModelProvider\");\n\nexport namespace CmsStorageModelProvider {\n export type Interface = ICmsStorageModelProvider;\n}\n\n/**\n * AccessControl abstraction for legacy access control.\n * The legacy implementation will be registered using container.registerInstance.\n */\nexport const AccessControl = createAbstraction<AccessControlClass>(\"AccessControl\");\n\nexport namespace AccessControl {\n export type Interface = AccessControlClass;\n}\n\n/**\n * CmsContext abstraction for legacy CMS context.\n * The legacy implementation will be registered using container.registerInstance.\n */\nexport const CmsContext = createAbstraction<CmsCtx>(\"CmsContext\");\n\nexport namespace CmsContext {\n export type Interface = CmsCtx;\n}\n\nexport interface IAccessControl {\n canAccessModel(params: { model: any }): Promise<boolean>;\n canAccessGroup(params: { group: any }): Promise<boolean>;\n}\n"],"names":["CmsStorageModelProvider","createAbstraction","AccessControl","CmsContext"],"mappings":";AAeO,MAAMA,0BACTC,kBAA4C;AAUzC,MAAMC,gBAAgBD,kBAAsC;AAU5D,MAAME,aAAaF,kBAA0B"}
@@ -0,0 +1,8 @@
1
+ import type { CmsModel, CmsEntry, CmsEntryValues, CmsEntryStorageOperationsCreateRevisionFromParams } from "../../../../types/index.js";
2
+ export interface ICreateEntryRevisionFromStorageOperation {
3
+ execute<T extends CmsEntryValues = CmsEntryValues>(model: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>): Promise<CmsEntry<T>>;
4
+ }
5
+ export declare const CreateEntryRevisionFromStorageOperation: import("@webiny/di").Abstraction<ICreateEntryRevisionFromStorageOperation>;
6
+ export declare namespace CreateEntryRevisionFromStorageOperation {
7
+ type Interface = ICreateEntryRevisionFromStorageOperation;
8
+ }