contentful-management 12.0.0-beta.11 → 12.0.0-beta.13

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 (672) hide show
  1. package/README.md +5 -3
  2. package/dist/{contentful-management.browser.js → contentful-management.bundle.browser.js} +562 -500
  3. package/dist/contentful-management.bundle.browser.js.map +1 -0
  4. package/dist/contentful-management.bundle.browser.min.js +2 -0
  5. package/dist/contentful-management.bundle.browser.min.js.map +1 -0
  6. package/dist/{contentful-management.node.cjs → contentful-management.bundle.node.cjs} +351 -176
  7. package/dist/contentful-management.bundle.node.cjs.map +1 -0
  8. package/dist/esm/adapters/REST/endpoints/environment-template-installation.js +2 -2
  9. package/dist/esm/adapters/REST/endpoints/environment-template-installation.js.map +1 -1
  10. package/dist/esm/common-types.js.map +1 -1
  11. package/dist/esm/create-contentful-api.js +1 -1
  12. package/dist/esm/create-environment-template-api.js +3 -1
  13. package/dist/esm/create-environment-template-api.js.map +1 -1
  14. package/dist/esm/entities/environment-template-installation.js.map +1 -1
  15. package/dist/esm/index.js +1 -1
  16. package/dist/esm/plain/plain-client.js +1 -1
  17. package/dist/stats-browser-min.html +1 -1
  18. package/dist/types/adapters/REST/endpoints/access-token.js +1 -0
  19. package/dist/types/adapters/REST/endpoints/access-token.js.map +1 -0
  20. package/dist/types/adapters/REST/endpoints/ai-action-invocation.js +1 -0
  21. package/dist/types/adapters/REST/endpoints/ai-action-invocation.js.map +1 -0
  22. package/dist/types/adapters/REST/endpoints/ai-action.js +1 -0
  23. package/dist/types/adapters/REST/endpoints/ai-action.js.map +1 -0
  24. package/dist/types/adapters/REST/endpoints/api-key.js +1 -0
  25. package/dist/types/adapters/REST/endpoints/api-key.js.map +1 -0
  26. package/dist/types/adapters/REST/endpoints/app-access-token.js +1 -0
  27. package/dist/types/adapters/REST/endpoints/app-access-token.js.map +1 -0
  28. package/dist/types/adapters/REST/endpoints/app-action-call.js +1 -0
  29. package/dist/types/adapters/REST/endpoints/app-action-call.js.map +1 -0
  30. package/dist/types/adapters/REST/endpoints/app-action.js +1 -0
  31. package/dist/types/adapters/REST/endpoints/app-action.js.map +1 -0
  32. package/dist/types/adapters/REST/endpoints/app-bundle.js +1 -0
  33. package/dist/types/adapters/REST/endpoints/app-bundle.js.map +1 -0
  34. package/dist/types/adapters/REST/endpoints/app-definition.js +1 -0
  35. package/dist/types/adapters/REST/endpoints/app-definition.js.map +1 -0
  36. package/dist/types/adapters/REST/endpoints/app-details.js +1 -0
  37. package/dist/types/adapters/REST/endpoints/app-details.js.map +1 -0
  38. package/dist/types/adapters/REST/endpoints/app-event-subscription.js +1 -0
  39. package/dist/types/adapters/REST/endpoints/app-event-subscription.js.map +1 -0
  40. package/dist/types/adapters/REST/endpoints/app-installation.js +1 -0
  41. package/dist/types/adapters/REST/endpoints/app-installation.js.map +1 -0
  42. package/dist/types/adapters/REST/endpoints/app-key.js +1 -0
  43. package/dist/types/adapters/REST/endpoints/app-key.js.map +1 -0
  44. package/dist/types/adapters/REST/endpoints/app-signed-request.js +1 -0
  45. package/dist/types/adapters/REST/endpoints/app-signed-request.js.map +1 -0
  46. package/dist/types/adapters/REST/endpoints/app-signing-secret.js +1 -0
  47. package/dist/types/adapters/REST/endpoints/app-signing-secret.js.map +1 -0
  48. package/dist/types/adapters/REST/endpoints/app-upload.js +1 -0
  49. package/dist/types/adapters/REST/endpoints/app-upload.js.map +1 -0
  50. package/dist/types/adapters/REST/endpoints/asset-key.js +1 -0
  51. package/dist/types/adapters/REST/endpoints/asset-key.js.map +1 -0
  52. package/dist/types/adapters/REST/endpoints/asset.js +1 -0
  53. package/dist/types/adapters/REST/endpoints/asset.js.map +1 -0
  54. package/dist/types/adapters/REST/endpoints/bulk-action.js +1 -0
  55. package/dist/types/adapters/REST/endpoints/bulk-action.js.map +1 -0
  56. package/dist/types/adapters/REST/endpoints/comment.js +1 -0
  57. package/dist/types/adapters/REST/endpoints/comment.js.map +1 -0
  58. package/dist/types/adapters/REST/endpoints/concept-scheme.js +1 -0
  59. package/dist/types/adapters/REST/endpoints/concept-scheme.js.map +1 -0
  60. package/dist/types/adapters/REST/endpoints/concept.js +1 -0
  61. package/dist/types/adapters/REST/endpoints/concept.js.map +1 -0
  62. package/dist/types/adapters/REST/endpoints/content-type.js +1 -0
  63. package/dist/types/adapters/REST/endpoints/content-type.js.map +1 -0
  64. package/dist/types/adapters/REST/endpoints/editor-interface.js +1 -0
  65. package/dist/types/adapters/REST/endpoints/editor-interface.js.map +1 -0
  66. package/dist/types/adapters/REST/endpoints/entry.js +1 -0
  67. package/dist/types/adapters/REST/endpoints/entry.js.map +1 -0
  68. package/dist/types/adapters/REST/endpoints/environment-alias.js +1 -0
  69. package/dist/types/adapters/REST/endpoints/environment-alias.js.map +1 -0
  70. package/dist/types/adapters/REST/endpoints/environment-template-installation.js +3 -2
  71. package/dist/types/adapters/REST/endpoints/environment-template-installation.js.map +1 -0
  72. package/dist/types/adapters/REST/endpoints/environment-template.js +1 -0
  73. package/dist/types/adapters/REST/endpoints/environment-template.js.map +1 -0
  74. package/dist/types/adapters/REST/endpoints/environment.js +1 -0
  75. package/dist/types/adapters/REST/endpoints/environment.js.map +1 -0
  76. package/dist/types/adapters/REST/endpoints/extension.js +1 -0
  77. package/dist/types/adapters/REST/endpoints/extension.js.map +1 -0
  78. package/dist/types/adapters/REST/endpoints/function-log.js +1 -0
  79. package/dist/types/adapters/REST/endpoints/function-log.js.map +1 -0
  80. package/dist/types/adapters/REST/endpoints/function.js +1 -0
  81. package/dist/types/adapters/REST/endpoints/function.js.map +1 -0
  82. package/dist/types/adapters/REST/endpoints/http.js +1 -0
  83. package/dist/types/adapters/REST/endpoints/http.js.map +1 -0
  84. package/dist/types/adapters/REST/endpoints/index.js +1 -0
  85. package/dist/types/adapters/REST/endpoints/index.js.map +1 -0
  86. package/dist/types/adapters/REST/endpoints/locale.js +1 -0
  87. package/dist/types/adapters/REST/endpoints/locale.js.map +1 -0
  88. package/dist/types/adapters/REST/endpoints/oauth-application.js +1 -0
  89. package/dist/types/adapters/REST/endpoints/oauth-application.js.map +1 -0
  90. package/dist/types/adapters/REST/endpoints/organization-invitation.js +1 -0
  91. package/dist/types/adapters/REST/endpoints/organization-invitation.js.map +1 -0
  92. package/dist/types/adapters/REST/endpoints/organization-membership.js +1 -0
  93. package/dist/types/adapters/REST/endpoints/organization-membership.js.map +1 -0
  94. package/dist/types/adapters/REST/endpoints/organization.js +1 -0
  95. package/dist/types/adapters/REST/endpoints/organization.js.map +1 -0
  96. package/dist/types/adapters/REST/endpoints/personal-access-token.js +1 -0
  97. package/dist/types/adapters/REST/endpoints/personal-access-token.js.map +1 -0
  98. package/dist/types/adapters/REST/endpoints/preview-api-key.js +1 -0
  99. package/dist/types/adapters/REST/endpoints/preview-api-key.js.map +1 -0
  100. package/dist/types/adapters/REST/endpoints/raw.js +1 -0
  101. package/dist/types/adapters/REST/endpoints/raw.js.map +1 -0
  102. package/dist/types/adapters/REST/endpoints/release-action.js +1 -0
  103. package/dist/types/adapters/REST/endpoints/release-action.js.map +1 -0
  104. package/dist/types/adapters/REST/endpoints/release-asset.js +1 -0
  105. package/dist/types/adapters/REST/endpoints/release-asset.js.map +1 -0
  106. package/dist/types/adapters/REST/endpoints/release-entry.js +1 -0
  107. package/dist/types/adapters/REST/endpoints/release-entry.js.map +1 -0
  108. package/dist/types/adapters/REST/endpoints/release.js +1 -0
  109. package/dist/types/adapters/REST/endpoints/release.js.map +1 -0
  110. package/dist/types/adapters/REST/endpoints/resource-provider.js +1 -0
  111. package/dist/types/adapters/REST/endpoints/resource-provider.js.map +1 -0
  112. package/dist/types/adapters/REST/endpoints/resource-type.js +1 -0
  113. package/dist/types/adapters/REST/endpoints/resource-type.js.map +1 -0
  114. package/dist/types/adapters/REST/endpoints/resource.js +1 -0
  115. package/dist/types/adapters/REST/endpoints/resource.js.map +1 -0
  116. package/dist/types/adapters/REST/endpoints/role.js +1 -0
  117. package/dist/types/adapters/REST/endpoints/role.js.map +1 -0
  118. package/dist/types/adapters/REST/endpoints/scheduled-action.js +1 -0
  119. package/dist/types/adapters/REST/endpoints/scheduled-action.js.map +1 -0
  120. package/dist/types/adapters/REST/endpoints/snapshot.js +1 -0
  121. package/dist/types/adapters/REST/endpoints/snapshot.js.map +1 -0
  122. package/dist/types/adapters/REST/endpoints/space-member.js +1 -0
  123. package/dist/types/adapters/REST/endpoints/space-member.js.map +1 -0
  124. package/dist/types/adapters/REST/endpoints/space-membership.js +1 -0
  125. package/dist/types/adapters/REST/endpoints/space-membership.js.map +1 -0
  126. package/dist/types/adapters/REST/endpoints/space.js +1 -0
  127. package/dist/types/adapters/REST/endpoints/space.js.map +1 -0
  128. package/dist/types/adapters/REST/endpoints/tag.js +1 -0
  129. package/dist/types/adapters/REST/endpoints/tag.js.map +1 -0
  130. package/dist/types/adapters/REST/endpoints/task.js +1 -0
  131. package/dist/types/adapters/REST/endpoints/task.js.map +1 -0
  132. package/dist/types/adapters/REST/endpoints/team-membership.js +1 -0
  133. package/dist/types/adapters/REST/endpoints/team-membership.js.map +1 -0
  134. package/dist/types/adapters/REST/endpoints/team-space-membership.js +1 -0
  135. package/dist/types/adapters/REST/endpoints/team-space-membership.js.map +1 -0
  136. package/dist/types/adapters/REST/endpoints/team.js +1 -0
  137. package/dist/types/adapters/REST/endpoints/team.js.map +1 -0
  138. package/dist/types/adapters/REST/endpoints/ui-config.js +1 -0
  139. package/dist/types/adapters/REST/endpoints/ui-config.js.map +1 -0
  140. package/dist/types/adapters/REST/endpoints/upload-credentials.js +1 -0
  141. package/dist/types/adapters/REST/endpoints/upload-credentials.js.map +1 -0
  142. package/dist/types/adapters/REST/endpoints/upload.js +1 -0
  143. package/dist/types/adapters/REST/endpoints/upload.js.map +1 -0
  144. package/dist/types/adapters/REST/endpoints/usage.js +1 -0
  145. package/dist/types/adapters/REST/endpoints/usage.js.map +1 -0
  146. package/dist/types/adapters/REST/endpoints/user-ui-config.js +1 -0
  147. package/dist/types/adapters/REST/endpoints/user-ui-config.js.map +1 -0
  148. package/dist/types/adapters/REST/endpoints/user.js +1 -0
  149. package/dist/types/adapters/REST/endpoints/user.js.map +1 -0
  150. package/dist/types/adapters/REST/endpoints/utils.js +1 -0
  151. package/dist/types/adapters/REST/endpoints/utils.js.map +1 -0
  152. package/dist/types/adapters/REST/endpoints/webhook.js +1 -0
  153. package/dist/types/adapters/REST/endpoints/webhook.js.map +1 -0
  154. package/dist/types/adapters/REST/endpoints/workflow-definition.js +1 -0
  155. package/dist/types/adapters/REST/endpoints/workflow-definition.js.map +1 -0
  156. package/dist/types/adapters/REST/endpoints/workflow.js +1 -0
  157. package/dist/types/adapters/REST/endpoints/workflow.js.map +1 -0
  158. package/dist/types/adapters/REST/endpoints/workflows-changelog.js +1 -0
  159. package/dist/types/adapters/REST/endpoints/workflows-changelog.js.map +1 -0
  160. package/dist/types/adapters/REST/make-request.js +1 -0
  161. package/dist/types/adapters/REST/make-request.js.map +1 -0
  162. package/dist/types/adapters/REST/rest-adapter.js +1 -0
  163. package/dist/types/adapters/REST/rest-adapter.js.map +1 -0
  164. package/dist/types/common-types.d.ts +2 -0
  165. package/dist/types/common-types.js +1 -0
  166. package/dist/types/common-types.js.map +1 -0
  167. package/dist/types/common-utils.js +1 -0
  168. package/dist/types/common-utils.js.map +1 -0
  169. package/dist/types/constants/editor-interface-defaults/controls-defaults.js +1 -0
  170. package/dist/types/constants/editor-interface-defaults/controls-defaults.js.map +1 -0
  171. package/dist/types/constants/editor-interface-defaults/editors-defaults.js +1 -0
  172. package/dist/types/constants/editor-interface-defaults/editors-defaults.js.map +1 -0
  173. package/dist/types/constants/editor-interface-defaults/index.js +1 -0
  174. package/dist/types/constants/editor-interface-defaults/index.js.map +1 -0
  175. package/dist/types/constants/editor-interface-defaults/sidebar-defaults.js +1 -0
  176. package/dist/types/constants/editor-interface-defaults/sidebar-defaults.js.map +1 -0
  177. package/dist/types/constants/editor-interface-defaults/types.js +1 -0
  178. package/dist/types/constants/editor-interface-defaults/types.js.map +1 -0
  179. package/dist/types/create-adapter.js +1 -0
  180. package/dist/types/create-adapter.js.map +1 -0
  181. package/dist/types/create-app-definition-api.js +1 -0
  182. package/dist/types/create-app-definition-api.js.map +1 -0
  183. package/dist/types/create-contentful-api.js +1 -0
  184. package/dist/types/create-contentful-api.js.map +1 -0
  185. package/dist/types/create-entry-api.js +1 -0
  186. package/dist/types/create-entry-api.js.map +1 -0
  187. package/dist/types/create-environment-api.js +1 -0
  188. package/dist/types/create-environment-api.js.map +1 -0
  189. package/dist/types/create-environment-template-api.d.ts +3 -1
  190. package/dist/types/create-environment-template-api.js +4 -1
  191. package/dist/types/create-environment-template-api.js.map +1 -0
  192. package/dist/types/create-organization-api.js +1 -0
  193. package/dist/types/create-organization-api.js.map +1 -0
  194. package/dist/types/create-space-api.js +1 -0
  195. package/dist/types/create-space-api.js.map +1 -0
  196. package/dist/types/create-ui-config-api.js +1 -0
  197. package/dist/types/create-ui-config-api.js.map +1 -0
  198. package/dist/types/create-user-ui-config-api.js +1 -0
  199. package/dist/types/create-user-ui-config-api.js.map +1 -0
  200. package/dist/types/enhance-with-methods.js +1 -0
  201. package/dist/types/enhance-with-methods.js.map +1 -0
  202. package/dist/types/entities/access-token.js +1 -0
  203. package/dist/types/entities/access-token.js.map +1 -0
  204. package/dist/types/entities/ai-action-invocation.js +1 -0
  205. package/dist/types/entities/ai-action-invocation.js.map +1 -0
  206. package/dist/types/entities/ai-action.js +1 -0
  207. package/dist/types/entities/ai-action.js.map +1 -0
  208. package/dist/types/entities/api-key.js +1 -0
  209. package/dist/types/entities/api-key.js.map +1 -0
  210. package/dist/types/entities/app-access-token.js +1 -0
  211. package/dist/types/entities/app-access-token.js.map +1 -0
  212. package/dist/types/entities/app-action-call.js +1 -0
  213. package/dist/types/entities/app-action-call.js.map +1 -0
  214. package/dist/types/entities/app-action.js +1 -0
  215. package/dist/types/entities/app-action.js.map +1 -0
  216. package/dist/types/entities/app-bundle.js +1 -0
  217. package/dist/types/entities/app-bundle.js.map +1 -0
  218. package/dist/types/entities/app-definition.js +1 -0
  219. package/dist/types/entities/app-definition.js.map +1 -0
  220. package/dist/types/entities/app-details.js +1 -0
  221. package/dist/types/entities/app-details.js.map +1 -0
  222. package/dist/types/entities/app-event-subscription.js +1 -0
  223. package/dist/types/entities/app-event-subscription.js.map +1 -0
  224. package/dist/types/entities/app-installation.js +1 -0
  225. package/dist/types/entities/app-installation.js.map +1 -0
  226. package/dist/types/entities/app-key.js +1 -0
  227. package/dist/types/entities/app-key.js.map +1 -0
  228. package/dist/types/entities/app-signed-request.js +1 -0
  229. package/dist/types/entities/app-signed-request.js.map +1 -0
  230. package/dist/types/entities/app-signing-secret.js +1 -0
  231. package/dist/types/entities/app-signing-secret.js.map +1 -0
  232. package/dist/types/entities/app-upload.js +1 -0
  233. package/dist/types/entities/app-upload.js.map +1 -0
  234. package/dist/types/entities/asset-key.js +1 -0
  235. package/dist/types/entities/asset-key.js.map +1 -0
  236. package/dist/types/entities/asset.js +1 -0
  237. package/dist/types/entities/asset.js.map +1 -0
  238. package/dist/types/entities/bulk-action.js +1 -0
  239. package/dist/types/entities/bulk-action.js.map +1 -0
  240. package/dist/types/entities/comment.js +1 -0
  241. package/dist/types/entities/comment.js.map +1 -0
  242. package/dist/types/entities/content-type.js +1 -0
  243. package/dist/types/entities/content-type.js.map +1 -0
  244. package/dist/types/entities/editor-interface.js +1 -0
  245. package/dist/types/entities/editor-interface.js.map +1 -0
  246. package/dist/types/entities/entry.js +1 -0
  247. package/dist/types/entities/entry.js.map +1 -0
  248. package/dist/types/entities/environment-alias.js +1 -0
  249. package/dist/types/entities/environment-alias.js.map +1 -0
  250. package/dist/types/entities/environment-template-installation.d.ts +1 -0
  251. package/dist/types/entities/environment-template-installation.js +1 -0
  252. package/dist/types/entities/environment-template-installation.js.map +1 -0
  253. package/dist/types/entities/environment-template.js +1 -0
  254. package/dist/types/entities/environment-template.js.map +1 -0
  255. package/dist/types/entities/environment.js +1 -0
  256. package/dist/types/entities/environment.js.map +1 -0
  257. package/dist/types/entities/extension.js +1 -0
  258. package/dist/types/entities/extension.js.map +1 -0
  259. package/dist/types/entities/function-log.js +1 -0
  260. package/dist/types/entities/function-log.js.map +1 -0
  261. package/dist/types/entities/function.js +1 -0
  262. package/dist/types/entities/function.js.map +1 -0
  263. package/dist/types/entities/locale.js +1 -0
  264. package/dist/types/entities/locale.js.map +1 -0
  265. package/dist/types/entities/oauth-application.js +1 -0
  266. package/dist/types/entities/oauth-application.js.map +1 -0
  267. package/dist/types/entities/organization-invitation.js +1 -0
  268. package/dist/types/entities/organization-invitation.js.map +1 -0
  269. package/dist/types/entities/organization-membership.js +1 -0
  270. package/dist/types/entities/organization-membership.js.map +1 -0
  271. package/dist/types/entities/organization.js +1 -0
  272. package/dist/types/entities/organization.js.map +1 -0
  273. package/dist/types/entities/personal-access-token.js +1 -0
  274. package/dist/types/entities/personal-access-token.js.map +1 -0
  275. package/dist/types/entities/preview-api-key.js +1 -0
  276. package/dist/types/entities/preview-api-key.js.map +1 -0
  277. package/dist/types/entities/release-action.js +1 -0
  278. package/dist/types/entities/release-action.js.map +1 -0
  279. package/dist/types/entities/release.js +1 -0
  280. package/dist/types/entities/release.js.map +1 -0
  281. package/dist/types/entities/resource-provider.js +1 -0
  282. package/dist/types/entities/resource-provider.js.map +1 -0
  283. package/dist/types/entities/resource-type.js +1 -0
  284. package/dist/types/entities/resource-type.js.map +1 -0
  285. package/dist/types/entities/resource.js +1 -0
  286. package/dist/types/entities/resource.js.map +1 -0
  287. package/dist/types/entities/role.js +1 -0
  288. package/dist/types/entities/role.js.map +1 -0
  289. package/dist/types/entities/scheduled-action.js +1 -0
  290. package/dist/types/entities/scheduled-action.js.map +1 -0
  291. package/dist/types/entities/snapshot.js +1 -0
  292. package/dist/types/entities/snapshot.js.map +1 -0
  293. package/dist/types/entities/space-member.js +1 -0
  294. package/dist/types/entities/space-member.js.map +1 -0
  295. package/dist/types/entities/space-membership.js +1 -0
  296. package/dist/types/entities/space-membership.js.map +1 -0
  297. package/dist/types/entities/space.js +1 -0
  298. package/dist/types/entities/space.js.map +1 -0
  299. package/dist/types/entities/tag.js +1 -0
  300. package/dist/types/entities/tag.js.map +1 -0
  301. package/dist/types/entities/task.js +1 -0
  302. package/dist/types/entities/task.js.map +1 -0
  303. package/dist/types/entities/team-membership.js +1 -0
  304. package/dist/types/entities/team-membership.js.map +1 -0
  305. package/dist/types/entities/team-space-membership.js +1 -0
  306. package/dist/types/entities/team-space-membership.js.map +1 -0
  307. package/dist/types/entities/team.js +1 -0
  308. package/dist/types/entities/team.js.map +1 -0
  309. package/dist/types/entities/ui-config.js +1 -0
  310. package/dist/types/entities/ui-config.js.map +1 -0
  311. package/dist/types/entities/upload.js +1 -0
  312. package/dist/types/entities/upload.js.map +1 -0
  313. package/dist/types/entities/usage.js +1 -0
  314. package/dist/types/entities/usage.js.map +1 -0
  315. package/dist/types/entities/user-ui-config.js +1 -0
  316. package/dist/types/entities/user-ui-config.js.map +1 -0
  317. package/dist/types/entities/user.js +1 -0
  318. package/dist/types/entities/user.js.map +1 -0
  319. package/dist/types/entities/webhook.js +1 -0
  320. package/dist/types/entities/webhook.js.map +1 -0
  321. package/dist/types/entities/workflow-definition.js +1 -0
  322. package/dist/types/entities/workflow-definition.js.map +1 -0
  323. package/dist/types/index.js +1 -0
  324. package/dist/types/index.js.map +1 -0
  325. package/dist/types/methods/action.js +1 -0
  326. package/dist/types/methods/action.js.map +1 -0
  327. package/dist/types/methods/content-type.js +1 -0
  328. package/dist/types/methods/content-type.js.map +1 -0
  329. package/dist/types/methods/utils.js +1 -0
  330. package/dist/types/methods/utils.js.map +1 -0
  331. package/dist/types/plain/as-iterator.js +1 -0
  332. package/dist/types/plain/as-iterator.js.map +1 -0
  333. package/dist/types/plain/checks.js +1 -0
  334. package/dist/types/plain/checks.js.map +1 -0
  335. package/dist/types/plain/common-types.d.ts +2 -0
  336. package/dist/types/plain/pagination-helper.js +1 -0
  337. package/dist/types/plain/pagination-helper.js.map +1 -0
  338. package/dist/types/plain/plain-client.js +1 -0
  339. package/dist/types/plain/plain-client.js.map +1 -0
  340. package/dist/types/plain/wrappers/wrap.js +1 -0
  341. package/dist/types/plain/wrappers/wrap.js.map +1 -0
  342. package/dist/types/upload-http-client.js +1 -0
  343. package/dist/types/upload-http-client.js.map +1 -0
  344. package/package.json +30 -37
  345. package/dist/cjs/adapters/REST/endpoints/access-token.cjs +0 -137
  346. package/dist/cjs/adapters/REST/endpoints/access-token.cjs.map +0 -1
  347. package/dist/cjs/adapters/REST/endpoints/ai-action-invocation.cjs +0 -10
  348. package/dist/cjs/adapters/REST/endpoints/ai-action-invocation.cjs.map +0 -1
  349. package/dist/cjs/adapters/REST/endpoints/ai-action.cjs +0 -58
  350. package/dist/cjs/adapters/REST/endpoints/ai-action.cjs.map +0 -1
  351. package/dist/cjs/adapters/REST/endpoints/api-key.cjs +0 -51
  352. package/dist/cjs/adapters/REST/endpoints/api-key.cjs.map +0 -1
  353. package/dist/cjs/adapters/REST/endpoints/app-access-token.cjs +0 -10
  354. package/dist/cjs/adapters/REST/endpoints/app-access-token.cjs.map +0 -1
  355. package/dist/cjs/adapters/REST/endpoints/app-action-call.cjs +0 -119
  356. package/dist/cjs/adapters/REST/endpoints/app-action-call.cjs.map +0 -1
  357. package/dist/cjs/adapters/REST/endpoints/app-action.cjs +0 -43
  358. package/dist/cjs/adapters/REST/endpoints/app-action.cjs.map +0 -1
  359. package/dist/cjs/adapters/REST/endpoints/app-bundle.cjs +0 -40
  360. package/dist/cjs/adapters/REST/endpoints/app-bundle.cjs.map +0 -1
  361. package/dist/cjs/adapters/REST/endpoints/app-definition.cjs +0 -53
  362. package/dist/cjs/adapters/REST/endpoints/app-definition.cjs.map +0 -1
  363. package/dist/cjs/adapters/REST/endpoints/app-details.cjs +0 -18
  364. package/dist/cjs/adapters/REST/endpoints/app-details.cjs.map +0 -1
  365. package/dist/cjs/adapters/REST/endpoints/app-event-subscription.cjs +0 -18
  366. package/dist/cjs/adapters/REST/endpoints/app-event-subscription.cjs.map +0 -1
  367. package/dist/cjs/adapters/REST/endpoints/app-installation.cjs +0 -49
  368. package/dist/cjs/adapters/REST/endpoints/app-installation.cjs.map +0 -1
  369. package/dist/cjs/adapters/REST/endpoints/app-key.cjs +0 -22
  370. package/dist/cjs/adapters/REST/endpoints/app-key.cjs.map +0 -1
  371. package/dist/cjs/adapters/REST/endpoints/app-signed-request.cjs +0 -10
  372. package/dist/cjs/adapters/REST/endpoints/app-signed-request.cjs.map +0 -1
  373. package/dist/cjs/adapters/REST/endpoints/app-signing-secret.cjs +0 -18
  374. package/dist/cjs/adapters/REST/endpoints/app-signing-secret.cjs.map +0 -1
  375. package/dist/cjs/adapters/REST/endpoints/app-upload.cjs +0 -29
  376. package/dist/cjs/adapters/REST/endpoints/app-upload.cjs.map +0 -1
  377. package/dist/cjs/adapters/REST/endpoints/asset-key.cjs +0 -35
  378. package/dist/cjs/adapters/REST/endpoints/asset-key.cjs.map +0 -1
  379. package/dist/cjs/adapters/REST/endpoints/asset.cjs +0 -223
  380. package/dist/cjs/adapters/REST/endpoints/asset.cjs.map +0 -1
  381. package/dist/cjs/adapters/REST/endpoints/bulk-action.cjs +0 -22
  382. package/dist/cjs/adapters/REST/endpoints/bulk-action.cjs.map +0 -1
  383. package/dist/cjs/adapters/REST/endpoints/comment.cjs +0 -98
  384. package/dist/cjs/adapters/REST/endpoints/comment.cjs.map +0 -1
  385. package/dist/cjs/adapters/REST/endpoints/concept-scheme.cjs +0 -55
  386. package/dist/cjs/adapters/REST/endpoints/concept-scheme.cjs.map +0 -1
  387. package/dist/cjs/adapters/REST/endpoints/concept.cjs +0 -73
  388. package/dist/cjs/adapters/REST/endpoints/concept.cjs.map +0 -1
  389. package/dist/cjs/adapters/REST/endpoints/content-type.cjs +0 -62
  390. package/dist/cjs/adapters/REST/endpoints/content-type.cjs.map +0 -1
  391. package/dist/cjs/adapters/REST/endpoints/editor-interface.cjs +0 -27
  392. package/dist/cjs/adapters/REST/endpoints/editor-interface.cjs.map +0 -1
  393. package/dist/cjs/adapters/REST/endpoints/entry.cjs +0 -128
  394. package/dist/cjs/adapters/REST/endpoints/entry.cjs.map +0 -1
  395. package/dist/cjs/adapters/REST/endpoints/environment-alias.cjs +0 -47
  396. package/dist/cjs/adapters/REST/endpoints/environment-alias.cjs.map +0 -1
  397. package/dist/cjs/adapters/REST/endpoints/environment-template-installation.cjs +0 -24
  398. package/dist/cjs/adapters/REST/endpoints/environment-template-installation.cjs.map +0 -1
  399. package/dist/cjs/adapters/REST/endpoints/environment-template.cjs +0 -52
  400. package/dist/cjs/adapters/REST/endpoints/environment-template.cjs.map +0 -1
  401. package/dist/cjs/adapters/REST/endpoints/environment.cjs +0 -53
  402. package/dist/cjs/adapters/REST/endpoints/environment.cjs.map +0 -1
  403. package/dist/cjs/adapters/REST/endpoints/extension.cjs +0 -47
  404. package/dist/cjs/adapters/REST/endpoints/extension.cjs.map +0 -1
  405. package/dist/cjs/adapters/REST/endpoints/function-log.cjs +0 -28
  406. package/dist/cjs/adapters/REST/endpoints/function-log.cjs.map +0 -1
  407. package/dist/cjs/adapters/REST/endpoints/function.cjs +0 -26
  408. package/dist/cjs/adapters/REST/endpoints/function.cjs.map +0 -1
  409. package/dist/cjs/adapters/REST/endpoints/http.cjs +0 -30
  410. package/dist/cjs/adapters/REST/endpoints/http.cjs.map +0 -1
  411. package/dist/cjs/adapters/REST/endpoints/index.cjs +0 -144
  412. package/dist/cjs/adapters/REST/endpoints/index.cjs.map +0 -1
  413. package/dist/cjs/adapters/REST/endpoints/locale.cjs +0 -40
  414. package/dist/cjs/adapters/REST/endpoints/locale.cjs.map +0 -1
  415. package/dist/cjs/adapters/REST/endpoints/oauth-application.cjs +0 -148
  416. package/dist/cjs/adapters/REST/endpoints/oauth-application.cjs.map +0 -1
  417. package/dist/cjs/adapters/REST/endpoints/organization-invitation.cjs +0 -30
  418. package/dist/cjs/adapters/REST/endpoints/organization-invitation.cjs.map +0 -1
  419. package/dist/cjs/adapters/REST/endpoints/organization-membership.cjs +0 -35
  420. package/dist/cjs/adapters/REST/endpoints/organization-membership.cjs.map +0 -1
  421. package/dist/cjs/adapters/REST/endpoints/organization.cjs +0 -29
  422. package/dist/cjs/adapters/REST/endpoints/organization.cjs.map +0 -1
  423. package/dist/cjs/adapters/REST/endpoints/personal-access-token.cjs +0 -38
  424. package/dist/cjs/adapters/REST/endpoints/personal-access-token.cjs.map +0 -1
  425. package/dist/cjs/adapters/REST/endpoints/preview-api-key.cjs +0 -16
  426. package/dist/cjs/adapters/REST/endpoints/preview-api-key.cjs.map +0 -1
  427. package/dist/cjs/adapters/REST/endpoints/raw.cjs +0 -62
  428. package/dist/cjs/adapters/REST/endpoints/raw.cjs.map +0 -1
  429. package/dist/cjs/adapters/REST/endpoints/release-action.cjs +0 -25
  430. package/dist/cjs/adapters/REST/endpoints/release-action.cjs.map +0 -1
  431. package/dist/cjs/adapters/REST/endpoints/release-asset.cjs +0 -152
  432. package/dist/cjs/adapters/REST/endpoints/release-asset.cjs.map +0 -1
  433. package/dist/cjs/adapters/REST/endpoints/release-entry.cjs +0 -63
  434. package/dist/cjs/adapters/REST/endpoints/release-entry.cjs.map +0 -1
  435. package/dist/cjs/adapters/REST/endpoints/release.cjs +0 -84
  436. package/dist/cjs/adapters/REST/endpoints/release.cjs.map +0 -1
  437. package/dist/cjs/adapters/REST/endpoints/resource-provider.cjs +0 -19
  438. package/dist/cjs/adapters/REST/endpoints/resource-provider.cjs.map +0 -1
  439. package/dist/cjs/adapters/REST/endpoints/resource-type.cjs +0 -31
  440. package/dist/cjs/adapters/REST/endpoints/resource-type.cjs.map +0 -1
  441. package/dist/cjs/adapters/REST/endpoints/resource.cjs +0 -11
  442. package/dist/cjs/adapters/REST/endpoints/resource.cjs.map +0 -1
  443. package/dist/cjs/adapters/REST/endpoints/role.cjs +0 -51
  444. package/dist/cjs/adapters/REST/endpoints/role.cjs.map +0 -1
  445. package/dist/cjs/adapters/REST/endpoints/scheduled-action.cjs +0 -44
  446. package/dist/cjs/adapters/REST/endpoints/scheduled-action.cjs.map +0 -1
  447. package/dist/cjs/adapters/REST/endpoints/snapshot.cjs +0 -31
  448. package/dist/cjs/adapters/REST/endpoints/snapshot.cjs.map +0 -1
  449. package/dist/cjs/adapters/REST/endpoints/space-member.cjs +0 -12
  450. package/dist/cjs/adapters/REST/endpoints/space-member.cjs.map +0 -1
  451. package/dist/cjs/adapters/REST/endpoints/space-membership.cjs +0 -63
  452. package/dist/cjs/adapters/REST/endpoints/space-membership.cjs.map +0 -1
  453. package/dist/cjs/adapters/REST/endpoints/space.cjs +0 -38
  454. package/dist/cjs/adapters/REST/endpoints/space.cjs.map +0 -1
  455. package/dist/cjs/adapters/REST/endpoints/tag.cjs +0 -37
  456. package/dist/cjs/adapters/REST/endpoints/tag.cjs.map +0 -1
  457. package/dist/cjs/adapters/REST/endpoints/task.cjs +0 -41
  458. package/dist/cjs/adapters/REST/endpoints/task.cjs.map +0 -1
  459. package/dist/cjs/adapters/REST/endpoints/team-membership.cjs +0 -39
  460. package/dist/cjs/adapters/REST/endpoints/team-membership.cjs.map +0 -1
  461. package/dist/cjs/adapters/REST/endpoints/team-space-membership.cjs +0 -54
  462. package/dist/cjs/adapters/REST/endpoints/team-space-membership.cjs.map +0 -1
  463. package/dist/cjs/adapters/REST/endpoints/team.cjs +0 -39
  464. package/dist/cjs/adapters/REST/endpoints/team.cjs.map +0 -1
  465. package/dist/cjs/adapters/REST/endpoints/ui-config.cjs +0 -22
  466. package/dist/cjs/adapters/REST/endpoints/ui-config.cjs.map +0 -1
  467. package/dist/cjs/adapters/REST/endpoints/upload-credentials.cjs +0 -16
  468. package/dist/cjs/adapters/REST/endpoints/upload-credentials.cjs.map +0 -1
  469. package/dist/cjs/adapters/REST/endpoints/upload.cjs +0 -43
  470. package/dist/cjs/adapters/REST/endpoints/upload.cjs.map +0 -1
  471. package/dist/cjs/adapters/REST/endpoints/usage.cjs +0 -18
  472. package/dist/cjs/adapters/REST/endpoints/usage.cjs.map +0 -1
  473. package/dist/cjs/adapters/REST/endpoints/user-ui-config.cjs +0 -22
  474. package/dist/cjs/adapters/REST/endpoints/user-ui-config.cjs.map +0 -1
  475. package/dist/cjs/adapters/REST/endpoints/user.cjs +0 -28
  476. package/dist/cjs/adapters/REST/endpoints/user.cjs.map +0 -1
  477. package/dist/cjs/adapters/REST/endpoints/utils.cjs +0 -25
  478. package/dist/cjs/adapters/REST/endpoints/utils.cjs.map +0 -1
  479. package/dist/cjs/adapters/REST/endpoints/webhook.cjs +0 -101
  480. package/dist/cjs/adapters/REST/endpoints/webhook.cjs.map +0 -1
  481. package/dist/cjs/adapters/REST/endpoints/workflow-definition.cjs +0 -42
  482. package/dist/cjs/adapters/REST/endpoints/workflow-definition.cjs.map +0 -1
  483. package/dist/cjs/adapters/REST/endpoints/workflow.cjs +0 -49
  484. package/dist/cjs/adapters/REST/endpoints/workflow.cjs.map +0 -1
  485. package/dist/cjs/adapters/REST/endpoints/workflows-changelog.cjs +0 -12
  486. package/dist/cjs/adapters/REST/endpoints/workflows-changelog.cjs.map +0 -1
  487. package/dist/cjs/adapters/REST/make-request.cjs +0 -23
  488. package/dist/cjs/adapters/REST/make-request.cjs.map +0 -1
  489. package/dist/cjs/adapters/REST/rest-adapter.cjs +0 -44
  490. package/dist/cjs/adapters/REST/rest-adapter.cjs.map +0 -1
  491. package/dist/cjs/common-types.cjs +0 -7
  492. package/dist/cjs/common-types.cjs.map +0 -1
  493. package/dist/cjs/common-utils.cjs +0 -39
  494. package/dist/cjs/common-utils.cjs.map +0 -1
  495. package/dist/cjs/constants/editor-interface-defaults/controls-defaults.cjs +0 -168
  496. package/dist/cjs/constants/editor-interface-defaults/controls-defaults.cjs.map +0 -1
  497. package/dist/cjs/constants/editor-interface-defaults/editors-defaults.cjs +0 -35
  498. package/dist/cjs/constants/editor-interface-defaults/editors-defaults.cjs.map +0 -1
  499. package/dist/cjs/constants/editor-interface-defaults/index.cjs +0 -15
  500. package/dist/cjs/constants/editor-interface-defaults/index.cjs.map +0 -1
  501. package/dist/cjs/constants/editor-interface-defaults/sidebar-defaults.cjs +0 -68
  502. package/dist/cjs/constants/editor-interface-defaults/sidebar-defaults.cjs.map +0 -1
  503. package/dist/cjs/constants/editor-interface-defaults/types.cjs +0 -19
  504. package/dist/cjs/constants/editor-interface-defaults/types.cjs.map +0 -1
  505. package/dist/cjs/create-adapter.cjs +0 -22
  506. package/dist/cjs/create-adapter.cjs.map +0 -1
  507. package/dist/cjs/create-app-definition-api.cjs +0 -254
  508. package/dist/cjs/create-app-definition-api.cjs.map +0 -1
  509. package/dist/cjs/create-contentful-api.cjs +0 -590
  510. package/dist/cjs/create-contentful-api.cjs.map +0 -1
  511. package/dist/cjs/create-entry-api.cjs +0 -490
  512. package/dist/cjs/create-entry-api.cjs.map +0 -1
  513. package/dist/cjs/create-environment-api.cjs +0 -2442
  514. package/dist/cjs/create-environment-api.cjs.map +0 -1
  515. package/dist/cjs/create-environment-template-api.cjs +0 -271
  516. package/dist/cjs/create-environment-template-api.cjs.map +0 -1
  517. package/dist/cjs/create-organization-api.cjs +0 -1139
  518. package/dist/cjs/create-organization-api.cjs.map +0 -1
  519. package/dist/cjs/create-space-api.cjs +0 -1590
  520. package/dist/cjs/create-space-api.cjs.map +0 -1
  521. package/dist/cjs/create-ui-config-api.cjs +0 -55
  522. package/dist/cjs/create-ui-config-api.cjs.map +0 -1
  523. package/dist/cjs/create-user-ui-config-api.cjs +0 -55
  524. package/dist/cjs/create-user-ui-config-api.cjs.map +0 -1
  525. package/dist/cjs/enhance-with-methods.cjs +0 -27
  526. package/dist/cjs/enhance-with-methods.cjs.map +0 -1
  527. package/dist/cjs/entities/access-token.cjs +0 -37
  528. package/dist/cjs/entities/access-token.cjs.map +0 -1
  529. package/dist/cjs/entities/ai-action-invocation.cjs +0 -19
  530. package/dist/cjs/entities/ai-action-invocation.cjs.map +0 -1
  531. package/dist/cjs/entities/ai-action.cjs +0 -76
  532. package/dist/cjs/entities/ai-action.cjs.map +0 -1
  533. package/dist/cjs/entities/api-key.cjs +0 -57
  534. package/dist/cjs/entities/api-key.cjs.map +0 -1
  535. package/dist/cjs/entities/app-access-token.cjs +0 -18
  536. package/dist/cjs/entities/app-access-token.cjs.map +0 -1
  537. package/dist/cjs/entities/app-action-call.cjs +0 -69
  538. package/dist/cjs/entities/app-action-call.cjs.map +0 -1
  539. package/dist/cjs/entities/app-action.cjs +0 -49
  540. package/dist/cjs/entities/app-action.cjs.map +0 -1
  541. package/dist/cjs/entities/app-bundle.cjs +0 -49
  542. package/dist/cjs/entities/app-bundle.cjs.map +0 -1
  543. package/dist/cjs/entities/app-definition.cjs +0 -30
  544. package/dist/cjs/entities/app-definition.cjs.map +0 -1
  545. package/dist/cjs/entities/app-details.cjs +0 -40
  546. package/dist/cjs/entities/app-details.cjs.map +0 -1
  547. package/dist/cjs/entities/app-event-subscription.cjs +0 -35
  548. package/dist/cjs/entities/app-event-subscription.cjs.map +0 -1
  549. package/dist/cjs/entities/app-installation.cjs +0 -56
  550. package/dist/cjs/entities/app-installation.cjs.map +0 -1
  551. package/dist/cjs/entities/app-key.cjs +0 -45
  552. package/dist/cjs/entities/app-key.cjs.map +0 -1
  553. package/dist/cjs/entities/app-signed-request.cjs +0 -18
  554. package/dist/cjs/entities/app-signed-request.cjs.map +0 -1
  555. package/dist/cjs/entities/app-signing-secret.cjs +0 -35
  556. package/dist/cjs/entities/app-signing-secret.cjs.map +0 -1
  557. package/dist/cjs/entities/app-upload.cjs +0 -39
  558. package/dist/cjs/entities/app-upload.cjs.map +0 -1
  559. package/dist/cjs/entities/asset-key.cjs +0 -18
  560. package/dist/cjs/entities/asset-key.cjs.map +0 -1
  561. package/dist/cjs/entities/asset.cjs +0 -133
  562. package/dist/cjs/entities/asset.cjs.map +0 -1
  563. package/dist/cjs/entities/bulk-action.cjs +0 -61
  564. package/dist/cjs/entities/bulk-action.cjs.map +0 -1
  565. package/dist/cjs/entities/comment.cjs +0 -64
  566. package/dist/cjs/entities/comment.cjs.map +0 -1
  567. package/dist/cjs/entities/content-type.cjs +0 -121
  568. package/dist/cjs/entities/content-type.cjs.map +0 -1
  569. package/dist/cjs/entities/editor-interface.cjs +0 -51
  570. package/dist/cjs/entities/editor-interface.cjs.map +0 -1
  571. package/dist/cjs/entities/entry.cjs +0 -28
  572. package/dist/cjs/entities/entry.cjs.map +0 -1
  573. package/dist/cjs/entities/environment-alias.cjs +0 -59
  574. package/dist/cjs/entities/environment-alias.cjs.map +0 -1
  575. package/dist/cjs/entities/environment-template-installation.cjs +0 -24
  576. package/dist/cjs/entities/environment-template-installation.cjs.map +0 -1
  577. package/dist/cjs/entities/environment-template.cjs +0 -19
  578. package/dist/cjs/entities/environment-template.cjs.map +0 -1
  579. package/dist/cjs/entities/environment.cjs +0 -35
  580. package/dist/cjs/entities/environment.cjs.map +0 -1
  581. package/dist/cjs/entities/extension.cjs +0 -55
  582. package/dist/cjs/entities/extension.cjs.map +0 -1
  583. package/dist/cjs/entities/function-log.cjs +0 -27
  584. package/dist/cjs/entities/function-log.cjs.map +0 -1
  585. package/dist/cjs/entities/function.cjs +0 -67
  586. package/dist/cjs/entities/function.cjs.map +0 -1
  587. package/dist/cjs/entities/locale.cjs +0 -58
  588. package/dist/cjs/entities/locale.cjs.map +0 -1
  589. package/dist/cjs/entities/oauth-application.cjs +0 -67
  590. package/dist/cjs/entities/oauth-application.cjs.map +0 -1
  591. package/dist/cjs/entities/organization-invitation.cjs +0 -18
  592. package/dist/cjs/entities/organization-invitation.cjs.map +0 -1
  593. package/dist/cjs/entities/organization-membership.cjs +0 -54
  594. package/dist/cjs/entities/organization-membership.cjs.map +0 -1
  595. package/dist/cjs/entities/organization.cjs +0 -33
  596. package/dist/cjs/entities/organization.cjs.map +0 -1
  597. package/dist/cjs/entities/personal-access-token.cjs +0 -37
  598. package/dist/cjs/entities/personal-access-token.cjs.map +0 -1
  599. package/dist/cjs/entities/preview-api-key.cjs +0 -32
  600. package/dist/cjs/entities/preview-api-key.cjs.map +0 -1
  601. package/dist/cjs/entities/release-action.cjs +0 -56
  602. package/dist/cjs/entities/release-action.cjs.map +0 -1
  603. package/dist/cjs/entities/release.cjs +0 -110
  604. package/dist/cjs/entities/release.cjs.map +0 -1
  605. package/dist/cjs/entities/resource-provider.cjs +0 -139
  606. package/dist/cjs/entities/resource-provider.cjs.map +0 -1
  607. package/dist/cjs/entities/resource-type.cjs +0 -99
  608. package/dist/cjs/entities/resource-type.cjs.map +0 -1
  609. package/dist/cjs/entities/resource.cjs +0 -14
  610. package/dist/cjs/entities/resource.cjs.map +0 -1
  611. package/dist/cjs/entities/role.cjs +0 -54
  612. package/dist/cjs/entities/role.cjs.map +0 -1
  613. package/dist/cjs/entities/scheduled-action.cjs +0 -151
  614. package/dist/cjs/entities/scheduled-action.cjs.map +0 -1
  615. package/dist/cjs/entities/snapshot.cjs +0 -37
  616. package/dist/cjs/entities/snapshot.cjs.map +0 -1
  617. package/dist/cjs/entities/space-member.cjs +0 -24
  618. package/dist/cjs/entities/space-member.cjs.map +0 -1
  619. package/dist/cjs/entities/space-membership.cjs +0 -54
  620. package/dist/cjs/entities/space-membership.cjs.map +0 -1
  621. package/dist/cjs/entities/space.cjs +0 -34
  622. package/dist/cjs/entities/space.cjs.map +0 -1
  623. package/dist/cjs/entities/tag.cjs +0 -57
  624. package/dist/cjs/entities/tag.cjs.map +0 -1
  625. package/dist/cjs/entities/task.cjs +0 -58
  626. package/dist/cjs/entities/task.cjs.map +0 -1
  627. package/dist/cjs/entities/team-membership.cjs +0 -55
  628. package/dist/cjs/entities/team-membership.cjs.map +0 -1
  629. package/dist/cjs/entities/team-space-membership.cjs +0 -54
  630. package/dist/cjs/entities/team-space-membership.cjs.map +0 -1
  631. package/dist/cjs/entities/team.cjs +0 -54
  632. package/dist/cjs/entities/team.cjs.map +0 -1
  633. package/dist/cjs/entities/ui-config.cjs +0 -21
  634. package/dist/cjs/entities/ui-config.cjs.map +0 -1
  635. package/dist/cjs/entities/upload.cjs +0 -39
  636. package/dist/cjs/entities/upload.cjs.map +0 -1
  637. package/dist/cjs/entities/usage.cjs +0 -26
  638. package/dist/cjs/entities/usage.cjs.map +0 -1
  639. package/dist/cjs/entities/user-ui-config.cjs +0 -21
  640. package/dist/cjs/entities/user-ui-config.cjs.map +0 -1
  641. package/dist/cjs/entities/user.cjs +0 -29
  642. package/dist/cjs/entities/user.cjs.map +0 -1
  643. package/dist/cjs/entities/webhook.cjs +0 -78
  644. package/dist/cjs/entities/webhook.cjs.map +0 -1
  645. package/dist/cjs/entities/workflow-definition.cjs +0 -29
  646. package/dist/cjs/entities/workflow-definition.cjs.map +0 -1
  647. package/dist/cjs/index.cjs +0 -66
  648. package/dist/cjs/index.cjs.map +0 -1
  649. package/dist/cjs/methods/action.cjs +0 -53
  650. package/dist/cjs/methods/action.cjs.map +0 -1
  651. package/dist/cjs/methods/content-type.cjs +0 -49
  652. package/dist/cjs/methods/content-type.cjs.map +0 -1
  653. package/dist/cjs/methods/utils.cjs +0 -12
  654. package/dist/cjs/methods/utils.cjs.map +0 -1
  655. package/dist/cjs/plain/as-iterator.cjs +0 -39
  656. package/dist/cjs/plain/as-iterator.cjs.map +0 -1
  657. package/dist/cjs/plain/checks.cjs +0 -16
  658. package/dist/cjs/plain/checks.cjs.map +0 -1
  659. package/dist/cjs/plain/pagination-helper.cjs +0 -70
  660. package/dist/cjs/plain/pagination-helper.cjs.map +0 -1
  661. package/dist/cjs/plain/plain-client.cjs +0 -561
  662. package/dist/cjs/plain/plain-client.cjs.map +0 -1
  663. package/dist/cjs/plain/wrappers/wrap.cjs +0 -27
  664. package/dist/cjs/plain/wrappers/wrap.cjs.map +0 -1
  665. package/dist/cjs/upload-http-client.cjs +0 -17
  666. package/dist/cjs/upload-http-client.cjs.map +0 -1
  667. package/dist/contentful-management.browser.js.map +0 -1
  668. package/dist/contentful-management.browser.min.js +0 -2
  669. package/dist/contentful-management.browser.min.js.map +0 -1
  670. package/dist/contentful-management.node.cjs.map +0 -1
  671. package/dist/contentful-management.react-native.js +0 -22285
  672. package/dist/contentful-management.react-native.js.map +0 -1
@@ -1,2442 +0,0 @@
1
- 'use strict';
2
-
3
- var contentfulSdkCore = require('contentful-sdk-core');
4
- var appInstallation = require('./entities/app-installation.cjs');
5
- var appSignedRequest = require('./entities/app-signed-request.cjs');
6
- var appActionCall = require('./entities/app-action-call.cjs');
7
- var asset = require('./entities/asset.cjs');
8
- var assetKey = require('./entities/asset-key.cjs');
9
- var bulkAction = require('./entities/bulk-action.cjs');
10
- var releaseAction = require('./entities/release-action.cjs');
11
- var release = require('./entities/release.cjs');
12
- var contentType = require('./entities/content-type.cjs');
13
- var entry = require('./entities/entry.cjs');
14
- var environment = require('./entities/environment.cjs');
15
- var extension = require('./entities/extension.cjs');
16
- var locale = require('./entities/locale.cjs');
17
- var tag = require('./entities/tag.cjs');
18
- var uiConfig = require('./entities/ui-config.cjs');
19
- var userUiConfig = require('./entities/user-ui-config.cjs');
20
- var environmentTemplateInstallation = require('./entities/environment-template-installation.cjs');
21
- var _function = require('./entities/function.cjs');
22
- var functionLog = require('./entities/function-log.cjs');
23
- var appAccessToken = require('./entities/app-access-token.cjs');
24
- var resource = require('./entities/resource.cjs');
25
- var aiActionInvocation = require('./entities/ai-action-invocation.cjs');
26
- var editorInterface = require('./entities/editor-interface.cjs');
27
- var resourceType = require('./entities/resource-type.cjs');
28
- var snapshot = require('./entities/snapshot.cjs');
29
- var upload = require('./entities/upload.cjs');
30
-
31
- /**
32
- * Creates API object with methods to access the Environment API
33
- * @param {ContentfulEnvironmentAPI} makeRequest - function to make requests via an adapter
34
- * @return {ContentfulSpaceAPI}
35
- * @private
36
- */
37
- function createEnvironmentApi(makeRequest) {
38
- return {
39
- /**
40
- * Deletes the environment
41
- * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
42
- * @example ```javascript
43
- * const contentful = require('contentful-management')
44
- *
45
- * const client = contentful.createClient({
46
- * accessToken: '<content_management_api_key>'
47
- * })
48
- *
49
- * client.getSpace('<space_id>')
50
- * .then((space) => space.getEnvironment('<environment-id>'))
51
- * .then((environment) => environment.delete())
52
- * .then(() => console.log('Environment deleted.'))
53
- * .catch(console.error)
54
- * ```
55
- */
56
- delete: function deleteEnvironment() {
57
- const raw = this.toPlainObject();
58
- return makeRequest({
59
- entityType: 'Environment',
60
- action: 'delete',
61
- params: { spaceId: raw.sys.space.sys.id, environmentId: raw.sys.id },
62
- }).then(() => {
63
- // noop
64
- });
65
- },
66
- /**
67
- * Updates the environment
68
- * @return Promise for the updated environment.
69
- * @example ```javascript
70
- * const contentful = require('contentful-management')
71
- *
72
- * const client = contentful.createClient({
73
- * accessToken: '<content_management_api_key>'
74
- * })
75
- *
76
- * client.getSpace('<space_id>')
77
- * .then((space) => space.getEnvironment('<environment-id>'))
78
- * .then((environment) => {
79
- * environment.name = 'New name'
80
- * return environment.update()
81
- * })
82
- * .then((environment) => console.log(`Environment ${environment.sys.id} renamed.`)
83
- * .catch(console.error)
84
- * ```
85
- */
86
- update: function updateEnvironment() {
87
- const raw = this.toPlainObject();
88
- return makeRequest({
89
- entityType: 'Environment',
90
- action: 'update',
91
- params: { spaceId: raw.sys.space.sys.id, environmentId: raw.sys.id },
92
- payload: raw,
93
- }).then((data) => environment.wrapEnvironment(makeRequest, data));
94
- },
95
- /**
96
- * Creates SDK Entry object (locally) from entry data
97
- * @param entryData - Entry Data
98
- * @return Entry
99
- * @example ```javascript
100
- * environment.getEntry('entryId').then(entry => {
101
- *
102
- * // Build a plainObject in order to make it usable for React (saving in state or redux)
103
- * const plainObject = entry.toPlainObject();
104
- *
105
- * // The entry is being updated in some way as plainObject:
106
- * const updatedPlainObject = {
107
- * ...plainObject,
108
- * fields: {
109
- * ...plainObject.fields,
110
- * title: {
111
- * 'en-US': 'updatedTitle'
112
- * }
113
- * }
114
- * };
115
- *
116
- * // Rebuild an sdk object out of the updated plainObject:
117
- * const entryWithMethodsAgain = environment.getEntryFromData(updatedPlainObject);
118
- *
119
- * // Update with help of the sdk method:
120
- * entryWithMethodsAgain.update();
121
- *
122
- * });
123
- * ```
124
- **/
125
- getEntryFromData(entryData) {
126
- return entry.wrapEntry(makeRequest, entryData);
127
- },
128
- /**
129
- * Creates SDK Asset object (locally) from entry data
130
- * @param assetData - Asset ID
131
- * @return Asset
132
- * @example ```javascript
133
- * environment.getAsset('asset_id').then(asset => {
134
- *
135
- * // Build a plainObject in order to make it usable for React (saving in state or redux)
136
- * const plainObject = asset.toPlainObject();
137
- *
138
- * // The asset is being updated in some way as plainObject:
139
- * const updatedPlainObject = {
140
- * ...plainObject,
141
- * fields: {
142
- * ...plainObject.fields,
143
- * title: {
144
- * 'en-US': 'updatedTitle'
145
- * }
146
- * }
147
- * };
148
- *
149
- * // Rebuild an sdk object out of the updated plainObject:
150
- * const assetWithMethodsAgain = environment.getAssetFromData(updatedPlainObject);
151
- *
152
- * // Update with help of the sdk method:
153
- * assetWithMethodsAgain.update();
154
- *
155
- * });
156
- * ```
157
- */
158
- getAssetFromData(assetData) {
159
- return asset.wrapAsset(makeRequest, assetData);
160
- },
161
- /**
162
- *
163
- * @description Get a BulkAction by ID.
164
- * See: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/bulk-actions/bulk-action
165
- * @param bulkActionId - ID of the BulkAction to fetch
166
- * @returns - Promise with the BulkAction
167
- *
168
- * @example ```javascript
169
- * const contentful = require('contentful-management')
170
- *
171
- * const client = contentful.createClient({
172
- * accessToken: '<content_management_api_key>'
173
- * })
174
- *
175
- * client.getSpace('<space_id>')
176
- * .then((space) => space.getEnvironment('<environment_id>'))
177
- * .then((environment) => environment.getBulkAction('<bulk_action_id>'))
178
- * .then((bulkAction) => console.log(bulkAction))
179
- * ```
180
- */
181
- getBulkAction(bulkActionId) {
182
- const raw = this.toPlainObject();
183
- return makeRequest({
184
- entityType: 'BulkAction',
185
- action: 'get',
186
- params: {
187
- spaceId: raw.sys.space.sys.id,
188
- environmentId: raw.sys.id,
189
- bulkActionId,
190
- },
191
- }).then((data) => bulkAction.wrapBulkAction(makeRequest, data));
192
- },
193
- /**
194
- * @description Creates a BulkAction that will attempt to publish all items contained in the payload.
195
- * See: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/bulk-actions/publish-bulk-action
196
- * @param {BulkActionPayload} payload - Object containing the items to be processed in the bulkAction
197
- * @returns - Promise with the BulkAction
198
- *
199
- * @example
200
- *
201
- * ```javascript
202
- * const contentful = require('contentful-management')
203
- *
204
- * const client = contentful.createClient({
205
- * accessToken: '<content_management_api_key>'
206
- * })
207
- *
208
- * const payload = {
209
- * entities: {
210
- * sys: { type: 'Array' }
211
- * items: [
212
- * { sys: { type: 'Link', id: '<entry-id>', linkType: 'Entry', version: 2 } }
213
- * ]
214
- * }
215
- * }
216
- *
217
- * // Using Thenables
218
- * client.getSpace('<space_id>')
219
- * .then((space) => space.getEnvironment('<environment_id>'))
220
- * .then((environment) => environment.createPublishBulkAction(payload))
221
- * .then((bulkAction) => console.log(bulkAction.waitProcessing()))
222
- * .catch(console.error)
223
- *
224
- * // Using async/await
225
- * try {
226
- * const space = await client.getSpace('<space_id>')
227
- * const environment = await space.getEnvironment('<environment_id>')
228
- * const bulkActionInProgress = await environment.createPublishBulkAction(payload)
229
- *
230
- * // You can wait for a recently created BulkAction to be processed by using `bulkAction.waitProcessing()`
231
- * const bulkActionCompleted = await bulkActionInProgress.waitProcessing()
232
- * console.log(bulkActionCompleted)
233
- * } catch (error) {
234
- * console.log(error)
235
- * }
236
- * ```
237
- */
238
- createPublishBulkAction(payload) {
239
- const raw = this.toPlainObject();
240
- return makeRequest({
241
- entityType: 'BulkAction',
242
- action: 'publish',
243
- params: {
244
- spaceId: raw.sys.space.sys.id,
245
- environmentId: raw.sys.id,
246
- },
247
- payload,
248
- }).then((data) => bulkAction.wrapBulkAction(makeRequest, data));
249
- },
250
- /**
251
- * @description Creates a BulkAction that will attempt to validate all items contained in the payload.
252
- * See: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/bulk-actions/validate-bulk-action
253
- * @param {BulkActionPayload} payload - Object containing the items to be processed in the bulkAction
254
- * @returns - Promise with the BulkAction
255
- *
256
- * @example
257
- *
258
- * ```javascript
259
- * const contentful = require('contentful-management')
260
- *
261
- * const client = contentful.createClient({
262
- * accessToken: '<content_management_api_key>'
263
- * })
264
- *
265
- * const payload = {
266
- * action: 'publish',
267
- * entities: {
268
- * sys: { type: 'Array' }
269
- * items: [
270
- * { sys: { type: 'Link', id: '<entry-id>', linkType: 'Entry' } }
271
- * ]
272
- * }
273
- * }
274
- *
275
- * // Using Thenables
276
- * client.getSpace('<space_id>')
277
- * .then((space) => space.getEnvironment('<environment_id>'))
278
- * .then((environment) => environment.createValidateBulkAction(payload))
279
- * .then((bulkAction) => console.log(bulkAction.waitProcessing()))
280
- * .catch(console.error)
281
- *
282
- * // Using async/await
283
- * try {
284
- * const space = await client.getSpace('<space_id>')
285
- * const environment = await space.getEnvironment('<environment_id>')
286
- * const bulkActionInProgress = await environment.createValidateBulkAction(payload)
287
- *
288
- * // You can wait for a recently created BulkAction to be processed by using `bulkAction.waitProcessing()`
289
- * const bulkActionCompleted = await bulkActionInProgress.waitProcessing()
290
- * console.log(bulkActionCompleted)
291
- * } catch (error) {
292
- * console.log(error)
293
- * }
294
- * ```
295
- */
296
- createValidateBulkAction(payload) {
297
- const raw = this.toPlainObject();
298
- return makeRequest({
299
- entityType: 'BulkAction',
300
- action: 'validate',
301
- params: {
302
- spaceId: raw.sys.space.sys.id,
303
- environmentId: raw.sys.id,
304
- },
305
- payload,
306
- }).then((data) => bulkAction.wrapBulkAction(makeRequest, data));
307
- },
308
- /**
309
- * @description Creates a BulkAction that will attempt to unpublish all items contained in the payload.
310
- * See: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/bulk-actions/unpublish-bulk-action
311
- * @param {BulkActionPayload} payload - Object containing the items to be processed in the bulkAction
312
- * @returns - Promise with the BulkAction
313
- *
314
- * @example
315
- *
316
- * ```javascript
317
- * const contentful = require('contentful-management')
318
- *
319
- * const client = contentful.createClient({
320
- * accessToken: '<content_management_api_key>'
321
- * })
322
- *
323
- * const payload = {
324
- * entities: {
325
- * sys: { type: 'Array' }
326
- * items: [
327
- * { sys: { type: 'Link', id: 'entry-id', linkType: 'Entry' } }
328
- * ]
329
- * }
330
- * }
331
- *
332
- * // Using Thenables
333
- * client.getSpace('<space_id>')
334
- * .then((space) => space.getEnvironment('<environment_id>'))
335
- * .then((environment) => environment.createUnpublishBulkAction(payload))
336
- * .then((bulkAction) => console.log(bulkAction.waitProcessing()))
337
- * .catch(console.error)
338
- *
339
- * // Using async/await
340
- * try {
341
- * const space = await clientgetSpace('<space_id>')
342
- * const environment = await space.getEnvironment('<environment_id>')
343
- * const bulkActionInProgress = await environment.createUnpublishBulkAction(payload)
344
- *
345
- * // You can wait for a recently created BulkAction to be processed by using `bulkAction.waitProcessing()`
346
- * const bulkActionCompleted = await bulkActionInProgress.waitProcessing()
347
- * console.log(bulkActionCompleted)
348
- * } catch (error) {
349
- * console.log(error)
350
- * }
351
- * ```
352
- */
353
- createUnpublishBulkAction(payload) {
354
- const raw = this.toPlainObject();
355
- return makeRequest({
356
- entityType: 'BulkAction',
357
- action: 'unpublish',
358
- params: {
359
- spaceId: raw.sys.space.sys.id,
360
- environmentId: raw.sys.id,
361
- },
362
- payload,
363
- }).then((data) => bulkAction.wrapBulkAction(makeRequest, data));
364
- },
365
- /**
366
- * Gets a Content Type
367
- * @param contentTypeId - Content Type ID
368
- * @return Promise for a Content Type
369
- * @example ```javascript
370
- * const contentful = require('contentful-management')
371
- *
372
- * const client = contentful.createClient({
373
- * accessToken: '<content_management_api_key>'
374
- * })
375
- *
376
- * client.getSpace('<space_id>')
377
- * .then((space) => space.getEnvironment('<environment-id>'))
378
- * .then((environment) => environment.getContentType('<content_type_id>'))
379
- * .then((contentType) => console.log(contentType))
380
- * .catch(console.error)
381
- * ```
382
- */
383
- getContentType(contentTypeId) {
384
- const raw = this.toPlainObject();
385
- return makeRequest({
386
- entityType: 'ContentType',
387
- action: 'get',
388
- params: {
389
- spaceId: raw.sys.space.sys.id,
390
- environmentId: raw.sys.id,
391
- contentTypeId,
392
- },
393
- }).then((data) => contentType.wrapContentType(makeRequest, data));
394
- },
395
- /**
396
- * Gets a collection of Content Types
397
- * @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.
398
- * @return Promise for a collection of Content Types
399
- * @example ```javascript
400
- * const contentful = require('contentful-management')
401
- *
402
- * const client = contentful.createClient({
403
- * accessToken: '<content_management_api_key>'
404
- * })
405
- *
406
- * client.getSpace('<space_id>')
407
- * .then((space) => space.getEnvironment('<environment-id>'))
408
- * .then((environment) => environment.getContentTypes())
409
- * .then((response) => console.log(response.items))
410
- * .catch(console.error)
411
- * ```
412
- */
413
- getContentTypes(query = {}) {
414
- const raw = this.toPlainObject();
415
- return makeRequest({
416
- entityType: 'ContentType',
417
- action: 'getMany',
418
- params: {
419
- spaceId: raw.sys.space.sys.id,
420
- environmentId: raw.sys.id,
421
- query: contentfulSdkCore.createRequestConfig({ query }).params,
422
- },
423
- }).then((data) => contentType.wrapContentTypeCollection(makeRequest, data));
424
- },
425
- /**
426
- * Creates a Content Type
427
- * @param data - Object representation of the Content Type to be created
428
- * @return Promise for the newly created Content Type
429
- * @example ```javascript
430
- * const contentful = require('contentful-management')
431
- *
432
- * const client = contentful.createClient({
433
- * accessToken: '<content_management_api_key>'
434
- * })
435
- *
436
- * client.getSpace('<space_id>')
437
- * .then((space) => space.getEnvironment('<environment-id>'))
438
- * .then((environment) => environment.createContentType({
439
- * name: 'Blog Post',
440
- * fields: [
441
- * {
442
- * id: 'title',
443
- * name: 'Title',
444
- * required: true,
445
- * localized: false,
446
- * type: 'Text'
447
- * }
448
- * ]
449
- * }))
450
- * .then((contentType) => console.log(contentType))
451
- * .catch(console.error)
452
- * ```
453
- */
454
- createContentType(data) {
455
- const raw = this.toPlainObject();
456
- return makeRequest({
457
- entityType: 'ContentType',
458
- action: 'create',
459
- params: {
460
- spaceId: raw.sys.space.sys.id,
461
- environmentId: raw.sys.id,
462
- },
463
- payload: data,
464
- }).then((response) => contentType.wrapContentType(makeRequest, response));
465
- },
466
- /**
467
- * Creates a Content Type with a custom ID
468
- * @param contentTypeId - Content Type ID
469
- * @param data - Object representation of the Content Type to be created
470
- * @return Promise for the newly created Content Type
471
- * @example ```javascript
472
- * const contentful = require('contentful-management')
473
- *
474
- * const client = contentful.createClient({
475
- * accessToken: '<content_management_api_key>'
476
- * })
477
- *
478
- * client.getSpace('<space_id>')
479
- * .then((space) => space.getEnvironment('<environment-id>'))
480
- * .then((environment) => environment.createContentTypeWithId('<content-type-id>', {
481
- * name: 'Blog Post',
482
- * fields: [
483
- * {
484
- * id: 'title',
485
- * name: 'Title',
486
- * required: true,
487
- * localized: false,
488
- * type: 'Text'
489
- * }
490
- * ]
491
- * }))
492
- * .then((contentType) => console.log(contentType))
493
- * .catch(console.error)
494
- * ```
495
- */
496
- createContentTypeWithId(contentTypeId, data) {
497
- const raw = this.toPlainObject();
498
- return makeRequest({
499
- entityType: 'ContentType',
500
- action: 'createWithId',
501
- params: {
502
- spaceId: raw.sys.space.sys.id,
503
- environmentId: raw.sys.id,
504
- contentTypeId,
505
- },
506
- payload: data,
507
- }).then((response) => contentType.wrapContentType(makeRequest, response));
508
- },
509
- /**
510
- * Gets an EditorInterface for a ContentType
511
- * @param contentTypeId - Content Type ID
512
- * @return Promise for an EditorInterface
513
- * @example ```javascript
514
- * const contentful = require('contentful-management')
515
- *
516
- * const client = contentful.createClient({
517
- * accessToken: '<content_management_api_key>'
518
- * })
519
- *
520
- * client.getSpace('<space_id>')
521
- * .then((space) => space.getEnvironment('<environment-id>'))
522
- * .then((environment) => environment.getEditorInterfaceForContentType('<content_type_id>'))
523
- * .then((EditorInterface) => console.log(EditorInterface))
524
- * .catch(console.error)
525
- * ```
526
- */
527
- getEditorInterfaceForContentType(contentTypeId) {
528
- const raw = this.toPlainObject();
529
- return makeRequest({
530
- entityType: 'EditorInterface',
531
- action: 'get',
532
- params: {
533
- spaceId: raw.sys.space.sys.id,
534
- environmentId: raw.sys.id,
535
- contentTypeId,
536
- },
537
- }).then((response) => editorInterface.wrapEditorInterface(makeRequest, response));
538
- },
539
- /**
540
- * Gets all EditorInterfaces
541
- * @return Promise for a collection of EditorInterface
542
- * @example ```javascript
543
- * const contentful = require('contentful-management')
544
- *
545
- * const client = contentful.createClient({
546
- * accessToken: '<content_management_api_key>'
547
- * })
548
- *
549
- * client.getSpace('<space_id>')
550
- * .then((space) => space.getEnvironment('<environment-id>'))
551
- * .then((environment) => environment.getEditorInterfaces())
552
- * .then((response) => console.log(response.items))
553
- * .catch(console.error)
554
- * ```
555
- */
556
- getEditorInterfaces() {
557
- const raw = this.toPlainObject();
558
- return makeRequest({
559
- entityType: 'EditorInterface',
560
- action: 'getMany',
561
- params: {
562
- spaceId: raw.sys.space.sys.id,
563
- environmentId: raw.sys.id,
564
- },
565
- }).then((response) => editorInterface.wrapEditorInterfaceCollection(makeRequest, response));
566
- },
567
- /**
568
- * Gets an Entry
569
- * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
570
- * from your entry in the backend
571
- * @param id - Entry ID
572
- * @param query - Object with search parameters. In this method it's only useful for `locale`.
573
- * @return Promise for an Entry
574
- * @example ```javascript
575
- * const contentful = require('contentful-management')
576
- *
577
- * const client = contentful.createClient({
578
- * accessToken: '<content_management_api_key>'
579
- * })
580
- *
581
- * client.getSpace('<space_id>')
582
- * .then((space) => space.getEnvironment('<environment-id>'))
583
- * .then((environment) => environment.getEntry('<entry-id>'))
584
- * .then((entry) => console.log(entry))
585
- * .catch(console.error)
586
- * ```
587
- */
588
- getEntry(id, query = {}) {
589
- const raw = this.toPlainObject();
590
- return makeRequest({
591
- entityType: 'Entry',
592
- action: 'get',
593
- params: {
594
- spaceId: raw.sys.space.sys.id,
595
- environmentId: raw.sys.id,
596
- entryId: id,
597
- query: contentfulSdkCore.createRequestConfig({ query: query }).params,
598
- },
599
- }).then((data) => entry.wrapEntry(makeRequest, data));
600
- },
601
- /**
602
- * Deletes an Entry of this environment
603
- * @param id - Entry ID
604
- * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
605
- * @example ```javascript
606
- * const contentful = require('contentful-management')
607
- *
608
- * const client = contentful.createClient({
609
- * accessToken: '<content_management_api_key>'
610
- * })
611
- *
612
- * client.getSpace('<space_id>')
613
- * .then((space) => space.getEnvironment('<environment-id>'))
614
- * .then((environment) => environment.deleteEntry("4bmLXiuviAZH3jkj5DLRWE"))
615
- * .then(() => console.log('Entry deleted.'))
616
- * .catch(console.error)
617
- * ```
618
- */
619
- deleteEntry(id) {
620
- const raw = this.toPlainObject();
621
- return makeRequest({
622
- entityType: 'Entry',
623
- action: 'delete',
624
- params: {
625
- spaceId: raw.sys.space.sys.id,
626
- environmentId: raw.sys.id,
627
- entryId: id,
628
- },
629
- }).then(() => {
630
- // noop
631
- });
632
- },
633
- /**
634
- * Gets a collection of Entries
635
- * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
636
- * from your entry in the backend
637
- * @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.
638
- * @return Promise for a collection of Entries
639
- * @example ```javascript
640
- * const contentful = require('contentful-management')
641
- *
642
- * const client = contentful.createClient({
643
- * accessToken: '<content_management_api_key>'
644
- * })
645
- *
646
- * client.getSpace('<space_id>')
647
- * .then((space) => space.getEnvironment('<environment-id>'))
648
- * .then((environment) => environment.getEntries({'content_type': 'foo'})) // you can add more queries as 'key': 'value'
649
- * .then((response) => console.log(response.items))
650
- * .catch(console.error)
651
- * ```
652
- */
653
- getEntries(query = {}) {
654
- const raw = this.toPlainObject();
655
- return makeRequest({
656
- entityType: 'Entry',
657
- action: 'getMany',
658
- params: {
659
- spaceId: raw.sys.space.sys.id,
660
- environmentId: raw.sys.id,
661
- query: contentfulSdkCore.createRequestConfig({ query: query }).params,
662
- },
663
- }).then((data) => entry.wrapEntryCollection(makeRequest, data));
664
- },
665
- /**
666
- * Gets a collection of published Entries
667
- * @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.
668
- * @return Promise for a collection of published Entries
669
- * @example ```javascript
670
- * const contentful = require('contentful-management')
671
- *
672
- * const client = contentful.createClient({
673
- * accessToken: '<content_management_api_key>'
674
- * })
675
- *
676
- * client.getSpace('<space_id>')
677
- * .then((space) => space.getEnvironment('<environment-id>'))
678
- * .then((environment) => environment.getPublishedEntries({'content_type': 'foo'})) // you can add more queries as 'key': 'value'
679
- * .then((response) => console.log(response.items))
680
- * .catch(console.error)
681
- * ```
682
- */
683
- getPublishedEntries(query = {}) {
684
- const raw = this.toPlainObject();
685
- return makeRequest({
686
- entityType: 'Entry',
687
- action: 'getPublished',
688
- params: {
689
- spaceId: raw.sys.space.sys.id,
690
- environmentId: raw.sys.id,
691
- query: contentfulSdkCore.createRequestConfig({ query: query }).params,
692
- },
693
- }).then((data) => entry.wrapEntryCollection(makeRequest, data));
694
- },
695
- /**
696
- * Creates a Entry
697
- * @param contentTypeId - The Content Type ID of the newly created Entry
698
- * @param data - Object representation of the Entry to be created
699
- * @return Promise for the newly created Entry
700
- * @example ```javascript
701
- * const contentful = require('contentful-management')
702
- *
703
- * const client = contentful.createClient({
704
- * accessToken: '<content_management_api_key>'
705
- * })
706
- *
707
- * client.getSpace('<space_id>')
708
- * .then((space) => space.getEnvironment('<environment-id>'))
709
- * .then((environment) => environment.createEntry('<content_type_id>', {
710
- * fields: {
711
- * title: {
712
- * 'en-US': 'Entry title'
713
- * }
714
- * }
715
- * }))
716
- * .then((entry) => console.log(entry))
717
- * .catch(console.error)
718
- * ```
719
- */
720
- createEntry(contentTypeId, data) {
721
- const raw = this.toPlainObject();
722
- return makeRequest({
723
- entityType: 'Entry',
724
- action: 'create',
725
- params: {
726
- spaceId: raw.sys.space.sys.id,
727
- environmentId: raw.sys.id,
728
- contentTypeId: contentTypeId,
729
- },
730
- payload: data,
731
- }).then((response) => entry.wrapEntry(makeRequest, response));
732
- },
733
- /**
734
- * Creates a Entry with a custom ID
735
- * @param contentTypeId - The Content Type of the newly created Entry
736
- * @param id - Entry ID
737
- * @param data - Object representation of the Entry to be created
738
- * @return Promise for the newly created Entry
739
- * @example ```javascript
740
- * const contentful = require('contentful-management')
741
- *
742
- * const client = contentful.createClient({
743
- * accessToken: '<content_management_api_key>'
744
- * })
745
- *
746
- * // Create entry
747
- * client.getSpace('<space_id>')
748
- * .then((space) => space.getEnvironment('<environment-id>'))
749
- * .then((environment) => environment.createEntryWithId('<content_type_id>', '<entry_id>', {
750
- * fields: {
751
- * title: {
752
- * 'en-US': 'Entry title'
753
- * }
754
- * }
755
- * }))
756
- * .then((entry) => console.log(entry))
757
- * .catch(console.error)
758
- * ```
759
- */
760
- createEntryWithId(contentTypeId, id, data) {
761
- const raw = this.toPlainObject();
762
- return makeRequest({
763
- entityType: 'Entry',
764
- action: 'createWithId',
765
- params: {
766
- spaceId: raw.sys.space.sys.id,
767
- environmentId: raw.sys.id,
768
- entryId: id,
769
- contentTypeId: contentTypeId,
770
- },
771
- payload: data,
772
- }).then((response) => entry.wrapEntry(makeRequest, response));
773
- },
774
- /**
775
- * Get entry references
776
- * @param entryId - Entry ID
777
- * @param {Object} options.include - Level of the entry descendants from 1 up to 10 maximum
778
- * @returns Promise of Entry references
779
- * @example ```javascript
780
- * const contentful = require('contentful-management');
781
- *
782
- * const client = contentful.createClient({
783
- * accessToken: '<contentful_management_api_key>
784
- * })
785
- *
786
- * // Get entry references
787
- * client.getSpace('<space_id>')
788
- * .then((space) => space.getEnvironment('<environment_id>'))
789
- * .then((environment) => environment.getEntryReferences('<entry_id>', {include: number}))
790
- * .then((entry) => console.log(entry.includes))
791
- * // or
792
- * .then((environment) => environment.getEntry('<entry_id>')).then((entry) => entry.references({include: number}))
793
- * .catch(console.error)
794
- * ```
795
- */
796
- getEntryReferences(entryId, options) {
797
- const raw = this.toPlainObject();
798
- return makeRequest({
799
- entityType: 'Entry',
800
- action: 'references',
801
- params: {
802
- spaceId: raw.sys.space.sys.id,
803
- environmentId: raw.sys.id,
804
- entryId: entryId,
805
- include: options?.include,
806
- },
807
- }).then((response) => entry.wrapEntryCollection(makeRequest, response));
808
- },
809
- /**
810
- * Gets an Asset
811
- * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
812
- * from your entry in the backend
813
- * @param id - Asset ID
814
- * @param query - Object with search parameters. In this method it's only useful for `locale`.
815
- * @return Promise for an Asset
816
- * @example ```javascript
817
- * const contentful = require('contentful-management')
818
- *
819
- * const client = contentful.createClient({
820
- * accessToken: '<content_management_api_key>'
821
- * })
822
- *
823
- * client.getSpace('<space_id>')
824
- * .then((space) => space.getEnvironment('<environment-id>'))
825
- * .then((environment) => environment.getAsset('<asset_id>'))
826
- * .then((asset) => console.log(asset))
827
- * .catch(console.error)
828
- * ```
829
- */
830
- getAsset(id, query = {}) {
831
- const raw = this.toPlainObject();
832
- return makeRequest({
833
- entityType: 'Asset',
834
- action: 'get',
835
- params: {
836
- spaceId: raw.sys.space.sys.id,
837
- environmentId: raw.sys.id,
838
- assetId: id,
839
- query: contentfulSdkCore.createRequestConfig({ query: query }).params,
840
- },
841
- }).then((data) => asset.wrapAsset(makeRequest, data));
842
- },
843
- /**
844
- * Gets a collection of Assets
845
- * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
846
- * from your entry in the backend
847
- * @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.
848
- * @return Promise for a collection of Assets
849
- * @example ```javascript
850
- * const contentful = require('contentful-management')
851
- *
852
- * const client = contentful.createClient({
853
- * accessToken: '<content_management_api_key>'
854
- * })
855
- *
856
- * client.getSpace('<space_id>')
857
- * .then((space) => space.getEnvironment('<environment-id>'))
858
- * .then((environment) => environment.getAssets())
859
- * .then((response) => console.log(response.items))
860
- * .catch(console.error)
861
- * ```
862
- */
863
- getAssets(query = {}) {
864
- const raw = this.toPlainObject();
865
- return makeRequest({
866
- entityType: 'Asset',
867
- action: 'getMany',
868
- params: {
869
- spaceId: raw.sys.space.sys.id,
870
- environmentId: raw.sys.id,
871
- query: contentfulSdkCore.createRequestConfig({ query: query }).params,
872
- },
873
- }).then((data) => asset.wrapAssetCollection(makeRequest, data));
874
- },
875
- /**
876
- * Gets a collection of published Assets
877
- * @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.
878
- * @return Promise for a collection of published Assets
879
- * @example ```javascript
880
- * const contentful = require('contentful-management')
881
- *
882
- * const client = contentful.createClient({
883
- * accessToken: '<content_management_api_key>'
884
- * })
885
- *
886
- * client.getSpace('<space_id>')
887
- * .then((space) => space.getEnvironment('<environment-id>'))
888
- * .then((environment) => environment.getPublishedAssets())
889
- * .then((response) => console.log(response.items))
890
- * .catch(console.error)
891
- * ```
892
- */
893
- getPublishedAssets(query = {}) {
894
- const raw = this.toPlainObject();
895
- return makeRequest({
896
- entityType: 'Asset',
897
- action: 'getPublished',
898
- params: {
899
- spaceId: raw.sys.space.sys.id,
900
- environmentId: raw.sys.id,
901
- query: contentfulSdkCore.createRequestConfig({ query: query }).params,
902
- },
903
- }).then((data) => asset.wrapAssetCollection(makeRequest, data));
904
- },
905
- /**
906
- * Creates a Asset. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
907
- * @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished.
908
- * @return Promise for the newly created Asset
909
- * @example ```javascript
910
- * const client = contentful.createClient({
911
- * accessToken: '<content_management_api_key>'
912
- * })
913
- *
914
- * // Create asset
915
- * client.getSpace('<space_id>')
916
- * .then((space) => space.getEnvironment('<environment-id>'))
917
- * .then((environment) => environment.createAsset({
918
- * fields: {
919
- * title: {
920
- * 'en-US': 'Playsam Streamliner'
921
- * },
922
- * file: {
923
- * 'en-US': {
924
- * contentType: 'image/jpeg',
925
- * fileName: 'example.jpeg',
926
- * upload: 'https://example.com/example.jpg'
927
- * }
928
- * }
929
- * }
930
- * }))
931
- * .then((asset) => asset.processForLocale("en-US")) // OR asset.processForAllLocales()
932
- * .then((asset) => console.log(asset))
933
- * .catch(console.error)
934
- * ```
935
- */
936
- createAsset(data) {
937
- const raw = this.toPlainObject();
938
- return makeRequest({
939
- entityType: 'Asset',
940
- action: 'create',
941
- params: {
942
- spaceId: raw.sys.space.sys.id,
943
- environmentId: raw.sys.id,
944
- },
945
- payload: data,
946
- }).then((response) => asset.wrapAsset(makeRequest, response));
947
- },
948
- /**
949
- * Creates a Asset with a custom ID. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
950
- * @param id - Asset ID
951
- * @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished.
952
- * @return Promise for the newly created Asset
953
- * @example ```javascript
954
- * const client = contentful.createClient({
955
- * accessToken: '<content_management_api_key>'
956
- * })
957
- *
958
- * // Create asset
959
- * client.getSpace('<space_id>')
960
- * .then((space) => space.getEnvironment('<environment-id>'))
961
- * .then((environment) => environment.createAssetWithId('<asset_id>', {
962
- * title: {
963
- * 'en-US': 'Playsam Streamliner'
964
- * },
965
- * file: {
966
- * 'en-US': {
967
- * contentType: 'image/jpeg',
968
- * fileName: 'example.jpeg',
969
- * upload: 'https://example.com/example.jpg'
970
- * }
971
- * }
972
- * }))
973
- * .then((asset) => asset.process())
974
- * .then((asset) => console.log(asset))
975
- * .catch(console.error)
976
- * ```
977
- */
978
- createAssetWithId(id, data) {
979
- const raw = this.toPlainObject();
980
- return makeRequest({
981
- entityType: 'Asset',
982
- action: 'createWithId',
983
- params: {
984
- spaceId: raw.sys.space.sys.id,
985
- environmentId: raw.sys.id,
986
- assetId: id,
987
- },
988
- payload: data,
989
- }).then((response) => asset.wrapAsset(makeRequest, response));
990
- },
991
- /**
992
- * Creates a Asset based on files. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
993
- * @param data - Object representation of the Asset to be created. Note that the field object should have an uploadFrom property on asset creation, which will be removed and replaced with an url property when processing is finished.
994
- * @param data.fields.file.[LOCALE].file - Can be a string, an ArrayBuffer or a Stream.
995
- * @return Promise for the newly created Asset
996
- * @example ```javascript
997
- * const client = contentful.createClient({
998
- * accessToken: '<content_management_api_key>'
999
- * })
1000
- *
1001
- * client.getSpace('<space_id>')
1002
- * .then((space) => space.getEnvironment('<environment-id>'))
1003
- * .then((environment) => environment.createAssetFromFiles({
1004
- * fields: {
1005
- * file: {
1006
- * 'en-US': {
1007
- * contentType: 'image/jpeg',
1008
- * fileName: 'filename_english.jpg',
1009
- * file: createReadStream('path/to/filename_english.jpg')
1010
- * },
1011
- * 'de-DE': {
1012
- * contentType: 'image/svg+xml',
1013
- * fileName: 'filename_german.svg',
1014
- * file: '<svg><path fill="red" d="M50 50h150v50H50z"/></svg>'
1015
- * }
1016
- * }
1017
- * }
1018
- * }))
1019
- * .then((asset) => console.log(asset))
1020
- * .catch(console.error)
1021
- * ```
1022
- */
1023
- createAssetFromFiles(data, options) {
1024
- const raw = this.toPlainObject();
1025
- return makeRequest({
1026
- entityType: 'Asset',
1027
- action: 'createFromFiles',
1028
- params: {
1029
- spaceId: raw.sys.space.sys.id,
1030
- environmentId: raw.sys.id,
1031
- uploadTimeout: options?.uploadTimeout,
1032
- },
1033
- payload: data,
1034
- }).then((response) => asset.wrapAsset(makeRequest, response));
1035
- },
1036
- /**
1037
- * Creates an asset key for signing asset URLs (Embargoed Assets)
1038
- * @param data Object with request payload
1039
- * @param data.expiresAt number a UNIX timestamp in the future (but not more than 48 hours from time of calling)
1040
- * @return Promise for the newly created AssetKey
1041
- * @example ```javascript
1042
- * const client = contentful.createClient({
1043
- * accessToken: '<content_management_api_key>'
1044
- * })
1045
- *
1046
- * // Create assetKey
1047
- * now = () => Math.floor(Date.now() / 1000)
1048
- * const withExpiryIn1Hour = () => now() + 1 * 60 * 60
1049
- * client.getSpace('<space_id>')
1050
- * .then((space) => space.getEnvironment('<environment-id>'))
1051
- * .then((environment) => environment.createAssetKey({ expiresAt: withExpiryIn1Hour() }))
1052
- * .then((policy, secret) => console.log({ policy, secret }))
1053
- * .catch(console.error)
1054
- * ```
1055
- */
1056
- createAssetKey(payload) {
1057
- const raw = this.toPlainObject();
1058
- return makeRequest({
1059
- entityType: 'AssetKey',
1060
- action: 'create',
1061
- params: {
1062
- spaceId: raw.sys.space.sys.id,
1063
- environmentId: raw.sys.id,
1064
- },
1065
- payload,
1066
- }).then((data) => assetKey.wrapAssetKey(makeRequest, data));
1067
- },
1068
- /**
1069
- * Gets an Upload
1070
- * @param id - Upload ID
1071
- * @return Promise for an Upload
1072
- * @example ```javascript
1073
- * const client = contentful.createClient({
1074
- * accessToken: '<content_management_api_key>'
1075
- * })
1076
- * const uploadStream = createReadStream('path/to/filename_english.jpg')
1077
- *
1078
- * client.getSpace('<space_id>')
1079
- * .then((space) => space.getEnvironment('<environment-id>'))
1080
- * .then((environment) => environment.getUpload('<upload-id>')
1081
- * .then((upload) => console.log(upload))
1082
- * .catch(console.error)
1083
- */
1084
- getUpload(id) {
1085
- const raw = this.toPlainObject();
1086
- return makeRequest({
1087
- entityType: 'Upload',
1088
- action: 'get',
1089
- params: {
1090
- spaceId: raw.sys.space.sys.id,
1091
- environmentId: raw.sys.id,
1092
- uploadId: id,
1093
- },
1094
- }).then((data) => upload.wrapUpload(makeRequest, data));
1095
- },
1096
- /**
1097
- * Creates a Upload.
1098
- * @param data - Object with file information.
1099
- * @param data.file - Actual file content. Can be a string, an ArrayBuffer or a Stream.
1100
- * @return Upload object containing information about the uploaded file.
1101
- * @example ```javascript
1102
- * const client = contentful.createClient({
1103
- * accessToken: '<content_management_api_key>'
1104
- * })
1105
- * const uploadStream = createReadStream('path/to/filename_english.jpg')
1106
- *
1107
- * client.getSpace('<space_id>')
1108
- * .then((space) => space.getEnvironment('<environment-id>'))
1109
- * .then((environment) => environment.createUpload({file: uploadStream})
1110
- * .then((upload) => console.log(upload))
1111
- * .catch(console.error)
1112
- * ```
1113
- */
1114
- createUpload: function createUpload(data) {
1115
- const raw = this.toPlainObject();
1116
- return makeRequest({
1117
- entityType: 'Upload',
1118
- action: 'create',
1119
- params: {
1120
- spaceId: raw.sys.space.sys.id,
1121
- environmentId: raw.sys.id,
1122
- },
1123
- payload: data,
1124
- }).then((data) => upload.wrapUpload(makeRequest, data));
1125
- },
1126
- /**
1127
- * Gets a Locale
1128
- * @param localeId - Locale ID
1129
- * @return Promise for an Locale
1130
- * @example ```javascript
1131
- * const contentful = require('contentful-management')
1132
- *
1133
- * const client = contentful.createClient({
1134
- * accessToken: '<content_management_api_key>'
1135
- * })
1136
- *
1137
- * client.getSpace('<space_id>')
1138
- * .then((space) => space.getEnvironment('<environment-id>'))
1139
- * .then((environment) => environment.getLocale('<locale_id>'))
1140
- * .then((locale) => console.log(locale))
1141
- * .catch(console.error)
1142
- * ```
1143
- */
1144
- getLocale(localeId) {
1145
- const raw = this.toPlainObject();
1146
- return makeRequest({
1147
- entityType: 'Locale',
1148
- action: 'get',
1149
- params: {
1150
- spaceId: raw.sys.space.sys.id,
1151
- environmentId: raw.sys.id,
1152
- localeId,
1153
- },
1154
- }).then((data) => locale.wrapLocale(makeRequest, data));
1155
- },
1156
- /**
1157
- * Gets a collection of Locales
1158
- * @return Promise for a collection of Locales
1159
- * @example ```javascript
1160
- * const contentful = require('contentful-management')
1161
- *
1162
- * const client = contentful.createClient({
1163
- * accessToken: '<content_management_api_key>'
1164
- * })
1165
- *
1166
- * client.getSpace('<space_id>')
1167
- * .then((space) => space.getEnvironment('<environment-id>'))
1168
- * .then((environment) => environment.getLocales())
1169
- * .then((response) => console.log(response.items))
1170
- * .catch(console.error)
1171
- * ```
1172
- */
1173
- getLocales(query = {}) {
1174
- const raw = this.toPlainObject();
1175
- return makeRequest({
1176
- entityType: 'Locale',
1177
- action: 'getMany',
1178
- params: {
1179
- spaceId: raw.sys.space.sys.id,
1180
- environmentId: raw.sys.id,
1181
- query: contentfulSdkCore.createRequestConfig({ query }).params,
1182
- },
1183
- }).then((data) => locale.wrapLocaleCollection(makeRequest, data));
1184
- },
1185
- /**
1186
- * Creates a Locale
1187
- * @param data - Object representation of the Locale to be created
1188
- * @return Promise for the newly created Locale
1189
- * @example ```javascript
1190
- * const contentful = require('contentful-management')
1191
- *
1192
- * const client = contentful.createClient({
1193
- * accessToken: '<content_management_api_key>'
1194
- * })
1195
- *
1196
- * // Create locale
1197
- * client.getSpace('<space_id>')
1198
- * .then((space) => space.getEnvironment('<environment-id>'))
1199
- * .then((environment) => environment.createLocale({
1200
- * name: 'German (Austria)',
1201
- * code: 'de-AT',
1202
- * fallbackCode: 'de-DE',
1203
- * optional: true
1204
- * }))
1205
- * .then((locale) => console.log(locale))
1206
- * .catch(console.error)
1207
- * ```
1208
- */
1209
- createLocale(data) {
1210
- const raw = this.toPlainObject();
1211
- return makeRequest({
1212
- entityType: 'Locale',
1213
- action: 'create',
1214
- params: {
1215
- spaceId: raw.sys.space.sys.id,
1216
- environmentId: raw.sys.id,
1217
- },
1218
- payload: data,
1219
- }).then((response) => locale.wrapLocale(makeRequest, response));
1220
- },
1221
- /**
1222
- * Gets an UI Extension
1223
- * @param id - Extension ID
1224
- * @return Promise for an UI Extension
1225
- * @example ```javascript
1226
- * const contentful = require('contentful-management')
1227
- *
1228
- * const client = contentful.createClient({
1229
- * accessToken: '<content_management_api_key>'
1230
- * })
1231
- *
1232
- * client.getSpace('<space_id>')
1233
- * .then((space) => space.getEnvironment('<environment-id>'))
1234
- * .then((environment) => environment.getUiExtension('<extension-id>'))
1235
- * .then((extension) => console.log(extension))
1236
- * .catch(console.error)
1237
- * ```
1238
- */
1239
- getUiExtension(id) {
1240
- const raw = this.toPlainObject();
1241
- return makeRequest({
1242
- entityType: 'Extension',
1243
- action: 'get',
1244
- params: {
1245
- spaceId: raw.sys.space.sys.id,
1246
- environmentId: raw.sys.id,
1247
- extensionId: id,
1248
- },
1249
- }).then((data) => extension.wrapExtension(makeRequest, data));
1250
- },
1251
- /**
1252
- * Gets a collection of UI Extension
1253
- * @return Promise for a collection of UI Extensions
1254
- * @example ```javascript
1255
- * const contentful = require('contentful-management')
1256
- *
1257
- * const client = contentful.createClient({
1258
- * accessToken: '<content_management_api_key>'
1259
- * })
1260
- *
1261
- * client.getSpace('<space_id>')
1262
- * .then((space) => space.getEnvironment('<environment-id>'))
1263
- * .then((environment) => environment.getUiExtensions()
1264
- * .then((response) => console.log(response.items))
1265
- * .catch(console.error)
1266
- * ```
1267
- */
1268
- getUiExtensions() {
1269
- const raw = this.toPlainObject();
1270
- return makeRequest({
1271
- entityType: 'Extension',
1272
- action: 'getMany',
1273
- params: {
1274
- spaceId: raw.sys.space.sys.id,
1275
- environmentId: raw.sys.id,
1276
- },
1277
- }).then((response) => extension.wrapExtensionCollection(makeRequest, response));
1278
- },
1279
- /**
1280
- * Creates a UI Extension
1281
- * @param data - Object representation of the UI Extension to be created
1282
- * @return Promise for the newly created UI Extension
1283
- * @example ```javascript
1284
- * const contentful = require('contentful-management')
1285
- *
1286
- * const client = contentful.createClient({
1287
- * accessToken: '<content_management_api_key>'
1288
- * })
1289
- *
1290
- * client.getSpace('<space_id>')
1291
- * .then((space) => space.getEnvironment('<environment-id>'))
1292
- * .then((environment) => environment.createUiExtension({
1293
- * extension: {
1294
- * name: 'My awesome extension',
1295
- * src: 'https://example.com/my',
1296
- * fieldTypes: [
1297
- * {
1298
- * type: 'Symbol'
1299
- * },
1300
- * {
1301
- * type: 'Text'
1302
- * }
1303
- * ],
1304
- * sidebar: false
1305
- * }
1306
- * }))
1307
- * .then((extension) => console.log(extension))
1308
- * .catch(console.error)
1309
- * ```
1310
- */
1311
- createUiExtension(data) {
1312
- const raw = this.toPlainObject();
1313
- return makeRequest({
1314
- entityType: 'Extension',
1315
- action: 'create',
1316
- params: {
1317
- spaceId: raw.sys.space.sys.id,
1318
- environmentId: raw.sys.id,
1319
- },
1320
- payload: data,
1321
- }).then((response) => extension.wrapExtension(makeRequest, response));
1322
- },
1323
- /**
1324
- * Creates a UI Extension with a custom ID
1325
- * @param id - Extension ID
1326
- * @param data - Object representation of the UI Extension to be created
1327
- * @return Promise for the newly created UI Extension
1328
- * @example ```javascript
1329
- * const contentful = require('contentful-management')
1330
- *
1331
- * const client = contentful.createClient({
1332
- * accessToken: '<content_management_api_key>'
1333
- * })
1334
- *
1335
- * client.getSpace('<space_id>')
1336
- * .then((space) => space.getEnvironment('<environment-id>'))
1337
- * .then((environment) => environment.createUiExtensionWithId('<extension_id>', {
1338
- * extension: {
1339
- * name: 'My awesome extension',
1340
- * src: 'https://example.com/my',
1341
- * fieldTypes: [
1342
- * {
1343
- * type: 'Symbol'
1344
- * },
1345
- * {
1346
- * type: 'Text'
1347
- * }
1348
- * ],
1349
- * sidebar: false
1350
- * }
1351
- * }))
1352
- * .then((extension) => console.log(extension))
1353
- * .catch(console.error)
1354
- * ```
1355
- */
1356
- createUiExtensionWithId(id, data) {
1357
- const raw = this.toPlainObject();
1358
- return makeRequest({
1359
- entityType: 'Extension',
1360
- action: 'createWithId',
1361
- params: {
1362
- spaceId: raw.sys.space.sys.id,
1363
- environmentId: raw.sys.id,
1364
- extensionId: id,
1365
- },
1366
- payload: data,
1367
- }).then((response) => extension.wrapExtension(makeRequest, response));
1368
- },
1369
- /**
1370
- * Creates an App Installation
1371
- * @param appDefinitionId - AppDefinition ID
1372
- * @param data - AppInstallation data
1373
- * @param options.acceptAllTerms - Flag for accepting Apps' Marketplace EULA, Terms, and Privacy policy (need to pass `{acceptAllTerms: true}` to install a marketplace app)
1374
- * @return Promise for an App Installation
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.getEnvironment('<environment-id>'))
1384
- * .then((environment) => environment.createAppInstallation('<app_definition_id>', {
1385
- * parameters: {
1386
- * someParameter: someValue
1387
- * }
1388
- * })
1389
- * .then((appInstallation) => console.log(appInstallation))
1390
- * .catch(console.error)
1391
- * ```
1392
- */
1393
- createAppInstallation(appDefinitionId, data, { acceptAllTerms } = {}) {
1394
- const raw = this.toPlainObject();
1395
- return makeRequest({
1396
- entityType: 'AppInstallation',
1397
- action: 'upsert',
1398
- params: {
1399
- spaceId: raw.sys.space.sys.id,
1400
- environmentId: raw.sys.id,
1401
- appDefinitionId,
1402
- acceptAllTerms,
1403
- },
1404
- payload: data,
1405
- }).then((payload) => appInstallation.wrapAppInstallation(makeRequest, payload));
1406
- },
1407
- /**
1408
- * Gets an App Installation
1409
- * @param id - AppDefintion ID
1410
- * @return Promise for an App Installation
1411
- * @example ```javascript
1412
- * const contentful = require('contentful-management')
1413
- *
1414
- * const client = contentful.createClient({
1415
- * accessToken: '<content_management_api_key>'
1416
- * })
1417
- *
1418
- * client.getSpace('<space_id>')
1419
- * .then((space) => space.getEnvironment('<environment-id>'))
1420
- * .then((environment) => environment.getAppInstallation('<app-definition-id>'))
1421
- * .then((appInstallation) => console.log(appInstallation))
1422
- * .catch(console.error)
1423
- * ```
1424
- */
1425
- getAppInstallation(id) {
1426
- const raw = this.toPlainObject();
1427
- return makeRequest({
1428
- entityType: 'AppInstallation',
1429
- action: 'get',
1430
- params: {
1431
- spaceId: raw.sys.space.sys.id,
1432
- environmentId: raw.sys.id,
1433
- appDefinitionId: id,
1434
- },
1435
- }).then((data) => appInstallation.wrapAppInstallation(makeRequest, data));
1436
- },
1437
- /**
1438
- * Gets a collection of App Installation
1439
- * @return Promise for a collection of App Installations
1440
- * @example ```javascript
1441
- * const contentful = require('contentful-management')
1442
- *
1443
- * const client = contentful.createClient({
1444
- * accessToken: '<content_management_api_key>'
1445
- * })
1446
- *
1447
- * client.getSpace('<space_id>')
1448
- * .then((space) => space.getEnvironment('<environment-id>'))
1449
- * .then((environment) => environment.getAppInstallations()
1450
- * .then((response) => console.log(response.items))
1451
- * .catch(console.error)
1452
- * ```
1453
- */
1454
- getAppInstallations() {
1455
- const raw = this.toPlainObject();
1456
- return makeRequest({
1457
- entityType: 'AppInstallation',
1458
- action: 'getMany',
1459
- params: {
1460
- spaceId: raw.sys.space.sys.id,
1461
- environmentId: raw.sys.id,
1462
- },
1463
- }).then((data) => appInstallation.wrapAppInstallationCollection(makeRequest, data));
1464
- },
1465
- /**
1466
- * Creates an app action call
1467
- * @param appDefinitionId - AppDefinition ID
1468
- * @param appActionId - action ID
1469
- * @param data - App Action Call data
1470
- * @return Promise for an App Action Call
1471
- * @example ```javascript
1472
- * const contentful = require('contentful-management')
1473
- *
1474
- * const client = contentful.createClient({
1475
- * accessToken: '<content_management_api_key>'
1476
- * })
1477
- *
1478
- * const data = {
1479
- * headers: {
1480
- * 'x-my-header': 'some-value'
1481
- * },
1482
- * body: {
1483
- * 'some-body-value': true
1484
- * }
1485
- * }
1486
- *
1487
- * client.getSpace('<space_id>')
1488
- * .then((space) => space.getEnvironment('<environment-id>'))
1489
- * .then((environment) => environment.createAppActionCall('<app_definition_id>', '<action_id>', data)
1490
- * .then((appActionCall) => console.log(appActionCall))
1491
- * .catch(console.error)
1492
- * ```
1493
- */
1494
- createAppActionCall(appDefinitionId, appActionId, data) {
1495
- const raw = this.toPlainObject();
1496
- return makeRequest({
1497
- entityType: 'AppActionCall',
1498
- action: 'create',
1499
- params: {
1500
- spaceId: raw.sys.space.sys.id,
1501
- environmentId: raw.sys.id,
1502
- appDefinitionId,
1503
- appActionId,
1504
- },
1505
- payload: data,
1506
- }).then((payload) => appActionCall.wrapAppActionCall(makeRequest, payload));
1507
- },
1508
- /**
1509
- * Gets the raw response (headers/body) for a completed App Action Call
1510
- * @param appDefinitionId - AppDefinition ID
1511
- * @param appActionId - App Action ID
1512
- * @param callId - App Action Call ID
1513
- * @return Promise for the raw response object including `response.body` and optional `response.headers`
1514
- * @example ```javascript
1515
- * const contentful = require('contentful-management')
1516
- *
1517
- * const client = contentful.createClient({
1518
- * accessToken: '<content_management_api_key>'
1519
- * })
1520
- *
1521
- * client
1522
- * .getSpace('<space_id>')
1523
- * .then((space) => space.getEnvironment('<environment_id>'))
1524
- * .then((environment) => environment.getAppActionCallResponse('<app_definition_id>', '<app_action_id>', '<call_id>'))
1525
- * .then((raw) => console.log(raw.response.body))
1526
- * .catch(console.error)
1527
- * ```
1528
- */
1529
- getAppActionCallResponse(appDefinitionId, appActionId, callId) {
1530
- const raw = this.toPlainObject();
1531
- return makeRequest({
1532
- entityType: 'AppActionCall',
1533
- action: 'getResponse',
1534
- params: {
1535
- spaceId: raw.sys.space.sys.id,
1536
- environmentId: raw.sys.id,
1537
- appDefinitionId,
1538
- appActionId,
1539
- callId,
1540
- },
1541
- });
1542
- },
1543
- /**
1544
- * Creates an app signed request
1545
- * @param appDefinitionId - AppDefinition ID
1546
- * @param data - SignedRequest data
1547
- * @return Promise for a Signed Request
1548
- * @example ```javascript
1549
- * const contentful = require('contentful-management')
1550
- *
1551
- * const client = contentful.createClient({
1552
- * accessToken: '<content_management_api_key>'
1553
- * })
1554
- *
1555
- * const data = {
1556
- * method: 'POST',
1557
- * path: '/request_path',
1558
- * body: '{ "key": "data" }',
1559
- * headers: {
1560
- * 'x-my-header': 'some-value'
1561
- * },
1562
- * }
1563
- *
1564
- * client.getSpace('<space_id>')
1565
- * .then((space) => space.getEnvironment('<environment-id>'))
1566
- * .then((environment) => environment.createAppSignedRequest('<app_definition_id>', data)
1567
- * .then((signedRequest) => console.log(signedRequest))
1568
- * .catch(console.error)
1569
- * ```
1570
- */
1571
- createAppSignedRequest(appDefinitionId, data) {
1572
- const raw = this.toPlainObject();
1573
- return makeRequest({
1574
- entityType: 'AppSignedRequest',
1575
- action: 'create',
1576
- params: {
1577
- spaceId: raw.sys.space.sys.id,
1578
- environmentId: raw.sys.id,
1579
- appDefinitionId,
1580
- },
1581
- payload: data,
1582
- }).then((payload) => appSignedRequest.wrapAppSignedRequest(makeRequest, payload));
1583
- },
1584
- /**
1585
- * Creates an app access token
1586
- * @param appDefinitionId - AppDefinition ID
1587
- * @param data - Json Web Token
1588
- * @return Promise for an app access token
1589
- * @example ```javascript
1590
- * const contentful = require('contentful-management')
1591
- * const { sign } = require('jsonwebtoken')
1592
- *
1593
- * const signOptions = { algorithm: 'RS256', issuer: '<app_definition_id>', expiresIn: '10m' }
1594
- *
1595
- * const client = contentful.createClient({
1596
- * accessToken: '<content_management_api_key>'
1597
- * })
1598
- *
1599
- * const data = {
1600
- * jwt: sign({}, '<private_key>', signOptions)
1601
- * }
1602
- *
1603
- * client.getSpace('<space_id>')
1604
- * .then((space) => space.getEnvironment('<environment-id>'))
1605
- * .then((environment) => environment.createAppAccessToken('<app_definition_id>', data)
1606
- * .then((appAccessToken) => console.log(appAccessToken))
1607
- * .catch(console.error)
1608
- * ```
1609
- */
1610
- createAppAccessToken(appDefinitionId, data) {
1611
- const raw = this.toPlainObject();
1612
- return makeRequest({
1613
- entityType: 'AppAccessToken',
1614
- action: 'create',
1615
- params: {
1616
- spaceId: raw.sys.space.sys.id,
1617
- environmentId: raw.sys.id,
1618
- appDefinitionId,
1619
- },
1620
- payload: data,
1621
- }).then((payload) => appAccessToken.wrapAppAccessToken(makeRequest, payload));
1622
- },
1623
- /**
1624
- * Gets a collection of Functions for a given environment
1625
- * @param appInstallationId
1626
- * @param {import('../common-types').AcceptsQueryOptions} query - optional query parameter for filtering functions by action
1627
- * @return Promise containing wrapped collection of Functions in an environment
1628
- * @example ```javascript
1629
- * const contentful = require('contentful-management')
1630
- *
1631
- * const client = contentful.createClient({
1632
- * accessToken: '<content_management_api_key>'
1633
- * })
1634
- *
1635
- * client
1636
- * .getSpace('<space-id>')
1637
- * .then((space) => space.getEnvironment('<environment-id>'))
1638
- * .then((environment) => environment.getFunctionsForEnvironment('<app-installation-id>', { 'accepts[all]': '<action>' }))
1639
- * .then((functions) => console.log(functions.items))
1640
- * .catch(console.error)
1641
- * ```
1642
- */
1643
- getFunctionsForEnvironment(appInstallationId, query) {
1644
- const raw = this.toPlainObject();
1645
- return makeRequest({
1646
- entityType: 'Function',
1647
- action: 'getManyForEnvironment',
1648
- params: {
1649
- spaceId: raw.sys.space.sys.id,
1650
- environmentId: raw.sys.id,
1651
- appInstallationId,
1652
- query,
1653
- },
1654
- }).then((data) => _function.wrapFunctionCollection(makeRequest, data));
1655
- },
1656
- /**
1657
- * Gets a collection of FunctionLogs for a given app installation id and FunctionId
1658
- * @param appInstallationId
1659
- * @param functionId
1660
- * @param {import('../common-types').CursorBasedParams} query - optional query parameter for pagination (limit, nextPage, prevPage)
1661
- * @return Promise containing wrapped collection of FunctionLogs
1662
- * * @example ```javascript
1663
- * const contentful = require('contentful-management')
1664
- *
1665
- * const client = contentful.createClient({
1666
- * accessToken: '<content_management_api_key>'
1667
- * })
1668
- *
1669
- * client
1670
- * .getSpace('<space-id>')
1671
- * .then((space) => space.getEnvironment('<environment-id>'))
1672
- * .then((environment) =>
1673
- * environment.getFunctionLogs(
1674
- * '<app-installation-id>',
1675
- * '<function-id>',
1676
- * {
1677
- * query: {
1678
- * // optional limit
1679
- * limit: 10,
1680
- * // optional interval query
1681
- * 'sys.createdAt[gte]': start,
1682
- * 'sys.createdAt[lt]': end,
1683
- * // optional cursor based pagination parameters
1684
- * pagePrev: '<page_prev>',
1685
- * },
1686
- * },
1687
- * )
1688
- * )
1689
- * .then((functionLogs) => console.log(functionLog.items))
1690
- * .catch(console.error)
1691
- * ```
1692
- */
1693
- getFunctionLogs(appInstallationId, functionId, query) {
1694
- const raw = this.toPlainObject();
1695
- return makeRequest({
1696
- entityType: 'FunctionLog',
1697
- action: 'getMany',
1698
- params: {
1699
- spaceId: raw.sys.space.sys.id,
1700
- environmentId: raw.sys.id,
1701
- appInstallationId,
1702
- functionId,
1703
- query: query ? contentfulSdkCore.createRequestConfig({ query }).params : undefined,
1704
- },
1705
- }).then((data) => functionLog.wrapFunctionLogCollection(makeRequest, data));
1706
- },
1707
- /**
1708
- * Gets a FunctionLog by appInstallationId, functionId and logId
1709
- * @param appInstallationId
1710
- * @param functionId
1711
- * @param logId
1712
- * @return Promise containing a wrapped FunctionLog
1713
- * @example ```javascript
1714
- * const contentful = require('contentful-management')
1715
- *
1716
- * const client = contentful.createClient({
1717
- * accessToken: '<content_management_api_key>'
1718
- * })
1719
- *
1720
- * client
1721
- * .getSpace(<space-id>)
1722
- * .then((space) => space.getEnvironment('<environment-id>'))
1723
- * .then((environment) =>
1724
- * environment.getFunctionLog(
1725
- * '<app-installation-id>',
1726
- * '<function-id>',
1727
- * '<log-id>'
1728
- * )
1729
- * )
1730
- * .then((functionLog) => console.log(functionLog))
1731
- * .catch(console.error)
1732
- * ```
1733
- */
1734
- getFunctionLog(appInstallationId, functionId, logId) {
1735
- const raw = this.toPlainObject();
1736
- return makeRequest({
1737
- entityType: 'FunctionLog',
1738
- action: 'get',
1739
- params: {
1740
- spaceId: raw.sys.space.sys.id,
1741
- environmentId: raw.sys.id,
1742
- appInstallationId,
1743
- functionId,
1744
- logId,
1745
- },
1746
- }).then((data) => functionLog.wrapFunctionLog(makeRequest, data));
1747
- },
1748
- /**
1749
- * Gets all snapshots of an entry
1750
- * @func getEntrySnapshots
1751
- * @param entryId - Entry ID
1752
- * @param query - query additional query paramaters
1753
- * @return Promise for a collection of Entry Snapshots
1754
- * @example ```javascript
1755
- * const contentful = require('contentful-management')
1756
- *
1757
- * const client = contentful.createClient({
1758
- * accessToken: '<content_management_api_key>'
1759
- * })
1760
- *
1761
- * client.getSpace('<space_id>')
1762
- * .then((space) => space.getEnvironment('<environment-id>'))
1763
- * .then((environment) => environment.getEntrySnapshots('<entry_id>'))
1764
- * .then((snapshots) => console.log(snapshots.items))
1765
- * .catch(console.error)
1766
- * ```
1767
- */
1768
- getEntrySnapshots(entryId, query = {}) {
1769
- const raw = this.toPlainObject();
1770
- return makeRequest({
1771
- entityType: 'Snapshot',
1772
- action: 'getManyForEntry',
1773
- params: {
1774
- spaceId: raw.sys.space.sys.id,
1775
- environmentId: raw.sys.id,
1776
- entryId,
1777
- query,
1778
- },
1779
- }).then((data) => snapshot.wrapSnapshotCollection(makeRequest, data));
1780
- },
1781
- /**
1782
- * Gets all snapshots of a contentType
1783
- * @func getContentTypeSnapshots
1784
- * @param contentTypeId - Content Type ID
1785
- * @param query - query additional query paramaters
1786
- * @return Promise for a collection of Content Type Snapshots
1787
- * @example ```javascript
1788
- * const contentful = require('contentful-management')
1789
- *
1790
- * const client = contentful.createClient({
1791
- * accessToken: '<content_management_api_key>'
1792
- * })
1793
- *
1794
- * client.getSpace('<space_id>')
1795
- * .then((space) => space.getEnvironment('<environment-id>'))
1796
- * .then((environment) => environment.getContentTypeSnapshots('<contentTypeId>'))
1797
- * .then((snapshots) => console.log(snapshots.items))
1798
- * .catch(console.error)
1799
- * ```
1800
- */
1801
- getContentTypeSnapshots(contentTypeId, query = {}) {
1802
- const raw = this.toPlainObject();
1803
- return makeRequest({
1804
- entityType: 'Snapshot',
1805
- action: 'getManyForContentType',
1806
- params: {
1807
- spaceId: raw.sys.space.sys.id,
1808
- environmentId: raw.sys.id,
1809
- contentTypeId,
1810
- query,
1811
- },
1812
- }).then((data) => snapshot.wrapSnapshotCollection(makeRequest, data));
1813
- },
1814
- createTag(id, name, visibility) {
1815
- const raw = this.toPlainObject();
1816
- return makeRequest({
1817
- entityType: 'Tag',
1818
- action: 'createWithId',
1819
- params: {
1820
- spaceId: raw.sys.space.sys.id,
1821
- environmentId: raw.sys.id,
1822
- tagId: id,
1823
- },
1824
- payload: {
1825
- name,
1826
- sys: { visibility: visibility ?? 'private' },
1827
- },
1828
- }).then((data) => tag.wrapTag(makeRequest, data));
1829
- },
1830
- getTags(query = {}) {
1831
- const raw = this.toPlainObject();
1832
- return makeRequest({
1833
- entityType: 'Tag',
1834
- action: 'getMany',
1835
- params: {
1836
- spaceId: raw.sys.space.sys.id,
1837
- environmentId: raw.sys.id,
1838
- query: contentfulSdkCore.createRequestConfig({ query }).params,
1839
- },
1840
- }).then((data) => tag.wrapTagCollection(makeRequest, data));
1841
- },
1842
- getTag(id) {
1843
- const raw = this.toPlainObject();
1844
- return makeRequest({
1845
- entityType: 'Tag',
1846
- action: 'get',
1847
- params: {
1848
- spaceId: raw.sys.space.sys.id,
1849
- environmentId: raw.sys.id,
1850
- tagId: id,
1851
- },
1852
- }).then((data) => tag.wrapTag(makeRequest, data));
1853
- },
1854
- /**
1855
- * Retrieves a Release by ID
1856
- * @param releaseId
1857
- * @returns Promise containing a wrapped Release
1858
- * @example ```javascript
1859
- * const contentful = require('contentful-management')
1860
- *
1861
- * const client = contentful.createClient({
1862
- * accessToken: '<content_management_api_key>'
1863
- * })
1864
- *
1865
- * client.getSpace('<space_id>')
1866
- * .then((space) => space.getEnvironment('<environment-id>'))
1867
- * .then((environment) => environment.getRelease('<release_id>'))
1868
- * .then((release) => console.log(release))
1869
- * .catch(console.error)
1870
- * ```
1871
- */
1872
- getRelease(releaseId) {
1873
- const raw = this.toPlainObject();
1874
- return makeRequest({
1875
- entityType: 'Release',
1876
- action: 'get',
1877
- params: {
1878
- spaceId: raw.sys.space.sys.id,
1879
- environmentId: raw.sys.id,
1880
- releaseId,
1881
- },
1882
- }).then((data) => release.wrapRelease(makeRequest, data));
1883
- },
1884
- /**
1885
- * Gets a Collection of Releases,
1886
- * @param {ReleaseQueryOptions} query filtering options for the collection result
1887
- * @returns Promise containing a wrapped Release Collection
1888
- * @example ```javascript
1889
- * const contentful = require('contentful-management')
1890
- *
1891
- * const client = contentful.createClient({
1892
- * accessToken: '<content_management_api_key>'
1893
- * })
1894
- *
1895
- * client.getSpace('<space_id>')
1896
- * .then((space) => space.getEnvironment('<environment-id>'))
1897
- * .then((environment) => environment.getReleases({ 'entities.sys.id[in]': '<asset_id>,<entry_id>' }))
1898
- * .then((releases) => console.log(releases))
1899
- * .catch(console.error)
1900
- * ```
1901
- */
1902
- getReleases(query) {
1903
- const raw = this.toPlainObject();
1904
- return makeRequest({
1905
- entityType: 'Release',
1906
- action: 'query',
1907
- params: {
1908
- spaceId: raw.sys.space.sys.id,
1909
- environmentId: raw.sys.id,
1910
- query,
1911
- },
1912
- }).then((data) => release.wrapReleaseCollection(makeRequest, data));
1913
- },
1914
- /**
1915
- * Creates a new Release with the entities and title in the payload
1916
- * @param payload Object containing the payload in order to create a Release
1917
- * @returns Promise containing a wrapped Release, that has other helper methods within.
1918
- * @example ```javascript
1919
- * const contentful = require('contentful-management')
1920
- *
1921
- * const client = contentful.createClient({
1922
- * accessToken: '<content_management_api_key>'
1923
- * })
1924
- *
1925
- * const payload = {
1926
- * title: 'My Release',
1927
- * entities: {
1928
- * sys: { type: 'Array' },
1929
- * items: [
1930
- * { sys: { linkType: 'Entry', type: 'Link', id: '<entry_id>' } }
1931
- * ]
1932
- * }
1933
- * }
1934
- *
1935
- * client.getSpace('<space_id>')
1936
- * .then((space) => space.getEnvironment('<environment-id>'))
1937
- * .then((environment) => environment.createRelease(payload))
1938
- * .then((release) => console.log(release))
1939
- * .catch(console.error)
1940
- * ```
1941
- */
1942
- createRelease(payload) {
1943
- const raw = this.toPlainObject();
1944
- return makeRequest({
1945
- entityType: 'Release',
1946
- action: 'create',
1947
- params: {
1948
- spaceId: raw.sys.space.sys.id,
1949
- environmentId: raw.sys.id,
1950
- },
1951
- payload,
1952
- }).then((data) => release.wrapRelease(makeRequest, data));
1953
- },
1954
- /**
1955
- * Updates a Release and replaces all the properties.
1956
- * @param {object} options,
1957
- * @param options.releaseId the ID of the release
1958
- * @param options.payload the payload to be updated in the Release
1959
- * @param options.version Release sys.version that to be updated
1960
- * @returns Promise containing a wrapped Release, that has helper methods within.
1961
- *
1962
- * @example ```javascript
1963
- * const contentful = require('contentful-management')
1964
- *
1965
- * const client = contentful.createClient({
1966
- * accessToken: '<content_management_api_key>'
1967
- * })
1968
- *
1969
- *
1970
- * const payload = {
1971
- * title: "Updated Release title",
1972
- * entities: {
1973
- * sys: { type: 'Array' },
1974
- * items: [
1975
- * { sys: { linkType: 'Entry', type: 'Link', id: '<entry_id>' } }
1976
- * ]
1977
- * }
1978
- * }
1979
- *
1980
- * client.getSpace('<space_id>')
1981
- * .then((space) => space.getEnvironment('<environment-id>'))
1982
- * .then((environment) => environment.updateRelease({ releaseId: '<release_id>', version: 1, payload } ))
1983
- * .then((release) => console.log(release))
1984
- * .catch(console.error)
1985
- * ```
1986
- */
1987
- updateRelease({ releaseId, payload, version, }) {
1988
- const raw = this.toPlainObject();
1989
- return makeRequest({
1990
- entityType: 'Release',
1991
- action: 'update',
1992
- params: {
1993
- spaceId: raw.sys.space.sys.id,
1994
- environmentId: raw.sys.id,
1995
- releaseId,
1996
- version,
1997
- },
1998
- payload,
1999
- }).then((data) => release.wrapRelease(makeRequest, data));
2000
- },
2001
- /**
2002
- * Deletes a Release by ID - does not delete any entities.
2003
- * @param releaseId the ID of the release
2004
- *
2005
- * @returns Promise containing a wrapped Release, that has helper methods within.
2006
- * @example ```javascript
2007
- * const contentful = require('contentful-management')
2008
- *
2009
- * const client = contentful.createClient({
2010
- * accessToken: '<content_management_api_key>'
2011
- * })
2012
- *
2013
- * client.getSpace('<space_id>')
2014
- * .then((space) => space.getEnvironment('<environment-id>'))
2015
- * .then((environment) => environment.deleteRelease('<release_id>')
2016
- * .catch(console.error)
2017
- * ```
2018
- */
2019
- deleteRelease(releaseId) {
2020
- const raw = this.toPlainObject();
2021
- return makeRequest({
2022
- entityType: 'Release',
2023
- action: 'delete',
2024
- params: {
2025
- spaceId: raw.sys.space.sys.id,
2026
- environmentId: raw.sys.id,
2027
- releaseId,
2028
- },
2029
- });
2030
- },
2031
- /**
2032
- * Publishes all Entities contained in a Release.
2033
- * @param options.releaseId the ID of the release
2034
- * @param options.version the version of the release that is to be published
2035
- * @returns Promise containing a wrapped Release, that has helper methods within.
2036
- *
2037
- * @example ```javascript
2038
- * const contentful = require('contentful-management')
2039
- *
2040
- * const client = contentful.createClient({
2041
- * accessToken: '<content_management_api_key>'
2042
- * })
2043
- *
2044
- * client.getSpace('<space_id>')
2045
- * .then((space) => space.getEnvironment('<environment-id>'))
2046
- * .then((environment) => environment.publishRelease({ releaseId: '<release_id>', version: 1 }))
2047
- * .catch(console.error)
2048
- * ```
2049
- */
2050
- publishRelease({ releaseId, version }) {
2051
- const raw = this.toPlainObject();
2052
- return makeRequest({
2053
- entityType: 'Release',
2054
- action: 'publish',
2055
- params: {
2056
- spaceId: raw.sys.space.sys.id,
2057
- environmentId: raw.sys.id,
2058
- releaseId,
2059
- version,
2060
- },
2061
- }).then((data) => releaseAction.wrapReleaseAction(makeRequest, data));
2062
- },
2063
- /**
2064
- * Unpublishes all Entities contained in a Release.
2065
- * @param options.releaseId the ID of the release
2066
- * @param options.version the version of the release that is to be published
2067
- * @returns Promise containing a wrapped Release, that has helper methods within.
2068
- *
2069
- * @example ```javascript
2070
- * const contentful = require('contentful-management')
2071
- *
2072
- * const client = contentful.createClient({
2073
- * accessToken: '<content_management_api_key>'
2074
- * })
2075
- *
2076
- * client.getSpace('<space_id>')
2077
- * .then((space) => space.getEnvironment('<environment-id>'))
2078
- * .then((environment) => environment.unpublishRelease({ releaseId: '<release_id>', version: 1 }))
2079
- * .catch(console.error)
2080
- * ```
2081
- */
2082
- unpublishRelease({ releaseId, version }) {
2083
- const raw = this.toPlainObject();
2084
- return makeRequest({
2085
- entityType: 'Release',
2086
- action: 'unpublish',
2087
- params: {
2088
- spaceId: raw.sys.space.sys.id,
2089
- environmentId: raw.sys.id,
2090
- releaseId,
2091
- version,
2092
- },
2093
- }).then((data) => releaseAction.wrapReleaseAction(makeRequest, data));
2094
- },
2095
- /**
2096
- * Validates all Entities contained in a Release against an action (publish or unpublish)
2097
- * @param options.releaseId the ID of the release
2098
- * @param options.payload (optional) the type of action to be validated against
2099
- *
2100
- * @returns Promise containing a wrapped Release, that has helper methods within.
2101
- *
2102
- * @example ```javascript
2103
- * const contentful = require('contentful-management')
2104
- *
2105
- * const client = contentful.createClient({
2106
- * accessToken: '<content_management_api_key>'
2107
- * })
2108
- *
2109
- * client.getSpace('<space_id>')
2110
- * .then((space) => space.getEnvironment('<environment-id>'))
2111
- * .then((environment) => environment.validateRelease({ releaseId: '<release_id>', payload: { action: 'unpublish' } }))
2112
- * .catch(console.error)
2113
- * ```
2114
- */
2115
- validateRelease({ releaseId, payload, }) {
2116
- const raw = this.toPlainObject();
2117
- return makeRequest({
2118
- entityType: 'Release',
2119
- action: 'validate',
2120
- params: {
2121
- spaceId: raw.sys.space.sys.id,
2122
- environmentId: raw.sys.id,
2123
- releaseId,
2124
- },
2125
- payload,
2126
- }).then((data) => releaseAction.wrapReleaseAction(makeRequest, data));
2127
- },
2128
- /**
2129
- * Archives a Release and prevents new operations (publishing, unpublishing adding new entities etc).
2130
- * @param options.releaseId the ID of the release
2131
- * @param options.version the version of the release that is to be archived
2132
- * @returns Promise containing a wrapped Release, that has helper methods within.
2133
- *
2134
- * @example ```javascript
2135
- * const contentful = require('contentful-management')
2136
- *
2137
- * const client = contentful.createClient({
2138
- * accessToken: '<content_management_api_key>'
2139
- * })
2140
- *
2141
- * client.getSpace('<space_id>')
2142
- * .then((space) => space.getEnvironment('<environment-id>'))
2143
- * .then((environment) => environment.archiveRelease({ releaseId: '<release_id>', version: 1 }))
2144
- * .catch(console.error)
2145
- * ```
2146
- */
2147
- archiveRelease({ releaseId, version }) {
2148
- const raw = this.toPlainObject();
2149
- return makeRequest({
2150
- entityType: 'Release',
2151
- action: 'archive',
2152
- params: {
2153
- spaceId: raw.sys.space.sys.id,
2154
- environmentId: raw.sys.id,
2155
- releaseId,
2156
- version,
2157
- },
2158
- }).then((data) => release.wrapRelease(makeRequest, data));
2159
- },
2160
- /**
2161
- * Unarchives a previously archived Release - this enables the release to be published, unpublished etc.
2162
- * @param options.releaseId the ID of the release
2163
- * @param options.version the version of the release that is to be unarchived
2164
- * @returns Promise containing a wrapped Release, that has helper methods within.
2165
- *
2166
- * @example ```javascript
2167
- * const contentful = require('contentful-management')
2168
- *
2169
- * const client = contentful.createClient({
2170
- * accessToken: '<content_management_api_key>'
2171
- * })
2172
- *
2173
- * client.getSpace('<space_id>')
2174
- * .then((space) => space.getEnvironment('<environment-id>'))
2175
- * .then((environment) => environment.unarchiveRelease({ releaseId: '<release_id>', version: 1 }))
2176
- * .catch(console.error)
2177
- * ```
2178
- */
2179
- unarchiveRelease({ releaseId, version }) {
2180
- const raw = this.toPlainObject();
2181
- return makeRequest({
2182
- entityType: 'Release',
2183
- action: 'unarchive',
2184
- params: {
2185
- spaceId: raw.sys.space.sys.id,
2186
- environmentId: raw.sys.id,
2187
- releaseId,
2188
- version,
2189
- },
2190
- }).then((data) => release.wrapRelease(makeRequest, data));
2191
- },
2192
- /**
2193
- * Retrieves a ReleaseAction by ID
2194
- * @param params.releaseId The ID of a Release
2195
- * @param params.actionId The ID of a Release Action
2196
- * @returns Promise containing a wrapped ReleaseAction
2197
- * @example ```javascript
2198
- * const contentful = require('contentful-management')
2199
- *
2200
- * const client = contentful.createClient({
2201
- * accessToken: '<content_management_api_key>'
2202
- * })
2203
- *
2204
- * client.getSpace('<space_id>')
2205
- * .then((space) => space.getEnvironment('<environment-id>'))
2206
- * .then((environment) => environment.getReleaseAction({ releaseId: '<release_id>', actionId: '<action_id>' }))
2207
- * .then((releaseAction) => console.log(releaseAction))
2208
- * .catch(console.error)
2209
- * ```
2210
- */
2211
- getReleaseAction({ actionId, releaseId }) {
2212
- const raw = this.toPlainObject();
2213
- return makeRequest({
2214
- entityType: 'ReleaseAction',
2215
- action: 'get',
2216
- params: {
2217
- actionId,
2218
- spaceId: raw.sys.space.sys.id,
2219
- environmentId: raw.sys.id,
2220
- releaseId,
2221
- },
2222
- }).then((data) => releaseAction.wrapReleaseAction(makeRequest, data));
2223
- },
2224
- /**
2225
- * Gets a Collection of ReleaseActions
2226
- * @param {string} params.releaseId ID of the Release to fetch the actions from
2227
- * @param {ReleaseQueryOptions} params.query filtering options for the collection result
2228
- * @returns Promise containing a wrapped ReleaseAction Collection
2229
- *
2230
- * @example ```javascript
2231
- * const contentful = require('contentful-management')
2232
- *
2233
- * const client = contentful.createClient({
2234
- * accessToken: '<content_management_api_key>'
2235
- * })
2236
- *
2237
- * client.getSpace('<space_id>')
2238
- * .then((space) => space.getEnvironment('<environment-id>'))
2239
- * .then((environment) => environment.getReleaseActions({ query: { 'sys.id[in]': '<id_1>,<id_2>', 'sys.release.sys.id[in]': '<id1>,<id2>' } }))
2240
- * .then((releaseActions) => console.log(releaseActions))
2241
- * .catch(console.error)
2242
- * ```
2243
- */
2244
- getReleaseActions({ query }) {
2245
- const raw = this.toPlainObject();
2246
- return makeRequest({
2247
- entityType: 'ReleaseAction',
2248
- action: 'getMany',
2249
- params: {
2250
- spaceId: raw.sys.space.sys.id,
2251
- environmentId: raw.sys.id,
2252
- query,
2253
- },
2254
- }).then((data) => releaseAction.wrapReleaseActionCollection(makeRequest, data));
2255
- },
2256
- async getUIConfig() {
2257
- const raw = this.toPlainObject();
2258
- const data = await makeRequest({
2259
- entityType: 'UIConfig',
2260
- action: 'get',
2261
- params: {
2262
- spaceId: raw.sys.space.sys.id,
2263
- environmentId: raw.sys.id,
2264
- },
2265
- });
2266
- return uiConfig.wrapUIConfig(makeRequest, data);
2267
- },
2268
- async getUserUIConfig() {
2269
- const raw = this.toPlainObject();
2270
- const data = await makeRequest({
2271
- entityType: 'UserUIConfig',
2272
- action: 'get',
2273
- params: {
2274
- spaceId: raw.sys.space.sys.id,
2275
- environmentId: raw.sys.id,
2276
- },
2277
- });
2278
- return userUiConfig.wrapUserUIConfig(makeRequest, data);
2279
- },
2280
- /**
2281
- * Gets a collection of all environment template installations in the environment for a given template
2282
- * @param environmentTemplateId - Environment template ID to return installations for
2283
- * @param [options.installationId] - Installation ID to filter for a specific installation
2284
- * @return Promise for a collection of EnvironmentTemplateInstallations
2285
- * ```javascript
2286
- * const contentful = require('contentful-management')
2287
- *
2288
- * const client = contentful.createClient({
2289
- * accessToken: '<content_management_api_key>'
2290
- * })
2291
- *
2292
- * client.getSpace('<space_id>')
2293
- * .then((space) => space.getEnvironment('<environment_id>'))
2294
- * .then((environment) => environment.getEnvironmentTemplateInstallations('<environment_template_id>'))
2295
- * .then((installations) => console.log(installations.items))
2296
- * .catch(console.error)
2297
- * ```
2298
- */
2299
- async getEnvironmentTemplateInstallations(environmentTemplateId, { installationId, ...query } = {}) {
2300
- const raw = this.toPlainObject();
2301
- return makeRequest({
2302
- entityType: 'EnvironmentTemplateInstallation',
2303
- action: 'getForEnvironment',
2304
- params: {
2305
- environmentTemplateId,
2306
- ...(installationId && { installationId }),
2307
- query: { ...contentfulSdkCore.createRequestConfig({ query }).params },
2308
- spaceId: raw.sys.space.sys.id,
2309
- environmentId: raw.sys.id,
2310
- },
2311
- }).then((data) => environmentTemplateInstallation.wrapEnvironmentTemplateInstallationCollection(makeRequest, data));
2312
- },
2313
- /**
2314
- * Gets a collection of all resource types based on native external references app installations in the environment
2315
- * @param query - BasicCursorPaginationOptions
2316
- * @return Promise for a collection of ResourceTypes
2317
- * ```javascript
2318
- * const contentful = require('contentful-management')
2319
- *
2320
- * const client = contentful.createClient({
2321
- * accessToken: '<content_management_api_key>'
2322
- * })
2323
- *
2324
- * client.getSpace('<space_id>')
2325
- * .then((space) => space.getEnvironment('<environment_id>'))
2326
- * .then((environment) => environment.getResourceTypes({limit: 10}))
2327
- * .then((installations) => console.log(installations.items))
2328
- * .catch(console.error)
2329
- * ```
2330
- */
2331
- async getResourceTypes(query) {
2332
- const raw = this.toPlainObject();
2333
- return makeRequest({
2334
- entityType: 'ResourceType',
2335
- action: 'getForEnvironment',
2336
- params: {
2337
- query,
2338
- spaceId: raw.sys.space.sys.id,
2339
- environmentId: raw.sys.id,
2340
- },
2341
- }).then((data) => resourceType.wrapResourceTypesForEnvironmentCollection(makeRequest, data));
2342
- },
2343
- /**
2344
- * Gets a collection of all resources for a given resource type based on native external references app installations in the environment
2345
- * @param resourceTypeId - Id of the resourceType to get its resources
2346
- * @param query - Either LookupQuery options with 'sys.urn[in]' param or a Search query with 'query' param, in both cases you can add pagination options
2347
- * @return Promise for a collection of Resources for a given resourceTypeId
2348
- * ```javascript
2349
- * const contentful = require('contentful-management')
2350
- *
2351
- * const client = contentful.createClient({
2352
- * accessToken: '<content_management_api_key>'
2353
- * })
2354
- *
2355
- * // Search Query
2356
- * client.getSpace('<space_id>')
2357
- * .then((space) => space.getEnvironment('<environment_id>'))
2358
- * // <search_query> is a string you want to search for in the external resources
2359
- * .then((environment) => environment.getResourcesForResourceType('<resource_type_id>', {query: '<search_query>', limit: 10}))
2360
- * .then((installations) => console.log(installations.items))
2361
- * .catch(console.error)
2362
- *
2363
- * // Lookup query
2364
- *
2365
- * client.getSpace('<space_id>')
2366
- * .then((space) => space.getEnvironment('<environment_id>'))
2367
- * .then((environment) => environment.getResourcesForResourceType('<resource_type_id>', {'sys.urn[in]': '<resource_urn1>,<resource_urn2>', limit: 10}))
2368
- * .then((installations) => console.log(installations.items))
2369
- * .catch(console.error)
2370
- * ```
2371
- */
2372
- async getResourcesForResourceType(resourceTypeId, query) {
2373
- const raw = this.toPlainObject();
2374
- return makeRequest({
2375
- entityType: 'Resource',
2376
- action: 'getMany',
2377
- params: {
2378
- query,
2379
- spaceId: raw.sys.space.sys.id,
2380
- environmentId: raw.sys.id,
2381
- resourceTypeId,
2382
- },
2383
- }).then((data) => resource.wrapResourceCollection(makeRequest, data));
2384
- },
2385
- /**
2386
- * Invokes an AI Action.
2387
- * @param aiActionId - The ID of the AI Action to invoke.
2388
- * @param payload - The invocation payload.
2389
- * @returns Promise for an AI Action Invocation.
2390
- * @example ```javascript
2391
- * client.getSpace('<space_id>')
2392
- * .then(space => space.getEnvironment('<environment_id>'))
2393
- * .then(environment => environment.invokeAiAction('<ai_action_id>', {
2394
- * variables: [ ... ],
2395
- * outputFormat: 'RichText'
2396
- * }))
2397
- * .then(invocation => console.log(invocation))
2398
- * .catch(console.error)
2399
- * ```
2400
- */
2401
- invokeAiAction(aiActionId, payload) {
2402
- const raw = this.toPlainObject();
2403
- return makeRequest({
2404
- entityType: 'AiAction',
2405
- action: 'invoke',
2406
- params: { spaceId: raw.sys.space.sys.id, environmentId: raw.sys.id, aiActionId },
2407
- payload,
2408
- }).then((data) => aiActionInvocation.wrapAiActionInvocation(makeRequest, data));
2409
- },
2410
- /**
2411
- * Retrieves an AI Action Invocation.
2412
- * @param params - Object containing the AI Action ID and the Invocation ID.
2413
- * @returns Promise for an AI Action Invocation.
2414
- * @example ```javascript
2415
- * client.getSpace('<space_id>')
2416
- * .then(space => space.getEnvironment('<environment_id>'))
2417
- * .then(environment => environment.getAiActionInvocation({
2418
- * aiActionId: '<ai_action_id>',
2419
- * invocationId: '<invocation_id>'
2420
- * }))
2421
- * .then(invocation => console.log(invocation))
2422
- * .catch(console.error)
2423
- * ```
2424
- */
2425
- getAiActionInvocation({ aiActionId, invocationId, }) {
2426
- const raw = this.toPlainObject();
2427
- return makeRequest({
2428
- entityType: 'AiActionInvocation',
2429
- action: 'get',
2430
- params: {
2431
- spaceId: raw.sys.space.sys.id,
2432
- environmentId: raw.sys.id,
2433
- aiActionId,
2434
- invocationId,
2435
- },
2436
- }).then((data) => aiActionInvocation.wrapAiActionInvocation(makeRequest, data));
2437
- },
2438
- };
2439
- }
2440
-
2441
- module.exports = createEnvironmentApi;
2442
- //# sourceMappingURL=create-environment-api.cjs.map