@seamapi/http 1.3.0 → 1.4.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/connect.cjs +210 -0
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +45 -1
- package/lib/seam/connect/routes/acs-access-groups-unmanaged.d.ts +25 -0
- package/lib/seam/connect/routes/acs-access-groups-unmanaged.js +96 -0
- package/lib/seam/connect/routes/acs-access-groups-unmanaged.js.map +1 -0
- package/lib/seam/connect/routes/acs-access-groups.d.ts +2 -0
- package/lib/seam/connect/routes/acs-access-groups.js +4 -0
- package/lib/seam/connect/routes/acs-access-groups.js.map +1 -1
- package/lib/seam/connect/routes/acs-credentials-unmanaged.d.ts +25 -0
- package/lib/seam/connect/routes/acs-credentials-unmanaged.js +96 -0
- package/lib/seam/connect/routes/acs-credentials-unmanaged.js.map +1 -0
- package/lib/seam/connect/routes/acs-credentials.d.ts +2 -0
- package/lib/seam/connect/routes/acs-credentials.js +4 -0
- package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
- package/lib/seam/connect/routes/index.d.ts +2 -0
- package/lib/seam/connect/routes/index.js +2 -0
- package/lib/seam/connect/routes/index.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/src/lib/seam/connect/routes/acs-access-groups-unmanaged.ts +202 -0
- package/src/lib/seam/connect/routes/acs-access-groups.ts +8 -0
- package/src/lib/seam/connect/routes/acs-credentials-unmanaged.ts +199 -0
- package/src/lib/seam/connect/routes/acs-credentials.ts +8 -0
- package/src/lib/seam/connect/routes/index.ts +2 -0
- package/src/lib/version.ts +1 -1
package/dist/connect.cjs
CHANGED
|
@@ -1210,6 +1210,104 @@ var SeamHttpAccessCodes = class _SeamHttpAccessCodes {
|
|
|
1210
1210
|
}
|
|
1211
1211
|
};
|
|
1212
1212
|
|
|
1213
|
+
// src/lib/seam/connect/routes/acs-access-groups-unmanaged.ts
|
|
1214
|
+
var SeamHttpAcsAccessGroupsUnmanaged = class _SeamHttpAcsAccessGroupsUnmanaged {
|
|
1215
|
+
constructor(apiKeyOrOptions = {}) {
|
|
1216
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
1217
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
1218
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
1219
|
+
}
|
|
1220
|
+
static fromClient(client, options = {}) {
|
|
1221
|
+
const constructorOptions = { ...options, client };
|
|
1222
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
1223
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
1224
|
+
}
|
|
1225
|
+
return new _SeamHttpAcsAccessGroupsUnmanaged(constructorOptions);
|
|
1226
|
+
}
|
|
1227
|
+
static fromApiKey(apiKey, options = {}) {
|
|
1228
|
+
const constructorOptions = { ...options, apiKey };
|
|
1229
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
1230
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
1231
|
+
}
|
|
1232
|
+
return new _SeamHttpAcsAccessGroupsUnmanaged(constructorOptions);
|
|
1233
|
+
}
|
|
1234
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
1235
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
1236
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
1237
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
1238
|
+
}
|
|
1239
|
+
return new _SeamHttpAcsAccessGroupsUnmanaged(constructorOptions);
|
|
1240
|
+
}
|
|
1241
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
1242
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
1243
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
1244
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
1245
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1246
|
+
"The client option cannot be used with SeamHttp.fromPublishableKey"
|
|
1247
|
+
);
|
|
1248
|
+
}
|
|
1249
|
+
const client = createClient(clientOptions);
|
|
1250
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
1251
|
+
const { token } = await clientSessions.getOrCreate({
|
|
1252
|
+
user_identifier_key: userIdentifierKey
|
|
1253
|
+
});
|
|
1254
|
+
return _SeamHttpAcsAccessGroupsUnmanaged.fromClientSessionToken(
|
|
1255
|
+
token,
|
|
1256
|
+
options
|
|
1257
|
+
);
|
|
1258
|
+
}
|
|
1259
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
1260
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
1261
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
1262
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1263
|
+
"Missing consoleSessionToken or workspaceId"
|
|
1264
|
+
);
|
|
1265
|
+
}
|
|
1266
|
+
return new _SeamHttpAcsAccessGroupsUnmanaged(constructorOptions);
|
|
1267
|
+
}
|
|
1268
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
1269
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
1270
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
1271
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1272
|
+
"Missing personalAccessToken or workspaceId"
|
|
1273
|
+
);
|
|
1274
|
+
}
|
|
1275
|
+
return new _SeamHttpAcsAccessGroupsUnmanaged(constructorOptions);
|
|
1276
|
+
}
|
|
1277
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
1278
|
+
const { headers } = this.client.defaults;
|
|
1279
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
1280
|
+
clientSessionToken
|
|
1281
|
+
});
|
|
1282
|
+
for (const key of Object.keys(authHeaders)) {
|
|
1283
|
+
if (headers[key] == null) {
|
|
1284
|
+
throw new Error(
|
|
1285
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
1286
|
+
);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
1290
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
1291
|
+
await clientSessions.get();
|
|
1292
|
+
}
|
|
1293
|
+
get(body) {
|
|
1294
|
+
return new SeamHttpRequest(this, {
|
|
1295
|
+
path: "/acs/access_groups/unmanaged/get",
|
|
1296
|
+
method: "post",
|
|
1297
|
+
body,
|
|
1298
|
+
responseKey: "acs_access_group"
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
list(body) {
|
|
1302
|
+
return new SeamHttpRequest(this, {
|
|
1303
|
+
path: "/acs/access_groups/unmanaged/list",
|
|
1304
|
+
method: "post",
|
|
1305
|
+
body,
|
|
1306
|
+
responseKey: "acs_access_groups"
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
|
|
1213
1311
|
// src/lib/seam/connect/routes/acs-access-groups.ts
|
|
1214
1312
|
var SeamHttpAcsAccessGroups = class _SeamHttpAcsAccessGroups {
|
|
1215
1313
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -1287,6 +1385,12 @@ var SeamHttpAcsAccessGroups = class _SeamHttpAcsAccessGroups {
|
|
|
1287
1385
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
1288
1386
|
await clientSessions.get();
|
|
1289
1387
|
}
|
|
1388
|
+
get unmanaged() {
|
|
1389
|
+
return SeamHttpAcsAccessGroupsUnmanaged.fromClient(
|
|
1390
|
+
this.client,
|
|
1391
|
+
this.defaults
|
|
1392
|
+
);
|
|
1393
|
+
}
|
|
1290
1394
|
addUser(body) {
|
|
1291
1395
|
return new SeamHttpRequest(this, {
|
|
1292
1396
|
path: "/acs/access_groups/add_user",
|
|
@@ -1514,6 +1618,104 @@ var SeamHttpAcsCredentialProvisioningAutomations = class _SeamHttpAcsCredentialP
|
|
|
1514
1618
|
}
|
|
1515
1619
|
};
|
|
1516
1620
|
|
|
1621
|
+
// src/lib/seam/connect/routes/acs-credentials-unmanaged.ts
|
|
1622
|
+
var SeamHttpAcsCredentialsUnmanaged = class _SeamHttpAcsCredentialsUnmanaged {
|
|
1623
|
+
constructor(apiKeyOrOptions = {}) {
|
|
1624
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
1625
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
1626
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
1627
|
+
}
|
|
1628
|
+
static fromClient(client, options = {}) {
|
|
1629
|
+
const constructorOptions = { ...options, client };
|
|
1630
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
1631
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
1632
|
+
}
|
|
1633
|
+
return new _SeamHttpAcsCredentialsUnmanaged(constructorOptions);
|
|
1634
|
+
}
|
|
1635
|
+
static fromApiKey(apiKey, options = {}) {
|
|
1636
|
+
const constructorOptions = { ...options, apiKey };
|
|
1637
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
1638
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
1639
|
+
}
|
|
1640
|
+
return new _SeamHttpAcsCredentialsUnmanaged(constructorOptions);
|
|
1641
|
+
}
|
|
1642
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
1643
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
1644
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
1645
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
1646
|
+
}
|
|
1647
|
+
return new _SeamHttpAcsCredentialsUnmanaged(constructorOptions);
|
|
1648
|
+
}
|
|
1649
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
1650
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
1651
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
1652
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
1653
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1654
|
+
"The client option cannot be used with SeamHttp.fromPublishableKey"
|
|
1655
|
+
);
|
|
1656
|
+
}
|
|
1657
|
+
const client = createClient(clientOptions);
|
|
1658
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
1659
|
+
const { token } = await clientSessions.getOrCreate({
|
|
1660
|
+
user_identifier_key: userIdentifierKey
|
|
1661
|
+
});
|
|
1662
|
+
return _SeamHttpAcsCredentialsUnmanaged.fromClientSessionToken(
|
|
1663
|
+
token,
|
|
1664
|
+
options
|
|
1665
|
+
);
|
|
1666
|
+
}
|
|
1667
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
1668
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
1669
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
1670
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1671
|
+
"Missing consoleSessionToken or workspaceId"
|
|
1672
|
+
);
|
|
1673
|
+
}
|
|
1674
|
+
return new _SeamHttpAcsCredentialsUnmanaged(constructorOptions);
|
|
1675
|
+
}
|
|
1676
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
1677
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
1678
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
1679
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1680
|
+
"Missing personalAccessToken or workspaceId"
|
|
1681
|
+
);
|
|
1682
|
+
}
|
|
1683
|
+
return new _SeamHttpAcsCredentialsUnmanaged(constructorOptions);
|
|
1684
|
+
}
|
|
1685
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
1686
|
+
const { headers } = this.client.defaults;
|
|
1687
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
1688
|
+
clientSessionToken
|
|
1689
|
+
});
|
|
1690
|
+
for (const key of Object.keys(authHeaders)) {
|
|
1691
|
+
if (headers[key] == null) {
|
|
1692
|
+
throw new Error(
|
|
1693
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
1694
|
+
);
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
1698
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
1699
|
+
await clientSessions.get();
|
|
1700
|
+
}
|
|
1701
|
+
get(body) {
|
|
1702
|
+
return new SeamHttpRequest(this, {
|
|
1703
|
+
path: "/acs/credentials/unmanaged/get",
|
|
1704
|
+
method: "post",
|
|
1705
|
+
body,
|
|
1706
|
+
responseKey: "acs_credential"
|
|
1707
|
+
});
|
|
1708
|
+
}
|
|
1709
|
+
list(body) {
|
|
1710
|
+
return new SeamHttpRequest(this, {
|
|
1711
|
+
path: "/acs/credentials/unmanaged/list",
|
|
1712
|
+
method: "post",
|
|
1713
|
+
body,
|
|
1714
|
+
responseKey: "acs_credentials"
|
|
1715
|
+
});
|
|
1716
|
+
}
|
|
1717
|
+
};
|
|
1718
|
+
|
|
1517
1719
|
// src/lib/seam/connect/routes/acs-credentials.ts
|
|
1518
1720
|
var SeamHttpAcsCredentials = class _SeamHttpAcsCredentials {
|
|
1519
1721
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -1591,6 +1793,12 @@ var SeamHttpAcsCredentials = class _SeamHttpAcsCredentials {
|
|
|
1591
1793
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
1592
1794
|
await clientSessions.get();
|
|
1593
1795
|
}
|
|
1796
|
+
get unmanaged() {
|
|
1797
|
+
return SeamHttpAcsCredentialsUnmanaged.fromClient(
|
|
1798
|
+
this.client,
|
|
1799
|
+
this.defaults
|
|
1800
|
+
);
|
|
1801
|
+
}
|
|
1594
1802
|
assign(body) {
|
|
1595
1803
|
return new SeamHttpRequest(this, {
|
|
1596
1804
|
path: "/acs/credentials/assign",
|
|
@@ -4663,9 +4871,11 @@ exports.SeamHttpAccessCodesSimulate = SeamHttpAccessCodesSimulate;
|
|
|
4663
4871
|
exports.SeamHttpAccessCodesUnmanaged = SeamHttpAccessCodesUnmanaged;
|
|
4664
4872
|
exports.SeamHttpAcs = SeamHttpAcs;
|
|
4665
4873
|
exports.SeamHttpAcsAccessGroups = SeamHttpAcsAccessGroups;
|
|
4874
|
+
exports.SeamHttpAcsAccessGroupsUnmanaged = SeamHttpAcsAccessGroupsUnmanaged;
|
|
4666
4875
|
exports.SeamHttpAcsCredentialPools = SeamHttpAcsCredentialPools;
|
|
4667
4876
|
exports.SeamHttpAcsCredentialProvisioningAutomations = SeamHttpAcsCredentialProvisioningAutomations;
|
|
4668
4877
|
exports.SeamHttpAcsCredentials = SeamHttpAcsCredentials;
|
|
4878
|
+
exports.SeamHttpAcsCredentialsUnmanaged = SeamHttpAcsCredentialsUnmanaged;
|
|
4669
4879
|
exports.SeamHttpAcsEntrances = SeamHttpAcsEntrances;
|
|
4670
4880
|
exports.SeamHttpAcsSystems = SeamHttpAcsSystems;
|
|
4671
4881
|
exports.SeamHttpAcsUsers = SeamHttpAcsUsers;
|