@webiny/api-headless-cms 6.0.0-alpha.0 → 6.0.0-alpha.2

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 (563) hide show
  1. package/constants.d.ts +1 -1
  2. package/constants.js.map +1 -1
  3. package/context.d.ts +1 -1
  4. package/context.js.map +1 -1
  5. package/crud/AccessControl/AccessControl.d.ts +2 -2
  6. package/crud/AccessControl/AccessControl.js.map +1 -1
  7. package/crud/contentEntry/abstractions/IDeleteEntry.d.ts +1 -1
  8. package/crud/contentEntry/abstractions/IDeleteEntry.js.map +1 -1
  9. package/crud/contentEntry/abstractions/IDeleteEntryOperation.d.ts +1 -1
  10. package/crud/contentEntry/abstractions/IDeleteEntryOperation.js.map +1 -1
  11. package/crud/contentEntry/abstractions/IGetEntriesByIds.d.ts +1 -1
  12. package/crud/contentEntry/abstractions/IGetEntriesByIds.js.map +1 -1
  13. package/crud/contentEntry/abstractions/IGetEntry.d.ts +1 -1
  14. package/crud/contentEntry/abstractions/IGetEntry.js.map +1 -1
  15. package/crud/contentEntry/abstractions/IGetLatestEntriesByIds.d.ts +1 -1
  16. package/crud/contentEntry/abstractions/IGetLatestEntriesByIds.js.map +1 -1
  17. package/crud/contentEntry/abstractions/IGetLatestRevisionByEntryId.d.ts +1 -1
  18. package/crud/contentEntry/abstractions/IGetLatestRevisionByEntryId.js.map +1 -1
  19. package/crud/contentEntry/abstractions/IGetPreviousRevisionByEntryId.d.ts +1 -1
  20. package/crud/contentEntry/abstractions/IGetPreviousRevisionByEntryId.js.map +1 -1
  21. package/crud/contentEntry/abstractions/IGetPublishedEntriesByIds.d.ts +1 -1
  22. package/crud/contentEntry/abstractions/IGetPublishedEntriesByIds.js.map +1 -1
  23. package/crud/contentEntry/abstractions/IGetPublishedRevisionByEntryId.d.ts +1 -1
  24. package/crud/contentEntry/abstractions/IGetPublishedRevisionByEntryId.js.map +1 -1
  25. package/crud/contentEntry/abstractions/IGetRevisionById.d.ts +1 -1
  26. package/crud/contentEntry/abstractions/IGetRevisionById.js.map +1 -1
  27. package/crud/contentEntry/abstractions/IGetRevisionsByEntryId.d.ts +1 -1
  28. package/crud/contentEntry/abstractions/IGetRevisionsByEntryId.js.map +1 -1
  29. package/crud/contentEntry/abstractions/IListEntries.d.ts +1 -1
  30. package/crud/contentEntry/abstractions/IListEntries.js.map +1 -1
  31. package/crud/contentEntry/abstractions/IListEntriesOperation.d.ts +1 -1
  32. package/crud/contentEntry/abstractions/IListEntriesOperation.js.map +1 -1
  33. package/crud/contentEntry/abstractions/IMoveEntryToBinOperation.d.ts +1 -1
  34. package/crud/contentEntry/abstractions/IMoveEntryToBinOperation.js.map +1 -1
  35. package/crud/contentEntry/abstractions/IRestoreEntryFromBin.d.ts +1 -1
  36. package/crud/contentEntry/abstractions/IRestoreEntryFromBin.js.map +1 -1
  37. package/crud/contentEntry/abstractions/IRestoreEntryFromBinOperation.d.ts +1 -1
  38. package/crud/contentEntry/abstractions/IRestoreEntryFromBinOperation.js.map +1 -1
  39. package/crud/contentEntry/afterDelete.d.ts +2 -2
  40. package/crud/contentEntry/afterDelete.js.map +1 -1
  41. package/crud/contentEntry/beforeCreate.d.ts +2 -2
  42. package/crud/contentEntry/beforeCreate.js.map +1 -1
  43. package/crud/contentEntry/beforeUpdate.d.ts +2 -2
  44. package/crud/contentEntry/beforeUpdate.js.map +1 -1
  45. package/crud/contentEntry/entryDataFactories/createEntryData.d.ts +5 -5
  46. package/crud/contentEntry/entryDataFactories/createEntryData.js.map +1 -1
  47. package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.d.ts +5 -5
  48. package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.js.map +1 -1
  49. package/crud/contentEntry/entryDataFactories/createPublishEntryData.d.ts +4 -4
  50. package/crud/contentEntry/entryDataFactories/createPublishEntryData.js.map +1 -1
  51. package/crud/contentEntry/entryDataFactories/createRepublishEntryData.d.ts +2 -2
  52. package/crud/contentEntry/entryDataFactories/createRepublishEntryData.js.map +1 -1
  53. package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.d.ts +4 -4
  54. package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.js.map +1 -1
  55. package/crud/contentEntry/entryDataFactories/createUpdateEntryData.d.ts +4 -4
  56. package/crud/contentEntry/entryDataFactories/createUpdateEntryData.js.map +1 -1
  57. package/crud/contentEntry/entryDataFactories/mapAndCleanUpdatedInputData.d.ts +1 -1
  58. package/crud/contentEntry/entryDataFactories/mapAndCleanUpdatedInputData.js.map +1 -1
  59. package/crud/contentEntry/entryDataValidation.d.ts +1 -1
  60. package/crud/contentEntry/entryDataValidation.js.map +1 -1
  61. package/crud/contentEntry/markLockedFields.d.ts +1 -1
  62. package/crud/contentEntry/markLockedFields.js.map +1 -1
  63. package/crud/contentEntry/referenceFieldsMapping.d.ts +1 -1
  64. package/crud/contentEntry/referenceFieldsMapping.js.map +1 -1
  65. package/crud/contentEntry/searchableFields.d.ts +2 -2
  66. package/crud/contentEntry/searchableFields.js.map +1 -1
  67. package/crud/contentEntry/useCases/DeleteEntry/DeleteEntry.d.ts +3 -3
  68. package/crud/contentEntry/useCases/DeleteEntry/DeleteEntry.js.map +1 -1
  69. package/crud/contentEntry/useCases/DeleteEntry/DeleteEntryOperation.d.ts +2 -2
  70. package/crud/contentEntry/useCases/DeleteEntry/DeleteEntryOperation.js.map +1 -1
  71. package/crud/contentEntry/useCases/DeleteEntry/DeleteEntryOperationWithEvents.d.ts +3 -3
  72. package/crud/contentEntry/useCases/DeleteEntry/DeleteEntryOperationWithEvents.js.map +1 -1
  73. package/crud/contentEntry/useCases/DeleteEntry/DeleteEntrySecure.d.ts +3 -3
  74. package/crud/contentEntry/useCases/DeleteEntry/DeleteEntrySecure.js.map +1 -1
  75. package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBin.d.ts +3 -3
  76. package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBin.js.map +1 -1
  77. package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBinOperation.d.ts +2 -2
  78. package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBinOperation.js.map +1 -1
  79. package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBinOperationWithEvents.d.ts +3 -3
  80. package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBinOperationWithEvents.js.map +1 -1
  81. package/crud/contentEntry/useCases/DeleteEntry/TransformEntryDelete.d.ts +1 -1
  82. package/crud/contentEntry/useCases/DeleteEntry/TransformEntryDelete.js.map +1 -1
  83. package/crud/contentEntry/useCases/DeleteEntry/TransformEntryMoveToBin.d.ts +2 -2
  84. package/crud/contentEntry/useCases/DeleteEntry/TransformEntryMoveToBin.js.map +1 -1
  85. package/crud/contentEntry/useCases/DeleteEntry/index.d.ts +5 -5
  86. package/crud/contentEntry/useCases/DeleteEntry/index.js.map +1 -1
  87. package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIds.d.ts +7 -5
  88. package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIds.js +6 -2
  89. package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIds.js.map +1 -1
  90. package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIdsNotDeleted.d.ts +2 -2
  91. package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIdsNotDeleted.js.map +1 -1
  92. package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIdsSecure.d.ts +3 -3
  93. package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIdsSecure.js.map +1 -1
  94. package/crud/contentEntry/useCases/GetEntriesByIds/index.d.ts +4 -2
  95. package/crud/contentEntry/useCases/GetEntriesByIds/index.js +1 -1
  96. package/crud/contentEntry/useCases/GetEntriesByIds/index.js.map +1 -1
  97. package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIds.d.ts +7 -5
  98. package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIds.js +6 -2
  99. package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIds.js.map +1 -1
  100. package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIdsNotDeleted.d.ts +2 -2
  101. package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIdsNotDeleted.js.map +1 -1
  102. package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIdsSecure.d.ts +3 -3
  103. package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIdsSecure.js.map +1 -1
  104. package/crud/contentEntry/useCases/GetLatestEntriesByIds/index.d.ts +4 -2
  105. package/crud/contentEntry/useCases/GetLatestEntriesByIds/index.js +1 -1
  106. package/crud/contentEntry/useCases/GetLatestEntriesByIds/index.js.map +1 -1
  107. package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryId.d.ts +7 -5
  108. package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryId.js +7 -2
  109. package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryId.js.map +1 -1
  110. package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdDeleted.d.ts +2 -2
  111. package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdDeleted.js.map +1 -1
  112. package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdNotDeleted.d.ts +2 -2
  113. package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdNotDeleted.js.map +1 -1
  114. package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/index.d.ts +3 -1
  115. package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/index.js +1 -1
  116. package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/index.js.map +1 -1
  117. package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryId.d.ts +7 -5
  118. package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryId.js +7 -2
  119. package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryId.js.map +1 -1
  120. package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdNotDeleted.d.ts +2 -2
  121. package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdNotDeleted.js.map +1 -1
  122. package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/index.d.ts +3 -1
  123. package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/index.js +1 -1
  124. package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/index.js.map +1 -1
  125. package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIds.d.ts +7 -5
  126. package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIds.js +6 -2
  127. package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIds.js.map +1 -1
  128. package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIdsNotDeleted.d.ts +2 -2
  129. package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIdsNotDeleted.js.map +1 -1
  130. package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIdsSecure.d.ts +3 -3
  131. package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIdsSecure.js.map +1 -1
  132. package/crud/contentEntry/useCases/GetPublishedEntriesByIds/index.d.ts +4 -2
  133. package/crud/contentEntry/useCases/GetPublishedEntriesByIds/index.js +1 -1
  134. package/crud/contentEntry/useCases/GetPublishedEntriesByIds/index.js.map +1 -1
  135. package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryId.d.ts +7 -5
  136. package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryId.js +7 -2
  137. package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryId.js.map +1 -1
  138. package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdNotDeleted.d.ts +2 -2
  139. package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdNotDeleted.js.map +1 -1
  140. package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/index.d.ts +3 -1
  141. package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/index.js +1 -1
  142. package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/index.js.map +1 -1
  143. package/crud/contentEntry/useCases/GetRevisionById/GetRevisionById.d.ts +7 -5
  144. package/crud/contentEntry/useCases/GetRevisionById/GetRevisionById.js +7 -2
  145. package/crud/contentEntry/useCases/GetRevisionById/GetRevisionById.js.map +1 -1
  146. package/crud/contentEntry/useCases/GetRevisionById/GetRevisionByIdNotDeleted.d.ts +2 -2
  147. package/crud/contentEntry/useCases/GetRevisionById/GetRevisionByIdNotDeleted.js.map +1 -1
  148. package/crud/contentEntry/useCases/GetRevisionById/index.d.ts +3 -1
  149. package/crud/contentEntry/useCases/GetRevisionById/index.js +1 -1
  150. package/crud/contentEntry/useCases/GetRevisionById/index.js.map +1 -1
  151. package/crud/contentEntry/useCases/GetRevisionsByEntryId/GetRevisionsByEntryId.d.ts +7 -5
  152. package/crud/contentEntry/useCases/GetRevisionsByEntryId/GetRevisionsByEntryId.js +6 -2
  153. package/crud/contentEntry/useCases/GetRevisionsByEntryId/GetRevisionsByEntryId.js.map +1 -1
  154. package/crud/contentEntry/useCases/GetRevisionsByEntryId/GetRevisionsByEntryIdNotDeleted.d.ts +2 -2
  155. package/crud/contentEntry/useCases/GetRevisionsByEntryId/GetRevisionsByEntryIdNotDeleted.js.map +1 -1
  156. package/crud/contentEntry/useCases/GetRevisionsByEntryId/index.d.ts +4 -2
  157. package/crud/contentEntry/useCases/GetRevisionsByEntryId/index.js +1 -1
  158. package/crud/contentEntry/useCases/GetRevisionsByEntryId/index.js.map +1 -1
  159. package/crud/contentEntry/useCases/ListEntries/GetEntry.d.ts +2 -2
  160. package/crud/contentEntry/useCases/ListEntries/GetEntry.js.map +1 -1
  161. package/crud/contentEntry/useCases/ListEntries/GetEntrySecure.d.ts +4 -4
  162. package/crud/contentEntry/useCases/ListEntries/GetEntrySecure.js.map +1 -1
  163. package/crud/contentEntry/useCases/ListEntries/ListEntries.d.ts +2 -2
  164. package/crud/contentEntry/useCases/ListEntries/ListEntries.js.map +1 -1
  165. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperation.d.ts +12 -5
  166. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperation.js +9 -2
  167. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperation.js.map +1 -1
  168. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationDeleted.d.ts +2 -2
  169. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationDeleted.js.map +1 -1
  170. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationLatest.d.ts +2 -2
  171. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationLatest.js.map +1 -1
  172. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationNotDeleted.d.ts +2 -2
  173. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationNotDeleted.js.map +1 -1
  174. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationPublished.d.ts +2 -2
  175. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationPublished.js.map +1 -1
  176. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithEvents.d.ts +3 -3
  177. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithEvents.js.map +1 -1
  178. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithSearchableFields.d.ts +2 -2
  179. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithSearchableFields.js.map +1 -1
  180. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithSort.d.ts +2 -2
  181. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithSort.js.map +1 -1
  182. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithStatusCheck.d.ts +2 -2
  183. package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithStatusCheck.js.map +1 -1
  184. package/crud/contentEntry/useCases/ListEntries/ListEntriesSecure.d.ts +4 -4
  185. package/crud/contentEntry/useCases/ListEntries/ListEntriesSecure.js.map +1 -1
  186. package/crud/contentEntry/useCases/ListEntries/index.d.ts +6 -4
  187. package/crud/contentEntry/useCases/ListEntries/index.js +1 -1
  188. package/crud/contentEntry/useCases/ListEntries/index.js.map +1 -1
  189. package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBin.d.ts +3 -3
  190. package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBin.js.map +1 -1
  191. package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinOperation.d.ts +7 -5
  192. package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinOperation.js +4 -2
  193. package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinOperation.js.map +1 -1
  194. package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinOperationWithEvents.d.ts +3 -3
  195. package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinOperationWithEvents.js.map +1 -1
  196. package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinSecure.d.ts +3 -3
  197. package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinSecure.js.map +1 -1
  198. package/crud/contentEntry/useCases/RestoreEntryFromBin/TransformEntryRestoreFromBin.d.ts +2 -2
  199. package/crud/contentEntry/useCases/RestoreEntryFromBin/TransformEntryRestoreFromBin.js.map +1 -1
  200. package/crud/contentEntry/useCases/RestoreEntryFromBin/index.d.ts +7 -5
  201. package/crud/contentEntry/useCases/RestoreEntryFromBin/index.js +1 -1
  202. package/crud/contentEntry/useCases/RestoreEntryFromBin/index.js.map +1 -1
  203. package/crud/contentEntry.crud.d.ts +5 -5
  204. package/crud/contentEntry.crud.js +16 -3
  205. package/crud/contentEntry.crud.js.map +1 -1
  206. package/crud/contentModel/beforeCreate.d.ts +2 -2
  207. package/crud/contentModel/beforeCreate.js.map +1 -1
  208. package/crud/contentModel/beforeDelete.d.ts +2 -2
  209. package/crud/contentModel/beforeDelete.js.map +1 -1
  210. package/crud/contentModel/beforeUpdate.d.ts +2 -2
  211. package/crud/contentModel/beforeUpdate.js.map +1 -1
  212. package/crud/contentModel/compatibility/modelApiName.d.ts +1 -1
  213. package/crud/contentModel/compatibility/modelApiName.js.map +1 -1
  214. package/crud/contentModel/contentModelManagerFactory.d.ts +1 -1
  215. package/crud/contentModel/contentModelManagerFactory.js.map +1 -1
  216. package/crud/contentModel/createFieldStorageId.d.ts +1 -1
  217. package/crud/contentModel/createFieldStorageId.js.map +1 -1
  218. package/crud/contentModel/defaultFields.d.ts +1 -1
  219. package/crud/contentModel/defaultFields.js.map +1 -1
  220. package/crud/contentModel/ensureTypeTag.d.ts +1 -1
  221. package/crud/contentModel/ensureTypeTag.js.map +1 -1
  222. package/crud/contentModel/fields/descriptionField.d.ts +1 -1
  223. package/crud/contentModel/fields/descriptionField.js.map +1 -1
  224. package/crud/contentModel/fields/getApplicableFieldById.d.ts +1 -1
  225. package/crud/contentModel/fields/getApplicableFieldById.js.map +1 -1
  226. package/crud/contentModel/fields/imageField.d.ts +1 -1
  227. package/crud/contentModel/fields/imageField.js.map +1 -1
  228. package/crud/contentModel/fields/titleField.d.ts +1 -1
  229. package/crud/contentModel/fields/titleField.js.map +1 -1
  230. package/crud/contentModel/listModelsFromDatabase.d.ts +3 -3
  231. package/crud/contentModel/listModelsFromDatabase.js.map +1 -1
  232. package/crud/contentModel/validate/endingAllowed.d.ts +1 -1
  233. package/crud/contentModel/validate/endingAllowed.js.map +1 -1
  234. package/crud/contentModel/validate/modelId.d.ts +1 -1
  235. package/crud/contentModel/validate/modelId.js.map +1 -1
  236. package/crud/contentModel/validate/pluralApiName.d.ts +1 -1
  237. package/crud/contentModel/validate/pluralApiName.js.map +1 -1
  238. package/crud/contentModel/validate/singularApiName.d.ts +1 -1
  239. package/crud/contentModel/validate/singularApiName.js.map +1 -1
  240. package/crud/contentModel/validateModel.d.ts +1 -1
  241. package/crud/contentModel/validateModel.js.map +1 -1
  242. package/crud/contentModel/validateModelFields.d.ts +1 -1
  243. package/crud/contentModel/validateModelFields.js.map +1 -1
  244. package/crud/contentModel/validation.d.ts +132 -132
  245. package/crud/contentModel.crud.d.ts +5 -5
  246. package/crud/contentModel.crud.js.map +1 -1
  247. package/crud/contentModelGroup/beforeCreate.d.ts +3 -3
  248. package/crud/contentModelGroup/beforeCreate.js.map +1 -1
  249. package/crud/contentModelGroup/beforeDelete.d.ts +3 -3
  250. package/crud/contentModelGroup/beforeDelete.js.map +1 -1
  251. package/crud/contentModelGroup/beforeUpdate.d.ts +3 -3
  252. package/crud/contentModelGroup/beforeUpdate.js.map +1 -1
  253. package/crud/contentModelGroup/listGroupsFromDatabase.d.ts +1 -1
  254. package/crud/contentModelGroup/listGroupsFromDatabase.js.map +1 -1
  255. package/crud/contentModelGroup/validation.d.ts +2 -2
  256. package/crud/contentModelGroup.crud.d.ts +5 -5
  257. package/crud/contentModelGroup.crud.js.map +1 -1
  258. package/crud/system.crud.d.ts +4 -4
  259. package/crud/system.crud.js +10 -0
  260. package/crud/system.crud.js.map +1 -1
  261. package/export/crud/exporting.d.ts +2 -2
  262. package/export/crud/exporting.js.map +1 -1
  263. package/export/crud/importing.d.ts +2 -2
  264. package/export/crud/importing.js.map +1 -1
  265. package/export/crud/imports/importData.d.ts +2 -2
  266. package/export/crud/imports/importData.js.map +1 -1
  267. package/export/crud/imports/importGroups.d.ts +2 -2
  268. package/export/crud/imports/importGroups.js.map +1 -1
  269. package/export/crud/imports/importModels.d.ts +2 -2
  270. package/export/crud/imports/importModels.js.map +1 -1
  271. package/export/crud/imports/validateGroups.d.ts +2 -2
  272. package/export/crud/imports/validateGroups.js.map +1 -1
  273. package/export/crud/imports/validateInput.d.ts +2 -2
  274. package/export/crud/imports/validateInput.js.map +1 -1
  275. package/export/crud/imports/validateModels.d.ts +2 -2
  276. package/export/crud/imports/validateModels.js.map +1 -1
  277. package/export/crud/index.d.ts +1 -1
  278. package/export/crud/index.js.map +1 -1
  279. package/export/crud/sanitize.d.ts +2 -2
  280. package/export/crud/sanitize.js.map +1 -1
  281. package/export/graphql/index.d.ts +1 -1
  282. package/export/graphql/index.js.map +1 -1
  283. package/export/types.d.ts +1 -1
  284. package/export/types.js.map +1 -1
  285. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.d.ts +3 -2
  286. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -1
  287. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.d.ts +3 -2
  288. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
  289. package/fieldConverters/CmsModelObjectFieldConverterPlugin.d.ts +3 -2
  290. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -1
  291. package/graphql/buildSchemaPlugins.d.ts +2 -2
  292. package/graphql/buildSchemaPlugins.js.map +1 -1
  293. package/graphql/checkEndpointAccess.d.ts +1 -1
  294. package/graphql/checkEndpointAccess.js.map +1 -1
  295. package/graphql/createExecutableSchema.d.ts +1 -1
  296. package/graphql/createExecutableSchema.js.map +1 -1
  297. package/graphql/createRequestBody.d.ts +1 -1
  298. package/graphql/createRequestBody.js.map +1 -1
  299. package/graphql/generateSchema.d.ts +2 -2
  300. package/graphql/generateSchema.js.map +1 -1
  301. package/graphql/getSchema/generateCacheId.d.ts +3 -3
  302. package/graphql/getSchema/generateCacheId.js.map +1 -1
  303. package/graphql/getSchema/generateCacheKey.d.ts +1 -1
  304. package/graphql/getSchema/generateCacheKey.js.map +1 -1
  305. package/graphql/getSchema.d.ts +4 -4
  306. package/graphql/getSchema.js.map +1 -1
  307. package/graphql/graphQLHandlerFactory.d.ts +1 -1
  308. package/graphql/graphQLHandlerFactory.js.map +1 -1
  309. package/graphql/handleRequest.d.ts +2 -2
  310. package/graphql/handleRequest.js.map +1 -1
  311. package/graphql/index.d.ts +2 -2
  312. package/graphql/index.js.map +1 -1
  313. package/graphql/scalars/RevisionIdScalarPlugin.d.ts +1 -1
  314. package/graphql/scalars/RevisionIdScalarPlugin.js.map +1 -1
  315. package/graphql/schema/baseContentSchema.d.ts +2 -2
  316. package/graphql/schema/baseContentSchema.js.map +1 -1
  317. package/graphql/schema/baseSchema.js.map +1 -1
  318. package/graphql/schema/contentEntries.d.ts +2 -2
  319. package/graphql/schema/contentEntries.js.map +1 -1
  320. package/graphql/schema/contentModelGroups.d.ts +2 -2
  321. package/graphql/schema/contentModelGroups.js.map +1 -1
  322. package/graphql/schema/contentModels.d.ts +2 -2
  323. package/graphql/schema/contentModels.js.map +1 -1
  324. package/graphql/schema/createFieldResolvers.d.ts +2 -2
  325. package/graphql/schema/createFieldResolvers.js.map +1 -1
  326. package/graphql/schema/createFieldTypePluginRecords.d.ts +2 -2
  327. package/graphql/schema/createFieldTypePluginRecords.js.map +1 -1
  328. package/graphql/schema/createManageSDL.d.ts +2 -2
  329. package/graphql/schema/createManageSDL.js.map +1 -1
  330. package/graphql/schema/createReadSDL.d.ts +2 -2
  331. package/graphql/schema/createReadSDL.js.map +1 -1
  332. package/graphql/schema/createSingularSDL.d.ts +1 -1
  333. package/graphql/schema/createSingularSDL.js.map +1 -1
  334. package/graphql/schema/resolvers/manage/normalizeGraphQlInput.d.ts +1 -1
  335. package/graphql/schema/resolvers/manage/normalizeGraphQlInput.js.map +1 -1
  336. package/graphql/schema/resolvers/manage/resolveCreate.d.ts +1 -1
  337. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
  338. package/graphql/schema/resolvers/manage/resolveCreateFrom.d.ts +1 -1
  339. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
  340. package/graphql/schema/resolvers/manage/resolveDelete.d.ts +1 -1
  341. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
  342. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.d.ts +1 -1
  343. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -1
  344. package/graphql/schema/resolvers/manage/resolveGet.d.ts +1 -1
  345. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
  346. package/graphql/schema/resolvers/manage/resolveGetByIds.d.ts +1 -1
  347. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
  348. package/graphql/schema/resolvers/manage/resolveGetRevisions.d.ts +1 -1
  349. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
  350. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.d.ts +1 -1
  351. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -1
  352. package/graphql/schema/resolvers/manage/resolveList.d.ts +1 -1
  353. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
  354. package/graphql/schema/resolvers/manage/resolveListDeleted.d.ts +1 -1
  355. package/graphql/schema/resolvers/manage/resolveListDeleted.js.map +1 -1
  356. package/graphql/schema/resolvers/manage/resolveMove.d.ts +1 -1
  357. package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -1
  358. package/graphql/schema/resolvers/manage/resolvePublish.d.ts +1 -1
  359. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
  360. package/graphql/schema/resolvers/manage/resolveRepublish.d.ts +1 -1
  361. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
  362. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.d.ts +1 -1
  363. package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js.map +1 -1
  364. package/graphql/schema/resolvers/manage/resolveUnpublish.d.ts +1 -1
  365. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
  366. package/graphql/schema/resolvers/manage/resolveUpdate.d.ts +1 -1
  367. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
  368. package/graphql/schema/resolvers/manage/resolveValidate.d.ts +1 -1
  369. package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -1
  370. package/graphql/schema/resolvers/preview/resolveGet.d.ts +1 -1
  371. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
  372. package/graphql/schema/resolvers/preview/resolveList.d.ts +1 -1
  373. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
  374. package/graphql/schema/resolvers/read/resolveGet.d.ts +1 -1
  375. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
  376. package/graphql/schema/resolvers/read/resolveList.d.ts +1 -1
  377. package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
  378. package/graphql/schema/resolvers/singular/resolveGet.d.ts +1 -1
  379. package/graphql/schema/resolvers/singular/resolveGet.js.map +1 -1
  380. package/graphql/schema/resolvers/singular/resolveUpdate.d.ts +1 -1
  381. package/graphql/schema/resolvers/singular/resolveUpdate.js.map +1 -1
  382. package/graphql/schema/schemaPlugins.d.ts +1 -1
  383. package/graphql/schema/schemaPlugins.js.map +1 -1
  384. package/graphql/system.d.ts +1 -1
  385. package/graphql/system.js.map +1 -1
  386. package/graphqlFields/boolean.d.ts +1 -1
  387. package/graphqlFields/boolean.js.map +1 -1
  388. package/graphqlFields/datetime.d.ts +1 -1
  389. package/graphqlFields/datetime.js.map +1 -1
  390. package/graphqlFields/dynamicZone/dynamicZoneField.d.ts +1 -1
  391. package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -1
  392. package/graphqlFields/file.d.ts +1 -1
  393. package/graphqlFields/file.js.map +1 -1
  394. package/graphqlFields/helpers.d.ts +1 -1
  395. package/graphqlFields/helpers.js.map +1 -1
  396. package/graphqlFields/index.d.ts +1 -1
  397. package/graphqlFields/index.js.map +1 -1
  398. package/graphqlFields/json.d.ts +1 -1
  399. package/graphqlFields/json.js.map +1 -1
  400. package/graphqlFields/longText.d.ts +1 -1
  401. package/graphqlFields/longText.js.map +1 -1
  402. package/graphqlFields/number.d.ts +1 -1
  403. package/graphqlFields/number.js.map +1 -1
  404. package/graphqlFields/object.d.ts +1 -1
  405. package/graphqlFields/object.js.map +1 -1
  406. package/graphqlFields/ref.d.ts +1 -1
  407. package/graphqlFields/ref.js.map +1 -1
  408. package/graphqlFields/richText/RichTextPluginsProcessor.d.ts +1 -1
  409. package/graphqlFields/richText/RichTextPluginsProcessor.js.map +1 -1
  410. package/graphqlFields/richText/richTextResolver.d.ts +2 -2
  411. package/graphqlFields/richText/richTextResolver.js.map +1 -1
  412. package/graphqlFields/richText.d.ts +1 -1
  413. package/graphqlFields/richText.js.map +1 -1
  414. package/graphqlFields/searchableJson.d.ts +1 -1
  415. package/graphqlFields/searchableJson.js +5 -0
  416. package/graphqlFields/searchableJson.js.map +1 -1
  417. package/graphqlFields/text.d.ts +1 -1
  418. package/graphqlFields/text.js.map +1 -1
  419. package/htmlRenderer/LexicalRenderer.d.ts +1 -1
  420. package/htmlRenderer/LexicalRenderer.js.map +1 -1
  421. package/htmlRenderer/createLexicalHTMLRenderer.js.map +1 -1
  422. package/index.d.ts +3 -3
  423. package/index.js.map +1 -1
  424. package/modelManager/SingletonModelManager.d.ts +1 -1
  425. package/modelManager/SingletonModelManager.js.map +1 -1
  426. package/modelManager/index.d.ts +1 -1
  427. package/modelManager/index.js.map +1 -1
  428. package/package.json +21 -21
  429. package/parameters/header.js.map +1 -1
  430. package/parameters/manual.d.ts +2 -1
  431. package/parameters/manual.js.map +1 -1
  432. package/parameters/path.js.map +1 -1
  433. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.d.ts +3 -2
  434. package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js.map +1 -1
  435. package/plugins/CmsGraphQLSchemaSorterPlugin.d.ts +1 -1
  436. package/plugins/CmsGraphQLSchemaSorterPlugin.js.map +1 -1
  437. package/plugins/CmsGroupPlugin.d.ts +1 -1
  438. package/plugins/CmsGroupPlugin.js.map +1 -1
  439. package/plugins/CmsModelFieldConverterPlugin.d.ts +2 -2
  440. package/plugins/CmsModelFieldConverterPlugin.js.map +1 -1
  441. package/plugins/CmsModelPlugin.d.ts +1 -1
  442. package/plugins/CmsModelPlugin.js.map +1 -1
  443. package/plugins/CmsParametersPlugin.d.ts +1 -1
  444. package/plugins/CmsParametersPlugin.js.map +1 -1
  445. package/plugins/StorageOperationsCmsModelPlugin.d.ts +1 -1
  446. package/plugins/StorageOperationsCmsModelPlugin.js.map +1 -1
  447. package/plugins/StorageTransformPlugin.d.ts +2 -2
  448. package/plugins/StorageTransformPlugin.js.map +1 -1
  449. package/storage/date.d.ts +1 -1
  450. package/storage/date.js.map +1 -1
  451. package/storage/dynamicZone.js.map +1 -1
  452. package/storage/json.js +34 -5
  453. package/storage/json.js.map +1 -1
  454. package/storage/object.js.map +1 -1
  455. package/types/context.d.ts +7 -7
  456. package/types/context.js.map +1 -1
  457. package/types/fields/dynamicZoneField.d.ts +1 -1
  458. package/types/fields/dynamicZoneField.js.map +1 -1
  459. package/types/fields/objectField.d.ts +1 -1
  460. package/types/fields/objectField.js.map +1 -1
  461. package/types/model.d.ts +3 -3
  462. package/types/model.js.map +1 -1
  463. package/types/modelAst.d.ts +1 -1
  464. package/types/modelAst.js.map +1 -1
  465. package/types/modelField.d.ts +2 -2
  466. package/types/modelField.js.map +1 -1
  467. package/types/modelGroup.d.ts +1 -1
  468. package/types/modelGroup.js.map +1 -1
  469. package/types/plugins.d.ts +6 -6
  470. package/types/plugins.js.map +1 -1
  471. package/types/types.d.ts +19 -19
  472. package/types/types.js.map +1 -1
  473. package/utils/RichTextRenderer.d.ts +2 -2
  474. package/utils/RichTextRenderer.js.map +1 -1
  475. package/utils/caching/Cache.d.ts +1 -1
  476. package/utils/caching/Cache.js.map +1 -1
  477. package/utils/caching/CacheKey.d.ts +2 -2
  478. package/utils/caching/CacheKey.js.map +1 -1
  479. package/utils/contentEntryTraverser/ContentEntryTraverser.d.ts +1 -1
  480. package/utils/contentEntryTraverser/ContentEntryTraverser.js.map +1 -1
  481. package/utils/contentModelAst/CmsModelFieldToAstConverterFromPlugins.d.ts +1 -1
  482. package/utils/contentModelAst/CmsModelFieldToAstConverterFromPlugins.js.map +1 -1
  483. package/utils/contentModelAst/CmsModelFieldToAstFromPlugin.d.ts +1 -1
  484. package/utils/contentModelAst/CmsModelFieldToAstFromPlugin.js.map +1 -1
  485. package/utils/contentModelAst/CmsModelToAstConverter.d.ts +1 -1
  486. package/utils/contentModelAst/CmsModelToAstConverter.js.map +1 -1
  487. package/utils/converters/Converter.d.ts +3 -3
  488. package/utils/converters/Converter.js.map +1 -1
  489. package/utils/converters/ConverterCollection.d.ts +2 -2
  490. package/utils/converters/ConverterCollection.js.map +1 -1
  491. package/utils/converters/valueKeyStorageConverter.d.ts +3 -3
  492. package/utils/converters/valueKeyStorageConverter.js.map +1 -1
  493. package/utils/createModelField.d.ts +1 -1
  494. package/utils/createModelField.js.map +1 -1
  495. package/utils/createTypeFromFields.d.ts +1 -1
  496. package/utils/createTypeFromFields.js.map +1 -1
  497. package/utils/entryStorage.d.ts +8 -1
  498. package/utils/entryStorage.js +37 -4
  499. package/utils/entryStorage.js.map +1 -1
  500. package/utils/getBaseFieldType.d.ts +1 -1
  501. package/utils/getBaseFieldType.js.map +1 -1
  502. package/utils/getEntryDescription.d.ts +1 -1
  503. package/utils/getEntryDescription.js.map +1 -1
  504. package/utils/getEntryImage.d.ts +1 -1
  505. package/utils/getEntryImage.js.map +1 -1
  506. package/utils/getEntryTitle.d.ts +1 -1
  507. package/utils/getEntryTitle.js.map +1 -1
  508. package/utils/getSchemaFromFieldPlugins.d.ts +4 -4
  509. package/utils/getSchemaFromFieldPlugins.js.map +1 -1
  510. package/utils/identity.d.ts +1 -1
  511. package/utils/identity.js.map +1 -1
  512. package/utils/isHeadlessCmsReady.d.ts +1 -1
  513. package/utils/isHeadlessCmsReady.js.map +1 -1
  514. package/utils/modelFieldTraverser/ModelFieldTraverser.d.ts +1 -1
  515. package/utils/modelFieldTraverser/ModelFieldTraverser.js.map +1 -1
  516. package/utils/renderFields.d.ts +1 -1
  517. package/utils/renderFields.js.map +1 -1
  518. package/utils/renderGetFilterFields.d.ts +1 -1
  519. package/utils/renderGetFilterFields.js.map +1 -1
  520. package/utils/renderInputFields.d.ts +1 -1
  521. package/utils/renderInputFields.js.map +1 -1
  522. package/utils/renderListFilterFields.d.ts +1 -1
  523. package/utils/renderListFilterFields.js.map +1 -1
  524. package/utils/renderSortEnum.d.ts +2 -2
  525. package/utils/renderSortEnum.js.map +1 -1
  526. package/validators/dateGte.d.ts +1 -1
  527. package/validators/dateGte.js.map +1 -1
  528. package/validators/dateLte.d.ts +1 -1
  529. package/validators/dateLte.js.map +1 -1
  530. package/validators/gte.d.ts +1 -1
  531. package/validators/gte.js.map +1 -1
  532. package/validators/in.d.ts +1 -1
  533. package/validators/in.js.map +1 -1
  534. package/validators/lte.d.ts +1 -1
  535. package/validators/lte.js.map +1 -1
  536. package/validators/maxLength.d.ts +1 -1
  537. package/validators/maxLength.js.map +1 -1
  538. package/validators/minLength.d.ts +1 -1
  539. package/validators/minLength.js.map +1 -1
  540. package/validators/pattern.d.ts +1 -1
  541. package/validators/pattern.js.map +1 -1
  542. package/validators/patternPlugins/email.d.ts +1 -1
  543. package/validators/patternPlugins/email.js.map +1 -1
  544. package/validators/patternPlugins/index.d.ts +1 -1
  545. package/validators/patternPlugins/index.js.map +1 -1
  546. package/validators/patternPlugins/lowerCase.d.ts +1 -1
  547. package/validators/patternPlugins/lowerCase.js.map +1 -1
  548. package/validators/patternPlugins/lowerCaseSpace.d.ts +1 -1
  549. package/validators/patternPlugins/lowerCaseSpace.js.map +1 -1
  550. package/validators/patternPlugins/upperCase.d.ts +1 -1
  551. package/validators/patternPlugins/upperCase.js.map +1 -1
  552. package/validators/patternPlugins/upperCaseSpace.d.ts +1 -1
  553. package/validators/patternPlugins/upperCaseSpace.js.map +1 -1
  554. package/validators/patternPlugins/url.d.ts +1 -1
  555. package/validators/patternPlugins/url.js.map +1 -1
  556. package/validators/required.d.ts +1 -1
  557. package/validators/required.js.map +1 -1
  558. package/validators/timeGte.d.ts +1 -1
  559. package/validators/timeGte.js.map +1 -1
  560. package/validators/timeLte.d.ts +1 -1
  561. package/validators/timeLte.js.map +1 -1
  562. package/validators/unique.d.ts +1 -1
  563. package/validators/unique.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["CONTENT_ENTRY_STATUS","exports"],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport { I18NContext, I18NLocale } from \"@webiny/api-i18n/types\";\nimport { Context, GenericRecord } from \"@webiny/api/types\";\nimport { GraphQLFieldResolver, GraphQLRequestBody, Resolvers } from \"@webiny/handler-graphql/types\";\nimport { processRequestBody } from \"@webiny/handler-graphql\";\nimport { SecurityPermission } from \"@webiny/api-security/types\";\nimport { DbContext } from \"@webiny/handler-db/types\";\nimport { Topic } from \"@webiny/pubsub/types\";\nimport { CmsModelConverterCallable } from \"~/utils/converters/ConverterCollection\";\nimport { HeadlessCmsExport, HeadlessCmsImport } from \"~/export/types\";\nimport { AccessControl } from \"~/crud/AccessControl/AccessControl\";\nimport { CmsModelToAstConverter } from \"~/utils/contentModelAst/CmsModelToAstConverter\";\nimport { CmsModelFieldToGraphQLPlugin } from \"./plugins\";\nimport { CmsEntryContext } from \"./context\";\nimport { CmsModelField, CmsModelFieldValidation, CmsModelUpdateInput } from \"./modelField\";\nimport { CmsModel, CmsModelCreateFromInput, CmsModelCreateInput } from \"./model\";\nimport { CmsGroup } from \"./modelGroup\";\nimport { CmsIdentity } from \"./identity\";\nimport { ISingletonModelManager } from \"~/modelManager\";\n\nexport interface CmsError {\n message: string;\n code: string;\n data: GenericRecord;\n stack?: string;\n}\n\nexport interface CmsError {\n message: string;\n code: string;\n data: GenericRecord;\n stack?: string;\n}\n\nexport type ApiEndpoint = \"manage\" | \"preview\" | \"read\";\n\nexport interface HeadlessCms\n extends CmsSystemContext,\n CmsGroupContext,\n CmsModelContext,\n CmsEntryContext {\n /**\n * API type\n */\n type: ApiEndpoint | null;\n /**\n * Requested locale\n */\n locale: string;\n /**\n * returns an instance of current locale\n */\n getLocale: () => I18NLocale;\n /**\n * Means this request is a READ API\n */\n READ: boolean;\n /**\n * Means this request is a MANAGE API\n */\n MANAGE: boolean;\n /**\n * Means this request is a PREVIEW API\n */\n PREVIEW: boolean;\n /**\n * The storage operations loaded for current context.\n */\n storageOperations: HeadlessCmsStorageOperations;\n\n /**\n * Use to ensure perform authorization and ensure identities have access to the groups, models and entries.\n */\n accessControl: AccessControl;\n\n /**\n * Export operations.\n */\n export: HeadlessCmsExport;\n importing: HeadlessCmsImport;\n getExecutableSchema: GetExecutableSchema;\n}\n\nexport type GetExecutableSchema = (\n type: ApiEndpoint\n) => Promise<\n <TData = Record<string, any>, TExtensions = Record<string, any>>(\n input: GraphQLRequestBody | GraphQLRequestBody[]\n ) => ReturnType<typeof processRequestBody<TData, TExtensions>>\n>;\n\n/**\n * @description This combines all contexts used in the CMS into a single one.\n *\n * @category Context\n */\nexport interface CmsContext extends Context, DbContext, I18NContext {\n cms: HeadlessCms;\n}\n\n/**\n * Used for our internal functionality.\n */\nexport interface CmsModelFieldWithParent extends CmsModelField {\n parent?: CmsModelFieldWithParent | null;\n}\n\n/**\n * A definition for dateTime field to show possible type of the field in settings.\n */\nexport interface CmsModelDateTimeField extends CmsModelField {\n /**\n * Settings object for the field. Contains `type` property.\n */\n settings: {\n type: \"time\" | \"date\" | \"dateTimeWithoutTimezone\" | \"dateTimeWithTimezone\";\n };\n}\n\n/**\n * Arguments for the field validator validate method.\n *\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldValidatorValidateParams<T = any> {\n /**\n * A value to be validated.\n */\n value: T;\n /**\n * Options from the CmsModelField validations.\n *\n * @see CmsModelField.validation\n * @see CmsModelField.listValidation\n */\n validator: CmsModelFieldValidation;\n /**\n * An instance of the current context.\n */\n context: CmsContext;\n /**\n * Field being validated.\n */\n field: CmsModelField;\n /**\n * An instance of the content model being validated.\n */\n model: CmsModel;\n /**\n * If entry is sent it means it is an update operation.\n * First usage is for the unique field value.\n */\n entry?: CmsEntry;\n}\n\n/**\n * When sending model to the storage operations, it must contain createValueKeyToStorageConverter and createValueKeyFromStorageConverter\n *\n * @category CmsModel\n */\nexport interface StorageOperationsCmsModel extends CmsModel {\n convertValueKeyToStorage: CmsModelConverterCallable;\n convertValueKeyFromStorage: CmsModelConverterCallable;\n}\n\n/**\n * @category ModelField\n */\nexport interface CmsModelFieldDefinition {\n fields: string;\n typeDefs?: string;\n}\n\nexport interface CmsModelFieldToGraphQLNormalizeInputParams<TField> {\n model: CmsModel;\n field: TField;\n input: GenericRecord<string> | Array<GenericRecord<string>>;\n}\n\ninterface CmsModelFieldToGraphQLCreateResolverParams<TField> {\n models: CmsModel[];\n model: CmsModel;\n graphQLType: string;\n field: TField;\n createFieldResolvers: any;\n fieldTypePlugins: CmsFieldTypePlugins;\n}\n\nexport interface CmsModelFieldToGraphQLCreateResolver<TField = CmsModelField> {\n (params: CmsModelFieldToGraphQLCreateResolverParams<TField>):\n | GraphQLFieldResolver\n | {\n resolver: GraphQLFieldResolver | null;\n typeResolvers: Resolvers<CmsContext>;\n }\n | false;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams<\n TField extends CmsModelField = CmsModelField\n> {\n fields: TField[];\n originalFields: TField[];\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidate {\n (params: CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams): void;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsParams<\n TField extends CmsModelField = CmsModelField\n> {\n field: TField;\n originalField?: TField;\n validate: CmsModelFieldToGraphQLPluginValidateChildFieldsValidate;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFields<\n TField extends CmsModelField = CmsModelField\n> {\n (params: CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField>): void;\n}\n\n/**\n * @category ModelField\n */\nexport interface CmsFieldTypePlugins {\n [key: string]: CmsModelFieldToGraphQLPlugin;\n}\n\nexport interface OnSystemBeforeInstallTopicParams {\n tenant: string;\n locale: string;\n}\n\nexport interface OnSystemAfterInstallTopicParams {\n tenant: string;\n locale: string;\n}\n\nexport interface OnSystemInstallErrorTopicParams {\n error: Error;\n tenant: string;\n locale: string;\n}\n\nexport type CmsSystemContext = {\n getSystemVersion: () => Promise<string | null>;\n setSystemVersion: (version: string) => Promise<void>;\n installSystem: () => Promise<void>;\n /**\n * Lifecycle Events\n */\n onSystemBeforeInstall: Topic<OnSystemBeforeInstallTopicParams>;\n onSystemAfterInstall: Topic<OnSystemAfterInstallTopicParams>;\n onSystemInstallError: Topic<OnSystemInstallErrorTopicParams>;\n};\n\n/**\n * A GraphQL `params.data` parameter received when creating content model group.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupCreateInput {\n id?: string;\n name: string;\n slug?: string;\n description?: string | null;\n icon: string;\n}\n\n/**\n * A GraphQL `params.data` parameter received when updating content model group.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupUpdateInput {\n name?: string;\n slug?: string;\n description?: string;\n icon?: string;\n}\n\n/**\n * A `data.where` parameter received when listing content model groups.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupListParams {\n where: {\n tenant: string;\n locale: string;\n };\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeCreateTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterCreateTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupCreateErrorTopicParams {\n input: CmsGroupCreateInput;\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeUpdateTopicParams {\n original: CmsGroup;\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterUpdateTopicParams {\n original: CmsGroup;\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupUpdateErrorTopicParams {\n input: CmsGroupUpdateInput;\n original: CmsGroup;\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeDeleteTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterDeleteTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupDeleteErrorTopicParams {\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * Cms Group in context.\n *\n * @category Context\n * @category CmsGroup\n */\nexport interface CmsGroupContext {\n /**\n * Gets content model group by given id.\n */\n getGroup: (id: string) => Promise<CmsGroup>;\n /**\n * List all content model groups. Filterable via params.\n */\n listGroups: (params?: CmsGroupListParams) => Promise<CmsGroup[]>;\n /**\n * Create a new content model group.\n */\n createGroup: (data: CmsGroupCreateInput) => Promise<CmsGroup>;\n /**\n * Update existing content model group.\n */\n updateGroup: (id: string, data: CmsGroupUpdateInput) => Promise<CmsGroup>;\n /**\n * Delete content model group by given id.\n */\n deleteGroup: (id: string) => Promise<boolean>;\n /**\n * Clear the cached groups.\n */\n clearGroupsCache: () => void;\n /**\n * Lifecycle Events\n */\n onGroupBeforeCreate: Topic<OnGroupBeforeCreateTopicParams>;\n onGroupAfterCreate: Topic<OnGroupAfterCreateTopicParams>;\n onGroupCreateError: Topic<OnGroupCreateErrorTopicParams>;\n onGroupBeforeUpdate: Topic<OnGroupBeforeUpdateTopicParams>;\n onGroupAfterUpdate: Topic<OnGroupAfterUpdateTopicParams>;\n onGroupUpdateError: Topic<OnGroupUpdateErrorTopicParams>;\n onGroupBeforeDelete: Topic<OnGroupBeforeDeleteTopicParams>;\n onGroupAfterDelete: Topic<OnGroupAfterDeleteTopicParams>;\n onGroupDeleteError: Topic<OnGroupDeleteErrorTopicParams>;\n}\n\n/**\n * A plugin to load a CmsModelManager.\n *\n * @see CmsModelManager\n *\n * @category Plugin\n * @category CmsModel\n * @category CmsEntry\n */\nexport interface ModelManagerPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-content-model-manager\";\n /**\n * Specific model CmsModelManager loader. Can target exact modelId(s).\n * Be aware that if you define multiple plugins without `modelId`, last one will run.\n */\n modelId?: string[] | string;\n /**\n * Create a CmsModelManager for specific type - or new default one.\n * For reference in how is this plugin run check [contentModelManagerFactory](https://github.com/webiny/webiny-js/blob/f15676/packages/api-headless-cms/src/content/plugins/CRUD/contentModel/contentModelManagerFactory.ts)\n */\n create<T = any>(context: CmsContext, model: CmsModel): Promise<CmsModelManager<T>>;\n}\n\n/**\n * A content entry values definition for and from the database.\n *\n * @category Database model\n * @category CmsEntry\n */\nexport interface CmsEntryValues {\n [key: string]: any;\n}\n\n/**\n * A content entry definition for and from the database.\n *\n * @category Database model\n * @category CmsEntry\n */\nexport interface CmsEntry<T = CmsEntryValues> {\n /**\n * A version of the webiny this entry was created with.\n * This can be used when upgrading the system, so we know which entries to update.\n */\n webinyVersion: string;\n /**\n * Tenant id which is this entry for. Can be used in case of shared storage.\n */\n tenant: string;\n /**\n * Generated ID of the entry. It is shared across all the records in the database that represent a single entry.\n * So version 1, 2, ..., 2371 will have the same value in this field to link them together.\n */\n entryId: string;\n /**\n * Generated ID + version of the entry.\n */\n id: string;\n\n /**\n * Revision-level meta fields. 👇\n */\n\n /**\n * An ISO 8601 date/time string.\n */\n revisionCreatedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n revisionSavedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n revisionModifiedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionDeletedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionRestoredOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionFirstPublishedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionLastPublishedOn: string | null;\n\n /**\n * Identity that last ionCreated the entry.\n */\n revisionCreatedBy: CmsIdentity;\n /**\n * Identity that last ionSaved the entry.\n */\n revisionSavedBy: CmsIdentity;\n /**\n * Identity that last ionModified the entry.\n */\n revisionModifiedBy: CmsIdentity | null;\n /**\n * Identity that last deleted the revision.\n */\n revisionDeletedBy: CmsIdentity | null;\n /**\n * Identity that last restored the revision.\n */\n revisionRestoredBy: CmsIdentity | null;\n /**\n * Identity that first published the entry.\n */\n revisionFirstPublishedBy: CmsIdentity | null;\n /**\n * Identity that last published the entry.\n */\n revisionLastPublishedBy: CmsIdentity | null;\n\n /**\n * An ISO 8601 date/time string.\n */\n createdOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n savedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n modifiedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n deletedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n restoredOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n firstPublishedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n lastPublishedOn: string | null;\n\n /**\n * Identity that last created the entry.\n */\n createdBy: CmsIdentity;\n /**\n * Identity that last saved the entry.\n */\n savedBy: CmsIdentity;\n /**\n * Identity that last modified the entry.\n */\n modifiedBy: CmsIdentity | null;\n /**\n * Identity that last deleted the entry.\n */\n deletedBy: CmsIdentity | null;\n /**\n * Identity that last restored the entry.\n */\n restoredBy: CmsIdentity | null;\n /**\n * Identity that first published the entry.\n */\n firstPublishedBy: CmsIdentity | null;\n /**\n * Identity that last published the entry.\n */\n lastPublishedBy: CmsIdentity | null;\n\n /**\n * Deprecated fields. 👇\n */\n\n /**\n * @deprecated Will be removed with the 5.41.0 release. Use `createdBy` field instead.\n */\n ownedBy?: CmsIdentity | null;\n\n /**\n * @deprecated Will be removed with the 5.41.0 release. Use `firstPublishedOn` or `lastPublishedOn` field instead.\n */\n publishedOn?: string | null;\n\n /**\n * Model ID of the definition for the entry.\n * @see CmsModel\n */\n modelId: string;\n /**\n * A locale of the entry.\n * @see I18NLocale.code\n */\n locale: string;\n /**\n * A revision version of the entry.\n */\n version: number;\n /**\n * Is the entry locked?\n */\n locked: boolean;\n /**\n * Status type of the entry.\n */\n status: CmsEntryStatus;\n /**\n * A mapped storageId -> value object.\n *\n * @see CmsModelField\n */\n values: T;\n /**\n * Advanced Content Organization\n */\n location?: {\n folderId?: string | null;\n };\n /**\n * Settings for the given entry.\n *\n * Introduced with Advanced Publishing Workflow. Will always be inserted once this PR is merged.\n * Be aware that when accessing properties in it on old systems, it will break if not checked first.\n *\n * Available only on the Manage API in entry GraphQL type `meta.data` property.\n */\n meta?: {\n [key: string]: any;\n };\n /**\n * Is the entry in the bin?\n */\n wbyDeleted?: boolean | null;\n /**\n * This field preserves the original folderId value, as the ROOT_FOLDER is set upon deletion.\n * The value is utilized when restoring the entry from the trash bin.\n */\n binOriginalFolderId?: string | null;\n}\n\nexport interface CmsStorageEntry extends CmsEntry {\n [key: string]: any;\n}\n\nexport interface CmsEntryUniqueValue {\n value: string;\n count: number;\n}\n\n/**\n * A definition for content model manager to be used in the code.\n * The default one uses `CmsEntryContext` methods internally, but devs can change to what every they want.\n *\n * @see CmsEntryContext\n *\n * @category Context\n * @category CmsEntry\n * @category CmsModel\n */\nexport interface CmsModelManager<T = CmsEntryValues> {\n model: CmsModel;\n /**\n * List only published entries in the content model.\n */\n listPublished(params: CmsEntryListParams): Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * List latest entries in the content model. Used for administration.\n */\n listLatest(params: CmsEntryListParams): Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * Get a list of published entries by the ID list.\n */\n getPublishedByIds(ids: string[]): Promise<CmsEntry<T>[]>;\n /**\n * Get a list of the latest entries by the ID list.\n */\n getLatestByIds(ids: string[]): Promise<CmsEntry<T>[]>;\n /**\n * Get an entry filtered by given params. Will always get one.\n */\n get(id: string): Promise<CmsEntry<T>>;\n /**\n * Create an entry.\n */\n create<I>(\n data: CreateCmsEntryInput & I,\n options?: CreateCmsEntryOptionsInput\n ): Promise<CmsEntry<T>>;\n /**\n * Update an entry.\n */\n update(\n id: string,\n data: UpdateCmsEntryInput,\n options?: UpdateCmsEntryOptionsInput\n ): Promise<CmsEntry<T>>;\n /**\n * Delete an entry.\n */\n delete(id: string, options?: CmsDeleteEntryOptions): Promise<void>;\n}\n\nexport type ICmsEntryManager<T = GenericRecord> = CmsModelManager<T>;\n\n/**\n * Create\n */\nexport interface OnModelBeforeCreateTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n}\n\nexport interface OnModelAfterCreateTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n}\n\nexport interface OnModelCreateErrorTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Create From / Clone\n */\nexport interface OnModelBeforeCreateFromTopicParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelAfterCreateFromTopicParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelCreateFromErrorParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Update\n */\nexport interface OnModelBeforeUpdateTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelAfterUpdateTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelUpdateErrorTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Delete\n */\nexport interface OnModelBeforeDeleteTopicParams {\n model: CmsModel;\n}\n\nexport interface OnModelAfterDeleteTopicParams {\n model: CmsModel;\n}\n\nexport interface OnModelDeleteErrorTopicParams {\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Initialize\n */\nexport interface OnModelInitializeParams {\n model: CmsModel;\n data: Record<string, any>;\n}\n\n/**\n *\n */\nexport interface CmsModelUpdateDirectParams {\n model: CmsModel;\n original: CmsModel;\n}\n\nexport interface ICmsModelListParams {\n /**\n * Defaults to true.\n */\n includePrivate?: boolean;\n includePlugins?: boolean;\n}\n\n/**\n * Cms Model in the context.\n *\n * @category Context\n * @category CmsModel\n */\nexport interface CmsModelContext {\n /**\n * Get a single content model.\n *\n * @throws NotFoundError\n */\n getModel(modelId: string): Promise<CmsModel>;\n /**\n * Get model to AST converter.\n */\n getModelToAstConverter: () => CmsModelToAstConverter;\n /**\n * Get all content models.\n */\n listModels(params?: ICmsModelListParams): Promise<CmsModel[]>;\n /**\n * Create a content model.\n */\n createModel(data: CmsModelCreateInput): Promise<CmsModel>;\n /**\n * Create a content model from the given model - clone.\n */\n createModelFrom(modelId: string, data: CmsModelCreateFromInput): Promise<CmsModel>;\n /**\n * Update content model without data validation. Used internally.\n * @hidden\n */\n updateModelDirect(params: CmsModelUpdateDirectParams): Promise<CmsModel>;\n /**\n * Update content model.\n */\n updateModel(modelId: string, data: CmsModelUpdateInput): Promise<CmsModel>;\n /**\n * Delete content model. Should not allow deletion if there are entries connected to it.\n */\n deleteModel(modelId: string): Promise<void>;\n /**\n * Possibility for users to trigger the model initialization.\n * They can hook into it and do what ever they want to.\n *\n * Primary idea behind this is creating the index, for the code models, in the ES.\n */\n initializeModel(modelId: string, data: Record<string, any>): Promise<boolean>;\n /**\n * Get an instance of CmsModelManager for given content modelId.\n *\n * @see CmsModelManager\n */\n getEntryManager<T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel | string\n ): Promise<ICmsEntryManager<T>>;\n /**\n * A model manager for a model which has a single entry.\n */\n getSingletonEntryManager<T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel | string\n ): Promise<ISingletonModelManager<T>>;\n /**\n * Get all content model managers mapped by modelId.\n * @see CmsModelManager\n */\n getEntryManagers(): Map<string, ICmsEntryManager>;\n /**\n * Clear all the model caches.\n */\n clearModelsCache(): void;\n /**\n * Lifecycle Events\n */\n onModelBeforeCreate: Topic<OnModelBeforeCreateTopicParams>;\n onModelAfterCreate: Topic<OnModelAfterCreateTopicParams>;\n onModelCreateError: Topic<OnModelCreateErrorTopicParams>;\n onModelBeforeCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;\n onModelAfterCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;\n onModelCreateFromError: Topic<OnModelCreateFromErrorParams>;\n onModelBeforeUpdate: Topic<OnModelBeforeUpdateTopicParams>;\n onModelAfterUpdate: Topic<OnModelAfterUpdateTopicParams>;\n onModelUpdateError: Topic<OnModelUpdateErrorTopicParams>;\n onModelBeforeDelete: Topic<OnModelBeforeDeleteTopicParams>;\n onModelAfterDelete: Topic<OnModelAfterDeleteTopicParams>;\n onModelDeleteError: Topic<OnModelDeleteErrorTopicParams>;\n onModelInitialize: Topic<OnModelInitializeParams>;\n}\n\n/**\n * Available statuses for content entry.\n *\n * @category CmsEntry\n */\nexport type CmsEntryStatus = \"published\" | \"unpublished\" | \"draft\";\n\nexport interface CmsEntryListWhereRef {\n id?: string;\n id_in?: string[];\n id_not?: string;\n id_not_in?: string[];\n entryId?: string;\n entryId_not?: string;\n entryId_in?: string[];\n entryId_not_in?: string[];\n}\n\n/**\n * Entry listing where params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryListWhere {\n /**\n * Fields.\n */\n id?: string;\n id_in?: string[];\n id_not?: string;\n id_not_in?: string[];\n /**\n * Generated ID without the version.\n */\n entryId?: string;\n entryId_not?: string;\n entryId_in?: string[];\n entryId_not_in?: string[];\n /**\n * Status of the entry.\n */\n status?: CmsEntryStatus;\n status_not?: CmsEntryStatus;\n status_in?: CmsEntryStatus[];\n status_not_in?: CmsEntryStatus[];\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedBy?: string;\n revisionCreatedBy_not?: string;\n revisionCreatedBy_in?: string[];\n revisionCreatedBy_not_in?: string[];\n\n revisionModifiedBy?: string;\n revisionModifiedBy_not?: string;\n revisionModifiedBy_in?: string[];\n revisionModifiedBy_not_in?: string[];\n\n revisionSavedBy?: string;\n revisionSavedBy_not?: string;\n revisionSavedBy_in?: string[];\n revisionSavedBy_not_in?: string[];\n\n revisionFirstPublishedBy?: string;\n revisionFirstPublishedBy_not?: string;\n revisionFirstPublishedBy_in?: string[];\n revisionFirstPublishedBy_not_in?: string[];\n\n revisionLastPublishedBy?: string;\n revisionLastPublishedBy_not?: string;\n revisionLastPublishedBy_in?: string[];\n revisionLastPublishedBy_not_in?: string[];\n\n /**\n * Entry-level meta fields. 👇\n */\n createdBy?: string;\n createdBy_not?: string;\n createdBy_in?: string[];\n createdBy_not_in?: string[];\n\n modifiedBy?: string;\n modifiedBy_not?: string;\n modifiedBy_in?: string[];\n modifiedBy_not_in?: string[];\n\n savedBy?: string;\n savedBy_not?: string;\n savedBy_in?: string[];\n savedBy_not_in?: string[];\n\n firstPublishedBy?: string;\n firstPublishedBy_not?: string;\n firstPublishedBy_in?: string[];\n firstPublishedBy_not_in?: string[];\n\n lastPublishedBy?: string;\n lastPublishedBy_not?: string;\n lastPublishedBy_in?: string[];\n lastPublishedBy_not_in?: string[];\n\n /**\n * Version of the entry.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n version?: number;\n version_lt?: number;\n version_gt?: number;\n /**\n * Each storage operations implementation MUST determine how to use this field.\n * In SQL, it can be a `published` field, and in DynamoDB it can be an SK.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n published?: boolean;\n /**\n * Each storage operations implementation MUST determine how to use this field.\n * In SQL, it can be a `latest` field, and in DynamoDB it can be an SK.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n latest?: boolean;\n /**\n * ACO related parameters.\n */\n wbyAco_location?: {\n folderId?: string;\n folderId_not?: string;\n folderId_in?: string[];\n folderId_not_in?: string[];\n AND?: CmsEntryListWhere[];\n OR?: CmsEntryListWhere[];\n };\n\n /**\n * This is to allow querying by any content model field defined by the user.\n */\n [key: string]:\n | string\n | number\n | boolean\n | Date\n | undefined\n | string[]\n | number[]\n | null\n | CmsEntryListWhere[]\n | CmsEntryListWhere\n | CmsEntryListWhereRef;\n\n /**\n * To allow querying via nested queries, we added the AND / OR properties.\n */\n AND?: CmsEntryListWhere[];\n OR?: CmsEntryListWhere[];\n}\n\n/**\n * Entry listing sort.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport type CmsEntryListSortAsc = `${string}_ASC`;\nexport type CmsEntryListSortDesc = `${string}_DESC`;\nexport type CmsEntryListSort = (CmsEntryListSortAsc | CmsEntryListSortDesc)[];\n\n/**\n * Get entry GraphQL resolver params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryGetParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n}\n\n/**\n * List entries GraphQL resolver params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryListParams {\n where?: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n search?: string;\n fields?: string[];\n limit?: number;\n after?: string | null;\n}\n\n/**\n * Meta information for GraphQL output.\n *\n * @category CmsEntry\n * @category GraphQL output\n */\nexport interface CmsEntryMeta {\n /**\n * A cursor for pagination.\n */\n cursor: string | null;\n /**\n * Is there more items to load?\n */\n hasMoreItems: boolean;\n /**\n * Total count of the items in the storage.\n */\n totalCount: number;\n}\n\n/**\n * Create\n */\nexport interface OnEntryBeforeCreateTopicParams {\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterCreateTopicParams {\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryCreateErrorTopicParams {\n error: Error;\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Revision Create\n */\nexport interface OnEntryRevisionBeforeCreateTopicParams {\n input: CreateFromCmsEntryInput;\n entry: CmsEntry;\n original: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionAfterCreateTopicParams {\n input: CreateFromCmsEntryInput;\n entry: CmsEntry;\n original: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryCreateRevisionErrorTopicParams {\n error: Error;\n input: CreateFromCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Update\n */\nexport interface OnEntryBeforeUpdateTopicParams {\n input: UpdateCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterUpdateTopicParams {\n input: UpdateCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryUpdateErrorTopicParams {\n error: Error;\n input: UpdateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Move\n */\nexport interface OnEntryBeforeMoveTopicParams {\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterMoveTopicParams {\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryMoveErrorTopicParams {\n error: Error;\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Publish\n */\nexport interface OnEntryBeforePublishTopicParams {\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterPublishTopicParams {\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryPublishErrorTopicParams {\n error: Error;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Republish\n */\nexport interface OnEntryBeforeRepublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterRepublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryRepublishErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Unpublish\n */\nexport interface OnEntryBeforeUnpublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterUnpublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryUnpublishErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Delete\n */\nexport interface OnEntryBeforeDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n permanent: boolean;\n}\n\nexport interface OnEntryAfterDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n permanent: boolean;\n}\n\nexport interface OnEntryDeleteErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n permanent: boolean;\n model: CmsModel;\n}\n\n/**\n * Restore from bin\n */\nexport interface OnEntryBeforeRestoreFromBinTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterRestoreFromBinTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryRestoreFromBinErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Delete Revision\n */\nexport interface OnEntryRevisionBeforeDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionAfterDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionDeleteErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Delete multiple\n */\nexport interface OnEntryBeforeDeleteMultipleTopicParams {\n model: CmsModel;\n entries: CmsEntry[];\n ids: string[];\n}\n\nexport interface OnEntryAfterDeleteMultipleTopicParams {\n model: CmsModel;\n entries: CmsEntry[];\n ids: string[];\n}\n\nexport interface OnEntryDeleteMultipleErrorTopicParams {\n model: CmsModel;\n entries: CmsEntry[];\n ids: string[];\n error: Error;\n}\n\n/**\n * Get\n */\nexport interface OnEntryBeforeGetTopicParams {\n model: CmsModel;\n where: CmsEntryListWhere;\n}\n\n/**\n * List\n */\nexport interface EntryBeforeListTopicParams {\n where: CmsEntryListWhere;\n model: CmsModel;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport type CreateCmsEntryInput<TValues = CmsEntryValues> = TValues & {\n id?: string;\n status?: CmsEntryStatus;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date | string;\n modifiedOn?: Date | string | null;\n savedOn?: Date | string;\n deletedOn?: Date | string | null;\n restoredOn?: Date | string | null;\n createdBy?: CmsIdentity;\n savedBy?: CmsIdentity;\n deletedBy?: CmsIdentity | null;\n restoredBy?: CmsIdentity | null;\n firstPublishedOn?: Date | string;\n lastPublishedOn?: Date | string;\n firstPublishedBy?: CmsIdentity;\n lastPublishedBy?: CmsIdentity;\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date | string;\n revisionModifiedOn?: Date | string | null;\n revisionSavedOn?: Date | string;\n revisionDeletedOn?: Date | string | null;\n revisionRestoredOn?: Date | string | null;\n revisionCreatedBy?: CmsIdentity;\n revisionModifiedBy?: CmsIdentity | null;\n revisionSavedBy?: CmsIdentity;\n revisionDeletedBy?: CmsIdentity | null;\n revisionRestoredBy?: CmsIdentity | null;\n revisionFirstPublishedOn?: Date | string;\n revisionLastPublishedOn?: Date | string;\n revisionFirstPublishedBy?: CmsIdentity;\n revisionLastPublishedBy?: CmsIdentity;\n\n wbyAco_location?: {\n folderId?: string | null;\n };\n};\n\nexport interface CreateCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface CreateFromCmsEntryInput {\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date;\n revisionSavedOn?: Date;\n revisionModifiedOn?: Date;\n revisionCreatedBy?: CmsIdentity;\n revisionModifiedBy?: CmsIdentity;\n revisionSavedBy?: CmsIdentity;\n revisionFirstPublishedOn?: Date | string;\n revisionLastPublishedOn?: Date | string;\n revisionFirstPublishedBy?: CmsIdentity;\n revisionLastPublishedBy?: CmsIdentity;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date;\n savedOn?: Date;\n modifiedOn?: Date;\n createdBy?: CmsIdentity;\n modifiedBy?: CmsIdentity;\n savedBy?: CmsIdentity;\n firstPublishedOn?: Date | string;\n lastPublishedOn?: Date | string;\n firstPublishedBy?: CmsIdentity;\n lastPublishedBy?: CmsIdentity;\n\n [key: string]: any;\n}\n\nexport interface CreateRevisionCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport type UpdateCmsEntryInput<TValues = CmsEntryValues> = TValues & {\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date | string | null;\n revisionModifiedOn?: Date | string | null;\n revisionSavedOn?: Date | string | null;\n revisionDeletedOn?: Date | string | null;\n revisionRestoredOn?: Date | string | null;\n revisionFirstPublishedOn?: Date | string | null;\n revisionLastPublishedOn?: Date | string | null;\n revisionModifiedBy?: CmsIdentity | null;\n revisionCreatedBy?: CmsIdentity | null;\n revisionSavedBy?: CmsIdentity | null;\n revisionDeletedBy?: CmsIdentity | null;\n revisionRestoredBy?: CmsIdentity | null;\n revisionFirstPublishedBy?: CmsIdentity | null;\n revisionLastPublishedBy?: CmsIdentity | null;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date | string | null;\n modifiedOn?: Date | string | null;\n savedOn?: Date | string | null;\n deletedOn?: Date | string | null;\n restoredOn?: Date | string | null;\n firstPublishedOn?: Date | string | null;\n lastPublishedOn?: Date | string | null;\n createdBy?: CmsIdentity | null;\n modifiedBy?: CmsIdentity | null;\n savedBy?: CmsIdentity | null;\n deletedBy?: CmsIdentity | null;\n restoredBy?: CmsIdentity | null;\n firstPublishedBy?: CmsIdentity | null;\n lastPublishedBy?: CmsIdentity | null;\n\n wbyAco_location?: {\n folderId?: string | null;\n };\n};\n\nexport interface UpdateCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface GetUniqueFieldValuesParams {\n where: CmsEntryListWhere;\n fieldId: string;\n}\n\n/**\n * @category CmsEntry\n */\nexport interface CmsDeleteEntryOptions {\n /**\n * Runs the delete commands even if the entry is not found in the DynamoDB.\n * This is to force clean the entry records that might have been left behind a failed delete.\n */\n force?: boolean;\n /**\n * Destroying the entry directly, without moving it to the bin.\n */\n permanently?: boolean;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface DeleteMultipleEntriesParams {\n entries: string[];\n}\n\nexport type DeleteMultipleEntriesResponse = {\n id: string;\n}[];\n\nexport interface CmsEntryValidateResponse {\n [key: string]: any;\n}\n\n/**\n * Parameters for CmsEntryResolverFactory.\n *\n * @category GraphQL resolver\n * @category CmsEntry\n */\ninterface CmsEntryResolverFactoryParams {\n model: CmsModel;\n fieldTypePlugins: CmsFieldTypePlugins;\n}\n\n/**\n * A type for EntryResolvers. Used when creating get, list, update, publish, ...etc.\n *\n * @category GraphQL resolver\n * @category CmsEntry\n */\nexport type CmsEntryResolverFactory<TSource = any, TArgs = any, TContext = CmsContext> = {\n (params: CmsEntryResolverFactoryParams): GraphQLFieldResolver<TSource, TArgs, TContext>;\n};\n\n/**\n * A base security permission for CMS.\n *\n * @category SecurityPermission\n */\nexport interface BaseCmsSecurityPermission extends SecurityPermission {\n own?: boolean;\n rwd: string;\n}\n\n/**\n * A security permission for content model.\n *\n * @category SecurityPermission\n * @category CmsModel\n */\nexport interface CmsModelPermission extends BaseCmsSecurityPermission {\n /**\n * An object representing `key: model.modelId` values where key is locale code.\n */\n models?: {\n [key: string]: string[];\n };\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\n/**\n * The security permission for content model groups.\n *\n * @category SecurityPermission\n * @category CmsGroup\n */\nexport interface CmsGroupPermission extends BaseCmsSecurityPermission {\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\n/**\n * The security permission for content entry.\n *\n * @category SecurityPermission\n * @category CmsEntry\n */\nexport interface CmsEntryPermission extends BaseCmsSecurityPermission {\n pw?: string;\n /**\n * An object representing `key: model.modelId` values where key is locale code.\n */\n models?: {\n [key: string]: string[];\n };\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\nexport interface CmsGroupStorageOperationsGetParams {\n id: string;\n tenant: string;\n locale: string;\n}\n\nexport interface CmsGroupStorageOperationsListWhereParams {\n tenant: string;\n locale: string;\n\n [key: string]: any;\n}\n\nexport interface CmsGroupStorageOperationsListParams {\n where: CmsGroupStorageOperationsListWhereParams;\n sort?: string[];\n}\n\nexport interface CmsGroupStorageOperationsCreateParams {\n group: CmsGroup;\n}\n\nexport interface CmsGroupStorageOperationsUpdateParams {\n group: CmsGroup;\n}\n\nexport interface CmsGroupStorageOperationsDeleteParams {\n group: CmsGroup;\n}\n\n/**\n * Description of the CmsGroup CRUD operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n */\nexport interface CmsGroupStorageOperations {\n /**\n * Gets content model group by given id.\n */\n get: (params: CmsGroupStorageOperationsGetParams) => Promise<CmsGroup | null>;\n /**\n * List all content model groups. Filterable via params.\n */\n list: (params: CmsGroupStorageOperationsListParams) => Promise<CmsGroup[]>;\n /**\n * Create a new content model group.\n */\n create: (params: CmsGroupStorageOperationsCreateParams) => Promise<CmsGroup>;\n /**\n * Update existing content model group.\n */\n update: (params: CmsGroupStorageOperationsUpdateParams) => Promise<CmsGroup>;\n /**\n * Delete the content model group.\n */\n delete: (params: CmsGroupStorageOperationsDeleteParams) => Promise<CmsGroup>;\n}\n\nexport interface CmsModelStorageOperationsGetParams {\n tenant: string;\n locale: string;\n modelId: string;\n}\n\nexport interface CmsModelStorageOperationsListWhereParams {\n tenant: string;\n locale: string;\n\n [key: string]: string;\n}\n\nexport interface CmsModelStorageOperationsListParams {\n where: CmsModelStorageOperationsListWhereParams;\n}\n\nexport interface CmsModelStorageOperationsCreateParams {\n model: CmsModel;\n}\n\nexport interface CmsModelStorageOperationsUpdateParams {\n model: CmsModel;\n}\n\nexport interface CmsModelStorageOperationsDeleteParams {\n model: CmsModel;\n}\n\n/**\n * Description of the CmsModel storage operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n */\nexport interface CmsModelStorageOperations {\n /**\n * Gets content model by given id.\n */\n get: (params: CmsModelStorageOperationsGetParams) => Promise<CmsModel | null>;\n /**\n * List all content models. Filterable via params.\n */\n list: (params: CmsModelStorageOperationsListParams) => Promise<CmsModel[]>;\n /**\n * Create a new content model.\n */\n create: (params: CmsModelStorageOperationsCreateParams) => Promise<CmsModel>;\n /**\n * Update existing content model.\n */\n update: (params: CmsModelStorageOperationsUpdateParams) => Promise<CmsModel>;\n /**\n * Delete the content model.\n */\n delete: (params: CmsModelStorageOperationsDeleteParams) => Promise<CmsModel>;\n}\n\nexport interface CmsEntryStorageOperationsGetParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n limit?: number;\n}\n\nexport interface CmsEntryStorageOperationsListParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n search?: string;\n fields?: string[];\n limit: number;\n after?: string | null;\n}\n\nexport interface CmsEntryStorageOperationsCreateParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsCreateRevisionFromParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsUpdateParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsDeleteRevisionParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Entry that was deleted.\n */\n entry: CmsEntry;\n /**\n * Entry that was deleted, directly from storage, with transformations.\n */\n storageEntry: T;\n /**\n * Entry that was set as latest.\n */\n latestEntry: CmsEntry | null;\n /**\n * Entry that was set as latest, directly from storage, with transformations.\n */\n latestStorageEntry: T | null;\n}\n\nexport interface CmsEntryStorageOperationsDeleteParams {\n entry: CmsEntry;\n}\n\nexport interface CmsEntryStorageOperationsMoveToBinParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as published.\n * Entry is in its original form.\n */\n entry: CmsEntry;\n /**\n * The modified entry and prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsRestoreFromBinParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as restored.\n * Entry is in its original form.\n */\n entry: CmsEntry;\n /**\n * The modified entry and prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsDeleteEntriesParams {\n entries: string[];\n}\n\nexport interface CmsEntryStorageOperationsPublishParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as published.\n * Entry is in its original form.\n */\n entry: CmsEntry;\n /**\n * The modified entry and prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsUnpublishParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as unpublished.\n */\n entry: CmsEntry;\n /**\n * The modified entry that is going to be saved as unpublished, with transformations on it.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsGetUniqueFieldValuesParams {\n where: CmsEntryListWhere;\n fieldId: string;\n}\n\nexport interface CmsEntryStorageOperationsGetByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetLatestByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetPublishedByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetRevisionsParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetPublishedRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetLatestRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetPreviousRevisionParams {\n entryId: string;\n version: number;\n}\n\nexport interface CmsEntryStorageOperationsListResponse<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Has more items to load with the current filtering?\n */\n hasMoreItems: boolean;\n /**\n * Items loaded with current filtering.\n */\n items: T[];\n /**\n * Pointer for where to start the new item set.\n */\n cursor: string | null;\n /**\n * Total amount of items with the current filter.\n */\n totalCount: number;\n}\n\n/**\n * Description of the CmsModel storage operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n *\n *\n * @category StorageOperations\n * @category CmsEntry\n */\nexport interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorageEntry> {\n /**\n * Get all the entries of the ids.\n */\n getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;\n /**\n * Get all the published entries of the ids.\n */\n getPublishedByIds: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPublishedByIdsParams\n ) => Promise<T[]>;\n /**\n * Get all the latest entries of the ids.\n */\n getLatestByIds: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetLatestByIdsParams\n ) => Promise<T[]>;\n /**\n * Get all revisions of the given entry id.\n */\n getRevisions: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetRevisionsParams\n ) => Promise<T[]>;\n /**\n * Get the entry by the given revision id.\n */\n getRevisionById: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the published entry by given entryId.\n */\n getPublishedRevisionByEntryId: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPublishedRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the latest entry by given entryId.\n */\n getLatestRevisionByEntryId: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetLatestRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the revision of the entry before given one.\n */\n getPreviousRevision: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPreviousRevisionParams\n ) => Promise<T | null>;\n /**\n * Gets entry by given params.\n */\n get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;\n /**\n * List all entries. Filterable via params.\n */\n list: (\n model: CmsModel,\n params: CmsEntryStorageOperationsListParams\n ) => Promise<CmsEntryStorageOperationsListResponse<T>>;\n /**\n * Create a new entry.\n */\n create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;\n /**\n * Create a new entry from existing one.\n */\n createRevisionFrom: (\n model: CmsModel,\n params: CmsEntryStorageOperationsCreateRevisionFromParams<T>\n ) => Promise<T>;\n /**\n * Update existing entry.\n */\n update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;\n /**\n * Move entry and all its entries into a new folder.\n */\n move: (model: CmsModel, id: string, folderId: string) => Promise<void>;\n /**\n * Delete the entry revision.\n */\n deleteRevision: (\n model: CmsModel,\n params: CmsEntryStorageOperationsDeleteRevisionParams<T>\n ) => Promise<void>;\n /**\n * Delete the entry.\n */\n delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;\n /**\n * Move the entry to bin.\n */\n moveToBin: (model: CmsModel, params: CmsEntryStorageOperationsMoveToBinParams) => Promise<void>;\n /**\n * Restore the entry from the bin.\n */\n restoreFromBin: (\n model: CmsModel,\n params: CmsEntryStorageOperationsRestoreFromBinParams<T>\n ) => Promise<T>;\n /**\n * Delete multiple entries, with a limit on how much can be deleted in one call.\n */\n deleteMultipleEntries: (\n model: CmsModel,\n params: CmsEntryStorageOperationsDeleteEntriesParams\n ) => Promise<void>;\n /**\n * Publish the entry.\n */\n publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;\n /**\n * Unpublish the entry.\n */\n unpublish: (model: CmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;\n /**\n * Method to list all the unique values for the given field id.\n * Simplest use case would be to aggregate tags for some content.\n * @internal\n */\n getUniqueFieldValues: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetUniqueFieldValuesParams\n ) => Promise<CmsEntryUniqueValue[]>;\n}\n\nexport enum CONTENT_ENTRY_STATUS {\n DRAFT = \"draft\",\n PUBLISHED = \"published\",\n UNPUBLISHED = \"unpublished\"\n}\n\nexport interface CmsSystem {\n version?: string;\n readAPIKey?: string;\n /**\n * System tenant.\n */\n tenant: string;\n}\n\nexport interface CmsSystemStorageOperationsGetParams {\n tenant: string;\n}\n\nexport interface CmsSystemStorageOperationsCreateParams {\n system: CmsSystem;\n}\n\nexport interface CmsSystemStorageOperationsUpdateParams {\n system: CmsSystem;\n}\n\nexport interface CmsSystemStorageOperations {\n /**\n * Get the system data.\n */\n get: (params: CmsSystemStorageOperationsGetParams) => Promise<CmsSystem | null>;\n /**\n * Create the system info in the storage.\n */\n create: (params: CmsSystemStorageOperationsCreateParams) => Promise<CmsSystem>;\n /**\n * Update the system info in the storage.\n */\n update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;\n}\n\nexport interface HeadlessCmsStorageOperations<C = CmsContext> {\n name: string;\n system: CmsSystemStorageOperations;\n groups: CmsGroupStorageOperations;\n models: CmsModelStorageOperations;\n entries: CmsEntryStorageOperations;\n /**\n * Either attach something from the storage operations or run something in it.\n */\n beforeInit: (context: C) => Promise<void>;\n init?: (context: C) => Promise<void>;\n}\n"],"mappings":";;;;;;AA2FA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AAKA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AAgCA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAwDA;AACA;AACA;AAiCA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAwCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AA4NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA8CA;AACA;AACA;AAiBA;AACA;AACA;AAoBA;AACA;AACA;AAoBA;AACA;AACA;AAcA;AACA;AACA;AAMA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AAqFA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AA4IA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AAqBA;AACA;AACA;AAwBA;AACA;AACA;AAuBA;AACA;AACA;AAoBA;AACA;AACA;AAqBA;AACA;AACA;AAkBA;AACA;AACA;AAkBA;AACA;AACA;AAoBA;AACA;AACA;AAkBA;AACA;AACA;AAiBA;AACA;AACA;AAoBA;AACA;AACA;AAMA;AACA;AACA;AAMA;AACA;AACA;AACA;AAiDA;AACA;AACA;AACA;AAqCA;AACA;AACA;AACA;AA+CA;AACA;AACA;AACA;AAMA;AACA;AACA;AAaA;AACA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AA+CA;AACA;AACA;AACA;AACA;AAqDA;AACA;AACA;AACA;AACA;AA6NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IA6IYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["CONTENT_ENTRY_STATUS","exports"],"sources":["types.ts"],"sourcesContent":["import type { Plugin } from \"@webiny/plugins/types\";\nimport type { I18NContext, I18NLocale } from \"@webiny/api-i18n/types\";\nimport type { Context, GenericRecord } from \"@webiny/api/types\";\nimport type {\n GraphQLFieldResolver,\n GraphQLRequestBody,\n Resolvers\n} from \"@webiny/handler-graphql/types\";\nimport type { processRequestBody } from \"@webiny/handler-graphql\";\nimport type { SecurityPermission } from \"@webiny/api-security/types\";\nimport type { DbContext } from \"@webiny/handler-db/types\";\nimport type { Topic } from \"@webiny/pubsub/types\";\nimport type { CmsModelConverterCallable } from \"~/utils/converters/ConverterCollection\";\nimport type { HeadlessCmsExport, HeadlessCmsImport } from \"~/export/types\";\nimport type { AccessControl } from \"~/crud/AccessControl/AccessControl\";\nimport type { CmsModelToAstConverter } from \"~/utils/contentModelAst/CmsModelToAstConverter\";\nimport type { CmsModelFieldToGraphQLPlugin } from \"./plugins\";\nimport type { CmsEntryContext } from \"./context\";\nimport type { CmsModelField, CmsModelFieldValidation, CmsModelUpdateInput } from \"./modelField\";\nimport type { CmsModel, CmsModelCreateFromInput, CmsModelCreateInput } from \"./model\";\nimport type { CmsGroup } from \"./modelGroup\";\nimport type { CmsIdentity } from \"./identity\";\nimport type { ISingletonModelManager } from \"~/modelManager\";\n\nexport interface CmsError {\n message: string;\n code: string;\n data: GenericRecord;\n stack?: string;\n}\n\nexport interface CmsError {\n message: string;\n code: string;\n data: GenericRecord;\n stack?: string;\n}\n\nexport type ApiEndpoint = \"manage\" | \"preview\" | \"read\";\n\nexport interface HeadlessCms\n extends CmsSystemContext,\n CmsGroupContext,\n CmsModelContext,\n CmsEntryContext {\n /**\n * API type\n */\n type: ApiEndpoint | null;\n /**\n * Requested locale\n */\n locale: string;\n /**\n * returns an instance of current locale\n */\n getLocale: () => I18NLocale;\n /**\n * Means this request is a READ API\n */\n READ: boolean;\n /**\n * Means this request is a MANAGE API\n */\n MANAGE: boolean;\n /**\n * Means this request is a PREVIEW API\n */\n PREVIEW: boolean;\n /**\n * The storage operations loaded for current context.\n */\n storageOperations: HeadlessCmsStorageOperations;\n\n /**\n * Use to ensure perform authorization and ensure identities have access to the groups, models and entries.\n */\n accessControl: AccessControl;\n\n /**\n * Export operations.\n */\n export: HeadlessCmsExport;\n importing: HeadlessCmsImport;\n getExecutableSchema: GetExecutableSchema;\n}\n\nexport type GetExecutableSchema = (\n type: ApiEndpoint\n) => Promise<\n <TData = Record<string, any>, TExtensions = Record<string, any>>(\n input: GraphQLRequestBody | GraphQLRequestBody[]\n ) => ReturnType<typeof processRequestBody<TData, TExtensions>>\n>;\n\n/**\n * @description This combines all contexts used in the CMS into a single one.\n *\n * @category Context\n */\nexport interface CmsContext extends Context, DbContext, I18NContext {\n cms: HeadlessCms;\n}\n\n/**\n * Used for our internal functionality.\n */\nexport interface CmsModelFieldWithParent extends CmsModelField {\n parent?: CmsModelFieldWithParent | null;\n}\n\n/**\n * A definition for dateTime field to show possible type of the field in settings.\n */\nexport interface CmsModelDateTimeField extends CmsModelField {\n /**\n * Settings object for the field. Contains `type` property.\n */\n settings: {\n type: \"time\" | \"date\" | \"dateTimeWithoutTimezone\" | \"dateTimeWithTimezone\";\n };\n}\n\n/**\n * Arguments for the field validator validate method.\n *\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldValidatorValidateParams<T = any> {\n /**\n * A value to be validated.\n */\n value: T;\n /**\n * Options from the CmsModelField validations.\n *\n * @see CmsModelField.validation\n * @see CmsModelField.listValidation\n */\n validator: CmsModelFieldValidation;\n /**\n * An instance of the current context.\n */\n context: CmsContext;\n /**\n * Field being validated.\n */\n field: CmsModelField;\n /**\n * An instance of the content model being validated.\n */\n model: CmsModel;\n /**\n * If entry is sent it means it is an update operation.\n * First usage is for the unique field value.\n */\n entry?: CmsEntry;\n}\n\n/**\n * When sending model to the storage operations, it must contain createValueKeyToStorageConverter and createValueKeyFromStorageConverter\n *\n * @category CmsModel\n */\nexport interface StorageOperationsCmsModel extends CmsModel {\n convertValueKeyToStorage: CmsModelConverterCallable;\n convertValueKeyFromStorage: CmsModelConverterCallable;\n}\n\n/**\n * @category ModelField\n */\nexport interface CmsModelFieldDefinition {\n fields: string;\n typeDefs?: string;\n}\n\nexport interface CmsModelFieldToGraphQLNormalizeInputParams<TField> {\n model: CmsModel;\n field: TField;\n input: GenericRecord<string> | Array<GenericRecord<string>>;\n}\n\ninterface CmsModelFieldToGraphQLCreateResolverParams<TField> {\n models: CmsModel[];\n model: CmsModel;\n graphQLType: string;\n field: TField;\n createFieldResolvers: any;\n fieldTypePlugins: CmsFieldTypePlugins;\n}\n\nexport interface CmsModelFieldToGraphQLCreateResolver<TField = CmsModelField> {\n (params: CmsModelFieldToGraphQLCreateResolverParams<TField>):\n | GraphQLFieldResolver\n | {\n resolver: GraphQLFieldResolver | null;\n typeResolvers: Resolvers<CmsContext>;\n }\n | false;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams<\n TField extends CmsModelField = CmsModelField\n> {\n fields: TField[];\n originalFields: TField[];\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidate {\n (params: CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams): void;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsParams<\n TField extends CmsModelField = CmsModelField\n> {\n field: TField;\n originalField?: TField;\n validate: CmsModelFieldToGraphQLPluginValidateChildFieldsValidate;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFields<\n TField extends CmsModelField = CmsModelField\n> {\n (params: CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField>): void;\n}\n\n/**\n * @category ModelField\n */\nexport interface CmsFieldTypePlugins {\n [key: string]: CmsModelFieldToGraphQLPlugin;\n}\n\nexport interface OnSystemBeforeInstallTopicParams {\n tenant: string;\n locale: string;\n}\n\nexport interface OnSystemAfterInstallTopicParams {\n tenant: string;\n locale: string;\n}\n\nexport interface OnSystemInstallErrorTopicParams {\n error: Error;\n tenant: string;\n locale: string;\n}\n\nexport type CmsSystemContext = {\n getSystemVersion: () => Promise<string | null>;\n setSystemVersion: (version: string) => Promise<void>;\n installSystem: () => Promise<void>;\n /**\n * Lifecycle Events\n */\n onSystemBeforeInstall: Topic<OnSystemBeforeInstallTopicParams>;\n onSystemAfterInstall: Topic<OnSystemAfterInstallTopicParams>;\n onSystemInstallError: Topic<OnSystemInstallErrorTopicParams>;\n};\n\n/**\n * A GraphQL `params.data` parameter received when creating content model group.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupCreateInput {\n id?: string;\n name: string;\n slug?: string;\n description?: string | null;\n icon: string;\n}\n\n/**\n * A GraphQL `params.data` parameter received when updating content model group.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupUpdateInput {\n name?: string;\n slug?: string;\n description?: string;\n icon?: string;\n}\n\n/**\n * A `data.where` parameter received when listing content model groups.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupListParams {\n where: {\n tenant: string;\n locale: string;\n };\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeCreateTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterCreateTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupCreateErrorTopicParams {\n input: CmsGroupCreateInput;\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeUpdateTopicParams {\n original: CmsGroup;\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterUpdateTopicParams {\n original: CmsGroup;\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupUpdateErrorTopicParams {\n input: CmsGroupUpdateInput;\n original: CmsGroup;\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeDeleteTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterDeleteTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupDeleteErrorTopicParams {\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * Cms Group in context.\n *\n * @category Context\n * @category CmsGroup\n */\nexport interface CmsGroupContext {\n /**\n * Gets content model group by given id.\n */\n getGroup: (id: string) => Promise<CmsGroup>;\n /**\n * List all content model groups. Filterable via params.\n */\n listGroups: (params?: CmsGroupListParams) => Promise<CmsGroup[]>;\n /**\n * Create a new content model group.\n */\n createGroup: (data: CmsGroupCreateInput) => Promise<CmsGroup>;\n /**\n * Update existing content model group.\n */\n updateGroup: (id: string, data: CmsGroupUpdateInput) => Promise<CmsGroup>;\n /**\n * Delete content model group by given id.\n */\n deleteGroup: (id: string) => Promise<boolean>;\n /**\n * Clear the cached groups.\n */\n clearGroupsCache: () => void;\n /**\n * Lifecycle Events\n */\n onGroupBeforeCreate: Topic<OnGroupBeforeCreateTopicParams>;\n onGroupAfterCreate: Topic<OnGroupAfterCreateTopicParams>;\n onGroupCreateError: Topic<OnGroupCreateErrorTopicParams>;\n onGroupBeforeUpdate: Topic<OnGroupBeforeUpdateTopicParams>;\n onGroupAfterUpdate: Topic<OnGroupAfterUpdateTopicParams>;\n onGroupUpdateError: Topic<OnGroupUpdateErrorTopicParams>;\n onGroupBeforeDelete: Topic<OnGroupBeforeDeleteTopicParams>;\n onGroupAfterDelete: Topic<OnGroupAfterDeleteTopicParams>;\n onGroupDeleteError: Topic<OnGroupDeleteErrorTopicParams>;\n}\n\n/**\n * A plugin to load a CmsModelManager.\n *\n * @see CmsModelManager\n *\n * @category Plugin\n * @category CmsModel\n * @category CmsEntry\n */\nexport interface ModelManagerPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-content-model-manager\";\n /**\n * Specific model CmsModelManager loader. Can target exact modelId(s).\n * Be aware that if you define multiple plugins without `modelId`, last one will run.\n */\n modelId?: string[] | string;\n /**\n * Create a CmsModelManager for specific type - or new default one.\n * For reference in how is this plugin run check [contentModelManagerFactory](https://github.com/webiny/webiny-js/blob/f15676/packages/api-headless-cms/src/content/plugins/CRUD/contentModel/contentModelManagerFactory.ts)\n */\n create<T = any>(context: CmsContext, model: CmsModel): Promise<CmsModelManager<T>>;\n}\n\n/**\n * A content entry values definition for and from the database.\n *\n * @category Database model\n * @category CmsEntry\n */\nexport interface CmsEntryValues {\n [key: string]: any;\n}\n\n/**\n * A content entry definition for and from the database.\n *\n * @category Database model\n * @category CmsEntry\n */\nexport interface CmsEntry<T = CmsEntryValues> {\n /**\n * A version of the webiny this entry was created with.\n * This can be used when upgrading the system, so we know which entries to update.\n */\n webinyVersion: string;\n /**\n * Tenant id which is this entry for. Can be used in case of shared storage.\n */\n tenant: string;\n /**\n * Generated ID of the entry. It is shared across all the records in the database that represent a single entry.\n * So version 1, 2, ..., 2371 will have the same value in this field to link them together.\n */\n entryId: string;\n /**\n * Generated ID + version of the entry.\n */\n id: string;\n\n /**\n * Revision-level meta fields. 👇\n */\n\n /**\n * An ISO 8601 date/time string.\n */\n revisionCreatedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n revisionSavedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n revisionModifiedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionDeletedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionRestoredOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionFirstPublishedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionLastPublishedOn: string | null;\n\n /**\n * Identity that last ionCreated the entry.\n */\n revisionCreatedBy: CmsIdentity;\n /**\n * Identity that last ionSaved the entry.\n */\n revisionSavedBy: CmsIdentity;\n /**\n * Identity that last ionModified the entry.\n */\n revisionModifiedBy: CmsIdentity | null;\n /**\n * Identity that last deleted the revision.\n */\n revisionDeletedBy: CmsIdentity | null;\n /**\n * Identity that last restored the revision.\n */\n revisionRestoredBy: CmsIdentity | null;\n /**\n * Identity that first published the entry.\n */\n revisionFirstPublishedBy: CmsIdentity | null;\n /**\n * Identity that last published the entry.\n */\n revisionLastPublishedBy: CmsIdentity | null;\n\n /**\n * An ISO 8601 date/time string.\n */\n createdOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n savedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n modifiedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n deletedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n restoredOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n firstPublishedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n lastPublishedOn: string | null;\n\n /**\n * Identity that last created the entry.\n */\n createdBy: CmsIdentity;\n /**\n * Identity that last saved the entry.\n */\n savedBy: CmsIdentity;\n /**\n * Identity that last modified the entry.\n */\n modifiedBy: CmsIdentity | null;\n /**\n * Identity that last deleted the entry.\n */\n deletedBy: CmsIdentity | null;\n /**\n * Identity that last restored the entry.\n */\n restoredBy: CmsIdentity | null;\n /**\n * Identity that first published the entry.\n */\n firstPublishedBy: CmsIdentity | null;\n /**\n * Identity that last published the entry.\n */\n lastPublishedBy: CmsIdentity | null;\n\n /**\n * Deprecated fields. 👇\n */\n\n /**\n * @deprecated Will be removed with the 5.41.0 release. Use `createdBy` field instead.\n */\n ownedBy?: CmsIdentity | null;\n\n /**\n * @deprecated Will be removed with the 5.41.0 release. Use `firstPublishedOn` or `lastPublishedOn` field instead.\n */\n publishedOn?: string | null;\n\n /**\n * Model ID of the definition for the entry.\n * @see CmsModel\n */\n modelId: string;\n /**\n * A locale of the entry.\n * @see I18NLocale.code\n */\n locale: string;\n /**\n * A revision version of the entry.\n */\n version: number;\n /**\n * Is the entry locked?\n */\n locked: boolean;\n /**\n * Status type of the entry.\n */\n status: CmsEntryStatus;\n /**\n * A mapped storageId -> value object.\n *\n * @see CmsModelField\n */\n values: T;\n /**\n * Advanced Content Organization\n */\n location?: {\n folderId?: string | null;\n };\n /**\n * Settings for the given entry.\n *\n * Introduced with Advanced Publishing Workflow. Will always be inserted once this PR is merged.\n * Be aware that when accessing properties in it on old systems, it will break if not checked first.\n *\n * Available only on the Manage API in entry GraphQL type `meta.data` property.\n */\n meta?: {\n [key: string]: any;\n };\n /**\n * Is the entry in the bin?\n */\n wbyDeleted?: boolean | null;\n /**\n * This field preserves the original folderId value, as the ROOT_FOLDER is set upon deletion.\n * The value is utilized when restoring the entry from the trash bin.\n */\n binOriginalFolderId?: string | null;\n}\n\nexport interface CmsStorageEntry extends CmsEntry {\n [key: string]: any;\n}\n\nexport interface CmsEntryUniqueValue {\n value: string;\n count: number;\n}\n\n/**\n * A definition for content model manager to be used in the code.\n * The default one uses `CmsEntryContext` methods internally, but devs can change to what every they want.\n *\n * @see CmsEntryContext\n *\n * @category Context\n * @category CmsEntry\n * @category CmsModel\n */\nexport interface CmsModelManager<T = CmsEntryValues> {\n model: CmsModel;\n /**\n * List only published entries in the content model.\n */\n listPublished(params: CmsEntryListParams): Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * List latest entries in the content model. Used for administration.\n */\n listLatest(params: CmsEntryListParams): Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * Get a list of published entries by the ID list.\n */\n getPublishedByIds(ids: string[]): Promise<CmsEntry<T>[]>;\n /**\n * Get a list of the latest entries by the ID list.\n */\n getLatestByIds(ids: string[]): Promise<CmsEntry<T>[]>;\n /**\n * Get an entry filtered by given params. Will always get one.\n */\n get(id: string): Promise<CmsEntry<T>>;\n /**\n * Create an entry.\n */\n create<I>(\n data: CreateCmsEntryInput & I,\n options?: CreateCmsEntryOptionsInput\n ): Promise<CmsEntry<T>>;\n /**\n * Update an entry.\n */\n update(\n id: string,\n data: UpdateCmsEntryInput,\n options?: UpdateCmsEntryOptionsInput\n ): Promise<CmsEntry<T>>;\n /**\n * Delete an entry.\n */\n delete(id: string, options?: CmsDeleteEntryOptions): Promise<void>;\n}\n\nexport type ICmsEntryManager<T = GenericRecord> = CmsModelManager<T>;\n\n/**\n * Create\n */\nexport interface OnModelBeforeCreateTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n}\n\nexport interface OnModelAfterCreateTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n}\n\nexport interface OnModelCreateErrorTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Create From / Clone\n */\nexport interface OnModelBeforeCreateFromTopicParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelAfterCreateFromTopicParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelCreateFromErrorParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Update\n */\nexport interface OnModelBeforeUpdateTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelAfterUpdateTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelUpdateErrorTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Delete\n */\nexport interface OnModelBeforeDeleteTopicParams {\n model: CmsModel;\n}\n\nexport interface OnModelAfterDeleteTopicParams {\n model: CmsModel;\n}\n\nexport interface OnModelDeleteErrorTopicParams {\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Initialize\n */\nexport interface OnModelInitializeParams {\n model: CmsModel;\n data: Record<string, any>;\n}\n\n/**\n *\n */\nexport interface CmsModelUpdateDirectParams {\n model: CmsModel;\n original: CmsModel;\n}\n\nexport interface ICmsModelListParams {\n /**\n * Defaults to true.\n */\n includePrivate?: boolean;\n includePlugins?: boolean;\n}\n\n/**\n * Cms Model in the context.\n *\n * @category Context\n * @category CmsModel\n */\nexport interface CmsModelContext {\n /**\n * Get a single content model.\n *\n * @throws NotFoundError\n */\n getModel(modelId: string): Promise<CmsModel>;\n /**\n * Get model to AST converter.\n */\n getModelToAstConverter: () => CmsModelToAstConverter;\n /**\n * Get all content models.\n */\n listModels(params?: ICmsModelListParams): Promise<CmsModel[]>;\n /**\n * Create a content model.\n */\n createModel(data: CmsModelCreateInput): Promise<CmsModel>;\n /**\n * Create a content model from the given model - clone.\n */\n createModelFrom(modelId: string, data: CmsModelCreateFromInput): Promise<CmsModel>;\n /**\n * Update content model without data validation. Used internally.\n * @hidden\n */\n updateModelDirect(params: CmsModelUpdateDirectParams): Promise<CmsModel>;\n /**\n * Update content model.\n */\n updateModel(modelId: string, data: CmsModelUpdateInput): Promise<CmsModel>;\n /**\n * Delete content model. Should not allow deletion if there are entries connected to it.\n */\n deleteModel(modelId: string): Promise<void>;\n /**\n * Possibility for users to trigger the model initialization.\n * They can hook into it and do what ever they want to.\n *\n * Primary idea behind this is creating the index, for the code models, in the ES.\n */\n initializeModel(modelId: string, data: Record<string, any>): Promise<boolean>;\n /**\n * Get an instance of CmsModelManager for given content modelId.\n *\n * @see CmsModelManager\n */\n getEntryManager<T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel | string\n ): Promise<ICmsEntryManager<T>>;\n /**\n * A model manager for a model which has a single entry.\n */\n getSingletonEntryManager<T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel | string\n ): Promise<ISingletonModelManager<T>>;\n /**\n * Get all content model managers mapped by modelId.\n * @see CmsModelManager\n */\n getEntryManagers(): Map<string, ICmsEntryManager>;\n /**\n * Clear all the model caches.\n */\n clearModelsCache(): void;\n /**\n * Lifecycle Events\n */\n onModelBeforeCreate: Topic<OnModelBeforeCreateTopicParams>;\n onModelAfterCreate: Topic<OnModelAfterCreateTopicParams>;\n onModelCreateError: Topic<OnModelCreateErrorTopicParams>;\n onModelBeforeCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;\n onModelAfterCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;\n onModelCreateFromError: Topic<OnModelCreateFromErrorParams>;\n onModelBeforeUpdate: Topic<OnModelBeforeUpdateTopicParams>;\n onModelAfterUpdate: Topic<OnModelAfterUpdateTopicParams>;\n onModelUpdateError: Topic<OnModelUpdateErrorTopicParams>;\n onModelBeforeDelete: Topic<OnModelBeforeDeleteTopicParams>;\n onModelAfterDelete: Topic<OnModelAfterDeleteTopicParams>;\n onModelDeleteError: Topic<OnModelDeleteErrorTopicParams>;\n onModelInitialize: Topic<OnModelInitializeParams>;\n}\n\n/**\n * Available statuses for content entry.\n *\n * @category CmsEntry\n */\nexport type CmsEntryStatus = \"published\" | \"unpublished\" | \"draft\";\n\nexport interface CmsEntryListWhereRef {\n id?: string;\n id_in?: string[];\n id_not?: string;\n id_not_in?: string[];\n entryId?: string;\n entryId_not?: string;\n entryId_in?: string[];\n entryId_not_in?: string[];\n}\n\n/**\n * Entry listing where params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryListWhere {\n /**\n * Fields.\n */\n id?: string;\n id_in?: string[];\n id_not?: string;\n id_not_in?: string[];\n /**\n * Generated ID without the version.\n */\n entryId?: string;\n entryId_not?: string;\n entryId_in?: string[];\n entryId_not_in?: string[];\n /**\n * Status of the entry.\n */\n status?: CmsEntryStatus;\n status_not?: CmsEntryStatus;\n status_in?: CmsEntryStatus[];\n status_not_in?: CmsEntryStatus[];\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedBy?: string;\n revisionCreatedBy_not?: string;\n revisionCreatedBy_in?: string[];\n revisionCreatedBy_not_in?: string[];\n\n revisionModifiedBy?: string;\n revisionModifiedBy_not?: string;\n revisionModifiedBy_in?: string[];\n revisionModifiedBy_not_in?: string[];\n\n revisionSavedBy?: string;\n revisionSavedBy_not?: string;\n revisionSavedBy_in?: string[];\n revisionSavedBy_not_in?: string[];\n\n revisionFirstPublishedBy?: string;\n revisionFirstPublishedBy_not?: string;\n revisionFirstPublishedBy_in?: string[];\n revisionFirstPublishedBy_not_in?: string[];\n\n revisionLastPublishedBy?: string;\n revisionLastPublishedBy_not?: string;\n revisionLastPublishedBy_in?: string[];\n revisionLastPublishedBy_not_in?: string[];\n\n /**\n * Entry-level meta fields. 👇\n */\n createdBy?: string;\n createdBy_not?: string;\n createdBy_in?: string[];\n createdBy_not_in?: string[];\n\n modifiedBy?: string;\n modifiedBy_not?: string;\n modifiedBy_in?: string[];\n modifiedBy_not_in?: string[];\n\n savedBy?: string;\n savedBy_not?: string;\n savedBy_in?: string[];\n savedBy_not_in?: string[];\n\n firstPublishedBy?: string;\n firstPublishedBy_not?: string;\n firstPublishedBy_in?: string[];\n firstPublishedBy_not_in?: string[];\n\n lastPublishedBy?: string;\n lastPublishedBy_not?: string;\n lastPublishedBy_in?: string[];\n lastPublishedBy_not_in?: string[];\n\n /**\n * Version of the entry.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n version?: number;\n version_lt?: number;\n version_gt?: number;\n /**\n * Each storage operations implementation MUST determine how to use this field.\n * In SQL, it can be a `published` field, and in DynamoDB it can be an SK.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n published?: boolean;\n /**\n * Each storage operations implementation MUST determine how to use this field.\n * In SQL, it can be a `latest` field, and in DynamoDB it can be an SK.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n latest?: boolean;\n /**\n * ACO related parameters.\n */\n wbyAco_location?: {\n folderId?: string;\n folderId_not?: string;\n folderId_in?: string[];\n folderId_not_in?: string[];\n AND?: CmsEntryListWhere[];\n OR?: CmsEntryListWhere[];\n };\n\n /**\n * This is to allow querying by any content model field defined by the user.\n */\n [key: string]:\n | string\n | number\n | boolean\n | Date\n | undefined\n | string[]\n | number[]\n | null\n | CmsEntryListWhere[]\n | CmsEntryListWhere\n | CmsEntryListWhereRef;\n\n /**\n * To allow querying via nested queries, we added the AND / OR properties.\n */\n AND?: CmsEntryListWhere[];\n OR?: CmsEntryListWhere[];\n}\n\n/**\n * Entry listing sort.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport type CmsEntryListSortAsc = `${string}_ASC`;\nexport type CmsEntryListSortDesc = `${string}_DESC`;\nexport type CmsEntryListSort = (CmsEntryListSortAsc | CmsEntryListSortDesc)[];\n\n/**\n * Get entry GraphQL resolver params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryGetParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n}\n\n/**\n * List entries GraphQL resolver params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryListParams {\n where?: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n search?: string;\n fields?: string[];\n limit?: number;\n after?: string | null;\n}\n\n/**\n * Meta information for GraphQL output.\n *\n * @category CmsEntry\n * @category GraphQL output\n */\nexport interface CmsEntryMeta {\n /**\n * A cursor for pagination.\n */\n cursor: string | null;\n /**\n * Is there more items to load?\n */\n hasMoreItems: boolean;\n /**\n * Total count of the items in the storage.\n */\n totalCount: number;\n}\n\n/**\n * Create\n */\nexport interface OnEntryBeforeCreateTopicParams {\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterCreateTopicParams {\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryCreateErrorTopicParams {\n error: Error;\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Revision Create\n */\nexport interface OnEntryRevisionBeforeCreateTopicParams {\n input: CreateFromCmsEntryInput;\n entry: CmsEntry;\n original: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionAfterCreateTopicParams {\n input: CreateFromCmsEntryInput;\n entry: CmsEntry;\n original: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryCreateRevisionErrorTopicParams {\n error: Error;\n input: CreateFromCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Update\n */\nexport interface OnEntryBeforeUpdateTopicParams {\n input: UpdateCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterUpdateTopicParams {\n input: UpdateCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryUpdateErrorTopicParams {\n error: Error;\n input: UpdateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Move\n */\nexport interface OnEntryBeforeMoveTopicParams {\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterMoveTopicParams {\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryMoveErrorTopicParams {\n error: Error;\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Publish\n */\nexport interface OnEntryBeforePublishTopicParams {\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterPublishTopicParams {\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryPublishErrorTopicParams {\n error: Error;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Republish\n */\nexport interface OnEntryBeforeRepublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterRepublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryRepublishErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Unpublish\n */\nexport interface OnEntryBeforeUnpublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterUnpublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryUnpublishErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Delete\n */\nexport interface OnEntryBeforeDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n permanent: boolean;\n}\n\nexport interface OnEntryAfterDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n permanent: boolean;\n}\n\nexport interface OnEntryDeleteErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n permanent: boolean;\n model: CmsModel;\n}\n\n/**\n * Restore from bin\n */\nexport interface OnEntryBeforeRestoreFromBinTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterRestoreFromBinTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryRestoreFromBinErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Delete Revision\n */\nexport interface OnEntryRevisionBeforeDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionAfterDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionDeleteErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Delete multiple\n */\nexport interface OnEntryBeforeDeleteMultipleTopicParams {\n model: CmsModel;\n entries: CmsEntry[];\n ids: string[];\n}\n\nexport interface OnEntryAfterDeleteMultipleTopicParams {\n model: CmsModel;\n entries: CmsEntry[];\n ids: string[];\n}\n\nexport interface OnEntryDeleteMultipleErrorTopicParams {\n model: CmsModel;\n entries: CmsEntry[];\n ids: string[];\n error: Error;\n}\n\n/**\n * Get\n */\nexport interface OnEntryBeforeGetTopicParams {\n model: CmsModel;\n where: CmsEntryListWhere;\n}\n\n/**\n * List\n */\nexport interface EntryBeforeListTopicParams {\n where: CmsEntryListWhere;\n model: CmsModel;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport type CreateCmsEntryInput<TValues = CmsEntryValues> = TValues & {\n id?: string;\n status?: CmsEntryStatus;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date | string;\n modifiedOn?: Date | string | null;\n savedOn?: Date | string;\n deletedOn?: Date | string | null;\n restoredOn?: Date | string | null;\n createdBy?: CmsIdentity;\n savedBy?: CmsIdentity;\n deletedBy?: CmsIdentity | null;\n restoredBy?: CmsIdentity | null;\n firstPublishedOn?: Date | string;\n lastPublishedOn?: Date | string;\n firstPublishedBy?: CmsIdentity;\n lastPublishedBy?: CmsIdentity;\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date | string;\n revisionModifiedOn?: Date | string | null;\n revisionSavedOn?: Date | string;\n revisionDeletedOn?: Date | string | null;\n revisionRestoredOn?: Date | string | null;\n revisionCreatedBy?: CmsIdentity;\n revisionModifiedBy?: CmsIdentity | null;\n revisionSavedBy?: CmsIdentity;\n revisionDeletedBy?: CmsIdentity | null;\n revisionRestoredBy?: CmsIdentity | null;\n revisionFirstPublishedOn?: Date | string;\n revisionLastPublishedOn?: Date | string;\n revisionFirstPublishedBy?: CmsIdentity;\n revisionLastPublishedBy?: CmsIdentity;\n\n wbyAco_location?: {\n folderId?: string | null;\n };\n};\n\nexport interface CreateCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface CreateFromCmsEntryInput {\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date;\n revisionSavedOn?: Date;\n revisionModifiedOn?: Date;\n revisionCreatedBy?: CmsIdentity;\n revisionModifiedBy?: CmsIdentity;\n revisionSavedBy?: CmsIdentity;\n revisionFirstPublishedOn?: Date | string;\n revisionLastPublishedOn?: Date | string;\n revisionFirstPublishedBy?: CmsIdentity;\n revisionLastPublishedBy?: CmsIdentity;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date;\n savedOn?: Date;\n modifiedOn?: Date;\n createdBy?: CmsIdentity;\n modifiedBy?: CmsIdentity;\n savedBy?: CmsIdentity;\n firstPublishedOn?: Date | string;\n lastPublishedOn?: Date | string;\n firstPublishedBy?: CmsIdentity;\n lastPublishedBy?: CmsIdentity;\n\n [key: string]: any;\n}\n\nexport interface CreateRevisionCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport type UpdateCmsEntryInput<TValues = CmsEntryValues> = TValues & {\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date | string | null;\n revisionModifiedOn?: Date | string | null;\n revisionSavedOn?: Date | string | null;\n revisionDeletedOn?: Date | string | null;\n revisionRestoredOn?: Date | string | null;\n revisionFirstPublishedOn?: Date | string | null;\n revisionLastPublishedOn?: Date | string | null;\n revisionModifiedBy?: CmsIdentity | null;\n revisionCreatedBy?: CmsIdentity | null;\n revisionSavedBy?: CmsIdentity | null;\n revisionDeletedBy?: CmsIdentity | null;\n revisionRestoredBy?: CmsIdentity | null;\n revisionFirstPublishedBy?: CmsIdentity | null;\n revisionLastPublishedBy?: CmsIdentity | null;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date | string | null;\n modifiedOn?: Date | string | null;\n savedOn?: Date | string | null;\n deletedOn?: Date | string | null;\n restoredOn?: Date | string | null;\n firstPublishedOn?: Date | string | null;\n lastPublishedOn?: Date | string | null;\n createdBy?: CmsIdentity | null;\n modifiedBy?: CmsIdentity | null;\n savedBy?: CmsIdentity | null;\n deletedBy?: CmsIdentity | null;\n restoredBy?: CmsIdentity | null;\n firstPublishedBy?: CmsIdentity | null;\n lastPublishedBy?: CmsIdentity | null;\n\n wbyAco_location?: {\n folderId?: string | null;\n };\n};\n\nexport interface UpdateCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface GetUniqueFieldValuesParams {\n where: CmsEntryListWhere;\n fieldId: string;\n}\n\n/**\n * @category CmsEntry\n */\nexport interface CmsDeleteEntryOptions {\n /**\n * Runs the delete commands even if the entry is not found in the DynamoDB.\n * This is to force clean the entry records that might have been left behind a failed delete.\n */\n force?: boolean;\n /**\n * Destroying the entry directly, without moving it to the bin.\n */\n permanently?: boolean;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface DeleteMultipleEntriesParams {\n entries: string[];\n}\n\nexport type DeleteMultipleEntriesResponse = {\n id: string;\n}[];\n\nexport interface CmsEntryValidateResponse {\n [key: string]: any;\n}\n\n/**\n * Parameters for CmsEntryResolverFactory.\n *\n * @category GraphQL resolver\n * @category CmsEntry\n */\ninterface CmsEntryResolverFactoryParams {\n model: CmsModel;\n fieldTypePlugins: CmsFieldTypePlugins;\n}\n\n/**\n * A type for EntryResolvers. Used when creating get, list, update, publish, ...etc.\n *\n * @category GraphQL resolver\n * @category CmsEntry\n */\nexport type CmsEntryResolverFactory<TSource = any, TArgs = any, TContext = CmsContext> = {\n (params: CmsEntryResolverFactoryParams): GraphQLFieldResolver<TSource, TArgs, TContext>;\n};\n\n/**\n * A base security permission for CMS.\n *\n * @category SecurityPermission\n */\nexport interface BaseCmsSecurityPermission extends SecurityPermission {\n own?: boolean;\n rwd: string;\n}\n\n/**\n * A security permission for content model.\n *\n * @category SecurityPermission\n * @category CmsModel\n */\nexport interface CmsModelPermission extends BaseCmsSecurityPermission {\n /**\n * An object representing `key: model.modelId` values where key is locale code.\n */\n models?: {\n [key: string]: string[];\n };\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\n/**\n * The security permission for content model groups.\n *\n * @category SecurityPermission\n * @category CmsGroup\n */\nexport interface CmsGroupPermission extends BaseCmsSecurityPermission {\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\n/**\n * The security permission for content entry.\n *\n * @category SecurityPermission\n * @category CmsEntry\n */\nexport interface CmsEntryPermission extends BaseCmsSecurityPermission {\n pw?: string;\n /**\n * An object representing `key: model.modelId` values where key is locale code.\n */\n models?: {\n [key: string]: string[];\n };\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\nexport interface CmsGroupStorageOperationsGetParams {\n id: string;\n tenant: string;\n locale: string;\n}\n\nexport interface CmsGroupStorageOperationsListWhereParams {\n tenant: string;\n locale: string;\n\n [key: string]: any;\n}\n\nexport interface CmsGroupStorageOperationsListParams {\n where: CmsGroupStorageOperationsListWhereParams;\n sort?: string[];\n}\n\nexport interface CmsGroupStorageOperationsCreateParams {\n group: CmsGroup;\n}\n\nexport interface CmsGroupStorageOperationsUpdateParams {\n group: CmsGroup;\n}\n\nexport interface CmsGroupStorageOperationsDeleteParams {\n group: CmsGroup;\n}\n\n/**\n * Description of the CmsGroup CRUD operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n */\nexport interface CmsGroupStorageOperations {\n /**\n * Gets content model group by given id.\n */\n get: (params: CmsGroupStorageOperationsGetParams) => Promise<CmsGroup | null>;\n /**\n * List all content model groups. Filterable via params.\n */\n list: (params: CmsGroupStorageOperationsListParams) => Promise<CmsGroup[]>;\n /**\n * Create a new content model group.\n */\n create: (params: CmsGroupStorageOperationsCreateParams) => Promise<CmsGroup>;\n /**\n * Update existing content model group.\n */\n update: (params: CmsGroupStorageOperationsUpdateParams) => Promise<CmsGroup>;\n /**\n * Delete the content model group.\n */\n delete: (params: CmsGroupStorageOperationsDeleteParams) => Promise<CmsGroup>;\n}\n\nexport interface CmsModelStorageOperationsGetParams {\n tenant: string;\n locale: string;\n modelId: string;\n}\n\nexport interface CmsModelStorageOperationsListWhereParams {\n tenant: string;\n locale: string;\n\n [key: string]: string;\n}\n\nexport interface CmsModelStorageOperationsListParams {\n where: CmsModelStorageOperationsListWhereParams;\n}\n\nexport interface CmsModelStorageOperationsCreateParams {\n model: CmsModel;\n}\n\nexport interface CmsModelStorageOperationsUpdateParams {\n model: CmsModel;\n}\n\nexport interface CmsModelStorageOperationsDeleteParams {\n model: CmsModel;\n}\n\n/**\n * Description of the CmsModel storage operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n */\nexport interface CmsModelStorageOperations {\n /**\n * Gets content model by given id.\n */\n get: (params: CmsModelStorageOperationsGetParams) => Promise<CmsModel | null>;\n /**\n * List all content models. Filterable via params.\n */\n list: (params: CmsModelStorageOperationsListParams) => Promise<CmsModel[]>;\n /**\n * Create a new content model.\n */\n create: (params: CmsModelStorageOperationsCreateParams) => Promise<CmsModel>;\n /**\n * Update existing content model.\n */\n update: (params: CmsModelStorageOperationsUpdateParams) => Promise<CmsModel>;\n /**\n * Delete the content model.\n */\n delete: (params: CmsModelStorageOperationsDeleteParams) => Promise<CmsModel>;\n}\n\nexport interface CmsEntryStorageOperationsGetParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n limit?: number;\n}\n\nexport interface CmsEntryStorageOperationsListParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n search?: string;\n fields?: string[];\n limit: number;\n after?: string | null;\n}\n\nexport interface CmsEntryStorageOperationsCreateParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsCreateRevisionFromParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsUpdateParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsDeleteRevisionParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Entry that was deleted.\n */\n entry: CmsEntry;\n /**\n * Entry that was deleted, directly from storage, with transformations.\n */\n storageEntry: T;\n /**\n * Entry that was set as latest.\n */\n latestEntry: CmsEntry | null;\n /**\n * Entry that was set as latest, directly from storage, with transformations.\n */\n latestStorageEntry: T | null;\n}\n\nexport interface CmsEntryStorageOperationsDeleteParams {\n entry: CmsEntry;\n}\n\nexport interface CmsEntryStorageOperationsMoveToBinParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as published.\n * Entry is in its original form.\n */\n entry: CmsEntry;\n /**\n * The modified entry and prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsRestoreFromBinParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as restored.\n * Entry is in its original form.\n */\n entry: CmsEntry;\n /**\n * The modified entry and prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsDeleteEntriesParams {\n entries: string[];\n}\n\nexport interface CmsEntryStorageOperationsPublishParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as published.\n * Entry is in its original form.\n */\n entry: CmsEntry;\n /**\n * The modified entry and prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsUnpublishParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as unpublished.\n */\n entry: CmsEntry;\n /**\n * The modified entry that is going to be saved as unpublished, with transformations on it.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsGetUniqueFieldValuesParams {\n where: CmsEntryListWhere;\n fieldId: string;\n}\n\nexport interface CmsEntryStorageOperationsGetByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetLatestByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetPublishedByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetRevisionsParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetPublishedRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetLatestRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetPreviousRevisionParams {\n entryId: string;\n version: number;\n}\n\nexport interface CmsEntryStorageOperationsListResponse<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Has more items to load with the current filtering?\n */\n hasMoreItems: boolean;\n /**\n * Items loaded with current filtering.\n */\n items: T[];\n /**\n * Pointer for where to start the new item set.\n */\n cursor: string | null;\n /**\n * Total amount of items with the current filter.\n */\n totalCount: number;\n}\n\n/**\n * Description of the CmsModel storage operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n *\n *\n * @category StorageOperations\n * @category CmsEntry\n */\nexport interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorageEntry> {\n /**\n * Get all the entries of the ids.\n */\n getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;\n /**\n * Get all the published entries of the ids.\n */\n getPublishedByIds: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPublishedByIdsParams\n ) => Promise<T[]>;\n /**\n * Get all the latest entries of the ids.\n */\n getLatestByIds: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetLatestByIdsParams\n ) => Promise<T[]>;\n /**\n * Get all revisions of the given entry id.\n */\n getRevisions: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetRevisionsParams\n ) => Promise<T[]>;\n /**\n * Get the entry by the given revision id.\n */\n getRevisionById: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the published entry by given entryId.\n */\n getPublishedRevisionByEntryId: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPublishedRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the latest entry by given entryId.\n */\n getLatestRevisionByEntryId: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetLatestRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the revision of the entry before given one.\n */\n getPreviousRevision: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPreviousRevisionParams\n ) => Promise<T | null>;\n /**\n * Gets entry by given params.\n */\n get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;\n /**\n * List all entries. Filterable via params.\n */\n list: (\n model: CmsModel,\n params: CmsEntryStorageOperationsListParams\n ) => Promise<CmsEntryStorageOperationsListResponse<T>>;\n /**\n * Create a new entry.\n */\n create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;\n /**\n * Create a new entry from existing one.\n */\n createRevisionFrom: (\n model: CmsModel,\n params: CmsEntryStorageOperationsCreateRevisionFromParams<T>\n ) => Promise<T>;\n /**\n * Update existing entry.\n */\n update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;\n /**\n * Move entry and all its entries into a new folder.\n */\n move: (model: CmsModel, id: string, folderId: string) => Promise<void>;\n /**\n * Delete the entry revision.\n */\n deleteRevision: (\n model: CmsModel,\n params: CmsEntryStorageOperationsDeleteRevisionParams<T>\n ) => Promise<void>;\n /**\n * Delete the entry.\n */\n delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;\n /**\n * Move the entry to bin.\n */\n moveToBin: (model: CmsModel, params: CmsEntryStorageOperationsMoveToBinParams) => Promise<void>;\n /**\n * Restore the entry from the bin.\n */\n restoreFromBin: (\n model: CmsModel,\n params: CmsEntryStorageOperationsRestoreFromBinParams<T>\n ) => Promise<T>;\n /**\n * Delete multiple entries, with a limit on how much can be deleted in one call.\n */\n deleteMultipleEntries: (\n model: CmsModel,\n params: CmsEntryStorageOperationsDeleteEntriesParams\n ) => Promise<void>;\n /**\n * Publish the entry.\n */\n publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;\n /**\n * Unpublish the entry.\n */\n unpublish: (model: CmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;\n /**\n * Method to list all the unique values for the given field id.\n * Simplest use case would be to aggregate tags for some content.\n * @internal\n */\n getUniqueFieldValues: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetUniqueFieldValuesParams\n ) => Promise<CmsEntryUniqueValue[]>;\n}\n\nexport enum CONTENT_ENTRY_STATUS {\n DRAFT = \"draft\",\n PUBLISHED = \"published\",\n UNPUBLISHED = \"unpublished\"\n}\n\nexport interface CmsSystem {\n version?: string;\n readAPIKey?: string;\n /**\n * System tenant.\n */\n tenant: string;\n}\n\nexport interface CmsSystemStorageOperationsGetParams {\n tenant: string;\n}\n\nexport interface CmsSystemStorageOperationsCreateParams {\n system: CmsSystem;\n}\n\nexport interface CmsSystemStorageOperationsUpdateParams {\n system: CmsSystem;\n}\n\nexport interface CmsSystemStorageOperations {\n /**\n * Get the system data.\n */\n get: (params: CmsSystemStorageOperationsGetParams) => Promise<CmsSystem | null>;\n /**\n * Create the system info in the storage.\n */\n create: (params: CmsSystemStorageOperationsCreateParams) => Promise<CmsSystem>;\n /**\n * Update the system info in the storage.\n */\n update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;\n}\n\nexport interface HeadlessCmsStorageOperations<C = CmsContext> {\n name: string;\n system: CmsSystemStorageOperations;\n groups: CmsGroupStorageOperations;\n models: CmsModelStorageOperations;\n entries: CmsEntryStorageOperations;\n /**\n * Either attach something from the storage operations or run something in it.\n */\n beforeInit: (context: C) => Promise<void>;\n init?: (context: C) => Promise<void>;\n}\n"],"mappings":";;;;;;AA+FA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AAKA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AAgCA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAwDA;AACA;AACA;AAiCA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAwCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AA4NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA8CA;AACA;AACA;AAiBA;AACA;AACA;AAoBA;AACA;AACA;AAoBA;AACA;AACA;AAcA;AACA;AACA;AAMA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AAqFA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AA4IA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AAqBA;AACA;AACA;AAwBA;AACA;AACA;AAuBA;AACA;AACA;AAoBA;AACA;AACA;AAqBA;AACA;AACA;AAkBA;AACA;AACA;AAkBA;AACA;AACA;AAoBA;AACA;AACA;AAkBA;AACA;AACA;AAiBA;AACA;AACA;AAoBA;AACA;AACA;AAMA;AACA;AACA;AAMA;AACA;AACA;AACA;AAiDA;AACA;AACA;AACA;AAqCA;AACA;AACA;AACA;AA+CA;AACA;AACA;AACA;AAMA;AACA;AACA;AAaA;AACA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AA+CA;AACA;AACA;AACA;AACA;AAqDA;AACA;AACA;AACA;AACA;AA6NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IA6IYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { RichTextContents } from "../plugins";
2
- import { CmsContext } from "../types";
1
+ import type { RichTextContents } from "../plugins";
2
+ import type { CmsContext } from "../types";
3
3
  export declare class RichTextRenderer {
4
4
  private renderersMap;
5
5
  private plugins;
@@ -1 +1 @@
1
- {"version":3,"names":["_plugins","require","_RichTextPluginsProcessor","RichTextRenderer","renderersMap","Map","plugins","constructor","create","context","rendererPlugins","byType","CmsRichTextRendererPlugin","type","render","format","contents","renderer","getRendererByType","has","filter","plugin","set","RichTextPluginsProcessor","get","exports"],"sources":["RichTextRenderer.ts"],"sourcesContent":["import { CmsRichTextRendererPlugin, RichTextContents } from \"~/plugins\";\nimport { CmsContext } from \"~/types\";\nimport { RichTextPluginsProcessor } from \"~/graphqlFields/richText/RichTextPluginsProcessor\";\n\nexport class RichTextRenderer {\n private renderersMap = new Map<string, RichTextPluginsProcessor>();\n private plugins: CmsRichTextRendererPlugin[] = [];\n\n private constructor(plugins: CmsRichTextRendererPlugin[]) {\n this.plugins = plugins;\n }\n\n static create(context: CmsContext) {\n const rendererPlugins = context.plugins.byType<CmsRichTextRendererPlugin>(\n CmsRichTextRendererPlugin.type\n );\n return new RichTextRenderer(rendererPlugins);\n }\n\n async render(format: string, contents: RichTextContents) {\n const renderer = this.getRendererByType(format);\n\n return renderer.render(contents);\n }\n\n private getRendererByType(format: string) {\n if (!this.renderersMap.has(format)) {\n const plugins = this.plugins.filter(plugin => plugin.format === format);\n\n this.renderersMap.set(format, new RichTextPluginsProcessor(plugins));\n }\n\n return this.renderersMap.get(format) as RichTextPluginsProcessor;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,yBAAA,GAAAD,OAAA;AAEO,MAAME,gBAAgB,CAAC;EAClBC,YAAY,GAAG,IAAIC,GAAG,CAAmC,CAAC;EAC1DC,OAAO,GAAgC,EAAE;EAEzCC,WAAWA,CAACD,OAAoC,EAAE;IACtD,IAAI,CAACA,OAAO,GAAGA,OAAO;EAC1B;EAEA,OAAOE,MAAMA,CAACC,OAAmB,EAAE;IAC/B,MAAMC,eAAe,GAAGD,OAAO,CAACH,OAAO,CAACK,MAAM,CAC1CC,kCAAyB,CAACC,IAC9B,CAAC;IACD,OAAO,IAAIV,gBAAgB,CAACO,eAAe,CAAC;EAChD;EAEA,MAAMI,MAAMA,CAACC,MAAc,EAAEC,QAA0B,EAAE;IACrD,MAAMC,QAAQ,GAAG,IAAI,CAACC,iBAAiB,CAACH,MAAM,CAAC;IAE/C,OAAOE,QAAQ,CAACH,MAAM,CAACE,QAAQ,CAAC;EACpC;EAEQE,iBAAiBA,CAACH,MAAc,EAAE;IACtC,IAAI,CAAC,IAAI,CAACX,YAAY,CAACe,GAAG,CAACJ,MAAM,CAAC,EAAE;MAChC,MAAMT,OAAO,GAAG,IAAI,CAACA,OAAO,CAACc,MAAM,CAACC,MAAM,IAAIA,MAAM,CAACN,MAAM,KAAKA,MAAM,CAAC;MAEvE,IAAI,CAACX,YAAY,CAACkB,GAAG,CAACP,MAAM,EAAE,IAAIQ,kDAAwB,CAACjB,OAAO,CAAC,CAAC;IACxE;IAEA,OAAO,IAAI,CAACF,YAAY,CAACoB,GAAG,CAACT,MAAM,CAAC;EACxC;AACJ;AAACU,OAAA,CAAAtB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_plugins","require","_RichTextPluginsProcessor","RichTextRenderer","renderersMap","Map","plugins","constructor","create","context","rendererPlugins","byType","CmsRichTextRendererPlugin","type","render","format","contents","renderer","getRendererByType","has","filter","plugin","set","RichTextPluginsProcessor","get","exports"],"sources":["RichTextRenderer.ts"],"sourcesContent":["import type { RichTextContents } from \"~/plugins\";\nimport { CmsRichTextRendererPlugin } from \"~/plugins\";\nimport type { CmsContext } from \"~/types\";\nimport { RichTextPluginsProcessor } from \"~/graphqlFields/richText/RichTextPluginsProcessor\";\n\nexport class RichTextRenderer {\n private renderersMap = new Map<string, RichTextPluginsProcessor>();\n private plugins: CmsRichTextRendererPlugin[] = [];\n\n private constructor(plugins: CmsRichTextRendererPlugin[]) {\n this.plugins = plugins;\n }\n\n static create(context: CmsContext) {\n const rendererPlugins = context.plugins.byType<CmsRichTextRendererPlugin>(\n CmsRichTextRendererPlugin.type\n );\n return new RichTextRenderer(rendererPlugins);\n }\n\n async render(format: string, contents: RichTextContents) {\n const renderer = this.getRendererByType(format);\n\n return renderer.render(contents);\n }\n\n private getRendererByType(format: string) {\n if (!this.renderersMap.has(format)) {\n const plugins = this.plugins.filter(plugin => plugin.format === format);\n\n this.renderersMap.set(format, new RichTextPluginsProcessor(plugins));\n }\n\n return this.renderersMap.get(format) as RichTextPluginsProcessor;\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,yBAAA,GAAAD,OAAA;AAEO,MAAME,gBAAgB,CAAC;EAClBC,YAAY,GAAG,IAAIC,GAAG,CAAmC,CAAC;EAC1DC,OAAO,GAAgC,EAAE;EAEzCC,WAAWA,CAACD,OAAoC,EAAE;IACtD,IAAI,CAACA,OAAO,GAAGA,OAAO;EAC1B;EAEA,OAAOE,MAAMA,CAACC,OAAmB,EAAE;IAC/B,MAAMC,eAAe,GAAGD,OAAO,CAACH,OAAO,CAACK,MAAM,CAC1CC,kCAAyB,CAACC,IAC9B,CAAC;IACD,OAAO,IAAIV,gBAAgB,CAACO,eAAe,CAAC;EAChD;EAEA,MAAMI,MAAMA,CAACC,MAAc,EAAEC,QAA0B,EAAE;IACrD,MAAMC,QAAQ,GAAG,IAAI,CAACC,iBAAiB,CAACH,MAAM,CAAC;IAE/C,OAAOE,QAAQ,CAACH,MAAM,CAACE,QAAQ,CAAC;EACpC;EAEQE,iBAAiBA,CAACH,MAAc,EAAE;IACtC,IAAI,CAAC,IAAI,CAACX,YAAY,CAACe,GAAG,CAACJ,MAAM,CAAC,EAAE;MAChC,MAAMT,OAAO,GAAG,IAAI,CAACA,OAAO,CAACc,MAAM,CAACC,MAAM,IAAIA,MAAM,CAACN,MAAM,KAAKA,MAAM,CAAC;MAEvE,IAAI,CAACX,YAAY,CAACkB,GAAG,CAACP,MAAM,EAAE,IAAIQ,kDAAwB,CAACjB,OAAO,CAAC,CAAC;IACxE;IAEA,OAAO,IAAI,CAACF,YAAY,CAACoB,GAAG,CAACT,MAAM,CAAC;EACxC;AACJ;AAACU,OAAA,CAAAtB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { ICache } from "./types";
1
+ import type { ICache } from "./types";
2
2
  export interface ICacheParams {
3
3
  id?: string;
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"names":["Cache","_cache","Map","constructor","params","id","get","cacheKey","key","value","set","getOrSet","cb","existing","clear","Array","isArray","delete","createMemoryCache","exports"],"sources":["Cache.ts"],"sourcesContent":["import { ICache, ICacheKey } from \"./types\";\n\nexport interface ICacheParams {\n id?: string;\n}\n\nclass Cache<T> implements ICache {\n public readonly id: string | undefined;\n private readonly _cache: Map<string, T> = new Map();\n\n public constructor(params?: ICacheParams) {\n this.id = params?.id;\n }\n\n public get(cacheKey: ICacheKey): T | null {\n const key = cacheKey.get();\n const value = this._cache.get(key);\n return value || null;\n }\n\n public set(cacheKey: ICacheKey, value: T): T {\n const key = cacheKey.get();\n this._cache.set(key, value);\n return value;\n }\n\n public getOrSet(cacheKey: ICacheKey, cb: () => T): T {\n const existing = this.get(cacheKey);\n if (existing) {\n return existing;\n }\n const value = cb();\n return this.set(cacheKey, value);\n }\n\n public clear(cacheKey?: ICacheKey | ICacheKey[]) {\n if (!cacheKey) {\n this._cache.clear();\n return;\n } else if (Array.isArray(cacheKey)) {\n for (const key of cacheKey) {\n this._cache.delete(key.get());\n }\n return;\n }\n\n this._cache.delete(cacheKey.get());\n }\n}\n\nexport const createMemoryCache = <T>(params?: ICacheParams): ICache<T> => {\n return new Cache<T>(params);\n};\n"],"mappings":";;;;;;AAMA,MAAMA,KAAK,CAAsB;EAEZC,MAAM,GAAmB,IAAIC,GAAG,CAAC,CAAC;EAE5CC,WAAWA,CAACC,MAAqB,EAAE;IACtC,IAAI,CAACC,EAAE,GAAGD,MAAM,EAAEC,EAAE;EACxB;EAEOC,GAAGA,CAACC,QAAmB,EAAY;IACtC,MAAMC,GAAG,GAAGD,QAAQ,CAACD,GAAG,CAAC,CAAC;IAC1B,MAAMG,KAAK,GAAG,IAAI,CAACR,MAAM,CAACK,GAAG,CAACE,GAAG,CAAC;IAClC,OAAOC,KAAK,IAAI,IAAI;EACxB;EAEOC,GAAGA,CAACH,QAAmB,EAAEE,KAAQ,EAAK;IACzC,MAAMD,GAAG,GAAGD,QAAQ,CAACD,GAAG,CAAC,CAAC;IAC1B,IAAI,CAACL,MAAM,CAACS,GAAG,CAACF,GAAG,EAAEC,KAAK,CAAC;IAC3B,OAAOA,KAAK;EAChB;EAEOE,QAAQA,CAACJ,QAAmB,EAAEK,EAAW,EAAK;IACjD,MAAMC,QAAQ,GAAG,IAAI,CAACP,GAAG,CAACC,QAAQ,CAAC;IACnC,IAAIM,QAAQ,EAAE;MACV,OAAOA,QAAQ;IACnB;IACA,MAAMJ,KAAK,GAAGG,EAAE,CAAC,CAAC;IAClB,OAAO,IAAI,CAACF,GAAG,CAACH,QAAQ,EAAEE,KAAK,CAAC;EACpC;EAEOK,KAAKA,CAACP,QAAkC,EAAE;IAC7C,IAAI,CAACA,QAAQ,EAAE;MACX,IAAI,CAACN,MAAM,CAACa,KAAK,CAAC,CAAC;MACnB;IACJ,CAAC,MAAM,IAAIC,KAAK,CAACC,OAAO,CAACT,QAAQ,CAAC,EAAE;MAChC,KAAK,MAAMC,GAAG,IAAID,QAAQ,EAAE;QACxB,IAAI,CAACN,MAAM,CAACgB,MAAM,CAACT,GAAG,CAACF,GAAG,CAAC,CAAC,CAAC;MACjC;MACA;IACJ;IAEA,IAAI,CAACL,MAAM,CAACgB,MAAM,CAACV,QAAQ,CAACD,GAAG,CAAC,CAAC,CAAC;EACtC;AACJ;AAEO,MAAMY,iBAAiB,GAAOd,MAAqB,IAAgB;EACtE,OAAO,IAAIJ,KAAK,CAAII,MAAM,CAAC;AAC/B,CAAC;AAACe,OAAA,CAAAD,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["Cache","_cache","Map","constructor","params","id","get","cacheKey","key","value","set","getOrSet","cb","existing","clear","Array","isArray","delete","createMemoryCache","exports"],"sources":["Cache.ts"],"sourcesContent":["import type { ICache, ICacheKey } from \"./types\";\n\nexport interface ICacheParams {\n id?: string;\n}\n\nclass Cache<T> implements ICache {\n public readonly id: string | undefined;\n private readonly _cache: Map<string, T> = new Map();\n\n public constructor(params?: ICacheParams) {\n this.id = params?.id;\n }\n\n public get(cacheKey: ICacheKey): T | null {\n const key = cacheKey.get();\n const value = this._cache.get(key);\n return value || null;\n }\n\n public set(cacheKey: ICacheKey, value: T): T {\n const key = cacheKey.get();\n this._cache.set(key, value);\n return value;\n }\n\n public getOrSet(cacheKey: ICacheKey, cb: () => T): T {\n const existing = this.get(cacheKey);\n if (existing) {\n return existing;\n }\n const value = cb();\n return this.set(cacheKey, value);\n }\n\n public clear(cacheKey?: ICacheKey | ICacheKey[]) {\n if (!cacheKey) {\n this._cache.clear();\n return;\n } else if (Array.isArray(cacheKey)) {\n for (const key of cacheKey) {\n this._cache.delete(key.get());\n }\n return;\n }\n\n this._cache.delete(cacheKey.get());\n }\n}\n\nexport const createMemoryCache = <T>(params?: ICacheParams): ICache<T> => {\n return new Cache<T>(params);\n};\n"],"mappings":";;;;;;AAMA,MAAMA,KAAK,CAAsB;EAEZC,MAAM,GAAmB,IAAIC,GAAG,CAAC,CAAC;EAE5CC,WAAWA,CAACC,MAAqB,EAAE;IACtC,IAAI,CAACC,EAAE,GAAGD,MAAM,EAAEC,EAAE;EACxB;EAEOC,GAAGA,CAACC,QAAmB,EAAY;IACtC,MAAMC,GAAG,GAAGD,QAAQ,CAACD,GAAG,CAAC,CAAC;IAC1B,MAAMG,KAAK,GAAG,IAAI,CAACR,MAAM,CAACK,GAAG,CAACE,GAAG,CAAC;IAClC,OAAOC,KAAK,IAAI,IAAI;EACxB;EAEOC,GAAGA,CAACH,QAAmB,EAAEE,KAAQ,EAAK;IACzC,MAAMD,GAAG,GAAGD,QAAQ,CAACD,GAAG,CAAC,CAAC;IAC1B,IAAI,CAACL,MAAM,CAACS,GAAG,CAACF,GAAG,EAAEC,KAAK,CAAC;IAC3B,OAAOA,KAAK;EAChB;EAEOE,QAAQA,CAACJ,QAAmB,EAAEK,EAAW,EAAK;IACjD,MAAMC,QAAQ,GAAG,IAAI,CAACP,GAAG,CAACC,QAAQ,CAAC;IACnC,IAAIM,QAAQ,EAAE;MACV,OAAOA,QAAQ;IACnB;IACA,MAAMJ,KAAK,GAAGG,EAAE,CAAC,CAAC;IAClB,OAAO,IAAI,CAACF,GAAG,CAACH,QAAQ,EAAEE,KAAK,CAAC;EACpC;EAEOK,KAAKA,CAACP,QAAkC,EAAE;IAC7C,IAAI,CAACA,QAAQ,EAAE;MACX,IAAI,CAACN,MAAM,CAACa,KAAK,CAAC,CAAC;MACnB;IACJ,CAAC,MAAM,IAAIC,KAAK,CAACC,OAAO,CAACT,QAAQ,CAAC,EAAE;MAChC,KAAK,MAAMC,GAAG,IAAID,QAAQ,EAAE;QACxB,IAAI,CAACN,MAAM,CAACgB,MAAM,CAACT,GAAG,CAACF,GAAG,CAAC,CAAC,CAAC;MACjC;MACA;IACJ;IAEA,IAAI,CAACL,MAAM,CAACgB,MAAM,CAACV,QAAQ,CAACD,GAAG,CAAC,CAAC,CAAC;EACtC;AACJ;AAEO,MAAMY,iBAAiB,GAAOd,MAAqB,IAAgB;EACtE,OAAO,IAAIJ,KAAK,CAAII,MAAM,CAAC;AAC/B,CAAC;AAACe,OAAA,CAAAD,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import { ICacheKey } from "./types";
2
- import { ICacheKeyKeys } from "@webiny/utils";
1
+ import type { ICacheKey } from "./types";
2
+ import type { ICacheKeyKeys } from "@webiny/utils";
3
3
  export declare const createCacheKey: (key: ICacheKeyKeys) => ICacheKey;
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","CacheKey","constructor","keys","key","createCacheKeyValue","algorithm","encoding","create","get","createCacheKey","exports"],"sources":["CacheKey.ts"],"sourcesContent":["import { ICacheKey } from \"./types\";\nimport { createCacheKey as createCacheKeyValue, ICacheKeyKeys } from \"@webiny/utils\";\n\nclass CacheKey implements ICacheKey {\n private readonly key: string;\n public readonly keys: ICacheKeyKeys;\n\n private constructor(keys: ICacheKeyKeys) {\n this.keys = keys;\n this.key = createCacheKeyValue(keys, {\n algorithm: \"sha1\",\n encoding: \"hex\"\n });\n }\n\n public static create(key: ICacheKeyKeys): ICacheKey {\n return new CacheKey(key);\n }\n\n public get(): string {\n return this.key;\n }\n}\n\nexport const createCacheKey = (key: ICacheKeyKeys) => {\n return CacheKey.create(key);\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,QAAQ,CAAsB;EAIxBC,WAAWA,CAACC,IAAmB,EAAE;IACrC,IAAI,CAACA,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,GAAG,GAAG,IAAAC,qBAAmB,EAACF,IAAI,EAAE;MACjCG,SAAS,EAAE,MAAM;MACjBC,QAAQ,EAAE;IACd,CAAC,CAAC;EACN;EAEA,OAAcC,MAAMA,CAACJ,GAAkB,EAAa;IAChD,OAAO,IAAIH,QAAQ,CAACG,GAAG,CAAC;EAC5B;EAEOK,GAAGA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACL,GAAG;EACnB;AACJ;AAEO,MAAMM,cAAc,GAAIN,GAAkB,IAAK;EAClD,OAAOH,QAAQ,CAACO,MAAM,CAACJ,GAAG,CAAC;AAC/B,CAAC;AAACO,OAAA,CAAAD,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"names":["_utils","require","CacheKey","constructor","keys","key","createCacheKeyValue","algorithm","encoding","create","get","createCacheKey","exports"],"sources":["CacheKey.ts"],"sourcesContent":["import type { ICacheKey } from \"./types\";\nimport type { ICacheKeyKeys } from \"@webiny/utils\";\nimport { createCacheKey as createCacheKeyValue } from \"@webiny/utils\";\n\nclass CacheKey implements ICacheKey {\n private readonly key: string;\n public readonly keys: ICacheKeyKeys;\n\n private constructor(keys: ICacheKeyKeys) {\n this.keys = keys;\n this.key = createCacheKeyValue(keys, {\n algorithm: \"sha1\",\n encoding: \"hex\"\n });\n }\n\n public static create(key: ICacheKeyKeys): ICacheKey {\n return new CacheKey(key);\n }\n\n public get(): string {\n return this.key;\n }\n}\n\nexport const createCacheKey = (key: ICacheKeyKeys) => {\n return CacheKey.create(key);\n};\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,QAAQ,CAAsB;EAIxBC,WAAWA,CAACC,IAAmB,EAAE;IACrC,IAAI,CAACA,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,GAAG,GAAG,IAAAC,qBAAmB,EAACF,IAAI,EAAE;MACjCG,SAAS,EAAE,MAAM;MACjBC,QAAQ,EAAE;IACd,CAAC,CAAC;EACN;EAEA,OAAcC,MAAMA,CAACJ,GAAkB,EAAa;IAChD,OAAO,IAAIH,QAAQ,CAACG,GAAG,CAAC;EAC5B;EAEOK,GAAGA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACL,GAAG;EACnB;AACJ;AAEO,MAAMM,cAAc,GAAIN,GAAkB,IAAK;EAClD,OAAOH,QAAQ,CAACO,MAAM,CAACJ,GAAG,CAAC;AAC/B,CAAC;AAACO,OAAA,CAAAD,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { CmsModelAst, ContentEntryValueVisitor, CmsEntryValues } from "../../types";
1
+ import type { CmsModelAst, ContentEntryValueVisitor, CmsEntryValues } from "../../types";
2
2
  export interface IContentEntryTraverser {
3
3
  traverse(values: CmsEntryValues, visitor: ContentEntryValueVisitor): Promise<void>;
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"names":["nodeHasChildren","node","children","length","childrenAreCollections","every","type","emptyValues","undefined","ContentEntryTraverser","constructor","modelAst","traverse","values","visitor","visitTree","root","path","context","parent","field","getFieldFromNode","value","fieldId","includes","fieldPath","join","multipleValues","arrayValue","ensureArray","i","findCollectionAndVisit","toString","Array","isArray","collection","find","child","discriminator","id","exports"],"sources":["ContentEntryTraverser.ts"],"sourcesContent":["import {\n CmsModelAst,\n CmsModelFieldAstNodeField,\n CmsModelFieldAstNode,\n ContentEntryValueVisitor,\n CmsModelFieldAstNodeCollection,\n CmsEntryValues\n} from \"~/types\";\n\ntype ParentNode = CmsModelAst | CmsModelFieldAstNode | null;\n\ntype VisitorContext = {\n node: CmsModelFieldAstNode;\n parent: ParentNode;\n};\n\nconst nodeHasChildren = (node: CmsModelFieldAstNode) => {\n return node.children.length > 0;\n};\n\ninterface NodeWithCollections extends CmsModelFieldAstNodeField {\n children: CmsModelFieldAstNodeCollection[];\n}\n\nconst childrenAreCollections = (node: CmsModelFieldAstNode): node is NodeWithCollections => {\n return node.children.every(node => node.type === \"collection\");\n};\n\nconst emptyValues = [null, undefined];\n\nexport interface IContentEntryTraverser {\n traverse(values: CmsEntryValues, visitor: ContentEntryValueVisitor): Promise<void>;\n}\n\nexport class ContentEntryTraverser implements IContentEntryTraverser {\n private readonly modelAst: CmsModelAst;\n\n constructor(modelAst: CmsModelAst) {\n this.modelAst = modelAst;\n }\n\n async traverse(values: CmsEntryValues, visitor: ContentEntryValueVisitor) {\n await this.visitTree(this.modelAst, values, [], visitor);\n }\n\n private async visitTree(\n root: CmsModelAst | CmsModelFieldAstNode,\n values: CmsEntryValues,\n path: string[],\n visitor: ContentEntryValueVisitor\n ) {\n for (const node of root.children) {\n const context: VisitorContext = { node, parent: root };\n const field = this.getFieldFromNode(context);\n let value = values[field.fieldId];\n\n // We do not descend into nodes if they're `null` or `undefined`.\n if (nodeHasChildren(node) && emptyValues.includes(value)) {\n continue;\n }\n\n // We do not visit leaf nodes that are `undefined`.\n if (!nodeHasChildren(node) && value === undefined) {\n continue;\n }\n\n const fieldPath = [...path, field.fieldId];\n\n await visitor(\n {\n field,\n value,\n path: fieldPath.join(\".\")\n },\n context\n );\n\n // Refetch the value from the original input, in case the value changed within the visitor.\n value = values[field.fieldId];\n\n if (nodeHasChildren(node) && childrenAreCollections(node)) {\n if (field.multipleValues) {\n const arrayValue = this.ensureArray(value);\n for (let i = 0; i < arrayValue.length; i++) {\n await this.findCollectionAndVisit(\n node,\n arrayValue[i],\n [...fieldPath, i.toString()],\n visitor\n );\n }\n } else {\n await this.findCollectionAndVisit(node, value, fieldPath, visitor);\n }\n continue;\n }\n\n if (field.multipleValues) {\n const arrayValue = this.ensureArray(value);\n for (let i = 0; i < arrayValue.length; i++) {\n await this.visitTree(\n node,\n arrayValue[i],\n [...fieldPath, i.toString()],\n visitor\n );\n }\n continue;\n }\n\n await this.visitTree(node, value, fieldPath, visitor);\n }\n }\n\n private ensureArray(value: any) {\n if (!Array.isArray(value)) {\n return [];\n }\n\n return value;\n }\n\n private findCollectionAndVisit(\n node: NodeWithCollections,\n values: CmsEntryValues,\n path: string[],\n visitor: ContentEntryValueVisitor\n ) {\n const collection = node.children.find(child => {\n // Use the `discriminator` to find the correct value.\n return values[child.collection.discriminator] === child.collection.id;\n });\n\n if (!collection) {\n return;\n }\n\n return this.visitTree(collection, values, path, visitor);\n }\n\n private getFieldFromNode({ node, parent }: VisitorContext) {\n if (node.type === \"collection\") {\n return (parent as CmsModelFieldAstNodeField).field;\n }\n\n return (node as CmsModelFieldAstNodeField).field;\n }\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"names":["nodeHasChildren","node","children","length","childrenAreCollections","every","type","emptyValues","undefined","ContentEntryTraverser","constructor","modelAst","traverse","values","visitor","visitTree","root","path","context","parent","field","getFieldFromNode","value","fieldId","includes","fieldPath","join","multipleValues","arrayValue","ensureArray","i","findCollectionAndVisit","toString","Array","isArray","collection","find","child","discriminator","id","exports"],"sources":["ContentEntryTraverser.ts"],"sourcesContent":["import type {\n CmsModelAst,\n CmsModelFieldAstNodeField,\n CmsModelFieldAstNode,\n ContentEntryValueVisitor,\n CmsModelFieldAstNodeCollection,\n CmsEntryValues\n} from \"~/types\";\n\ntype ParentNode = CmsModelAst | CmsModelFieldAstNode | null;\n\ntype VisitorContext = {\n node: CmsModelFieldAstNode;\n parent: ParentNode;\n};\n\nconst nodeHasChildren = (node: CmsModelFieldAstNode) => {\n return node.children.length > 0;\n};\n\ninterface NodeWithCollections extends CmsModelFieldAstNodeField {\n children: CmsModelFieldAstNodeCollection[];\n}\n\nconst childrenAreCollections = (node: CmsModelFieldAstNode): node is NodeWithCollections => {\n return node.children.every(node => node.type === \"collection\");\n};\n\nconst emptyValues = [null, undefined];\n\nexport interface IContentEntryTraverser {\n traverse(values: CmsEntryValues, visitor: ContentEntryValueVisitor): Promise<void>;\n}\n\nexport class ContentEntryTraverser implements IContentEntryTraverser {\n private readonly modelAst: CmsModelAst;\n\n constructor(modelAst: CmsModelAst) {\n this.modelAst = modelAst;\n }\n\n async traverse(values: CmsEntryValues, visitor: ContentEntryValueVisitor) {\n await this.visitTree(this.modelAst, values, [], visitor);\n }\n\n private async visitTree(\n root: CmsModelAst | CmsModelFieldAstNode,\n values: CmsEntryValues,\n path: string[],\n visitor: ContentEntryValueVisitor\n ) {\n for (const node of root.children) {\n const context: VisitorContext = { node, parent: root };\n const field = this.getFieldFromNode(context);\n let value = values[field.fieldId];\n\n // We do not descend into nodes if they're `null` or `undefined`.\n if (nodeHasChildren(node) && emptyValues.includes(value)) {\n continue;\n }\n\n // We do not visit leaf nodes that are `undefined`.\n if (!nodeHasChildren(node) && value === undefined) {\n continue;\n }\n\n const fieldPath = [...path, field.fieldId];\n\n await visitor(\n {\n field,\n value,\n path: fieldPath.join(\".\")\n },\n context\n );\n\n // Refetch the value from the original input, in case the value changed within the visitor.\n value = values[field.fieldId];\n\n if (nodeHasChildren(node) && childrenAreCollections(node)) {\n if (field.multipleValues) {\n const arrayValue = this.ensureArray(value);\n for (let i = 0; i < arrayValue.length; i++) {\n await this.findCollectionAndVisit(\n node,\n arrayValue[i],\n [...fieldPath, i.toString()],\n visitor\n );\n }\n } else {\n await this.findCollectionAndVisit(node, value, fieldPath, visitor);\n }\n continue;\n }\n\n if (field.multipleValues) {\n const arrayValue = this.ensureArray(value);\n for (let i = 0; i < arrayValue.length; i++) {\n await this.visitTree(\n node,\n arrayValue[i],\n [...fieldPath, i.toString()],\n visitor\n );\n }\n continue;\n }\n\n await this.visitTree(node, value, fieldPath, visitor);\n }\n }\n\n private ensureArray(value: any) {\n if (!Array.isArray(value)) {\n return [];\n }\n\n return value;\n }\n\n private findCollectionAndVisit(\n node: NodeWithCollections,\n values: CmsEntryValues,\n path: string[],\n visitor: ContentEntryValueVisitor\n ) {\n const collection = node.children.find(child => {\n // Use the `discriminator` to find the correct value.\n return values[child.collection.discriminator] === child.collection.id;\n });\n\n if (!collection) {\n return;\n }\n\n return this.visitTree(collection, values, path, visitor);\n }\n\n private getFieldFromNode({ node, parent }: VisitorContext) {\n if (node.type === \"collection\") {\n return (parent as CmsModelFieldAstNodeField).field;\n }\n\n return (node as CmsModelFieldAstNodeField).field;\n }\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { CmsModelField, CmsModelFieldToGraphQLPlugin, ICmsModelFieldToAst } from "../../types";
1
+ import type { CmsModelField, CmsModelFieldToGraphQLPlugin, ICmsModelFieldToAst } from "../../types";
2
2
  export declare class CmsModelFieldToAstConverterFromPlugins implements ICmsModelFieldToAst {
3
3
  private converters;
4
4
  constructor(plugins: CmsModelFieldToGraphQLPlugin[]);
@@ -1 +1 @@
1
- {"version":3,"names":["_CmsModelFieldToAstFromPlugin","require","CmsModelFieldToAstConverterFromPlugins","constructor","plugins","converters","reduce","plugin","fieldType","CmsModelFieldToAstFromPlugin","toAst","field","type","exports"],"sources":["CmsModelFieldToAstConverterFromPlugins.ts"],"sourcesContent":["import { CmsModelField, CmsModelFieldToGraphQLPlugin, ICmsModelFieldToAst } from \"~/types\";\nimport { CmsModelFieldToAstFromPlugin } from \"./CmsModelFieldToAstFromPlugin\";\n\ntype FieldToAstConverters = Record<string, ICmsModelFieldToAst>;\n\nexport class CmsModelFieldToAstConverterFromPlugins implements ICmsModelFieldToAst {\n private converters: FieldToAstConverters;\n\n constructor(plugins: CmsModelFieldToGraphQLPlugin[]) {\n this.converters = plugins.reduce<FieldToAstConverters>((converters, plugin) => {\n return {\n ...converters,\n [plugin.fieldType]: new CmsModelFieldToAstFromPlugin(plugin, this)\n };\n }, {});\n }\n\n toAst(field: CmsModelField) {\n return this.converters[field.type].toAst(field);\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,6BAAA,GAAAC,OAAA;AAIO,MAAMC,sCAAsC,CAAgC;EAG/EC,WAAWA,CAACC,OAAuC,EAAE;IACjD,IAAI,CAACC,UAAU,GAAGD,OAAO,CAACE,MAAM,CAAuB,CAACD,UAAU,EAAEE,MAAM,KAAK;MAC3E,OAAO;QACH,GAAGF,UAAU;QACb,CAACE,MAAM,CAACC,SAAS,GAAG,IAAIC,0DAA4B,CAACF,MAAM,EAAE,IAAI;MACrE,CAAC;IACL,CAAC,EAAE,CAAC,CAAC,CAAC;EACV;EAEAG,KAAKA,CAACC,KAAoB,EAAE;IACxB,OAAO,IAAI,CAACN,UAAU,CAACM,KAAK,CAACC,IAAI,CAAC,CAACF,KAAK,CAACC,KAAK,CAAC;EACnD;AACJ;AAACE,OAAA,CAAAX,sCAAA,GAAAA,sCAAA","ignoreList":[]}
1
+ {"version":3,"names":["_CmsModelFieldToAstFromPlugin","require","CmsModelFieldToAstConverterFromPlugins","constructor","plugins","converters","reduce","plugin","fieldType","CmsModelFieldToAstFromPlugin","toAst","field","type","exports"],"sources":["CmsModelFieldToAstConverterFromPlugins.ts"],"sourcesContent":["import type { CmsModelField, CmsModelFieldToGraphQLPlugin, ICmsModelFieldToAst } from \"~/types\";\nimport { CmsModelFieldToAstFromPlugin } from \"./CmsModelFieldToAstFromPlugin\";\n\ntype FieldToAstConverters = Record<string, ICmsModelFieldToAst>;\n\nexport class CmsModelFieldToAstConverterFromPlugins implements ICmsModelFieldToAst {\n private converters: FieldToAstConverters;\n\n constructor(plugins: CmsModelFieldToGraphQLPlugin[]) {\n this.converters = plugins.reduce<FieldToAstConverters>((converters, plugin) => {\n return {\n ...converters,\n [plugin.fieldType]: new CmsModelFieldToAstFromPlugin(plugin, this)\n };\n }, {});\n }\n\n toAst(field: CmsModelField) {\n return this.converters[field.type].toAst(field);\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,6BAAA,GAAAC,OAAA;AAIO,MAAMC,sCAAsC,CAAgC;EAG/EC,WAAWA,CAACC,OAAuC,EAAE;IACjD,IAAI,CAACC,UAAU,GAAGD,OAAO,CAACE,MAAM,CAAuB,CAACD,UAAU,EAAEE,MAAM,KAAK;MAC3E,OAAO;QACH,GAAGF,UAAU;QACb,CAACE,MAAM,CAACC,SAAS,GAAG,IAAIC,0DAA4B,CAACF,MAAM,EAAE,IAAI;MACrE,CAAC;IACL,CAAC,EAAE,CAAC,CAAC,CAAC;EACV;EAEAG,KAAKA,CAACC,KAAoB,EAAE;IACxB,OAAO,IAAI,CAACN,UAAU,CAACM,KAAK,CAACC,IAAI,CAAC,CAACF,KAAK,CAACC,KAAK,CAAC;EACnD;AACJ;AAACE,OAAA,CAAAX,sCAAA,GAAAA,sCAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { CmsModelField, CmsModelFieldAstNode, CmsModelFieldToGraphQLPlugin, ICmsModelFieldToAst } from "../../types";
1
+ import type { CmsModelField, CmsModelFieldAstNode, CmsModelFieldToGraphQLPlugin, ICmsModelFieldToAst } from "../../types";
2
2
  export declare class CmsModelFieldToAstFromPlugin implements ICmsModelFieldToAst {
3
3
  private readonly converter;
4
4
  private plugin;
@@ -1 +1 @@
1
- {"version":3,"names":["CmsModelFieldToAstFromPlugin","constructor","plugin","converter","toAst","field","getFieldAst","type","children","exports"],"sources":["CmsModelFieldToAstFromPlugin.ts"],"sourcesContent":["import {\n CmsModelField,\n CmsModelFieldAstNode,\n CmsModelFieldToGraphQLPlugin,\n ICmsModelFieldToAst\n} from \"~/types\";\n\nexport class CmsModelFieldToAstFromPlugin implements ICmsModelFieldToAst {\n private readonly converter: ICmsModelFieldToAst;\n private plugin: CmsModelFieldToGraphQLPlugin;\n\n constructor(plugin: CmsModelFieldToGraphQLPlugin, converter: ICmsModelFieldToAst) {\n this.converter = converter;\n this.plugin = plugin;\n }\n\n toAst(field: CmsModelField): CmsModelFieldAstNode {\n return this.plugin.getFieldAst\n ? this.plugin.getFieldAst(field, this.converter)\n : { type: \"field\", field, children: [] };\n }\n}\n"],"mappings":";;;;;;AAOO,MAAMA,4BAA4B,CAAgC;EAIrEC,WAAWA,CAACC,MAAoC,EAAEC,SAA8B,EAAE;IAC9E,IAAI,CAACA,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACD,MAAM,GAAGA,MAAM;EACxB;EAEAE,KAAKA,CAACC,KAAoB,EAAwB;IAC9C,OAAO,IAAI,CAACH,MAAM,CAACI,WAAW,GACxB,IAAI,CAACJ,MAAM,CAACI,WAAW,CAACD,KAAK,EAAE,IAAI,CAACF,SAAS,CAAC,GAC9C;MAAEI,IAAI,EAAE,OAAO;MAAEF,KAAK;MAAEG,QAAQ,EAAE;IAAG,CAAC;EAChD;AACJ;AAACC,OAAA,CAAAT,4BAAA,GAAAA,4BAAA","ignoreList":[]}
1
+ {"version":3,"names":["CmsModelFieldToAstFromPlugin","constructor","plugin","converter","toAst","field","getFieldAst","type","children","exports"],"sources":["CmsModelFieldToAstFromPlugin.ts"],"sourcesContent":["import type {\n CmsModelField,\n CmsModelFieldAstNode,\n CmsModelFieldToGraphQLPlugin,\n ICmsModelFieldToAst\n} from \"~/types\";\n\nexport class CmsModelFieldToAstFromPlugin implements ICmsModelFieldToAst {\n private readonly converter: ICmsModelFieldToAst;\n private plugin: CmsModelFieldToGraphQLPlugin;\n\n constructor(plugin: CmsModelFieldToGraphQLPlugin, converter: ICmsModelFieldToAst) {\n this.converter = converter;\n this.plugin = plugin;\n }\n\n toAst(field: CmsModelField): CmsModelFieldAstNode {\n return this.plugin.getFieldAst\n ? this.plugin.getFieldAst(field, this.converter)\n : { type: \"field\", field, children: [] };\n }\n}\n"],"mappings":";;;;;;AAOO,MAAMA,4BAA4B,CAAgC;EAIrEC,WAAWA,CAACC,MAAoC,EAAEC,SAA8B,EAAE;IAC9E,IAAI,CAACA,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACD,MAAM,GAAGA,MAAM;EACxB;EAEAE,KAAKA,CAACC,KAAoB,EAAwB;IAC9C,OAAO,IAAI,CAACH,MAAM,CAACI,WAAW,GACxB,IAAI,CAACJ,MAAM,CAACI,WAAW,CAACD,KAAK,EAAE,IAAI,CAACF,SAAS,CAAC,GAC9C;MAAEI,IAAI,EAAE,OAAO;MAAEF,KAAK;MAAEG,QAAQ,EAAE;IAAG,CAAC;EAChD;AACJ;AAACC,OAAA,CAAAT,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { CmsModel, CmsModelAst, ICmsModelFieldToAst } from "../../types";
1
+ import type { CmsModel, CmsModelAst, ICmsModelFieldToAst } from "../../types";
2
2
  /**
3
3
  * The purpose of this class is to convert the given CmsModel to an AST, which is easier to traverse programmatically.
4
4
  * Using this, we can get information about the structure of the model fields, without understanding how each
@@ -1 +1 @@
1
- {"version":3,"names":["CmsModelToAstConverter","constructor","fieldToAstConverter","toAst","model","type","children","fields","reduce","ast","field","exports"],"sources":["CmsModelToAstConverter.ts"],"sourcesContent":["import { CmsModel, CmsModelAst, CmsModelFieldAstNode, ICmsModelFieldToAst } from \"~/types\";\n\n/**\n * The purpose of this class is to convert the given CmsModel to an AST, which is easier to traverse programmatically.\n * Using this, we can get information about the structure of the model fields, without understanding how each\n * individual model field stores its internal data. This is particularly useful for fields like `dynamicZone` and `object`.\n */\n\nexport class CmsModelToAstConverter {\n private readonly fieldToAstConverter: ICmsModelFieldToAst;\n\n public constructor(fieldToAstConverter: ICmsModelFieldToAst) {\n this.fieldToAstConverter = fieldToAstConverter;\n }\n\n public toAst(model: Pick<CmsModel, \"fields\">): CmsModelAst {\n return {\n type: \"root\",\n children: model.fields.reduce<CmsModelFieldAstNode[]>((ast, field) => {\n return [...ast, this.fieldToAstConverter.toAst(field)];\n }, [])\n };\n }\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,sBAAsB,CAAC;EAGzBC,WAAWA,CAACC,mBAAwC,EAAE;IACzD,IAAI,CAACA,mBAAmB,GAAGA,mBAAmB;EAClD;EAEOC,KAAKA,CAACC,KAA+B,EAAe;IACvD,OAAO;MACHC,IAAI,EAAE,MAAM;MACZC,QAAQ,EAAEF,KAAK,CAACG,MAAM,CAACC,MAAM,CAAyB,CAACC,GAAG,EAAEC,KAAK,KAAK;QAClE,OAAO,CAAC,GAAGD,GAAG,EAAE,IAAI,CAACP,mBAAmB,CAACC,KAAK,CAACO,KAAK,CAAC,CAAC;MAC1D,CAAC,EAAE,EAAE;IACT,CAAC;EACL;AACJ;AAACC,OAAA,CAAAX,sBAAA,GAAAA,sBAAA","ignoreList":[]}
1
+ {"version":3,"names":["CmsModelToAstConverter","constructor","fieldToAstConverter","toAst","model","type","children","fields","reduce","ast","field","exports"],"sources":["CmsModelToAstConverter.ts"],"sourcesContent":["import type { CmsModel, CmsModelAst, CmsModelFieldAstNode, ICmsModelFieldToAst } from \"~/types\";\n\n/**\n * The purpose of this class is to convert the given CmsModel to an AST, which is easier to traverse programmatically.\n * Using this, we can get information about the structure of the model fields, without understanding how each\n * individual model field stores its internal data. This is particularly useful for fields like `dynamicZone` and `object`.\n */\n\nexport class CmsModelToAstConverter {\n private readonly fieldToAstConverter: ICmsModelFieldToAst;\n\n public constructor(fieldToAstConverter: ICmsModelFieldToAst) {\n this.fieldToAstConverter = fieldToAstConverter;\n }\n\n public toAst(model: Pick<CmsModel, \"fields\">): CmsModelAst {\n return {\n type: \"root\",\n children: model.fields.reduce<CmsModelFieldAstNode[]>((ast, field) => {\n return [...ast, this.fieldToAstConverter.toAst(field)];\n }, [])\n };\n }\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,sBAAsB,CAAC;EAGzBC,WAAWA,CAACC,mBAAwC,EAAE;IACzD,IAAI,CAACA,mBAAmB,GAAGA,mBAAmB;EAClD;EAEOC,KAAKA,CAACC,KAA+B,EAAe;IACvD,OAAO;MACHC,IAAI,EAAE,MAAM;MACZC,QAAQ,EAAEF,KAAK,CAACG,MAAM,CAACC,MAAM,CAAyB,CAACC,GAAG,EAAEC,KAAK,KAAK;QAClE,OAAO,CAAC,GAAGD,GAAG,EAAE,IAAI,CAACP,mBAAmB,CAACC,KAAK,CAACO,KAAK,CAAC,CAAC;MAC1D,CAAC,EAAE,EAAE;IACT,CAAC;EACL;AACJ;AAACC,OAAA,CAAAX,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
- import { CmsEntryValues, CmsModelField } from "../../types";
2
- import { CmsModelFieldConverterPlugin } from "../../plugins";
3
- import { ConverterCollection } from "./ConverterCollection";
1
+ import type { CmsEntryValues, CmsModelField } from "../../types";
2
+ import type { CmsModelFieldConverterPlugin } from "../../plugins";
3
+ import type { ConverterCollection } from "./ConverterCollection";
4
4
  export interface CmsModelFieldWithParent extends CmsModelField {
5
5
  parent?: CmsModelFieldWithParent | null;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","Converter","converters","undefined","constructor","config","type","plugin","setConverterCollection","WebinyError","getConverterCollection","getType","convertToStorage","params","field","value","converterCollection","convertFromStorage","exports"],"sources":["Converter.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntryValues, CmsModelField } from \"~/types\";\nimport { CmsModelFieldConverterPlugin } from \"~/plugins\";\nimport { ConverterCollection } from \"./ConverterCollection\";\n\nexport interface CmsModelFieldWithParent extends CmsModelField {\n parent?: CmsModelFieldWithParent | null;\n}\n\ninterface ConverterConvertParams {\n field: CmsModelFieldWithParent;\n value: any;\n parent?: CmsModelFieldWithParent | null;\n}\nexport interface ConverterConfig {\n type: string;\n plugin: CmsModelFieldConverterPlugin;\n}\nexport class Converter {\n private readonly type: string;\n private readonly plugin: CmsModelFieldConverterPlugin;\n\n private converters: ConverterCollection | undefined = undefined;\n\n public constructor(config: ConverterConfig) {\n this.type = config.type;\n this.plugin = config.plugin;\n }\n\n public setConverterCollection(converters: ConverterCollection): void {\n if (this.converters) {\n throw new WebinyError(\n `Cannot attach converters collection more than once to Converter with type \"${this.type}\".`,\n \"CONVERTER_COLLECTION_ERROR\",\n {\n type: this.type\n }\n );\n }\n this.converters = converters;\n }\n\n public getConverterCollection(): ConverterCollection {\n if (!this.converters) {\n throw new WebinyError(\n `There is no ConverterCollection defined in the converter with type \"${this.type}\".`\n );\n }\n return this.converters;\n }\n\n public getType(): string {\n return this.type;\n }\n\n public convertToStorage(params: ConverterConvertParams): CmsEntryValues {\n const { field, value } = params;\n\n return this.plugin.convertToStorage({\n field,\n value,\n converterCollection: this.getConverterCollection()\n });\n }\n\n public convertFromStorage(params: ConverterConvertParams): CmsEntryValues {\n const { field, value } = params;\n\n return this.plugin.convertFromStorage({\n field,\n value,\n converterCollection: this.getConverterCollection()\n });\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAkBO,MAAMC,SAAS,CAAC;EAIXC,UAAU,GAAoCC,SAAS;EAExDC,WAAWA,CAACC,MAAuB,EAAE;IACxC,IAAI,CAACC,IAAI,GAAGD,MAAM,CAACC,IAAI;IACvB,IAAI,CAACC,MAAM,GAAGF,MAAM,CAACE,MAAM;EAC/B;EAEOC,sBAAsBA,CAACN,UAA+B,EAAQ;IACjE,IAAI,IAAI,CAACA,UAAU,EAAE;MACjB,MAAM,IAAIO,cAAW,CACjB,8EAA8E,IAAI,CAACH,IAAI,IAAI,EAC3F,4BAA4B,EAC5B;QACIA,IAAI,EAAE,IAAI,CAACA;MACf,CACJ,CAAC;IACL;IACA,IAAI,CAACJ,UAAU,GAAGA,UAAU;EAChC;EAEOQ,sBAAsBA,CAAA,EAAwB;IACjD,IAAI,CAAC,IAAI,CAACR,UAAU,EAAE;MAClB,MAAM,IAAIO,cAAW,CACjB,uEAAuE,IAAI,CAACH,IAAI,IACpF,CAAC;IACL;IACA,OAAO,IAAI,CAACJ,UAAU;EAC1B;EAEOS,OAAOA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACL,IAAI;EACpB;EAEOM,gBAAgBA,CAACC,MAA8B,EAAkB;IACpE,MAAM;MAAEC,KAAK;MAAEC;IAAM,CAAC,GAAGF,MAAM;IAE/B,OAAO,IAAI,CAACN,MAAM,CAACK,gBAAgB,CAAC;MAChCE,KAAK;MACLC,KAAK;MACLC,mBAAmB,EAAE,IAAI,CAACN,sBAAsB,CAAC;IACrD,CAAC,CAAC;EACN;EAEOO,kBAAkBA,CAACJ,MAA8B,EAAkB;IACtE,MAAM;MAAEC,KAAK;MAAEC;IAAM,CAAC,GAAGF,MAAM;IAE/B,OAAO,IAAI,CAACN,MAAM,CAACU,kBAAkB,CAAC;MAClCH,KAAK;MACLC,KAAK;MACLC,mBAAmB,EAAE,IAAI,CAACN,sBAAsB,CAAC;IACrD,CAAC,CAAC;EACN;AACJ;AAACQ,OAAA,CAAAjB,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_error","_interopRequireDefault","require","Converter","converters","undefined","constructor","config","type","plugin","setConverterCollection","WebinyError","getConverterCollection","getType","convertToStorage","params","field","value","converterCollection","convertFromStorage","exports"],"sources":["Converter.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { CmsEntryValues, CmsModelField } from \"~/types\";\nimport type { CmsModelFieldConverterPlugin } from \"~/plugins\";\nimport type { ConverterCollection } from \"./ConverterCollection\";\n\nexport interface CmsModelFieldWithParent extends CmsModelField {\n parent?: CmsModelFieldWithParent | null;\n}\n\ninterface ConverterConvertParams {\n field: CmsModelFieldWithParent;\n value: any;\n parent?: CmsModelFieldWithParent | null;\n}\nexport interface ConverterConfig {\n type: string;\n plugin: CmsModelFieldConverterPlugin;\n}\nexport class Converter {\n private readonly type: string;\n private readonly plugin: CmsModelFieldConverterPlugin;\n\n private converters: ConverterCollection | undefined = undefined;\n\n public constructor(config: ConverterConfig) {\n this.type = config.type;\n this.plugin = config.plugin;\n }\n\n public setConverterCollection(converters: ConverterCollection): void {\n if (this.converters) {\n throw new WebinyError(\n `Cannot attach converters collection more than once to Converter with type \"${this.type}\".`,\n \"CONVERTER_COLLECTION_ERROR\",\n {\n type: this.type\n }\n );\n }\n this.converters = converters;\n }\n\n public getConverterCollection(): ConverterCollection {\n if (!this.converters) {\n throw new WebinyError(\n `There is no ConverterCollection defined in the converter with type \"${this.type}\".`\n );\n }\n return this.converters;\n }\n\n public getType(): string {\n return this.type;\n }\n\n public convertToStorage(params: ConverterConvertParams): CmsEntryValues {\n const { field, value } = params;\n\n return this.plugin.convertToStorage({\n field,\n value,\n converterCollection: this.getConverterCollection()\n });\n }\n\n public convertFromStorage(params: ConverterConvertParams): CmsEntryValues {\n const { field, value } = params;\n\n return this.plugin.convertFromStorage({\n field,\n value,\n converterCollection: this.getConverterCollection()\n });\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAkBO,MAAMC,SAAS,CAAC;EAIXC,UAAU,GAAoCC,SAAS;EAExDC,WAAWA,CAACC,MAAuB,EAAE;IACxC,IAAI,CAACC,IAAI,GAAGD,MAAM,CAACC,IAAI;IACvB,IAAI,CAACC,MAAM,GAAGF,MAAM,CAACE,MAAM;EAC/B;EAEOC,sBAAsBA,CAACN,UAA+B,EAAQ;IACjE,IAAI,IAAI,CAACA,UAAU,EAAE;MACjB,MAAM,IAAIO,cAAW,CACjB,8EAA8E,IAAI,CAACH,IAAI,IAAI,EAC3F,4BAA4B,EAC5B;QACIA,IAAI,EAAE,IAAI,CAACA;MACf,CACJ,CAAC;IACL;IACA,IAAI,CAACJ,UAAU,GAAGA,UAAU;EAChC;EAEOQ,sBAAsBA,CAAA,EAAwB;IACjD,IAAI,CAAC,IAAI,CAACR,UAAU,EAAE;MAClB,MAAM,IAAIO,cAAW,CACjB,uEAAuE,IAAI,CAACH,IAAI,IACpF,CAAC;IACL;IACA,OAAO,IAAI,CAACJ,UAAU;EAC1B;EAEOS,OAAOA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACL,IAAI;EACpB;EAEOM,gBAAgBA,CAACC,MAA8B,EAAkB;IACpE,MAAM;MAAEC,KAAK;MAAEC;IAAM,CAAC,GAAGF,MAAM;IAE/B,OAAO,IAAI,CAACN,MAAM,CAACK,gBAAgB,CAAC;MAChCE,KAAK;MACLC,KAAK;MACLC,mBAAmB,EAAE,IAAI,CAACN,sBAAsB,CAAC;IACrD,CAAC,CAAC;EACN;EAEOO,kBAAkBA,CAACJ,MAA8B,EAAkB;IACtE,MAAM;MAAEC,KAAK;MAAEC;IAAM,CAAC,GAAGF,MAAM;IAE/B,OAAO,IAAI,CAACN,MAAM,CAACU,kBAAkB,CAAC;MAClCH,KAAK;MACLC,KAAK;MACLC,mBAAmB,EAAE,IAAI,CAACN,sBAAsB,CAAC;IACrD,CAAC,CAAC;EACN;AACJ;AAACQ,OAAA,CAAAjB,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import { Converter } from "./Converter";
2
- import { CmsEntryValues, CmsModelField } from "../../types";
3
- import { PluginsContainer } from "@webiny/plugins";
2
+ import type { CmsEntryValues, CmsModelField } from "../../types";
3
+ import type { PluginsContainer } from "@webiny/plugins";
4
4
  export interface CmsModelFieldsWithParent extends CmsModelField {
5
5
  parent?: CmsModelField | null;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_Converter","_plugins","_getBaseFieldType","ConverterCollection","converters","Map","constructor","params","plugins","fieldGraphQLPlugins","byType","fieldConverterPlugins","CmsModelFieldConverterPlugin","type","defaultFieldConverterPlugin","find","pl","getFieldType","undefined","WebinyError","fieldGraphQLPlugin","plugin","fieldType","converter","Converter","addConverter","setConverterCollection","set","getType","getConverter","get","convertToStorage","fields","values","inputValues","attachHasOwnProperty","reduce","output","field","baseType","getBaseFieldType","hasOwnProperty","fieldId","value","convertFromStorage","storageId","Array","isArray","Object","defineProperty","enumerable","writable","property","exports"],"sources":["ConverterCollection.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Converter } from \"./Converter\";\nimport { CmsEntryValues, CmsModelField, CmsModelFieldToGraphQLPlugin } from \"~/types\";\nimport { CmsModelFieldConverterPlugin } from \"~/plugins\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { getBaseFieldType } from \"~/utils/getBaseFieldType\";\n\nexport interface CmsModelFieldsWithParent extends CmsModelField {\n parent?: CmsModelField | null;\n}\n\nexport interface CmsModelConverterCallable {\n (params: ConverterCollectionConvertParams): CmsEntryValues;\n}\n\nexport interface ConverterCollectionConvertParams {\n fields: CmsModelFieldsWithParent[];\n values?: CmsEntryValues;\n}\n\nexport interface ConverterCollectionParams {\n plugins: PluginsContainer;\n}\n\nexport class ConverterCollection {\n private readonly converters: Map<string, Converter> = new Map();\n\n public constructor(params: ConverterCollectionParams) {\n const { plugins } = params;\n const fieldGraphQLPlugins = plugins.byType<CmsModelFieldToGraphQLPlugin>(\n \"cms-model-field-to-graphql\"\n );\n const fieldConverterPlugins = plugins.byType<CmsModelFieldConverterPlugin>(\n CmsModelFieldConverterPlugin.type\n );\n const defaultFieldConverterPlugin = fieldConverterPlugins.find(\n pl => pl.getFieldType() === \"*\"\n );\n if (defaultFieldConverterPlugin === undefined) {\n throw new WebinyError(\n `Missing default field converter plugin.`,\n \"DEFAULT_FIELD_CONVERTER_ERROR\"\n );\n }\n for (const fieldGraphQLPlugin of fieldGraphQLPlugins) {\n const plugin = fieldConverterPlugins.find(\n pl => pl.getFieldType() === fieldGraphQLPlugin.fieldType\n );\n const converter = new Converter({\n type: fieldGraphQLPlugin.fieldType,\n plugin: plugin || defaultFieldConverterPlugin\n });\n\n this.addConverter(converter);\n }\n }\n\n public addConverter(converter: Converter): void {\n converter.setConverterCollection(this);\n this.converters.set(converter.getType(), converter);\n }\n\n public getConverter(type: string): Converter {\n const converter = this.converters.get(type);\n if (converter === undefined) {\n throw new WebinyError(\n `Missing converter for field type \"${type}\".`,\n \"CONVERTER_ERROR\",\n {\n type\n }\n );\n }\n return converter;\n }\n\n public convertToStorage(params: ConverterCollectionConvertParams): CmsEntryValues | undefined {\n const { fields, values: inputValues } = params;\n if (inputValues === undefined) {\n return undefined;\n }\n\n this.attachHasOwnProperty(inputValues);\n\n return fields.reduce<CmsEntryValues>((output, field) => {\n const baseType = getBaseFieldType(field);\n const converter = this.getConverter(baseType);\n if (inputValues === null || inputValues.hasOwnProperty(field.fieldId) === false) {\n return output;\n }\n const values = converter.convertToStorage({\n field,\n value: inputValues[field.fieldId]\n });\n\n return {\n ...output,\n ...values\n };\n }, {});\n }\n\n public convertFromStorage(\n params: ConverterCollectionConvertParams\n ): CmsEntryValues | undefined {\n const { fields, values: inputValues } = params;\n if (inputValues === undefined) {\n return undefined;\n }\n\n return fields.reduce((output, field) => {\n const baseType = getBaseFieldType(field);\n const converter = this.getConverter(baseType);\n if (inputValues === null || inputValues.hasOwnProperty(field.storageId) === false) {\n return output;\n }\n const values = converter.convertFromStorage({\n field,\n value: inputValues[field.storageId]\n });\n\n return {\n ...output,\n ...values\n };\n }, {});\n }\n\n /**\n * This method attaches hasOwnProperty when received object was created via Object.create(null) - no inheritance of Object.\n * At that point, hasOwnProperty does not exist, and we need to add it.\n *\n * TODO add more checks if required\n */\n private attachHasOwnProperty(values: CmsEntryValues) {\n if (\n // null or undefined?\n values === null ||\n values === undefined ||\n // not an object?\n typeof values !== \"object\" ||\n // maybe it's an array?\n Array.isArray(values) ||\n // and in the end, check if hasOwnProperty is a function already\n typeof values?.hasOwnProperty === \"function\"\n ) {\n return;\n }\n Object.defineProperty(values, \"hasOwnProperty\", {\n enumerable: false,\n writable: false,\n value: function (property: string) {\n return this[property] !== undefined;\n }\n });\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,iBAAA,GAAAH,OAAA;AAmBO,MAAMI,mBAAmB,CAAC;EACZC,UAAU,GAA2B,IAAIC,GAAG,CAAC,CAAC;EAExDC,WAAWA,CAACC,MAAiC,EAAE;IAClD,MAAM;MAAEC;IAAQ,CAAC,GAAGD,MAAM;IAC1B,MAAME,mBAAmB,GAAGD,OAAO,CAACE,MAAM,CACtC,4BACJ,CAAC;IACD,MAAMC,qBAAqB,GAAGH,OAAO,CAACE,MAAM,CACxCE,qCAA4B,CAACC,IACjC,CAAC;IACD,MAAMC,2BAA2B,GAAGH,qBAAqB,CAACI,IAAI,CAC1DC,EAAE,IAAIA,EAAE,CAACC,YAAY,CAAC,CAAC,KAAK,GAChC,CAAC;IACD,IAAIH,2BAA2B,KAAKI,SAAS,EAAE;MAC3C,MAAM,IAAIC,cAAW,CACjB,yCAAyC,EACzC,+BACJ,CAAC;IACL;IACA,KAAK,MAAMC,kBAAkB,IAAIX,mBAAmB,EAAE;MAClD,MAAMY,MAAM,GAAGV,qBAAqB,CAACI,IAAI,CACrCC,EAAE,IAAIA,EAAE,CAACC,YAAY,CAAC,CAAC,KAAKG,kBAAkB,CAACE,SACnD,CAAC;MACD,MAAMC,SAAS,GAAG,IAAIC,oBAAS,CAAC;QAC5BX,IAAI,EAAEO,kBAAkB,CAACE,SAAS;QAClCD,MAAM,EAAEA,MAAM,IAAIP;MACtB,CAAC,CAAC;MAEF,IAAI,CAACW,YAAY,CAACF,SAAS,CAAC;IAChC;EACJ;EAEOE,YAAYA,CAACF,SAAoB,EAAQ;IAC5CA,SAAS,CAACG,sBAAsB,CAAC,IAAI,CAAC;IACtC,IAAI,CAACtB,UAAU,CAACuB,GAAG,CAACJ,SAAS,CAACK,OAAO,CAAC,CAAC,EAAEL,SAAS,CAAC;EACvD;EAEOM,YAAYA,CAAChB,IAAY,EAAa;IACzC,MAAMU,SAAS,GAAG,IAAI,CAACnB,UAAU,CAAC0B,GAAG,CAACjB,IAAI,CAAC;IAC3C,IAAIU,SAAS,KAAKL,SAAS,EAAE;MACzB,MAAM,IAAIC,cAAW,CACjB,qCAAqCN,IAAI,IAAI,EAC7C,iBAAiB,EACjB;QACIA;MACJ,CACJ,CAAC;IACL;IACA,OAAOU,SAAS;EACpB;EAEOQ,gBAAgBA,CAACxB,MAAwC,EAA8B;IAC1F,MAAM;MAAEyB,MAAM;MAAEC,MAAM,EAAEC;IAAY,CAAC,GAAG3B,MAAM;IAC9C,IAAI2B,WAAW,KAAKhB,SAAS,EAAE;MAC3B,OAAOA,SAAS;IACpB;IAEA,IAAI,CAACiB,oBAAoB,CAACD,WAAW,CAAC;IAEtC,OAAOF,MAAM,CAACI,MAAM,CAAiB,CAACC,MAAM,EAAEC,KAAK,KAAK;MACpD,MAAMC,QAAQ,GAAG,IAAAC,kCAAgB,EAACF,KAAK,CAAC;MACxC,MAAMf,SAAS,GAAG,IAAI,CAACM,YAAY,CAACU,QAAQ,CAAC;MAC7C,IAAIL,WAAW,KAAK,IAAI,IAAIA,WAAW,CAACO,cAAc,CAACH,KAAK,CAACI,OAAO,CAAC,KAAK,KAAK,EAAE;QAC7E,OAAOL,MAAM;MACjB;MACA,MAAMJ,MAAM,GAAGV,SAAS,CAACQ,gBAAgB,CAAC;QACtCO,KAAK;QACLK,KAAK,EAAET,WAAW,CAACI,KAAK,CAACI,OAAO;MACpC,CAAC,CAAC;MAEF,OAAO;QACH,GAAGL,MAAM;QACT,GAAGJ;MACP,CAAC;IACL,CAAC,EAAE,CAAC,CAAC,CAAC;EACV;EAEOW,kBAAkBA,CACrBrC,MAAwC,EACd;IAC1B,MAAM;MAAEyB,MAAM;MAAEC,MAAM,EAAEC;IAAY,CAAC,GAAG3B,MAAM;IAC9C,IAAI2B,WAAW,KAAKhB,SAAS,EAAE;MAC3B,OAAOA,SAAS;IACpB;IAEA,OAAOc,MAAM,CAACI,MAAM,CAAC,CAACC,MAAM,EAAEC,KAAK,KAAK;MACpC,MAAMC,QAAQ,GAAG,IAAAC,kCAAgB,EAACF,KAAK,CAAC;MACxC,MAAMf,SAAS,GAAG,IAAI,CAACM,YAAY,CAACU,QAAQ,CAAC;MAC7C,IAAIL,WAAW,KAAK,IAAI,IAAIA,WAAW,CAACO,cAAc,CAACH,KAAK,CAACO,SAAS,CAAC,KAAK,KAAK,EAAE;QAC/E,OAAOR,MAAM;MACjB;MACA,MAAMJ,MAAM,GAAGV,SAAS,CAACqB,kBAAkB,CAAC;QACxCN,KAAK;QACLK,KAAK,EAAET,WAAW,CAACI,KAAK,CAACO,SAAS;MACtC,CAAC,CAAC;MAEF,OAAO;QACH,GAAGR,MAAM;QACT,GAAGJ;MACP,CAAC;IACL,CAAC,EAAE,CAAC,CAAC,CAAC;EACV;;EAEA;AACJ;AACA;AACA;AACA;AACA;EACYE,oBAAoBA,CAACF,MAAsB,EAAE;IACjD;IACI;IACAA,MAAM,KAAK,IAAI,IACfA,MAAM,KAAKf,SAAS;IACpB;IACA,OAAOe,MAAM,KAAK,QAAQ;IAC1B;IACAa,KAAK,CAACC,OAAO,CAACd,MAAM,CAAC;IACrB;IACA,OAAOA,MAAM,EAAEQ,cAAc,KAAK,UAAU,EAC9C;MACE;IACJ;IACAO,MAAM,CAACC,cAAc,CAAChB,MAAM,EAAE,gBAAgB,EAAE;MAC5CiB,UAAU,EAAE,KAAK;MACjBC,QAAQ,EAAE,KAAK;MACfR,KAAK,EAAE,SAAAA,CAAUS,QAAgB,EAAE;QAC/B,OAAO,IAAI,CAACA,QAAQ,CAAC,KAAKlC,SAAS;MACvC;IACJ,CAAC,CAAC;EACN;AACJ;AAACmC,OAAA,CAAAlD,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_error","_interopRequireDefault","require","_Converter","_plugins","_getBaseFieldType","ConverterCollection","converters","Map","constructor","params","plugins","fieldGraphQLPlugins","byType","fieldConverterPlugins","CmsModelFieldConverterPlugin","type","defaultFieldConverterPlugin","find","pl","getFieldType","undefined","WebinyError","fieldGraphQLPlugin","plugin","fieldType","converter","Converter","addConverter","setConverterCollection","set","getType","getConverter","get","convertToStorage","fields","values","inputValues","attachHasOwnProperty","reduce","output","field","baseType","getBaseFieldType","hasOwnProperty","fieldId","value","convertFromStorage","storageId","Array","isArray","Object","defineProperty","enumerable","writable","property","exports"],"sources":["ConverterCollection.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Converter } from \"./Converter\";\nimport type { CmsEntryValues, CmsModelField, CmsModelFieldToGraphQLPlugin } from \"~/types\";\nimport { CmsModelFieldConverterPlugin } from \"~/plugins\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport { getBaseFieldType } from \"~/utils/getBaseFieldType\";\n\nexport interface CmsModelFieldsWithParent extends CmsModelField {\n parent?: CmsModelField | null;\n}\n\nexport interface CmsModelConverterCallable {\n (params: ConverterCollectionConvertParams): CmsEntryValues;\n}\n\nexport interface ConverterCollectionConvertParams {\n fields: CmsModelFieldsWithParent[];\n values?: CmsEntryValues;\n}\n\nexport interface ConverterCollectionParams {\n plugins: PluginsContainer;\n}\n\nexport class ConverterCollection {\n private readonly converters: Map<string, Converter> = new Map();\n\n public constructor(params: ConverterCollectionParams) {\n const { plugins } = params;\n const fieldGraphQLPlugins = plugins.byType<CmsModelFieldToGraphQLPlugin>(\n \"cms-model-field-to-graphql\"\n );\n const fieldConverterPlugins = plugins.byType<CmsModelFieldConverterPlugin>(\n CmsModelFieldConverterPlugin.type\n );\n const defaultFieldConverterPlugin = fieldConverterPlugins.find(\n pl => pl.getFieldType() === \"*\"\n );\n if (defaultFieldConverterPlugin === undefined) {\n throw new WebinyError(\n `Missing default field converter plugin.`,\n \"DEFAULT_FIELD_CONVERTER_ERROR\"\n );\n }\n for (const fieldGraphQLPlugin of fieldGraphQLPlugins) {\n const plugin = fieldConverterPlugins.find(\n pl => pl.getFieldType() === fieldGraphQLPlugin.fieldType\n );\n const converter = new Converter({\n type: fieldGraphQLPlugin.fieldType,\n plugin: plugin || defaultFieldConverterPlugin\n });\n\n this.addConverter(converter);\n }\n }\n\n public addConverter(converter: Converter): void {\n converter.setConverterCollection(this);\n this.converters.set(converter.getType(), converter);\n }\n\n public getConverter(type: string): Converter {\n const converter = this.converters.get(type);\n if (converter === undefined) {\n throw new WebinyError(\n `Missing converter for field type \"${type}\".`,\n \"CONVERTER_ERROR\",\n {\n type\n }\n );\n }\n return converter;\n }\n\n public convertToStorage(params: ConverterCollectionConvertParams): CmsEntryValues | undefined {\n const { fields, values: inputValues } = params;\n if (inputValues === undefined) {\n return undefined;\n }\n\n this.attachHasOwnProperty(inputValues);\n\n return fields.reduce<CmsEntryValues>((output, field) => {\n const baseType = getBaseFieldType(field);\n const converter = this.getConverter(baseType);\n if (inputValues === null || inputValues.hasOwnProperty(field.fieldId) === false) {\n return output;\n }\n const values = converter.convertToStorage({\n field,\n value: inputValues[field.fieldId]\n });\n\n return {\n ...output,\n ...values\n };\n }, {});\n }\n\n public convertFromStorage(\n params: ConverterCollectionConvertParams\n ): CmsEntryValues | undefined {\n const { fields, values: inputValues } = params;\n if (inputValues === undefined) {\n return undefined;\n }\n\n return fields.reduce((output, field) => {\n const baseType = getBaseFieldType(field);\n const converter = this.getConverter(baseType);\n if (inputValues === null || inputValues.hasOwnProperty(field.storageId) === false) {\n return output;\n }\n const values = converter.convertFromStorage({\n field,\n value: inputValues[field.storageId]\n });\n\n return {\n ...output,\n ...values\n };\n }, {});\n }\n\n /**\n * This method attaches hasOwnProperty when received object was created via Object.create(null) - no inheritance of Object.\n * At that point, hasOwnProperty does not exist, and we need to add it.\n *\n * TODO add more checks if required\n */\n private attachHasOwnProperty(values: CmsEntryValues) {\n if (\n // null or undefined?\n values === null ||\n values === undefined ||\n // not an object?\n typeof values !== \"object\" ||\n // maybe it's an array?\n Array.isArray(values) ||\n // and in the end, check if hasOwnProperty is a function already\n typeof values?.hasOwnProperty === \"function\"\n ) {\n return;\n }\n Object.defineProperty(values, \"hasOwnProperty\", {\n enumerable: false,\n writable: false,\n value: function (property: string) {\n return this[property] !== undefined;\n }\n });\n }\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,6 +1,6 @@
1
- import { PluginsContainer } from "@webiny/plugins";
2
- import { CmsModelConverterCallable } from "./ConverterCollection";
3
- import { CmsModel, StorageOperationsCmsModel } from "../../types";
1
+ import type { PluginsContainer } from "@webiny/plugins";
2
+ import type { CmsModelConverterCallable } from "./ConverterCollection";
3
+ import type { CmsModel, StorageOperationsCmsModel } from "../../types";
4
4
  interface Params {
5
5
  /**
6
6
  * We need a model to determine if the conversion feature is enabled.