UNPKG

2.14 kBTypeScriptView Raw
1import { Except } from 'type-fest';
2import { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types';
3declare type AppBundleSys = Except<BasicMetaSysProps, 'version'> & {
4 appDefinition: SysLink;
5 organization: SysLink;
6};
7export declare type AppBundleFile = {
8 name: string;
9 size: number;
10 md5: string;
11};
12export declare type CreateAppBundleProps = {
13 appUploadId: string;
14 comment?: string;
15};
16export declare type AppBundleProps = {
17 /**
18 * System metadata
19 */
20 sys: AppBundleSys;
21 /**
22 * List of all the files that are in this bundle
23 */
24 files: AppBundleFile[];
25 /**
26 * A comment that describes this bundle
27 */
28 comment?: string;
29};
30export interface AppBundle extends AppBundleProps, DefaultElements<AppBundleProps> {
31 /**
32 * Deletes this object on the server.
33 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
34 * @example ```javascript
35 * const contentful = require('contentful-management')
36 *
37 * const client = contentful.createClient({
38 * accessToken: '<content_management_api_key>'
39 * })
40 *
41 * client.getOrganization('<org_id>')
42 * .then((org) => org.getAppDefinition('<app_def_id>'))
43 * .then((appDefinition) => appDefinition.getAppBundle('<app-bundle-id>'))
44 * .then((appBundle) => appBundle.delete())
45 * .catch(console.error)
46 * ```
47 */
48 delete(): Promise<void>;
49}
50/**
51 * @private
52 * @param makeRequest - function to make requests via an adapter
53 * @param data - Raw App Bundle data
54 * @return Wrapped App Bundle data
55 */
56export declare function wrapAppBundle(makeRequest: MakeRequest, data: AppBundleProps): AppBundle;
57/**
58 * @private
59 * @param makeRequest - function to make requests via an adapter
60 * @param data - Raw App Bundle collection data
61 * @return Wrapped App Bundle collection data
62 */
63export declare const wrapAppBundleCollection: (makeRequest: MakeRequest, data: import("../common-types").CollectionProp<AppBundleProps>) => import("../common-types").Collection<AppBundle, AppBundleProps>;
64export {};