svix 2.6.0 → 2.6.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svix",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "Svix webhooks API client and webhook verification library",
5
5
  "author": "svix",
6
6
  "repository": "https://github.com/svix/svix-webhooks",
@@ -1,6 +1,10 @@
1
1
  // this file is @generated
2
2
 
3
3
  import { type AutoConfigOut, AutoConfigOutSerializer } from "../models/autoConfigOut";
4
+ import {
5
+ type CreateAutoConfigSubscriptionIn,
6
+ CreateAutoConfigSubscriptionInSerializer,
7
+ } from "../models/createAutoConfigSubscriptionIn";
4
8
  import {
5
9
  type RotateSubscriptionIn2,
6
10
  RotateSubscriptionIn2Serializer,
@@ -21,16 +25,35 @@ export class AutoconfigSubscription {
21
25
  /** Create an AutoConfig subscription. */
22
26
  public async create(
23
27
  appId: string,
28
+ createAutoConfigSubscriptionIn: CreateAutoConfigSubscriptionIn = {},
24
29
  options?: AutoconfigSubscriptionCreateOptions
25
30
  ): Promise<AutoConfigOut> {
26
31
  const request = new SvixRequest(HttpMethod.POST, "/api/v1/app/{app_id}/autoconfig");
27
32
 
28
33
  request.setPathParam("app_id", appId);
29
34
  request.setHeaderParam("idempotency-key", options?.idempotencyKey);
35
+ request.setBody(
36
+ CreateAutoConfigSubscriptionInSerializer._toJsonObject(
37
+ createAutoConfigSubscriptionIn
38
+ )
39
+ );
30
40
 
31
41
  return await request.send(this.requestCtx, AutoConfigOutSerializer._fromJsonObject);
32
42
  }
33
43
 
44
+ /** Delete an AutoConfig subscription. This also invalidates its auth token. */
45
+ public async delete(appId: string, autoconfigId: string): Promise<void> {
46
+ const request = new SvixRequest(
47
+ HttpMethod.DELETE,
48
+ "/api/v1/app/{app_id}/autoconfig/{autoconfig_id}"
49
+ );
50
+
51
+ request.setPathParam("app_id", appId);
52
+ request.setPathParam("autoconfig_id", autoconfigId);
53
+
54
+ return await request.sendNoResponseBody(this.requestCtx);
55
+ }
56
+
34
57
  /** Rotate the auth token and signing secret for an AutoConfig subscription. */
35
58
  public async rotate(
36
59
  appId: string,
@@ -5,6 +5,7 @@ export enum ConnectorKind {
5
5
  AgenticCommerceProtocol = "AgenticCommerceProtocol",
6
6
  CloseCrm = "CloseCRM",
7
7
  CustomerIo = "CustomerIO",
8
+ DatadogTracing = "DatadogTracing",
8
9
  Discord = "Discord",
9
10
  Hubspot = "Hubspot",
10
11
  Inngest = "Inngest",
@@ -0,0 +1,25 @@
1
+ // this file is @generated
2
+
3
+ export interface CreateAutoConfigSubscriptionIn {
4
+ /**
5
+ * The set of feature flags the created token will have access to.
6
+ *
7
+ * When omitted or empty, the token inherits the calling token's feature flags.
8
+ * When set, these flags are used instead. An application token may only grant a subset of its own flags.
9
+ */
10
+ featureFlags?: string[];
11
+ }
12
+
13
+ export const CreateAutoConfigSubscriptionInSerializer = {
14
+ _fromJsonObject(object: any): CreateAutoConfigSubscriptionIn {
15
+ return {
16
+ featureFlags: object["featureFlags"],
17
+ };
18
+ },
19
+
20
+ _toJsonObject(self: CreateAutoConfigSubscriptionIn): any {
21
+ return {
22
+ featureFlags: self.featureFlags,
23
+ };
24
+ },
25
+ };
@@ -39,6 +39,7 @@ export { type ConnectorOut } from "./connectorOut";
39
39
  export { type ConnectorPatch } from "./connectorPatch";
40
40
  export { ConnectorProduct } from "./connectorProduct";
41
41
  export { type ConnectorUpsertIn } from "./connectorUpsertIn";
42
+ export { type CreateAutoConfigSubscriptionIn } from "./createAutoConfigSubscriptionIn";
42
43
  export { type CreateStreamEventsIn } from "./createStreamEventsIn";
43
44
  export { type CreateStreamEventsOut } from "./createStreamEventsOut";
44
45
  export { type CronConfig } from "./cronConfig";
@@ -2,8 +2,20 @@
2
2
 
3
3
  /** Configuration for a RabbitMq sink. */
4
4
  export interface RabbitMqConfigIn {
5
+ /**
6
+ * URI to connect to
7
+ *
8
+ * Note that the VHost must be percent-escaped, so a default URI would look
9
+ * like `amqp://user:pass@host/%2F`
10
+ */
5
11
  uri: string;
12
+ /** Routing key for message dispatch */
6
13
  routingKey: string;
14
+ /**
15
+ * If true, then dispatches will fail if there is no attached queue; if false, they are
16
+ * silently dropped (this was previously the default)
17
+ */
18
+ mandatory?: boolean;
7
19
  }
8
20
 
9
21
  export const RabbitMqConfigInSerializer = {
@@ -11,6 +23,7 @@ export const RabbitMqConfigInSerializer = {
11
23
  return {
12
24
  uri: object["uri"],
13
25
  routingKey: object["routingKey"],
26
+ mandatory: object["mandatory"],
14
27
  };
15
28
  },
16
29
 
@@ -18,6 +31,7 @@ export const RabbitMqConfigInSerializer = {
18
31
  return {
19
32
  uri: self.uri,
20
33
  routingKey: self.routingKey,
34
+ mandatory: self.mandatory,
21
35
  };
22
36
  },
23
37
  };
@@ -3,6 +3,7 @@
3
3
  export interface RabbitMqConfigOut {
4
4
  uri: string;
5
5
  routingKey: string;
6
+ mandatory: boolean;
6
7
  }
7
8
 
8
9
  export const RabbitMqConfigOutSerializer = {
@@ -10,6 +11,7 @@ export const RabbitMqConfigOutSerializer = {
10
11
  return {
11
12
  uri: object["uri"],
12
13
  routingKey: object["routingKey"],
14
+ mandatory: object["mandatory"],
13
15
  };
14
16
  },
15
17
 
@@ -17,6 +19,7 @@ export const RabbitMqConfigOutSerializer = {
17
19
  return {
18
20
  uri: self.uri,
19
21
  routingKey: self.routingKey,
22
+ mandatory: self.mandatory,
20
23
  };
21
24
  },
22
25
  };
@@ -3,6 +3,7 @@
3
3
  export interface RabbitMqConfigPatch {
4
4
  routingKey?: string;
5
5
  uri?: string;
6
+ mandatory?: boolean;
6
7
  }
7
8
 
8
9
  export const RabbitMqConfigPatchSerializer = {
@@ -10,6 +11,7 @@ export const RabbitMqConfigPatchSerializer = {
10
11
  return {
11
12
  routingKey: object["routingKey"],
12
13
  uri: object["uri"],
14
+ mandatory: object["mandatory"],
13
15
  };
14
16
  },
15
17
 
@@ -17,6 +19,7 @@ export const RabbitMqConfigPatchSerializer = {
17
19
  return {
18
20
  routingKey: self.routingKey,
19
21
  uri: self.uri,
22
+ mandatory: self.mandatory,
20
23
  };
21
24
  },
22
25
  };
package/src/request.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ApiException, type XOR } from "./util";
2
2
  import type { HttpErrorOut, HTTPValidationError } from "./HttpErrors";
3
3
 
4
- export const LIB_VERSION = "2.6.0";
4
+ export const LIB_VERSION = "2.6.1";
5
5
 
6
6
  function getUserAgent() {
7
7
  var fields = [`svix-libs/${LIB_VERSION}/javascript`];