@webiny/api-headless-cms 5.29.0 → 5.30.0-beta.0

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 (548) hide show
  1. package/context.d.ts +3 -0
  2. package/{content/contextSetup.js → context.js} +13 -8
  3. package/context.js.map +1 -0
  4. package/{content/plugins/crud → crud}/contentEntry/afterDelete.d.ts +1 -1
  5. package/{content/plugins/crud → crud}/contentEntry/afterDelete.js +0 -0
  6. package/{content/plugins/crud → crud}/contentEntry/afterDelete.js.map +0 -0
  7. package/{content/plugins/crud → crud}/contentEntry/beforeCreate.d.ts +1 -1
  8. package/{content/plugins/crud → crud}/contentEntry/beforeCreate.js +0 -0
  9. package/{content/plugins/crud → crud}/contentEntry/beforeCreate.js.map +0 -0
  10. package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.d.ts +1 -1
  11. package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.js +0 -0
  12. package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.js.map +0 -0
  13. package/{content/plugins/crud → crud}/contentEntry/entryDataValidation.d.ts +1 -1
  14. package/{content/plugins/crud → crud}/contentEntry/entryDataValidation.js +7 -1
  15. package/crud/contentEntry/entryDataValidation.js.map +1 -0
  16. package/{content/plugins/crud → crud}/contentEntry/markLockedFields.d.ts +1 -1
  17. package/{content/plugins/crud → crud}/contentEntry/markLockedFields.js +1 -1
  18. package/crud/contentEntry/markLockedFields.js.map +1 -0
  19. package/{content/plugins/crud → crud}/contentEntry/referenceFieldsMapping.d.ts +1 -1
  20. package/{content/plugins/crud → crud}/contentEntry/referenceFieldsMapping.js +0 -0
  21. package/{content/plugins/crud → crud}/contentEntry/referenceFieldsMapping.js.map +0 -0
  22. package/{content/plugins/crud → crud}/contentEntry.crud.d.ts +1 -1
  23. package/{content/plugins/crud → crud}/contentEntry.crud.js +68 -42
  24. package/crud/contentEntry.crud.js.map +1 -0
  25. package/{content/plugins/crud → crud}/contentModel/afterCreate.d.ts +1 -1
  26. package/{content/plugins/crud → crud}/contentModel/afterCreate.js +0 -0
  27. package/{content/plugins/crud → crud}/contentModel/afterCreate.js.map +0 -0
  28. package/{content/plugins/crud → crud}/contentModel/afterCreateFrom.d.ts +1 -1
  29. package/{content/plugins/crud → crud}/contentModel/afterCreateFrom.js +0 -0
  30. package/{content/plugins/crud → crud}/contentModel/afterCreateFrom.js.map +0 -0
  31. package/{content/plugins/crud → crud}/contentModel/afterDelete.d.ts +1 -1
  32. package/{content/plugins/crud → crud}/contentModel/afterDelete.js +0 -0
  33. package/{content/plugins/crud → crud}/contentModel/afterDelete.js.map +0 -0
  34. package/{content/plugins/crud → crud}/contentModel/afterUpdate.d.ts +1 -1
  35. package/{content/plugins/crud → crud}/contentModel/afterUpdate.js +0 -0
  36. package/{content/plugins/crud → crud}/contentModel/afterUpdate.js.map +0 -0
  37. package/{content/plugins/crud → crud}/contentModel/beforeCreate.d.ts +1 -1
  38. package/{content/plugins/crud → crud}/contentModel/beforeCreate.js +1 -1
  39. package/crud/contentModel/beforeCreate.js.map +1 -0
  40. package/{content/plugins/crud → crud}/contentModel/beforeDelete.d.ts +1 -1
  41. package/{content/plugins/crud → crud}/contentModel/beforeDelete.js +1 -1
  42. package/crud/contentModel/beforeDelete.js.map +1 -0
  43. package/{content/plugins/crud → crud}/contentModel/beforeUpdate.d.ts +1 -1
  44. package/{content/plugins/crud → crud}/contentModel/beforeUpdate.js +0 -0
  45. package/crud/contentModel/beforeUpdate.js.map +1 -0
  46. package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.d.ts +1 -1
  47. package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.js +0 -0
  48. package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.js.map +0 -0
  49. package/crud/contentModel/createFieldModels.d.ts +2 -0
  50. package/{content/plugins/crud → crud}/contentModel/createFieldModels.js +0 -0
  51. package/{content/plugins/crud → crud}/contentModel/createFieldModels.js.map +0 -0
  52. package/crud/contentModel/idValidation.d.ts +1 -0
  53. package/{content/plugins/crud → crud}/contentModel/idValidation.js +3 -3
  54. package/crud/contentModel/idValidation.js.map +1 -0
  55. package/{content/plugins/crud → crud}/contentModel/models.d.ts +0 -0
  56. package/{content/plugins/crud → crud}/contentModel/models.js +2 -2
  57. package/crud/contentModel/models.js.map +1 -0
  58. package/{content/plugins/crud → crud}/contentModel/validateLayout.d.ts +1 -1
  59. package/{content/plugins/crud → crud}/contentModel/validateLayout.js +0 -0
  60. package/{content/plugins/crud → crud}/contentModel/validateLayout.js.map +0 -0
  61. package/{content/plugins/crud → crud}/contentModel/validateModelFields.d.ts +1 -1
  62. package/{content/plugins/crud → crud}/contentModel/validateModelFields.js +2 -2
  63. package/crud/contentModel/validateModelFields.js.map +1 -0
  64. package/{content/plugins/crud → crud}/contentModel.crud.d.ts +1 -1
  65. package/{content/plugins/crud → crud}/contentModel.crud.js +14 -12
  66. package/crud/contentModel.crud.js.map +1 -0
  67. package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.d.ts +1 -1
  68. package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.js +5 -5
  69. package/crud/contentModelGroup/beforeCreate.js.map +1 -0
  70. package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.d.ts +1 -1
  71. package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.js +1 -1
  72. package/crud/contentModelGroup/beforeDelete.js.map +1 -0
  73. package/{content/plugins/crud → crud}/contentModelGroup/beforeUpdate.d.ts +1 -1
  74. package/{content/plugins/crud → crud}/contentModelGroup/beforeUpdate.js +1 -1
  75. package/crud/contentModelGroup/beforeUpdate.js.map +1 -0
  76. package/{content/plugins/crud → crud}/contentModelGroup.crud.d.ts +1 -1
  77. package/{content/plugins/crud → crud}/contentModelGroup.crud.js +15 -13
  78. package/crud/contentModelGroup.crud.js.map +1 -0
  79. package/crud/index.d.ts +6 -0
  80. package/{content/plugins/crud → crud}/index.js +5 -17
  81. package/crud/index.js.map +1 -0
  82. package/{plugins/crud → crud}/settings.crud.d.ts +1 -1
  83. package/{plugins/crud → crud}/settings.crud.js +3 -7
  84. package/crud/settings.crud.js.map +1 -0
  85. package/{plugins/crud → crud}/system.crud.d.ts +1 -1
  86. package/{plugins/crud → crud}/system.crud.js +0 -0
  87. package/{plugins/crud → crud}/system.crud.js.map +0 -0
  88. package/{content/plugins → graphql}/buildSchemaPlugins.d.ts +2 -3
  89. package/graphql/buildSchemaPlugins.js +27 -0
  90. package/graphql/buildSchemaPlugins.js.map +1 -0
  91. package/graphql/graphQLHandlerFactory.d.ts +5 -0
  92. package/{content → graphql}/graphQLHandlerFactory.js +26 -18
  93. package/graphql/graphQLHandlerFactory.js.map +1 -0
  94. package/graphql/index.d.ts +5 -0
  95. package/graphql/index.js +57 -0
  96. package/graphql/index.js.map +1 -0
  97. package/graphql/schema/baseContentSchema.d.ts +3 -0
  98. package/{content/plugins/schema/baseSchema.js → graphql/schema/baseContentSchema.js} +3 -27
  99. package/graphql/schema/baseContentSchema.js.map +1 -0
  100. package/graphql/schema/contentEntries.d.ts +3 -0
  101. package/{content/plugins → graphql}/schema/contentEntries.js +5 -58
  102. package/graphql/schema/contentEntries.js.map +1 -0
  103. package/graphql/schema/contentModelGroups.d.ts +3 -0
  104. package/{content/plugins → graphql}/schema/contentModelGroups.js +27 -11
  105. package/graphql/schema/contentModelGroups.js.map +1 -0
  106. package/graphql/schema/contentModels.d.ts +3 -0
  107. package/{content/plugins → graphql}/schema/contentModels.js +13 -7
  108. package/graphql/schema/contentModels.js.map +1 -0
  109. package/{content/plugins → graphql}/schema/createFieldResolvers.d.ts +1 -1
  110. package/{content/plugins → graphql}/schema/createFieldResolvers.js +1 -1
  111. package/graphql/schema/createFieldResolvers.js.map +1 -0
  112. package/{content/plugins → graphql}/schema/createManageResolvers.d.ts +1 -1
  113. package/{content/plugins → graphql}/schema/createManageResolvers.js +7 -3
  114. package/graphql/schema/createManageResolvers.js.map +1 -0
  115. package/{content/plugins → graphql}/schema/createManageSDL.d.ts +1 -1
  116. package/{content/plugins → graphql}/schema/createManageSDL.js +11 -7
  117. package/graphql/schema/createManageSDL.js.map +1 -0
  118. package/{content/plugins → graphql}/schema/createPreviewResolvers.d.ts +1 -1
  119. package/{content/plugins → graphql}/schema/createPreviewResolvers.js +2 -2
  120. package/graphql/schema/createPreviewResolvers.js.map +1 -0
  121. package/{content/plugins → graphql}/schema/createReadResolvers.d.ts +1 -1
  122. package/{content/plugins → graphql}/schema/createReadResolvers.js +2 -2
  123. package/graphql/schema/createReadResolvers.js.map +1 -0
  124. package/{content/plugins → graphql}/schema/createReadSDL.d.ts +1 -1
  125. package/{content/plugins → graphql}/schema/createReadSDL.js +6 -6
  126. package/graphql/schema/createReadSDL.js.map +1 -0
  127. package/graphql/schema/resolvers/commonFieldResolvers.d.ts +6 -0
  128. package/{content/plugins → graphql}/schema/resolvers/commonFieldResolvers.js +0 -0
  129. package/{content/plugins → graphql}/schema/resolvers/commonFieldResolvers.js.map +0 -0
  130. package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.d.ts +1 -1
  131. package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.js +0 -0
  132. package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.js.map +0 -0
  133. package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.d.ts +1 -1
  134. package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.js +0 -0
  135. package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.js.map +0 -0
  136. package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.d.ts +1 -1
  137. package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.js +0 -0
  138. package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.js.map +0 -0
  139. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGet.d.ts +1 -1
  140. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGet.js +0 -0
  141. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGet.js.map +0 -0
  142. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.d.ts +1 -1
  143. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.js +0 -0
  144. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.js.map +0 -0
  145. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.d.ts +1 -1
  146. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.js +0 -0
  147. package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.js.map +0 -0
  148. package/{content/plugins → graphql}/schema/resolvers/manage/resolveList.d.ts +1 -1
  149. package/{content/plugins → graphql}/schema/resolvers/manage/resolveList.js +0 -0
  150. package/{content/plugins → graphql}/schema/resolvers/manage/resolveList.js.map +0 -0
  151. package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.d.ts +1 -1
  152. package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.js +0 -0
  153. package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.js.map +0 -0
  154. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRepublish.d.ts +1 -1
  155. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRepublish.js +0 -0
  156. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRepublish.js.map +0 -0
  157. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.d.ts +1 -1
  158. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.js +0 -0
  159. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.js.map +0 -0
  160. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.d.ts +1 -1
  161. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.js +0 -0
  162. package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.js.map +0 -0
  163. package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.d.ts +1 -1
  164. package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.js +0 -0
  165. package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.js.map +0 -0
  166. package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.d.ts +1 -1
  167. package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.js +0 -0
  168. package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.js.map +0 -0
  169. package/{content/plugins/schema/resolvers/read → graphql/schema/resolvers/preview}/resolveGet.d.ts +1 -1
  170. package/{content/plugins → graphql}/schema/resolvers/preview/resolveGet.js +0 -0
  171. package/{content/plugins → graphql}/schema/resolvers/preview/resolveGet.js.map +0 -0
  172. package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.d.ts +1 -1
  173. package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.js +0 -0
  174. package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.js.map +0 -0
  175. package/{content/plugins/schema/resolvers/preview → graphql/schema/resolvers/read}/resolveGet.d.ts +1 -1
  176. package/{content/plugins → graphql}/schema/resolvers/read/resolveGet.js +0 -0
  177. package/{content/plugins → graphql}/schema/resolvers/read/resolveGet.js.map +0 -0
  178. package/{content/plugins → graphql}/schema/resolvers/read/resolveList.d.ts +1 -1
  179. package/{content/plugins → graphql}/schema/resolvers/read/resolveList.js +0 -0
  180. package/{content/plugins → graphql}/schema/resolvers/read/resolveList.js.map +0 -0
  181. package/{content/plugins → graphql}/schema/schemaPlugins.d.ts +1 -1
  182. package/{content/plugins → graphql}/schema/schemaPlugins.js +18 -5
  183. package/graphql/schema/schemaPlugins.js.map +1 -0
  184. package/graphql/system.d.ts +6 -0
  185. package/graphql/system.js +119 -0
  186. package/graphql/system.js.map +1 -0
  187. package/graphqlFields/boolean.d.ts +2 -0
  188. package/graphqlFields/boolean.js +69 -0
  189. package/graphqlFields/boolean.js.map +1 -0
  190. package/graphqlFields/datetime.d.ts +2 -0
  191. package/{content/plugins/graphqlFields → graphqlFields}/datetime.js +42 -40
  192. package/graphqlFields/datetime.js.map +1 -0
  193. package/graphqlFields/file.d.ts +2 -0
  194. package/graphqlFields/file.js +50 -0
  195. package/graphqlFields/file.js.map +1 -0
  196. package/{content/plugins/graphqlFields → graphqlFields}/helpers.d.ts +1 -1
  197. package/{content/plugins/graphqlFields → graphqlFields}/helpers.js +0 -0
  198. package/{content/plugins/graphqlFields → graphqlFields}/helpers.js.map +0 -0
  199. package/graphqlFields/index.d.ts +2 -0
  200. package/graphqlFields/index.js +28 -0
  201. package/graphqlFields/index.js.map +1 -0
  202. package/graphqlFields/longText.d.ts +2 -0
  203. package/graphqlFields/longText.js +63 -0
  204. package/graphqlFields/longText.js.map +1 -0
  205. package/graphqlFields/number.d.ts +2 -0
  206. package/graphqlFields/number.js +75 -0
  207. package/graphqlFields/number.js.map +1 -0
  208. package/graphqlFields/object.d.ts +2 -0
  209. package/graphqlFields/object.js +225 -0
  210. package/graphqlFields/object.js.map +1 -0
  211. package/graphqlFields/ref.d.ts +2 -0
  212. package/graphqlFields/ref.js +279 -0
  213. package/graphqlFields/ref.js.map +1 -0
  214. package/graphqlFields/richText.d.ts +2 -0
  215. package/graphqlFields/richText.js +56 -0
  216. package/graphqlFields/richText.js.map +1 -0
  217. package/graphqlFields/text.d.ts +2 -0
  218. package/graphqlFields/text.js +73 -0
  219. package/graphqlFields/text.js.map +1 -0
  220. package/index.d.ts +10 -17
  221. package/index.js +73 -56
  222. package/index.js.map +1 -1
  223. package/modelManager/DefaultCmsModelManager.d.ts +14 -0
  224. package/{content/plugins/modelManager → modelManager}/DefaultCmsModelManager.js +0 -0
  225. package/{content/plugins/modelManager → modelManager}/DefaultCmsModelManager.js.map +0 -0
  226. package/modelManager/index.d.ts +2 -0
  227. package/{content/plugins/modelManager → modelManager}/index.js +3 -3
  228. package/modelManager/index.js.map +1 -0
  229. package/package.json +26 -27
  230. package/parameters/context.d.ts +2 -0
  231. package/parameters/context.js +22 -0
  232. package/parameters/context.js.map +1 -0
  233. package/parameters/header.d.ts +2 -0
  234. package/parameters/header.js +55 -0
  235. package/parameters/header.js.map +1 -0
  236. package/parameters/index.d.ts +4 -0
  237. package/parameters/index.js +57 -0
  238. package/parameters/index.js.map +1 -0
  239. package/parameters/manual.d.ts +6 -0
  240. package/{plugins/context.js → parameters/manual.js} +27 -27
  241. package/parameters/manual.js.map +1 -0
  242. package/parameters/path.d.ts +2 -0
  243. package/parameters/path.js +54 -0
  244. package/parameters/path.js.map +1 -0
  245. package/{content/plugins → plugins}/CmsGroupPlugin.d.ts +1 -1
  246. package/{content/plugins → plugins}/CmsGroupPlugin.js +0 -0
  247. package/{content/plugins → plugins}/CmsGroupPlugin.js.map +0 -0
  248. package/{content/plugins → plugins}/CmsModelPlugin.d.ts +1 -1
  249. package/{content/plugins → plugins}/CmsModelPlugin.js +0 -0
  250. package/{content/plugins → plugins}/CmsModelPlugin.js.map +0 -0
  251. package/{content/plugins → plugins}/CmsParametersPlugin.d.ts +8 -3
  252. package/{content/plugins → plugins}/CmsParametersPlugin.js +0 -0
  253. package/plugins/CmsParametersPlugin.js.map +1 -0
  254. package/{content/plugins/storage → plugins}/StorageTransformPlugin.d.ts +2 -1
  255. package/{content/plugins/storage → plugins}/StorageTransformPlugin.js +1 -0
  256. package/plugins/StorageTransformPlugin.js.map +1 -0
  257. package/plugins/index.d.ts +4 -0
  258. package/plugins/index.js +57 -0
  259. package/plugins/index.js.map +1 -0
  260. package/storage/default.d.ts +2 -0
  261. package/storage/default.js +27 -0
  262. package/storage/default.js.map +1 -0
  263. package/storage/object.d.ts +2 -0
  264. package/{content/plugins/storage → storage}/object.js +63 -64
  265. package/storage/object.js.map +1 -0
  266. package/types.d.ts +28 -3
  267. package/types.js.map +1 -1
  268. package/upgrades/index.d.ts +1 -0
  269. package/upgrades/index.js +10 -0
  270. package/upgrades/index.js.map +1 -0
  271. package/utils/access.d.ts +8 -0
  272. package/utils/access.js +90 -0
  273. package/utils/access.js.map +1 -0
  274. package/{content/plugins/utils → utils}/createTypeName.d.ts +0 -0
  275. package/{content/plugins/utils → utils}/createTypeName.js +0 -0
  276. package/{content/plugins/utils → utils}/createTypeName.js.map +0 -0
  277. package/{content/plugins/utils → utils}/entryStorage.d.ts +1 -1
  278. package/{content/plugins/utils → utils}/entryStorage.js +1 -1
  279. package/utils/entryStorage.js.map +1 -0
  280. package/utils/filterAsync.d.ts +1 -0
  281. package/utils/filterAsync.js +23 -0
  282. package/utils/filterAsync.js.map +1 -0
  283. package/{content/plugins/utils → utils}/getEntryTitle.d.ts +1 -1
  284. package/{content/plugins/utils → utils}/getEntryTitle.js +0 -0
  285. package/{content/plugins/utils → utils}/getEntryTitle.js.map +0 -0
  286. package/{content/plugins/utils → utils}/getSchemaFromFieldPlugins.d.ts +1 -1
  287. package/{content/plugins/utils → utils}/getSchemaFromFieldPlugins.js +0 -0
  288. package/{content/plugins/utils → utils}/getSchemaFromFieldPlugins.js.map +0 -0
  289. package/utils/ownership.d.ts +8 -0
  290. package/utils/ownership.js +39 -0
  291. package/utils/ownership.js.map +1 -0
  292. package/utils/permissions.d.ts +7 -0
  293. package/utils/permissions.js +110 -0
  294. package/utils/permissions.js.map +1 -0
  295. package/{content/plugins/utils → utils}/pluralizedTypeName.d.ts +0 -0
  296. package/{content/plugins/utils → utils}/pluralizedTypeName.js +0 -0
  297. package/{content/plugins/utils → utils}/pluralizedTypeName.js.map +0 -0
  298. package/{content/plugins/utils → utils}/renderFields.d.ts +1 -1
  299. package/{content/plugins/utils → utils}/renderFields.js +0 -0
  300. package/{content/plugins/utils → utils}/renderFields.js.map +0 -0
  301. package/{content/plugins/utils → utils}/renderGetFilterFields.d.ts +1 -1
  302. package/{content/plugins/utils → utils}/renderGetFilterFields.js +0 -0
  303. package/{content/plugins/utils → utils}/renderGetFilterFields.js.map +0 -0
  304. package/{content/plugins/utils → utils}/renderInputFields.d.ts +1 -1
  305. package/{content/plugins/utils → utils}/renderInputFields.js +0 -0
  306. package/{content/plugins/utils → utils}/renderInputFields.js.map +0 -0
  307. package/{content/plugins/utils → utils}/renderListFilterFields.d.ts +1 -1
  308. package/{content/plugins/utils → utils}/renderListFilterFields.js +0 -0
  309. package/{content/plugins/utils → utils}/renderListFilterFields.js.map +0 -0
  310. package/{content/plugins/utils → utils}/renderSortEnum.d.ts +1 -1
  311. package/{content/plugins/utils → utils}/renderSortEnum.js +0 -0
  312. package/{content/plugins/utils → utils}/renderSortEnum.js.map +0 -0
  313. package/utils/toSlug.d.ts +1 -0
  314. package/utils/toSlug.js +20 -0
  315. package/utils/toSlug.js.map +1 -0
  316. package/validators/dateGte.d.ts +2 -0
  317. package/{content/plugins/validators → validators}/dateGte.js +3 -3
  318. package/validators/dateGte.js.map +1 -0
  319. package/validators/dateLte.d.ts +2 -0
  320. package/{content/plugins/validators → validators}/dateLte.js +3 -3
  321. package/validators/dateLte.js.map +1 -0
  322. package/validators/gte.d.ts +2 -0
  323. package/validators/gte.js +36 -0
  324. package/validators/gte.js.map +1 -0
  325. package/validators/in.d.ts +2 -0
  326. package/validators/in.js +36 -0
  327. package/validators/in.js.map +1 -0
  328. package/validators/index.d.ts +1 -0
  329. package/validators/index.js +36 -0
  330. package/validators/index.js.map +1 -0
  331. package/validators/lte.d.ts +2 -0
  332. package/validators/lte.js +36 -0
  333. package/validators/lte.js.map +1 -0
  334. package/validators/maxLength.d.ts +2 -0
  335. package/validators/maxLength.js +36 -0
  336. package/validators/maxLength.js.map +1 -0
  337. package/validators/minLength.d.ts +2 -0
  338. package/validators/minLength.js +36 -0
  339. package/validators/minLength.js.map +1 -0
  340. package/validators/pattern.d.ts +2 -0
  341. package/validators/pattern.js +50 -0
  342. package/validators/pattern.js.map +1 -0
  343. package/validators/patternPlugins/email.d.ts +2 -0
  344. package/validators/patternPlugins/email.js +20 -0
  345. package/validators/patternPlugins/email.js.map +1 -0
  346. package/validators/patternPlugins/index.d.ts +2 -0
  347. package/validators/patternPlugins/index.js +24 -0
  348. package/validators/patternPlugins/index.js.map +1 -0
  349. package/validators/patternPlugins/lowerCase.d.ts +2 -0
  350. package/validators/patternPlugins/lowerCase.js +20 -0
  351. package/validators/patternPlugins/lowerCase.js.map +1 -0
  352. package/validators/patternPlugins/lowerCaseSpace.d.ts +2 -0
  353. package/validators/patternPlugins/lowerCaseSpace.js +20 -0
  354. package/validators/patternPlugins/lowerCaseSpace.js.map +1 -0
  355. package/validators/patternPlugins/upperCase.d.ts +2 -0
  356. package/validators/patternPlugins/upperCase.js +20 -0
  357. package/validators/patternPlugins/upperCase.js.map +1 -0
  358. package/validators/patternPlugins/upperCaseSpace.d.ts +2 -0
  359. package/validators/patternPlugins/upperCaseSpace.js +20 -0
  360. package/validators/patternPlugins/upperCaseSpace.js.map +1 -0
  361. package/validators/patternPlugins/url.d.ts +2 -0
  362. package/validators/patternPlugins/url.js +20 -0
  363. package/validators/patternPlugins/url.js.map +1 -0
  364. package/validators/required.d.ts +2 -0
  365. package/validators/required.js +27 -0
  366. package/validators/required.js.map +1 -0
  367. package/validators/timeGte.d.ts +2 -0
  368. package/{content/plugins/validators → validators}/timeGte.js +3 -3
  369. package/validators/timeGte.js.map +1 -0
  370. package/validators/timeLte.d.ts +2 -0
  371. package/{content/plugins/validators → validators}/timeLte.js +3 -3
  372. package/validators/timeLte.js.map +1 -0
  373. package/{content/plugins/validators → validators}/unique.d.ts +2 -3
  374. package/{content/plugins/validators → validators}/unique.js +3 -3
  375. package/validators/unique.js.map +1 -0
  376. package/content/contextSetup.d.ts +0 -4
  377. package/content/contextSetup.js.map +0 -1
  378. package/content/graphQLHandlerFactory.d.ts +0 -5
  379. package/content/graphQLHandlerFactory.js.map +0 -1
  380. package/content/parameterPlugins.d.ts +0 -6
  381. package/content/parameterPlugins.js +0 -78
  382. package/content/parameterPlugins.js.map +0 -1
  383. package/content/plugins/CmsParametersPlugin.js.map +0 -1
  384. package/content/plugins/buildSchemaPlugins.js +0 -29
  385. package/content/plugins/buildSchemaPlugins.js.map +0 -1
  386. package/content/plugins/crud/contentEntry/entryDataValidation.js.map +0 -1
  387. package/content/plugins/crud/contentEntry/markLockedFields.js.map +0 -1
  388. package/content/plugins/crud/contentEntry.crud.js.map +0 -1
  389. package/content/plugins/crud/contentModel/beforeCreate.js.map +0 -1
  390. package/content/plugins/crud/contentModel/beforeDelete.js.map +0 -1
  391. package/content/plugins/crud/contentModel/beforeUpdate.js.map +0 -1
  392. package/content/plugins/crud/contentModel/createFieldModels.d.ts +0 -2
  393. package/content/plugins/crud/contentModel/idValidation.d.ts +0 -2
  394. package/content/plugins/crud/contentModel/idValidation.js.map +0 -1
  395. package/content/plugins/crud/contentModel/models.js.map +0 -1
  396. package/content/plugins/crud/contentModel/validateModelFields.js.map +0 -1
  397. package/content/plugins/crud/contentModel.crud.js.map +0 -1
  398. package/content/plugins/crud/contentModelGroup/beforeCreate.js.map +0 -1
  399. package/content/plugins/crud/contentModelGroup/beforeDelete.js.map +0 -1
  400. package/content/plugins/crud/contentModelGroup/beforeUpdate.js.map +0 -1
  401. package/content/plugins/crud/contentModelGroup.crud.js.map +0 -1
  402. package/content/plugins/crud/index.d.ts +0 -6
  403. package/content/plugins/crud/index.js.map +0 -1
  404. package/content/plugins/graphqlFields/boolean.d.ts +0 -3
  405. package/content/plugins/graphqlFields/boolean.js +0 -67
  406. package/content/plugins/graphqlFields/boolean.js.map +0 -1
  407. package/content/plugins/graphqlFields/datetime.d.ts +0 -3
  408. package/content/plugins/graphqlFields/datetime.js.map +0 -1
  409. package/content/plugins/graphqlFields/file.d.ts +0 -3
  410. package/content/plugins/graphqlFields/file.js +0 -48
  411. package/content/plugins/graphqlFields/file.js.map +0 -1
  412. package/content/plugins/graphqlFields/index.d.ts +0 -2
  413. package/content/plugins/graphqlFields/index.js +0 -30
  414. package/content/plugins/graphqlFields/index.js.map +0 -1
  415. package/content/plugins/graphqlFields/longText.d.ts +0 -3
  416. package/content/plugins/graphqlFields/longText.js +0 -61
  417. package/content/plugins/graphqlFields/longText.js.map +0 -1
  418. package/content/plugins/graphqlFields/number.d.ts +0 -3
  419. package/content/plugins/graphqlFields/number.js +0 -73
  420. package/content/plugins/graphqlFields/number.js.map +0 -1
  421. package/content/plugins/graphqlFields/object.d.ts +0 -3
  422. package/content/plugins/graphqlFields/object.js +0 -223
  423. package/content/plugins/graphqlFields/object.js.map +0 -1
  424. package/content/plugins/graphqlFields/ref.d.ts +0 -3
  425. package/content/plugins/graphqlFields/ref.js +0 -276
  426. package/content/plugins/graphqlFields/ref.js.map +0 -1
  427. package/content/plugins/graphqlFields/richText.d.ts +0 -3
  428. package/content/plugins/graphqlFields/richText.js +0 -54
  429. package/content/plugins/graphqlFields/richText.js.map +0 -1
  430. package/content/plugins/graphqlFields/text.d.ts +0 -3
  431. package/content/plugins/graphqlFields/text.js +0 -71
  432. package/content/plugins/graphqlFields/text.js.map +0 -1
  433. package/content/plugins/internalSecurity/InternalAuthenticationPlugin.d.ts +0 -8
  434. package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +0 -55
  435. package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js.map +0 -1
  436. package/content/plugins/internalSecurity/InternalAuthorizationPlugin.d.ts +0 -7
  437. package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +0 -36
  438. package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js.map +0 -1
  439. package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +0 -14
  440. package/content/plugins/modelManager/index.d.ts +0 -3
  441. package/content/plugins/modelManager/index.js.map +0 -1
  442. package/content/plugins/schema/baseSchema.d.ts +0 -4
  443. package/content/plugins/schema/baseSchema.js.map +0 -1
  444. package/content/plugins/schema/contentEntries.d.ts +0 -4
  445. package/content/plugins/schema/contentEntries.js.map +0 -1
  446. package/content/plugins/schema/contentModelGroups.d.ts +0 -4
  447. package/content/plugins/schema/contentModelGroups.js.map +0 -1
  448. package/content/plugins/schema/contentModels.d.ts +0 -4
  449. package/content/plugins/schema/contentModels.js.map +0 -1
  450. package/content/plugins/schema/createFieldResolvers.js.map +0 -1
  451. package/content/plugins/schema/createManageResolvers.js.map +0 -1
  452. package/content/plugins/schema/createManageSDL.js.map +0 -1
  453. package/content/plugins/schema/createPreviewResolvers.js.map +0 -1
  454. package/content/plugins/schema/createReadResolvers.js.map +0 -1
  455. package/content/plugins/schema/createReadSDL.js.map +0 -1
  456. package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +0 -6
  457. package/content/plugins/schema/schemaPlugins.js.map +0 -1
  458. package/content/plugins/storage/StorageTransformPlugin.js.map +0 -1
  459. package/content/plugins/storage/default.d.ts +0 -3
  460. package/content/plugins/storage/default.js +0 -28
  461. package/content/plugins/storage/default.js.map +0 -1
  462. package/content/plugins/storage/object.d.ts +0 -3
  463. package/content/plugins/storage/object.js.map +0 -1
  464. package/content/plugins/utils/entryStorage.js.map +0 -1
  465. package/content/plugins/validators/dateGte.d.ts +0 -3
  466. package/content/plugins/validators/dateGte.js.map +0 -1
  467. package/content/plugins/validators/dateLte.d.ts +0 -3
  468. package/content/plugins/validators/dateLte.js.map +0 -1
  469. package/content/plugins/validators/gte.d.ts +0 -3
  470. package/content/plugins/validators/gte.js +0 -34
  471. package/content/plugins/validators/gte.js.map +0 -1
  472. package/content/plugins/validators/in.d.ts +0 -3
  473. package/content/plugins/validators/in.js +0 -34
  474. package/content/plugins/validators/in.js.map +0 -1
  475. package/content/plugins/validators/index.d.ts +0 -2
  476. package/content/plugins/validators/index.js +0 -38
  477. package/content/plugins/validators/index.js.map +0 -1
  478. package/content/plugins/validators/lte.d.ts +0 -3
  479. package/content/plugins/validators/lte.js +0 -34
  480. package/content/plugins/validators/lte.js.map +0 -1
  481. package/content/plugins/validators/maxLength.d.ts +0 -3
  482. package/content/plugins/validators/maxLength.js +0 -34
  483. package/content/plugins/validators/maxLength.js.map +0 -1
  484. package/content/plugins/validators/minLength.d.ts +0 -3
  485. package/content/plugins/validators/minLength.js +0 -34
  486. package/content/plugins/validators/minLength.js.map +0 -1
  487. package/content/plugins/validators/pattern.d.ts +0 -3
  488. package/content/plugins/validators/pattern.js +0 -47
  489. package/content/plugins/validators/pattern.js.map +0 -1
  490. package/content/plugins/validators/patternPlugins/email.d.ts +0 -3
  491. package/content/plugins/validators/patternPlugins/email.js +0 -17
  492. package/content/plugins/validators/patternPlugins/email.js.map +0 -1
  493. package/content/plugins/validators/patternPlugins/index.d.ts +0 -2
  494. package/content/plugins/validators/patternPlugins/index.js +0 -23
  495. package/content/plugins/validators/patternPlugins/index.js.map +0 -1
  496. package/content/plugins/validators/patternPlugins/lowerCase.d.ts +0 -3
  497. package/content/plugins/validators/patternPlugins/lowerCase.js +0 -17
  498. package/content/plugins/validators/patternPlugins/lowerCase.js.map +0 -1
  499. package/content/plugins/validators/patternPlugins/lowerCaseSpace.d.ts +0 -3
  500. package/content/plugins/validators/patternPlugins/lowerCaseSpace.js +0 -17
  501. package/content/plugins/validators/patternPlugins/lowerCaseSpace.js.map +0 -1
  502. package/content/plugins/validators/patternPlugins/upperCase.d.ts +0 -3
  503. package/content/plugins/validators/patternPlugins/upperCase.js +0 -17
  504. package/content/plugins/validators/patternPlugins/upperCase.js.map +0 -1
  505. package/content/plugins/validators/patternPlugins/upperCaseSpace.d.ts +0 -3
  506. package/content/plugins/validators/patternPlugins/upperCaseSpace.js +0 -17
  507. package/content/plugins/validators/patternPlugins/upperCaseSpace.js.map +0 -1
  508. package/content/plugins/validators/patternPlugins/url.d.ts +0 -3
  509. package/content/plugins/validators/patternPlugins/url.js +0 -17
  510. package/content/plugins/validators/patternPlugins/url.js.map +0 -1
  511. package/content/plugins/validators/required.d.ts +0 -3
  512. package/content/plugins/validators/required.js +0 -25
  513. package/content/plugins/validators/required.js.map +0 -1
  514. package/content/plugins/validators/timeGte.d.ts +0 -3
  515. package/content/plugins/validators/timeGte.js.map +0 -1
  516. package/content/plugins/validators/timeLte.d.ts +0 -3
  517. package/content/plugins/validators/timeLte.js.map +0 -1
  518. package/content/plugins/validators/unique.js.map +0 -1
  519. package/migrateCMSPermissions.d.ts +0 -17
  520. package/migrateCMSPermissions.js +0 -199
  521. package/migrateCMSPermissions.js.map +0 -1
  522. package/plugins/context.d.ts +0 -4
  523. package/plugins/context.js.map +0 -1
  524. package/plugins/crud/index.d.ts +0 -6
  525. package/plugins/crud/index.js +0 -108
  526. package/plugins/crud/index.js.map +0 -1
  527. package/plugins/crud/settings.crud.js.map +0 -1
  528. package/plugins/graphql/system.d.ts +0 -18
  529. package/plugins/graphql/system.js +0 -74
  530. package/plugins/graphql/system.js.map +0 -1
  531. package/plugins/graphql.d.ts +0 -2
  532. package/plugins/graphql.js +0 -86
  533. package/plugins/graphql.js.map +0 -1
  534. package/plugins/upgrades/index.d.ts +0 -2
  535. package/plugins/upgrades/index.js +0 -14
  536. package/plugins/upgrades/index.js.map +0 -1
  537. package/plugins/upgrades/v5.5.0/helpers.d.ts +0 -6
  538. package/plugins/upgrades/v5.5.0/helpers.js +0 -10
  539. package/plugins/upgrades/v5.5.0/helpers.js.map +0 -1
  540. package/plugins/upgrades/v5.5.0/index.d.ts +0 -4
  541. package/plugins/upgrades/v5.5.0/index.js +0 -134
  542. package/plugins/upgrades/v5.5.0/index.js.map +0 -1
  543. package/transformers.d.ts +0 -2
  544. package/transformers.js +0 -25
  545. package/transformers.js.map +0 -1
  546. package/utils.d.ts +0 -23
  547. package/utils.js +0 -251
  548. package/utils.js.map +0 -1
@@ -0,0 +1,6 @@
1
+ import { CmsParametersPlugin, CmsParametersPluginResponseLocale, CmsParametersPluginResponseType } from "../plugins/CmsParametersPlugin";
2
+ export interface ManualPluginParams {
3
+ endpointType?: CmsParametersPluginResponseType;
4
+ locale?: CmsParametersPluginResponseLocale;
5
+ }
6
+ export declare const createManualPlugin: (params: ManualPluginParams) => CmsParametersPlugin;
@@ -5,41 +5,41 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.createManualPlugin = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
12
- var _handler = require("@webiny/handler");
12
+ var _error = _interopRequireDefault(require("@webiny/error"));
13
+
14
+ var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
13
15
 
14
16
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
17
 
16
18
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
19
 
18
- const DEFAULT_LOCALE_CODE = "en-US";
19
-
20
- var _default = () => {
21
- return new _handler.ContextPlugin(context => {
22
- context.cms = _objectSpread(_objectSpread({}, context.cms || {}), {}, {
23
- get locale() {
24
- const locale = context.i18n.getContentLocale();
25
- return locale ? locale.code : DEFAULT_LOCALE_CODE;
26
- },
27
-
28
- getLocale() {
29
- const locale = context.i18n.getContentLocale();
30
-
31
- if (!locale) {
32
- return {
33
- code: DEFAULT_LOCALE_CODE,
34
- default: true
35
- };
36
- }
37
-
38
- return locale;
39
- }
40
-
41
- });
20
+ const createManualPlugin = params => {
21
+ return new _CmsParametersPlugin.CmsParametersPlugin(async () => {
22
+ const {
23
+ endpointType: type,
24
+ locale
25
+ } = params;
26
+ /**
27
+ * if both of parameters are not existing, just skip this plugin.
28
+ */
29
+
30
+ if (!type && !locale) {
31
+ return null;
32
+ } else if (!type) {
33
+ throw new _error.default(`There is defined "locale" CMS parameter but no "endpointType".`, "MALFORMED_ENDPOINT_TYPE", _objectSpread({}, params));
34
+ } else if (!locale) {
35
+ throw new _error.default(`There is defined "endpointType" CMS parameter but no "locale".`, "MALFORMED_LOCALE_TYPE", _objectSpread({}, params));
36
+ }
37
+
38
+ return {
39
+ type,
40
+ locale
41
+ };
42
42
  });
43
43
  };
44
44
 
45
- exports.default = _default;
45
+ exports.createManualPlugin = createManualPlugin;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createManualPlugin","params","CmsParametersPlugin","endpointType","type","locale","WebinyError"],"sources":["manual.ts"],"sourcesContent":["/**\n * This would be used for custom Lambdas when there is no path or header information about the endpoint type and locale.\n */\nimport WebinyError from \"@webiny/error\";\nimport {\n CmsParametersPlugin,\n CmsParametersPluginResponseLocale,\n CmsParametersPluginResponseType\n} from \"~/plugins/CmsParametersPlugin\";\n\nexport interface ManualPluginParams {\n endpointType?: CmsParametersPluginResponseType;\n locale?: CmsParametersPluginResponseLocale;\n}\n\nexport const createManualPlugin = (params: ManualPluginParams): CmsParametersPlugin => {\n return new CmsParametersPlugin(async () => {\n const { endpointType: type, locale } = params;\n /**\n * if both of parameters are not existing, just skip this plugin.\n */\n if (!type && !locale) {\n return null;\n } else if (!type) {\n throw new WebinyError(\n `There is defined \"locale\" CMS parameter but no \"endpointType\".`,\n \"MALFORMED_ENDPOINT_TYPE\",\n {\n ...params\n }\n );\n } else if (!locale) {\n throw new WebinyError(\n `There is defined \"endpointType\" CMS parameter but no \"locale\".`,\n \"MALFORMED_LOCALE_TYPE\",\n {\n ...params\n }\n );\n }\n\n return {\n type,\n locale\n };\n });\n};\n"],"mappings":";;;;;;;;;;;AAGA;;AACA;;;;;;AAWO,MAAMA,kBAAkB,GAAIC,MAAD,IAAqD;EACnF,OAAO,IAAIC,wCAAJ,CAAwB,YAAY;IACvC,MAAM;MAAEC,YAAY,EAAEC,IAAhB;MAAsBC;IAAtB,IAAiCJ,MAAvC;IACA;AACR;AACA;;IACQ,IAAI,CAACG,IAAD,IAAS,CAACC,MAAd,EAAsB;MAClB,OAAO,IAAP;IACH,CAFD,MAEO,IAAI,CAACD,IAAL,EAAW;MACd,MAAM,IAAIE,cAAJ,CACD,gEADC,EAEF,yBAFE,oBAIKL,MAJL,EAAN;IAOH,CARM,MAQA,IAAI,CAACI,MAAL,EAAa;MAChB,MAAM,IAAIC,cAAJ,CACD,gEADC,EAEF,uBAFE,oBAIKL,MAJL,EAAN;IAOH;;IAED,OAAO;MACHG,IADG;MAEHC;IAFG,CAAP;EAIH,CA7BM,CAAP;AA8BH,CA/BM"}
@@ -0,0 +1,2 @@
1
+ import { CmsParametersPlugin } from "../plugins/CmsParametersPlugin";
2
+ export declare const createPathParameterPlugin: () => CmsParametersPlugin;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createPathParameterPlugin = void 0;
9
+
10
+ var _error = _interopRequireDefault(require("@webiny/error"));
11
+
12
+ var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
13
+
14
+ const allowedEndpoints = ["manage", "read", "preview"];
15
+
16
+ const createPathParameterPlugin = () => {
17
+ return new _CmsParametersPlugin.CmsParametersPlugin(async context => {
18
+ var _context$http, _context$http$request, _context$http$request2;
19
+
20
+ /**
21
+ * If any of the properties is not defined, just ignore this plugin
22
+ */
23
+ if (!((_context$http = context.http) !== null && _context$http !== void 0 && (_context$http$request = _context$http.request) !== null && _context$http$request !== void 0 && (_context$http$request2 = _context$http$request.path) !== null && _context$http$request2 !== void 0 && _context$http$request2.parameters)) {
24
+ return null;
25
+ }
26
+
27
+ const {
28
+ key
29
+ } = context.http.request.path.parameters;
30
+
31
+ if (typeof key !== "string") {
32
+ throw new _error.default("The key property in context.http.request.path.parameters is not a string.", "MALFORMED_KEY", {
33
+ key
34
+ });
35
+ }
36
+
37
+ const [type, locale] = key.split("/");
38
+
39
+ if (!type) {
40
+ throw new _error.default(`Missing context.http.request.path.parameters.key parameter "type".`);
41
+ } else if (!locale) {
42
+ throw new _error.default(`Missing context.http.request.path.parameters.key "locale".`);
43
+ } else if (allowedEndpoints.includes(type) === false) {
44
+ throw new _error.default(`Endpoint "${type}" not allowed!`);
45
+ }
46
+
47
+ return {
48
+ type: type,
49
+ locale
50
+ };
51
+ });
52
+ };
53
+
54
+ exports.createPathParameterPlugin = createPathParameterPlugin;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["allowedEndpoints","createPathParameterPlugin","CmsParametersPlugin","context","http","request","path","parameters","key","WebinyError","type","locale","split","includes"],"sources":["path.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsParametersPlugin } from \"~/plugins/CmsParametersPlugin\";\nimport { ApiEndpoint } from \"~/types\";\n\nconst allowedEndpoints: ApiEndpoint[] = [\"manage\", \"read\", \"preview\"];\n\nexport const createPathParameterPlugin = () => {\n return new CmsParametersPlugin(async context => {\n /**\n * If any of the properties is not defined, just ignore this plugin\n */\n if (!context.http?.request?.path?.parameters) {\n return null;\n }\n\n const { key } = context.http.request.path.parameters;\n if (typeof key !== \"string\") {\n throw new WebinyError(\n \"The key property in context.http.request.path.parameters is not a string.\",\n \"MALFORMED_KEY\",\n {\n key\n }\n );\n }\n const [type, locale] = key.split(\"/\");\n if (!type) {\n throw new WebinyError(\n `Missing context.http.request.path.parameters.key parameter \"type\".`\n );\n } else if (!locale) {\n throw new WebinyError(`Missing context.http.request.path.parameters.key \"locale\".`);\n } else if (allowedEndpoints.includes(type as ApiEndpoint) === false) {\n throw new WebinyError(`Endpoint \"${type}\" not allowed!`);\n }\n\n return {\n type: type as ApiEndpoint,\n locale\n };\n });\n};\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAGA,MAAMA,gBAA+B,GAAG,CAAC,QAAD,EAAW,MAAX,EAAmB,SAAnB,CAAxC;;AAEO,MAAMC,yBAAyB,GAAG,MAAM;EAC3C,OAAO,IAAIC,wCAAJ,CAAwB,MAAMC,OAAN,IAAiB;IAAA;;IAC5C;AACR;AACA;IACQ,IAAI,mBAACA,OAAO,CAACC,IAAT,mEAAC,cAAcC,OAAf,4EAAC,sBAAuBC,IAAxB,mDAAC,uBAA6BC,UAA9B,CAAJ,EAA8C;MAC1C,OAAO,IAAP;IACH;;IAED,MAAM;MAAEC;IAAF,IAAUL,OAAO,CAACC,IAAR,CAAaC,OAAb,CAAqBC,IAArB,CAA0BC,UAA1C;;IACA,IAAI,OAAOC,GAAP,KAAe,QAAnB,EAA6B;MACzB,MAAM,IAAIC,cAAJ,CACF,2EADE,EAEF,eAFE,EAGF;QACID;MADJ,CAHE,CAAN;IAOH;;IACD,MAAM,CAACE,IAAD,EAAOC,MAAP,IAAiBH,GAAG,CAACI,KAAJ,CAAU,GAAV,CAAvB;;IACA,IAAI,CAACF,IAAL,EAAW;MACP,MAAM,IAAID,cAAJ,CACD,oEADC,CAAN;IAGH,CAJD,MAIO,IAAI,CAACE,MAAL,EAAa;MAChB,MAAM,IAAIF,cAAJ,CAAiB,4DAAjB,CAAN;IACH,CAFM,MAEA,IAAIT,gBAAgB,CAACa,QAAjB,CAA0BH,IAA1B,MAAmD,KAAvD,EAA8D;MACjE,MAAM,IAAID,cAAJ,CAAiB,aAAYC,IAAK,gBAAlC,CAAN;IACH;;IAED,OAAO;MACHA,IAAI,EAAEA,IADH;MAEHC;IAFG,CAAP;EAIH,CAjCM,CAAP;AAkCH,CAnCM"}
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { CmsGroup as BaseCmsGroup } from "../../types";
2
+ import { CmsGroup as BaseCmsGroup } from "../types";
3
3
  export interface CmsGroup extends Omit<BaseCmsGroup, "locale" | "tenant" | "webinyVersion"> {
4
4
  tenant?: string;
5
5
  locale?: string;
File without changes
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { CmsModel as CmsModelBase } from "../../types";
2
+ import { CmsModel as CmsModelBase } from "../types";
3
3
  export interface CmsModel extends Omit<CmsModelBase, "locale" | "tenant" | "webinyVersion"> {
4
4
  locale?: string;
5
5
  tenant?: string;
File without changes
@@ -1,8 +1,13 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { CmsContext } from "../../types";
2
+ import { ApiEndpoint, CmsContext } from "../types";
3
+ /**
4
+ * Type can be null because it might be that Headless CMS context is loaded on a different Lambda where there is no GraphQL Schema generated.
5
+ */
6
+ export declare type CmsParametersPluginResponseType = ApiEndpoint | null;
7
+ export declare type CmsParametersPluginResponseLocale = string;
3
8
  export interface CmsParametersPluginResponse {
4
- type: "read" | "manage" | "preview" | string;
5
- locale: string;
9
+ type: CmsParametersPluginResponseType;
10
+ locale: CmsParametersPluginResponseLocale;
6
11
  }
7
12
  export interface CmsParametersPluginCallable {
8
13
  (context: CmsContext): Promise<CmsParametersPluginResponse | null>;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CmsParametersPlugin","Plugin","constructor","callable","getParameters","context"],"sources":["CmsParametersPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ApiEndpoint, CmsContext } from \"~/types\";\n\n/**\n * Type can be null because it might be that Headless CMS context is loaded on a different Lambda where there is no GraphQL Schema generated.\n */\nexport type CmsParametersPluginResponseType = ApiEndpoint | null;\nexport type CmsParametersPluginResponseLocale = string;\n\nexport interface CmsParametersPluginResponse {\n type: CmsParametersPluginResponseType;\n locale: CmsParametersPluginResponseLocale;\n}\n\nexport interface CmsParametersPluginCallable {\n (context: CmsContext): Promise<CmsParametersPluginResponse | null>;\n}\n\nexport class CmsParametersPlugin extends Plugin {\n public static override readonly type: string = \"cms-parameters-plugin\";\n\n private readonly callable: CmsParametersPluginCallable;\n\n public constructor(callable: CmsParametersPluginCallable) {\n super();\n\n this.callable = callable;\n }\n\n public async getParameters(context: CmsContext): Promise<CmsParametersPluginResponse | null> {\n return this.callable(context);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAkBO,MAAMA,mBAAN,SAAkCC,eAAlC,CAAyC;EAKrCC,WAAW,CAACC,QAAD,EAAwC;IACtD;IADsD;IAGtD,KAAKA,QAAL,GAAgBA,QAAhB;EACH;;EAEyB,MAAbC,aAAa,CAACC,OAAD,EAAmE;IACzF,OAAO,KAAKF,QAAL,CAAcE,OAAd,CAAP;EACH;;AAb2C;;;8BAAnCL,mB,UACsC,uB"}
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins/Plugin";
2
- import { CmsModel, CmsModelField } from "../../../types";
2
+ import { CmsModel, CmsModelField } from "../types";
3
3
  import { PluginsContainer } from "@webiny/plugins";
4
4
  export interface ToStorageParams<T> {
5
5
  model: CmsModel;
@@ -16,6 +16,7 @@ export interface FromStorageParams<T> {
16
16
  plugins: PluginsContainer;
17
17
  }
18
18
  export interface StorageTransformPluginParams<T, R> {
19
+ name?: string;
19
20
  fieldType: string;
20
21
  toStorage: (params: ToStorageParams<T>) => Promise<R>;
21
22
  fromStorage: (params: FromStorageParams<R>) => Promise<T>;
@@ -19,6 +19,7 @@ class StorageTransformPlugin extends _Plugin.Plugin {
19
19
  constructor(config) {
20
20
  super();
21
21
  (0, _defineProperty2.default)(this, "config", void 0);
22
+ this.name = config.name;
22
23
  this.config = config;
23
24
  }
24
25
 
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StorageTransformPlugin","Plugin","fieldType","config","constructor","name","toStorage","params","fromStorage"],"sources":["StorageTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { CmsModel, CmsModelField } from \"~/types\";\nimport { PluginsContainer } from \"@webiny/plugins\";\n\nexport interface ToStorageParams<T> {\n model: CmsModel;\n field: CmsModelField;\n value: T;\n getStoragePlugin(fieldType: string): StorageTransformPlugin<T>;\n plugins: PluginsContainer;\n}\n\nexport interface FromStorageParams<T> {\n model: CmsModel;\n field: CmsModelField;\n value: T;\n getStoragePlugin(fieldType: string): StorageTransformPlugin<T>;\n plugins: PluginsContainer;\n}\n\nexport interface StorageTransformPluginParams<T, R> {\n name?: string;\n fieldType: string;\n toStorage: (params: ToStorageParams<T>) => Promise<R>;\n fromStorage: (params: FromStorageParams<R>) => Promise<T>;\n}\nexport class StorageTransformPlugin<T = any, R = any> extends Plugin {\n public static override readonly type: string = \"cms.storage.transform.plugin\";\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n private readonly config: StorageTransformPluginParams<T, R>;\n\n public constructor(config: StorageTransformPluginParams<T, R>) {\n super();\n this.name = config.name;\n this.config = config;\n }\n\n public toStorage(params: ToStorageParams<T>): Promise<R> {\n return this.config.toStorage(params);\n }\n\n public fromStorage(params: FromStorageParams<R>): Promise<T> {\n return this.config.fromStorage(params);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AA0BO,MAAMA,sBAAN,SAAuDC,cAAvD,CAA8D;EAE7C,IAATC,SAAS,GAAW;IAC3B,OAAO,KAAKC,MAAL,CAAYD,SAAnB;EACH;;EAIME,WAAW,CAACD,MAAD,EAA6C;IAC3D;IAD2D;IAE3D,KAAKE,IAAL,GAAYF,MAAM,CAACE,IAAnB;IACA,KAAKF,MAAL,GAAcA,MAAd;EACH;;EAEMG,SAAS,CAACC,MAAD,EAAyC;IACrD,OAAO,KAAKJ,MAAL,CAAYG,SAAZ,CAAsBC,MAAtB,CAAP;EACH;;EAEMC,WAAW,CAACD,MAAD,EAA2C;IACzD,OAAO,KAAKJ,MAAL,CAAYK,WAAZ,CAAwBD,MAAxB,CAAP;EACH;;AApBgE;;;8BAAxDP,sB,UACsC,8B"}
@@ -0,0 +1,4 @@
1
+ export * from "./CmsGroupPlugin";
2
+ export * from "./CmsModelPlugin";
3
+ export * from "./StorageTransformPlugin";
4
+ export * from "./CmsParametersPlugin";
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _CmsGroupPlugin = require("./CmsGroupPlugin");
8
+
9
+ Object.keys(_CmsGroupPlugin).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _CmsGroupPlugin[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _CmsGroupPlugin[key];
16
+ }
17
+ });
18
+ });
19
+
20
+ var _CmsModelPlugin = require("./CmsModelPlugin");
21
+
22
+ Object.keys(_CmsModelPlugin).forEach(function (key) {
23
+ if (key === "default" || key === "__esModule") return;
24
+ if (key in exports && exports[key] === _CmsModelPlugin[key]) return;
25
+ Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _CmsModelPlugin[key];
29
+ }
30
+ });
31
+ });
32
+
33
+ var _StorageTransformPlugin = require("./StorageTransformPlugin");
34
+
35
+ Object.keys(_StorageTransformPlugin).forEach(function (key) {
36
+ if (key === "default" || key === "__esModule") return;
37
+ if (key in exports && exports[key] === _StorageTransformPlugin[key]) return;
38
+ Object.defineProperty(exports, key, {
39
+ enumerable: true,
40
+ get: function () {
41
+ return _StorageTransformPlugin[key];
42
+ }
43
+ });
44
+ });
45
+
46
+ var _CmsParametersPlugin = require("./CmsParametersPlugin");
47
+
48
+ Object.keys(_CmsParametersPlugin).forEach(function (key) {
49
+ if (key === "default" || key === "__esModule") return;
50
+ if (key in exports && exports[key] === _CmsParametersPlugin[key]) return;
51
+ Object.defineProperty(exports, key, {
52
+ enumerable: true,
53
+ get: function () {
54
+ return _CmsParametersPlugin[key];
55
+ }
56
+ });
57
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsGroupPlugin\";\nexport * from \"./CmsModelPlugin\";\nexport * from \"./StorageTransformPlugin\";\nexport * from \"./CmsParametersPlugin\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,2 @@
1
+ import { StorageTransformPlugin } from "../plugins/StorageTransformPlugin";
2
+ export declare const createDefaultStorageTransform: () => StorageTransformPlugin;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createDefaultStorageTransform = void 0;
7
+
8
+ var _StorageTransformPlugin = require("../plugins/StorageTransformPlugin");
9
+
10
+ const createDefaultStorageTransform = () => {
11
+ return new _StorageTransformPlugin.StorageTransformPlugin({
12
+ name: "headless-cms.storage-transform.all.default",
13
+ fieldType: "*",
14
+ fromStorage: async ({
15
+ value
16
+ }) => {
17
+ return value;
18
+ },
19
+ toStorage: async ({
20
+ value
21
+ }) => {
22
+ return value;
23
+ }
24
+ });
25
+ };
26
+
27
+ exports.createDefaultStorageTransform = createDefaultStorageTransform;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createDefaultStorageTransform","StorageTransformPlugin","name","fieldType","fromStorage","value","toStorage"],"sources":["default.ts"],"sourcesContent":["import { StorageTransformPlugin } from \"~/plugins/StorageTransformPlugin\";\n\nexport const createDefaultStorageTransform = (): StorageTransformPlugin => {\n return new StorageTransformPlugin({\n name: \"headless-cms.storage-transform.all.default\",\n fieldType: \"*\",\n fromStorage: async ({ value }) => {\n return value;\n },\n toStorage: async ({ value }) => {\n return value;\n }\n });\n};\n"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,6BAA6B,GAAG,MAA8B;EACvE,OAAO,IAAIC,8CAAJ,CAA2B;IAC9BC,IAAI,EAAE,4CADwB;IAE9BC,SAAS,EAAE,GAFmB;IAG9BC,WAAW,EAAE,OAAO;MAAEC;IAAF,CAAP,KAAqB;MAC9B,OAAOA,KAAP;IACH,CAL6B;IAM9BC,SAAS,EAAE,OAAO;MAAED;IAAF,CAAP,KAAqB;MAC5B,OAAOA,KAAP;IACH;EAR6B,CAA3B,CAAP;AAUH,CAXM"}
@@ -0,0 +1,2 @@
1
+ import { StorageTransformPlugin } from "../plugins/StorageTransformPlugin";
2
+ export declare const createObjectStorageTransform: () => StorageTransformPlugin;
@@ -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.default = void 0;
8
+ exports.createObjectStorageTransform = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
@@ -13,7 +13,7 @@ var _pReduce = _interopRequireDefault(require("p-reduce"));
13
13
 
14
14
  var _pMap = _interopRequireDefault(require("p-map"));
15
15
 
16
- var _StorageTransformPlugin = require("./StorageTransformPlugin");
16
+ var _StorageTransformPlugin = require("../plugins/StorageTransformPlugin");
17
17
 
18
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
19
 
@@ -48,82 +48,81 @@ const processValue = async params => {
48
48
  }, {});
49
49
  };
50
50
 
51
- const plugin = new _StorageTransformPlugin.StorageTransformPlugin({
52
- fieldType: "object",
53
- toStorage: async ({
54
- field,
55
- value,
56
- getStoragePlugin,
57
- model,
58
- plugins
59
- }) => {
60
- var _field$settings;
61
-
62
- if (!value) {
63
- return null;
64
- }
65
-
66
- const fields = ((_field$settings = field.settings) === null || _field$settings === void 0 ? void 0 : _field$settings.fields) || [];
67
-
68
- if (field.multipleValues) {
69
- return await (0, _pMap.default)(value, value => processValue({
51
+ const createObjectStorageTransform = () => {
52
+ return new _StorageTransformPlugin.StorageTransformPlugin({
53
+ name: "headless-cms.storage-transform.object.default",
54
+ fieldType: "object",
55
+ toStorage: async ({
56
+ field,
57
+ value,
58
+ getStoragePlugin,
59
+ model,
60
+ plugins
61
+ }) => {
62
+ var _field$settings;
63
+
64
+ if (!value) {
65
+ return null;
66
+ }
67
+
68
+ const fields = ((_field$settings = field.settings) === null || _field$settings === void 0 ? void 0 : _field$settings.fields) || [];
69
+
70
+ if (field.multipleValues) {
71
+ return await (0, _pMap.default)(value, value => processValue({
72
+ sourceValue: value,
73
+ getStoragePlugin,
74
+ model,
75
+ plugins,
76
+ operation: "toStorage",
77
+ fields
78
+ }));
79
+ }
80
+
81
+ return await processValue({
70
82
  sourceValue: value,
71
83
  getStoragePlugin,
72
84
  model,
73
85
  plugins,
74
86
  operation: "toStorage",
75
87
  fields
76
- }));
77
- }
78
-
79
- return processValue({
80
- sourceValue: value,
88
+ });
89
+ },
90
+ fromStorage: async ({
91
+ field,
92
+ value,
81
93
  getStoragePlugin,
82
- model,
83
94
  plugins,
84
- operation: "toStorage",
85
- fields
86
- });
87
- },
88
- fromStorage: async ({
89
- field,
90
- value,
91
- getStoragePlugin,
92
- plugins,
93
- model
94
- }) => {
95
- var _field$settings2;
96
-
97
- if (!value) {
98
- return null;
99
- }
100
-
101
- const fields = ((_field$settings2 = field.settings) === null || _field$settings2 === void 0 ? void 0 : _field$settings2.fields) || [];
102
-
103
- if (field.multipleValues) {
104
- return (0, _pMap.default)(value, value => processValue({
95
+ model
96
+ }) => {
97
+ var _field$settings2;
98
+
99
+ if (!value) {
100
+ return null;
101
+ }
102
+
103
+ const fields = ((_field$settings2 = field.settings) === null || _field$settings2 === void 0 ? void 0 : _field$settings2.fields) || [];
104
+
105
+ if (field.multipleValues) {
106
+ return (0, _pMap.default)(value, value => processValue({
107
+ sourceValue: value,
108
+ getStoragePlugin,
109
+ model,
110
+ plugins,
111
+ operation: "fromStorage",
112
+ fields
113
+ }));
114
+ }
115
+
116
+ return processValue({
105
117
  sourceValue: value,
106
118
  getStoragePlugin,
107
119
  model,
108
120
  plugins,
109
121
  operation: "fromStorage",
110
122
  fields
111
- }));
123
+ });
112
124
  }
113
-
114
- return processValue({
115
- sourceValue: value,
116
- getStoragePlugin,
117
- model,
118
- plugins,
119
- operation: "fromStorage",
120
- fields
121
- });
122
- }
123
- });
124
-
125
- var _default = () => {
126
- return plugin;
125
+ });
127
126
  };
128
127
 
129
- exports.default = _default;
128
+ exports.createObjectStorageTransform = createObjectStorageTransform;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["processValue","params","fields","sourceValue","getStoragePlugin","plugins","model","operation","pReduce","values","field","plugin","type","Error","value","fieldId","createObjectStorageTransform","StorageTransformPlugin","name","fieldType","toStorage","settings","multipleValues","pMap","fromStorage"],"sources":["object.ts"],"sourcesContent":["import pReduce from \"p-reduce\";\nimport pMap from \"p-map\";\nimport { CmsModel, CmsModelField } from \"~/types\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { StorageTransformPlugin } from \"~/plugins/StorageTransformPlugin\";\n\ninterface ProcessValueParams {\n fields: CmsModelField[];\n sourceValue: Record<string, any>;\n getStoragePlugin: (fieldType: string) => StorageTransformPlugin;\n plugins: PluginsContainer;\n model: CmsModel;\n operation: \"toStorage\" | \"fromStorage\";\n}\ninterface ProcessValue {\n (params: ProcessValueParams): Promise<Record<string, any>>;\n}\n\nconst processValue: ProcessValue = async params => {\n const { fields, sourceValue, getStoragePlugin, plugins, model, operation } = params;\n return await pReduce(\n fields,\n async (values, field) => {\n const plugin = getStoragePlugin(field.type);\n if (!plugin) {\n throw new Error(`Missing storage plugin for field type \"${field.type}\".`);\n }\n const value = await plugin[operation]({\n plugins,\n model,\n field,\n value: sourceValue[field.fieldId],\n getStoragePlugin\n });\n return { ...values, [field.fieldId]: value };\n },\n {}\n );\n};\n\nexport const createObjectStorageTransform = (): StorageTransformPlugin => {\n return new StorageTransformPlugin({\n name: \"headless-cms.storage-transform.object.default\",\n fieldType: \"object\",\n toStorage: async ({ field, value, getStoragePlugin, model, plugins }) => {\n if (!value) {\n return null;\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n if (field.multipleValues) {\n return await pMap(value as Record<string, any>[], value =>\n processValue({\n sourceValue: value,\n getStoragePlugin,\n model,\n plugins,\n operation: \"toStorage\",\n fields\n })\n );\n }\n\n return await processValue({\n sourceValue: value,\n getStoragePlugin,\n model,\n plugins,\n operation: \"toStorage\",\n fields\n });\n },\n fromStorage: async ({ field, value, getStoragePlugin, plugins, model }) => {\n if (!value) {\n return null;\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n if (field.multipleValues) {\n return pMap(value as Record<string, any>[], value =>\n processValue({\n sourceValue: value,\n getStoragePlugin,\n model,\n plugins,\n operation: \"fromStorage\",\n fields\n })\n );\n }\n\n return processValue({\n sourceValue: value,\n getStoragePlugin,\n model,\n plugins,\n operation: \"fromStorage\",\n fields\n });\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAGA;;;;;;AAcA,MAAMA,YAA0B,GAAG,MAAMC,MAAN,IAAgB;EAC/C,MAAM;IAAEC,MAAF;IAAUC,WAAV;IAAuBC,gBAAvB;IAAyCC,OAAzC;IAAkDC,KAAlD;IAAyDC;EAAzD,IAAuEN,MAA7E;EACA,OAAO,MAAM,IAAAO,gBAAA,EACTN,MADS,EAET,OAAOO,MAAP,EAAeC,KAAf,KAAyB;IACrB,MAAMC,MAAM,GAAGP,gBAAgB,CAACM,KAAK,CAACE,IAAP,CAA/B;;IACA,IAAI,CAACD,MAAL,EAAa;MACT,MAAM,IAAIE,KAAJ,CAAW,0CAAyCH,KAAK,CAACE,IAAK,IAA/D,CAAN;IACH;;IACD,MAAME,KAAK,GAAG,MAAMH,MAAM,CAACJ,SAAD,CAAN,CAAkB;MAClCF,OADkC;MAElCC,KAFkC;MAGlCI,KAHkC;MAIlCI,KAAK,EAAEX,WAAW,CAACO,KAAK,CAACK,OAAP,CAJgB;MAKlCX;IALkC,CAAlB,CAApB;IAOA,uCAAYK,MAAZ;MAAoB,CAACC,KAAK,CAACK,OAAP,GAAiBD;IAArC;EACH,CAfQ,EAgBT,EAhBS,CAAb;AAkBH,CApBD;;AAsBO,MAAME,4BAA4B,GAAG,MAA8B;EACtE,OAAO,IAAIC,8CAAJ,CAA2B;IAC9BC,IAAI,EAAE,+CADwB;IAE9BC,SAAS,EAAE,QAFmB;IAG9BC,SAAS,EAAE,OAAO;MAAEV,KAAF;MAASI,KAAT;MAAgBV,gBAAhB;MAAkCE,KAAlC;MAAyCD;IAAzC,CAAP,KAA8D;MAAA;;MACrE,IAAI,CAACS,KAAL,EAAY;QACR,OAAO,IAAP;MACH;;MAED,MAAMZ,MAAM,GAAI,oBAAAQ,KAAK,CAACW,QAAN,oEAAgBnB,MAAhB,KAA0B,EAA1C;;MAEA,IAAIQ,KAAK,CAACY,cAAV,EAA0B;QACtB,OAAO,MAAM,IAAAC,aAAA,EAAKT,KAAL,EAAqCA,KAAK,IACnDd,YAAY,CAAC;UACTG,WAAW,EAAEW,KADJ;UAETV,gBAFS;UAGTE,KAHS;UAITD,OAJS;UAKTE,SAAS,EAAE,WALF;UAMTL;QANS,CAAD,CADH,CAAb;MAUH;;MAED,OAAO,MAAMF,YAAY,CAAC;QACtBG,WAAW,EAAEW,KADS;QAEtBV,gBAFsB;QAGtBE,KAHsB;QAItBD,OAJsB;QAKtBE,SAAS,EAAE,WALW;QAMtBL;MANsB,CAAD,CAAzB;IAQH,CA/B6B;IAgC9BsB,WAAW,EAAE,OAAO;MAAEd,KAAF;MAASI,KAAT;MAAgBV,gBAAhB;MAAkCC,OAAlC;MAA2CC;IAA3C,CAAP,KAA8D;MAAA;;MACvE,IAAI,CAACQ,KAAL,EAAY;QACR,OAAO,IAAP;MACH;;MAED,MAAMZ,MAAM,GAAI,qBAAAQ,KAAK,CAACW,QAAN,sEAAgBnB,MAAhB,KAA0B,EAA1C;;MAEA,IAAIQ,KAAK,CAACY,cAAV,EAA0B;QACtB,OAAO,IAAAC,aAAA,EAAKT,KAAL,EAAqCA,KAAK,IAC7Cd,YAAY,CAAC;UACTG,WAAW,EAAEW,KADJ;UAETV,gBAFS;UAGTE,KAHS;UAITD,OAJS;UAKTE,SAAS,EAAE,aALF;UAMTL;QANS,CAAD,CADT,CAAP;MAUH;;MAED,OAAOF,YAAY,CAAC;QAChBG,WAAW,EAAEW,KADG;QAEhBV,gBAFgB;QAGhBE,KAHgB;QAIhBD,OAJgB;QAKhBE,SAAS,EAAE,aALK;QAMhBL;MANgB,CAAD,CAAnB;IAQH;EA5D6B,CAA3B,CAAP;AA8DH,CA/DM"}
package/types.d.ts CHANGED
@@ -14,7 +14,7 @@ export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGr
14
14
  /**
15
15
  * API type
16
16
  */
17
- type: ApiEndpoint;
17
+ type: ApiEndpoint | null;
18
18
  /**
19
19
  * Requested locale
20
20
  */
@@ -384,6 +384,12 @@ export interface CmsModel {
384
384
  * The version of Webiny which this record was stored with.
385
385
  */
386
386
  webinyVersion: string;
387
+ /**
388
+ * Is model private?
389
+ * This is meant to be used for some internal models - will not be visible in the schema.
390
+ * Only available for the plugin constructed models.
391
+ */
392
+ isPrivate?: boolean;
387
393
  }
388
394
  /**
389
395
  * @category ModelField
@@ -831,6 +837,12 @@ export interface CmsGroup {
831
837
  * Which Webiny version was this record stored with.
832
838
  */
833
839
  webinyVersion: string;
840
+ /**
841
+ * Is group private?
842
+ * This is meant to be used for some internal groups - will not be visible in the schema.
843
+ * Only available for the plugin constructed groups.
844
+ */
845
+ isPrivate?: boolean;
834
846
  }
835
847
  /**
836
848
  * A data.where parameter received when listing content model groups.
@@ -1203,7 +1215,20 @@ export interface CmsEntry {
1203
1215
  *
1204
1216
  * @see CmsModelField
1205
1217
  */
1206
- values: Record<string, any>;
1218
+ values: {
1219
+ [key: string]: any;
1220
+ };
1221
+ /**
1222
+ * Settings for the given entry.
1223
+ *
1224
+ * Introduced with Advanced Publishing Workflow - will be always inserted after this PR is merged.
1225
+ * Be aware that when accessing properties in it on old systems - it will break if not checked first.
1226
+ *
1227
+ * Available only on the Manage API in entry GraphQL type meta.data property.
1228
+ */
1229
+ meta?: {
1230
+ [key: string]: any;
1231
+ };
1207
1232
  }
1208
1233
  export interface CmsStorageEntry extends CmsEntry {
1209
1234
  [key: string]: any;
@@ -1662,7 +1687,7 @@ export interface CmsEntryContext {
1662
1687
  /**
1663
1688
  * Update existing entry.
1664
1689
  */
1665
- updateEntry: (model: CmsModel, id: string, input: UpdateCmsEntryInput) => Promise<CmsEntry>;
1690
+ updateEntry: (model: CmsModel, id: string, input: UpdateCmsEntryInput, meta?: Record<string, any>) => Promise<CmsEntry>;
1666
1691
  /**
1667
1692
  * Method that republishes entry with given identifier.
1668
1693
  * @internal