@webiny/api-headless-cms 0.0.0-unstable.1e66d121db → 0.0.0-unstable.2696f9d9e8

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 (579) hide show
  1. package/constants.d.ts +32 -0
  2. package/constants.js +57 -0
  3. package/constants.js.map +1 -0
  4. package/context.d.ts +5 -2
  5. package/context.js +100 -25
  6. package/context.js.map +1 -1
  7. package/crud/contentEntry/afterDelete.js +2 -5
  8. package/crud/contentEntry/afterDelete.js.map +1 -1
  9. package/crud/contentEntry/beforeCreate.js +2 -3
  10. package/crud/contentEntry/beforeCreate.js.map +1 -1
  11. package/crud/contentEntry/beforeUpdate.js +2 -3
  12. package/crud/contentEntry/beforeUpdate.js.map +1 -1
  13. package/crud/contentEntry/entryDataFactories/createEntryData.d.ts +20 -0
  14. package/crud/contentEntry/entryDataFactories/createEntryData.js +228 -0
  15. package/crud/contentEntry/entryDataFactories/createEntryData.js.map +1 -0
  16. package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.d.ts +21 -0
  17. package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.js +114 -0
  18. package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.js.map +1 -0
  19. package/crud/contentEntry/entryDataFactories/createPublishEntryData.d.ts +13 -0
  20. package/crud/contentEntry/entryDataFactories/createPublishEntryData.js +61 -0
  21. package/crud/contentEntry/entryDataFactories/createPublishEntryData.js.map +1 -0
  22. package/crud/contentEntry/entryDataFactories/createRepublishEntryData.d.ts +12 -0
  23. package/crud/contentEntry/entryDataFactories/createRepublishEntryData.js +57 -0
  24. package/crud/contentEntry/entryDataFactories/createRepublishEntryData.js.map +1 -0
  25. package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.d.ts +12 -0
  26. package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.js +38 -0
  27. package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.js.map +1 -0
  28. package/crud/contentEntry/entryDataFactories/createUpdateEntryData.d.ts +20 -0
  29. package/crud/contentEntry/entryDataFactories/createUpdateEntryData.js +122 -0
  30. package/crud/contentEntry/entryDataFactories/createUpdateEntryData.js.map +1 -0
  31. package/crud/contentEntry/entryDataFactories/index.d.ts +8 -0
  32. package/crud/contentEntry/entryDataFactories/index.js +95 -0
  33. package/crud/contentEntry/entryDataFactories/index.js.map +1 -0
  34. package/crud/contentEntry/entryDataFactories/mapAndCleanUpdatedInputData.d.ts +5 -0
  35. package/crud/contentEntry/entryDataFactories/mapAndCleanUpdatedInputData.js +36 -0
  36. package/crud/contentEntry/entryDataFactories/mapAndCleanUpdatedInputData.js.map +1 -0
  37. package/crud/contentEntry/entryDataFactories/statuses.d.ts +4 -0
  38. package/crud/contentEntry/entryDataFactories/statuses.js +15 -0
  39. package/crud/contentEntry/entryDataFactories/statuses.js.map +1 -0
  40. package/crud/contentEntry/entryDataValidation.d.ts +4 -2
  41. package/crud/contentEntry/entryDataValidation.js +222 -83
  42. package/crud/contentEntry/entryDataValidation.js.map +1 -1
  43. package/crud/contentEntry/markLockedFields.d.ts +1 -1
  44. package/crud/contentEntry/markLockedFields.js +34 -37
  45. package/crud/contentEntry/markLockedFields.js.map +1 -1
  46. package/crud/contentEntry/referenceFieldsMapping.d.ts +6 -0
  47. package/crud/contentEntry/referenceFieldsMapping.js +145 -145
  48. package/crud/contentEntry/referenceFieldsMapping.js.map +1 -1
  49. package/crud/contentEntry/searchableFields.d.ts +9 -0
  50. package/crud/contentEntry/searchableFields.js +73 -0
  51. package/crud/contentEntry/searchableFields.js.map +1 -0
  52. package/crud/contentEntry.crud.d.ts +9 -5
  53. package/crud/contentEntry.crud.js +1121 -1070
  54. package/crud/contentEntry.crud.js.map +1 -1
  55. package/crud/contentModel/beforeCreate.d.ts +2 -3
  56. package/crud/contentModel/beforeCreate.js +53 -117
  57. package/crud/contentModel/beforeCreate.js.map +1 -1
  58. package/crud/contentModel/beforeDelete.d.ts +1 -1
  59. package/crud/contentModel/beforeDelete.js +3 -15
  60. package/crud/contentModel/beforeDelete.js.map +1 -1
  61. package/crud/contentModel/beforeUpdate.d.ts +2 -4
  62. package/crud/contentModel/beforeUpdate.js +32 -12
  63. package/crud/contentModel/beforeUpdate.js.map +1 -1
  64. package/crud/contentModel/compatibility/modelApiName.d.ts +3 -0
  65. package/crud/contentModel/compatibility/modelApiName.js +26 -0
  66. package/crud/contentModel/compatibility/modelApiName.js.map +1 -0
  67. package/crud/contentModel/contentModelManagerFactory.js +2 -7
  68. package/crud/contentModel/contentModelManagerFactory.js.map +1 -1
  69. package/crud/contentModel/createFieldStorageId.js +6 -3
  70. package/crud/contentModel/createFieldStorageId.js.map +1 -1
  71. package/crud/contentModel/defaultFields.d.ts +5 -0
  72. package/crud/contentModel/defaultFields.js +60 -0
  73. package/crud/contentModel/defaultFields.js.map +1 -0
  74. package/crud/contentModel/ensureTypeTag.d.ts +5 -0
  75. package/crud/contentModel/ensureTypeTag.js +21 -0
  76. package/crud/contentModel/ensureTypeTag.js.map +1 -0
  77. package/crud/contentModel/fields/descriptionField.d.ts +2 -0
  78. package/crud/contentModel/fields/descriptionField.js +44 -0
  79. package/crud/contentModel/fields/descriptionField.js.map +1 -0
  80. package/crud/contentModel/fields/imageField.d.ts +2 -0
  81. package/crud/contentModel/fields/imageField.js +44 -0
  82. package/crud/contentModel/fields/imageField.js.map +1 -0
  83. package/crud/contentModel/fields/titleField.d.ts +2 -0
  84. package/crud/contentModel/fields/titleField.js +60 -0
  85. package/crud/contentModel/fields/titleField.js.map +1 -0
  86. package/crud/contentModel/listModelsFromDatabase.d.ts +10 -0
  87. package/crud/contentModel/listModelsFromDatabase.js +38 -0
  88. package/crud/contentModel/listModelsFromDatabase.js.map +1 -0
  89. package/crud/contentModel/validate/endingAllowed.d.ts +6 -0
  90. package/crud/contentModel/validate/endingAllowed.js +28 -0
  91. package/crud/contentModel/validate/endingAllowed.js.map +1 -0
  92. package/crud/contentModel/validate/isModelEndingAllowed.d.ts +6 -0
  93. package/crud/contentModel/validate/isModelEndingAllowed.js +26 -0
  94. package/crud/contentModel/validate/isModelEndingAllowed.js.map +1 -0
  95. package/crud/contentModel/validate/modelId.d.ts +11 -0
  96. package/crud/contentModel/validate/modelId.js +38 -0
  97. package/crud/contentModel/validate/modelId.js.map +1 -0
  98. package/crud/contentModel/validate/pluralApiName.d.ts +7 -0
  99. package/crud/contentModel/validate/pluralApiName.js +26 -0
  100. package/crud/contentModel/validate/pluralApiName.js.map +1 -0
  101. package/crud/contentModel/validate/singularApiName.d.ts +7 -0
  102. package/crud/contentModel/validate/singularApiName.js +26 -0
  103. package/crud/contentModel/validate/singularApiName.js.map +1 -0
  104. package/crud/contentModel/validateModel.d.ts +4 -4
  105. package/crud/contentModel/validateModel.js +8 -11
  106. package/crud/contentModel/validateModel.js.map +1 -1
  107. package/crud/contentModel/validateModelFields.d.ts +4 -4
  108. package/crud/contentModel/validateModelFields.js +136 -152
  109. package/crud/contentModel/validateModelFields.js.map +1 -1
  110. package/crud/contentModel/validation.d.ts +872 -0
  111. package/crud/contentModel/validation.js +205 -0
  112. package/crud/contentModel/validation.js.map +1 -0
  113. package/crud/contentModel.crud.d.ts +2 -0
  114. package/crud/contentModel.crud.js +436 -445
  115. package/crud/contentModel.crud.js.map +1 -1
  116. package/crud/contentModelGroup/beforeCreate.d.ts +1 -1
  117. package/crud/contentModelGroup/beforeCreate.js +14 -12
  118. package/crud/contentModelGroup/beforeCreate.js.map +1 -1
  119. package/crud/contentModelGroup/beforeDelete.js +2 -8
  120. package/crud/contentModelGroup/beforeDelete.js.map +1 -1
  121. package/crud/contentModelGroup/beforeUpdate.js +2 -5
  122. package/crud/contentModelGroup/beforeUpdate.js.map +1 -1
  123. package/crud/contentModelGroup/listGroupsFromDatabase.d.ts +8 -0
  124. package/crud/contentModelGroup/listGroupsFromDatabase.js +22 -0
  125. package/crud/contentModelGroup/listGroupsFromDatabase.js.map +1 -0
  126. package/crud/contentModelGroup/validation.d.ts +33 -0
  127. package/crud/contentModelGroup/validation.js +37 -0
  128. package/crud/contentModelGroup/validation.js.map +1 -0
  129. package/crud/contentModelGroup.crud.d.ts +3 -1
  130. package/crud/contentModelGroup.crud.js +291 -289
  131. package/crud/contentModelGroup.crud.js.map +1 -1
  132. package/crud/system.crud.js +8 -106
  133. package/crud/system.crud.js.map +1 -1
  134. package/export/crud/exporting.d.ts +3 -0
  135. package/export/crud/exporting.js +49 -0
  136. package/export/crud/exporting.js.map +1 -0
  137. package/export/crud/importing.d.ts +3 -0
  138. package/export/crud/importing.js +79 -0
  139. package/export/crud/importing.js.map +1 -0
  140. package/export/crud/imports/importData.d.ts +14 -0
  141. package/export/crud/imports/importData.js +52 -0
  142. package/export/crud/imports/importData.js.map +1 -0
  143. package/export/crud/imports/importGroups.d.ts +8 -0
  144. package/export/crud/imports/importGroups.js +104 -0
  145. package/export/crud/imports/importGroups.js.map +1 -0
  146. package/export/crud/imports/importModels.d.ts +8 -0
  147. package/export/crud/imports/importModels.js +136 -0
  148. package/export/crud/imports/importModels.js.map +1 -0
  149. package/export/crud/imports/validateGroups.d.ts +8 -0
  150. package/export/crud/imports/validateGroups.js +112 -0
  151. package/export/crud/imports/validateGroups.js.map +1 -0
  152. package/export/crud/imports/validateInput.d.ts +19 -0
  153. package/export/crud/imports/validateInput.js +55 -0
  154. package/export/crud/imports/validateInput.js.map +1 -0
  155. package/export/crud/imports/validateModels.d.ts +12 -0
  156. package/export/crud/imports/validateModels.js +203 -0
  157. package/export/crud/imports/validateModels.js.map +1 -0
  158. package/export/crud/index.d.ts +4 -0
  159. package/export/crud/index.js +15 -0
  160. package/export/crud/index.js.map +1 -0
  161. package/export/crud/sanitize.d.ts +4 -0
  162. package/export/crud/sanitize.js +35 -0
  163. package/export/crud/sanitize.js.map +1 -0
  164. package/export/graphql/index.d.ts +3 -0
  165. package/export/graphql/index.js +188 -0
  166. package/export/graphql/index.js.map +1 -0
  167. package/export/index.d.ts +2 -0
  168. package/export/index.js +29 -0
  169. package/export/index.js.map +1 -0
  170. package/export/types.d.ts +113 -0
  171. package/export/types.js +22 -0
  172. package/export/types.js.map +1 -0
  173. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +3 -19
  174. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -1
  175. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.d.ts +11 -0
  176. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +200 -0
  177. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -0
  178. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +46 -90
  179. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -1
  180. package/fieldConverters/index.d.ts +2 -1
  181. package/fieldConverters/index.js +4 -5
  182. package/fieldConverters/index.js.map +1 -1
  183. package/graphql/buildSchemaPlugins.d.ts +8 -3
  184. package/graphql/buildSchemaPlugins.js +9 -11
  185. package/graphql/buildSchemaPlugins.js.map +1 -1
  186. package/graphql/checkEndpointAccess.d.ts +2 -0
  187. package/graphql/checkEndpointAccess.js +20 -0
  188. package/graphql/checkEndpointAccess.js.map +1 -0
  189. package/graphql/createExecutableSchema.d.ts +6 -0
  190. package/graphql/createExecutableSchema.js +31 -0
  191. package/graphql/createExecutableSchema.js.map +1 -0
  192. package/graphql/createRequestBody.d.ts +2 -0
  193. package/graphql/createRequestBody.js +16 -0
  194. package/graphql/createRequestBody.js.map +1 -0
  195. package/graphql/formatErrorPayload.d.ts +1 -0
  196. package/graphql/formatErrorPayload.js +27 -0
  197. package/graphql/formatErrorPayload.js.map +1 -0
  198. package/graphql/generateSchema.d.ts +8 -0
  199. package/graphql/generateSchema.js +33 -0
  200. package/graphql/generateSchema.js.map +1 -0
  201. package/graphql/getSchema.d.ts +16 -0
  202. package/graphql/getSchema.js +118 -0
  203. package/graphql/getSchema.js.map +1 -0
  204. package/graphql/graphQLHandlerFactory.js +8 -129
  205. package/graphql/graphQLHandlerFactory.js.map +1 -1
  206. package/graphql/handleRequest.d.ts +11 -0
  207. package/graphql/handleRequest.js +79 -0
  208. package/graphql/handleRequest.js.map +1 -0
  209. package/graphql/index.d.ts +1 -3
  210. package/graphql/index.js +4 -46
  211. package/graphql/index.js.map +1 -1
  212. package/graphql/schema/baseContentSchema.d.ts +6 -2
  213. package/graphql/schema/baseContentSchema.js +20 -29
  214. package/graphql/schema/baseContentSchema.js.map +1 -1
  215. package/graphql/schema/baseSchema.d.ts +2 -0
  216. package/graphql/schema/baseSchema.js +146 -0
  217. package/graphql/schema/baseSchema.js.map +1 -0
  218. package/graphql/schema/contentEntries.d.ts +6 -2
  219. package/graphql/schema/contentEntries.js +160 -111
  220. package/graphql/schema/contentEntries.js.map +1 -1
  221. package/graphql/schema/contentModelGroups.d.ts +6 -2
  222. package/graphql/schema/contentModelGroups.js +20 -30
  223. package/graphql/schema/contentModelGroups.js.map +1 -1
  224. package/graphql/schema/contentModels.d.ts +6 -2
  225. package/graphql/schema/contentModels.js +81 -26
  226. package/graphql/schema/contentModels.js.map +1 -1
  227. package/graphql/schema/createFieldResolvers.d.ts +2 -2
  228. package/graphql/schema/createFieldResolvers.js +29 -40
  229. package/graphql/schema/createFieldResolvers.js.map +1 -1
  230. package/graphql/schema/createFieldTypePluginRecords.d.ts +3 -0
  231. package/graphql/schema/createFieldTypePluginRecords.js +15 -0
  232. package/graphql/schema/createFieldTypePluginRecords.js.map +1 -0
  233. package/graphql/schema/createManageResolvers.d.ts +1 -1
  234. package/graphql/schema/createManageResolvers.js +59 -52
  235. package/graphql/schema/createManageResolvers.js.map +1 -1
  236. package/graphql/schema/createManageSDL.d.ts +3 -0
  237. package/graphql/schema/createManageSDL.js +119 -81
  238. package/graphql/schema/createManageSDL.js.map +1 -1
  239. package/graphql/schema/createPreviewResolvers.js +9 -22
  240. package/graphql/schema/createPreviewResolvers.js.map +1 -1
  241. package/graphql/schema/createReadResolvers.js +14 -22
  242. package/graphql/schema/createReadResolvers.js.map +1 -1
  243. package/graphql/schema/createReadSDL.d.ts +3 -0
  244. package/graphql/schema/createReadSDL.js +57 -48
  245. package/graphql/schema/createReadSDL.js.map +1 -1
  246. package/graphql/schema/resolvers/manage/resolveCreate.d.ts +2 -1
  247. package/graphql/schema/resolvers/manage/resolveCreate.js +3 -4
  248. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
  249. package/graphql/schema/resolvers/manage/resolveCreateFrom.d.ts +2 -1
  250. package/graphql/schema/resolvers/manage/resolveCreateFrom.js +3 -4
  251. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
  252. package/graphql/schema/resolvers/manage/resolveDelete.d.ts +2 -1
  253. package/graphql/schema/resolvers/manage/resolveDelete.js +15 -9
  254. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
  255. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.d.ts +7 -0
  256. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +22 -0
  257. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -0
  258. package/graphql/schema/resolvers/manage/resolveGet.js +11 -20
  259. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
  260. package/graphql/schema/resolvers/manage/resolveGetByIds.js +2 -3
  261. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
  262. package/graphql/schema/resolvers/manage/resolveGetRevisions.js +2 -3
  263. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
  264. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.d.ts +4 -0
  265. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +20 -0
  266. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -0
  267. package/graphql/schema/resolvers/manage/resolveList.js +2 -3
  268. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
  269. package/graphql/schema/resolvers/manage/resolveMove.d.ts +8 -0
  270. package/graphql/schema/resolvers/manage/resolveMove.js +27 -0
  271. package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -0
  272. package/graphql/schema/resolvers/manage/resolvePublish.js +2 -3
  273. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
  274. package/graphql/schema/resolvers/manage/resolveRepublish.js +2 -3
  275. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
  276. package/graphql/schema/resolvers/manage/resolveUnpublish.js +2 -3
  277. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
  278. package/graphql/schema/resolvers/manage/resolveUpdate.d.ts +2 -1
  279. package/graphql/schema/resolvers/manage/resolveUpdate.js +3 -4
  280. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
  281. package/graphql/schema/resolvers/manage/resolveValidate.d.ts +8 -0
  282. package/graphql/schema/resolvers/manage/{resolveRequestChanges.js → resolveValidate.js} +5 -6
  283. package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -0
  284. package/graphql/schema/resolvers/preview/resolveGet.js +5 -12
  285. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
  286. package/graphql/schema/resolvers/preview/resolveList.js +2 -3
  287. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
  288. package/graphql/schema/resolvers/read/resolveGet.js +5 -12
  289. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
  290. package/graphql/schema/resolvers/read/resolveList.js +2 -3
  291. package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
  292. package/graphql/schema/schemaPlugins.d.ts +8 -3
  293. package/graphql/schema/schemaPlugins.js +60 -69
  294. package/graphql/schema/schemaPlugins.js.map +1 -1
  295. package/graphql/system.d.ts +2 -5
  296. package/graphql/system.js +58 -98
  297. package/graphql/system.js.map +1 -1
  298. package/graphqlFields/boolean.js +2 -12
  299. package/graphqlFields/boolean.js.map +1 -1
  300. package/graphqlFields/datetime.js +4 -21
  301. package/graphqlFields/datetime.js.map +1 -1
  302. package/graphqlFields/dynamicZone/dynamicZoneField.d.ts +2 -0
  303. package/graphqlFields/dynamicZone/dynamicZoneField.js +266 -0
  304. package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -0
  305. package/graphqlFields/dynamicZone/dynamicZoneStorage.d.ts +3 -0
  306. package/graphqlFields/dynamicZone/dynamicZoneStorage.js +111 -0
  307. package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +1 -0
  308. package/graphqlFields/dynamicZone/index.d.ts +2 -0
  309. package/graphqlFields/dynamicZone/index.js +21 -0
  310. package/graphqlFields/dynamicZone/index.js.map +1 -0
  311. package/graphqlFields/file.js +2 -8
  312. package/graphqlFields/file.js.map +1 -1
  313. package/graphqlFields/helpers.d.ts +0 -1
  314. package/graphqlFields/helpers.js +5 -27
  315. package/graphqlFields/helpers.js.map +1 -1
  316. package/graphqlFields/index.d.ts +1 -1
  317. package/graphqlFields/index.js +5 -12
  318. package/graphqlFields/index.js.map +1 -1
  319. package/graphqlFields/json.d.ts +2 -0
  320. package/graphqlFields/json.js +49 -0
  321. package/graphqlFields/json.js.map +1 -0
  322. package/graphqlFields/longText.js +13 -12
  323. package/graphqlFields/longText.js.map +1 -1
  324. package/graphqlFields/number.js +7 -12
  325. package/graphqlFields/number.js.map +1 -1
  326. package/graphqlFields/object.js +114 -101
  327. package/graphqlFields/object.js.map +1 -1
  328. package/graphqlFields/ref.js +111 -119
  329. package/graphqlFields/ref.js.map +1 -1
  330. package/graphqlFields/richText.js +2 -9
  331. package/graphqlFields/richText.js.map +1 -1
  332. package/graphqlFields/text.js +4 -11
  333. package/graphqlFields/text.js.map +1 -1
  334. package/index.d.ts +6 -3
  335. package/index.js +43 -29
  336. package/index.js.map +1 -1
  337. package/modelManager/DefaultCmsModelManager.js +2 -20
  338. package/modelManager/DefaultCmsModelManager.js.map +1 -1
  339. package/modelManager/index.js +2 -4
  340. package/modelManager/index.js.map +1 -1
  341. package/package.json +36 -43
  342. package/parameters/context.js +3 -5
  343. package/parameters/context.js.map +1 -1
  344. package/parameters/header.js +6 -16
  345. package/parameters/header.js.map +1 -1
  346. package/parameters/index.js +3 -9
  347. package/parameters/index.js.map +1 -1
  348. package/parameters/manual.js +9 -11
  349. package/parameters/manual.js.map +1 -1
  350. package/parameters/path.js +3 -13
  351. package/parameters/path.js.map +1 -1
  352. package/plugins/CmsGraphQLSchemaPlugin.d.ts +5 -0
  353. package/plugins/CmsGraphQLSchemaPlugin.js +13 -0
  354. package/plugins/CmsGraphQLSchemaPlugin.js.map +1 -0
  355. package/plugins/CmsGraphQLSchemaSorterPlugin.d.ts +20 -0
  356. package/plugins/CmsGraphQLSchemaSorterPlugin.js +27 -0
  357. package/plugins/CmsGraphQLSchemaSorterPlugin.js.map +1 -0
  358. package/plugins/CmsGroupPlugin.d.ts +6 -3
  359. package/plugins/CmsGroupPlugin.js +7 -13
  360. package/plugins/CmsGroupPlugin.js.map +1 -1
  361. package/plugins/CmsModelFieldConverterPlugin.d.ts +2 -2
  362. package/plugins/CmsModelFieldConverterPlugin.js +5 -9
  363. package/plugins/CmsModelFieldConverterPlugin.js.map +1 -1
  364. package/plugins/CmsModelPlugin.d.ts +25 -5
  365. package/plugins/CmsModelPlugin.js +72 -57
  366. package/plugins/CmsModelPlugin.js.map +1 -1
  367. package/plugins/CmsParametersPlugin.js +6 -10
  368. package/plugins/CmsParametersPlugin.js.map +1 -1
  369. package/plugins/StorageOperationsCmsModelPlugin.d.ts +23 -0
  370. package/plugins/StorageOperationsCmsModelPlugin.js +41 -0
  371. package/plugins/StorageOperationsCmsModelPlugin.js.map +1 -0
  372. package/plugins/StorageTransformPlugin.d.ts +13 -13
  373. package/plugins/StorageTransformPlugin.js +3 -13
  374. package/plugins/StorageTransformPlugin.js.map +1 -1
  375. package/plugins/index.d.ts +3 -0
  376. package/plugins/index.js +36 -11
  377. package/plugins/index.js.map +1 -1
  378. package/storage/default.js +2 -3
  379. package/storage/default.js.map +1 -1
  380. package/storage/index.d.ts +1 -0
  381. package/storage/index.js +15 -0
  382. package/storage/index.js.map +1 -0
  383. package/storage/json.d.ts +2 -0
  384. package/storage/json.js +27 -0
  385. package/storage/json.js.map +1 -0
  386. package/storage/object.js +11 -27
  387. package/storage/object.js.map +1 -1
  388. package/types.d.ts +755 -384
  389. package/types.js +83 -90
  390. package/types.js.map +1 -1
  391. package/utils/access.d.ts +9 -8
  392. package/utils/access.js +11 -75
  393. package/utils/access.js.map +1 -1
  394. package/utils/caching/Cache.d.ts +2 -0
  395. package/utils/caching/Cache.js +51 -0
  396. package/utils/caching/Cache.js.map +1 -0
  397. package/utils/caching/CacheKey.d.ts +2 -0
  398. package/utils/caching/CacheKey.js +40 -0
  399. package/utils/caching/CacheKey.js.map +1 -0
  400. package/utils/caching/index.d.ts +2 -0
  401. package/utils/caching/index.js +29 -0
  402. package/utils/caching/index.js.map +1 -0
  403. package/utils/caching/types.d.ts +11 -0
  404. package/utils/caching/types.js +7 -0
  405. package/utils/caching/types.js.map +1 -0
  406. package/utils/converters/Converter.js +3 -17
  407. package/utils/converters/Converter.js.map +1 -1
  408. package/utils/converters/ConverterCollection.d.ts +7 -0
  409. package/utils/converters/ConverterCollection.js +43 -31
  410. package/utils/converters/ConverterCollection.js.map +1 -1
  411. package/utils/converters/valueKeyStorageConverter.d.ts +1 -5
  412. package/utils/converters/valueKeyStorageConverter.js +32 -45
  413. package/utils/converters/valueKeyStorageConverter.js.map +1 -1
  414. package/utils/createTypeFromFields.d.ts +16 -0
  415. package/utils/createTypeFromFields.js +71 -0
  416. package/utils/createTypeFromFields.js.map +1 -0
  417. package/utils/createTypeName.d.ts +0 -2
  418. package/utils/createTypeName.js +4 -17
  419. package/utils/createTypeName.js.map +1 -1
  420. package/utils/date.d.ts +10 -0
  421. package/utils/date.js +36 -0
  422. package/utils/date.js.map +1 -0
  423. package/utils/entryStorage.d.ts +4 -4
  424. package/utils/entryStorage.js +27 -38
  425. package/utils/entryStorage.js.map +1 -1
  426. package/utils/filterAsync.js +8 -12
  427. package/utils/filterAsync.js.map +1 -1
  428. package/utils/getBaseFieldType.d.ts +2 -0
  429. package/utils/getBaseFieldType.js +12 -0
  430. package/utils/getBaseFieldType.js.map +1 -0
  431. package/utils/getEntryDescription.d.ts +2 -0
  432. package/utils/getEntryDescription.js +19 -0
  433. package/utils/getEntryDescription.js.map +1 -0
  434. package/utils/getEntryImage.d.ts +2 -0
  435. package/utils/getEntryImage.js +19 -0
  436. package/utils/getEntryImage.js.map +1 -0
  437. package/utils/getEntryTitle.d.ts +1 -1
  438. package/utils/getEntryTitle.js +3 -10
  439. package/utils/getEntryTitle.js.map +1 -1
  440. package/utils/getSchemaFromFieldPlugins.d.ts +14 -6
  441. package/utils/getSchemaFromFieldPlugins.js +39 -17
  442. package/utils/getSchemaFromFieldPlugins.js.map +1 -1
  443. package/utils/identity.d.ts +2 -0
  444. package/utils/identity.js +20 -0
  445. package/utils/identity.js.map +1 -0
  446. package/utils/incrementEntryIdVersion.d.ts +5 -0
  447. package/utils/incrementEntryIdVersion.js +31 -0
  448. package/utils/incrementEntryIdVersion.js.map +1 -0
  449. package/utils/index.d.ts +1 -0
  450. package/utils/index.js +18 -0
  451. package/utils/index.js.map +1 -0
  452. package/utils/permissions/EntriesPermissions.d.ts +4 -0
  453. package/utils/permissions/EntriesPermissions.js +11 -0
  454. package/utils/permissions/EntriesPermissions.js.map +1 -0
  455. package/utils/permissions/ModelGroupsPermissions.d.ts +9 -0
  456. package/utils/permissions/ModelGroupsPermissions.js +50 -0
  457. package/utils/permissions/ModelGroupsPermissions.js.map +1 -0
  458. package/utils/permissions/ModelsPermissions.d.ts +22 -0
  459. package/utils/permissions/ModelsPermissions.js +90 -0
  460. package/utils/permissions/ModelsPermissions.js.map +1 -0
  461. package/utils/renderFields.d.ts +4 -2
  462. package/utils/renderFields.js +14 -11
  463. package/utils/renderFields.js.map +1 -1
  464. package/utils/renderGetFilterFields.d.ts +2 -2
  465. package/utils/renderGetFilterFields.js +10 -30
  466. package/utils/renderGetFilterFields.js.map +1 -1
  467. package/utils/renderInputFields.d.ts +4 -2
  468. package/utils/renderInputFields.js +21 -14
  469. package/utils/renderInputFields.js.map +1 -1
  470. package/utils/renderListFilterFields.d.ts +3 -1
  471. package/utils/renderListFilterFields.js +27 -30
  472. package/utils/renderListFilterFields.js.map +1 -1
  473. package/utils/renderSortEnum.d.ts +9 -5
  474. package/utils/renderSortEnum.js +29 -12
  475. package/utils/renderSortEnum.js.map +1 -1
  476. package/utils/toSlug.js +2 -4
  477. package/utils/toSlug.js.map +1 -1
  478. package/validators/dateGte.js +2 -7
  479. package/validators/dateGte.js.map +1 -1
  480. package/validators/dateLte.js +2 -7
  481. package/validators/dateLte.js.map +1 -1
  482. package/validators/gte.js +3 -10
  483. package/validators/gte.js.map +1 -1
  484. package/validators/in.js +3 -10
  485. package/validators/in.js.map +1 -1
  486. package/validators/index.js +2 -15
  487. package/validators/index.js.map +1 -1
  488. package/validators/lte.js +3 -10
  489. package/validators/lte.js.map +1 -1
  490. package/validators/maxLength.js +3 -10
  491. package/validators/maxLength.js.map +1 -1
  492. package/validators/minLength.js +3 -10
  493. package/validators/minLength.js.map +1 -1
  494. package/validators/pattern.js +4 -11
  495. package/validators/pattern.js.map +1 -1
  496. package/validators/patternPlugins/email.js +2 -2
  497. package/validators/patternPlugins/email.js.map +1 -1
  498. package/validators/patternPlugins/index.js +2 -8
  499. package/validators/patternPlugins/index.js.map +1 -1
  500. package/validators/patternPlugins/lowerCase.js +2 -2
  501. package/validators/patternPlugins/lowerCase.js.map +1 -1
  502. package/validators/patternPlugins/lowerCaseSpace.js +2 -2
  503. package/validators/patternPlugins/lowerCaseSpace.js.map +1 -1
  504. package/validators/patternPlugins/upperCase.js +2 -2
  505. package/validators/patternPlugins/upperCase.js.map +1 -1
  506. package/validators/patternPlugins/upperCaseSpace.js +2 -2
  507. package/validators/patternPlugins/upperCaseSpace.js.map +1 -1
  508. package/validators/patternPlugins/url.js +2 -2
  509. package/validators/patternPlugins/url.js.map +1 -1
  510. package/validators/required.js +2 -5
  511. package/validators/required.js.map +1 -1
  512. package/validators/timeGte.js +3 -10
  513. package/validators/timeGte.js.map +1 -1
  514. package/validators/timeLte.js +3 -10
  515. package/validators/timeLte.js.map +1 -1
  516. package/validators/unique.js +3 -8
  517. package/validators/unique.js.map +1 -1
  518. package/crud/contentModel/afterCreate.d.ts +0 -8
  519. package/crud/contentModel/afterCreate.js +0 -18
  520. package/crud/contentModel/afterCreate.js.map +0 -1
  521. package/crud/contentModel/afterCreateFrom.d.ts +0 -8
  522. package/crud/contentModel/afterCreateFrom.js +0 -18
  523. package/crud/contentModel/afterCreateFrom.js.map +0 -1
  524. package/crud/contentModel/afterDelete.d.ts +0 -8
  525. package/crud/contentModel/afterDelete.js +0 -18
  526. package/crud/contentModel/afterDelete.js.map +0 -1
  527. package/crud/contentModel/afterUpdate.d.ts +0 -8
  528. package/crud/contentModel/afterUpdate.js +0 -18
  529. package/crud/contentModel/afterUpdate.js.map +0 -1
  530. package/crud/contentModel/createFieldModels.d.ts +0 -2
  531. package/crud/contentModel/createFieldModels.js +0 -26
  532. package/crud/contentModel/createFieldModels.js.map +0 -1
  533. package/crud/contentModel/fieldIdValidation.d.ts +0 -1
  534. package/crud/contentModel/fieldIdValidation.js +0 -25
  535. package/crud/contentModel/fieldIdValidation.js.map +0 -1
  536. package/crud/contentModel/idValidation.d.ts +0 -1
  537. package/crud/contentModel/idValidation.js +0 -22
  538. package/crud/contentModel/idValidation.js.map +0 -1
  539. package/crud/contentModel/models.d.ts +0 -4
  540. package/crud/contentModel/models.js +0 -180
  541. package/crud/contentModel/models.js.map +0 -1
  542. package/crud/contentModel/systemFields.d.ts +0 -1
  543. package/crud/contentModel/systemFields.js +0 -8
  544. package/crud/contentModel/systemFields.js.map +0 -1
  545. package/crud/contentModel/validateLayout.d.ts +0 -2
  546. package/crud/contentModel/validateLayout.js +0 -36
  547. package/crud/contentModel/validateLayout.js.map +0 -1
  548. package/crud/index.d.ts +0 -6
  549. package/crud/index.js +0 -85
  550. package/crud/index.js.map +0 -1
  551. package/crud/settings.crud.d.ts +0 -10
  552. package/crud/settings.crud.js +0 -83
  553. package/crud/settings.crud.js.map +0 -1
  554. package/graphql/schema/resolvers/commonFieldResolvers.d.ts +0 -6
  555. package/graphql/schema/resolvers/commonFieldResolvers.js +0 -14
  556. package/graphql/schema/resolvers/commonFieldResolvers.js.map +0 -1
  557. package/graphql/schema/resolvers/manage/resolveRequestChanges.d.ts +0 -7
  558. package/graphql/schema/resolvers/manage/resolveRequestChanges.js.map +0 -1
  559. package/graphql/schema/resolvers/manage/resolveRequestReview.d.ts +0 -7
  560. package/graphql/schema/resolvers/manage/resolveRequestReview.js +0 -21
  561. package/graphql/schema/resolvers/manage/resolveRequestReview.js.map +0 -1
  562. package/upgrades/5.33.0/index.d.ts +0 -3
  563. package/upgrades/5.33.0/index.js +0 -182
  564. package/upgrades/5.33.0/index.js.map +0 -1
  565. package/upgrades/index.d.ts +0 -1
  566. package/upgrades/index.js +0 -12
  567. package/upgrades/index.js.map +0 -1
  568. package/utils/filterModelFields.d.ts +0 -16
  569. package/utils/filterModelFields.js +0 -77
  570. package/utils/filterModelFields.js.map +0 -1
  571. package/utils/ownership.d.ts +0 -8
  572. package/utils/ownership.js +0 -41
  573. package/utils/ownership.js.map +0 -1
  574. package/utils/permissions.d.ts +0 -7
  575. package/utils/permissions.js +0 -106
  576. package/utils/permissions.js.map +0 -1
  577. package/utils/pluralizedTypeName.d.ts +0 -1
  578. package/utils/pluralizedTypeName.js +0 -26
  579. package/utils/pluralizedTypeName.js.map +0 -1
package/types.d.ts CHANGED
@@ -4,12 +4,19 @@ import { Context } from "@webiny/api/types";
4
4
  import { GraphQLFieldResolver, GraphQLSchemaDefinition, Resolvers } from "@webiny/handler-graphql/types";
5
5
  import { SecurityPermission } from "@webiny/api-security/types";
6
6
  import { DbContext } from "@webiny/handler-db/types";
7
- import { FileManagerContext } from "@webiny/api-file-manager/types";
8
- import { UpgradePlugin } from "@webiny/api-upgrade/types";
9
7
  import { Topic } from "@webiny/pubsub/types";
10
8
  import { CmsModelConverterCallable } from "./utils/converters/ConverterCollection";
9
+ import { ModelGroupsPermissions } from "./utils/permissions/ModelGroupsPermissions";
10
+ import { ModelsPermissions } from "./utils/permissions/ModelsPermissions";
11
+ import { EntriesPermissions } from "./utils/permissions/EntriesPermissions";
12
+ import { HeadlessCmsExport, HeadlessCmsImport } from "./export/types";
11
13
  export declare type ApiEndpoint = "manage" | "preview" | "read";
12
- export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGroupContext, CmsModelContext, CmsEntryContext {
14
+ interface HeadlessCmsPermissions {
15
+ groups: ModelGroupsPermissions;
16
+ models: ModelsPermissions;
17
+ entries: EntriesPermissions;
18
+ }
19
+ export interface HeadlessCms extends CmsSystemContext, CmsGroupContext, CmsModelContext, CmsEntryContext {
13
20
  /**
14
21
  * API type
15
22
  */
@@ -38,13 +45,24 @@ export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGr
38
45
  * The storage operations loaded for current context.
39
46
  */
40
47
  storageOperations: HeadlessCmsStorageOperations;
48
+ /**
49
+ * Permissions for groups, models and entries.
50
+ *
51
+ * @internal
52
+ */
53
+ permissions: HeadlessCmsPermissions;
54
+ /**
55
+ * Export operations.
56
+ */
57
+ export: HeadlessCmsExport;
58
+ importing: HeadlessCmsImport;
41
59
  }
42
60
  /**
43
61
  * @description This combines all contexts used in the CMS into a single one.
44
62
  *
45
63
  * @category Context
46
64
  */
47
- export interface CmsContext extends Context, DbContext, I18NContext, FileManagerContext {
65
+ export interface CmsContext extends Context, DbContext, I18NContext {
48
66
  cms: HeadlessCms;
49
67
  }
50
68
  interface CmsModelFieldPredefinedValuesValue {
@@ -98,6 +116,10 @@ export interface CmsModelFieldSettings {
98
116
  * Object field has child fields.
99
117
  */
100
118
  fields?: CmsModelField[];
119
+ /**
120
+ * Is the file field images only one?
121
+ */
122
+ imagesOnly?: boolean;
101
123
  /**
102
124
  * Object field has child fields - so it needs to have a layout.
103
125
  */
@@ -110,11 +132,16 @@ export interface CmsModelFieldSettings {
110
132
  * Date field.
111
133
  */
112
134
  type?: string;
135
+ /**
136
+ * Disable full text search explicitly on this field.
137
+ */
138
+ disableFullTextSearch?: boolean;
113
139
  /**
114
140
  * There are a lot of other settings that are possible to add, so we keep the type opened.
115
141
  */
116
142
  [key: string]: any;
117
143
  }
144
+ export declare type CmsModelFieldType = "boolean" | "datetime" | "file" | "long-text" | "number" | "json" | "object" | "ref" | "rich-text" | "text" | "dynamicZone" | string;
118
145
  /**
119
146
  * A definition for content model field. This type exists on the app side as well.
120
147
  *
@@ -135,18 +162,16 @@ export interface CmsModelField {
135
162
  * A type of the field.
136
163
  * We are defining our built-in fields, so people know which are available by the default.
137
164
  */
138
- type: "boolean" | "datetime" | "file" | "long-text" | "number" | "object" | "ref" | "rich-text" | "text" | string;
165
+ type: CmsModelFieldType;
139
166
  /**
140
167
  * 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.
168
+ * Must in form of a-zA-Z0-9@a-zA-Z0-9
142
169
  *
143
170
  * This is an auto-generated value: uses `id` and `type`
144
171
  *
145
172
  * This is used as path for the entry value.
146
- *
147
- * @internal
148
173
  */
149
- storageId: string;
174
+ storageId: `${string}@${string}` | string;
150
175
  /**
151
176
  * Field identifier for the model field that will be available to the outside world.
152
177
  * `storageId` is used as path (or column) to store the data.
@@ -195,6 +220,10 @@ export interface CmsModelField {
195
220
  *
196
221
  */
197
222
  multipleValues?: boolean;
223
+ /**
224
+ * Fields can be tagged to give them contextual meaning.
225
+ */
226
+ tags?: string[];
198
227
  /**
199
228
  * Any user defined settings.
200
229
  *
@@ -202,6 +231,27 @@ export interface CmsModelField {
202
231
  */
203
232
  settings?: CmsModelFieldSettings;
204
233
  }
234
+ export interface CmsDynamicZoneTemplate {
235
+ id: string;
236
+ name: string;
237
+ gqlTypeName: string;
238
+ description: string;
239
+ icon: string;
240
+ fields: CmsModelField[];
241
+ layout: string[][];
242
+ validation: CmsModelFieldValidation[];
243
+ }
244
+ /**
245
+ * A definition for dynamic-zone field to show possible type of the field in settings.
246
+ */
247
+ export interface CmsModelDynamicZoneField extends CmsModelField {
248
+ /**
249
+ * Settings object for the field. Contains `templates` property.
250
+ */
251
+ settings: {
252
+ templates: CmsDynamicZoneTemplate[];
253
+ };
254
+ }
205
255
  /**
206
256
  * Used for our internal functionality.
207
257
  */
@@ -213,7 +263,7 @@ export interface CmsModelFieldWithParent extends CmsModelField {
213
263
  */
214
264
  export interface CmsModelDateTimeField extends CmsModelField {
215
265
  /**
216
- * Settings object for the field. Contains type property.
266
+ * Settings object for the field. Contains `type` property.
217
267
  */
218
268
  settings: {
219
269
  type: "time" | "date" | "dateTimeWithoutTimezone" | "dateTimeWithTimezone";
@@ -262,6 +312,9 @@ export interface CmsModelFieldValidatorValidateParams<T = any> {
262
312
  * @category ModelField
263
313
  * @category FieldValidation
264
314
  */
315
+ export interface CmsModelFieldValidatorPluginValidateCb {
316
+ (params: CmsModelFieldValidatorValidateParams): Promise<boolean>;
317
+ }
265
318
  export interface CmsModelFieldValidatorPlugin extends Plugin {
266
319
  /**
267
320
  * A plugin type.
@@ -278,7 +331,7 @@ export interface CmsModelFieldValidatorPlugin extends Plugin {
278
331
  /**
279
332
  * Validation method.
280
333
  */
281
- validate(params: CmsModelFieldValidatorValidateParams): Promise<boolean>;
334
+ validate: CmsModelFieldValidatorPluginValidateCb;
282
335
  };
283
336
  }
284
337
  /**
@@ -335,7 +388,21 @@ export interface LockedField {
335
388
  [key: string]: any;
336
389
  }
337
390
  /**
338
- * Cms Model defining an entry.
391
+ * @category Database model
392
+ * @category CmsModel
393
+ */
394
+ export interface CmsModelGroup {
395
+ /**
396
+ * Generated ID of the group
397
+ */
398
+ id: string;
399
+ /**
400
+ * Name of the group
401
+ */
402
+ name: string;
403
+ }
404
+ /**
405
+ * Base CMS Model. Should not be exported and used outside of this package.
339
406
  *
340
407
  * @category Database model
341
408
  * @category CmsModel
@@ -349,6 +416,24 @@ export interface CmsModel {
349
416
  * Unique ID for the content model. Created from name if not defined by user.
350
417
  */
351
418
  modelId: string;
419
+ /**
420
+ * Name of the content model in singular form to be used in the API.
421
+ * example:
422
+ * - Article
423
+ * - Fruit
424
+ * - Vegetable
425
+ * - Car
426
+ */
427
+ singularApiName: string;
428
+ /**
429
+ * Name of the content model in plural form to be used in the API.
430
+ * example:
431
+ * - Articles
432
+ * - Fruits
433
+ * - Vegetables
434
+ * - Cars
435
+ */
436
+ pluralApiName: string;
352
437
  /**
353
438
  * Model tenant.
354
439
  */
@@ -360,20 +445,15 @@ export interface CmsModel {
360
445
  /**
361
446
  * Cms Group reference object.
362
447
  */
363
- group: {
364
- /**
365
- * Generated ID of the group
366
- */
367
- id: string;
368
- /**
369
- * Name of the group
370
- */
371
- name: string;
372
- };
448
+ group: CmsModelGroup;
449
+ /**
450
+ * Icon for the content model.
451
+ */
452
+ icon?: string | null;
373
453
  /**
374
454
  * Description for the content model.
375
455
  */
376
- description: string;
456
+ description: string | null;
377
457
  /**
378
458
  * Date created
379
459
  */
@@ -385,7 +465,7 @@ export interface CmsModel {
385
465
  /**
386
466
  * CreatedBy object wrapper. Contains id, name and type of the user.
387
467
  */
388
- createdBy?: CreatedBy;
468
+ createdBy?: CmsIdentity;
389
469
  /**
390
470
  * List of fields defining entry values.
391
471
  */
@@ -401,6 +481,10 @@ export interface CmsModel {
401
481
  * ```
402
482
  */
403
483
  layout: string[][];
484
+ /**
485
+ * Models can be tagged to give them contextual meaning.
486
+ */
487
+ tags?: string[];
404
488
  /**
405
489
  * List of locked fields. Updated when entry is saved and a field has been used.
406
490
  */
@@ -410,6 +494,16 @@ export interface CmsModel {
410
494
  * It is picked as first available text field. Or user can select own field.
411
495
  */
412
496
  titleFieldId: string;
497
+ /**
498
+ * The field which is displayed as the description one.
499
+ * Only way this is null or undefined is that there are no long-text fields to be set as description.
500
+ */
501
+ descriptionFieldId?: string | null;
502
+ /**
503
+ * The field which is displayed as the image.
504
+ * Only way this is null or undefined is that there are no file fields, with images only set, to be set as image.
505
+ */
506
+ imageFieldId?: string | null;
413
507
  /**
414
508
  * The version of Webiny which this record was stored with.
415
509
  */
@@ -420,6 +514,10 @@ export interface CmsModel {
420
514
  * Only available for the plugin constructed models.
421
515
  */
422
516
  isPrivate?: boolean;
517
+ /**
518
+ * Is this model created via plugin?
519
+ */
520
+ isPlugin?: boolean;
423
521
  }
424
522
  /**
425
523
  * When sending model to the storage operations, it must contain createValueKeyToStorageConverter and createValueKeyFromStorageConverter
@@ -437,25 +535,41 @@ export interface CmsModelFieldDefinition {
437
535
  fields: string;
438
536
  typeDefs?: string;
439
537
  }
440
- interface CmsModelFieldToGraphQLCreateResolverParams {
538
+ interface CmsModelFieldToGraphQLCreateResolverParams<TField> {
441
539
  models: CmsModel[];
442
540
  model: CmsModel;
443
541
  graphQLType: string;
444
- field: CmsModelField;
542
+ field: TField;
445
543
  createFieldResolvers: any;
544
+ fieldTypePlugins: CmsFieldTypePlugins;
446
545
  }
447
- export interface CmsModelFieldToGraphQLCreateResolver {
448
- (params: CmsModelFieldToGraphQLCreateResolverParams): GraphQLFieldResolver | {
546
+ export interface CmsModelFieldToGraphQLCreateResolver<TField = CmsModelField> {
547
+ (params: CmsModelFieldToGraphQLCreateResolverParams<TField>): GraphQLFieldResolver | {
449
548
  resolver: GraphQLFieldResolver | null;
450
549
  typeResolvers: Resolvers<CmsContext>;
451
550
  } | false;
452
551
  }
552
+ export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams<TField extends CmsModelField = CmsModelField> {
553
+ fields: TField[];
554
+ originalFields: TField[];
555
+ }
556
+ export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidate {
557
+ (params: CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams): void;
558
+ }
559
+ export interface CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField extends CmsModelField = CmsModelField> {
560
+ field: TField;
561
+ originalField?: TField;
562
+ validate: CmsModelFieldToGraphQLPluginValidateChildFieldsValidate;
563
+ }
564
+ export interface CmsModelFieldToGraphQLPluginValidateChildFields<TField extends CmsModelField = CmsModelField> {
565
+ (params: CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField>): void;
566
+ }
453
567
  /**
454
568
  * @category Plugin
455
569
  * @category ModelField
456
570
  * @category GraphQL
457
571
  */
458
- export interface CmsModelFieldToGraphQLPlugin extends Plugin {
572
+ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = CmsModelField> extends Plugin {
459
573
  /**
460
574
  * A plugin type
461
575
  */
@@ -467,7 +581,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
467
581
  * fieldType: "myField"
468
582
  * ```
469
583
  */
470
- fieldType: string;
584
+ fieldType: CmsModelFieldType;
471
585
  /**
472
586
  * Is the field searchable via the GraphQL?
473
587
  *
@@ -509,7 +623,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
509
623
  */
510
624
  createStorageId?: (params: {
511
625
  model: CmsModel;
512
- field: CmsModelField;
626
+ field: Omit<TField, "storageId"> & Partial<Pick<TField, "storageId">>;
513
627
  }) => string | null | undefined;
514
628
  /**
515
629
  * Read API methods.
@@ -527,8 +641,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
527
641
  * ```
528
642
  */
529
643
  createGetFilters?(params: {
530
- model: CmsModel;
531
- field: CmsModelField;
644
+ field: TField;
532
645
  }): string;
533
646
  /**
534
647
  * Definition for list filtering for GraphQL.
@@ -547,8 +660,9 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
547
660
  * ```
548
661
  */
549
662
  createListFilters?(params: {
550
- model: CmsModel;
551
- field: CmsModelField;
663
+ model: Pick<CmsModel, "singularApiName">;
664
+ field: TField;
665
+ plugins: CmsFieldTypePlugins;
552
666
  }): string;
553
667
  /**
554
668
  * Definition of the field type for GraphQL - be aware if multiple values is selected.
@@ -566,13 +680,14 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
566
680
  * ```
567
681
  */
568
682
  createTypeField(params: {
683
+ models: CmsModel[];
569
684
  model: CmsModel;
570
- field: CmsModelField;
685
+ field: TField;
571
686
  fieldTypePlugins: CmsFieldTypePlugins;
572
687
  }): CmsModelFieldDefinition | string | null;
573
688
  /**
574
689
  * Definition for field resolver.
575
- * By default it is simple return of the `instance.values[storageId]` but if required, users can define their own.
690
+ * By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
576
691
  *
577
692
  * ```ts
578
693
  * read: {
@@ -584,7 +699,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
584
699
  * }
585
700
  * ```
586
701
  */
587
- createResolver?: CmsModelFieldToGraphQLCreateResolver;
702
+ createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
588
703
  /**
589
704
  * Read API schema definitions for the field and resolvers for them.
590
705
  *
@@ -626,8 +741,9 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
626
741
  * ```
627
742
  */
628
743
  createListFilters?: (params: {
629
- model: CmsModel;
630
- field: CmsModelField;
744
+ model: Pick<CmsModel, "singularApiName">;
745
+ field: TField;
746
+ plugins: CmsFieldTypePlugins;
631
747
  }) => string;
632
748
  /**
633
749
  * Manage API schema definitions for the field and resolvers for them. Probably similar to `read.createSchema`.
@@ -665,8 +781,9 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
665
781
  * ```
666
782
  */
667
783
  createTypeField: (params: {
784
+ models: CmsModel[];
668
785
  model: CmsModel;
669
- field: CmsModelField;
786
+ field: TField;
670
787
  fieldTypePlugins: CmsFieldTypePlugins;
671
788
  }) => CmsModelFieldDefinition | string | null;
672
789
  /**
@@ -685,13 +802,14 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
685
802
  * ```
686
803
  */
687
804
  createInputField: (params: {
805
+ models: CmsModel[];
688
806
  model: CmsModel;
689
- field: CmsModelField;
807
+ field: TField;
690
808
  fieldTypePlugins: CmsFieldTypePlugins;
691
809
  }) => CmsModelFieldDefinition | string | null;
692
810
  /**
693
811
  * Definition for field resolver.
694
- * By default it is simple return of the `instance.values[storageId]` but if required, users can define their own.
812
+ * By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
695
813
  *
696
814
  * ```ts
697
815
  * manage: {
@@ -703,8 +821,13 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
703
821
  * }
704
822
  * ```
705
823
  */
706
- createResolver?: CmsModelFieldToGraphQLCreateResolver;
824
+ createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
707
825
  };
826
+ /**
827
+ *
828
+ * @param field
829
+ */
830
+ validateChildFields?: CmsModelFieldToGraphQLPluginValidateChildFields<TField>;
708
831
  }
709
832
  /**
710
833
  * Check for content model locked field.
@@ -743,11 +866,11 @@ export interface CmsFieldTypePlugins {
743
866
  [key: string]: CmsModelFieldToGraphQLPlugin;
744
867
  }
745
868
  /**
746
- * A interface describing the reference to a user that created some data in the database.
869
+ * An interface describing the reference to a user that created some data in the database.
747
870
  *
748
871
  * @category General
749
872
  */
750
- export interface CreatedBy {
873
+ export interface CmsIdentity {
751
874
  /**
752
875
  * ID if the user.
753
876
  */
@@ -761,44 +884,6 @@ export interface CreatedBy {
761
884
  */
762
885
  type: string;
763
886
  }
764
- /**
765
- * Representation of settings database model.
766
- *
767
- * @category Database model
768
- */
769
- export interface CmsSettings {
770
- /**
771
- * Last content model change. Used to cache GraphQL schema.
772
- */
773
- contentModelLastChange: Date;
774
- /**
775
- * Settings tenant.
776
- */
777
- tenant: string;
778
- /**
779
- * Settings locale.
780
- */
781
- locale: string;
782
- }
783
- /**
784
- * Settings CRUD in context.
785
- *
786
- * @category Context
787
- */
788
- export interface CmsSettingsContext {
789
- /**
790
- * Gets settings model from the database.
791
- */
792
- getSettings: () => Promise<CmsSettings | null>;
793
- /**
794
- * Updates settings model with a new date.
795
- */
796
- updateModelLastChange: () => Promise<void>;
797
- /**
798
- * Get the datetime when content model last changed.
799
- */
800
- getModelLastChange: () => Promise<Date>;
801
- }
802
887
  export interface OnSystemBeforeInstallTopicParams {
803
888
  tenant: string;
804
889
  locale: string;
@@ -815,41 +900,29 @@ export interface OnSystemInstallErrorTopicParams {
815
900
  export declare type CmsSystemContext = {
816
901
  getSystemVersion: () => Promise<string | null>;
817
902
  setSystemVersion: (version: string) => Promise<void>;
818
- getReadAPIKey(): Promise<string | null>;
819
903
  installSystem: () => Promise<void>;
820
- upgradeSystem: (version: string) => Promise<boolean>;
821
904
  /**
822
- * Lifecycle events - deprecated
823
- */
824
- /**
825
- * @deprecated
826
- */
827
- onBeforeSystemInstall: Topic<OnSystemBeforeInstallTopicParams>;
828
- /**
829
- * @deprecated
830
- */
831
- onAfterSystemInstall: Topic<OnSystemAfterInstallTopicParams>;
832
- /**
833
- * Released in 5.34.0
905
+ * Lifecycle Events
834
906
  */
835
907
  onSystemBeforeInstall: Topic<OnSystemBeforeInstallTopicParams>;
836
908
  onSystemAfterInstall: Topic<OnSystemAfterInstallTopicParams>;
837
909
  onSystemInstallError: Topic<OnSystemInstallErrorTopicParams>;
838
910
  };
839
911
  /**
840
- * A GraphQL params.data parameter received when creating content model group.
912
+ * A GraphQL `params.data` parameter received when creating content model group.
841
913
  *
842
914
  * @category CmsGroup
843
915
  * @category GraphQL params
844
916
  */
845
917
  export interface CmsGroupCreateInput {
918
+ id?: string;
846
919
  name: string;
847
920
  slug?: string;
848
- description?: string;
921
+ description?: string | null;
849
922
  icon: string;
850
923
  }
851
924
  /**
852
- * A GraphQL params.data parameter received when updating content model group.
925
+ * A GraphQL `params.data` parameter received when updating content model group.
853
926
  *
854
927
  * @category CmsGroup
855
928
  * @category GraphQL params
@@ -890,7 +963,7 @@ export interface CmsGroup {
890
963
  /**
891
964
  * Description for the group.
892
965
  */
893
- description: string;
966
+ description: string | null;
894
967
  /**
895
968
  * Icon for the group. In a form of "ico/ico".
896
969
  */
@@ -898,7 +971,7 @@ export interface CmsGroup {
898
971
  /**
899
972
  * CreatedBy reference object.
900
973
  */
901
- createdBy?: CreatedBy;
974
+ createdBy?: CmsIdentity;
902
975
  /**
903
976
  * Date group was created on.
904
977
  */
@@ -917,9 +990,13 @@ export interface CmsGroup {
917
990
  * Only available for the plugin constructed groups.
918
991
  */
919
992
  isPrivate?: boolean;
993
+ /**
994
+ * Is this group created via plugin?
995
+ */
996
+ isPlugin?: boolean;
920
997
  }
921
998
  /**
922
- * A data.where parameter received when listing content model groups.
999
+ * A `data.where` parameter received when listing content model groups.
923
1000
  *
924
1001
  * @category CmsGroup
925
1002
  * @category GraphQL params
@@ -928,7 +1005,6 @@ export interface CmsGroupListParams {
928
1005
  where: {
929
1006
  tenant: string;
930
1007
  locale: string;
931
- [key: string]: any;
932
1008
  };
933
1009
  }
934
1010
  /**
@@ -945,6 +1021,15 @@ export interface OnGroupBeforeCreateTopicParams {
945
1021
  export interface OnGroupAfterCreateTopicParams {
946
1022
  group: CmsGroup;
947
1023
  }
1024
+ /**
1025
+ * @category CmsGroup
1026
+ * @category Topic
1027
+ */
1028
+ export interface OnGroupCreateErrorTopicParams {
1029
+ input: CmsGroupCreateInput;
1030
+ group: CmsGroup;
1031
+ error: Error;
1032
+ }
948
1033
  /**
949
1034
  * @category CmsGroup
950
1035
  * @category Topic
@@ -961,6 +1046,16 @@ export interface OnGroupAfterUpdateTopicParams {
961
1046
  original: CmsGroup;
962
1047
  group: CmsGroup;
963
1048
  }
1049
+ /**
1050
+ * @category CmsGroup
1051
+ * @category Topic
1052
+ */
1053
+ export interface OnGroupUpdateErrorTopicParams {
1054
+ input: CmsGroupUpdateInput;
1055
+ original: CmsGroup;
1056
+ group: CmsGroup;
1057
+ error: Error;
1058
+ }
964
1059
  /**
965
1060
  * @category CmsGroup
966
1061
  * @category Topic
@@ -975,6 +1070,14 @@ export interface OnGroupBeforeDeleteTopicParams {
975
1070
  export interface OnGroupAfterDeleteTopicParams {
976
1071
  group: CmsGroup;
977
1072
  }
1073
+ /**
1074
+ * @category CmsGroup
1075
+ * @category Topic
1076
+ */
1077
+ export interface OnGroupDeleteErrorTopicParams {
1078
+ group: CmsGroup;
1079
+ error: Error;
1080
+ }
978
1081
  /**
979
1082
  * Cms Group in context.
980
1083
  *
@@ -985,7 +1088,7 @@ export interface CmsGroupContext {
985
1088
  /**
986
1089
  * Gets content model group by given id.
987
1090
  */
988
- getGroup: (id: string) => Promise<CmsGroup | null>;
1091
+ getGroup: (id: string) => Promise<CmsGroup>;
989
1092
  /**
990
1093
  * List all content model groups. Filterable via params.
991
1094
  */
@@ -1007,41 +1110,17 @@ export interface CmsGroupContext {
1007
1110
  */
1008
1111
  clearGroupsCache: () => void;
1009
1112
  /**
1010
- * Lifecycle events - deprecated
1011
- */
1012
- /**
1013
- * @deprecated
1014
- */
1015
- onBeforeGroupCreate: Topic<OnGroupBeforeCreateTopicParams>;
1016
- /**
1017
- * @deprecated
1018
- */
1019
- onAfterGroupCreate: Topic<OnGroupAfterCreateTopicParams>;
1020
- /**
1021
- * @deprecated
1022
- */
1023
- onBeforeGroupUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
1024
- /**
1025
- * @deprecated
1026
- */
1027
- onAfterGroupUpdate: Topic<OnGroupAfterUpdateTopicParams>;
1028
- /**
1029
- * @deprecated
1030
- */
1031
- onBeforeGroupDelete: Topic<OnGroupBeforeDeleteTopicParams>;
1032
- /**
1033
- * @deprecated
1034
- */
1035
- onAfterGroupDelete: Topic<OnGroupAfterDeleteTopicParams>;
1036
- /**
1037
- * Lifecycle events released in 5.33.0
1113
+ * Lifecycle Events
1038
1114
  */
1039
1115
  onGroupBeforeCreate: Topic<OnGroupBeforeCreateTopicParams>;
1040
1116
  onGroupAfterCreate: Topic<OnGroupAfterCreateTopicParams>;
1117
+ onGroupCreateError: Topic<OnGroupCreateErrorTopicParams>;
1041
1118
  onGroupBeforeUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
1042
1119
  onGroupAfterUpdate: Topic<OnGroupAfterUpdateTopicParams>;
1120
+ onGroupUpdateError: Topic<OnGroupUpdateErrorTopicParams>;
1043
1121
  onGroupBeforeDelete: Topic<OnGroupBeforeDeleteTopicParams>;
1044
1122
  onGroupAfterDelete: Topic<OnGroupAfterDeleteTopicParams>;
1123
+ onGroupDeleteError: Topic<OnGroupDeleteErrorTopicParams>;
1045
1124
  }
1046
1125
  /**
1047
1126
  * Definition for content model field validator.
@@ -1060,7 +1139,7 @@ export interface CmsModelFieldValidation {
1060
1139
  };
1061
1140
  }
1062
1141
  /**
1063
- * A GraphQL params.data parameter received when creating content model.
1142
+ * A GraphQL `params.data` parameter received when creating content model.
1064
1143
  *
1065
1144
  * @category GraphQL params
1066
1145
  * @category CmsModel
@@ -1070,6 +1149,14 @@ export interface CmsModelCreateInput {
1070
1149
  * Name of the content model.
1071
1150
  */
1072
1151
  name: string;
1152
+ /**
1153
+ * Singular name of the content model to be used in the API.
1154
+ */
1155
+ singularApiName: string;
1156
+ /**
1157
+ * Plural name of the content model to be used in the API.
1158
+ */
1159
+ pluralApiName: string;
1073
1160
  /**
1074
1161
  * Unique ID of the content model. Created from name if not sent by the user. Cannot be changed.
1075
1162
  */
@@ -1077,7 +1164,7 @@ export interface CmsModelCreateInput {
1077
1164
  /**
1078
1165
  * Description of the content model.
1079
1166
  */
1080
- description?: string;
1167
+ description?: string | null;
1081
1168
  /**
1082
1169
  * Group where to put the content model in.
1083
1170
  */
@@ -1098,13 +1185,18 @@ export interface CmsModelCreateInput {
1098
1185
  */
1099
1186
  layout?: string[][];
1100
1187
  /**
1101
- * The field that is being displayed as entry title.
1102
- * It is picked as first available text field. Or user can select own field.
1188
+ * Models can be tagged to give them contextual meaning.
1103
1189
  */
1104
- titleFieldId?: string;
1190
+ tags?: string[];
1191
+ /**
1192
+ * Fields fieldId which are picked to represent the CMS entry.
1193
+ */
1194
+ titleFieldId?: string | null;
1195
+ descriptionFieldId?: string | null;
1196
+ imageFieldId?: string | null;
1105
1197
  }
1106
1198
  /**
1107
- * A GraphQL params.data parameter received when creating content model from existing model.
1199
+ * A GraphQL `params.data` parameter received when creating content model from existing model.
1108
1200
  *
1109
1201
  * @category GraphQL params
1110
1202
  * @category CmsModel
@@ -1145,11 +1237,15 @@ export interface CmsModelFieldInput {
1145
1237
  /**
1146
1238
  * Text to display below the field to help user what to write in the field.
1147
1239
  */
1148
- helpText?: string;
1240
+ helpText?: string | null;
1149
1241
  /**
1150
1242
  * Text to display in the field.
1151
1243
  */
1152
- placeholderText?: string;
1244
+ placeholderText?: string | null;
1245
+ /**
1246
+ * Fields can be tagged to give them contextual meaning.
1247
+ */
1248
+ tags?: string[];
1153
1249
  /**
1154
1250
  * Are multiple values allowed?
1155
1251
  */
@@ -1169,14 +1265,14 @@ export interface CmsModelFieldInput {
1169
1265
  /**
1170
1266
  * @see CmsModelField.listValidation
1171
1267
  */
1172
- listValidation: CmsModelFieldValidation[];
1268
+ listValidation?: CmsModelFieldValidation[];
1173
1269
  /**
1174
1270
  * User defined settings.
1175
1271
  */
1176
1272
  settings?: Record<string, any>;
1177
1273
  }
1178
1274
  /**
1179
- * A GraphQL params.data parameter received when updating content model.
1275
+ * A GraphQL `params.data` parameter received when updating content model.
1180
1276
  *
1181
1277
  * @category GraphQL params
1182
1278
  * @category CmsModel
@@ -1186,6 +1282,14 @@ export interface CmsModelUpdateInput {
1186
1282
  * A new content model name.
1187
1283
  */
1188
1284
  name?: string;
1285
+ /**
1286
+ * A new singular name of the content model to be used in the API.
1287
+ */
1288
+ singularApiName?: string;
1289
+ /**
1290
+ * A new plural name of the content model to be used in the API.
1291
+ */
1292
+ pluralApiName?: string;
1189
1293
  /**
1190
1294
  * A group we want to move the model to.
1191
1295
  */
@@ -1193,7 +1297,7 @@ export interface CmsModelUpdateInput {
1193
1297
  /**
1194
1298
  * A new description of the content model.
1195
1299
  */
1196
- description?: string;
1300
+ description?: string | null;
1197
1301
  /**
1198
1302
  * A list of content model fields to define the entry values.
1199
1303
  */
@@ -1210,10 +1314,11 @@ export interface CmsModelUpdateInput {
1210
1314
  */
1211
1315
  layout: string[][];
1212
1316
  /**
1213
- * The field that is being displayed as entry title.
1214
- * It is picked as first available text field. Or user can select own field.
1317
+ * Fields fieldId which are picked to represent the CMS entry.
1215
1318
  */
1216
- titleFieldId?: string;
1319
+ titleFieldId?: string | null;
1320
+ descriptionFieldId?: string | null;
1321
+ imageFieldId?: string | null;
1217
1322
  }
1218
1323
  /**
1219
1324
  * A plugin to load a CmsModelManager.
@@ -1258,7 +1363,7 @@ export interface CmsEntryValues {
1258
1363
  export interface CmsEntry<T = CmsEntryValues> {
1259
1364
  /**
1260
1365
  * A version of the webiny this entry was created with.
1261
- * This can be used when upgrading the system so we know which entries to update.
1366
+ * This can be used when upgrading the system, so we know which entries to update.
1262
1367
  */
1263
1368
  webinyVersion: string;
1264
1369
  /**
@@ -1275,23 +1380,88 @@ export interface CmsEntry<T = CmsEntryValues> {
1275
1380
  */
1276
1381
  id: string;
1277
1382
  /**
1278
- * CreatedBy object reference.
1383
+ * Revision-level meta fields. 👇
1384
+ */
1385
+ /**
1386
+ * An ISO 8601 date/time string.
1387
+ */
1388
+ revisionCreatedOn: string;
1389
+ /**
1390
+ * An ISO 8601 date/time string.
1391
+ */
1392
+ revisionSavedOn: string;
1393
+ /**
1394
+ * An ISO 8601 date/time string.
1395
+ */
1396
+ revisionModifiedOn: string | null;
1397
+ /**
1398
+ * An ISO 8601 date/time string.
1399
+ */
1400
+ revisionFirstPublishedOn: string | null;
1401
+ /**
1402
+ * An ISO 8601 date/time string.
1279
1403
  */
1280
- createdBy: CreatedBy;
1404
+ revisionLastPublishedOn: string | null;
1281
1405
  /**
1282
- * OwnedBy object reference. Can be different from CreatedBy.
1406
+ * Identity that last ionCreated the entry.
1283
1407
  */
1284
- ownedBy: CreatedBy;
1408
+ revisionCreatedBy: CmsIdentity;
1285
1409
  /**
1286
- * A string of Date.toISOString() type.
1287
- * Populated on creation.
1410
+ * Identity that last ionSaved the entry.
1411
+ */
1412
+ revisionSavedBy: CmsIdentity;
1413
+ /**
1414
+ * Identity that last ionModified the entry.
1415
+ */
1416
+ revisionModifiedBy: CmsIdentity | null;
1417
+ /**
1418
+ * Identity that first published the entry.
1419
+ */
1420
+ revisionFirstPublishedBy: CmsIdentity | null;
1421
+ /**
1422
+ * Identity that last published the entry.
1423
+ */
1424
+ revisionLastPublishedBy: CmsIdentity | null;
1425
+ /**
1426
+ * An ISO 8601 date/time string.
1288
1427
  */
1289
1428
  createdOn: string;
1290
1429
  /**
1291
- * A string of Date.toISOString() type.
1292
- * Populated every time entry is saved.
1430
+ * An ISO 8601 date/time string.
1293
1431
  */
1294
1432
  savedOn: string;
1433
+ /**
1434
+ * An ISO 8601 date/time string.
1435
+ */
1436
+ modifiedOn: string | null;
1437
+ /**
1438
+ * An ISO 8601 date/time string.
1439
+ */
1440
+ firstPublishedOn: string | null;
1441
+ /**
1442
+ * An ISO 8601 date/time string.
1443
+ */
1444
+ lastPublishedOn: string | null;
1445
+ /**
1446
+ * Identity that last created the entry.
1447
+ */
1448
+ createdBy: CmsIdentity;
1449
+ /**
1450
+ * Identity that last saved the entry.
1451
+ */
1452
+ savedBy: CmsIdentity;
1453
+ /**
1454
+ * Identity that last modified the entry.
1455
+ */
1456
+ modifiedBy: CmsIdentity | null;
1457
+ /**
1458
+ * Identity that first published the entry.
1459
+ */
1460
+ firstPublishedBy: CmsIdentity | null;
1461
+ /**
1462
+ * Identity that last published the entry.
1463
+ */
1464
+ lastPublishedBy: CmsIdentity | null;
1295
1465
  /**
1296
1466
  * Model ID of the definition for the entry.
1297
1467
  * @see CmsModel
@@ -1302,11 +1472,6 @@ export interface CmsEntry<T = CmsEntryValues> {
1302
1472
  * @see I18NLocale.code
1303
1473
  */
1304
1474
  locale: string;
1305
- /**
1306
- * A string of Date.toISOString() type - if published.
1307
- * Populated when entry is published.
1308
- */
1309
- publishedOn?: string;
1310
1475
  /**
1311
1476
  * A revision version of the entry.
1312
1477
  */
@@ -1325,13 +1490,19 @@ export interface CmsEntry<T = CmsEntryValues> {
1325
1490
  * @see CmsModelField
1326
1491
  */
1327
1492
  values: T;
1493
+ /**
1494
+ * Advanced Content Organization
1495
+ */
1496
+ location?: {
1497
+ folderId?: string | null;
1498
+ };
1328
1499
  /**
1329
1500
  * Settings for the given entry.
1330
1501
  *
1331
- * Introduced with Advanced Publishing Workflow - will be always inserted after this PR is merged.
1332
- * Be aware that when accessing properties in it on old systems - it will break if not checked first.
1502
+ * Introduced with Advanced Publishing Workflow. Will always be inserted once this PR is merged.
1503
+ * Be aware that when accessing properties in it on old systems, it will break if not checked first.
1333
1504
  *
1334
- * Available only on the Manage API in entry GraphQL type meta.data property.
1505
+ * Available only on the Manage API in entry GraphQL type `meta.data` property.
1335
1506
  */
1336
1507
  meta?: {
1337
1508
  [key: string]: any;
@@ -1340,6 +1511,10 @@ export interface CmsEntry<T = CmsEntryValues> {
1340
1511
  export interface CmsStorageEntry extends CmsEntry {
1341
1512
  [key: string]: any;
1342
1513
  }
1514
+ export interface CmsEntryUniqueValue {
1515
+ value: string;
1516
+ count: number;
1517
+ }
1343
1518
  /**
1344
1519
  * A definition for content model manager to be used in the code.
1345
1520
  * The default one uses `CmsEntryContext` methods internally, but devs can change to what every they want.
@@ -1364,7 +1539,7 @@ export interface CmsModelManager {
1364
1539
  */
1365
1540
  getPublishedByIds: (ids: string[]) => Promise<CmsEntry[]>;
1366
1541
  /**
1367
- * Get a list of latest entries by the ID list.
1542
+ * Get a list of the latest entries by the ID list.
1368
1543
  */
1369
1544
  getLatestByIds: (ids: string[]) => Promise<CmsEntry[]>;
1370
1545
  /**
@@ -1372,18 +1547,21 @@ export interface CmsModelManager {
1372
1547
  */
1373
1548
  get: (id: string) => Promise<CmsEntry>;
1374
1549
  /**
1375
- * Create a entry.
1550
+ * Create an entry.
1376
1551
  */
1377
1552
  create: (data: CreateCmsEntryInput) => Promise<CmsEntry>;
1378
1553
  /**
1379
- * Update a entry.
1554
+ * Update an entry.
1380
1555
  */
1381
1556
  update: (id: string, data: UpdateCmsEntryInput) => Promise<CmsEntry>;
1382
1557
  /**
1383
- * Delete a entry.
1558
+ * Delete an entry.
1384
1559
  */
1385
1560
  delete: (id: string) => Promise<void>;
1386
1561
  }
1562
+ /**
1563
+ * Create
1564
+ */
1387
1565
  export interface OnModelBeforeCreateTopicParams {
1388
1566
  input: CmsModelCreateInput;
1389
1567
  model: CmsModel;
@@ -1392,6 +1570,14 @@ export interface OnModelAfterCreateTopicParams {
1392
1570
  input: CmsModelCreateInput;
1393
1571
  model: CmsModel;
1394
1572
  }
1573
+ export interface OnModelCreateErrorTopicParams {
1574
+ input: CmsModelCreateInput;
1575
+ model: CmsModel;
1576
+ error: Error;
1577
+ }
1578
+ /**
1579
+ * Create From / Clone
1580
+ */
1395
1581
  export interface OnModelBeforeCreateFromTopicParams {
1396
1582
  input: CmsModelCreateInput;
1397
1583
  original: CmsModel;
@@ -1402,6 +1588,15 @@ export interface OnModelAfterCreateFromTopicParams {
1402
1588
  original: CmsModel;
1403
1589
  model: CmsModel;
1404
1590
  }
1591
+ export interface OnModelCreateFromErrorParams {
1592
+ input: CmsModelCreateInput;
1593
+ original: CmsModel;
1594
+ model: CmsModel;
1595
+ error: Error;
1596
+ }
1597
+ /**
1598
+ * Update
1599
+ */
1405
1600
  export interface OnModelBeforeUpdateTopicParams {
1406
1601
  input: CmsModelUpdateInput;
1407
1602
  original: CmsModel;
@@ -1412,12 +1607,35 @@ export interface OnModelAfterUpdateTopicParams {
1412
1607
  original: CmsModel;
1413
1608
  model: CmsModel;
1414
1609
  }
1610
+ export interface OnModelUpdateErrorTopicParams {
1611
+ input: CmsModelUpdateInput;
1612
+ original: CmsModel;
1613
+ model: CmsModel;
1614
+ error: Error;
1615
+ }
1616
+ /**
1617
+ * Delete
1618
+ */
1415
1619
  export interface OnModelBeforeDeleteTopicParams {
1416
1620
  model: CmsModel;
1417
1621
  }
1418
1622
  export interface OnModelAfterDeleteTopicParams {
1419
1623
  model: CmsModel;
1420
1624
  }
1625
+ export interface OnModelDeleteErrorTopicParams {
1626
+ model: CmsModel;
1627
+ error: Error;
1628
+ }
1629
+ /**
1630
+ * Initialize
1631
+ */
1632
+ export interface OnModelInitializeParams {
1633
+ model: CmsModel;
1634
+ data: Record<string, any>;
1635
+ }
1636
+ /**
1637
+ *
1638
+ */
1421
1639
  export interface CmsModelUpdateDirectParams {
1422
1640
  model: CmsModel;
1423
1641
  original: CmsModel;
@@ -1459,71 +1677,43 @@ export interface CmsModelContext {
1459
1677
  */
1460
1678
  deleteModel: (modelId: string) => Promise<void>;
1461
1679
  /**
1462
- * Get a instance of CmsModelManager for given content modelId.
1680
+ * Possibility for users to trigger the model initialization.
1681
+ * They can hook into it and do what ever they want to.
1463
1682
  *
1464
- * @see CmsModelManager
1683
+ * Primary idea behind this is creating the index, for the code models, in the ES.
1684
+ */
1685
+ initializeModel: (modelId: string, data: Record<string, any>) => Promise<boolean>;
1686
+ /**
1687
+ * Get an instance of CmsModelManager for given content modelId.
1465
1688
  *
1466
- * @deprecated use the getEntryManager() method instead
1689
+ * @see CmsModelManager
1467
1690
  */
1468
- getModelManager: (model: CmsModel | string) => Promise<CmsModelManager>;
1469
1691
  getEntryManager: (model: CmsModel | string) => Promise<CmsModelManager>;
1470
1692
  /**
1471
1693
  * Get all content model managers mapped by modelId.
1472
1694
  * @see CmsModelManager
1473
- * @deprecated use getEntryManagers instead
1474
1695
  */
1475
- getManagers: () => Map<string, CmsModelManager>;
1476
1696
  getEntryManagers: () => Map<string, CmsModelManager>;
1477
1697
  /**
1478
1698
  * Clear all the model caches.
1479
1699
  */
1480
1700
  clearModelsCache: () => void;
1481
1701
  /**
1482
- * Lifecycle events - deprecated.
1483
- */
1484
- /**
1485
- * @deprecated
1486
- */
1487
- onBeforeModelCreate: Topic<OnModelBeforeCreateTopicParams>;
1488
- /**
1489
- * @deprecated
1490
- */
1491
- onAfterModelCreate: Topic<OnModelAfterCreateTopicParams>;
1492
- /**
1493
- * @deprecated
1494
- */
1495
- onBeforeModelCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
1496
- /**
1497
- * @deprecated
1498
- */
1499
- onAfterModelCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
1500
- /**
1501
- * @deprecated
1502
- */
1503
- onBeforeModelUpdate: Topic<OnModelBeforeUpdateTopicParams>;
1504
- /**
1505
- * @deprecated
1506
- */
1507
- onAfterModelUpdate: Topic<OnModelAfterUpdateTopicParams>;
1508
- /**
1509
- * @deprecated
1510
- */
1511
- onBeforeModelDelete: Topic<OnModelBeforeDeleteTopicParams>;
1512
- /**
1513
- * @deprecated
1514
- */
1515
- onAfterModelDelete: Topic<OnModelAfterDeleteTopicParams>;
1516
- /**
1517
- * Lifecycle events - released in 5.33.0
1702
+ * Lifecycle Events
1518
1703
  */
1519
1704
  onModelBeforeCreate: Topic<OnModelBeforeCreateTopicParams>;
1520
1705
  onModelAfterCreate: Topic<OnModelAfterCreateTopicParams>;
1706
+ onModelCreateError: Topic<OnModelCreateErrorTopicParams>;
1521
1707
  onModelBeforeCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
1522
1708
  onModelAfterCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
1709
+ onModelCreateFromError: Topic<OnModelCreateFromErrorParams>;
1523
1710
  onModelBeforeUpdate: Topic<OnModelBeforeUpdateTopicParams>;
1524
1711
  onModelAfterUpdate: Topic<OnModelAfterUpdateTopicParams>;
1712
+ onModelUpdateError: Topic<OnModelUpdateErrorTopicParams>;
1525
1713
  onModelBeforeDelete: Topic<OnModelBeforeDeleteTopicParams>;
1526
1714
  onModelAfterDelete: Topic<OnModelAfterDeleteTopicParams>;
1715
+ onModelDeleteError: Topic<OnModelDeleteErrorTopicParams>;
1716
+ onModelInitialize: Topic<OnModelInitializeParams>;
1527
1717
  }
1528
1718
  /**
1529
1719
  * Available statuses for content entry.
@@ -1563,23 +1753,51 @@ export interface CmsEntryListWhere {
1563
1753
  entryId_in?: string[];
1564
1754
  entryId_not_in?: string[];
1565
1755
  /**
1566
- * Contains the owner of the entry. An "owner" is the identity who originally created the entry.
1567
- * Subsequent revisions can be created by other identities, and those will be stored in `createdBy`,
1568
- * but the `owner` is always the original author of the entry.
1569
- *
1570
- * Can be sent via the API or set internal if user can see only their own entries.
1571
- */
1572
- ownedBy?: string;
1573
- ownedBy_not?: string;
1574
- ownedBy_in?: string[];
1575
- ownedBy_not_in?: string[];
1576
- /**
1577
- * Who created the entry?
1756
+ * Revision-level meta fields. 👇
1757
+ */
1758
+ revisionCreatedBy?: string;
1759
+ revisionCreatedBy_not?: string;
1760
+ revisionCreatedBy_in?: string[];
1761
+ revisionCreatedBy_not_in?: string[];
1762
+ revisionModifiedBy?: string;
1763
+ revisionModifiedBy_not?: string;
1764
+ revisionModifiedBy_in?: string[];
1765
+ revisionModifiedBy_not_in?: string[];
1766
+ revisionSavedBy?: string;
1767
+ revisionSavedBy_not?: string;
1768
+ revisionSavedBy_in?: string[];
1769
+ revisionSavedBy_not_in?: string[];
1770
+ revisionFirstPublishedBy?: string;
1771
+ revisionFirstPublishedBy_not?: string;
1772
+ revisionFirstPublishedBy_in?: string[];
1773
+ revisionFirstPublishedBy_not_in?: string[];
1774
+ revisionLastPublishedBy?: string;
1775
+ revisionLastPublishedBy_not?: string;
1776
+ revisionLastPublishedBy_in?: string[];
1777
+ revisionLastPublishedBy_not_in?: string[];
1778
+ /**
1779
+ * Entry-level meta fields. 👇
1578
1780
  */
1579
1781
  createdBy?: string;
1580
1782
  createdBy_not?: string;
1581
1783
  createdBy_in?: string[];
1582
1784
  createdBy_not_in?: string[];
1785
+ modifiedBy?: string;
1786
+ modifiedBy_not?: string;
1787
+ modifiedBy_in?: string[];
1788
+ modifiedBy_not_in?: string[];
1789
+ savedBy?: string;
1790
+ savedBy_not?: string;
1791
+ savedBy_in?: string[];
1792
+ savedBy_not_in?: string[];
1793
+ firstPublishedBy?: string;
1794
+ firstPublishedBy_not?: string;
1795
+ firstPublishedBy_in?: string[];
1796
+ firstPublishedBy_not_in?: string[];
1797
+ lastPublishedBy?: string;
1798
+ lastPublishedBy_not?: string;
1799
+ lastPublishedBy_in?: string[];
1800
+ lastPublishedBy_not_in?: string[];
1583
1801
  /**
1584
1802
  * Version of the entry.
1585
1803
  *
@@ -1605,10 +1823,26 @@ export interface CmsEntryListWhere {
1605
1823
  * @internal
1606
1824
  */
1607
1825
  latest?: boolean;
1826
+ /**
1827
+ * ACO related parameters.
1828
+ */
1829
+ wbyAco_location?: {
1830
+ folderId?: string;
1831
+ folderId_not?: string;
1832
+ folderId_in?: string[];
1833
+ folderId_not_in?: string[];
1834
+ AND?: CmsEntryListWhere[];
1835
+ OR?: CmsEntryListWhere[];
1836
+ };
1608
1837
  /**
1609
1838
  * This is to allow querying by any content model field defined by the user.
1610
1839
  */
1611
- [key: string]: any | CmsEntryListWhereRef;
1840
+ [key: string]: string | number | boolean | undefined | string[] | number[] | null | CmsEntryListWhere[] | CmsEntryListWhere | CmsEntryListWhereRef;
1841
+ /**
1842
+ * To allow querying via nested queries, we added the AND / OR properties.
1843
+ */
1844
+ AND?: CmsEntryListWhere[];
1845
+ OR?: CmsEntryListWhere[];
1612
1846
  }
1613
1847
  /**
1614
1848
  * Entry listing sort.
@@ -1661,15 +1895,18 @@ export interface CmsEntryMeta {
1661
1895
  */
1662
1896
  totalCount: number;
1663
1897
  }
1898
+ /**
1899
+ * Create
1900
+ */
1664
1901
  export interface OnEntryBeforeCreateTopicParams {
1665
1902
  input: CreateCmsEntryInput;
1666
1903
  entry: CmsEntry;
1667
- model: StorageOperationsCmsModel;
1904
+ model: CmsModel;
1668
1905
  }
1669
1906
  export interface OnEntryAfterCreateTopicParams {
1670
1907
  input: CreateCmsEntryInput;
1671
1908
  entry: CmsEntry;
1672
- model: StorageOperationsCmsModel;
1909
+ model: CmsModel;
1673
1910
  storageEntry: CmsEntry;
1674
1911
  }
1675
1912
  export interface OnEntryCreateErrorTopicParams {
@@ -1678,65 +1915,117 @@ export interface OnEntryCreateErrorTopicParams {
1678
1915
  entry: CmsEntry;
1679
1916
  model: CmsModel;
1680
1917
  }
1918
+ /**
1919
+ * Revision Create
1920
+ */
1681
1921
  export interface OnEntryRevisionBeforeCreateTopicParams {
1682
1922
  input: CreateFromCmsEntryInput;
1683
1923
  entry: CmsEntry;
1684
1924
  original: CmsEntry;
1685
- model: StorageOperationsCmsModel;
1925
+ model: CmsModel;
1686
1926
  }
1687
1927
  export interface OnEntryRevisionAfterCreateTopicParams {
1688
1928
  input: CreateFromCmsEntryInput;
1689
1929
  entry: CmsEntry;
1690
1930
  original: CmsEntry;
1691
- model: StorageOperationsCmsModel;
1931
+ model: CmsModel;
1692
1932
  storageEntry: CmsEntry;
1693
1933
  }
1694
1934
  export interface OnEntryCreateRevisionErrorTopicParams {
1695
1935
  error: Error;
1696
1936
  input: CreateFromCmsEntryInput;
1937
+ original: CmsEntry;
1697
1938
  entry: CmsEntry;
1698
1939
  model: CmsModel;
1699
1940
  }
1941
+ /**
1942
+ * Update
1943
+ */
1700
1944
  export interface OnEntryBeforeUpdateTopicParams {
1701
1945
  input: UpdateCmsEntryInput;
1702
1946
  original: CmsEntry;
1703
1947
  entry: CmsEntry;
1704
- model: StorageOperationsCmsModel;
1948
+ model: CmsModel;
1705
1949
  }
1706
1950
  export interface OnEntryAfterUpdateTopicParams {
1707
1951
  input: UpdateCmsEntryInput;
1708
1952
  original: CmsEntry;
1709
1953
  entry: CmsEntry;
1710
- model: StorageOperationsCmsModel;
1954
+ model: CmsModel;
1711
1955
  storageEntry: CmsEntry;
1712
1956
  }
1713
1957
  export interface OnEntryUpdateErrorTopicParams {
1714
1958
  error: Error;
1715
- input: CreateFromCmsEntryInput;
1959
+ input: UpdateCmsEntryInput;
1960
+ entry: CmsEntry;
1961
+ model: CmsModel;
1962
+ }
1963
+ /**
1964
+ * Move
1965
+ */
1966
+ export interface OnEntryBeforeMoveTopicParams {
1967
+ folderId: string;
1968
+ entry: CmsEntry;
1969
+ model: CmsModel;
1970
+ }
1971
+ export interface OnEntryAfterMoveTopicParams {
1972
+ folderId: string;
1973
+ entry: CmsEntry;
1974
+ model: CmsModel;
1975
+ }
1976
+ export interface OnEntryMoveErrorTopicParams {
1977
+ error: Error;
1978
+ folderId: string;
1716
1979
  entry: CmsEntry;
1717
1980
  model: CmsModel;
1718
1981
  }
1982
+ /**
1983
+ * Publish
1984
+ */
1719
1985
  export interface OnEntryBeforePublishTopicParams {
1986
+ original: CmsEntry;
1720
1987
  entry: CmsEntry;
1721
- model: StorageOperationsCmsModel;
1988
+ model: CmsModel;
1722
1989
  }
1723
1990
  export interface OnEntryAfterPublishTopicParams {
1991
+ original: CmsEntry;
1724
1992
  entry: CmsEntry;
1725
- model: StorageOperationsCmsModel;
1993
+ model: CmsModel;
1726
1994
  storageEntry: CmsEntry;
1727
1995
  }
1728
1996
  export interface OnEntryPublishErrorTopicParams {
1729
1997
  error: Error;
1998
+ original: CmsEntry;
1999
+ entry: CmsEntry;
2000
+ model: CmsModel;
2001
+ }
2002
+ /**
2003
+ * Republish
2004
+ */
2005
+ export interface OnEntryBeforeRepublishTopicParams {
1730
2006
  entry: CmsEntry;
1731
- model: StorageOperationsCmsModel;
2007
+ model: CmsModel;
1732
2008
  }
2009
+ export interface OnEntryAfterRepublishTopicParams {
2010
+ entry: CmsEntry;
2011
+ model: CmsModel;
2012
+ storageEntry: CmsEntry;
2013
+ }
2014
+ export interface OnEntryRepublishErrorTopicParams {
2015
+ error: Error;
2016
+ entry: CmsEntry;
2017
+ model: CmsModel;
2018
+ }
2019
+ /**
2020
+ * Unpublish
2021
+ */
1733
2022
  export interface OnEntryBeforeUnpublishTopicParams {
1734
2023
  entry: CmsEntry;
1735
- model: StorageOperationsCmsModel;
2024
+ model: CmsModel;
1736
2025
  }
1737
2026
  export interface OnEntryAfterUnpublishTopicParams {
1738
2027
  entry: CmsEntry;
1739
- model: StorageOperationsCmsModel;
2028
+ model: CmsModel;
1740
2029
  storageEntry: CmsEntry;
1741
2030
  }
1742
2031
  export interface OnEntryUnpublishErrorTopicParams {
@@ -1746,57 +2035,199 @@ export interface OnEntryUnpublishErrorTopicParams {
1746
2035
  }
1747
2036
  export interface OnEntryBeforeDeleteTopicParams {
1748
2037
  entry: CmsEntry;
1749
- model: StorageOperationsCmsModel;
2038
+ model: CmsModel;
1750
2039
  }
1751
2040
  export interface OnEntryAfterDeleteTopicParams {
1752
2041
  entry: CmsEntry;
1753
- model: StorageOperationsCmsModel;
2042
+ model: CmsModel;
1754
2043
  }
1755
2044
  export interface OnEntryDeleteErrorTopicParams {
1756
2045
  error: Error;
1757
2046
  entry: CmsEntry;
1758
- model: StorageOperationsCmsModel;
2047
+ model: CmsModel;
1759
2048
  }
1760
2049
  export interface OnEntryRevisionBeforeDeleteTopicParams {
1761
2050
  entry: CmsEntry;
1762
- model: StorageOperationsCmsModel;
2051
+ model: CmsModel;
1763
2052
  }
1764
2053
  export interface OnEntryRevisionAfterDeleteTopicParams {
1765
2054
  entry: CmsEntry;
1766
- model: StorageOperationsCmsModel;
2055
+ model: CmsModel;
1767
2056
  }
1768
2057
  export interface OnEntryRevisionDeleteErrorTopicParams {
1769
2058
  error: Error;
1770
2059
  entry: CmsEntry;
1771
- model: StorageOperationsCmsModel;
2060
+ model: CmsModel;
2061
+ }
2062
+ export interface OnEntryBeforeDeleteMultipleTopicParams {
2063
+ model: CmsModel;
2064
+ entries: CmsEntry[];
2065
+ ids: string[];
2066
+ }
2067
+ export interface OnEntryAfterDeleteMultipleTopicParams {
2068
+ model: CmsModel;
2069
+ entries: CmsEntry[];
2070
+ ids: string[];
2071
+ }
2072
+ export interface OnEntryDeleteMultipleErrorTopicParams {
2073
+ model: CmsModel;
2074
+ entries: CmsEntry[];
2075
+ ids: string[];
2076
+ error: Error;
1772
2077
  }
1773
2078
  export interface OnEntryBeforeGetTopicParams {
1774
- model: StorageOperationsCmsModel;
2079
+ model: CmsModel;
1775
2080
  where: CmsEntryListWhere;
1776
2081
  }
1777
2082
  export interface EntryBeforeListTopicParams {
1778
2083
  where: CmsEntryListWhere;
1779
- model: StorageOperationsCmsModel;
2084
+ model: CmsModel;
1780
2085
  }
1781
2086
  /**
1782
2087
  * @category Context
1783
2088
  * @category CmsEntry
1784
2089
  */
1785
2090
  export interface CreateCmsEntryInput {
2091
+ id?: string;
2092
+ status?: CmsEntryStatus;
2093
+ /**
2094
+ * Entry-level meta fields. 👇
2095
+ */
2096
+ createdOn?: Date | string;
2097
+ modifiedOn?: Date | string | null;
2098
+ savedOn?: Date | string;
2099
+ createdBy?: CmsIdentity;
2100
+ modifiedBy?: CmsIdentity | null;
2101
+ savedBy?: CmsIdentity;
2102
+ firstPublishedOn?: Date | string;
2103
+ lastPublishedOn?: Date | string;
2104
+ firstPublishedBy?: CmsIdentity;
2105
+ lastPublishedBy?: CmsIdentity;
2106
+ /**
2107
+ * Revision-level meta fields. 👇
2108
+ */
2109
+ revisionCreatedOn?: Date | string;
2110
+ revisionModifiedOn?: Date | string | null;
2111
+ revisionSavedOn?: Date | string;
2112
+ revisionCreatedBy?: CmsIdentity;
2113
+ revisionModifiedBy?: CmsIdentity | null;
2114
+ revisionSavedBy?: CmsIdentity;
2115
+ revisionFirstPublishedOn?: Date | string;
2116
+ revisionLastPublishedOn?: Date | string;
2117
+ revisionFirstPublishedBy?: CmsIdentity;
2118
+ revisionLastPublishedBy?: CmsIdentity;
2119
+ wbyAco_location?: {
2120
+ folderId?: string | null;
2121
+ };
1786
2122
  [key: string]: any;
1787
2123
  }
2124
+ export interface CreateCmsEntryOptionsInput {
2125
+ skipValidators?: string[];
2126
+ }
1788
2127
  /**
1789
2128
  * @category Context
1790
2129
  * @category CmsEntry
1791
2130
  */
1792
2131
  export interface CreateFromCmsEntryInput {
2132
+ /**
2133
+ * Revision-level meta fields. 👇
2134
+ */
2135
+ revisionCreatedOn?: Date;
2136
+ revisionSavedOn?: Date;
2137
+ revisionModifiedOn?: Date;
2138
+ revisionCreatedBy?: CmsIdentity;
2139
+ revisionModifiedBy?: CmsIdentity;
2140
+ revisionSavedBy?: CmsIdentity;
2141
+ revisionFirstPublishedOn?: Date | string;
2142
+ revisionLastPublishedOn?: Date | string;
2143
+ revisionFirstPublishedBy?: CmsIdentity;
2144
+ revisionLastPublishedBy?: CmsIdentity;
2145
+ /**
2146
+ * Entry-level meta fields. 👇
2147
+ */
2148
+ createdOn?: Date;
2149
+ savedOn?: Date;
2150
+ modifiedOn?: Date;
2151
+ createdBy?: CmsIdentity;
2152
+ modifiedBy?: CmsIdentity;
2153
+ savedBy?: CmsIdentity;
2154
+ firstPublishedOn?: Date | string;
2155
+ lastPublishedOn?: Date | string;
2156
+ firstPublishedBy?: CmsIdentity;
2157
+ lastPublishedBy?: CmsIdentity;
1793
2158
  [key: string]: any;
1794
2159
  }
2160
+ export interface CreateRevisionCmsEntryOptionsInput {
2161
+ skipValidators?: string[];
2162
+ }
1795
2163
  /**
1796
2164
  * @category Context
1797
2165
  * @category CmsEntry
1798
2166
  */
1799
2167
  export interface UpdateCmsEntryInput {
2168
+ /**
2169
+ * Revision-level meta fields. 👇
2170
+ */
2171
+ revisionCreatedOn?: Date | string | null;
2172
+ revisionModifiedOn?: Date | string | null;
2173
+ revisionSavedOn?: Date | string | null;
2174
+ revisionFirstPublishedOn?: Date | string | null;
2175
+ revisionLastPublishedOn?: Date | string | null;
2176
+ revisionModifiedBy?: CmsIdentity | null;
2177
+ revisionCreatedBy?: CmsIdentity | null;
2178
+ revisionSavedBy?: CmsIdentity | null;
2179
+ revisionFirstPublishedBy?: CmsIdentity | null;
2180
+ revisionLastPublishedBy?: CmsIdentity | null;
2181
+ /**
2182
+ * Entry-level meta fields. 👇
2183
+ */
2184
+ createdOn?: Date | string | null;
2185
+ modifiedOn?: Date | string | null;
2186
+ savedOn?: Date | string | null;
2187
+ firstPublishedOn?: Date | string | null;
2188
+ lastPublishedOn?: Date | string | null;
2189
+ createdBy?: CmsIdentity | null;
2190
+ modifiedBy?: CmsIdentity | null;
2191
+ savedBy?: CmsIdentity | null;
2192
+ firstPublishedBy?: CmsIdentity | null;
2193
+ lastPublishedBy?: CmsIdentity | null;
2194
+ wbyAco_location?: {
2195
+ folderId?: string | null;
2196
+ };
2197
+ [key: string]: any;
2198
+ }
2199
+ export interface UpdateCmsEntryOptionsInput {
2200
+ skipValidators?: string[];
2201
+ }
2202
+ /**
2203
+ * @category Context
2204
+ * @category CmsEntry
2205
+ */
2206
+ export interface GetUniqueFieldValuesParams {
2207
+ where: CmsEntryListWhere;
2208
+ fieldId: string;
2209
+ }
2210
+ /**
2211
+ * @category CmsEntry
2212
+ */
2213
+ export interface CmsDeleteEntryOptions {
2214
+ /**
2215
+ * Runs the delete commands even if the entry is not found in the DynamoDB.
2216
+ * This is to force clean the entry records that might have been left behind a failed delete.
2217
+ */
2218
+ force?: boolean;
2219
+ }
2220
+ /**
2221
+ * @category Context
2222
+ * @category CmsEntry
2223
+ */
2224
+ export interface DeleteMultipleEntriesParams {
2225
+ entries: string[];
2226
+ }
2227
+ export declare type DeleteMultipleEntriesResponse = {
2228
+ id: string;
2229
+ }[];
2230
+ export interface CmsEntryValidateResponse {
1800
2231
  [key: string]: any;
1801
2232
  }
1802
2233
  /**
@@ -1809,7 +2240,7 @@ export interface CmsEntryContext {
1809
2240
  /**
1810
2241
  * Get a single content entry for a model.
1811
2242
  */
1812
- getEntry: (model: CmsModel, params: CmsEntryGetParams) => Promise<CmsEntry | null>;
2243
+ getEntry: (model: CmsModel, params: CmsEntryGetParams) => Promise<CmsEntry>;
1813
2244
  /**
1814
2245
  * Get a list of entries for a model by a given ID (revision).
1815
2246
  */
@@ -1821,15 +2252,15 @@ export interface CmsEntryContext {
1821
2252
  /**
1822
2253
  * List entries for a model. Internal method used by get, listLatest and listPublished.
1823
2254
  */
1824
- listEntries: (model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
2255
+ listEntries: <T = CmsEntryValues>(model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
1825
2256
  /**
1826
- * Lists latest entries. Used for manage API.
2257
+ * Lists the latest entries. Used for manage API.
1827
2258
  */
1828
- listLatestEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
2259
+ listLatestEntries: <T = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
1829
2260
  /**
1830
2261
  * List published entries. Used for read API.
1831
2262
  */
1832
- listPublishedEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
2263
+ listPublishedEntries: <T = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
1833
2264
  /**
1834
2265
  * List published entries by IDs.
1835
2266
  */
@@ -1841,15 +2272,23 @@ export interface CmsEntryContext {
1841
2272
  /**
1842
2273
  * Create a new content entry.
1843
2274
  */
1844
- createEntry: (model: CmsModel, input: CreateCmsEntryInput) => Promise<CmsEntry>;
2275
+ createEntry: (model: CmsModel, input: CreateCmsEntryInput, options?: CreateCmsEntryOptionsInput) => Promise<CmsEntry>;
1845
2276
  /**
1846
2277
  * Create a new entry from already existing entry.
1847
2278
  */
1848
- createEntryRevisionFrom: (model: CmsModel, id: string, input: CreateFromCmsEntryInput) => Promise<CmsEntry>;
2279
+ createEntryRevisionFrom: (model: CmsModel, id: string, input: CreateFromCmsEntryInput, options?: CreateRevisionCmsEntryOptionsInput) => Promise<CmsEntry>;
1849
2280
  /**
1850
2281
  * Update existing entry.
1851
2282
  */
1852
- updateEntry: (model: CmsModel, id: string, input: UpdateCmsEntryInput, meta?: Record<string, any>) => Promise<CmsEntry>;
2283
+ updateEntry: (model: CmsModel, id: string, input: UpdateCmsEntryInput, meta?: Record<string, any>, options?: UpdateCmsEntryOptionsInput) => Promise<CmsEntry>;
2284
+ /**
2285
+ * Validate the entry - either new one or existing one.
2286
+ */
2287
+ validateEntry: (model: CmsModel, id?: string, input?: UpdateCmsEntryInput) => Promise<CmsEntryValidateResponse>;
2288
+ /**
2289
+ * Move entry, and all its revisions, to a new folder.
2290
+ */
2291
+ moveEntry: (model: CmsModel, id: string, folderId: string) => Promise<CmsEntry>;
1853
2292
  /**
1854
2293
  * Method that republishes entry with given identifier.
1855
2294
  * @internal
@@ -1862,7 +2301,11 @@ export interface CmsEntryContext {
1862
2301
  /**
1863
2302
  * Delete entry with all its revisions.
1864
2303
  */
1865
- deleteEntry: (model: CmsModel, id: string) => Promise<void>;
2304
+ deleteEntry: (model: CmsModel, id: string, options?: CmsDeleteEntryOptions) => Promise<void>;
2305
+ /**
2306
+ * Delete multiple entries
2307
+ */
2308
+ deleteMultipleEntries: (model: CmsModel, params: DeleteMultipleEntriesParams) => Promise<DeleteMultipleEntriesResponse>;
1866
2309
  /**
1867
2310
  * Publish entry.
1868
2311
  */
@@ -1876,74 +2319,13 @@ export interface CmsEntryContext {
1876
2319
  */
1877
2320
  getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;
1878
2321
  /**
1879
- * Lifecyle events - deprecated.
1880
- */
1881
- /**
1882
- * @deprecated
1883
- */
1884
- onBeforeEntryCreate: Topic<OnEntryBeforeCreateTopicParams>;
1885
- /**
1886
- * @deprecated
1887
- */
1888
- onAfterEntryCreate: Topic<OnEntryAfterCreateTopicParams>;
1889
- /**
1890
- * @deprecated
1891
- */
1892
- onBeforeEntryCreateRevision: Topic<OnEntryRevisionBeforeCreateTopicParams>;
1893
- /**
1894
- * @deprecated
1895
- */
1896
- onAfterEntryCreateRevision: Topic<OnEntryRevisionAfterCreateTopicParams>;
1897
- /**
1898
- * @deprecated
1899
- */
1900
- onBeforeEntryUpdate: Topic<OnEntryBeforeUpdateTopicParams>;
1901
- /**
1902
- * @deprecated
1903
- */
1904
- onAfterEntryUpdate: Topic<OnEntryAfterUpdateTopicParams>;
1905
- /**
1906
- * @deprecated
1907
- */
1908
- onBeforeEntryDelete: Topic<OnEntryBeforeDeleteTopicParams>;
1909
- /**
1910
- * @deprecated
1911
- */
1912
- onAfterEntryDelete: Topic<OnEntryAfterDeleteTopicParams>;
1913
- /**
1914
- * @deprecated
1915
- */
1916
- onBeforeEntryDeleteRevision: Topic<OnEntryRevisionBeforeDeleteTopicParams>;
1917
- /**
1918
- * @deprecated
1919
- */
1920
- onAfterEntryDeleteRevision: Topic<OnEntryRevisionAfterDeleteTopicParams>;
1921
- /**
1922
- * @deprecated
1923
- */
1924
- onBeforeEntryPublish: Topic<OnEntryBeforePublishTopicParams>;
1925
- /**
1926
- * @deprecated
1927
- */
1928
- onAfterEntryPublish: Topic<OnEntryAfterPublishTopicParams>;
1929
- /**
1930
- * @deprecated
1931
- */
1932
- onBeforeEntryUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
1933
- /**
1934
- * @deprecated
1935
- */
1936
- onAfterEntryUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
1937
- /**
1938
- * @deprecated
1939
- */
1940
- onBeforeEntryGet: Topic<OnEntryBeforeGetTopicParams>;
1941
- /**
1942
- * @deprecated
2322
+ * List all unique values for a given field.
2323
+ *
2324
+ * @internal
1943
2325
  */
1944
- onBeforeEntryList: Topic<EntryBeforeListTopicParams>;
2326
+ getUniqueFieldValues: (model: CmsModel, params: GetUniqueFieldValuesParams) => Promise<CmsEntryUniqueValue[]>;
1945
2327
  /**
1946
- * Lifecycle events released in 5.33.0
2328
+ * Lifecycle Events
1947
2329
  */
1948
2330
  onEntryBeforeCreate: Topic<OnEntryBeforeCreateTopicParams>;
1949
2331
  onEntryAfterCreate: Topic<OnEntryAfterCreateTopicParams>;
@@ -1954,6 +2336,9 @@ export interface CmsEntryContext {
1954
2336
  onEntryBeforeUpdate: Topic<OnEntryBeforeUpdateTopicParams>;
1955
2337
  onEntryAfterUpdate: Topic<OnEntryAfterUpdateTopicParams>;
1956
2338
  onEntryUpdateError: Topic<OnEntryUpdateErrorTopicParams>;
2339
+ onEntryBeforeMove: Topic<OnEntryBeforeMoveTopicParams>;
2340
+ onEntryAfterMove: Topic<OnEntryAfterMoveTopicParams>;
2341
+ onEntryMoveError: Topic<OnEntryMoveErrorTopicParams>;
1957
2342
  onEntryBeforeDelete: Topic<OnEntryBeforeDeleteTopicParams>;
1958
2343
  onEntryAfterDelete: Topic<OnEntryAfterDeleteTopicParams>;
1959
2344
  onEntryDeleteError: Topic<OnEntryDeleteErrorTopicParams>;
@@ -1963,6 +2348,9 @@ export interface CmsEntryContext {
1963
2348
  onEntryBeforePublish: Topic<OnEntryBeforePublishTopicParams>;
1964
2349
  onEntryAfterPublish: Topic<OnEntryAfterPublishTopicParams>;
1965
2350
  onEntryPublishError: Topic<OnEntryPublishErrorTopicParams>;
2351
+ onEntryBeforeRepublish: Topic<OnEntryBeforeRepublishTopicParams>;
2352
+ onEntryAfterRepublish: Topic<OnEntryAfterRepublishTopicParams>;
2353
+ onEntryRepublishError: Topic<OnEntryRepublishErrorTopicParams>;
1966
2354
  onEntryBeforeUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
1967
2355
  onEntryAfterUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
1968
2356
  onEntryUnpublishError: Topic<OnEntryUnpublishErrorTopicParams>;
@@ -1987,13 +2375,6 @@ interface CmsEntryResolverFactoryParams {
1987
2375
  export declare type CmsEntryResolverFactory<TSource = any, TArgs = any, TContext = CmsContext> = {
1988
2376
  (params: CmsEntryResolverFactoryParams): GraphQLFieldResolver<TSource, TArgs, TContext>;
1989
2377
  };
1990
- /**
1991
- * Settings security permission.
1992
- *
1993
- * @category SecurityPermission
1994
- */
1995
- export interface CmsSettingsPermission extends SecurityPermission {
1996
- }
1997
2378
  /**
1998
2379
  * A base security permission for CMS.
1999
2380
  *
@@ -2011,13 +2392,13 @@ export interface BaseCmsSecurityPermission extends SecurityPermission {
2011
2392
  */
2012
2393
  export interface CmsModelPermission extends BaseCmsSecurityPermission {
2013
2394
  /**
2014
- * A object representing `key: model.modelId` values where key is locale code.
2395
+ * An object representing `key: model.modelId` values where key is locale code.
2015
2396
  */
2016
2397
  models?: {
2017
2398
  [key: string]: string[];
2018
2399
  };
2019
2400
  /**
2020
- * A object representing `key: group.id` values where key is locale code.
2401
+ * {locale: groupId[]} map, where key is a locale code.
2021
2402
  */
2022
2403
  groups?: {
2023
2404
  [key: string]: string[];
@@ -2031,7 +2412,7 @@ export interface CmsModelPermission extends BaseCmsSecurityPermission {
2031
2412
  */
2032
2413
  export interface CmsGroupPermission extends BaseCmsSecurityPermission {
2033
2414
  /**
2034
- * A object representing `key: group.id` values where key is locale code.
2415
+ * {locale: groupId[]} map, where key is a locale code.
2035
2416
  */
2036
2417
  groups?: {
2037
2418
  [key: string]: string[];
@@ -2046,13 +2427,13 @@ export interface CmsGroupPermission extends BaseCmsSecurityPermission {
2046
2427
  export interface CmsEntryPermission extends BaseCmsSecurityPermission {
2047
2428
  pw?: string;
2048
2429
  /**
2049
- * A object representing `key: model.modelId` values where key is locale code.
2430
+ * An object representing `key: model.modelId` values where key is locale code.
2050
2431
  */
2051
2432
  models?: {
2052
2433
  [key: string]: string[];
2053
2434
  };
2054
2435
  /**
2055
- * A object representing `key: group.id` values where key is locale code.
2436
+ * {locale: groupId[]} map, where key is a locale code.
2056
2437
  */
2057
2438
  groups?: {
2058
2439
  [key: string]: string[];
@@ -2167,7 +2548,7 @@ export interface CmsEntryStorageOperationsListParams {
2167
2548
  sort?: CmsEntryListSort;
2168
2549
  search?: string;
2169
2550
  fields?: string[];
2170
- limit?: number;
2551
+ limit: number;
2171
2552
  after?: string | null;
2172
2553
  }
2173
2554
  export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry = CmsStorageEntry> {
@@ -2219,11 +2600,11 @@ export interface CmsEntryStorageOperationsDeleteRevisionParams<T extends CmsStor
2219
2600
  latestStorageEntry: T | null;
2220
2601
  }
2221
2602
  export interface CmsEntryStorageOperationsDeleteParams {
2222
- /**
2223
- * Entry that is going to be deleted.
2224
- */
2225
2603
  entry: CmsEntry;
2226
2604
  }
2605
+ export interface CmsEntryStorageOperationsDeleteEntriesParams {
2606
+ entries: string[];
2607
+ }
2227
2608
  export interface CmsEntryStorageOperationsPublishParams<T extends CmsStorageEntry = CmsStorageEntry> {
2228
2609
  /**
2229
2610
  * The modified entry that is going to be saved as published.
@@ -2245,6 +2626,10 @@ export interface CmsEntryStorageOperationsUnpublishParams<T extends CmsStorageEn
2245
2626
  */
2246
2627
  storageEntry: T;
2247
2628
  }
2629
+ export interface CmsEntryStorageOperationsGetUniqueFieldValuesParams {
2630
+ where: CmsEntryListWhere;
2631
+ fieldId: string;
2632
+ }
2248
2633
  export interface CmsEntryStorageOperationsGetByIdsParams {
2249
2634
  ids: readonly string[];
2250
2635
  }
@@ -2301,101 +2686,91 @@ export interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorag
2301
2686
  /**
2302
2687
  * Get all the entries of the ids.
2303
2688
  */
2304
- getByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
2689
+ getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
2305
2690
  /**
2306
2691
  * Get all the published entries of the ids.
2307
2692
  */
2308
- getPublishedByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
2693
+ getPublishedByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
2309
2694
  /**
2310
2695
  * Get all the latest entries of the ids.
2311
2696
  */
2312
- getLatestByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
2697
+ getLatestByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
2313
2698
  /**
2314
2699
  * Get all revisions of the given entry id.
2315
2700
  */
2316
- getRevisions: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
2701
+ getRevisions: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
2317
2702
  /**
2318
2703
  * Get the entry by the given revision id.
2319
2704
  */
2320
- getRevisionById: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
2705
+ getRevisionById: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
2321
2706
  /**
2322
2707
  * Get the published entry by given entryId.
2323
2708
  */
2324
- getPublishedRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
2709
+ getPublishedRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
2325
2710
  /**
2326
2711
  * Get the latest entry by given entryId.
2327
2712
  */
2328
- getLatestRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
2713
+ getLatestRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
2329
2714
  /**
2330
2715
  * Get the revision of the entry before given one.
2331
2716
  */
2332
- getPreviousRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
2717
+ getPreviousRevision: (model: CmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
2333
2718
  /**
2334
2719
  * Gets entry by given params.
2335
2720
  */
2336
- get: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
2721
+ get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
2337
2722
  /**
2338
2723
  * List all entries. Filterable via params.
2339
2724
  */
2340
- list: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
2725
+ list: (model: CmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
2341
2726
  /**
2342
2727
  * Create a new entry.
2343
2728
  */
2344
- create: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
2729
+ create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
2345
2730
  /**
2346
2731
  * Create a new entry from existing one.
2347
2732
  */
2348
- createRevisionFrom: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
2733
+ createRevisionFrom: (model: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
2349
2734
  /**
2350
2735
  * Update existing entry.
2351
2736
  */
2352
- update: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
2737
+ update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
2738
+ /**
2739
+ * Move entry and all its entries into a new folder.
2740
+ */
2741
+ move: (model: CmsModel, id: string, folderId: string) => Promise<void>;
2353
2742
  /**
2354
2743
  * Delete the entry revision.
2355
2744
  */
2356
- deleteRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
2745
+ deleteRevision: (model: CmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
2357
2746
  /**
2358
2747
  * Delete the entry.
2359
2748
  */
2360
- delete: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
2749
+ delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
2750
+ /**
2751
+ * Delete multiple entries, with a limit on how much can be deleted in one call.
2752
+ */
2753
+ deleteMultipleEntries: (model: CmsModel, params: CmsEntryStorageOperationsDeleteEntriesParams) => Promise<void>;
2361
2754
  /**
2362
2755
  * Publish the entry.
2363
2756
  */
2364
- publish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
2757
+ publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
2365
2758
  /**
2366
2759
  * Unpublish the entry.
2367
2760
  */
2368
- unpublish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
2761
+ unpublish: (model: CmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
2762
+ /**
2763
+ * Method to list all the unique values for the given field id.
2764
+ * Simplest use case would be to aggregate tags for some content.
2765
+ * @internal
2766
+ */
2767
+ getUniqueFieldValues: (model: CmsModel, params: CmsEntryStorageOperationsGetUniqueFieldValuesParams) => Promise<CmsEntryUniqueValue[]>;
2369
2768
  }
2370
2769
  export declare enum CONTENT_ENTRY_STATUS {
2371
2770
  DRAFT = "draft",
2372
2771
  PUBLISHED = "published",
2373
2772
  UNPUBLISHED = "unpublished"
2374
2773
  }
2375
- export interface CmsSettingsStorageOperationsGetParams {
2376
- locale: string;
2377
- tenant: string;
2378
- }
2379
- export interface CmsSettingsStorageOperationsCreateParams {
2380
- settings: CmsSettings;
2381
- }
2382
- export interface CmsSettingsStorageOperationsUpdateParams {
2383
- settings: CmsSettings;
2384
- }
2385
- export interface CmsSettingsStorageOperations {
2386
- /**
2387
- * Get the settings from the storage.
2388
- */
2389
- get: (params: CmsSettingsStorageOperationsGetParams) => Promise<CmsSettings | null>;
2390
- /**
2391
- * Create settings in the storage.
2392
- */
2393
- create: (params: CmsSettingsStorageOperationsCreateParams) => Promise<CmsSettings>;
2394
- /**
2395
- * Update the settings in the storage.
2396
- */
2397
- update: (params: CmsSettingsStorageOperationsUpdateParams) => Promise<CmsSettings>;
2398
- }
2399
2774
  export interface CmsSystem {
2400
2775
  version?: string;
2401
2776
  readAPIKey?: string;
@@ -2427,20 +2802,16 @@ export interface CmsSystemStorageOperations {
2427
2802
  */
2428
2803
  update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;
2429
2804
  }
2430
- export interface HeadlessCmsStorageOperations {
2805
+ export interface HeadlessCmsStorageOperations<C = CmsContext> {
2806
+ name: string;
2431
2807
  system: CmsSystemStorageOperations;
2432
- settings: CmsSettingsStorageOperations;
2433
2808
  groups: CmsGroupStorageOperations;
2434
2809
  models: CmsModelStorageOperations;
2435
2810
  entries: CmsEntryStorageOperations;
2436
2811
  /**
2437
2812
  * Either attach something from the storage operations or run something in it.
2438
2813
  */
2439
- beforeInit?: (context: CmsContext) => Promise<void>;
2440
- init?: (context: CmsContext) => Promise<void>;
2441
- /**
2442
- * An upgrade to run if necessary.
2443
- */
2444
- upgrade?: UpgradePlugin | null;
2814
+ beforeInit: (context: C) => Promise<void>;
2815
+ init?: (context: C) => Promise<void>;
2445
2816
  }
2446
2817
  export {};