svix 2.4.0 → 2.5.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.
- package/dist/index.d.mts +108 -30
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +216 -113
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/autoconfigSubscription.ts +53 -0
- package/src/api_internal/autoconfigSubscription.ts +40 -0
- package/src/api_internal/{destinationAutoconfig.ts → autoconfigSubscriptionDestination.ts} +1 -1
- package/src/api_internal/{endpointAutoconfig.ts → autoconfigSubscriptionEndpoint.ts} +1 -24
- package/src/api_internal/endpoint.ts +0 -5
- package/src/autoconfig.ts +2 -1
- package/src/autoconfigConsumer.ts +4 -4
- package/src/index.ts +5 -0
- package/src/models/autoConfigOut.ts +26 -0
- package/src/models/eventBridgeConfigIn.ts +14 -2
- package/src/models/eventBridgeConfigOut.ts +7 -1
- package/src/models/eventBridgeConfigPatch.ts +6 -0
- package/src/models/index.ts +2 -0
- package/src/models/redshiftConfigIn.ts +14 -2
- package/src/models/redshiftConfigOut.ts +7 -1
- package/src/models/redshiftConfigPatch.ts +6 -0
- package/src/models/rotateSubscriptionIn2.ts +29 -0
- package/src/models/snsConfigIn.ts +14 -2
- package/src/models/snsConfigOut.ts +7 -1
- package/src/models/snsConfigPatch.ts +6 -0
- package/src/models/sqsConfigIn.ts +14 -2
- package/src/models/sqsConfigOut.ts +7 -1
- package/src/models/sqsConfigPatch.ts +6 -0
- package/src/request.ts +1 -1
- 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.
|
|
104
|
+
const LIB_VERSION = "2.5.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
|
}
|
|
@@ -1503,6 +1591,8 @@ const RedshiftConfigOutSerializer = {
|
|
|
1503
1591
|
_fromJsonObject(object) {
|
|
1504
1592
|
return {
|
|
1505
1593
|
accessKeyId: object["accessKeyId"],
|
|
1594
|
+
roleArn: object["roleArn"],
|
|
1595
|
+
externalId: object["externalId"],
|
|
1506
1596
|
region: object["region"],
|
|
1507
1597
|
clusterIdentifier: object["clusterIdentifier"],
|
|
1508
1598
|
dbUser: object["dbUser"],
|
|
@@ -1515,6 +1605,8 @@ const RedshiftConfigOutSerializer = {
|
|
|
1515
1605
|
_toJsonObject(self) {
|
|
1516
1606
|
return {
|
|
1517
1607
|
accessKeyId: self.accessKeyId,
|
|
1608
|
+
roleArn: self.roleArn,
|
|
1609
|
+
externalId: self.externalId,
|
|
1518
1610
|
region: self.region,
|
|
1519
1611
|
clusterIdentifier: self.clusterIdentifier,
|
|
1520
1612
|
dbUser: self.dbUser,
|
|
@@ -1594,14 +1686,18 @@ const SnsConfigOutSerializer = {
|
|
|
1594
1686
|
return {
|
|
1595
1687
|
topicArn: object["topicArn"],
|
|
1596
1688
|
region: object["region"],
|
|
1597
|
-
accessKeyId: object["accessKeyId"]
|
|
1689
|
+
accessKeyId: object["accessKeyId"],
|
|
1690
|
+
roleArn: object["roleArn"],
|
|
1691
|
+
externalId: object["externalId"]
|
|
1598
1692
|
};
|
|
1599
1693
|
},
|
|
1600
1694
|
_toJsonObject(self) {
|
|
1601
1695
|
return {
|
|
1602
1696
|
topicArn: self.topicArn,
|
|
1603
1697
|
region: self.region,
|
|
1604
|
-
accessKeyId: self.accessKeyId
|
|
1698
|
+
accessKeyId: self.accessKeyId,
|
|
1699
|
+
roleArn: self.roleArn,
|
|
1700
|
+
externalId: self.externalId
|
|
1605
1701
|
};
|
|
1606
1702
|
}
|
|
1607
1703
|
};
|
|
@@ -1613,6 +1709,8 @@ const SqsConfigOutSerializer = {
|
|
|
1613
1709
|
queueUrl: object["queueUrl"],
|
|
1614
1710
|
region: object["region"],
|
|
1615
1711
|
accessKeyId: object["accessKeyId"],
|
|
1712
|
+
roleArn: object["roleArn"],
|
|
1713
|
+
externalId: object["externalId"],
|
|
1616
1714
|
endpointUrl: object["endpointUrl"]
|
|
1617
1715
|
};
|
|
1618
1716
|
},
|
|
@@ -1621,6 +1719,8 @@ const SqsConfigOutSerializer = {
|
|
|
1621
1719
|
queueUrl: self.queueUrl,
|
|
1622
1720
|
region: self.region,
|
|
1623
1721
|
accessKeyId: self.accessKeyId,
|
|
1722
|
+
roleArn: self.roleArn,
|
|
1723
|
+
externalId: self.externalId,
|
|
1624
1724
|
endpointUrl: self.endpointUrl
|
|
1625
1725
|
};
|
|
1626
1726
|
}
|
|
@@ -1809,6 +1909,8 @@ const EventBridgeConfigPatchSerializer = {
|
|
|
1809
1909
|
detailType: object["detailType"],
|
|
1810
1910
|
accessKeyId: object["accessKeyId"],
|
|
1811
1911
|
secretAccessKey: object["secretAccessKey"],
|
|
1912
|
+
roleArn: object["roleArn"],
|
|
1913
|
+
externalId: object["externalId"],
|
|
1812
1914
|
region: object["region"]
|
|
1813
1915
|
};
|
|
1814
1916
|
},
|
|
@@ -1818,6 +1920,8 @@ const EventBridgeConfigPatchSerializer = {
|
|
|
1818
1920
|
detailType: self.detailType,
|
|
1819
1921
|
accessKeyId: self.accessKeyId,
|
|
1820
1922
|
secretAccessKey: self.secretAccessKey,
|
|
1923
|
+
roleArn: self.roleArn,
|
|
1924
|
+
externalId: self.externalId,
|
|
1821
1925
|
region: self.region
|
|
1822
1926
|
};
|
|
1823
1927
|
}
|
|
@@ -1909,6 +2013,8 @@ const RedshiftConfigPatchSerializer = {
|
|
|
1909
2013
|
return {
|
|
1910
2014
|
accessKeyId: object["accessKeyId"],
|
|
1911
2015
|
secretAccessKey: object["secretAccessKey"],
|
|
2016
|
+
roleArn: object["roleArn"],
|
|
2017
|
+
externalId: object["externalId"],
|
|
1912
2018
|
region: object["region"],
|
|
1913
2019
|
dbName: object["dbName"],
|
|
1914
2020
|
schemaName: object["schemaName"],
|
|
@@ -1919,6 +2025,8 @@ const RedshiftConfigPatchSerializer = {
|
|
|
1919
2025
|
return {
|
|
1920
2026
|
accessKeyId: self.accessKeyId,
|
|
1921
2027
|
secretAccessKey: self.secretAccessKey,
|
|
2028
|
+
roleArn: self.roleArn,
|
|
2029
|
+
externalId: self.externalId,
|
|
1922
2030
|
region: self.region,
|
|
1923
2031
|
dbName: self.dbName,
|
|
1924
2032
|
schemaName: self.schemaName,
|
|
@@ -1995,6 +2103,8 @@ const SnsConfigPatchSerializer = {
|
|
|
1995
2103
|
region: object["region"],
|
|
1996
2104
|
accessKeyId: object["accessKeyId"],
|
|
1997
2105
|
secretAccessKey: object["secretAccessKey"],
|
|
2106
|
+
roleArn: object["roleArn"],
|
|
2107
|
+
externalId: object["externalId"],
|
|
1998
2108
|
endpointUrl: object["endpointUrl"]
|
|
1999
2109
|
};
|
|
2000
2110
|
},
|
|
@@ -2004,6 +2114,8 @@ const SnsConfigPatchSerializer = {
|
|
|
2004
2114
|
region: self.region,
|
|
2005
2115
|
accessKeyId: self.accessKeyId,
|
|
2006
2116
|
secretAccessKey: self.secretAccessKey,
|
|
2117
|
+
roleArn: self.roleArn,
|
|
2118
|
+
externalId: self.externalId,
|
|
2007
2119
|
endpointUrl: self.endpointUrl
|
|
2008
2120
|
};
|
|
2009
2121
|
}
|
|
@@ -2017,6 +2129,8 @@ const SqsConfigPatchSerializer = {
|
|
|
2017
2129
|
region: object["region"],
|
|
2018
2130
|
accessKeyId: object["accessKeyId"],
|
|
2019
2131
|
secretAccessKey: object["secretAccessKey"],
|
|
2132
|
+
roleArn: object["roleArn"],
|
|
2133
|
+
externalId: object["externalId"],
|
|
2020
2134
|
endpointUrl: object["endpointUrl"]
|
|
2021
2135
|
};
|
|
2022
2136
|
},
|
|
@@ -2026,6 +2140,8 @@ const SqsConfigPatchSerializer = {
|
|
|
2026
2140
|
region: self.region,
|
|
2027
2141
|
accessKeyId: self.accessKeyId,
|
|
2028
2142
|
secretAccessKey: self.secretAccessKey,
|
|
2143
|
+
roleArn: self.roleArn,
|
|
2144
|
+
externalId: self.externalId,
|
|
2029
2145
|
endpointUrl: self.endpointUrl
|
|
2030
2146
|
};
|
|
2031
2147
|
}
|
|
@@ -2214,7 +2330,7 @@ var DestinationTransformation = class {
|
|
|
2214
2330
|
};
|
|
2215
2331
|
//#endregion
|
|
2216
2332
|
//#region src/api/destination.ts
|
|
2217
|
-
var Destination
|
|
2333
|
+
var Destination = class {
|
|
2218
2334
|
requestCtx;
|
|
2219
2335
|
constructor(requestCtx) {
|
|
2220
2336
|
this.requestCtx = requestCtx;
|
|
@@ -2485,22 +2601,6 @@ const EndpointSecretOutSerializer = {
|
|
|
2485
2601
|
}
|
|
2486
2602
|
};
|
|
2487
2603
|
//#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
2604
|
//#region src/models/endpointStats.ts
|
|
2505
2605
|
const EndpointStatsSerializer = {
|
|
2506
2606
|
_fromJsonObject(object) {
|
|
@@ -7112,6 +7212,93 @@ var SvixInternal = class {
|
|
|
7112
7212
|
}
|
|
7113
7213
|
};
|
|
7114
7214
|
//#endregion
|
|
7215
|
+
//#region src/models/status.ts
|
|
7216
|
+
const StatusSerializer = {
|
|
7217
|
+
_fromJsonObject(object) {
|
|
7218
|
+
return object;
|
|
7219
|
+
},
|
|
7220
|
+
_toJsonObject(self) {
|
|
7221
|
+
return self;
|
|
7222
|
+
}
|
|
7223
|
+
};
|
|
7224
|
+
//#endregion
|
|
7225
|
+
//#region src/models/autoConfigSubscriptionOut.ts
|
|
7226
|
+
const AutoConfigSubscriptionOutSerializer = {
|
|
7227
|
+
_fromJsonObject(object) {
|
|
7228
|
+
return {
|
|
7229
|
+
createdAt: new Date(object["createdAt"]),
|
|
7230
|
+
tokenCensored: object["tokenCensored"],
|
|
7231
|
+
id: object["id"],
|
|
7232
|
+
endpId: object["endpId"],
|
|
7233
|
+
destId: object["destId"],
|
|
7234
|
+
status: StatusSerializer._fromJsonObject(object["status"])
|
|
7235
|
+
};
|
|
7236
|
+
},
|
|
7237
|
+
_toJsonObject(self) {
|
|
7238
|
+
return {
|
|
7239
|
+
createdAt: self.createdAt,
|
|
7240
|
+
tokenCensored: self.tokenCensored,
|
|
7241
|
+
id: self.id,
|
|
7242
|
+
endpId: self.endpId,
|
|
7243
|
+
destId: self.destId,
|
|
7244
|
+
status: StatusSerializer._toJsonObject(self.status)
|
|
7245
|
+
};
|
|
7246
|
+
}
|
|
7247
|
+
};
|
|
7248
|
+
//#endregion
|
|
7249
|
+
//#region src/api_internal/autoconfigSubscriptionDestination.ts
|
|
7250
|
+
var AutoconfigSubscriptionDestination = class {
|
|
7251
|
+
requestCtx;
|
|
7252
|
+
constructor(requestCtx) {
|
|
7253
|
+
this.requestCtx = requestCtx;
|
|
7254
|
+
}
|
|
7255
|
+
/** Create or update the destination for an AutoConfig subscription. */
|
|
7256
|
+
async subscribe(appId, autoconfigId, destinationIn) {
|
|
7257
|
+
const request = new SvixRequest("PUT", "/api/v1/app/{app_id}/autoconfig/{autoconfig_id}/destination");
|
|
7258
|
+
request.setPathParam("app_id", appId);
|
|
7259
|
+
request.setPathParam("autoconfig_id", autoconfigId);
|
|
7260
|
+
request.setBody(DestinationInSerializer._toJsonObject(destinationIn));
|
|
7261
|
+
return await request.send(this.requestCtx, DestinationOutSerializer._fromJsonObject);
|
|
7262
|
+
}
|
|
7263
|
+
};
|
|
7264
|
+
//#endregion
|
|
7265
|
+
//#region src/api_internal/autoconfigSubscriptionEndpoint.ts
|
|
7266
|
+
var AutoconfigSubscriptionEndpoint = class {
|
|
7267
|
+
requestCtx;
|
|
7268
|
+
constructor(requestCtx) {
|
|
7269
|
+
this.requestCtx = requestCtx;
|
|
7270
|
+
}
|
|
7271
|
+
/** Create or update the HTTP endpoint for an AutoConfig subscription. */
|
|
7272
|
+
async subscribe(appId, autoconfigId, endpointIn) {
|
|
7273
|
+
const request = new SvixRequest("PUT", "/api/v1/app/{app_id}/autoconfig/{autoconfig_id}/endpoint");
|
|
7274
|
+
request.setPathParam("app_id", appId);
|
|
7275
|
+
request.setPathParam("autoconfig_id", autoconfigId);
|
|
7276
|
+
request.setBody(EndpointInSerializer._toJsonObject(endpointIn));
|
|
7277
|
+
return await request.send(this.requestCtx, EndpointOutSerializer._fromJsonObject);
|
|
7278
|
+
}
|
|
7279
|
+
};
|
|
7280
|
+
//#endregion
|
|
7281
|
+
//#region src/api_internal/autoconfigSubscription.ts
|
|
7282
|
+
var AutoconfigSubscription = class {
|
|
7283
|
+
requestCtx;
|
|
7284
|
+
constructor(requestCtx) {
|
|
7285
|
+
this.requestCtx = requestCtx;
|
|
7286
|
+
}
|
|
7287
|
+
get destination() {
|
|
7288
|
+
return new AutoconfigSubscriptionDestination(this.requestCtx);
|
|
7289
|
+
}
|
|
7290
|
+
get endpoint() {
|
|
7291
|
+
return new AutoconfigSubscriptionEndpoint(this.requestCtx);
|
|
7292
|
+
}
|
|
7293
|
+
/** Get an AutoConfig subscription, including the bound endpoint or destination if any. */
|
|
7294
|
+
async get(appId, autoconfigId) {
|
|
7295
|
+
const request = new SvixRequest("GET", "/api/v1/app/{app_id}/autoconfig/{autoconfig_id}");
|
|
7296
|
+
request.setPathParam("app_id", appId);
|
|
7297
|
+
request.setPathParam("autoconfig_id", autoconfigId);
|
|
7298
|
+
return await request.send(this.requestCtx, AutoConfigSubscriptionOutSerializer._fromJsonObject);
|
|
7299
|
+
}
|
|
7300
|
+
};
|
|
7301
|
+
//#endregion
|
|
7115
7302
|
//#region src/models/sinkInCommon.ts
|
|
7116
7303
|
const SinkInCommonSerializer = {
|
|
7117
7304
|
_fromJsonObject(object) {
|
|
@@ -7205,63 +7392,6 @@ var EndpointAutoConfigDeprecated = class {
|
|
|
7205
7392
|
}
|
|
7206
7393
|
};
|
|
7207
7394
|
//#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
7395
|
//#region src/api_internal/endpoint.ts
|
|
7266
7396
|
var Endpoint = class {
|
|
7267
7397
|
requestCtx;
|
|
@@ -7271,9 +7401,6 @@ var Endpoint = class {
|
|
|
7271
7401
|
get autoConfigDeprecated() {
|
|
7272
7402
|
return new EndpointAutoConfigDeprecated(this.requestCtx);
|
|
7273
7403
|
}
|
|
7274
|
-
get autoconfig() {
|
|
7275
|
-
return new EndpointAutoconfig(this.requestCtx);
|
|
7276
|
-
}
|
|
7277
7404
|
/**
|
|
7278
7405
|
* This operation was renamed to `set-transformation`.
|
|
7279
7406
|
*
|
|
@@ -7362,7 +7489,7 @@ var AutoConfig = class {
|
|
|
7362
7489
|
}
|
|
7363
7490
|
subscribe() {
|
|
7364
7491
|
const endpoint = new Endpoint(this.requestCtx);
|
|
7365
|
-
if (this.autoconfigId != null) return endpoint.
|
|
7492
|
+
if (this.autoconfigId != null) return new AutoconfigSubscription(this.requestCtx).endpoint.subscribe(this.appId, this.autoconfigId, this.endpointIn);
|
|
7366
7493
|
return endpoint.autoConfigDeprecated.update(this.appId, this.endpointId, { endpoint: this.endpointIn });
|
|
7367
7494
|
}
|
|
7368
7495
|
verify(payload, headers) {
|
|
@@ -7370,33 +7497,6 @@ var AutoConfig = class {
|
|
|
7370
7497
|
}
|
|
7371
7498
|
};
|
|
7372
7499
|
//#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
7500
|
//#region src/models/pollerV2CommitIn.ts
|
|
7401
7501
|
const PollerV2CommitInSerializer = {
|
|
7402
7502
|
_fromJsonObject(object) {
|
|
@@ -7505,7 +7605,7 @@ var AutoConfigConsumer = class {
|
|
|
7505
7605
|
async subscribe() {
|
|
7506
7606
|
const endpoint = new Endpoint(this.requestCtx);
|
|
7507
7607
|
if (this.autoconfigId != null) {
|
|
7508
|
-
const destination = await new
|
|
7608
|
+
const destination = await new AutoconfigSubscription(this.requestCtx).destination.subscribe(this.appId, this.autoconfigId, sinkInCommonToPollingDestination(this.sinkIn));
|
|
7509
7609
|
this.sinkId = destination.id;
|
|
7510
7610
|
return destination;
|
|
7511
7611
|
}
|
|
@@ -7516,7 +7616,7 @@ var AutoConfigConsumer = class {
|
|
|
7516
7616
|
}
|
|
7517
7617
|
async getSinkId() {
|
|
7518
7618
|
if (this.sinkId != null) return this.sinkId;
|
|
7519
|
-
const destId = (await new
|
|
7619
|
+
const destId = (await new AutoconfigSubscription(this.requestCtx).get(this.appId, this.autoconfigId)).destId;
|
|
7520
7620
|
if (destId == null) throw new Error("autoconfig subscription is pending. Have you called subscribe()?");
|
|
7521
7621
|
return destId;
|
|
7522
7622
|
}
|
|
@@ -7568,6 +7668,9 @@ var Svix = class {
|
|
|
7568
7668
|
get authentication() {
|
|
7569
7669
|
return new Authentication(this.requestCtx);
|
|
7570
7670
|
}
|
|
7671
|
+
get autoconfigSubscription() {
|
|
7672
|
+
return new AutoconfigSubscription$1(this.requestCtx);
|
|
7673
|
+
}
|
|
7571
7674
|
get backgroundTask() {
|
|
7572
7675
|
return new BackgroundTask(this.requestCtx);
|
|
7573
7676
|
}
|
|
@@ -7575,7 +7678,7 @@ var Svix = class {
|
|
|
7575
7678
|
return new Connector(this.requestCtx);
|
|
7576
7679
|
}
|
|
7577
7680
|
get destination() {
|
|
7578
|
-
return new Destination
|
|
7681
|
+
return new Destination(this.requestCtx);
|
|
7579
7682
|
}
|
|
7580
7683
|
get endpoint() {
|
|
7581
7684
|
return new Endpoint$1(this.requestCtx);
|