contentful-management 12.0.0-new-beta.1 → 12.0.0-new-beta.3

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