@webiny/api-headless-cms 0.0.0-mt-3 → 0.0.0-unstable.3386f66516

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 (614) hide show
  1. package/context.d.ts +6 -0
  2. package/context.js +119 -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 +14 -15
  18. package/crud/contentEntry/markLockedFields.js.map +1 -0
  19. package/crud/contentEntry/referenceFieldsMapping.d.ts +13 -0
  20. package/crud/contentEntry/referenceFieldsMapping.js +292 -0
  21. package/crud/contentEntry/referenceFieldsMapping.js.map +1 -0
  22. package/crud/contentEntry/searchableFields.d.ts +9 -0
  23. package/crud/contentEntry/searchableFields.js +83 -0
  24. package/crud/contentEntry/searchableFields.js.map +1 -0
  25. package/{content/plugins/crud → crud}/contentEntry.crud.d.ts +5 -9
  26. package/crud/contentEntry.crud.js +1309 -0
  27. package/crud/contentEntry.crud.js.map +1 -0
  28. package/crud/contentModel/afterCreate.d.ts +8 -0
  29. package/crud/contentModel/afterCreate.js +18 -0
  30. package/crud/contentModel/afterCreate.js.map +1 -0
  31. package/crud/contentModel/afterCreateFrom.d.ts +8 -0
  32. package/crud/contentModel/afterCreateFrom.js +18 -0
  33. package/crud/contentModel/afterCreateFrom.js.map +1 -0
  34. package/crud/contentModel/afterDelete.d.ts +8 -0
  35. package/crud/contentModel/afterDelete.js +18 -0
  36. package/crud/contentModel/afterDelete.js.map +1 -0
  37. package/crud/contentModel/afterUpdate.d.ts +8 -0
  38. package/crud/contentModel/afterUpdate.js +18 -0
  39. package/crud/contentModel/afterUpdate.js.map +1 -0
  40. package/crud/contentModel/beforeCreate.d.ts +14 -0
  41. package/{content/plugins/crud → crud}/contentModel/beforeCreate.js +61 -13
  42. package/crud/contentModel/beforeCreate.js.map +1 -0
  43. package/crud/contentModel/beforeDelete.d.ts +10 -0
  44. package/{content/plugins/crud → crud}/contentModel/beforeDelete.js +14 -10
  45. package/crud/contentModel/beforeDelete.js.map +1 -0
  46. package/crud/contentModel/beforeUpdate.d.ts +8 -0
  47. package/crud/contentModel/beforeUpdate.js +37 -0
  48. package/crud/contentModel/beforeUpdate.js.map +1 -0
  49. package/crud/contentModel/contentModelManagerFactory.d.ts +2 -0
  50. package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.js +0 -0
  51. package/crud/contentModel/contentModelManagerFactory.js.map +1 -0
  52. package/crud/contentModel/createFieldModels.d.ts +2 -0
  53. package/{content/plugins/crud → crud}/contentModel/createFieldModels.js +6 -2
  54. package/crud/contentModel/createFieldModels.js.map +1 -0
  55. package/crud/contentModel/createFieldStorageId.d.ts +2 -0
  56. package/crud/contentModel/createFieldStorageId.js +20 -0
  57. package/crud/contentModel/createFieldStorageId.js.map +1 -0
  58. package/crud/contentModel/fieldIdValidation.d.ts +1 -0
  59. package/crud/contentModel/fieldIdValidation.js +25 -0
  60. package/crud/contentModel/fieldIdValidation.js.map +1 -0
  61. package/crud/contentModel/idValidation.d.ts +1 -0
  62. package/{content/plugins/crud → crud}/contentModel/idValidation.js +3 -3
  63. package/crud/contentModel/idValidation.js.map +1 -0
  64. package/{content/plugins/crud → crud}/contentModel/models.d.ts +2 -1
  65. package/{content/plugins/crud → crud}/contentModel/models.js +76 -25
  66. package/crud/contentModel/models.js.map +1 -0
  67. package/crud/contentModel/systemFields.d.ts +1 -0
  68. package/crud/contentModel/systemFields.js +8 -0
  69. package/crud/contentModel/systemFields.js.map +1 -0
  70. package/crud/contentModel/validateLayout.d.ts +2 -0
  71. package/{content/plugins/crud → crud}/contentModel/validateLayout.js +1 -3
  72. package/crud/contentModel/validateLayout.js.map +1 -0
  73. package/crud/contentModel/validateModel.d.ts +8 -0
  74. package/crud/contentModel/validateModel.js +35 -0
  75. package/crud/contentModel/validateModel.js.map +1 -0
  76. package/crud/contentModel/validateModelFields.d.ts +8 -0
  77. package/crud/contentModel/validateModelFields.js +436 -0
  78. package/crud/contentModel/validateModelFields.js.map +1 -0
  79. package/crud/contentModel/validation.d.ts +477 -0
  80. package/crud/contentModel/validation.js +109 -0
  81. package/crud/contentModel/validation.js.map +1 -0
  82. package/{content/plugins/crud → crud}/contentModel.crud.d.ts +3 -3
  83. package/crud/contentModel.crud.js +642 -0
  84. package/crud/contentModel.crud.js.map +1 -0
  85. package/crud/contentModelGroup/beforeCreate.d.ts +10 -0
  86. package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.js +9 -9
  87. package/crud/contentModelGroup/beforeCreate.js.map +1 -0
  88. package/crud/contentModelGroup/beforeDelete.d.ts +10 -0
  89. package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.js +4 -4
  90. package/crud/contentModelGroup/beforeDelete.js.map +1 -0
  91. package/crud/contentModelGroup/beforeUpdate.d.ts +9 -0
  92. package/{content/plugins/crud → crud}/contentModelGroup/beforeUpdate.js +3 -3
  93. package/crud/contentModelGroup/beforeUpdate.js.map +1 -0
  94. package/crud/contentModelGroup/validation.d.ts +30 -0
  95. package/crud/contentModelGroup/validation.js +43 -0
  96. package/crud/contentModelGroup/validation.js.map +1 -0
  97. package/{content/plugins/crud → crud}/contentModelGroup.crud.d.ts +3 -3
  98. package/crud/contentModelGroup.crud.js +366 -0
  99. package/crud/contentModelGroup.crud.js.map +1 -0
  100. package/{plugins/crud → crud}/settings.crud.d.ts +3 -3
  101. package/crud/settings.crud.js +83 -0
  102. package/crud/settings.crud.js.map +1 -0
  103. package/{plugins/crud → crud}/system.crud.d.ts +6 -3
  104. package/crud/system.crud.js +221 -0
  105. package/crud/system.crud.js.map +1 -0
  106. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.d.ts +7 -0
  107. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +66 -0
  108. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -0
  109. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.d.ts +11 -0
  110. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +239 -0
  111. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -0
  112. package/fieldConverters/CmsModelObjectFieldConverterPlugin.d.ts +11 -0
  113. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +304 -0
  114. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -0
  115. package/fieldConverters/index.d.ts +4 -0
  116. package/fieldConverters/index.js +18 -0
  117. package/fieldConverters/index.js.map +1 -0
  118. package/graphql/buildSchemaPlugins.d.ts +11 -0
  119. package/graphql/buildSchemaPlugins.js +24 -0
  120. package/graphql/buildSchemaPlugins.js.map +1 -0
  121. package/graphql/createExecutableSchema.d.ts +7 -0
  122. package/graphql/createExecutableSchema.js +33 -0
  123. package/graphql/createExecutableSchema.js.map +1 -0
  124. package/graphql/generateSchema.d.ts +8 -0
  125. package/graphql/generateSchema.js +38 -0
  126. package/graphql/generateSchema.js.map +1 -0
  127. package/graphql/graphQLHandlerFactory.d.ts +5 -0
  128. package/graphql/graphQLHandlerFactory.js +202 -0
  129. package/graphql/graphQLHandlerFactory.js.map +1 -0
  130. package/graphql/index.d.ts +3 -0
  131. package/graphql/index.js +18 -0
  132. package/graphql/index.js.map +1 -0
  133. package/graphql/schema/baseContentSchema.d.ts +7 -0
  134. package/graphql/schema/baseContentSchema.js +78 -0
  135. package/graphql/schema/baseContentSchema.js.map +1 -0
  136. package/graphql/schema/baseSchema.d.ts +3 -0
  137. package/graphql/schema/baseSchema.js +60 -0
  138. package/graphql/schema/baseSchema.js.map +1 -0
  139. package/graphql/schema/contentEntries.d.ts +7 -0
  140. package/graphql/schema/contentEntries.js +357 -0
  141. package/graphql/schema/contentEntries.js.map +1 -0
  142. package/graphql/schema/contentModelGroups.d.ts +7 -0
  143. package/{content/plugins → graphql}/schema/contentModelGroups.js +40 -17
  144. package/graphql/schema/contentModelGroups.js.map +1 -0
  145. package/graphql/schema/contentModels.d.ts +7 -0
  146. package/{content/plugins → graphql}/schema/contentModels.js +108 -13
  147. package/graphql/schema/contentModels.js.map +1 -0
  148. package/graphql/schema/createFieldResolvers.d.ts +20 -0
  149. package/graphql/schema/createFieldResolvers.js +133 -0
  150. package/graphql/schema/createFieldResolvers.js.map +1 -0
  151. package/graphql/schema/createManageResolvers.d.ts +12 -0
  152. package/{content/plugins → graphql}/schema/createManageResolvers.js +36 -34
  153. package/graphql/schema/createManageResolvers.js.map +1 -0
  154. package/graphql/schema/createManageSDL.d.ts +12 -0
  155. package/{content/plugins → graphql}/schema/createManageSDL.js +31 -21
  156. package/graphql/schema/createManageSDL.js.map +1 -0
  157. package/graphql/schema/createPreviewResolvers.d.ts +12 -0
  158. package/graphql/schema/createPreviewResolvers.js +58 -0
  159. package/graphql/schema/createPreviewResolvers.js.map +1 -0
  160. package/graphql/schema/createReadResolvers.d.ts +12 -0
  161. package/graphql/schema/createReadResolvers.js +63 -0
  162. package/graphql/schema/createReadResolvers.js.map +1 -0
  163. package/graphql/schema/createReadSDL.d.ts +12 -0
  164. package/{content/plugins → graphql}/schema/createReadSDL.js +25 -13
  165. package/graphql/schema/createReadSDL.js.map +1 -0
  166. package/graphql/schema/resolvers/commonFieldResolvers.d.ts +6 -0
  167. package/{content/plugins → graphql}/schema/resolvers/commonFieldResolvers.js +0 -0
  168. package/graphql/schema/resolvers/commonFieldResolvers.js.map +1 -0
  169. package/graphql/schema/resolvers/manage/resolveCreate.d.ts +7 -0
  170. package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.js +2 -4
  171. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -0
  172. package/graphql/schema/resolvers/manage/resolveCreateFrom.d.ts +8 -0
  173. package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.js +2 -4
  174. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -0
  175. package/graphql/schema/resolvers/manage/resolveDelete.d.ts +7 -0
  176. package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.js +10 -8
  177. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -0
  178. package/graphql/schema/resolvers/manage/resolveGet.d.ts +7 -0
  179. package/graphql/schema/resolvers/manage/resolveGet.js +79 -0
  180. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -0
  181. package/graphql/schema/resolvers/manage/resolveGetByIds.d.ts +7 -0
  182. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.js +2 -4
  183. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -0
  184. package/graphql/schema/resolvers/manage/resolveGetRevisions.d.ts +7 -0
  185. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.js +2 -4
  186. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -0
  187. package/graphql/schema/resolvers/manage/resolveList.d.ts +4 -0
  188. package/{content/plugins/schema/resolvers/read → graphql/schema/resolvers/manage}/resolveList.js +2 -4
  189. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -0
  190. package/graphql/schema/resolvers/manage/resolvePublish.d.ts +7 -0
  191. package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.js +0 -0
  192. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -0
  193. package/graphql/schema/resolvers/manage/resolveRepublish.d.ts +7 -0
  194. package/{content/plugins/schema/resolvers/manage/resolveGet.js → graphql/schema/resolvers/manage/resolveRepublish.js} +4 -4
  195. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -0
  196. package/graphql/schema/resolvers/manage/resolveUnpublish.d.ts +7 -0
  197. package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.js +0 -0
  198. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -0
  199. package/graphql/schema/resolvers/manage/resolveUpdate.d.ts +8 -0
  200. package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.js +2 -4
  201. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -0
  202. package/graphql/schema/resolvers/preview/resolveGet.d.ts +4 -0
  203. package/graphql/schema/resolvers/preview/resolveGet.js +34 -0
  204. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -0
  205. package/graphql/schema/resolvers/preview/resolveList.d.ts +4 -0
  206. package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.js +2 -4
  207. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -0
  208. package/graphql/schema/resolvers/read/resolveGet.d.ts +4 -0
  209. package/graphql/schema/resolvers/read/resolveGet.js +34 -0
  210. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -0
  211. package/graphql/schema/resolvers/read/resolveList.d.ts +4 -0
  212. package/{content/plugins/schema/resolvers/manage → graphql/schema/resolvers/read}/resolveList.js +2 -4
  213. package/graphql/schema/resolvers/read/resolveList.js.map +1 -0
  214. package/graphql/schema/schemaPlugins.d.ts +8 -0
  215. package/graphql/schema/schemaPlugins.js +119 -0
  216. package/graphql/schema/schemaPlugins.js.map +1 -0
  217. package/graphql/system.d.ts +6 -0
  218. package/{plugins/graphql → graphql}/system.js +50 -6
  219. package/graphql/system.js.map +1 -0
  220. package/graphqlFields/boolean.d.ts +2 -0
  221. package/graphqlFields/boolean.js +69 -0
  222. package/graphqlFields/boolean.js.map +1 -0
  223. package/graphqlFields/datetime.d.ts +2 -0
  224. package/graphqlFields/datetime.js +95 -0
  225. package/graphqlFields/datetime.js.map +1 -0
  226. package/graphqlFields/dynamicZone/dynamicZoneField.d.ts +2 -0
  227. package/graphqlFields/dynamicZone/dynamicZoneField.js +234 -0
  228. package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -0
  229. package/graphqlFields/dynamicZone/dynamicZoneStorage.d.ts +3 -0
  230. package/graphqlFields/dynamicZone/dynamicZoneStorage.js +79 -0
  231. package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +1 -0
  232. package/graphqlFields/dynamicZone/index.d.ts +2 -0
  233. package/graphqlFields/dynamicZone/index.js +21 -0
  234. package/graphqlFields/dynamicZone/index.js.map +1 -0
  235. package/graphqlFields/file.d.ts +2 -0
  236. package/graphqlFields/file.js +50 -0
  237. package/graphqlFields/file.js.map +1 -0
  238. package/graphqlFields/helpers.d.ts +6 -0
  239. package/graphqlFields/helpers.js +49 -0
  240. package/graphqlFields/helpers.js.map +1 -0
  241. package/graphqlFields/index.d.ts +2 -0
  242. package/graphqlFields/index.js +30 -0
  243. package/graphqlFields/index.js.map +1 -0
  244. package/graphqlFields/longText.d.ts +2 -0
  245. package/graphqlFields/longText.js +63 -0
  246. package/graphqlFields/longText.js.map +1 -0
  247. package/graphqlFields/number.d.ts +2 -0
  248. package/graphqlFields/number.js +79 -0
  249. package/graphqlFields/number.js.map +1 -0
  250. package/graphqlFields/object.d.ts +2 -0
  251. package/graphqlFields/object.js +275 -0
  252. package/graphqlFields/object.js.map +1 -0
  253. package/graphqlFields/ref.d.ts +2 -0
  254. package/graphqlFields/ref.js +261 -0
  255. package/graphqlFields/ref.js.map +1 -0
  256. package/graphqlFields/richText.d.ts +2 -0
  257. package/graphqlFields/richText.js +56 -0
  258. package/graphqlFields/richText.js.map +1 -0
  259. package/graphqlFields/text.d.ts +2 -0
  260. package/graphqlFields/text.js +73 -0
  261. package/graphqlFields/text.js.map +1 -0
  262. package/index.d.ts +10 -12
  263. package/index.js +75 -36
  264. package/index.js.map +1 -0
  265. package/modelManager/DefaultCmsModelManager.d.ts +14 -0
  266. package/{content/plugins/modelManager → modelManager}/DefaultCmsModelManager.js +12 -10
  267. package/modelManager/DefaultCmsModelManager.js.map +1 -0
  268. package/modelManager/index.d.ts +2 -0
  269. package/{content/plugins/modelManager → modelManager}/index.js +3 -3
  270. package/modelManager/index.js.map +1 -0
  271. package/package.json +38 -38
  272. package/parameters/context.d.ts +2 -0
  273. package/parameters/context.js +22 -0
  274. package/parameters/context.js.map +1 -0
  275. package/parameters/header.d.ts +2 -0
  276. package/parameters/header.js +55 -0
  277. package/parameters/header.js.map +1 -0
  278. package/parameters/index.d.ts +4 -0
  279. package/parameters/index.js +57 -0
  280. package/parameters/index.js.map +1 -0
  281. package/parameters/manual.d.ts +6 -0
  282. package/parameters/manual.js +44 -0
  283. package/parameters/manual.js.map +1 -0
  284. package/parameters/path.d.ts +2 -0
  285. package/parameters/path.js +51 -0
  286. package/parameters/path.js.map +1 -0
  287. package/plugins/CmsGraphQLSchemaPlugin.d.ts +5 -0
  288. package/plugins/CmsGraphQLSchemaPlugin.js +17 -0
  289. package/plugins/CmsGraphQLSchemaPlugin.js.map +1 -0
  290. package/plugins/CmsGraphQLSchemaSorterPlugin.d.ts +20 -0
  291. package/plugins/CmsGraphQLSchemaSorterPlugin.js +38 -0
  292. package/plugins/CmsGraphQLSchemaSorterPlugin.js.map +1 -0
  293. package/plugins/CmsGroupPlugin.d.ts +13 -0
  294. package/{content/plugins → plugins}/CmsGroupPlugin.js +9 -3
  295. package/plugins/CmsGroupPlugin.js.map +1 -0
  296. package/plugins/CmsModelFieldConverterPlugin.d.ts +14 -0
  297. package/plugins/CmsModelFieldConverterPlugin.js +17 -0
  298. package/plugins/CmsModelFieldConverterPlugin.js.map +1 -0
  299. package/plugins/CmsModelPlugin.d.ts +45 -0
  300. package/plugins/CmsModelPlugin.js +194 -0
  301. package/plugins/CmsModelPlugin.js.map +1 -0
  302. package/plugins/CmsParametersPlugin.d.ts +20 -0
  303. package/plugins/CmsParametersPlugin.js +28 -0
  304. package/plugins/CmsParametersPlugin.js.map +1 -0
  305. package/plugins/StorageTransformPlugin.d.ts +31 -0
  306. package/{content/plugins/storage → plugins}/StorageTransformPlugin.js +2 -1
  307. package/plugins/StorageTransformPlugin.js.map +1 -0
  308. package/plugins/index.d.ts +7 -0
  309. package/plugins/index.js +96 -0
  310. package/plugins/index.js.map +1 -0
  311. package/storage/default.d.ts +2 -0
  312. package/storage/default.js +27 -0
  313. package/storage/default.js.map +1 -0
  314. package/storage/object.d.ts +2 -0
  315. package/storage/object.js +127 -0
  316. package/storage/object.js.map +1 -0
  317. package/types.d.ts +878 -387
  318. package/types.js +130 -8
  319. package/types.js.map +1 -0
  320. package/upgrades/5.33.0/index.d.ts +3 -0
  321. package/upgrades/5.33.0/index.js +182 -0
  322. package/upgrades/5.33.0/index.js.map +1 -0
  323. package/upgrades/index.d.ts +1 -0
  324. package/upgrades/index.js +12 -0
  325. package/upgrades/index.js.map +1 -0
  326. package/utils/access.d.ts +8 -0
  327. package/utils/access.js +90 -0
  328. package/utils/access.js.map +1 -0
  329. package/utils/converters/Converter.d.ts +27 -0
  330. package/utils/converters/Converter.js +71 -0
  331. package/utils/converters/Converter.js.map +1 -0
  332. package/utils/converters/ConverterCollection.d.ts +31 -0
  333. package/utils/converters/ConverterCollection.js +143 -0
  334. package/utils/converters/ConverterCollection.js.map +1 -0
  335. package/utils/converters/valueKeyStorageConverter.d.ts +18 -0
  336. package/utils/converters/valueKeyStorageConverter.js +148 -0
  337. package/utils/converters/valueKeyStorageConverter.js.map +1 -0
  338. package/utils/createTypeFromFields.d.ts +15 -0
  339. package/utils/createTypeFromFields.js +75 -0
  340. package/utils/createTypeFromFields.js.map +1 -0
  341. package/{content/plugins/utils → utils}/createTypeName.d.ts +3 -3
  342. package/{content/plugins/utils → utils}/createTypeName.js +4 -2
  343. package/utils/createTypeName.js.map +1 -0
  344. package/{content/plugins/utils → utils}/entryStorage.d.ts +3 -3
  345. package/{content/plugins/utils → utils}/entryStorage.js +18 -23
  346. package/utils/entryStorage.js.map +1 -0
  347. package/utils/filterAsync.d.ts +1 -0
  348. package/utils/filterAsync.js +23 -0
  349. package/utils/filterAsync.js.map +1 -0
  350. package/utils/getBaseFieldType.d.ts +4 -0
  351. package/utils/getBaseFieldType.js +12 -0
  352. package/utils/getBaseFieldType.js.map +1 -0
  353. package/utils/getEntryTitle.d.ts +2 -0
  354. package/{content/plugins/utils → utils}/getEntryTitle.js +7 -6
  355. package/utils/getEntryTitle.js.map +1 -0
  356. package/utils/getSchemaFromFieldPlugins.d.ts +9 -0
  357. package/utils/getSchemaFromFieldPlugins.js +48 -0
  358. package/utils/getSchemaFromFieldPlugins.js.map +1 -0
  359. package/utils/ownership.d.ts +8 -0
  360. package/utils/ownership.js +41 -0
  361. package/utils/ownership.js.map +1 -0
  362. package/utils/permissions.d.ts +7 -0
  363. package/utils/permissions.js +106 -0
  364. package/utils/permissions.js.map +1 -0
  365. package/utils/pluralizedTypeName.d.ts +1 -0
  366. package/{content/plugins/utils → utils}/pluralizedTypeName.js +1 -1
  367. package/utils/pluralizedTypeName.js.map +1 -0
  368. package/utils/renderFields.d.ts +15 -0
  369. package/{content/plugins/utils → utils}/renderFields.js +7 -3
  370. package/utils/renderFields.js.map +1 -0
  371. package/utils/renderGetFilterFields.d.ts +10 -0
  372. package/utils/renderGetFilterFields.js +61 -0
  373. package/utils/renderGetFilterFields.js.map +1 -0
  374. package/utils/renderInputFields.d.ts +14 -0
  375. package/{content/plugins/utils → utils}/renderInputFields.js +4 -2
  376. package/utils/renderInputFields.js.map +1 -0
  377. package/utils/renderListFilterFields.d.ts +11 -0
  378. package/{content/plugins/utils → utils}/renderListFilterFields.js +40 -17
  379. package/utils/renderListFilterFields.js.map +1 -0
  380. package/utils/renderSortEnum.d.ts +12 -0
  381. package/utils/renderSortEnum.js +51 -0
  382. package/utils/renderSortEnum.js.map +1 -0
  383. package/utils/toSlug.d.ts +1 -0
  384. package/utils/toSlug.js +20 -0
  385. package/utils/toSlug.js.map +1 -0
  386. package/validators/dateGte.d.ts +2 -0
  387. package/{content/plugins/validators → validators}/dateGte.js +4 -4
  388. package/validators/dateGte.js.map +1 -0
  389. package/validators/dateLte.d.ts +2 -0
  390. package/{content/plugins/validators → validators}/dateLte.js +4 -4
  391. package/validators/dateLte.js.map +1 -0
  392. package/validators/dynamicZone.d.ts +2 -0
  393. package/validators/dynamicZone.js +24 -0
  394. package/validators/dynamicZone.js.map +1 -0
  395. package/validators/gte.d.ts +2 -0
  396. package/validators/gte.js +36 -0
  397. package/validators/gte.js.map +1 -0
  398. package/validators/in.d.ts +2 -0
  399. package/validators/in.js +36 -0
  400. package/validators/in.js.map +1 -0
  401. package/validators/index.d.ts +1 -0
  402. package/validators/index.js +38 -0
  403. package/validators/index.js.map +1 -0
  404. package/validators/lte.d.ts +2 -0
  405. package/validators/lte.js +36 -0
  406. package/validators/lte.js.map +1 -0
  407. package/validators/maxLength.d.ts +2 -0
  408. package/validators/maxLength.js +36 -0
  409. package/validators/maxLength.js.map +1 -0
  410. package/validators/minLength.d.ts +2 -0
  411. package/validators/minLength.js +36 -0
  412. package/validators/minLength.js.map +1 -0
  413. package/validators/pattern.d.ts +2 -0
  414. package/validators/pattern.js +50 -0
  415. package/validators/pattern.js.map +1 -0
  416. package/validators/patternPlugins/email.d.ts +2 -0
  417. package/validators/patternPlugins/email.js +20 -0
  418. package/validators/patternPlugins/email.js.map +1 -0
  419. package/validators/patternPlugins/index.d.ts +2 -0
  420. package/validators/patternPlugins/index.js +24 -0
  421. package/validators/patternPlugins/index.js.map +1 -0
  422. package/validators/patternPlugins/lowerCase.d.ts +2 -0
  423. package/validators/patternPlugins/lowerCase.js +20 -0
  424. package/validators/patternPlugins/lowerCase.js.map +1 -0
  425. package/validators/patternPlugins/lowerCaseSpace.d.ts +2 -0
  426. package/validators/patternPlugins/lowerCaseSpace.js +20 -0
  427. package/validators/patternPlugins/lowerCaseSpace.js.map +1 -0
  428. package/validators/patternPlugins/upperCase.d.ts +2 -0
  429. package/validators/patternPlugins/upperCase.js +20 -0
  430. package/validators/patternPlugins/upperCase.js.map +1 -0
  431. package/validators/patternPlugins/upperCaseSpace.d.ts +2 -0
  432. package/validators/patternPlugins/upperCaseSpace.js +20 -0
  433. package/validators/patternPlugins/upperCaseSpace.js.map +1 -0
  434. package/validators/patternPlugins/url.d.ts +2 -0
  435. package/validators/patternPlugins/url.js +20 -0
  436. package/validators/patternPlugins/url.js.map +1 -0
  437. package/validators/required.d.ts +2 -0
  438. package/validators/required.js +27 -0
  439. package/validators/required.js.map +1 -0
  440. package/validators/timeGte.d.ts +2 -0
  441. package/{content/plugins/validators → validators}/timeGte.js +6 -4
  442. package/validators/timeGte.js.map +1 -0
  443. package/validators/timeLte.d.ts +2 -0
  444. package/{content/plugins/validators → validators}/timeLte.js +6 -4
  445. package/validators/timeLte.js.map +1 -0
  446. package/validators/unique.d.ts +6 -0
  447. package/validators/unique.js +63 -0
  448. package/validators/unique.js.map +1 -0
  449. package/content/contextSetup.d.ts +0 -4
  450. package/content/contextSetup.js +0 -65
  451. package/content/graphQLHandlerFactory.d.ts +0 -5
  452. package/content/graphQLHandlerFactory.js +0 -173
  453. package/content/plugins/CmsGroupPlugin.d.ts +0 -11
  454. package/content/plugins/CmsModelPlugin.d.ts +0 -11
  455. package/content/plugins/CmsModelPlugin.js +0 -24
  456. package/content/plugins/buildSchemaPlugins.d.ts +0 -7
  457. package/content/plugins/buildSchemaPlugins.js +0 -29
  458. package/content/plugins/crud/contentEntry/afterDelete.d.ts +0 -7
  459. package/content/plugins/crud/contentEntry/beforeCreate.d.ts +0 -7
  460. package/content/plugins/crud/contentEntry/beforeUpdate.d.ts +0 -7
  461. package/content/plugins/crud/contentEntry/entryDataValidation.d.ts +0 -4
  462. package/content/plugins/crud/contentEntry.crud.js +0 -931
  463. package/content/plugins/crud/contentModel/afterCreate.d.ts +0 -7
  464. package/content/plugins/crud/contentModel/afterCreate.js +0 -18
  465. package/content/plugins/crud/contentModel/afterDelete.d.ts +0 -7
  466. package/content/plugins/crud/contentModel/afterDelete.js +0 -18
  467. package/content/plugins/crud/contentModel/afterUpdate.d.ts +0 -7
  468. package/content/plugins/crud/contentModel/afterUpdate.js +0 -18
  469. package/content/plugins/crud/contentModel/beforeCreate.d.ts +0 -9
  470. package/content/plugins/crud/contentModel/beforeDelete.d.ts +0 -9
  471. package/content/plugins/crud/contentModel/beforeUpdate.d.ts +0 -9
  472. package/content/plugins/crud/contentModel/beforeUpdate.js +0 -128
  473. package/content/plugins/crud/contentModel/contentModelManagerFactory.d.ts +0 -2
  474. package/content/plugins/crud/contentModel/createFieldModels.d.ts +0 -2
  475. package/content/plugins/crud/contentModel/idValidation.d.ts +0 -2
  476. package/content/plugins/crud/contentModel/validateLayout.d.ts +0 -2
  477. package/content/plugins/crud/contentModel.crud.js +0 -425
  478. package/content/plugins/crud/contentModelGroup/beforeCreate.d.ts +0 -9
  479. package/content/plugins/crud/contentModelGroup/beforeDelete.d.ts +0 -9
  480. package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +0 -8
  481. package/content/plugins/crud/contentModelGroup.crud.js +0 -351
  482. package/content/plugins/crud/index.d.ts +0 -6
  483. package/content/plugins/crud/index.js +0 -100
  484. package/content/plugins/graphqlFields/boolean.d.ts +0 -3
  485. package/content/plugins/graphqlFields/boolean.js +0 -69
  486. package/content/plugins/graphqlFields/datetime.d.ts +0 -3
  487. package/content/plugins/graphqlFields/datetime.js +0 -83
  488. package/content/plugins/graphqlFields/file.d.ts +0 -3
  489. package/content/plugins/graphqlFields/file.js +0 -49
  490. package/content/plugins/graphqlFields/index.d.ts +0 -2
  491. package/content/plugins/graphqlFields/index.js +0 -30
  492. package/content/plugins/graphqlFields/longText.d.ts +0 -3
  493. package/content/plugins/graphqlFields/longText.js +0 -62
  494. package/content/plugins/graphqlFields/number.d.ts +0 -3
  495. package/content/plugins/graphqlFields/number.js +0 -75
  496. package/content/plugins/graphqlFields/object.d.ts +0 -3
  497. package/content/plugins/graphqlFields/object.js +0 -180
  498. package/content/plugins/graphqlFields/ref.d.ts +0 -3
  499. package/content/plugins/graphqlFields/ref.js +0 -205
  500. package/content/plugins/graphqlFields/richText.d.ts +0 -3
  501. package/content/plugins/graphqlFields/richText.js +0 -55
  502. package/content/plugins/graphqlFields/text.d.ts +0 -3
  503. package/content/plugins/graphqlFields/text.js +0 -72
  504. package/content/plugins/internalSecurity/InternalAuthenticationPlugin.d.ts +0 -8
  505. package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +0 -54
  506. package/content/plugins/internalSecurity/InternalAuthorizationPlugin.d.ts +0 -7
  507. package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +0 -35
  508. package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +0 -15
  509. package/content/plugins/modelManager/index.d.ts +0 -3
  510. package/content/plugins/schema/baseSchema.d.ts +0 -4
  511. package/content/plugins/schema/baseSchema.js +0 -98
  512. package/content/plugins/schema/contentEntries.d.ts +0 -4
  513. package/content/plugins/schema/contentEntries.js +0 -166
  514. package/content/plugins/schema/contentModelGroups.d.ts +0 -4
  515. package/content/plugins/schema/contentModels.d.ts +0 -4
  516. package/content/plugins/schema/createFieldResolvers.d.ts +0 -19
  517. package/content/plugins/schema/createFieldResolvers.js +0 -92
  518. package/content/plugins/schema/createManageResolvers.d.ts +0 -11
  519. package/content/plugins/schema/createManageSDL.d.ts +0 -9
  520. package/content/plugins/schema/createPreviewResolvers.d.ts +0 -10
  521. package/content/plugins/schema/createPreviewResolvers.js +0 -55
  522. package/content/plugins/schema/createReadResolvers.d.ts +0 -10
  523. package/content/plugins/schema/createReadResolvers.js +0 -55
  524. package/content/plugins/schema/createReadSDL.d.ts +0 -9
  525. package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +0 -6
  526. package/content/plugins/schema/resolvers/manage/resolveCreate.d.ts +0 -6
  527. package/content/plugins/schema/resolvers/manage/resolveCreateFrom.d.ts +0 -7
  528. package/content/plugins/schema/resolvers/manage/resolveDelete.d.ts +0 -2
  529. package/content/plugins/schema/resolvers/manage/resolveGet.d.ts +0 -2
  530. package/content/plugins/schema/resolvers/manage/resolveGetByIds.d.ts +0 -2
  531. package/content/plugins/schema/resolvers/manage/resolveGetRevisions.d.ts +0 -2
  532. package/content/plugins/schema/resolvers/manage/resolveList.d.ts +0 -2
  533. package/content/plugins/schema/resolvers/manage/resolvePublish.d.ts +0 -2
  534. package/content/plugins/schema/resolvers/manage/resolveRequestChanges.d.ts +0 -6
  535. package/content/plugins/schema/resolvers/manage/resolveRequestChanges.js +0 -23
  536. package/content/plugins/schema/resolvers/manage/resolveRequestReview.d.ts +0 -6
  537. package/content/plugins/schema/resolvers/manage/resolveRequestReview.js +0 -23
  538. package/content/plugins/schema/resolvers/manage/resolveUnpublish.d.ts +0 -2
  539. package/content/plugins/schema/resolvers/manage/resolveUpdate.d.ts +0 -7
  540. package/content/plugins/schema/resolvers/preview/resolveGet.d.ts +0 -2
  541. package/content/plugins/schema/resolvers/preview/resolveGet.js +0 -38
  542. package/content/plugins/schema/resolvers/preview/resolveList.d.ts +0 -2
  543. package/content/plugins/schema/resolvers/read/resolveGet.d.ts +0 -2
  544. package/content/plugins/schema/resolvers/read/resolveGet.js +0 -38
  545. package/content/plugins/schema/resolvers/read/resolveList.d.ts +0 -2
  546. package/content/plugins/schema/schemaPlugins.d.ts +0 -3
  547. package/content/plugins/schema/schemaPlugins.js +0 -92
  548. package/content/plugins/storage/StorageTransformPlugin.d.ts +0 -30
  549. package/content/plugins/storage/default.d.ts +0 -3
  550. package/content/plugins/storage/default.js +0 -28
  551. package/content/plugins/storage/object.d.ts +0 -3
  552. package/content/plugins/storage/object.js +0 -119
  553. package/content/plugins/utils/getEntryTitle.d.ts +0 -2
  554. package/content/plugins/utils/getSchemaFromFieldPlugins.d.ts +0 -11
  555. package/content/plugins/utils/getSchemaFromFieldPlugins.js +0 -30
  556. package/content/plugins/utils/pluralizedTypeName.d.ts +0 -1
  557. package/content/plugins/utils/renderFields.d.ts +0 -16
  558. package/content/plugins/utils/renderGetFilterFields.d.ts +0 -9
  559. package/content/plugins/utils/renderGetFilterFields.js +0 -41
  560. package/content/plugins/utils/renderInputFields.d.ts +0 -14
  561. package/content/plugins/utils/renderListFilterFields.d.ts +0 -10
  562. package/content/plugins/utils/renderSortEnum.d.ts +0 -9
  563. package/content/plugins/utils/renderSortEnum.js +0 -32
  564. package/content/plugins/validators/dateGte.d.ts +0 -3
  565. package/content/plugins/validators/dateLte.d.ts +0 -3
  566. package/content/plugins/validators/gte.d.ts +0 -3
  567. package/content/plugins/validators/gte.js +0 -32
  568. package/content/plugins/validators/in.d.ts +0 -3
  569. package/content/plugins/validators/in.js +0 -32
  570. package/content/plugins/validators/index.d.ts +0 -2
  571. package/content/plugins/validators/index.js +0 -36
  572. package/content/plugins/validators/lte.d.ts +0 -3
  573. package/content/plugins/validators/lte.js +0 -32
  574. package/content/plugins/validators/maxLength.d.ts +0 -3
  575. package/content/plugins/validators/maxLength.js +0 -32
  576. package/content/plugins/validators/minLength.d.ts +0 -3
  577. package/content/plugins/validators/minLength.js +0 -32
  578. package/content/plugins/validators/pattern.d.ts +0 -3
  579. package/content/plugins/validators/pattern.js +0 -47
  580. package/content/plugins/validators/patternPlugins/email.d.ts +0 -3
  581. package/content/plugins/validators/patternPlugins/email.js +0 -17
  582. package/content/plugins/validators/patternPlugins/index.d.ts +0 -2
  583. package/content/plugins/validators/patternPlugins/index.js +0 -19
  584. package/content/plugins/validators/patternPlugins/lowerCase.d.ts +0 -3
  585. package/content/plugins/validators/patternPlugins/lowerCase.js +0 -17
  586. package/content/plugins/validators/patternPlugins/upperCase.d.ts +0 -3
  587. package/content/plugins/validators/patternPlugins/upperCase.js +0 -17
  588. package/content/plugins/validators/patternPlugins/url.d.ts +0 -3
  589. package/content/plugins/validators/patternPlugins/url.js +0 -17
  590. package/content/plugins/validators/required.d.ts +0 -3
  591. package/content/plugins/validators/required.js +0 -25
  592. package/content/plugins/validators/timeGte.d.ts +0 -3
  593. package/content/plugins/validators/timeLte.d.ts +0 -3
  594. package/migrateCMSPermissions.d.ts +0 -17
  595. package/migrateCMSPermissions.js +0 -193
  596. package/plugins/context.d.ts +0 -4
  597. package/plugins/context.js +0 -34
  598. package/plugins/crud/index.d.ts +0 -6
  599. package/plugins/crud/index.js +0 -100
  600. package/plugins/crud/settings.crud.js +0 -93
  601. package/plugins/crud/system.crud.js +0 -182
  602. package/plugins/graphql/system.d.ts +0 -17
  603. package/plugins/graphql.d.ts +0 -2
  604. package/plugins/graphql.js +0 -79
  605. package/plugins/upgrades/index.d.ts +0 -2
  606. package/plugins/upgrades/index.js +0 -14
  607. package/plugins/upgrades/v5.5.0/helpers.d.ts +0 -6
  608. package/plugins/upgrades/v5.5.0/helpers.js +0 -10
  609. package/plugins/upgrades/v5.5.0/index.d.ts +0 -4
  610. package/plugins/upgrades/v5.5.0/index.js +0 -129
  611. package/transformers.d.ts +0 -2
  612. package/transformers.js +0 -25
  613. package/utils.d.ts +0 -25
  614. 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" | "dynamicZone" | string;
97
139
  /**
98
- * A unique field ID for mapping values
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;
150
+ /**
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
  */
@@ -137,21 +195,53 @@ export interface CmsModelField {
137
195
  *
138
196
  */
139
197
  multipleValues?: boolean;
198
+ /**
199
+ * Fields can be tagged to give them contextual meaning.
200
+ */
201
+ tags?: string[];
140
202
  /**
141
203
  * Any user defined settings.
142
204
  *
143
205
  * @default {}
144
206
  */
145
- settings?: {
146
- [key: string]: any;
207
+ settings?: CmsModelFieldSettings;
208
+ }
209
+ export interface CmsDynamicZoneTemplate {
210
+ id: string;
211
+ name: string;
212
+ gqlTypeName: string;
213
+ description: string;
214
+ icon: string;
215
+ fields: CmsModelField[];
216
+ layout: string[][];
217
+ validation: CmsModelFieldValidation[];
218
+ }
219
+ /**
220
+ * A definition for dynamic-zone field to show possible type of the field in settings.
221
+ */
222
+ export interface CmsModelDynamicZoneField extends CmsModelField {
223
+ /**
224
+ * Settings object for the field. Contains `templates` property.
225
+ */
226
+ settings: {
227
+ templates: CmsDynamicZoneTemplate[];
147
228
  };
148
229
  }
230
+ /**
231
+ * Used for our internal functionality.
232
+ */
233
+ export interface CmsModelFieldWithParent extends CmsModelField {
234
+ parent?: CmsModelFieldWithParent | null;
235
+ }
236
+ export interface CmsModelDynamicZoneFieldWithParent extends CmsModelDynamicZoneField {
237
+ parent?: CmsModelDynamicZoneFieldWithParent | null;
238
+ }
149
239
  /**
150
240
  * A definition for dateTime field to show possible type of the field in settings.
151
241
  */
152
242
  export interface CmsModelDateTimeField extends CmsModelField {
153
243
  /**
154
- * Settings object for the field. Contains type property.
244
+ * Settings object for the field. Contains `type` property.
155
245
  */
156
246
  settings: {
157
247
  type: "time" | "date" | "dateTimeWithoutTimezone" | "dateTimeWithTimezone";
@@ -163,11 +253,11 @@ export interface CmsModelDateTimeField extends CmsModelField {
163
253
  * @category ModelField
164
254
  * @category FieldValidation
165
255
  */
166
- export interface CmsModelFieldValidatorValidateParams {
256
+ export interface CmsModelFieldValidatorValidateParams<T = any> {
167
257
  /**
168
258
  * A value to be validated.
169
259
  */
170
- value: any;
260
+ value: T;
171
261
  /**
172
262
  * Options from the CmsModelField validations.
173
263
  *
@@ -186,7 +276,12 @@ export interface CmsModelFieldValidatorValidateParams {
186
276
  /**
187
277
  * An instance of the content model being validated.
188
278
  */
189
- contentModel: CmsModel;
279
+ model: CmsModel;
280
+ /**
281
+ * If entry is sent it means it is an update operation.
282
+ * First usage is for the unique field value.
283
+ */
284
+ entry?: CmsEntry;
190
285
  }
191
286
  /**
192
287
  * Definition for the field validator.
@@ -253,7 +348,8 @@ export interface CmsModelFieldPatternValidatorPlugin extends Plugin {
253
348
  */
254
349
  export interface LockedField {
255
350
  /**
256
- * Locked field ID - one used for mapping values.
351
+ * Locked field storage ID - one used to store values.
352
+ * We cannot change this due to old systems.
257
353
  */
258
354
  fieldId: string;
259
355
  /**
@@ -266,6 +362,20 @@ export interface LockedField {
266
362
  type: string;
267
363
  [key: string]: any;
268
364
  }
365
+ /**
366
+ * @category Database model
367
+ * @category CmsModel
368
+ */
369
+ export interface CmsModelGroup {
370
+ /**
371
+ * Generated ID of the group
372
+ */
373
+ id: string;
374
+ /**
375
+ * Name of the group
376
+ */
377
+ name: string;
378
+ }
269
379
  /**
270
380
  * Cms Model defining an entry.
271
381
  *
@@ -281,6 +391,10 @@ export interface CmsModel {
281
391
  * Unique ID for the content model. Created from name if not defined by user.
282
392
  */
283
393
  modelId: string;
394
+ /**
395
+ * Model tenant.
396
+ */
397
+ tenant: string;
284
398
  /**
285
399
  * Locale this model belongs to.
286
400
  */
@@ -288,28 +402,19 @@ export interface CmsModel {
288
402
  /**
289
403
  * Cms Group reference object.
290
404
  */
291
- group: {
292
- /**
293
- * Generated ID of the group
294
- */
295
- id: string;
296
- /**
297
- * Name of the group
298
- */
299
- name: string;
300
- };
405
+ group: CmsModelGroup;
301
406
  /**
302
407
  * Description for the content model.
303
408
  */
304
- description?: string;
409
+ description: string;
305
410
  /**
306
411
  * Date created
307
412
  */
308
- createdOn?: Date;
413
+ createdOn?: string;
309
414
  /**
310
415
  * Date saved. Changes on both save and create.
311
416
  */
312
- savedOn?: Date;
417
+ savedOn?: string;
313
418
  /**
314
419
  * CreatedBy object wrapper. Contains id, name and type of the user.
315
420
  */
@@ -329,6 +434,10 @@ export interface CmsModel {
329
434
  * ```
330
435
  */
331
436
  layout: string[][];
437
+ /**
438
+ * Models can be tagged to give them contextual meaning.
439
+ */
440
+ tags?: string[];
332
441
  /**
333
442
  * List of locked fields. Updated when entry is saved and a field has been used.
334
443
  */
@@ -343,9 +452,20 @@ export interface CmsModel {
343
452
  */
344
453
  webinyVersion: string;
345
454
  /**
346
- * Model tenant.
455
+ * Is model private?
456
+ * This is meant to be used for some internal models - will not be visible in the schema.
457
+ * Only available for the plugin constructed models.
347
458
  */
348
- tenant: string;
459
+ isPrivate?: boolean;
460
+ }
461
+ /**
462
+ * When sending model to the storage operations, it must contain createValueKeyToStorageConverter and createValueKeyFromStorageConverter
463
+ *
464
+ * @category CmsModel
465
+ */
466
+ export interface StorageOperationsCmsModel extends CmsModel {
467
+ convertValueKeyToStorage: CmsModelConverterCallable;
468
+ convertValueKeyFromStorage: CmsModelConverterCallable;
349
469
  }
350
470
  /**
351
471
  * @category ModelField
@@ -354,24 +474,40 @@ export interface CmsModelFieldDefinition {
354
474
  fields: string;
355
475
  typeDefs?: string;
356
476
  }
357
- 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;
477
+ interface CmsModelFieldToGraphQLCreateResolverParams<TField> {
478
+ models: CmsModel[];
479
+ model: CmsModel;
480
+ graphQLType: string;
481
+ field: TField;
482
+ createFieldResolvers: any;
483
+ }
484
+ export interface CmsModelFieldToGraphQLCreateResolver<TField = CmsModelField> {
485
+ (params: CmsModelFieldToGraphQLCreateResolverParams<TField>): GraphQLFieldResolver | {
486
+ resolver: GraphQLFieldResolver | null;
366
487
  typeResolvers: Resolvers<CmsContext>;
367
- };
488
+ } | false;
489
+ }
490
+ export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams<TField extends CmsModelField = CmsModelField> {
491
+ fields: TField[];
492
+ originalFields: TField[];
493
+ }
494
+ export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidate {
495
+ (params: CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams): void;
496
+ }
497
+ export interface CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField extends CmsModelField = CmsModelField> {
498
+ field: TField;
499
+ originalField?: TField;
500
+ validate: CmsModelFieldToGraphQLPluginValidateChildFieldsValidate;
501
+ }
502
+ export interface CmsModelFieldToGraphQLPluginValidateChildFields<TField extends CmsModelField = CmsModelField> {
503
+ (params: CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField>): void;
368
504
  }
369
505
  /**
370
506
  * @category Plugin
371
507
  * @category ModelField
372
508
  * @category GraphQL
373
509
  */
374
- export interface CmsModelFieldToGraphQLPlugin extends Plugin {
510
+ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = CmsModelField> extends Plugin {
375
511
  /**
376
512
  * A plugin type
377
513
  */
@@ -392,6 +528,15 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
392
528
  * ```
393
529
  */
394
530
  isSearchable: boolean;
531
+ /**
532
+ * Is the field searchable via full text search?
533
+ *
534
+ * Field is not full text searchable by default.
535
+ * ```ts
536
+ * fullTextSearch: false
537
+ * ```
538
+ */
539
+ fullTextSearch?: boolean;
395
540
  /**
396
541
  * Is the field sortable via the GraphQL?
397
542
  *
@@ -400,6 +545,27 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
400
545
  * ```
401
546
  */
402
547
  isSortable: boolean;
548
+ /**
549
+ * Optional method which creates the storageId.
550
+ * Primary use is for the datetime field, but if users has some specific fields, they can customize the storageId to their needs.
551
+ *
552
+ * ```ts
553
+ * createStorageId: ({field}) => {
554
+ * if (field.settings.type === "time) {
555
+ * return `${field.type}_time@${field.id}`
556
+ * }
557
+ * // use default method
558
+ * return undefined;
559
+ * }
560
+ * ```
561
+ */
562
+ createStorageId?: (params: {
563
+ model: CmsModel;
564
+ field: TField;
565
+ }) => string | null | undefined;
566
+ /**
567
+ * Read API methods.
568
+ */
403
569
  read: {
404
570
  /**
405
571
  * Definition for get filtering for GraphQL.
@@ -414,7 +580,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
414
580
  */
415
581
  createGetFilters?(params: {
416
582
  model: CmsModel;
417
- field: CmsModelField;
583
+ field: TField;
418
584
  }): string;
419
585
  /**
420
586
  * Definition for list filtering for GraphQL.
@@ -434,7 +600,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
434
600
  */
435
601
  createListFilters?(params: {
436
602
  model: CmsModel;
437
- field: CmsModelField;
603
+ field: TField;
604
+ plugins: CmsFieldTypePlugins;
438
605
  }): string;
439
606
  /**
440
607
  * Definition of the field type for GraphQL - be aware if multiple values is selected.
@@ -453,24 +620,24 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
453
620
  */
454
621
  createTypeField(params: {
455
622
  model: CmsModel;
456
- field: CmsModelField;
623
+ field: TField;
457
624
  fieldTypePlugins: CmsFieldTypePlugins;
458
- }): CmsModelFieldDefinition | string;
625
+ }): CmsModelFieldDefinition | string | null;
459
626
  /**
460
627
  * Definition for field resolver.
461
- * By default it is simple return of the `instance.values[fieldId]` but if required, users can define their own.
628
+ * By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
462
629
  *
463
630
  * ```ts
464
631
  * read: {
465
632
  * createResolver({ field }) {
466
633
  * return instance => {
467
- * return instance.values[field.fieldId];
634
+ * return instance.values[field.storageId];
468
635
  * };
469
636
  * }
470
637
  * }
471
638
  * ```
472
639
  */
473
- createResolver?: CmsModelFieldToGraphQLCreateResolver;
640
+ createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
474
641
  /**
475
642
  * Read API schema definitions for the field and resolvers for them.
476
643
  *
@@ -492,7 +659,6 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
492
659
  */
493
660
  createSchema?: (params: {
494
661
  models: CmsModel[];
495
- model: CmsModel;
496
662
  }) => GraphQLSchemaDefinition<CmsContext>;
497
663
  };
498
664
  manage: {
@@ -514,7 +680,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
514
680
  */
515
681
  createListFilters?: (params: {
516
682
  model: CmsModel;
517
- field: CmsModelField;
683
+ field: TField;
684
+ plugins: CmsFieldTypePlugins;
518
685
  }) => string;
519
686
  /**
520
687
  * Manage API schema definitions for the field and resolvers for them. Probably similar to `read.createSchema`.
@@ -535,7 +702,6 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
535
702
  */
536
703
  createSchema?: (params: {
537
704
  models: CmsModel[];
538
- model: CmsModel;
539
705
  }) => GraphQLSchemaDefinition<CmsContext>;
540
706
  /**
541
707
  * Definition of the field type for GraphQL - be aware if multiple values is selected. Probably same as `read.createTypeField`.
@@ -554,9 +720,9 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
554
720
  */
555
721
  createTypeField: (params: {
556
722
  model: CmsModel;
557
- field: CmsModelField;
723
+ field: TField;
558
724
  fieldTypePlugins: CmsFieldTypePlugins;
559
- }) => CmsModelFieldDefinition | string;
725
+ }) => CmsModelFieldDefinition | string | null;
560
726
  /**
561
727
  * Definition for input GraphQL field type.
562
728
  *
@@ -574,25 +740,30 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
574
740
  */
575
741
  createInputField: (params: {
576
742
  model: CmsModel;
577
- field: CmsModelField;
743
+ field: TField;
578
744
  fieldTypePlugins: CmsFieldTypePlugins;
579
- }) => CmsModelFieldDefinition | string;
745
+ }) => CmsModelFieldDefinition | string | null;
580
746
  /**
581
747
  * Definition for field resolver.
582
- * By default it is simple return of the `instance.values[fieldId]` but if required, users can define their own.
748
+ * By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
583
749
  *
584
750
  * ```ts
585
751
  * manage: {
586
752
  * createResolver({ field }) {
587
753
  * return instance => {
588
- * return instance.values[field.fieldId];
754
+ * return instance.values[field.storageId];
589
755
  * };
590
756
  * }
591
757
  * }
592
758
  * ```
593
759
  */
594
- createResolver?: CmsModelFieldToGraphQLCreateResolver;
760
+ createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
595
761
  };
762
+ /**
763
+ *
764
+ * @param field
765
+ */
766
+ validateChildFields?: CmsModelFieldToGraphQLPluginValidateChildFields<TField>;
596
767
  }
597
768
  /**
598
769
  * Check for content model locked field.
@@ -631,7 +802,7 @@ export interface CmsFieldTypePlugins {
631
802
  [key: string]: CmsModelFieldToGraphQLPlugin;
632
803
  }
633
804
  /**
634
- * A interface describing the reference to a user that created some data in the database.
805
+ * An interface describing the reference to a user that created some data in the database.
635
806
  *
636
807
  * @category General
637
808
  */
@@ -643,7 +814,7 @@ export interface CreatedBy {
643
814
  /**
644
815
  * Full name of the user.
645
816
  */
646
- displayName: string;
817
+ displayName: string | null;
647
818
  /**
648
819
  * Type of the user (admin, user)
649
820
  */
@@ -687,26 +858,45 @@ export interface CmsSettingsContext {
687
858
  */
688
859
  getModelLastChange: () => Promise<Date>;
689
860
  }
690
- export interface BeforeInstallTopicParams {
861
+ export interface OnSystemBeforeInstallTopicParams {
691
862
  tenant: string;
863
+ locale: string;
692
864
  }
693
- export interface AfterInstallTopicParams {
865
+ export interface OnSystemAfterInstallTopicParams {
694
866
  tenant: string;
867
+ locale: string;
868
+ }
869
+ export interface OnSystemInstallErrorTopicParams {
870
+ error: Error;
871
+ tenant: string;
872
+ locale: string;
695
873
  }
696
874
  export declare type CmsSystemContext = {
697
- getSystemVersion: () => Promise<string>;
875
+ getSystemVersion: () => Promise<string | null>;
698
876
  setSystemVersion: (version: string) => Promise<void>;
699
- getReadAPIKey(): Promise<string>;
877
+ getReadAPIKey(): Promise<string | null>;
700
878
  installSystem: () => Promise<void>;
701
879
  upgradeSystem: (version: string) => Promise<boolean>;
702
880
  /**
703
- * Events
881
+ * Lifecycle events - deprecated
704
882
  */
705
- onBeforeSystemInstall: Topic<BeforeInstallTopicParams>;
706
- onAfterSystemInstall: Topic<AfterInstallTopicParams>;
883
+ /**
884
+ * @deprecated
885
+ */
886
+ onBeforeSystemInstall: Topic<OnSystemBeforeInstallTopicParams>;
887
+ /**
888
+ * @deprecated
889
+ */
890
+ onAfterSystemInstall: Topic<OnSystemAfterInstallTopicParams>;
891
+ /**
892
+ * Released in 5.34.0
893
+ */
894
+ onSystemBeforeInstall: Topic<OnSystemBeforeInstallTopicParams>;
895
+ onSystemAfterInstall: Topic<OnSystemAfterInstallTopicParams>;
896
+ onSystemInstallError: Topic<OnSystemInstallErrorTopicParams>;
707
897
  };
708
898
  /**
709
- * A GraphQL params.data parameter received when creating content model group.
899
+ * A GraphQL `params.data` parameter received when creating content model group.
710
900
  *
711
901
  * @category CmsGroup
712
902
  * @category GraphQL params
@@ -718,7 +908,7 @@ export interface CmsGroupCreateInput {
718
908
  icon: string;
719
909
  }
720
910
  /**
721
- * A GraphQL params.data parameter received when updating content model group.
911
+ * A GraphQL `params.data` parameter received when updating content model group.
722
912
  *
723
913
  * @category CmsGroup
724
914
  * @category GraphQL params
@@ -748,6 +938,10 @@ export interface CmsGroup {
748
938
  * Slug for the group. Must be unique.
749
939
  */
750
940
  slug: string;
941
+ /**
942
+ * Group tenant.
943
+ */
944
+ tenant: string;
751
945
  /**
752
946
  * Locale this group belongs to.
753
947
  */
@@ -755,11 +949,11 @@ export interface CmsGroup {
755
949
  /**
756
950
  * Description for the group.
757
951
  */
758
- description?: string;
952
+ description: string;
759
953
  /**
760
954
  * Icon for the group. In a form of "ico/ico".
761
955
  */
762
- icon?: string;
956
+ icon: string;
763
957
  /**
764
958
  * CreatedBy reference object.
765
959
  */
@@ -777,12 +971,14 @@ export interface CmsGroup {
777
971
  */
778
972
  webinyVersion: string;
779
973
  /**
780
- * Group tenant.
974
+ * Is group private?
975
+ * This is meant to be used for some internal groups - will not be visible in the schema.
976
+ * Only available for the plugin constructed groups.
781
977
  */
782
- tenant: string;
978
+ isPrivate?: boolean;
783
979
  }
784
980
  /**
785
- * A data.where parameter received when listing content model groups.
981
+ * A `data.where` parameter received when listing content model groups.
786
982
  *
787
983
  * @category CmsGroup
788
984
  * @category GraphQL params
@@ -798,21 +994,30 @@ export interface CmsGroupListParams {
798
994
  * @category CmsGroup
799
995
  * @category Topic
800
996
  */
801
- export interface BeforeGroupCreateTopicParams {
997
+ export interface OnGroupBeforeCreateTopicParams {
802
998
  group: CmsGroup;
803
999
  }
804
1000
  /**
805
1001
  * @category CmsGroup
806
1002
  * @category Topic
807
1003
  */
808
- export interface AfterGroupCreateTopicParams {
1004
+ export interface OnGroupAfterCreateTopicParams {
809
1005
  group: CmsGroup;
810
1006
  }
811
1007
  /**
812
1008
  * @category CmsGroup
813
1009
  * @category Topic
814
1010
  */
815
- export interface BeforeGroupUpdateTopicParams {
1011
+ export interface OnGroupCreateErrorTopicParams {
1012
+ input: CmsGroupCreateInput;
1013
+ group: CmsGroup;
1014
+ error: Error;
1015
+ }
1016
+ /**
1017
+ * @category CmsGroup
1018
+ * @category Topic
1019
+ */
1020
+ export interface OnGroupBeforeUpdateTopicParams {
816
1021
  original: CmsGroup;
817
1022
  group: CmsGroup;
818
1023
  }
@@ -820,7 +1025,7 @@ export interface BeforeGroupUpdateTopicParams {
820
1025
  * @category CmsGroup
821
1026
  * @category Topic
822
1027
  */
823
- export interface AfterGroupUpdateTopicParams {
1028
+ export interface OnGroupAfterUpdateTopicParams {
824
1029
  original: CmsGroup;
825
1030
  group: CmsGroup;
826
1031
  }
@@ -828,16 +1033,34 @@ export interface AfterGroupUpdateTopicParams {
828
1033
  * @category CmsGroup
829
1034
  * @category Topic
830
1035
  */
831
- export interface BeforeGroupDeleteTopicParams {
1036
+ export interface OnGroupUpdateErrorTopicParams {
1037
+ input: CmsGroupUpdateInput;
1038
+ original: CmsGroup;
832
1039
  group: CmsGroup;
1040
+ error: Error;
833
1041
  }
834
1042
  /**
835
1043
  * @category CmsGroup
836
1044
  * @category Topic
837
1045
  */
838
- export interface AfterGroupDeleteTopicParams {
1046
+ export interface OnGroupBeforeDeleteTopicParams {
839
1047
  group: CmsGroup;
840
1048
  }
1049
+ /**
1050
+ * @category CmsGroup
1051
+ * @category Topic
1052
+ */
1053
+ export interface OnGroupAfterDeleteTopicParams {
1054
+ group: CmsGroup;
1055
+ }
1056
+ /**
1057
+ * @category CmsGroup
1058
+ * @category Topic
1059
+ */
1060
+ export interface OnGroupDeleteErrorTopicParams {
1061
+ group: CmsGroup;
1062
+ error: Error;
1063
+ }
841
1064
  /**
842
1065
  * Cms Group in context.
843
1066
  *
@@ -866,14 +1089,48 @@ export interface CmsGroupContext {
866
1089
  */
867
1090
  deleteGroup: (id: string) => Promise<boolean>;
868
1091
  /**
869
- * Events.
1092
+ * Clear the cached groups.
1093
+ */
1094
+ clearGroupsCache: () => void;
1095
+ /**
1096
+ * Lifecycle events - deprecated
1097
+ */
1098
+ /**
1099
+ * @deprecated
1100
+ */
1101
+ onBeforeGroupCreate: Topic<OnGroupBeforeCreateTopicParams>;
1102
+ /**
1103
+ * @deprecated
1104
+ */
1105
+ onAfterGroupCreate: Topic<OnGroupAfterCreateTopicParams>;
1106
+ /**
1107
+ * @deprecated
1108
+ */
1109
+ onBeforeGroupUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
1110
+ /**
1111
+ * @deprecated
1112
+ */
1113
+ onAfterGroupUpdate: Topic<OnGroupAfterUpdateTopicParams>;
1114
+ /**
1115
+ * @deprecated
1116
+ */
1117
+ onBeforeGroupDelete: Topic<OnGroupBeforeDeleteTopicParams>;
1118
+ /**
1119
+ * @deprecated
1120
+ */
1121
+ onAfterGroupDelete: Topic<OnGroupAfterDeleteTopicParams>;
1122
+ /**
1123
+ * Lifecycle events released in 5.33.0
870
1124
  */
871
- onBeforeGroupCreate: Topic<BeforeGroupCreateTopicParams>;
872
- onAfterGroupCreate: Topic<AfterGroupCreateTopicParams>;
873
- onBeforeGroupUpdate: Topic<BeforeGroupUpdateTopicParams>;
874
- onAfterGroupUpdate: Topic<AfterGroupUpdateTopicParams>;
875
- onBeforeGroupDelete: Topic<BeforeGroupDeleteTopicParams>;
876
- onAfterGroupDelete: Topic<AfterGroupDeleteTopicParams>;
1125
+ onGroupBeforeCreate: Topic<OnGroupBeforeCreateTopicParams>;
1126
+ onGroupAfterCreate: Topic<OnGroupAfterCreateTopicParams>;
1127
+ onGroupCreateError: Topic<OnGroupCreateErrorTopicParams>;
1128
+ onGroupBeforeUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
1129
+ onGroupAfterUpdate: Topic<OnGroupAfterUpdateTopicParams>;
1130
+ onGroupUpdateError: Topic<OnGroupUpdateErrorTopicParams>;
1131
+ onGroupBeforeDelete: Topic<OnGroupBeforeDeleteTopicParams>;
1132
+ onGroupAfterDelete: Topic<OnGroupAfterDeleteTopicParams>;
1133
+ onGroupDeleteError: Topic<OnGroupDeleteErrorTopicParams>;
877
1134
  }
878
1135
  /**
879
1136
  * Definition for content model field validator.
@@ -884,10 +1141,15 @@ export interface CmsGroupContext {
884
1141
  export interface CmsModelFieldValidation {
885
1142
  name: string;
886
1143
  message: string;
887
- settings?: Record<string, any>;
1144
+ settings?: {
1145
+ value?: string | number;
1146
+ values?: string[];
1147
+ preset?: string;
1148
+ [key: string]: any;
1149
+ };
888
1150
  }
889
1151
  /**
890
- * A GraphQL params.data parameter received when creating content model.
1152
+ * A GraphQL `params.data` parameter received when creating content model.
891
1153
  *
892
1154
  * @category GraphQL params
893
1155
  * @category CmsModel
@@ -905,6 +1167,46 @@ export interface CmsModelCreateInput {
905
1167
  * Description of the content model.
906
1168
  */
907
1169
  description?: string;
1170
+ /**
1171
+ * Group where to put the content model in.
1172
+ */
1173
+ group: string;
1174
+ /**
1175
+ * A list of content model fields to define the entry values.
1176
+ */
1177
+ fields?: CmsModelFieldInput[];
1178
+ /**
1179
+ * Admin UI field layout
1180
+ *
1181
+ * ```ts
1182
+ * layout: [
1183
+ * [field1id, field2id],
1184
+ * [field3id]
1185
+ * ]
1186
+ * ```
1187
+ */
1188
+ layout?: string[][];
1189
+ /**
1190
+ * Models can be tagged to give them contextual meaning.
1191
+ */
1192
+ tags?: string[];
1193
+ /**
1194
+ * The field that is being displayed as entry title.
1195
+ * It is picked as first available text field. Or user can select own field.
1196
+ */
1197
+ titleFieldId?: string;
1198
+ }
1199
+ /**
1200
+ * A GraphQL `params.data` parameter received when creating content model from existing model.
1201
+ *
1202
+ * @category GraphQL params
1203
+ * @category CmsModel
1204
+ */
1205
+ export interface CmsModelCreateFromInput extends CmsModelCreateInput {
1206
+ /**
1207
+ * Locale into which we want to clone the model into.
1208
+ */
1209
+ locale?: string;
908
1210
  }
909
1211
  /**
910
1212
  * A definition for content model field received from the user.
@@ -926,7 +1228,7 @@ export interface CmsModelFieldInput {
926
1228
  */
927
1229
  type: string;
928
1230
  /**
929
- * A unique ID for the field. Values will be mapped via this value.
1231
+ * Field outside world identifier for the field. Must be unique in the model.
930
1232
  */
931
1233
  fieldId: string;
932
1234
  /**
@@ -936,11 +1238,15 @@ export interface CmsModelFieldInput {
936
1238
  /**
937
1239
  * Text to display below the field to help user what to write in the field.
938
1240
  */
939
- helpText?: string;
1241
+ helpText?: string | null;
940
1242
  /**
941
1243
  * Text to display in the field.
942
1244
  */
943
- placeholderText?: string;
1245
+ placeholderText?: string | null;
1246
+ /**
1247
+ * Fields can be tagged to give them contextual meaning.
1248
+ */
1249
+ tags?: string[];
944
1250
  /**
945
1251
  * Are multiple values allowed?
946
1252
  */
@@ -967,7 +1273,7 @@ export interface CmsModelFieldInput {
967
1273
  settings?: Record<string, any>;
968
1274
  }
969
1275
  /**
970
- * A GraphQL params.data parameter received when updating content model.
1276
+ * A GraphQL `params.data` parameter received when updating content model.
971
1277
  *
972
1278
  * @category GraphQL params
973
1279
  * @category CmsModel
@@ -977,6 +1283,10 @@ export interface CmsModelUpdateInput {
977
1283
  * A new content model name.
978
1284
  */
979
1285
  name?: string;
1286
+ /**
1287
+ * A group we want to move the model to.
1288
+ */
1289
+ group?: string;
980
1290
  /**
981
1291
  * A new description of the content model.
982
1292
  */
@@ -1027,16 +1337,25 @@ export interface ModelManagerPlugin extends Plugin {
1027
1337
  */
1028
1338
  create: (context: CmsContext, model: CmsModel) => Promise<CmsModelManager>;
1029
1339
  }
1340
+ /**
1341
+ * A content entry values definition for and from the database.
1342
+ *
1343
+ * @category Database model
1344
+ * @category CmsEntry
1345
+ */
1346
+ export interface CmsEntryValues {
1347
+ [key: string]: any;
1348
+ }
1030
1349
  /**
1031
1350
  * A content entry definition for and from the database.
1032
1351
  *
1033
1352
  * @category Database model
1034
1353
  * @category CmsEntry
1035
1354
  */
1036
- export interface CmsEntry {
1355
+ export interface CmsEntry<T = CmsEntryValues> {
1037
1356
  /**
1038
1357
  * A version of the webiny this entry was created with.
1039
- * This can be used when upgrading the system so we know which entries to update.
1358
+ * This can be used when upgrading the system, so we know which entries to update.
1040
1359
  */
1041
1360
  webinyVersion: string;
1042
1361
  /**
@@ -1098,11 +1417,22 @@ export interface CmsEntry {
1098
1417
  */
1099
1418
  status: CmsEntryStatus;
1100
1419
  /**
1101
- * A mapped fieldId -> value object.
1420
+ * A mapped storageId -> value object.
1102
1421
  *
1103
1422
  * @see CmsModelField
1104
1423
  */
1105
- values: Record<string, any>;
1424
+ values: T;
1425
+ /**
1426
+ * Settings for the given entry.
1427
+ *
1428
+ * Introduced with Advanced Publishing Workflow. Will always be inserted once this PR is merged.
1429
+ * Be aware that when accessing properties in it on old systems, it will break if not checked first.
1430
+ *
1431
+ * Available only on the Manage API in entry GraphQL type `meta.data` property.
1432
+ */
1433
+ meta?: {
1434
+ [key: string]: any;
1435
+ };
1106
1436
  }
1107
1437
  export interface CmsStorageEntry extends CmsEntry {
1108
1438
  [key: string]: any;
@@ -1118,24 +1448,20 @@ export interface CmsStorageEntry extends CmsEntry {
1118
1448
  * @category CmsModel
1119
1449
  */
1120
1450
  export interface CmsModelManager {
1121
- /**
1122
- * List entries in this content model.
1123
- */
1124
- list: (params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1125
1451
  /**
1126
1452
  * List only published entries in the content model.
1127
1453
  */
1128
- listPublished: (params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1454
+ listPublished: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1129
1455
  /**
1130
1456
  * List latest entries in the content model. Used for administration.
1131
1457
  */
1132
- listLatest: (params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1458
+ listLatest: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1133
1459
  /**
1134
1460
  * Get a list of published entries by the ID list.
1135
1461
  */
1136
1462
  getPublishedByIds: (ids: string[]) => Promise<CmsEntry[]>;
1137
1463
  /**
1138
- * Get a list of latest entries by the ID list.
1464
+ * Get a list of the latest entries by the ID list.
1139
1465
  */
1140
1466
  getLatestByIds: (ids: string[]) => Promise<CmsEntry[]>;
1141
1467
  /**
@@ -1143,42 +1469,95 @@ export interface CmsModelManager {
1143
1469
  */
1144
1470
  get: (id: string) => Promise<CmsEntry>;
1145
1471
  /**
1146
- * Create a entry.
1472
+ * Create an entry.
1147
1473
  */
1148
- create: (data: Record<string, any>) => Promise<CmsEntry>;
1474
+ create: (data: CreateCmsEntryInput) => Promise<CmsEntry>;
1149
1475
  /**
1150
- * Update a entry.
1476
+ * Update an entry.
1151
1477
  */
1152
- update: (id: string, data: Record<string, any>) => Promise<CmsEntry>;
1478
+ update: (id: string, data: UpdateCmsEntryInput) => Promise<CmsEntry>;
1153
1479
  /**
1154
- * Delete a entry.
1480
+ * Delete an entry.
1155
1481
  */
1156
1482
  delete: (id: string) => Promise<void>;
1157
1483
  }
1158
- export interface BeforeModelCreateTopicParams {
1159
- input: Partial<CmsModel>;
1484
+ /**
1485
+ * Create
1486
+ */
1487
+ export interface OnModelBeforeCreateTopicParams {
1488
+ input: CmsModelCreateInput;
1489
+ model: CmsModel;
1490
+ }
1491
+ export interface OnModelAfterCreateTopicParams {
1492
+ input: CmsModelCreateInput;
1160
1493
  model: CmsModel;
1161
1494
  }
1162
- export interface AfterModelCreateTopicParams {
1163
- input: Partial<CmsModel>;
1495
+ export interface OnModelCreateErrorTopicParams {
1496
+ input: CmsModelCreateInput;
1164
1497
  model: CmsModel;
1498
+ error: Error;
1165
1499
  }
1166
- export interface BeforeModelUpdateTopicParams {
1167
- input: Partial<CmsModel>;
1500
+ /**
1501
+ * Create From / Clone
1502
+ */
1503
+ export interface OnModelBeforeCreateFromTopicParams {
1504
+ input: CmsModelCreateInput;
1168
1505
  original: CmsModel;
1169
1506
  model: CmsModel;
1170
1507
  }
1171
- export interface AfterModelUpdateTopicParams {
1172
- input: Partial<CmsModel>;
1508
+ export interface OnModelAfterCreateFromTopicParams {
1509
+ input: CmsModelCreateInput;
1173
1510
  original: CmsModel;
1174
1511
  model: CmsModel;
1175
1512
  }
1176
- export interface BeforeModelDeleteTopicParams {
1513
+ export interface OnModelCreateFromErrorParams {
1514
+ input: CmsModelCreateInput;
1515
+ original: CmsModel;
1177
1516
  model: CmsModel;
1517
+ error: Error;
1178
1518
  }
1179
- export interface AfterModelDeleteTopicParams {
1519
+ /**
1520
+ * Update
1521
+ */
1522
+ export interface OnModelBeforeUpdateTopicParams {
1523
+ input: CmsModelUpdateInput;
1524
+ original: CmsModel;
1180
1525
  model: CmsModel;
1181
1526
  }
1527
+ export interface OnModelAfterUpdateTopicParams {
1528
+ input: CmsModelUpdateInput;
1529
+ original: CmsModel;
1530
+ model: CmsModel;
1531
+ }
1532
+ export interface OnModelUpdateErrorTopicParams {
1533
+ input: CmsModelUpdateInput;
1534
+ original: CmsModel;
1535
+ model: CmsModel;
1536
+ error: Error;
1537
+ }
1538
+ /**
1539
+ * Delete
1540
+ */
1541
+ export interface OnModelBeforeDeleteTopicParams {
1542
+ model: CmsModel;
1543
+ }
1544
+ export interface OnModelAfterDeleteTopicParams {
1545
+ model: CmsModel;
1546
+ }
1547
+ export interface OnModelDeleteErrorTopicParams {
1548
+ model: CmsModel;
1549
+ error: Error;
1550
+ }
1551
+ /**
1552
+ * Initialize
1553
+ */
1554
+ export interface OnModelInitializeParams {
1555
+ model: CmsModel;
1556
+ data: Record<string, any>;
1557
+ }
1558
+ /**
1559
+ *
1560
+ */
1182
1561
  export interface CmsModelUpdateDirectParams {
1183
1562
  model: CmsModel;
1184
1563
  original: CmsModel;
@@ -1190,15 +1569,6 @@ export interface CmsModelUpdateDirectParams {
1190
1569
  * @category CmsModel
1191
1570
  */
1192
1571
  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
1572
  /**
1203
1573
  * Get a single content model.
1204
1574
  */
@@ -1211,12 +1581,12 @@ export interface CmsModelContext {
1211
1581
  * Create a content model.
1212
1582
  */
1213
1583
  createModel: (data: CmsModelCreateInput) => Promise<CmsModel>;
1584
+ /**
1585
+ * Create a content model from the given model - clone.
1586
+ */
1587
+ createModelFrom: (modelId: string, data: CmsModelCreateFromInput) => Promise<CmsModel>;
1214
1588
  /**
1215
1589
  * Update content model without data validation. Used internally.
1216
- *
1217
- * @param model - existing content model
1218
- * @param data - data to be updated
1219
- *
1220
1590
  * @hidden
1221
1591
  */
1222
1592
  updateModelDirect: (params: CmsModelUpdateDirectParams) => Promise<CmsModel>;
@@ -1229,32 +1599,100 @@ export interface CmsModelContext {
1229
1599
  */
1230
1600
  deleteModel: (modelId: string) => Promise<void>;
1231
1601
  /**
1232
- * Get a instance of CmsModelManager for given content modelId.
1602
+ * Possibility for users to trigger the model initialization.
1603
+ * They can hook into it and do what ever they want to.
1604
+ *
1605
+ * Primary idea behind this is creating the index, for the code models, in the ES.
1606
+ */
1607
+ initializeModel: (modelId: string, data: Record<string, any>) => Promise<boolean>;
1608
+ /**
1609
+ * Get an instance of CmsModelManager for given content modelId.
1233
1610
  *
1234
1611
  * @see CmsModelManager
1612
+ *
1613
+ * @deprecated use the getEntryManager() method instead
1235
1614
  */
1236
- getModelManager: (modelId: string) => Promise<CmsModelManager>;
1615
+ getModelManager: (model: CmsModel | string) => Promise<CmsModelManager>;
1616
+ getEntryManager: (model: CmsModel | string) => Promise<CmsModelManager>;
1237
1617
  /**
1238
1618
  * Get all content model managers mapped by modelId.
1239
1619
  * @see CmsModelManager
1620
+ * @deprecated use getEntryManagers instead
1240
1621
  */
1241
1622
  getManagers: () => Map<string, CmsModelManager>;
1623
+ getEntryManagers: () => Map<string, CmsModelManager>;
1624
+ /**
1625
+ * Clear all the model caches.
1626
+ */
1627
+ clearModelsCache: () => void;
1628
+ /**
1629
+ * Lifecycle events - deprecated.
1630
+ */
1631
+ /**
1632
+ * @deprecated
1633
+ */
1634
+ onBeforeModelCreate: Topic<OnModelBeforeCreateTopicParams>;
1635
+ /**
1636
+ * @deprecated
1637
+ */
1638
+ onAfterModelCreate: Topic<OnModelAfterCreateTopicParams>;
1639
+ /**
1640
+ * @deprecated
1641
+ */
1642
+ onBeforeModelCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
1643
+ /**
1644
+ * @deprecated
1645
+ */
1646
+ onAfterModelCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
1242
1647
  /**
1243
- * Events.
1648
+ * @deprecated
1244
1649
  */
1245
- onBeforeModelCreate: Topic<BeforeModelCreateTopicParams>;
1246
- onAfterModelCreate: Topic<AfterModelCreateTopicParams>;
1247
- onBeforeModelUpdate: Topic<BeforeModelUpdateTopicParams>;
1248
- onAfterModelUpdate: Topic<AfterModelUpdateTopicParams>;
1249
- onBeforeModelDelete: Topic<BeforeModelDeleteTopicParams>;
1250
- onAfterModelDelete: Topic<AfterModelDeleteTopicParams>;
1650
+ onBeforeModelUpdate: Topic<OnModelBeforeUpdateTopicParams>;
1651
+ /**
1652
+ * @deprecated
1653
+ */
1654
+ onAfterModelUpdate: Topic<OnModelAfterUpdateTopicParams>;
1655
+ /**
1656
+ * @deprecated
1657
+ */
1658
+ onBeforeModelDelete: Topic<OnModelBeforeDeleteTopicParams>;
1659
+ /**
1660
+ * @deprecated
1661
+ */
1662
+ onAfterModelDelete: Topic<OnModelAfterDeleteTopicParams>;
1663
+ /**
1664
+ * Lifecycle events - released in 5.33.0
1665
+ */
1666
+ onModelBeforeCreate: Topic<OnModelBeforeCreateTopicParams>;
1667
+ onModelAfterCreate: Topic<OnModelAfterCreateTopicParams>;
1668
+ onModelCreateError: Topic<OnModelCreateErrorTopicParams>;
1669
+ onModelBeforeCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
1670
+ onModelAfterCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
1671
+ onModelCreateFromError: Topic<OnModelCreateFromErrorParams>;
1672
+ onModelBeforeUpdate: Topic<OnModelBeforeUpdateTopicParams>;
1673
+ onModelAfterUpdate: Topic<OnModelAfterUpdateTopicParams>;
1674
+ onModelUpdateError: Topic<OnModelUpdateErrorTopicParams>;
1675
+ onModelBeforeDelete: Topic<OnModelBeforeDeleteTopicParams>;
1676
+ onModelAfterDelete: Topic<OnModelAfterDeleteTopicParams>;
1677
+ onModelDeleteError: Topic<OnModelDeleteErrorTopicParams>;
1678
+ onModelInitialize: Topic<OnModelInitializeParams>;
1251
1679
  }
1252
1680
  /**
1253
1681
  * Available statuses for content entry.
1254
1682
  *
1255
1683
  * @category CmsEntry
1256
1684
  */
1257
- declare type CmsEntryStatus = "published" | "unpublished" | "reviewRequested" | "changesRequested" | "draft";
1685
+ export declare type CmsEntryStatus = "published" | "unpublished" | "draft";
1686
+ export interface CmsEntryListWhereRef {
1687
+ id?: string;
1688
+ id_in?: string[];
1689
+ id_not?: string;
1690
+ id_not_in?: string[];
1691
+ entryId?: string;
1692
+ entryId_not?: string;
1693
+ entryId_in?: string[];
1694
+ entryId_not_in?: string[];
1695
+ }
1258
1696
  /**
1259
1697
  * Entry listing where params.
1260
1698
  *
@@ -1277,7 +1715,9 @@ export interface CmsEntryListWhere {
1277
1715
  entryId_in?: string[];
1278
1716
  entryId_not_in?: string[];
1279
1717
  /**
1280
- * Entry is owned by whom?
1718
+ * Contains the owner of the entry. An "owner" is the identity who originally created the entry.
1719
+ * Subsequent revisions can be created by other identities, and those will be stored in `createdBy`,
1720
+ * but the `owner` is always the original author of the entry.
1281
1721
  *
1282
1722
  * Can be sent via the API or set internal if user can see only their own entries.
1283
1723
  */
@@ -1302,22 +1742,30 @@ export interface CmsEntryListWhere {
1302
1742
  version_lt?: number;
1303
1743
  version_gt?: number;
1304
1744
  /**
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.
1745
+ * Each storage operations implementation MUST determine how to use this field.
1746
+ * In SQL, it can be a `published` field, and in DynamoDB it can be an SK.
1307
1747
  *
1308
1748
  * It is not meant to be used via the API.
1309
1749
  * @internal
1310
1750
  */
1311
1751
  published?: boolean;
1312
1752
  /**
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.
1753
+ * Each storage operations implementation MUST determine how to use this field.
1754
+ * In SQL, it can be a `latest` field, and in DynamoDB it can be an SK.
1315
1755
  *
1316
1756
  * It is not meant to be used via the API.
1317
1757
  * @internal
1318
1758
  */
1319
1759
  latest?: boolean;
1320
- [key: string]: any;
1760
+ /**
1761
+ * This is to allow querying by any content model field defined by the user.
1762
+ */
1763
+ [key: string]: string | number | boolean | undefined | string[] | number[] | null | CmsEntryListWhere[] | CmsEntryListWhere | CmsEntryListWhereRef;
1764
+ /**
1765
+ * To allow querying via nested queries, we added the AND / OR properties.
1766
+ */
1767
+ AND?: CmsEntryListWhere[];
1768
+ OR?: CmsEntryListWhere[];
1321
1769
  }
1322
1770
  /**
1323
1771
  * Entry listing sort.
@@ -1343,10 +1791,12 @@ export interface CmsEntryGetParams {
1343
1791
  * @category GraphQL params
1344
1792
  */
1345
1793
  export interface CmsEntryListParams {
1346
- where: CmsEntryListWhere;
1794
+ where?: CmsEntryListWhere;
1347
1795
  sort?: CmsEntryListSort;
1796
+ search?: string;
1797
+ fields?: string[];
1348
1798
  limit?: number;
1349
- after?: string;
1799
+ after?: string | null;
1350
1800
  }
1351
1801
  /**
1352
1802
  * Meta information for GraphQL output.
@@ -1358,7 +1808,7 @@ export interface CmsEntryMeta {
1358
1808
  /**
1359
1809
  * A cursor for pagination.
1360
1810
  */
1361
- cursor: string;
1811
+ cursor: string | null;
1362
1812
  /**
1363
1813
  * Is there more items to load?
1364
1814
  */
@@ -1368,98 +1818,176 @@ export interface CmsEntryMeta {
1368
1818
  */
1369
1819
  totalCount: number;
1370
1820
  }
1371
- export interface BeforeEntryCreateTopicParams {
1372
- input: Partial<CmsEntry>;
1821
+ /**
1822
+ * Create
1823
+ */
1824
+ export interface OnEntryBeforeCreateTopicParams {
1825
+ input: CreateCmsEntryInput;
1373
1826
  entry: CmsEntry;
1374
- model: CmsModel;
1827
+ model: StorageOperationsCmsModel;
1375
1828
  }
1376
- export interface AfterEntryCreateTopicParams {
1377
- input: Partial<CmsEntry>;
1829
+ export interface OnEntryAfterCreateTopicParams {
1830
+ input: CreateCmsEntryInput;
1378
1831
  entry: CmsEntry;
1379
- model: CmsModel;
1832
+ model: StorageOperationsCmsModel;
1380
1833
  storageEntry: CmsEntry;
1381
1834
  }
1382
- export interface BeforeEntryRevisionCreateTopicParams {
1835
+ export interface OnEntryCreateErrorTopicParams {
1836
+ error: Error;
1837
+ input: CreateCmsEntryInput;
1383
1838
  entry: CmsEntry;
1384
1839
  model: CmsModel;
1385
1840
  }
1386
- export interface AfterEntryRevisionCreateTopicParams {
1841
+ /**
1842
+ * Revision Create
1843
+ */
1844
+ export interface OnEntryRevisionBeforeCreateTopicParams {
1845
+ input: CreateFromCmsEntryInput;
1846
+ entry: CmsEntry;
1847
+ original: CmsEntry;
1848
+ model: StorageOperationsCmsModel;
1849
+ }
1850
+ export interface OnEntryRevisionAfterCreateTopicParams {
1851
+ input: CreateFromCmsEntryInput;
1387
1852
  entry: CmsEntry;
1388
- model: CmsModel;
1853
+ original: CmsEntry;
1854
+ model: StorageOperationsCmsModel;
1389
1855
  storageEntry: CmsEntry;
1390
1856
  }
1391
- export interface BeforeEntryUpdateTopicParams {
1392
- input: Partial<CmsEntry>;
1857
+ export interface OnEntryCreateRevisionErrorTopicParams {
1858
+ error: Error;
1859
+ input: CreateFromCmsEntryInput;
1393
1860
  original: CmsEntry;
1394
1861
  entry: CmsEntry;
1395
1862
  model: CmsModel;
1396
1863
  }
1397
- export interface AfterEntryUpdateTopicParams {
1398
- input: Partial<CmsEntry>;
1864
+ /**
1865
+ * Update
1866
+ */
1867
+ export interface OnEntryBeforeUpdateTopicParams {
1868
+ input: UpdateCmsEntryInput;
1399
1869
  original: CmsEntry;
1400
1870
  entry: CmsEntry;
1401
- model: CmsModel;
1871
+ model: StorageOperationsCmsModel;
1872
+ }
1873
+ export interface OnEntryAfterUpdateTopicParams {
1874
+ input: UpdateCmsEntryInput;
1875
+ original: CmsEntry;
1876
+ entry: CmsEntry;
1877
+ model: StorageOperationsCmsModel;
1402
1878
  storageEntry: CmsEntry;
1403
1879
  }
1404
- export interface BeforeEntryPublishTopicParams {
1880
+ export interface OnEntryUpdateErrorTopicParams {
1881
+ error: Error;
1882
+ input: CreateFromCmsEntryInput;
1405
1883
  entry: CmsEntry;
1406
1884
  model: CmsModel;
1407
1885
  }
1408
- export interface AfterEntryPublishTopicParams {
1886
+ /**
1887
+ * Publish
1888
+ */
1889
+ export interface OnEntryBeforePublishTopicParams {
1409
1890
  entry: CmsEntry;
1410
- model: CmsModel;
1891
+ model: StorageOperationsCmsModel;
1892
+ }
1893
+ export interface OnEntryAfterPublishTopicParams {
1894
+ entry: CmsEntry;
1895
+ model: StorageOperationsCmsModel;
1411
1896
  storageEntry: CmsEntry;
1412
1897
  }
1413
- export interface BeforeEntryUnpublishTopicParams {
1898
+ export interface OnEntryPublishErrorTopicParams {
1899
+ error: Error;
1414
1900
  entry: CmsEntry;
1415
- model: CmsModel;
1901
+ model: StorageOperationsCmsModel;
1902
+ }
1903
+ /**
1904
+ * Republish
1905
+ */
1906
+ export interface OnEntryBeforeRepublishTopicParams {
1907
+ entry: CmsEntry;
1908
+ model: StorageOperationsCmsModel;
1416
1909
  }
1417
- export interface AfterEntryUnpublishTopicParams {
1910
+ export interface OnEntryAfterRepublishTopicParams {
1418
1911
  entry: CmsEntry;
1419
- model: CmsModel;
1912
+ model: StorageOperationsCmsModel;
1420
1913
  storageEntry: CmsEntry;
1421
1914
  }
1422
- export interface BeforeEntryRequestChangesTopicParams {
1915
+ export interface OnEntryRepublishErrorTopicParams {
1916
+ error: Error;
1423
1917
  entry: CmsEntry;
1424
- model: CmsModel;
1918
+ model: StorageOperationsCmsModel;
1425
1919
  }
1426
- export interface AfterEntryRequestChangesTopicParams {
1920
+ /**
1921
+ * Unpublish
1922
+ */
1923
+ export interface OnEntryBeforeUnpublishTopicParams {
1427
1924
  entry: CmsEntry;
1428
- model: CmsModel;
1925
+ model: StorageOperationsCmsModel;
1926
+ }
1927
+ export interface OnEntryAfterUnpublishTopicParams {
1928
+ entry: CmsEntry;
1929
+ model: StorageOperationsCmsModel;
1429
1930
  storageEntry: CmsEntry;
1430
1931
  }
1431
- export interface BeforeEntryRequestReviewTopicParams {
1932
+ export interface OnEntryUnpublishErrorTopicParams {
1933
+ error: Error;
1432
1934
  entry: CmsEntry;
1433
1935
  model: CmsModel;
1434
1936
  }
1435
- export interface AfterEntryRequestReviewTopicParams {
1937
+ export interface OnEntryBeforeDeleteTopicParams {
1436
1938
  entry: CmsEntry;
1437
- model: CmsModel;
1438
- storageEntry: CmsEntry;
1939
+ model: StorageOperationsCmsModel;
1439
1940
  }
1440
- export interface BeforeEntryDeleteTopicParams {
1941
+ export interface OnEntryAfterDeleteTopicParams {
1441
1942
  entry: CmsEntry;
1442
- model: CmsModel;
1943
+ model: StorageOperationsCmsModel;
1443
1944
  }
1444
- export interface AfterEntryDeleteTopicParams {
1945
+ export interface OnEntryDeleteErrorTopicParams {
1946
+ error: Error;
1445
1947
  entry: CmsEntry;
1446
- model: CmsModel;
1948
+ model: StorageOperationsCmsModel;
1447
1949
  }
1448
- export interface BeforeEntryRevisionDeleteTopicParams {
1950
+ export interface OnEntryRevisionBeforeDeleteTopicParams {
1449
1951
  entry: CmsEntry;
1450
- model: CmsModel;
1952
+ model: StorageOperationsCmsModel;
1451
1953
  }
1452
- export interface AfterEntryRevisionDeleteTopicParams {
1954
+ export interface OnEntryRevisionAfterDeleteTopicParams {
1453
1955
  entry: CmsEntry;
1454
- model: CmsModel;
1956
+ model: StorageOperationsCmsModel;
1455
1957
  }
1456
- export interface BeforeEntryGetTopicParams {
1457
- model: CmsModel;
1958
+ export interface OnEntryRevisionDeleteErrorTopicParams {
1959
+ error: Error;
1960
+ entry: CmsEntry;
1961
+ model: StorageOperationsCmsModel;
1962
+ }
1963
+ export interface OnEntryBeforeGetTopicParams {
1964
+ model: StorageOperationsCmsModel;
1458
1965
  where: CmsEntryListWhere;
1459
1966
  }
1460
- export interface BeforeEntryListTopicParams {
1967
+ export interface EntryBeforeListTopicParams {
1461
1968
  where: CmsEntryListWhere;
1462
- model: CmsModel;
1969
+ model: StorageOperationsCmsModel;
1970
+ }
1971
+ /**
1972
+ * @category Context
1973
+ * @category CmsEntry
1974
+ */
1975
+ export interface CreateCmsEntryInput {
1976
+ [key: string]: any;
1977
+ }
1978
+ /**
1979
+ * @category Context
1980
+ * @category CmsEntry
1981
+ */
1982
+ export interface CreateFromCmsEntryInput {
1983
+ [key: string]: any;
1984
+ }
1985
+ /**
1986
+ * @category Context
1987
+ * @category CmsEntry
1988
+ */
1989
+ export interface UpdateCmsEntryInput {
1990
+ [key: string]: any;
1463
1991
  }
1464
1992
  /**
1465
1993
  * Cms Entry CRUD methods in the context.
@@ -1475,7 +2003,7 @@ export interface CmsEntryContext {
1475
2003
  /**
1476
2004
  * Get a list of entries for a model by a given ID (revision).
1477
2005
  */
1478
- getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[] | null>;
2006
+ getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[]>;
1479
2007
  /**
1480
2008
  * Get the entry for a model by a given ID.
1481
2009
  */
@@ -1483,9 +2011,9 @@ export interface CmsEntryContext {
1483
2011
  /**
1484
2012
  * List entries for a model. Internal method used by get, listLatest and listPublished.
1485
2013
  */
1486
- listEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
2014
+ listEntries: (model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1487
2015
  /**
1488
- * Lists latest entries. Used for manage API.
2016
+ * Lists the latest entries. Used for manage API.
1489
2017
  */
1490
2018
  listLatestEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1491
2019
  /**
@@ -1503,15 +2031,20 @@ export interface CmsEntryContext {
1503
2031
  /**
1504
2032
  * Create a new content entry.
1505
2033
  */
1506
- createEntry: (model: CmsModel, data: Record<string, any>) => Promise<CmsEntry>;
2034
+ createEntry: (model: CmsModel, input: CreateCmsEntryInput) => Promise<CmsEntry>;
1507
2035
  /**
1508
2036
  * Create a new entry from already existing entry.
1509
2037
  */
1510
- createEntryRevisionFrom: (model: CmsModel, id: string, data: Record<string, any>) => Promise<CmsEntry>;
2038
+ createEntryRevisionFrom: (model: CmsModel, id: string, input: CreateFromCmsEntryInput) => Promise<CmsEntry>;
1511
2039
  /**
1512
2040
  * Update existing entry.
1513
2041
  */
1514
- updateEntry: (model: CmsModel, id: string, data?: Record<string, any>) => Promise<CmsEntry>;
2042
+ updateEntry: (model: CmsModel, id: string, input: UpdateCmsEntryInput, meta?: Record<string, any>) => Promise<CmsEntry>;
2043
+ /**
2044
+ * Method that republishes entry with given identifier.
2045
+ * @internal
2046
+ */
2047
+ republishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;
1515
2048
  /**
1516
2049
  * Delete only a certain revision of the entry.
1517
2050
  */
@@ -1529,40 +2062,105 @@ export interface CmsEntryContext {
1529
2062
  */
1530
2063
  unpublishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;
1531
2064
  /**
1532
- * Request a review for the entry.
2065
+ * Get all entry revisions.
1533
2066
  */
1534
- requestEntryReview: (model: CmsModel, id: string) => Promise<CmsEntry>;
2067
+ getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;
1535
2068
  /**
1536
- * Request changes for the entry.
2069
+ * Lifecyle events - deprecated.
1537
2070
  */
1538
- requestEntryChanges: (model: CmsModel, id: string) => Promise<CmsEntry>;
1539
2071
  /**
1540
- * Get all entry revisions.
2072
+ * @deprecated
1541
2073
  */
1542
- getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;
2074
+ onBeforeEntryCreate: Topic<OnEntryBeforeCreateTopicParams>;
2075
+ /**
2076
+ * @deprecated
2077
+ */
2078
+ onAfterEntryCreate: Topic<OnEntryAfterCreateTopicParams>;
2079
+ /**
2080
+ * @deprecated
2081
+ */
2082
+ onBeforeEntryCreateRevision: Topic<OnEntryRevisionBeforeCreateTopicParams>;
2083
+ /**
2084
+ * @deprecated
2085
+ */
2086
+ onAfterEntryCreateRevision: Topic<OnEntryRevisionAfterCreateTopicParams>;
1543
2087
  /**
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>;
2088
+ * @deprecated
2089
+ */
2090
+ onBeforeEntryUpdate: Topic<OnEntryBeforeUpdateTopicParams>;
2091
+ /**
2092
+ * @deprecated
2093
+ */
2094
+ onAfterEntryUpdate: Topic<OnEntryAfterUpdateTopicParams>;
2095
+ /**
2096
+ * @deprecated
2097
+ */
2098
+ onBeforeEntryDelete: Topic<OnEntryBeforeDeleteTopicParams>;
2099
+ /**
2100
+ * @deprecated
2101
+ */
2102
+ onAfterEntryDelete: Topic<OnEntryAfterDeleteTopicParams>;
2103
+ /**
2104
+ * @deprecated
2105
+ */
2106
+ onBeforeEntryDeleteRevision: Topic<OnEntryRevisionBeforeDeleteTopicParams>;
2107
+ /**
2108
+ * @deprecated
2109
+ */
2110
+ onAfterEntryDeleteRevision: Topic<OnEntryRevisionAfterDeleteTopicParams>;
2111
+ /**
2112
+ * @deprecated
2113
+ */
2114
+ onBeforeEntryPublish: Topic<OnEntryBeforePublishTopicParams>;
2115
+ /**
2116
+ * @deprecated
2117
+ */
2118
+ onAfterEntryPublish: Topic<OnEntryAfterPublishTopicParams>;
2119
+ /**
2120
+ * @deprecated
2121
+ */
2122
+ onBeforeEntryUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
2123
+ /**
2124
+ * @deprecated
2125
+ */
2126
+ onAfterEntryUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
2127
+ /**
2128
+ * @deprecated
2129
+ */
2130
+ onBeforeEntryGet: Topic<OnEntryBeforeGetTopicParams>;
2131
+ /**
2132
+ * @deprecated
2133
+ */
2134
+ onBeforeEntryList: Topic<EntryBeforeListTopicParams>;
2135
+ /**
2136
+ * Lifecycle events released in 5.33.0
2137
+ */
2138
+ onEntryBeforeCreate: Topic<OnEntryBeforeCreateTopicParams>;
2139
+ onEntryAfterCreate: Topic<OnEntryAfterCreateTopicParams>;
2140
+ onEntryCreateError: Topic<OnEntryCreateErrorTopicParams>;
2141
+ onEntryRevisionBeforeCreate: Topic<OnEntryRevisionBeforeCreateTopicParams>;
2142
+ onEntryRevisionAfterCreate: Topic<OnEntryRevisionAfterCreateTopicParams>;
2143
+ onEntryRevisionCreateError: Topic<OnEntryCreateRevisionErrorTopicParams>;
2144
+ onEntryBeforeUpdate: Topic<OnEntryBeforeUpdateTopicParams>;
2145
+ onEntryAfterUpdate: Topic<OnEntryAfterUpdateTopicParams>;
2146
+ onEntryUpdateError: Topic<OnEntryUpdateErrorTopicParams>;
2147
+ onEntryBeforeDelete: Topic<OnEntryBeforeDeleteTopicParams>;
2148
+ onEntryAfterDelete: Topic<OnEntryAfterDeleteTopicParams>;
2149
+ onEntryDeleteError: Topic<OnEntryDeleteErrorTopicParams>;
2150
+ onEntryRevisionBeforeDelete: Topic<OnEntryRevisionBeforeDeleteTopicParams>;
2151
+ onEntryRevisionAfterDelete: Topic<OnEntryRevisionAfterDeleteTopicParams>;
2152
+ onEntryRevisionDeleteError: Topic<OnEntryRevisionDeleteErrorTopicParams>;
2153
+ onEntryBeforePublish: Topic<OnEntryBeforePublishTopicParams>;
2154
+ onEntryAfterPublish: Topic<OnEntryAfterPublishTopicParams>;
2155
+ onEntryPublishError: Topic<OnEntryPublishErrorTopicParams>;
2156
+ onEntryBeforeRepublish: Topic<OnEntryBeforeRepublishTopicParams>;
2157
+ onEntryAfterRepublish: Topic<OnEntryAfterRepublishTopicParams>;
2158
+ onEntryRepublishError: Topic<OnEntryRepublishErrorTopicParams>;
2159
+ onEntryBeforeUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
2160
+ onEntryAfterUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
2161
+ onEntryUnpublishError: Topic<OnEntryUnpublishErrorTopicParams>;
2162
+ onEntryBeforeGet: Topic<OnEntryBeforeGetTopicParams>;
2163
+ onEntryBeforeList: Topic<EntryBeforeListTopicParams>;
1566
2164
  }
1567
2165
  /**
1568
2166
  * Parameters for CmsEntryResolverFactory.
@@ -1589,23 +2187,30 @@ export declare type CmsEntryResolverFactory<TSource = any, TArgs = any, TContext
1589
2187
  */
1590
2188
  export interface CmsSettingsPermission extends SecurityPermission {
1591
2189
  }
2190
+ /**
2191
+ * A base security permission for CMS.
2192
+ *
2193
+ * @category SecurityPermission
2194
+ */
2195
+ export interface BaseCmsSecurityPermission extends SecurityPermission {
2196
+ own?: boolean;
2197
+ rwd: string | number;
2198
+ }
1592
2199
  /**
1593
2200
  * A security permission for content model.
1594
2201
  *
1595
2202
  * @category SecurityPermission
1596
2203
  * @category CmsModel
1597
2204
  */
1598
- export interface CmsModelPermission extends SecurityPermission {
1599
- own: boolean;
1600
- rwd: string;
2205
+ export interface CmsModelPermission extends BaseCmsSecurityPermission {
1601
2206
  /**
1602
- * A object representing `key: model.modelId` values where key is locale code.
2207
+ * An object representing `key: model.modelId` values where key is locale code.
1603
2208
  */
1604
2209
  models?: {
1605
2210
  [key: string]: string[];
1606
2211
  };
1607
2212
  /**
1608
- * A object representing `key: group.id` values where key is locale code.
2213
+ * {locale: groupId[]} map, where key is a locale code.
1609
2214
  */
1610
2215
  groups?: {
1611
2216
  [key: string]: string[];
@@ -1617,11 +2222,9 @@ export interface CmsModelPermission extends SecurityPermission {
1617
2222
  * @category SecurityPermission
1618
2223
  * @category CmsGroup
1619
2224
  */
1620
- export interface CmsGroupPermission extends SecurityPermission {
1621
- own: boolean;
1622
- rwd: string;
2225
+ export interface CmsGroupPermission extends BaseCmsSecurityPermission {
1623
2226
  /**
1624
- * A object representing `key: group.id` values where key is locale code.
2227
+ * {locale: groupId[]} map, where key is a locale code.
1625
2228
  */
1626
2229
  groups?: {
1627
2230
  [key: string]: string[];
@@ -1633,18 +2236,16 @@ export interface CmsGroupPermission extends SecurityPermission {
1633
2236
  * @category SecurityPermission
1634
2237
  * @category CmsEntry
1635
2238
  */
1636
- export interface CmsEntryPermission extends SecurityPermission {
1637
- own: boolean;
1638
- rwd: string;
1639
- pw: string;
2239
+ export interface CmsEntryPermission extends BaseCmsSecurityPermission {
2240
+ pw?: string;
1640
2241
  /**
1641
- * A object representing `key: model.modelId` values where key is locale code.
2242
+ * An object representing `key: model.modelId` values where key is locale code.
1642
2243
  */
1643
2244
  models?: {
1644
2245
  [key: string]: string[];
1645
2246
  };
1646
2247
  /**
1647
- * A object representing `key: group.id` values where key is locale code.
2248
+ * {locale: groupId[]} map, where key is a locale code.
1648
2249
  */
1649
2250
  groups?: {
1650
2251
  [key: string]: string[];
@@ -1665,13 +2266,10 @@ export interface CmsGroupStorageOperationsListParams {
1665
2266
  sort?: string[];
1666
2267
  }
1667
2268
  export interface CmsGroupStorageOperationsCreateParams {
1668
- input: CmsGroupCreateInput;
1669
2269
  group: CmsGroup;
1670
2270
  }
1671
2271
  export interface CmsGroupStorageOperationsUpdateParams {
1672
- original: CmsGroup;
1673
2272
  group: CmsGroup;
1674
- input: CmsGroupUpdateInput;
1675
2273
  }
1676
2274
  export interface CmsGroupStorageOperationsDeleteParams {
1677
2275
  group: CmsGroup;
@@ -1717,13 +2315,10 @@ export interface CmsModelStorageOperationsListParams {
1717
2315
  where: CmsModelStorageOperationsListWhereParams;
1718
2316
  }
1719
2317
  export interface CmsModelStorageOperationsCreateParams {
1720
- input: CmsModelCreateInput;
1721
2318
  model: CmsModel;
1722
2319
  }
1723
2320
  export interface CmsModelStorageOperationsUpdateParams {
1724
- original: CmsModel;
1725
2321
  model: CmsModel;
1726
- input: CmsModelUpdateInput;
1727
2322
  }
1728
2323
  export interface CmsModelStorageOperationsDeleteParams {
1729
2324
  model: CmsModel;
@@ -1763,14 +2358,12 @@ export interface CmsEntryStorageOperationsGetParams {
1763
2358
  export interface CmsEntryStorageOperationsListParams {
1764
2359
  where: CmsEntryListWhere;
1765
2360
  sort?: CmsEntryListSort;
1766
- limit?: number;
1767
- after?: string;
2361
+ search?: string;
2362
+ fields?: string[];
2363
+ limit: number;
2364
+ after?: string | null;
1768
2365
  }
1769
2366
  export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry = CmsStorageEntry> {
1770
- /**
1771
- * Input received from the user.
1772
- */
1773
- input: Record<string, any>;
1774
2367
  /**
1775
2368
  * Real entry, with no transformations on it.
1776
2369
  */
@@ -1781,22 +2374,6 @@ export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry
1781
2374
  storageEntry: T;
1782
2375
  }
1783
2376
  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
2377
  /**
1801
2378
  * Real entry, with no transformations on it.
1802
2379
  */
@@ -1807,18 +2384,6 @@ export interface CmsEntryStorageOperationsCreateRevisionFromParams<T extends Cms
1807
2384
  storageEntry: T;
1808
2385
  }
1809
2386
  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
2387
  /**
1823
2388
  * Real entry, with no transformations on it.
1824
2389
  */
@@ -1832,39 +2397,27 @@ export interface CmsEntryStorageOperationsDeleteRevisionParams<T extends CmsStor
1832
2397
  /**
1833
2398
  * Entry that was deleted.
1834
2399
  */
1835
- entryToDelete: CmsEntry;
2400
+ entry: CmsEntry;
1836
2401
  /**
1837
2402
  * Entry that was deleted, directly from storage, with transformations.
1838
2403
  */
1839
- storageEntryToDelete: T;
2404
+ storageEntry: T;
1840
2405
  /**
1841
2406
  * Entry that was set as latest.
1842
2407
  */
1843
- entryToSetAsLatest?: CmsEntry;
2408
+ latestEntry: CmsEntry | null;
1844
2409
  /**
1845
2410
  * Entry that was set as latest, directly from storage, with transformations.
1846
2411
  */
1847
- storageEntryToSetAsLatest?: T;
2412
+ latestStorageEntry: T | null;
1848
2413
  }
1849
- export interface CmsEntryStorageOperationsDeleteParams<T extends CmsStorageEntry = CmsStorageEntry> {
2414
+ export interface CmsEntryStorageOperationsDeleteParams {
1850
2415
  /**
1851
2416
  * Entry that is going to be deleted.
1852
2417
  */
1853
2418
  entry: CmsEntry;
1854
- /**
1855
- * Entry that is going to be deleted, directly from storage.
1856
- */
1857
- storageEntry: T;
1858
2419
  }
1859
2420
  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
2421
  /**
1869
2422
  * The modified entry that is going to be saved as published.
1870
2423
  * Entry is in its original form.
@@ -1876,14 +2429,6 @@ export interface CmsEntryStorageOperationsPublishParams<T extends CmsStorageEntr
1876
2429
  storageEntry: T;
1877
2430
  }
1878
2431
  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
2432
  /**
1888
2433
  * The modified entry that is going to be saved as unpublished.
1889
2434
  */
@@ -1893,45 +2438,6 @@ export interface CmsEntryStorageOperationsUnpublishParams<T extends CmsStorageEn
1893
2438
  */
1894
2439
  storageEntry: T;
1895
2440
  }
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
2441
  export interface CmsEntryStorageOperationsGetByIdsParams {
1936
2442
  ids: readonly string[];
1937
2443
  }
@@ -1988,90 +2494,76 @@ export interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorag
1988
2494
  /**
1989
2495
  * Get all the entries of the ids.
1990
2496
  */
1991
- getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
2497
+ getByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
1992
2498
  /**
1993
2499
  * Get all the published entries of the ids.
1994
2500
  */
1995
- getPublishedByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
2501
+ getPublishedByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
1996
2502
  /**
1997
2503
  * Get all the latest entries of the ids.
1998
2504
  */
1999
- getLatestByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
2505
+ getLatestByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
2000
2506
  /**
2001
2507
  * Get all revisions of the given entry id.
2002
2508
  */
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[]>;
2509
+ getRevisions: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
2008
2510
  /**
2009
2511
  * Get the entry by the given revision id.
2010
2512
  */
2011
- getRevisionById: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
2513
+ getRevisionById: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
2012
2514
  /**
2013
2515
  * Get the published entry by given entryId.
2014
2516
  */
2015
- getPublishedRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
2517
+ getPublishedRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
2016
2518
  /**
2017
2519
  * Get the latest entry by given entryId.
2018
2520
  */
2019
- getLatestRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
2521
+ getLatestRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
2020
2522
  /**
2021
2523
  * Get the revision of the entry before given one.
2022
2524
  */
2023
- getPreviousRevision: (model: CmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
2525
+ getPreviousRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
2024
2526
  /**
2025
2527
  * Gets entry by given params.
2026
2528
  */
2027
- get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
2529
+ get: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
2028
2530
  /**
2029
2531
  * List all entries. Filterable via params.
2030
2532
  */
2031
- list: (model: CmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
2533
+ list: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
2032
2534
  /**
2033
2535
  * Create a new entry.
2034
2536
  */
2035
- create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
2537
+ create: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
2036
2538
  /**
2037
2539
  * Create a new entry from existing one.
2038
2540
  */
2039
- createRevisionFrom: (model: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
2541
+ createRevisionFrom: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
2040
2542
  /**
2041
2543
  * Update existing entry.
2042
2544
  */
2043
- update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
2545
+ update: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
2044
2546
  /**
2045
2547
  * Delete the entry revision.
2046
2548
  */
2047
- deleteRevision: (model: CmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
2549
+ deleteRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
2048
2550
  /**
2049
2551
  * Delete the entry.
2050
2552
  */
2051
- delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams<T>) => Promise<void>;
2553
+ delete: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
2052
2554
  /**
2053
2555
  * Publish the entry.
2054
2556
  */
2055
- publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
2557
+ publish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
2056
2558
  /**
2057
2559
  * Unpublish the entry.
2058
2560
  */
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>;
2561
+ unpublish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
2068
2562
  }
2069
2563
  export declare enum CONTENT_ENTRY_STATUS {
2070
2564
  DRAFT = "draft",
2071
2565
  PUBLISHED = "published",
2072
- UNPUBLISHED = "unpublished",
2073
- CHANGES_REQUESTED = "changesRequested",
2074
- REVIEW_REQUESTED = "reviewRequested"
2566
+ UNPUBLISHED = "unpublished"
2075
2567
  }
2076
2568
  export interface CmsSettingsStorageOperationsGetParams {
2077
2569
  locale: string;
@@ -2081,7 +2573,6 @@ export interface CmsSettingsStorageOperationsCreateParams {
2081
2573
  settings: CmsSettings;
2082
2574
  }
2083
2575
  export interface CmsSettingsStorageOperationsUpdateParams {
2084
- original: CmsSettings;
2085
2576
  settings: CmsSettings;
2086
2577
  }
2087
2578
  export interface CmsSettingsStorageOperations {
@@ -2114,7 +2605,6 @@ export interface CmsSystemStorageOperationsCreateParams {
2114
2605
  }
2115
2606
  export interface CmsSystemStorageOperationsUpdateParams {
2116
2607
  system: CmsSystem;
2117
- original: CmsSystem;
2118
2608
  }
2119
2609
  export interface CmsSystemStorageOperations {
2120
2610
  /**
@@ -2130,17 +2620,18 @@ export interface CmsSystemStorageOperations {
2130
2620
  */
2131
2621
  update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;
2132
2622
  }
2133
- export interface HeadlessCmsStorageOperations {
2623
+ export interface HeadlessCmsStorageOperations<C = CmsContext> {
2624
+ name: string;
2134
2625
  system: CmsSystemStorageOperations;
2135
2626
  settings: CmsSettingsStorageOperations;
2136
2627
  groups: CmsGroupStorageOperations;
2137
2628
  models: CmsModelStorageOperations;
2138
2629
  entries: CmsEntryStorageOperations;
2139
- init?: (cms: HeadlessCms) => Promise<void>;
2140
2630
  /**
2141
- * Plugins to be attached to the main context.
2631
+ * Either attach something from the storage operations or run something in it.
2142
2632
  */
2143
- plugins?: Plugin[] | Plugin[][];
2633
+ beforeInit?: (context: C) => Promise<void>;
2634
+ init?: (context: C) => Promise<void>;
2144
2635
  /**
2145
2636
  * An upgrade to run if necessary.
2146
2637
  */