contentful-management 11.64.0-new-beta.5 → 11.65.0

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