UNPKG

2.56 kBTypeScriptView Raw
1import type { CollectionProp, GetAppBundleParams, GetAppDefinitionParams, QueryParams } from '../../common-types';
2import type { AppBundleProps, CreateAppBundleProps } from '../../entities/app-bundle';
3import type { OptionalDefaults } from '../wrappers/wrap';
4export type AppBundlePlainClientAPI = {
5 /**
6 * Fetches the App Bundle
7 * @param params entity IDs to identify the App Bundle
8 * @returns the App Bundle
9 * @throws if the request fails, or the App Bundle is not found
10 * @example
11 * ```javascript
12 * const appBundle = await client.appBundle.get({
13 * appDefinitionId: '<app_definition_id>',
14 * appBundleId: '<app_bundle_id>',
15 * });
16 * ```
17 */
18 get(params: OptionalDefaults<GetAppBundleParams>): Promise<AppBundleProps>;
19 /**
20 * Fetches all App Bundles for the given App
21 * @param params entity IDs to identify the App
22 * @returns an object containing an array of App Bundles
23 * @throws if the request fails, or the App is not found
24 * @example
25 * ```javascript
26 * const results = await client.appBundle.getMany({
27 * organizationId: '<organization_id>',
28 * appDefinitionId: '<app_definition_id>',
29 * });
30 * ```
31 */
32 getMany(params: OptionalDefaults<GetAppDefinitionParams & QueryParams>): Promise<CollectionProp<AppBundleProps>>;
33 /**
34 * Deletes the App Bundle
35 * @param params entity IDs to identify the App Bundle
36 * @throws if the request fails, or the App Bundle is not found
37 * @example
38 * ```javascript
39 * await client.appBundle.delete({
40 * appDefinitionId: '<app_definition_id>',
41 * appBundleId: '<app_bundle_id>',
42 * });
43 * ```
44 */
45 delete(params: OptionalDefaults<GetAppBundleParams>): Promise<void>;
46 /**
47 * Creates an App Bundle
48 * @param params entity IDs to scope where to create the App Bundle
49 * @param payload the App Bundle details
50 * @returns the created App Bundle and its metadata
51 * @throws if the request fails, the associated App is not found, or the payload is malformed
52 * @example
53 * ```javascript
54 * const appBundle = await client.appBundle.create(
55 * {
56 * appDefinitionId: '<app_definition_id>',
57 * appBundleId: '<app_bundle_id>',
58 * },
59 * {
60 * appUploadId: '<app_upload_id>',
61 * comment: 'a bundle comment',
62 * }
63 * );
64 * ```
65 */
66 create(params: OptionalDefaults<GetAppDefinitionParams>, payload: CreateAppBundleProps): Promise<AppBundleProps>;
67};