UNPKG

2.14 kBTypeScriptView Raw
1import type { Stream } from 'stream';
2import type { OptionalDefaults } from '../wrappers/wrap';
3import type { GetSpaceEnvironmentParams, GetSpaceEnvironmentUploadParams } from '../../common-types';
4export type UploadPlainClientAPI = {
5 /** Fetches the Space Environment Upload
6 *
7 * @param params Upload Id, Space Id and Environment Id to identify the Space Environment Upload
8 * @returns the Space Environment Upload
9 * @throws if the request fails, or the Space Environment Upload is not found
10 * @example
11 * ```javascript
12 * const upload = await client.upload.get({
13 * spaceId: '<space_id>',
14 * environmentId: '<environment_id>',
15 * uploadId: '<upload_id>',
16 * });
17 * ```
18 */
19 get(params: OptionalDefaults<GetSpaceEnvironmentUploadParams>): Promise<any>;
20 /** Creates a Space Environment Upload
21 *
22 * @param params Space Id and Environment Id to identify the Space Environment
23 * @param data the Space Environment Upload
24 * @returns the Space Environment Upload
25 * @throws if the request fails, or the Space Environment is not found
26 * @example
27 * ```javascript
28 * const file = fs.readFileSync('<path_to_file>');
29 * const upload = await client.upload.create(
30 * {
31 * spaceId: '<space_id>',
32 * environmentId: '<environment_id>',
33 * },
34 * {
35 * file: new ArrayBuffer(file.length),
36 * }
37 * );
38 * ```
39 */
40 create(params: OptionalDefaults<GetSpaceEnvironmentParams>, data: {
41 file: string | ArrayBuffer | Stream;
42 }): Promise<any>;
43 /** Deletes the Space Environment Upload
44 *
45 * @param params Space Id, Environment Id and Upload Id to identify the Space Environment Upload
46 * @throws if the request fails, or the Space Environment Upload is not found
47 * @example
48 * ```javascript
49 * await client.upload.delete({
50 * spaceId: '<space_id>',
51 * environmentId: '<environment_id>',
52 * uploadId: '<upload_id>',
53 * });
54 * ```
55 */
56 delete(params: OptionalDefaults<GetSpaceEnvironmentUploadParams>): Promise<any>;
57};