svix 2.4.0 → 2.6.0

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.
Files changed (58) hide show
  1. package/dist/index.d.mts +245 -81
  2. package/dist/index.d.mts.map +1 -1
  3. package/dist/index.mjs +261 -119
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/src/api/autoconfigSubscription.ts +53 -0
  7. package/src/api/endpoint.ts +39 -0
  8. package/src/api/eventType.ts +4 -1
  9. package/src/api/message.ts +6 -3
  10. package/src/api/messageAttempt.ts +6 -3
  11. package/src/api_internal/autoconfigSubscription.ts +40 -0
  12. package/src/api_internal/{destinationAutoconfig.ts → autoconfigSubscriptionDestination.ts} +1 -1
  13. package/src/api_internal/{endpointAutoconfig.ts → autoconfigSubscriptionEndpoint.ts} +1 -24
  14. package/src/api_internal/endpoint.ts +0 -5
  15. package/src/autoconfig.ts +2 -1
  16. package/src/autoconfigConsumer.ts +4 -4
  17. package/src/index.ts +5 -0
  18. package/src/models/appPortalAccessIn.ts +4 -2
  19. package/src/models/appUsageStatsOut.ts +7 -7
  20. package/src/models/applicationTokenExpireIn.ts +2 -1
  21. package/src/models/autoConfigOut.ts +27 -0
  22. package/src/models/autoConfigSubscriptionOut.ts +1 -0
  23. package/src/models/azureBlobStorageConfigIn.ts +2 -1
  24. package/src/models/clickhouseConfigIn.ts +4 -2
  25. package/src/models/createStreamEventsIn.ts +2 -1
  26. package/src/models/destinationIn.ts +14 -5
  27. package/src/models/endpointAttemptStats.ts +25 -0
  28. package/src/models/endpointMessageOut.ts +4 -1
  29. package/src/models/endpointSecretRotateIn.ts +2 -1
  30. package/src/models/eventBridgeConfigIn.ts +16 -3
  31. package/src/models/eventBridgeConfigOut.ts +7 -1
  32. package/src/models/eventBridgeConfigPatch.ts +6 -0
  33. package/src/models/eventTypeImportOpenApiIn.ts +3 -1
  34. package/src/models/index.ts +3 -0
  35. package/src/models/ingestEndpointSecretIn.ts +2 -1
  36. package/src/models/ingestSourceConsumerPortalAccessIn.ts +2 -1
  37. package/src/models/messageIn.ts +12 -4
  38. package/src/models/operationalWebhookEndpointSecretIn.ts +2 -1
  39. package/src/models/postgresConfigIn.ts +7 -3
  40. package/src/models/rabbitMqConfigOut.ts +3 -0
  41. package/src/models/redshiftConfigIn.ts +18 -4
  42. package/src/models/redshiftConfigOut.ts +7 -1
  43. package/src/models/redshiftConfigPatch.ts +6 -0
  44. package/src/models/rotatePollerTokenIn.ts +2 -1
  45. package/src/models/rotateSubscriptionIn2.ts +29 -0
  46. package/src/models/s3ConfigIn.ts +2 -1
  47. package/src/models/snowflakeConfigIn.ts +8 -3
  48. package/src/models/snsConfigIn.ts +16 -3
  49. package/src/models/snsConfigOut.ts +7 -1
  50. package/src/models/snsConfigPatch.ts +6 -0
  51. package/src/models/sqsConfigIn.ts +16 -3
  52. package/src/models/sqsConfigOut.ts +7 -1
  53. package/src/models/sqsConfigPatch.ts +6 -0
  54. package/src/models/streamPortalAccessIn.ts +4 -2
  55. package/src/models/streamSinkIn.ts +6 -2
  56. package/src/models/streamTokenExpireIn.ts +2 -1
  57. package/src/request.ts +1 -1
  58. package/src/api_internal/destination.ts +0 -12
package/dist/index.mjs CHANGED
@@ -101,7 +101,7 @@ var ApiException = class extends Error {
101
101
  };
102
102
  //#endregion
103
103
  //#region src/request.ts
104
- const LIB_VERSION = "2.4.0";
104
+ const LIB_VERSION = "2.6.0";
105
105
  function getUserAgent() {
106
106
  var fields = [`svix-libs/${LIB_VERSION}/javascript`];
107
107
  if (typeof process !== "undefined") {
@@ -540,6 +540,74 @@ var Authentication = class {
540
540
  }
541
541
  };
542
542
  //#endregion
543
+ //#region src/models/autoConfigOut.ts
544
+ const AutoConfigOutSerializer = {
545
+ _fromJsonObject(object) {
546
+ return {
547
+ createdAt: new Date(object["createdAt"]),
548
+ token: object["token"],
549
+ id: object["id"]
550
+ };
551
+ },
552
+ _toJsonObject(self) {
553
+ return {
554
+ createdAt: self.createdAt,
555
+ token: self.token,
556
+ id: self.id
557
+ };
558
+ }
559
+ };
560
+ //#endregion
561
+ //#region src/models/endpointSecretRotateIn.ts
562
+ const EndpointSecretRotateInSerializer = {
563
+ _fromJsonObject(object) {
564
+ return {
565
+ key: object["key"],
566
+ gracePeriodSeconds: object["gracePeriodSeconds"]
567
+ };
568
+ },
569
+ _toJsonObject(self) {
570
+ return {
571
+ key: self.key,
572
+ gracePeriodSeconds: self.gracePeriodSeconds
573
+ };
574
+ }
575
+ };
576
+ //#endregion
577
+ //#region src/models/rotateSubscriptionIn2.ts
578
+ const RotateSubscriptionIn2Serializer = {
579
+ _fromJsonObject(object) {
580
+ return { signingSecret: object["signingSecret"] != null ? EndpointSecretRotateInSerializer._fromJsonObject(object["signingSecret"]) : void 0 };
581
+ },
582
+ _toJsonObject(self) {
583
+ return { signingSecret: self.signingSecret != null ? EndpointSecretRotateInSerializer._toJsonObject(self.signingSecret) : void 0 };
584
+ }
585
+ };
586
+ //#endregion
587
+ //#region src/api/autoconfigSubscription.ts
588
+ var AutoconfigSubscription$1 = class {
589
+ requestCtx;
590
+ constructor(requestCtx) {
591
+ this.requestCtx = requestCtx;
592
+ }
593
+ /** Create an AutoConfig subscription. */
594
+ async create(appId, options) {
595
+ const request = new SvixRequest("POST", "/api/v1/app/{app_id}/autoconfig");
596
+ request.setPathParam("app_id", appId);
597
+ request.setHeaderParam("idempotency-key", options?.idempotencyKey);
598
+ return await request.send(this.requestCtx, AutoConfigOutSerializer._fromJsonObject);
599
+ }
600
+ /** Rotate the auth token and signing secret for an AutoConfig subscription. */
601
+ async rotate(appId, autoconfigId, rotateSubscriptionIn2 = {}, options) {
602
+ const request = new SvixRequest("POST", "/api/v1/app/{app_id}/autoconfig/{autoconfig_id}/rotate");
603
+ request.setPathParam("app_id", appId);
604
+ request.setPathParam("autoconfig_id", autoconfigId);
605
+ request.setHeaderParam("idempotency-key", options?.idempotencyKey);
606
+ request.setBody(RotateSubscriptionIn2Serializer._toJsonObject(rotateSubscriptionIn2));
607
+ return await request.send(this.requestCtx, AutoConfigOutSerializer._fromJsonObject);
608
+ }
609
+ };
610
+ //#endregion
543
611
  //#region src/models/backgroundTaskStatus.ts
544
612
  let BackgroundTaskStatus = /* @__PURE__ */ function(BackgroundTaskStatus) {
545
613
  BackgroundTaskStatus["Running"] = "running";
@@ -976,6 +1044,8 @@ const EventBridgeConfigInSerializer = {
976
1044
  detailType: object["detailType"],
977
1045
  accessKeyId: object["accessKeyId"],
978
1046
  secretAccessKey: object["secretAccessKey"],
1047
+ roleArn: object["roleArn"],
1048
+ externalId: object["externalId"],
979
1049
  region: object["region"]
980
1050
  };
981
1051
  },
@@ -985,6 +1055,8 @@ const EventBridgeConfigInSerializer = {
985
1055
  detailType: self.detailType,
986
1056
  accessKeyId: self.accessKeyId,
987
1057
  secretAccessKey: self.secretAccessKey,
1058
+ roleArn: self.roleArn,
1059
+ externalId: self.externalId,
988
1060
  region: self.region
989
1061
  };
990
1062
  }
@@ -1100,6 +1172,8 @@ const RedshiftConfigInSerializer = {
1100
1172
  return {
1101
1173
  accessKeyId: object["accessKeyId"],
1102
1174
  secretAccessKey: object["secretAccessKey"],
1175
+ roleArn: object["roleArn"],
1176
+ externalId: object["externalId"],
1103
1177
  region: object["region"],
1104
1178
  clusterIdentifier: object["clusterIdentifier"],
1105
1179
  dbUser: object["dbUser"],
@@ -1113,6 +1187,8 @@ const RedshiftConfigInSerializer = {
1113
1187
  return {
1114
1188
  accessKeyId: self.accessKeyId,
1115
1189
  secretAccessKey: self.secretAccessKey,
1190
+ roleArn: self.roleArn,
1191
+ externalId: self.externalId,
1116
1192
  region: self.region,
1117
1193
  clusterIdentifier: self.clusterIdentifier,
1118
1194
  dbUser: self.dbUser,
@@ -1182,7 +1258,9 @@ const SnsConfigInSerializer = {
1182
1258
  region: object["region"],
1183
1259
  accessKeyId: object["accessKeyId"],
1184
1260
  secretAccessKey: object["secretAccessKey"],
1185
- endpointUrl: object["endpointUrl"]
1261
+ endpointUrl: object["endpointUrl"],
1262
+ roleArn: object["roleArn"],
1263
+ externalId: object["externalId"]
1186
1264
  };
1187
1265
  },
1188
1266
  _toJsonObject(self) {
@@ -1191,7 +1269,9 @@ const SnsConfigInSerializer = {
1191
1269
  region: self.region,
1192
1270
  accessKeyId: self.accessKeyId,
1193
1271
  secretAccessKey: self.secretAccessKey,
1194
- endpointUrl: self.endpointUrl
1272
+ endpointUrl: self.endpointUrl,
1273
+ roleArn: self.roleArn,
1274
+ externalId: self.externalId
1195
1275
  };
1196
1276
  }
1197
1277
  };
@@ -1204,6 +1284,8 @@ const SqsConfigInSerializer = {
1204
1284
  region: object["region"],
1205
1285
  accessKeyId: object["accessKeyId"],
1206
1286
  secretAccessKey: object["secretAccessKey"],
1287
+ roleArn: object["roleArn"],
1288
+ externalId: object["externalId"],
1207
1289
  endpointUrl: object["endpointUrl"]
1208
1290
  };
1209
1291
  },
@@ -1213,6 +1295,8 @@ const SqsConfigInSerializer = {
1213
1295
  region: self.region,
1214
1296
  accessKeyId: self.accessKeyId,
1215
1297
  secretAccessKey: self.secretAccessKey,
1298
+ roleArn: self.roleArn,
1299
+ externalId: self.externalId,
1216
1300
  endpointUrl: self.endpointUrl
1217
1301
  };
1218
1302
  }
@@ -1399,6 +1483,8 @@ const EventBridgeConfigOutSerializer = {
1399
1483
  eventBusName: object["eventBusName"],
1400
1484
  detailType: object["detailType"],
1401
1485
  accessKeyId: object["accessKeyId"],
1486
+ roleArn: object["roleArn"],
1487
+ externalId: object["externalId"],
1402
1488
  region: object["region"]
1403
1489
  };
1404
1490
  },
@@ -1407,6 +1493,8 @@ const EventBridgeConfigOutSerializer = {
1407
1493
  eventBusName: self.eventBusName,
1408
1494
  detailType: self.detailType,
1409
1495
  accessKeyId: self.accessKeyId,
1496
+ roleArn: self.roleArn,
1497
+ externalId: self.externalId,
1410
1498
  region: self.region
1411
1499
  };
1412
1500
  }
@@ -1491,10 +1579,16 @@ const PostgresConfigOutSerializer = {
1491
1579
  //#region src/models/rabbitMqConfigOut.ts
1492
1580
  const RabbitMqConfigOutSerializer = {
1493
1581
  _fromJsonObject(object) {
1494
- return { routingKey: object["routingKey"] };
1582
+ return {
1583
+ uri: object["uri"],
1584
+ routingKey: object["routingKey"]
1585
+ };
1495
1586
  },
1496
1587
  _toJsonObject(self) {
1497
- return { routingKey: self.routingKey };
1588
+ return {
1589
+ uri: self.uri,
1590
+ routingKey: self.routingKey
1591
+ };
1498
1592
  }
1499
1593
  };
1500
1594
  //#endregion
@@ -1503,6 +1597,8 @@ const RedshiftConfigOutSerializer = {
1503
1597
  _fromJsonObject(object) {
1504
1598
  return {
1505
1599
  accessKeyId: object["accessKeyId"],
1600
+ roleArn: object["roleArn"],
1601
+ externalId: object["externalId"],
1506
1602
  region: object["region"],
1507
1603
  clusterIdentifier: object["clusterIdentifier"],
1508
1604
  dbUser: object["dbUser"],
@@ -1515,6 +1611,8 @@ const RedshiftConfigOutSerializer = {
1515
1611
  _toJsonObject(self) {
1516
1612
  return {
1517
1613
  accessKeyId: self.accessKeyId,
1614
+ roleArn: self.roleArn,
1615
+ externalId: self.externalId,
1518
1616
  region: self.region,
1519
1617
  clusterIdentifier: self.clusterIdentifier,
1520
1618
  dbUser: self.dbUser,
@@ -1594,14 +1692,18 @@ const SnsConfigOutSerializer = {
1594
1692
  return {
1595
1693
  topicArn: object["topicArn"],
1596
1694
  region: object["region"],
1597
- accessKeyId: object["accessKeyId"]
1695
+ accessKeyId: object["accessKeyId"],
1696
+ roleArn: object["roleArn"],
1697
+ externalId: object["externalId"]
1598
1698
  };
1599
1699
  },
1600
1700
  _toJsonObject(self) {
1601
1701
  return {
1602
1702
  topicArn: self.topicArn,
1603
1703
  region: self.region,
1604
- accessKeyId: self.accessKeyId
1704
+ accessKeyId: self.accessKeyId,
1705
+ roleArn: self.roleArn,
1706
+ externalId: self.externalId
1605
1707
  };
1606
1708
  }
1607
1709
  };
@@ -1613,6 +1715,8 @@ const SqsConfigOutSerializer = {
1613
1715
  queueUrl: object["queueUrl"],
1614
1716
  region: object["region"],
1615
1717
  accessKeyId: object["accessKeyId"],
1718
+ roleArn: object["roleArn"],
1719
+ externalId: object["externalId"],
1616
1720
  endpointUrl: object["endpointUrl"]
1617
1721
  };
1618
1722
  },
@@ -1621,6 +1725,8 @@ const SqsConfigOutSerializer = {
1621
1725
  queueUrl: self.queueUrl,
1622
1726
  region: self.region,
1623
1727
  accessKeyId: self.accessKeyId,
1728
+ roleArn: self.roleArn,
1729
+ externalId: self.externalId,
1624
1730
  endpointUrl: self.endpointUrl
1625
1731
  };
1626
1732
  }
@@ -1809,6 +1915,8 @@ const EventBridgeConfigPatchSerializer = {
1809
1915
  detailType: object["detailType"],
1810
1916
  accessKeyId: object["accessKeyId"],
1811
1917
  secretAccessKey: object["secretAccessKey"],
1918
+ roleArn: object["roleArn"],
1919
+ externalId: object["externalId"],
1812
1920
  region: object["region"]
1813
1921
  };
1814
1922
  },
@@ -1818,6 +1926,8 @@ const EventBridgeConfigPatchSerializer = {
1818
1926
  detailType: self.detailType,
1819
1927
  accessKeyId: self.accessKeyId,
1820
1928
  secretAccessKey: self.secretAccessKey,
1929
+ roleArn: self.roleArn,
1930
+ externalId: self.externalId,
1821
1931
  region: self.region
1822
1932
  };
1823
1933
  }
@@ -1909,6 +2019,8 @@ const RedshiftConfigPatchSerializer = {
1909
2019
  return {
1910
2020
  accessKeyId: object["accessKeyId"],
1911
2021
  secretAccessKey: object["secretAccessKey"],
2022
+ roleArn: object["roleArn"],
2023
+ externalId: object["externalId"],
1912
2024
  region: object["region"],
1913
2025
  dbName: object["dbName"],
1914
2026
  schemaName: object["schemaName"],
@@ -1919,6 +2031,8 @@ const RedshiftConfigPatchSerializer = {
1919
2031
  return {
1920
2032
  accessKeyId: self.accessKeyId,
1921
2033
  secretAccessKey: self.secretAccessKey,
2034
+ roleArn: self.roleArn,
2035
+ externalId: self.externalId,
1922
2036
  region: self.region,
1923
2037
  dbName: self.dbName,
1924
2038
  schemaName: self.schemaName,
@@ -1995,6 +2109,8 @@ const SnsConfigPatchSerializer = {
1995
2109
  region: object["region"],
1996
2110
  accessKeyId: object["accessKeyId"],
1997
2111
  secretAccessKey: object["secretAccessKey"],
2112
+ roleArn: object["roleArn"],
2113
+ externalId: object["externalId"],
1998
2114
  endpointUrl: object["endpointUrl"]
1999
2115
  };
2000
2116
  },
@@ -2004,6 +2120,8 @@ const SnsConfigPatchSerializer = {
2004
2120
  region: self.region,
2005
2121
  accessKeyId: self.accessKeyId,
2006
2122
  secretAccessKey: self.secretAccessKey,
2123
+ roleArn: self.roleArn,
2124
+ externalId: self.externalId,
2007
2125
  endpointUrl: self.endpointUrl
2008
2126
  };
2009
2127
  }
@@ -2017,6 +2135,8 @@ const SqsConfigPatchSerializer = {
2017
2135
  region: object["region"],
2018
2136
  accessKeyId: object["accessKeyId"],
2019
2137
  secretAccessKey: object["secretAccessKey"],
2138
+ roleArn: object["roleArn"],
2139
+ externalId: object["externalId"],
2020
2140
  endpointUrl: object["endpointUrl"]
2021
2141
  };
2022
2142
  },
@@ -2026,6 +2146,8 @@ const SqsConfigPatchSerializer = {
2026
2146
  region: self.region,
2027
2147
  accessKeyId: self.accessKeyId,
2028
2148
  secretAccessKey: self.secretAccessKey,
2149
+ roleArn: self.roleArn,
2150
+ externalId: self.externalId,
2029
2151
  endpointUrl: self.endpointUrl
2030
2152
  };
2031
2153
  }
@@ -2214,7 +2336,7 @@ var DestinationTransformation = class {
2214
2336
  };
2215
2337
  //#endregion
2216
2338
  //#region src/api/destination.ts
2217
- var Destination$1 = class {
2339
+ var Destination = class {
2218
2340
  requestCtx;
2219
2341
  constructor(requestCtx) {
2220
2342
  this.requestCtx = requestCtx;
@@ -2355,6 +2477,24 @@ const BulkReplayInSerializer = {
2355
2477
  }
2356
2478
  };
2357
2479
  //#endregion
2480
+ //#region src/models/endpointAttemptStats.ts
2481
+ const EndpointAttemptStatsSerializer = {
2482
+ _fromJsonObject(object) {
2483
+ return {
2484
+ success: object["success"],
2485
+ fail: object["fail"],
2486
+ canceled: object["canceled"]
2487
+ };
2488
+ },
2489
+ _toJsonObject(self) {
2490
+ return {
2491
+ success: self.success,
2492
+ fail: self.fail,
2493
+ canceled: self.canceled
2494
+ };
2495
+ }
2496
+ };
2497
+ //#endregion
2358
2498
  //#region src/models/endpointHeadersIn.ts
2359
2499
  const EndpointHeadersInSerializer = {
2360
2500
  _fromJsonObject(object) {
@@ -2485,22 +2625,6 @@ const EndpointSecretOutSerializer = {
2485
2625
  }
2486
2626
  };
2487
2627
  //#endregion
2488
- //#region src/models/endpointSecretRotateIn.ts
2489
- const EndpointSecretRotateInSerializer = {
2490
- _fromJsonObject(object) {
2491
- return {
2492
- key: object["key"],
2493
- gracePeriodSeconds: object["gracePeriodSeconds"]
2494
- };
2495
- },
2496
- _toJsonObject(self) {
2497
- return {
2498
- key: self.key,
2499
- gracePeriodSeconds: self.gracePeriodSeconds
2500
- };
2501
- }
2502
- };
2503
- //#endregion
2504
2628
  //#region src/models/endpointStats.ts
2505
2629
  const EndpointStatsSerializer = {
2506
2630
  _fromJsonObject(object) {
@@ -2938,6 +3062,21 @@ var Endpoint$1 = class {
2938
3062
  return await request.send(this.requestCtx, EndpointStatsSerializer._fromJsonObject);
2939
3063
  }
2940
3064
  /**
3065
+ * Get basic statistics about attempted deliveries for the endpoint.
3066
+ *
3067
+ * Time windows are always rounded to hour granularity
3068
+ */
3069
+ async getAttemptStats(appId, endpointId, options) {
3070
+ const request = new SvixRequest("GET", "/api/v1/app/{app_id}/endpoint/{endpoint_id}/attempt-stats");
3071
+ request.setPathParam("app_id", appId);
3072
+ request.setPathParam("endpoint_id", endpointId);
3073
+ request.setQueryParams({
3074
+ since: options?.since,
3075
+ until: options?.until
3076
+ });
3077
+ return await request.send(this.requestCtx, EndpointAttemptStatsSerializer._fromJsonObject);
3078
+ }
3079
+ /**
2941
3080
  * Resend all failed messages since a given time.
2942
3081
  *
2943
3082
  * Messages that were sent successfully, even if failed initially, are not resent.
@@ -5942,20 +6081,20 @@ const AppUsageStatsInSerializer = {
5942
6081
  const AppUsageStatsOutSerializer = {
5943
6082
  _fromJsonObject(object) {
5944
6083
  return {
5945
- unresolvedAppIds: object["unresolvedAppIds"],
5946
6084
  id: object["id"],
5947
6085
  status: BackgroundTaskStatusSerializer._fromJsonObject(object["status"]),
5948
6086
  task: BackgroundTaskTypeSerializer._fromJsonObject(object["task"]),
5949
- updatedAt: new Date(object["updatedAt"])
6087
+ updatedAt: new Date(object["updatedAt"]),
6088
+ unresolvedAppIds: object["unresolvedAppIds"]
5950
6089
  };
5951
6090
  },
5952
6091
  _toJsonObject(self) {
5953
6092
  return {
5954
- unresolvedAppIds: self.unresolvedAppIds,
5955
6093
  id: self.id,
5956
6094
  status: BackgroundTaskStatusSerializer._toJsonObject(self.status),
5957
6095
  task: BackgroundTaskTypeSerializer._toJsonObject(self.task),
5958
- updatedAt: self.updatedAt
6096
+ updatedAt: self.updatedAt,
6097
+ unresolvedAppIds: self.unresolvedAppIds
5959
6098
  };
5960
6099
  }
5961
6100
  };
@@ -7112,6 +7251,93 @@ var SvixInternal = class {
7112
7251
  }
7113
7252
  };
7114
7253
  //#endregion
7254
+ //#region src/models/status.ts
7255
+ const StatusSerializer = {
7256
+ _fromJsonObject(object) {
7257
+ return object;
7258
+ },
7259
+ _toJsonObject(self) {
7260
+ return self;
7261
+ }
7262
+ };
7263
+ //#endregion
7264
+ //#region src/models/autoConfigSubscriptionOut.ts
7265
+ const AutoConfigSubscriptionOutSerializer = {
7266
+ _fromJsonObject(object) {
7267
+ return {
7268
+ createdAt: new Date(object["createdAt"]),
7269
+ tokenCensored: object["tokenCensored"],
7270
+ id: object["id"],
7271
+ endpId: object["endpId"],
7272
+ destId: object["destId"],
7273
+ status: StatusSerializer._fromJsonObject(object["status"])
7274
+ };
7275
+ },
7276
+ _toJsonObject(self) {
7277
+ return {
7278
+ createdAt: self.createdAt,
7279
+ tokenCensored: self.tokenCensored,
7280
+ id: self.id,
7281
+ endpId: self.endpId,
7282
+ destId: self.destId,
7283
+ status: StatusSerializer._toJsonObject(self.status)
7284
+ };
7285
+ }
7286
+ };
7287
+ //#endregion
7288
+ //#region src/api_internal/autoconfigSubscriptionDestination.ts
7289
+ var AutoconfigSubscriptionDestination = class {
7290
+ requestCtx;
7291
+ constructor(requestCtx) {
7292
+ this.requestCtx = requestCtx;
7293
+ }
7294
+ /** Create or update the destination for an AutoConfig subscription. */
7295
+ async subscribe(appId, autoconfigId, destinationIn) {
7296
+ const request = new SvixRequest("PUT", "/api/v1/app/{app_id}/autoconfig/{autoconfig_id}/destination");
7297
+ request.setPathParam("app_id", appId);
7298
+ request.setPathParam("autoconfig_id", autoconfigId);
7299
+ request.setBody(DestinationInSerializer._toJsonObject(destinationIn));
7300
+ return await request.send(this.requestCtx, DestinationOutSerializer._fromJsonObject);
7301
+ }
7302
+ };
7303
+ //#endregion
7304
+ //#region src/api_internal/autoconfigSubscriptionEndpoint.ts
7305
+ var AutoconfigSubscriptionEndpoint = class {
7306
+ requestCtx;
7307
+ constructor(requestCtx) {
7308
+ this.requestCtx = requestCtx;
7309
+ }
7310
+ /** Create or update the HTTP endpoint for an AutoConfig subscription. */
7311
+ async subscribe(appId, autoconfigId, endpointIn) {
7312
+ const request = new SvixRequest("PUT", "/api/v1/app/{app_id}/autoconfig/{autoconfig_id}/endpoint");
7313
+ request.setPathParam("app_id", appId);
7314
+ request.setPathParam("autoconfig_id", autoconfigId);
7315
+ request.setBody(EndpointInSerializer._toJsonObject(endpointIn));
7316
+ return await request.send(this.requestCtx, EndpointOutSerializer._fromJsonObject);
7317
+ }
7318
+ };
7319
+ //#endregion
7320
+ //#region src/api_internal/autoconfigSubscription.ts
7321
+ var AutoconfigSubscription = class {
7322
+ requestCtx;
7323
+ constructor(requestCtx) {
7324
+ this.requestCtx = requestCtx;
7325
+ }
7326
+ get destination() {
7327
+ return new AutoconfigSubscriptionDestination(this.requestCtx);
7328
+ }
7329
+ get endpoint() {
7330
+ return new AutoconfigSubscriptionEndpoint(this.requestCtx);
7331
+ }
7332
+ /** Get an AutoConfig subscription, including the bound endpoint or destination if any. */
7333
+ async get(appId, autoconfigId) {
7334
+ const request = new SvixRequest("GET", "/api/v1/app/{app_id}/autoconfig/{autoconfig_id}");
7335
+ request.setPathParam("app_id", appId);
7336
+ request.setPathParam("autoconfig_id", autoconfigId);
7337
+ return await request.send(this.requestCtx, AutoConfigSubscriptionOutSerializer._fromJsonObject);
7338
+ }
7339
+ };
7340
+ //#endregion
7115
7341
  //#region src/models/sinkInCommon.ts
7116
7342
  const SinkInCommonSerializer = {
7117
7343
  _fromJsonObject(object) {
@@ -7205,63 +7431,6 @@ var EndpointAutoConfigDeprecated = class {
7205
7431
  }
7206
7432
  };
7207
7433
  //#endregion
7208
- //#region src/models/status.ts
7209
- const StatusSerializer = {
7210
- _fromJsonObject(object) {
7211
- return object;
7212
- },
7213
- _toJsonObject(self) {
7214
- return self;
7215
- }
7216
- };
7217
- //#endregion
7218
- //#region src/models/autoConfigSubscriptionOut.ts
7219
- const AutoConfigSubscriptionOutSerializer = {
7220
- _fromJsonObject(object) {
7221
- return {
7222
- createdAt: new Date(object["createdAt"]),
7223
- tokenCensored: object["tokenCensored"],
7224
- id: object["id"],
7225
- endpId: object["endpId"],
7226
- destId: object["destId"],
7227
- status: StatusSerializer._fromJsonObject(object["status"])
7228
- };
7229
- },
7230
- _toJsonObject(self) {
7231
- return {
7232
- createdAt: self.createdAt,
7233
- tokenCensored: self.tokenCensored,
7234
- id: self.id,
7235
- endpId: self.endpId,
7236
- destId: self.destId,
7237
- status: StatusSerializer._toJsonObject(self.status)
7238
- };
7239
- }
7240
- };
7241
- //#endregion
7242
- //#region src/api_internal/endpointAutoconfig.ts
7243
- var EndpointAutoconfig = class {
7244
- requestCtx;
7245
- constructor(requestCtx) {
7246
- this.requestCtx = requestCtx;
7247
- }
7248
- /** Get an AutoConfig subscription, including the bound endpoint or destination if any. */
7249
- async get(appId, autoconfigId) {
7250
- const request = new SvixRequest("GET", "/api/v1/app/{app_id}/autoconfig/{autoconfig_id}");
7251
- request.setPathParam("app_id", appId);
7252
- request.setPathParam("autoconfig_id", autoconfigId);
7253
- return await request.send(this.requestCtx, AutoConfigSubscriptionOutSerializer._fromJsonObject);
7254
- }
7255
- /** Create or update the HTTP endpoint for an AutoConfig subscription. */
7256
- async subscribe(appId, autoconfigId, endpointIn) {
7257
- const request = new SvixRequest("PUT", "/api/v1/app/{app_id}/autoconfig/{autoconfig_id}/endpoint");
7258
- request.setPathParam("app_id", appId);
7259
- request.setPathParam("autoconfig_id", autoconfigId);
7260
- request.setBody(EndpointInSerializer._toJsonObject(endpointIn));
7261
- return await request.send(this.requestCtx, EndpointOutSerializer._fromJsonObject);
7262
- }
7263
- };
7264
- //#endregion
7265
7434
  //#region src/api_internal/endpoint.ts
7266
7435
  var Endpoint = class {
7267
7436
  requestCtx;
@@ -7271,9 +7440,6 @@ var Endpoint = class {
7271
7440
  get autoConfigDeprecated() {
7272
7441
  return new EndpointAutoConfigDeprecated(this.requestCtx);
7273
7442
  }
7274
- get autoconfig() {
7275
- return new EndpointAutoconfig(this.requestCtx);
7276
- }
7277
7443
  /**
7278
7444
  * This operation was renamed to `set-transformation`.
7279
7445
  *
@@ -7362,7 +7528,7 @@ var AutoConfig = class {
7362
7528
  }
7363
7529
  subscribe() {
7364
7530
  const endpoint = new Endpoint(this.requestCtx);
7365
- if (this.autoconfigId != null) return endpoint.autoconfig.subscribe(this.appId, this.autoconfigId, this.endpointIn);
7531
+ if (this.autoconfigId != null) return new AutoconfigSubscription(this.requestCtx).endpoint.subscribe(this.appId, this.autoconfigId, this.endpointIn);
7366
7532
  return endpoint.autoConfigDeprecated.update(this.appId, this.endpointId, { endpoint: this.endpointIn });
7367
7533
  }
7368
7534
  verify(payload, headers) {
@@ -7370,33 +7536,6 @@ var AutoConfig = class {
7370
7536
  }
7371
7537
  };
7372
7538
  //#endregion
7373
- //#region src/api_internal/destinationAutoconfig.ts
7374
- var DestinationAutoconfig = class {
7375
- requestCtx;
7376
- constructor(requestCtx) {
7377
- this.requestCtx = requestCtx;
7378
- }
7379
- /** Create or update the destination for an AutoConfig subscription. */
7380
- async subscribe(appId, autoconfigId, destinationIn) {
7381
- const request = new SvixRequest("PUT", "/api/v1/app/{app_id}/autoconfig/{autoconfig_id}/destination");
7382
- request.setPathParam("app_id", appId);
7383
- request.setPathParam("autoconfig_id", autoconfigId);
7384
- request.setBody(DestinationInSerializer._toJsonObject(destinationIn));
7385
- return await request.send(this.requestCtx, DestinationOutSerializer._fromJsonObject);
7386
- }
7387
- };
7388
- //#endregion
7389
- //#region src/api_internal/destination.ts
7390
- var Destination = class {
7391
- requestCtx;
7392
- constructor(requestCtx) {
7393
- this.requestCtx = requestCtx;
7394
- }
7395
- get autoconfig() {
7396
- return new DestinationAutoconfig(this.requestCtx);
7397
- }
7398
- };
7399
- //#endregion
7400
7539
  //#region src/models/pollerV2CommitIn.ts
7401
7540
  const PollerV2CommitInSerializer = {
7402
7541
  _fromJsonObject(object) {
@@ -7505,7 +7644,7 @@ var AutoConfigConsumer = class {
7505
7644
  async subscribe() {
7506
7645
  const endpoint = new Endpoint(this.requestCtx);
7507
7646
  if (this.autoconfigId != null) {
7508
- const destination = await new Destination(this.requestCtx).autoconfig.subscribe(this.appId, this.autoconfigId, sinkInCommonToPollingDestination(this.sinkIn));
7647
+ const destination = await new AutoconfigSubscription(this.requestCtx).destination.subscribe(this.appId, this.autoconfigId, sinkInCommonToPollingDestination(this.sinkIn));
7509
7648
  this.sinkId = destination.id;
7510
7649
  return destination;
7511
7650
  }
@@ -7516,7 +7655,7 @@ var AutoConfigConsumer = class {
7516
7655
  }
7517
7656
  async getSinkId() {
7518
7657
  if (this.sinkId != null) return this.sinkId;
7519
- const destId = (await new Endpoint(this.requestCtx).autoconfig.get(this.appId, this.autoconfigId)).destId;
7658
+ const destId = (await new AutoconfigSubscription(this.requestCtx).get(this.appId, this.autoconfigId)).destId;
7520
7659
  if (destId == null) throw new Error("autoconfig subscription is pending. Have you called subscribe()?");
7521
7660
  return destId;
7522
7661
  }
@@ -7568,6 +7707,9 @@ var Svix = class {
7568
7707
  get authentication() {
7569
7708
  return new Authentication(this.requestCtx);
7570
7709
  }
7710
+ get autoconfigSubscription() {
7711
+ return new AutoconfigSubscription$1(this.requestCtx);
7712
+ }
7571
7713
  get backgroundTask() {
7572
7714
  return new BackgroundTask(this.requestCtx);
7573
7715
  }
@@ -7575,7 +7717,7 @@ var Svix = class {
7575
7717
  return new Connector(this.requestCtx);
7576
7718
  }
7577
7719
  get destination() {
7578
- return new Destination$1(this.requestCtx);
7720
+ return new Destination(this.requestCtx);
7579
7721
  }
7580
7722
  get endpoint() {
7581
7723
  return new Endpoint$1(this.requestCtx);