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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/content/contextSetup.js +1 -2
  2. package/content/graphQLHandlerFactory.d.ts +1 -2
  3. package/content/graphQLHandlerFactory.js +12 -4
  4. package/content/plugins/CmsGroupPlugin.d.ts +11 -0
  5. package/content/plugins/{ContentModelGroupPlugin.js → CmsGroupPlugin.js} +4 -5
  6. package/content/plugins/CmsModelPlugin.d.ts +11 -0
  7. package/content/plugins/{ContentModelPlugin.js → CmsModelPlugin.js} +4 -5
  8. package/content/plugins/buildSchemaPlugins.js +1 -2
  9. package/content/plugins/crud/contentEntry/beforeCreate.d.ts +7 -0
  10. package/content/plugins/crud/contentEntry/beforeCreate.js +28 -0
  11. package/content/plugins/crud/contentEntry/beforeUpdate.d.ts +7 -0
  12. package/content/plugins/crud/contentEntry/beforeUpdate.js +28 -0
  13. package/content/plugins/crud/contentEntry/entryDataValidation.d.ts +2 -2
  14. package/content/plugins/crud/contentEntry/entryDataValidation.js +1 -2
  15. package/content/plugins/crud/contentEntry/markLockedFields.d.ts +3 -3
  16. package/content/plugins/crud/contentEntry/markLockedFields.js +10 -7
  17. package/content/plugins/crud/contentEntry.crud.d.ts +12 -4
  18. package/content/plugins/crud/contentEntry.crud.js +807 -757
  19. package/content/plugins/crud/contentModel/afterCreate.d.ts +7 -0
  20. package/content/plugins/crud/contentModel/afterCreate.js +18 -0
  21. package/content/plugins/crud/contentModel/afterDelete.d.ts +7 -0
  22. package/content/plugins/crud/contentModel/afterDelete.js +18 -0
  23. package/content/plugins/crud/contentModel/afterUpdate.d.ts +7 -0
  24. package/content/plugins/crud/contentModel/afterUpdate.js +18 -0
  25. package/content/plugins/crud/contentModel/beforeCreate.d.ts +9 -0
  26. package/content/plugins/crud/contentModel/beforeCreate.js +146 -0
  27. package/content/plugins/crud/contentModel/beforeDelete.d.ts +9 -0
  28. package/content/plugins/crud/contentModel/beforeDelete.js +56 -0
  29. package/content/plugins/crud/contentModel/beforeUpdate.d.ts +9 -0
  30. package/content/plugins/crud/contentModel/beforeUpdate.js +128 -0
  31. package/content/plugins/crud/contentModel/contentModelManagerFactory.d.ts +2 -2
  32. package/content/plugins/crud/contentModel/contentModelManagerFactory.js +2 -3
  33. package/content/plugins/crud/contentModel/createFieldModels.d.ts +2 -2
  34. package/content/plugins/crud/contentModel/createFieldModels.js +2 -3
  35. package/content/plugins/crud/contentModel/idValidation.js +1 -2
  36. package/content/plugins/crud/contentModel/models.js +1 -2
  37. package/content/plugins/crud/contentModel/validateLayout.d.ts +2 -2
  38. package/content/plugins/crud/contentModel/validateLayout.js +1 -2
  39. package/content/plugins/crud/contentModel.crud.d.ts +12 -4
  40. package/content/plugins/crud/contentModel.crud.js +351 -279
  41. package/content/plugins/crud/contentModelGroup/beforeCreate.d.ts +9 -0
  42. package/content/plugins/crud/contentModelGroup/beforeCreate.js +66 -0
  43. package/content/plugins/crud/contentModelGroup/beforeDelete.d.ts +9 -0
  44. package/content/plugins/crud/contentModelGroup/beforeDelete.js +48 -0
  45. package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +8 -0
  46. package/content/plugins/crud/contentModelGroup/beforeUpdate.js +28 -0
  47. package/content/plugins/crud/contentModelGroup.crud.d.ts +12 -4
  48. package/content/plugins/crud/contentModelGroup.crud.js +259 -219
  49. package/content/plugins/crud/index.d.ts +6 -0
  50. package/content/plugins/crud/index.js +96 -0
  51. package/content/plugins/graphqlFields/boolean.js +1 -2
  52. package/content/plugins/graphqlFields/datetime.js +1 -2
  53. package/content/plugins/graphqlFields/file.js +1 -2
  54. package/content/plugins/graphqlFields/index.js +1 -2
  55. package/content/plugins/graphqlFields/longText.js +1 -2
  56. package/content/plugins/graphqlFields/number.js +1 -2
  57. package/content/plugins/graphqlFields/object.js +1 -2
  58. package/content/plugins/graphqlFields/ref.js +22 -11
  59. package/content/plugins/graphqlFields/richText.js +1 -2
  60. package/content/plugins/graphqlFields/text.js +1 -2
  61. package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +2 -3
  62. package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +1 -2
  63. package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +15 -0
  64. package/content/plugins/modelManager/DefaultCmsModelManager.js +62 -0
  65. package/content/plugins/modelManager/index.d.ts +2 -2
  66. package/content/plugins/modelManager/index.js +3 -4
  67. package/content/plugins/schema/baseSchema.js +1 -2
  68. package/content/plugins/schema/contentEntries.js +9 -10
  69. package/content/plugins/schema/contentModelGroups.js +13 -14
  70. package/content/plugins/schema/contentModels.js +9 -10
  71. package/content/plugins/schema/createFieldResolvers.d.ts +2 -2
  72. package/content/plugins/schema/createFieldResolvers.js +14 -20
  73. package/content/plugins/schema/createManageResolvers.d.ts +3 -3
  74. package/content/plugins/schema/createManageResolvers.js +6 -10
  75. package/content/plugins/schema/createManageSDL.d.ts +2 -2
  76. package/content/plugins/schema/createManageSDL.js +5 -6
  77. package/content/plugins/schema/createPreviewResolvers.d.ts +3 -3
  78. package/content/plugins/schema/createPreviewResolvers.js +5 -6
  79. package/content/plugins/schema/createReadResolvers.d.ts +3 -3
  80. package/content/plugins/schema/createReadResolvers.js +5 -6
  81. package/content/plugins/schema/createReadSDL.d.ts +2 -2
  82. package/content/plugins/schema/createReadSDL.js +3 -4
  83. package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +4 -4
  84. package/content/plugins/schema/resolvers/commonFieldResolvers.js +1 -2
  85. package/content/plugins/schema/resolvers/manage/resolveCreate.d.ts +1 -1
  86. package/content/plugins/schema/resolvers/manage/resolveCreate.js +3 -4
  87. package/content/plugins/schema/resolvers/manage/resolveCreateFrom.d.ts +1 -1
  88. package/content/plugins/schema/resolvers/manage/resolveCreateFrom.js +3 -4
  89. package/content/plugins/schema/resolvers/manage/resolveDelete.d.ts +1 -1
  90. package/content/plugins/schema/resolvers/manage/resolveDelete.js +4 -5
  91. package/content/plugins/schema/resolvers/manage/resolveGet.d.ts +1 -1
  92. package/content/plugins/schema/resolvers/manage/resolveGet.js +3 -4
  93. package/content/plugins/schema/resolvers/manage/resolveGetByIds.d.ts +1 -1
  94. package/content/plugins/schema/resolvers/manage/resolveGetByIds.js +3 -4
  95. package/content/plugins/schema/resolvers/manage/resolveGetRevisions.d.ts +1 -1
  96. package/content/plugins/schema/resolvers/manage/resolveGetRevisions.js +3 -4
  97. package/content/plugins/schema/resolvers/manage/resolveList.d.ts +1 -1
  98. package/content/plugins/schema/resolvers/manage/resolveList.js +3 -4
  99. package/content/plugins/schema/resolvers/manage/resolvePublish.d.ts +1 -1
  100. package/content/plugins/schema/resolvers/manage/resolvePublish.js +3 -4
  101. package/content/plugins/schema/resolvers/manage/resolveRequestChanges.d.ts +1 -1
  102. package/content/plugins/schema/resolvers/manage/resolveRequestChanges.js +3 -4
  103. package/content/plugins/schema/resolvers/manage/resolveRequestReview.d.ts +1 -1
  104. package/content/plugins/schema/resolvers/manage/resolveRequestReview.js +3 -4
  105. package/content/plugins/schema/resolvers/manage/resolveUnpublish.d.ts +1 -1
  106. package/content/plugins/schema/resolvers/manage/resolveUnpublish.js +3 -4
  107. package/content/plugins/schema/resolvers/manage/resolveUpdate.d.ts +1 -1
  108. package/content/plugins/schema/resolvers/manage/resolveUpdate.js +3 -4
  109. package/content/plugins/schema/resolvers/preview/resolveGet.d.ts +1 -1
  110. package/content/plugins/schema/resolvers/preview/resolveGet.js +3 -4
  111. package/content/plugins/schema/resolvers/preview/resolveList.d.ts +1 -1
  112. package/content/plugins/schema/resolvers/preview/resolveList.js +3 -4
  113. package/content/plugins/schema/resolvers/read/resolveGet.d.ts +1 -1
  114. package/content/plugins/schema/resolvers/read/resolveGet.js +3 -4
  115. package/content/plugins/schema/resolvers/read/resolveList.d.ts +1 -1
  116. package/content/plugins/schema/resolvers/read/resolveList.js +3 -4
  117. package/content/plugins/schema/schemaPlugins.js +4 -3
  118. package/content/plugins/storage/StorageTransformPlugin.d.ts +30 -0
  119. package/content/plugins/storage/StorageTransformPlugin.js +36 -0
  120. package/content/plugins/storage/default.d.ts +2 -2
  121. package/content/plugins/storage/default.js +12 -12
  122. package/content/plugins/storage/object.d.ts +2 -2
  123. package/content/plugins/storage/object.js +28 -29
  124. package/content/plugins/utils/createTypeName.js +1 -2
  125. package/content/plugins/utils/entryStorage.d.ts +5 -5
  126. package/content/plugins/utils/entryStorage.js +21 -14
  127. package/content/plugins/utils/getEntryTitle.d.ts +2 -2
  128. package/content/plugins/utils/getEntryTitle.js +1 -2
  129. package/content/plugins/utils/getSchemaFromFieldPlugins.d.ts +2 -2
  130. package/content/plugins/utils/getSchemaFromFieldPlugins.js +1 -2
  131. package/content/plugins/utils/pluralizedTypeName.js +1 -2
  132. package/content/plugins/utils/renderFields.d.ts +2 -2
  133. package/content/plugins/utils/renderFields.js +1 -2
  134. package/content/plugins/utils/renderGetFilterFields.d.ts +2 -2
  135. package/content/plugins/utils/renderGetFilterFields.js +1 -2
  136. package/content/plugins/utils/renderInputFields.d.ts +2 -2
  137. package/content/plugins/utils/renderInputFields.js +1 -2
  138. package/content/plugins/utils/renderListFilterFields.d.ts +2 -2
  139. package/content/plugins/utils/renderListFilterFields.js +1 -2
  140. package/content/plugins/utils/renderSortEnum.d.ts +2 -2
  141. package/content/plugins/utils/renderSortEnum.js +1 -2
  142. package/content/plugins/validators/dateGte.js +1 -2
  143. package/content/plugins/validators/dateLte.js +1 -2
  144. package/content/plugins/validators/gte.js +1 -2
  145. package/content/plugins/validators/in.js +1 -2
  146. package/content/plugins/validators/index.js +1 -2
  147. package/content/plugins/validators/lte.js +1 -2
  148. package/content/plugins/validators/maxLength.js +1 -2
  149. package/content/plugins/validators/minLength.js +1 -2
  150. package/content/plugins/validators/pattern.js +1 -2
  151. package/content/plugins/validators/patternPlugins/email.js +1 -2
  152. package/content/plugins/validators/patternPlugins/index.js +1 -2
  153. package/content/plugins/validators/patternPlugins/lowerCase.js +1 -2
  154. package/content/plugins/validators/patternPlugins/upperCase.js +1 -2
  155. package/content/plugins/validators/patternPlugins/url.js +1 -2
  156. package/content/plugins/validators/required.js +1 -2
  157. package/content/plugins/validators/timeGte.js +1 -2
  158. package/content/plugins/validators/timeLte.js +1 -2
  159. package/index.d.ts +12 -0
  160. package/index.js +66 -0
  161. package/migrateCMSPermissions.d.ts +2 -2
  162. package/migrateCMSPermissions.js +1 -2
  163. package/package.json +23 -21
  164. package/plugins/context.js +1 -2
  165. package/plugins/crud/index.d.ts +6 -2
  166. package/plugins/crud/index.js +69 -6
  167. package/plugins/crud/settings.crud.d.ts +10 -4
  168. package/plugins/crud/settings.crud.js +64 -77
  169. package/plugins/crud/system.crud.d.ts +10 -4
  170. package/plugins/crud/system.crud.js +139 -126
  171. package/plugins/graphql/system.js +5 -6
  172. package/plugins/graphql.d.ts +1 -2
  173. package/plugins/graphql.js +49 -50
  174. package/plugins/upgrades/index.js +1 -2
  175. package/plugins/upgrades/v5.5.0/helpers.js +1 -2
  176. package/plugins/upgrades/v5.5.0/index.js +3 -4
  177. package/transformers.js +1 -2
  178. package/types.d.ts +742 -1232
  179. package/types.js +104 -254
  180. package/utils.d.ts +4 -11
  181. package/utils.js +2 -49
  182. package/content/contextSetup.js.map +0 -1
  183. package/content/graphQLHandlerFactory.js.map +0 -1
  184. package/content/index.d.ts +0 -5
  185. package/content/index.js +0 -37
  186. package/content/index.js.map +0 -1
  187. package/content/plugins/ContentModelGroupPlugin.d.ts +0 -7
  188. package/content/plugins/ContentModelGroupPlugin.js.map +0 -1
  189. package/content/plugins/ContentModelPlugin.d.ts +0 -7
  190. package/content/plugins/ContentModelPlugin.js.map +0 -1
  191. package/content/plugins/buildSchemaPlugins.js.map +0 -1
  192. package/content/plugins/crud/contentEntry/afterCreate.hook.d.ts +0 -2
  193. package/content/plugins/crud/contentEntry/afterCreate.hook.js +0 -15
  194. package/content/plugins/crud/contentEntry/afterCreate.hook.js.map +0 -1
  195. package/content/plugins/crud/contentEntry/afterCreateRevisionFrom.hook.d.ts +0 -2
  196. package/content/plugins/crud/contentEntry/afterCreateRevisionFrom.hook.js +0 -15
  197. package/content/plugins/crud/contentEntry/afterCreateRevisionFrom.hook.js.map +0 -1
  198. package/content/plugins/crud/contentEntry/afterDelete.hook.d.ts +0 -2
  199. package/content/plugins/crud/contentEntry/afterDelete.hook.js +0 -15
  200. package/content/plugins/crud/contentEntry/afterDelete.hook.js.map +0 -1
  201. package/content/plugins/crud/contentEntry/afterDeleteRevision.hook.d.ts +0 -2
  202. package/content/plugins/crud/contentEntry/afterDeleteRevision.hook.js +0 -15
  203. package/content/plugins/crud/contentEntry/afterDeleteRevision.hook.js.map +0 -1
  204. package/content/plugins/crud/contentEntry/afterPublish.hook.d.ts +0 -2
  205. package/content/plugins/crud/contentEntry/afterPublish.hook.js +0 -15
  206. package/content/plugins/crud/contentEntry/afterPublish.hook.js.map +0 -1
  207. package/content/plugins/crud/contentEntry/afterRequestChanges.hook.d.ts +0 -2
  208. package/content/plugins/crud/contentEntry/afterRequestChanges.hook.js +0 -15
  209. package/content/plugins/crud/contentEntry/afterRequestChanges.hook.js.map +0 -1
  210. package/content/plugins/crud/contentEntry/afterRequestReview.hook.d.ts +0 -2
  211. package/content/plugins/crud/contentEntry/afterRequestReview.hook.js +0 -15
  212. package/content/plugins/crud/contentEntry/afterRequestReview.hook.js.map +0 -1
  213. package/content/plugins/crud/contentEntry/afterUnpublish.hook.d.ts +0 -2
  214. package/content/plugins/crud/contentEntry/afterUnpublish.hook.js +0 -15
  215. package/content/plugins/crud/contentEntry/afterUnpublish.hook.js.map +0 -1
  216. package/content/plugins/crud/contentEntry/afterUpdate.hook.d.ts +0 -2
  217. package/content/plugins/crud/contentEntry/afterUpdate.hook.js +0 -15
  218. package/content/plugins/crud/contentEntry/afterUpdate.hook.js.map +0 -1
  219. package/content/plugins/crud/contentEntry/beforeCreate.hook.d.ts +0 -2
  220. package/content/plugins/crud/contentEntry/beforeCreate.hook.js +0 -18
  221. package/content/plugins/crud/contentEntry/beforeCreate.hook.js.map +0 -1
  222. package/content/plugins/crud/contentEntry/beforeCreateRevisionFrom.hook.d.ts +0 -2
  223. package/content/plugins/crud/contentEntry/beforeCreateRevisionFrom.hook.js +0 -15
  224. package/content/plugins/crud/contentEntry/beforeCreateRevisionFrom.hook.js.map +0 -1
  225. package/content/plugins/crud/contentEntry/beforeDelete.hook.d.ts +0 -2
  226. package/content/plugins/crud/contentEntry/beforeDelete.hook.js +0 -15
  227. package/content/plugins/crud/contentEntry/beforeDelete.hook.js.map +0 -1
  228. package/content/plugins/crud/contentEntry/beforeDeleteRevision.hook.d.ts +0 -2
  229. package/content/plugins/crud/contentEntry/beforeDeleteRevision.hook.js +0 -15
  230. package/content/plugins/crud/contentEntry/beforeDeleteRevision.hook.js.map +0 -1
  231. package/content/plugins/crud/contentEntry/beforePublish.hook.d.ts +0 -2
  232. package/content/plugins/crud/contentEntry/beforePublish.hook.js +0 -15
  233. package/content/plugins/crud/contentEntry/beforePublish.hook.js.map +0 -1
  234. package/content/plugins/crud/contentEntry/beforeRequestChanges.hook.d.ts +0 -2
  235. package/content/plugins/crud/contentEntry/beforeRequestChanges.hook.js +0 -15
  236. package/content/plugins/crud/contentEntry/beforeRequestChanges.hook.js.map +0 -1
  237. package/content/plugins/crud/contentEntry/beforeRequestReview.hook.d.ts +0 -2
  238. package/content/plugins/crud/contentEntry/beforeRequestReview.hook.js +0 -15
  239. package/content/plugins/crud/contentEntry/beforeRequestReview.hook.js.map +0 -1
  240. package/content/plugins/crud/contentEntry/beforeUnpublish.hook.d.ts +0 -2
  241. package/content/plugins/crud/contentEntry/beforeUnpublish.hook.js +0 -15
  242. package/content/plugins/crud/contentEntry/beforeUnpublish.hook.js.map +0 -1
  243. package/content/plugins/crud/contentEntry/beforeUpdate.hook.d.ts +0 -2
  244. package/content/plugins/crud/contentEntry/beforeUpdate.hook.js +0 -18
  245. package/content/plugins/crud/contentEntry/beforeUpdate.hook.js.map +0 -1
  246. package/content/plugins/crud/contentEntry/entryDataValidation.js.map +0 -1
  247. package/content/plugins/crud/contentEntry/hooks.d.ts +0 -18
  248. package/content/plugins/crud/contentEntry/hooks.js +0 -240
  249. package/content/plugins/crud/contentEntry/hooks.js.map +0 -1
  250. package/content/plugins/crud/contentEntry/markLockedFields.js.map +0 -1
  251. package/content/plugins/crud/contentEntry/runContentEntryLifecycleHooks.d.ts +0 -4
  252. package/content/plugins/crud/contentEntry/runContentEntryLifecycleHooks.js +0 -24
  253. package/content/plugins/crud/contentEntry/runContentEntryLifecycleHooks.js.map +0 -1
  254. package/content/plugins/crud/contentEntry.crud.js.map +0 -1
  255. package/content/plugins/crud/contentModel/afterCreate.hook.d.ts +0 -7
  256. package/content/plugins/crud/contentModel/afterCreate.hook.js +0 -24
  257. package/content/plugins/crud/contentModel/afterCreate.hook.js.map +0 -1
  258. package/content/plugins/crud/contentModel/afterDelete.hook.d.ts +0 -7
  259. package/content/plugins/crud/contentModel/afterDelete.hook.js +0 -24
  260. package/content/plugins/crud/contentModel/afterDelete.hook.js.map +0 -1
  261. package/content/plugins/crud/contentModel/afterUpdate.hook.d.ts +0 -7
  262. package/content/plugins/crud/contentModel/afterUpdate.hook.js +0 -24
  263. package/content/plugins/crud/contentModel/afterUpdate.hook.js.map +0 -1
  264. package/content/plugins/crud/contentModel/beforeCreate.hook.d.ts +0 -7
  265. package/content/plugins/crud/contentModel/beforeCreate.hook.js +0 -137
  266. package/content/plugins/crud/contentModel/beforeCreate.hook.js.map +0 -1
  267. package/content/plugins/crud/contentModel/beforeDelete.hook.d.ts +0 -7
  268. package/content/plugins/crud/contentModel/beforeDelete.hook.js +0 -58
  269. package/content/plugins/crud/contentModel/beforeDelete.hook.js.map +0 -1
  270. package/content/plugins/crud/contentModel/beforeUpdate.hook.d.ts +0 -7
  271. package/content/plugins/crud/contentModel/beforeUpdate.hook.js +0 -141
  272. package/content/plugins/crud/contentModel/beforeUpdate.hook.js.map +0 -1
  273. package/content/plugins/crud/contentModel/contentModelManagerFactory.js.map +0 -1
  274. package/content/plugins/crud/contentModel/createFieldModels.js.map +0 -1
  275. package/content/plugins/crud/contentModel/hooks.d.ts +0 -6
  276. package/content/plugins/crud/contentModel/hooks.js +0 -84
  277. package/content/plugins/crud/contentModel/hooks.js.map +0 -1
  278. package/content/plugins/crud/contentModel/idValidation.js.map +0 -1
  279. package/content/plugins/crud/contentModel/models.js.map +0 -1
  280. package/content/plugins/crud/contentModel/runContentModelLifecycleHooks.d.ts +0 -2
  281. package/content/plugins/crud/contentModel/runContentModelLifecycleHooks.js +0 -24
  282. package/content/plugins/crud/contentModel/runContentModelLifecycleHooks.js.map +0 -1
  283. package/content/plugins/crud/contentModel/validateLayout.js.map +0 -1
  284. package/content/plugins/crud/contentModel.crud.js.map +0 -1
  285. package/content/plugins/crud/contentModelGroup/afterCreate.hook.d.ts +0 -7
  286. package/content/plugins/crud/contentModelGroup/afterCreate.hook.js +0 -24
  287. package/content/plugins/crud/contentModelGroup/afterCreate.hook.js.map +0 -1
  288. package/content/plugins/crud/contentModelGroup/afterDelete.hook.d.ts +0 -8
  289. package/content/plugins/crud/contentModelGroup/afterDelete.hook.js +0 -22
  290. package/content/plugins/crud/contentModelGroup/afterDelete.hook.js.map +0 -1
  291. package/content/plugins/crud/contentModelGroup/afterUpdate.hook.d.ts +0 -7
  292. package/content/plugins/crud/contentModelGroup/afterUpdate.hook.js +0 -26
  293. package/content/plugins/crud/contentModelGroup/afterUpdate.hook.js.map +0 -1
  294. package/content/plugins/crud/contentModelGroup/beforeCreate.hook.d.ts +0 -7
  295. package/content/plugins/crud/contentModelGroup/beforeCreate.hook.js +0 -87
  296. package/content/plugins/crud/contentModelGroup/beforeCreate.hook.js.map +0 -1
  297. package/content/plugins/crud/contentModelGroup/beforeDelete.hook.d.ts +0 -7
  298. package/content/plugins/crud/contentModelGroup/beforeDelete.hook.js +0 -46
  299. package/content/plugins/crud/contentModelGroup/beforeDelete.hook.js.map +0 -1
  300. package/content/plugins/crud/contentModelGroup/beforeUpdate.hook.d.ts +0 -7
  301. package/content/plugins/crud/contentModelGroup/beforeUpdate.hook.js +0 -35
  302. package/content/plugins/crud/contentModelGroup/beforeUpdate.hook.js.map +0 -1
  303. package/content/plugins/crud/contentModelGroup.crud.js.map +0 -1
  304. package/content/plugins/graphqlFields/boolean.js.map +0 -1
  305. package/content/plugins/graphqlFields/datetime.js.map +0 -1
  306. package/content/plugins/graphqlFields/file.js.map +0 -1
  307. package/content/plugins/graphqlFields/index.js.map +0 -1
  308. package/content/plugins/graphqlFields/longText.js.map +0 -1
  309. package/content/plugins/graphqlFields/number.js.map +0 -1
  310. package/content/plugins/graphqlFields/object.js.map +0 -1
  311. package/content/plugins/graphqlFields/ref.js.map +0 -1
  312. package/content/plugins/graphqlFields/richText.js.map +0 -1
  313. package/content/plugins/graphqlFields/text.js.map +0 -1
  314. package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js.map +0 -1
  315. package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js.map +0 -1
  316. package/content/plugins/modelManager/DefaultContentModelManager.d.ts +0 -15
  317. package/content/plugins/modelManager/DefaultContentModelManager.js +0 -63
  318. package/content/plugins/modelManager/DefaultContentModelManager.js.map +0 -1
  319. package/content/plugins/modelManager/index.js.map +0 -1
  320. package/content/plugins/schema/baseSchema.js.map +0 -1
  321. package/content/plugins/schema/contentEntries.js.map +0 -1
  322. package/content/plugins/schema/contentModelGroups.js.map +0 -1
  323. package/content/plugins/schema/contentModels.js.map +0 -1
  324. package/content/plugins/schema/createFieldResolvers.js.map +0 -1
  325. package/content/plugins/schema/createManageResolvers.js.map +0 -1
  326. package/content/plugins/schema/createManageSDL.js.map +0 -1
  327. package/content/plugins/schema/createPreviewResolvers.js.map +0 -1
  328. package/content/plugins/schema/createReadResolvers.js.map +0 -1
  329. package/content/plugins/schema/createReadSDL.js.map +0 -1
  330. package/content/plugins/schema/resolvers/commonFieldResolvers.js.map +0 -1
  331. package/content/plugins/schema/resolvers/manage/resolveCreate.js.map +0 -1
  332. package/content/plugins/schema/resolvers/manage/resolveCreateFrom.js.map +0 -1
  333. package/content/plugins/schema/resolvers/manage/resolveDelete.js.map +0 -1
  334. package/content/plugins/schema/resolvers/manage/resolveGet.js.map +0 -1
  335. package/content/plugins/schema/resolvers/manage/resolveGetByIds.js.map +0 -1
  336. package/content/plugins/schema/resolvers/manage/resolveGetRevisions.js.map +0 -1
  337. package/content/plugins/schema/resolvers/manage/resolveList.js.map +0 -1
  338. package/content/plugins/schema/resolvers/manage/resolvePublish.js.map +0 -1
  339. package/content/plugins/schema/resolvers/manage/resolveRequestChanges.js.map +0 -1
  340. package/content/plugins/schema/resolvers/manage/resolveRequestReview.js.map +0 -1
  341. package/content/plugins/schema/resolvers/manage/resolveUnpublish.js.map +0 -1
  342. package/content/plugins/schema/resolvers/manage/resolveUpdate.js.map +0 -1
  343. package/content/plugins/schema/resolvers/preview/resolveGet.js.map +0 -1
  344. package/content/plugins/schema/resolvers/preview/resolveList.js.map +0 -1
  345. package/content/plugins/schema/resolvers/read/resolveGet.js.map +0 -1
  346. package/content/plugins/schema/resolvers/read/resolveList.js.map +0 -1
  347. package/content/plugins/schema/schemaPlugins.js.map +0 -1
  348. package/content/plugins/storage/default.js.map +0 -1
  349. package/content/plugins/storage/object.js.map +0 -1
  350. package/content/plugins/utils/createTypeName.js.map +0 -1
  351. package/content/plugins/utils/entryStorage.js.map +0 -1
  352. package/content/plugins/utils/getEntryTitle.js.map +0 -1
  353. package/content/plugins/utils/getSchemaFromFieldPlugins.js.map +0 -1
  354. package/content/plugins/utils/pluralizedTypeName.js.map +0 -1
  355. package/content/plugins/utils/renderFields.js.map +0 -1
  356. package/content/plugins/utils/renderGetFilterFields.js.map +0 -1
  357. package/content/plugins/utils/renderInputFields.js.map +0 -1
  358. package/content/plugins/utils/renderListFilterFields.js.map +0 -1
  359. package/content/plugins/utils/renderSortEnum.js.map +0 -1
  360. package/content/plugins/validators/dateGte.js.map +0 -1
  361. package/content/plugins/validators/dateLte.js.map +0 -1
  362. package/content/plugins/validators/gte.js.map +0 -1
  363. package/content/plugins/validators/in.js.map +0 -1
  364. package/content/plugins/validators/index.js.map +0 -1
  365. package/content/plugins/validators/lte.js.map +0 -1
  366. package/content/plugins/validators/maxLength.js.map +0 -1
  367. package/content/plugins/validators/minLength.js.map +0 -1
  368. package/content/plugins/validators/pattern.js.map +0 -1
  369. package/content/plugins/validators/patternPlugins/email.js.map +0 -1
  370. package/content/plugins/validators/patternPlugins/index.js.map +0 -1
  371. package/content/plugins/validators/patternPlugins/lowerCase.js.map +0 -1
  372. package/content/plugins/validators/patternPlugins/upperCase.js.map +0 -1
  373. package/content/plugins/validators/patternPlugins/url.js.map +0 -1
  374. package/content/plugins/validators/required.js.map +0 -1
  375. package/content/plugins/validators/timeGte.js.map +0 -1
  376. package/content/plugins/validators/timeLte.js.map +0 -1
  377. package/migrateCMSPermissions.js.map +0 -1
  378. package/plugins/InstallationPlugin.d.ts +0 -19
  379. package/plugins/InstallationPlugin.js +0 -39
  380. package/plugins/InstallationPlugin.js.map +0 -1
  381. package/plugins/context.js.map +0 -1
  382. package/plugins/crud/index.js.map +0 -1
  383. package/plugins/crud/settings.crud.js.map +0 -1
  384. package/plugins/crud/system.crud.js.map +0 -1
  385. package/plugins/graphql/system.js.map +0 -1
  386. package/plugins/graphql.js.map +0 -1
  387. package/plugins/index.d.ts +0 -2
  388. package/plugins/index.js +0 -25
  389. package/plugins/index.js.map +0 -1
  390. package/plugins/upgrades/index.js.map +0 -1
  391. package/plugins/upgrades/v5.5.0/helpers.js.map +0 -1
  392. package/plugins/upgrades/v5.5.0/index.js.map +0 -1
  393. package/transformers.js.map +0 -1
  394. package/types.js.map +0 -1
  395. package/utils.js.map +0 -1
package/types.js CHANGED
@@ -14,19 +14,19 @@ exports.CONTENT_ENTRY_STATUS = void 0;
14
14
  /**
15
15
  * Object containing content model field predefined options and values.
16
16
  *
17
- * @category ContentModelField
17
+ * @category CmsModelField
18
18
  */
19
19
 
20
20
  /**
21
21
  * Object containing content model field renderer options.
22
22
  *
23
- * @category ContentModelField
23
+ * @category CmsModelField
24
24
  */
25
25
 
26
26
  /**
27
27
  * A definition for content model field. This type exists on the app side as well.
28
28
  *
29
- * @category ContentModelField
29
+ * @category ModelField
30
30
  * @category Database model
31
31
  */
32
32
 
@@ -37,7 +37,7 @@ exports.CONTENT_ENTRY_STATUS = void 0;
37
37
  /**
38
38
  * Arguments for the field validator validate method.
39
39
  *
40
- * @category ContentModelField
40
+ * @category ModelField
41
41
  * @category FieldValidation
42
42
  */
43
43
 
@@ -45,7 +45,7 @@ exports.CONTENT_ENTRY_STATUS = void 0;
45
45
  * Definition for the field validator.
46
46
  *
47
47
  * @category Plugin
48
- * @category ContentModelField
48
+ * @category ModelField
49
49
  * @category FieldValidation
50
50
  */
51
51
 
@@ -53,32 +53,32 @@ exports.CONTENT_ENTRY_STATUS = void 0;
53
53
  * A pattern validator for the content entry field value.
54
54
  *
55
55
  * @category Plugin
56
- * @category ContentModelField
56
+ * @category ModelField
57
57
  * @category FieldValidation
58
58
  */
59
59
 
60
60
  /**
61
61
  * Locked field in the content model
62
62
  *
63
- * @see CmsContentModel.lockedFields
63
+ * @see CmsModel.lockedFields
64
64
  *
65
- * @category ContentModelField
65
+ * @category ModelField
66
66
  */
67
67
 
68
68
  /**
69
- * Content model defining an entry.
69
+ * Cms Model defining an entry.
70
70
  *
71
71
  * @category Database model
72
- * @category ContentModel
72
+ * @category CmsModel
73
73
  */
74
74
 
75
75
  /**
76
- * @category ContentModelField
76
+ * @category ModelField
77
77
  */
78
78
 
79
79
  /**
80
80
  * @category Plugin
81
- * @category ContentModelField
81
+ * @category ModelField
82
82
  * @category GraphQL
83
83
  */
84
84
 
@@ -86,12 +86,12 @@ exports.CONTENT_ENTRY_STATUS = void 0;
86
86
  * Check for content model locked field.
87
87
  * A custom plugin definable by the user.
88
88
  *
89
- * @category ContentModel
89
+ * @category CmsModel
90
90
  * @category Plugin
91
91
  */
92
92
 
93
93
  /**
94
- * @category ContentModelField
94
+ * @category ModelField
95
95
  */
96
96
 
97
97
  /**
@@ -113,152 +113,182 @@ exports.CONTENT_ENTRY_STATUS = void 0;
113
113
  */
114
114
 
115
115
  /**
116
- * A GraphQL args.data parameter received when creating content model group.
116
+ * A GraphQL params.data parameter received when creating content model group.
117
117
  *
118
- * @category ContentModelGroup
119
- * @category GraphQL args
118
+ * @category CmsGroup
119
+ * @category GraphQL params
120
120
  */
121
121
 
122
122
  /**
123
- * A GraphQL args.data parameter received when updating content model group.
123
+ * A GraphQL params.data parameter received when updating content model group.
124
124
  *
125
- * @category ContentModelGroup
126
- * @category GraphQL args
125
+ * @category CmsGroup
126
+ * @category GraphQL params
127
127
  */
128
128
 
129
129
  /**
130
130
  * A representation of content model group in the database.
131
131
  *
132
- * @category ContentModelGroup
132
+ * @category CmsGroup
133
133
  * @category Database model
134
134
  */
135
135
 
136
136
  /**
137
137
  * A data.where parameter received when listing content model groups.
138
138
  *
139
- * @category ContentModelGroup
140
- * @category GraphQL args
139
+ * @category CmsGroup
140
+ * @category GraphQL params
141
141
  */
142
142
 
143
143
  /**
144
- * Content model group in context.
144
+ * @category CmsGroup
145
+ * @category Topic
146
+ */
147
+
148
+ /**
149
+ * @category CmsGroup
150
+ * @category Topic
151
+ */
152
+
153
+ /**
154
+ * @category CmsGroup
155
+ * @category Topic
156
+ */
157
+
158
+ /**
159
+ * @category CmsGroup
160
+ * @category Topic
161
+ */
162
+
163
+ /**
164
+ * @category CmsGroup
165
+ * @category Topic
166
+ */
167
+
168
+ /**
169
+ * @category CmsGroup
170
+ * @category Topic
171
+ */
172
+
173
+ /**
174
+ * Cms Group in context.
145
175
  *
146
176
  * @category Context
147
- * @category ContentModelGroup
177
+ * @category CmsGroup
148
178
  */
149
179
 
150
180
  /**
151
181
  * Definition for content model field validator.
152
182
  *
153
- * @category ContentModelField
183
+ * @category ModelField
154
184
  * @category FieldValidation
155
185
  */
156
186
 
157
187
  /**
158
- * A GraphQL args.data parameter received when creating content model.
188
+ * A GraphQL params.data parameter received when creating content model.
159
189
  *
160
- * @category GraphQL args
161
- * @category ContentModel
190
+ * @category GraphQL params
191
+ * @category CmsModel
162
192
  */
163
193
 
164
194
  /**
165
195
  * A definition for content model field received from the user.
166
196
  *
167
- * Input type for `CmsContentModelField`.
168
- * @see CmsContentModelField
197
+ * Input type for `CmsModelField`.
198
+ * @see CmsModelField
169
199
  *
170
- * @category GraphQL args
171
- * @category ContentModelField
200
+ * @category GraphQL params
201
+ * @category ModelField
172
202
  */
173
203
 
174
204
  /**
175
- * A GraphQL args.data parameter received when updating content model.
205
+ * A GraphQL params.data parameter received when updating content model.
176
206
  *
177
- * @category GraphQL args
178
- * @category ContentModel
207
+ * @category GraphQL params
208
+ * @category CmsModel
179
209
  */
180
210
 
181
211
  /**
182
- * A plugin to load a CmsContentModelManager.
212
+ * A plugin to load a CmsModelManager.
183
213
  *
184
- * @see CmsContentModelManager
214
+ * @see CmsModelManager
185
215
  *
186
216
  * @category Plugin
187
- * @category ContentModel
188
- * @category ContentEntry
217
+ * @category CmsModel
218
+ * @category CmsEntry
189
219
  */
190
220
 
191
221
  /**
192
222
  * A content entry definition for and from the database.
193
223
  *
194
224
  * @category Database model
195
- * @category ContentEntry
225
+ * @category CmsEntry
196
226
  */
197
227
 
198
228
  /**
199
229
  * A definition for content model manager to be used in the code.
200
- * The default one uses `CmsContentEntryContext` methods internally, but devs can change to what every they want.
230
+ * The default one uses `CmsEntryContext` methods internally, but devs can change to what every they want.
201
231
  *
202
- * @see CmsContentEntryContext
232
+ * @see CmsEntryContext
203
233
  *
204
234
  * @category Context
205
- * @category ContentEntry
206
- * @category ContentModel
235
+ * @category CmsEntry
236
+ * @category CmsModel
207
237
  */
208
238
 
209
239
  /**
210
- * Content model in the context.
240
+ * Cms Model in the context.
211
241
  *
212
242
  * @category Context
213
- * @category ContentModel
243
+ * @category CmsModel
214
244
  */
215
245
 
216
246
  /**
217
247
  * Available statuses for content entry.
218
248
  *
219
- * @category ContentEntry
249
+ * @category CmsEntry
220
250
  */
221
251
 
222
252
  /**
223
- * Entry listing where args.
253
+ * Entry listing where params.
224
254
  *
225
- * @category ContentEntry
226
- * @category GraphQL args
255
+ * @category CmsEntry
256
+ * @category GraphQL params
227
257
  */
228
258
 
229
259
  /**
230
260
  * Entry listing sort.
231
261
  *
232
- * @category ContentEntry
233
- * @category GraphQL args
262
+ * @category CmsEntry
263
+ * @category GraphQL params
234
264
  */
235
265
 
236
266
  /**
237
- * Get entry GraphQL resolver args.
267
+ * Get entry GraphQL resolver params.
238
268
  *
239
- * @category ContentEntry
240
- * @category GraphQL args
269
+ * @category CmsEntry
270
+ * @category GraphQL params
241
271
  */
242
272
 
243
273
  /**
244
- * List entries GraphQL resolver args.
274
+ * List entries GraphQL resolver params.
245
275
  *
246
- * @category ContentEntry
247
- * @category GraphQL args
276
+ * @category CmsEntry
277
+ * @category GraphQL params
248
278
  */
249
279
 
250
280
  /**
251
281
  * Meta information for GraphQL output.
252
282
  *
253
- * @category ContentEntry
283
+ * @category CmsEntry
254
284
  * @category GraphQL output
255
285
  */
256
286
 
257
287
  /**
258
- * Content entry CRUD methods in the context.
288
+ * Cms Entry CRUD methods in the context.
259
289
  *
260
290
  * @category Context
261
- * @category ContentEntry
291
+ * @category CmsEntry
262
292
  */
263
293
 
264
294
  /**
@@ -268,17 +298,17 @@ exports.CONTENT_ENTRY_STATUS = void 0;
268
298
  */
269
299
 
270
300
  /**
271
- * Parameters for ContentEntryResolverFactory.
301
+ * Parameters for CmsEntryResolverFactory.
272
302
  *
273
303
  * @category GraphQL resolver
274
- * @category ContentEntry
304
+ * @category CmsEntry
275
305
  */
276
306
 
277
307
  /**
278
- * A type for ContentEntryResolvers. Used when creating get, list, update, publish, ...etc.
308
+ * A type for EntryResolvers. Used when creating get, list, update, publish, ...etc.
279
309
  *
280
310
  * @category GraphQL resolver
281
- * @category ContentEntry
311
+ * @category CmsEntry
282
312
  */
283
313
 
284
314
  /**
@@ -292,222 +322,43 @@ exports.CONTENT_ENTRY_STATUS = void 0;
292
322
  * A security permission for content model.
293
323
  *
294
324
  * @category SecurityPermission
295
- * @category ContentModel
325
+ * @category CmsModel
296
326
  */
297
327
 
298
328
  /**
299
329
  * The security permission for content model groups.
300
330
  *
301
331
  * @category SecurityPermission
302
- * @category ContentModelGroup
332
+ * @category CmsGroup
303
333
  */
304
334
 
305
335
  /**
306
336
  * The security permission for content entry.
307
337
  *
308
338
  * @category SecurityPermission
309
- * @category ContentEntry
310
- */
311
-
312
- /**
313
- * A argument definition for CmsModelFieldToStoragePlugin.toStorage
314
- *
315
- * @see CmsModelFieldToStoragePlugin.toStorage
316
- *
317
- * @category Plugin
318
- * @category ContentModelField
319
- * @category Storage
320
- */
321
-
322
- /**
323
- * A argument definition for CmsModelFieldToStoragePlugin.fromStorage
324
- *
325
- * @see CmsModelFieldToStoragePlugin.fromStorage
326
- *
327
- * @category Plugin
328
- * @category ContentModelField
329
- * @category Storage
339
+ * @category CmsEntry
330
340
  */
331
341
 
332
342
  /**
333
- * A plugin defining transformation of field value to and from storage.
334
- *
335
- * @category Plugin
336
- * @category ContentModelField
337
- * @category ContentEntry
338
- * @category Storage
339
- */
340
-
341
- /**
342
- * @category LifecycleHook
343
- * @category ContentModel
344
- */
345
-
346
- /**
347
- * @category LifecycleHook
348
- * @category ContentModel
349
- */
350
-
351
- /**
352
- * @category LifecycleHook
353
- * @category ContentModel
354
- */
355
-
356
- /**
357
- * A plugin type that defines lifecycle hooks for content model.
358
- *
359
- * @category Plugin
360
- * @category ContentModel
361
- * @category LifecycleHook
362
- */
363
-
364
- /**
365
- * @category ContentEntry
366
- * @category LifecycleHook
367
- */
368
-
369
- /**
370
- * @category ContentEntry
371
- * @category LifecycleHook
372
- */
373
-
374
- /**
375
- * @category ContentEntry
376
- * @category LifecycleHook
377
- */
378
-
379
- /**
380
- * @category ContentEntry
381
- * @category LifecycleHook
382
- */
383
-
384
- /**
385
- * @category ContentEntry
386
- * @category LifecycleHook
387
- */
388
-
389
- /**
390
- * @category ContentEntry
391
- * @category LifecycleHook
392
- */
393
-
394
- /**
395
- * @category ContentEntry
396
- * @category LifecycleHook
397
- */
398
-
399
- /**
400
- * @category ContentEntry
401
- * @category LifecycleHook
402
- */
403
-
404
- /**
405
- * @category ContentEntry
406
- * @category LifecycleHook
407
- */
408
-
409
- /**
410
- * @category ContentEntry
411
- * @category LifecycleHook
412
- */
413
-
414
- /**
415
- * @category ContentEntry
416
- * @category LifecycleHook
417
- */
418
-
419
- /**
420
- * @category ContentEntry
421
- * @category LifecycleHook
422
- */
423
-
424
- /**
425
- * @category ContentEntry
426
- * @category LifecycleHook
427
- */
428
-
429
- /**
430
- * @category ContentEntry
431
- * @category LifecycleHook
432
- */
433
-
434
- /**
435
- * @category ContentEntry
436
- * @category LifecycleHook
437
- */
438
-
439
- /**
440
- * @category ContentEntry
441
- * @category LifecycleHook
442
- */
443
-
444
- /**
445
- * @category ContentEntry
446
- * @category LifecycleHook
447
- */
448
-
449
- /**
450
- * @category ContentEntry
451
- * @category LifecycleHook
452
- */
453
-
454
- /**
455
- * @category ContentEntry
456
- * @category LifecycleHook
457
- */
458
-
459
- /**
460
- * A plugin type that defines lifecycle hooks for content entry.
461
- *
462
- * @category Plugin
463
- * @category ContentEntry
464
- * @category LifecycleHook
465
- */
466
-
467
- /**
468
- * Arguments for the group storage operations provider method.
469
- */
470
-
471
- /**
472
- * A plugin that provides the group storage operations implementation.
473
- */
474
-
475
- /**
476
- * Description of the ContentModelGroup CRUD operations.
343
+ * Description of the CmsGroup CRUD operations.
477
344
  * If user wants to add another database to the application, this is how it is done.
478
345
  * This is just plain read, update, write, delete and list - no authentication or permission checks.
479
346
  */
480
347
 
481
348
  /**
482
- * Arguments for the model storage operations provider method.
483
- */
484
-
485
- /**
486
- * A plugin that provides the model storage operations implementation.
487
- */
488
-
489
- /**
490
- * Description of the ContentModel storage operations.
349
+ * Description of the CmsModel storage operations.
491
350
  * If user wants to add another database to the application, this is how it is done.
492
351
  * This is just plain read, update, write, delete and list - no authentication or permission checks.
493
352
  */
494
353
 
495
354
  /**
496
- * Arguments for the entry storage provider method.
497
- */
498
-
499
- /**
500
- * A plugin that provides the entry storage operations implementation.
501
- */
502
-
503
- /**
504
- * Description of the ContentModel storage operations.
355
+ * Description of the CmsModel storage operations.
505
356
  * If user wants to add another database to the application, this is how it is done.
506
357
  * This is just plain read, update, write, delete and list - no authentication or permission checks.
507
358
  *
508
359
  *
509
360
  * @category StorageOperations
510
- * @category ContentEntry
361
+ * @category CmsEntry
511
362
  */
512
363
  let CONTENT_ENTRY_STATUS;
513
364
  exports.CONTENT_ENTRY_STATUS = CONTENT_ENTRY_STATUS;
@@ -518,5 +369,4 @@ exports.CONTENT_ENTRY_STATUS = CONTENT_ENTRY_STATUS;
518
369
  CONTENT_ENTRY_STATUS["UNPUBLISHED"] = "unpublished";
519
370
  CONTENT_ENTRY_STATUS["CHANGES_REQUESTED"] = "changesRequested";
520
371
  CONTENT_ENTRY_STATUS["REVIEW_REQUESTED"] = "reviewRequested";
521
- })(CONTENT_ENTRY_STATUS || (exports.CONTENT_ENTRY_STATUS = CONTENT_ENTRY_STATUS = {}));
522
- //# sourceMappingURL=types.js.map
372
+ })(CONTENT_ENTRY_STATUS || (exports.CONTENT_ENTRY_STATUS = CONTENT_ENTRY_STATUS = {}));
package/utils.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { Plugin } from "@webiny/plugins/types";
2
1
  import { SecurityPermission } from "@webiny/api-security/types";
3
- import { CmsContentModel, CmsContext, CreatedBy, CmsContentModelGroupPermission, CmsContentModelGroup } from "./types";
2
+ import { CmsModel, CmsContext, CreatedBy, CmsGroupPermission, CmsGroup } from "./types";
4
3
  export declare const hasRwd: (permission: any, rwd: any) => any;
5
4
  export declare const hasPw: (permission: any, pw: any) => any;
6
5
  export declare const checkPermissions: <TPermission extends SecurityPermission = SecurityPermission>(context: CmsContext, name: string, check?: {
@@ -19,14 +18,8 @@ export declare const validateOwnership: (context: CmsContext, permission: Securi
19
18
  * model access is checking for both specific model or group access
20
19
  * if permission has specific models set as access pattern then groups will not matter (although both can be set)
21
20
  */
22
- export declare const checkModelAccess: (context: CmsContext, model: CmsContentModel) => Promise<void>;
23
- export declare const validateModelAccess: (context: CmsContext, model: CmsContentModel) => Promise<boolean>;
24
- export declare const validateGroupAccess: (context: CmsContext, permission: CmsContentModelGroupPermission, group: CmsContentModelGroup) => boolean;
21
+ export declare const checkModelAccess: (context: CmsContext, model: CmsModel) => Promise<void>;
22
+ export declare const validateModelAccess: (context: CmsContext, model: CmsModel) => Promise<boolean>;
23
+ export declare const validateGroupAccess: (context: CmsContext, permission: CmsGroupPermission, group: CmsGroup) => boolean;
25
24
  export declare const toSlug: (text: any) => string;
26
- export declare const zeroPad: (version: any) => string;
27
- export declare const createCmsPK: (context: CmsContext) => string;
28
- export declare const paginateBatch: <T = Record<string, any>>(items: T[], perPage: number, execute: (items: T[]) => Promise<any>) => Promise<void>;
29
25
  export declare const filterAsync: <T = Record<string, any>>(items: T[], predicate: (T: any) => Promise<boolean>) => Promise<T[]>;
30
- declare type CallbackFallback = (args: any) => void | Promise<void>;
31
- export declare const executeCallbacks: <TCallbackFunction extends CallbackFallback = CallbackFallback>(plugins: Plugin[], hook: string, args: Parameters<TCallbackFunction>[0]) => Promise<void>;
32
- export {};
package/utils.js CHANGED
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.zeroPad = exports.validateOwnership = exports.validateModelAccess = exports.validateGroupAccess = exports.toSlug = exports.paginateBatch = exports.hasRwd = exports.hasPw = exports.filterAsync = exports.executeCallbacks = exports.createCmsPK = exports.checkPermissions = exports.checkOwnership = exports.checkModelAccess = void 0;
8
+ exports.validateOwnership = exports.validateModelAccess = exports.validateGroupAccess = exports.toSlug = exports.hasRwd = exports.hasPw = exports.filterAsync = exports.checkPermissions = exports.checkOwnership = exports.checkModelAccess = void 0;
9
9
 
10
10
  var _slugify = _interopRequireDefault(require("slugify"));
11
11
 
@@ -233,42 +233,6 @@ const toSlug = text => {
233
233
 
234
234
  exports.toSlug = toSlug;
235
235
 
236
- const zeroPad = version => `${version}`.padStart(4, "0");
237
-
238
- exports.zeroPad = zeroPad;
239
-
240
- const createCmsPK = context => {
241
- const {
242
- tenancy,
243
- cms
244
- } = context;
245
- const tenant = tenancy.getCurrentTenant();
246
-
247
- if (!tenant) {
248
- throw new Error("Tenant missing.");
249
- }
250
-
251
- const locale = cms.getLocale();
252
-
253
- if (!locale) {
254
- throw new Error("Locale missing.");
255
- }
256
-
257
- return `T#${tenant.id}#L#${locale.code}#CMS`;
258
- };
259
-
260
- exports.createCmsPK = createCmsPK;
261
-
262
- const paginateBatch = async (items, perPage, execute) => {
263
- const pages = Math.ceil(items.length / perPage);
264
-
265
- for (let i = 0; i < pages; i++) {
266
- await execute(items.slice(i * perPage, i * perPage + perPage));
267
- }
268
- };
269
-
270
- exports.paginateBatch = paginateBatch;
271
-
272
236
  const filterAsync = async (items, predicate) => {
273
237
  const filteredItems = [];
274
238
 
@@ -284,15 +248,4 @@ const filterAsync = async (items, predicate) => {
284
248
  return filteredItems;
285
249
  };
286
250
 
287
- exports.filterAsync = filterAsync;
288
-
289
- const executeCallbacks = async (plugins, hook, args) => {
290
- for (const plugin of plugins) {
291
- if (typeof plugin[hook] === "function") {
292
- await plugin[hook](args);
293
- }
294
- }
295
- };
296
-
297
- exports.executeCallbacks = executeCallbacks;
298
- //# sourceMappingURL=utils.js.map
251
+ exports.filterAsync = filterAsync;
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/content/contextSetup.ts"],"names":["extractHandlerHttpParameters","context","key","http","request","path","parameters","type","locale","split","WebinyError","ContextPlugin","method","cms","systemLocale","i18n","getLocale","READ","PREVIEW","MANAGE"],"mappings":";;;;;;;;;AACA;;AACA;;AAEA,MAAMA,4BAA4B,GAAIC,OAAD,IAAyB;AAAA;;AAC1D,QAAM;AAAEC,IAAAA,GAAG,GAAG;AAAR,MAAe,kBAAAD,OAAO,CAACE,IAAR,yFAAcC,OAAd,0GAAuBC,IAAvB,kFAA6BC,UAA7B,KAA2C,EAAhE;AACA,QAAM,CAACC,IAAD,EAAOC,MAAP,IAAiBN,GAAG,CAACO,KAAJ,CAAU,GAAV,CAAvB;;AACA,MAAI,CAACF,IAAL,EAAW;AACP,UAAM,IAAIG,cAAJ,CAAiB,qDAAjB,CAAN;AACH,GAFD,MAEO,IAAI,CAACF,MAAL,EAAa;AAChB,UAAM,IAAIE,cAAJ,CAAiB,uDAAjB,CAAN;AACH;;AAED,SAAO;AACHH,IAAAA,IADG;AAEHC,IAAAA;AAFG,GAAP;AAIH,CAbD;;eAee,MAAM;AACjB,SAAO,IAAIG,4BAAJ,CAA8B,MAAMV,OAAN,IAAiB;AAAA;;AAClD,QAAI,mBAAAA,OAAO,CAACE,IAAR,2FAAcC,OAAd,gFAAuBQ,MAAvB,MAAkC,SAAtC,EAAiD;AAC7C;AACH,KAFD,MAEO,IAAIX,OAAO,CAACY,GAAZ,EAAiB;AACpB,YAAM,IAAIH,cAAJ,CACF,sFADE,EAEF,+BAFE,CAAN;AAIH;;AAED,UAAM;AAAEH,MAAAA,IAAF;AAAQC,MAAAA;AAAR,QAAmBR,4BAA4B,CAACC,OAAD,CAArD;AAEA,UAAMa,YAAY,GAAGb,OAAO,CAACc,IAAR,CAAaC,SAAb,CAAuBR,MAAvB,CAArB;;AACA,QAAI,CAACM,YAAL,EAAmB;AACf,YAAM,IAAIJ,cAAJ,CAAiB,uBAAsBF,MAAO,kBAA9C,CAAN;AACH;;AAEDP,IAAAA,OAAO,CAACY,GAAR,GAAc;AACVN,MAAAA,IADU;AAEVC,MAAAA,MAFU;AAGVQ,MAAAA,SAAS,EAAE,MAAMF,YAHP;AAIVG,MAAAA,IAAI,EAAEV,IAAI,KAAK,MAJL;AAKVW,MAAAA,OAAO,EAAEX,IAAI,KAAK,SALR;AAMVY,MAAAA,MAAM,EAAEZ,IAAI,KAAK;AANP,KAAd;AAQH,GAzBM,CAAP;AA0BH,C","sourcesContent":["import { CmsContext } from \"~/types\";\nimport WebinyError from \"@webiny/error\";\nimport { ContextPlugin } from \"@webiny/handler/plugins/ContextPlugin\";\n\nconst extractHandlerHttpParameters = (context: CmsContext) => {\n const { key = \"\" } = context.http?.request?.path?.parameters || {};\n const [type, locale] = key.split(\"/\");\n if (!type) {\n throw new WebinyError(`Missing context.http.request.path parameter \"type\".`);\n } else if (!locale) {\n throw new WebinyError(`Missing context.http.request.path parameter \"locale\".`);\n }\n\n return {\n type,\n locale\n };\n};\n\nexport default () => {\n return new ContextPlugin<CmsContext>(async context => {\n if (context.http?.request?.method === \"OPTIONS\") {\n return;\n } else if (context.cms) {\n throw new WebinyError(\n \"Context setup plugin must be first to be registered. Cannot have anything before it.\",\n \"CMS_CONTEXT_INITIALIZED_ERROR\"\n );\n }\n\n const { type, locale } = extractHandlerHttpParameters(context);\n\n const systemLocale = context.i18n.getLocale(locale);\n if (!systemLocale) {\n throw new WebinyError(`There is no locale \"${locale}\" in the system.`);\n }\n\n context.cms = {\n type,\n locale,\n getLocale: () => systemLocale,\n READ: type === \"read\",\n PREVIEW: type === \"preview\",\n MANAGE: type === \"manage\"\n } as any;\n });\n};\n"],"file":"contextSetup.js"}