1 | import type { DefaultElements, MakeRequest, MetaSysProps, SysLink } from '../common-types';
|
2 | export type UploadProps = {
|
3 | /**
|
4 | * System metadata
|
5 | */
|
6 | sys: MetaSysProps & {
|
7 | space: SysLink;
|
8 | environment?: SysLink;
|
9 | };
|
10 | };
|
11 | export interface Upload extends UploadProps, DefaultElements<UploadProps> {
|
12 | /**
|
13 | * Deletes this object on the server.
|
14 | * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
15 | * @example
|
16 | * const contentful = require('contentful-management')
|
17 | *
|
18 | * const client = contentful.createClient({
|
19 | * accessToken: '<content_management_api_key>'
|
20 | * })
|
21 | *
|
22 | * client.getSpace('<space_id>')
|
23 | * .then((space) => space.getEnvironment('<environment_id>'))
|
24 | * .then((environment) => environment.getUpload('<upload_id>'))
|
25 | * .then((upload) => upload.delete())
|
26 | * .then((upload) => console.log(`upload ${upload.sys.id} updated.`))
|
27 | * .catch(console.error)
|
28 | */
|
29 | delete(): Promise<void>;
|
30 | }
|
31 | /**
|
32 | * @private
|
33 | * @param {function} makeRequest - function to make requests via an adapter
|
34 | * @param {object} data - Raw upload data
|
35 | * @return {Upload} Wrapped upload data
|
36 | */
|
37 | export declare function wrapUpload(makeRequest: MakeRequest, data: UploadProps): {
|
38 | delete: () => Promise<void>;
|
39 | } & UploadProps & {
|
40 | toPlainObject(): UploadProps;
|
41 | };
|