@webiny/api-headless-cms 0.0.0-mt-3 → 0.0.0-unstable.40876133bb

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 (570) hide show
  1. package/context.d.ts +3 -0
  2. package/context.js +60 -0
  3. package/context.js.map +1 -0
  4. package/crud/contentEntry/afterDelete.d.ts +8 -0
  5. package/{content/plugins/crud → crud}/contentEntry/afterDelete.js +2 -2
  6. package/crud/contentEntry/afterDelete.js.map +1 -0
  7. package/crud/contentEntry/beforeCreate.d.ts +8 -0
  8. package/{content/plugins/crud → crud}/contentEntry/beforeCreate.js +2 -2
  9. package/crud/contentEntry/beforeCreate.js.map +1 -0
  10. package/crud/contentEntry/beforeUpdate.d.ts +8 -0
  11. package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.js +2 -2
  12. package/crud/contentEntry/beforeUpdate.js.map +1 -0
  13. package/crud/contentEntry/entryDataValidation.d.ts +10 -0
  14. package/{content/plugins/crud → crud}/contentEntry/entryDataValidation.js +23 -11
  15. package/crud/contentEntry/entryDataValidation.js.map +1 -0
  16. package/{content/plugins/crud → crud}/contentEntry/markLockedFields.d.ts +3 -2
  17. package/{content/plugins/crud → crud}/contentEntry/markLockedFields.js +10 -14
  18. package/crud/contentEntry/markLockedFields.js.map +1 -0
  19. package/crud/contentEntry/referenceFieldsMapping.d.ts +13 -0
  20. package/crud/contentEntry/referenceFieldsMapping.js +288 -0
  21. package/crud/contentEntry/referenceFieldsMapping.js.map +1 -0
  22. package/{content/plugins/crud → crud}/contentEntry.crud.d.ts +5 -9
  23. package/crud/contentEntry.crud.js +1255 -0
  24. package/crud/contentEntry.crud.js.map +1 -0
  25. package/crud/contentModel/afterCreate.d.ts +8 -0
  26. package/crud/contentModel/afterCreate.js +18 -0
  27. package/crud/contentModel/afterCreate.js.map +1 -0
  28. package/crud/contentModel/afterCreateFrom.d.ts +8 -0
  29. package/crud/contentModel/afterCreateFrom.js +18 -0
  30. package/crud/contentModel/afterCreateFrom.js.map +1 -0
  31. package/crud/contentModel/afterDelete.d.ts +8 -0
  32. package/crud/contentModel/afterDelete.js +18 -0
  33. package/crud/contentModel/afterDelete.js.map +1 -0
  34. package/crud/contentModel/afterUpdate.d.ts +8 -0
  35. package/crud/contentModel/afterUpdate.js +18 -0
  36. package/crud/contentModel/afterUpdate.js.map +1 -0
  37. package/crud/contentModel/beforeCreate.d.ts +15 -0
  38. package/{content/plugins/crud → crud}/contentModel/beforeCreate.js +61 -13
  39. package/crud/contentModel/beforeCreate.js.map +1 -0
  40. package/crud/contentModel/beforeDelete.d.ts +10 -0
  41. package/{content/plugins/crud → crud}/contentModel/beforeDelete.js +14 -10
  42. package/crud/contentModel/beforeDelete.js.map +1 -0
  43. package/crud/contentModel/beforeUpdate.d.ts +10 -0
  44. package/crud/contentModel/beforeUpdate.js +37 -0
  45. package/crud/contentModel/beforeUpdate.js.map +1 -0
  46. package/crud/contentModel/contentModelManagerFactory.d.ts +2 -0
  47. package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.js +0 -0
  48. package/crud/contentModel/contentModelManagerFactory.js.map +1 -0
  49. package/crud/contentModel/createFieldModels.d.ts +2 -0
  50. package/{content/plugins/crud → crud}/contentModel/createFieldModels.js +6 -2
  51. package/crud/contentModel/createFieldModels.js.map +1 -0
  52. package/crud/contentModel/createFieldStorageId.d.ts +2 -0
  53. package/crud/contentModel/createFieldStorageId.js +16 -0
  54. package/crud/contentModel/createFieldStorageId.js.map +1 -0
  55. package/crud/contentModel/fieldIdValidation.d.ts +1 -0
  56. package/crud/contentModel/fieldIdValidation.js +25 -0
  57. package/crud/contentModel/fieldIdValidation.js.map +1 -0
  58. package/crud/contentModel/idValidation.d.ts +1 -0
  59. package/{content/plugins/crud → crud}/contentModel/idValidation.js +3 -3
  60. package/crud/contentModel/idValidation.js.map +1 -0
  61. package/{content/plugins/crud → crud}/contentModel/models.d.ts +2 -1
  62. package/{content/plugins/crud → crud}/contentModel/models.js +64 -25
  63. package/crud/contentModel/models.js.map +1 -0
  64. package/crud/contentModel/systemFields.d.ts +1 -0
  65. package/crud/contentModel/systemFields.js +8 -0
  66. package/crud/contentModel/systemFields.js.map +1 -0
  67. package/crud/contentModel/validateLayout.d.ts +2 -0
  68. package/{content/plugins/crud → crud}/contentModel/validateLayout.js +1 -3
  69. package/crud/contentModel/validateLayout.js.map +1 -0
  70. package/crud/contentModel/validateModel.d.ts +9 -0
  71. package/crud/contentModel/validateModel.js +32 -0
  72. package/crud/contentModel/validateModel.js.map +1 -0
  73. package/crud/contentModel/validateModelFields.d.ts +9 -0
  74. package/crud/contentModel/validateModelFields.js +359 -0
  75. package/crud/contentModel/validateModelFields.js.map +1 -0
  76. package/{content/plugins/crud → crud}/contentModel.crud.d.ts +3 -3
  77. package/crud/contentModel.crud.js +605 -0
  78. package/crud/contentModel.crud.js.map +1 -0
  79. package/crud/contentModelGroup/beforeCreate.d.ts +10 -0
  80. package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.js +9 -9
  81. package/crud/contentModelGroup/beforeCreate.js.map +1 -0
  82. package/crud/contentModelGroup/beforeDelete.d.ts +10 -0
  83. package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.js +4 -4
  84. package/crud/contentModelGroup/beforeDelete.js.map +1 -0
  85. package/crud/contentModelGroup/beforeUpdate.d.ts +9 -0
  86. package/{content/plugins/crud → crud}/contentModelGroup/beforeUpdate.js +3 -3
  87. package/crud/contentModelGroup/beforeUpdate.js.map +1 -0
  88. package/{content/plugins/crud → crud}/contentModelGroup.crud.d.ts +3 -3
  89. package/{content/plugins/crud → crud}/contentModelGroup.crud.js +108 -93
  90. package/crud/contentModelGroup.crud.js.map +1 -0
  91. package/crud/index.d.ts +6 -0
  92. package/crud/index.js +85 -0
  93. package/crud/index.js.map +1 -0
  94. package/{plugins/crud → crud}/settings.crud.d.ts +3 -3
  95. package/crud/settings.crud.js +83 -0
  96. package/crud/settings.crud.js.map +1 -0
  97. package/{plugins/crud → crud}/system.crud.d.ts +6 -3
  98. package/crud/system.crud.js +221 -0
  99. package/crud/system.crud.js.map +1 -0
  100. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.d.ts +7 -0
  101. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +66 -0
  102. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -0
  103. package/fieldConverters/CmsModelObjectFieldConverterPlugin.d.ts +11 -0
  104. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +304 -0
  105. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -0
  106. package/fieldConverters/index.d.ts +3 -0
  107. package/fieldConverters/index.js +16 -0
  108. package/fieldConverters/index.js.map +1 -0
  109. package/{content/plugins → graphql}/buildSchemaPlugins.d.ts +2 -3
  110. package/graphql/buildSchemaPlugins.js +27 -0
  111. package/graphql/buildSchemaPlugins.js.map +1 -0
  112. package/graphql/graphQLHandlerFactory.d.ts +5 -0
  113. package/graphql/graphQLHandlerFactory.js +158 -0
  114. package/graphql/graphQLHandlerFactory.js.map +1 -0
  115. package/graphql/index.d.ts +5 -0
  116. package/graphql/index.js +57 -0
  117. package/graphql/index.js.map +1 -0
  118. package/graphql/schema/baseContentSchema.d.ts +3 -0
  119. package/graphql/schema/baseContentSchema.js +76 -0
  120. package/graphql/schema/baseContentSchema.js.map +1 -0
  121. package/graphql/schema/contentEntries.d.ts +3 -0
  122. package/graphql/schema/contentEntries.js +351 -0
  123. package/graphql/schema/contentEntries.js.map +1 -0
  124. package/graphql/schema/contentModelGroups.d.ts +3 -0
  125. package/{content/plugins → graphql}/schema/contentModelGroups.js +34 -15
  126. package/graphql/schema/contentModelGroups.js.map +1 -0
  127. package/graphql/schema/contentModels.d.ts +3 -0
  128. package/{content/plugins → graphql}/schema/contentModels.js +66 -10
  129. package/graphql/schema/contentModels.js.map +1 -0
  130. package/graphql/schema/createFieldResolvers.d.ts +20 -0
  131. package/{content/plugins → graphql}/schema/createFieldResolvers.js +48 -23
  132. package/graphql/schema/createFieldResolvers.js.map +1 -0
  133. package/graphql/schema/createManageResolvers.d.ts +12 -0
  134. package/{content/plugins → graphql}/schema/createManageResolvers.js +36 -34
  135. package/graphql/schema/createManageResolvers.js.map +1 -0
  136. package/graphql/schema/createManageSDL.d.ts +10 -0
  137. package/{content/plugins → graphql}/schema/createManageSDL.js +23 -16
  138. package/graphql/schema/createManageSDL.js.map +1 -0
  139. package/graphql/schema/createPreviewResolvers.d.ts +12 -0
  140. package/graphql/schema/createPreviewResolvers.js +58 -0
  141. package/graphql/schema/createPreviewResolvers.js.map +1 -0
  142. package/graphql/schema/createReadResolvers.d.ts +12 -0
  143. package/graphql/schema/createReadResolvers.js +58 -0
  144. package/graphql/schema/createReadResolvers.js.map +1 -0
  145. package/graphql/schema/createReadSDL.d.ts +10 -0
  146. package/{content/plugins → graphql}/schema/createReadSDL.js +14 -8
  147. package/graphql/schema/createReadSDL.js.map +1 -0
  148. package/graphql/schema/resolvers/commonFieldResolvers.d.ts +6 -0
  149. package/{content/plugins → graphql}/schema/resolvers/commonFieldResolvers.js +0 -0
  150. package/graphql/schema/resolvers/commonFieldResolvers.js.map +1 -0
  151. package/graphql/schema/resolvers/manage/resolveCreate.d.ts +7 -0
  152. package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.js +2 -4
  153. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -0
  154. package/graphql/schema/resolvers/manage/resolveCreateFrom.d.ts +8 -0
  155. package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.js +2 -4
  156. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -0
  157. package/graphql/schema/resolvers/manage/resolveDelete.d.ts +7 -0
  158. package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.js +10 -8
  159. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -0
  160. package/graphql/schema/resolvers/manage/resolveGet.d.ts +7 -0
  161. package/graphql/schema/resolvers/manage/resolveGet.js +79 -0
  162. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -0
  163. package/graphql/schema/resolvers/manage/resolveGetByIds.d.ts +7 -0
  164. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.js +2 -4
  165. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -0
  166. package/graphql/schema/resolvers/manage/resolveGetRevisions.d.ts +7 -0
  167. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.js +2 -4
  168. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -0
  169. package/graphql/schema/resolvers/manage/resolveList.d.ts +4 -0
  170. package/{content/plugins/schema/resolvers/read → graphql/schema/resolvers/manage}/resolveList.js +2 -4
  171. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -0
  172. package/graphql/schema/resolvers/manage/resolvePublish.d.ts +7 -0
  173. package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.js +0 -0
  174. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -0
  175. package/graphql/schema/resolvers/manage/resolveRepublish.d.ts +7 -0
  176. package/{content/plugins/schema/resolvers/manage/resolveGet.js → graphql/schema/resolvers/manage/resolveRepublish.js} +4 -4
  177. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -0
  178. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.d.ts +4 -3
  179. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.js +2 -4
  180. package/graphql/schema/resolvers/manage/resolveRequestChanges.js.map +1 -0
  181. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.d.ts +4 -3
  182. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.js +2 -4
  183. package/graphql/schema/resolvers/manage/resolveRequestReview.js.map +1 -0
  184. package/graphql/schema/resolvers/manage/resolveUnpublish.d.ts +7 -0
  185. package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.js +0 -0
  186. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -0
  187. package/graphql/schema/resolvers/manage/resolveUpdate.d.ts +8 -0
  188. package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.js +2 -4
  189. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -0
  190. package/graphql/schema/resolvers/preview/resolveGet.d.ts +4 -0
  191. package/graphql/schema/resolvers/preview/resolveGet.js +34 -0
  192. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -0
  193. package/graphql/schema/resolvers/preview/resolveList.d.ts +4 -0
  194. package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.js +2 -4
  195. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -0
  196. package/graphql/schema/resolvers/read/resolveGet.d.ts +4 -0
  197. package/graphql/schema/resolvers/read/resolveGet.js +34 -0
  198. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -0
  199. package/graphql/schema/resolvers/read/resolveList.d.ts +4 -0
  200. package/{content/plugins/schema/resolvers/manage → graphql/schema/resolvers/read}/resolveList.js +2 -4
  201. package/graphql/schema/resolvers/read/resolveList.js.map +1 -0
  202. package/{content/plugins → graphql}/schema/schemaPlugins.d.ts +1 -1
  203. package/{content/plugins → graphql}/schema/schemaPlugins.js +25 -6
  204. package/graphql/schema/schemaPlugins.js.map +1 -0
  205. package/graphql/system.d.ts +6 -0
  206. package/graphql/system.js +119 -0
  207. package/graphql/system.js.map +1 -0
  208. package/graphqlFields/boolean.d.ts +2 -0
  209. package/graphqlFields/boolean.js +69 -0
  210. package/graphqlFields/boolean.js.map +1 -0
  211. package/graphqlFields/datetime.d.ts +2 -0
  212. package/graphqlFields/datetime.js +95 -0
  213. package/graphqlFields/datetime.js.map +1 -0
  214. package/graphqlFields/file.d.ts +2 -0
  215. package/graphqlFields/file.js +50 -0
  216. package/graphqlFields/file.js.map +1 -0
  217. package/graphqlFields/helpers.d.ts +6 -0
  218. package/graphqlFields/helpers.js +49 -0
  219. package/graphqlFields/helpers.js.map +1 -0
  220. package/graphqlFields/index.d.ts +2 -0
  221. package/graphqlFields/index.js +28 -0
  222. package/graphqlFields/index.js.map +1 -0
  223. package/graphqlFields/longText.d.ts +2 -0
  224. package/graphqlFields/longText.js +63 -0
  225. package/graphqlFields/longText.js.map +1 -0
  226. package/graphqlFields/number.d.ts +2 -0
  227. package/graphqlFields/number.js +75 -0
  228. package/graphqlFields/number.js.map +1 -0
  229. package/graphqlFields/object.d.ts +2 -0
  230. package/graphqlFields/object.js +225 -0
  231. package/graphqlFields/object.js.map +1 -0
  232. package/graphqlFields/ref.d.ts +2 -0
  233. package/graphqlFields/ref.js +275 -0
  234. package/graphqlFields/ref.js.map +1 -0
  235. package/graphqlFields/richText.d.ts +2 -0
  236. package/graphqlFields/richText.js +56 -0
  237. package/graphqlFields/richText.js.map +1 -0
  238. package/graphqlFields/text.d.ts +2 -0
  239. package/graphqlFields/text.js +73 -0
  240. package/graphqlFields/text.js.map +1 -0
  241. package/index.d.ts +10 -12
  242. package/index.js +80 -37
  243. package/index.js.map +1 -0
  244. package/modelManager/DefaultCmsModelManager.d.ts +14 -0
  245. package/{content/plugins/modelManager → modelManager}/DefaultCmsModelManager.js +12 -10
  246. package/modelManager/DefaultCmsModelManager.js.map +1 -0
  247. package/modelManager/index.d.ts +2 -0
  248. package/{content/plugins/modelManager → modelManager}/index.js +3 -3
  249. package/modelManager/index.js.map +1 -0
  250. package/package.json +36 -36
  251. package/parameters/context.d.ts +2 -0
  252. package/parameters/context.js +22 -0
  253. package/parameters/context.js.map +1 -0
  254. package/parameters/header.d.ts +2 -0
  255. package/parameters/header.js +55 -0
  256. package/parameters/header.js.map +1 -0
  257. package/parameters/index.d.ts +4 -0
  258. package/parameters/index.js +57 -0
  259. package/parameters/index.js.map +1 -0
  260. package/parameters/manual.d.ts +6 -0
  261. package/parameters/manual.js +44 -0
  262. package/parameters/manual.js.map +1 -0
  263. package/parameters/path.d.ts +2 -0
  264. package/parameters/path.js +51 -0
  265. package/parameters/path.js.map +1 -0
  266. package/plugins/CmsGroupPlugin.d.ts +13 -0
  267. package/{content/plugins → plugins}/CmsGroupPlugin.js +9 -3
  268. package/plugins/CmsGroupPlugin.js.map +1 -0
  269. package/plugins/CmsModelFieldConverterPlugin.d.ts +14 -0
  270. package/plugins/CmsModelFieldConverterPlugin.js +17 -0
  271. package/plugins/CmsModelFieldConverterPlugin.js.map +1 -0
  272. package/plugins/CmsModelPlugin.d.ts +45 -0
  273. package/plugins/CmsModelPlugin.js +194 -0
  274. package/plugins/CmsModelPlugin.js.map +1 -0
  275. package/plugins/CmsParametersPlugin.d.ts +20 -0
  276. package/plugins/CmsParametersPlugin.js +28 -0
  277. package/plugins/CmsParametersPlugin.js.map +1 -0
  278. package/{content/plugins/storage → plugins}/StorageTransformPlugin.d.ts +4 -3
  279. package/{content/plugins/storage → plugins}/StorageTransformPlugin.js +2 -1
  280. package/plugins/StorageTransformPlugin.js.map +1 -0
  281. package/plugins/index.d.ts +5 -0
  282. package/plugins/index.js +70 -0
  283. package/plugins/index.js.map +1 -0
  284. package/storage/default.d.ts +2 -0
  285. package/storage/default.js +27 -0
  286. package/storage/default.js.map +1 -0
  287. package/storage/object.d.ts +2 -0
  288. package/storage/object.js +124 -0
  289. package/storage/object.js.map +1 -0
  290. package/types.d.ts +657 -349
  291. package/types.js +52 -2
  292. package/types.js.map +1 -0
  293. package/upgrades/5.33.0/index.d.ts +3 -0
  294. package/upgrades/5.33.0/index.js +182 -0
  295. package/upgrades/5.33.0/index.js.map +1 -0
  296. package/upgrades/index.d.ts +1 -0
  297. package/upgrades/index.js +12 -0
  298. package/upgrades/index.js.map +1 -0
  299. package/utils/access.d.ts +8 -0
  300. package/utils/access.js +90 -0
  301. package/utils/access.js.map +1 -0
  302. package/utils/converters/Converter.d.ts +27 -0
  303. package/utils/converters/Converter.js +71 -0
  304. package/utils/converters/Converter.js.map +1 -0
  305. package/utils/converters/ConverterCollection.d.ts +31 -0
  306. package/utils/converters/ConverterCollection.js +139 -0
  307. package/utils/converters/ConverterCollection.js.map +1 -0
  308. package/utils/converters/valueKeyStorageConverter.d.ts +18 -0
  309. package/utils/converters/valueKeyStorageConverter.js +148 -0
  310. package/utils/converters/valueKeyStorageConverter.js.map +1 -0
  311. package/{content/plugins/utils → utils}/createTypeName.d.ts +3 -3
  312. package/{content/plugins/utils → utils}/createTypeName.js +1 -1
  313. package/utils/createTypeName.js.map +1 -0
  314. package/{content/plugins/utils → utils}/entryStorage.d.ts +3 -3
  315. package/{content/plugins/utils → utils}/entryStorage.js +4 -12
  316. package/utils/entryStorage.js.map +1 -0
  317. package/utils/filterAsync.d.ts +1 -0
  318. package/utils/filterAsync.js +23 -0
  319. package/utils/filterAsync.js.map +1 -0
  320. package/utils/filterModelFields.d.ts +16 -0
  321. package/utils/filterModelFields.js +77 -0
  322. package/utils/filterModelFields.js.map +1 -0
  323. package/utils/getEntryTitle.d.ts +2 -0
  324. package/{content/plugins/utils → utils}/getEntryTitle.js +7 -6
  325. package/utils/getEntryTitle.js.map +1 -0
  326. package/utils/getSchemaFromFieldPlugins.d.ts +12 -0
  327. package/utils/getSchemaFromFieldPlugins.js +35 -0
  328. package/utils/getSchemaFromFieldPlugins.js.map +1 -0
  329. package/utils/ownership.d.ts +8 -0
  330. package/utils/ownership.js +41 -0
  331. package/utils/ownership.js.map +1 -0
  332. package/utils/permissions.d.ts +7 -0
  333. package/utils/permissions.js +106 -0
  334. package/utils/permissions.js.map +1 -0
  335. package/utils/pluralizedTypeName.d.ts +1 -0
  336. package/{content/plugins/utils → utils}/pluralizedTypeName.js +1 -1
  337. package/utils/pluralizedTypeName.js.map +1 -0
  338. package/utils/renderFields.d.ts +15 -0
  339. package/{content/plugins/utils → utils}/renderFields.js +4 -2
  340. package/utils/renderFields.js.map +1 -0
  341. package/utils/renderGetFilterFields.d.ts +10 -0
  342. package/{content/plugins/utils → utils}/renderGetFilterFields.js +28 -13
  343. package/utils/renderGetFilterFields.js.map +1 -0
  344. package/utils/renderInputFields.d.ts +14 -0
  345. package/{content/plugins/utils → utils}/renderInputFields.js +1 -1
  346. package/utils/renderInputFields.js.map +1 -0
  347. package/utils/renderListFilterFields.d.ts +11 -0
  348. package/{content/plugins/utils → utils}/renderListFilterFields.js +37 -17
  349. package/utils/renderListFilterFields.js.map +1 -0
  350. package/{content/plugins/utils → utils}/renderSortEnum.d.ts +1 -1
  351. package/utils/renderSortEnum.js +32 -0
  352. package/utils/renderSortEnum.js.map +1 -0
  353. package/utils/toSlug.d.ts +1 -0
  354. package/utils/toSlug.js +20 -0
  355. package/utils/toSlug.js.map +1 -0
  356. package/validators/dateGte.d.ts +2 -0
  357. package/{content/plugins/validators → validators}/dateGte.js +4 -4
  358. package/validators/dateGte.js.map +1 -0
  359. package/validators/dateLte.d.ts +2 -0
  360. package/{content/plugins/validators → validators}/dateLte.js +4 -4
  361. package/validators/dateLte.js.map +1 -0
  362. package/validators/gte.d.ts +2 -0
  363. package/validators/gte.js +36 -0
  364. package/validators/gte.js.map +1 -0
  365. package/validators/in.d.ts +2 -0
  366. package/validators/in.js +36 -0
  367. package/validators/in.js.map +1 -0
  368. package/validators/index.d.ts +1 -0
  369. package/validators/index.js +36 -0
  370. package/validators/index.js.map +1 -0
  371. package/validators/lte.d.ts +2 -0
  372. package/validators/lte.js +36 -0
  373. package/validators/lte.js.map +1 -0
  374. package/validators/maxLength.d.ts +2 -0
  375. package/validators/maxLength.js +36 -0
  376. package/validators/maxLength.js.map +1 -0
  377. package/validators/minLength.d.ts +2 -0
  378. package/validators/minLength.js +36 -0
  379. package/validators/minLength.js.map +1 -0
  380. package/validators/pattern.d.ts +2 -0
  381. package/validators/pattern.js +50 -0
  382. package/validators/pattern.js.map +1 -0
  383. package/validators/patternPlugins/email.d.ts +2 -0
  384. package/validators/patternPlugins/email.js +20 -0
  385. package/validators/patternPlugins/email.js.map +1 -0
  386. package/validators/patternPlugins/index.d.ts +2 -0
  387. package/validators/patternPlugins/index.js +24 -0
  388. package/validators/patternPlugins/index.js.map +1 -0
  389. package/validators/patternPlugins/lowerCase.d.ts +2 -0
  390. package/validators/patternPlugins/lowerCase.js +20 -0
  391. package/validators/patternPlugins/lowerCase.js.map +1 -0
  392. package/validators/patternPlugins/lowerCaseSpace.d.ts +2 -0
  393. package/validators/patternPlugins/lowerCaseSpace.js +20 -0
  394. package/validators/patternPlugins/lowerCaseSpace.js.map +1 -0
  395. package/validators/patternPlugins/upperCase.d.ts +2 -0
  396. package/validators/patternPlugins/upperCase.js +20 -0
  397. package/validators/patternPlugins/upperCase.js.map +1 -0
  398. package/validators/patternPlugins/upperCaseSpace.d.ts +2 -0
  399. package/validators/patternPlugins/upperCaseSpace.js +20 -0
  400. package/validators/patternPlugins/upperCaseSpace.js.map +1 -0
  401. package/validators/patternPlugins/url.d.ts +2 -0
  402. package/validators/patternPlugins/url.js +20 -0
  403. package/validators/patternPlugins/url.js.map +1 -0
  404. package/validators/required.d.ts +2 -0
  405. package/validators/required.js +27 -0
  406. package/validators/required.js.map +1 -0
  407. package/validators/timeGte.d.ts +2 -0
  408. package/{content/plugins/validators → validators}/timeGte.js +6 -4
  409. package/validators/timeGte.js.map +1 -0
  410. package/validators/timeLte.d.ts +2 -0
  411. package/{content/plugins/validators → validators}/timeLte.js +6 -4
  412. package/validators/timeLte.js.map +1 -0
  413. package/validators/unique.d.ts +6 -0
  414. package/validators/unique.js +63 -0
  415. package/validators/unique.js.map +1 -0
  416. package/content/contextSetup.d.ts +0 -4
  417. package/content/contextSetup.js +0 -65
  418. package/content/graphQLHandlerFactory.d.ts +0 -5
  419. package/content/graphQLHandlerFactory.js +0 -173
  420. package/content/plugins/CmsGroupPlugin.d.ts +0 -11
  421. package/content/plugins/CmsModelPlugin.d.ts +0 -11
  422. package/content/plugins/CmsModelPlugin.js +0 -24
  423. package/content/plugins/buildSchemaPlugins.js +0 -29
  424. package/content/plugins/crud/contentEntry/afterDelete.d.ts +0 -7
  425. package/content/plugins/crud/contentEntry/beforeCreate.d.ts +0 -7
  426. package/content/plugins/crud/contentEntry/beforeUpdate.d.ts +0 -7
  427. package/content/plugins/crud/contentEntry/entryDataValidation.d.ts +0 -4
  428. package/content/plugins/crud/contentEntry.crud.js +0 -931
  429. package/content/plugins/crud/contentModel/afterCreate.d.ts +0 -7
  430. package/content/plugins/crud/contentModel/afterCreate.js +0 -18
  431. package/content/plugins/crud/contentModel/afterDelete.d.ts +0 -7
  432. package/content/plugins/crud/contentModel/afterDelete.js +0 -18
  433. package/content/plugins/crud/contentModel/afterUpdate.d.ts +0 -7
  434. package/content/plugins/crud/contentModel/afterUpdate.js +0 -18
  435. package/content/plugins/crud/contentModel/beforeCreate.d.ts +0 -9
  436. package/content/plugins/crud/contentModel/beforeDelete.d.ts +0 -9
  437. package/content/plugins/crud/contentModel/beforeUpdate.d.ts +0 -9
  438. package/content/plugins/crud/contentModel/beforeUpdate.js +0 -128
  439. package/content/plugins/crud/contentModel/contentModelManagerFactory.d.ts +0 -2
  440. package/content/plugins/crud/contentModel/createFieldModels.d.ts +0 -2
  441. package/content/plugins/crud/contentModel/idValidation.d.ts +0 -2
  442. package/content/plugins/crud/contentModel/validateLayout.d.ts +0 -2
  443. package/content/plugins/crud/contentModel.crud.js +0 -425
  444. package/content/plugins/crud/contentModelGroup/beforeCreate.d.ts +0 -9
  445. package/content/plugins/crud/contentModelGroup/beforeDelete.d.ts +0 -9
  446. package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +0 -8
  447. package/content/plugins/crud/index.d.ts +0 -6
  448. package/content/plugins/crud/index.js +0 -100
  449. package/content/plugins/graphqlFields/boolean.d.ts +0 -3
  450. package/content/plugins/graphqlFields/boolean.js +0 -69
  451. package/content/plugins/graphqlFields/datetime.d.ts +0 -3
  452. package/content/plugins/graphqlFields/datetime.js +0 -83
  453. package/content/plugins/graphqlFields/file.d.ts +0 -3
  454. package/content/plugins/graphqlFields/file.js +0 -49
  455. package/content/plugins/graphqlFields/index.d.ts +0 -2
  456. package/content/plugins/graphqlFields/index.js +0 -30
  457. package/content/plugins/graphqlFields/longText.d.ts +0 -3
  458. package/content/plugins/graphqlFields/longText.js +0 -62
  459. package/content/plugins/graphqlFields/number.d.ts +0 -3
  460. package/content/plugins/graphqlFields/number.js +0 -75
  461. package/content/plugins/graphqlFields/object.d.ts +0 -3
  462. package/content/plugins/graphqlFields/object.js +0 -180
  463. package/content/plugins/graphqlFields/ref.d.ts +0 -3
  464. package/content/plugins/graphqlFields/ref.js +0 -205
  465. package/content/plugins/graphqlFields/richText.d.ts +0 -3
  466. package/content/plugins/graphqlFields/richText.js +0 -55
  467. package/content/plugins/graphqlFields/text.d.ts +0 -3
  468. package/content/plugins/graphqlFields/text.js +0 -72
  469. package/content/plugins/internalSecurity/InternalAuthenticationPlugin.d.ts +0 -8
  470. package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +0 -54
  471. package/content/plugins/internalSecurity/InternalAuthorizationPlugin.d.ts +0 -7
  472. package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +0 -35
  473. package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +0 -15
  474. package/content/plugins/modelManager/index.d.ts +0 -3
  475. package/content/plugins/schema/baseSchema.d.ts +0 -4
  476. package/content/plugins/schema/baseSchema.js +0 -98
  477. package/content/plugins/schema/contentEntries.d.ts +0 -4
  478. package/content/plugins/schema/contentEntries.js +0 -166
  479. package/content/plugins/schema/contentModelGroups.d.ts +0 -4
  480. package/content/plugins/schema/contentModels.d.ts +0 -4
  481. package/content/plugins/schema/createFieldResolvers.d.ts +0 -19
  482. package/content/plugins/schema/createManageResolvers.d.ts +0 -11
  483. package/content/plugins/schema/createManageSDL.d.ts +0 -9
  484. package/content/plugins/schema/createPreviewResolvers.d.ts +0 -10
  485. package/content/plugins/schema/createPreviewResolvers.js +0 -55
  486. package/content/plugins/schema/createReadResolvers.d.ts +0 -10
  487. package/content/plugins/schema/createReadResolvers.js +0 -55
  488. package/content/plugins/schema/createReadSDL.d.ts +0 -9
  489. package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +0 -6
  490. package/content/plugins/schema/resolvers/manage/resolveCreate.d.ts +0 -6
  491. package/content/plugins/schema/resolvers/manage/resolveCreateFrom.d.ts +0 -7
  492. package/content/plugins/schema/resolvers/manage/resolveDelete.d.ts +0 -2
  493. package/content/plugins/schema/resolvers/manage/resolveGet.d.ts +0 -2
  494. package/content/plugins/schema/resolvers/manage/resolveGetByIds.d.ts +0 -2
  495. package/content/plugins/schema/resolvers/manage/resolveGetRevisions.d.ts +0 -2
  496. package/content/plugins/schema/resolvers/manage/resolveList.d.ts +0 -2
  497. package/content/plugins/schema/resolvers/manage/resolvePublish.d.ts +0 -2
  498. package/content/plugins/schema/resolvers/manage/resolveUnpublish.d.ts +0 -2
  499. package/content/plugins/schema/resolvers/manage/resolveUpdate.d.ts +0 -7
  500. package/content/plugins/schema/resolvers/preview/resolveGet.d.ts +0 -2
  501. package/content/plugins/schema/resolvers/preview/resolveGet.js +0 -38
  502. package/content/plugins/schema/resolvers/preview/resolveList.d.ts +0 -2
  503. package/content/plugins/schema/resolvers/read/resolveGet.d.ts +0 -2
  504. package/content/plugins/schema/resolvers/read/resolveGet.js +0 -38
  505. package/content/plugins/schema/resolvers/read/resolveList.d.ts +0 -2
  506. package/content/plugins/storage/default.d.ts +0 -3
  507. package/content/plugins/storage/default.js +0 -28
  508. package/content/plugins/storage/object.d.ts +0 -3
  509. package/content/plugins/storage/object.js +0 -119
  510. package/content/plugins/utils/getEntryTitle.d.ts +0 -2
  511. package/content/plugins/utils/getSchemaFromFieldPlugins.d.ts +0 -11
  512. package/content/plugins/utils/getSchemaFromFieldPlugins.js +0 -30
  513. package/content/plugins/utils/pluralizedTypeName.d.ts +0 -1
  514. package/content/plugins/utils/renderFields.d.ts +0 -16
  515. package/content/plugins/utils/renderGetFilterFields.d.ts +0 -9
  516. package/content/plugins/utils/renderInputFields.d.ts +0 -14
  517. package/content/plugins/utils/renderListFilterFields.d.ts +0 -10
  518. package/content/plugins/utils/renderSortEnum.js +0 -32
  519. package/content/plugins/validators/dateGte.d.ts +0 -3
  520. package/content/plugins/validators/dateLte.d.ts +0 -3
  521. package/content/plugins/validators/gte.d.ts +0 -3
  522. package/content/plugins/validators/gte.js +0 -32
  523. package/content/plugins/validators/in.d.ts +0 -3
  524. package/content/plugins/validators/in.js +0 -32
  525. package/content/plugins/validators/index.d.ts +0 -2
  526. package/content/plugins/validators/index.js +0 -36
  527. package/content/plugins/validators/lte.d.ts +0 -3
  528. package/content/plugins/validators/lte.js +0 -32
  529. package/content/plugins/validators/maxLength.d.ts +0 -3
  530. package/content/plugins/validators/maxLength.js +0 -32
  531. package/content/plugins/validators/minLength.d.ts +0 -3
  532. package/content/plugins/validators/minLength.js +0 -32
  533. package/content/plugins/validators/pattern.d.ts +0 -3
  534. package/content/plugins/validators/pattern.js +0 -47
  535. package/content/plugins/validators/patternPlugins/email.d.ts +0 -3
  536. package/content/plugins/validators/patternPlugins/email.js +0 -17
  537. package/content/plugins/validators/patternPlugins/index.d.ts +0 -2
  538. package/content/plugins/validators/patternPlugins/index.js +0 -19
  539. package/content/plugins/validators/patternPlugins/lowerCase.d.ts +0 -3
  540. package/content/plugins/validators/patternPlugins/lowerCase.js +0 -17
  541. package/content/plugins/validators/patternPlugins/upperCase.d.ts +0 -3
  542. package/content/plugins/validators/patternPlugins/upperCase.js +0 -17
  543. package/content/plugins/validators/patternPlugins/url.d.ts +0 -3
  544. package/content/plugins/validators/patternPlugins/url.js +0 -17
  545. package/content/plugins/validators/required.d.ts +0 -3
  546. package/content/plugins/validators/required.js +0 -25
  547. package/content/plugins/validators/timeGte.d.ts +0 -3
  548. package/content/plugins/validators/timeLte.d.ts +0 -3
  549. package/migrateCMSPermissions.d.ts +0 -17
  550. package/migrateCMSPermissions.js +0 -193
  551. package/plugins/context.d.ts +0 -4
  552. package/plugins/context.js +0 -34
  553. package/plugins/crud/index.d.ts +0 -6
  554. package/plugins/crud/index.js +0 -100
  555. package/plugins/crud/settings.crud.js +0 -93
  556. package/plugins/crud/system.crud.js +0 -182
  557. package/plugins/graphql/system.d.ts +0 -17
  558. package/plugins/graphql/system.js +0 -72
  559. package/plugins/graphql.d.ts +0 -2
  560. package/plugins/graphql.js +0 -79
  561. package/plugins/upgrades/index.d.ts +0 -2
  562. package/plugins/upgrades/index.js +0 -14
  563. package/plugins/upgrades/v5.5.0/helpers.d.ts +0 -6
  564. package/plugins/upgrades/v5.5.0/helpers.js +0 -10
  565. package/plugins/upgrades/v5.5.0/index.d.ts +0 -4
  566. package/plugins/upgrades/v5.5.0/index.js +0 -129
  567. package/transformers.d.ts +0 -2
  568. package/transformers.js +0 -25
  569. package/utils.d.ts +0 -25
  570. package/utils.js +0 -251
package/types.d.ts CHANGED
@@ -1,20 +1,19 @@
1
1
  import { Plugin } from "@webiny/plugins/types";
2
2
  import { I18NContext, I18NLocale } from "@webiny/api-i18n/types";
3
- import { ContextInterface } from "@webiny/handler/types";
4
- import { TenancyContext } from "@webiny/api-tenancy/types";
3
+ import { Context } from "@webiny/api/types";
5
4
  import { GraphQLFieldResolver, GraphQLSchemaDefinition, Resolvers } from "@webiny/handler-graphql/types";
6
- import { BaseI18NContentContext } from "@webiny/api-i18n-content/types";
7
5
  import { SecurityPermission } from "@webiny/api-security/types";
8
- import { HttpContext } from "@webiny/handler-http/types";
9
6
  import { DbContext } from "@webiny/handler-db/types";
10
7
  import { FileManagerContext } from "@webiny/api-file-manager/types";
11
8
  import { UpgradePlugin } from "@webiny/api-upgrade/types";
12
9
  import { Topic } from "@webiny/pubsub/types";
10
+ import { CmsModelConverterCallable } from "./utils/converters/ConverterCollection";
11
+ export declare type ApiEndpoint = "manage" | "preview" | "read";
13
12
  export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGroupContext, CmsModelContext, CmsEntryContext {
14
13
  /**
15
14
  * API type
16
15
  */
17
- type: "manage" | "preview" | "read" | string;
16
+ type: ApiEndpoint | null;
18
17
  /**
19
18
  * Requested locale
20
19
  */
@@ -45,12 +44,16 @@ export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGr
45
44
  *
46
45
  * @category Context
47
46
  */
48
- export interface CmsContext extends ContextInterface, DbContext, HttpContext, I18NContext, FileManagerContext, BaseI18NContentContext, TenancyContext {
47
+ export interface CmsContext extends Context, DbContext, I18NContext, FileManagerContext {
49
48
  cms: HeadlessCms;
50
49
  }
51
50
  interface CmsModelFieldPredefinedValuesValue {
52
51
  value: string;
53
52
  label: string;
53
+ /**
54
+ * Default selected predefined value.
55
+ */
56
+ selected?: boolean;
54
57
  }
55
58
  /**
56
59
  * Object containing content model field predefined options and values.
@@ -79,6 +82,39 @@ interface CmsModelFieldRenderer {
79
82
  */
80
83
  name: string;
81
84
  }
85
+ /**
86
+ * A definition for content model field settings.
87
+ *
88
+ * @category ModelField
89
+ * @category Database model
90
+ */
91
+ export interface CmsModelFieldSettings {
92
+ /**
93
+ * Predefined values (text, number)
94
+ * The default value for the field in case it is not predefined values field.
95
+ */
96
+ defaultValue?: string | number | null | undefined;
97
+ /**
98
+ * Object field has child fields.
99
+ */
100
+ fields?: CmsModelField[];
101
+ /**
102
+ * Object field has child fields - so it needs to have a layout.
103
+ */
104
+ layout?: string[][];
105
+ /**
106
+ * Ref field.
107
+ */
108
+ models?: Pick<CmsModel, "modelId">[];
109
+ /**
110
+ * Date field.
111
+ */
112
+ type?: string;
113
+ /**
114
+ * There are a lot of other settings that are possible to add, so we keep the type opened.
115
+ */
116
+ [key: string]: any;
117
+ }
82
118
  /**
83
119
  * A definition for content model field. This type exists on the app side as well.
84
120
  *
@@ -87,15 +123,37 @@ interface CmsModelFieldRenderer {
87
123
  */
88
124
  export interface CmsModelField {
89
125
  /**
90
- * A generated ID for the model field
126
+ * A generated unique ID for the model field.
127
+ * MUST be absolute unique throughout the models.
128
+ * Must be in form of a-zA-Z0-9.
129
+ *
130
+ * We generate a unique id value when you're building a model via UI,
131
+ * but when user is creating a model via a plugin it is up to them to be careful about this.
91
132
  */
92
133
  id: string;
93
134
  /**
94
- * A type of the field
135
+ * A type of the field.
136
+ * We are defining our built-in fields, so people know which are available by the default.
95
137
  */
96
- type: string;
138
+ type: "boolean" | "datetime" | "file" | "long-text" | "number" | "object" | "ref" | "rich-text" | "text" | string;
139
+ /**
140
+ * A unique storage ID for storing actual values.
141
+ * Must in form of a-zA-Z0-9@a-zA-Z0-9@a-zA-Z0-9.
142
+ *
143
+ * This is an auto-generated value: uses `id` and `type`
144
+ *
145
+ * This is used as path for the entry value.
146
+ *
147
+ * @internal
148
+ */
149
+ storageId: string;
97
150
  /**
98
- * A unique field ID for mapping values
151
+ * Field identifier for the model field that will be available to the outside world.
152
+ * `storageId` is used as path (or column) to store the data.
153
+ *
154
+ * Must in form of a-zA-Z0-9.
155
+ *
156
+ * This value MUST be unique in the CmsModel.
99
157
  */
100
158
  fieldId: string;
101
159
  /**
@@ -105,11 +163,11 @@ export interface CmsModelField {
105
163
  /**
106
164
  * Text below the field to clarify what is it meant to be in the field value
107
165
  */
108
- helpText?: string;
166
+ helpText?: string | null;
109
167
  /**
110
168
  * Text to be displayed in the field
111
169
  */
112
- placeholderText?: string;
170
+ placeholderText?: string | null;
113
171
  /**
114
172
  * Are predefined values enabled? And list of them
115
173
  */
@@ -142,9 +200,13 @@ export interface CmsModelField {
142
200
  *
143
201
  * @default {}
144
202
  */
145
- settings?: {
146
- [key: string]: any;
147
- };
203
+ settings?: CmsModelFieldSettings;
204
+ }
205
+ /**
206
+ * Used for our internal functionality.
207
+ */
208
+ export interface CmsModelFieldWithParent extends CmsModelField {
209
+ parent?: CmsModelFieldWithParent | null;
148
210
  }
149
211
  /**
150
212
  * A definition for dateTime field to show possible type of the field in settings.
@@ -163,11 +225,11 @@ export interface CmsModelDateTimeField extends CmsModelField {
163
225
  * @category ModelField
164
226
  * @category FieldValidation
165
227
  */
166
- export interface CmsModelFieldValidatorValidateParams {
228
+ export interface CmsModelFieldValidatorValidateParams<T = any> {
167
229
  /**
168
230
  * A value to be validated.
169
231
  */
170
- value: any;
232
+ value: T;
171
233
  /**
172
234
  * Options from the CmsModelField validations.
173
235
  *
@@ -186,7 +248,12 @@ export interface CmsModelFieldValidatorValidateParams {
186
248
  /**
187
249
  * An instance of the content model being validated.
188
250
  */
189
- contentModel: CmsModel;
251
+ model: CmsModel;
252
+ /**
253
+ * If entry is sent it means it is an update operation.
254
+ * First usage is for the unique field value.
255
+ */
256
+ entry?: CmsEntry;
190
257
  }
191
258
  /**
192
259
  * Definition for the field validator.
@@ -253,7 +320,8 @@ export interface CmsModelFieldPatternValidatorPlugin extends Plugin {
253
320
  */
254
321
  export interface LockedField {
255
322
  /**
256
- * Locked field ID - one used for mapping values.
323
+ * Locked field storage ID - one used to store values.
324
+ * We cannot change this due to old systems.
257
325
  */
258
326
  fieldId: string;
259
327
  /**
@@ -281,6 +349,10 @@ export interface CmsModel {
281
349
  * Unique ID for the content model. Created from name if not defined by user.
282
350
  */
283
351
  modelId: string;
352
+ /**
353
+ * Model tenant.
354
+ */
355
+ tenant: string;
284
356
  /**
285
357
  * Locale this model belongs to.
286
358
  */
@@ -301,15 +373,15 @@ export interface CmsModel {
301
373
  /**
302
374
  * Description for the content model.
303
375
  */
304
- description?: string;
376
+ description: string;
305
377
  /**
306
378
  * Date created
307
379
  */
308
- createdOn?: Date;
380
+ createdOn?: string;
309
381
  /**
310
382
  * Date saved. Changes on both save and create.
311
383
  */
312
- savedOn?: Date;
384
+ savedOn?: string;
313
385
  /**
314
386
  * CreatedBy object wrapper. Contains id, name and type of the user.
315
387
  */
@@ -343,9 +415,20 @@ export interface CmsModel {
343
415
  */
344
416
  webinyVersion: string;
345
417
  /**
346
- * Model tenant.
418
+ * Is model private?
419
+ * This is meant to be used for some internal models - will not be visible in the schema.
420
+ * Only available for the plugin constructed models.
347
421
  */
348
- tenant: string;
422
+ isPrivate?: boolean;
423
+ }
424
+ /**
425
+ * When sending model to the storage operations, it must contain createValueKeyToStorageConverter and createValueKeyFromStorageConverter
426
+ *
427
+ * @category CmsModel
428
+ */
429
+ export interface StorageOperationsCmsModel extends CmsModel {
430
+ convertValueKeyToStorage: CmsModelConverterCallable;
431
+ convertValueKeyFromStorage: CmsModelConverterCallable;
349
432
  }
350
433
  /**
351
434
  * @category ModelField
@@ -354,17 +437,18 @@ export interface CmsModelFieldDefinition {
354
437
  fields: string;
355
438
  typeDefs?: string;
356
439
  }
440
+ interface CmsModelFieldToGraphQLCreateResolverParams {
441
+ models: CmsModel[];
442
+ model: CmsModel;
443
+ graphQLType: string;
444
+ field: CmsModelField;
445
+ createFieldResolvers: any;
446
+ }
357
447
  export interface CmsModelFieldToGraphQLCreateResolver {
358
- (params: {
359
- models: CmsModel[];
360
- model: CmsModel;
361
- graphQLType: string;
362
- field: CmsModelField;
363
- createFieldResolvers: any;
364
- }): GraphQLFieldResolver | {
365
- resolver: GraphQLFieldResolver;
448
+ (params: CmsModelFieldToGraphQLCreateResolverParams): GraphQLFieldResolver | {
449
+ resolver: GraphQLFieldResolver | null;
366
450
  typeResolvers: Resolvers<CmsContext>;
367
- };
451
+ } | false;
368
452
  }
369
453
  /**
370
454
  * @category Plugin
@@ -392,6 +476,15 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
392
476
  * ```
393
477
  */
394
478
  isSearchable: boolean;
479
+ /**
480
+ * Is the field searchable via full text search?
481
+ *
482
+ * Field is not full text searchable by default.
483
+ * ```ts
484
+ * fullTextSearch: false
485
+ * ```
486
+ */
487
+ fullTextSearch?: boolean;
395
488
  /**
396
489
  * Is the field sortable via the GraphQL?
397
490
  *
@@ -400,6 +493,27 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
400
493
  * ```
401
494
  */
402
495
  isSortable: boolean;
496
+ /**
497
+ * Optional method which creates the storageId.
498
+ * Primary use is for the datetime field, but if users has some specific fields, they can customize the storageId to their needs.
499
+ *
500
+ * ```ts
501
+ * createStorageId: ({field}) => {
502
+ * if (field.settings.type === "time) {
503
+ * return `${field.type}_time@${field.id}`
504
+ * }
505
+ * // use default method
506
+ * return undefined;
507
+ * }
508
+ * ```
509
+ */
510
+ createStorageId?: (params: {
511
+ model: CmsModel;
512
+ field: CmsModelField;
513
+ }) => string | null | undefined;
514
+ /**
515
+ * Read API methods.
516
+ */
403
517
  read: {
404
518
  /**
405
519
  * Definition for get filtering for GraphQL.
@@ -455,16 +569,16 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
455
569
  model: CmsModel;
456
570
  field: CmsModelField;
457
571
  fieldTypePlugins: CmsFieldTypePlugins;
458
- }): CmsModelFieldDefinition | string;
572
+ }): CmsModelFieldDefinition | string | null;
459
573
  /**
460
574
  * Definition for field resolver.
461
- * By default it is simple return of the `instance.values[fieldId]` but if required, users can define their own.
575
+ * By default it is simple return of the `instance.values[storageId]` but if required, users can define their own.
462
576
  *
463
577
  * ```ts
464
578
  * read: {
465
579
  * createResolver({ field }) {
466
580
  * return instance => {
467
- * return instance.values[field.fieldId];
581
+ * return instance.values[field.storageId];
468
582
  * };
469
583
  * }
470
584
  * }
@@ -492,7 +606,6 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
492
606
  */
493
607
  createSchema?: (params: {
494
608
  models: CmsModel[];
495
- model: CmsModel;
496
609
  }) => GraphQLSchemaDefinition<CmsContext>;
497
610
  };
498
611
  manage: {
@@ -535,7 +648,6 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
535
648
  */
536
649
  createSchema?: (params: {
537
650
  models: CmsModel[];
538
- model: CmsModel;
539
651
  }) => GraphQLSchemaDefinition<CmsContext>;
540
652
  /**
541
653
  * Definition of the field type for GraphQL - be aware if multiple values is selected. Probably same as `read.createTypeField`.
@@ -556,7 +668,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
556
668
  model: CmsModel;
557
669
  field: CmsModelField;
558
670
  fieldTypePlugins: CmsFieldTypePlugins;
559
- }) => CmsModelFieldDefinition | string;
671
+ }) => CmsModelFieldDefinition | string | null;
560
672
  /**
561
673
  * Definition for input GraphQL field type.
562
674
  *
@@ -576,16 +688,16 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
576
688
  model: CmsModel;
577
689
  field: CmsModelField;
578
690
  fieldTypePlugins: CmsFieldTypePlugins;
579
- }) => CmsModelFieldDefinition | string;
691
+ }) => CmsModelFieldDefinition | string | null;
580
692
  /**
581
693
  * Definition for field resolver.
582
- * By default it is simple return of the `instance.values[fieldId]` but if required, users can define their own.
694
+ * By default it is simple return of the `instance.values[storageId]` but if required, users can define their own.
583
695
  *
584
696
  * ```ts
585
697
  * manage: {
586
698
  * createResolver({ field }) {
587
699
  * return instance => {
588
- * return instance.values[field.fieldId];
700
+ * return instance.values[field.storageId];
589
701
  * };
590
702
  * }
591
703
  * }
@@ -643,7 +755,7 @@ export interface CreatedBy {
643
755
  /**
644
756
  * Full name of the user.
645
757
  */
646
- displayName: string;
758
+ displayName: string | null;
647
759
  /**
648
760
  * Type of the user (admin, user)
649
761
  */
@@ -687,23 +799,42 @@ export interface CmsSettingsContext {
687
799
  */
688
800
  getModelLastChange: () => Promise<Date>;
689
801
  }
690
- export interface BeforeInstallTopicParams {
802
+ export interface OnSystemBeforeInstallTopicParams {
691
803
  tenant: string;
804
+ locale: string;
805
+ }
806
+ export interface OnSystemAfterInstallTopicParams {
807
+ tenant: string;
808
+ locale: string;
692
809
  }
693
- export interface AfterInstallTopicParams {
810
+ export interface OnSystemInstallErrorTopicParams {
811
+ error: Error;
694
812
  tenant: string;
813
+ locale: string;
695
814
  }
696
815
  export declare type CmsSystemContext = {
697
- getSystemVersion: () => Promise<string>;
816
+ getSystemVersion: () => Promise<string | null>;
698
817
  setSystemVersion: (version: string) => Promise<void>;
699
- getReadAPIKey(): Promise<string>;
818
+ getReadAPIKey(): Promise<string | null>;
700
819
  installSystem: () => Promise<void>;
701
820
  upgradeSystem: (version: string) => Promise<boolean>;
702
821
  /**
703
- * Events
822
+ * Lifecycle events - deprecated
704
823
  */
705
- onBeforeSystemInstall: Topic<BeforeInstallTopicParams>;
706
- onAfterSystemInstall: Topic<AfterInstallTopicParams>;
824
+ /**
825
+ * @deprecated
826
+ */
827
+ onBeforeSystemInstall: Topic<OnSystemBeforeInstallTopicParams>;
828
+ /**
829
+ * @deprecated
830
+ */
831
+ onAfterSystemInstall: Topic<OnSystemAfterInstallTopicParams>;
832
+ /**
833
+ * Released in 5.34.0
834
+ */
835
+ onSystemBeforeInstall: Topic<OnSystemBeforeInstallTopicParams>;
836
+ onSystemAfterInstall: Topic<OnSystemAfterInstallTopicParams>;
837
+ onSystemInstallError: Topic<OnSystemInstallErrorTopicParams>;
707
838
  };
708
839
  /**
709
840
  * A GraphQL params.data parameter received when creating content model group.
@@ -748,6 +879,10 @@ export interface CmsGroup {
748
879
  * Slug for the group. Must be unique.
749
880
  */
750
881
  slug: string;
882
+ /**
883
+ * Group tenant.
884
+ */
885
+ tenant: string;
751
886
  /**
752
887
  * Locale this group belongs to.
753
888
  */
@@ -755,11 +890,11 @@ export interface CmsGroup {
755
890
  /**
756
891
  * Description for the group.
757
892
  */
758
- description?: string;
893
+ description: string;
759
894
  /**
760
895
  * Icon for the group. In a form of "ico/ico".
761
896
  */
762
- icon?: string;
897
+ icon: string;
763
898
  /**
764
899
  * CreatedBy reference object.
765
900
  */
@@ -777,9 +912,11 @@ export interface CmsGroup {
777
912
  */
778
913
  webinyVersion: string;
779
914
  /**
780
- * Group tenant.
915
+ * Is group private?
916
+ * This is meant to be used for some internal groups - will not be visible in the schema.
917
+ * Only available for the plugin constructed groups.
781
918
  */
782
- tenant: string;
919
+ isPrivate?: boolean;
783
920
  }
784
921
  /**
785
922
  * A data.where parameter received when listing content model groups.
@@ -798,21 +935,21 @@ export interface CmsGroupListParams {
798
935
  * @category CmsGroup
799
936
  * @category Topic
800
937
  */
801
- export interface BeforeGroupCreateTopicParams {
938
+ export interface OnGroupBeforeCreateTopicParams {
802
939
  group: CmsGroup;
803
940
  }
804
941
  /**
805
942
  * @category CmsGroup
806
943
  * @category Topic
807
944
  */
808
- export interface AfterGroupCreateTopicParams {
945
+ export interface OnGroupAfterCreateTopicParams {
809
946
  group: CmsGroup;
810
947
  }
811
948
  /**
812
949
  * @category CmsGroup
813
950
  * @category Topic
814
951
  */
815
- export interface BeforeGroupUpdateTopicParams {
952
+ export interface OnGroupBeforeUpdateTopicParams {
816
953
  original: CmsGroup;
817
954
  group: CmsGroup;
818
955
  }
@@ -820,7 +957,7 @@ export interface BeforeGroupUpdateTopicParams {
820
957
  * @category CmsGroup
821
958
  * @category Topic
822
959
  */
823
- export interface AfterGroupUpdateTopicParams {
960
+ export interface OnGroupAfterUpdateTopicParams {
824
961
  original: CmsGroup;
825
962
  group: CmsGroup;
826
963
  }
@@ -828,14 +965,14 @@ export interface AfterGroupUpdateTopicParams {
828
965
  * @category CmsGroup
829
966
  * @category Topic
830
967
  */
831
- export interface BeforeGroupDeleteTopicParams {
968
+ export interface OnGroupBeforeDeleteTopicParams {
832
969
  group: CmsGroup;
833
970
  }
834
971
  /**
835
972
  * @category CmsGroup
836
973
  * @category Topic
837
974
  */
838
- export interface AfterGroupDeleteTopicParams {
975
+ export interface OnGroupAfterDeleteTopicParams {
839
976
  group: CmsGroup;
840
977
  }
841
978
  /**
@@ -866,14 +1003,45 @@ export interface CmsGroupContext {
866
1003
  */
867
1004
  deleteGroup: (id: string) => Promise<boolean>;
868
1005
  /**
869
- * Events.
1006
+ * Clear the cached groups.
1007
+ */
1008
+ clearGroupsCache: () => void;
1009
+ /**
1010
+ * Lifecycle events - deprecated
1011
+ */
1012
+ /**
1013
+ * @deprecated
1014
+ */
1015
+ onBeforeGroupCreate: Topic<OnGroupBeforeCreateTopicParams>;
1016
+ /**
1017
+ * @deprecated
1018
+ */
1019
+ onAfterGroupCreate: Topic<OnGroupAfterCreateTopicParams>;
1020
+ /**
1021
+ * @deprecated
1022
+ */
1023
+ onBeforeGroupUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
1024
+ /**
1025
+ * @deprecated
1026
+ */
1027
+ onAfterGroupUpdate: Topic<OnGroupAfterUpdateTopicParams>;
1028
+ /**
1029
+ * @deprecated
1030
+ */
1031
+ onBeforeGroupDelete: Topic<OnGroupBeforeDeleteTopicParams>;
1032
+ /**
1033
+ * @deprecated
1034
+ */
1035
+ onAfterGroupDelete: Topic<OnGroupAfterDeleteTopicParams>;
1036
+ /**
1037
+ * Lifecycle events released in 5.33.0
870
1038
  */
871
- onBeforeGroupCreate: Topic<BeforeGroupCreateTopicParams>;
872
- onAfterGroupCreate: Topic<AfterGroupCreateTopicParams>;
873
- onBeforeGroupUpdate: Topic<BeforeGroupUpdateTopicParams>;
874
- onAfterGroupUpdate: Topic<AfterGroupUpdateTopicParams>;
875
- onBeforeGroupDelete: Topic<BeforeGroupDeleteTopicParams>;
876
- onAfterGroupDelete: Topic<AfterGroupDeleteTopicParams>;
1039
+ onGroupBeforeCreate: Topic<OnGroupBeforeCreateTopicParams>;
1040
+ onGroupAfterCreate: Topic<OnGroupAfterCreateTopicParams>;
1041
+ onGroupBeforeUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
1042
+ onGroupAfterUpdate: Topic<OnGroupAfterUpdateTopicParams>;
1043
+ onGroupBeforeDelete: Topic<OnGroupBeforeDeleteTopicParams>;
1044
+ onGroupAfterDelete: Topic<OnGroupAfterDeleteTopicParams>;
877
1045
  }
878
1046
  /**
879
1047
  * Definition for content model field validator.
@@ -884,7 +1052,12 @@ export interface CmsGroupContext {
884
1052
  export interface CmsModelFieldValidation {
885
1053
  name: string;
886
1054
  message: string;
887
- settings?: Record<string, any>;
1055
+ settings?: {
1056
+ value?: string | number;
1057
+ values?: string[];
1058
+ preset?: string;
1059
+ [key: string]: any;
1060
+ };
888
1061
  }
889
1062
  /**
890
1063
  * A GraphQL params.data parameter received when creating content model.
@@ -905,6 +1078,42 @@ export interface CmsModelCreateInput {
905
1078
  * Description of the content model.
906
1079
  */
907
1080
  description?: string;
1081
+ /**
1082
+ * Group where to put the content model in.
1083
+ */
1084
+ group: string;
1085
+ /**
1086
+ * A list of content model fields to define the entry values.
1087
+ */
1088
+ fields?: CmsModelFieldInput[];
1089
+ /**
1090
+ * Admin UI field layout
1091
+ *
1092
+ * ```ts
1093
+ * layout: [
1094
+ * [field1id, field2id],
1095
+ * [field3id]
1096
+ * ]
1097
+ * ```
1098
+ */
1099
+ layout?: string[][];
1100
+ /**
1101
+ * The field that is being displayed as entry title.
1102
+ * It is picked as first available text field. Or user can select own field.
1103
+ */
1104
+ titleFieldId?: string;
1105
+ }
1106
+ /**
1107
+ * A GraphQL params.data parameter received when creating content model from existing model.
1108
+ *
1109
+ * @category GraphQL params
1110
+ * @category CmsModel
1111
+ */
1112
+ export interface CmsModelCreateFromInput extends CmsModelCreateInput {
1113
+ /**
1114
+ * Locale into which we want to clone the model into.
1115
+ */
1116
+ locale?: string;
908
1117
  }
909
1118
  /**
910
1119
  * A definition for content model field received from the user.
@@ -926,7 +1135,7 @@ export interface CmsModelFieldInput {
926
1135
  */
927
1136
  type: string;
928
1137
  /**
929
- * A unique ID for the field. Values will be mapped via this value.
1138
+ * Field outside world identifier for the field. Must be unique in the model.
930
1139
  */
931
1140
  fieldId: string;
932
1141
  /**
@@ -977,6 +1186,10 @@ export interface CmsModelUpdateInput {
977
1186
  * A new content model name.
978
1187
  */
979
1188
  name?: string;
1189
+ /**
1190
+ * A group we want to move the model to.
1191
+ */
1192
+ group?: string;
980
1193
  /**
981
1194
  * A new description of the content model.
982
1195
  */
@@ -1027,13 +1240,22 @@ export interface ModelManagerPlugin extends Plugin {
1027
1240
  */
1028
1241
  create: (context: CmsContext, model: CmsModel) => Promise<CmsModelManager>;
1029
1242
  }
1243
+ /**
1244
+ * A content entry values definition for and from the database.
1245
+ *
1246
+ * @category Database model
1247
+ * @category CmsEntry
1248
+ */
1249
+ export interface CmsEntryValues {
1250
+ [key: string]: any;
1251
+ }
1030
1252
  /**
1031
1253
  * A content entry definition for and from the database.
1032
1254
  *
1033
1255
  * @category Database model
1034
1256
  * @category CmsEntry
1035
1257
  */
1036
- export interface CmsEntry {
1258
+ export interface CmsEntry<T = CmsEntryValues> {
1037
1259
  /**
1038
1260
  * A version of the webiny this entry was created with.
1039
1261
  * This can be used when upgrading the system so we know which entries to update.
@@ -1098,11 +1320,22 @@ export interface CmsEntry {
1098
1320
  */
1099
1321
  status: CmsEntryStatus;
1100
1322
  /**
1101
- * A mapped fieldId -> value object.
1323
+ * A mapped storageId -> value object.
1102
1324
  *
1103
1325
  * @see CmsModelField
1104
1326
  */
1105
- values: Record<string, any>;
1327
+ values: T;
1328
+ /**
1329
+ * Settings for the given entry.
1330
+ *
1331
+ * Introduced with Advanced Publishing Workflow - will be always inserted after this PR is merged.
1332
+ * Be aware that when accessing properties in it on old systems - it will break if not checked first.
1333
+ *
1334
+ * Available only on the Manage API in entry GraphQL type meta.data property.
1335
+ */
1336
+ meta?: {
1337
+ [key: string]: any;
1338
+ };
1106
1339
  }
1107
1340
  export interface CmsStorageEntry extends CmsEntry {
1108
1341
  [key: string]: any;
@@ -1118,18 +1351,14 @@ export interface CmsStorageEntry extends CmsEntry {
1118
1351
  * @category CmsModel
1119
1352
  */
1120
1353
  export interface CmsModelManager {
1121
- /**
1122
- * List entries in this content model.
1123
- */
1124
- list: (params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1125
1354
  /**
1126
1355
  * List only published entries in the content model.
1127
1356
  */
1128
- listPublished: (params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1357
+ listPublished: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1129
1358
  /**
1130
1359
  * List latest entries in the content model. Used for administration.
1131
1360
  */
1132
- listLatest: (params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1361
+ listLatest: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1133
1362
  /**
1134
1363
  * Get a list of published entries by the ID list.
1135
1364
  */
@@ -1145,38 +1374,51 @@ export interface CmsModelManager {
1145
1374
  /**
1146
1375
  * Create a entry.
1147
1376
  */
1148
- create: (data: Record<string, any>) => Promise<CmsEntry>;
1377
+ create: (data: CreateCmsEntryInput) => Promise<CmsEntry>;
1149
1378
  /**
1150
1379
  * Update a entry.
1151
1380
  */
1152
- update: (id: string, data: Record<string, any>) => Promise<CmsEntry>;
1381
+ update: (id: string, data: UpdateCmsEntryInput) => Promise<CmsEntry>;
1153
1382
  /**
1154
1383
  * Delete a entry.
1155
1384
  */
1156
1385
  delete: (id: string) => Promise<void>;
1157
1386
  }
1158
- export interface BeforeModelCreateTopicParams {
1159
- input: Partial<CmsModel>;
1387
+ export interface OnModelBeforeCreateTopicParams {
1388
+ input: CmsModelCreateInput;
1160
1389
  model: CmsModel;
1161
1390
  }
1162
- export interface AfterModelCreateTopicParams {
1163
- input: Partial<CmsModel>;
1391
+ export interface OnModelAfterCreateTopicParams {
1392
+ input: CmsModelCreateInput;
1164
1393
  model: CmsModel;
1165
1394
  }
1166
- export interface BeforeModelUpdateTopicParams {
1167
- input: Partial<CmsModel>;
1395
+ export interface OnModelBeforeCreateFromTopicParams {
1396
+ input: CmsModelCreateInput;
1168
1397
  original: CmsModel;
1169
1398
  model: CmsModel;
1170
1399
  }
1171
- export interface AfterModelUpdateTopicParams {
1172
- input: Partial<CmsModel>;
1400
+ export interface OnModelAfterCreateFromTopicParams {
1401
+ input: CmsModelCreateInput;
1402
+ original: CmsModel;
1403
+ model: CmsModel;
1404
+ }
1405
+ export interface OnModelBeforeUpdateTopicParams {
1406
+ input: CmsModelUpdateInput;
1407
+ original: CmsModel;
1408
+ model: CmsModel;
1409
+ }
1410
+ export interface OnModelAfterUpdateTopicParams {
1411
+ input: CmsModelUpdateInput;
1173
1412
  original: CmsModel;
1174
1413
  model: CmsModel;
1175
1414
  }
1176
- export interface BeforeModelDeleteTopicParams {
1415
+ export interface OnModelBeforeDeleteTopicParams {
1177
1416
  model: CmsModel;
1178
1417
  }
1179
- export interface AfterModelDeleteTopicParams {
1418
+ export interface OnModelAfterDeleteTopicParams {
1419
+ model: CmsModel;
1420
+ }
1421
+ export interface OnModelInitializeParams {
1180
1422
  model: CmsModel;
1181
1423
  }
1182
1424
  export interface CmsModelUpdateDirectParams {
@@ -1190,15 +1432,6 @@ export interface CmsModelUpdateDirectParams {
1190
1432
  * @category CmsModel
1191
1433
  */
1192
1434
  export interface CmsModelContext {
1193
- /**
1194
- * A function defining usage of a method with authenticating the user but not throwing an error.
1195
- */
1196
- silentAuthModel: () => {
1197
- /**
1198
- * Get all content models.
1199
- */
1200
- list: () => Promise<CmsModel[]>;
1201
- };
1202
1435
  /**
1203
1436
  * Get a single content model.
1204
1437
  */
@@ -1211,12 +1444,12 @@ export interface CmsModelContext {
1211
1444
  * Create a content model.
1212
1445
  */
1213
1446
  createModel: (data: CmsModelCreateInput) => Promise<CmsModel>;
1447
+ /**
1448
+ * Create a content model from the given model - clone.
1449
+ */
1450
+ createModelFrom: (modelId: string, data: CmsModelCreateFromInput) => Promise<CmsModel>;
1214
1451
  /**
1215
1452
  * Update content model without data validation. Used internally.
1216
- *
1217
- * @param model - existing content model
1218
- * @param data - data to be updated
1219
- *
1220
1453
  * @hidden
1221
1454
  */
1222
1455
  updateModelDirect: (params: CmsModelUpdateDirectParams) => Promise<CmsModel>;
@@ -1228,33 +1461,97 @@ export interface CmsModelContext {
1228
1461
  * Delete content model. Should not allow deletion if there are entries connected to it.
1229
1462
  */
1230
1463
  deleteModel: (modelId: string) => Promise<void>;
1464
+ /**
1465
+ * Possibility for users to trigger the model initialization.
1466
+ * They can hook into it and do what ever they want to.
1467
+ *
1468
+ * Primary idea behind this is creating the index, for the code models, in the ES.
1469
+ */
1470
+ initializeModel: (modelId: string) => Promise<boolean>;
1231
1471
  /**
1232
1472
  * Get a instance of CmsModelManager for given content modelId.
1233
1473
  *
1234
1474
  * @see CmsModelManager
1475
+ *
1476
+ * @deprecated use the getEntryManager() method instead
1235
1477
  */
1236
- getModelManager: (modelId: string) => Promise<CmsModelManager>;
1478
+ getModelManager: (model: CmsModel | string) => Promise<CmsModelManager>;
1479
+ getEntryManager: (model: CmsModel | string) => Promise<CmsModelManager>;
1237
1480
  /**
1238
1481
  * Get all content model managers mapped by modelId.
1239
1482
  * @see CmsModelManager
1483
+ * @deprecated use getEntryManagers instead
1240
1484
  */
1241
1485
  getManagers: () => Map<string, CmsModelManager>;
1486
+ getEntryManagers: () => Map<string, CmsModelManager>;
1487
+ /**
1488
+ * Clear all the model caches.
1489
+ */
1490
+ clearModelsCache: () => void;
1491
+ /**
1492
+ * Lifecycle events - deprecated.
1493
+ */
1494
+ /**
1495
+ * @deprecated
1496
+ */
1497
+ onBeforeModelCreate: Topic<OnModelBeforeCreateTopicParams>;
1498
+ /**
1499
+ * @deprecated
1500
+ */
1501
+ onAfterModelCreate: Topic<OnModelAfterCreateTopicParams>;
1502
+ /**
1503
+ * @deprecated
1504
+ */
1505
+ onBeforeModelCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
1506
+ /**
1507
+ * @deprecated
1508
+ */
1509
+ onAfterModelCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
1510
+ /**
1511
+ * @deprecated
1512
+ */
1513
+ onBeforeModelUpdate: Topic<OnModelBeforeUpdateTopicParams>;
1514
+ /**
1515
+ * @deprecated
1516
+ */
1517
+ onAfterModelUpdate: Topic<OnModelAfterUpdateTopicParams>;
1518
+ /**
1519
+ * @deprecated
1520
+ */
1521
+ onBeforeModelDelete: Topic<OnModelBeforeDeleteTopicParams>;
1522
+ /**
1523
+ * @deprecated
1524
+ */
1525
+ onAfterModelDelete: Topic<OnModelAfterDeleteTopicParams>;
1242
1526
  /**
1243
- * Events.
1527
+ * Lifecycle events - released in 5.33.0
1244
1528
  */
1245
- onBeforeModelCreate: Topic<BeforeModelCreateTopicParams>;
1246
- onAfterModelCreate: Topic<AfterModelCreateTopicParams>;
1247
- onBeforeModelUpdate: Topic<BeforeModelUpdateTopicParams>;
1248
- onAfterModelUpdate: Topic<AfterModelUpdateTopicParams>;
1249
- onBeforeModelDelete: Topic<BeforeModelDeleteTopicParams>;
1250
- onAfterModelDelete: Topic<AfterModelDeleteTopicParams>;
1529
+ onModelBeforeCreate: Topic<OnModelBeforeCreateTopicParams>;
1530
+ onModelAfterCreate: Topic<OnModelAfterCreateTopicParams>;
1531
+ onModelBeforeCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
1532
+ onModelAfterCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
1533
+ onModelBeforeUpdate: Topic<OnModelBeforeUpdateTopicParams>;
1534
+ onModelAfterUpdate: Topic<OnModelAfterUpdateTopicParams>;
1535
+ onModelBeforeDelete: Topic<OnModelBeforeDeleteTopicParams>;
1536
+ onModelAfterDelete: Topic<OnModelAfterDeleteTopicParams>;
1537
+ onModelInitialize: Topic<OnModelInitializeParams>;
1251
1538
  }
1252
1539
  /**
1253
1540
  * Available statuses for content entry.
1254
1541
  *
1255
1542
  * @category CmsEntry
1256
1543
  */
1257
- declare type CmsEntryStatus = "published" | "unpublished" | "reviewRequested" | "changesRequested" | "draft";
1544
+ export declare type CmsEntryStatus = "published" | "unpublished" | "draft";
1545
+ export interface CmsEntryListWhereRef {
1546
+ id?: string;
1547
+ id_in?: string[];
1548
+ id_not?: string;
1549
+ id_not_in?: string[];
1550
+ entryId?: string;
1551
+ entryId_not?: string;
1552
+ entryId_in?: string[];
1553
+ entryId_not_in?: string[];
1554
+ }
1258
1555
  /**
1259
1556
  * Entry listing where params.
1260
1557
  *
@@ -1277,7 +1574,9 @@ export interface CmsEntryListWhere {
1277
1574
  entryId_in?: string[];
1278
1575
  entryId_not_in?: string[];
1279
1576
  /**
1280
- * Entry is owned by whom?
1577
+ * Contains the owner of the entry. An "owner" is the identity who originally created the entry.
1578
+ * Subsequent revisions can be created by other identities, and those will be stored in `createdBy`,
1579
+ * but the `owner` is always the original author of the entry.
1281
1580
  *
1282
1581
  * Can be sent via the API or set internal if user can see only their own entries.
1283
1582
  */
@@ -1302,22 +1601,25 @@ export interface CmsEntryListWhere {
1302
1601
  version_lt?: number;
1303
1602
  version_gt?: number;
1304
1603
  /**
1305
- * Each operations implementation MUST determine how to use this field.
1306
- * In SQL it can be published field and in DynamoDB can be a secondary key.
1604
+ * Each storage operations implementation MUST determine how to use this field.
1605
+ * In SQL, it can be a `published` field, and in DynamoDB it can be an SK.
1307
1606
  *
1308
1607
  * It is not meant to be used via the API.
1309
1608
  * @internal
1310
1609
  */
1311
1610
  published?: boolean;
1312
1611
  /**
1313
- * Each operations implementation MUST determine how to use this field.
1314
- * In SQL it can be published field and in DynamoDB can be a secondary key.
1612
+ * Each storage operations implementation MUST determine how to use this field.
1613
+ * In SQL, it can be a `latest` field, and in DynamoDB it can be an SK.
1315
1614
  *
1316
1615
  * It is not meant to be used via the API.
1317
1616
  * @internal
1318
1617
  */
1319
1618
  latest?: boolean;
1320
- [key: string]: any;
1619
+ /**
1620
+ * This is to allow querying by any content model field defined by the user.
1621
+ */
1622
+ [key: string]: any | CmsEntryListWhereRef;
1321
1623
  }
1322
1624
  /**
1323
1625
  * Entry listing sort.
@@ -1343,10 +1645,12 @@ export interface CmsEntryGetParams {
1343
1645
  * @category GraphQL params
1344
1646
  */
1345
1647
  export interface CmsEntryListParams {
1346
- where: CmsEntryListWhere;
1648
+ where?: CmsEntryListWhere;
1347
1649
  sort?: CmsEntryListSort;
1650
+ search?: string;
1651
+ fields?: string[];
1348
1652
  limit?: number;
1349
- after?: string;
1653
+ after?: string | null;
1350
1654
  }
1351
1655
  /**
1352
1656
  * Meta information for GraphQL output.
@@ -1358,7 +1662,7 @@ export interface CmsEntryMeta {
1358
1662
  /**
1359
1663
  * A cursor for pagination.
1360
1664
  */
1361
- cursor: string;
1665
+ cursor: string | null;
1362
1666
  /**
1363
1667
  * Is there more items to load?
1364
1668
  */
@@ -1368,98 +1672,143 @@ export interface CmsEntryMeta {
1368
1672
  */
1369
1673
  totalCount: number;
1370
1674
  }
1371
- export interface BeforeEntryCreateTopicParams {
1372
- input: Partial<CmsEntry>;
1675
+ export interface OnEntryBeforeCreateTopicParams {
1676
+ input: CreateCmsEntryInput;
1373
1677
  entry: CmsEntry;
1374
- model: CmsModel;
1678
+ model: StorageOperationsCmsModel;
1375
1679
  }
1376
- export interface AfterEntryCreateTopicParams {
1377
- input: Partial<CmsEntry>;
1680
+ export interface OnEntryAfterCreateTopicParams {
1681
+ input: CreateCmsEntryInput;
1378
1682
  entry: CmsEntry;
1379
- model: CmsModel;
1683
+ model: StorageOperationsCmsModel;
1380
1684
  storageEntry: CmsEntry;
1381
1685
  }
1382
- export interface BeforeEntryRevisionCreateTopicParams {
1686
+ export interface OnEntryCreateErrorTopicParams {
1687
+ error: Error;
1688
+ input: CreateCmsEntryInput;
1383
1689
  entry: CmsEntry;
1384
1690
  model: CmsModel;
1385
1691
  }
1386
- export interface AfterEntryRevisionCreateTopicParams {
1692
+ export interface OnEntryRevisionBeforeCreateTopicParams {
1693
+ input: CreateFromCmsEntryInput;
1387
1694
  entry: CmsEntry;
1388
- model: CmsModel;
1389
- storageEntry: CmsEntry;
1695
+ original: CmsEntry;
1696
+ model: StorageOperationsCmsModel;
1390
1697
  }
1391
- export interface BeforeEntryUpdateTopicParams {
1392
- input: Partial<CmsEntry>;
1698
+ export interface OnEntryRevisionAfterCreateTopicParams {
1699
+ input: CreateFromCmsEntryInput;
1700
+ entry: CmsEntry;
1393
1701
  original: CmsEntry;
1702
+ model: StorageOperationsCmsModel;
1703
+ storageEntry: CmsEntry;
1704
+ }
1705
+ export interface OnEntryCreateRevisionErrorTopicParams {
1706
+ error: Error;
1707
+ input: CreateFromCmsEntryInput;
1394
1708
  entry: CmsEntry;
1395
1709
  model: CmsModel;
1396
1710
  }
1397
- export interface AfterEntryUpdateTopicParams {
1398
- input: Partial<CmsEntry>;
1711
+ export interface OnEntryBeforeUpdateTopicParams {
1712
+ input: UpdateCmsEntryInput;
1399
1713
  original: CmsEntry;
1400
1714
  entry: CmsEntry;
1401
- model: CmsModel;
1402
- storageEntry: CmsEntry;
1715
+ model: StorageOperationsCmsModel;
1403
1716
  }
1404
- export interface BeforeEntryPublishTopicParams {
1717
+ export interface OnEntryAfterUpdateTopicParams {
1718
+ input: UpdateCmsEntryInput;
1719
+ original: CmsEntry;
1405
1720
  entry: CmsEntry;
1406
- model: CmsModel;
1721
+ model: StorageOperationsCmsModel;
1722
+ storageEntry: CmsEntry;
1407
1723
  }
1408
- export interface AfterEntryPublishTopicParams {
1724
+ export interface OnEntryUpdateErrorTopicParams {
1725
+ error: Error;
1726
+ input: CreateFromCmsEntryInput;
1409
1727
  entry: CmsEntry;
1410
1728
  model: CmsModel;
1411
- storageEntry: CmsEntry;
1412
1729
  }
1413
- export interface BeforeEntryUnpublishTopicParams {
1730
+ export interface OnEntryBeforePublishTopicParams {
1414
1731
  entry: CmsEntry;
1415
- model: CmsModel;
1732
+ model: StorageOperationsCmsModel;
1416
1733
  }
1417
- export interface AfterEntryUnpublishTopicParams {
1734
+ export interface OnEntryAfterPublishTopicParams {
1418
1735
  entry: CmsEntry;
1419
- model: CmsModel;
1736
+ model: StorageOperationsCmsModel;
1420
1737
  storageEntry: CmsEntry;
1421
1738
  }
1422
- export interface BeforeEntryRequestChangesTopicParams {
1739
+ export interface OnEntryPublishErrorTopicParams {
1740
+ error: Error;
1423
1741
  entry: CmsEntry;
1424
- model: CmsModel;
1742
+ model: StorageOperationsCmsModel;
1425
1743
  }
1426
- export interface AfterEntryRequestChangesTopicParams {
1744
+ export interface OnEntryBeforeUnpublishTopicParams {
1427
1745
  entry: CmsEntry;
1428
- model: CmsModel;
1746
+ model: StorageOperationsCmsModel;
1747
+ }
1748
+ export interface OnEntryAfterUnpublishTopicParams {
1749
+ entry: CmsEntry;
1750
+ model: StorageOperationsCmsModel;
1429
1751
  storageEntry: CmsEntry;
1430
1752
  }
1431
- export interface BeforeEntryRequestReviewTopicParams {
1753
+ export interface OnEntryUnpublishErrorTopicParams {
1754
+ error: Error;
1432
1755
  entry: CmsEntry;
1433
1756
  model: CmsModel;
1434
1757
  }
1435
- export interface AfterEntryRequestReviewTopicParams {
1758
+ export interface OnEntryBeforeDeleteTopicParams {
1436
1759
  entry: CmsEntry;
1437
- model: CmsModel;
1438
- storageEntry: CmsEntry;
1760
+ model: StorageOperationsCmsModel;
1439
1761
  }
1440
- export interface BeforeEntryDeleteTopicParams {
1762
+ export interface OnEntryAfterDeleteTopicParams {
1441
1763
  entry: CmsEntry;
1442
- model: CmsModel;
1764
+ model: StorageOperationsCmsModel;
1443
1765
  }
1444
- export interface AfterEntryDeleteTopicParams {
1766
+ export interface OnEntryDeleteErrorTopicParams {
1767
+ error: Error;
1445
1768
  entry: CmsEntry;
1446
- model: CmsModel;
1769
+ model: StorageOperationsCmsModel;
1447
1770
  }
1448
- export interface BeforeEntryRevisionDeleteTopicParams {
1771
+ export interface OnEntryRevisionBeforeDeleteTopicParams {
1449
1772
  entry: CmsEntry;
1450
- model: CmsModel;
1773
+ model: StorageOperationsCmsModel;
1451
1774
  }
1452
- export interface AfterEntryRevisionDeleteTopicParams {
1775
+ export interface OnEntryRevisionAfterDeleteTopicParams {
1453
1776
  entry: CmsEntry;
1454
- model: CmsModel;
1777
+ model: StorageOperationsCmsModel;
1455
1778
  }
1456
- export interface BeforeEntryGetTopicParams {
1457
- model: CmsModel;
1779
+ export interface OnEntryRevisionDeleteErrorTopicParams {
1780
+ error: Error;
1781
+ entry: CmsEntry;
1782
+ model: StorageOperationsCmsModel;
1783
+ }
1784
+ export interface OnEntryBeforeGetTopicParams {
1785
+ model: StorageOperationsCmsModel;
1458
1786
  where: CmsEntryListWhere;
1459
1787
  }
1460
- export interface BeforeEntryListTopicParams {
1788
+ export interface EntryBeforeListTopicParams {
1461
1789
  where: CmsEntryListWhere;
1462
- model: CmsModel;
1790
+ model: StorageOperationsCmsModel;
1791
+ }
1792
+ /**
1793
+ * @category Context
1794
+ * @category CmsEntry
1795
+ */
1796
+ export interface CreateCmsEntryInput {
1797
+ [key: string]: any;
1798
+ }
1799
+ /**
1800
+ * @category Context
1801
+ * @category CmsEntry
1802
+ */
1803
+ export interface CreateFromCmsEntryInput {
1804
+ [key: string]: any;
1805
+ }
1806
+ /**
1807
+ * @category Context
1808
+ * @category CmsEntry
1809
+ */
1810
+ export interface UpdateCmsEntryInput {
1811
+ [key: string]: any;
1463
1812
  }
1464
1813
  /**
1465
1814
  * Cms Entry CRUD methods in the context.
@@ -1475,7 +1824,7 @@ export interface CmsEntryContext {
1475
1824
  /**
1476
1825
  * Get a list of entries for a model by a given ID (revision).
1477
1826
  */
1478
- getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[] | null>;
1827
+ getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[]>;
1479
1828
  /**
1480
1829
  * Get the entry for a model by a given ID.
1481
1830
  */
@@ -1483,7 +1832,7 @@ export interface CmsEntryContext {
1483
1832
  /**
1484
1833
  * List entries for a model. Internal method used by get, listLatest and listPublished.
1485
1834
  */
1486
- listEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1835
+ listEntries: (model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1487
1836
  /**
1488
1837
  * Lists latest entries. Used for manage API.
1489
1838
  */
@@ -1503,15 +1852,20 @@ export interface CmsEntryContext {
1503
1852
  /**
1504
1853
  * Create a new content entry.
1505
1854
  */
1506
- createEntry: (model: CmsModel, data: Record<string, any>) => Promise<CmsEntry>;
1855
+ createEntry: (model: CmsModel, input: CreateCmsEntryInput) => Promise<CmsEntry>;
1507
1856
  /**
1508
1857
  * Create a new entry from already existing entry.
1509
1858
  */
1510
- createEntryRevisionFrom: (model: CmsModel, id: string, data: Record<string, any>) => Promise<CmsEntry>;
1859
+ createEntryRevisionFrom: (model: CmsModel, id: string, input: CreateFromCmsEntryInput) => Promise<CmsEntry>;
1511
1860
  /**
1512
1861
  * Update existing entry.
1513
1862
  */
1514
- updateEntry: (model: CmsModel, id: string, data?: Record<string, any>) => Promise<CmsEntry>;
1863
+ updateEntry: (model: CmsModel, id: string, input: UpdateCmsEntryInput, meta?: Record<string, any>) => Promise<CmsEntry>;
1864
+ /**
1865
+ * Method that republishes entry with given identifier.
1866
+ * @internal
1867
+ */
1868
+ republishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;
1515
1869
  /**
1516
1870
  * Delete only a certain revision of the entry.
1517
1871
  */
@@ -1529,40 +1883,102 @@ export interface CmsEntryContext {
1529
1883
  */
1530
1884
  unpublishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;
1531
1885
  /**
1532
- * Request a review for the entry.
1886
+ * Get all entry revisions.
1533
1887
  */
1534
- requestEntryReview: (model: CmsModel, id: string) => Promise<CmsEntry>;
1888
+ getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;
1535
1889
  /**
1536
- * Request changes for the entry.
1890
+ * Lifecyle events - deprecated.
1537
1891
  */
1538
- requestEntryChanges: (model: CmsModel, id: string) => Promise<CmsEntry>;
1539
1892
  /**
1540
- * Get all entry revisions.
1893
+ * @deprecated
1541
1894
  */
1542
- getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;
1895
+ onBeforeEntryCreate: Topic<OnEntryBeforeCreateTopicParams>;
1543
1896
  /**
1544
- * Events.
1545
- */
1546
- onBeforeEntryCreate: Topic<BeforeEntryCreateTopicParams>;
1547
- onAfterEntryCreate: Topic<AfterEntryCreateTopicParams>;
1548
- onBeforeEntryRevisionCreate: Topic<BeforeEntryRevisionCreateTopicParams>;
1549
- onAfterEntryRevisionCreate: Topic<AfterEntryRevisionCreateTopicParams>;
1550
- onBeforeEntryUpdate: Topic<BeforeEntryUpdateTopicParams>;
1551
- onAfterEntryUpdate: Topic<AfterEntryUpdateTopicParams>;
1552
- onBeforeEntryDelete: Topic<BeforeEntryDeleteTopicParams>;
1553
- onAfterEntryDelete: Topic<AfterEntryDeleteTopicParams>;
1554
- onBeforeEntryRevisionDelete: Topic<BeforeEntryRevisionDeleteTopicParams>;
1555
- onAfterEntryRevisionDelete: Topic<AfterEntryRevisionDeleteTopicParams>;
1556
- onBeforeEntryPublish: Topic<BeforeEntryPublishTopicParams>;
1557
- onAfterEntryPublish: Topic<AfterEntryPublishTopicParams>;
1558
- onBeforeEntryUnpublish: Topic<BeforeEntryUnpublishTopicParams>;
1559
- onAfterEntryUnpublish: Topic<AfterEntryUnpublishTopicParams>;
1560
- onBeforeEntryRequestChanges: Topic<BeforeEntryRequestChangesTopicParams>;
1561
- onAfterEntryRequestChanges: Topic<AfterEntryRequestChangesTopicParams>;
1562
- onBeforeEntryRequestReview: Topic<BeforeEntryRequestReviewTopicParams>;
1563
- onAfterEntryRequestReview: Topic<AfterEntryRequestReviewTopicParams>;
1564
- onBeforeEntryGet: Topic<BeforeEntryGetTopicParams>;
1565
- onBeforeEntryList: Topic<BeforeEntryListTopicParams>;
1897
+ * @deprecated
1898
+ */
1899
+ onAfterEntryCreate: Topic<OnEntryAfterCreateTopicParams>;
1900
+ /**
1901
+ * @deprecated
1902
+ */
1903
+ onBeforeEntryCreateRevision: Topic<OnEntryRevisionBeforeCreateTopicParams>;
1904
+ /**
1905
+ * @deprecated
1906
+ */
1907
+ onAfterEntryCreateRevision: Topic<OnEntryRevisionAfterCreateTopicParams>;
1908
+ /**
1909
+ * @deprecated
1910
+ */
1911
+ onBeforeEntryUpdate: Topic<OnEntryBeforeUpdateTopicParams>;
1912
+ /**
1913
+ * @deprecated
1914
+ */
1915
+ onAfterEntryUpdate: Topic<OnEntryAfterUpdateTopicParams>;
1916
+ /**
1917
+ * @deprecated
1918
+ */
1919
+ onBeforeEntryDelete: Topic<OnEntryBeforeDeleteTopicParams>;
1920
+ /**
1921
+ * @deprecated
1922
+ */
1923
+ onAfterEntryDelete: Topic<OnEntryAfterDeleteTopicParams>;
1924
+ /**
1925
+ * @deprecated
1926
+ */
1927
+ onBeforeEntryDeleteRevision: Topic<OnEntryRevisionBeforeDeleteTopicParams>;
1928
+ /**
1929
+ * @deprecated
1930
+ */
1931
+ onAfterEntryDeleteRevision: Topic<OnEntryRevisionAfterDeleteTopicParams>;
1932
+ /**
1933
+ * @deprecated
1934
+ */
1935
+ onBeforeEntryPublish: Topic<OnEntryBeforePublishTopicParams>;
1936
+ /**
1937
+ * @deprecated
1938
+ */
1939
+ onAfterEntryPublish: Topic<OnEntryAfterPublishTopicParams>;
1940
+ /**
1941
+ * @deprecated
1942
+ */
1943
+ onBeforeEntryUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
1944
+ /**
1945
+ * @deprecated
1946
+ */
1947
+ onAfterEntryUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
1948
+ /**
1949
+ * @deprecated
1950
+ */
1951
+ onBeforeEntryGet: Topic<OnEntryBeforeGetTopicParams>;
1952
+ /**
1953
+ * @deprecated
1954
+ */
1955
+ onBeforeEntryList: Topic<EntryBeforeListTopicParams>;
1956
+ /**
1957
+ * Lifecycle events released in 5.33.0
1958
+ */
1959
+ onEntryBeforeCreate: Topic<OnEntryBeforeCreateTopicParams>;
1960
+ onEntryAfterCreate: Topic<OnEntryAfterCreateTopicParams>;
1961
+ onEntryCreateError: Topic<OnEntryCreateErrorTopicParams>;
1962
+ onEntryRevisionBeforeCreate: Topic<OnEntryRevisionBeforeCreateTopicParams>;
1963
+ onEntryRevisionAfterCreate: Topic<OnEntryRevisionAfterCreateTopicParams>;
1964
+ onEntryRevisionCreateError: Topic<OnEntryCreateRevisionErrorTopicParams>;
1965
+ onEntryBeforeUpdate: Topic<OnEntryBeforeUpdateTopicParams>;
1966
+ onEntryAfterUpdate: Topic<OnEntryAfterUpdateTopicParams>;
1967
+ onEntryUpdateError: Topic<OnEntryUpdateErrorTopicParams>;
1968
+ onEntryBeforeDelete: Topic<OnEntryBeforeDeleteTopicParams>;
1969
+ onEntryAfterDelete: Topic<OnEntryAfterDeleteTopicParams>;
1970
+ onEntryDeleteError: Topic<OnEntryDeleteErrorTopicParams>;
1971
+ onEntryRevisionBeforeDelete: Topic<OnEntryRevisionBeforeDeleteTopicParams>;
1972
+ onEntryRevisionAfterDelete: Topic<OnEntryRevisionAfterDeleteTopicParams>;
1973
+ onEntryRevisionDeleteError: Topic<OnEntryRevisionDeleteErrorTopicParams>;
1974
+ onEntryBeforePublish: Topic<OnEntryBeforePublishTopicParams>;
1975
+ onEntryAfterPublish: Topic<OnEntryAfterPublishTopicParams>;
1976
+ onEntryPublishError: Topic<OnEntryPublishErrorTopicParams>;
1977
+ onEntryBeforeUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
1978
+ onEntryAfterUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
1979
+ onEntryUnpublishError: Topic<OnEntryUnpublishErrorTopicParams>;
1980
+ onEntryBeforeGet: Topic<OnEntryBeforeGetTopicParams>;
1981
+ onEntryBeforeList: Topic<EntryBeforeListTopicParams>;
1566
1982
  }
1567
1983
  /**
1568
1984
  * Parameters for CmsEntryResolverFactory.
@@ -1589,15 +2005,22 @@ export declare type CmsEntryResolverFactory<TSource = any, TArgs = any, TContext
1589
2005
  */
1590
2006
  export interface CmsSettingsPermission extends SecurityPermission {
1591
2007
  }
2008
+ /**
2009
+ * A base security permission for CMS.
2010
+ *
2011
+ * @category SecurityPermission
2012
+ */
2013
+ export interface BaseCmsSecurityPermission extends SecurityPermission {
2014
+ own?: boolean;
2015
+ rwd: string | number;
2016
+ }
1592
2017
  /**
1593
2018
  * A security permission for content model.
1594
2019
  *
1595
2020
  * @category SecurityPermission
1596
2021
  * @category CmsModel
1597
2022
  */
1598
- export interface CmsModelPermission extends SecurityPermission {
1599
- own: boolean;
1600
- rwd: string;
2023
+ export interface CmsModelPermission extends BaseCmsSecurityPermission {
1601
2024
  /**
1602
2025
  * A object representing `key: model.modelId` values where key is locale code.
1603
2026
  */
@@ -1617,9 +2040,7 @@ export interface CmsModelPermission extends SecurityPermission {
1617
2040
  * @category SecurityPermission
1618
2041
  * @category CmsGroup
1619
2042
  */
1620
- export interface CmsGroupPermission extends SecurityPermission {
1621
- own: boolean;
1622
- rwd: string;
2043
+ export interface CmsGroupPermission extends BaseCmsSecurityPermission {
1623
2044
  /**
1624
2045
  * A object representing `key: group.id` values where key is locale code.
1625
2046
  */
@@ -1633,10 +2054,8 @@ export interface CmsGroupPermission extends SecurityPermission {
1633
2054
  * @category SecurityPermission
1634
2055
  * @category CmsEntry
1635
2056
  */
1636
- export interface CmsEntryPermission extends SecurityPermission {
1637
- own: boolean;
1638
- rwd: string;
1639
- pw: string;
2057
+ export interface CmsEntryPermission extends BaseCmsSecurityPermission {
2058
+ pw?: string;
1640
2059
  /**
1641
2060
  * A object representing `key: model.modelId` values where key is locale code.
1642
2061
  */
@@ -1665,13 +2084,10 @@ export interface CmsGroupStorageOperationsListParams {
1665
2084
  sort?: string[];
1666
2085
  }
1667
2086
  export interface CmsGroupStorageOperationsCreateParams {
1668
- input: CmsGroupCreateInput;
1669
2087
  group: CmsGroup;
1670
2088
  }
1671
2089
  export interface CmsGroupStorageOperationsUpdateParams {
1672
- original: CmsGroup;
1673
2090
  group: CmsGroup;
1674
- input: CmsGroupUpdateInput;
1675
2091
  }
1676
2092
  export interface CmsGroupStorageOperationsDeleteParams {
1677
2093
  group: CmsGroup;
@@ -1717,13 +2133,10 @@ export interface CmsModelStorageOperationsListParams {
1717
2133
  where: CmsModelStorageOperationsListWhereParams;
1718
2134
  }
1719
2135
  export interface CmsModelStorageOperationsCreateParams {
1720
- input: CmsModelCreateInput;
1721
2136
  model: CmsModel;
1722
2137
  }
1723
2138
  export interface CmsModelStorageOperationsUpdateParams {
1724
- original: CmsModel;
1725
2139
  model: CmsModel;
1726
- input: CmsModelUpdateInput;
1727
2140
  }
1728
2141
  export interface CmsModelStorageOperationsDeleteParams {
1729
2142
  model: CmsModel;
@@ -1763,14 +2176,12 @@ export interface CmsEntryStorageOperationsGetParams {
1763
2176
  export interface CmsEntryStorageOperationsListParams {
1764
2177
  where: CmsEntryListWhere;
1765
2178
  sort?: CmsEntryListSort;
2179
+ search?: string;
2180
+ fields?: string[];
1766
2181
  limit?: number;
1767
- after?: string;
2182
+ after?: string | null;
1768
2183
  }
1769
2184
  export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry = CmsStorageEntry> {
1770
- /**
1771
- * Input received from the user.
1772
- */
1773
- input: Record<string, any>;
1774
2185
  /**
1775
2186
  * Real entry, with no transformations on it.
1776
2187
  */
@@ -1781,22 +2192,6 @@ export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry
1781
2192
  storageEntry: T;
1782
2193
  }
1783
2194
  export interface CmsEntryStorageOperationsCreateRevisionFromParams<T extends CmsStorageEntry = CmsStorageEntry> {
1784
- /**
1785
- * The entry we are creating new one from.
1786
- */
1787
- originalEntry: CmsEntry;
1788
- /**
1789
- * The entry we are creating new one from, directly from storage, with transformations on it.
1790
- */
1791
- originalStorageEntry: T;
1792
- /**
1793
- * Latest entry, used to calculate the new version.
1794
- */
1795
- latestEntry: CmsEntry;
1796
- /**
1797
- * Latest entry, used to calculate the new version, directly from storage, with transformations.
1798
- */
1799
- latestStorageEntry: T;
1800
2195
  /**
1801
2196
  * Real entry, with no transformations on it.
1802
2197
  */
@@ -1807,18 +2202,6 @@ export interface CmsEntryStorageOperationsCreateRevisionFromParams<T extends Cms
1807
2202
  storageEntry: T;
1808
2203
  }
1809
2204
  export interface CmsEntryStorageOperationsUpdateParams<T extends CmsStorageEntry = CmsStorageEntry> {
1810
- /**
1811
- * Input received from the user.
1812
- */
1813
- input: Record<string, any>;
1814
- /**
1815
- * Used to compare IDs, versions and passed into storage operations to be used if required.
1816
- */
1817
- originalEntry: CmsEntry;
1818
- /**
1819
- * Directly from storage, with transformations on it.
1820
- */
1821
- originalStorageEntry: T;
1822
2205
  /**
1823
2206
  * Real entry, with no transformations on it.
1824
2207
  */
@@ -1832,39 +2215,27 @@ export interface CmsEntryStorageOperationsDeleteRevisionParams<T extends CmsStor
1832
2215
  /**
1833
2216
  * Entry that was deleted.
1834
2217
  */
1835
- entryToDelete: CmsEntry;
2218
+ entry: CmsEntry;
1836
2219
  /**
1837
2220
  * Entry that was deleted, directly from storage, with transformations.
1838
2221
  */
1839
- storageEntryToDelete: T;
2222
+ storageEntry: T;
1840
2223
  /**
1841
2224
  * Entry that was set as latest.
1842
2225
  */
1843
- entryToSetAsLatest?: CmsEntry;
2226
+ latestEntry: CmsEntry | null;
1844
2227
  /**
1845
2228
  * Entry that was set as latest, directly from storage, with transformations.
1846
2229
  */
1847
- storageEntryToSetAsLatest?: T;
2230
+ latestStorageEntry: T | null;
1848
2231
  }
1849
- export interface CmsEntryStorageOperationsDeleteParams<T extends CmsStorageEntry = CmsStorageEntry> {
2232
+ export interface CmsEntryStorageOperationsDeleteParams {
1850
2233
  /**
1851
2234
  * Entry that is going to be deleted.
1852
2235
  */
1853
2236
  entry: CmsEntry;
1854
- /**
1855
- * Entry that is going to be deleted, directly from storage.
1856
- */
1857
- storageEntry: T;
1858
2237
  }
1859
2238
  export interface CmsEntryStorageOperationsPublishParams<T extends CmsStorageEntry = CmsStorageEntry> {
1860
- /**
1861
- * The entry record before it was published.
1862
- */
1863
- originalEntry: CmsEntry;
1864
- /**
1865
- * Directly from storage, with transformations on it.
1866
- */
1867
- originalStorageEntry: T;
1868
2239
  /**
1869
2240
  * The modified entry that is going to be saved as published.
1870
2241
  * Entry is in its original form.
@@ -1876,14 +2247,6 @@ export interface CmsEntryStorageOperationsPublishParams<T extends CmsStorageEntr
1876
2247
  storageEntry: T;
1877
2248
  }
1878
2249
  export interface CmsEntryStorageOperationsUnpublishParams<T extends CmsStorageEntry = CmsStorageEntry> {
1879
- /**
1880
- * The entry record before it was unpublished.
1881
- */
1882
- originalEntry: CmsEntry;
1883
- /**
1884
- * The entry record before it was unpublished, with transformations on it.
1885
- */
1886
- originalStorageEntry: T;
1887
2250
  /**
1888
2251
  * The modified entry that is going to be saved as unpublished.
1889
2252
  */
@@ -1893,45 +2256,6 @@ export interface CmsEntryStorageOperationsUnpublishParams<T extends CmsStorageEn
1893
2256
  */
1894
2257
  storageEntry: T;
1895
2258
  }
1896
- export interface CmsEntryStorageOperationsRequestChangesParams<T extends CmsStorageEntry = CmsStorageEntry> {
1897
- /**
1898
- * Entry data updated with the required properties.
1899
- */
1900
- entry: CmsEntry;
1901
- /**
1902
- * Entry that is prepared for the storageOperations, with the transformations.
1903
- */
1904
- storageEntry: T;
1905
- /**
1906
- * Original entry from the storage.
1907
- */
1908
- originalEntry: CmsEntry;
1909
- /**
1910
- * Original entry to be updated, directly from storage, with the transformations.
1911
- */
1912
- originalStorageEntry: T;
1913
- }
1914
- export interface CmsEntryStorageOperationsRequestReviewParams<T extends CmsStorageEntry = CmsStorageEntry> {
1915
- /**
1916
- * Entry that is prepared for the storageOperations.
1917
- */
1918
- entry: CmsEntry;
1919
- /**
1920
- * Entry that is prepared for the storageOperations, with the transformations.
1921
- */
1922
- storageEntry: T;
1923
- /**
1924
- * Original entry from the storage.
1925
- */
1926
- originalEntry: CmsEntry;
1927
- /**
1928
- * Original entry to be updated, directly from storage, with the transformations.
1929
- */
1930
- originalStorageEntry: T;
1931
- }
1932
- export interface CmsEntryStorageOperationsGetAllRevisionsParams {
1933
- ids: readonly string[];
1934
- }
1935
2259
  export interface CmsEntryStorageOperationsGetByIdsParams {
1936
2260
  ids: readonly string[];
1937
2261
  }
@@ -1988,90 +2312,76 @@ export interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorag
1988
2312
  /**
1989
2313
  * Get all the entries of the ids.
1990
2314
  */
1991
- getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
2315
+ getByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
1992
2316
  /**
1993
2317
  * Get all the published entries of the ids.
1994
2318
  */
1995
- getPublishedByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
2319
+ getPublishedByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
1996
2320
  /**
1997
2321
  * Get all the latest entries of the ids.
1998
2322
  */
1999
- getLatestByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
2323
+ getLatestByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
2000
2324
  /**
2001
2325
  * Get all revisions of the given entry id.
2002
2326
  */
2003
- getRevisions: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
2004
- /**
2005
- * Get all revisions of all of the given IDs.
2006
- */
2007
- getAllRevisionsByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetAllRevisionsParams) => Promise<T[]>;
2327
+ getRevisions: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
2008
2328
  /**
2009
2329
  * Get the entry by the given revision id.
2010
2330
  */
2011
- getRevisionById: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
2331
+ getRevisionById: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
2012
2332
  /**
2013
2333
  * Get the published entry by given entryId.
2014
2334
  */
2015
- getPublishedRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
2335
+ getPublishedRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
2016
2336
  /**
2017
2337
  * Get the latest entry by given entryId.
2018
2338
  */
2019
- getLatestRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
2339
+ getLatestRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
2020
2340
  /**
2021
2341
  * Get the revision of the entry before given one.
2022
2342
  */
2023
- getPreviousRevision: (model: CmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
2343
+ getPreviousRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
2024
2344
  /**
2025
2345
  * Gets entry by given params.
2026
2346
  */
2027
- get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
2347
+ get: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
2028
2348
  /**
2029
2349
  * List all entries. Filterable via params.
2030
2350
  */
2031
- list: (model: CmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
2351
+ list: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
2032
2352
  /**
2033
2353
  * Create a new entry.
2034
2354
  */
2035
- create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
2355
+ create: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
2036
2356
  /**
2037
2357
  * Create a new entry from existing one.
2038
2358
  */
2039
- createRevisionFrom: (model: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
2359
+ createRevisionFrom: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
2040
2360
  /**
2041
2361
  * Update existing entry.
2042
2362
  */
2043
- update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
2363
+ update: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
2044
2364
  /**
2045
2365
  * Delete the entry revision.
2046
2366
  */
2047
- deleteRevision: (model: CmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
2367
+ deleteRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
2048
2368
  /**
2049
2369
  * Delete the entry.
2050
2370
  */
2051
- delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams<T>) => Promise<void>;
2371
+ delete: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
2052
2372
  /**
2053
2373
  * Publish the entry.
2054
2374
  */
2055
- publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
2375
+ publish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
2056
2376
  /**
2057
2377
  * Unpublish the entry.
2058
2378
  */
2059
- unpublish: (model: CmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
2060
- /**
2061
- * Request changes the entry.
2062
- */
2063
- requestChanges: (model: CmsModel, params: CmsEntryStorageOperationsRequestChangesParams<T>) => Promise<T>;
2064
- /**
2065
- * Request review the entry.
2066
- */
2067
- requestReview: (model: CmsModel, params: CmsEntryStorageOperationsRequestReviewParams<T>) => Promise<CmsEntry>;
2379
+ unpublish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
2068
2380
  }
2069
2381
  export declare enum CONTENT_ENTRY_STATUS {
2070
2382
  DRAFT = "draft",
2071
2383
  PUBLISHED = "published",
2072
- UNPUBLISHED = "unpublished",
2073
- CHANGES_REQUESTED = "changesRequested",
2074
- REVIEW_REQUESTED = "reviewRequested"
2384
+ UNPUBLISHED = "unpublished"
2075
2385
  }
2076
2386
  export interface CmsSettingsStorageOperationsGetParams {
2077
2387
  locale: string;
@@ -2081,7 +2391,6 @@ export interface CmsSettingsStorageOperationsCreateParams {
2081
2391
  settings: CmsSettings;
2082
2392
  }
2083
2393
  export interface CmsSettingsStorageOperationsUpdateParams {
2084
- original: CmsSettings;
2085
2394
  settings: CmsSettings;
2086
2395
  }
2087
2396
  export interface CmsSettingsStorageOperations {
@@ -2114,7 +2423,6 @@ export interface CmsSystemStorageOperationsCreateParams {
2114
2423
  }
2115
2424
  export interface CmsSystemStorageOperationsUpdateParams {
2116
2425
  system: CmsSystem;
2117
- original: CmsSystem;
2118
2426
  }
2119
2427
  export interface CmsSystemStorageOperations {
2120
2428
  /**
@@ -2130,17 +2438,17 @@ export interface CmsSystemStorageOperations {
2130
2438
  */
2131
2439
  update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;
2132
2440
  }
2133
- export interface HeadlessCmsStorageOperations {
2441
+ export interface HeadlessCmsStorageOperations<C = CmsContext> {
2134
2442
  system: CmsSystemStorageOperations;
2135
2443
  settings: CmsSettingsStorageOperations;
2136
2444
  groups: CmsGroupStorageOperations;
2137
2445
  models: CmsModelStorageOperations;
2138
2446
  entries: CmsEntryStorageOperations;
2139
- init?: (cms: HeadlessCms) => Promise<void>;
2140
2447
  /**
2141
- * Plugins to be attached to the main context.
2448
+ * Either attach something from the storage operations or run something in it.
2142
2449
  */
2143
- plugins?: Plugin[] | Plugin[][];
2450
+ beforeInit?: (context: C) => Promise<void>;
2451
+ init?: (context: C) => Promise<void>;
2144
2452
  /**
2145
2453
  * An upgrade to run if necessary.
2146
2454
  */