@webiny/api-headless-cms 6.4.5 → 6.6.0-alpha.0

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 (666) hide show
  1. package/HeadlessCmsContextualSchema.d.ts +16 -0
  2. package/HeadlessCmsContextualSchema.js +32 -0
  3. package/HeadlessCmsContextualSchema.js.map +1 -0
  4. package/HeadlessCmsEndpointConfig.d.ts +10 -0
  5. package/HeadlessCmsEndpointConfig.js +5 -0
  6. package/HeadlessCmsEndpointConfig.js.map +1 -0
  7. package/HeadlessCmsFeature.d.ts +10 -0
  8. package/HeadlessCmsFeature.js +192 -0
  9. package/HeadlessCmsFeature.js.map +1 -0
  10. package/createCmsRoute.d.ts +21 -0
  11. package/createCmsRoute.js +49 -0
  12. package/createCmsRoute.js.map +1 -0
  13. package/crud/contentEntry/entryDataValidation.d.ts +1 -1
  14. package/crud/contentEntry/entryDataValidation.js +2 -15
  15. package/crud/contentEntry/entryDataValidation.js.map +1 -1
  16. package/crud/contentEntry/references/validateEntries.d.ts +1 -1
  17. package/crud/contentEntry/references/validateEntries.js +17 -7
  18. package/crud/contentEntry/references/validateEntries.js.map +1 -1
  19. package/crud/contentEntry.crud.js +22 -20
  20. package/crud/contentEntry.crud.js.map +1 -1
  21. package/crud/contentModel.crud.js +8 -6
  22. package/crud/contentModel.crud.js.map +1 -1
  23. package/crud/contentModelGroup.crud.js +7 -5
  24. package/crud/contentModelGroup.crud.js.map +1 -1
  25. package/domain/contentModel/schemas.d.ts +6 -6
  26. package/domain/contentModel/schemas.js +1 -1
  27. package/domain/contentModel/schemas.js.map +1 -1
  28. package/domain/contentModel/validation/modelFields.js +21 -15
  29. package/domain/contentModel/validation/modelFields.js.map +1 -1
  30. package/export/abstractions.d.ts +9 -0
  31. package/export/abstractions.js +6 -0
  32. package/export/abstractions.js.map +1 -0
  33. package/export/crud/exporting.js +8 -2
  34. package/export/crud/exporting.js.map +1 -1
  35. package/export/crud/importing.js +13 -4
  36. package/export/crud/importing.js.map +1 -1
  37. package/export/crud/imports/importGroups.js +23 -23
  38. package/export/crud/imports/importGroups.js.map +1 -1
  39. package/export/crud/imports/importModels.js +25 -22
  40. package/export/crud/imports/importModels.js.map +1 -1
  41. package/export/graphql/index.d.ts +2 -3
  42. package/export/graphql/index.js +6 -10
  43. package/export/graphql/index.js.map +1 -1
  44. package/exports/api/cms/storage.d.ts +0 -1
  45. package/exports/api/cms/storage.js +0 -1
  46. package/features/contentEntry/CreateEntry/CreateEntryRepository.d.ts +6 -4
  47. package/features/contentEntry/CreateEntry/CreateEntryRepository.js +7 -8
  48. package/features/contentEntry/CreateEntry/CreateEntryRepository.js.map +1 -1
  49. package/features/contentEntry/CreateEntry/CreateEntryUseCase.d.ts +3 -1
  50. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js +2 -3
  51. package/features/contentEntry/CreateEntry/CreateEntryUseCase.js.map +1 -1
  52. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.d.ts +6 -4
  53. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js +7 -8
  54. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js.map +1 -1
  55. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.d.ts +3 -1
  56. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js +2 -3
  57. package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js.map +1 -1
  58. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.d.ts +6 -4
  59. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js +7 -8
  60. package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js.map +1 -1
  61. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.d.ts +3 -1
  62. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js +2 -3
  63. package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js.map +1 -1
  64. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.d.ts +6 -4
  65. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js +7 -8
  66. package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js.map +1 -1
  67. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.d.ts +3 -1
  68. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js +2 -3
  69. package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js.map +1 -1
  70. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.d.ts +3 -3
  71. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js +5 -5
  72. package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js.map +1 -1
  73. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.d.ts +6 -4
  74. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js +7 -8
  75. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js.map +1 -1
  76. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.d.ts +3 -1
  77. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js +2 -3
  78. package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js.map +1 -1
  79. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.d.ts +6 -4
  80. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js +7 -8
  81. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js.map +1 -1
  82. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.d.ts +3 -1
  83. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js +2 -3
  84. package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js.map +1 -1
  85. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.d.ts +6 -4
  86. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js +7 -8
  87. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js.map +1 -1
  88. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.d.ts +3 -1
  89. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js +2 -3
  90. package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js.map +1 -1
  91. package/features/contentEntry/GetEntry/GetEntryUseCase.d.ts +3 -1
  92. package/features/contentEntry/GetEntry/GetEntryUseCase.js +2 -3
  93. package/features/contentEntry/GetEntry/GetEntryUseCase.js.map +1 -1
  94. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.d.ts +3 -1
  95. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js +2 -3
  96. package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js.map +1 -1
  97. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.d.ts +6 -4
  98. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js +7 -8
  99. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js.map +1 -1
  100. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.d.ts +3 -1
  101. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js +2 -3
  102. package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js.map +1 -1
  103. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.d.ts +3 -1
  104. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js +2 -3
  105. package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js.map +1 -1
  106. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.d.ts +6 -4
  107. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js +7 -8
  108. package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js.map +1 -1
  109. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.d.ts +3 -1
  110. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js +2 -3
  111. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js.map +1 -1
  112. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.d.ts +3 -1
  113. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js +1 -3
  114. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js.map +1 -1
  115. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.d.ts +3 -1
  116. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js +2 -3
  117. package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js.map +1 -1
  118. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.d.ts +3 -1
  119. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js +2 -3
  120. package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js.map +1 -1
  121. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.d.ts +6 -4
  122. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js +7 -8
  123. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js.map +1 -1
  124. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.d.ts +3 -1
  125. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js +2 -3
  126. package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js.map +1 -1
  127. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.d.ts +6 -4
  128. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js +7 -8
  129. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js.map +1 -1
  130. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.d.ts +3 -1
  131. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js +2 -3
  132. package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js.map +1 -1
  133. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.d.ts +6 -4
  134. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js +7 -8
  135. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js.map +1 -1
  136. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.d.ts +3 -1
  137. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js +2 -3
  138. package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js.map +1 -1
  139. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.d.ts +6 -4
  140. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js +7 -8
  141. package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js.map +1 -1
  142. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.d.ts +3 -1
  143. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js +1 -3
  144. package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js.map +1 -1
  145. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.d.ts +6 -4
  146. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js +7 -8
  147. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js.map +1 -1
  148. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.d.ts +3 -1
  149. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js +2 -3
  150. package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js.map +1 -1
  151. package/features/contentEntry/GetSingletonEntry/GetSingletonEntryUseCase.js +1 -3
  152. package/features/contentEntry/GetSingletonEntry/GetSingletonEntryUseCase.js.map +1 -1
  153. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.d.ts +6 -4
  154. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js +7 -8
  155. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js.map +1 -1
  156. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.d.ts +6 -2
  157. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js +8 -6
  158. package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js.map +1 -1
  159. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.d.ts +3 -1
  160. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js +1 -3
  161. package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js.map +1 -1
  162. package/features/contentEntry/ListEntries/ListEntriesRepository.d.ts +6 -4
  163. package/features/contentEntry/ListEntries/ListEntriesRepository.js +7 -8
  164. package/features/contentEntry/ListEntries/ListEntriesRepository.js.map +1 -1
  165. package/features/contentEntry/ListEntries/ListEntriesUseCase.d.ts +3 -1
  166. package/features/contentEntry/ListEntries/ListEntriesUseCase.js +2 -3
  167. package/features/contentEntry/ListEntries/ListEntriesUseCase.js.map +1 -1
  168. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.d.ts +3 -1
  169. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js +1 -3
  170. package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js.map +1 -1
  171. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.d.ts +3 -1
  172. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js +1 -3
  173. package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js.map +1 -1
  174. package/features/contentEntry/MoveEntry/MoveEntryRepository.d.ts +6 -4
  175. package/features/contentEntry/MoveEntry/MoveEntryRepository.js +7 -8
  176. package/features/contentEntry/MoveEntry/MoveEntryRepository.js.map +1 -1
  177. package/features/contentEntry/MoveEntry/MoveEntryUseCase.d.ts +3 -1
  178. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js +2 -3
  179. package/features/contentEntry/MoveEntry/MoveEntryUseCase.js.map +1 -1
  180. package/features/contentEntry/PublishEntry/PublishEntryRepository.d.ts +6 -4
  181. package/features/contentEntry/PublishEntry/PublishEntryRepository.js +7 -8
  182. package/features/contentEntry/PublishEntry/PublishEntryRepository.js.map +1 -1
  183. package/features/contentEntry/PublishEntry/PublishEntryUseCase.d.ts +3 -1
  184. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js +2 -3
  185. package/features/contentEntry/PublishEntry/PublishEntryUseCase.js.map +1 -1
  186. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.d.ts +8 -4
  187. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js +11 -9
  188. package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js.map +1 -1
  189. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.d.ts +3 -1
  190. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js +2 -3
  191. package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js.map +1 -1
  192. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.d.ts +6 -4
  193. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js +7 -8
  194. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js.map +1 -1
  195. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.d.ts +3 -1
  196. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js +2 -3
  197. package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js.map +1 -1
  198. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.d.ts +6 -4
  199. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js +7 -8
  200. package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js.map +1 -1
  201. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.d.ts +3 -1
  202. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js +2 -3
  203. package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js.map +1 -1
  204. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.d.ts +6 -4
  205. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js +7 -8
  206. package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js.map +1 -1
  207. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.d.ts +3 -1
  208. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js +2 -3
  209. package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js.map +1 -1
  210. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.d.ts +3 -1
  211. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js +2 -3
  212. package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js.map +1 -1
  213. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.d.ts +3 -1
  214. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js +2 -3
  215. package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js.map +1 -1
  216. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.d.ts +3 -1
  217. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js +2 -4
  218. package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js.map +1 -1
  219. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.d.ts +4 -4
  220. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js +4 -8
  221. package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js.map +1 -1
  222. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.d.ts +3 -1
  223. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js +1 -3
  224. package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js.map +1 -1
  225. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.d.ts +3 -1
  226. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js +1 -3
  227. package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js.map +1 -1
  228. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.d.ts +3 -1
  229. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js +1 -3
  230. package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js.map +1 -1
  231. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.d.ts +3 -1
  232. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js +2 -4
  233. package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js.map +1 -1
  234. package/features/contentModel/ContentModelFeature.js +2 -0
  235. package/features/contentModel/ContentModelFeature.js.map +1 -1
  236. package/features/contentModel/CreateModel/CreateModelRepository.d.ts +4 -3
  237. package/features/contentModel/CreateModel/CreateModelRepository.js +6 -5
  238. package/features/contentModel/CreateModel/CreateModelRepository.js.map +1 -1
  239. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.d.ts +4 -3
  240. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js +6 -5
  241. package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js.map +1 -1
  242. package/features/contentModel/DeleteModel/DeleteModelRepository.d.ts +3 -3
  243. package/features/contentModel/DeleteModel/DeleteModelRepository.js +5 -5
  244. package/features/contentModel/DeleteModel/DeleteModelRepository.js.map +1 -1
  245. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.d.ts +1 -0
  246. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js +11 -8
  247. package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js.map +1 -1
  248. package/features/contentModel/UpdateModel/UpdateModelRepository.d.ts +6 -3
  249. package/features/contentModel/UpdateModel/UpdateModelRepository.js +11 -7
  250. package/features/contentModel/UpdateModel/UpdateModelRepository.js.map +1 -1
  251. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.d.ts +16 -0
  252. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js +51 -0
  253. package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js.map +1 -0
  254. package/features/contentModel/ValuesSelectionGenerator/abstractions.d.ts +8 -0
  255. package/features/contentModel/ValuesSelectionGenerator/abstractions.js +5 -0
  256. package/features/contentModel/ValuesSelectionGenerator/abstractions.js.map +1 -0
  257. package/features/contentModel/ValuesSelectionGenerator/feature.d.ts +4 -0
  258. package/features/contentModel/ValuesSelectionGenerator/feature.js +11 -0
  259. package/features/contentModel/ValuesSelectionGenerator/feature.js.map +1 -0
  260. package/features/contentModel/ValuesSelectionGenerator/index.d.ts +1 -0
  261. package/features/contentModel/ValuesSelectionGenerator/index.js +1 -0
  262. package/features/contentModel/shared/ModelsFetcher.d.ts +3 -3
  263. package/features/contentModel/shared/ModelsFetcher.js +5 -5
  264. package/features/contentModel/shared/ModelsFetcher.js.map +1 -1
  265. package/features/contentModel/shared/PluginModelsProvider.d.ts +5 -4
  266. package/features/contentModel/shared/PluginModelsProvider.js +11 -8
  267. package/features/contentModel/shared/PluginModelsProvider.js.map +1 -1
  268. package/features/contentModel/shared/abstractions.d.ts +10 -0
  269. package/features/contentModel/shared/abstractions.js +2 -1
  270. package/features/contentModel/shared/abstractions.js.map +1 -1
  271. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.d.ts +8 -4
  272. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js +13 -11
  273. package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js.map +1 -1
  274. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.d.ts +3 -1
  275. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js +2 -3
  276. package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js.map +1 -1
  277. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.d.ts +8 -4
  278. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js +11 -9
  279. package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js.map +1 -1
  280. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.d.ts +3 -1
  281. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js +2 -3
  282. package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js.map +1 -1
  283. package/features/contentModelGroup/GetGroup/GetGroupRepository.d.ts +6 -4
  284. package/features/contentModelGroup/GetGroup/GetGroupRepository.js +9 -9
  285. package/features/contentModelGroup/GetGroup/GetGroupRepository.js.map +1 -1
  286. package/features/contentModelGroup/GetGroup/GetGroupUseCase.d.ts +3 -1
  287. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js +2 -3
  288. package/features/contentModelGroup/GetGroup/GetGroupUseCase.js.map +1 -1
  289. package/features/contentModelGroup/ListGroups/ListGroupsRepository.d.ts +6 -4
  290. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js +9 -9
  291. package/features/contentModelGroup/ListGroups/ListGroupsRepository.js.map +1 -1
  292. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.d.ts +3 -1
  293. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js +2 -3
  294. package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js.map +1 -1
  295. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.d.ts +6 -4
  296. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js +7 -8
  297. package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js.map +1 -1
  298. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.d.ts +3 -1
  299. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js +2 -3
  300. package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js.map +1 -1
  301. package/features/contentModelGroup/shared/PluginGroupsProvider.d.ts +6 -4
  302. package/features/contentModelGroup/shared/PluginGroupsProvider.js +13 -11
  303. package/features/contentModelGroup/shared/PluginGroupsProvider.js.map +1 -1
  304. package/features/contentModelGroup/shared/abstractions.d.ts +10 -0
  305. package/features/contentModelGroup/shared/abstractions.js +2 -1
  306. package/features/contentModelGroup/shared/abstractions.js.map +1 -1
  307. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.d.ts +2 -2
  308. package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.js.map +1 -1
  309. package/features/graphql/fields/base/DynamicZoneToGraphQL.js.map +1 -1
  310. package/features/graphql/fields/base/RefToGraphQL.d.ts +1 -1
  311. package/features/graphql/fields/base/RefToGraphQL.js +3 -1
  312. package/features/graphql/fields/base/RefToGraphQL.js.map +1 -1
  313. package/features/graphql/fields/base/richText/richTextResolver.d.ts +1 -1
  314. package/features/graphql/fields/base/richText/richTextResolver.js.map +1 -1
  315. package/features/modelBuilder/fields/BaseFieldBuilder.d.ts +1 -3
  316. package/features/modelBuilder/fields/BaseFieldBuilder.js +0 -4
  317. package/features/modelBuilder/fields/BaseFieldBuilder.js.map +1 -1
  318. package/features/modelBuilder/fields/DataFieldBuilder.d.ts +12 -18
  319. package/features/modelBuilder/fields/DataFieldBuilder.js +1 -2
  320. package/features/modelBuilder/fields/DataFieldBuilder.js.map +1 -1
  321. package/features/modelBuilder/fields/DynamicZoneFieldType.js +3 -8
  322. package/features/modelBuilder/fields/DynamicZoneFieldType.js.map +1 -1
  323. package/features/modelBuilder/fields/TextFieldType.d.ts +3 -1
  324. package/features/modelBuilder/fields/TextFieldType.js +1 -3
  325. package/features/modelBuilder/fields/TextFieldType.js.map +1 -1
  326. package/features/modelBuilder/fields/UiAlertFieldType.js +1 -2
  327. package/features/modelBuilder/fields/UiAlertFieldType.js.map +1 -1
  328. package/features/modelBuilder/fields/UiSeparatorFieldType.js +1 -2
  329. package/features/modelBuilder/fields/UiSeparatorFieldType.js.map +1 -1
  330. package/features/modelBuilder/fields/UiTabsFieldType.d.ts +1 -2
  331. package/features/modelBuilder/fields/UiTabsFieldType.js +3 -6
  332. package/features/modelBuilder/fields/UiTabsFieldType.js.map +1 -1
  333. package/features/shared/abstractions.d.ts +11 -15
  334. package/features/shared/abstractions.js +3 -3
  335. package/features/shared/abstractions.js.map +1 -1
  336. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.d.ts +8 -0
  337. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js +5 -0
  338. package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js.map +1 -0
  339. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.d.ts +8 -0
  340. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js +5 -0
  341. package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js.map +1 -0
  342. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.d.ts +8 -0
  343. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js +5 -0
  344. package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js.map +1 -0
  345. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.d.ts +8 -0
  346. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js +5 -0
  347. package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js.map +1 -0
  348. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.d.ts +8 -0
  349. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js +5 -0
  350. package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js.map +1 -0
  351. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.d.ts +8 -0
  352. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js +5 -0
  353. package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js.map +1 -0
  354. package/features/shared/storageOperations/entry/GetEntryStorageOperation.d.ts +8 -0
  355. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js +5 -0
  356. package/features/shared/storageOperations/entry/GetEntryStorageOperation.js.map +1 -0
  357. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.d.ts +8 -0
  358. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js +5 -0
  359. package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js.map +1 -0
  360. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.d.ts +8 -0
  361. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js +5 -0
  362. package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js.map +1 -0
  363. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.d.ts +8 -0
  364. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js +5 -0
  365. package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js.map +1 -0
  366. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.d.ts +8 -0
  367. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js +5 -0
  368. package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js.map +1 -0
  369. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.d.ts +8 -0
  370. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js +5 -0
  371. package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js.map +1 -0
  372. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.d.ts +8 -0
  373. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js +5 -0
  374. package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js.map +1 -0
  375. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.d.ts +8 -0
  376. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js +5 -0
  377. package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js.map +1 -0
  378. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.d.ts +8 -0
  379. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js +5 -0
  380. package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js.map +1 -0
  381. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.d.ts +8 -0
  382. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js +5 -0
  383. package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js.map +1 -0
  384. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.d.ts +8 -0
  385. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js +5 -0
  386. package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js.map +1 -0
  387. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.d.ts +8 -0
  388. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js +5 -0
  389. package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js.map +1 -0
  390. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.d.ts +8 -0
  391. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js +5 -0
  392. package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js.map +1 -0
  393. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.d.ts +8 -0
  394. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js +5 -0
  395. package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js.map +1 -0
  396. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.d.ts +8 -0
  397. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js +5 -0
  398. package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js.map +1 -0
  399. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.d.ts +8 -0
  400. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js +5 -0
  401. package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js.map +1 -0
  402. package/features/shared/storageOperations/group/CreateGroupStorageOperation.d.ts +8 -0
  403. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js +5 -0
  404. package/features/shared/storageOperations/group/CreateGroupStorageOperation.js.map +1 -0
  405. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.d.ts +8 -0
  406. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js +5 -0
  407. package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js.map +1 -0
  408. package/features/shared/storageOperations/group/GetGroupStorageOperation.d.ts +8 -0
  409. package/features/shared/storageOperations/group/GetGroupStorageOperation.js +5 -0
  410. package/features/shared/storageOperations/group/GetGroupStorageOperation.js.map +1 -0
  411. package/features/shared/storageOperations/group/ListGroupsStorageOperation.d.ts +8 -0
  412. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js +5 -0
  413. package/features/shared/storageOperations/group/ListGroupsStorageOperation.js.map +1 -0
  414. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.d.ts +8 -0
  415. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js +5 -0
  416. package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js.map +1 -0
  417. package/features/shared/storageOperations/index.d.ts +32 -0
  418. package/features/shared/storageOperations/index.js +32 -0
  419. package/features/shared/storageOperations/model/CreateModelStorageOperation.d.ts +8 -0
  420. package/features/shared/storageOperations/model/CreateModelStorageOperation.js +5 -0
  421. package/features/shared/storageOperations/model/CreateModelStorageOperation.js.map +1 -0
  422. package/features/shared/storageOperations/model/DeleteModelStorageOperation.d.ts +8 -0
  423. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js +5 -0
  424. package/features/shared/storageOperations/model/DeleteModelStorageOperation.js.map +1 -0
  425. package/features/shared/storageOperations/model/GetModelStorageOperation.d.ts +8 -0
  426. package/features/shared/storageOperations/model/GetModelStorageOperation.js +5 -0
  427. package/features/shared/storageOperations/model/GetModelStorageOperation.js.map +1 -0
  428. package/features/shared/storageOperations/model/ListModelsStorageOperation.d.ts +8 -0
  429. package/features/shared/storageOperations/model/ListModelsStorageOperation.js +5 -0
  430. package/features/shared/storageOperations/model/ListModelsStorageOperation.js.map +1 -0
  431. package/features/shared/storageOperations/model/UpdateModelStorageOperation.d.ts +8 -0
  432. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js +5 -0
  433. package/features/shared/storageOperations/model/UpdateModelStorageOperation.js.map +1 -0
  434. package/fieldConverters/abstractions.d.ts +14 -0
  435. package/fieldConverters/abstractions.js +13 -0
  436. package/fieldConverters/abstractions.js.map +1 -0
  437. package/fieldConverters/index.d.ts +1 -1
  438. package/graphql/CmsGraphQLSchemaFactory.d.ts +8 -0
  439. package/graphql/CmsGraphQLSchemaFactory.js +5 -0
  440. package/graphql/CmsGraphQLSchemaFactory.js.map +1 -0
  441. package/graphql/CmsSchemaExecutor.d.ts +10 -0
  442. package/graphql/CmsSchemaExecutor.js +5 -0
  443. package/graphql/CmsSchemaExecutor.js.map +1 -0
  444. package/graphql/buildSchemaPlugins.d.ts +2 -1
  445. package/graphql/buildSchemaPlugins.js +1 -3
  446. package/graphql/buildSchemaPlugins.js.map +1 -1
  447. package/graphql/checkEndpointAccess.js +5 -2
  448. package/graphql/checkEndpointAccess.js.map +1 -1
  449. package/graphql/createExecutableSchema.d.ts +1 -1
  450. package/graphql/createExecutableSchema.js +1 -1
  451. package/graphql/createExecutableSchema.js.map +1 -1
  452. package/graphql/generateSchema.d.ts +2 -1
  453. package/graphql/generateSchema.js +14 -5
  454. package/graphql/generateSchema.js.map +1 -1
  455. package/graphql/getSchema.js +7 -2
  456. package/graphql/getSchema.js.map +1 -1
  457. package/graphql/scalars/RevisionIdScalarPlugin.d.ts +1 -1
  458. package/graphql/scalars/RevisionIdScalarPlugin.js.map +1 -1
  459. package/graphql/schema/baseContentSchema.d.ts +1 -6
  460. package/graphql/schema/baseContentSchema.js +5 -8
  461. package/graphql/schema/baseContentSchema.js.map +1 -1
  462. package/graphql/schema/baseSchema.d.ts +2 -2
  463. package/graphql/schema/baseSchema.js +6 -41
  464. package/graphql/schema/baseSchema.js.map +1 -1
  465. package/graphql/schema/cms/CmsBaseErrorTypeFactory.d.ts +14 -0
  466. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js +21 -0
  467. package/graphql/schema/cms/CmsBaseErrorTypeFactory.js.map +1 -0
  468. package/graphql/schema/cms/createEntryResolver.js +2 -2
  469. package/graphql/schema/cms/createEntryResolver.js.map +1 -1
  470. package/graphql/schema/cms/deleteEntryResolver.js +2 -2
  471. package/graphql/schema/cms/deleteEntryResolver.js.map +1 -1
  472. package/graphql/schema/cms/getEntryResolver.js +2 -2
  473. package/graphql/schema/cms/getEntryResolver.js.map +1 -1
  474. package/graphql/schema/cms/helpers/getModel.d.ts +0 -3
  475. package/graphql/schema/cms/helpers/getModel.js +5 -3
  476. package/graphql/schema/cms/helpers/getModel.js.map +1 -1
  477. package/graphql/schema/cms/helpers/transformWhereToNested.js +17 -39
  478. package/graphql/schema/cms/helpers/transformWhereToNested.js.map +1 -1
  479. package/graphql/schema/cms/listEntriesResolver.js +2 -2
  480. package/graphql/schema/cms/listEntriesResolver.js.map +1 -1
  481. package/graphql/schema/cms/publishEntryResolver.js +2 -2
  482. package/graphql/schema/cms/publishEntryResolver.js.map +1 -1
  483. package/graphql/schema/cms/resolvers/createEntry.d.ts +2 -2
  484. package/graphql/schema/cms/resolvers/createEntry.js +1 -1
  485. package/graphql/schema/cms/resolvers/createEntry.js.map +1 -1
  486. package/graphql/schema/cms/resolvers/deleteEntryRevision.d.ts +2 -2
  487. package/graphql/schema/cms/resolvers/deleteEntryRevision.js +1 -1
  488. package/graphql/schema/cms/resolvers/deleteEntryRevision.js.map +1 -1
  489. package/graphql/schema/cms/resolvers/getEntry.d.ts +2 -2
  490. package/graphql/schema/cms/resolvers/getEntry.js +1 -1
  491. package/graphql/schema/cms/resolvers/getEntry.js.map +1 -1
  492. package/graphql/schema/cms/resolvers/listEntries.d.ts +2 -2
  493. package/graphql/schema/cms/resolvers/listEntries.js +1 -1
  494. package/graphql/schema/cms/resolvers/listEntries.js.map +1 -1
  495. package/graphql/schema/cms/resolvers/mutationCms.d.ts +2 -2
  496. package/graphql/schema/cms/resolvers/mutationCms.js +1 -1
  497. package/graphql/schema/cms/resolvers/mutationCms.js.map +1 -1
  498. package/graphql/schema/cms/resolvers/publishEntryRevision.d.ts +2 -2
  499. package/graphql/schema/cms/resolvers/publishEntryRevision.js +1 -1
  500. package/graphql/schema/cms/resolvers/publishEntryRevision.js.map +1 -1
  501. package/graphql/schema/cms/resolvers/queryCms.d.ts +2 -2
  502. package/graphql/schema/cms/resolvers/queryCms.js +1 -1
  503. package/graphql/schema/cms/resolvers/queryCms.js.map +1 -1
  504. package/graphql/schema/cms/resolvers/unpublishEntryRevision.d.ts +2 -2
  505. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js +1 -1
  506. package/graphql/schema/cms/resolvers/unpublishEntryRevision.js.map +1 -1
  507. package/graphql/schema/cms/resolvers/updateEntryRevision.d.ts +2 -2
  508. package/graphql/schema/cms/resolvers/updateEntryRevision.js +1 -1
  509. package/graphql/schema/cms/resolvers/updateEntryRevision.js.map +1 -1
  510. package/graphql/schema/cms/typeDefs/mutation.d.ts +2 -2
  511. package/graphql/schema/cms/typeDefs/mutation.js +1 -1
  512. package/graphql/schema/cms/typeDefs/mutation.js.map +1 -1
  513. package/graphql/schema/cms/typeDefs/query.d.ts +2 -2
  514. package/graphql/schema/cms/typeDefs/query.js +1 -1
  515. package/graphql/schema/cms/typeDefs/query.js.map +1 -1
  516. package/graphql/schema/cms/typeDefs/responses.d.ts +2 -2
  517. package/graphql/schema/cms/typeDefs/responses.js +1 -1
  518. package/graphql/schema/cms/typeDefs/responses.js.map +1 -1
  519. package/graphql/schema/cms/unpublishEntryResolver.js +2 -2
  520. package/graphql/schema/cms/unpublishEntryResolver.js.map +1 -1
  521. package/graphql/schema/cms/updateEntryResolver.js +2 -2
  522. package/graphql/schema/cms/updateEntryResolver.js.map +1 -1
  523. package/graphql/schema/contentEntries.js +43 -32
  524. package/graphql/schema/contentEntries.js.map +1 -1
  525. package/graphql/schema/contentModelGroups.js +39 -18
  526. package/graphql/schema/contentModelGroups.js.map +1 -1
  527. package/graphql/schema/contentModels.js +37 -16
  528. package/graphql/schema/contentModels.js.map +1 -1
  529. package/graphql/schema/createFieldResolvers.d.ts +1 -1
  530. package/graphql/schema/createFieldResolvers.js.map +1 -1
  531. package/graphql/schema/createManageResolvers.js +4 -2
  532. package/graphql/schema/createManageResolvers.js.map +1 -1
  533. package/graphql/schema/resolvers/manage/resolveCreate.js +5 -3
  534. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
  535. package/graphql/schema/resolvers/manage/resolveCreateFrom.js +5 -3
  536. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
  537. package/graphql/schema/resolvers/manage/resolveDelete.js +9 -4
  538. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
  539. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +5 -3
  540. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -1
  541. package/graphql/schema/resolvers/manage/resolveGet.js +11 -6
  542. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
  543. package/graphql/schema/resolvers/manage/resolveGetByIds.js +5 -3
  544. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
  545. package/graphql/schema/resolvers/manage/resolveGetRevisions.js +5 -3
  546. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
  547. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +5 -3
  548. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -1
  549. package/graphql/schema/resolvers/manage/resolveList.js +5 -3
  550. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
  551. package/graphql/schema/resolvers/manage/resolveListDeleted.js +5 -3
  552. package/graphql/schema/resolvers/manage/resolveListDeleted.js.map +1 -1
  553. package/graphql/schema/resolvers/manage/resolveMove.js +4 -2
  554. package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -1
  555. package/graphql/schema/resolvers/manage/resolvePublish.js +5 -3
  556. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
  557. package/graphql/schema/resolvers/manage/resolveRepublish.js +5 -3
  558. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
  559. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js +5 -3
  560. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js.map +1 -1
  561. package/graphql/schema/resolvers/manage/resolveUnpublish.js +5 -3
  562. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
  563. package/graphql/schema/resolvers/manage/resolveUpdate.js +5 -3
  564. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
  565. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js +5 -3
  566. package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js.map +1 -1
  567. package/graphql/schema/resolvers/manage/resolveValidate.js +5 -3
  568. package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -1
  569. package/graphql/schema/resolvers/preview/resolveGet.js +6 -3
  570. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
  571. package/graphql/schema/resolvers/preview/resolveList.js +5 -3
  572. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
  573. package/graphql/schema/resolvers/read/resolveGet.js +5 -2
  574. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
  575. package/graphql/schema/resolvers/read/resolveList.js +5 -3
  576. package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
  577. package/graphql/schema/resolvers/singular/resolveGet.js +1 -1
  578. package/graphql/schema/resolvers/singular/resolveGet.js.map +1 -1
  579. package/graphql/schema/resolvers/singular/resolveUpdate.js +1 -1
  580. package/graphql/schema/resolvers/singular/resolveUpdate.js.map +1 -1
  581. package/graphql/schema/schemaPlugins.d.ts +2 -1
  582. package/graphql/schema/schemaPlugins.js +2 -4
  583. package/graphql/schema/schemaPlugins.js.map +1 -1
  584. package/index.d.ts +7 -6
  585. package/index.js +4 -22
  586. package/legacy/abstractions.js.map +1 -1
  587. package/package.json +22 -27
  588. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.d.ts +2 -2
  589. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js +1 -1
  590. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js.map +1 -1
  591. package/plugins/index.d.ts +0 -1
  592. package/plugins/index.js +0 -1
  593. package/types/fields/dynamicZoneField.d.ts +2 -2
  594. package/types/modelField.d.ts +1 -1
  595. package/types/types.d.ts +10 -183
  596. package/types/types.js.map +1 -1
  597. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.d.ts +28 -0
  598. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js +324 -0
  599. package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js.map +1 -0
  600. package/utils/contentModelToJsonSchema/index.d.ts +2 -0
  601. package/utils/contentModelToJsonSchema/index.js +1 -0
  602. package/utils/contentModelToJsonSchema/types.d.ts +24 -0
  603. package/utils/contentModelToJsonSchema/types.js +0 -0
  604. package/utils/converters/ConverterCollection.d.ts +2 -2
  605. package/utils/converters/ConverterCollection.js +1 -3
  606. package/utils/converters/ConverterCollection.js.map +1 -1
  607. package/utils/converters/valueKeyFromStorageConverter.d.ts +2 -2
  608. package/utils/converters/valueKeyFromStorageConverter.js +2 -2
  609. package/utils/converters/valueKeyFromStorageConverter.js.map +1 -1
  610. package/utils/converters/valueKeyStorageConverter.js +4 -2
  611. package/utils/converters/valueKeyStorageConverter.js.map +1 -1
  612. package/utils/converters/valueKeyToStorageConverter.d.ts +2 -2
  613. package/utils/converters/valueKeyToStorageConverter.js +2 -2
  614. package/utils/converters/valueKeyToStorageConverter.js.map +1 -1
  615. package/utils/getSchemaFromFieldPlugins.d.ts +2 -2
  616. package/utils/getSchemaFromFieldPlugins.js.map +1 -1
  617. package/utils/index.d.ts +1 -0
  618. package/utils/index.js +1 -0
  619. package/utils/isHeadlessCmsReady.d.ts +1 -1
  620. package/utils/isHeadlessCmsReady.js +3 -2
  621. package/utils/isHeadlessCmsReady.js.map +1 -1
  622. package/abstractions/entryHooks/OnEntryBeforeCreate.d.ts +0 -8
  623. package/abstractions/entryHooks/OnEntryBeforeCreate.js +0 -5
  624. package/abstractions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  625. package/abstractions/entryHooks/index.d.ts +0 -1
  626. package/abstractions/entryHooks/index.js +0 -1
  627. package/abstractions/index.d.ts +0 -1
  628. package/abstractions/index.js +0 -1
  629. package/context.d.ts +0 -3
  630. package/context.js +0 -131
  631. package/context.js.map +0 -1
  632. package/extensions/entryHooks/OnEntryBeforeCreate.d.ts +0 -4
  633. package/extensions/entryHooks/OnEntryBeforeCreate.js +0 -21
  634. package/extensions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
  635. package/extensions/entryHooks/index.d.ts +0 -1
  636. package/extensions/entryHooks/index.js +0 -1
  637. package/extensions/index.d.ts +0 -5
  638. package/extensions/index.js +0 -7
  639. package/extensions/index.js.map +0 -1
  640. package/graphql/graphQLHandlerFactory.d.ts +0 -5
  641. package/graphql/graphQLHandlerFactory.js +0 -22
  642. package/graphql/graphQLHandlerFactory.js.map +0 -1
  643. package/graphql/handleRequest.d.ts +0 -11
  644. package/graphql/handleRequest.js +0 -62
  645. package/graphql/handleRequest.js.map +0 -1
  646. package/graphql/index.d.ts +0 -4
  647. package/graphql/index.js +0 -11
  648. package/graphql/index.js.map +0 -1
  649. package/graphql/schema/cms/index.d.ts +0 -2
  650. package/graphql/schema/cms/index.js +0 -24
  651. package/graphql/schema/cms/index.js.map +0 -1
  652. package/index.js.map +0 -1
  653. package/parameters/context.d.ts +0 -2
  654. package/parameters/context.js +0 -7
  655. package/parameters/context.js.map +0 -1
  656. package/parameters/header.d.ts +0 -2
  657. package/parameters/header.js +0 -13
  658. package/parameters/header.js.map +0 -1
  659. package/parameters/index.d.ts +0 -3
  660. package/parameters/index.js +0 -3
  661. package/parameters/path.d.ts +0 -2
  662. package/parameters/path.js +0 -12
  663. package/parameters/path.js.map +0 -1
  664. package/plugins/CmsParametersPlugin.d.ts +0 -18
  665. package/plugins/CmsParametersPlugin.js +0 -16
  666. package/plugins/CmsParametersPlugin.js.map +0 -1
@@ -3,6 +3,7 @@ import { CmsModelFieldToGraphQL } from "../abstractions/CmsModelFieldToGraphQL.j
3
3
  import { createTypeName } from "../../../../utils/createTypeName.js";
4
4
  import { parseIdentifier } from "@webiny/utils";
5
5
  import { createGraphQLInputField } from "./utils/createGraphQLInputField.js";
6
+ import { HeadlessCms } from "../../../shared/abstractions.js";
6
7
  import { GetModelUseCase } from "../../../contentModel/GetModel/index.js";
7
8
  import { GetPublishedEntriesByIdsUseCase } from "../../../contentEntry/GetPublishedEntriesByIds/index.js";
8
9
  import { GetLatestEntriesByIdsUseCase } from "../../../contentEntry/GetLatestEntriesByIds/index.js";
@@ -74,7 +75,8 @@ class ReadApi {
74
75
  return parent[field.fieldId];
75
76
  };
76
77
  return async (parent, args, context)=>{
77
- const { cms, container } = context;
78
+ const { container } = context;
79
+ const cms = container.resolve(HeadlessCms);
78
80
  const getModel = container.resolve(GetModelUseCase);
79
81
  const getPublishedByIds = container.resolve(GetPublishedEntriesByIdsUseCase);
80
82
  const getLatestByIds = container.resolve(GetLatestEntriesByIdsUseCase);
@@ -1 +1 @@
1
- {"version":3,"file":"features/graphql/fields/base/RefToGraphQL.js","sources":["../../../../../src/features/graphql/fields/base/RefToGraphQL.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsModelFieldToGraphQL } from \"../abstractions/CmsModelFieldToGraphQL.js\";\nimport type {\n CmsContext,\n CmsEntry,\n CmsModel,\n CmsModelField,\n CmsModelFieldType,\n CmsModelFieldDefinition\n} from \"~/types/index.js\";\nimport type { GraphQLSchemaDefinition } from \"@webiny/handler-graphql/types.js\";\nimport { createTypeName } from \"~/utils/createTypeName.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { createGraphQLInputField } from \"./utils/createGraphQLInputField.js\";\nimport { GetModelUseCase } from \"~/features/contentModel/GetModel/index.js\";\nimport { GetPublishedEntriesByIdsUseCase } from \"~/features/contentEntry/GetPublishedEntriesByIds/index.js\";\nimport { GetLatestEntriesByIdsUseCase } from \"~/features/contentEntry/GetLatestEntriesByIds/index.js\";\n\ninterface RefFieldValue {\n /**\n * `id` is optional for backwards compatibility with records created before this property was introduced.\n */\n id?: string;\n entryId: string;\n modelId: string;\n}\n\nconst createUnionTypeName = (model: CmsModel, field: CmsModelField) => {\n return `${model.singularApiName}_${createTypeName(field.fieldId)}`;\n};\n\nconst createListFilters = (fieldId: string): string => {\n return `\n ${fieldId}: RefFieldWhereInput\n `;\n};\n\nconst createFilteringTypeDef = () => {\n return `\n input RefFieldWhereInput {\n id: String\n id_not: String\n id_in: [String!]\n id_not_in: [String]\n entryId: String\n entryId_not: String\n entryId_in: [String!]\n entryId_not_in: [String!]\n modelId: String\n modelId_not: String\n modelId_in: [String!]\n modelId_not_in: [String!]\n }\n `;\n};\n\nconst appendTypename = (entries: CmsEntry[], typename: string): CmsEntry[] => {\n return entries.map(item => {\n return {\n ...item,\n __typename: typename\n };\n });\n};\n\nconst getFieldModels = (field: CmsModelField): Pick<CmsModel, \"modelId\">[] => {\n if (!field.settings || Array.isArray(field.settings.models) === false) {\n return [];\n }\n return field.settings.models as Pick<CmsModel, \"modelId\">[];\n};\n\nconst modelIdToTypeName = new Map<string, string>();\n\ninterface GetModelParams {\n models: CmsModel[];\n modelId: string;\n}\n\nconst getModel = (params: GetModelParams): CmsModel => {\n const { models, modelId } = params;\n const model = models.find(item => item.modelId === modelId);\n if (model) {\n return model;\n }\n throw new WebinyError(\n `Could not find model with ID \"${modelId}\" in the list of models.`,\n \"MODEL_NOT_FOUND\",\n { modelId }\n );\n};\n\nconst getModelSingularApiName = (params: GetModelParams): string => {\n return getModel(params).singularApiName;\n};\n\nclass ReadApi implements CmsModelFieldToGraphQL.ReadApi {\n public createTypeField({\n model,\n field,\n models\n }: CmsModelFieldToGraphQL.TypeFieldParams): CmsModelFieldDefinition {\n const fieldModels = field.settings?.models || [];\n const gqlType =\n fieldModels.length > 1\n ? createUnionTypeName(model, field)\n : getModelSingularApiName({ models, modelId: fieldModels[0].modelId });\n const typeDefs =\n fieldModels.length > 1\n ? `union ${gqlType} = ${getFieldModels(field)\n .map(({ modelId }) => getModelSingularApiName({ models, modelId }))\n .join(\" | \")}`\n : \"\";\n\n return {\n fields:\n field.fieldId +\n `(populate: Boolean = true): ${field.list ? `[${gqlType}!]` : gqlType}`,\n typeDefs\n };\n }\n\n public createListFilters({ field }: CmsModelFieldToGraphQL.ListFiltersParams): string {\n return createListFilters(field.fieldId);\n }\n\n public createResolver({\n field,\n models\n }: CmsModelFieldToGraphQL.ResolverParams): CmsModelFieldToGraphQL.Resolver {\n const fieldModels = field.settings?.models || [];\n for (const item of fieldModels) {\n modelIdToTypeName.set(\n item.modelId,\n getModelSingularApiName({ models, modelId: item.modelId })\n );\n }\n\n const getValue = (parent: any): RefFieldValue | RefFieldValue[] => {\n if (parent.values) {\n return parent.values[field.fieldId];\n }\n return parent[field.fieldId];\n };\n\n /* @ts-expect-error Mixed return types for createResolver. */\n return async (parent: CmsEntry, args: any, context: CmsContext) => {\n const { cms, container } = context;\n\n const getModel = container.resolve(GetModelUseCase);\n const getPublishedByIds = container.resolve(GetPublishedEntriesByIdsUseCase);\n const getLatestByIds = container.resolve(GetLatestEntriesByIdsUseCase);\n\n const initialValue = getValue(parent);\n\n if (!initialValue) {\n return null;\n }\n if (args.populate === false) {\n return initialValue;\n }\n\n if (field.list) {\n const referenceFieldValues = initialValue as RefFieldValue[];\n if (\n Array.isArray(referenceFieldValues) === false ||\n referenceFieldValues.length === 0\n ) {\n return [];\n }\n\n const entriesByModel = referenceFieldValues.reduce(\n (collection, ref) => {\n if (!collection[ref.modelId]) {\n collection[ref.modelId] = [];\n } else if (collection[ref.modelId].includes(ref.entryId) === true) {\n return collection;\n }\n collection[ref.modelId].push(ref.entryId);\n return collection;\n },\n {} as Record<string, string[]>\n );\n\n const getters = Object.keys(entriesByModel).map(async modelId => {\n const idList = entriesByModel[modelId];\n const modelResult = await getModel.execute(modelId);\n const model = modelResult.value;\n\n let entries: CmsEntry[];\n if (cms.READ) {\n const getPublishedResult = await getPublishedByIds.execute(model, idList);\n entries = getPublishedResult.value;\n } else {\n const latestByIsResult = await getLatestByIds.execute(model, idList);\n entries = latestByIsResult.value;\n }\n return appendTypename(entries, modelIdToTypeName.get(modelId)!);\n });\n\n const references = await Promise.all(getters).then((results: CmsEntry[][]) => {\n return results.reduce((result, item) => {\n return result.concat(item);\n }, []);\n });\n\n return referenceFieldValues\n .map(v => {\n return references.find(ref => ref.entryId === v.entryId);\n })\n .filter(Boolean);\n }\n\n const value = initialValue as RefFieldValue;\n const modelResult = await getModel.execute(value.modelId);\n const model = modelResult.value;\n\n let revisions: CmsEntry[];\n if (cms.READ) {\n const publishedByIdsResult = await getPublishedByIds.execute(model, [\n value.entryId\n ]);\n revisions = publishedByIdsResult.value;\n } else {\n const latestByIdsResult = await getLatestByIds.execute(model, [value.entryId]);\n revisions = latestByIdsResult.value;\n }\n\n if (!revisions || revisions.length === 0) {\n return null;\n }\n return {\n ...revisions[0],\n __typename: modelIdToTypeName.get(value.modelId)\n };\n };\n }\n\n public createSchema(): GraphQLSchemaDefinition<CmsContext> {\n return {\n typeDefs: createFilteringTypeDef(),\n resolvers: {}\n };\n }\n}\n\nclass ManageApi implements CmsModelFieldToGraphQL.ManageApi {\n public createTypeField({ field }: CmsModelFieldToGraphQL.TypeFieldParams): string {\n if (field.list) {\n return `${field.fieldId}: [RefField!]`;\n }\n return `${field.fieldId}: RefField`;\n }\n\n public createInputField({ field }: CmsModelFieldToGraphQL.TypeFieldParams): string {\n return createGraphQLInputField(field, \"RefFieldInput\");\n }\n\n public createListFilters({ field }: CmsModelFieldToGraphQL.ListFiltersParams): string {\n return createListFilters(field.fieldId);\n }\n\n public createSchema(): GraphQLSchemaDefinition<CmsContext> {\n return {\n typeDefs: /* GraphQL */ `\n type RefField {\n modelId: String!\n entryId: ID!\n id: ID!\n }\n\n input RefFieldInput {\n modelId: String!\n id: RevisionId!\n }\n\n ${createFilteringTypeDef()}\n `,\n resolvers: {\n RefField: {\n entryId: (parent: RefFieldValue) => {\n const { id } = parseIdentifier(parent.entryId || parent.id);\n return id;\n },\n id: (parent: RefFieldValue) => {\n return parent.id || parent.entryId;\n }\n }\n }\n };\n }\n}\n\nclass RefToGraphQL implements CmsModelFieldToGraphQL.Interface {\n public readonly read = new ReadApi();\n public readonly manage = new ManageApi();\n\n public readonly fieldType: CmsModelFieldType = \"ref\";\n public readonly isSearchable: boolean = true;\n public readonly isSortable: boolean = false;\n public readonly isFullTextSearchable: boolean = false;\n\n public getReadApi(): CmsModelFieldToGraphQL.ReadApi {\n return this.read;\n }\n\n public getManageApi(): CmsModelFieldToGraphQL.ManageApi {\n return this.manage;\n }\n}\n\nexport const RefFieldToGraphQL = CmsModelFieldToGraphQL.createImplementation({\n implementation: RefToGraphQL,\n dependencies: []\n});\n"],"names":["createUnionTypeName","model","field","createTypeName","createListFilters","fieldId","createFilteringTypeDef","appendTypename","entries","typename","item","getFieldModels","Array","modelIdToTypeName","Map","getModel","params","models","modelId","WebinyError","getModelSingularApiName","ReadApi","fieldModels","gqlType","typeDefs","getValue","parent","args","context","cms","container","GetModelUseCase","getPublishedByIds","GetPublishedEntriesByIdsUseCase","getLatestByIds","GetLatestEntriesByIdsUseCase","initialValue","referenceFieldValues","entriesByModel","collection","ref","getters","Object","idList","modelResult","getPublishedResult","latestByIsResult","references","Promise","results","result","v","Boolean","value","revisions","publishedByIdsResult","latestByIdsResult","ManageApi","createGraphQLInputField","id","parseIdentifier","RefToGraphQL","RefFieldToGraphQL","CmsModelFieldToGraphQL"],"mappings":";;;;;;;;AA2BA,MAAMA,sBAAsB,CAACC,OAAiBC,QACnC,GAAGD,MAAM,eAAe,CAAC,CAAC,EAAEE,eAAeD,MAAM,OAAO,GAAG;AAGtE,MAAME,oBAAoB,CAACC,UAChB,CAAC;QACJ,EAAEA,QAAQ;IACd,CAAC;AAGL,MAAMC,yBAAyB,IACpB,CAAC;;;;;;;;;;;;;;;IAeR,CAAC;AAGL,MAAMC,iBAAiB,CAACC,SAAqBC,WAClCD,QAAQ,GAAG,CAACE,CAAAA,OACR;YACH,GAAGA,IAAI;YACP,YAAYD;QAChB;AAIR,MAAME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IACzE,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/graphql/fields/base/RefToGraphQL.js","sources":["../../../../../src/features/graphql/fields/base/RefToGraphQL.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsModelFieldToGraphQL } from \"../abstractions/CmsModelFieldToGraphQL.js\";\nimport type {\n CmsContext,\n CmsEntry,\n CmsModel,\n CmsModelField,\n CmsModelFieldType,\n CmsModelFieldDefinition\n} from \"~/types/index.js\";\nimport type { GraphQLSchemaDefinition } from \"@webiny/api-graphql/types.js\";\nimport { createTypeName } from \"~/utils/createTypeName.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { createGraphQLInputField } from \"./utils/createGraphQLInputField.js\";\nimport { HeadlessCms } from \"~/features/shared/abstractions.js\";\nimport { GetModelUseCase } from \"~/features/contentModel/GetModel/index.js\";\nimport { GetPublishedEntriesByIdsUseCase } from \"~/features/contentEntry/GetPublishedEntriesByIds/index.js\";\nimport { GetLatestEntriesByIdsUseCase } from \"~/features/contentEntry/GetLatestEntriesByIds/index.js\";\n\ninterface RefFieldValue {\n /**\n * `id` is optional for backwards compatibility with records created before this property was introduced.\n */\n id?: string;\n entryId: string;\n modelId: string;\n}\n\nconst createUnionTypeName = (model: CmsModel, field: CmsModelField) => {\n return `${model.singularApiName}_${createTypeName(field.fieldId)}`;\n};\n\nconst createListFilters = (fieldId: string): string => {\n return `\n ${fieldId}: RefFieldWhereInput\n `;\n};\n\nconst createFilteringTypeDef = () => {\n return `\n input RefFieldWhereInput {\n id: String\n id_not: String\n id_in: [String!]\n id_not_in: [String]\n entryId: String\n entryId_not: String\n entryId_in: [String!]\n entryId_not_in: [String!]\n modelId: String\n modelId_not: String\n modelId_in: [String!]\n modelId_not_in: [String!]\n }\n `;\n};\n\nconst appendTypename = (entries: CmsEntry[], typename: string): CmsEntry[] => {\n return entries.map(item => {\n return {\n ...item,\n __typename: typename\n };\n });\n};\n\nconst getFieldModels = (field: CmsModelField): Pick<CmsModel, \"modelId\">[] => {\n if (!field.settings || Array.isArray(field.settings.models) === false) {\n return [];\n }\n return field.settings.models as Pick<CmsModel, \"modelId\">[];\n};\n\nconst modelIdToTypeName = new Map<string, string>();\n\ninterface GetModelParams {\n models: CmsModel[];\n modelId: string;\n}\n\nconst getModel = (params: GetModelParams): CmsModel => {\n const { models, modelId } = params;\n const model = models.find(item => item.modelId === modelId);\n if (model) {\n return model;\n }\n throw new WebinyError(\n `Could not find model with ID \"${modelId}\" in the list of models.`,\n \"MODEL_NOT_FOUND\",\n { modelId }\n );\n};\n\nconst getModelSingularApiName = (params: GetModelParams): string => {\n return getModel(params).singularApiName;\n};\n\nclass ReadApi implements CmsModelFieldToGraphQL.ReadApi {\n public createTypeField({\n model,\n field,\n models\n }: CmsModelFieldToGraphQL.TypeFieldParams): CmsModelFieldDefinition {\n const fieldModels = field.settings?.models || [];\n const gqlType =\n fieldModels.length > 1\n ? createUnionTypeName(model, field)\n : getModelSingularApiName({ models, modelId: fieldModels[0].modelId });\n const typeDefs =\n fieldModels.length > 1\n ? `union ${gqlType} = ${getFieldModels(field)\n .map(({ modelId }) => getModelSingularApiName({ models, modelId }))\n .join(\" | \")}`\n : \"\";\n\n return {\n fields:\n field.fieldId +\n `(populate: Boolean = true): ${field.list ? `[${gqlType}!]` : gqlType}`,\n typeDefs\n };\n }\n\n public createListFilters({ field }: CmsModelFieldToGraphQL.ListFiltersParams): string {\n return createListFilters(field.fieldId);\n }\n\n public createResolver({\n field,\n models\n }: CmsModelFieldToGraphQL.ResolverParams): CmsModelFieldToGraphQL.Resolver {\n const fieldModels = field.settings?.models || [];\n for (const item of fieldModels) {\n modelIdToTypeName.set(\n item.modelId,\n getModelSingularApiName({ models, modelId: item.modelId })\n );\n }\n\n const getValue = (parent: any): RefFieldValue | RefFieldValue[] => {\n if (parent.values) {\n return parent.values[field.fieldId];\n }\n return parent[field.fieldId];\n };\n\n return async (parent: CmsEntry, args: any, context: CmsContext) => {\n const { container } = context;\n const cms = container.resolve(HeadlessCms);\n\n const getModel = container.resolve(GetModelUseCase);\n const getPublishedByIds = container.resolve(GetPublishedEntriesByIdsUseCase);\n const getLatestByIds = container.resolve(GetLatestEntriesByIdsUseCase);\n\n const initialValue = getValue(parent);\n\n if (!initialValue) {\n return null;\n }\n if (args.populate === false) {\n return initialValue;\n }\n\n if (field.list) {\n const referenceFieldValues = initialValue as RefFieldValue[];\n if (\n Array.isArray(referenceFieldValues) === false ||\n referenceFieldValues.length === 0\n ) {\n return [];\n }\n\n const entriesByModel = referenceFieldValues.reduce(\n (collection, ref) => {\n if (!collection[ref.modelId]) {\n collection[ref.modelId] = [];\n } else if (collection[ref.modelId].includes(ref.entryId) === true) {\n return collection;\n }\n collection[ref.modelId].push(ref.entryId);\n return collection;\n },\n {} as Record<string, string[]>\n );\n\n const getters = Object.keys(entriesByModel).map(async modelId => {\n const idList = entriesByModel[modelId];\n const modelResult = await getModel.execute(modelId);\n const model = modelResult.value;\n\n let entries: CmsEntry[];\n if (cms.READ) {\n const getPublishedResult = await getPublishedByIds.execute(model, idList);\n entries = getPublishedResult.value;\n } else {\n const latestByIsResult = await getLatestByIds.execute(model, idList);\n entries = latestByIsResult.value;\n }\n return appendTypename(entries, modelIdToTypeName.get(modelId)!);\n });\n\n const references = await Promise.all(getters).then((results: CmsEntry[][]) => {\n return results.reduce((result, item) => {\n return result.concat(item);\n }, []);\n });\n\n return referenceFieldValues\n .map(v => {\n return references.find(ref => ref.entryId === v.entryId);\n })\n .filter(Boolean);\n }\n\n const value = initialValue as RefFieldValue;\n const modelResult = await getModel.execute(value.modelId);\n const model = modelResult.value;\n\n let revisions: CmsEntry[];\n if (cms.READ) {\n const publishedByIdsResult = await getPublishedByIds.execute(model, [\n value.entryId\n ]);\n revisions = publishedByIdsResult.value;\n } else {\n const latestByIdsResult = await getLatestByIds.execute(model, [value.entryId]);\n revisions = latestByIdsResult.value;\n }\n\n if (!revisions || revisions.length === 0) {\n return null;\n }\n return {\n ...revisions[0],\n __typename: modelIdToTypeName.get(value.modelId)\n };\n };\n }\n\n public createSchema(): GraphQLSchemaDefinition<CmsContext> {\n return {\n typeDefs: createFilteringTypeDef(),\n resolvers: {}\n };\n }\n}\n\nclass ManageApi implements CmsModelFieldToGraphQL.ManageApi {\n public createTypeField({ field }: CmsModelFieldToGraphQL.TypeFieldParams): string {\n if (field.list) {\n return `${field.fieldId}: [RefField!]`;\n }\n return `${field.fieldId}: RefField`;\n }\n\n public createInputField({ field }: CmsModelFieldToGraphQL.TypeFieldParams): string {\n return createGraphQLInputField(field, \"RefFieldInput\");\n }\n\n public createListFilters({ field }: CmsModelFieldToGraphQL.ListFiltersParams): string {\n return createListFilters(field.fieldId);\n }\n\n public createSchema(): GraphQLSchemaDefinition<CmsContext> {\n return {\n typeDefs: /* GraphQL */ `\n type RefField {\n modelId: String!\n entryId: ID!\n id: ID!\n }\n\n input RefFieldInput {\n modelId: String!\n id: RevisionId!\n }\n\n ${createFilteringTypeDef()}\n `,\n resolvers: {\n RefField: {\n entryId: (parent: RefFieldValue) => {\n const { id } = parseIdentifier(parent.entryId || parent.id);\n return id;\n },\n id: (parent: RefFieldValue) => {\n return parent.id || parent.entryId;\n }\n }\n }\n };\n }\n}\n\nclass RefToGraphQL implements CmsModelFieldToGraphQL.Interface {\n public readonly read = new ReadApi();\n public readonly manage = new ManageApi();\n\n public readonly fieldType: CmsModelFieldType = \"ref\";\n public readonly isSearchable: boolean = true;\n public readonly isSortable: boolean = false;\n public readonly isFullTextSearchable: boolean = false;\n\n public getReadApi(): CmsModelFieldToGraphQL.ReadApi {\n return this.read;\n }\n\n public getManageApi(): CmsModelFieldToGraphQL.ManageApi {\n return this.manage;\n }\n}\n\nexport const RefFieldToGraphQL = CmsModelFieldToGraphQL.createImplementation({\n implementation: RefToGraphQL,\n dependencies: []\n});\n"],"names":["createUnionTypeName","model","field","createTypeName","createListFilters","fieldId","createFilteringTypeDef","appendTypename","entries","typename","item","getFieldModels","Array","modelIdToTypeName","Map","getModel","params","models","modelId","WebinyError","getModelSingularApiName","ReadApi","fieldModels","gqlType","typeDefs","getValue","parent","args","context","container","cms","HeadlessCms","GetModelUseCase","getPublishedByIds","GetPublishedEntriesByIdsUseCase","getLatestByIds","GetLatestEntriesByIdsUseCase","initialValue","referenceFieldValues","entriesByModel","collection","ref","getters","Object","idList","modelResult","getPublishedResult","latestByIsResult","references","Promise","results","result","v","Boolean","value","revisions","publishedByIdsResult","latestByIdsResult","ManageApi","createGraphQLInputField","id","parseIdentifier","RefToGraphQL","RefFieldToGraphQL","CmsModelFieldToGraphQL"],"mappings":";;;;;;;;;AA4BA,MAAMA,sBAAsB,CAACC,OAAiBC,QACnC,GAAGD,MAAM,eAAe,CAAC,CAAC,EAAEE,eAAeD,MAAM,OAAO,GAAG;AAGtE,MAAME,oBAAoB,CAACC,UAChB,CAAC;QACJ,EAAEA,QAAQ;IACd,CAAC;AAGL,MAAMC,yBAAyB,IACpB,CAAC;;;;;;;;;;;;;;;IAeR,CAAC;AAGL,MAAMC,iBAAiB,CAACC,SAAqBC,WAClCD,QAAQ,GAAG,CAACE,CAAAA,OACR;YACH,GAAGA,IAAI;YACP,YAAYD;QAChB;AAIR,MAAME,iBAAiB,CAACT;IACpB,IAAI,CAACA,MAAM,QAAQ,IAAIU,AAAyC,UAAzCA,MAAM,OAAO,CAACV,MAAM,QAAQ,CAAC,MAAM,GACtD,OAAO,EAAE;IAEb,OAAOA,MAAM,QAAQ,CAAC,MAAM;AAChC;AAEA,MAAMW,oBAAoB,IAAIC;AAO9B,MAAMC,wBAAW,CAACC;IACd,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGF;IAC5B,MAAMf,QAAQgB,OAAO,IAAI,CAACP,CAAAA,OAAQA,KAAK,OAAO,KAAKQ;IACnD,IAAIjB,OACA,OAAOA;IAEX,MAAM,IAAIkB,MACN,CAAC,8BAA8B,EAAED,QAAQ,wBAAwB,CAAC,EAClE,mBACA;QAAEA;IAAQ;AAElB;AAE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AK,EAA0C,EAAU;QAC/E,OAAOyD,wBAAwBzD,OAAO;IAC1C;IAEO,kBAAkB,EAAEA,KAAK,EAA4C,EAAU;QAClF,OAAOE,kBAAkBF,MAAM,OAAO;IAC1C;IAEO,eAAoD;QACvD,OAAO;YACH,UAAwB,CAAC;;;;;;;;;;;;gBAYrB,EAAEI,yBAAyB;YAC/B,CAAC;YACD,WAAW;gBACP,UAAU;oBACN,SAAS,CAACoB;wBACN,MAAM,EAAEkC,EAAE,EAAE,GAAGC,gBAAgBnC,OAAO,OAAO,IAAIA,OAAO,EAAE;wBAC1D,OAAOkC;oBACX;oBACA,IAAI,CAAClC,SACMA,OAAO,EAAE,IAAIA,OAAO,OAAO;gBAE1C;YACJ;QACJ;IACJ;AACJ;AAEA,MAAMoC;IASK,aAA6C;QAChD,OAAO,IAAI,CAAC,IAAI;IACpB;IAEO,eAAiD;QACpD,OAAO,IAAI,CAAC,MAAM;IACtB;;aAdgB,IAAI,GAAG,IAAIzC;aACX,MAAM,GAAG,IAAIqC;aAEb,SAAS,GAAsB;aAC/B,YAAY,GAAY;aACxB,UAAU,GAAY;aACtB,oBAAoB,GAAY;;AASpD;AAEO,MAAMK,oBAAoBC,uBAAuB,oBAAoB,CAAC;IACzE,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
@@ -1,4 +1,4 @@
1
- import type { GraphQLFieldResolver } from "@webiny/handler-graphql/types.js";
1
+ import type { GraphQLFieldResolver } from "@webiny/api-graphql/types.js";
2
2
  import type { CmsModelField } from "../../../../../types/index.js";
3
3
  interface ResolverArgs {
4
4
  format?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"features/graphql/fields/base/richText/richTextResolver.js","sources":["../../../../../../src/features/graphql/fields/base/richText/richTextResolver.ts"],"sourcesContent":["import type { GraphQLFieldResolver } from \"@webiny/handler-graphql/types.js\";\nimport type { CmsModelField } from \"~/types/index.js\";\n\ninterface ResolverArgs {\n format?: string;\n}\n\ninterface RichTextContents {\n state: string;\n html: string;\n}\n\nexport const createRichTextResolver = (\n field: CmsModelField\n): GraphQLFieldResolver<any, ResolverArgs> => {\n return async (entry, args) => {\n const rawValue = entry[field.fieldId] as RichTextContents;\n const outputFormat = args.format;\n\n /* If `lexical` state is requested explicitly. */\n if (outputFormat === \"lexical\") {\n if (field.list) {\n return (rawValue as unknown as RichTextContents[]).map(value => value.state);\n }\n return rawValue?.state ?? null;\n }\n\n /* Otherwise return HTML. */\n if (field.list) {\n return (rawValue as unknown as RichTextContents[]).map(value => value?.html ?? null);\n }\n\n return rawValue?.html ?? null;\n };\n};\n"],"names":["createRichTextResolver","field","entry","args","rawValue","outputFormat","value"],"mappings":"AAYO,MAAMA,yBAAyB,CAClCC,QAEO,OAAOC,OAAOC;QACjB,MAAMC,WAAWF,KAAK,CAACD,MAAM,OAAO,CAAC;QACrC,MAAMI,eAAeF,KAAK,MAAM;QAGhC,IAAIE,AAAiB,cAAjBA,cAA4B;YAC5B,IAAIJ,MAAM,IAAI,EACV,OAAQG,SAA2C,GAAG,CAACE,CAAAA,QAASA,MAAM,KAAK;YAE/E,OAAOF,UAAU,SAAS;QAC9B;QAGA,IAAIH,MAAM,IAAI,EACV,OAAQG,SAA2C,GAAG,CAACE,CAAAA,QAASA,OAAO,QAAQ;QAGnF,OAAOF,UAAU,QAAQ;IAC7B"}
1
+ {"version":3,"file":"features/graphql/fields/base/richText/richTextResolver.js","sources":["../../../../../../src/features/graphql/fields/base/richText/richTextResolver.ts"],"sourcesContent":["import type { GraphQLFieldResolver } from \"@webiny/api-graphql/types.js\";\nimport type { CmsModelField } from \"~/types/index.js\";\n\ninterface ResolverArgs {\n format?: string;\n}\n\ninterface RichTextContents {\n state: string;\n html: string;\n}\n\nexport const createRichTextResolver = (\n field: CmsModelField\n): GraphQLFieldResolver<any, ResolverArgs> => {\n return async (entry, args) => {\n const rawValue = entry[field.fieldId] as RichTextContents;\n const outputFormat = args.format;\n\n /* If `lexical` state is requested explicitly. */\n if (outputFormat === \"lexical\") {\n if (field.list) {\n return (rawValue as unknown as RichTextContents[]).map(value => value.state);\n }\n return rawValue?.state ?? null;\n }\n\n /* Otherwise return HTML. */\n if (field.list) {\n return (rawValue as unknown as RichTextContents[]).map(value => value?.html ?? null);\n }\n\n return rawValue?.html ?? null;\n };\n};\n"],"names":["createRichTextResolver","field","entry","args","rawValue","outputFormat","value"],"mappings":"AAYO,MAAMA,yBAAyB,CAClCC,QAEO,OAAOC,OAAOC;QACjB,MAAMC,WAAWF,KAAK,CAACD,MAAM,OAAO,CAAC;QACrC,MAAMI,eAAeF,KAAK,MAAM;QAGhC,IAAIE,AAAiB,cAAjBA,cAA4B;YAC5B,IAAIJ,MAAM,IAAI,EACV,OAAQG,SAA2C,GAAG,CAACE,CAAAA,QAASA,MAAM,KAAK;YAE/E,OAAOF,UAAU,SAAS;QAC9B;QAGA,IAAIH,MAAM,IAAI,EACV,OAAQG,SAA2C,GAAG,CAACE,CAAAA,QAASA,OAAO,QAAQ;QAGnF,OAAOF,UAAU,QAAQ;IAC7B"}
@@ -1,4 +1,4 @@
1
- import type { CmsModelField, CmsModelLayoutCell, FieldRule } from "../../../types/index.js";
1
+ import type { CmsModelField, CmsModelLayoutCell } from "../../../types/index.js";
2
2
  export interface DataFieldBuildResult {
3
3
  type: "data";
4
4
  field: CmsModelField;
@@ -15,7 +15,6 @@ export interface BaseFieldBuilderConfig {
15
15
  description?: string | null;
16
16
  note?: string | null;
17
17
  _fieldId?: string;
18
- rules?: FieldRule[];
19
18
  }
20
19
  /**
21
20
  * Minimal shared base class for all field builders (data and layout).
@@ -31,7 +30,6 @@ export declare abstract class BaseFieldBuilder<TType extends string = string> {
31
30
  description(text: string): this;
32
31
  note(text: string): this;
33
32
  fieldId(id: string): this;
34
- rules(rules: FieldRule[]): this;
35
33
  protected setSubType(subType: string): this;
36
34
  /**
37
35
  * Build the final field result.
@@ -31,10 +31,6 @@ class BaseFieldBuilder {
31
31
  this.config._fieldId = id;
32
32
  return this;
33
33
  }
34
- rules(rules) {
35
- this.config.rules = rules;
36
- return this;
37
- }
38
34
  setSubType(subType) {
39
35
  this._fieldSubType = subType;
40
36
  return this;
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/fields/BaseFieldBuilder.js","sources":["../../../../src/features/modelBuilder/fields/BaseFieldBuilder.ts"],"sourcesContent":["import type { CmsModelField, CmsModelLayoutCell, FieldRule } from \"~/types/index.js\";\n\nexport interface DataFieldBuildResult {\n type: \"data\";\n field: CmsModelField;\n}\n\nexport interface LayoutFieldBuildResult {\n type: \"layout\";\n layoutCell: CmsModelLayoutCell;\n fields?: CmsModelField[];\n}\n\nexport type FieldBuildResult = DataFieldBuildResult | LayoutFieldBuildResult;\n\nexport interface BaseFieldBuilderConfig {\n label: string;\n help?: string | null;\n description?: string | null;\n note?: string | null;\n _fieldId?: string;\n rules?: FieldRule[];\n}\n\n/**\n * Minimal shared base class for all field builders (data and layout).\n */\nexport abstract class BaseFieldBuilder<TType extends string = string> {\n public readonly type: TType;\n private _fieldSubType?: string;\n protected config: BaseFieldBuilderConfig;\n\n public get subType(): string | undefined {\n return this._fieldSubType;\n }\n\n public constructor(type: TType, label?: string) {\n this.type = type;\n this.config = {\n label: label || \"\",\n help: null,\n description: null,\n note: null\n };\n }\n\n public label(text: string): this {\n this.config.label = text;\n return this;\n }\n\n public help(text: string): this {\n this.config.help = text;\n return this;\n }\n\n public description(text: string): this {\n this.config.description = text;\n return this;\n }\n\n public note(text: string): this {\n this.config.note = text;\n return this;\n }\n\n public fieldId(id: string): this {\n this.config._fieldId = id;\n return this;\n }\n\n public rules(rules: FieldRule[]): this {\n this.config.rules = rules;\n return this;\n }\n\n protected setSubType(subType: string): this {\n this._fieldSubType = subType;\n return this;\n }\n\n /**\n * Build the final field result.\n * @internal\n */\n public abstract build(): FieldBuildResult;\n}\n"],"names":["BaseFieldBuilder","type","label","text","id","rules","subType"],"mappings":"AA2BO,MAAeA;IAKlB,IAAW,UAA8B;QACrC,OAAO,IAAI,CAAC,aAAa;IAC7B;IAEA,YAAmBC,IAAW,EAAEC,KAAc,CAAE;QAC5C,IAAI,CAAC,IAAI,GAAGD;QACZ,IAAI,CAAC,MAAM,GAAG;YACV,OAAOC,SAAS;YAChB,MAAM;YACN,aAAa;YACb,MAAM;QACV;IACJ;IAEO,MAAMC,IAAY,EAAQ;QAC7B,IAAI,CAAC,MAAM,CAAC,KAAK,GAAGA;QACpB,OAAO,IAAI;IACf;IAEO,KAAKA,IAAY,EAAQ;QAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,GAAGA;QACnB,OAAO,IAAI;IACf;IAEO,YAAYA,IAAY,EAAQ;QACnC,IAAI,CAAC,MAAM,CAAC,WAAW,GAAGA;QAC1B,OAAO,IAAI;IACf;IAEO,KAAKA,IAAY,EAAQ;QAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,GAAGA;QACnB,OAAO,IAAI;IACf;IAEO,QAAQC,EAAU,EAAQ;QAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAGA;QACvB,OAAO,IAAI;IACf;IAEO,MAAMC,KAAkB,EAAQ;QACnC,IAAI,CAAC,MAAM,CAAC,KAAK,GAAGA;QACpB,OAAO,IAAI;IACf;IAEU,WAAWC,OAAe,EAAQ;QACxC,IAAI,CAAC,aAAa,GAAGA;QACrB,OAAO,IAAI;IACf;AAOJ"}
1
+ {"version":3,"file":"features/modelBuilder/fields/BaseFieldBuilder.js","sources":["../../../../src/features/modelBuilder/fields/BaseFieldBuilder.ts"],"sourcesContent":["import type { CmsModelField, CmsModelLayoutCell } from \"~/types/index.js\";\n\nexport interface DataFieldBuildResult {\n type: \"data\";\n field: CmsModelField;\n}\n\nexport interface LayoutFieldBuildResult {\n type: \"layout\";\n layoutCell: CmsModelLayoutCell;\n fields?: CmsModelField[];\n}\n\nexport type FieldBuildResult = DataFieldBuildResult | LayoutFieldBuildResult;\n\nexport interface BaseFieldBuilderConfig {\n label: string;\n help?: string | null;\n description?: string | null;\n note?: string | null;\n _fieldId?: string;\n}\n\n/**\n * Minimal shared base class for all field builders (data and layout).\n */\nexport abstract class BaseFieldBuilder<TType extends string = string> {\n public readonly type: TType;\n private _fieldSubType?: string;\n protected config: BaseFieldBuilderConfig;\n\n public get subType(): string | undefined {\n return this._fieldSubType;\n }\n\n public constructor(type: TType, label?: string) {\n this.type = type;\n this.config = {\n label: label || \"\",\n help: null,\n description: null,\n note: null\n };\n }\n\n public label(text: string): this {\n this.config.label = text;\n return this;\n }\n\n public help(text: string): this {\n this.config.help = text;\n return this;\n }\n\n public description(text: string): this {\n this.config.description = text;\n return this;\n }\n\n public note(text: string): this {\n this.config.note = text;\n return this;\n }\n\n public fieldId(id: string): this {\n this.config._fieldId = id;\n return this;\n }\n\n protected setSubType(subType: string): this {\n this._fieldSubType = subType;\n return this;\n }\n\n /**\n * Build the final field result.\n * @internal\n */\n public abstract build(): FieldBuildResult;\n}\n"],"names":["BaseFieldBuilder","type","label","text","id","subType"],"mappings":"AA0BO,MAAeA;IAKlB,IAAW,UAA8B;QACrC,OAAO,IAAI,CAAC,aAAa;IAC7B;IAEA,YAAmBC,IAAW,EAAEC,KAAc,CAAE;QAC5C,IAAI,CAAC,IAAI,GAAGD;QACZ,IAAI,CAAC,MAAM,GAAG;YACV,OAAOC,SAAS;YAChB,MAAM;YACN,aAAa;YACb,MAAM;QACV;IACJ;IAEO,MAAMC,IAAY,EAAQ;QAC7B,IAAI,CAAC,MAAM,CAAC,KAAK,GAAGA;QACpB,OAAO,IAAI;IACf;IAEO,KAAKA,IAAY,EAAQ;QAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,GAAGA;QACnB,OAAO,IAAI;IACf;IAEO,YAAYA,IAAY,EAAQ;QACnC,IAAI,CAAC,MAAM,CAAC,WAAW,GAAGA;QAC1B,OAAO,IAAI;IACf;IAEO,KAAKA,IAAY,EAAQ;QAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,GAAGA;QACnB,OAAO,IAAI;IACf;IAEO,QAAQC,EAAU,EAAQ;QAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAGA;QACvB,OAAO,IAAI;IACf;IAEU,WAAWC,OAAe,EAAQ;QACxC,IAAI,CAAC,aAAa,GAAGA;QACrB,OAAO,IAAI;IACf;AAOJ"}
@@ -25,9 +25,7 @@ export interface IFieldRendererRegistry {
25
25
  dateTimeInputs: {
26
26
  fieldType: "datetime";
27
27
  settings?: {
28
- multiValue?: {
29
- addValueButtonLabel?: string;
30
- };
28
+ addItemLabel?: string;
31
29
  };
32
30
  };
33
31
  dynamicZone: {
@@ -47,9 +45,7 @@ export interface IFieldRendererRegistry {
47
45
  lexicalEditors: {
48
46
  fieldType: "rich-text";
49
47
  settings?: {
50
- multiValue?: {
51
- addValueButtonLabel?: string;
52
- };
48
+ addItemLabel?: string;
53
49
  };
54
50
  };
55
51
  textarea: {
@@ -59,9 +55,7 @@ export interface IFieldRendererRegistry {
59
55
  textareas: {
60
56
  fieldType: "long-text";
61
57
  settings: {
62
- multiValue?: {
63
- addValueButtonLabel?: string;
64
- };
58
+ addItemLabel?: string;
65
59
  };
66
60
  };
67
61
  numberInput: {
@@ -71,24 +65,26 @@ export interface IFieldRendererRegistry {
71
65
  numberInputs: {
72
66
  fieldType: "number";
73
67
  settings?: {
74
- multiValue?: {
75
- addValueButtonLabel?: string;
76
- };
68
+ addItemLabel?: string;
77
69
  };
78
70
  };
79
71
  objectAccordionSingle: {
80
72
  fieldType: "object";
81
73
  settings?: {
82
74
  open?: boolean;
75
+ container?: boolean;
76
+ itemTitle?: string;
77
+ itemDescription?: string;
83
78
  };
84
79
  };
85
80
  objectAccordionMultiple: {
86
81
  fieldType: "object";
87
82
  settings?: {
88
83
  open?: boolean;
89
- multiValue?: {
90
- addValueButtonLabel?: string;
91
- };
84
+ container?: boolean;
85
+ itemTitle?: string;
86
+ itemDescription?: string;
87
+ addItemLabel?: string;
92
88
  };
93
89
  };
94
90
  passthrough: {
@@ -140,9 +136,7 @@ export interface IFieldRendererRegistry {
140
136
  textInputs: {
141
137
  fieldType: "text";
142
138
  settings?: {
143
- multiValue?: {
144
- addValueButtonLabel?: string;
145
- };
139
+ addItemLabel?: string;
146
140
  };
147
141
  };
148
142
  file: {
@@ -157,8 +157,7 @@ class DataFieldBuilder extends BaseFieldBuilder {
157
157
  note: this.config.note || null,
158
158
  renderer: this.config.renderer || null,
159
159
  settings: this.config.settings || {},
160
- tags: this.config.tags || [],
161
- rules: this.config.rules
160
+ tags: this.config.tags || []
162
161
  }
163
162
  };
164
163
  }
@@ -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 multiValue?: {\n addValueButtonLabel?: string;\n };\n };\n };\n dynamicZone: {\n fieldType: \"dynamicZone\";\n settings?: {\n open?: boolean;\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 multiValue?: {\n addValueButtonLabel?: string;\n };\n };\n };\n textarea: {\n fieldType: \"long-text\";\n settings: undefined;\n };\n textareas: {\n fieldType: \"long-text\";\n settings: {\n multiValue?: {\n addValueButtonLabel?: string;\n };\n };\n };\n numberInput: {\n fieldType: \"number\";\n settings: undefined;\n };\n numberInputs: {\n fieldType: \"number\";\n settings?: {\n multiValue?: {\n addValueButtonLabel?: string;\n };\n };\n };\n objectAccordionSingle: {\n fieldType: \"object\";\n settings?: {\n open?: boolean;\n };\n };\n objectAccordionMultiple: {\n fieldType: \"object\";\n settings?: {\n open?: boolean;\n multiValue?: {\n addValueButtonLabel?: string;\n };\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 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 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 multiValue?: {\n addValueButtonLabel?: string;\n };\n };\n };\n file: {\n fieldType: \"file\";\n settings?: {\n imagesOnly?: boolean;\n };\n };\n files: {\n fieldType: \"file\";\n settings?: {\n imagesOnly?: boolean;\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 dropdown: \"select-box\",\n tags: \"tags\",\n textInput: \"text-input\",\n textInputs: \"text-inputs\",\n file: \"file-input\",\n files: \"file-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":";;;AA8LA,MAAMA,kBAAgE;IAClE,QAAQ;IACR,YAAY;IACZ,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,QAAQ;IACR,eAAe;IACf,gBAAgB;IAChB,UAAU;IACV,WAAW;IACX,aAAa;IACb,cAAc;IACd,uBAAuB;IACvB,yBAAyB;IACzB,aAAa;IACb,cAAc;IACd,iBAAiB;IACjB,mBAAmB;IACnB,uBAAuB;IACvB,yBAAyB;IACzB,eAAe;IACf,iBAAiB;IACjB,UAAU;IACV,MAAM;IACN,WAAW;IACX,YAAY;IACZ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AAC,UAAU,IAAIF,SAAS;QAEpE,OAAO;YACH,MAAM;YACN,OAAO;gBACH,IAAIA;gBACJA;gBACAI;gBACA,MAAM,IAAI,CAAC,YAAY;gBACvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;gBACxB,YAAY,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE;gBACxC,gBAAgB,IAAI,CAAC,MAAM,CAAC,cAAc,IAAI,EAAE;gBAChD,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI;gBAC1B,kBAAkB,IAAI,CAAC,MAAM,CAAC,gBAAgB,IAAI;oBAC9C,SAAS;oBACT,QAAQ,EAAE;gBACd;gBACA,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI;gBAC1B,aAAa,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI;gBACxC,aAAa,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI;gBACxC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI;gBAC1B,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI;gBAClC,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC;gBACnC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;gBAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;YAC5B;QACJ;IACJ;IAEQ,eAAuB;QAC3B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QACf,OAAO,IAAI,CAAC,IAAI;QAEpB,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE;IACzC;AACJ"}
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 open?: boolean;\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 open?: boolean;\n container?: boolean;\n itemTitle?: string;\n itemDescription?: string;\n };\n };\n objectAccordionMultiple: {\n fieldType: \"object\";\n settings?: {\n open?: boolean;\n container?: boolean;\n itemTitle?: string;\n itemDescription?: string;\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 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 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 file: {\n fieldType: \"file\";\n settings?: {\n imagesOnly?: boolean;\n };\n };\n files: {\n fieldType: \"file\";\n settings?: {\n imagesOnly?: boolean;\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 dropdown: \"select-box\",\n tags: \"tags\",\n textInput: \"text-input\",\n textInputs: \"text-inputs\",\n file: \"file-input\",\n files: \"file-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 }\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":";;;AAwLA,MAAMA,kBAAgE;IAClE,QAAQ;IACR,YAAY;IACZ,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,QAAQ;IACR,eAAe;IACf,gBAAgB;IAChB,UAAU;IACV,WAAW;IACX,aAAa;IACb,cAAc;IACd,uBAAuB;IACvB,yBAAyB;IACzB,aAAa;IACb,cAAc;IACd,iBAAiB;IACjB,mBAAmB;IACnB,uBAAuB;IACvB,yBAAyB;IACzB,eAAe;IACf,iBAAiB;IACjB,UAAU;IACV,MAAM;IACN,WAAW;IACX,YAAY;IACZ,MAAM;IACN,OAAO;IACP,aAAa;IACb,SAAS;IACT,QAAQ;AACZ;AAKA,SAASC,oBAAoBC,IAAY;IACrC,OAAOF,eAAe,CAACE,KAAqC,IAAIA;AACpE;AAuBO,MAAMC,yBAAwDC;IAGjE,YAAmBC,IAAW,EAAEC,KAAc,CAAE;QAC5C,KAAK,CAACD,MAAMC;QACZ,IAAI,CAAC,MAAM,GAAG;YACV,OAAOA,SAAS;YAChB,YAAY,EAAE;YACd,gBAAgB,EAAE;YAClB,MAAM;YACN,kBAAkB;gBACd,SAAS;gBACT,QAAQ,EAAE;YACd;YACA,MAAM;YACN,aAAa;YACb,aAAa;YACb,MAAM;YACN,UAAU;YACV,UAAU,CAAC;YACX,MAAM,EAAE;QACZ;IACJ;IAEA,YAAYC,IAAY,EAAQ;QAC5B,IAAI,CAAC,MAAM,CAAC,WAAW,GAAGA;QAC1B,OAAO,IAAI;IACf;IAEA,U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,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI;gBAC1B,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI;gBAClC,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC;gBACnC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;YAChC;QACJ;IACJ;IAEQ,eAAuB;QAC3B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QACf,OAAO,IAAI,CAAC,IAAI;QAEpB,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE;IACzC;AACJ"}
@@ -14,17 +14,12 @@ class DynamicZoneFieldBuilder extends DataFieldBuilder {
14
14
  template(id, config) {
15
15
  const fieldBuilders = config.fields(this.registry);
16
16
  const fields = [];
17
- const layoutReplacements = new Map();
18
17
  for (const [key, fieldBuilder] of Object.entries(fieldBuilders)){
19
18
  fieldBuilder.fieldId(key);
20
19
  const result = fieldBuilder.build();
21
- if ("layout" === result.type) {
22
- layoutReplacements.set(key, result.layoutCell);
23
- if (result.fields) fields.push(...result.fields);
24
- } else fields.push(result.field);
20
+ if ("data" === result.type) fields.push(result.field);
21
+ else if (result.fields) fields.push(...result.fields);
25
22
  }
26
- const rawLayout = config.layout || [];
27
- const layout = rawLayout.map((row)=>row.map((cell)=>layoutReplacements.get(cell) ?? cell));
28
23
  this.templates.push({
29
24
  id,
30
25
  name: config.name,
@@ -32,7 +27,7 @@ class DynamicZoneFieldBuilder extends DataFieldBuilder {
32
27
  icon: config.icon,
33
28
  description: config.description || "",
34
29
  fields,
35
- layout,
30
+ layout: config.layout || [],
36
31
  validation: []
37
32
  });
38
33
  return this;
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/fields/DynamicZoneFieldType.js","sources":["../../../../src/features/modelBuilder/fields/DynamicZoneFieldType.ts"],"sourcesContent":["import { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport { type FieldBuildResult } from \"./BaseFieldBuilder.js\";\nimport { DataFieldBuilder, type BaseFieldBuilder } from \"./FieldBuilder.js\";\nimport { type IFieldBuilderRegistry } from \"../abstractions.js\";\nimport type {\n CmsIcon,\n CmsModelField,\n CmsModelFieldValidation,\n CmsModelLayoutCell\n} from \"~/types/index.js\";\n\ninterface IDynamicZoneTemplate {\n id: string;\n name: string;\n gqlTypeName: string;\n icon: CmsIcon | undefined;\n description: string;\n fields: any[];\n layout: CmsModelLayoutCell[][];\n validation: CmsModelFieldValidation[];\n}\n\nexport interface IDynamicZoneFieldBuilder extends DataFieldBuilder<\"dynamicZone\"> {\n required(message?: string): this;\n template(\n id: string,\n config: {\n name: string;\n gqlTypeName: string;\n icon?: CmsIcon;\n description?: string;\n fields: (registry: IFieldBuilderRegistry) => Record<string, BaseFieldBuilder<any>>;\n layout?: string[][];\n }\n ): this;\n}\n\ninterface IDynamicZoneFieldBuilderTemplateConfig {\n name: string;\n gqlTypeName: string;\n icon?: CmsIcon;\n description?: string;\n fields: (registry: IFieldBuilderRegistry) => Record<string, BaseFieldBuilder<any>>;\n layout?: string[][];\n}\n\nclass DynamicZoneFieldBuilder\n extends DataFieldBuilder<\"dynamicZone\">\n implements IDynamicZoneFieldBuilder\n{\n private readonly templates: IDynamicZoneTemplate[] = [];\n\n public constructor(private registry: IFieldBuilderRegistry) {\n super(\"dynamicZone\");\n }\n\n public required(message?: string): this {\n return this.validation({\n name: \"required\",\n message: message || \"Field is required\",\n settings: {}\n });\n }\n\n public template(id: string, config: IDynamicZoneFieldBuilderTemplateConfig): this {\n const fieldBuilders = config.fields(this.registry);\n const fields: CmsModelField[] = [];\n const layoutReplacements = new Map<string, CmsModelLayoutCell>();\n\n for (const [key, fieldBuilder] of Object.entries(fieldBuilders)) {\n fieldBuilder.fieldId(key);\n const result: FieldBuildResult = (fieldBuilder as any).build();\n if (result.type === \"layout\") {\n layoutReplacements.set(key, result.layoutCell);\n if (result.fields) {\n fields.push(...result.fields);\n }\n } else {\n fields.push(result.field);\n }\n }\n\n const rawLayout: string[][] = config.layout || [];\n const layout = rawLayout.map(row => row.map(cell => layoutReplacements.get(cell) ?? cell));\n\n this.templates.push({\n id,\n name: config.name,\n gqlTypeName: config.gqlTypeName,\n icon: config.icon,\n description: config.description || \"\",\n fields,\n layout,\n validation: []\n });\n\n return this;\n }\n\n public override build() {\n // Set templates in settings before building\n this.config.settings = this.config.settings || {};\n this.config.settings.templates = this.templates;\n this.config.listValidation = [{ name: \"dynamicZone\", message: \"\" }];\n return super.build();\n }\n}\n\nclass DynamicZoneFieldTypeFactory implements IFieldTypeFactory {\n public readonly type = \"dynamicZone\";\n\n public create(registry: IFieldBuilderRegistry): IDynamicZoneFieldBuilder {\n return new DynamicZoneFieldBuilder(registry);\n }\n}\n\nexport const DynamicZoneFieldType = FieldType.createImplementation({\n implementation: DynamicZoneFieldTypeFactory,\n dependencies: []\n});\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n dynamicZone(): IDynamicZoneFieldBuilder;\n }\n}\n"],"names":["DynamicZoneFieldBuilder","DataFieldBuilder","registry","message","id","config","fieldBuilders","fields","layoutReplacements","Map","key","fieldBuilder","Object","result","rawLayout","layout","row","cell","DynamicZoneFieldTypeFactory","DynamicZoneFieldType","FieldType"],"mappings":";;AA8CA,MAAMA,gCACMC;IAKR,YAA2BC,QAA+B,CAAE;QACxD,KAAK,CAAC,qBADiBA,QAAQ,GAARA,UAAAA,IAAAA,CAFV,SAAS,GAA2B,EAAE;IAIvD;IAEO,SAASC,OAAgB,EAAQ;QACpC,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU,CAAC;QACf;IACJ;IAEO,SAASC,EAAU,EAAEC,MAA8C,EAAQ;QAC9E,MAAMC,gBAAgBD,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ;QACjD,MAAME,SAA0B,EAAE;QAClC,MAAMC,qBAAqB,IA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":"features/modelBuilder/fields/DynamicZoneFieldType.js","sources":["../../../../src/features/modelBuilder/fields/DynamicZoneFieldType.ts"],"sourcesContent":["import { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport { type FieldBuildResult } from \"./BaseFieldBuilder.js\";\nimport { DataFieldBuilder, type BaseFieldBuilder } from \"./FieldBuilder.js\";\nimport { type IFieldBuilderRegistry } from \"../abstractions.js\";\nimport type { CmsIcon, CmsModelField, CmsModelFieldValidation } from \"~/types/index.js\";\n\ninterface IDynamicZoneTemplate {\n id: string;\n name: string;\n gqlTypeName: string;\n icon: CmsIcon | undefined;\n description: string;\n fields: any[];\n layout: string[][];\n validation: CmsModelFieldValidation[];\n}\n\nexport interface IDynamicZoneFieldBuilder extends DataFieldBuilder<\"dynamicZone\"> {\n required(message?: string): this;\n template(\n id: string,\n config: {\n name: string;\n gqlTypeName: string;\n icon?: CmsIcon;\n description?: string;\n fields: (registry: IFieldBuilderRegistry) => Record<string, BaseFieldBuilder<any>>;\n layout?: string[][];\n }\n ): this;\n}\n\ninterface IDynamicZoneFieldBuilderTemplateConfig {\n name: string;\n gqlTypeName: string;\n icon?: CmsIcon;\n description?: string;\n fields: (registry: IFieldBuilderRegistry) => Record<string, BaseFieldBuilder<any>>;\n layout?: string[][];\n}\n\nclass DynamicZoneFieldBuilder\n extends DataFieldBuilder<\"dynamicZone\">\n implements IDynamicZoneFieldBuilder\n{\n private readonly templates: IDynamicZoneTemplate[] = [];\n\n public constructor(private registry: IFieldBuilderRegistry) {\n super(\"dynamicZone\");\n }\n\n public required(message?: string): this {\n return this.validation({\n name: \"required\",\n message: message || \"Field is required\",\n settings: {}\n });\n }\n\n public template(id: string, config: IDynamicZoneFieldBuilderTemplateConfig): this {\n const fieldBuilders = config.fields(this.registry);\n const fields: CmsModelField[] = [];\n\n for (const [key, fieldBuilder] of Object.entries(fieldBuilders)) {\n fieldBuilder.fieldId(key);\n const result: FieldBuildResult = (fieldBuilder as any).build();\n if (result.type === \"data\") {\n fields.push(result.field);\n } else if (result.fields) {\n fields.push(...result.fields);\n }\n }\n\n this.templates.push({\n id,\n name: config.name,\n gqlTypeName: config.gqlTypeName,\n icon: config.icon,\n description: config.description || \"\",\n fields,\n layout: config.layout || [],\n validation: []\n });\n\n return this;\n }\n\n public override build() {\n // Set templates in settings before building\n this.config.settings = this.config.settings || {};\n this.config.settings.templates = this.templates;\n this.config.listValidation = [{ name: \"dynamicZone\", message: \"\" }];\n return super.build();\n }\n}\n\nclass DynamicZoneFieldTypeFactory implements IFieldTypeFactory {\n public readonly type = \"dynamicZone\";\n\n public create(registry: IFieldBuilderRegistry): IDynamicZoneFieldBuilder {\n return new DynamicZoneFieldBuilder(registry);\n }\n}\n\nexport const DynamicZoneFieldType = FieldType.createImplementation({\n implementation: DynamicZoneFieldTypeFactory,\n dependencies: []\n});\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n dynamicZone(): IDynamicZoneFieldBuilder;\n }\n}\n"],"names":["DynamicZoneFieldBuilder","DataFieldBuilder","registry","message","id","config","fieldBuilders","fields","key","fieldBuilder","Object","result","DynamicZoneFieldTypeFactory","DynamicZoneFieldType","FieldType"],"mappings":";;AAyCA,MAAMA,gCACMC;IAKR,YAA2BC,QAA+B,CAAE;QACxD,KAAK,CAAC,qBADiBA,QAAQ,GAARA,UAAAA,IAAAA,CAFV,SAAS,GAA2B,EAAE;IAIvD;IAEO,SAASC,OAAgB,EAAQ;QACpC,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU,CAAC;QACf;IACJ;IAEO,SAASC,EAAU,EAAEC,MAA8C,EAAQ;QAC9E,MAAMC,gBAAgBD,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ;QACjD,MAAME,SAA0B,EAAE;QAElC,KAAK,MAAM,CAACC,KAAKC,aAAa,IAAIC,OAAO,OAAO,CAACJ,eAAgB;YAC7DG,aAAa,OAAO,CAACD;YACrB,MAAMG,SAA4BF,aAAqB,KAAK;YAC5D,IAAIE,AAAgB,WAAhBA,OAAO,IAAI,EACXJ,OAAO,IAAI,CAACI,OAAO,KAAK;iBACrB,IAAIA,OAAO,MAAM,EACpBJ,OAAO,IAAI,IAAII,OAAO,MAAM;QAEpC;QAEA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAChBP;YACA,MAAMC,OAAO,IAAI;YACjB,aAAaA,OAAO,WAAW;YAC/B,MAAMA,OAAO,IAAI;YACjB,aAAaA,OAAO,WAAW,IAAI;YACnCE;YACA,QAAQF,OAAO,MAAM,IAAI,EAAE;YAC3B,YAAY,EAAE;QAClB;QAEA,OAAO,IAAI;IACf;IAEgB,QAAQ;QAEpB,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS;QAC/C,IAAI,CAAC,MAAM,CAAC,cAAc,GAAG;YAAC;gBAAE,MAAM;gBAAe,SAAS;YAAG;SAAE;QACnE,OAAO,KAAK,CAAC;IACjB;AACJ;AAEA,MAAMO;IAGK,OAAOV,QAA+B,EAA4B;QACrE,OAAO,IAAIF,wBAAwBE;IACvC;;aAJgB,IAAI,GAAG;;AAK3B;AAEO,MAAMW,uBAAuBC,UAAU,oBAAoB,CAAC;IAC/D,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,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BAAuB;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,U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IACxD,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
@@ -14,8 +14,7 @@ class AlertFieldBuilder extends LayoutFieldBuilder {
14
14
  layoutCell: {
15
15
  type: "alert",
16
16
  label: this.config.label,
17
- alertType: this._alertType,
18
- rules: this.config.rules
17
+ alertType: this._alertType
19
18
  }
20
19
  };
21
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/fields/UiAlertFieldType.js","sources":["../../../../src/features/modelBuilder/fields/UiAlertFieldType.ts"],"sourcesContent":["import { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport { type LayoutFieldBuildResult } from \"./BaseFieldBuilder.js\";\nimport { LayoutFieldBuilder } from \"./LayoutFieldBuilder.js\";\n\ntype AlertType = \"info\" | \"success\" | \"warning\" | \"danger\";\n\nexport interface IUiAlertFieldBuilder extends LayoutFieldBuilder<\"uiAlert\"> {\n alertType(type: AlertType): this;\n}\n\nclass AlertFieldBuilder extends LayoutFieldBuilder<\"uiAlert\"> implements IUiAlertFieldBuilder {\n private _alertType: AlertType = \"warning\";\n\n public constructor() {\n super(\"uiAlert\");\n }\n\n public alertType(type: AlertType): this {\n this._alertType = type;\n return this;\n }\n\n public override build(): LayoutFieldBuildResult {\n return {\n type: \"layout\",\n layoutCell: {\n type: \"alert\",\n label: this.config.label,\n alertType: this._alertType,\n rules: this.config.rules\n }\n };\n }\n}\n\nclass UiAlertFieldTypeFactory implements IFieldTypeFactory {\n public readonly type = \"uiAlert\";\n\n public create(): IUiAlertFieldBuilder {\n return new AlertFieldBuilder();\n }\n}\n\nexport const UiAlertFieldType = FieldType.createImplementation({\n implementation: UiAlertFieldTypeFactory,\n dependencies: []\n});\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n uiAlert(): IUiAlertFieldBuilder;\n }\n}\n"],"names":["AlertFieldBuilder","LayoutFieldBuilder","type","UiAlertFieldTypeFactory","UiAlertFieldType","FieldType"],"mappings":";;AAUA,MAAMA,0BAA0BC;IAG5B,aAAqB;QACjB,KAAK,CAAC,iBAHF,UAAU,GAAc;IAIhC;IAEO,UAAUC,IAAe,EAAQ;QACpC,IAAI,CAAC,UAAU,GAAGA;QAClB,OAAO,IAAI;IACf;IAEgB,QAAgC;QAC5C,OAAO;YACH,MAAM;YACN,YAAY;gBACR,MAAM;gBACN,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;gBACxB,WAAW,IAAI,CAAC,UAAU;gBAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;YAC5B;QACJ;IACJ;AACJ;AAEA,MAAMC;IAGK,SAA+B;QAClC,OAAO,IAAIH;IACf;;aAJgB,IAAI,GAAG;;AAK3B;AAEO,MAAMI,mBAAmBC,UAAU,oBAAoB,CAAC;IAC3D,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/modelBuilder/fields/UiAlertFieldType.js","sources":["../../../../src/features/modelBuilder/fields/UiAlertFieldType.ts"],"sourcesContent":["import { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport { type LayoutFieldBuildResult } from \"./BaseFieldBuilder.js\";\nimport { LayoutFieldBuilder } from \"./LayoutFieldBuilder.js\";\n\ntype AlertType = \"info\" | \"success\" | \"warning\" | \"danger\";\n\nexport interface IUiAlertFieldBuilder extends LayoutFieldBuilder<\"uiAlert\"> {\n alertType(type: AlertType): this;\n}\n\nclass AlertFieldBuilder extends LayoutFieldBuilder<\"uiAlert\"> implements IUiAlertFieldBuilder {\n private _alertType: AlertType = \"warning\";\n\n public constructor() {\n super(\"uiAlert\");\n }\n\n public alertType(type: AlertType): this {\n this._alertType = type;\n return this;\n }\n\n public override build(): LayoutFieldBuildResult {\n return {\n type: \"layout\",\n layoutCell: {\n type: \"alert\",\n label: this.config.label,\n alertType: this._alertType\n }\n };\n }\n}\n\nclass UiAlertFieldTypeFactory implements IFieldTypeFactory {\n public readonly type = \"uiAlert\";\n\n public create(): IUiAlertFieldBuilder {\n return new AlertFieldBuilder();\n }\n}\n\nexport const UiAlertFieldType = FieldType.createImplementation({\n implementation: UiAlertFieldTypeFactory,\n dependencies: []\n});\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n uiAlert(): IUiAlertFieldBuilder;\n }\n}\n"],"names":["AlertFieldBuilder","LayoutFieldBuilder","type","UiAlertFieldTypeFactory","UiAlertFieldType","FieldType"],"mappings":";;AAUA,MAAMA,0BAA0BC;IAG5B,aAAqB;QACjB,KAAK,CAAC,iBAHF,UAAU,GAAc;IAIhC;IAEO,UAAUC,IAAe,EAAQ;QACpC,IAAI,CAAC,UAAU,GAAGA;QAClB,OAAO,IAAI;IACf;IAEgB,QAAgC;QAC5C,OAAO;YACH,MAAM;YACN,YAAY;gBACR,MAAM;gBACN,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;gBACxB,WAAW,IAAI,CAAC,UAAU;YAC9B;QACJ;IACJ;AACJ;AAEA,MAAMC;IAGK,SAA+B;QAClC,OAAO,IAAIH;IACf;;aAJgB,IAAI,GAAG;;AAK3B;AAEO,MAAMI,mBAAmBC,UAAU,oBAAoB,CAAC;IAC3D,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
@@ -10,8 +10,7 @@ class SeparatorFieldBuilder extends LayoutFieldBuilder {
10
10
  layoutCell: {
11
11
  type: "separator",
12
12
  label: this.config.label,
13
- description: this.config.description,
14
- rules: this.config.rules
13
+ description: this.config.description
15
14
  }
16
15
  };
17
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/fields/UiSeparatorFieldType.js","sources":["../../../../src/features/modelBuilder/fields/UiSeparatorFieldType.ts"],"sourcesContent":["import { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport { type LayoutFieldBuildResult } from \"./BaseFieldBuilder.js\";\nimport { LayoutFieldBuilder } from \"./LayoutFieldBuilder.js\";\n\nexport interface IUiSeparatorFieldBuilder extends LayoutFieldBuilder<\"uiSeparator\"> {}\n\nclass SeparatorFieldBuilder\n extends LayoutFieldBuilder<\"uiSeparator\">\n implements IUiSeparatorFieldBuilder\n{\n public constructor() {\n super(\"uiSeparator\");\n }\n\n public override build(): LayoutFieldBuildResult {\n return {\n type: \"layout\",\n layoutCell: {\n type: \"separator\",\n label: this.config.label,\n description: this.config.description,\n rules: this.config.rules\n }\n };\n }\n}\n\nclass UiSeparatorFieldTypeFactory implements IFieldTypeFactory {\n public readonly type = \"uiSeparator\";\n\n public create(): IUiSeparatorFieldBuilder {\n return new SeparatorFieldBuilder();\n }\n}\n\nexport const UiSeparatorFieldType = FieldType.createImplementation({\n implementation: UiSeparatorFieldTypeFactory,\n dependencies: []\n});\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n uiSeparator(): IUiSeparatorFieldBuilder;\n }\n}\n"],"names":["SeparatorFieldBuilder","LayoutFieldBuilder","UiSeparatorFieldTypeFactory","UiSeparatorFieldType","FieldType"],"mappings":";;AAMA,MAAMA,8BACMC;IAGR,aAAqB;QACjB,KAAK,CAAC;IACV;IAEgB,QAAgC;QAC5C,OAAO;YACH,MAAM;YACN,YAAY;gBACR,MAAM;gBACN,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;gBACxB,aAAa,IAAI,CAAC,MAAM,CAAC,WAAW;gBACpC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;YAC5B;QACJ;IACJ;AACJ;AAEA,MAAMC;IAGK,SAAmC;QACtC,OAAO,IAAIF;IACf;;aAJgB,IAAI,GAAG;;AAK3B;AAEO,MAAMG,uBAAuBC,UAAU,oBAAoB,CAAC;IAC/D,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/modelBuilder/fields/UiSeparatorFieldType.js","sources":["../../../../src/features/modelBuilder/fields/UiSeparatorFieldType.ts"],"sourcesContent":["import { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport { type LayoutFieldBuildResult } from \"./BaseFieldBuilder.js\";\nimport { LayoutFieldBuilder } from \"./LayoutFieldBuilder.js\";\n\nexport interface IUiSeparatorFieldBuilder extends LayoutFieldBuilder<\"uiSeparator\"> {}\n\nclass SeparatorFieldBuilder\n extends LayoutFieldBuilder<\"uiSeparator\">\n implements IUiSeparatorFieldBuilder\n{\n public constructor() {\n super(\"uiSeparator\");\n }\n\n public override build(): LayoutFieldBuildResult {\n return {\n type: \"layout\",\n layoutCell: {\n type: \"separator\",\n label: this.config.label,\n description: this.config.description\n }\n };\n }\n}\n\nclass UiSeparatorFieldTypeFactory implements IFieldTypeFactory {\n public readonly type = \"uiSeparator\";\n\n public create(): IUiSeparatorFieldBuilder {\n return new SeparatorFieldBuilder();\n }\n}\n\nexport const UiSeparatorFieldType = FieldType.createImplementation({\n implementation: UiSeparatorFieldTypeFactory,\n dependencies: []\n});\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n uiSeparator(): IUiSeparatorFieldBuilder;\n }\n}\n"],"names":["SeparatorFieldBuilder","LayoutFieldBuilder","UiSeparatorFieldTypeFactory","UiSeparatorFieldType","FieldType"],"mappings":";;AAMA,MAAMA,8BACMC;IAGR,aAAqB;QACjB,KAAK,CAAC;IACV;IAEgB,QAAgC;QAC5C,OAAO;YACH,MAAM;YACN,YAAY;gBACR,MAAM;gBACN,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;gBACxB,aAAa,IAAI,CAAC,MAAM,CAAC,WAAW;YACxC;QACJ;IACJ;AACJ;AAEA,MAAMC;IAGK,SAAmC;QACtC,OAAO,IAAIF;IACf;;aAJgB,IAAI,GAAG;;AAK3B;AAEO,MAAMG,uBAAuBC,UAAU,oBAAoB,CAAC;IAC/D,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
@@ -2,14 +2,13 @@ import { type IFieldTypeFactory } from "./abstractions.js";
2
2
  import { BaseFieldBuilder } from "./BaseFieldBuilder.js";
3
3
  import { LayoutFieldBuilder } from "./LayoutFieldBuilder.js";
4
4
  import { type IFieldBuilderRegistry } from "../abstractions.js";
5
- import type { CmsIcon, FieldRule } from "../../../types/index.js";
5
+ import type { CmsIcon } from "../../../types/index.js";
6
6
  interface ITabConfig {
7
7
  label: string;
8
8
  icon?: CmsIcon;
9
9
  description?: string;
10
10
  fields: (registry: IFieldBuilderRegistry) => Record<string, BaseFieldBuilder<any>>;
11
11
  layout?: string[][];
12
- rules?: FieldRule[];
13
12
  }
14
13
  export interface IUiTabsFieldBuilder extends LayoutFieldBuilder<"uiTabs"> {
15
14
  tab(id: string, config: ITabConfig): this;
@@ -24,8 +24,7 @@ class TabsFieldBuilder extends LayoutFieldBuilder {
24
24
  icon: config.icon,
25
25
  description: config.description || "",
26
26
  fields,
27
- layout,
28
- rules: config.rules
27
+ layout
29
28
  });
30
29
  return this;
31
30
  }
@@ -38,8 +37,7 @@ class TabsFieldBuilder extends LayoutFieldBuilder {
38
37
  id: tab.id,
39
38
  label: tab.label,
40
39
  icon: tab.icon || null,
41
- layout: tab.layout,
42
- rules: tab.rules
40
+ layout: tab.layout
43
41
  });
44
42
  }
45
43
  return {
@@ -49,8 +47,7 @@ class TabsFieldBuilder extends LayoutFieldBuilder {
49
47
  label: this.config.label,
50
48
  description: this.config.description || null,
51
49
  help: this.config.help || null,
52
- tabs: layoutTabs,
53
- rules: this.config.rules
50
+ tabs: layoutTabs
54
51
  },
55
52
  fields: hoistedFields
56
53
  };
@@ -1 +1 @@
1
- {"version":3,"file":"features/modelBuilder/fields/UiTabsFieldType.js","sources":["../../../../src/features/modelBuilder/fields/UiTabsFieldType.ts"],"sourcesContent":["import { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport {\n BaseFieldBuilder,\n type FieldBuildResult,\n type LayoutFieldBuildResult\n} from \"./BaseFieldBuilder.js\";\nimport { LayoutFieldBuilder } from \"./LayoutFieldBuilder.js\";\nimport { type IFieldBuilderRegistry } from \"../abstractions.js\";\nimport type {\n CmsIcon,\n CmsModelField,\n CmsModelLayout,\n CmsModelLayoutCell,\n FieldRule\n} from \"~/types/index.js\";\n\ninterface ITab {\n id: string;\n label: string;\n icon: CmsIcon | undefined;\n description: string;\n fields: CmsModelField[];\n layout: CmsModelLayout;\n rules?: FieldRule[];\n}\n\ninterface ITabConfig {\n label: string;\n icon?: CmsIcon;\n description?: string;\n fields: (registry: IFieldBuilderRegistry) => Record<string, BaseFieldBuilder<any>>;\n layout?: string[][];\n rules?: FieldRule[];\n}\n\nexport interface IUiTabsFieldBuilder extends LayoutFieldBuilder<\"uiTabs\"> {\n tab(id: string, config: ITabConfig): this;\n}\n\nclass TabsFieldBuilder extends LayoutFieldBuilder<\"uiTabs\"> implements IUiTabsFieldBuilder {\n private readonly tabs: ITab[] = [];\n\n public constructor(private registry: IFieldBuilderRegistry) {\n super(\"uiTabs\");\n }\n\n public tab(id: string, config: ITabConfig): this {\n const fieldBuilders = config.fields(this.registry);\n const fields: CmsModelField[] = [];\n const layoutReplacements = new Map<string, CmsModelLayoutCell>();\n\n for (const [key, fieldBuilder] of Object.entries(fieldBuilders)) {\n fieldBuilder.fieldId(key);\n const result: FieldBuildResult = (fieldBuilder as any).build();\n if (result.type === \"layout\") {\n layoutReplacements.set(key, result.layoutCell);\n if (result.fields) {\n fields.push(...result.fields);\n }\n } else {\n fields.push(result.field);\n }\n }\n\n const rawLayout: string[][] = config.layout || [];\n const layout: CmsModelLayout = rawLayout.map(row =>\n row.map(cell => layoutReplacements.get(cell) ?? cell)\n );\n\n this.tabs.push({\n id,\n label: config.label,\n icon: config.icon,\n description: config.description || \"\",\n fields,\n layout,\n rules: config.rules\n });\n\n return this;\n }\n\n public override build(): LayoutFieldBuildResult {\n const hoistedFields: CmsModelField[] = [];\n const layoutTabs = [];\n\n for (const tab of this.tabs) {\n hoistedFields.push(...tab.fields);\n layoutTabs.push({\n id: tab.id,\n label: tab.label,\n icon: tab.icon || null,\n layout: tab.layout,\n rules: tab.rules\n });\n }\n\n return {\n type: \"layout\",\n layoutCell: {\n type: \"tabs\",\n label: this.config.label,\n description: this.config.description || null,\n help: this.config.help || null,\n tabs: layoutTabs,\n rules: this.config.rules\n },\n fields: hoistedFields\n };\n }\n}\n\nclass TabsFieldTypeFactory implements IFieldTypeFactory {\n public readonly type = \"uiTabs\";\n\n public create(registry: IFieldBuilderRegistry): IUiTabsFieldBuilder {\n return new TabsFieldBuilder(registry);\n }\n}\n\nexport const UiTabsFieldType = FieldType.createImplementation({\n implementation: TabsFieldTypeFactory,\n dependencies: []\n});\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n uiTabs(): IUiTabsFieldBuilder;\n }\n}\n"],"names":["TabsFieldBuilder","LayoutFieldBuilder","registry","id","config","fieldBuilders","fields","layoutReplacements","Map","key","fieldBuilder","Object","result","rawLayout","layout","row","cell","hoistedFields","layoutTabs","tab","TabsFieldTypeFactory","UiTabsFieldType","FieldType"],"mappings":";;AAuCA,MAAMA,yBAAyBC;IAG3B,YAA2BC,QAA+B,CAAE;QACxD,KAAK,CAAC,gBADiBA,QAAQ,GAARA,UAAAA,IAAAA,CAFV,IAAI,GAAW,EAAE;IAIlC;IAEO,IAAIC,EAAU,EAAEC,MAAkB,EAAQ;QAC7C,MAAMC,gBAAgBD,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ;QACjD,MAAME,SAA0B,EAAE;QAClC,MAAMC,qBAAqB,IAAIC;QAE/B,KAAK,MAAM,CAACC,KAAKC,aAAa,IAAIC,OAAO,OAAO,CAACN,eAAgB;YAC7DK,aAAa,OAAO,CAACD;YACrB,MAAMG,SAA4BF,aAAqB,KAAK;YAC5D,IAAIE,AAAgB,aAAhBA,OAAO,IAAI,EAAe;gBAC1BL,mBAAmB,GAAG,CAACE,KAAKG,OAAO,UAAU;gBAC7C,IAAIA,OAAO,MAAM,EACbN,OAAO,IAAI,IAAIM,OAAO,MAAM;YAEpC,OACIN,OAAO,IAAI,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","sources":["../../../../src/features/modelBuilder/fields/UiTabsFieldType.ts"],"sourcesContent":["import { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport {\n BaseFieldBuilder,\n type FieldBuildResult,\n type LayoutFieldBuildResult\n} from \"./BaseFieldBuilder.js\";\nimport { LayoutFieldBuilder } from \"./LayoutFieldBuilder.js\";\nimport { type IFieldBuilderRegistry } from \"../abstractions.js\";\nimport type { CmsIcon, CmsModelField, CmsModelLayout, CmsModelLayoutCell } from \"~/types/index.js\";\n\ninterface ITab {\n id: string;\n label: string;\n icon: CmsIcon | undefined;\n description: string;\n fields: CmsModelField[];\n layout: CmsModelLayout;\n}\n\ninterface ITabConfig {\n label: string;\n icon?: CmsIcon;\n description?: string;\n fields: (registry: IFieldBuilderRegistry) => Record<string, BaseFieldBuilder<any>>;\n layout?: string[][];\n}\n\nexport interface IUiTabsFieldBuilder extends LayoutFieldBuilder<\"uiTabs\"> {\n tab(id: string, config: ITabConfig): this;\n}\n\nclass TabsFieldBuilder extends LayoutFieldBuilder<\"uiTabs\"> implements IUiTabsFieldBuilder {\n private readonly tabs: ITab[] = [];\n\n public constructor(private registry: IFieldBuilderRegistry) {\n super(\"uiTabs\");\n }\n\n public tab(id: string, config: ITabConfig): this {\n const fieldBuilders = config.fields(this.registry);\n const fields: CmsModelField[] = [];\n const layoutReplacements = new Map<string, CmsModelLayoutCell>();\n\n for (const [key, fieldBuilder] of Object.entries(fieldBuilders)) {\n fieldBuilder.fieldId(key);\n const result: FieldBuildResult = (fieldBuilder as any).build();\n if (result.type === \"layout\") {\n layoutReplacements.set(key, result.layoutCell);\n if (result.fields) {\n fields.push(...result.fields);\n }\n } else {\n fields.push(result.field);\n }\n }\n\n const rawLayout: string[][] = config.layout || [];\n const layout: CmsModelLayout = rawLayout.map(row =>\n row.map(cell => layoutReplacements.get(cell) ?? cell)\n );\n\n this.tabs.push({\n id,\n label: config.label,\n icon: config.icon,\n description: config.description || \"\",\n fields,\n layout\n });\n\n return this;\n }\n\n public override build(): LayoutFieldBuildResult {\n const hoistedFields: CmsModelField[] = [];\n const layoutTabs = [];\n\n for (const tab of this.tabs) {\n hoistedFields.push(...tab.fields);\n layoutTabs.push({\n id: tab.id,\n label: tab.label,\n icon: tab.icon || null,\n layout: tab.layout\n });\n }\n\n return {\n type: \"layout\",\n layoutCell: {\n type: \"tabs\",\n label: this.config.label,\n description: this.config.description || null,\n help: this.config.help || null,\n tabs: layoutTabs\n },\n fields: hoistedFields\n };\n }\n}\n\nclass TabsFieldTypeFactory implements IFieldTypeFactory {\n public readonly type = \"uiTabs\";\n\n public create(registry: IFieldBuilderRegistry): IUiTabsFieldBuilder {\n return new TabsFieldBuilder(registry);\n }\n}\n\nexport const UiTabsFieldType = FieldType.createImplementation({\n implementation: TabsFieldTypeFactory,\n dependencies: []\n});\n\n// Module augmentation for TypeScript autocomplete\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n uiTabs(): IUiTabsFieldBuilder;\n }\n}\n"],"names":["TabsFieldBuilder","LayoutFieldBuilder","registry","id","config","fieldBuilders","fields","layoutReplacements","Map","key","fieldBuilder","Object","result","rawLayout","layout","row","cell","hoistedFields","layoutTabs","tab","TabsFieldTypeFactory","UiTabsFieldType","FieldType"],"mappings":";;AA+BA,MAAMA,yBAAyBC;IAG3B,YAA2BC,QAA+B,CAAE;QACxD,KAAK,CAAC,gBADiBA,QAAQ,GAARA,UAAAA,IAAAA,CAFV,IAAI,GAAW,EAAE;IAIlC;IAEO,IAAIC,EAAU,EAAEC,MAAkB,EAAQ;QAC7C,MAAMC,gBAAgBD,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ;QACjD,MAAME,SAA0B,EAAE;QAClC,MAAMC,qBAAqB,IAAIC;QAE/B,KAAK,MAAM,CAACC,KAAKC,aAAa,IAAIC,OAAO,OAAO,CAACN,eAAgB;YAC7DK,aAAa,OAAO,CAACD;YACrB,MAAMG,SAA4BF,aAAqB,KAAK;YAC5D,IAAIE,AAAgB,aAA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