contentful-management 11.63.1 → 11.64.0-new-beta.1

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