UNPKG

1.65 kBTypeScriptView Raw
1import type { Except } from 'type-fest';
2import type { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types';
3type AppDetailsSys = Except<BasicMetaSysProps, 'version' | 'id'> & {
4 appDefinition: SysLink;
5 organization: SysLink;
6};
7export type IconType = 'base64';
8export interface AppIcon {
9 value: string;
10 type: IconType;
11}
12export type AppDetailsProps = {
13 /**
14 * System metadata
15 */
16 sys: AppDetailsSys;
17 /**
18 * An Icon that represents the App
19 */
20 icon?: AppIcon;
21};
22export type CreateAppDetailsProps = {
23 /**
24 * An Icon that represents the App
25 */
26 icon?: AppIcon;
27};
28export interface AppDetails extends AppDetailsProps, DefaultElements<AppDetailsProps> {
29 /**
30 * Deletes this object on the server.
31 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
32 * @example ```javascript
33 * const contentful = require('contentful-management')
34 *
35 * const client = contentful.createClient({
36 * accessToken: '<content_management_api_key>'
37 * })
38 * client.getOrganization('<organization_id>')
39 * .then((organization) => organization.getAppDetails(<app-id>))
40 * .then((appDetails) => appDetails.delete())
41 * .then(() => console.log('appDetails deleted'))
42 * .catch(console.error)
43 * ```
44 */
45 delete(): Promise<void>;
46}
47/**
48 * @private
49 * @param http - HTTP client instance
50 * @param data - Raw AppDetails data
51 * @return Wrapped AppDetails data
52 */
53export declare function wrapAppDetails(makeRequest: MakeRequest, data: AppDetailsProps): AppDetails;
54export {};