1 | import type { RawAxiosRequestHeaders } from 'axios';
|
2 | import type { CollectionProp, GetAppDefinitionParams, GetOrganizationParams, QueryParams } from '../../common-types';
|
3 | import type { AppDefinitionProps, AppInstallationsForOrganizationProps, CreateAppDefinitionProps } from '../../entities/app-definition';
|
4 | import type { OptionalDefaults } from '../wrappers/wrap';
|
5 | export type AppDefinitionPlainClientAPI = {
|
6 | /**
|
7 | * Fetch an App Definition
|
8 | * @param params entity IDs to identify the App Definition
|
9 | * @returns the App Definition config
|
10 | * @throws if the request fails, or the App Definition is not found
|
11 | * @example
|
12 | * ```javascript
|
13 | * const appDefinition = await client.appDefinition.get({
|
14 | * organizationId: '<organization_id>',
|
15 | * appDefinitionId: '<app_definition_id>',
|
16 | * });
|
17 | * ```
|
18 | */
|
19 | get(params: OptionalDefaults<GetOrganizationParams & {
|
20 | appDefinitionId: string;
|
21 | } & QueryParams>): Promise<AppDefinitionProps>;
|
22 | /**
|
23 | * Fetch all App Definitions for the given Organization
|
24 | * @param params entity IDs to identify the Organization from which to fetch App Definitions
|
25 | * @returns an object containing an array of App Definitions
|
26 | * @throws if the request fails, or the Organization is not found
|
27 | * @example
|
28 | * ```javascript
|
29 | * const results = await client.appDefinition.getMany({
|
30 | * organizationId: '<organization_id>',
|
31 | * });
|
32 | * ```
|
33 | */
|
34 | getMany(params: OptionalDefaults<GetOrganizationParams & QueryParams>): Promise<CollectionProp<AppDefinitionProps>>;
|
35 | /**
|
36 | * Create an App Definition
|
37 | * @param params entity IDs to identify the Organization where the App Definition will be created
|
38 | * @param rawData the new App Definition
|
39 | * @returns the new App Definition
|
40 | * @throws if the request fails, the Organization is not found, or the update payload is malformed
|
41 | * @example
|
42 | * ```javascript
|
43 | * const appDefinition = await client.appDefinition.create(
|
44 | * {
|
45 | * organizationId: '<organization_id>',
|
46 | * },
|
47 | * {
|
48 | * name: "Hello world!",
|
49 | * parameters: {},
|
50 | * src: "https://example.com/app.html",
|
51 | * locations: [
|
52 | * {
|
53 | * location: "entry-sidebar",
|
54 | * },
|
55 | * ],
|
56 | * }
|
57 | * );
|
58 | * ```
|
59 | */
|
60 | create(params: OptionalDefaults<GetOrganizationParams>, rawData: CreateAppDefinitionProps): Promise<AppDefinitionProps>;
|
61 | /**
|
62 | * Update an App Definition
|
63 | * @param params entity IDs to identify the App Definition
|
64 | * @param rawData the updated App Definition config
|
65 | * @returns the updated App Definition config
|
66 | * @throws if the request fails, the App Definition is not found, or the update payload is malformed
|
67 | * @example
|
68 | * ```javascript
|
69 | * const updatedAppDefinition = await client.appDefinition.update(
|
70 | * {
|
71 | * organizationId: '<organization_id>',
|
72 | * appDefinitionId: '<app_definition_id>',
|
73 | * },
|
74 | * {
|
75 | * ...currentAppDefinition,
|
76 | * name: "New App Definition name",
|
77 | * }
|
78 | * );
|
79 | * ```
|
80 | */
|
81 | update(params: OptionalDefaults<GetAppDefinitionParams>, rawData: AppDefinitionProps, headers?: RawAxiosRequestHeaders): Promise<AppDefinitionProps>;
|
82 | /**
|
83 | * Delete an App Definition
|
84 | * @param params entity IDs to identify the App Definition
|
85 | * @throws if the request fails, or the App Definition is not found
|
86 | * @example
|
87 | * ```javascript
|
88 | * await client.appDefinition.delete({
|
89 | * organizationId: '<organization_id>',
|
90 | * appDefinitionId: '<app_definition_id>',
|
91 | * });
|
92 | * ```
|
93 | */
|
94 | delete(params: OptionalDefaults<GetAppDefinitionParams>): Promise<any>;
|
95 | /**
|
96 | * @deprecated
|
97 | * Please use please use appInstallations.getForOrganization instead
|
98 | */
|
99 | getInstallationsForOrg(params: OptionalDefaults<GetAppDefinitionParams>): Promise<AppInstallationsForOrganizationProps>;
|
100 | };
|