@webiny/api-headless-cms 5.17.4 → 5.18.0-beta.3

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 (395) hide show
  1. package/content/contextSetup.js +1 -2
  2. package/content/graphQLHandlerFactory.d.ts +1 -2
  3. package/content/graphQLHandlerFactory.js +12 -4
  4. package/content/plugins/CmsGroupPlugin.d.ts +11 -0
  5. package/content/plugins/{ContentModelGroupPlugin.js → CmsGroupPlugin.js} +4 -5
  6. package/content/plugins/CmsModelPlugin.d.ts +11 -0
  7. package/content/plugins/{ContentModelPlugin.js → CmsModelPlugin.js} +4 -5
  8. package/content/plugins/buildSchemaPlugins.js +1 -2
  9. package/content/plugins/crud/contentEntry/beforeCreate.d.ts +7 -0
  10. package/content/plugins/crud/contentEntry/beforeCreate.js +28 -0
  11. package/content/plugins/crud/contentEntry/beforeUpdate.d.ts +7 -0
  12. package/content/plugins/crud/contentEntry/beforeUpdate.js +28 -0
  13. package/content/plugins/crud/contentEntry/entryDataValidation.d.ts +2 -2
  14. package/content/plugins/crud/contentEntry/entryDataValidation.js +1 -2
  15. package/content/plugins/crud/contentEntry/markLockedFields.d.ts +3 -3
  16. package/content/plugins/crud/contentEntry/markLockedFields.js +10 -7
  17. package/content/plugins/crud/contentEntry.crud.d.ts +12 -4
  18. package/content/plugins/crud/contentEntry.crud.js +807 -757
  19. package/content/plugins/crud/contentModel/afterCreate.d.ts +7 -0
  20. package/content/plugins/crud/contentModel/afterCreate.js +18 -0
  21. package/content/plugins/crud/contentModel/afterDelete.d.ts +7 -0
  22. package/content/plugins/crud/contentModel/afterDelete.js +18 -0
  23. package/content/plugins/crud/contentModel/afterUpdate.d.ts +7 -0
  24. package/content/plugins/crud/contentModel/afterUpdate.js +18 -0
  25. package/content/plugins/crud/contentModel/beforeCreate.d.ts +9 -0
  26. package/content/plugins/crud/contentModel/beforeCreate.js +146 -0
  27. package/content/plugins/crud/contentModel/beforeDelete.d.ts +9 -0
  28. package/content/plugins/crud/contentModel/beforeDelete.js +56 -0
  29. package/content/plugins/crud/contentModel/beforeUpdate.d.ts +9 -0
  30. package/content/plugins/crud/contentModel/beforeUpdate.js +128 -0
  31. package/content/plugins/crud/contentModel/contentModelManagerFactory.d.ts +2 -2
  32. package/content/plugins/crud/contentModel/contentModelManagerFactory.js +2 -3
  33. package/content/plugins/crud/contentModel/createFieldModels.d.ts +2 -2
  34. package/content/plugins/crud/contentModel/createFieldModels.js +2 -3
  35. package/content/plugins/crud/contentModel/idValidation.js +1 -2
  36. package/content/plugins/crud/contentModel/models.js +1 -2
  37. package/content/plugins/crud/contentModel/validateLayout.d.ts +2 -2
  38. package/content/plugins/crud/contentModel/validateLayout.js +1 -2
  39. package/content/plugins/crud/contentModel.crud.d.ts +12 -4
  40. package/content/plugins/crud/contentModel.crud.js +351 -279
  41. package/content/plugins/crud/contentModelGroup/beforeCreate.d.ts +9 -0
  42. package/content/plugins/crud/contentModelGroup/beforeCreate.js +66 -0
  43. package/content/plugins/crud/contentModelGroup/beforeDelete.d.ts +9 -0
  44. package/content/plugins/crud/contentModelGroup/beforeDelete.js +48 -0
  45. package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +8 -0
  46. package/content/plugins/crud/contentModelGroup/beforeUpdate.js +28 -0
  47. package/content/plugins/crud/contentModelGroup.crud.d.ts +12 -4
  48. package/content/plugins/crud/contentModelGroup.crud.js +259 -219
  49. package/content/plugins/crud/index.d.ts +6 -0
  50. package/content/plugins/crud/index.js +96 -0
  51. package/content/plugins/graphqlFields/boolean.js +1 -2
  52. package/content/plugins/graphqlFields/datetime.js +1 -2
  53. package/content/plugins/graphqlFields/file.js +1 -2
  54. package/content/plugins/graphqlFields/index.js +1 -2
  55. package/content/plugins/graphqlFields/longText.js +1 -2
  56. package/content/plugins/graphqlFields/number.js +1 -2
  57. package/content/plugins/graphqlFields/object.js +1 -2
  58. package/content/plugins/graphqlFields/ref.js +22 -11
  59. package/content/plugins/graphqlFields/richText.js +1 -2
  60. package/content/plugins/graphqlFields/text.js +1 -2
  61. package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +2 -3
  62. package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +1 -2
  63. package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +15 -0
  64. package/content/plugins/modelManager/DefaultCmsModelManager.js +62 -0
  65. package/content/plugins/modelManager/index.d.ts +2 -2
  66. package/content/plugins/modelManager/index.js +3 -4
  67. package/content/plugins/schema/baseSchema.js +1 -2
  68. package/content/plugins/schema/contentEntries.js +9 -10
  69. package/content/plugins/schema/contentModelGroups.js +13 -14
  70. package/content/plugins/schema/contentModels.js +9 -10
  71. package/content/plugins/schema/createFieldResolvers.d.ts +2 -2
  72. package/content/plugins/schema/createFieldResolvers.js +14 -20
  73. package/content/plugins/schema/createManageResolvers.d.ts +3 -3
  74. package/content/plugins/schema/createManageResolvers.js +6 -10
  75. package/content/plugins/schema/createManageSDL.d.ts +2 -2
  76. package/content/plugins/schema/createManageSDL.js +5 -6
  77. package/content/plugins/schema/createPreviewResolvers.d.ts +3 -3
  78. package/content/plugins/schema/createPreviewResolvers.js +5 -6
  79. package/content/plugins/schema/createReadResolvers.d.ts +3 -3
  80. package/content/plugins/schema/createReadResolvers.js +5 -6
  81. package/content/plugins/schema/createReadSDL.d.ts +2 -2
  82. package/content/plugins/schema/createReadSDL.js +3 -4
  83. package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +4 -4
  84. package/content/plugins/schema/resolvers/commonFieldResolvers.js +1 -2
  85. package/content/plugins/schema/resolvers/manage/resolveCreate.d.ts +1 -1
  86. package/content/plugins/schema/resolvers/manage/resolveCreate.js +3 -4
  87. package/content/plugins/schema/resolvers/manage/resolveCreateFrom.d.ts +1 -1
  88. package/content/plugins/schema/resolvers/manage/resolveCreateFrom.js +3 -4
  89. package/content/plugins/schema/resolvers/manage/resolveDelete.d.ts +1 -1
  90. package/content/plugins/schema/resolvers/manage/resolveDelete.js +4 -5
  91. package/content/plugins/schema/resolvers/manage/resolveGet.d.ts +1 -1
  92. package/content/plugins/schema/resolvers/manage/resolveGet.js +3 -4
  93. package/content/plugins/schema/resolvers/manage/resolveGetByIds.d.ts +1 -1
  94. package/content/plugins/schema/resolvers/manage/resolveGetByIds.js +3 -4
  95. package/content/plugins/schema/resolvers/manage/resolveGetRevisions.d.ts +1 -1
  96. package/content/plugins/schema/resolvers/manage/resolveGetRevisions.js +3 -4
  97. package/content/plugins/schema/resolvers/manage/resolveList.d.ts +1 -1
  98. package/content/plugins/schema/resolvers/manage/resolveList.js +3 -4
  99. package/content/plugins/schema/resolvers/manage/resolvePublish.d.ts +1 -1
  100. package/content/plugins/schema/resolvers/manage/resolvePublish.js +3 -4
  101. package/content/plugins/schema/resolvers/manage/resolveRequestChanges.d.ts +1 -1
  102. package/content/plugins/schema/resolvers/manage/resolveRequestChanges.js +3 -4
  103. package/content/plugins/schema/resolvers/manage/resolveRequestReview.d.ts +1 -1
  104. package/content/plugins/schema/resolvers/manage/resolveRequestReview.js +3 -4
  105. package/content/plugins/schema/resolvers/manage/resolveUnpublish.d.ts +1 -1
  106. package/content/plugins/schema/resolvers/manage/resolveUnpublish.js +3 -4
  107. package/content/plugins/schema/resolvers/manage/resolveUpdate.d.ts +1 -1
  108. package/content/plugins/schema/resolvers/manage/resolveUpdate.js +3 -4
  109. package/content/plugins/schema/resolvers/preview/resolveGet.d.ts +1 -1
  110. package/content/plugins/schema/resolvers/preview/resolveGet.js +3 -4
  111. package/content/plugins/schema/resolvers/preview/resolveList.d.ts +1 -1
  112. package/content/plugins/schema/resolvers/preview/resolveList.js +3 -4
  113. package/content/plugins/schema/resolvers/read/resolveGet.d.ts +1 -1
  114. package/content/plugins/schema/resolvers/read/resolveGet.js +3 -4
  115. package/content/plugins/schema/resolvers/read/resolveList.d.ts +1 -1
  116. package/content/plugins/schema/resolvers/read/resolveList.js +3 -4
  117. package/content/plugins/schema/schemaPlugins.js +4 -3
  118. package/content/plugins/storage/StorageTransformPlugin.d.ts +30 -0
  119. package/content/plugins/storage/StorageTransformPlugin.js +36 -0
  120. package/content/plugins/storage/default.d.ts +2 -2
  121. package/content/plugins/storage/default.js +12 -12
  122. package/content/plugins/storage/object.d.ts +2 -2
  123. package/content/plugins/storage/object.js +28 -29
  124. package/content/plugins/utils/createTypeName.js +1 -2
  125. package/content/plugins/utils/entryStorage.d.ts +5 -5
  126. package/content/plugins/utils/entryStorage.js +21 -14
  127. package/content/plugins/utils/getEntryTitle.d.ts +2 -2
  128. package/content/plugins/utils/getEntryTitle.js +1 -2
  129. package/content/plugins/utils/getSchemaFromFieldPlugins.d.ts +2 -2
  130. package/content/plugins/utils/getSchemaFromFieldPlugins.js +1 -2
  131. package/content/plugins/utils/pluralizedTypeName.js +1 -2
  132. package/content/plugins/utils/renderFields.d.ts +2 -2
  133. package/content/plugins/utils/renderFields.js +1 -2
  134. package/content/plugins/utils/renderGetFilterFields.d.ts +2 -2
  135. package/content/plugins/utils/renderGetFilterFields.js +1 -2
  136. package/content/plugins/utils/renderInputFields.d.ts +2 -2
  137. package/content/plugins/utils/renderInputFields.js +1 -2
  138. package/content/plugins/utils/renderListFilterFields.d.ts +2 -2
  139. package/content/plugins/utils/renderListFilterFields.js +1 -2
  140. package/content/plugins/utils/renderSortEnum.d.ts +2 -2
  141. package/content/plugins/utils/renderSortEnum.js +1 -2
  142. package/content/plugins/validators/dateGte.js +1 -2
  143. package/content/plugins/validators/dateLte.js +1 -2
  144. package/content/plugins/validators/gte.js +1 -2
  145. package/content/plugins/validators/in.js +1 -2
  146. package/content/plugins/validators/index.js +1 -2
  147. package/content/plugins/validators/lte.js +1 -2
  148. package/content/plugins/validators/maxLength.js +1 -2
  149. package/content/plugins/validators/minLength.js +1 -2
  150. package/content/plugins/validators/pattern.js +1 -2
  151. package/content/plugins/validators/patternPlugins/email.js +1 -2
  152. package/content/plugins/validators/patternPlugins/index.js +1 -2
  153. package/content/plugins/validators/patternPlugins/lowerCase.js +1 -2
  154. package/content/plugins/validators/patternPlugins/upperCase.js +1 -2
  155. package/content/plugins/validators/patternPlugins/url.js +1 -2
  156. package/content/plugins/validators/required.js +1 -2
  157. package/content/plugins/validators/timeGte.js +1 -2
  158. package/content/plugins/validators/timeLte.js +1 -2
  159. package/index.d.ts +12 -0
  160. package/index.js +66 -0
  161. package/migrateCMSPermissions.d.ts +2 -2
  162. package/migrateCMSPermissions.js +1 -2
  163. package/package.json +23 -21
  164. package/plugins/context.js +1 -2
  165. package/plugins/crud/index.d.ts +6 -2
  166. package/plugins/crud/index.js +69 -6
  167. package/plugins/crud/settings.crud.d.ts +10 -4
  168. package/plugins/crud/settings.crud.js +64 -77
  169. package/plugins/crud/system.crud.d.ts +10 -4
  170. package/plugins/crud/system.crud.js +139 -126
  171. package/plugins/graphql/system.js +5 -6
  172. package/plugins/graphql.d.ts +1 -2
  173. package/plugins/graphql.js +49 -50
  174. package/plugins/upgrades/index.js +1 -2
  175. package/plugins/upgrades/v5.5.0/helpers.js +1 -2
  176. package/plugins/upgrades/v5.5.0/index.js +3 -4
  177. package/transformers.js +1 -2
  178. package/types.d.ts +742 -1232
  179. package/types.js +104 -254
  180. package/utils.d.ts +4 -11
  181. package/utils.js +2 -49
  182. package/content/contextSetup.js.map +0 -1
  183. package/content/graphQLHandlerFactory.js.map +0 -1
  184. package/content/index.d.ts +0 -5
  185. package/content/index.js +0 -37
  186. package/content/index.js.map +0 -1
  187. package/content/plugins/ContentModelGroupPlugin.d.ts +0 -7
  188. package/content/plugins/ContentModelGroupPlugin.js.map +0 -1
  189. package/content/plugins/ContentModelPlugin.d.ts +0 -7
  190. package/content/plugins/ContentModelPlugin.js.map +0 -1
  191. package/content/plugins/buildSchemaPlugins.js.map +0 -1
  192. package/content/plugins/crud/contentEntry/afterCreate.hook.d.ts +0 -2
  193. package/content/plugins/crud/contentEntry/afterCreate.hook.js +0 -15
  194. package/content/plugins/crud/contentEntry/afterCreate.hook.js.map +0 -1
  195. package/content/plugins/crud/contentEntry/afterCreateRevisionFrom.hook.d.ts +0 -2
  196. package/content/plugins/crud/contentEntry/afterCreateRevisionFrom.hook.js +0 -15
  197. package/content/plugins/crud/contentEntry/afterCreateRevisionFrom.hook.js.map +0 -1
  198. package/content/plugins/crud/contentEntry/afterDelete.hook.d.ts +0 -2
  199. package/content/plugins/crud/contentEntry/afterDelete.hook.js +0 -15
  200. package/content/plugins/crud/contentEntry/afterDelete.hook.js.map +0 -1
  201. package/content/plugins/crud/contentEntry/afterDeleteRevision.hook.d.ts +0 -2
  202. package/content/plugins/crud/contentEntry/afterDeleteRevision.hook.js +0 -15
  203. package/content/plugins/crud/contentEntry/afterDeleteRevision.hook.js.map +0 -1
  204. package/content/plugins/crud/contentEntry/afterPublish.hook.d.ts +0 -2
  205. package/content/plugins/crud/contentEntry/afterPublish.hook.js +0 -15
  206. package/content/plugins/crud/contentEntry/afterPublish.hook.js.map +0 -1
  207. package/content/plugins/crud/contentEntry/afterRequestChanges.hook.d.ts +0 -2
  208. package/content/plugins/crud/contentEntry/afterRequestChanges.hook.js +0 -15
  209. package/content/plugins/crud/contentEntry/afterRequestChanges.hook.js.map +0 -1
  210. package/content/plugins/crud/contentEntry/afterRequestReview.hook.d.ts +0 -2
  211. package/content/plugins/crud/contentEntry/afterRequestReview.hook.js +0 -15
  212. package/content/plugins/crud/contentEntry/afterRequestReview.hook.js.map +0 -1
  213. package/content/plugins/crud/contentEntry/afterUnpublish.hook.d.ts +0 -2
  214. package/content/plugins/crud/contentEntry/afterUnpublish.hook.js +0 -15
  215. package/content/plugins/crud/contentEntry/afterUnpublish.hook.js.map +0 -1
  216. package/content/plugins/crud/contentEntry/afterUpdate.hook.d.ts +0 -2
  217. package/content/plugins/crud/contentEntry/afterUpdate.hook.js +0 -15
  218. package/content/plugins/crud/contentEntry/afterUpdate.hook.js.map +0 -1
  219. package/content/plugins/crud/contentEntry/beforeCreate.hook.d.ts +0 -2
  220. package/content/plugins/crud/contentEntry/beforeCreate.hook.js +0 -18
  221. package/content/plugins/crud/contentEntry/beforeCreate.hook.js.map +0 -1
  222. package/content/plugins/crud/contentEntry/beforeCreateRevisionFrom.hook.d.ts +0 -2
  223. package/content/plugins/crud/contentEntry/beforeCreateRevisionFrom.hook.js +0 -15
  224. package/content/plugins/crud/contentEntry/beforeCreateRevisionFrom.hook.js.map +0 -1
  225. package/content/plugins/crud/contentEntry/beforeDelete.hook.d.ts +0 -2
  226. package/content/plugins/crud/contentEntry/beforeDelete.hook.js +0 -15
  227. package/content/plugins/crud/contentEntry/beforeDelete.hook.js.map +0 -1
  228. package/content/plugins/crud/contentEntry/beforeDeleteRevision.hook.d.ts +0 -2
  229. package/content/plugins/crud/contentEntry/beforeDeleteRevision.hook.js +0 -15
  230. package/content/plugins/crud/contentEntry/beforeDeleteRevision.hook.js.map +0 -1
  231. package/content/plugins/crud/contentEntry/beforePublish.hook.d.ts +0 -2
  232. package/content/plugins/crud/contentEntry/beforePublish.hook.js +0 -15
  233. package/content/plugins/crud/contentEntry/beforePublish.hook.js.map +0 -1
  234. package/content/plugins/crud/contentEntry/beforeRequestChanges.hook.d.ts +0 -2
  235. package/content/plugins/crud/contentEntry/beforeRequestChanges.hook.js +0 -15
  236. package/content/plugins/crud/contentEntry/beforeRequestChanges.hook.js.map +0 -1
  237. package/content/plugins/crud/contentEntry/beforeRequestReview.hook.d.ts +0 -2
  238. package/content/plugins/crud/contentEntry/beforeRequestReview.hook.js +0 -15
  239. package/content/plugins/crud/contentEntry/beforeRequestReview.hook.js.map +0 -1
  240. package/content/plugins/crud/contentEntry/beforeUnpublish.hook.d.ts +0 -2
  241. package/content/plugins/crud/contentEntry/beforeUnpublish.hook.js +0 -15
  242. package/content/plugins/crud/contentEntry/beforeUnpublish.hook.js.map +0 -1
  243. package/content/plugins/crud/contentEntry/beforeUpdate.hook.d.ts +0 -2
  244. package/content/plugins/crud/contentEntry/beforeUpdate.hook.js +0 -18
  245. package/content/plugins/crud/contentEntry/beforeUpdate.hook.js.map +0 -1
  246. package/content/plugins/crud/contentEntry/entryDataValidation.js.map +0 -1
  247. package/content/plugins/crud/contentEntry/hooks.d.ts +0 -18
  248. package/content/plugins/crud/contentEntry/hooks.js +0 -240
  249. package/content/plugins/crud/contentEntry/hooks.js.map +0 -1
  250. package/content/plugins/crud/contentEntry/markLockedFields.js.map +0 -1
  251. package/content/plugins/crud/contentEntry/runContentEntryLifecycleHooks.d.ts +0 -4
  252. package/content/plugins/crud/contentEntry/runContentEntryLifecycleHooks.js +0 -24
  253. package/content/plugins/crud/contentEntry/runContentEntryLifecycleHooks.js.map +0 -1
  254. package/content/plugins/crud/contentEntry.crud.js.map +0 -1
  255. package/content/plugins/crud/contentModel/afterCreate.hook.d.ts +0 -7
  256. package/content/plugins/crud/contentModel/afterCreate.hook.js +0 -24
  257. package/content/plugins/crud/contentModel/afterCreate.hook.js.map +0 -1
  258. package/content/plugins/crud/contentModel/afterDelete.hook.d.ts +0 -7
  259. package/content/plugins/crud/contentModel/afterDelete.hook.js +0 -24
  260. package/content/plugins/crud/contentModel/afterDelete.hook.js.map +0 -1
  261. package/content/plugins/crud/contentModel/afterUpdate.hook.d.ts +0 -7
  262. package/content/plugins/crud/contentModel/afterUpdate.hook.js +0 -24
  263. package/content/plugins/crud/contentModel/afterUpdate.hook.js.map +0 -1
  264. package/content/plugins/crud/contentModel/beforeCreate.hook.d.ts +0 -7
  265. package/content/plugins/crud/contentModel/beforeCreate.hook.js +0 -137
  266. package/content/plugins/crud/contentModel/beforeCreate.hook.js.map +0 -1
  267. package/content/plugins/crud/contentModel/beforeDelete.hook.d.ts +0 -7
  268. package/content/plugins/crud/contentModel/beforeDelete.hook.js +0 -58
  269. package/content/plugins/crud/contentModel/beforeDelete.hook.js.map +0 -1
  270. package/content/plugins/crud/contentModel/beforeUpdate.hook.d.ts +0 -7
  271. package/content/plugins/crud/contentModel/beforeUpdate.hook.js +0 -141
  272. package/content/plugins/crud/contentModel/beforeUpdate.hook.js.map +0 -1
  273. package/content/plugins/crud/contentModel/contentModelManagerFactory.js.map +0 -1
  274. package/content/plugins/crud/contentModel/createFieldModels.js.map +0 -1
  275. package/content/plugins/crud/contentModel/hooks.d.ts +0 -6
  276. package/content/plugins/crud/contentModel/hooks.js +0 -84
  277. package/content/plugins/crud/contentModel/hooks.js.map +0 -1
  278. package/content/plugins/crud/contentModel/idValidation.js.map +0 -1
  279. package/content/plugins/crud/contentModel/models.js.map +0 -1
  280. package/content/plugins/crud/contentModel/runContentModelLifecycleHooks.d.ts +0 -2
  281. package/content/plugins/crud/contentModel/runContentModelLifecycleHooks.js +0 -24
  282. package/content/plugins/crud/contentModel/runContentModelLifecycleHooks.js.map +0 -1
  283. package/content/plugins/crud/contentModel/validateLayout.js.map +0 -1
  284. package/content/plugins/crud/contentModel.crud.js.map +0 -1
  285. package/content/plugins/crud/contentModelGroup/afterCreate.hook.d.ts +0 -7
  286. package/content/plugins/crud/contentModelGroup/afterCreate.hook.js +0 -24
  287. package/content/plugins/crud/contentModelGroup/afterCreate.hook.js.map +0 -1
  288. package/content/plugins/crud/contentModelGroup/afterDelete.hook.d.ts +0 -8
  289. package/content/plugins/crud/contentModelGroup/afterDelete.hook.js +0 -22
  290. package/content/plugins/crud/contentModelGroup/afterDelete.hook.js.map +0 -1
  291. package/content/plugins/crud/contentModelGroup/afterUpdate.hook.d.ts +0 -7
  292. package/content/plugins/crud/contentModelGroup/afterUpdate.hook.js +0 -26
  293. package/content/plugins/crud/contentModelGroup/afterUpdate.hook.js.map +0 -1
  294. package/content/plugins/crud/contentModelGroup/beforeCreate.hook.d.ts +0 -7
  295. package/content/plugins/crud/contentModelGroup/beforeCreate.hook.js +0 -87
  296. package/content/plugins/crud/contentModelGroup/beforeCreate.hook.js.map +0 -1
  297. package/content/plugins/crud/contentModelGroup/beforeDelete.hook.d.ts +0 -7
  298. package/content/plugins/crud/contentModelGroup/beforeDelete.hook.js +0 -46
  299. package/content/plugins/crud/contentModelGroup/beforeDelete.hook.js.map +0 -1
  300. package/content/plugins/crud/contentModelGroup/beforeUpdate.hook.d.ts +0 -7
  301. package/content/plugins/crud/contentModelGroup/beforeUpdate.hook.js +0 -35
  302. package/content/plugins/crud/contentModelGroup/beforeUpdate.hook.js.map +0 -1
  303. package/content/plugins/crud/contentModelGroup.crud.js.map +0 -1
  304. package/content/plugins/graphqlFields/boolean.js.map +0 -1
  305. package/content/plugins/graphqlFields/datetime.js.map +0 -1
  306. package/content/plugins/graphqlFields/file.js.map +0 -1
  307. package/content/plugins/graphqlFields/index.js.map +0 -1
  308. package/content/plugins/graphqlFields/longText.js.map +0 -1
  309. package/content/plugins/graphqlFields/number.js.map +0 -1
  310. package/content/plugins/graphqlFields/object.js.map +0 -1
  311. package/content/plugins/graphqlFields/ref.js.map +0 -1
  312. package/content/plugins/graphqlFields/richText.js.map +0 -1
  313. package/content/plugins/graphqlFields/text.js.map +0 -1
  314. package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js.map +0 -1
  315. package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js.map +0 -1
  316. package/content/plugins/modelManager/DefaultContentModelManager.d.ts +0 -15
  317. package/content/plugins/modelManager/DefaultContentModelManager.js +0 -63
  318. package/content/plugins/modelManager/DefaultContentModelManager.js.map +0 -1
  319. package/content/plugins/modelManager/index.js.map +0 -1
  320. package/content/plugins/schema/baseSchema.js.map +0 -1
  321. package/content/plugins/schema/contentEntries.js.map +0 -1
  322. package/content/plugins/schema/contentModelGroups.js.map +0 -1
  323. package/content/plugins/schema/contentModels.js.map +0 -1
  324. package/content/plugins/schema/createFieldResolvers.js.map +0 -1
  325. package/content/plugins/schema/createManageResolvers.js.map +0 -1
  326. package/content/plugins/schema/createManageSDL.js.map +0 -1
  327. package/content/plugins/schema/createPreviewResolvers.js.map +0 -1
  328. package/content/plugins/schema/createReadResolvers.js.map +0 -1
  329. package/content/plugins/schema/createReadSDL.js.map +0 -1
  330. package/content/plugins/schema/resolvers/commonFieldResolvers.js.map +0 -1
  331. package/content/plugins/schema/resolvers/manage/resolveCreate.js.map +0 -1
  332. package/content/plugins/schema/resolvers/manage/resolveCreateFrom.js.map +0 -1
  333. package/content/plugins/schema/resolvers/manage/resolveDelete.js.map +0 -1
  334. package/content/plugins/schema/resolvers/manage/resolveGet.js.map +0 -1
  335. package/content/plugins/schema/resolvers/manage/resolveGetByIds.js.map +0 -1
  336. package/content/plugins/schema/resolvers/manage/resolveGetRevisions.js.map +0 -1
  337. package/content/plugins/schema/resolvers/manage/resolveList.js.map +0 -1
  338. package/content/plugins/schema/resolvers/manage/resolvePublish.js.map +0 -1
  339. package/content/plugins/schema/resolvers/manage/resolveRequestChanges.js.map +0 -1
  340. package/content/plugins/schema/resolvers/manage/resolveRequestReview.js.map +0 -1
  341. package/content/plugins/schema/resolvers/manage/resolveUnpublish.js.map +0 -1
  342. package/content/plugins/schema/resolvers/manage/resolveUpdate.js.map +0 -1
  343. package/content/plugins/schema/resolvers/preview/resolveGet.js.map +0 -1
  344. package/content/plugins/schema/resolvers/preview/resolveList.js.map +0 -1
  345. package/content/plugins/schema/resolvers/read/resolveGet.js.map +0 -1
  346. package/content/plugins/schema/resolvers/read/resolveList.js.map +0 -1
  347. package/content/plugins/schema/schemaPlugins.js.map +0 -1
  348. package/content/plugins/storage/default.js.map +0 -1
  349. package/content/plugins/storage/object.js.map +0 -1
  350. package/content/plugins/utils/createTypeName.js.map +0 -1
  351. package/content/plugins/utils/entryStorage.js.map +0 -1
  352. package/content/plugins/utils/getEntryTitle.js.map +0 -1
  353. package/content/plugins/utils/getSchemaFromFieldPlugins.js.map +0 -1
  354. package/content/plugins/utils/pluralizedTypeName.js.map +0 -1
  355. package/content/plugins/utils/renderFields.js.map +0 -1
  356. package/content/plugins/utils/renderGetFilterFields.js.map +0 -1
  357. package/content/plugins/utils/renderInputFields.js.map +0 -1
  358. package/content/plugins/utils/renderListFilterFields.js.map +0 -1
  359. package/content/plugins/utils/renderSortEnum.js.map +0 -1
  360. package/content/plugins/validators/dateGte.js.map +0 -1
  361. package/content/plugins/validators/dateLte.js.map +0 -1
  362. package/content/plugins/validators/gte.js.map +0 -1
  363. package/content/plugins/validators/in.js.map +0 -1
  364. package/content/plugins/validators/index.js.map +0 -1
  365. package/content/plugins/validators/lte.js.map +0 -1
  366. package/content/plugins/validators/maxLength.js.map +0 -1
  367. package/content/plugins/validators/minLength.js.map +0 -1
  368. package/content/plugins/validators/pattern.js.map +0 -1
  369. package/content/plugins/validators/patternPlugins/email.js.map +0 -1
  370. package/content/plugins/validators/patternPlugins/index.js.map +0 -1
  371. package/content/plugins/validators/patternPlugins/lowerCase.js.map +0 -1
  372. package/content/plugins/validators/patternPlugins/upperCase.js.map +0 -1
  373. package/content/plugins/validators/patternPlugins/url.js.map +0 -1
  374. package/content/plugins/validators/required.js.map +0 -1
  375. package/content/plugins/validators/timeGte.js.map +0 -1
  376. package/content/plugins/validators/timeLte.js.map +0 -1
  377. package/migrateCMSPermissions.js.map +0 -1
  378. package/plugins/InstallationPlugin.d.ts +0 -19
  379. package/plugins/InstallationPlugin.js +0 -39
  380. package/plugins/InstallationPlugin.js.map +0 -1
  381. package/plugins/context.js.map +0 -1
  382. package/plugins/crud/index.js.map +0 -1
  383. package/plugins/crud/settings.crud.js.map +0 -1
  384. package/plugins/crud/system.crud.js.map +0 -1
  385. package/plugins/graphql/system.js.map +0 -1
  386. package/plugins/graphql.js.map +0 -1
  387. package/plugins/index.d.ts +0 -2
  388. package/plugins/index.js +0 -25
  389. package/plugins/index.js.map +0 -1
  390. package/plugins/upgrades/index.js.map +0 -1
  391. package/plugins/upgrades/v5.5.0/helpers.js.map +0 -1
  392. package/plugins/upgrades/v5.5.0/index.js.map +0 -1
  393. package/transformers.js.map +0 -1
  394. package/types.js.map +0 -1
  395. package/utils.js.map +0 -1
package/types.d.ts CHANGED
@@ -8,6 +8,8 @@ import { SecurityPermission } from "@webiny/api-security/types";
8
8
  import { HttpContext } from "@webiny/handler-http/types";
9
9
  import { DbContext } from "@webiny/handler-db/types";
10
10
  import { FileManagerContext } from "@webiny/api-file-manager/types";
11
+ import { UpgradePlugin } from "@webiny/api-upgrade/types";
12
+ import { Topic } from "@webiny/pubsub/types";
11
13
  interface BaseCmsValuesObject {
12
14
  /**
13
15
  * API type
@@ -34,24 +36,27 @@ interface BaseCmsValuesObject {
34
36
  */
35
37
  PREVIEW: boolean;
36
38
  }
39
+ export interface HeadlessCms extends BaseCmsValuesObject, CmsCrudContextObject {
40
+ storageOperations: HeadlessCmsStorageOperations;
41
+ }
37
42
  /**
38
43
  * @description This combines all contexts used in the CMS into a single one.
39
44
  *
40
45
  * @category Context
41
46
  */
42
47
  export interface CmsContext extends ContextInterface, DbContext, HttpContext, I18NContext, FileManagerContext, BaseI18NContentContext, TenancyContext {
43
- cms: BaseCmsValuesObject & CmsCrudContextObject;
48
+ cms: HeadlessCms;
44
49
  }
45
- interface CmsContentModelFieldPredefinedValuesValue {
50
+ interface CmsModelFieldPredefinedValuesValue {
46
51
  value: string;
47
52
  label: string;
48
53
  }
49
54
  /**
50
55
  * Object containing content model field predefined options and values.
51
56
  *
52
- * @category ContentModelField
57
+ * @category CmsModelField
53
58
  */
54
- export interface CmsContentModelFieldPredefinedValues {
59
+ export interface CmsModelFieldPredefinedValues {
55
60
  /**
56
61
  * Are predefined field values enabled?
57
62
  */
@@ -59,14 +64,14 @@ export interface CmsContentModelFieldPredefinedValues {
59
64
  /**
60
65
  * Predefined values array.
61
66
  */
62
- values: CmsContentModelFieldPredefinedValuesValue[];
67
+ values: CmsModelFieldPredefinedValuesValue[];
63
68
  }
64
69
  /**
65
70
  * Object containing content model field renderer options.
66
71
  *
67
- * @category ContentModelField
72
+ * @category CmsModelField
68
73
  */
69
- interface CmsContentModelFieldRenderer {
74
+ interface CmsModelFieldRenderer {
70
75
  /**
71
76
  * Name of the field renderer. Must have one in field renderer plugins.
72
77
  * Can be blank to let automatically determine the renderer.
@@ -76,10 +81,10 @@ interface CmsContentModelFieldRenderer {
76
81
  /**
77
82
  * A definition for content model field. This type exists on the app side as well.
78
83
  *
79
- * @category ContentModelField
84
+ * @category ModelField
80
85
  * @category Database model
81
86
  */
82
- export interface CmsContentModelField {
87
+ export interface CmsModelField {
83
88
  /**
84
89
  * A generated ID for the model field
85
90
  */
@@ -107,17 +112,17 @@ export interface CmsContentModelField {
107
112
  /**
108
113
  * Are predefined values enabled? And list of them
109
114
  */
110
- predefinedValues?: CmsContentModelFieldPredefinedValues;
115
+ predefinedValues?: CmsModelFieldPredefinedValues;
111
116
  /**
112
117
  * Field renderer. Blank if determined automatically.
113
118
  */
114
- renderer?: CmsContentModelFieldRenderer;
119
+ renderer?: CmsModelFieldRenderer;
115
120
  /**
116
121
  * List of validations for the field
117
122
  *
118
123
  * @default []
119
124
  */
120
- validation?: CmsContentModelFieldValidation[];
125
+ validation?: CmsModelFieldValidation[];
121
126
  /**
122
127
  * List of validations for the list of values, when a field is set to accept a list of values.
123
128
  * These validations will be applied to the entire list, and `validation` (see above) will be applied
@@ -125,7 +130,7 @@ export interface CmsContentModelField {
125
130
  *
126
131
  * @default []
127
132
  */
128
- listValidation?: CmsContentModelFieldValidation[];
133
+ listValidation?: CmsModelFieldValidation[];
129
134
  /**
130
135
  * Is this a multiple values field?
131
136
  *
@@ -143,7 +148,7 @@ export interface CmsContentModelField {
143
148
  /**
144
149
  * A definition for dateTime field to show possible type of the field in settings.
145
150
  */
146
- export interface CmsContentModelDateTimeField extends CmsContentModelField {
151
+ export interface CmsModelDateTimeField extends CmsModelField {
147
152
  /**
148
153
  * Settings object for the field. Contains type property.
149
154
  */
@@ -154,21 +159,21 @@ export interface CmsContentModelDateTimeField extends CmsContentModelField {
154
159
  /**
155
160
  * Arguments for the field validator validate method.
156
161
  *
157
- * @category ContentModelField
162
+ * @category ModelField
158
163
  * @category FieldValidation
159
164
  */
160
- export interface CmsModelFieldValidatorValidateArgs {
165
+ export interface CmsModelFieldValidatorValidateParams {
161
166
  /**
162
167
  * A value to be validated.
163
168
  */
164
169
  value: any;
165
170
  /**
166
- * Options from the CmsContentModelField validations.
171
+ * Options from the CmsModelField validations.
167
172
  *
168
- * @see CmsContentModelField.validation
169
- * @see CmsContentModelField.listValidation
173
+ * @see CmsModelField.validation
174
+ * @see CmsModelField.listValidation
170
175
  */
171
- validator: CmsContentModelFieldValidation;
176
+ validator: CmsModelFieldValidation;
172
177
  /**
173
178
  * An instance of the current context.
174
179
  */
@@ -176,17 +181,17 @@ export interface CmsModelFieldValidatorValidateArgs {
176
181
  /**
177
182
  * Field being validated.
178
183
  */
179
- field: CmsContentModelField;
184
+ field: CmsModelField;
180
185
  /**
181
186
  * An instance of the content model being validated.
182
187
  */
183
- contentModel: CmsContentModel;
188
+ contentModel: CmsModel;
184
189
  }
185
190
  /**
186
191
  * Definition for the field validator.
187
192
  *
188
193
  * @category Plugin
189
- * @category ContentModelField
194
+ * @category ModelField
190
195
  * @category FieldValidation
191
196
  */
192
197
  export interface CmsModelFieldValidatorPlugin extends Plugin {
@@ -205,14 +210,14 @@ export interface CmsModelFieldValidatorPlugin extends Plugin {
205
210
  /**
206
211
  * Validation method.
207
212
  */
208
- validate(params: CmsModelFieldValidatorValidateArgs): Promise<boolean>;
213
+ validate(params: CmsModelFieldValidatorValidateParams): Promise<boolean>;
209
214
  };
210
215
  }
211
216
  /**
212
217
  * A pattern validator for the content entry field value.
213
218
  *
214
219
  * @category Plugin
215
- * @category ContentModelField
220
+ * @category ModelField
216
221
  * @category FieldValidation
217
222
  */
218
223
  export interface CmsModelFieldPatternValidatorPlugin extends Plugin {
@@ -241,9 +246,9 @@ export interface CmsModelFieldPatternValidatorPlugin extends Plugin {
241
246
  /**
242
247
  * Locked field in the content model
243
248
  *
244
- * @see CmsContentModel.lockedFields
249
+ * @see CmsModel.lockedFields
245
250
  *
246
- * @category ContentModelField
251
+ * @category ModelField
247
252
  */
248
253
  export interface LockedField {
249
254
  /**
@@ -261,12 +266,12 @@ export interface LockedField {
261
266
  [key: string]: any;
262
267
  }
263
268
  /**
264
- * Content model defining an entry.
269
+ * Cms Model defining an entry.
265
270
  *
266
271
  * @category Database model
267
- * @category ContentModel
272
+ * @category CmsModel
268
273
  */
269
- export interface CmsContentModel {
274
+ export interface CmsModel {
270
275
  /**
271
276
  * Name of the content model.
272
277
  */
@@ -278,9 +283,9 @@ export interface CmsContentModel {
278
283
  /**
279
284
  * Locale this model belongs to.
280
285
  */
281
- locale?: string;
286
+ locale: string;
282
287
  /**
283
- * Content model group reference object.
288
+ * Cms Group reference object.
284
289
  */
285
290
  group: {
286
291
  /**
@@ -311,7 +316,7 @@ export interface CmsContentModel {
311
316
  /**
312
317
  * List of fields defining entry values.
313
318
  */
314
- fields: CmsContentModelField[];
319
+ fields: CmsModelField[];
315
320
  /**
316
321
  * Admin UI field layout
317
322
  *
@@ -332,9 +337,17 @@ export interface CmsContentModel {
332
337
  * It is picked as first available text field. Or user can select own field.
333
338
  */
334
339
  titleFieldId: string;
340
+ /**
341
+ * The version of Webiny which this record was stored with.
342
+ */
343
+ webinyVersion: string;
344
+ /**
345
+ * Model tenant.
346
+ */
347
+ tenant: string;
335
348
  }
336
349
  /**
337
- * @category ContentModelField
350
+ * @category ModelField
338
351
  */
339
352
  export interface CmsModelFieldDefinition {
340
353
  fields: string;
@@ -342,10 +355,10 @@ export interface CmsModelFieldDefinition {
342
355
  }
343
356
  export interface CmsModelFieldToGraphQLCreateResolver {
344
357
  (params: {
345
- models: CmsContentModel[];
346
- model: CmsContentModel;
358
+ models: CmsModel[];
359
+ model: CmsModel;
347
360
  graphQLType: string;
348
- field: CmsContentModelField;
361
+ field: CmsModelField;
349
362
  createFieldResolvers: any;
350
363
  }): GraphQLFieldResolver | {
351
364
  resolver: GraphQLFieldResolver;
@@ -354,7 +367,7 @@ export interface CmsModelFieldToGraphQLCreateResolver {
354
367
  }
355
368
  /**
356
369
  * @category Plugin
357
- * @category ContentModelField
370
+ * @category ModelField
358
371
  * @category GraphQL
359
372
  */
360
373
  export interface CmsModelFieldToGraphQLPlugin extends Plugin {
@@ -399,8 +412,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
399
412
  * ```
400
413
  */
401
414
  createGetFilters?(params: {
402
- model: CmsContentModel;
403
- field: CmsContentModelField;
415
+ model: CmsModel;
416
+ field: CmsModelField;
404
417
  }): string;
405
418
  /**
406
419
  * Definition for list filtering for GraphQL.
@@ -419,8 +432,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
419
432
  * ```
420
433
  */
421
434
  createListFilters?(params: {
422
- model: CmsContentModel;
423
- field: CmsContentModelField;
435
+ model: CmsModel;
436
+ field: CmsModelField;
424
437
  }): string;
425
438
  /**
426
439
  * Definition of the field type for GraphQL - be aware if multiple values is selected.
@@ -438,8 +451,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
438
451
  * ```
439
452
  */
440
453
  createTypeField(params: {
441
- model: CmsContentModel;
442
- field: CmsContentModelField;
454
+ model: CmsModel;
455
+ field: CmsModelField;
443
456
  fieldTypePlugins: CmsFieldTypePlugins;
444
457
  }): CmsModelFieldDefinition | string;
445
458
  /**
@@ -477,8 +490,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
477
490
  * ```
478
491
  */
479
492
  createSchema?: (params: {
480
- models: CmsContentModel[];
481
- model: CmsContentModel;
493
+ models: CmsModel[];
494
+ model: CmsModel;
482
495
  }) => GraphQLSchemaDefinition<CmsContext>;
483
496
  };
484
497
  manage: {
@@ -499,8 +512,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
499
512
  * ```
500
513
  */
501
514
  createListFilters?: (params: {
502
- model: CmsContentModel;
503
- field: CmsContentModelField;
515
+ model: CmsModel;
516
+ field: CmsModelField;
504
517
  }) => string;
505
518
  /**
506
519
  * Manage API schema definitions for the field and resolvers for them. Probably similar to `read.createSchema`.
@@ -520,8 +533,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
520
533
  * ```
521
534
  */
522
535
  createSchema?: (params: {
523
- models: CmsContentModel[];
524
- model: CmsContentModel;
536
+ models: CmsModel[];
537
+ model: CmsModel;
525
538
  }) => GraphQLSchemaDefinition<CmsContext>;
526
539
  /**
527
540
  * Definition of the field type for GraphQL - be aware if multiple values is selected. Probably same as `read.createTypeField`.
@@ -539,8 +552,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
539
552
  * ```
540
553
  */
541
554
  createTypeField: (params: {
542
- model: CmsContentModel;
543
- field: CmsContentModelField;
555
+ model: CmsModel;
556
+ field: CmsModelField;
544
557
  fieldTypePlugins: CmsFieldTypePlugins;
545
558
  }) => CmsModelFieldDefinition | string;
546
559
  /**
@@ -559,8 +572,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
559
572
  * ```
560
573
  */
561
574
  createInputField: (params: {
562
- model: CmsContentModel;
563
- field: CmsContentModelField;
575
+ model: CmsModel;
576
+ field: CmsModelField;
564
577
  fieldTypePlugins: CmsFieldTypePlugins;
565
578
  }) => CmsModelFieldDefinition | string;
566
579
  /**
@@ -584,7 +597,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
584
597
  * Check for content model locked field.
585
598
  * A custom plugin definable by the user.
586
599
  *
587
- * @category ContentModel
600
+ * @category CmsModel
588
601
  * @category Plugin
589
602
  */
590
603
  export interface CmsModelLockedFieldPlugin extends Plugin {
@@ -601,17 +614,17 @@ export interface CmsModelLockedFieldPlugin extends Plugin {
601
614
  */
602
615
  checkLockedField?: (params: {
603
616
  lockedField: LockedField;
604
- field: CmsContentModelField;
617
+ field: CmsModelField;
605
618
  }) => void;
606
619
  /**
607
620
  * A method to get the locked field data.
608
621
  */
609
622
  getLockedFieldData?: (params: {
610
- field: CmsContentModelField;
623
+ field: CmsModelField;
611
624
  }) => Record<string, any>;
612
625
  }
613
626
  /**
614
- * @category ContentModelField
627
+ * @category ModelField
615
628
  */
616
629
  export interface CmsFieldTypePlugins {
617
630
  [key: string]: CmsModelFieldToGraphQLPlugin;
@@ -645,6 +658,14 @@ export interface CmsSettings {
645
658
  * Last content model change. Used to cache GraphQL schema.
646
659
  */
647
660
  contentModelLastChange: Date;
661
+ /**
662
+ * Settings tenant.
663
+ */
664
+ tenant: string;
665
+ /**
666
+ * Settings locale.
667
+ */
668
+ locale: string;
648
669
  }
649
670
  /**
650
671
  * Settings CRUD in context.
@@ -652,55 +673,56 @@ export interface CmsSettings {
652
673
  * @category Context
653
674
  */
654
675
  export interface CmsSettingsContext {
655
- /**
656
- * A function defining usage of a method without authenticating the user.
657
- */
658
- noAuth: () => {
659
- /**
660
- * Gets settings model from the database.
661
- */
662
- get: () => Promise<CmsSettings | null>;
663
- };
664
676
  /**
665
677
  * Gets settings model from the database.
666
678
  */
667
- get: () => Promise<CmsSettings | null>;
679
+ getSettings: () => Promise<CmsSettings | null>;
668
680
  /**
669
681
  * Updates settings model with a new date.
670
682
  */
671
- updateContentModelLastChange: () => Promise<void>;
683
+ updateModelLastChange: () => Promise<void>;
672
684
  /**
673
685
  * Get the datetime when content model last changed.
674
686
  */
675
- getContentModelLastChange: () => Promise<Date>;
687
+ getModelLastChange: () => Promise<Date>;
688
+ }
689
+ export interface BeforeInstallTopicParams {
690
+ tenant: string;
691
+ }
692
+ export interface AfterInstallTopicParams {
693
+ tenant: string;
676
694
  }
677
695
  export declare type CmsSystemContext = {
678
- getVersion: () => Promise<string>;
679
- setVersion: (version: string) => Promise<void>;
696
+ getSystemVersion: () => Promise<string>;
697
+ setSystemVersion: (version: string) => Promise<void>;
680
698
  getReadAPIKey(): Promise<string>;
681
- setReadAPIKey(apiKey: string): Promise<void>;
682
- install: () => Promise<void>;
683
- upgrade: (version: string) => Promise<boolean>;
699
+ installSystem: () => Promise<void>;
700
+ upgradeSystem: (version: string) => Promise<boolean>;
701
+ /**
702
+ * Events
703
+ */
704
+ onBeforeSystemInstall: Topic<BeforeInstallTopicParams>;
705
+ onAfterSystemInstall: Topic<AfterInstallTopicParams>;
684
706
  };
685
707
  /**
686
- * A GraphQL args.data parameter received when creating content model group.
708
+ * A GraphQL params.data parameter received when creating content model group.
687
709
  *
688
- * @category ContentModelGroup
689
- * @category GraphQL args
710
+ * @category CmsGroup
711
+ * @category GraphQL params
690
712
  */
691
- export interface CmsContentModelGroupCreateInput {
713
+ export interface CmsGroupCreateInput {
692
714
  name: string;
693
715
  slug?: string;
694
716
  description?: string;
695
717
  icon: string;
696
718
  }
697
719
  /**
698
- * A GraphQL args.data parameter received when updating content model group.
720
+ * A GraphQL params.data parameter received when updating content model group.
699
721
  *
700
- * @category ContentModelGroup
701
- * @category GraphQL args
722
+ * @category CmsGroup
723
+ * @category GraphQL params
702
724
  */
703
- export interface CmsContentModelGroupUpdateInput {
725
+ export interface CmsGroupUpdateInput {
704
726
  name?: string;
705
727
  slug?: string;
706
728
  description?: string;
@@ -709,10 +731,10 @@ export interface CmsContentModelGroupUpdateInput {
709
731
  /**
710
732
  * A representation of content model group in the database.
711
733
  *
712
- * @category ContentModelGroup
734
+ * @category CmsGroup
713
735
  * @category Database model
714
736
  */
715
- export interface CmsContentModelGroup {
737
+ export interface CmsGroup {
716
738
  /**
717
739
  * Generated ID.
718
740
  */
@@ -728,7 +750,7 @@ export interface CmsContentModelGroup {
728
750
  /**
729
751
  * Locale this group belongs to.
730
752
  */
731
- locale?: string;
753
+ locale: string;
732
754
  /**
733
755
  * Description for the group.
734
756
  */
@@ -744,85 +766,132 @@ export interface CmsContentModelGroup {
744
766
  /**
745
767
  * Date group was created on.
746
768
  */
747
- createdOn?: Date;
769
+ createdOn?: string;
748
770
  /**
749
771
  * Date group was created or changed on.
750
772
  */
751
- savedOn?: Date;
773
+ savedOn?: string;
774
+ /**
775
+ * Which Webiny version was this record stored with.
776
+ */
777
+ webinyVersion: string;
778
+ /**
779
+ * Group tenant.
780
+ */
781
+ tenant: string;
752
782
  }
753
783
  /**
754
784
  * A data.where parameter received when listing content model groups.
755
785
  *
756
- * @category ContentModelGroup
757
- * @category GraphQL args
786
+ * @category CmsGroup
787
+ * @category GraphQL params
758
788
  */
759
- export interface CmsContentModelGroupListArgs {
760
- where?: Record<string, any>;
761
- limit?: number;
789
+ export interface CmsGroupListParams {
790
+ where: {
791
+ tenant: string;
792
+ locale: string;
793
+ [key: string]: any;
794
+ };
795
+ }
796
+ /**
797
+ * @category CmsGroup
798
+ * @category Topic
799
+ */
800
+ export interface BeforeGroupCreateTopicParams {
801
+ group: CmsGroup;
802
+ }
803
+ /**
804
+ * @category CmsGroup
805
+ * @category Topic
806
+ */
807
+ export interface AfterGroupCreateTopicParams {
808
+ group: CmsGroup;
809
+ }
810
+ /**
811
+ * @category CmsGroup
812
+ * @category Topic
813
+ */
814
+ export interface BeforeGroupUpdateTopicParams {
815
+ original: CmsGroup;
816
+ group: CmsGroup;
817
+ }
818
+ /**
819
+ * @category CmsGroup
820
+ * @category Topic
821
+ */
822
+ export interface AfterGroupUpdateTopicParams {
823
+ original: CmsGroup;
824
+ group: CmsGroup;
825
+ }
826
+ /**
827
+ * @category CmsGroup
828
+ * @category Topic
829
+ */
830
+ export interface BeforeGroupDeleteTopicParams {
831
+ group: CmsGroup;
762
832
  }
763
833
  /**
764
- * Content model group in context.
834
+ * @category CmsGroup
835
+ * @category Topic
836
+ */
837
+ export interface AfterGroupDeleteTopicParams {
838
+ group: CmsGroup;
839
+ }
840
+ /**
841
+ * Cms Group in context.
765
842
  *
766
843
  * @category Context
767
- * @category ContentModelGroup
844
+ * @category CmsGroup
768
845
  */
769
- export interface CmsContentModelGroupContext {
770
- /**
771
- * Plain operations on the storage level.
772
- */
773
- operations: CmsContentModelGroupStorageOperations;
774
- /**
775
- * A function defining usage of a method without authenticating the user.
776
- */
777
- noAuth: () => {
778
- /**
779
- * Gets content model group by given id.
780
- */
781
- get: (id: string) => Promise<CmsContentModelGroup | null>;
782
- /**
783
- * List all content model groups. Filterable via params.
784
- */
785
- list: (args?: CmsContentModelGroupListArgs) => Promise<CmsContentModelGroup[]>;
786
- };
846
+ export interface CmsGroupContext {
787
847
  /**
788
848
  * Gets content model group by given id.
789
849
  */
790
- get: (id: string) => Promise<CmsContentModelGroup | null>;
850
+ getGroup: (id: string) => Promise<CmsGroup | null>;
791
851
  /**
792
852
  * List all content model groups. Filterable via params.
793
853
  */
794
- list: (args?: CmsContentModelGroupListArgs) => Promise<CmsContentModelGroup[]>;
854
+ listGroups: (params?: CmsGroupListParams) => Promise<CmsGroup[]>;
795
855
  /**
796
856
  * Create a new content model group.
797
857
  */
798
- create: (data: CmsContentModelGroupCreateInput) => Promise<CmsContentModelGroup>;
858
+ createGroup: (data: CmsGroupCreateInput) => Promise<CmsGroup>;
799
859
  /**
800
860
  * Update existing content model group.
801
861
  */
802
- update: (id: string, data: CmsContentModelGroupUpdateInput) => Promise<CmsContentModelGroup>;
862
+ updateGroup: (id: string, data: CmsGroupUpdateInput) => Promise<CmsGroup>;
803
863
  /**
804
864
  * Delete content model group by given id.
805
865
  */
806
- delete: (id: string) => Promise<boolean>;
866
+ deleteGroup: (id: string) => Promise<boolean>;
867
+ /**
868
+ * Events.
869
+ */
870
+ onBeforeGroupCreate: Topic<BeforeGroupCreateTopicParams>;
871
+ onAfterGroupCreate: Topic<AfterGroupCreateTopicParams>;
872
+ onBeforeGroupUpdate: Topic<BeforeGroupUpdateTopicParams>;
873
+ onAfterGroupUpdate: Topic<AfterGroupUpdateTopicParams>;
874
+ onBeforeGroupDelete: Topic<BeforeGroupDeleteTopicParams>;
875
+ onAfterGroupDelete: Topic<AfterGroupDeleteTopicParams>;
807
876
  }
808
877
  /**
809
878
  * Definition for content model field validator.
810
879
  *
811
- * @category ContentModelField
880
+ * @category ModelField
812
881
  * @category FieldValidation
813
882
  */
814
- export interface CmsContentModelFieldValidation {
883
+ export interface CmsModelFieldValidation {
815
884
  name: string;
816
885
  message: string;
817
886
  settings?: Record<string, any>;
818
887
  }
819
888
  /**
820
- * A GraphQL args.data parameter received when creating content model.
889
+ * A GraphQL params.data parameter received when creating content model.
821
890
  *
822
- * @category GraphQL args
823
- * @category ContentModel
891
+ * @category GraphQL params
892
+ * @category CmsModel
824
893
  */
825
- export interface CmsContentModelCreateInput {
894
+ export interface CmsModelCreateInput {
826
895
  /**
827
896
  * Name of the content model.
828
897
  */
@@ -839,13 +908,13 @@ export interface CmsContentModelCreateInput {
839
908
  /**
840
909
  * A definition for content model field received from the user.
841
910
  *
842
- * Input type for `CmsContentModelField`.
843
- * @see CmsContentModelField
911
+ * Input type for `CmsModelField`.
912
+ * @see CmsModelField
844
913
  *
845
- * @category GraphQL args
846
- * @category ContentModelField
914
+ * @category GraphQL params
915
+ * @category ModelField
847
916
  */
848
- export interface CmsContentModelFieldInput {
917
+ export interface CmsModelFieldInput {
849
918
  /**
850
919
  * Generated ID.
851
920
  */
@@ -878,31 +947,31 @@ export interface CmsContentModelFieldInput {
878
947
  /**
879
948
  * Predefined values options for the field. Check the reference for more information.
880
949
  */
881
- predefinedValues?: CmsContentModelFieldPredefinedValues;
950
+ predefinedValues?: CmsModelFieldPredefinedValues;
882
951
  /**
883
952
  * Renderer options for the field. Check the reference for more information.
884
953
  */
885
- renderer?: CmsContentModelFieldRenderer;
954
+ renderer?: CmsModelFieldRenderer;
886
955
  /**
887
956
  * List of validations for the field.
888
957
  */
889
- validation?: CmsContentModelFieldValidation[];
958
+ validation?: CmsModelFieldValidation[];
890
959
  /**
891
- * @see CmsContentModelField.listValidation
960
+ * @see CmsModelField.listValidation
892
961
  */
893
- listValidation: CmsContentModelFieldValidation[];
962
+ listValidation: CmsModelFieldValidation[];
894
963
  /**
895
964
  * User defined settings.
896
965
  */
897
966
  settings?: Record<string, any>;
898
967
  }
899
968
  /**
900
- * A GraphQL args.data parameter received when updating content model.
969
+ * A GraphQL params.data parameter received when updating content model.
901
970
  *
902
- * @category GraphQL args
903
- * @category ContentModel
971
+ * @category GraphQL params
972
+ * @category CmsModel
904
973
  */
905
- export interface CmsContentModelUpdateInput {
974
+ export interface CmsModelUpdateInput {
906
975
  /**
907
976
  * A new content model name.
908
977
  */
@@ -914,7 +983,7 @@ export interface CmsContentModelUpdateInput {
914
983
  /**
915
984
  * A list of content model fields to define the entry values.
916
985
  */
917
- fields: CmsContentModelFieldInput[];
986
+ fields: CmsModelFieldInput[];
918
987
  /**
919
988
  * Admin UI field layout
920
989
  *
@@ -933,37 +1002,37 @@ export interface CmsContentModelUpdateInput {
933
1002
  titleFieldId?: string;
934
1003
  }
935
1004
  /**
936
- * A plugin to load a CmsContentModelManager.
1005
+ * A plugin to load a CmsModelManager.
937
1006
  *
938
- * @see CmsContentModelManager
1007
+ * @see CmsModelManager
939
1008
  *
940
1009
  * @category Plugin
941
- * @category ContentModel
942
- * @category ContentEntry
1010
+ * @category CmsModel
1011
+ * @category CmsEntry
943
1012
  */
944
- export interface ContentModelManagerPlugin extends Plugin {
1013
+ export interface ModelManagerPlugin extends Plugin {
945
1014
  /**
946
1015
  * A plugin type.
947
1016
  */
948
1017
  type: "cms-content-model-manager";
949
1018
  /**
950
- * Specific model CmsContentModelManager loader. Can target exact modelId(s).
1019
+ * Specific model CmsModelManager loader. Can target exact modelId(s).
951
1020
  * Be aware that if you define multiple plugins without `modelId`, last one will run.
952
1021
  */
953
1022
  modelId?: string[] | string;
954
1023
  /**
955
- * Create a CmsContentModelManager for specific type - or new default one.
1024
+ * Create a CmsModelManager for specific type - or new default one.
956
1025
  * 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)
957
1026
  */
958
- create: (context: CmsContext, model: CmsContentModel) => Promise<CmsContentModelManager>;
1027
+ create: (context: CmsContext, model: CmsModel) => Promise<CmsModelManager>;
959
1028
  }
960
1029
  /**
961
1030
  * A content entry definition for and from the database.
962
1031
  *
963
1032
  * @category Database model
964
- * @category ContentEntry
1033
+ * @category CmsEntry
965
1034
  */
966
- export interface CmsContentEntry {
1035
+ export interface CmsEntry {
967
1036
  /**
968
1037
  * A version of the webiny this entry was created with.
969
1038
  * This can be used when upgrading the system so we know which entries to update.
@@ -1002,7 +1071,7 @@ export interface CmsContentEntry {
1002
1071
  savedOn: string;
1003
1072
  /**
1004
1073
  * Model ID of the definition for the entry.
1005
- * @see CmsContentModel
1074
+ * @see CmsModel
1006
1075
  */
1007
1076
  modelId: string;
1008
1077
  /**
@@ -1026,110 +1095,121 @@ export interface CmsContentEntry {
1026
1095
  /**
1027
1096
  * Status type of the entry.
1028
1097
  */
1029
- status: CmsContentEntryStatus;
1098
+ status: CmsEntryStatus;
1030
1099
  /**
1031
1100
  * A mapped fieldId -> value object.
1032
1101
  *
1033
- * @see CmsContentModelField
1102
+ * @see CmsModelField
1034
1103
  */
1035
1104
  values: Record<string, any>;
1036
1105
  }
1037
- export interface CmsStorageContentEntry extends CmsContentEntry {
1106
+ export interface CmsStorageEntry extends CmsEntry {
1038
1107
  [key: string]: any;
1039
1108
  }
1040
1109
  /**
1041
1110
  * A definition for content model manager to be used in the code.
1042
- * The default one uses `CmsContentEntryContext` methods internally, but devs can change to what every they want.
1111
+ * The default one uses `CmsEntryContext` methods internally, but devs can change to what every they want.
1043
1112
  *
1044
- * @see CmsContentEntryContext
1113
+ * @see CmsEntryContext
1045
1114
  *
1046
1115
  * @category Context
1047
- * @category ContentEntry
1048
- * @category ContentModel
1116
+ * @category CmsEntry
1117
+ * @category CmsModel
1049
1118
  */
1050
- export interface CmsContentModelManager {
1119
+ export interface CmsModelManager {
1051
1120
  /**
1052
1121
  * List entries in this content model.
1053
1122
  */
1054
- list: (args?: CmsContentEntryListArgs) => Promise<[CmsContentEntry[], CmsContentEntryMeta]>;
1123
+ list: (params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1055
1124
  /**
1056
1125
  * List only published entries in the content model.
1057
1126
  */
1058
- listPublished: (args?: CmsContentEntryListArgs) => Promise<[CmsContentEntry[], CmsContentEntryMeta]>;
1127
+ listPublished: (params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1059
1128
  /**
1060
1129
  * List latest entries in the content model. Used for administration.
1061
1130
  */
1062
- listLatest: (args?: CmsContentEntryListArgs) => Promise<[CmsContentEntry[], CmsContentEntryMeta]>;
1131
+ listLatest: (params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1063
1132
  /**
1064
1133
  * Get a list of published entries by the ID list.
1065
1134
  */
1066
- getPublishedByIds: (ids: string[]) => Promise<CmsContentEntry[]>;
1135
+ getPublishedByIds: (ids: string[]) => Promise<CmsEntry[]>;
1067
1136
  /**
1068
1137
  * Get a list of latest entries by the ID list.
1069
1138
  */
1070
- getLatestByIds: (ids: string[]) => Promise<CmsContentEntry[]>;
1139
+ getLatestByIds: (ids: string[]) => Promise<CmsEntry[]>;
1071
1140
  /**
1072
- * Get an entry filtered by given args. Will always get one.
1141
+ * Get an entry filtered by given params. Will always get one.
1073
1142
  */
1074
- get: (args?: CmsContentEntryGetArgs) => Promise<CmsContentEntry>;
1143
+ get: (id: string) => Promise<CmsEntry>;
1075
1144
  /**
1076
1145
  * Create a entry.
1077
1146
  */
1078
- create: (data: Record<string, any>) => Promise<CmsContentEntry>;
1147
+ create: (data: Record<string, any>) => Promise<CmsEntry>;
1079
1148
  /**
1080
1149
  * Update a entry.
1081
1150
  */
1082
- update: (id: string, data: Record<string, any>) => Promise<CmsContentEntry>;
1151
+ update: (id: string, data: Record<string, any>) => Promise<CmsEntry>;
1083
1152
  /**
1084
1153
  * Delete a entry.
1085
1154
  */
1086
1155
  delete: (id: string) => Promise<void>;
1087
1156
  }
1157
+ export interface BeforeModelCreateTopicParams {
1158
+ input: Partial<CmsModel>;
1159
+ model: CmsModel;
1160
+ }
1161
+ export interface AfterModelCreateTopicParams {
1162
+ input: Partial<CmsModel>;
1163
+ model: CmsModel;
1164
+ }
1165
+ export interface BeforeModelUpdateTopicParams {
1166
+ input: Partial<CmsModel>;
1167
+ original: CmsModel;
1168
+ model: CmsModel;
1169
+ }
1170
+ export interface AfterModelUpdateTopicParams {
1171
+ input: Partial<CmsModel>;
1172
+ original: CmsModel;
1173
+ model: CmsModel;
1174
+ }
1175
+ export interface BeforeModelDeleteTopicParams {
1176
+ model: CmsModel;
1177
+ }
1178
+ export interface AfterModelDeleteTopicParams {
1179
+ model: CmsModel;
1180
+ }
1181
+ export interface CmsModelUpdateDirectParams {
1182
+ model: CmsModel;
1183
+ original: CmsModel;
1184
+ }
1088
1185
  /**
1089
- * Content model in the context.
1186
+ * Cms Model in the context.
1090
1187
  *
1091
1188
  * @category Context
1092
- * @category ContentModel
1189
+ * @category CmsModel
1093
1190
  */
1094
- export interface CmsContentModelContext {
1095
- /**
1096
- * Plain operations on the storage level.
1097
- */
1098
- operations: CmsContentModelStorageOperations;
1099
- /**
1100
- * A function defining usage of a method without authenticating the user.
1101
- */
1102
- noAuth: () => {
1103
- /**
1104
- * Get a single content model.
1105
- */
1106
- get: (modelId: string) => Promise<CmsContentModel | null>;
1107
- /**
1108
- * Get all content models.
1109
- */
1110
- list: () => Promise<CmsContentModel[]>;
1111
- };
1191
+ export interface CmsModelContext {
1112
1192
  /**
1113
1193
  * A function defining usage of a method with authenticating the user but not throwing an error.
1114
1194
  */
1115
- silentAuth: () => {
1195
+ silentAuthModel: () => {
1116
1196
  /**
1117
1197
  * Get all content models.
1118
1198
  */
1119
- list: () => Promise<CmsContentModel[]>;
1199
+ list: () => Promise<CmsModel[]>;
1120
1200
  };
1121
1201
  /**
1122
1202
  * Get a single content model.
1123
1203
  */
1124
- get: (modelId: string) => Promise<CmsContentModel | null>;
1204
+ getModel: (modelId: string) => Promise<CmsModel | null>;
1125
1205
  /**
1126
1206
  * Get all content models.
1127
1207
  */
1128
- list: () => Promise<CmsContentModel[]>;
1208
+ listModels: () => Promise<CmsModel[]>;
1129
1209
  /**
1130
1210
  * Create a content model.
1131
1211
  */
1132
- create: (data: CmsContentModelCreateInput) => Promise<CmsContentModel>;
1212
+ createModel: (data: CmsModelCreateInput) => Promise<CmsModel>;
1133
1213
  /**
1134
1214
  * Update content model without data validation. Used internally.
1135
1215
  *
@@ -1138,40 +1218,52 @@ export interface CmsContentModelContext {
1138
1218
  *
1139
1219
  * @hidden
1140
1220
  */
1141
- updateModel: (model: CmsContentModel, data: Partial<CmsContentModel>) => Promise<CmsContentModel>;
1221
+ updateModelDirect: (params: CmsModelUpdateDirectParams) => Promise<CmsModel>;
1142
1222
  /**
1143
1223
  * Update content model.
1144
1224
  */
1145
- update: (modelId: string, data: CmsContentModelUpdateInput) => Promise<CmsContentModel>;
1225
+ updateModel: (modelId: string, data: CmsModelUpdateInput) => Promise<CmsModel>;
1146
1226
  /**
1147
1227
  * Delete content model. Should not allow deletion if there are entries connected to it.
1148
1228
  */
1149
- delete: (modelId: string) => Promise<void>;
1229
+ deleteModel: (modelId: string) => Promise<void>;
1150
1230
  /**
1151
- * Get a instance of CmsContentModelManager for given content modelId.
1231
+ * Get a instance of CmsModelManager for given content modelId.
1152
1232
  *
1153
- * @see CmsContentModelManager
1233
+ * @see CmsModelManager
1154
1234
  */
1155
- getManager: (modelId: string) => Promise<CmsContentModelManager>;
1235
+ getModelManager: (modelId: string) => Promise<CmsModelManager>;
1156
1236
  /**
1157
1237
  * Get all content model managers mapped by modelId.
1158
- * @see CmsContentModelManager
1238
+ * @see CmsModelManager
1239
+ */
1240
+ getManagers: () => Map<string, CmsModelManager>;
1241
+ /**
1242
+ * Events.
1159
1243
  */
1160
- getManagers: () => Map<string, CmsContentModelManager>;
1244
+ onBeforeModelCreate: Topic<BeforeModelCreateTopicParams>;
1245
+ onAfterModelCreate: Topic<AfterModelCreateTopicParams>;
1246
+ onBeforeModelUpdate: Topic<BeforeModelUpdateTopicParams>;
1247
+ onAfterModelUpdate: Topic<AfterModelUpdateTopicParams>;
1248
+ onBeforeModelDelete: Topic<BeforeModelDeleteTopicParams>;
1249
+ onAfterModelDelete: Topic<AfterModelDeleteTopicParams>;
1161
1250
  }
1162
1251
  /**
1163
1252
  * Available statuses for content entry.
1164
1253
  *
1165
- * @category ContentEntry
1254
+ * @category CmsEntry
1166
1255
  */
1167
- declare type CmsContentEntryStatus = "published" | "unpublished" | "reviewRequested" | "changesRequested" | "draft";
1256
+ declare type CmsEntryStatus = "published" | "unpublished" | "reviewRequested" | "changesRequested" | "draft";
1168
1257
  /**
1169
- * Entry listing where args.
1258
+ * Entry listing where params.
1170
1259
  *
1171
- * @category ContentEntry
1172
- * @category GraphQL args
1260
+ * @category CmsEntry
1261
+ * @category GraphQL params
1173
1262
  */
1174
- export interface CmsContentEntryListWhere {
1263
+ export interface CmsEntryListWhere {
1264
+ /**
1265
+ * Fields.
1266
+ */
1175
1267
  id?: string;
1176
1268
  id_in?: string[];
1177
1269
  id_not?: string;
@@ -1229,39 +1321,39 @@ export interface CmsContentEntryListWhere {
1229
1321
  /**
1230
1322
  * Entry listing sort.
1231
1323
  *
1232
- * @category ContentEntry
1233
- * @category GraphQL args
1324
+ * @category CmsEntry
1325
+ * @category GraphQL params
1234
1326
  */
1235
- export declare type CmsContentEntryListSort = string[];
1327
+ export declare type CmsEntryListSort = string[];
1236
1328
  /**
1237
- * Get entry GraphQL resolver args.
1329
+ * Get entry GraphQL resolver params.
1238
1330
  *
1239
- * @category ContentEntry
1240
- * @category GraphQL args
1331
+ * @category CmsEntry
1332
+ * @category GraphQL params
1241
1333
  */
1242
- export interface CmsContentEntryGetArgs {
1243
- where?: CmsContentEntryListWhere;
1244
- sort?: CmsContentEntryListSort;
1334
+ export interface CmsEntryGetParams {
1335
+ where: CmsEntryListWhere;
1336
+ sort?: CmsEntryListSort;
1245
1337
  }
1246
1338
  /**
1247
- * List entries GraphQL resolver args.
1339
+ * List entries GraphQL resolver params.
1248
1340
  *
1249
- * @category ContentEntry
1250
- * @category GraphQL args
1341
+ * @category CmsEntry
1342
+ * @category GraphQL params
1251
1343
  */
1252
- export interface CmsContentEntryListArgs {
1253
- where?: CmsContentEntryListWhere;
1254
- sort?: CmsContentEntryListSort;
1344
+ export interface CmsEntryListParams {
1345
+ where: CmsEntryListWhere;
1346
+ sort?: CmsEntryListSort;
1255
1347
  limit?: number;
1256
1348
  after?: string;
1257
1349
  }
1258
1350
  /**
1259
1351
  * Meta information for GraphQL output.
1260
1352
  *
1261
- * @category ContentEntry
1353
+ * @category CmsEntry
1262
1354
  * @category GraphQL output
1263
1355
  */
1264
- export interface CmsContentEntryMeta {
1356
+ export interface CmsEntryMeta {
1265
1357
  /**
1266
1358
  * A cursor for pagination.
1267
1359
  */
@@ -1275,138 +1367,227 @@ export interface CmsContentEntryMeta {
1275
1367
  */
1276
1368
  totalCount: number;
1277
1369
  }
1278
- /**
1279
- * Content entry CRUD methods in the context.
1370
+ export interface BeforeEntryCreateTopicParams {
1371
+ input: Partial<CmsEntry>;
1372
+ entry: CmsEntry;
1373
+ model: CmsModel;
1374
+ }
1375
+ export interface AfterEntryCreateTopicParams {
1376
+ input: Partial<CmsEntry>;
1377
+ entry: CmsEntry;
1378
+ model: CmsModel;
1379
+ storageEntry: CmsEntry;
1380
+ }
1381
+ export interface BeforeEntryRevisionCreateTopicParams {
1382
+ entry: CmsEntry;
1383
+ model: CmsModel;
1384
+ }
1385
+ export interface AfterEntryRevisionCreateTopicParams {
1386
+ entry: CmsEntry;
1387
+ model: CmsModel;
1388
+ storageEntry: CmsEntry;
1389
+ }
1390
+ export interface BeforeEntryUpdateTopicParams {
1391
+ input: Partial<CmsEntry>;
1392
+ original: CmsEntry;
1393
+ entry: CmsEntry;
1394
+ model: CmsModel;
1395
+ }
1396
+ export interface AfterEntryUpdateTopicParams {
1397
+ input: Partial<CmsEntry>;
1398
+ original: CmsEntry;
1399
+ entry: CmsEntry;
1400
+ model: CmsModel;
1401
+ storageEntry: CmsEntry;
1402
+ }
1403
+ export interface BeforeEntryPublishTopicParams {
1404
+ entry: CmsEntry;
1405
+ model: CmsModel;
1406
+ }
1407
+ export interface AfterEntryPublishTopicParams {
1408
+ entry: CmsEntry;
1409
+ model: CmsModel;
1410
+ storageEntry: CmsEntry;
1411
+ }
1412
+ export interface BeforeEntryUnpublishTopicParams {
1413
+ entry: CmsEntry;
1414
+ model: CmsModel;
1415
+ }
1416
+ export interface AfterEntryUnpublishTopicParams {
1417
+ entry: CmsEntry;
1418
+ model: CmsModel;
1419
+ storageEntry: CmsEntry;
1420
+ }
1421
+ export interface BeforeEntryRequestChangesTopicParams {
1422
+ entry: CmsEntry;
1423
+ model: CmsModel;
1424
+ }
1425
+ export interface AfterEntryRequestChangesTopicParams {
1426
+ entry: CmsEntry;
1427
+ model: CmsModel;
1428
+ storageEntry: CmsEntry;
1429
+ }
1430
+ export interface BeforeEntryRequestReviewTopicParams {
1431
+ entry: CmsEntry;
1432
+ model: CmsModel;
1433
+ }
1434
+ export interface AfterEntryRequestReviewTopicParams {
1435
+ entry: CmsEntry;
1436
+ model: CmsModel;
1437
+ storageEntry: CmsEntry;
1438
+ }
1439
+ export interface BeforeEntryDeleteTopicParams {
1440
+ entry: CmsEntry;
1441
+ model: CmsModel;
1442
+ }
1443
+ export interface AfterEntryDeleteTopicParams {
1444
+ entry: CmsEntry;
1445
+ model: CmsModel;
1446
+ }
1447
+ export interface BeforeEntryRevisionDeleteTopicParams {
1448
+ entry: CmsEntry;
1449
+ model: CmsModel;
1450
+ }
1451
+ export interface AfterEntryRevisionDeleteTopicParams {
1452
+ entry: CmsEntry;
1453
+ model: CmsModel;
1454
+ }
1455
+ export interface BeforeEntryGetTopicParams {
1456
+ model: CmsModel;
1457
+ where: CmsEntryListWhere;
1458
+ }
1459
+ export interface BeforeEntryListTopicParams {
1460
+ where: CmsEntryListWhere;
1461
+ model: CmsModel;
1462
+ }
1463
+ /**
1464
+ * Cms Entry CRUD methods in the context.
1280
1465
  *
1281
1466
  * @category Context
1282
- * @category ContentEntry
1467
+ * @category CmsEntry
1283
1468
  */
1284
- export interface CmsContentEntryContext {
1285
- /**
1286
- * Plain operations on the storage level.
1287
- */
1288
- operations: CmsContentEntryStorageOperations;
1469
+ export interface CmsEntryContext {
1289
1470
  /**
1290
1471
  * Get a single content entry for a model.
1291
1472
  */
1292
- get: (model: CmsContentModel, args: CmsContentEntryGetArgs) => Promise<CmsContentEntry | null>;
1473
+ getEntry: (model: CmsModel, params: CmsEntryGetParams) => Promise<CmsEntry | null>;
1293
1474
  /**
1294
1475
  * Get a list of entries for a model by a given ID (revision).
1295
1476
  */
1296
- getByIds: (model: CmsContentModel, revisions: string[]) => Promise<CmsContentEntry[] | null>;
1477
+ getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[] | null>;
1297
1478
  /**
1298
1479
  * Get the entry for a model by a given ID.
1299
1480
  */
1300
- getById: (model: CmsContentModel, revision: string) => Promise<CmsContentEntry>;
1481
+ getEntryById: (model: CmsModel, revision: string) => Promise<CmsEntry>;
1301
1482
  /**
1302
1483
  * List entries for a model. Internal method used by get, listLatest and listPublished.
1303
1484
  */
1304
- list: (model: CmsContentModel, args?: CmsContentEntryListArgs) => Promise<[CmsContentEntry[], CmsContentEntryMeta]>;
1485
+ listEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1305
1486
  /**
1306
1487
  * Lists latest entries. Used for manage API.
1307
1488
  */
1308
- listLatest: (model: CmsContentModel, args?: CmsContentEntryListArgs) => Promise<[CmsContentEntry[], CmsContentEntryMeta]>;
1489
+ listLatestEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1309
1490
  /**
1310
1491
  * List published entries. Used for read API.
1311
1492
  */
1312
- listPublished: (model: CmsContentModel, args?: CmsContentEntryListArgs) => Promise<[CmsContentEntry[], CmsContentEntryMeta]>;
1493
+ listPublishedEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1313
1494
  /**
1314
1495
  * List published entries by IDs.
1315
1496
  */
1316
- getPublishedByIds: (model: CmsContentModel, ids: string[]) => Promise<CmsContentEntry[]>;
1497
+ getPublishedEntriesByIds: (model: CmsModel, ids: string[]) => Promise<CmsEntry[]>;
1317
1498
  /**
1318
1499
  * List latest entries by IDs.
1319
1500
  */
1320
- getLatestByIds: (model: CmsContentModel, ids: string[]) => Promise<CmsContentEntry[]>;
1501
+ getLatestEntriesByIds: (model: CmsModel, ids: string[]) => Promise<CmsEntry[]>;
1321
1502
  /**
1322
1503
  * Create a new content entry.
1323
1504
  */
1324
- create: (model: CmsContentModel, data: Record<string, any>) => Promise<CmsContentEntry>;
1505
+ createEntry: (model: CmsModel, data: Record<string, any>) => Promise<CmsEntry>;
1325
1506
  /**
1326
1507
  * Create a new entry from already existing entry.
1327
1508
  */
1328
- createRevisionFrom: (model: CmsContentModel, id: string, data: Record<string, any>) => Promise<CmsContentEntry>;
1509
+ createEntryRevisionFrom: (model: CmsModel, id: string, data: Record<string, any>) => Promise<CmsEntry>;
1329
1510
  /**
1330
1511
  * Update existing entry.
1331
1512
  */
1332
- update: (model: CmsContentModel, id: string, data?: Record<string, any>) => Promise<CmsContentEntry>;
1513
+ updateEntry: (model: CmsModel, id: string, data?: Record<string, any>) => Promise<CmsEntry>;
1333
1514
  /**
1334
1515
  * Delete only a certain revision of the entry.
1335
1516
  */
1336
- deleteRevision: (model: CmsContentModel, id: string) => Promise<void>;
1517
+ deleteEntryRevision: (model: CmsModel, id: string) => Promise<void>;
1337
1518
  /**
1338
1519
  * Delete entry with all its revisions.
1339
1520
  */
1340
- deleteEntry: (model: CmsContentModel, id: string) => Promise<void>;
1521
+ deleteEntry: (model: CmsModel, id: string) => Promise<void>;
1341
1522
  /**
1342
1523
  * Publish entry.
1343
1524
  */
1344
- publish: (model: CmsContentModel, id: string) => Promise<CmsContentEntry>;
1525
+ publishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;
1345
1526
  /**
1346
1527
  * Unpublish entry.
1347
1528
  */
1348
- unpublish: (model: CmsContentModel, id: string) => Promise<CmsContentEntry>;
1529
+ unpublishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;
1349
1530
  /**
1350
1531
  * Request a review for the entry.
1351
1532
  */
1352
- requestReview: (model: CmsContentModel, id: string) => Promise<CmsContentEntry>;
1533
+ requestEntryReview: (model: CmsModel, id: string) => Promise<CmsEntry>;
1353
1534
  /**
1354
1535
  * Request changes for the entry.
1355
1536
  */
1356
- requestChanges: (model: CmsContentModel, id: string) => Promise<CmsContentEntry>;
1537
+ requestEntryChanges: (model: CmsModel, id: string) => Promise<CmsEntry>;
1357
1538
  /**
1358
1539
  * Get all entry revisions.
1359
1540
  */
1360
- getEntryRevisions: (model: CmsContentModel, id: string) => Promise<CmsContentEntry[]>;
1541
+ getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;
1542
+ /**
1543
+ * Events.
1544
+ */
1545
+ onBeforeEntryCreate: Topic<BeforeEntryCreateTopicParams>;
1546
+ onAfterEntryCreate: Topic<AfterEntryCreateTopicParams>;
1547
+ onBeforeEntryRevisionCreate: Topic<BeforeEntryRevisionCreateTopicParams>;
1548
+ onAfterEntryRevisionCreate: Topic<AfterEntryRevisionCreateTopicParams>;
1549
+ onBeforeEntryUpdate: Topic<BeforeEntryUpdateTopicParams>;
1550
+ onAfterEntryUpdate: Topic<AfterEntryUpdateTopicParams>;
1551
+ onBeforeEntryDelete: Topic<BeforeEntryDeleteTopicParams>;
1552
+ onAfterEntryDelete: Topic<AfterEntryDeleteTopicParams>;
1553
+ onBeforeEntryRevisionDelete: Topic<BeforeEntryRevisionDeleteTopicParams>;
1554
+ onAfterEntryRevisionDelete: Topic<AfterEntryRevisionDeleteTopicParams>;
1555
+ onBeforeEntryPublish: Topic<BeforeEntryPublishTopicParams>;
1556
+ onAfterEntryPublish: Topic<AfterEntryPublishTopicParams>;
1557
+ onBeforeEntryUnpublish: Topic<BeforeEntryUnpublishTopicParams>;
1558
+ onAfterEntryUnpublish: Topic<AfterEntryUnpublishTopicParams>;
1559
+ onBeforeEntryRequestChanges: Topic<BeforeEntryRequestChangesTopicParams>;
1560
+ onAfterEntryRequestChanges: Topic<AfterEntryRequestChangesTopicParams>;
1561
+ onBeforeEntryRequestReview: Topic<BeforeEntryRequestReviewTopicParams>;
1562
+ onAfterEntryRequestReview: Topic<AfterEntryRequestReviewTopicParams>;
1563
+ onBeforeEntryGet: Topic<BeforeEntryGetTopicParams>;
1564
+ onBeforeEntryList: Topic<BeforeEntryListTopicParams>;
1361
1565
  }
1362
1566
  /**
1363
1567
  * A cms part of the context that has all the CRUD operations.
1364
1568
  *
1365
1569
  * @category Context
1366
1570
  */
1367
- interface CmsCrudContextObject {
1368
- /**
1369
- * Settings CRUD methods.
1370
- */
1371
- settings: CmsSettingsContext;
1372
- /**
1373
- * Content model group CRUD methods.
1374
- */
1375
- groups: CmsContentModelGroupContext;
1376
- /**
1377
- * Content model CRUD methods.
1378
- */
1379
- models: CmsContentModelContext;
1380
- /**
1381
- * Fetch the content entry manager. It calls content entry methods internally, with given model as the target.
1382
- */
1383
- getModel: (modelId: string) => Promise<CmsContentModelManager>;
1384
- /**
1385
- * Content entry CRUD methods.
1386
- */
1387
- entries: CmsContentEntryContext;
1388
- /**
1389
- * System CRUD methods
1390
- */
1391
- system: CmsSystemContext;
1571
+ interface CmsCrudContextObject extends CmsSettingsContext, CmsSystemContext, CmsGroupContext, CmsModelContext, CmsEntryContext {
1572
+ storageOperations: HeadlessCmsStorageOperations;
1392
1573
  }
1393
1574
  /**
1394
- * Parameters for ContentEntryResolverFactory.
1575
+ * Parameters for CmsEntryResolverFactory.
1395
1576
  *
1396
1577
  * @category GraphQL resolver
1397
- * @category ContentEntry
1578
+ * @category CmsEntry
1398
1579
  */
1399
- interface CmsContentEntryResolverFactoryParams {
1400
- model: CmsContentModel;
1580
+ interface CmsEntryResolverFactoryParams {
1581
+ model: CmsModel;
1401
1582
  }
1402
1583
  /**
1403
- * A type for ContentEntryResolvers. Used when creating get, list, update, publish, ...etc.
1584
+ * A type for EntryResolvers. Used when creating get, list, update, publish, ...etc.
1404
1585
  *
1405
1586
  * @category GraphQL resolver
1406
- * @category ContentEntry
1587
+ * @category CmsEntry
1407
1588
  */
1408
- export declare type CmsContentEntryResolverFactory<TSource = any, TArgs = any, TContext = CmsContext> = {
1409
- (params: CmsContentEntryResolverFactoryParams): GraphQLFieldResolver<TSource, TArgs, TContext>;
1589
+ export declare type CmsEntryResolverFactory<TSource = any, TArgs = any, TContext = CmsContext> = {
1590
+ (params: CmsEntryResolverFactoryParams): GraphQLFieldResolver<TSource, TArgs, TContext>;
1410
1591
  };
1411
1592
  /**
1412
1593
  * Settings security permission.
@@ -1419,9 +1600,9 @@ export interface CmsSettingsPermission extends SecurityPermission {
1419
1600
  * A security permission for content model.
1420
1601
  *
1421
1602
  * @category SecurityPermission
1422
- * @category ContentModel
1603
+ * @category CmsModel
1423
1604
  */
1424
- export interface CmsContentModelPermission extends SecurityPermission {
1605
+ export interface CmsModelPermission extends SecurityPermission {
1425
1606
  own: boolean;
1426
1607
  rwd: string;
1427
1608
  /**
@@ -1441,9 +1622,9 @@ export interface CmsContentModelPermission extends SecurityPermission {
1441
1622
  * The security permission for content model groups.
1442
1623
  *
1443
1624
  * @category SecurityPermission
1444
- * @category ContentModelGroup
1625
+ * @category CmsGroup
1445
1626
  */
1446
- export interface CmsContentModelGroupPermission extends SecurityPermission {
1627
+ export interface CmsGroupPermission extends SecurityPermission {
1447
1628
  own: boolean;
1448
1629
  rwd: string;
1449
1630
  /**
@@ -1457,9 +1638,9 @@ export interface CmsContentModelGroupPermission extends SecurityPermission {
1457
1638
  * The security permission for content entry.
1458
1639
  *
1459
1640
  * @category SecurityPermission
1460
- * @category ContentEntry
1641
+ * @category CmsEntry
1461
1642
  */
1462
- export interface CmsContentEntryPermission extends SecurityPermission {
1643
+ export interface CmsEntryPermission extends SecurityPermission {
1463
1644
  own: boolean;
1464
1645
  rwd: string;
1465
1646
  pw: string;
@@ -1476,1020 +1657,332 @@ export interface CmsContentEntryPermission extends SecurityPermission {
1476
1657
  [key: string]: string[];
1477
1658
  };
1478
1659
  }
1479
- /**
1480
- * A argument definition for CmsModelFieldToStoragePlugin.toStorage
1481
- *
1482
- * @see CmsModelFieldToStoragePlugin.toStorage
1483
- *
1484
- * @category Plugin
1485
- * @category ContentModelField
1486
- * @category Storage
1487
- */
1488
- export interface CmsModelFieldToStoragePluginToStorageArgs<T> {
1489
- model: CmsContentModel;
1490
- field: CmsContentModelField;
1491
- value: T;
1492
- getStoragePlugin(fieldType: string): CmsModelFieldToStoragePlugin<T>;
1493
- context: CmsContext;
1660
+ export interface CmsGroupStorageOperationsGetParams {
1661
+ id: string;
1662
+ tenant: string;
1663
+ locale: string;
1494
1664
  }
1495
- /**
1496
- * A argument definition for CmsModelFieldToStoragePlugin.fromStorage
1497
- *
1498
- * @see CmsModelFieldToStoragePlugin.fromStorage
1499
- *
1500
- * @category Plugin
1501
- * @category ContentModelField
1502
- * @category Storage
1503
- */
1504
- export interface CmsModelFieldToStoragePluginFromStorageArgs<T> {
1505
- model: CmsContentModel;
1506
- field: CmsContentModelField;
1507
- value: T;
1508
- getStoragePlugin(fieldType: string): CmsModelFieldToStoragePlugin<T>;
1509
- context: CmsContext;
1665
+ export interface CmsGroupStorageOperationsListWhereParams {
1666
+ tenant: string;
1667
+ locale: string;
1668
+ [key: string]: any;
1669
+ }
1670
+ export interface CmsGroupStorageOperationsListParams {
1671
+ where: CmsGroupStorageOperationsListWhereParams;
1672
+ sort?: string[];
1673
+ }
1674
+ export interface CmsGroupStorageOperationsCreateParams {
1675
+ input: CmsGroupCreateInput;
1676
+ group: CmsGroup;
1677
+ }
1678
+ export interface CmsGroupStorageOperationsUpdateParams {
1679
+ original: CmsGroup;
1680
+ group: CmsGroup;
1681
+ input: CmsGroupUpdateInput;
1682
+ }
1683
+ export interface CmsGroupStorageOperationsDeleteParams {
1684
+ group: CmsGroup;
1510
1685
  }
1511
1686
  /**
1512
- * A plugin defining transformation of field value to and from storage.
1513
- *
1514
- * @category Plugin
1515
- * @category ContentModelField
1516
- * @category ContentEntry
1517
- * @category Storage
1687
+ * Description of the CmsGroup CRUD operations.
1688
+ * If user wants to add another database to the application, this is how it is done.
1689
+ * This is just plain read, update, write, delete and list - no authentication or permission checks.
1518
1690
  */
1519
- export interface CmsModelFieldToStoragePlugin<Original = Record<string, any>, Converted = Record<string, any>> extends Plugin {
1691
+ export interface CmsGroupStorageOperations {
1520
1692
  /**
1521
- * A plugin type
1693
+ * Gets content model group by given id.
1522
1694
  */
1523
- type: "cms-model-field-to-storage";
1695
+ get: (params: CmsGroupStorageOperationsGetParams) => Promise<CmsGroup | null>;
1524
1696
  /**
1525
- * A unique identifier of the field type (text, number, json, myField, ...).
1526
- *
1527
- * ```ts
1528
- * fieldType: "myField"
1529
- * ```
1697
+ * List all content model groups. Filterable via params.
1530
1698
  */
1531
- fieldType: string;
1699
+ list: (params: CmsGroupStorageOperationsListParams) => Promise<CmsGroup[]>;
1532
1700
  /**
1533
- * A function that is ran when storing the data. You can do what ever transformations you need on input value and return a new value that is stored into the database.
1534
- *
1535
- * ```ts
1536
- * toStorage({ value }) {
1537
- * return gzip(value);
1538
- * }
1539
- * ```
1701
+ * Create a new content model group.
1540
1702
  */
1541
- toStorage: (args: CmsModelFieldToStoragePluginToStorageArgs<Original>) => Promise<Converted>;
1703
+ create: (params: CmsGroupStorageOperationsCreateParams) => Promise<CmsGroup>;
1542
1704
  /**
1543
- * A function that is ran when retrieving the data from the database. You either revert the action you did in the `toStorage` or handle it via some other way available to you.
1544
- *
1545
- * ```ts
1546
- * fromStorage({ value }) {
1547
- * return ungzip(value);
1548
- * }
1549
- * ```
1705
+ * Update existing content model group.
1706
+ */
1707
+ update: (params: CmsGroupStorageOperationsUpdateParams) => Promise<CmsGroup>;
1708
+ /**
1709
+ * Delete the content model group.
1550
1710
  */
1551
- fromStorage: (args: CmsModelFieldToStoragePluginFromStorageArgs<Converted>) => Promise<Original>;
1711
+ delete: (params: CmsGroupStorageOperationsDeleteParams) => Promise<CmsGroup>;
1552
1712
  }
1553
- /**
1554
- * @category LifecycleHook
1555
- * @category ContentModel
1556
- */
1557
- export interface CmsContentModelHookPluginArgs {
1558
- model: CmsContentModel;
1559
- context: CmsContext;
1560
- storageOperations: CmsContentModelStorageOperations;
1713
+ export interface CmsModelStorageOperationsGetParams {
1714
+ tenant: string;
1715
+ locale: string;
1716
+ modelId: string;
1561
1717
  }
1562
- /**
1563
- * @category LifecycleHook
1564
- * @category ContentModel
1565
- */
1566
- export interface CmsContentModelCreateHookPluginArgs extends CmsContentModelHookPluginArgs {
1567
- input: CmsContentModelCreateInput;
1718
+ export interface CmsModelStorageOperationsListWhereParams {
1719
+ tenant: string;
1720
+ locale: string;
1721
+ [key: string]: string;
1568
1722
  }
1569
- /**
1570
- * @category LifecycleHook
1571
- * @category ContentModel
1572
- */
1573
- export interface CmsContentModelUpdateHookPluginArgs extends CmsContentModelHookPluginArgs {
1574
- input: CmsContentModelUpdateInput;
1723
+ export interface CmsModelStorageOperationsListParams {
1724
+ where: CmsModelStorageOperationsListWhereParams;
1725
+ }
1726
+ export interface CmsModelStorageOperationsCreateParams {
1727
+ input: CmsModelCreateInput;
1728
+ model: CmsModel;
1729
+ }
1730
+ export interface CmsModelStorageOperationsUpdateParams {
1731
+ original: CmsModel;
1732
+ model: CmsModel;
1733
+ input: CmsModelUpdateInput;
1734
+ }
1735
+ export interface CmsModelStorageOperationsDeleteParams {
1736
+ model: CmsModel;
1575
1737
  }
1576
1738
  /**
1577
- * A plugin type that defines lifecycle hooks for content model.
1578
- *
1579
- * @category Plugin
1580
- * @category ContentModel
1581
- * @category LifecycleHook
1739
+ * Description of the CmsModel storage operations.
1740
+ * If user wants to add another database to the application, this is how it is done.
1741
+ * This is just plain read, update, write, delete and list - no authentication or permission checks.
1582
1742
  */
1583
- export interface CmsContentModelHookPlugin extends Plugin {
1584
- type: "cms-content-model-hook";
1743
+ export interface CmsModelStorageOperations {
1585
1744
  /**
1586
- * A hook triggered before the content model is created.
1745
+ * Gets content model by given id.
1587
1746
  */
1588
- beforeCreate?: (args: CmsContentModelCreateHookPluginArgs) => void;
1747
+ get: (params: CmsModelStorageOperationsGetParams) => Promise<CmsModel | null>;
1589
1748
  /**
1590
- * A hook triggered after the content model is created.
1749
+ * List all content models. Filterable via params.
1591
1750
  */
1592
- afterCreate?: (args: CmsContentModelCreateHookPluginArgs) => void;
1751
+ list: (params: CmsModelStorageOperationsListParams) => Promise<CmsModel[]>;
1593
1752
  /**
1594
- * A hook triggered before the content model is updated.
1753
+ * Create a new content model.
1595
1754
  */
1596
- beforeUpdate?: (args: CmsContentModelUpdateHookPluginArgs) => void;
1755
+ create: (params: CmsModelStorageOperationsCreateParams) => Promise<CmsModel>;
1597
1756
  /**
1598
- * A hook triggered after the content model is updated.
1757
+ * Update existing content model.
1599
1758
  */
1600
- afterUpdate?: (args: CmsContentModelUpdateHookPluginArgs) => void;
1759
+ update: (params: CmsModelStorageOperationsUpdateParams) => Promise<CmsModel>;
1601
1760
  /**
1602
- * A hook triggered before the content model is deleted.
1761
+ * Delete the content model.
1603
1762
  */
1604
- beforeDelete?: (args: CmsContentModelHookPluginArgs) => void;
1763
+ delete: (params: CmsModelStorageOperationsDeleteParams) => Promise<CmsModel>;
1764
+ }
1765
+ export interface CmsEntryStorageOperationsGetParams {
1766
+ where: CmsEntryListWhere;
1767
+ sort?: CmsEntryListSort;
1768
+ limit?: number;
1769
+ }
1770
+ export interface CmsEntryStorageOperationsListParams {
1771
+ where: CmsEntryListWhere;
1772
+ sort?: CmsEntryListSort;
1773
+ limit?: number;
1774
+ after?: string;
1775
+ }
1776
+ export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry = CmsStorageEntry> {
1605
1777
  /**
1606
- * A hook triggered after the content model is deleted.
1778
+ * Input received from the user.
1607
1779
  */
1608
- afterDelete?: (args: CmsContentModelHookPluginArgs) => void;
1609
- }
1610
- /**
1611
- * @category ContentEntry
1612
- * @category LifecycleHook
1613
- */
1614
- interface CmsContentEntryHookPluginArgs {
1615
- context: CmsContext;
1780
+ input: Record<string, any>;
1616
1781
  /**
1617
- * Storage operations that we have initialized.
1782
+ * Real entry, with no transformations on it.
1618
1783
  */
1619
- storageOperations: CmsContentEntryStorageOperations;
1784
+ entry: CmsEntry;
1620
1785
  /**
1621
- * Model of the given entry.
1786
+ * Entry prepared for the storage.
1622
1787
  */
1623
- model: CmsContentModel;
1788
+ storageEntry: T;
1624
1789
  }
1625
- /**
1626
- * @category ContentEntry
1627
- * @category LifecycleHook
1628
- */
1629
- export interface CmsContentEntryBeforeCreateHookArgs extends CmsContentEntryHookPluginArgs {
1790
+ export interface CmsEntryStorageOperationsCreateRevisionFromParams<T extends CmsStorageEntry = CmsStorageEntry> {
1630
1791
  /**
1631
- * User input.
1792
+ * The entry we are creating new one from.
1632
1793
  */
1633
- input: Record<string, any>;
1794
+ originalEntry: CmsEntry;
1634
1795
  /**
1635
- * Plain entry, as we need it in the system.
1796
+ * The entry we are creating new one from, directly from storage, with transformations on it.
1636
1797
  */
1637
- entry: CmsContentEntry;
1638
- }
1639
- /**
1640
- * @category ContentEntry
1641
- * @category LifecycleHook
1642
- */
1643
- export interface CmsContentEntryAfterCreateHookArgs extends CmsContentEntryHookPluginArgs {
1798
+ originalStorageEntry: T;
1644
1799
  /**
1645
- * User input.
1800
+ * Latest entry, used to calculate the new version.
1646
1801
  */
1647
- input: Record<string, any>;
1802
+ latestEntry: CmsEntry;
1648
1803
  /**
1649
- * Plain entry, as we need it in the system.
1804
+ * Latest entry, used to calculate the new version, directly from storage, with transformations.
1650
1805
  */
1651
- entry: CmsContentEntry;
1806
+ latestStorageEntry: T;
1652
1807
  /**
1653
- * Transformed entry to insert into the storage.
1808
+ * Real entry, with no transformations on it.
1654
1809
  */
1655
- storageEntry: CmsStorageContentEntry;
1656
- }
1657
- /**
1658
- * @category ContentEntry
1659
- * @category LifecycleHook
1660
- */
1661
- export interface CmsContentEntryBeforeCreateFromRevisionHookArgs extends CmsContentEntryHookPluginArgs {
1810
+ entry: CmsEntry;
1662
1811
  /**
1663
- * Entry used through the system as we need it.
1812
+ * Entry prepared for the storage.
1664
1813
  */
1665
- entry: CmsContentEntry;
1814
+ storageEntry: T;
1815
+ }
1816
+ export interface CmsEntryStorageOperationsUpdateParams<T extends CmsStorageEntry = CmsStorageEntry> {
1666
1817
  /**
1667
- * Entry prepared for the storage.
1818
+ * Input received from the user.
1668
1819
  */
1669
- storageEntry: CmsStorageContentEntry;
1820
+ input: Record<string, any>;
1670
1821
  /**
1671
- * The entry we are creating the new entry from.
1822
+ * Used to compare IDs, versions and passed into storage operations to be used if required.
1672
1823
  */
1673
- originalEntry: CmsContentEntry;
1824
+ originalEntry: CmsEntry;
1674
1825
  /**
1675
- * The entry we are creating the new entry from, directly from storage, with transformations on it.
1826
+ * Directly from storage, with transformations on it.
1676
1827
  */
1677
- originalStorageEntry: CmsStorageContentEntry;
1828
+ originalStorageEntry: T;
1678
1829
  /**
1679
- * Latest entry, used to calculate the new version.
1830
+ * Real entry, with no transformations on it.
1680
1831
  */
1681
- latestEntry: CmsContentEntry;
1832
+ entry: CmsEntry;
1682
1833
  /**
1683
- * Latest entry, used to calculate the new version, directly from storage, with transformations.
1834
+ * Entry prepared for the storage.
1684
1835
  */
1685
- latestStorageEntry: CmsStorageContentEntry;
1836
+ storageEntry: T;
1686
1837
  }
1687
- /**
1688
- * @category ContentEntry
1689
- * @category LifecycleHook
1690
- */
1691
- export interface CmsContentEntryAfterCreateFromRevisionHookArgs extends CmsContentEntryHookPluginArgs {
1838
+ export interface CmsEntryStorageOperationsDeleteRevisionParams<T extends CmsStorageEntry = CmsStorageEntry> {
1692
1839
  /**
1693
- * Entry used through the system as we need it.
1840
+ * Entry that was deleted.
1694
1841
  */
1695
- entry: CmsContentEntry;
1842
+ entryToDelete: CmsEntry;
1696
1843
  /**
1697
- * Entry prepared for the storage.
1844
+ * Entry that was deleted, directly from storage, with transformations.
1698
1845
  */
1699
- storageEntry: CmsStorageContentEntry;
1846
+ storageEntryToDelete: T;
1700
1847
  /**
1701
- * The entry we are creating the new entry from.
1848
+ * Entry that was set as latest.
1702
1849
  */
1703
- originalEntry: CmsContentEntry;
1850
+ entryToSetAsLatest?: CmsEntry;
1704
1851
  /**
1705
- * The entry we are creating the new entry from, directly from storage, with transformations on it.
1852
+ * Entry that was set as latest, directly from storage, with transformations.
1706
1853
  */
1707
- originalStorageEntry: CmsStorageContentEntry;
1854
+ storageEntryToSetAsLatest?: T;
1855
+ }
1856
+ export interface CmsEntryStorageOperationsDeleteParams<T extends CmsStorageEntry = CmsStorageEntry> {
1708
1857
  /**
1709
- * Latest entry, used to calculate the new version.
1858
+ * Entry that is going to be deleted.
1710
1859
  */
1711
- latestEntry: CmsContentEntry;
1860
+ entry: CmsEntry;
1712
1861
  /**
1713
- * Latest entry, used to calculate the new version, directly from storage, with transformations.
1862
+ * Entry that is going to be deleted, directly from storage.
1714
1863
  */
1715
- latestStorageEntry: CmsStorageContentEntry;
1864
+ storageEntry: T;
1716
1865
  }
1717
- /**
1718
- * @category ContentEntry
1719
- * @category LifecycleHook
1720
- */
1721
- export interface CmsContentEntryBeforeUpdateHookArgs extends CmsContentEntryHookPluginArgs {
1866
+ export interface CmsEntryStorageOperationsPublishParams<T extends CmsStorageEntry = CmsStorageEntry> {
1722
1867
  /**
1723
- * User input.
1868
+ * The entry record before it was published.
1724
1869
  */
1725
- input: Record<string, any>;
1870
+ originalEntry: CmsEntry;
1726
1871
  /**
1727
- * Entry to be updated in the storage, after the changes are applied.
1872
+ * Directly from storage, with transformations on it.
1728
1873
  */
1729
- entry: CmsContentEntry;
1874
+ originalStorageEntry: T;
1730
1875
  /**
1731
- * Original entry being updated.
1876
+ * The modified entry that is going to be saved as published.
1877
+ * Entry is in its original form.
1732
1878
  */
1733
- originalEntry: CmsContentEntry;
1879
+ entry: CmsEntry;
1734
1880
  /**
1735
- * Original entry being updated, directly from storage, with transformations on it.
1881
+ * The modified entry and prepared for the storage.
1736
1882
  */
1737
- originalStorageEntry: CmsStorageContentEntry;
1883
+ storageEntry: T;
1738
1884
  }
1739
- /**
1740
- * @category ContentEntry
1741
- * @category LifecycleHook
1742
- */
1743
- export interface CmsContentEntryAfterUpdateHookArgs extends CmsContentEntryHookPluginArgs {
1744
- /**
1745
- * User input.
1746
- */
1747
- input: Record<string, any>;
1885
+ export interface CmsEntryStorageOperationsUnpublishParams<T extends CmsStorageEntry = CmsStorageEntry> {
1748
1886
  /**
1749
- * Original entry being updated.
1887
+ * The entry record before it was unpublished.
1750
1888
  */
1751
- originalEntry: CmsContentEntry;
1889
+ originalEntry: CmsEntry;
1752
1890
  /**
1753
- * Original entry being updated, directly from storage, with transformations on it.
1891
+ * The entry record before it was unpublished, with transformations on it.
1754
1892
  */
1755
- originalStorageEntry: CmsContentEntry;
1893
+ originalStorageEntry: T;
1756
1894
  /**
1757
- * Entry that was stored, in its plain form without the transformations.
1895
+ * The modified entry that is going to be saved as unpublished.
1758
1896
  */
1759
- entry: CmsContentEntry;
1897
+ entry: CmsEntry;
1760
1898
  /**
1761
- * Entry record that was stored in the storage via the storage operations.
1899
+ * The modified entry that is going to be saved as unpublished, with transformations on it.
1762
1900
  */
1763
- storageEntry: CmsStorageContentEntry;
1901
+ storageEntry: T;
1764
1902
  }
1765
- /**
1766
- * @category ContentEntry
1767
- * @category LifecycleHook
1768
- */
1769
- export interface CmsContentEntryBeforeDeleteRevisionHookArgs extends CmsContentEntryHookPluginArgs {
1903
+ export interface CmsEntryStorageOperationsRequestChangesParams<T extends CmsStorageEntry = CmsStorageEntry> {
1770
1904
  /**
1771
- * Entry that is going to be deleted.
1772
- */
1773
- entryToDelete: CmsContentEntry;
1774
- /**
1775
- * Entry that is going to be deleted, directly from storage, with transformations.
1776
- */
1777
- storageEntryToDelete: CmsStorageContentEntry;
1778
- /**
1779
- * Entry that is to be set as latest.
1780
- */
1781
- entryToSetAsLatest?: CmsContentEntry;
1782
- /**
1783
- * Entry that is to be set as latest, directly from storage, with transformations.
1784
- */
1785
- storageEntryToSetAsLatest?: CmsStorageContentEntry;
1786
- }
1787
- /**
1788
- * @category ContentEntry
1789
- * @category LifecycleHook
1790
- */
1791
- export interface CmsContentEntryAfterDeleteRevisionHookArgs extends CmsContentEntryHookPluginArgs {
1792
- /**
1793
- * Entry that was deleted.
1794
- */
1795
- entryToDelete: CmsContentEntry;
1796
- /**
1797
- * Entry that was deleted, directly from storage, with transformations.
1798
- */
1799
- storageEntryToDelete: CmsStorageContentEntry;
1800
- /**
1801
- * Entry that was set as latest.
1802
- */
1803
- entryToSetAsLatest?: CmsContentEntry;
1804
- /**
1805
- * Entry that was set as latest, directly from storage, with transformations.
1806
- */
1807
- storageEntryToSetAsLatest?: CmsStorageContentEntry;
1808
- }
1809
- /**
1810
- * @category ContentEntry
1811
- * @category LifecycleHook
1812
- */
1813
- export interface CmsContentEntryBeforeDeleteHookArgs extends CmsContentEntryHookPluginArgs {
1814
- /**
1815
- * Entry that is going to be deleted.
1816
- */
1817
- entry: CmsContentEntry;
1818
- /**
1819
- * Entry that is going to be deleted, directly from storage, with transformations.
1820
- */
1821
- storageEntry: CmsStorageContentEntry;
1822
- }
1823
- /**
1824
- * @category ContentEntry
1825
- * @category LifecycleHook
1826
- */
1827
- export interface CmsContentEntryAfterDeleteHookArgs extends CmsContentEntryHookPluginArgs {
1828
- /**
1829
- * Entry that was deleted.
1830
- */
1831
- entry: CmsContentEntry;
1832
- /**
1833
- * Entry that was deleted, directly from storage, with transformations.
1834
- */
1835
- storageEntry: CmsStorageContentEntry;
1836
- }
1837
- /**
1838
- * @category ContentEntry
1839
- * @category LifecycleHook
1840
- */
1841
- export interface CmsContentEntryBeforePublishHookArgs extends CmsContentEntryHookPluginArgs {
1842
- /**
1843
- * Entry to be set as published.
1844
- */
1845
- entry: CmsContentEntry;
1846
- /**
1847
- * Entry before the changes that made it published.
1848
- */
1849
- originalEntry: CmsContentEntry;
1850
- /**
1851
- * Entry before the changes that made it published, directly from storage, with transforms.
1852
- */
1853
- originalStorageEntry: CmsContentEntry;
1854
- }
1855
- /**
1856
- * @category ContentEntry
1857
- * @category LifecycleHook
1858
- */
1859
- export interface CmsContentEntryAfterPublishHookArgs extends CmsContentEntryHookPluginArgs {
1860
- /**
1861
- * Entry to be set as published.
1862
- */
1863
- entry: CmsContentEntry;
1864
- /**
1865
- * Entry to be set as published, after the storage transformations.
1866
- */
1867
- storageEntry: CmsStorageContentEntry;
1868
- /**
1869
- * Entry before the changes that made it published.
1870
- */
1871
- originalEntry: CmsContentEntry;
1872
- /**
1873
- * Entry before the changes that made it published, directly from storage, with transforms.
1874
- */
1875
- originalStorageEntry: CmsContentEntry;
1876
- }
1877
- /**
1878
- * @category ContentEntry
1879
- * @category LifecycleHook
1880
- */
1881
- export interface CmsContentEntryBeforeUnpublishHookArgs extends CmsContentEntryHookPluginArgs {
1882
- /**
1883
- * Entry to be set as unpublished.
1884
- */
1885
- entry: CmsContentEntry;
1886
- /**
1887
- * Entry before the modification to set it unpublished.
1888
- */
1889
- originalEntry: CmsContentEntry;
1890
- /**
1891
- * Entry before the modification to set it unpublished, directly from storage, with transformations on it.
1892
- */
1893
- originalStorageEntry: CmsStorageContentEntry;
1894
- }
1895
- /**
1896
- * @category ContentEntry
1897
- * @category LifecycleHook
1898
- */
1899
- export interface CmsContentEntryAfterUnpublishHookArgs extends CmsContentEntryHookPluginArgs {
1900
- /**
1901
- * Entry that was set as unpublished.
1902
- */
1903
- entry: CmsContentEntry;
1904
- /**
1905
- * Entry that was set as unpublished, with transformations on it.
1906
- */
1907
- storageEntry: CmsContentEntry;
1908
- /**
1909
- * Entry before the modification to set it unpublished.
1910
- */
1911
- originalEntry: CmsContentEntry;
1912
- /**
1913
- * Entry before the modification to set it unpublished, directly from storage, with transformations on it.
1914
- */
1915
- originalStorageEntry: CmsStorageContentEntry;
1916
- }
1917
- /**
1918
- * @category ContentEntry
1919
- * @category LifecycleHook
1920
- */
1921
- export interface CmsContentEntryBeforeRequestChangesHookArgs extends CmsContentEntryHookPluginArgs {
1922
- /**
1923
- * Original entry to be updated, no transformations on it.
1924
- */
1925
- originalEntry: CmsContentEntry;
1926
- /**
1927
- * Original entry to be updated, directly from storage, with the transformations.
1928
- */
1929
- originalStorageEntry: CmsContentEntry;
1930
- /**
1931
- * Entry to be updated as requested changes on it.
1932
- */
1933
- entry: CmsContentEntry;
1934
- }
1935
- /**
1936
- * @category ContentEntry
1937
- * @category LifecycleHook
1938
- */
1939
- export interface CmsContentEntryAfterRequestChangesHookArgs extends CmsContentEntryHookPluginArgs {
1940
- /**
1941
- * Original entry to be updated, no transformations on it.
1942
- */
1943
- originalEntry: CmsContentEntry;
1944
- /**
1945
- * Original entry to be updated, directly from storage, with the transformations.
1946
- */
1947
- originalStorageEntry: CmsContentEntry;
1948
- /**
1949
- * Entry to be updated as requested changes on it.
1905
+ * Entry data updated with the required properties.
1950
1906
  */
1951
- entry: CmsContentEntry;
1907
+ entry: CmsEntry;
1952
1908
  /**
1953
- * Transformed entry, prepared for the storage.
1909
+ * Entry that is prepared for the storageOperations, with the transformations.
1954
1910
  */
1955
- storageEntry: CmsStorageContentEntry;
1956
- }
1957
- /**
1958
- * @category ContentEntry
1959
- * @category LifecycleHook
1960
- */
1961
- export interface CmsContentEntryBeforeRequestReviewHookArgs extends CmsContentEntryHookPluginArgs {
1911
+ storageEntry: T;
1962
1912
  /**
1963
- * Original entry to be updated, no transformations on it.
1913
+ * Original entry from the storage.
1964
1914
  */
1965
- originalEntry: CmsContentEntry;
1915
+ originalEntry: CmsEntry;
1966
1916
  /**
1967
1917
  * Original entry to be updated, directly from storage, with the transformations.
1968
1918
  */
1969
- originalStorageEntry: CmsContentEntry;
1970
- /**
1971
- * Entry to be updated as requested review on it.
1972
- */
1973
- entry: CmsContentEntry;
1919
+ originalStorageEntry: T;
1974
1920
  }
1975
- /**
1976
- * @category ContentEntry
1977
- * @category LifecycleHook
1978
- */
1979
- export interface CmsContentEntryAfterRequestReviewHookArgs extends CmsContentEntryHookPluginArgs {
1921
+ export interface CmsEntryStorageOperationsRequestReviewParams<T extends CmsStorageEntry = CmsStorageEntry> {
1980
1922
  /**
1981
- * Entry to be updated as requested review on it.
1923
+ * Entry that is prepared for the storageOperations.
1982
1924
  */
1983
- entry: CmsContentEntry;
1925
+ entry: CmsEntry;
1984
1926
  /**
1985
1927
  * Entry that is prepared for the storageOperations, with the transformations.
1986
1928
  */
1987
- storageEntry: CmsStorageContentEntry;
1929
+ storageEntry: T;
1988
1930
  /**
1989
1931
  * Original entry from the storage.
1990
1932
  */
1991
- originalEntry: CmsContentEntry;
1933
+ originalEntry: CmsEntry;
1992
1934
  /**
1993
1935
  * Original entry to be updated, directly from storage, with the transformations.
1994
1936
  */
1995
- originalStorageEntry: CmsStorageContentEntry;
1937
+ originalStorageEntry: T;
1996
1938
  }
1997
- /**
1998
- * A plugin type that defines lifecycle hooks for content entry.
1999
- *
2000
- * @category Plugin
2001
- * @category ContentEntry
2002
- * @category LifecycleHook
2003
- */
2004
- export interface CmsContentEntryHookPlugin extends Plugin {
2005
- type: "cms-content-entry-hook";
2006
- /**
2007
- * A hook triggered before entry is stored.
2008
- * At this point, entry for storage is already built so you cannot modify them.
2009
- */
2010
- beforeCreate?: (args: CmsContentEntryBeforeCreateHookArgs) => void;
2011
- /**
2012
- * A hook triggered after entry is stored.
2013
- */
2014
- afterCreate?: (CmsContentEntryAfterCreateHookArgs: any) => void;
2015
- /**
2016
- * @see CmsContentEntryHookPlugin.beforeCreate
2017
- */
2018
- beforeCreateRevisionFrom?: (args: CmsContentEntryBeforeCreateFromRevisionHookArgs) => void;
2019
- /**
2020
- * @see CmsContentEntryHookPlugin.afterCreate
2021
- */
2022
- afterCreateRevisionFrom?: (args: CmsContentEntryAfterCreateFromRevisionHookArgs) => void;
2023
- /**
2024
- * A hook triggered before entry is updated in the database.
2025
- * It can be modified but we do not recommend it.
2026
- */
2027
- beforeUpdate?: (args: CmsContentEntryBeforeUpdateHookArgs) => void;
2028
- /**
2029
- * A hook triggered after entry is updated.
2030
- */
2031
- afterUpdate?: (args: CmsContentEntryAfterUpdateHookArgs) => void;
2032
- /**
2033
- * A hook triggered before deleting a certain revision (id#revision).
2034
- */
2035
- beforeDeleteRevision?: (args: CmsContentEntryBeforeDeleteRevisionHookArgs) => void;
2036
- /**
2037
- * A hook triggered after deleting certain revision.
2038
- * In a case that deleted revision is only one, deleteEntry is called just to make sure that nothing is left in storage.
2039
- */
2040
- afterDeleteRevision?: (args: CmsContentEntryAfterDeleteRevisionHookArgs) => void;
2041
- /**
2042
- * A hook triggered before deleting an entry with all its revisions.
2043
- */
2044
- beforeDelete?: (args: CmsContentEntryBeforeDeleteHookArgs) => void;
2045
- /**
2046
- * A hook triggered after deleting an entry.
2047
- */
2048
- afterDelete?: (args: CmsContentEntryBeforeDeleteHookArgs) => void;
2049
- /**
2050
- * A hook triggered before publishing of an entry.
2051
- */
2052
- beforePublish?: (args: CmsContentEntryBeforePublishHookArgs) => void;
2053
- /**
2054
- * A hook triggered after publishing of an entry.
2055
- */
2056
- afterPublish?: (args: CmsContentEntryAfterPublishHookArgs) => void;
2057
- /**
2058
- * A hook triggered before unpublishing of an entry.
2059
- */
2060
- beforeUnpublish?: (args: CmsContentEntryBeforeUnpublishHookArgs) => void;
2061
- /**
2062
- * A hook triggered after unpublishing of an entry.
2063
- */
2064
- afterUnpublish?: (args: CmsContentEntryAfterUnpublishHookArgs) => void;
2065
- /**
2066
- * A hook triggered before requesting changes of an entry.
2067
- */
2068
- beforeRequestChanges?: (args: CmsContentEntryBeforeRequestChangesHookArgs) => void;
2069
- /**
2070
- * A hook triggered after requesting changes of an entry.
2071
- */
2072
- afterRequestChanges?: (args: CmsContentEntryAfterRequestChangesHookArgs) => void;
2073
- /**
2074
- * A hook triggered before requesting review of an entry.
2075
- */
2076
- beforeRequestReview?: (args: CmsContentEntryBeforeRequestReviewHookArgs) => void;
2077
- /**
2078
- * A hook triggered after requesting review of an entry.
2079
- */
2080
- afterRequestReview?: (args: CmsContentEntryAfterRequestReviewHookArgs) => void;
1939
+ export interface CmsEntryStorageOperationsGetAllRevisionsParams {
1940
+ ids: readonly string[];
1941
+ tenant: string;
1942
+ locale: string;
2081
1943
  }
2082
- interface CmsStorageOperationsProvider<A = any, T = any> extends Plugin {
2083
- provide: (args: A) => Promise<T>;
1944
+ export interface CmsEntryStorageOperationsGetByIdsParams {
1945
+ ids: readonly string[];
1946
+ tenant: string;
1947
+ locale: string;
2084
1948
  }
2085
- /**
2086
- * Arguments for the group storage operations provider method.
2087
- */
2088
- interface CmsContentModelGroupStorageOperationsProviderArgs {
2089
- context: CmsContext;
1949
+ export interface CmsEntryStorageOperationsGetLatestByIdsParams {
1950
+ ids: readonly string[];
1951
+ tenant: string;
1952
+ locale: string;
2090
1953
  }
2091
- /**
2092
- * A plugin that provides the group storage operations implementation.
2093
- */
2094
- export interface CmsContentModelGroupStorageOperationsProvider extends CmsStorageOperationsProvider<CmsContentModelGroupStorageOperationsProviderArgs, CmsContentModelGroupStorageOperations> {
2095
- /**
2096
- * A plugin type.
2097
- */
2098
- type: "cms-content-model-group-storage-operations-provider";
1954
+ export interface CmsEntryStorageOperationsGetPublishedByIdsParams {
1955
+ ids: readonly string[];
1956
+ tenant: string;
1957
+ locale: string;
2099
1958
  }
2100
- export interface CmsContentModelGroupStorageOperationsGetArgs {
1959
+ export interface CmsEntryStorageOperationsGetRevisionsParams {
2101
1960
  id: string;
1961
+ tenant: string;
1962
+ locale: string;
2102
1963
  }
2103
- export interface CmsContentModelGroupStorageOperationsListArgs<T extends Record<string, any> = Record<string, any>> {
2104
- where?: T;
2105
- limit?: number;
2106
- }
2107
- export interface CmsContentModelGroupStorageOperationsBeforeCreateArgs {
2108
- input: CmsContentModelGroupCreateInput;
2109
- data: CmsContentModelGroup;
2110
- }
2111
- export interface CmsContentModelGroupStorageOperationsCreateArgs {
2112
- input: CmsContentModelGroupCreateInput;
2113
- data: CmsContentModelGroup;
2114
- }
2115
- export interface CmsContentModelGroupStorageOperationsAfterCreateArgs {
2116
- input: CmsContentModelGroupCreateInput;
2117
- group: CmsContentModelGroup;
2118
- }
2119
- export interface CmsContentModelGroupStorageOperationsBeforeUpdateArgs {
2120
- group: CmsContentModelGroup;
2121
- data: Partial<CmsContentModelGroup>;
2122
- input: CmsContentModelGroupUpdateInput;
2123
- }
2124
- export interface CmsContentModelGroupStorageOperationsUpdateArgs {
2125
- group: CmsContentModelGroup;
2126
- data: Partial<CmsContentModelGroup>;
2127
- input: CmsContentModelGroupUpdateInput;
2128
- }
2129
- export interface CmsContentModelGroupStorageOperationsAfterUpdateArgs {
2130
- group: CmsContentModelGroup;
2131
- data: Partial<CmsContentModelGroup>;
2132
- input: CmsContentModelGroupUpdateInput;
2133
- }
2134
- export interface CmsContentModelGroupStorageOperationsBeforeDeleteArgs {
2135
- group: CmsContentModelGroup;
2136
- }
2137
- export interface CmsContentModelGroupStorageOperationsDeleteArgs {
2138
- group: CmsContentModelGroup;
2139
- }
2140
- export interface CmsContentModelGroupStorageOperationsAfterDeleteArgs {
2141
- group: CmsContentModelGroup;
2142
- }
2143
- /**
2144
- * Description of the ContentModelGroup CRUD operations.
2145
- * If user wants to add another database to the application, this is how it is done.
2146
- * This is just plain read, update, write, delete and list - no authentication or permission checks.
2147
- */
2148
- export interface CmsContentModelGroupStorageOperations {
2149
- /**
2150
- * Gets content model group by given id.
2151
- */
2152
- get: (args: CmsContentModelGroupStorageOperationsGetArgs) => Promise<CmsContentModelGroup | null>;
2153
- /**
2154
- * List all content model groups. Filterable via params.
2155
- */
2156
- list: (args?: CmsContentModelGroupStorageOperationsListArgs) => Promise<CmsContentModelGroup[]>;
2157
- /**
2158
- * A hook to be run before the create method.
2159
- */
2160
- beforeCreate?: (args: CmsContentModelGroupStorageOperationsBeforeCreateArgs) => Promise<void>;
2161
- /**
2162
- * Create a new content model group.
2163
- */
2164
- create: (args: CmsContentModelGroupStorageOperationsCreateArgs) => Promise<CmsContentModelGroup>;
2165
- /**
2166
- * A hook to be run after the create method.
2167
- */
2168
- afterCreate?: (args: CmsContentModelGroupStorageOperationsAfterCreateArgs) => Promise<void>;
2169
- /**
2170
- * A hook to be run before the update method.
2171
- */
2172
- beforeUpdate?: (args: CmsContentModelGroupStorageOperationsBeforeUpdateArgs) => Promise<void>;
2173
- /**
2174
- * Update existing content model group.
2175
- */
2176
- update: (args: CmsContentModelGroupStorageOperationsUpdateArgs) => Promise<CmsContentModelGroup>;
2177
- /**
2178
- * A hook to be run after the update method.
2179
- */
2180
- afterUpdate?: (args: CmsContentModelGroupStorageOperationsAfterUpdateArgs) => Promise<void>;
2181
- /**
2182
- * A hook to be run before the delete method.
2183
- */
2184
- beforeDelete?: (args: CmsContentModelGroupStorageOperationsBeforeDeleteArgs) => Promise<void>;
2185
- /**
2186
- * Delete the content model group.
2187
- */
2188
- delete: (args: CmsContentModelGroupStorageOperationsDeleteArgs) => Promise<boolean>;
2189
- /**
2190
- * A hook to be run after the delete method.
2191
- */
2192
- afterDelete?: (args: CmsContentModelGroupStorageOperationsAfterDeleteArgs) => Promise<void>;
2193
- }
2194
- /**
2195
- * Arguments for the model storage operations provider method.
2196
- */
2197
- interface CmsContentModelStorageOperationsProviderArgs {
2198
- context: CmsContext;
2199
- }
2200
- /**
2201
- * A plugin that provides the model storage operations implementation.
2202
- */
2203
- export interface CmsContentModelStorageOperationsProvider extends CmsStorageOperationsProvider<CmsContentModelStorageOperationsProviderArgs, CmsContentModelStorageOperations> {
2204
- /**
2205
- * A plugin type.
2206
- */
2207
- type: "cms-content-model-storage-operations-provider";
2208
- }
2209
- export interface CmsContentModelStorageOperationsGetArgs {
1964
+ export interface CmsEntryStorageOperationsGetRevisionParams {
2210
1965
  id: string;
1966
+ tenant: string;
1967
+ locale: string;
2211
1968
  }
2212
- export interface CmsContentModelStorageOperationsListArgs<T extends Record<string, any> = Record<string, any>> {
2213
- where?: T;
2214
- limit?: number;
2215
- }
2216
- export interface CmsContentModelStorageOperationsBeforeCreateArgs {
2217
- input: CmsContentModelCreateInput;
2218
- data: CmsContentModel;
2219
- }
2220
- export interface CmsContentModelStorageOperationsCreateArgs {
2221
- input: CmsContentModelCreateInput;
2222
- data: CmsContentModel;
2223
- }
2224
- export interface CmsContentModelStorageOperationsAfterCreateArgs {
2225
- input: CmsContentModelCreateInput;
2226
- model: CmsContentModel;
2227
- }
2228
- export interface CmsContentModelStorageOperationsBeforeUpdateArgs {
2229
- model: CmsContentModel;
2230
- data: Partial<CmsContentModel>;
2231
- input: CmsContentModelUpdateInput;
2232
- }
2233
- export interface CmsContentModelStorageOperationsUpdateArgs {
2234
- model: CmsContentModel;
2235
- data: Partial<CmsContentModel>;
2236
- input: CmsContentModelUpdateInput;
2237
- }
2238
- export interface CmsContentModelStorageOperationsAfterUpdateArgs {
2239
- model: CmsContentModel;
2240
- data: Partial<CmsContentModel>;
2241
- input: CmsContentModelUpdateInput;
2242
- }
2243
- export interface CmsContentModelStorageOperationsBeforeDeleteArgs {
2244
- model: CmsContentModel;
2245
- }
2246
- export interface CmsContentModelStorageOperationsDeleteArgs {
2247
- model: CmsContentModel;
2248
- }
2249
- export interface CmsContentModelStorageOperationsAfterDeleteArgs {
2250
- model: CmsContentModel;
2251
- }
2252
- /**
2253
- * Description of the ContentModel storage operations.
2254
- * If user wants to add another database to the application, this is how it is done.
2255
- * This is just plain read, update, write, delete and list - no authentication or permission checks.
2256
- */
2257
- export interface CmsContentModelStorageOperations {
2258
- /**
2259
- * Gets content model by given id.
2260
- */
2261
- get: (args: CmsContentModelStorageOperationsGetArgs) => Promise<CmsContentModel | null>;
2262
- /**
2263
- * List all content models. Filterable via params.
2264
- */
2265
- list: (args?: CmsContentModelStorageOperationsListArgs) => Promise<CmsContentModel[]>;
2266
- /**
2267
- * A hook to be run before the create method.
2268
- */
2269
- beforeCreate?: (args: CmsContentModelStorageOperationsBeforeCreateArgs) => Promise<void>;
2270
- /**
2271
- * Create a new content model.
2272
- */
2273
- create: (args: CmsContentModelStorageOperationsCreateArgs) => Promise<CmsContentModel>;
2274
- /**
2275
- * A hook to be run after the create method.
2276
- */
2277
- afterCreate?: (args: CmsContentModelStorageOperationsAfterCreateArgs) => Promise<void>;
2278
- /**
2279
- * A hook to be run before the update method.
2280
- */
2281
- beforeUpdate?: (args: CmsContentModelStorageOperationsBeforeUpdateArgs) => Promise<void>;
2282
- /**
2283
- * Update existing content model.
2284
- */
2285
- update: (args: CmsContentModelStorageOperationsUpdateArgs) => Promise<CmsContentModel>;
2286
- /**
2287
- * A hook to be run after the update method.
2288
- */
2289
- afterUpdate?: (args: CmsContentModelStorageOperationsAfterUpdateArgs) => Promise<void>;
2290
- /**
2291
- * A hook to be run before the delete method.
2292
- */
2293
- beforeDelete?: (args: CmsContentModelStorageOperationsBeforeDeleteArgs) => Promise<void>;
2294
- /**
2295
- * Delete the content model.
2296
- */
2297
- delete: (args: CmsContentModelStorageOperationsDeleteArgs) => Promise<boolean>;
2298
- /**
2299
- * A hook to be run after the delete method.
2300
- */
2301
- afterDelete?: (args: CmsContentModelStorageOperationsAfterDeleteArgs) => Promise<void>;
2302
- }
2303
- /**
2304
- * Arguments for the entry storage provider method.
2305
- */
2306
- interface CmsContentEntryStorageOperationsProviderArgs {
2307
- context: CmsContext;
2308
- }
2309
- /**
2310
- * A plugin that provides the entry storage operations implementation.
2311
- */
2312
- export interface CmsContentEntryStorageOperationsProvider extends CmsStorageOperationsProvider<CmsContentEntryStorageOperationsProviderArgs, CmsContentEntryStorageOperations> {
2313
- /**
2314
- * A plugin type.
2315
- */
2316
- type: "cms-content-entry-storage-operations-provider";
2317
- }
2318
- export interface CmsContentEntryStorageOperationsGetArgs {
2319
- where?: CmsContentEntryListWhere;
2320
- sort?: CmsContentEntryListSort;
2321
- limit?: number;
2322
- }
2323
- export interface CmsContentEntryStorageOperationsListArgs<T extends Record<string, any> = Record<string, any>> {
2324
- where?: T;
2325
- sort?: CmsContentEntryListSort;
2326
- limit?: number;
2327
- after?: string;
2328
- }
2329
- export interface CmsContentEntryStorageOperationsCreateArgs<T extends CmsStorageContentEntry = CmsStorageContentEntry> {
2330
- /**
2331
- * Input received from the user.
2332
- */
2333
- input: Record<string, any>;
2334
- /**
2335
- * Real entry, with no transformations on it.
2336
- */
2337
- entry: CmsContentEntry;
2338
- /**
2339
- * Entry prepared for the storage.
2340
- */
2341
- storageEntry: T;
2342
- }
2343
- export interface CmsContentEntryStorageOperationsCreateRevisionFromArgs<T extends CmsStorageContentEntry = CmsStorageContentEntry> {
2344
- /**
2345
- * The entry we are creating new one from.
2346
- */
2347
- originalEntry: CmsContentEntry;
2348
- /**
2349
- * The entry we are creating new one from, directly from storage, with transformations on it.
2350
- */
2351
- originalStorageEntry: T;
2352
- /**
2353
- * Latest entry, used to calculate the new version.
2354
- */
2355
- latestEntry: CmsContentEntry;
2356
- /**
2357
- * Latest entry, used to calculate the new version, directly from storage, with transformations.
2358
- */
2359
- latestStorageEntry: T;
2360
- /**
2361
- * Real entry, with no transformations on it.
2362
- */
2363
- entry: CmsContentEntry;
2364
- /**
2365
- * Entry prepared for the storage.
2366
- */
2367
- storageEntry: T;
2368
- }
2369
- export interface CmsContentEntryStorageOperationsUpdateArgs<T extends CmsStorageContentEntry = CmsStorageContentEntry> {
2370
- /**
2371
- * Input received from the user.
2372
- */
2373
- input: Record<string, any>;
2374
- /**
2375
- * Used to compare IDs, versions and passed into storage operations to be used if required.
2376
- */
2377
- originalEntry: CmsContentEntry;
2378
- /**
2379
- * Directly from storage, with transformations on it.
2380
- */
2381
- originalStorageEntry: T;
2382
- /**
2383
- * Real entry, with no transformations on it.
2384
- */
2385
- entry: CmsContentEntry;
2386
- /**
2387
- * Entry prepared for the storage.
2388
- */
2389
- storageEntry: T;
2390
- }
2391
- export interface CmsContentEntryStorageOperationsDeleteRevisionArgs<T extends CmsStorageContentEntry = CmsStorageContentEntry> {
2392
- /**
2393
- * Entry that was deleted.
2394
- */
2395
- entryToDelete: CmsContentEntry;
2396
- /**
2397
- * Entry that was deleted, directly from storage, with transformations.
2398
- */
2399
- storageEntryToDelete: T;
2400
- /**
2401
- * Entry that was set as latest.
2402
- */
2403
- entryToSetAsLatest?: CmsContentEntry;
2404
- /**
2405
- * Entry that was set as latest, directly from storage, with transformations.
2406
- */
2407
- storageEntryToSetAsLatest?: T;
2408
- }
2409
- export interface CmsContentEntryStorageOperationsDeleteArgs<T extends CmsStorageContentEntry = CmsStorageContentEntry> {
2410
- /**
2411
- * Entry that is going to be deleted.
2412
- */
2413
- entry: CmsContentEntry;
2414
- /**
2415
- * Entry that is going to be deleted, directly from storage.
2416
- */
2417
- storageEntry: T;
2418
- }
2419
- export interface CmsContentEntryStorageOperationsPublishArgs<T extends CmsStorageContentEntry = CmsStorageContentEntry> {
2420
- /**
2421
- * The entry record before it was published.
2422
- */
2423
- originalEntry: CmsContentEntry;
2424
- /**
2425
- * Directly from storage, with transformations on it.
2426
- */
2427
- originalStorageEntry: T;
2428
- /**
2429
- * The modified entry that is going to be saved as published.
2430
- * Entry is in its original form.
2431
- */
2432
- entry: CmsContentEntry;
2433
- /**
2434
- * The modified entry and prepared for the storage.
2435
- */
2436
- storageEntry: T;
2437
- }
2438
- export interface CmsContentEntryStorageOperationsUnpublishArgs<T extends CmsStorageContentEntry = CmsStorageContentEntry> {
2439
- /**
2440
- * The entry record before it was unpublished.
2441
- */
2442
- originalEntry: CmsContentEntry;
2443
- /**
2444
- * The entry record before it was unpublished, with transformations on it.
2445
- */
2446
- originalStorageEntry: T;
2447
- /**
2448
- * The modified entry that is going to be saved as unpublished.
2449
- */
2450
- entry: CmsContentEntry;
2451
- /**
2452
- * The modified entry that is going to be saved as unpublished, with transformations on it.
2453
- */
2454
- storageEntry: T;
1969
+ export interface CmsEntryStorageOperationsGetPublishedRevisionParams {
1970
+ id: string;
1971
+ tenant: string;
1972
+ locale: string;
2455
1973
  }
2456
- export interface CmsContentEntryStorageOperationsRequestChangesArgs<T extends CmsStorageContentEntry = CmsStorageContentEntry> {
2457
- /**
2458
- * Entry data updated with the required properties.
2459
- */
2460
- entry: CmsContentEntry;
2461
- /**
2462
- * Entry that is prepared for the storageOperations, with the transformations.
2463
- */
2464
- storageEntry: T;
2465
- /**
2466
- * Original entry from the storage.
2467
- */
2468
- originalEntry: CmsContentEntry;
2469
- /**
2470
- * Original entry to be updated, directly from storage, with the transformations.
2471
- */
2472
- originalStorageEntry: T;
1974
+ export interface CmsEntryStorageOperationsGetLatestRevisionParams {
1975
+ id: string;
1976
+ tenant: string;
1977
+ locale: string;
2473
1978
  }
2474
- export interface CmsContentEntryStorageOperationsRequestReviewArgs<T extends CmsStorageContentEntry = CmsStorageContentEntry> {
2475
- /**
2476
- * Entry that is prepared for the storageOperations.
2477
- */
2478
- entry: CmsContentEntry;
2479
- /**
2480
- * Entry that is prepared for the storageOperations, with the transformations.
2481
- */
2482
- storageEntry: T;
2483
- /**
2484
- * Original entry from the storage.
2485
- */
2486
- originalEntry: CmsContentEntry;
2487
- /**
2488
- * Original entry to be updated, directly from storage, with the transformations.
2489
- */
2490
- originalStorageEntry: T;
1979
+ export interface CmsEntryStorageOperationsGetPreviousRevisionParams {
1980
+ entryId: string;
1981
+ version: number;
1982
+ tenant: string;
1983
+ locale: string;
2491
1984
  }
2492
- export interface CmsContentEntryStorageOperationsListResponse<T extends CmsStorageContentEntry = CmsStorageContentEntry> {
1985
+ export interface CmsEntryStorageOperationsListResponse<T extends CmsStorageEntry = CmsStorageEntry> {
2493
1986
  /**
2494
1987
  * Has more items to load with the current filtering?
2495
1988
  */
@@ -2508,95 +2001,95 @@ export interface CmsContentEntryStorageOperationsListResponse<T extends CmsStora
2508
2001
  totalCount: number;
2509
2002
  }
2510
2003
  /**
2511
- * Description of the ContentModel storage operations.
2004
+ * Description of the CmsModel storage operations.
2512
2005
  * If user wants to add another database to the application, this is how it is done.
2513
2006
  * This is just plain read, update, write, delete and list - no authentication or permission checks.
2514
2007
  *
2515
2008
  *
2516
2009
  * @category StorageOperations
2517
- * @category ContentEntry
2010
+ * @category CmsEntry
2518
2011
  */
2519
- export interface CmsContentEntryStorageOperations<T extends CmsStorageContentEntry = CmsStorageContentEntry> {
2012
+ export interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorageEntry> {
2520
2013
  /**
2521
2014
  * Get all the entries of the ids.
2522
2015
  */
2523
- getByIds: (model: CmsContentModel, ids: readonly string[]) => Promise<T[]>;
2016
+ getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
2524
2017
  /**
2525
2018
  * Get all the published entries of the ids.
2526
2019
  */
2527
- getPublishedByIds: (model: CmsContentModel, ids: readonly string[]) => Promise<T[]>;
2020
+ getPublishedByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
2528
2021
  /**
2529
2022
  * Get all the latest entries of the ids.
2530
2023
  */
2531
- getLatestByIds: (model: CmsContentModel, ids: readonly string[]) => Promise<T[]>;
2024
+ getLatestByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
2532
2025
  /**
2533
2026
  * Get all revisions of the given entry id.
2534
2027
  */
2535
- getRevisions: (model: CmsContentModel, id: string) => Promise<T[]>;
2028
+ getRevisions: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
2536
2029
  /**
2537
2030
  * Get all revisions of all of the given IDs.
2538
2031
  */
2539
- getAllRevisionsByIds: (model: CmsContentModel, ids: readonly string[]) => Promise<T[]>;
2032
+ getAllRevisionsByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetAllRevisionsParams) => Promise<T[]>;
2540
2033
  /**
2541
2034
  * Get the entry by the given revision id.
2542
2035
  */
2543
- getRevisionById: (model: CmsContentModel, id: string) => Promise<T | null>;
2036
+ getRevisionById: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
2544
2037
  /**
2545
2038
  * Get the published entry by given entryId.
2546
2039
  */
2547
- getPublishedRevisionByEntryId: (model: CmsContentModel, entryId: string) => Promise<T | null>;
2040
+ getPublishedRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
2548
2041
  /**
2549
2042
  * Get the latest entry by given entryId.
2550
2043
  */
2551
- getLatestRevisionByEntryId: (model: CmsContentModel, entryId: string) => Promise<T | null>;
2044
+ getLatestRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
2552
2045
  /**
2553
2046
  * Get the revision of the entry before given one.
2554
2047
  */
2555
- getPreviousRevision: (model: CmsContentModel, entryId: string, version: number) => Promise<T | null>;
2048
+ getPreviousRevision: (model: CmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
2556
2049
  /**
2557
- * Gets entry by given args.
2050
+ * Gets entry by given params.
2558
2051
  */
2559
- get: (model: CmsContentModel, args: CmsContentEntryStorageOperationsGetArgs) => Promise<T | null>;
2052
+ get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
2560
2053
  /**
2561
2054
  * List all entries. Filterable via params.
2562
2055
  */
2563
- list: (model: CmsContentModel, args?: CmsContentEntryStorageOperationsListArgs) => Promise<CmsContentEntryStorageOperationsListResponse<T>>;
2056
+ list: (model: CmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
2564
2057
  /**
2565
2058
  * Create a new entry.
2566
2059
  */
2567
- create: (model: CmsContentModel, args: CmsContentEntryStorageOperationsCreateArgs<T>) => Promise<T>;
2060
+ create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
2568
2061
  /**
2569
2062
  * Create a new entry from existing one.
2570
2063
  */
2571
- createRevisionFrom: (model: CmsContentModel, args: CmsContentEntryStorageOperationsCreateRevisionFromArgs<T>) => Promise<T>;
2064
+ createRevisionFrom: (model: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
2572
2065
  /**
2573
2066
  * Update existing entry.
2574
2067
  */
2575
- update: (model: CmsContentModel, args: CmsContentEntryStorageOperationsUpdateArgs<T>) => Promise<T>;
2068
+ update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
2576
2069
  /**
2577
2070
  * Delete the entry revision.
2578
2071
  */
2579
- deleteRevision: (model: CmsContentModel, args: CmsContentEntryStorageOperationsDeleteRevisionArgs<T>) => Promise<void>;
2072
+ deleteRevision: (model: CmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
2580
2073
  /**
2581
2074
  * Delete the entry.
2582
2075
  */
2583
- delete: (model: CmsContentModel, args: CmsContentEntryStorageOperationsDeleteArgs<T>) => Promise<void>;
2076
+ delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams<T>) => Promise<void>;
2584
2077
  /**
2585
2078
  * Publish the entry.
2586
2079
  */
2587
- publish: (model: CmsContentModel, args: CmsContentEntryStorageOperationsPublishArgs<T>) => Promise<T>;
2080
+ publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
2588
2081
  /**
2589
2082
  * Unpublish the entry.
2590
2083
  */
2591
- unpublish: (model: CmsContentModel, args: CmsContentEntryStorageOperationsUnpublishArgs<T>) => Promise<T>;
2084
+ unpublish: (model: CmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
2592
2085
  /**
2593
2086
  * Request changes the entry.
2594
2087
  */
2595
- requestChanges: (model: CmsContentModel, args: CmsContentEntryStorageOperationsRequestChangesArgs<T>) => Promise<T>;
2088
+ requestChanges: (model: CmsModel, params: CmsEntryStorageOperationsRequestChangesParams<T>) => Promise<T>;
2596
2089
  /**
2597
2090
  * Request review the entry.
2598
2091
  */
2599
- requestReview: (model: CmsContentModel, args: CmsContentEntryStorageOperationsRequestReviewArgs<T>) => Promise<CmsContentEntry>;
2092
+ requestReview: (model: CmsModel, params: CmsEntryStorageOperationsRequestReviewParams<T>) => Promise<CmsEntry>;
2600
2093
  }
2601
2094
  export declare enum CONTENT_ENTRY_STATUS {
2602
2095
  DRAFT = "draft",
@@ -2605,60 +2098,77 @@ export declare enum CONTENT_ENTRY_STATUS {
2605
2098
  CHANGES_REQUESTED = "changesRequested",
2606
2099
  REVIEW_REQUESTED = "reviewRequested"
2607
2100
  }
2608
- interface CmsSettingsStorageOperationsProviderArgs {
2609
- context: CmsContext;
2101
+ export interface CmsSettingsStorageOperationsGetParams {
2102
+ locale: string;
2103
+ tenant: string;
2610
2104
  }
2611
- /**
2612
- * A plugin that provides the settings storage operations implementation.
2613
- */
2614
- export interface CmsSettingsStorageOperationsProviderPlugin extends CmsStorageOperationsProvider<CmsSettingsStorageOperationsProviderArgs, CmsSettingsStorageOperations> {
2615
- /**
2616
- * A plugin type.
2617
- */
2618
- type: "cms-settings-storage-operations-provider";
2105
+ export interface CmsSettingsStorageOperationsCreateParams {
2106
+ settings: CmsSettings;
2107
+ }
2108
+ export interface CmsSettingsStorageOperationsUpdateParams {
2109
+ original: CmsSettings;
2110
+ settings: CmsSettings;
2619
2111
  }
2620
2112
  export interface CmsSettingsStorageOperations {
2621
2113
  /**
2622
2114
  * Get the settings from the storage.
2623
2115
  */
2624
- get: () => Promise<CmsSettings | null>;
2116
+ get: (params: CmsSettingsStorageOperationsGetParams) => Promise<CmsSettings | null>;
2625
2117
  /**
2626
2118
  * Create settings in the storage.
2627
2119
  */
2628
- create: (data: CmsSettings) => Promise<void>;
2120
+ create: (params: CmsSettingsStorageOperationsCreateParams) => Promise<CmsSettings>;
2629
2121
  /**
2630
2122
  * Update the settings in the storage.
2631
2123
  */
2632
- update: (data: CmsSettings) => Promise<void>;
2633
- }
2634
- interface CmsSystemStorageOperationsProviderArgs {
2635
- context: CmsContext;
2636
- }
2637
- /**
2638
- * A plugin that provides the system storage operations implementation.
2639
- */
2640
- export interface CmsSystemStorageOperationsProviderPlugin extends CmsStorageOperationsProvider<CmsSystemStorageOperationsProviderArgs, CmsSystemStorageOperations> {
2641
- /**
2642
- * A plugin type.
2643
- */
2644
- type: "cms-system-storage-operations-provider";
2124
+ update: (params: CmsSettingsStorageOperationsUpdateParams) => Promise<CmsSettings>;
2645
2125
  }
2646
2126
  export interface CmsSystem {
2647
2127
  version?: string;
2648
2128
  readAPIKey?: string;
2129
+ /**
2130
+ * System tenant.
2131
+ */
2132
+ tenant: string;
2133
+ }
2134
+ export interface CmsSystemStorageOperationsGetParams {
2135
+ tenant: string;
2136
+ }
2137
+ export interface CmsSystemStorageOperationsCreateParams {
2138
+ system: CmsSystem;
2139
+ }
2140
+ export interface CmsSystemStorageOperationsUpdateParams {
2141
+ system: CmsSystem;
2142
+ original: CmsSystem;
2649
2143
  }
2650
2144
  export interface CmsSystemStorageOperations {
2651
2145
  /**
2652
2146
  * Get the system data.
2653
2147
  */
2654
- get: () => Promise<CmsSystem | null>;
2148
+ get: (params: CmsSystemStorageOperationsGetParams) => Promise<CmsSystem | null>;
2655
2149
  /**
2656
2150
  * Create the system info in the storage.
2657
2151
  */
2658
- create: (data: CmsSystem) => Promise<void>;
2152
+ create: (params: CmsSystemStorageOperationsCreateParams) => Promise<CmsSystem>;
2659
2153
  /**
2660
2154
  * Update the system info in the storage.
2661
2155
  */
2662
- update: (data: CmsSystem) => Promise<void>;
2156
+ update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;
2157
+ }
2158
+ export interface HeadlessCmsStorageOperations {
2159
+ system: CmsSystemStorageOperations;
2160
+ settings: CmsSettingsStorageOperations;
2161
+ groups: CmsGroupStorageOperations;
2162
+ models: CmsModelStorageOperations;
2163
+ entries: CmsEntryStorageOperations;
2164
+ init?: (cms: HeadlessCms) => Promise<void>;
2165
+ /**
2166
+ * Plugins to be attached to the main context.
2167
+ */
2168
+ plugins?: Plugin[] | Plugin[][];
2169
+ /**
2170
+ * An upgrade to run if necessary.
2171
+ */
2172
+ upgrade?: UpgradePlugin | null;
2663
2173
  }
2664
2174
  export {};