@seamapi/http 1.2.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.
Files changed (35) hide show
  1. package/dist/connect.cjs +309 -0
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +67 -1
  4. package/lib/seam/connect/routes/acs-access-groups-unmanaged.d.ts +25 -0
  5. package/lib/seam/connect/routes/acs-access-groups-unmanaged.js +96 -0
  6. package/lib/seam/connect/routes/acs-access-groups-unmanaged.js.map +1 -0
  7. package/lib/seam/connect/routes/acs-access-groups.d.ts +2 -0
  8. package/lib/seam/connect/routes/acs-access-groups.js +4 -0
  9. package/lib/seam/connect/routes/acs-access-groups.js.map +1 -1
  10. package/lib/seam/connect/routes/acs-credentials-unmanaged.d.ts +25 -0
  11. package/lib/seam/connect/routes/acs-credentials-unmanaged.js +96 -0
  12. package/lib/seam/connect/routes/acs-credentials-unmanaged.js.map +1 -0
  13. package/lib/seam/connect/routes/acs-credentials.d.ts +2 -0
  14. package/lib/seam/connect/routes/acs-credentials.js +4 -0
  15. package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
  16. package/lib/seam/connect/routes/acs-users-unmanaged.d.ts +25 -0
  17. package/lib/seam/connect/routes/acs-users-unmanaged.js +96 -0
  18. package/lib/seam/connect/routes/acs-users-unmanaged.js.map +1 -0
  19. package/lib/seam/connect/routes/acs-users.d.ts +2 -0
  20. package/lib/seam/connect/routes/acs-users.js +4 -0
  21. package/lib/seam/connect/routes/acs-users.js.map +1 -1
  22. package/lib/seam/connect/routes/index.d.ts +3 -0
  23. package/lib/seam/connect/routes/index.js +3 -0
  24. package/lib/seam/connect/routes/index.js.map +1 -1
  25. package/lib/version.d.ts +1 -1
  26. package/lib/version.js +1 -1
  27. package/package.json +3 -3
  28. package/src/lib/seam/connect/routes/acs-access-groups-unmanaged.ts +202 -0
  29. package/src/lib/seam/connect/routes/acs-access-groups.ts +8 -0
  30. package/src/lib/seam/connect/routes/acs-credentials-unmanaged.ts +199 -0
  31. package/src/lib/seam/connect/routes/acs-credentials.ts +8 -0
  32. package/src/lib/seam/connect/routes/acs-users-unmanaged.ts +196 -0
  33. package/src/lib/seam/connect/routes/acs-users.ts +5 -0
  34. package/src/lib/seam/connect/routes/index.ts +3 -0
  35. 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",
@@ -1871,6 +2079,101 @@ var SeamHttpAcsSystems = class _SeamHttpAcsSystems {
1871
2079
  }
1872
2080
  };
1873
2081
 
2082
+ // src/lib/seam/connect/routes/acs-users-unmanaged.ts
2083
+ var SeamHttpAcsUsersUnmanaged = class _SeamHttpAcsUsersUnmanaged {
2084
+ constructor(apiKeyOrOptions = {}) {
2085
+ const options = parseOptions(apiKeyOrOptions);
2086
+ this.client = "client" in options ? options.client : createClient(options);
2087
+ this.defaults = limitToSeamHttpRequestOptions(options);
2088
+ }
2089
+ static fromClient(client, options = {}) {
2090
+ const constructorOptions = { ...options, client };
2091
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
2092
+ throw new SeamHttpInvalidOptionsError("Missing client");
2093
+ }
2094
+ return new _SeamHttpAcsUsersUnmanaged(constructorOptions);
2095
+ }
2096
+ static fromApiKey(apiKey, options = {}) {
2097
+ const constructorOptions = { ...options, apiKey };
2098
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
2099
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
2100
+ }
2101
+ return new _SeamHttpAcsUsersUnmanaged(constructorOptions);
2102
+ }
2103
+ static fromClientSessionToken(clientSessionToken, options = {}) {
2104
+ const constructorOptions = { ...options, clientSessionToken };
2105
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
2106
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
2107
+ }
2108
+ return new _SeamHttpAcsUsersUnmanaged(constructorOptions);
2109
+ }
2110
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
2111
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
2112
+ const clientOptions = parseOptions({ ...options, publishableKey });
2113
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
2114
+ throw new SeamHttpInvalidOptionsError(
2115
+ "The client option cannot be used with SeamHttp.fromPublishableKey"
2116
+ );
2117
+ }
2118
+ const client = createClient(clientOptions);
2119
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
2120
+ const { token } = await clientSessions.getOrCreate({
2121
+ user_identifier_key: userIdentifierKey
2122
+ });
2123
+ return _SeamHttpAcsUsersUnmanaged.fromClientSessionToken(token, options);
2124
+ }
2125
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
2126
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
2127
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
2128
+ throw new SeamHttpInvalidOptionsError(
2129
+ "Missing consoleSessionToken or workspaceId"
2130
+ );
2131
+ }
2132
+ return new _SeamHttpAcsUsersUnmanaged(constructorOptions);
2133
+ }
2134
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
2135
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
2136
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
2137
+ throw new SeamHttpInvalidOptionsError(
2138
+ "Missing personalAccessToken or workspaceId"
2139
+ );
2140
+ }
2141
+ return new _SeamHttpAcsUsersUnmanaged(constructorOptions);
2142
+ }
2143
+ async updateClientSessionToken(clientSessionToken) {
2144
+ const { headers } = this.client.defaults;
2145
+ const authHeaders = getAuthHeadersForClientSessionToken({
2146
+ clientSessionToken
2147
+ });
2148
+ for (const key of Object.keys(authHeaders)) {
2149
+ if (headers[key] == null) {
2150
+ throw new Error(
2151
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
2152
+ );
2153
+ }
2154
+ }
2155
+ this.client.defaults.headers = { ...headers, ...authHeaders };
2156
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
2157
+ await clientSessions.get();
2158
+ }
2159
+ get(body) {
2160
+ return new SeamHttpRequest(this, {
2161
+ path: "/acs/users/unmanaged/get",
2162
+ method: "post",
2163
+ body,
2164
+ responseKey: "acs_user"
2165
+ });
2166
+ }
2167
+ list(body) {
2168
+ return new SeamHttpRequest(this, {
2169
+ path: "/acs/users/unmanaged/list",
2170
+ method: "post",
2171
+ body,
2172
+ responseKey: "acs_users"
2173
+ });
2174
+ }
2175
+ };
2176
+
1874
2177
  // src/lib/seam/connect/routes/acs-users.ts
1875
2178
  var SeamHttpAcsUsers = class _SeamHttpAcsUsers {
1876
2179
  constructor(apiKeyOrOptions = {}) {
@@ -1948,6 +2251,9 @@ var SeamHttpAcsUsers = class _SeamHttpAcsUsers {
1948
2251
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
1949
2252
  await clientSessions.get();
1950
2253
  }
2254
+ get unmanaged() {
2255
+ return SeamHttpAcsUsersUnmanaged.fromClient(this.client, this.defaults);
2256
+ }
1951
2257
  addToAccessGroup(body) {
1952
2258
  return new SeamHttpRequest(this, {
1953
2259
  path: "/acs/users/add_to_access_group",
@@ -4565,12 +4871,15 @@ exports.SeamHttpAccessCodesSimulate = SeamHttpAccessCodesSimulate;
4565
4871
  exports.SeamHttpAccessCodesUnmanaged = SeamHttpAccessCodesUnmanaged;
4566
4872
  exports.SeamHttpAcs = SeamHttpAcs;
4567
4873
  exports.SeamHttpAcsAccessGroups = SeamHttpAcsAccessGroups;
4874
+ exports.SeamHttpAcsAccessGroupsUnmanaged = SeamHttpAcsAccessGroupsUnmanaged;
4568
4875
  exports.SeamHttpAcsCredentialPools = SeamHttpAcsCredentialPools;
4569
4876
  exports.SeamHttpAcsCredentialProvisioningAutomations = SeamHttpAcsCredentialProvisioningAutomations;
4570
4877
  exports.SeamHttpAcsCredentials = SeamHttpAcsCredentials;
4878
+ exports.SeamHttpAcsCredentialsUnmanaged = SeamHttpAcsCredentialsUnmanaged;
4571
4879
  exports.SeamHttpAcsEntrances = SeamHttpAcsEntrances;
4572
4880
  exports.SeamHttpAcsSystems = SeamHttpAcsSystems;
4573
4881
  exports.SeamHttpAcsUsers = SeamHttpAcsUsers;
4882
+ exports.SeamHttpAcsUsersUnmanaged = SeamHttpAcsUsersUnmanaged;
4574
4883
  exports.SeamHttpActionAttempts = SeamHttpActionAttempts;
4575
4884
  exports.SeamHttpApiError = SeamHttpApiError;
4576
4885
  exports.SeamHttpClientSessions = SeamHttpClientSessions;