1 | import type { Stream } from 'stream';
|
2 | import type { GetAppUploadParams, GetOrganizationParams } from '../../common-types';
|
3 | import type { AppUploadProps } from '../../entities/app-upload';
|
4 | import type { OptionalDefaults } from '../wrappers/wrap';
|
5 | export type AppUploadPlainClientAPI = {
|
6 | /**
|
7 | * Fetches the App Upload
|
8 | * @param params entity IDs to identify the App Upload
|
9 | * @returns the App Upload
|
10 | * @throws if the request fails, or the App Upload is not found
|
11 | * @example
|
12 | * ```javascript
|
13 | * const appUpload = await client.appUpload.get({
|
14 | * organizationId: '<organization_id>',
|
15 | * appUploadId: '<app_upload_id>',
|
16 | * });
|
17 | * ```
|
18 | */
|
19 | get(params: OptionalDefaults<GetAppUploadParams>): Promise<AppUploadProps>;
|
20 | /**
|
21 | * Deletes the App Upload
|
22 | * @param params entity IDs to identify the App Upload
|
23 | * @throws if the request fails, or the App Upload is not found
|
24 | * @example
|
25 | * ```javascript
|
26 | * await client.appUpload.delete({
|
27 | * organizationId: '<organization_id>',
|
28 | * appUploadId: '<app_upload_id>',
|
29 | * });
|
30 | * ```
|
31 | */
|
32 | delete(params: OptionalDefaults<GetAppUploadParams>): Promise<void>;
|
33 | /**
|
34 | * Creates an App Upload
|
35 | * @param params entity IDs to identify the Organization to upload the App to
|
36 | * @param payload the App Upload
|
37 | * @returns the App Upload
|
38 | * @throws if the request fails, or the Organization is not found
|
39 | * @example
|
40 | * ```javascript
|
41 | * const file = fs.readFileSync('<path_to_file>');
|
42 | * const appUpload = await client.appUpload.create(
|
43 | * {
|
44 | * organizationId: '<organization_id>',
|
45 | * },
|
46 | * {
|
47 | * file: new ArrayBuffer(file.length),
|
48 | * }
|
49 | * );
|
50 | * ```
|
51 | */
|
52 | create(params: OptionalDefaults<GetOrganizationParams>, payload: {
|
53 | file: string | ArrayBuffer | Stream;
|
54 | }): Promise<AppUploadProps>;
|
55 | };
|