contentful-management 11.48.2 → 11.48.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,7 +47,7 @@ function createClient(params, opts = {}) {
47
47
  const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
48
48
  const userAgent = getUserAgentHeader(
49
49
  // @ts-expect-error
50
- `${sdkMain}/${"11.48.2"}`, params.application, params.integration, params.feature);
50
+ `${sdkMain}/${"11.48.3"}`, params.application, params.integration, params.feature);
51
51
  const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, {
52
52
  userAgent
53
53
  }));
@@ -1,5 +1,5 @@
1
1
  import type { Except } from 'type-fest';
2
- import type { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types';
2
+ import type { BasicMetaSysProps, DefaultElements, Link, MakeRequest, SysLink } from '../common-types';
3
3
  type AppEventSubscriptionSys = Except<BasicMetaSysProps, 'version' | 'id'> & {
4
4
  appDefinition: SysLink;
5
5
  organization: SysLink;
@@ -10,9 +10,15 @@ export type AppEventSubscriptionProps = {
10
10
  */
11
11
  sys: AppEventSubscriptionSys;
12
12
  /** Subscription url that will receive events */
13
- targetUrl: string;
13
+ targetUrl?: string;
14
14
  /** List of topics to subscribe to */
15
15
  topics: string[];
16
+ /** Optional filter, transformation, or handler function */
17
+ functions?: {
18
+ filter?: Link<'Function'>;
19
+ transformation?: Link<'Function'>;
20
+ handler?: Link<'Function'>;
21
+ };
16
22
  };
17
23
  export type CreateAppEventSubscriptionProps = Except<AppEventSubscriptionProps, 'sys'>;
18
24
  export interface AppEventSubscription extends AppEventSubscriptionProps, DefaultElements<AppEventSubscriptionProps> {
@@ -10,6 +10,7 @@ export type AppEventSubscriptionPlainClientAPI = {
10
10
  * @throws if the request fails, the App or Event Subscription is not found, or the payload is malformed
11
11
  * @example
12
12
  * ```javascript
13
+ * // app event subscription that targets an endpoint url
13
14
  * const eventSubscription = await client.appEventSubscription.upsert({
14
15
  * organizationId: '<organization_id>',
15
16
  * appDefinitionId: '<app_definition_id>',
@@ -17,6 +18,30 @@ export type AppEventSubscriptionPlainClientAPI = {
17
18
  * targetUrl: `<target_url>`,
18
19
  * topics: ['<Topic>'],
19
20
  * })
21
+ *
22
+ * // app event subscription that targets a function and have a filter function
23
+ * const eventSubscription = await client.appEventSubscription.upsert({
24
+ * organizationId: '<organization_id>',
25
+ * appDefinitionId: '<app_definition_id>',
26
+ * }, {
27
+ * functions: {
28
+ * handler: {
29
+ * sys: {
30
+ * type: 'Link',
31
+ * linkType: 'Function',
32
+ * id: '<function_id>',
33
+ * },
34
+ * },
35
+ * filter: {
36
+ * sys: {
37
+ * type: 'Link',
38
+ * linkType: 'Function',
39
+ * id: '<function_id>',
40
+ * },
41
+ * },
42
+ * },
43
+ * topics: ['<Topic>'],
44
+ * })
20
45
  * ```
21
46
  */
22
47
  upsert(params: OptionalDefaults<GetAppDefinitionParams>, payload: CreateAppEventSubscriptionProps): Promise<AppEventSubscriptionProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentful-management",
3
- "version": "11.48.2",
3
+ "version": "11.48.3",
4
4
  "description": "Client for Contentful's Content Management API",
5
5
  "homepage": "https://www.contentful.com/developers/documentation/content-management-api/",
6
6
  "main": "./dist/contentful-management.node.js",