@webiny/api-headless-cms 0.0.0-unstable.78f581c1d2 → 0.0.0-unstable.8acc9e8892

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 (405) hide show
  1. package/context.d.ts +5 -2
  2. package/context.js +61 -23
  3. package/context.js.map +1 -1
  4. package/crud/contentEntry/afterDelete.js +0 -5
  5. package/crud/contentEntry/afterDelete.js.map +1 -1
  6. package/crud/contentEntry/beforeCreate.js +0 -3
  7. package/crud/contentEntry/beforeCreate.js.map +1 -1
  8. package/crud/contentEntry/beforeUpdate.js +0 -3
  9. package/crud/contentEntry/beforeUpdate.js.map +1 -1
  10. package/crud/contentEntry/entryDataValidation.js +1 -40
  11. package/crud/contentEntry/entryDataValidation.js.map +1 -1
  12. package/crud/contentEntry/markLockedFields.d.ts +1 -1
  13. package/crud/contentEntry/markLockedFields.js +19 -29
  14. package/crud/contentEntry/markLockedFields.js.map +1 -1
  15. package/crud/contentEntry/referenceFieldsMapping.js +45 -68
  16. package/crud/contentEntry/referenceFieldsMapping.js.map +1 -1
  17. package/crud/contentEntry/searchableFields.d.ts +9 -0
  18. package/crud/contentEntry/searchableFields.js +72 -0
  19. package/crud/contentEntry/searchableFields.js.map +1 -0
  20. package/crud/contentEntry.crud.d.ts +5 -2
  21. package/crud/contentEntry.crud.js +911 -954
  22. package/crud/contentEntry.crud.js.map +1 -1
  23. package/crud/contentModel/afterCreate.js +0 -2
  24. package/crud/contentModel/afterCreate.js.map +1 -1
  25. package/crud/contentModel/afterCreateFrom.js +0 -2
  26. package/crud/contentModel/afterCreateFrom.js.map +1 -1
  27. package/crud/contentModel/afterDelete.js +0 -2
  28. package/crud/contentModel/afterDelete.js.map +1 -1
  29. package/crud/contentModel/afterUpdate.js +0 -2
  30. package/crud/contentModel/afterUpdate.js.map +1 -1
  31. package/crud/contentModel/beforeCreate.d.ts +2 -3
  32. package/crud/contentModel/beforeCreate.js +43 -109
  33. package/crud/contentModel/beforeCreate.js.map +1 -1
  34. package/crud/contentModel/beforeDelete.d.ts +1 -1
  35. package/crud/contentModel/beforeDelete.js +1 -15
  36. package/crud/contentModel/beforeDelete.js.map +1 -1
  37. package/crud/contentModel/beforeUpdate.d.ts +2 -4
  38. package/crud/contentModel/beforeUpdate.js +33 -10
  39. package/crud/contentModel/beforeUpdate.js.map +1 -1
  40. package/crud/contentModel/compatibility/modelApiName.d.ts +3 -0
  41. package/crud/contentModel/compatibility/modelApiName.js +24 -0
  42. package/crud/contentModel/compatibility/modelApiName.js.map +1 -0
  43. package/crud/contentModel/contentModelManagerFactory.js +0 -7
  44. package/crud/contentModel/contentModelManagerFactory.js.map +1 -1
  45. package/crud/contentModel/createFieldStorageId.js +4 -3
  46. package/crud/contentModel/createFieldStorageId.js.map +1 -1
  47. package/crud/contentModel/defaultFields.d.ts +5 -0
  48. package/crud/contentModel/defaultFields.js +58 -0
  49. package/crud/contentModel/defaultFields.js.map +1 -0
  50. package/crud/contentModel/fields/descriptionField.d.ts +2 -0
  51. package/crud/contentModel/fields/descriptionField.js +42 -0
  52. package/crud/contentModel/fields/descriptionField.js.map +1 -0
  53. package/crud/contentModel/fields/imageField.d.ts +2 -0
  54. package/crud/contentModel/fields/imageField.js +46 -0
  55. package/crud/contentModel/fields/imageField.js.map +1 -0
  56. package/crud/contentModel/fields/titleField.d.ts +2 -0
  57. package/crud/contentModel/fields/titleField.js +58 -0
  58. package/crud/contentModel/fields/titleField.js.map +1 -0
  59. package/crud/contentModel/models.js +12 -0
  60. package/crud/contentModel/models.js.map +1 -1
  61. package/crud/contentModel/validate/endingAllowed.d.ts +6 -0
  62. package/crud/contentModel/validate/endingAllowed.js +26 -0
  63. package/crud/contentModel/validate/endingAllowed.js.map +1 -0
  64. package/crud/contentModel/validate/isModelEndingAllowed.d.ts +6 -0
  65. package/crud/contentModel/validate/isModelEndingAllowed.js +24 -0
  66. package/crud/contentModel/validate/isModelEndingAllowed.js.map +1 -0
  67. package/crud/contentModel/validate/modelId.d.ts +11 -0
  68. package/crud/contentModel/validate/modelId.js +36 -0
  69. package/crud/contentModel/validate/modelId.js.map +1 -0
  70. package/crud/contentModel/validate/pluralApiName.d.ts +7 -0
  71. package/crud/contentModel/validate/pluralApiName.js +24 -0
  72. package/crud/contentModel/validate/pluralApiName.js.map +1 -0
  73. package/crud/contentModel/validate/singularApiName.d.ts +7 -0
  74. package/crud/contentModel/validate/singularApiName.js +24 -0
  75. package/crud/contentModel/validate/singularApiName.js.map +1 -0
  76. package/crud/contentModel/validateLayout.js +0 -8
  77. package/crud/contentModel/validateLayout.js.map +1 -1
  78. package/crud/contentModel/validateModel.d.ts +4 -4
  79. package/crud/contentModel/validateModel.js +6 -11
  80. package/crud/contentModel/validateModel.js.map +1 -1
  81. package/crud/contentModel/validateModelFields.d.ts +4 -4
  82. package/crud/contentModel/validateModelFields.js +130 -147
  83. package/crud/contentModel/validateModelFields.js.map +1 -1
  84. package/crud/contentModel/validation.d.ts +551 -0
  85. package/crud/contentModel/validation.js +145 -0
  86. package/crud/contentModel/validation.js.map +1 -0
  87. package/crud/contentModel.crud.js +373 -362
  88. package/crud/contentModel.crud.js.map +1 -1
  89. package/crud/contentModelGroup/beforeCreate.js +0 -12
  90. package/crud/contentModelGroup/beforeCreate.js.map +1 -1
  91. package/crud/contentModelGroup/beforeDelete.js +0 -8
  92. package/crud/contentModelGroup/beforeDelete.js.map +1 -1
  93. package/crud/contentModelGroup/beforeUpdate.js +0 -5
  94. package/crud/contentModelGroup/beforeUpdate.js.map +1 -1
  95. package/crud/contentModelGroup/validation.d.ts +30 -0
  96. package/crud/contentModelGroup/validation.js +34 -0
  97. package/crud/contentModelGroup/validation.js.map +1 -0
  98. package/crud/contentModelGroup.crud.js +194 -208
  99. package/crud/contentModelGroup.crud.js.map +1 -1
  100. package/crud/settings.crud.d.ts +1 -1
  101. package/crud/settings.crud.js +5 -22
  102. package/crud/settings.crud.js.map +1 -1
  103. package/crud/system.crud.js +1 -96
  104. package/crud/system.crud.js.map +1 -1
  105. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +0 -13
  106. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -1
  107. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.d.ts +11 -0
  108. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +203 -0
  109. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -0
  110. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +0 -53
  111. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -1
  112. package/fieldConverters/index.d.ts +2 -1
  113. package/fieldConverters/index.js +2 -5
  114. package/fieldConverters/index.js.map +1 -1
  115. package/graphql/buildSchemaPlugins.d.ts +8 -3
  116. package/graphql/buildSchemaPlugins.js +6 -14
  117. package/graphql/buildSchemaPlugins.js.map +1 -1
  118. package/graphql/checkEndpointAccess.d.ts +2 -0
  119. package/graphql/checkEndpointAccess.js +18 -0
  120. package/graphql/checkEndpointAccess.js.map +1 -0
  121. package/graphql/createExecutableSchema.d.ts +6 -0
  122. package/graphql/createExecutableSchema.js +29 -0
  123. package/graphql/createExecutableSchema.js.map +1 -0
  124. package/graphql/createRequestBody.d.ts +2 -0
  125. package/graphql/createRequestBody.js +14 -0
  126. package/graphql/createRequestBody.js.map +1 -0
  127. package/graphql/formatErrorPayload.d.ts +1 -0
  128. package/graphql/formatErrorPayload.js +25 -0
  129. package/graphql/formatErrorPayload.js.map +1 -0
  130. package/graphql/generateSchema.d.ts +8 -0
  131. package/graphql/generateSchema.js +31 -0
  132. package/graphql/generateSchema.js.map +1 -0
  133. package/graphql/getSchema.d.ts +17 -0
  134. package/graphql/getSchema.js +102 -0
  135. package/graphql/getSchema.js.map +1 -0
  136. package/graphql/graphQLHandlerFactory.js +6 -129
  137. package/graphql/graphQLHandlerFactory.js.map +1 -1
  138. package/graphql/handleRequest.d.ts +11 -0
  139. package/graphql/handleRequest.js +81 -0
  140. package/graphql/handleRequest.js.map +1 -0
  141. package/graphql/index.d.ts +1 -3
  142. package/graphql/index.js +2 -46
  143. package/graphql/index.js.map +1 -1
  144. package/graphql/schema/baseContentSchema.d.ts +6 -2
  145. package/graphql/schema/baseContentSchema.js +10 -20
  146. package/graphql/schema/baseContentSchema.js.map +1 -1
  147. package/graphql/schema/baseSchema.d.ts +3 -0
  148. package/graphql/schema/baseSchema.js +53 -0
  149. package/graphql/schema/baseSchema.js.map +1 -0
  150. package/graphql/schema/contentEntries.d.ts +6 -2
  151. package/graphql/schema/contentEntries.js +118 -107
  152. package/graphql/schema/contentEntries.js.map +1 -1
  153. package/graphql/schema/contentModelGroups.d.ts +6 -2
  154. package/graphql/schema/contentModelGroups.js +16 -29
  155. package/graphql/schema/contentModelGroups.js.map +1 -1
  156. package/graphql/schema/contentModels.d.ts +6 -2
  157. package/graphql/schema/contentModels.js +62 -26
  158. package/graphql/schema/contentModels.js.map +1 -1
  159. package/graphql/schema/createFieldResolvers.d.ts +1 -1
  160. package/graphql/schema/createFieldResolvers.js +22 -28
  161. package/graphql/schema/createFieldResolvers.js.map +1 -1
  162. package/graphql/schema/createManageResolvers.d.ts +1 -1
  163. package/graphql/schema/createManageResolvers.js +33 -43
  164. package/graphql/schema/createManageResolvers.js.map +1 -1
  165. package/graphql/schema/createManageSDL.d.ts +3 -0
  166. package/graphql/schema/createManageSDL.js +64 -67
  167. package/graphql/schema/createManageSDL.js.map +1 -1
  168. package/graphql/schema/createPreviewResolvers.js +3 -17
  169. package/graphql/schema/createPreviewResolvers.js.map +1 -1
  170. package/graphql/schema/createReadResolvers.js +8 -17
  171. package/graphql/schema/createReadResolvers.js.map +1 -1
  172. package/graphql/schema/createReadSDL.d.ts +3 -0
  173. package/graphql/schema/createReadSDL.js +33 -35
  174. package/graphql/schema/createReadSDL.js.map +1 -1
  175. package/graphql/schema/resolvers/commonFieldResolvers.d.ts +3 -2
  176. package/graphql/schema/resolvers/commonFieldResolvers.js +2 -3
  177. package/graphql/schema/resolvers/commonFieldResolvers.js.map +1 -1
  178. package/graphql/schema/resolvers/manage/resolveCreate.js +0 -3
  179. package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
  180. package/graphql/schema/resolvers/manage/resolveCreateFrom.js +0 -3
  181. package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
  182. package/graphql/schema/resolvers/manage/resolveDelete.js +0 -6
  183. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
  184. package/graphql/schema/resolvers/manage/resolveGet.js +0 -16
  185. package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
  186. package/graphql/schema/resolvers/manage/resolveGetByIds.js +0 -3
  187. package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
  188. package/graphql/schema/resolvers/manage/resolveGetRevisions.js +0 -3
  189. package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
  190. package/graphql/schema/resolvers/manage/resolveList.js +0 -3
  191. package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
  192. package/graphql/schema/resolvers/manage/resolvePublish.js +0 -3
  193. package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
  194. package/graphql/schema/resolvers/manage/resolveRepublish.js +0 -3
  195. package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
  196. package/graphql/schema/resolvers/manage/resolveUnpublish.js +0 -3
  197. package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
  198. package/graphql/schema/resolvers/manage/resolveUpdate.js +0 -3
  199. package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
  200. package/graphql/schema/resolvers/preview/resolveGet.js +0 -8
  201. package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
  202. package/graphql/schema/resolvers/preview/resolveList.js +0 -3
  203. package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
  204. package/graphql/schema/resolvers/read/resolveGet.js +0 -8
  205. package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
  206. package/graphql/schema/resolvers/read/resolveList.js +0 -3
  207. package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
  208. package/graphql/schema/schemaPlugins.d.ts +8 -3
  209. package/graphql/schema/schemaPlugins.js +64 -66
  210. package/graphql/schema/schemaPlugins.js.map +1 -1
  211. package/graphql/system.js +55 -87
  212. package/graphql/system.js.map +1 -1
  213. package/graphqlFields/boolean.js +0 -12
  214. package/graphqlFields/boolean.js.map +1 -1
  215. package/graphqlFields/datetime.js +0 -17
  216. package/graphqlFields/datetime.js.map +1 -1
  217. package/graphqlFields/dynamicZone/dynamicZoneField.d.ts +2 -0
  218. package/graphqlFields/dynamicZone/dynamicZoneField.js +243 -0
  219. package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -0
  220. package/graphqlFields/dynamicZone/dynamicZoneStorage.d.ts +3 -0
  221. package/graphqlFields/dynamicZone/dynamicZoneStorage.js +63 -0
  222. package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +1 -0
  223. package/graphqlFields/dynamicZone/index.d.ts +2 -0
  224. package/graphqlFields/dynamicZone/index.js +19 -0
  225. package/graphqlFields/dynamicZone/index.js.map +1 -0
  226. package/graphqlFields/file.js +0 -8
  227. package/graphqlFields/file.js.map +1 -1
  228. package/graphqlFields/helpers.js +0 -10
  229. package/graphqlFields/helpers.js.map +1 -1
  230. package/graphqlFields/index.d.ts +1 -1
  231. package/graphqlFields/index.js +2 -12
  232. package/graphqlFields/index.js.map +1 -1
  233. package/graphqlFields/longText.js +0 -10
  234. package/graphqlFields/longText.js.map +1 -1
  235. package/graphqlFields/number.js +4 -12
  236. package/graphqlFields/number.js.map +1 -1
  237. package/graphqlFields/object.js +131 -98
  238. package/graphqlFields/object.js.map +1 -1
  239. package/graphqlFields/ref.js +86 -106
  240. package/graphqlFields/ref.js.map +1 -1
  241. package/graphqlFields/richText.js +0 -9
  242. package/graphqlFields/richText.js.map +1 -1
  243. package/graphqlFields/text.js +0 -11
  244. package/graphqlFields/text.js.map +1 -1
  245. package/index.d.ts +5 -3
  246. package/index.js +27 -27
  247. package/index.js.map +1 -1
  248. package/modelManager/DefaultCmsModelManager.js +0 -16
  249. package/modelManager/DefaultCmsModelManager.js.map +1 -1
  250. package/modelManager/index.js +0 -4
  251. package/modelManager/index.js.map +1 -1
  252. package/package.json +27 -28
  253. package/parameters/context.js +0 -4
  254. package/parameters/context.js.map +1 -1
  255. package/parameters/header.js +0 -11
  256. package/parameters/header.js.map +1 -1
  257. package/parameters/index.js +0 -8
  258. package/parameters/index.js.map +1 -1
  259. package/parameters/manual.js +1 -8
  260. package/parameters/manual.js.map +1 -1
  261. package/parameters/path.js +0 -11
  262. package/parameters/path.js.map +1 -1
  263. package/plugins/CmsGraphQLSchemaPlugin.d.ts +5 -0
  264. package/plugins/CmsGraphQLSchemaPlugin.js +12 -0
  265. package/plugins/CmsGraphQLSchemaPlugin.js.map +1 -0
  266. package/plugins/CmsGraphQLSchemaSorterPlugin.d.ts +20 -0
  267. package/plugins/CmsGraphQLSchemaSorterPlugin.js +28 -0
  268. package/plugins/CmsGraphQLSchemaSorterPlugin.js.map +1 -0
  269. package/plugins/CmsGroupPlugin.js +0 -8
  270. package/plugins/CmsGroupPlugin.js.map +1 -1
  271. package/plugins/CmsModelFieldConverterPlugin.d.ts +2 -2
  272. package/plugins/CmsModelFieldConverterPlugin.js +0 -5
  273. package/plugins/CmsModelFieldConverterPlugin.js.map +1 -1
  274. package/plugins/CmsModelPlugin.d.ts +21 -3
  275. package/plugins/CmsModelPlugin.js +30 -40
  276. package/plugins/CmsModelPlugin.js.map +1 -1
  277. package/plugins/CmsParametersPlugin.js +0 -7
  278. package/plugins/CmsParametersPlugin.js.map +1 -1
  279. package/plugins/StorageOperationsCmsModelPlugin.d.ts +23 -0
  280. package/plugins/StorageOperationsCmsModelPlugin.js +42 -0
  281. package/plugins/StorageOperationsCmsModelPlugin.js.map +1 -0
  282. package/plugins/StorageTransformPlugin.d.ts +11 -11
  283. package/plugins/StorageTransformPlugin.js +0 -9
  284. package/plugins/StorageTransformPlugin.js.map +1 -1
  285. package/plugins/index.d.ts +3 -0
  286. package/plugins/index.js +33 -10
  287. package/plugins/index.js.map +1 -1
  288. package/storage/default.js +0 -3
  289. package/storage/default.js.map +1 -1
  290. package/storage/object.js +4 -20
  291. package/storage/object.js.map +1 -1
  292. package/types.d.ts +358 -120
  293. package/types.js +63 -70
  294. package/types.js.map +1 -1
  295. package/utils/access.js +11 -25
  296. package/utils/access.js.map +1 -1
  297. package/utils/converters/Converter.js +0 -13
  298. package/utils/converters/Converter.js.map +1 -1
  299. package/utils/converters/ConverterCollection.js +14 -34
  300. package/utils/converters/ConverterCollection.js.map +1 -1
  301. package/utils/converters/valueKeyStorageConverter.d.ts +1 -5
  302. package/utils/converters/valueKeyStorageConverter.js +21 -44
  303. package/utils/converters/valueKeyStorageConverter.js.map +1 -1
  304. package/utils/createTypeFromFields.d.ts +16 -0
  305. package/utils/createTypeFromFields.js +66 -0
  306. package/utils/createTypeFromFields.js.map +1 -0
  307. package/utils/createTypeName.d.ts +0 -2
  308. package/utils/createTypeName.js +4 -19
  309. package/utils/createTypeName.js.map +1 -1
  310. package/utils/entryStorage.js +22 -35
  311. package/utils/entryStorage.js.map +1 -1
  312. package/utils/filterAsync.js +0 -5
  313. package/utils/filterAsync.js.map +1 -1
  314. package/utils/getBaseFieldType.d.ts +4 -0
  315. package/utils/getBaseFieldType.js +10 -0
  316. package/utils/getBaseFieldType.js.map +1 -0
  317. package/utils/getEntryDescription.d.ts +2 -0
  318. package/utils/getEntryDescription.js +17 -0
  319. package/utils/getEntryDescription.js.map +1 -0
  320. package/utils/getEntryImage.d.ts +2 -0
  321. package/utils/getEntryImage.js +17 -0
  322. package/utils/getEntryImage.js.map +1 -0
  323. package/utils/getEntryTitle.js +0 -9
  324. package/utils/getEntryTitle.js.map +1 -1
  325. package/utils/getSchemaFromFieldPlugins.d.ts +4 -7
  326. package/utils/getSchemaFromFieldPlugins.js +23 -19
  327. package/utils/getSchemaFromFieldPlugins.js.map +1 -1
  328. package/utils/incrementEntryIdVersion.d.ts +5 -0
  329. package/utils/incrementEntryIdVersion.js +29 -0
  330. package/utils/incrementEntryIdVersion.js.map +1 -0
  331. package/utils/ownership.d.ts +3 -3
  332. package/utils/ownership.js +0 -8
  333. package/utils/ownership.js.map +1 -1
  334. package/utils/permissions.js +8 -23
  335. package/utils/permissions.js.map +1 -1
  336. package/utils/renderFields.d.ts +2 -1
  337. package/utils/renderFields.js +10 -10
  338. package/utils/renderFields.js.map +1 -1
  339. package/utils/renderGetFilterFields.js +6 -14
  340. package/utils/renderGetFilterFields.js.map +1 -1
  341. package/utils/renderInputFields.d.ts +2 -1
  342. package/utils/renderInputFields.js +6 -9
  343. package/utils/renderInputFields.js.map +1 -1
  344. package/utils/renderListFilterFields.js +4 -10
  345. package/utils/renderListFilterFields.js.map +1 -1
  346. package/utils/renderSortEnum.d.ts +7 -4
  347. package/utils/renderSortEnum.js +21 -11
  348. package/utils/renderSortEnum.js.map +1 -1
  349. package/utils/toSlug.js +0 -4
  350. package/utils/toSlug.js.map +1 -1
  351. package/validators/dateGte.js +0 -7
  352. package/validators/dateGte.js.map +1 -1
  353. package/validators/dateLte.js +0 -7
  354. package/validators/dateLte.js.map +1 -1
  355. package/validators/dynamicZone.d.ts +2 -0
  356. package/validators/dynamicZone.js +20 -0
  357. package/validators/dynamicZone.js.map +1 -0
  358. package/validators/gte.js +0 -8
  359. package/validators/gte.js.map +1 -1
  360. package/validators/in.js +0 -8
  361. package/validators/in.js.map +1 -1
  362. package/validators/index.js +2 -16
  363. package/validators/index.js.map +1 -1
  364. package/validators/lte.js +0 -8
  365. package/validators/lte.js.map +1 -1
  366. package/validators/maxLength.js +0 -8
  367. package/validators/maxLength.js.map +1 -1
  368. package/validators/minLength.js +0 -8
  369. package/validators/minLength.js.map +1 -1
  370. package/validators/pattern.js +0 -9
  371. package/validators/pattern.js.map +1 -1
  372. package/validators/patternPlugins/email.js +0 -2
  373. package/validators/patternPlugins/email.js.map +1 -1
  374. package/validators/patternPlugins/index.js +0 -8
  375. package/validators/patternPlugins/index.js.map +1 -1
  376. package/validators/patternPlugins/lowerCase.js +0 -2
  377. package/validators/patternPlugins/lowerCase.js.map +1 -1
  378. package/validators/patternPlugins/lowerCaseSpace.js +0 -2
  379. package/validators/patternPlugins/lowerCaseSpace.js.map +1 -1
  380. package/validators/patternPlugins/upperCase.js +0 -2
  381. package/validators/patternPlugins/upperCase.js.map +1 -1
  382. package/validators/patternPlugins/upperCaseSpace.js +0 -2
  383. package/validators/patternPlugins/upperCaseSpace.js.map +1 -1
  384. package/validators/patternPlugins/url.js +0 -2
  385. package/validators/patternPlugins/url.js.map +1 -1
  386. package/validators/required.js +0 -5
  387. package/validators/required.js.map +1 -1
  388. package/validators/timeGte.js +0 -8
  389. package/validators/timeGte.js.map +1 -1
  390. package/validators/timeLte.js +0 -8
  391. package/validators/timeLte.js.map +1 -1
  392. package/validators/unique.js +0 -7
  393. package/validators/unique.js.map +1 -1
  394. package/crud/index.d.ts +0 -6
  395. package/crud/index.js +0 -85
  396. package/crud/index.js.map +0 -1
  397. package/graphql/schema/resolvers/manage/resolveRequestChanges.d.ts +0 -7
  398. package/graphql/schema/resolvers/manage/resolveRequestChanges.js +0 -21
  399. package/graphql/schema/resolvers/manage/resolveRequestChanges.js.map +0 -1
  400. package/graphql/schema/resolvers/manage/resolveRequestReview.d.ts +0 -7
  401. package/graphql/schema/resolvers/manage/resolveRequestReview.js +0 -21
  402. package/graphql/schema/resolvers/manage/resolveRequestReview.js.map +0 -1
  403. package/utils/filterModelFields.d.ts +0 -16
  404. package/utils/filterModelFields.js +0 -77
  405. package/utils/filterModelFields.js.map +0 -1
package/types.d.ts CHANGED
@@ -5,7 +5,6 @@ import { GraphQLFieldResolver, GraphQLSchemaDefinition, Resolvers } from "@webin
5
5
  import { SecurityPermission } from "@webiny/api-security/types";
6
6
  import { DbContext } from "@webiny/handler-db/types";
7
7
  import { FileManagerContext } from "@webiny/api-file-manager/types";
8
- import { UpgradePlugin } from "@webiny/api-upgrade/types";
9
8
  import { Topic } from "@webiny/pubsub/types";
10
9
  import { CmsModelConverterCallable } from "./utils/converters/ConverterCollection";
11
10
  export declare type ApiEndpoint = "manage" | "preview" | "read";
@@ -98,6 +97,10 @@ export interface CmsModelFieldSettings {
98
97
  * Object field has child fields.
99
98
  */
100
99
  fields?: CmsModelField[];
100
+ /**
101
+ * Is the file field images only one?
102
+ */
103
+ imagesOnly?: boolean;
101
104
  /**
102
105
  * Object field has child fields - so it needs to have a layout.
103
106
  */
@@ -115,6 +118,7 @@ export interface CmsModelFieldSettings {
115
118
  */
116
119
  [key: string]: any;
117
120
  }
121
+ export declare type CmsModelFieldType = "boolean" | "datetime" | "file" | "long-text" | "number" | "object" | "ref" | "rich-text" | "text" | "dynamicZone" | string;
118
122
  /**
119
123
  * A definition for content model field. This type exists on the app side as well.
120
124
  *
@@ -135,18 +139,16 @@ export interface CmsModelField {
135
139
  * A type of the field.
136
140
  * We are defining our built-in fields, so people know which are available by the default.
137
141
  */
138
- type: "boolean" | "datetime" | "file" | "long-text" | "number" | "object" | "ref" | "rich-text" | "text" | string;
142
+ type: CmsModelFieldType;
139
143
  /**
140
144
  * 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.
145
+ * Must in form of a-zA-Z0-9@a-zA-Z0-9
142
146
  *
143
147
  * This is an auto-generated value: uses `id` and `type`
144
148
  *
145
149
  * This is used as path for the entry value.
146
- *
147
- * @internal
148
150
  */
149
- storageId: string;
151
+ storageId: `${string}@${string}` | string;
150
152
  /**
151
153
  * Field identifier for the model field that will be available to the outside world.
152
154
  * `storageId` is used as path (or column) to store the data.
@@ -195,6 +197,10 @@ export interface CmsModelField {
195
197
  *
196
198
  */
197
199
  multipleValues?: boolean;
200
+ /**
201
+ * Fields can be tagged to give them contextual meaning.
202
+ */
203
+ tags?: string[];
198
204
  /**
199
205
  * Any user defined settings.
200
206
  *
@@ -202,18 +208,42 @@ export interface CmsModelField {
202
208
  */
203
209
  settings?: CmsModelFieldSettings;
204
210
  }
211
+ export interface CmsDynamicZoneTemplate {
212
+ id: string;
213
+ name: string;
214
+ gqlTypeName: string;
215
+ description: string;
216
+ icon: string;
217
+ fields: CmsModelField[];
218
+ layout: string[][];
219
+ validation: CmsModelFieldValidation[];
220
+ }
221
+ /**
222
+ * A definition for dynamic-zone field to show possible type of the field in settings.
223
+ */
224
+ export interface CmsModelDynamicZoneField extends CmsModelField {
225
+ /**
226
+ * Settings object for the field. Contains `templates` property.
227
+ */
228
+ settings: {
229
+ templates: CmsDynamicZoneTemplate[];
230
+ };
231
+ }
205
232
  /**
206
233
  * Used for our internal functionality.
207
234
  */
208
235
  export interface CmsModelFieldWithParent extends CmsModelField {
209
236
  parent?: CmsModelFieldWithParent | null;
210
237
  }
238
+ export interface CmsModelDynamicZoneFieldWithParent extends CmsModelDynamicZoneField {
239
+ parent?: CmsModelDynamicZoneFieldWithParent | null;
240
+ }
211
241
  /**
212
242
  * A definition for dateTime field to show possible type of the field in settings.
213
243
  */
214
244
  export interface CmsModelDateTimeField extends CmsModelField {
215
245
  /**
216
- * Settings object for the field. Contains type property.
246
+ * Settings object for the field. Contains `type` property.
217
247
  */
218
248
  settings: {
219
249
  type: "time" | "date" | "dateTimeWithoutTimezone" | "dateTimeWithTimezone";
@@ -335,7 +365,21 @@ export interface LockedField {
335
365
  [key: string]: any;
336
366
  }
337
367
  /**
338
- * Cms Model defining an entry.
368
+ * @category Database model
369
+ * @category CmsModel
370
+ */
371
+ export interface CmsModelGroup {
372
+ /**
373
+ * Generated ID of the group
374
+ */
375
+ id: string;
376
+ /**
377
+ * Name of the group
378
+ */
379
+ name: string;
380
+ }
381
+ /**
382
+ * Base CMS Model. Should not be exported and used outside of this package.
339
383
  *
340
384
  * @category Database model
341
385
  * @category CmsModel
@@ -349,6 +393,24 @@ export interface CmsModel {
349
393
  * Unique ID for the content model. Created from name if not defined by user.
350
394
  */
351
395
  modelId: string;
396
+ /**
397
+ * Name of the content model in singular form to be used in the API.
398
+ * example:
399
+ * - Article
400
+ * - Fruit
401
+ * - Vegetable
402
+ * - Car
403
+ */
404
+ singularApiName: string;
405
+ /**
406
+ * Name of the content model in plural form to be used in the API.
407
+ * example:
408
+ * - Articles
409
+ * - Fruits
410
+ * - Vegetables
411
+ * - Cars
412
+ */
413
+ pluralApiName: string;
352
414
  /**
353
415
  * Model tenant.
354
416
  */
@@ -360,20 +422,15 @@ export interface CmsModel {
360
422
  /**
361
423
  * Cms Group reference object.
362
424
  */
363
- group: {
364
- /**
365
- * Generated ID of the group
366
- */
367
- id: string;
368
- /**
369
- * Name of the group
370
- */
371
- name: string;
372
- };
425
+ group: CmsModelGroup;
426
+ /**
427
+ * Icon for the content model.
428
+ */
429
+ icon?: string | null;
373
430
  /**
374
431
  * Description for the content model.
375
432
  */
376
- description: string;
433
+ description: string | null;
377
434
  /**
378
435
  * Date created
379
436
  */
@@ -385,7 +442,7 @@ export interface CmsModel {
385
442
  /**
386
443
  * CreatedBy object wrapper. Contains id, name and type of the user.
387
444
  */
388
- createdBy?: CreatedBy;
445
+ createdBy?: CmsIdentity;
389
446
  /**
390
447
  * List of fields defining entry values.
391
448
  */
@@ -401,6 +458,10 @@ export interface CmsModel {
401
458
  * ```
402
459
  */
403
460
  layout: string[][];
461
+ /**
462
+ * Models can be tagged to give them contextual meaning.
463
+ */
464
+ tags?: string[];
404
465
  /**
405
466
  * List of locked fields. Updated when entry is saved and a field has been used.
406
467
  */
@@ -410,6 +471,16 @@ export interface CmsModel {
410
471
  * It is picked as first available text field. Or user can select own field.
411
472
  */
412
473
  titleFieldId: string;
474
+ /**
475
+ * The field which is displayed as the description one.
476
+ * Only way this is null or undefined is that there are no long-text fields to be set as description.
477
+ */
478
+ descriptionFieldId?: string | null;
479
+ /**
480
+ * The field which is displayed as the image.
481
+ * Only way this is null or undefined is that there are no file fields, with images only set, to be set as image.
482
+ */
483
+ imageFieldId?: string | null;
413
484
  /**
414
485
  * The version of Webiny which this record was stored with.
415
486
  */
@@ -437,25 +508,41 @@ export interface CmsModelFieldDefinition {
437
508
  fields: string;
438
509
  typeDefs?: string;
439
510
  }
440
- interface CmsModelFieldToGraphQLCreateResolverParams {
511
+ interface CmsModelFieldToGraphQLCreateResolverParams<TField> {
441
512
  models: CmsModel[];
442
513
  model: CmsModel;
443
514
  graphQLType: string;
444
- field: CmsModelField;
515
+ field: TField;
445
516
  createFieldResolvers: any;
517
+ fieldTypePlugins: CmsFieldTypePlugins;
446
518
  }
447
- export interface CmsModelFieldToGraphQLCreateResolver {
448
- (params: CmsModelFieldToGraphQLCreateResolverParams): GraphQLFieldResolver | {
519
+ export interface CmsModelFieldToGraphQLCreateResolver<TField = CmsModelField> {
520
+ (params: CmsModelFieldToGraphQLCreateResolverParams<TField>): GraphQLFieldResolver | {
449
521
  resolver: GraphQLFieldResolver | null;
450
522
  typeResolvers: Resolvers<CmsContext>;
451
523
  } | false;
452
524
  }
525
+ export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams<TField extends CmsModelField = CmsModelField> {
526
+ fields: TField[];
527
+ originalFields: TField[];
528
+ }
529
+ export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidate {
530
+ (params: CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams): void;
531
+ }
532
+ export interface CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField extends CmsModelField = CmsModelField> {
533
+ field: TField;
534
+ originalField?: TField;
535
+ validate: CmsModelFieldToGraphQLPluginValidateChildFieldsValidate;
536
+ }
537
+ export interface CmsModelFieldToGraphQLPluginValidateChildFields<TField extends CmsModelField = CmsModelField> {
538
+ (params: CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField>): void;
539
+ }
453
540
  /**
454
541
  * @category Plugin
455
542
  * @category ModelField
456
543
  * @category GraphQL
457
544
  */
458
- export interface CmsModelFieldToGraphQLPlugin extends Plugin {
545
+ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = CmsModelField> extends Plugin {
459
546
  /**
460
547
  * A plugin type
461
548
  */
@@ -509,7 +596,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
509
596
  */
510
597
  createStorageId?: (params: {
511
598
  model: CmsModel;
512
- field: CmsModelField;
599
+ field: TField;
513
600
  }) => string | null | undefined;
514
601
  /**
515
602
  * Read API methods.
@@ -528,7 +615,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
528
615
  */
529
616
  createGetFilters?(params: {
530
617
  model: CmsModel;
531
- field: CmsModelField;
618
+ field: TField;
532
619
  }): string;
533
620
  /**
534
621
  * Definition for list filtering for GraphQL.
@@ -548,7 +635,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
548
635
  */
549
636
  createListFilters?(params: {
550
637
  model: CmsModel;
551
- field: CmsModelField;
638
+ field: TField;
639
+ plugins: CmsFieldTypePlugins;
552
640
  }): string;
553
641
  /**
554
642
  * Definition of the field type for GraphQL - be aware if multiple values is selected.
@@ -566,13 +654,14 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
566
654
  * ```
567
655
  */
568
656
  createTypeField(params: {
657
+ models: CmsModel[];
569
658
  model: CmsModel;
570
- field: CmsModelField;
659
+ field: TField;
571
660
  fieldTypePlugins: CmsFieldTypePlugins;
572
661
  }): CmsModelFieldDefinition | string | null;
573
662
  /**
574
663
  * Definition for field resolver.
575
- * By default it is simple return of the `instance.values[storageId]` but if required, users can define their own.
664
+ * By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
576
665
  *
577
666
  * ```ts
578
667
  * read: {
@@ -584,7 +673,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
584
673
  * }
585
674
  * ```
586
675
  */
587
- createResolver?: CmsModelFieldToGraphQLCreateResolver;
676
+ createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
588
677
  /**
589
678
  * Read API schema definitions for the field and resolvers for them.
590
679
  *
@@ -627,7 +716,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
627
716
  */
628
717
  createListFilters?: (params: {
629
718
  model: CmsModel;
630
- field: CmsModelField;
719
+ field: TField;
720
+ plugins: CmsFieldTypePlugins;
631
721
  }) => string;
632
722
  /**
633
723
  * Manage API schema definitions for the field and resolvers for them. Probably similar to `read.createSchema`.
@@ -665,8 +755,9 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
665
755
  * ```
666
756
  */
667
757
  createTypeField: (params: {
758
+ models: CmsModel[];
668
759
  model: CmsModel;
669
- field: CmsModelField;
760
+ field: TField;
670
761
  fieldTypePlugins: CmsFieldTypePlugins;
671
762
  }) => CmsModelFieldDefinition | string | null;
672
763
  /**
@@ -685,13 +776,14 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
685
776
  * ```
686
777
  */
687
778
  createInputField: (params: {
779
+ models: CmsModel[];
688
780
  model: CmsModel;
689
- field: CmsModelField;
781
+ field: TField;
690
782
  fieldTypePlugins: CmsFieldTypePlugins;
691
783
  }) => CmsModelFieldDefinition | string | null;
692
784
  /**
693
785
  * Definition for field resolver.
694
- * By default it is simple return of the `instance.values[storageId]` but if required, users can define their own.
786
+ * By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
695
787
  *
696
788
  * ```ts
697
789
  * manage: {
@@ -703,8 +795,13 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
703
795
  * }
704
796
  * ```
705
797
  */
706
- createResolver?: CmsModelFieldToGraphQLCreateResolver;
798
+ createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
707
799
  };
800
+ /**
801
+ *
802
+ * @param field
803
+ */
804
+ validateChildFields?: CmsModelFieldToGraphQLPluginValidateChildFields<TField>;
708
805
  }
709
806
  /**
710
807
  * Check for content model locked field.
@@ -743,11 +840,11 @@ export interface CmsFieldTypePlugins {
743
840
  [key: string]: CmsModelFieldToGraphQLPlugin;
744
841
  }
745
842
  /**
746
- * A interface describing the reference to a user that created some data in the database.
843
+ * An interface describing the reference to a user that created some data in the database.
747
844
  *
748
845
  * @category General
749
846
  */
750
- export interface CreatedBy {
847
+ export interface CmsIdentity {
751
848
  /**
752
849
  * ID if the user.
753
850
  */
@@ -797,7 +894,7 @@ export interface CmsSettingsContext {
797
894
  /**
798
895
  * Get the datetime when content model last changed.
799
896
  */
800
- getModelLastChange: () => Promise<Date>;
897
+ getModelLastChange: () => Promise<Date | null>;
801
898
  }
802
899
  export interface OnSystemBeforeInstallTopicParams {
803
900
  tenant: string;
@@ -815,9 +912,7 @@ export interface OnSystemInstallErrorTopicParams {
815
912
  export declare type CmsSystemContext = {
816
913
  getSystemVersion: () => Promise<string | null>;
817
914
  setSystemVersion: (version: string) => Promise<void>;
818
- getReadAPIKey(): Promise<string | null>;
819
915
  installSystem: () => Promise<void>;
820
- upgradeSystem: (version: string) => Promise<boolean>;
821
916
  /**
822
917
  * Lifecycle events - deprecated
823
918
  */
@@ -837,7 +932,7 @@ export declare type CmsSystemContext = {
837
932
  onSystemInstallError: Topic<OnSystemInstallErrorTopicParams>;
838
933
  };
839
934
  /**
840
- * A GraphQL params.data parameter received when creating content model group.
935
+ * A GraphQL `params.data` parameter received when creating content model group.
841
936
  *
842
937
  * @category CmsGroup
843
938
  * @category GraphQL params
@@ -849,7 +944,7 @@ export interface CmsGroupCreateInput {
849
944
  icon: string;
850
945
  }
851
946
  /**
852
- * A GraphQL params.data parameter received when updating content model group.
947
+ * A GraphQL `params.data` parameter received when updating content model group.
853
948
  *
854
949
  * @category CmsGroup
855
950
  * @category GraphQL params
@@ -898,7 +993,7 @@ export interface CmsGroup {
898
993
  /**
899
994
  * CreatedBy reference object.
900
995
  */
901
- createdBy?: CreatedBy;
996
+ createdBy?: CmsIdentity;
902
997
  /**
903
998
  * Date group was created on.
904
999
  */
@@ -919,7 +1014,7 @@ export interface CmsGroup {
919
1014
  isPrivate?: boolean;
920
1015
  }
921
1016
  /**
922
- * A data.where parameter received when listing content model groups.
1017
+ * A `data.where` parameter received when listing content model groups.
923
1018
  *
924
1019
  * @category CmsGroup
925
1020
  * @category GraphQL params
@@ -945,6 +1040,15 @@ export interface OnGroupBeforeCreateTopicParams {
945
1040
  export interface OnGroupAfterCreateTopicParams {
946
1041
  group: CmsGroup;
947
1042
  }
1043
+ /**
1044
+ * @category CmsGroup
1045
+ * @category Topic
1046
+ */
1047
+ export interface OnGroupCreateErrorTopicParams {
1048
+ input: CmsGroupCreateInput;
1049
+ group: CmsGroup;
1050
+ error: Error;
1051
+ }
948
1052
  /**
949
1053
  * @category CmsGroup
950
1054
  * @category Topic
@@ -961,6 +1065,16 @@ export interface OnGroupAfterUpdateTopicParams {
961
1065
  original: CmsGroup;
962
1066
  group: CmsGroup;
963
1067
  }
1068
+ /**
1069
+ * @category CmsGroup
1070
+ * @category Topic
1071
+ */
1072
+ export interface OnGroupUpdateErrorTopicParams {
1073
+ input: CmsGroupUpdateInput;
1074
+ original: CmsGroup;
1075
+ group: CmsGroup;
1076
+ error: Error;
1077
+ }
964
1078
  /**
965
1079
  * @category CmsGroup
966
1080
  * @category Topic
@@ -975,6 +1089,14 @@ export interface OnGroupBeforeDeleteTopicParams {
975
1089
  export interface OnGroupAfterDeleteTopicParams {
976
1090
  group: CmsGroup;
977
1091
  }
1092
+ /**
1093
+ * @category CmsGroup
1094
+ * @category Topic
1095
+ */
1096
+ export interface OnGroupDeleteErrorTopicParams {
1097
+ group: CmsGroup;
1098
+ error: Error;
1099
+ }
978
1100
  /**
979
1101
  * Cms Group in context.
980
1102
  *
@@ -1038,10 +1160,13 @@ export interface CmsGroupContext {
1038
1160
  */
1039
1161
  onGroupBeforeCreate: Topic<OnGroupBeforeCreateTopicParams>;
1040
1162
  onGroupAfterCreate: Topic<OnGroupAfterCreateTopicParams>;
1163
+ onGroupCreateError: Topic<OnGroupCreateErrorTopicParams>;
1041
1164
  onGroupBeforeUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
1042
1165
  onGroupAfterUpdate: Topic<OnGroupAfterUpdateTopicParams>;
1166
+ onGroupUpdateError: Topic<OnGroupUpdateErrorTopicParams>;
1043
1167
  onGroupBeforeDelete: Topic<OnGroupBeforeDeleteTopicParams>;
1044
1168
  onGroupAfterDelete: Topic<OnGroupAfterDeleteTopicParams>;
1169
+ onGroupDeleteError: Topic<OnGroupDeleteErrorTopicParams>;
1045
1170
  }
1046
1171
  /**
1047
1172
  * Definition for content model field validator.
@@ -1060,7 +1185,7 @@ export interface CmsModelFieldValidation {
1060
1185
  };
1061
1186
  }
1062
1187
  /**
1063
- * A GraphQL params.data parameter received when creating content model.
1188
+ * A GraphQL `params.data` parameter received when creating content model.
1064
1189
  *
1065
1190
  * @category GraphQL params
1066
1191
  * @category CmsModel
@@ -1070,6 +1195,14 @@ export interface CmsModelCreateInput {
1070
1195
  * Name of the content model.
1071
1196
  */
1072
1197
  name: string;
1198
+ /**
1199
+ * Singular name of the content model to be used in the API.
1200
+ */
1201
+ singularApiName: string;
1202
+ /**
1203
+ * Plural name of the content model to be used in the API.
1204
+ */
1205
+ pluralApiName: string;
1073
1206
  /**
1074
1207
  * Unique ID of the content model. Created from name if not sent by the user. Cannot be changed.
1075
1208
  */
@@ -1077,7 +1210,7 @@ export interface CmsModelCreateInput {
1077
1210
  /**
1078
1211
  * Description of the content model.
1079
1212
  */
1080
- description?: string;
1213
+ description?: string | null;
1081
1214
  /**
1082
1215
  * Group where to put the content model in.
1083
1216
  */
@@ -1098,13 +1231,18 @@ export interface CmsModelCreateInput {
1098
1231
  */
1099
1232
  layout?: string[][];
1100
1233
  /**
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.
1234
+ * Models can be tagged to give them contextual meaning.
1235
+ */
1236
+ tags?: string[];
1237
+ /**
1238
+ * Fields fieldId which are picked to represent the CMS entry.
1103
1239
  */
1104
- titleFieldId?: string;
1240
+ titleFieldId?: string | null;
1241
+ descriptionFieldId?: string | null;
1242
+ imageFieldId?: string | null;
1105
1243
  }
1106
1244
  /**
1107
- * A GraphQL params.data parameter received when creating content model from existing model.
1245
+ * A GraphQL `params.data` parameter received when creating content model from existing model.
1108
1246
  *
1109
1247
  * @category GraphQL params
1110
1248
  * @category CmsModel
@@ -1145,11 +1283,15 @@ export interface CmsModelFieldInput {
1145
1283
  /**
1146
1284
  * Text to display below the field to help user what to write in the field.
1147
1285
  */
1148
- helpText?: string;
1286
+ helpText?: string | null;
1149
1287
  /**
1150
1288
  * Text to display in the field.
1151
1289
  */
1152
- placeholderText?: string;
1290
+ placeholderText?: string | null;
1291
+ /**
1292
+ * Fields can be tagged to give them contextual meaning.
1293
+ */
1294
+ tags?: string[];
1153
1295
  /**
1154
1296
  * Are multiple values allowed?
1155
1297
  */
@@ -1169,14 +1311,14 @@ export interface CmsModelFieldInput {
1169
1311
  /**
1170
1312
  * @see CmsModelField.listValidation
1171
1313
  */
1172
- listValidation: CmsModelFieldValidation[];
1314
+ listValidation?: CmsModelFieldValidation[];
1173
1315
  /**
1174
1316
  * User defined settings.
1175
1317
  */
1176
1318
  settings?: Record<string, any>;
1177
1319
  }
1178
1320
  /**
1179
- * A GraphQL params.data parameter received when updating content model.
1321
+ * A GraphQL `params.data` parameter received when updating content model.
1180
1322
  *
1181
1323
  * @category GraphQL params
1182
1324
  * @category CmsModel
@@ -1186,6 +1328,14 @@ export interface CmsModelUpdateInput {
1186
1328
  * A new content model name.
1187
1329
  */
1188
1330
  name?: string;
1331
+ /**
1332
+ * A new singular name of the content model to be used in the API.
1333
+ */
1334
+ singularApiName?: string;
1335
+ /**
1336
+ * A new plural name of the content model to be used in the API.
1337
+ */
1338
+ pluralApiName?: string;
1189
1339
  /**
1190
1340
  * A group we want to move the model to.
1191
1341
  */
@@ -1193,7 +1343,7 @@ export interface CmsModelUpdateInput {
1193
1343
  /**
1194
1344
  * A new description of the content model.
1195
1345
  */
1196
- description?: string;
1346
+ description?: string | null;
1197
1347
  /**
1198
1348
  * A list of content model fields to define the entry values.
1199
1349
  */
@@ -1210,10 +1360,11 @@ export interface CmsModelUpdateInput {
1210
1360
  */
1211
1361
  layout: string[][];
1212
1362
  /**
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.
1363
+ * Fields fieldId which are picked to represent the CMS entry.
1215
1364
  */
1216
- titleFieldId?: string;
1365
+ titleFieldId?: string | null;
1366
+ descriptionFieldId?: string | null;
1367
+ imageFieldId?: string | null;
1217
1368
  }
1218
1369
  /**
1219
1370
  * A plugin to load a CmsModelManager.
@@ -1258,7 +1409,7 @@ export interface CmsEntryValues {
1258
1409
  export interface CmsEntry<T = CmsEntryValues> {
1259
1410
  /**
1260
1411
  * 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.
1412
+ * This can be used when upgrading the system, so we know which entries to update.
1262
1413
  */
1263
1414
  webinyVersion: string;
1264
1415
  /**
@@ -1277,11 +1428,15 @@ export interface CmsEntry<T = CmsEntryValues> {
1277
1428
  /**
1278
1429
  * CreatedBy object reference.
1279
1430
  */
1280
- createdBy: CreatedBy;
1431
+ createdBy: CmsIdentity;
1281
1432
  /**
1282
1433
  * OwnedBy object reference. Can be different from CreatedBy.
1283
1434
  */
1284
- ownedBy: CreatedBy;
1435
+ ownedBy: CmsIdentity;
1436
+ /**
1437
+ * ModifiedBy object reference. Last person who modified the entry.
1438
+ */
1439
+ modifiedBy?: CmsIdentity | null;
1285
1440
  /**
1286
1441
  * A string of Date.toISOString() type.
1287
1442
  * Populated on creation.
@@ -1328,10 +1483,10 @@ export interface CmsEntry<T = CmsEntryValues> {
1328
1483
  /**
1329
1484
  * Settings for the given entry.
1330
1485
  *
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.
1486
+ * Introduced with Advanced Publishing Workflow. Will always be inserted once this PR is merged.
1487
+ * Be aware that when accessing properties in it on old systems, it will break if not checked first.
1333
1488
  *
1334
- * Available only on the Manage API in entry GraphQL type meta.data property.
1489
+ * Available only on the Manage API in entry GraphQL type `meta.data` property.
1335
1490
  */
1336
1491
  meta?: {
1337
1492
  [key: string]: any;
@@ -1364,7 +1519,7 @@ export interface CmsModelManager {
1364
1519
  */
1365
1520
  getPublishedByIds: (ids: string[]) => Promise<CmsEntry[]>;
1366
1521
  /**
1367
- * Get a list of latest entries by the ID list.
1522
+ * Get a list of the latest entries by the ID list.
1368
1523
  */
1369
1524
  getLatestByIds: (ids: string[]) => Promise<CmsEntry[]>;
1370
1525
  /**
@@ -1372,18 +1527,21 @@ export interface CmsModelManager {
1372
1527
  */
1373
1528
  get: (id: string) => Promise<CmsEntry>;
1374
1529
  /**
1375
- * Create a entry.
1530
+ * Create an entry.
1376
1531
  */
1377
1532
  create: (data: CreateCmsEntryInput) => Promise<CmsEntry>;
1378
1533
  /**
1379
- * Update a entry.
1534
+ * Update an entry.
1380
1535
  */
1381
1536
  update: (id: string, data: UpdateCmsEntryInput) => Promise<CmsEntry>;
1382
1537
  /**
1383
- * Delete a entry.
1538
+ * Delete an entry.
1384
1539
  */
1385
1540
  delete: (id: string) => Promise<void>;
1386
1541
  }
1542
+ /**
1543
+ * Create
1544
+ */
1387
1545
  export interface OnModelBeforeCreateTopicParams {
1388
1546
  input: CmsModelCreateInput;
1389
1547
  model: CmsModel;
@@ -1392,6 +1550,14 @@ export interface OnModelAfterCreateTopicParams {
1392
1550
  input: CmsModelCreateInput;
1393
1551
  model: CmsModel;
1394
1552
  }
1553
+ export interface OnModelCreateErrorTopicParams {
1554
+ input: CmsModelCreateInput;
1555
+ model: CmsModel;
1556
+ error: Error;
1557
+ }
1558
+ /**
1559
+ * Create From / Clone
1560
+ */
1395
1561
  export interface OnModelBeforeCreateFromTopicParams {
1396
1562
  input: CmsModelCreateInput;
1397
1563
  original: CmsModel;
@@ -1402,6 +1568,15 @@ export interface OnModelAfterCreateFromTopicParams {
1402
1568
  original: CmsModel;
1403
1569
  model: CmsModel;
1404
1570
  }
1571
+ export interface OnModelCreateFromErrorParams {
1572
+ input: CmsModelCreateInput;
1573
+ original: CmsModel;
1574
+ model: CmsModel;
1575
+ error: Error;
1576
+ }
1577
+ /**
1578
+ * Update
1579
+ */
1405
1580
  export interface OnModelBeforeUpdateTopicParams {
1406
1581
  input: CmsModelUpdateInput;
1407
1582
  original: CmsModel;
@@ -1412,15 +1587,35 @@ export interface OnModelAfterUpdateTopicParams {
1412
1587
  original: CmsModel;
1413
1588
  model: CmsModel;
1414
1589
  }
1590
+ export interface OnModelUpdateErrorTopicParams {
1591
+ input: CmsModelUpdateInput;
1592
+ original: CmsModel;
1593
+ model: CmsModel;
1594
+ error: Error;
1595
+ }
1596
+ /**
1597
+ * Delete
1598
+ */
1415
1599
  export interface OnModelBeforeDeleteTopicParams {
1416
1600
  model: CmsModel;
1417
1601
  }
1418
1602
  export interface OnModelAfterDeleteTopicParams {
1419
1603
  model: CmsModel;
1420
1604
  }
1605
+ export interface OnModelDeleteErrorTopicParams {
1606
+ model: CmsModel;
1607
+ error: Error;
1608
+ }
1609
+ /**
1610
+ * Initialize
1611
+ */
1421
1612
  export interface OnModelInitializeParams {
1422
1613
  model: CmsModel;
1614
+ data: Record<string, any>;
1423
1615
  }
1616
+ /**
1617
+ *
1618
+ */
1424
1619
  export interface CmsModelUpdateDirectParams {
1425
1620
  model: CmsModel;
1426
1621
  original: CmsModel;
@@ -1467,9 +1662,9 @@ export interface CmsModelContext {
1467
1662
  *
1468
1663
  * Primary idea behind this is creating the index, for the code models, in the ES.
1469
1664
  */
1470
- initializeModel: (modelId: string) => Promise<boolean>;
1665
+ initializeModel: (modelId: string, data: Record<string, any>) => Promise<boolean>;
1471
1666
  /**
1472
- * Get a instance of CmsModelManager for given content modelId.
1667
+ * Get an instance of CmsModelManager for given content modelId.
1473
1668
  *
1474
1669
  * @see CmsModelManager
1475
1670
  *
@@ -1528,12 +1723,16 @@ export interface CmsModelContext {
1528
1723
  */
1529
1724
  onModelBeforeCreate: Topic<OnModelBeforeCreateTopicParams>;
1530
1725
  onModelAfterCreate: Topic<OnModelAfterCreateTopicParams>;
1726
+ onModelCreateError: Topic<OnModelCreateErrorTopicParams>;
1531
1727
  onModelBeforeCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
1532
1728
  onModelAfterCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
1729
+ onModelCreateFromError: Topic<OnModelCreateFromErrorParams>;
1533
1730
  onModelBeforeUpdate: Topic<OnModelBeforeUpdateTopicParams>;
1534
1731
  onModelAfterUpdate: Topic<OnModelAfterUpdateTopicParams>;
1732
+ onModelUpdateError: Topic<OnModelUpdateErrorTopicParams>;
1535
1733
  onModelBeforeDelete: Topic<OnModelBeforeDeleteTopicParams>;
1536
1734
  onModelAfterDelete: Topic<OnModelAfterDeleteTopicParams>;
1735
+ onModelDeleteError: Topic<OnModelDeleteErrorTopicParams>;
1537
1736
  onModelInitialize: Topic<OnModelInitializeParams>;
1538
1737
  }
1539
1738
  /**
@@ -1619,7 +1818,12 @@ export interface CmsEntryListWhere {
1619
1818
  /**
1620
1819
  * This is to allow querying by any content model field defined by the user.
1621
1820
  */
1622
- [key: string]: any | CmsEntryListWhereRef;
1821
+ [key: string]: string | number | boolean | undefined | string[] | number[] | null | CmsEntryListWhere[] | CmsEntryListWhere | CmsEntryListWhereRef;
1822
+ /**
1823
+ * To allow querying via nested queries, we added the AND / OR properties.
1824
+ */
1825
+ AND?: CmsEntryListWhere[];
1826
+ OR?: CmsEntryListWhere[];
1623
1827
  }
1624
1828
  /**
1625
1829
  * Entry listing sort.
@@ -1672,15 +1876,18 @@ export interface CmsEntryMeta {
1672
1876
  */
1673
1877
  totalCount: number;
1674
1878
  }
1879
+ /**
1880
+ * Create
1881
+ */
1675
1882
  export interface OnEntryBeforeCreateTopicParams {
1676
1883
  input: CreateCmsEntryInput;
1677
1884
  entry: CmsEntry;
1678
- model: StorageOperationsCmsModel;
1885
+ model: CmsModel;
1679
1886
  }
1680
1887
  export interface OnEntryAfterCreateTopicParams {
1681
1888
  input: CreateCmsEntryInput;
1682
1889
  entry: CmsEntry;
1683
- model: StorageOperationsCmsModel;
1890
+ model: CmsModel;
1684
1891
  storageEntry: CmsEntry;
1685
1892
  }
1686
1893
  export interface OnEntryCreateErrorTopicParams {
@@ -1689,36 +1896,43 @@ export interface OnEntryCreateErrorTopicParams {
1689
1896
  entry: CmsEntry;
1690
1897
  model: CmsModel;
1691
1898
  }
1899
+ /**
1900
+ * Revision Create
1901
+ */
1692
1902
  export interface OnEntryRevisionBeforeCreateTopicParams {
1693
1903
  input: CreateFromCmsEntryInput;
1694
1904
  entry: CmsEntry;
1695
1905
  original: CmsEntry;
1696
- model: StorageOperationsCmsModel;
1906
+ model: CmsModel;
1697
1907
  }
1698
1908
  export interface OnEntryRevisionAfterCreateTopicParams {
1699
1909
  input: CreateFromCmsEntryInput;
1700
1910
  entry: CmsEntry;
1701
1911
  original: CmsEntry;
1702
- model: StorageOperationsCmsModel;
1912
+ model: CmsModel;
1703
1913
  storageEntry: CmsEntry;
1704
1914
  }
1705
1915
  export interface OnEntryCreateRevisionErrorTopicParams {
1706
1916
  error: Error;
1707
1917
  input: CreateFromCmsEntryInput;
1918
+ original: CmsEntry;
1708
1919
  entry: CmsEntry;
1709
1920
  model: CmsModel;
1710
1921
  }
1922
+ /**
1923
+ * Update
1924
+ */
1711
1925
  export interface OnEntryBeforeUpdateTopicParams {
1712
1926
  input: UpdateCmsEntryInput;
1713
1927
  original: CmsEntry;
1714
1928
  entry: CmsEntry;
1715
- model: StorageOperationsCmsModel;
1929
+ model: CmsModel;
1716
1930
  }
1717
1931
  export interface OnEntryAfterUpdateTopicParams {
1718
1932
  input: UpdateCmsEntryInput;
1719
1933
  original: CmsEntry;
1720
1934
  entry: CmsEntry;
1721
- model: StorageOperationsCmsModel;
1935
+ model: CmsModel;
1722
1936
  storageEntry: CmsEntry;
1723
1937
  }
1724
1938
  export interface OnEntryUpdateErrorTopicParams {
@@ -1727,27 +1941,50 @@ export interface OnEntryUpdateErrorTopicParams {
1727
1941
  entry: CmsEntry;
1728
1942
  model: CmsModel;
1729
1943
  }
1944
+ /**
1945
+ * Publish
1946
+ */
1730
1947
  export interface OnEntryBeforePublishTopicParams {
1731
1948
  entry: CmsEntry;
1732
- model: StorageOperationsCmsModel;
1949
+ model: CmsModel;
1733
1950
  }
1734
1951
  export interface OnEntryAfterPublishTopicParams {
1735
1952
  entry: CmsEntry;
1736
- model: StorageOperationsCmsModel;
1953
+ model: CmsModel;
1737
1954
  storageEntry: CmsEntry;
1738
1955
  }
1739
1956
  export interface OnEntryPublishErrorTopicParams {
1740
1957
  error: Error;
1741
1958
  entry: CmsEntry;
1742
- model: StorageOperationsCmsModel;
1959
+ model: CmsModel;
1960
+ }
1961
+ /**
1962
+ * Republish
1963
+ */
1964
+ export interface OnEntryBeforeRepublishTopicParams {
1965
+ entry: CmsEntry;
1966
+ model: CmsModel;
1743
1967
  }
1968
+ export interface OnEntryAfterRepublishTopicParams {
1969
+ entry: CmsEntry;
1970
+ model: CmsModel;
1971
+ storageEntry: CmsEntry;
1972
+ }
1973
+ export interface OnEntryRepublishErrorTopicParams {
1974
+ error: Error;
1975
+ entry: CmsEntry;
1976
+ model: CmsModel;
1977
+ }
1978
+ /**
1979
+ * Unpublish
1980
+ */
1744
1981
  export interface OnEntryBeforeUnpublishTopicParams {
1745
1982
  entry: CmsEntry;
1746
- model: StorageOperationsCmsModel;
1983
+ model: CmsModel;
1747
1984
  }
1748
1985
  export interface OnEntryAfterUnpublishTopicParams {
1749
1986
  entry: CmsEntry;
1750
- model: StorageOperationsCmsModel;
1987
+ model: CmsModel;
1751
1988
  storageEntry: CmsEntry;
1752
1989
  }
1753
1990
  export interface OnEntryUnpublishErrorTopicParams {
@@ -1757,43 +1994,44 @@ export interface OnEntryUnpublishErrorTopicParams {
1757
1994
  }
1758
1995
  export interface OnEntryBeforeDeleteTopicParams {
1759
1996
  entry: CmsEntry;
1760
- model: StorageOperationsCmsModel;
1997
+ model: CmsModel;
1761
1998
  }
1762
1999
  export interface OnEntryAfterDeleteTopicParams {
1763
2000
  entry: CmsEntry;
1764
- model: StorageOperationsCmsModel;
2001
+ model: CmsModel;
1765
2002
  }
1766
2003
  export interface OnEntryDeleteErrorTopicParams {
1767
2004
  error: Error;
1768
2005
  entry: CmsEntry;
1769
- model: StorageOperationsCmsModel;
2006
+ model: CmsModel;
1770
2007
  }
1771
2008
  export interface OnEntryRevisionBeforeDeleteTopicParams {
1772
2009
  entry: CmsEntry;
1773
- model: StorageOperationsCmsModel;
2010
+ model: CmsModel;
1774
2011
  }
1775
2012
  export interface OnEntryRevisionAfterDeleteTopicParams {
1776
2013
  entry: CmsEntry;
1777
- model: StorageOperationsCmsModel;
2014
+ model: CmsModel;
1778
2015
  }
1779
2016
  export interface OnEntryRevisionDeleteErrorTopicParams {
1780
2017
  error: Error;
1781
2018
  entry: CmsEntry;
1782
- model: StorageOperationsCmsModel;
2019
+ model: CmsModel;
1783
2020
  }
1784
2021
  export interface OnEntryBeforeGetTopicParams {
1785
- model: StorageOperationsCmsModel;
2022
+ model: CmsModel;
1786
2023
  where: CmsEntryListWhere;
1787
2024
  }
1788
2025
  export interface EntryBeforeListTopicParams {
1789
2026
  where: CmsEntryListWhere;
1790
- model: StorageOperationsCmsModel;
2027
+ model: CmsModel;
1791
2028
  }
1792
2029
  /**
1793
2030
  * @category Context
1794
2031
  * @category CmsEntry
1795
2032
  */
1796
2033
  export interface CreateCmsEntryInput {
2034
+ id?: string;
1797
2035
  [key: string]: any;
1798
2036
  }
1799
2037
  /**
@@ -1834,7 +2072,7 @@ export interface CmsEntryContext {
1834
2072
  */
1835
2073
  listEntries: (model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1836
2074
  /**
1837
- * Lists latest entries. Used for manage API.
2075
+ * Lists the latest entries. Used for manage API.
1838
2076
  */
1839
2077
  listLatestEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
1840
2078
  /**
@@ -1974,6 +2212,9 @@ export interface CmsEntryContext {
1974
2212
  onEntryBeforePublish: Topic<OnEntryBeforePublishTopicParams>;
1975
2213
  onEntryAfterPublish: Topic<OnEntryAfterPublishTopicParams>;
1976
2214
  onEntryPublishError: Topic<OnEntryPublishErrorTopicParams>;
2215
+ onEntryBeforeRepublish: Topic<OnEntryBeforeRepublishTopicParams>;
2216
+ onEntryAfterRepublish: Topic<OnEntryAfterRepublishTopicParams>;
2217
+ onEntryRepublishError: Topic<OnEntryRepublishErrorTopicParams>;
1977
2218
  onEntryBeforeUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
1978
2219
  onEntryAfterUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
1979
2220
  onEntryUnpublishError: Topic<OnEntryUnpublishErrorTopicParams>;
@@ -2022,13 +2263,13 @@ export interface BaseCmsSecurityPermission extends SecurityPermission {
2022
2263
  */
2023
2264
  export interface CmsModelPermission extends BaseCmsSecurityPermission {
2024
2265
  /**
2025
- * A object representing `key: model.modelId` values where key is locale code.
2266
+ * An object representing `key: model.modelId` values where key is locale code.
2026
2267
  */
2027
2268
  models?: {
2028
2269
  [key: string]: string[];
2029
2270
  };
2030
2271
  /**
2031
- * A object representing `key: group.id` values where key is locale code.
2272
+ * {locale: groupId[]} map, where key is a locale code.
2032
2273
  */
2033
2274
  groups?: {
2034
2275
  [key: string]: string[];
@@ -2042,7 +2283,7 @@ export interface CmsModelPermission extends BaseCmsSecurityPermission {
2042
2283
  */
2043
2284
  export interface CmsGroupPermission extends BaseCmsSecurityPermission {
2044
2285
  /**
2045
- * A object representing `key: group.id` values where key is locale code.
2286
+ * {locale: groupId[]} map, where key is a locale code.
2046
2287
  */
2047
2288
  groups?: {
2048
2289
  [key: string]: string[];
@@ -2057,13 +2298,13 @@ export interface CmsGroupPermission extends BaseCmsSecurityPermission {
2057
2298
  export interface CmsEntryPermission extends BaseCmsSecurityPermission {
2058
2299
  pw?: string;
2059
2300
  /**
2060
- * A object representing `key: model.modelId` values where key is locale code.
2301
+ * An object representing `key: model.modelId` values where key is locale code.
2061
2302
  */
2062
2303
  models?: {
2063
2304
  [key: string]: string[];
2064
2305
  };
2065
2306
  /**
2066
- * A object representing `key: group.id` values where key is locale code.
2307
+ * {locale: groupId[]} map, where key is a locale code.
2067
2308
  */
2068
2309
  groups?: {
2069
2310
  [key: string]: string[];
@@ -2178,7 +2419,7 @@ export interface CmsEntryStorageOperationsListParams {
2178
2419
  sort?: CmsEntryListSort;
2179
2420
  search?: string;
2180
2421
  fields?: string[];
2181
- limit?: number;
2422
+ limit: number;
2182
2423
  after?: string | null;
2183
2424
  }
2184
2425
  export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry = CmsStorageEntry> {
@@ -2312,71 +2553,71 @@ export interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorag
2312
2553
  /**
2313
2554
  * Get all the entries of the ids.
2314
2555
  */
2315
- getByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
2556
+ getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
2316
2557
  /**
2317
2558
  * Get all the published entries of the ids.
2318
2559
  */
2319
- getPublishedByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
2560
+ getPublishedByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
2320
2561
  /**
2321
2562
  * Get all the latest entries of the ids.
2322
2563
  */
2323
- getLatestByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
2564
+ getLatestByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
2324
2565
  /**
2325
2566
  * Get all revisions of the given entry id.
2326
2567
  */
2327
- getRevisions: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
2568
+ getRevisions: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
2328
2569
  /**
2329
2570
  * Get the entry by the given revision id.
2330
2571
  */
2331
- getRevisionById: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
2572
+ getRevisionById: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
2332
2573
  /**
2333
2574
  * Get the published entry by given entryId.
2334
2575
  */
2335
- getPublishedRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
2576
+ getPublishedRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
2336
2577
  /**
2337
2578
  * Get the latest entry by given entryId.
2338
2579
  */
2339
- getLatestRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
2580
+ getLatestRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
2340
2581
  /**
2341
2582
  * Get the revision of the entry before given one.
2342
2583
  */
2343
- getPreviousRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
2584
+ getPreviousRevision: (model: CmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
2344
2585
  /**
2345
2586
  * Gets entry by given params.
2346
2587
  */
2347
- get: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
2588
+ get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
2348
2589
  /**
2349
2590
  * List all entries. Filterable via params.
2350
2591
  */
2351
- list: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
2592
+ list: (model: CmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
2352
2593
  /**
2353
2594
  * Create a new entry.
2354
2595
  */
2355
- create: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
2596
+ create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
2356
2597
  /**
2357
2598
  * Create a new entry from existing one.
2358
2599
  */
2359
- createRevisionFrom: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
2600
+ createRevisionFrom: (model: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
2360
2601
  /**
2361
2602
  * Update existing entry.
2362
2603
  */
2363
- update: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
2604
+ update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
2364
2605
  /**
2365
2606
  * Delete the entry revision.
2366
2607
  */
2367
- deleteRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
2608
+ deleteRevision: (model: CmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
2368
2609
  /**
2369
2610
  * Delete the entry.
2370
2611
  */
2371
- delete: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
2612
+ delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
2372
2613
  /**
2373
2614
  * Publish the entry.
2374
2615
  */
2375
- publish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
2616
+ publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
2376
2617
  /**
2377
2618
  * Unpublish the entry.
2378
2619
  */
2379
- unpublish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
2620
+ unpublish: (model: CmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
2380
2621
  }
2381
2622
  export declare enum CONTENT_ENTRY_STATUS {
2382
2623
  DRAFT = "draft",
@@ -2439,6 +2680,7 @@ export interface CmsSystemStorageOperations {
2439
2680
  update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;
2440
2681
  }
2441
2682
  export interface HeadlessCmsStorageOperations<C = CmsContext> {
2683
+ name: string;
2442
2684
  system: CmsSystemStorageOperations;
2443
2685
  settings: CmsSettingsStorageOperations;
2444
2686
  groups: CmsGroupStorageOperations;
@@ -2447,11 +2689,7 @@ export interface HeadlessCmsStorageOperations<C = CmsContext> {
2447
2689
  /**
2448
2690
  * Either attach something from the storage operations or run something in it.
2449
2691
  */
2450
- beforeInit?: (context: C) => Promise<void>;
2692
+ beforeInit: (context: C) => Promise<void>;
2451
2693
  init?: (context: C) => Promise<void>;
2452
- /**
2453
- * An upgrade to run if necessary.
2454
- */
2455
- upgrade?: UpgradePlugin | null;
2456
2694
  }
2457
2695
  export {};