contentful-management 11.48.3 → 11.49.0-beta.2

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 (596) hide show
  1. package/README.md +73 -48
  2. package/dist/contentful-management.browser.js +23430 -27836
  3. package/dist/contentful-management.browser.min.js +1 -2
  4. package/dist/contentful-management.cjs +36550 -0
  5. package/dist/{es-modules → esm}/adapters/REST/endpoints/access-token.js +20 -22
  6. package/dist/esm/adapters/REST/endpoints/api-key.js +41 -0
  7. package/dist/esm/adapters/REST/endpoints/app-access-token.js +7 -0
  8. package/dist/esm/adapters/REST/endpoints/app-action-call.js +61 -0
  9. package/dist/esm/adapters/REST/endpoints/app-action.js +35 -0
  10. package/dist/esm/adapters/REST/endpoints/app-bundle.js +34 -0
  11. package/dist/esm/adapters/REST/endpoints/app-definition.js +39 -0
  12. package/dist/esm/adapters/REST/endpoints/app-details.js +13 -0
  13. package/dist/esm/adapters/REST/endpoints/app-event-subscription.js +13 -0
  14. package/dist/esm/adapters/REST/endpoints/app-installation.js +35 -0
  15. package/dist/esm/adapters/REST/endpoints/app-key.js +16 -0
  16. package/dist/esm/adapters/REST/endpoints/app-signed-request.js +7 -0
  17. package/dist/esm/adapters/REST/endpoints/app-signing-secret.js +13 -0
  18. package/dist/esm/adapters/REST/endpoints/app-upload.js +24 -0
  19. package/dist/esm/adapters/REST/endpoints/asset-key.js +31 -0
  20. package/dist/esm/adapters/REST/endpoints/asset.js +170 -0
  21. package/dist/esm/adapters/REST/endpoints/bulk-action.js +16 -0
  22. package/dist/esm/adapters/REST/endpoints/comment.js +85 -0
  23. package/dist/esm/adapters/REST/endpoints/concept-scheme.js +40 -0
  24. package/dist/esm/adapters/REST/endpoints/concept.js +59 -0
  25. package/dist/esm/adapters/REST/endpoints/content-type.js +47 -0
  26. package/dist/esm/adapters/REST/endpoints/editor-interface.js +20 -0
  27. package/dist/esm/adapters/REST/endpoints/entry.js +90 -0
  28. package/dist/esm/adapters/REST/endpoints/environment-alias.js +38 -0
  29. package/dist/esm/adapters/REST/endpoints/environment-template-installation.js +20 -0
  30. package/dist/esm/adapters/REST/endpoints/environment-template.js +38 -0
  31. package/dist/esm/adapters/REST/endpoints/environment.js +40 -0
  32. package/dist/esm/adapters/REST/endpoints/extension.js +36 -0
  33. package/dist/esm/adapters/REST/endpoints/function-log.js +20 -0
  34. package/dist/esm/adapters/REST/endpoints/function.js +21 -0
  35. package/dist/esm/adapters/REST/endpoints/http.js +22 -0
  36. package/dist/esm/adapters/REST/endpoints/index.js +133 -0
  37. package/dist/esm/adapters/REST/endpoints/locale.js +31 -0
  38. package/dist/{es-modules → esm}/adapters/REST/endpoints/oauth-application.js +21 -22
  39. package/dist/esm/adapters/REST/endpoints/organization-invitation.js +20 -0
  40. package/dist/esm/adapters/REST/endpoints/organization-membership.js +27 -0
  41. package/dist/esm/adapters/REST/endpoints/organization.js +25 -0
  42. package/dist/esm/adapters/REST/endpoints/personal-access-token.js +32 -0
  43. package/dist/esm/adapters/REST/endpoints/preview-api-key.js +12 -0
  44. package/dist/esm/adapters/REST/endpoints/raw.js +37 -0
  45. package/dist/esm/adapters/REST/endpoints/release-action.js +17 -0
  46. package/dist/esm/adapters/REST/endpoints/release.js +50 -0
  47. package/dist/esm/adapters/REST/endpoints/resource-provider.js +14 -0
  48. package/dist/esm/adapters/REST/endpoints/resource-type.js +24 -0
  49. package/dist/esm/adapters/REST/endpoints/resource.js +8 -0
  50. package/dist/esm/adapters/REST/endpoints/role.js +40 -0
  51. package/dist/esm/adapters/REST/endpoints/scheduled-action.js +38 -0
  52. package/dist/esm/adapters/REST/endpoints/snapshot.js +25 -0
  53. package/dist/esm/adapters/REST/endpoints/space-member.js +8 -0
  54. package/dist/esm/adapters/REST/endpoints/space-membership.js +51 -0
  55. package/dist/esm/adapters/REST/endpoints/space.js +27 -0
  56. package/dist/esm/adapters/REST/endpoints/tag.js +31 -0
  57. package/dist/esm/adapters/REST/endpoints/task.js +33 -0
  58. package/dist/esm/adapters/REST/endpoints/team-membership.js +28 -0
  59. package/dist/esm/adapters/REST/endpoints/team-space-membership.js +38 -0
  60. package/dist/esm/adapters/REST/endpoints/team.js +29 -0
  61. package/dist/esm/adapters/REST/endpoints/ui-config.js +19 -0
  62. package/dist/esm/adapters/REST/endpoints/upload-credentials.js +14 -0
  63. package/dist/esm/adapters/REST/endpoints/upload.js +38 -0
  64. package/dist/esm/adapters/REST/endpoints/usage.js +14 -0
  65. package/dist/esm/adapters/REST/endpoints/user-ui-config.js +19 -0
  66. package/dist/esm/adapters/REST/endpoints/user.js +21 -0
  67. package/dist/esm/adapters/REST/endpoints/utils.js +17 -0
  68. package/dist/esm/adapters/REST/endpoints/webhook.js +82 -0
  69. package/dist/esm/adapters/REST/endpoints/workflow-definition.js +35 -0
  70. package/dist/esm/adapters/REST/endpoints/workflow.js +42 -0
  71. package/dist/esm/adapters/REST/endpoints/workflows-changelog.js +9 -0
  72. package/dist/esm/adapters/REST/make-request.js +17 -0
  73. package/dist/esm/adapters/REST/rest-adapter.js +30 -0
  74. package/dist/esm/common-types.js +6 -0
  75. package/dist/esm/common-utils.js +32 -0
  76. package/dist/esm/constants/editor-interface-defaults/controls-defaults.js +153 -0
  77. package/dist/esm/constants/editor-interface-defaults/editors-defaults.js +37 -0
  78. package/dist/esm/constants/editor-interface-defaults/index.js +12 -0
  79. package/dist/esm/constants/editor-interface-defaults/sidebar-defaults.js +68 -0
  80. package/dist/esm/constants/editor-interface-defaults/types.js +15 -0
  81. package/dist/esm/create-adapter.js +19 -0
  82. package/dist/esm/create-app-definition-api.js +252 -0
  83. package/dist/esm/create-contentful-api.js +590 -0
  84. package/dist/esm/create-entry-api.js +479 -0
  85. package/dist/esm/create-environment-api.js +2347 -0
  86. package/dist/esm/create-environment-template-api.js +268 -0
  87. package/dist/esm/create-organization-api.js +1134 -0
  88. package/dist/esm/create-space-api.js +1436 -0
  89. package/dist/esm/create-ui-config-api.js +53 -0
  90. package/dist/esm/create-user-ui-config-api.js +53 -0
  91. package/dist/{es-modules → esm}/enhance-with-methods.js +13 -11
  92. package/dist/esm/entities/access-token.js +33 -0
  93. package/dist/esm/entities/api-key.js +56 -0
  94. package/dist/esm/entities/app-access-token.js +15 -0
  95. package/dist/esm/entities/app-action-call.js +61 -0
  96. package/dist/esm/entities/app-action.js +45 -0
  97. package/dist/esm/entities/app-bundle.js +45 -0
  98. package/dist/esm/entities/app-definition.js +26 -0
  99. package/dist/esm/entities/app-details.js +37 -0
  100. package/dist/esm/entities/app-event-subscription.js +32 -0
  101. package/dist/esm/entities/app-installation.js +52 -0
  102. package/dist/esm/entities/app-key.js +41 -0
  103. package/dist/{es-modules → esm}/entities/app-signed-request.js +7 -4
  104. package/dist/esm/entities/app-signing-secret.js +32 -0
  105. package/dist/esm/entities/app-upload.js +44 -0
  106. package/dist/{es-modules → esm}/entities/asset-key.js +7 -4
  107. package/dist/esm/entities/asset.js +121 -0
  108. package/dist/esm/entities/bulk-action.js +58 -0
  109. package/dist/esm/entities/comment.js +57 -0
  110. package/dist/esm/entities/concept-scheme.js +1 -0
  111. package/dist/esm/entities/concept.js +1 -0
  112. package/dist/esm/entities/content-type.js +117 -0
  113. package/dist/esm/entities/editor-interface.js +47 -0
  114. package/dist/esm/entities/entry.js +24 -0
  115. package/dist/esm/entities/environment-alias.js +55 -0
  116. package/dist/esm/entities/environment-template-installation.js +20 -0
  117. package/dist/esm/entities/environment-template.js +15 -0
  118. package/dist/esm/entities/environment.js +31 -0
  119. package/dist/esm/entities/extension.js +51 -0
  120. package/dist/{es-modules → esm}/entities/function-log.js +9 -7
  121. package/dist/esm/entities/function.js +63 -0
  122. package/dist/esm/entities/index.js +125 -0
  123. package/dist/esm/entities/locale.js +54 -0
  124. package/dist/esm/entities/oauth-application.js +63 -0
  125. package/dist/esm/entities/organization-invitation.js +15 -0
  126. package/dist/esm/entities/organization-membership.js +50 -0
  127. package/dist/esm/entities/organization.js +29 -0
  128. package/dist/esm/entities/personal-access-token.js +33 -0
  129. package/dist/esm/entities/preview-api-key.js +28 -0
  130. package/dist/esm/entities/release-action.js +52 -0
  131. package/dist/esm/entities/release.js +107 -0
  132. package/dist/esm/entities/resource-provider.js +137 -0
  133. package/dist/esm/entities/resource-type.js +94 -0
  134. package/dist/esm/entities/resource.js +10 -0
  135. package/dist/esm/entities/role.js +50 -0
  136. package/dist/esm/entities/scheduled-action.js +148 -0
  137. package/dist/esm/entities/snapshot.js +33 -0
  138. package/dist/esm/entities/space-member.js +20 -0
  139. package/dist/esm/entities/space-membership.js +50 -0
  140. package/dist/esm/entities/space.js +30 -0
  141. package/dist/esm/entities/tag.js +50 -0
  142. package/dist/esm/entities/task.js +51 -0
  143. package/dist/esm/entities/team-membership.js +51 -0
  144. package/dist/esm/entities/team-space-membership.js +50 -0
  145. package/dist/esm/entities/team.js +50 -0
  146. package/dist/esm/entities/ui-config.js +18 -0
  147. package/dist/esm/entities/upload.js +36 -0
  148. package/dist/esm/entities/usage.js +22 -0
  149. package/dist/esm/entities/user-ui-config.js +18 -0
  150. package/dist/esm/entities/user.js +25 -0
  151. package/dist/esm/entities/webhook.js +74 -0
  152. package/dist/esm/entities/workflow-definition.js +73 -0
  153. package/dist/esm/index.js +36 -0
  154. package/dist/esm/methods/action.js +49 -0
  155. package/dist/esm/methods/content-type.js +49 -0
  156. package/dist/esm/methods/utils.js +9 -0
  157. package/dist/esm/plain/as-iterator.js +30 -0
  158. package/dist/esm/plain/checks.js +10 -0
  159. package/dist/esm/plain/pagination-helper.js +54 -0
  160. package/dist/esm/plain/plain-client.js +503 -0
  161. package/dist/esm/plain/wrappers/wrap.js +24 -0
  162. package/dist/esm/upload-http-client.js +15 -0
  163. package/dist/stats-browser-min.html +4842 -0
  164. package/dist/{typings → types}/create-contentful-api.d.ts +1 -0
  165. package/dist/{typings → types}/create-environment-api.d.ts +2 -2
  166. package/dist/{typings → types}/create-ui-config-api.d.ts +1 -1
  167. package/dist/{typings → types}/create-user-ui-config-api.d.ts +1 -1
  168. package/dist/{typings → types}/entities/ui-config.d.ts +1 -1
  169. package/dist/{typings → types}/entities/user-ui-config.d.ts +1 -1
  170. package/dist/{typings/contentful-management.d.ts → types/index.d.ts} +1 -1
  171. package/dist/{typings → types}/plain/common-types.d.ts +1 -0
  172. package/package.json +49 -45
  173. package/dist/contentful-management.browser.js.map +0 -1
  174. package/dist/contentful-management.node.js +0 -32061
  175. package/dist/contentful-management.node.js.map +0 -1
  176. package/dist/contentful-management.node.min.js +0 -2
  177. package/dist/es-modules/adapters/REST/endpoints/api-key.js +0 -47
  178. package/dist/es-modules/adapters/REST/endpoints/app-access-token.js +0 -8
  179. package/dist/es-modules/adapters/REST/endpoints/app-action-call.js +0 -69
  180. package/dist/es-modules/adapters/REST/endpoints/app-action.js +0 -32
  181. package/dist/es-modules/adapters/REST/endpoints/app-bundle.js +0 -36
  182. package/dist/es-modules/adapters/REST/endpoints/app-definition.js +0 -45
  183. package/dist/es-modules/adapters/REST/endpoints/app-details.js +0 -10
  184. package/dist/es-modules/adapters/REST/endpoints/app-event-subscription.js +0 -10
  185. package/dist/es-modules/adapters/REST/endpoints/app-installation.js +0 -39
  186. package/dist/es-modules/adapters/REST/endpoints/app-key.js +0 -13
  187. package/dist/es-modules/adapters/REST/endpoints/app-signed-request.js +0 -4
  188. package/dist/es-modules/adapters/REST/endpoints/app-signing-secret.js +0 -10
  189. package/dist/es-modules/adapters/REST/endpoints/app-upload.js +0 -23
  190. package/dist/es-modules/adapters/REST/endpoints/asset-key.js +0 -33
  191. package/dist/es-modules/adapters/REST/endpoints/asset.js +0 -220
  192. package/dist/es-modules/adapters/REST/endpoints/bulk-action.js +0 -13
  193. package/dist/es-modules/adapters/REST/endpoints/comment.js +0 -101
  194. package/dist/es-modules/adapters/REST/endpoints/concept-scheme.js +0 -52
  195. package/dist/es-modules/adapters/REST/endpoints/concept.js +0 -85
  196. package/dist/es-modules/adapters/REST/endpoints/content-type.js +0 -61
  197. package/dist/es-modules/adapters/REST/endpoints/editor-interface.js +0 -24
  198. package/dist/es-modules/adapters/REST/endpoints/entry.js +0 -113
  199. package/dist/es-modules/adapters/REST/endpoints/environment-alias.js +0 -46
  200. package/dist/es-modules/adapters/REST/endpoints/environment-template-installation.js +0 -43
  201. package/dist/es-modules/adapters/REST/endpoints/environment-template.js +0 -88
  202. package/dist/es-modules/adapters/REST/endpoints/environment.js +0 -42
  203. package/dist/es-modules/adapters/REST/endpoints/extension.js +0 -44
  204. package/dist/es-modules/adapters/REST/endpoints/function-log.js +0 -22
  205. package/dist/es-modules/adapters/REST/endpoints/function.js +0 -20
  206. package/dist/es-modules/adapters/REST/endpoints/http.js +0 -39
  207. package/dist/es-modules/adapters/REST/endpoints/index.js +0 -130
  208. package/dist/es-modules/adapters/REST/endpoints/locale.js +0 -35
  209. package/dist/es-modules/adapters/REST/endpoints/organization-invitation.js +0 -22
  210. package/dist/es-modules/adapters/REST/endpoints/organization-membership.js +0 -35
  211. package/dist/es-modules/adapters/REST/endpoints/organization.js +0 -26
  212. package/dist/es-modules/adapters/REST/endpoints/personal-access-token.js +0 -33
  213. package/dist/es-modules/adapters/REST/endpoints/preview-api-key.js +0 -9
  214. package/dist/es-modules/adapters/REST/endpoints/raw.js +0 -42
  215. package/dist/es-modules/adapters/REST/endpoints/release-action.js +0 -21
  216. package/dist/es-modules/adapters/REST/endpoints/release.js +0 -58
  217. package/dist/es-modules/adapters/REST/endpoints/resource-provider.js +0 -13
  218. package/dist/es-modules/adapters/REST/endpoints/resource-type.js +0 -23
  219. package/dist/es-modules/adapters/REST/endpoints/resource.js +0 -5
  220. package/dist/es-modules/adapters/REST/endpoints/role.js +0 -44
  221. package/dist/es-modules/adapters/REST/endpoints/scheduled-action.js +0 -35
  222. package/dist/es-modules/adapters/REST/endpoints/snapshot.js +0 -22
  223. package/dist/es-modules/adapters/REST/endpoints/space-member.js +0 -5
  224. package/dist/es-modules/adapters/REST/endpoints/space-membership.js +0 -55
  225. package/dist/es-modules/adapters/REST/endpoints/space.js +0 -32
  226. package/dist/es-modules/adapters/REST/endpoints/tag.js +0 -46
  227. package/dist/es-modules/adapters/REST/endpoints/task.js +0 -47
  228. package/dist/es-modules/adapters/REST/endpoints/team-membership.js +0 -34
  229. package/dist/es-modules/adapters/REST/endpoints/team-space-membership.js +0 -45
  230. package/dist/es-modules/adapters/REST/endpoints/team.js +0 -35
  231. package/dist/es-modules/adapters/REST/endpoints/ui-config.js +0 -16
  232. package/dist/es-modules/adapters/REST/endpoints/upload-credentials.js +0 -11
  233. package/dist/es-modules/adapters/REST/endpoints/upload.js +0 -37
  234. package/dist/es-modules/adapters/REST/endpoints/usage.js +0 -11
  235. package/dist/es-modules/adapters/REST/endpoints/user-ui-config.js +0 -16
  236. package/dist/es-modules/adapters/REST/endpoints/user.js +0 -20
  237. package/dist/es-modules/adapters/REST/endpoints/utils.js +0 -28
  238. package/dist/es-modules/adapters/REST/endpoints/webhook.js +0 -93
  239. package/dist/es-modules/adapters/REST/endpoints/workflow-definition.js +0 -46
  240. package/dist/es-modules/adapters/REST/endpoints/workflow.js +0 -59
  241. package/dist/es-modules/adapters/REST/endpoints/workflows-changelog.js +0 -6
  242. package/dist/es-modules/adapters/REST/make-request.js +0 -28
  243. package/dist/es-modules/adapters/REST/rest-adapter.js +0 -42
  244. package/dist/es-modules/adapters/REST/types.js +0 -1
  245. package/dist/es-modules/common-types.js +0 -61
  246. package/dist/es-modules/common-utils.js +0 -30
  247. package/dist/es-modules/constants/editor-interface-defaults/controls-defaults.js +0 -255
  248. package/dist/es-modules/constants/editor-interface-defaults/editors-defaults.js +0 -34
  249. package/dist/es-modules/constants/editor-interface-defaults/index.js +0 -9
  250. package/dist/es-modules/constants/editor-interface-defaults/sidebar-defaults.js +0 -57
  251. package/dist/es-modules/constants/editor-interface-defaults/types.js +0 -14
  252. package/dist/es-modules/contentful-management.js +0 -66
  253. package/dist/es-modules/create-adapter.js +0 -16
  254. package/dist/es-modules/create-app-definition-api.js +0 -263
  255. package/dist/es-modules/create-contentful-api.js +0 -663
  256. package/dist/es-modules/create-entry-api.js +0 -548
  257. package/dist/es-modules/create-environment-api.js +0 -2464
  258. package/dist/es-modules/create-environment-template-api.js +0 -316
  259. package/dist/es-modules/create-organization-api.js +0 -1306
  260. package/dist/es-modules/create-space-api.js +0 -1565
  261. package/dist/es-modules/create-ui-config-api.js +0 -60
  262. package/dist/es-modules/create-user-ui-config-api.js +0 -60
  263. package/dist/es-modules/entities/access-token.js +0 -38
  264. package/dist/es-modules/entities/api-key.js +0 -55
  265. package/dist/es-modules/entities/app-access-token.js +0 -12
  266. package/dist/es-modules/entities/app-action-call.js +0 -70
  267. package/dist/es-modules/entities/app-action.js +0 -53
  268. package/dist/es-modules/entities/app-bundle.js +0 -44
  269. package/dist/es-modules/entities/app-definition.js +0 -24
  270. package/dist/es-modules/entities/app-details.js +0 -35
  271. package/dist/es-modules/entities/app-event-subscription.js +0 -30
  272. package/dist/es-modules/entities/app-installation.js +0 -51
  273. package/dist/es-modules/entities/app-key.js +0 -40
  274. package/dist/es-modules/entities/app-signing-secret.js +0 -30
  275. package/dist/es-modules/entities/app-upload.js +0 -43
  276. package/dist/es-modules/entities/asset.js +0 -131
  277. package/dist/es-modules/entities/bulk-action.js +0 -61
  278. package/dist/es-modules/entities/comment.js +0 -77
  279. package/dist/es-modules/entities/concept-scheme.js +0 -1
  280. package/dist/es-modules/entities/concept.js +0 -1
  281. package/dist/es-modules/entities/content-type-fields.js +0 -1
  282. package/dist/es-modules/entities/content-type.js +0 -146
  283. package/dist/es-modules/entities/editor-interface.js +0 -46
  284. package/dist/es-modules/entities/entry.js +0 -22
  285. package/dist/es-modules/entities/environment-alias.js +0 -54
  286. package/dist/es-modules/entities/environment-template-installation.js +0 -17
  287. package/dist/es-modules/entities/environment-template.js +0 -12
  288. package/dist/es-modules/entities/environment.js +0 -29
  289. package/dist/es-modules/entities/extension.js +0 -50
  290. package/dist/es-modules/entities/field-type.js +0 -1
  291. package/dist/es-modules/entities/function.js +0 -61
  292. package/dist/es-modules/entities/index.js +0 -122
  293. package/dist/es-modules/entities/locale.js +0 -53
  294. package/dist/es-modules/entities/oauth-application.js +0 -62
  295. package/dist/es-modules/entities/organization-invitation.js +0 -12
  296. package/dist/es-modules/entities/organization-membership.js +0 -49
  297. package/dist/es-modules/entities/organization.js +0 -32
  298. package/dist/es-modules/entities/personal-access-token.js +0 -38
  299. package/dist/es-modules/entities/preview-api-key.js +0 -27
  300. package/dist/es-modules/entities/release-action.js +0 -53
  301. package/dist/es-modules/entities/release.js +0 -105
  302. package/dist/es-modules/entities/resource-provider.js +0 -139
  303. package/dist/es-modules/entities/resource-type.js +0 -93
  304. package/dist/es-modules/entities/resource.js +0 -7
  305. package/dist/es-modules/entities/role.js +0 -49
  306. package/dist/es-modules/entities/scheduled-action.js +0 -155
  307. package/dist/es-modules/entities/snapshot.js +0 -31
  308. package/dist/es-modules/entities/space-member.js +0 -18
  309. package/dist/es-modules/entities/space-membership.js +0 -49
  310. package/dist/es-modules/entities/space.js +0 -28
  311. package/dist/es-modules/entities/tag.js +0 -56
  312. package/dist/es-modules/entities/task.js +0 -57
  313. package/dist/es-modules/entities/team-membership.js +0 -50
  314. package/dist/es-modules/entities/team-space-membership.js +0 -49
  315. package/dist/es-modules/entities/team.js +0 -49
  316. package/dist/es-modules/entities/ui-config.js +0 -15
  317. package/dist/es-modules/entities/upload-credential.js +0 -33
  318. package/dist/es-modules/entities/upload.js +0 -34
  319. package/dist/es-modules/entities/usage.js +0 -20
  320. package/dist/es-modules/entities/user-ui-config.js +0 -15
  321. package/dist/es-modules/entities/user.js +0 -23
  322. package/dist/es-modules/entities/utils.js +0 -1
  323. package/dist/es-modules/entities/webhook.js +0 -80
  324. package/dist/es-modules/entities/widget-parameters.js +0 -1
  325. package/dist/es-modules/entities/workflow-definition.js +0 -87
  326. package/dist/es-modules/entities/workflow.js +0 -76
  327. package/dist/es-modules/entities/workflows-changelog-entry.js +0 -24
  328. package/dist/es-modules/export-types.js +0 -3
  329. package/dist/es-modules/methods/action.js +0 -54
  330. package/dist/es-modules/methods/bulk-action.js +0 -15
  331. package/dist/es-modules/methods/content-type.js +0 -47
  332. package/dist/es-modules/methods/release-action.js +0 -17
  333. package/dist/es-modules/methods/utils.js +0 -7
  334. package/dist/es-modules/plain/as-iterator.js +0 -47
  335. package/dist/es-modules/plain/checks.js +0 -8
  336. package/dist/es-modules/plain/common-types.js +0 -1
  337. package/dist/es-modules/plain/entities/app-access-token.js +0 -1
  338. package/dist/es-modules/plain/entities/app-action-call.js +0 -1
  339. package/dist/es-modules/plain/entities/app-action.js +0 -1
  340. package/dist/es-modules/plain/entities/app-bundle.js +0 -1
  341. package/dist/es-modules/plain/entities/app-definition.js +0 -1
  342. package/dist/es-modules/plain/entities/app-details.js +0 -1
  343. package/dist/es-modules/plain/entities/app-event-subscription.js +0 -1
  344. package/dist/es-modules/plain/entities/app-installation.js +0 -1
  345. package/dist/es-modules/plain/entities/app-key.js +0 -1
  346. package/dist/es-modules/plain/entities/app-signed-request.js +0 -1
  347. package/dist/es-modules/plain/entities/app-signing-secret.js +0 -1
  348. package/dist/es-modules/plain/entities/app-upload.js +0 -1
  349. package/dist/es-modules/plain/entities/comment.js +0 -1
  350. package/dist/es-modules/plain/entities/concept-scheme.js +0 -1
  351. package/dist/es-modules/plain/entities/concept.js +0 -1
  352. package/dist/es-modules/plain/entities/editor-interface.js +0 -1
  353. package/dist/es-modules/plain/entities/environment-alias.js +0 -1
  354. package/dist/es-modules/plain/entities/environment.js +0 -1
  355. package/dist/es-modules/plain/entities/extension.js +0 -1
  356. package/dist/es-modules/plain/entities/function-log.js +0 -1
  357. package/dist/es-modules/plain/entities/function.js +0 -1
  358. package/dist/es-modules/plain/entities/locale.js +0 -1
  359. package/dist/es-modules/plain/entities/oauth-application.js +0 -1
  360. package/dist/es-modules/plain/entities/organization.js +0 -1
  361. package/dist/es-modules/plain/entities/resource-provider.js +0 -1
  362. package/dist/es-modules/plain/entities/resource-type.js +0 -1
  363. package/dist/es-modules/plain/entities/resource.js +0 -1
  364. package/dist/es-modules/plain/entities/role.js +0 -1
  365. package/dist/es-modules/plain/entities/space-member.js +0 -1
  366. package/dist/es-modules/plain/entities/space-membership.js +0 -1
  367. package/dist/es-modules/plain/entities/space.js +0 -1
  368. package/dist/es-modules/plain/entities/tag.js +0 -1
  369. package/dist/es-modules/plain/entities/task.js +0 -1
  370. package/dist/es-modules/plain/entities/team-membership.js +0 -1
  371. package/dist/es-modules/plain/entities/team-space-membership.js +0 -1
  372. package/dist/es-modules/plain/entities/team.js +0 -1
  373. package/dist/es-modules/plain/entities/ui-config.js +0 -1
  374. package/dist/es-modules/plain/entities/upload-credential.js +0 -1
  375. package/dist/es-modules/plain/entities/upload.js +0 -1
  376. package/dist/es-modules/plain/entities/usage.js +0 -1
  377. package/dist/es-modules/plain/entities/user-ui-config.js +0 -1
  378. package/dist/es-modules/plain/entities/user.js +0 -1
  379. package/dist/es-modules/plain/entities/webhook.js +0 -1
  380. package/dist/es-modules/plain/entities/workflow-definition.js +0 -1
  381. package/dist/es-modules/plain/entities/workflow.js +0 -1
  382. package/dist/es-modules/plain/entities/workflows-changelog.js +0 -1
  383. package/dist/es-modules/plain/pagination-helper.js +0 -76
  384. package/dist/es-modules/plain/plain-client.js +0 -531
  385. package/dist/es-modules/plain/wrappers/wrap.js +0 -46
  386. package/dist/es-modules/plain/wrappers/wrap.test-d.js +0 -15
  387. package/dist/es-modules/upload-http-client.js +0 -17
  388. /package/dist/{typings → types}/adapters/REST/endpoints/access-token.d.ts +0 -0
  389. /package/dist/{typings → types}/adapters/REST/endpoints/api-key.d.ts +0 -0
  390. /package/dist/{typings → types}/adapters/REST/endpoints/app-access-token.d.ts +0 -0
  391. /package/dist/{typings → types}/adapters/REST/endpoints/app-action-call.d.ts +0 -0
  392. /package/dist/{typings → types}/adapters/REST/endpoints/app-action.d.ts +0 -0
  393. /package/dist/{typings → types}/adapters/REST/endpoints/app-bundle.d.ts +0 -0
  394. /package/dist/{typings → types}/adapters/REST/endpoints/app-definition.d.ts +0 -0
  395. /package/dist/{typings → types}/adapters/REST/endpoints/app-details.d.ts +0 -0
  396. /package/dist/{typings → types}/adapters/REST/endpoints/app-event-subscription.d.ts +0 -0
  397. /package/dist/{typings → types}/adapters/REST/endpoints/app-installation.d.ts +0 -0
  398. /package/dist/{typings → types}/adapters/REST/endpoints/app-key.d.ts +0 -0
  399. /package/dist/{typings → types}/adapters/REST/endpoints/app-signed-request.d.ts +0 -0
  400. /package/dist/{typings → types}/adapters/REST/endpoints/app-signing-secret.d.ts +0 -0
  401. /package/dist/{typings → types}/adapters/REST/endpoints/app-upload.d.ts +0 -0
  402. /package/dist/{typings → types}/adapters/REST/endpoints/asset-key.d.ts +0 -0
  403. /package/dist/{typings → types}/adapters/REST/endpoints/asset.d.ts +0 -0
  404. /package/dist/{typings → types}/adapters/REST/endpoints/bulk-action.d.ts +0 -0
  405. /package/dist/{typings → types}/adapters/REST/endpoints/comment.d.ts +0 -0
  406. /package/dist/{typings → types}/adapters/REST/endpoints/concept-scheme.d.ts +0 -0
  407. /package/dist/{typings → types}/adapters/REST/endpoints/concept.d.ts +0 -0
  408. /package/dist/{typings → types}/adapters/REST/endpoints/content-type.d.ts +0 -0
  409. /package/dist/{typings → types}/adapters/REST/endpoints/editor-interface.d.ts +0 -0
  410. /package/dist/{typings → types}/adapters/REST/endpoints/entry.d.ts +0 -0
  411. /package/dist/{typings → types}/adapters/REST/endpoints/environment-alias.d.ts +0 -0
  412. /package/dist/{typings → types}/adapters/REST/endpoints/environment-template-installation.d.ts +0 -0
  413. /package/dist/{typings → types}/adapters/REST/endpoints/environment-template.d.ts +0 -0
  414. /package/dist/{typings → types}/adapters/REST/endpoints/environment.d.ts +0 -0
  415. /package/dist/{typings → types}/adapters/REST/endpoints/extension.d.ts +0 -0
  416. /package/dist/{typings → types}/adapters/REST/endpoints/function-log.d.ts +0 -0
  417. /package/dist/{typings → types}/adapters/REST/endpoints/function.d.ts +0 -0
  418. /package/dist/{typings → types}/adapters/REST/endpoints/http.d.ts +0 -0
  419. /package/dist/{typings → types}/adapters/REST/endpoints/index.d.ts +0 -0
  420. /package/dist/{typings → types}/adapters/REST/endpoints/locale.d.ts +0 -0
  421. /package/dist/{typings → types}/adapters/REST/endpoints/oauth-application.d.ts +0 -0
  422. /package/dist/{typings → types}/adapters/REST/endpoints/organization-invitation.d.ts +0 -0
  423. /package/dist/{typings → types}/adapters/REST/endpoints/organization-membership.d.ts +0 -0
  424. /package/dist/{typings → types}/adapters/REST/endpoints/organization.d.ts +0 -0
  425. /package/dist/{typings → types}/adapters/REST/endpoints/personal-access-token.d.ts +0 -0
  426. /package/dist/{typings → types}/adapters/REST/endpoints/preview-api-key.d.ts +0 -0
  427. /package/dist/{typings → types}/adapters/REST/endpoints/raw.d.ts +0 -0
  428. /package/dist/{typings → types}/adapters/REST/endpoints/release-action.d.ts +0 -0
  429. /package/dist/{typings → types}/adapters/REST/endpoints/release.d.ts +0 -0
  430. /package/dist/{typings → types}/adapters/REST/endpoints/resource-provider.d.ts +0 -0
  431. /package/dist/{typings → types}/adapters/REST/endpoints/resource-type.d.ts +0 -0
  432. /package/dist/{typings → types}/adapters/REST/endpoints/resource.d.ts +0 -0
  433. /package/dist/{typings → types}/adapters/REST/endpoints/role.d.ts +0 -0
  434. /package/dist/{typings → types}/adapters/REST/endpoints/scheduled-action.d.ts +0 -0
  435. /package/dist/{typings → types}/adapters/REST/endpoints/snapshot.d.ts +0 -0
  436. /package/dist/{typings → types}/adapters/REST/endpoints/space-member.d.ts +0 -0
  437. /package/dist/{typings → types}/adapters/REST/endpoints/space-membership.d.ts +0 -0
  438. /package/dist/{typings → types}/adapters/REST/endpoints/space.d.ts +0 -0
  439. /package/dist/{typings → types}/adapters/REST/endpoints/tag.d.ts +0 -0
  440. /package/dist/{typings → types}/adapters/REST/endpoints/task.d.ts +0 -0
  441. /package/dist/{typings → types}/adapters/REST/endpoints/team-membership.d.ts +0 -0
  442. /package/dist/{typings → types}/adapters/REST/endpoints/team-space-membership.d.ts +0 -0
  443. /package/dist/{typings → types}/adapters/REST/endpoints/team.d.ts +0 -0
  444. /package/dist/{typings → types}/adapters/REST/endpoints/ui-config.d.ts +0 -0
  445. /package/dist/{typings → types}/adapters/REST/endpoints/upload-credentials.d.ts +0 -0
  446. /package/dist/{typings → types}/adapters/REST/endpoints/upload.d.ts +0 -0
  447. /package/dist/{typings → types}/adapters/REST/endpoints/usage.d.ts +0 -0
  448. /package/dist/{typings → types}/adapters/REST/endpoints/user-ui-config.d.ts +0 -0
  449. /package/dist/{typings → types}/adapters/REST/endpoints/user.d.ts +0 -0
  450. /package/dist/{typings → types}/adapters/REST/endpoints/utils.d.ts +0 -0
  451. /package/dist/{typings → types}/adapters/REST/endpoints/webhook.d.ts +0 -0
  452. /package/dist/{typings → types}/adapters/REST/endpoints/workflow-definition.d.ts +0 -0
  453. /package/dist/{typings → types}/adapters/REST/endpoints/workflow.d.ts +0 -0
  454. /package/dist/{typings → types}/adapters/REST/endpoints/workflows-changelog.d.ts +0 -0
  455. /package/dist/{typings → types}/adapters/REST/make-request.d.ts +0 -0
  456. /package/dist/{typings → types}/adapters/REST/rest-adapter.d.ts +0 -0
  457. /package/dist/{typings → types}/adapters/REST/types.d.ts +0 -0
  458. /package/dist/{typings → types}/common-types.d.ts +0 -0
  459. /package/dist/{typings → types}/common-utils.d.ts +0 -0
  460. /package/dist/{typings → types}/constants/editor-interface-defaults/controls-defaults.d.ts +0 -0
  461. /package/dist/{typings → types}/constants/editor-interface-defaults/editors-defaults.d.ts +0 -0
  462. /package/dist/{typings → types}/constants/editor-interface-defaults/index.d.ts +0 -0
  463. /package/dist/{typings → types}/constants/editor-interface-defaults/sidebar-defaults.d.ts +0 -0
  464. /package/dist/{typings → types}/constants/editor-interface-defaults/types.d.ts +0 -0
  465. /package/dist/{typings → types}/create-adapter.d.ts +0 -0
  466. /package/dist/{typings → types}/create-app-definition-api.d.ts +0 -0
  467. /package/dist/{typings → types}/create-entry-api.d.ts +0 -0
  468. /package/dist/{typings → types}/create-environment-template-api.d.ts +0 -0
  469. /package/dist/{typings → types}/create-organization-api.d.ts +0 -0
  470. /package/dist/{typings → types}/create-space-api.d.ts +0 -0
  471. /package/dist/{typings → types}/enhance-with-methods.d.ts +0 -0
  472. /package/dist/{typings → types}/entities/access-token.d.ts +0 -0
  473. /package/dist/{typings → types}/entities/api-key.d.ts +0 -0
  474. /package/dist/{typings → types}/entities/app-access-token.d.ts +0 -0
  475. /package/dist/{typings → types}/entities/app-action-call.d.ts +0 -0
  476. /package/dist/{typings → types}/entities/app-action.d.ts +0 -0
  477. /package/dist/{typings → types}/entities/app-bundle.d.ts +0 -0
  478. /package/dist/{typings → types}/entities/app-definition.d.ts +0 -0
  479. /package/dist/{typings → types}/entities/app-details.d.ts +0 -0
  480. /package/dist/{typings → types}/entities/app-event-subscription.d.ts +0 -0
  481. /package/dist/{typings → types}/entities/app-installation.d.ts +0 -0
  482. /package/dist/{typings → types}/entities/app-key.d.ts +0 -0
  483. /package/dist/{typings → types}/entities/app-signed-request.d.ts +0 -0
  484. /package/dist/{typings → types}/entities/app-signing-secret.d.ts +0 -0
  485. /package/dist/{typings → types}/entities/app-upload.d.ts +0 -0
  486. /package/dist/{typings → types}/entities/asset-key.d.ts +0 -0
  487. /package/dist/{typings → types}/entities/asset.d.ts +0 -0
  488. /package/dist/{typings → types}/entities/bulk-action.d.ts +0 -0
  489. /package/dist/{typings → types}/entities/comment.d.ts +0 -0
  490. /package/dist/{typings → types}/entities/concept-scheme.d.ts +0 -0
  491. /package/dist/{typings → types}/entities/concept.d.ts +0 -0
  492. /package/dist/{typings → types}/entities/content-type-fields.d.ts +0 -0
  493. /package/dist/{typings → types}/entities/content-type.d.ts +0 -0
  494. /package/dist/{typings → types}/entities/editor-interface.d.ts +0 -0
  495. /package/dist/{typings → types}/entities/entry.d.ts +0 -0
  496. /package/dist/{typings → types}/entities/environment-alias.d.ts +0 -0
  497. /package/dist/{typings → types}/entities/environment-template-installation.d.ts +0 -0
  498. /package/dist/{typings → types}/entities/environment-template.d.ts +0 -0
  499. /package/dist/{typings → types}/entities/environment.d.ts +0 -0
  500. /package/dist/{typings → types}/entities/extension.d.ts +0 -0
  501. /package/dist/{typings → types}/entities/field-type.d.ts +0 -0
  502. /package/dist/{typings → types}/entities/function-log.d.ts +0 -0
  503. /package/dist/{typings → types}/entities/function.d.ts +0 -0
  504. /package/dist/{typings → types}/entities/index.d.ts +0 -0
  505. /package/dist/{typings → types}/entities/locale.d.ts +0 -0
  506. /package/dist/{typings → types}/entities/oauth-application.d.ts +0 -0
  507. /package/dist/{typings → types}/entities/organization-invitation.d.ts +0 -0
  508. /package/dist/{typings → types}/entities/organization-membership.d.ts +0 -0
  509. /package/dist/{typings → types}/entities/organization.d.ts +0 -0
  510. /package/dist/{typings → types}/entities/personal-access-token.d.ts +0 -0
  511. /package/dist/{typings → types}/entities/preview-api-key.d.ts +0 -0
  512. /package/dist/{typings → types}/entities/release-action.d.ts +0 -0
  513. /package/dist/{typings → types}/entities/release.d.ts +0 -0
  514. /package/dist/{typings → types}/entities/resource-provider.d.ts +0 -0
  515. /package/dist/{typings → types}/entities/resource-type.d.ts +0 -0
  516. /package/dist/{typings → types}/entities/resource.d.ts +0 -0
  517. /package/dist/{typings → types}/entities/role.d.ts +0 -0
  518. /package/dist/{typings → types}/entities/scheduled-action.d.ts +0 -0
  519. /package/dist/{typings → types}/entities/snapshot.d.ts +0 -0
  520. /package/dist/{typings → types}/entities/space-member.d.ts +0 -0
  521. /package/dist/{typings → types}/entities/space-membership.d.ts +0 -0
  522. /package/dist/{typings → types}/entities/space.d.ts +0 -0
  523. /package/dist/{typings → types}/entities/tag.d.ts +0 -0
  524. /package/dist/{typings → types}/entities/task.d.ts +0 -0
  525. /package/dist/{typings → types}/entities/team-membership.d.ts +0 -0
  526. /package/dist/{typings → types}/entities/team-space-membership.d.ts +0 -0
  527. /package/dist/{typings → types}/entities/team.d.ts +0 -0
  528. /package/dist/{typings → types}/entities/upload-credential.d.ts +0 -0
  529. /package/dist/{typings → types}/entities/upload.d.ts +0 -0
  530. /package/dist/{typings → types}/entities/usage.d.ts +0 -0
  531. /package/dist/{typings → types}/entities/user.d.ts +0 -0
  532. /package/dist/{typings → types}/entities/utils.d.ts +0 -0
  533. /package/dist/{typings → types}/entities/webhook.d.ts +0 -0
  534. /package/dist/{typings → types}/entities/widget-parameters.d.ts +0 -0
  535. /package/dist/{typings → types}/entities/workflow-definition.d.ts +0 -0
  536. /package/dist/{typings → types}/entities/workflow.d.ts +0 -0
  537. /package/dist/{typings → types}/entities/workflows-changelog-entry.d.ts +0 -0
  538. /package/dist/{typings → types}/export-types.d.ts +0 -0
  539. /package/dist/{typings → types}/methods/action.d.ts +0 -0
  540. /package/dist/{typings → types}/methods/bulk-action.d.ts +0 -0
  541. /package/dist/{typings → types}/methods/content-type.d.ts +0 -0
  542. /package/dist/{typings → types}/methods/release-action.d.ts +0 -0
  543. /package/dist/{typings → types}/methods/utils.d.ts +0 -0
  544. /package/dist/{typings → types}/plain/as-iterator.d.ts +0 -0
  545. /package/dist/{typings → types}/plain/checks.d.ts +0 -0
  546. /package/dist/{typings → types}/plain/entities/app-access-token.d.ts +0 -0
  547. /package/dist/{typings → types}/plain/entities/app-action-call.d.ts +0 -0
  548. /package/dist/{typings → types}/plain/entities/app-action.d.ts +0 -0
  549. /package/dist/{typings → types}/plain/entities/app-bundle.d.ts +0 -0
  550. /package/dist/{typings → types}/plain/entities/app-definition.d.ts +0 -0
  551. /package/dist/{typings → types}/plain/entities/app-details.d.ts +0 -0
  552. /package/dist/{typings → types}/plain/entities/app-event-subscription.d.ts +0 -0
  553. /package/dist/{typings → types}/plain/entities/app-installation.d.ts +0 -0
  554. /package/dist/{typings → types}/plain/entities/app-key.d.ts +0 -0
  555. /package/dist/{typings → types}/plain/entities/app-signed-request.d.ts +0 -0
  556. /package/dist/{typings → types}/plain/entities/app-signing-secret.d.ts +0 -0
  557. /package/dist/{typings → types}/plain/entities/app-upload.d.ts +0 -0
  558. /package/dist/{typings → types}/plain/entities/comment.d.ts +0 -0
  559. /package/dist/{typings → types}/plain/entities/concept-scheme.d.ts +0 -0
  560. /package/dist/{typings → types}/plain/entities/concept.d.ts +0 -0
  561. /package/dist/{typings → types}/plain/entities/editor-interface.d.ts +0 -0
  562. /package/dist/{typings → types}/plain/entities/environment-alias.d.ts +0 -0
  563. /package/dist/{typings → types}/plain/entities/environment.d.ts +0 -0
  564. /package/dist/{typings → types}/plain/entities/extension.d.ts +0 -0
  565. /package/dist/{typings → types}/plain/entities/function-log.d.ts +0 -0
  566. /package/dist/{typings → types}/plain/entities/function.d.ts +0 -0
  567. /package/dist/{typings → types}/plain/entities/locale.d.ts +0 -0
  568. /package/dist/{typings → types}/plain/entities/oauth-application.d.ts +0 -0
  569. /package/dist/{typings → types}/plain/entities/organization.d.ts +0 -0
  570. /package/dist/{typings → types}/plain/entities/resource-provider.d.ts +0 -0
  571. /package/dist/{typings → types}/plain/entities/resource-type.d.ts +0 -0
  572. /package/dist/{typings → types}/plain/entities/resource.d.ts +0 -0
  573. /package/dist/{typings → types}/plain/entities/role.d.ts +0 -0
  574. /package/dist/{typings → types}/plain/entities/space-member.d.ts +0 -0
  575. /package/dist/{typings → types}/plain/entities/space-membership.d.ts +0 -0
  576. /package/dist/{typings → types}/plain/entities/space.d.ts +0 -0
  577. /package/dist/{typings → types}/plain/entities/tag.d.ts +0 -0
  578. /package/dist/{typings → types}/plain/entities/task.d.ts +0 -0
  579. /package/dist/{typings → types}/plain/entities/team-membership.d.ts +0 -0
  580. /package/dist/{typings → types}/plain/entities/team-space-membership.d.ts +0 -0
  581. /package/dist/{typings → types}/plain/entities/team.d.ts +0 -0
  582. /package/dist/{typings → types}/plain/entities/ui-config.d.ts +0 -0
  583. /package/dist/{typings → types}/plain/entities/upload-credential.d.ts +0 -0
  584. /package/dist/{typings → types}/plain/entities/upload.d.ts +0 -0
  585. /package/dist/{typings → types}/plain/entities/usage.d.ts +0 -0
  586. /package/dist/{typings → types}/plain/entities/user-ui-config.d.ts +0 -0
  587. /package/dist/{typings → types}/plain/entities/user.d.ts +0 -0
  588. /package/dist/{typings → types}/plain/entities/webhook.d.ts +0 -0
  589. /package/dist/{typings → types}/plain/entities/workflow-definition.d.ts +0 -0
  590. /package/dist/{typings → types}/plain/entities/workflow.d.ts +0 -0
  591. /package/dist/{typings → types}/plain/entities/workflows-changelog.d.ts +0 -0
  592. /package/dist/{typings → types}/plain/pagination-helper.d.ts +0 -0
  593. /package/dist/{typings → types}/plain/plain-client.d.ts +0 -0
  594. /package/dist/{typings → types}/plain/wrappers/wrap.d.ts +0 -0
  595. /package/dist/{typings → types}/plain/wrappers/wrap.test-d.d.ts +0 -0
  596. /package/dist/{typings → types}/upload-http-client.d.ts +0 -0
@@ -1,1565 +0,0 @@
1
- /**
2
- * Contentful Space API. Contains methods to access any operations at a space
3
- * level, such as creating and reading entities contained in a space.
4
- */
5
-
6
- import { createRequestConfig } from 'contentful-sdk-core';
7
- import entities from './entities';
8
-
9
- /**
10
- * @private
11
- */
12
-
13
- /**
14
- * Creates API object with methods to access the Space API
15
- * @param {MakeRequest} makeRequest - function to make requests via an adapter
16
- * @return {ContentfulSpaceAPI}
17
- * @private
18
- */
19
- export default function createSpaceApi(makeRequest) {
20
- const {
21
- wrapSpace
22
- } = entities.space;
23
- const {
24
- wrapEnvironment,
25
- wrapEnvironmentCollection
26
- } = entities.environment;
27
- const {
28
- wrapWebhook,
29
- wrapWebhookCollection
30
- } = entities.webhook;
31
- const {
32
- wrapRole,
33
- wrapRoleCollection
34
- } = entities.role;
35
- const {
36
- wrapUser,
37
- wrapUserCollection
38
- } = entities.user;
39
- const {
40
- wrapSpaceMember,
41
- wrapSpaceMemberCollection
42
- } = entities.spaceMember;
43
- const {
44
- wrapSpaceMembership,
45
- wrapSpaceMembershipCollection
46
- } = entities.spaceMembership;
47
- const {
48
- wrapTeamSpaceMembership,
49
- wrapTeamSpaceMembershipCollection
50
- } = entities.teamSpaceMembership;
51
- const {
52
- wrapTeamCollection
53
- } = entities.team;
54
- const {
55
- wrapApiKey,
56
- wrapApiKeyCollection
57
- } = entities.apiKey;
58
- const {
59
- wrapEnvironmentAlias,
60
- wrapEnvironmentAliasCollection
61
- } = entities.environmentAlias;
62
- const {
63
- wrapPreviewApiKey,
64
- wrapPreviewApiKeyCollection
65
- } = entities.previewApiKey;
66
- const {
67
- wrapScheduledAction,
68
- wrapScheduledActionCollection
69
- } = entities.scheduledAction;
70
- return {
71
- /**
72
- * Deletes the space
73
- * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
74
- * @example ```javascript
75
- * const contentful = require('contentful-management')
76
- *
77
- * const client = contentful.createClient({
78
- * accessToken: '<content_management_api_key>'
79
- * })
80
- *
81
- * client.getSpace('<space_id>')
82
- * .then((space) => space.delete())
83
- * .then(() => console.log('Space deleted.'))
84
- * .catch(console.error)
85
- * ```
86
- */
87
- delete: function deleteSpace() {
88
- const raw = this.toPlainObject();
89
- return makeRequest({
90
- entityType: 'Space',
91
- action: 'delete',
92
- params: {
93
- spaceId: raw.sys.id
94
- }
95
- });
96
- },
97
- /**
98
- * Updates the space
99
- * @return Promise for the updated space.
100
- * @example ```javascript
101
- * const contentful = require('contentful-management')
102
- *
103
- * const client = contentful.createClient({
104
- * accessToken: '<content_management_api_key>'
105
- * })
106
- *
107
- * client.getSpace('<space_id>')
108
- * .then((space) => {
109
- * space.name = 'New name'
110
- * return space.update()
111
- * })
112
- * .then((space) => console.log(`Space ${space.sys.id} renamed.`)
113
- * .catch(console.error)
114
- * ```
115
- */
116
- update: function updateSpace() {
117
- const raw = this.toPlainObject();
118
- return makeRequest({
119
- entityType: 'Space',
120
- action: 'update',
121
- params: {
122
- spaceId: raw.sys.id
123
- },
124
- payload: raw,
125
- headers: {}
126
- }).then(data => wrapSpace(makeRequest, data));
127
- },
128
- /**
129
- * Gets an environment
130
- * @param id - Environment ID
131
- * @return Promise for an Environment
132
- * @example ```javascript
133
- * const contentful = require('contentful-management')
134
- *
135
- * const client = contentful.createClient({
136
- * accessToken: '<content_management_api_key>'
137
- * })
138
- *
139
- * client.getSpace('<space_id>')
140
- * .then((space) => space.getEnvironment('<environment_id>'))
141
- * .then((environment) => console.log(environment))
142
- * .catch(console.error)
143
- * ```
144
- */
145
- getEnvironment(environmentId) {
146
- const raw = this.toPlainObject();
147
- return makeRequest({
148
- entityType: 'Environment',
149
- action: 'get',
150
- params: {
151
- spaceId: raw.sys.id,
152
- environmentId
153
- }
154
- }).then(data => wrapEnvironment(makeRequest, data));
155
- },
156
- /**
157
- * Gets a collection of Environments
158
- * @return Promise for a collection of Environment
159
- * @example ```javascript
160
- * const contentful = require('contentful-management')
161
- *
162
- * const client = contentful.createClient({
163
- * accessToken: '<content_management_api_key>'
164
- * })
165
- *
166
- * client.getSpace('<space_id>')
167
- * .then((space) => space.getEnvironments())
168
- * .then((response) => console.log(response.items))
169
- * .catch(console.error)
170
- * ```
171
- */
172
- getEnvironments(query = {}) {
173
- const raw = this.toPlainObject();
174
- return makeRequest({
175
- entityType: 'Environment',
176
- action: 'getMany',
177
- params: {
178
- spaceId: raw.sys.id,
179
- query
180
- }
181
- }).then(data => wrapEnvironmentCollection(makeRequest, data));
182
- },
183
- /**
184
- * Creates an environment
185
- * @param data - Object representation of the Environment to be created
186
- * @return Promise for the newly created Environment
187
- * @example ```javascript
188
- * const contentful = require('contentful-management')
189
- *
190
- * const client = contentful.createClient({
191
- * accessToken: '<content_management_api_key>'
192
- * })
193
- *
194
- * client.getSpace('<space_id>')
195
- * .then((space) => space.createEnvironment({ name: 'Staging' }))
196
- * .then((environment) => console.log(environment))
197
- * .catch(console.error)
198
- * ```
199
- */
200
- createEnvironment(data = {}) {
201
- const raw = this.toPlainObject();
202
- return makeRequest({
203
- entityType: 'Environment',
204
- action: 'create',
205
- params: {
206
- spaceId: raw.sys.id
207
- },
208
- payload: data
209
- }).then(response => wrapEnvironment(makeRequest, response));
210
- },
211
- /**
212
- * Creates an Environment with a custom ID
213
- * @param id - Environment ID
214
- * @param data - Object representation of the Environment to be created
215
- * @param sourceEnvironmentId - ID of the source environment that will be copied to create the new environment. Default is "master"
216
- * @return Promise for the newly created Environment
217
- * @example ```javascript
218
- * const contentful = require('contentful-management')
219
- *
220
- * const client = contentful.createClient({
221
- * accessToken: '<content_management_api_key>'
222
- * })
223
- *
224
- * client.getSpace('<space_id>')
225
- * .then((space) => space.createEnvironmentWithId('<environment-id>', { name: 'Staging'}, 'master'))
226
- * .then((environment) => console.log(environment))
227
- * .catch(console.error)
228
- * ```
229
- */
230
- createEnvironmentWithId(id, data, sourceEnvironmentId) {
231
- const raw = this.toPlainObject();
232
- return makeRequest({
233
- entityType: 'Environment',
234
- action: 'createWithId',
235
- params: {
236
- spaceId: raw.sys.id,
237
- environmentId: id,
238
- sourceEnvironmentId
239
- },
240
- payload: data
241
- }).then(response => wrapEnvironment(makeRequest, response));
242
- },
243
- /**
244
- * Gets a Webhook
245
- * @param id - Webhook ID
246
- * @return Promise for a Webhook
247
- * @example ```javascript
248
- * const contentful = require('contentful-management')
249
- *
250
- * const client = contentful.createClient({
251
- * accessToken: '<content_management_api_key>'
252
- * })
253
- *
254
- * client.getSpace('<space_id>')
255
- * .then((space) => space.getWebhook('<webhook_id>'))
256
- * .then((webhook) => console.log(webhook))
257
- * .catch(console.error)
258
- * ```
259
- */
260
- getWebhook(id) {
261
- const raw = this.toPlainObject();
262
- return makeRequest({
263
- entityType: 'Webhook',
264
- action: 'get',
265
- params: {
266
- spaceId: raw.sys.id,
267
- webhookDefinitionId: id
268
- }
269
- }).then(data => wrapWebhook(makeRequest, data));
270
- },
271
- /**
272
- * Gets a collection of Webhooks
273
- * @return Promise for a collection of Webhooks
274
- * @example ```javascript
275
- * const contentful = require('contentful-management')
276
- *
277
- * const client = contentful.createClient({
278
- * accessToken: '<content_management_api_key>'
279
- * })
280
- *
281
- * client.getSpace('<space_id>')
282
- * .then((space) => space.getWebhooks())
283
- * .then((response) => console.log(response.items))
284
- * .catch(console.error)
285
- * ```
286
- */
287
- getWebhooks() {
288
- const raw = this.toPlainObject();
289
- return makeRequest({
290
- entityType: 'Webhook',
291
- action: 'getMany',
292
- params: {
293
- spaceId: raw.sys.id
294
- }
295
- }).then(data => wrapWebhookCollection(makeRequest, data));
296
- },
297
- /**
298
- * Fetch a webhook signing secret
299
- * @returns Promise for the redacted webhook signing secret in this space
300
- * @example ```javascript
301
- * const contentful = require('contentful-management')
302
- *
303
- * const client = contentful.createClient({
304
- * accessToken: '<content_management_api_key>'
305
- * })
306
- *
307
- * client.getSpace('<space_id>')
308
- * .then((space) => space.getWebhookSigningSecret())
309
- * .then((response) => console.log(response.redactedValue))
310
- * .catch(console.error)
311
- * ```
312
- */
313
- getWebhookSigningSecret: function getSigningSecret() {
314
- const raw = this.toPlainObject();
315
- return makeRequest({
316
- entityType: 'Webhook',
317
- action: 'getSigningSecret',
318
- params: {
319
- spaceId: raw.sys.id
320
- }
321
- });
322
- },
323
- /**
324
- * Fetch a webhook retry policy
325
- * @returns Promise for the redacted webhook retry policy in this space
326
- * @example ```javascript
327
- * const contentful = require('contentful-management')
328
- *
329
- * const client = contentful.createClient({
330
- * accessToken: '<content_management_api_key>'
331
- * })
332
- *
333
- * client.getSpace('<space_id>')
334
- * .then((space) => space.getRetryPolicy())
335
- * .then((response) => console.log(response.redactedValue))
336
- * .catch(console.error)
337
- * ```
338
- */
339
- getWebhookRetryPolicy: function getWebhookRetryPolicy() {
340
- const raw = this.toPlainObject();
341
- return makeRequest({
342
- entityType: 'Webhook',
343
- action: 'getRetryPolicy',
344
- params: {
345
- spaceId: raw.sys.id
346
- }
347
- });
348
- },
349
- /**
350
- * Creates a Webhook
351
- * @param data - Object representation of the Webhook to be created
352
- * @return Promise for the newly created Webhook
353
- * @example ```javascript
354
- * const contentful = require('contentful-management')
355
- *
356
- * client.getSpace('<space_id>')
357
- * .then((space) => space.createWebhook({
358
- * 'name': 'My webhook',
359
- * 'url': 'https://www.example.com/test',
360
- * 'topics': [
361
- * 'Entry.create',
362
- * 'ContentType.create',
363
- * '*.publish',
364
- * 'Asset.*'
365
- * ]
366
- * }))
367
- * .then((webhook) => console.log(webhook))
368
- * .catch(console.error)
369
- * ```
370
- */
371
- createWebhook(data) {
372
- const raw = this.toPlainObject();
373
- return makeRequest({
374
- entityType: 'Webhook',
375
- action: 'create',
376
- params: {
377
- spaceId: raw.sys.id
378
- },
379
- payload: data
380
- }).then(data => wrapWebhook(makeRequest, data));
381
- },
382
- /**
383
- * Creates a Webhook with a custom ID
384
- * @param id - Webhook ID
385
- * @param data - Object representation of the Webhook to be created
386
- * @return Promise for the newly created Webhook
387
- * @example ```javascript
388
- * const contentful = require('contentful-management')
389
- *
390
- * client.getSpace('<space_id>')
391
- * .then((space) => space.createWebhookWithId('<webhook_id>', {
392
- * 'name': 'My webhook',
393
- * 'url': 'https://www.example.com/test',
394
- * 'topics': [
395
- * 'Entry.create',
396
- * 'ContentType.create',
397
- * '*.publish',
398
- * 'Asset.*'
399
- * ]
400
- * }))
401
- * .then((webhook) => console.log(webhook))
402
- * .catch(console.error)
403
- * ```
404
- */
405
- createWebhookWithId(id, data) {
406
- const raw = this.toPlainObject();
407
- return makeRequest({
408
- entityType: 'Webhook',
409
- action: 'createWithId',
410
- params: {
411
- spaceId: raw.sys.id,
412
- webhookDefinitionId: id
413
- },
414
- payload: data
415
- }).then(data => wrapWebhook(makeRequest, data));
416
- },
417
- /**
418
- * Create or update the webhook signing secret for this space
419
- * @param data 64 character string that will be used to sign the webhook calls
420
- * @returns Promise for the redacted webhook signing secret that was created or updated
421
- * @example ```javascript
422
- * const contentful = require('contentful-management')
423
- * const crypto = require('crypto')
424
- *
425
- * const client = contentful.createClient({
426
- * accessToken: '<content_management_api_key>'
427
- * })
428
- *
429
- * const signingSecret = client.getSpace('<space_id>')
430
- * .then((space) => space.upsertWebhookSigningSecret({
431
- * value: crypto.randomBytes(32).toString('hex')
432
- * }))
433
- * .then((response) => console.log(response.redactedValue))
434
- * .catch(console.error)
435
- * ```
436
- */
437
- upsertWebhookSigningSecret: function getSigningSecret(data) {
438
- const raw = this.toPlainObject();
439
- return makeRequest({
440
- entityType: 'Webhook',
441
- action: 'upsertSigningSecret',
442
- params: {
443
- spaceId: raw.sys.id
444
- },
445
- payload: data
446
- });
447
- },
448
- /**
449
- * Create or update the webhook retry policy for this space
450
- * @param data the maxRetries with integer value >= 2 and <= 99 value to set in the Retry Policy
451
- * @returns Promise for the redacted webhook retry policy that was created or updated
452
- * @example ```javascript
453
- * const contentful = require('contentful-management')
454
- *
455
- * const client = contentful.createClient({
456
- * accessToken: '<content_management_api_key>'
457
- * })
458
- *
459
- * const retryPolicy = client.getSpace('<space_id>')
460
- * .then((space) => space.upsertWebhookRetryPolicy({
461
- * maxRetries: 15
462
- * }))
463
- * .then((response) => console.log(response.redactedValue))
464
- * .catch(console.error)
465
- * ```
466
- */
467
- upsertWebhookRetryPolicy: function upsertWebhookRetryPolicy(data) {
468
- const raw = this.toPlainObject();
469
- return makeRequest({
470
- entityType: 'Webhook',
471
- action: 'upsertRetryPolicy',
472
- params: {
473
- spaceId: raw.sys.id
474
- },
475
- payload: data
476
- });
477
- },
478
- /**
479
- * Delete the webhook signing secret for this space
480
- * @returns Promise<void>
481
- * @example ```javascript
482
- * const contentful = require('contentful-management')
483
- *
484
- * const client = contentful.createClient({
485
- * accessToken: '<content_management_api_key>'
486
- * })
487
- *
488
- * client.getSpace('<space_id>')
489
- * .then((space) => space.deleteWebhookSigningSecret())
490
- * .then(() => console.log("success"))
491
- * .catch(console.error)
492
- * ```
493
- */
494
- deleteWebhookSigningSecret: function getSigningSecret() {
495
- const raw = this.toPlainObject();
496
- return makeRequest({
497
- entityType: 'Webhook',
498
- action: 'deleteSigningSecret',
499
- params: {
500
- spaceId: raw.sys.id
501
- }
502
- });
503
- },
504
- /**
505
- * Delete the webhook retry policy for this space
506
- * @returns Promise<void>
507
- * @example ```javascript
508
- * const contentful = require('contentful-management')
509
- *
510
- * const client = contentful.createClient({
511
- * accessToken: '<content_management_api_key>'
512
- * })
513
- *
514
- * client.getSpace('<space_id>')
515
- * .then((space) => space.deleteWebhookRetryPolicy())
516
- * .then(() => console.log("success"))
517
- * .catch(console.error)
518
- * ```
519
- */
520
- deleteWebhookRetryPolicy: function deleteRetryPolicy() {
521
- const raw = this.toPlainObject();
522
- return makeRequest({
523
- entityType: 'Webhook',
524
- action: 'deleteRetryPolicy',
525
- params: {
526
- spaceId: raw.sys.id
527
- }
528
- });
529
- },
530
- /**
531
- * Gets a Role
532
- * @param id - Role ID
533
- * @return Promise for a Role
534
- * @example ```javascript
535
- * const contentful = require('contentful-management')
536
- *
537
- * const client = contentful.createClient({
538
- * accessToken: '<content_management_api_key>'
539
- * })
540
- *
541
- * client.getSpace('<space_id>')
542
- * .then((space) => space.createRole({
543
- * fields: {
544
- * title: {
545
- * 'en-US': 'Role title'
546
- * }
547
- * }
548
- * }))
549
- * .then((role) => console.log(role))
550
- * .catch(console.error)
551
- * ```
552
- */
553
- getRole(id) {
554
- const raw = this.toPlainObject();
555
- return makeRequest({
556
- entityType: 'Role',
557
- action: 'get',
558
- params: {
559
- spaceId: raw.sys.id,
560
- roleId: id
561
- }
562
- }).then(data => wrapRole(makeRequest, data));
563
- },
564
- /**
565
- * Gets a collection of Roles
566
- * @return Promise for a collection of Roles
567
- * @example ```javascript
568
- * const contentful = require('contentful-management')
569
- *
570
- * const client = contentful.createClient({
571
- * accessToken: '<content_management_api_key>'
572
- * })
573
- *
574
- * client.getSpace('<space_id>')
575
- * .then((space) => space.getRoles())
576
- * .then((response) => console.log(response.items))
577
- * .catch(console.error)
578
- * ```
579
- */
580
- getRoles(query = {}) {
581
- const raw = this.toPlainObject();
582
- return makeRequest({
583
- entityType: 'Role',
584
- action: 'getMany',
585
- params: {
586
- spaceId: raw.sys.id,
587
- query: createRequestConfig({
588
- query
589
- }).params
590
- }
591
- }).then(data => wrapRoleCollection(makeRequest, data));
592
- },
593
- /**
594
- * Creates a Role
595
- * @param data - Object representation of the Role to be created
596
- * @return Promise for the newly created Role
597
- * @example ```javascript
598
- * const contentful = require('contentful-management')
599
- *
600
- * const client = contentful.createClient({
601
- * accessToken: '<content_management_api_key>'
602
- * })
603
- * client.getSpace('<space_id>')
604
- * .then((space) => space.createRole({
605
- * name: 'My Role',
606
- * description: 'foobar role',
607
- * permissions: {
608
- * ContentDelivery: 'all',
609
- * ContentModel: ['read'],
610
- * Settings: []
611
- * },
612
- * policies: [
613
- * {
614
- * effect: 'allow',
615
- * actions: 'all',
616
- * constraint: {
617
- * and: [
618
- * {
619
- * equals: [
620
- * { doc: 'sys.type' },
621
- * 'Entry'
622
- * ]
623
- * },
624
- * {
625
- * equals: [
626
- * { doc: 'sys.type' },
627
- * 'Asset'
628
- * ]
629
- * }
630
- * ]
631
- * }
632
- * }
633
- * ]
634
- * }))
635
- * .then((role) => console.log(role))
636
- * .catch(console.error)
637
- * ```
638
- */
639
- createRole(data) {
640
- const raw = this.toPlainObject();
641
- return makeRequest({
642
- entityType: 'Role',
643
- action: 'create',
644
- params: {
645
- spaceId: raw.sys.id
646
- },
647
- payload: data
648
- }).then(data => wrapRole(makeRequest, data));
649
- },
650
- /**
651
- * Creates a Role with a custom ID
652
- * @param id - Role ID
653
- * @param data - Object representation of the Role to be created
654
- * @return Promise for the newly created Role
655
- * @example ```javascript
656
- * const contentful = require('contentful-management')
657
- *
658
- * const client = contentful.createClient({
659
- * accessToken: '<content_management_api_key>'
660
- * })
661
- * client.getSpace('<space_id>')
662
- * .then((space) => space.createRoleWithId('<role-id>', {
663
- * name: 'My Role',
664
- * description: 'foobar role',
665
- * permissions: {
666
- * ContentDelivery: 'all',
667
- * ContentModel: ['read'],
668
- * Settings: []
669
- * },
670
- * policies: [
671
- * {
672
- * effect: 'allow',
673
- * actions: 'all',
674
- * constraint: {
675
- * and: [
676
- * {
677
- * equals: [
678
- * { doc: 'sys.type' },
679
- * 'Entry'
680
- * ]
681
- * },
682
- * {
683
- * equals: [
684
- * { doc: 'sys.type' },
685
- * 'Asset'
686
- * ]
687
- * }
688
- * ]
689
- * }
690
- * }
691
- * ]
692
- * }))
693
- * .then((role) => console.log(role))
694
- * .catch(console.error)
695
- * ```
696
- */
697
- createRoleWithId(id, roleData) {
698
- const raw = this.toPlainObject();
699
- return makeRequest({
700
- entityType: 'Role',
701
- action: 'createWithId',
702
- params: {
703
- spaceId: raw.sys.id,
704
- roleId: id
705
- },
706
- payload: roleData
707
- }).then(data => wrapRole(makeRequest, data));
708
- },
709
- /**
710
- * Gets a User
711
- * @param userId - User ID
712
- * @return Promise for a User
713
- * @example ```javascript
714
- * const contentful = require('contentful-management')
715
- *
716
- * client.getSpace('<space_id>')
717
- * .then((space) => space.getSpaceUser('id'))
718
- * .then((user) => console.log(user))
719
- * .catch(console.error)
720
- * ```
721
- */
722
- getSpaceUser(userId) {
723
- const raw = this.toPlainObject();
724
- return makeRequest({
725
- entityType: 'User',
726
- action: 'getForSpace',
727
- params: {
728
- spaceId: raw.sys.id,
729
- userId
730
- }
731
- }).then(data => wrapUser(makeRequest, data));
732
- },
733
- /**
734
- * Gets a collection of Users in a space
735
- * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
736
- * @return Promise a collection of Users in a space
737
- * @example ```javascript
738
- * const contentful = require('contentful-management')
739
- *
740
- * client.getSpace('<space_id>')
741
- * .then((space) => space.getSpaceUsers(query))
742
- * .then((data) => console.log(data))
743
- * .catch(console.error)
744
- * ```
745
- */
746
- getSpaceUsers(query = {}) {
747
- const raw = this.toPlainObject();
748
- return makeRequest({
749
- entityType: 'User',
750
- action: 'getManyForSpace',
751
- params: {
752
- spaceId: raw.sys.id,
753
- query: createRequestConfig({
754
- query
755
- }).params
756
- }
757
- }).then(data => wrapUserCollection(makeRequest, data));
758
- },
759
- /**
760
- * Gets a collection of teams for a space
761
- * @param query
762
- * @return Promise for a collection of teams for a space
763
- * @example ```javascript
764
- * const contentful = require('contentful-management')
765
- *
766
- * client.getSpace('<space_id>')
767
- * .then((space) => space.getTeams())
768
- * .then((teamsCollection) => console.log(teamsCollection))
769
- * .catch(console.error)
770
- * ```
771
- */
772
- getTeams(query = {
773
- limit: 100
774
- }) {
775
- const raw = this.toPlainObject();
776
- return makeRequest({
777
- entityType: 'Team',
778
- action: 'getManyForSpace',
779
- params: {
780
- spaceId: raw.sys.id,
781
- query: createRequestConfig({
782
- query
783
- }).params
784
- }
785
- }).then(data => wrapTeamCollection(makeRequest, data));
786
- },
787
- /**
788
- * Gets a Space Member
789
- * @param id Get Space Member by user_id
790
- * @return Promise for a Space Member
791
- * @example ```javascript
792
- * const contentful = require('contentful-management')
793
- *
794
- * client.getSpace('<space_id>')
795
- * .then((space) => space.getSpaceMember(id))
796
- * .then((spaceMember) => console.log(spaceMember))
797
- * .catch(console.error)
798
- * ```
799
- */
800
- getSpaceMember(id) {
801
- const raw = this.toPlainObject();
802
- return makeRequest({
803
- entityType: 'SpaceMember',
804
- action: 'get',
805
- params: {
806
- spaceId: raw.sys.id,
807
- spaceMemberId: id
808
- }
809
- }).then(data => wrapSpaceMember(makeRequest, data));
810
- },
811
- /**
812
- * Gets a collection of Space Members
813
- * @param query
814
- * @return Promise for a collection of Space Members
815
- * @example ```javascript
816
- * const contentful = require('contentful-management')
817
- *
818
- * client.getSpace('<space_id>')
819
- * .then((space) => space.getSpaceMembers({'limit': 100}))
820
- * .then((spaceMemberCollection) => console.log(spaceMemberCollection))
821
- * .catch(console.error)
822
- * ```
823
- */
824
- getSpaceMembers(query = {}) {
825
- const raw = this.toPlainObject();
826
- return makeRequest({
827
- entityType: 'SpaceMember',
828
- action: 'getMany',
829
- params: {
830
- spaceId: raw.sys.id,
831
- query: createRequestConfig({
832
- query
833
- }).params
834
- }
835
- }).then(data => wrapSpaceMemberCollection(makeRequest, data));
836
- },
837
- /**
838
- * Gets a Space Membership
839
- * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
840
- * @param id - Space Membership ID
841
- * @return Promise for a Space Membership
842
- * @example ```javascript
843
- * const contentful = require('contentful-management')
844
- *
845
- * client.getSpace('<space_id>')
846
- * .then((space) => space.getSpaceMembership('id'))
847
- * .then((spaceMembership) => console.log(spaceMembership))
848
- * .catch(console.error)
849
- * ```
850
- */
851
- getSpaceMembership(id) {
852
- const raw = this.toPlainObject();
853
- return makeRequest({
854
- entityType: 'SpaceMembership',
855
- action: 'get',
856
- params: {
857
- spaceId: raw.sys.id,
858
- spaceMembershipId: id
859
- }
860
- }).then(data => wrapSpaceMembership(makeRequest, data));
861
- },
862
- /**
863
- * Gets a collection of Space Memberships
864
- * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
865
- * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
866
- * @return Promise for a collection of Space Memberships
867
- * @example ```javascript
868
- * const contentful = require('contentful-management')
869
- *
870
- * client.getSpace('<space_id>')
871
- * .then((space) => space.getSpaceMemberships({'limit': 100})) // you can add more queries as 'key': 'value'
872
- * .then((response) => console.log(response.items))
873
- * .catch(console.error)
874
- * ```
875
- */
876
- getSpaceMemberships(query = {}) {
877
- const raw = this.toPlainObject();
878
- return makeRequest({
879
- entityType: 'SpaceMembership',
880
- action: 'getMany',
881
- params: {
882
- spaceId: raw.sys.id,
883
- query: createRequestConfig({
884
- query
885
- }).params
886
- }
887
- }).then(data => wrapSpaceMembershipCollection(makeRequest, data));
888
- },
889
- /**
890
- * Creates a Space Membership
891
- * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
892
- * @param data - Object representation of the Space Membership to be created
893
- * @return Promise for the newly created Space Membership
894
- * @example ```javascript
895
- * const contentful = require('contentful-management')
896
- *
897
- * const client = contentful.createClient({
898
- * accessToken: '<content_management_api_key>'
899
- * })
900
- *
901
- * client.getSpace('<space_id>')
902
- * .then((space) => space.createSpaceMembership({
903
- * admin: false,
904
- * roles: [
905
- * {
906
- * type: 'Link',
907
- * linkType: 'Role',
908
- * id: '<role_id>'
909
- * }
910
- * ],
911
- * email: 'foo@example.com'
912
- * }))
913
- * .then((spaceMembership) => console.log(spaceMembership))
914
- * .catch(console.error)
915
- * ```
916
- */
917
- createSpaceMembership(data) {
918
- const raw = this.toPlainObject();
919
- return makeRequest({
920
- entityType: 'SpaceMembership',
921
- action: 'create',
922
- params: {
923
- spaceId: raw.sys.id
924
- },
925
- payload: data
926
- }).then(response => wrapSpaceMembership(makeRequest, response));
927
- },
928
- /**
929
- * Creates a Space Membership with a custom ID
930
- * Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).
931
- * @param id - Space Membership ID
932
- * @param data - Object representation of the Space Membership to be created
933
- * @return Promise for the newly created Space Membership
934
- * @example ```javascript
935
- * const contentful = require('contentful-management')
936
- *
937
- * const client = contentful.createClient({
938
- * accessToken: '<content_management_api_key>'
939
- * })
940
- *
941
- * client.getSpace('<space_id>')
942
- * .then((space) => space.createSpaceMembershipWithId('<space-membership-id>', {
943
- * admin: false,
944
- * roles: [
945
- * {
946
- * type: 'Link',
947
- * linkType: 'Role',
948
- * id: '<role_id>'
949
- * }
950
- * ],
951
- * email: 'foo@example.com'
952
- * }))
953
- * .then((spaceMembership) => console.log(spaceMembership))
954
- * .catch(console.error)
955
- * ```
956
- */
957
- createSpaceMembershipWithId(id, data) {
958
- const raw = this.toPlainObject();
959
- return makeRequest({
960
- entityType: 'SpaceMembership',
961
- action: 'createWithId',
962
- params: {
963
- spaceId: raw.sys.id,
964
- spaceMembershipId: id
965
- },
966
- payload: data
967
- }).then(response => wrapSpaceMembership(makeRequest, response));
968
- },
969
- /**
970
- * Gets a Team Space Membership
971
- * @param id - Team Space Membership ID
972
- * @return Promise for a Team Space Membership
973
- * @example ```javascript
974
- * const contentful = require('contentful-management')
975
- *
976
- * client.getSpace('<space_id>')
977
- * .then((space) => space.getTeamSpaceMembership('team_space_membership_id'))
978
- * .then((teamSpaceMembership) => console.log(teamSpaceMembership))
979
- * .catch(console.error)
980
- * ```
981
- */
982
- getTeamSpaceMembership(teamSpaceMembershipId) {
983
- const raw = this.toPlainObject();
984
- return makeRequest({
985
- entityType: 'TeamSpaceMembership',
986
- action: 'get',
987
- params: {
988
- spaceId: raw.sys.id,
989
- teamSpaceMembershipId
990
- }
991
- }).then(data => wrapTeamSpaceMembership(makeRequest, data));
992
- },
993
- /**
994
- * Gets a collection of Team Space Memberships
995
- * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
996
- * @return Promise for a collection of Team Space Memberships
997
- * @example ```javascript
998
- * const contentful = require('contentful-management')
999
- *
1000
- * client.getSpace('<space_id>')
1001
- * .then((space) => space.getTeamSpaceMemberships())
1002
- * .then((response) => console.log(response.items))
1003
- * .catch(console.error)
1004
- * ```
1005
- */
1006
- getTeamSpaceMemberships(query = {}) {
1007
- const raw = this.toPlainObject();
1008
- return makeRequest({
1009
- entityType: 'TeamSpaceMembership',
1010
- action: 'getMany',
1011
- params: {
1012
- spaceId: raw.sys.id,
1013
- query: createRequestConfig({
1014
- query: query
1015
- }).params
1016
- }
1017
- }).then(data => wrapTeamSpaceMembershipCollection(makeRequest, data));
1018
- },
1019
- /**
1020
- * Creates a Team Space Membership
1021
- * @param id - Team ID
1022
- * @param data - Object representation of the Team Space Membership to be created
1023
- * @return Promise for the newly created Team Space Membership
1024
- * @example ```javascript
1025
- * const contentful = require('contentful-management')
1026
- *
1027
- * const client = contentful.createClient({
1028
- * accessToken: '<content_management_api_key>'
1029
- * })
1030
- *
1031
- * client.getSpace('<space_id>')
1032
- * .then((space) => space.createTeamSpaceMembership('team_id', {
1033
- * admin: false,
1034
- * roles: [
1035
- * {
1036
- sys: {
1037
- * type: 'Link',
1038
- * linkType: 'Role',
1039
- * id: '<role_id>'
1040
- * }
1041
- * }
1042
- * ],
1043
- * }))
1044
- * .then((teamSpaceMembership) => console.log(teamSpaceMembership))
1045
- * .catch(console.error)
1046
- * ```
1047
- */
1048
- createTeamSpaceMembership(teamId, data) {
1049
- const raw = this.toPlainObject();
1050
- return makeRequest({
1051
- entityType: 'TeamSpaceMembership',
1052
- action: 'create',
1053
- params: {
1054
- spaceId: raw.sys.id,
1055
- teamId
1056
- },
1057
- payload: data
1058
- }).then(response => wrapTeamSpaceMembership(makeRequest, response));
1059
- },
1060
- /**
1061
- * Gets a Api Key
1062
- * @param id - API Key ID
1063
- * @return Promise for a Api Key
1064
- * @example ```javascript
1065
- * const contentful = require('contentful-management')
1066
- *
1067
- * const client = contentful.createClient({
1068
- * accessToken: '<content_management_api_key>'
1069
- * })
1070
- *
1071
- * client.getSpace('<space_id>')
1072
- * .then((space) => space.getApiKey('<apikey-id>'))
1073
- * .then((apikey) => console.log(apikey))
1074
- * .catch(console.error)
1075
- * ```
1076
- */
1077
- getApiKey(id) {
1078
- const raw = this.toPlainObject();
1079
- return makeRequest({
1080
- entityType: 'ApiKey',
1081
- action: 'get',
1082
- params: {
1083
- spaceId: raw.sys.id,
1084
- apiKeyId: id
1085
- }
1086
- }).then(data => wrapApiKey(makeRequest, data));
1087
- },
1088
- /**
1089
- * Gets a collection of Api Keys
1090
- * @return Promise for a collection of Api Keys
1091
- * @example ```javascript
1092
- * const contentful = require('contentful-management')
1093
- *
1094
- * const client = contentful.createClient({
1095
- * accessToken: '<content_management_api_key>'
1096
- * })
1097
- *
1098
- * client.getSpace('<space_id>')
1099
- * .then((space) => space.getApiKeys())
1100
- * .then((response) => console.log(response.items))
1101
- * .catch(console.error)
1102
- * ```
1103
- */
1104
- getApiKeys() {
1105
- const raw = this.toPlainObject();
1106
- return makeRequest({
1107
- entityType: 'ApiKey',
1108
- action: 'getMany',
1109
- params: {
1110
- spaceId: raw.sys.id
1111
- }
1112
- }).then(data => wrapApiKeyCollection(makeRequest, data));
1113
- },
1114
- /**
1115
- * Gets a collection of preview Api Keys
1116
- * @return Promise for a collection of Preview Api Keys
1117
- * @example ```javascript
1118
- * const contentful = require('contentful-management')
1119
- *
1120
- * const client = contentful.createClient({
1121
- * accessToken: '<content_management_api_key>'
1122
- * })
1123
- *
1124
- * client.getSpace('<space_id>')
1125
- * .then((space) => space.getPreviewApiKeys())
1126
- * .then((response) => console.log(response.items))
1127
- * .catch(console.error)
1128
- * ```
1129
- */
1130
- getPreviewApiKeys() {
1131
- const raw = this.toPlainObject();
1132
- return makeRequest({
1133
- entityType: 'PreviewApiKey',
1134
- action: 'getMany',
1135
- params: {
1136
- spaceId: raw.sys.id
1137
- }
1138
- }).then(data => wrapPreviewApiKeyCollection(makeRequest, data));
1139
- },
1140
- /**
1141
- * Gets a preview Api Key
1142
- * @param id - Preview API Key ID
1143
- * @return Promise for a Preview Api Key
1144
- * @example ```javascript
1145
- * const contentful = require('contentful-management')
1146
- *
1147
- * const client = contentful.createClient({
1148
- * accessToken: '<content_management_api_key>'
1149
- * })
1150
- *
1151
- * client.getSpace('<space_id>')
1152
- * .then((space) => space.getPreviewApiKey('<preview-apikey-id>'))
1153
- * .then((previewApikey) => console.log(previewApikey))
1154
- * .catch(console.error)
1155
- * ```
1156
- */
1157
- getPreviewApiKey(id) {
1158
- const raw = this.toPlainObject();
1159
- return makeRequest({
1160
- entityType: 'PreviewApiKey',
1161
- action: 'get',
1162
- params: {
1163
- spaceId: raw.sys.id,
1164
- previewApiKeyId: id
1165
- }
1166
- }).then(data => wrapPreviewApiKey(makeRequest, data));
1167
- },
1168
- /**
1169
- * Creates a Api Key
1170
- * @param payload - Object representation of the Api Key to be created
1171
- * @return Promise for the newly created Api Key
1172
- * @example ```javascript
1173
- * const contentful = require('contentful-management')
1174
- *
1175
- * const client = contentful.createClient({
1176
- * accessToken: '<content_management_api_key>'
1177
- * })
1178
- *
1179
- * client.getSpace('<space_id>')
1180
- * .then((space) => space.createApiKey({
1181
- * name: 'API Key name',
1182
- * environments:[
1183
- * {
1184
- * sys: {
1185
- * type: 'Link'
1186
- * linkType: 'Environment',
1187
- * id:'<environment_id>'
1188
- * }
1189
- * }
1190
- * ]
1191
- * }
1192
- * }))
1193
- * .then((apiKey) => console.log(apiKey))
1194
- * .catch(console.error)
1195
- * ```
1196
- */
1197
- createApiKey: function createApiKey(payload) {
1198
- const raw = this.toPlainObject();
1199
- return makeRequest({
1200
- entityType: 'ApiKey',
1201
- action: 'create',
1202
- params: {
1203
- spaceId: raw.sys.id
1204
- },
1205
- payload
1206
- }).then(data => wrapApiKey(makeRequest, data));
1207
- },
1208
- /**
1209
- * Creates a Api Key with a custom ID
1210
- * @param id - Api Key ID
1211
- * @param payload - Object representation of the Api Key to be created
1212
- * @return Promise for the newly created Api Key
1213
- * @example ```javascript
1214
- * const contentful = require('contentful-management')
1215
- *
1216
- * const client = contentful.createClient({
1217
- * accessToken: '<content_management_api_key>'
1218
- * })
1219
- *
1220
- * client.getSpace('<space_id>')
1221
- * .then((space) => space.createApiKeyWithId('<api-key-id>', {
1222
- * name: 'API Key name'
1223
- * environments:[
1224
- * {
1225
- * sys: {
1226
- * type: 'Link'
1227
- * linkType: 'Environment',
1228
- * id:'<environment_id>'
1229
- * }
1230
- * }
1231
- * ]
1232
- * }
1233
- * }))
1234
- * .then((apiKey) => console.log(apiKey))
1235
- * .catch(console.error)
1236
- * ```
1237
- */
1238
- createApiKeyWithId(id, payload) {
1239
- const raw = this.toPlainObject();
1240
- return makeRequest({
1241
- entityType: 'ApiKey',
1242
- action: 'createWithId',
1243
- params: {
1244
- spaceId: raw.sys.id,
1245
- apiKeyId: id
1246
- },
1247
- payload
1248
- }).then(data => wrapApiKey(makeRequest, data));
1249
- },
1250
- /**
1251
- * Creates an EnvironmentAlias with a custom ID
1252
- * @param environmentAliasId - EnvironmentAlias ID
1253
- * @param data - Object representation of the EnvironmentAlias to be created
1254
- * @return Promise for the newly created EnvironmentAlias
1255
- * @example ```javascript
1256
- * const contentful = require('contentful-management')
1257
- *
1258
- * const client = contentful.createClient({
1259
- * accessToken: '<content_management_api_key>'
1260
- * })
1261
- *
1262
- * client.getSpace('<space_id>')
1263
- * .then((space) => space.createEnvironmentAliasWithId('<environment-alias-id>', {
1264
- * environment: {
1265
- * sys: { type: 'Link', linkType: 'Environment', id: 'targetEnvironment' }
1266
- * }
1267
- * }))
1268
- * .then((environmentAlias) => console.log(environmentAlias))
1269
- * .catch(console.error)
1270
- * ```
1271
- */
1272
- createEnvironmentAliasWithId(environmentAliasId, data) {
1273
- const raw = this.toPlainObject();
1274
- return makeRequest({
1275
- entityType: 'EnvironmentAlias',
1276
- action: 'createWithId',
1277
- params: {
1278
- spaceId: raw.sys.id,
1279
- environmentAliasId
1280
- },
1281
- payload: data
1282
- }).then(response => wrapEnvironmentAlias(makeRequest, response));
1283
- },
1284
- /**
1285
- * Gets an Environment Alias
1286
- * @param Environment Alias ID
1287
- * @return Promise for an Environment Alias
1288
- * @example ```javascript
1289
- * const contentful = require('contentful-management')
1290
- *
1291
- * const client = contentful.createClient({
1292
- * accessToken: '<content_management_api_key>'
1293
- * })
1294
- *
1295
- * client.getSpace('<space_id>')
1296
- * .then((space) => space.getEnvironmentAlias('<alias-id>'))
1297
- * .then((alias) => console.log(alias))
1298
- * .catch(console.error)
1299
- * ```
1300
- */
1301
- getEnvironmentAlias(environmentAliasId) {
1302
- const raw = this.toPlainObject();
1303
- return makeRequest({
1304
- entityType: 'EnvironmentAlias',
1305
- action: 'get',
1306
- params: {
1307
- spaceId: raw.sys.id,
1308
- environmentAliasId
1309
- }
1310
- }).then(data => wrapEnvironmentAlias(makeRequest, data));
1311
- },
1312
- /**
1313
- * Gets a collection of Environment Aliases
1314
- * @return Promise for a collection of Environment Aliases
1315
- * @example ```javascript
1316
- * const contentful = require('contentful-management')
1317
- *
1318
- * const client = contentful.createClient({
1319
- * accessToken: '<content_management_api_key>'
1320
- * })
1321
- *
1322
- * client.getSpace('<space_id>')
1323
- * .then((space) => space.getEnvironmentAliases()
1324
- * .then((response) => console.log(response.items))
1325
- * .catch(console.error)
1326
- * ```
1327
- */
1328
- getEnvironmentAliases() {
1329
- const raw = this.toPlainObject();
1330
- return makeRequest({
1331
- entityType: 'EnvironmentAlias',
1332
- action: 'getMany',
1333
- params: {
1334
- spaceId: raw.sys.id
1335
- }
1336
- }).then(data => wrapEnvironmentAliasCollection(makeRequest, data));
1337
- },
1338
- /**
1339
- * Query for scheduled actions in space.
1340
- * @param query - Object with search parameters. The enviroment id field is mandatory. Check the <a href="https://www.contentful.com/developers/docs/references/content-management-api/#/reference/scheduled-actions/scheduled-actions-collection">REST API reference</a> for more details.
1341
- * @return Promise for the scheduled actions query
1342
- *
1343
- * @example ```javascript
1344
- * const contentful = require('contentful-management');
1345
- *
1346
- * const client = contentful.createClient({
1347
- * accessToken: '<content_management_api_key>'
1348
- * })
1349
- *
1350
- * client.getSpace('<space_id>')
1351
- * .then((space) => space.getScheduledActions({
1352
- * 'environment.sys.id': '<environment_id>',
1353
- * 'sys.status': 'scheduled'
1354
- * }))
1355
- * .then((scheduledActionCollection) => console.log(scheduledActionCollection.items))
1356
- * .catch(console.error)
1357
- * ```
1358
- */
1359
- getScheduledActions(query) {
1360
- const raw = this.toPlainObject();
1361
- return makeRequest({
1362
- entityType: 'ScheduledAction',
1363
- action: 'getMany',
1364
- params: {
1365
- spaceId: raw.sys.id,
1366
- query
1367
- }
1368
- }).then(response => wrapScheduledActionCollection(makeRequest, response));
1369
- },
1370
- /**
1371
- * Get a Scheduled Action in the current space by environment and ID.
1372
- *
1373
- * @throws if the Scheduled Action cannot be found or the user doesn't have permission to read schedules from the entity of the scheduled action itself.
1374
- * @returns Promise with the Scheduled Action
1375
- * @example ```javascript
1376
- * const contentful = require('contentful-management');
1377
- *
1378
- * const client = contentful.createClient({
1379
- * accessToken: '<content_management_api_key>'
1380
- * })
1381
- *
1382
- * client.getSpace('<space_id>')
1383
- * .then((space) => space.getScheduledAction({
1384
- * scheduledActionId: '<scheduled-action-id>',
1385
- * environmentId: '<environmentId>'
1386
- * }))
1387
- * .then((scheduledAction) => console.log(scheduledAction))
1388
- * .catch(console.error)
1389
- * ```
1390
- */
1391
- getScheduledAction({
1392
- scheduledActionId,
1393
- environmentId
1394
- }) {
1395
- const space = this.toPlainObject();
1396
- return makeRequest({
1397
- entityType: 'ScheduledAction',
1398
- action: 'get',
1399
- params: {
1400
- spaceId: space.sys.id,
1401
- environmentId,
1402
- scheduledActionId
1403
- }
1404
- }).then(scheduledAction => wrapScheduledAction(makeRequest, scheduledAction));
1405
- },
1406
- /**
1407
- * Creates a scheduled action
1408
- * @param data - Object representation of the scheduled action to be created
1409
- * @return Promise for the newly created scheduled actions
1410
- * @example ```javascript
1411
- * const contentful = require('contentful-management');
1412
- *
1413
- * const client = contentful.createClient({
1414
- * accessToken: '<content_management_api_key>'
1415
- * })
1416
- *
1417
- * client.getSpace('<space_id>')
1418
- * .then((space) => space.createScheduledAction({
1419
- * entity: {
1420
- * sys: {
1421
- * type: 'Link',
1422
- * linkType: 'Entry',
1423
- * id: '<entry_id>'
1424
- * }
1425
- * },
1426
- * environment: {
1427
- * sys: {
1428
- * type: 'Link',
1429
- * linkType: 'Environment',
1430
- * id: '<environment_id>'
1431
- * }
1432
- * },
1433
- * action: 'publish',
1434
- * scheduledFor: {
1435
- * datetime: <ISO_date_string>,
1436
- * timezone: 'Europe/Berlin'
1437
- * }
1438
- * }))
1439
- * .then((scheduledAction) => console.log(scheduledAction))
1440
- * .catch(console.error)
1441
- * ```
1442
- */
1443
- createScheduledAction(data) {
1444
- const raw = this.toPlainObject();
1445
- return makeRequest({
1446
- entityType: 'ScheduledAction',
1447
- action: 'create',
1448
- params: {
1449
- spaceId: raw.sys.id
1450
- },
1451
- payload: data
1452
- }).then(response => wrapScheduledAction(makeRequest, response));
1453
- },
1454
- /**
1455
- * Update a scheduled action
1456
- * @param {object} options
1457
- * @param options.scheduledActionId the id of the scheduled action to update
1458
- * @param options.version the sys.version of the scheduled action to be updated
1459
- * @param payload the scheduled actions object with updates, omitting sys object
1460
- * @returns Promise containing a wrapped scheduled action with helper methods
1461
- * @example ```javascript
1462
- * const contentful = require('contentful-management');
1463
- *
1464
- * const client = contentful.createClient({
1465
- * accessToken: '<content_management_api_key>'
1466
- * })
1467
- *
1468
- * client.getSpace('<space_id>')
1469
- * .then((space) => {
1470
- * return space.createScheduledAction({
1471
- * entity: {
1472
- * sys: {
1473
- * type: 'Link',
1474
- * linkType: 'Entry',
1475
- * id: '<entry_id>'
1476
- * }
1477
- * },
1478
- * environment: {
1479
- * sys: {
1480
- * type: 'Link',
1481
- * linkType: 'Environment',
1482
- * id: '<environment_id>'
1483
- * }
1484
- * },
1485
- * action: 'publish',
1486
- * scheduledFor: {
1487
- * datetime: <ISO_date_string>,
1488
- * timezone: 'Europe/Berlin'
1489
- * }
1490
- * })
1491
- * .then((scheduledAction) => {
1492
- * const { _sys, ...payload } = scheduledAction;
1493
- * return space.updateScheduledAction({
1494
- * ...payload,
1495
- * scheduledFor: {
1496
- * ...payload.scheduledFor,
1497
- * timezone: 'Europe/Paris'
1498
- * }
1499
- * })
1500
- * })
1501
- * .then((scheduledAction) => console.log(scheduledAction))
1502
- * .catch(console.error);
1503
- * ```
1504
- */
1505
- updateScheduledAction({
1506
- scheduledActionId,
1507
- payload,
1508
- version
1509
- }) {
1510
- const spaceProps = this.toPlainObject();
1511
- return makeRequest({
1512
- entityType: 'ScheduledAction',
1513
- action: 'update',
1514
- params: {
1515
- spaceId: spaceProps.sys.id,
1516
- version,
1517
- scheduledActionId
1518
- },
1519
- payload
1520
- }).then(response => wrapScheduledAction(makeRequest, response));
1521
- },
1522
- /**
1523
- * Cancels a Scheduled Action.
1524
- * Only cancels actions that have not yet executed.
1525
- *
1526
- * @param {object} options
1527
- * @param options.scheduledActionId the id of the scheduled action to be canceled
1528
- * @param options.environmentId the environment ID of the scheduled action to be canceled
1529
- * @throws if the Scheduled Action cannot be found or the user doesn't have permissions in the entity in the action.
1530
- * @returns Promise containing a wrapped Scheduled Action with helper methods
1531
- * @example ```javascript
1532
- * const contentful = require('contentful-management');
1533
- *
1534
- * const client = contentful.createClient({
1535
- * accessToken: '<content_management_api_key>'
1536
- * })
1537
- *
1538
- * // Given that an Scheduled Action is scheduled
1539
- * client.getSpace('<space_id>')
1540
- * .then((space) => space.deleteScheduledAction({
1541
- * environmentId: '<environment-id>',
1542
- * scheduledActionId: '<scheduled-action-id>'
1543
- * }))
1544
- * // The scheduled Action sys.status is now 'canceled'
1545
- * .then((scheduledAction) => console.log(scheduledAction))
1546
- * .catch(console.error);
1547
- * ```
1548
- */
1549
- deleteScheduledAction({
1550
- scheduledActionId,
1551
- environmentId
1552
- }) {
1553
- const spaceProps = this.toPlainObject();
1554
- return makeRequest({
1555
- entityType: 'ScheduledAction',
1556
- action: 'delete',
1557
- params: {
1558
- spaceId: spaceProps.sys.id,
1559
- environmentId,
1560
- scheduledActionId
1561
- }
1562
- }).then(response => wrapScheduledAction(makeRequest, response));
1563
- }
1564
- };
1565
- }