UNPKG

2.3 kBTypeScriptView Raw
1import type { GetAppDefinitionParams } from '../../common-types';
2import type { AppEventSubscriptionProps, CreateAppEventSubscriptionProps } from '../../entities/app-event-subscription';
3import type { OptionalDefaults } from '../wrappers/wrap';
4export type AppEventSubscriptionPlainClientAPI = {
5 /**
6 * Creates or updates an App Event Subscription
7 * @param params entity IDs to identify the App that the Event Subscription belongs to
8 * @param payload the new or updated Event Subscription
9 * @returns the App Event Subscription and its metadata
10 * @throws if the request fails, the App or Event Subscription is not found, or the payload is malformed
11 * @example
12 * ```javascript
13 * const eventSubscription = await client.appEventSubscription.upsert({
14 * organizationId: '<organization_id>',
15 * appDefinitionId: '<app_definition_id>',
16 * }, {
17 * targetUrl: `<target_url>`,
18 * topics: ['<Topic>'],
19 * })
20 * ```
21 */
22 upsert(params: OptionalDefaults<GetAppDefinitionParams>, payload: CreateAppEventSubscriptionProps): Promise<AppEventSubscriptionProps>;
23 /**
24 * Fetches the current App Event Subscription for the given App
25 * @param params entity IDs to identify the App that the Event Subscription belongs to
26 * @returns the App Event Subscription
27 * @throws if the request fails, or the App or the Event Subscription is not found
28 * @example
29 * ```javascript
30 * const eventSubscription = await client.appEventSubscription.get({
31 * organizationId: '<organization_id>',
32 * appDefinitionId: '<app_definition_id>',
33 * })
34 * ```
35 */
36 get(params: OptionalDefaults<GetAppDefinitionParams>): Promise<AppEventSubscriptionProps>;
37 /**
38 * Removes the current App Event Subscription for the given App
39 * @param params entity IDs to identify the App that the Event Subscription belongs to
40 * @throws if the request fails, or the App or the Event Subscription is not found
41 * @example
42 * ```javascript
43 * await client.appEventSubscription.delete({
44 * organizationId: '<organization_id>',
45 * appDefinitionId: '<app_definition_id>',
46 * })
47 * ```
48 */
49 delete(params: OptionalDefaults<GetAppDefinitionParams>): Promise<void>;
50};