UNPKG

53.6 kBTypeScriptView Raw
1import { Stream } from 'stream';
2import type { QueryOptions } from './common-types';
3import { BasicQueryOptions, MakeRequest } from './common-types';
4import type { CreateAppInstallationProps } from './entities/app-installation';
5import type { CreateAppSignedRequestProps } from './entities/app-signed-request';
6import type { AssetFileProp, AssetProps, CreateAssetProps } from './entities/asset';
7import type { CreateAssetKeyProps } from './entities/asset-key';
8import type { BulkAction, BulkActionPayload, BulkActionPublishPayload, BulkActionUnpublishPayload, BulkActionValidatePayload } from './entities/bulk-action';
9import { ReleaseActionQueryOptions } from './entities/release-action';
10import { ReleasePayload, ReleaseQueryOptions, ReleaseValidatePayload } from './entities/release';
11import type { ContentTypeProps, CreateContentTypeProps } from './entities/content-type';
12import type { CreateEntryProps, EntryProps, EntryReferenceOptionsProps, EntryReferenceProps } from './entities/entry';
13import type { CreateExtensionProps } from './entities/extension';
14import type { CreateLocaleProps } from './entities/locale';
15import { TagVisibility } from './entities/tag';
16/**
17 * @private
18 */
19export declare type ContentfulEnvironmentAPI = ReturnType<typeof createEnvironmentApi>;
20/**
21 * Creates API object with methods to access the Environment API
22 * @param {ContentfulEnvironmentAPI} makeRequest - function to make requests via an adapter
23 * @return {ContentfulSpaceAPI}
24 * @private
25 */
26export default function createEnvironmentApi(makeRequest: MakeRequest): {
27 /**
28 * Deletes the environment
29 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
30 * @example ```javascript
31 * const contentful = require('contentful-management')
32 *
33 * const client = contentful.createClient({
34 * accessToken: '<content_management_api_key>'
35 * })
36 *
37 * client.getSpace('<space_id>')
38 * .then((space) => space.getEnvironment('<environment-id>'))
39 * .then((environment) => environment.delete())
40 * .then(() => console.log('Environment deleted.'))
41 * .catch(console.error)
42 * ```
43 */
44 delete: () => Promise<void>;
45 /**
46 * Updates the environment
47 * @return Promise for the updated environment.
48 * @example ```javascript
49 * const contentful = require('contentful-management')
50 *
51 * const client = contentful.createClient({
52 * accessToken: '<content_management_api_key>'
53 * })
54 *
55 * client.getSpace('<space_id>')
56 * .then((space) => space.getEnvironment('<environment-id>'))
57 * .then((environment) => {
58 * environment.name = 'New name'
59 * return environment.update()
60 * })
61 * .then((environment) => console.log(`Environment ${environment.sys.id} renamed.`)
62 * .catch(console.error)
63 * ```
64 */
65 update: () => Promise<import("./entities/environment").Environment>;
66 /**
67 * Creates SDK Entry object (locally) from entry data
68 * @param entryData - Entry Data
69 * @return Entry
70 * @example ```javascript
71 * environment.getEntry('entryId').then(entry => {
72 *
73 * // Build a plainObject in order to make it usable for React (saving in state or redux)
74 * const plainObject = entry.toPlainObject();
75 *
76 * // The entry is being updated in some way as plainObject:
77 * const updatedPlainObject = {
78 * ...plainObject,
79 * fields: {
80 * ...plainObject.fields,
81 * title: {
82 * 'en-US': 'updatedTitle'
83 * }
84 * }
85 * };
86 *
87 * // Rebuild an sdk object out of the updated plainObject:
88 * const entryWithMethodsAgain = environment.getEntryFromData(updatedPlainObject);
89 *
90 * // Update with help of the sdk method:
91 * entryWithMethodsAgain.update();
92 *
93 * });
94 * ```
95 **/
96 getEntryFromData(entryData: EntryProps): import("./entities/entry").Entry;
97 /**
98 * Creates SDK Asset object (locally) from entry data
99 * @param assetData - Asset ID
100 * @return Asset
101 * @example ```javascript
102 * environment.getAsset('asset_id').then(asset => {
103 *
104 * // Build a plainObject in order to make it usable for React (saving in state or redux)
105 * const plainObject = asset.toPlainObject();
106 *
107 * // The asset is being updated in some way as plainObject:
108 * const updatedPlainObject = {
109 * ...plainObject,
110 * fields: {
111 * ...plainObject.fields,
112 * title: {
113 * 'en-US': 'updatedTitle'
114 * }
115 * }
116 * };
117 *
118 * // Rebuild an sdk object out of the updated plainObject:
119 * const assetWithMethodsAgain = environment.getAssetFromData(updatedPlainObject);
120 *
121 * // Update with help of the sdk method:
122 * assetWithMethodsAgain.update();
123 *
124 * });
125 * ```
126 */
127 getAssetFromData(assetData: AssetProps): import("./entities/asset").Asset;
128 /**
129 *
130 * @description Get a BulkAction by ID.
131 * See: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/bulk-actions/bulk-action
132 * @param bulkActionId - ID of the BulkAction to fetch
133 * @returns - Promise with the BulkAction
134 *
135 * @example ```javascript
136 * const contentful = require('contentful-management')
137 *
138 * const client = contentful.createClient({
139 * accessToken: '<content_management_api_key>'
140 * })
141 *
142 * client.getSpace('<space_id>')
143 * .then((space) => space.getEnvironment('<environment_id>'))
144 * .then((environment) => environment.getBulkAction('<bulk_action_id>'))
145 * .then((bulkAction) => console.log(bulkAction))
146 * ```
147 */
148 getBulkAction<T extends BulkActionPayload = any>(bulkActionId: string): Promise<BulkAction<T>>;
149 /**
150 * @description Creates a BulkAction that will attempt to publish all items contained in the payload.
151 * See: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/bulk-actions/publish-bulk-action
152 * @param {BulkActionPayload} payload - Object containing the items to be processed in the bulkAction
153 * @returns - Promise with the BulkAction
154 *
155 * @example
156 *
157 * ```javascript
158 * const contentful = require('contentful-management')
159 *
160 * const client = contentful.createClient({
161 * accessToken: '<content_management_api_key>'
162 * })
163 *
164 * const payload = {
165 * entities: {
166 * sys: { type: 'Array' }
167 * items: [
168 * { sys: { type: 'Link', id: '<entry-id>', linkType: 'Entry', version: 2 } }
169 * ]
170 * }
171 * }
172 *
173 * // Using Thenables
174 * client.getSpace('<space_id>')
175 * .then((space) => space.getEnvironment('<environment_id>'))
176 * .then((environment) => environment.createPublishBulkAction(payload))
177 * .then((bulkAction) => console.log(bulkAction.waitProcessing()))
178 * .catch(console.error)
179 *
180 * // Using async/await
181 * try {
182 * const space = await client.getSpace('<space_id>')
183 * const environment = await space.getEnvironment('<environment_id>')
184 * const bulkActionInProgress = await environment.createPublishBulkAction(payload)
185 *
186 * // You can wait for a recently created BulkAction to be processed by using `bulkAction.waitProcessing()`
187 * const bulkActionCompleted = await bulkActionInProgress.waitProcessing()
188 * console.log(bulkActionCompleted)
189 * } catch (error) {
190 * console.log(error)
191 * }
192 * ```
193 */
194 createPublishBulkAction(payload: BulkActionPublishPayload): Promise<BulkAction<BulkActionPublishPayload>>;
195 /**
196 * @description Creates a BulkAction that will attempt to validate all items contained in the payload.
197 * See: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/bulk-actions/validate-bulk-action
198 * @param {BulkActionPayload} payload - Object containing the items to be processed in the bulkAction
199 * @returns - Promise with the BulkAction
200 *
201 * @example
202 *
203 * ```javascript
204 * const contentful = require('contentful-management')
205 *
206 * const client = contentful.createClient({
207 * accessToken: '<content_management_api_key>'
208 * })
209 *
210 * const payload = {
211 * action: 'publish',
212 * entities: {
213 * sys: { type: 'Array' }
214 * items: [
215 * { sys: { type: 'Link', id: '<entry-id>', linkType: 'Entry' } }
216 * ]
217 * }
218 * }
219 *
220 * // Using Thenables
221 * client.getSpace('<space_id>')
222 * .then((space) => space.getEnvironment('<environment_id>'))
223 * .then((environment) => environment.createValidateBulkAction(payload))
224 * .then((bulkAction) => console.log(bulkAction.waitProcessing()))
225 * .catch(console.error)
226 *
227 * // Using async/await
228 * try {
229 * const space = await client.getSpace('<space_id>')
230 * const environment = await space.getEnvironment('<environment_id>')
231 * const bulkActionInProgress = await environment.createValidateBulkAction(payload)
232 *
233 * // You can wait for a recently created BulkAction to be processed by using `bulkAction.waitProcessing()`
234 * const bulkActionCompleted = await bulkActionInProgress.waitProcessing()
235 * console.log(bulkActionCompleted)
236 * } catch (error) {
237 * console.log(error)
238 * }
239 * ```
240 */
241 createValidateBulkAction(payload: BulkActionValidatePayload): Promise<BulkAction<BulkActionValidatePayload>>;
242 /**
243 * @description Creates a BulkAction that will attempt to unpublish all items contained in the payload.
244 * See: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/bulk-actions/unpublish-bulk-action
245 * @param {BulkActionPayload} payload - Object containing the items to be processed in the bulkAction
246 * @returns - Promise with the BulkAction
247 *
248 * @example
249 *
250 * ```javascript
251 * const contentful = require('contentful-management')
252 *
253 * const client = contentful.createClient({
254 * accessToken: '<content_management_api_key>'
255 * })
256 *
257 * const payload = {
258 * entities: {
259 * sys: { type: 'Array' }
260 * items: [
261 * { sys: { type: 'Link', id: 'entry-id', linkType: 'Entry' } }
262 * ]
263 * }
264 * }
265 *
266 * // Using Thenables
267 * client.getSpace('<space_id>')
268 * .then((space) => space.getEnvironment('<environment_id>'))
269 * .then((environment) => environment.createUnpublishBulkAction(payload))
270 * .then((bulkAction) => console.log(bulkAction.waitProcessing()))
271 * .catch(console.error)
272 *
273 * // Using async/await
274 * try {
275 * const space = await clientgetSpace('<space_id>')
276 * const environment = await space.getEnvironment('<environment_id>')
277 * const bulkActionInProgress = await environment.createUnpublishBulkAction(payload)
278 *
279 * // You can wait for a recently created BulkAction to be processed by using `bulkAction.waitProcessing()`
280 * const bulkActionCompleted = await bulkActionInProgress.waitProcessing()
281 * console.log(bulkActionCompleted)
282 * } catch (error) {
283 * console.log(error)
284 * }
285 * ```
286 */
287 createUnpublishBulkAction(payload: BulkActionUnpublishPayload): Promise<BulkAction<BulkActionUnpublishPayload>>;
288 /**
289 * Gets a Content Type
290 * @param contentTypeId - Content Type ID
291 * @return Promise for a Content Type
292 * @example ```javascript
293 * const contentful = require('contentful-management')
294 *
295 * const client = contentful.createClient({
296 * accessToken: '<content_management_api_key>'
297 * })
298 *
299 * client.getSpace('<space_id>')
300 * .then((space) => space.getEnvironment('<environment-id>'))
301 * .then((environment) => environment.getContentType('<content_type_id>'))
302 * .then((contentType) => console.log(contentType))
303 * .catch(console.error)
304 * ```
305 */
306 getContentType(contentTypeId: string): Promise<import("./entities/content-type").ContentType>;
307 /**
308 * Gets a collection of Content Types
309 * @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.
310 * @return Promise for a collection of Content Types
311 * @example ```javascript
312 * const contentful = require('contentful-management')
313 *
314 * const client = contentful.createClient({
315 * accessToken: '<content_management_api_key>'
316 * })
317 *
318 * client.getSpace('<space_id>')
319 * .then((space) => space.getEnvironment('<environment-id>'))
320 * .then((environment) => environment.getContentTypes())
321 * .then((response) => console.log(response.items))
322 * .catch(console.error)
323 * ```
324 */
325 getContentTypes(query?: QueryOptions): Promise<import("./common-types").Collection<import("./entities/content-type").ContentType, ContentTypeProps>>;
326 /**
327 * Creates a Content Type
328 * @param data - Object representation of the Content Type to be created
329 * @return Promise for the newly created Content Type
330 * @example ```javascript
331 * const contentful = require('contentful-management')
332 *
333 * const client = contentful.createClient({
334 * accessToken: '<content_management_api_key>'
335 * })
336 *
337 * client.getSpace('<space_id>')
338 * .then((space) => space.getEnvironment('<environment-id>'))
339 * .then((environment) => environment.createContentType({
340 * name: 'Blog Post',
341 * fields: [
342 * {
343 * id: 'title',
344 * name: 'Title',
345 * required: true,
346 * localized: false,
347 * type: 'Text'
348 * }
349 * ]
350 * }))
351 * .then((contentType) => console.log(contentType))
352 * .catch(console.error)
353 * ```
354 */
355 createContentType(data: CreateContentTypeProps): Promise<import("./entities/content-type").ContentType>;
356 /**
357 * Creates a Content Type with a custom ID
358 * @param contentTypeId - Content Type ID
359 * @param data - Object representation of the Content Type to be created
360 * @return Promise for the newly created Content Type
361 * @example ```javascript
362 * const contentful = require('contentful-management')
363 *
364 * const client = contentful.createClient({
365 * accessToken: '<content_management_api_key>'
366 * })
367 *
368 * client.getSpace('<space_id>')
369 * .then((space) => space.getEnvironment('<environment-id>'))
370 * .then((environment) => environment.createContentTypeWithId('<content-type-id>', {
371 * name: 'Blog Post',
372 * fields: [
373 * {
374 * id: 'title',
375 * name: 'Title',
376 * required: true,
377 * localized: false,
378 * type: 'Text'
379 * }
380 * ]
381 * }))
382 * .then((contentType) => console.log(contentType))
383 * .catch(console.error)
384 * ```
385 */
386 createContentTypeWithId(contentTypeId: string, data: CreateContentTypeProps): Promise<import("./entities/content-type").ContentType>;
387 /**
388 * Gets an EditorInterface for a ContentType
389 * @param contentTypeId - Content Type ID
390 * @return Promise for an EditorInterface
391 * @example ```javascript
392 * const contentful = require('contentful-management')
393 *
394 * const client = contentful.createClient({
395 * accessToken: '<content_management_api_key>'
396 * })
397 *
398 * client.getSpace('<space_id>')
399 * .then((space) => space.getEnvironment('<environment-id>'))
400 * .then((environment) => environment.getEditorInterfaceForContentType('<content_type_id>'))
401 * .then((EditorInterface) => console.log(EditorInterface))
402 * .catch(console.error)
403 * ```
404 */
405 getEditorInterfaceForContentType(contentTypeId: string): Promise<import("./export-types").EditorInterface>;
406 /**
407 * Gets all EditorInterfaces
408 * @return Promise for a collection of EditorInterface
409 * @example ```javascript
410 * const contentful = require('contentful-management')
411 *
412 * const client = contentful.createClient({
413 * accessToken: '<content_management_api_key>'
414 * })
415 *
416 * client.getSpace('<space_id>')
417 * .then((space) => space.getEnvironment('<environment-id>'))
418 * .then((environment) => environment.getEditorInterfaces())
419 * .then((response) => console.log(response.items))
420 * .catch(console.error)
421 * ```
422 */
423 getEditorInterfaces(): Promise<import("./common-types").Collection<import("./export-types").EditorInterface, import("./export-types").EditorInterfaceProps>>;
424 /**
425 * Gets an Entry
426 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
427 * from your entry in the backend
428 * @param id - Entry ID
429 * @param query - Object with search parameters. In this method it's only useful for `locale`.
430 * @return Promise for an Entry
431 * @example ```javascript
432 * const contentful = require('contentful-management')
433 *
434 * const client = contentful.createClient({
435 * accessToken: '<content_management_api_key>'
436 * })
437 *
438 * client.getSpace('<space_id>')
439 * .then((space) => space.getEnvironment('<environment-id>'))
440 * .then((environment) => environment.getEntry('<entry-id>'))
441 * .then((entry) => console.log(entry))
442 * .catch(console.error)
443 * ```
444 */
445 getEntry(id: string, query?: QueryOptions): Promise<import("./entities/entry").Entry>;
446 /**
447 * Deletes an Entry of this environement
448 * @param id - Entry ID
449 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
450 * @example ```javascript
451 * const contentful = require('contentful-management')
452 *
453 * const client = contentful.createClient({
454 * accessToken: '<content_management_api_key>'
455 * })
456 *
457 * client.getSpace('<space_id>')
458 * .then((space) => space.getEnvironment('<environment-id>'))
459 * .then((environment) => environment.deleteEntry("4bmLXiuviAZH3jkj5DLRWE"))
460 * .then(() => console.log('Entry deleted.'))
461 * .catch(console.error)
462 * ```
463 */
464 deleteEntry(id: string): Promise<void>;
465 /**
466 * Gets a collection of Entries
467 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
468 * from your entry in the backend
469 * @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.
470 * @return Promise for a collection of Entries
471 * @example ```javascript
472 * const contentful = require('contentful-management')
473 *
474 * const client = contentful.createClient({
475 * accessToken: '<content_management_api_key>'
476 * })
477 *
478 * client.getSpace('<space_id>')
479 * .then((space) => space.getEnvironment('<environment-id>'))
480 * .then((environment) => environment.getEntries({'content_type': 'foo'})) // you can add more queries as 'key': 'value'
481 * .then((response) => console.log(response.items))
482 * .catch(console.error)
483 * ```
484 */
485 getEntries(query?: QueryOptions): Promise<import("./common-types").Collection<import("./entities/entry").Entry, EntryProps<import("./common-types").KeyValueMap>>>;
486 /**
487 * Creates a Entry
488 * @param contentTypeId - The Content Type ID of the newly created Entry
489 * @param data - Object representation of the Entry to be created
490 * @return Promise for the newly created Entry
491 * @example ```javascript
492 * const contentful = require('contentful-management')
493 *
494 * const client = contentful.createClient({
495 * accessToken: '<content_management_api_key>'
496 * })
497 *
498 * client.getSpace('<space_id>')
499 * .then((space) => space.getEnvironment('<environment-id>'))
500 * .then((environment) => environment.createEntry('<content_type_id>', {
501 * fields: {
502 * title: {
503 * 'en-US': 'Entry title'
504 * }
505 * }
506 * }))
507 * .then((entry) => console.log(entry))
508 * .catch(console.error)
509 * ```
510 */
511 createEntry(contentTypeId: string, data: Omit<EntryProps, 'sys'>): Promise<import("./entities/entry").Entry>;
512 /**
513 * Creates a Entry with a custom ID
514 * @param contentTypeId - The Content Type of the newly created Entry
515 * @param id - Entry ID
516 * @param data - Object representation of the Entry to be created
517 * @return Promise for the newly created Entry
518 * @example ```javascript
519 * const contentful = require('contentful-management')
520 *
521 * const client = contentful.createClient({
522 * accessToken: '<content_management_api_key>'
523 * })
524 *
525 * // Create entry
526 * client.getSpace('<space_id>')
527 * .then((space) => space.getEnvironment('<environment-id>'))
528 * .then((environment) => environment.createEntryWithId('<content_type_id>', '<entry_id>', {
529 * fields: {
530 * title: {
531 * 'en-US': 'Entry title'
532 * }
533 * }
534 * }))
535 * .then((entry) => console.log(entry))
536 * .catch(console.error)
537 * ```
538 */
539 createEntryWithId(contentTypeId: string, id: string, data: CreateEntryProps): Promise<import("./entities/entry").Entry>;
540 /**
541 * Get entry references
542 * @param entryId - Entry ID
543 * @param {Object} options.include - Level of the entry descendants from 1 up to 10 maximum
544 * @param {Object} options.maxDepth - alias for `include`. Deprecated, please use `include`
545 * @returns Promise of Entry references
546 * @example ```javascript
547 * const contentful = require('contentful-management');
548 *
549 * const client = contentful.createClient({
550 * accessToken: '<contentful_management_api_key>
551 * })
552 *
553 * // Get entry references
554 * client.getSpace('<space_id>')
555 * .then((space) => space.getEnvironment('<environment_id>'))
556 * .then((environment) => environment.getEntryReferences('<entry_id>', {include: number}))
557 * .then((entry) => console.log(entry.includes))
558 * // or
559 * .then((environment) => environment.getEntry('<entry_id>')).then((entry) => entry.references({include: number}))
560 * .catch(console.error)
561 * ```
562 */
563 getEntryReferences(entryId: string, options?: EntryReferenceOptionsProps | undefined): Promise<EntryReferenceProps>;
564 /**
565 * Gets an Asset
566 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
567 * from your entry in the backend
568 * @param id - Asset ID
569 * @param query - Object with search parameters. In this method it's only useful for `locale`.
570 * @return Promise for an Asset
571 * @example ```javascript
572 * const contentful = require('contentful-management')
573 *
574 * const client = contentful.createClient({
575 * accessToken: '<content_management_api_key>'
576 * })
577 *
578 * client.getSpace('<space_id>')
579 * .then((space) => space.getEnvironment('<environment-id>'))
580 * .then((environment) => environment.getAsset('<asset_id>'))
581 * .then((asset) => console.log(asset))
582 * .catch(console.error)
583 * ```
584 */
585 getAsset(id: string, query?: QueryOptions): Promise<import("./entities/asset").Asset>;
586 /**
587 * Gets a collection of Assets
588 * Warning: if you are using the select operator, when saving, any field that was not selected will be removed
589 * from your entry in the backend
590 * @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.
591 * @return Promise for a collection of Assets
592 * @example ```javascript
593 * const contentful = require('contentful-management')
594 *
595 * const client = contentful.createClient({
596 * accessToken: '<content_management_api_key>'
597 * })
598 *
599 * client.getSpace('<space_id>')
600 * .then((space) => space.getEnvironment('<environment-id>'))
601 * .then((environment) => environment.getAssets())
602 * .then((response) => console.log(response.items))
603 * .catch(console.error)
604 * ```
605 */
606 getAssets(query?: QueryOptions): Promise<import("./common-types").Collection<import("./entities/asset").Asset, AssetProps>>;
607 /**
608 * Creates a Asset. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
609 * @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.
610 * @return Promise for the newly created Asset
611 * @example ```javascript
612 * const client = contentful.createClient({
613 * accessToken: '<content_management_api_key>'
614 * })
615 *
616 * // Create asset
617 * client.getSpace('<space_id>')
618 * .then((space) => space.getEnvironment('<environment-id>'))
619 * .then((environment) => environment.createAsset({
620 * fields: {
621 * title: {
622 * 'en-US': 'Playsam Streamliner'
623 * },
624 * file: {
625 * 'en-US': {
626 * contentType: 'image/jpeg',
627 * fileName: 'example.jpeg',
628 * upload: 'https://example.com/example.jpg'
629 * }
630 * }
631 * }
632 * }))
633 * .then((asset) => asset.processForLocale("en-US")) // OR asset.processForAllLocales()
634 * .then((asset) => console.log(asset))
635 * .catch(console.error)
636 * ```
637 */
638 createAsset(data: CreateAssetProps): Promise<import("./entities/asset").Asset>;
639 /**
640 * Creates a Asset with a custom ID. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
641 * @param id - Asset ID
642 * @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.
643 * @return Promise for the newly created Asset
644 * @example ```javascript
645 * const client = contentful.createClient({
646 * accessToken: '<content_management_api_key>'
647 * })
648 *
649 * // Create asset
650 * client.getSpace('<space_id>')
651 * .then((space) => space.getEnvironment('<environment-id>'))
652 * .then((environment) => environment.createAssetWithId('<asset_id>', {
653 * title: {
654 * 'en-US': 'Playsam Streamliner'
655 * },
656 * file: {
657 * 'en-US': {
658 * contentType: 'image/jpeg',
659 * fileName: 'example.jpeg',
660 * upload: 'https://example.com/example.jpg'
661 * }
662 * }
663 * }))
664 * .then((asset) => asset.process())
665 * .then((asset) => console.log(asset))
666 * .catch(console.error)
667 * ```
668 */
669 createAssetWithId(id: string, data: CreateAssetProps): Promise<import("./entities/asset").Asset>;
670 /**
671 * Creates a Asset based on files. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
672 * @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.
673 * @param data.fields.file.[LOCALE].file - Can be a string, an ArrayBuffer or a Stream.
674 * @return Promise for the newly created Asset
675 * @example ```javascript
676 * const client = contentful.createClient({
677 * accessToken: '<content_management_api_key>'
678 * })
679 *
680 * client.getSpace('<space_id>')
681 * .then((space) => space.getEnvironment('<environment-id>'))
682 * .then((environment) => environment.createAssetFromFiles({
683 * fields: {
684 * file: {
685 * 'en-US': {
686 * contentType: 'image/jpeg',
687 * fileName: 'filename_english.jpg',
688 * file: createReadStream('path/to/filename_english.jpg')
689 * },
690 * 'de-DE': {
691 * contentType: 'image/svg+xml',
692 * fileName: 'filename_german.svg',
693 * file: '<svg><path fill="red" d="M50 50h150v50H50z"/></svg>'
694 * }
695 * }
696 * }
697 * }))
698 * .then((asset) => console.log(asset))
699 * .catch(console.error)
700 * ```
701 */
702 createAssetFromFiles(data: Omit<AssetFileProp, 'sys'>): Promise<import("./entities/asset").Asset>;
703 /**
704 * Creates an asset key for signing asset URLs (Embargoed Assets)
705 * @param data Object with request payload
706 * @param data.expiresAt number a UNIX timestamp in the future (but not more than 48 hours from time of calling)
707 * @return Promise for the newly created AssetKey
708 * @example ```javascript
709 * const client = contentful.createClient({
710 * accessToken: '<content_management_api_key>'
711 * })
712 *
713 * // Create assetKey
714 * now = () => Math.floor(Date.now() / 1000)
715 * const withExpiryIn1Hour = () => now() + 1 * 60 * 60
716 * client.getSpace('<space_id>')
717 * .then((space) => space.getEnvironment('<environment-id>'))
718 * .then((environment) => environment.createAssetKey({ expiresAt: withExpiryIn1Hour() }))
719 * .then((policy, secret) => console.log({ policy, secret }))
720 * .catch(console.error)
721 * ```
722 */
723 createAssetKey(payload: CreateAssetKeyProps): Promise<import("./entities/asset-key").AssetKey>;
724 /**
725 * Gets an Upload
726 * @param id - Upload ID
727 * @return Promise for an Upload
728 * @example ```javascript
729 * const client = contentful.createClient({
730 * accessToken: '<content_management_api_key>'
731 * })
732 * const uploadStream = createReadStream('path/to/filename_english.jpg')
733 *
734 * client.getSpace('<space_id>')
735 * .then((space) => space.getEnvironment('<environment-id>'))
736 * .then((environment) => environment.getUpload('<upload-id>')
737 * .then((upload) => console.log(upload))
738 * .catch(console.error)
739 */
740 getUpload(id: string): Promise<{
741 delete: () => Promise<void>;
742 } & import("./export-types").UploadProps & {
743 toPlainObject(): import("./export-types").UploadProps;
744 }>;
745 /**
746 * Creates a Upload.
747 * @param data - Object with file information.
748 * @param data.file - Actual file content. Can be a string, an ArrayBuffer or a Stream.
749 * @return Upload object containing information about the uploaded file.
750 * @example ```javascript
751 * const client = contentful.createClient({
752 * accessToken: '<content_management_api_key>'
753 * })
754 * const uploadStream = createReadStream('path/to/filename_english.jpg')
755 *
756 * client.getSpace('<space_id>')
757 * .then((space) => space.getEnvironment('<environment-id>'))
758 * .then((environment) => environment.createUpload({file: uploadStream})
759 * .then((upload) => console.log(upload))
760 * .catch(console.error)
761 * ```
762 */
763 createUpload: (data: {
764 file: string | ArrayBuffer | Stream;
765 }) => Promise<{
766 delete: () => Promise<void>;
767 } & import("./export-types").UploadProps & {
768 toPlainObject(): import("./export-types").UploadProps;
769 }>;
770 /**
771 * Gets a Locale
772 * @param localeId - Locale ID
773 * @return Promise for an Locale
774 * @example ```javascript
775 * const contentful = require('contentful-management')
776 *
777 * const client = contentful.createClient({
778 * accessToken: '<content_management_api_key>'
779 * })
780 *
781 * client.getSpace('<space_id>')
782 * .then((space) => space.getEnvironment('<environment-id>'))
783 * .then((environment) => environment.getLocale('<locale_id>'))
784 * .then((locale) => console.log(locale))
785 * .catch(console.error)
786 * ```
787 */
788 getLocale(localeId: string): Promise<import("./entities/locale").Locale>;
789 /**
790 * Gets a collection of Locales
791 * @return Promise for a collection of Locales
792 * @example ```javascript
793 * const contentful = require('contentful-management')
794 *
795 * const client = contentful.createClient({
796 * accessToken: '<content_management_api_key>'
797 * })
798 *
799 * client.getSpace('<space_id>')
800 * .then((space) => space.getEnvironment('<environment-id>'))
801 * .then((environment) => environment.getLocales())
802 * .then((response) => console.log(response.items))
803 * .catch(console.error)
804 * ```
805 */
806 getLocales(): Promise<import("./common-types").Collection<import("./entities/locale").Locale, import("./entities/locale").LocaleProps>>;
807 /**
808 * Creates a Locale
809 * @param data - Object representation of the Locale to be created
810 * @return Promise for the newly created Locale
811 * @example ```javascript
812 * const contentful = require('contentful-management')
813 *
814 * const client = contentful.createClient({
815 * accessToken: '<content_management_api_key>'
816 * })
817 *
818 * // Create locale
819 * client.getSpace('<space_id>')
820 * .then((space) => space.getEnvironment('<environment-id>'))
821 * .then((environment) => environment.createLocale({
822 * name: 'German (Austria)',
823 * code: 'de-AT',
824 * fallbackCode: 'de-DE',
825 * optional: true
826 * }))
827 * .then((locale) => console.log(locale))
828 * .catch(console.error)
829 * ```
830 */
831 createLocale(data: CreateLocaleProps): Promise<import("./entities/locale").Locale>;
832 /**
833 * Gets an UI Extension
834 * @param id - Extension ID
835 * @return Promise for an UI Extension
836 * @example ```javascript
837 * const contentful = require('contentful-management')
838 *
839 * const client = contentful.createClient({
840 * accessToken: '<content_management_api_key>'
841 * })
842 *
843 * client.getSpace('<space_id>')
844 * .then((space) => space.getEnvironment('<environment-id>'))
845 * .then((environment) => environment.getUiExtension('<extension-id>'))
846 * .then((extension) => console.log(extension))
847 * .catch(console.error)
848 * ```
849 */
850 getUiExtension(id: string): Promise<import("./entities/extension").Extension>;
851 /**
852 * Gets a collection of UI Extension
853 * @return Promise for a collection of UI Extensions
854 * @example ```javascript
855 * const contentful = require('contentful-management')
856 *
857 * const client = contentful.createClient({
858 * accessToken: '<content_management_api_key>'
859 * })
860 *
861 * client.getSpace('<space_id>')
862 * .then((space) => space.getEnvironment('<environment-id>'))
863 * .then((environment) => environment.getUiExtensions()
864 * .then((response) => console.log(response.items))
865 * .catch(console.error)
866 * ```
867 */
868 getUiExtensions(): Promise<import("./common-types").Collection<import("./entities/extension").Extension, import("./entities/extension").ExtensionProps>>;
869 /**
870 * Creates a UI Extension
871 * @param data - Object representation of the UI Extension to be created
872 * @return Promise for the newly created UI Extension
873 * @example ```javascript
874 * const contentful = require('contentful-management')
875 *
876 * const client = contentful.createClient({
877 * accessToken: '<content_management_api_key>'
878 * })
879 *
880 * client.getSpace('<space_id>')
881 * .then((space) => space.getEnvironment('<environment-id>'))
882 * .then((environment) => environment.createUiExtension({
883 * extension: {
884 * name: 'My awesome extension',
885 * src: 'https://example.com/my',
886 * fieldTypes: [
887 * {
888 * type: 'Symbol'
889 * },
890 * {
891 * type: 'Text'
892 * }
893 * ],
894 * sidebar: false
895 * }
896 * }))
897 * .then((extension) => console.log(extension))
898 * .catch(console.error)
899 * ```
900 */
901 createUiExtension(data: CreateExtensionProps): Promise<import("./entities/extension").Extension>;
902 /**
903 * Creates a UI Extension with a custom ID
904 * @param id - Extension ID
905 * @param data - Object representation of the UI Extension to be created
906 * @return Promise for the newly created UI Extension
907 * @example ```javascript
908 * const contentful = require('contentful-management')
909 *
910 * const client = contentful.createClient({
911 * accessToken: '<content_management_api_key>'
912 * })
913 *
914 * client.getSpace('<space_id>')
915 * .then((space) => space.getEnvironment('<environment-id>'))
916 * .then((environment) => environment.createUiExtensionWithId('<extension_id>', {
917 * extension: {
918 * name: 'My awesome extension',
919 * src: 'https://example.com/my',
920 * fieldTypes: [
921 * {
922 * type: 'Symbol'
923 * },
924 * {
925 * type: 'Text'
926 * }
927 * ],
928 * sidebar: false
929 * }
930 * }))
931 * .then((extension) => console.log(extension))
932 * .catch(console.error)
933 * ```
934 */
935 createUiExtensionWithId(id: string, data: CreateExtensionProps): Promise<import("./entities/extension").Extension>;
936 /**
937 * Creates an App Installation
938 * @param appDefinitionId - AppDefinition ID
939 * @param data - AppInstallation data
940 * @return Promise for an App Installation
941 * @example ```javascript
942 * const contentful = require('contentful-management')
943 *
944 * const client = contentful.createClient({
945 * accessToken: '<content_management_api_key>'
946 * })
947 *
948 * client.getSpace('<space_id>')
949 * .then((space) => space.getEnvironment('<environment-id>'))
950 * .then((environment) => environment.createAppInstallation('<app_definition_id>', {
951 * parameters: {
952 * someParameter: someValue
953 * }
954 * })
955 * .then((appInstallation) => console.log(appInstallation))
956 * .catch(console.error)
957 * ```
958 */
959 createAppInstallation(appDefinitionId: string, data: CreateAppInstallationProps): Promise<import("./entities/app-installation").AppInstallation>;
960 /**
961 * Gets an App Installation
962 * @param id - AppDefintion ID
963 * @return Promise for an App Installation
964 * @example ```javascript
965 * const contentful = require('contentful-management')
966 *
967 * const client = contentful.createClient({
968 * accessToken: '<content_management_api_key>'
969 * })
970 *
971 * client.getSpace('<space_id>')
972 * .then((space) => space.getEnvironment('<environment-id>'))
973 * .then((environment) => environment.getAppInstallation('<app-definition-id>'))
974 * .then((appInstallation) => console.log(appInstallation))
975 * .catch(console.error)
976 * ```
977 */
978 getAppInstallation(id: string): Promise<import("./entities/app-installation").AppInstallation>;
979 /**
980 * Gets a collection of App Installation
981 * @return Promise for a collection of App Installations
982 * @example ```javascript
983 * const contentful = require('contentful-management')
984 *
985 * const client = contentful.createClient({
986 * accessToken: '<content_management_api_key>'
987 * })
988 *
989 * client.getSpace('<space_id>')
990 * .then((space) => space.getEnvironment('<environment-id>'))
991 * .then((environment) => environment.getAppInstallations()
992 * .then((response) => console.log(response.items))
993 * .catch(console.error)
994 * ```
995 */
996 getAppInstallations(): Promise<import("./common-types").Collection<import("./entities/app-installation").AppInstallation, import("./entities/app-installation").AppInstallationProps>>;
997 /**
998 * Creates an app signed request
999 * @param appDefinitionId - AppDefinition ID
1000 * @param data - SignedRequest data
1001 * @return Promise for a Signed Request
1002 * @example ```javascript
1003 * const contentful = require('contentful-management')
1004 *
1005 * const client = contentful.createClient({
1006 * accessToken: '<content_management_api_key>'
1007 * })
1008 *
1009 * const data = {
1010 * method: 'POST',
1011 * path: '/request_path',
1012 * body: '{ "key": "data" }',
1013 * headers: {
1014 * 'x-my-header': 'some-value'
1015 * },
1016 * }
1017 *
1018 * client.getSpace('<space_id>')
1019 * .then((space) => space.getEnvironment('<environment-id>'))
1020 * .then((environment) => environment.createAppSignedRequest('<app_definition_id>', data)
1021 * .then((signedRequest) => console.log(signedRequest))
1022 * .catch(console.error)
1023 * ```
1024 */
1025 createAppSignedRequest(appDefinitionId: string, data: CreateAppSignedRequestProps): Promise<import("./entities/app-signed-request").AppSignedRequest>;
1026 /**
1027 * Gets all snapshots of an entry
1028 * @func getEntrySnapshots
1029 * @param entryId - Entry ID
1030 * @param query - query additional query paramaters
1031 * @return Promise for a collection of Entry Snapshots
1032 * @example ```javascript
1033 * const contentful = require('contentful-management')
1034 *
1035 * const client = contentful.createClient({
1036 * accessToken: '<content_management_api_key>'
1037 * })
1038 *
1039 * client.getSpace('<space_id>')
1040 * .then((space) => space.getEnvironment('<environment-id>'))
1041 * .then((environment) => environment.getEntrySnapshots('<entry_id>'))
1042 * .then((snapshots) => console.log(snapshots.items))
1043 * .catch(console.error)
1044 * ```
1045 */
1046 getEntrySnapshots(entryId: string, query?: QueryOptions): Promise<import("./common-types").Collection<import("./export-types").Snapshot<EntryProps<import("./common-types").KeyValueMap>>, import("./export-types").SnapshotProps<EntryProps<import("./common-types").KeyValueMap>>>>;
1047 /**
1048 * Gets all snapshots of a contentType
1049 * @func getContentTypeSnapshots
1050 * @param contentTypeId - Content Type ID
1051 * @param query - query additional query paramaters
1052 * @return Promise for a collection of Content Type Snapshots
1053 * @example ```javascript
1054 * const contentful = require('contentful-management')
1055 *
1056 * const client = contentful.createClient({
1057 * accessToken: '<content_management_api_key>'
1058 * })
1059 *
1060 * client.getSpace('<space_id>')
1061 * .then((space) => space.getEnvironment('<environment-id>'))
1062 * .then((environment) => environment.getContentTypeSnapshots('<contentTypeId>'))
1063 * .then((snapshots) => console.log(snapshots.items))
1064 * .catch(console.error)
1065 * ```
1066 */
1067 getContentTypeSnapshots(contentTypeId: string, query?: QueryOptions): Promise<import("./common-types").Collection<import("./export-types").Snapshot<ContentTypeProps>, import("./export-types").SnapshotProps<ContentTypeProps>>>;
1068 createTag(id: string, name: string, visibility?: TagVisibility | undefined): Promise<import("./entities/tag").Tag>;
1069 getTags(query?: BasicQueryOptions): Promise<import("./common-types").Collection<import("./entities/tag").Tag, import("./entities/tag").TagProps>>;
1070 getTag(id: string): Promise<import("./entities/tag").Tag>;
1071 /**
1072 * Retrieves a Release by ID
1073 * @param releaseId
1074 * @returns Promise containing a wrapped Release
1075 * @example ```javascript
1076 * const contentful = require('contentful-management')
1077 *
1078 * const client = contentful.createClient({
1079 * accessToken: '<content_management_api_key>'
1080 * })
1081 *
1082 * client.getSpace('<space_id>')
1083 * .then((space) => space.getEnvironment('<environment-id>'))
1084 * .then((environment) => environment.getRelease('<release_id>'))
1085 * .then((release) => console.log(release))
1086 * .catch(console.error)
1087 * ```
1088 */
1089 getRelease(releaseId: string): Promise<import("./entities/release").Release>;
1090 /**
1091 * Gets a Collection of Releases,
1092 * @param {ReleaseQueryOptions} query filtering options for the collection result
1093 * @returns Promise containing a wrapped Release Collection
1094 * @example ```javascript
1095 * const contentful = require('contentful-management')
1096 *
1097 * const client = contentful.createClient({
1098 * accessToken: '<content_management_api_key>'
1099 * })
1100 *
1101 * client.getSpace('<space_id>')
1102 * .then((space) => space.getEnvironment('<environment-id>'))
1103 * .then((environment) => environment.getReleases({ 'entities.sys.id[in]': '<asset_id>,<entry_id>' }))
1104 * .then((releases) => console.log(releases))
1105 * .catch(console.error)
1106 * ```
1107 */
1108 getReleases(query?: ReleaseQueryOptions | undefined): Promise<import("./common-types").CursorPaginatedCollection<import("./entities/release").Release, import("./entities/release").ReleaseProps>>;
1109 /**
1110 * Creates a new Release with the entities and title in the payload
1111 * @param payload Object containing the payload in order to create a Release
1112 * @returns Promise containing a wrapped Release, that has other helper methods within.
1113 * @example ```javascript
1114 * const contentful = require('contentful-management')
1115 *
1116 * const client = contentful.createClient({
1117 * accessToken: '<content_management_api_key>'
1118 * })
1119 *
1120 * const payload = {
1121 * title: 'My Release',
1122 * entities: {
1123 * sys: { type: 'Array' },
1124 * items: [
1125 * { sys: { linkType: 'Entry', type: 'Link', id: '<entry_id>' } }
1126 * ]
1127 * }
1128 * }
1129 *
1130 * client.getSpace('<space_id>')
1131 * .then((space) => space.getEnvironment('<environment-id>'))
1132 * .then((environment) => environment.createRelease(payload))
1133 * .then((release) => console.log(release))
1134 * .catch(console.error)
1135 * ```
1136 */
1137 createRelease(payload: ReleasePayload): Promise<import("./entities/release").Release>;
1138 /**
1139 * Updates a Release and replaces all the properties.
1140 * @param {object} options,
1141 * @param options.releaseId the ID of the release
1142 * @param options.payload the payload to be updated in the Release
1143 * @param options.version Release sys.version that to be updated
1144 * @returns Promise containing a wrapped Release, that has helper methods within.
1145 *
1146 * @example ```javascript
1147 * const contentful = require('contentful-management')
1148 *
1149 * const client = contentful.createClient({
1150 * accessToken: '<content_management_api_key>'
1151 * })
1152 *
1153 *
1154 * const payload = {
1155 * title: "Updated Release title",
1156 * entities: {
1157 * sys: { type: 'Array' },
1158 * items: [
1159 * { sys: { linkType: 'Entry', type: 'Link', id: '<entry_id>' } }
1160 * ]
1161 * }
1162 * }
1163 *
1164 * client.getSpace('<space_id>')
1165 * .then((space) => space.getEnvironment('<environment-id>'))
1166 * .then((environment) => environment.updateRelease({ releaseId: '<release_id>', version: 1, payload } ))
1167 * .then((release) => console.log(release))
1168 * .catch(console.error)
1169 * ```
1170 */
1171 updateRelease({ releaseId, payload, version, }: {
1172 releaseId: string;
1173 payload: ReleasePayload;
1174 version: number;
1175 }): Promise<import("./entities/release").Release>;
1176 /**
1177 * Deletes a Release by ID - does not delete any entities.
1178 * @param releaseId the ID of the release
1179 *
1180 * @returns Promise containing a wrapped Release, that has helper methods within.
1181 * @example ```javascript
1182 * const contentful = require('contentful-management')
1183 *
1184 * const client = contentful.createClient({
1185 * accessToken: '<content_management_api_key>'
1186 * })
1187 *
1188 * client.getSpace('<space_id>')
1189 * .then((space) => space.getEnvironment('<environment-id>'))
1190 * .then((environment) => environment.deleteRelease('<release_id>')
1191 * .catch(console.error)
1192 * ```
1193 */
1194 deleteRelease(releaseId: string): Promise<void>;
1195 /**
1196 * Publishes all Entities contained in a Release.
1197 * @param options.releaseId the ID of the release
1198 * @param options.version the version of the release that is to be published
1199 * @returns Promise containing a wrapped Release, that has helper methods within.
1200 *
1201 * @example ```javascript
1202 * const contentful = require('contentful-management')
1203 *
1204 * const client = contentful.createClient({
1205 * accessToken: '<content_management_api_key>'
1206 * })
1207 *
1208 * client.getSpace('<space_id>')
1209 * .then((space) => space.getEnvironment('<environment-id>'))
1210 * .then((environment) => environment.publishRelease({ releaseId: '<release_id>', version: 1 }))
1211 * .catch(console.error)
1212 * ```
1213 */
1214 publishRelease({ releaseId, version }: {
1215 releaseId: string;
1216 version: number;
1217 }): Promise<import("./entities/release-action").ReleaseAction<any>>;
1218 /**
1219 * Unpublishes all Entities contained in a Release.
1220 * @param options.releaseId the ID of the release
1221 * @param options.version the version of the release that is to be published
1222 * @returns Promise containing a wrapped Release, that has helper methods within.
1223 *
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.unpublishRelease({ releaseId: '<release_id>', version: 1 }))
1234 * .catch(console.error)
1235 * ```
1236 */
1237 unpublishRelease({ releaseId, version }: {
1238 releaseId: string;
1239 version: number;
1240 }): Promise<import("./entities/release-action").ReleaseAction<any>>;
1241 /**
1242 * Validates all Entities contained in a Release against an action (publish or unpublish)
1243 * @param options.releaseId the ID of the release
1244 * @param options.payload (optional) the type of action to be validated against
1245 *
1246 * @returns Promise containing a wrapped Release, that has helper methods within.
1247 *
1248 * @example ```javascript
1249 * const contentful = require('contentful-management')
1250 *
1251 * const client = contentful.createClient({
1252 * accessToken: '<content_management_api_key>'
1253 * })
1254 *
1255 * client.getSpace('<space_id>')
1256 * .then((space) => space.getEnvironment('<environment-id>'))
1257 * .then((environment) => environment.validateRelease({ releaseId: '<release_id>', payload: { action: 'unpublish' } }))
1258 * .catch(console.error)
1259 * ```
1260 */
1261 validateRelease({ releaseId, payload, }: {
1262 releaseId: string;
1263 payload?: ReleaseValidatePayload | undefined;
1264 }): Promise<import("./entities/release-action").ReleaseAction<any>>;
1265 /**
1266 * Retrieves a ReleaseAction by ID
1267 * @param params.releaseId The ID of a Release
1268 * @param params.actionId The ID of a Release Action
1269 * @returns Promise containing a wrapped ReleaseAction
1270 * @example ```javascript
1271 * const contentful = require('contentful-management')
1272 *
1273 * const client = contentful.createClient({
1274 * accessToken: '<content_management_api_key>'
1275 * })
1276 *
1277 * client.getSpace('<space_id>')
1278 * .then((space) => space.getEnvironment('<environment-id>'))
1279 * .then((environment) => environment.getReleaseAction({ releaseId: '<release_id>', actionId: '<action_id>' }))
1280 * .then((releaseAction) => console.log(releaseAction))
1281 * .catch(console.error)
1282 * ```
1283 */
1284 getReleaseAction({ actionId, releaseId }: {
1285 actionId: string;
1286 releaseId: string;
1287 }): Promise<import("./entities/release-action").ReleaseAction<any>>;
1288 /**
1289 * Gets a Collection of ReleaseActions
1290 * @param {string} params.releaseId ID of the Release to fetch the actions from
1291 * @param {ReleaseQueryOptions} params.query filtering options for the collection result
1292 * @returns Promise containing a wrapped ReleaseAction Collection
1293 *
1294 * @example ```javascript
1295 * const contentful = require('contentful-management')
1296 *
1297 * const client = contentful.createClient({
1298 * accessToken: '<content_management_api_key>'
1299 * })
1300 *
1301 * client.getSpace('<space_id>')
1302 * .then((space) => space.getEnvironment('<environment-id>'))
1303 * .then((environment) => environment.getReleaseActions({ releaseId: '<release_id>', query: { 'sys.id[in]': '<id_1>,<id_2>' } }))
1304 * .then((releaseActions) => console.log(releaseActions))
1305 * .catch(console.error)
1306 * ```
1307 */
1308 getReleaseActions({ releaseId, query, }: {
1309 releaseId: string;
1310 query?: ReleaseActionQueryOptions | undefined;
1311 }): Promise<import("./common-types").Collection<import("./entities/release-action").ReleaseAction<any>, import("./entities/release-action").ReleaseActionProps<any>>>;
1312};