@seamapi/http 0.9.3 → 0.10.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/README.md +5 -5
- package/dist/connect.cjs +241 -0
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +56 -1
- package/lib/seam/connect/routes/acs-credential-pools.d.ts +19 -0
- package/lib/seam/connect/routes/acs-credential-pools.js +73 -0
- package/lib/seam/connect/routes/acs-credential-pools.js.map +1 -0
- package/lib/seam/connect/routes/acs-credential-provisioning-automations.d.ts +19 -0
- package/lib/seam/connect/routes/acs-credential-provisioning-automations.js +73 -0
- package/lib/seam/connect/routes/acs-credential-provisioning-automations.js.map +1 -0
- package/lib/seam/connect/routes/acs-entrances.d.ts +23 -0
- package/lib/seam/connect/routes/acs-entrances.js +81 -0
- package/lib/seam/connect/routes/acs-entrances.js.map +1 -0
- package/lib/seam/connect/routes/acs.d.ts +6 -0
- package/lib/seam/connect/routes/acs.js +12 -0
- package/lib/seam/connect/routes/acs.js.map +1 -1
- package/lib/seam/connect/routes/index.d.ts +3 -0
- package/lib/seam/connect/routes/index.js +3 -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/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/seam/connect/routes/acs-credential-pools.ts +154 -0
- package/src/lib/seam/connect/routes/acs-credential-provisioning-automations.ts +162 -0
- package/src/lib/seam/connect/routes/acs-entrances.ts +173 -0
- package/src/lib/seam/connect/routes/acs.ts +18 -0
- package/src/lib/seam/connect/routes/index.ts +3 -0
- package/src/lib/version.ts +1 -1
package/README.md
CHANGED
|
@@ -56,19 +56,19 @@ Refer to the next section for keeping the types updated.
|
|
|
56
56
|
#### Keeping up with the latest types
|
|
57
57
|
|
|
58
58
|
This package depends on [@seamapi/types] for the latest TypeScript types.
|
|
59
|
-
New versions of this
|
|
59
|
+
New versions of this SDK are generally not released when new types are published.
|
|
60
60
|
Unless your project frequently runs a blanket `npm update`,
|
|
61
61
|
the types will become outdated with the Seam API over time.
|
|
62
|
-
Thus, users of this package should explicitly install the types
|
|
62
|
+
Thus, users of this package should explicitly install the types with
|
|
63
63
|
|
|
64
64
|
```
|
|
65
|
-
$ npm install @seamapi/types
|
|
65
|
+
$ npm install -D @seamapi/types
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
and update them when consuming new API features
|
|
68
|
+
and update them when consuming new API features with
|
|
69
69
|
|
|
70
70
|
```
|
|
71
|
-
$ npm install @seamapi/http@latest
|
|
71
|
+
$ npm install -D @seamapi/http@latest
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
## Usage
|
package/dist/connect.cjs
CHANGED
|
@@ -1097,6 +1097,153 @@ var SeamHttpAcsAccessGroups = class _SeamHttpAcsAccessGroups {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
};
|
|
1099
1099
|
|
|
1100
|
+
// src/lib/seam/connect/routes/acs-credential-pools.ts
|
|
1101
|
+
var SeamHttpAcsCredentialPools = class _SeamHttpAcsCredentialPools {
|
|
1102
|
+
constructor(apiKeyOrOptions = {}) {
|
|
1103
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
1104
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
1105
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
1106
|
+
}
|
|
1107
|
+
static fromClient(client, options = {}) {
|
|
1108
|
+
const constructorOptions = { ...options, client };
|
|
1109
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
1110
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
1111
|
+
}
|
|
1112
|
+
return new _SeamHttpAcsCredentialPools(constructorOptions);
|
|
1113
|
+
}
|
|
1114
|
+
static fromApiKey(apiKey, options = {}) {
|
|
1115
|
+
const constructorOptions = { ...options, apiKey };
|
|
1116
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
1117
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
1118
|
+
}
|
|
1119
|
+
return new _SeamHttpAcsCredentialPools(constructorOptions);
|
|
1120
|
+
}
|
|
1121
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
1122
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
1123
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
1124
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
1125
|
+
}
|
|
1126
|
+
return new _SeamHttpAcsCredentialPools(constructorOptions);
|
|
1127
|
+
}
|
|
1128
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
1129
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
1130
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
1131
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
1132
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1133
|
+
"The client option cannot be used with SeamHttp.fromPublishableKey"
|
|
1134
|
+
);
|
|
1135
|
+
}
|
|
1136
|
+
const client = createClient(clientOptions);
|
|
1137
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
1138
|
+
const { token } = await clientSessions.getOrCreate({
|
|
1139
|
+
user_identifier_key: userIdentifierKey
|
|
1140
|
+
});
|
|
1141
|
+
return _SeamHttpAcsCredentialPools.fromClientSessionToken(token, options);
|
|
1142
|
+
}
|
|
1143
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
1144
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
1145
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
1146
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1147
|
+
"Missing consoleSessionToken or workspaceId"
|
|
1148
|
+
);
|
|
1149
|
+
}
|
|
1150
|
+
return new _SeamHttpAcsCredentialPools(constructorOptions);
|
|
1151
|
+
}
|
|
1152
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
1153
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
1154
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
1155
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1156
|
+
"Missing personalAccessToken or workspaceId"
|
|
1157
|
+
);
|
|
1158
|
+
}
|
|
1159
|
+
return new _SeamHttpAcsCredentialPools(constructorOptions);
|
|
1160
|
+
}
|
|
1161
|
+
async list(body) {
|
|
1162
|
+
const { data } = await this.client.request({
|
|
1163
|
+
url: "/acs/credential_pools/list",
|
|
1164
|
+
method: "post",
|
|
1165
|
+
data: body
|
|
1166
|
+
});
|
|
1167
|
+
return data.acs_credential_pools;
|
|
1168
|
+
}
|
|
1169
|
+
};
|
|
1170
|
+
|
|
1171
|
+
// src/lib/seam/connect/routes/acs-credential-provisioning-automations.ts
|
|
1172
|
+
var SeamHttpAcsCredentialProvisioningAutomations = class _SeamHttpAcsCredentialProvisioningAutomations {
|
|
1173
|
+
constructor(apiKeyOrOptions = {}) {
|
|
1174
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
1175
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
1176
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
1177
|
+
}
|
|
1178
|
+
static fromClient(client, options = {}) {
|
|
1179
|
+
const constructorOptions = { ...options, client };
|
|
1180
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
1181
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
1182
|
+
}
|
|
1183
|
+
return new _SeamHttpAcsCredentialProvisioningAutomations(constructorOptions);
|
|
1184
|
+
}
|
|
1185
|
+
static fromApiKey(apiKey, options = {}) {
|
|
1186
|
+
const constructorOptions = { ...options, apiKey };
|
|
1187
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
1188
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
1189
|
+
}
|
|
1190
|
+
return new _SeamHttpAcsCredentialProvisioningAutomations(constructorOptions);
|
|
1191
|
+
}
|
|
1192
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
1193
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
1194
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
1195
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
1196
|
+
}
|
|
1197
|
+
return new _SeamHttpAcsCredentialProvisioningAutomations(constructorOptions);
|
|
1198
|
+
}
|
|
1199
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
1200
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
1201
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
1202
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
1203
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1204
|
+
"The client option cannot be used with SeamHttp.fromPublishableKey"
|
|
1205
|
+
);
|
|
1206
|
+
}
|
|
1207
|
+
const client = createClient(clientOptions);
|
|
1208
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
1209
|
+
const { token } = await clientSessions.getOrCreate({
|
|
1210
|
+
user_identifier_key: userIdentifierKey
|
|
1211
|
+
});
|
|
1212
|
+
return _SeamHttpAcsCredentialProvisioningAutomations.fromClientSessionToken(
|
|
1213
|
+
token,
|
|
1214
|
+
options
|
|
1215
|
+
);
|
|
1216
|
+
}
|
|
1217
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
1218
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
1219
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
1220
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1221
|
+
"Missing consoleSessionToken or workspaceId"
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
return new _SeamHttpAcsCredentialProvisioningAutomations(constructorOptions);
|
|
1225
|
+
}
|
|
1226
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
1227
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
1228
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
1229
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1230
|
+
"Missing personalAccessToken or workspaceId"
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
return new _SeamHttpAcsCredentialProvisioningAutomations(constructorOptions);
|
|
1234
|
+
}
|
|
1235
|
+
async launch(body) {
|
|
1236
|
+
const { data } = await this.client.request(
|
|
1237
|
+
{
|
|
1238
|
+
url: "/acs/credential_provisioning_automations/launch",
|
|
1239
|
+
method: "post",
|
|
1240
|
+
data: body
|
|
1241
|
+
}
|
|
1242
|
+
);
|
|
1243
|
+
return data.acs_credential_provisioning_automation;
|
|
1244
|
+
}
|
|
1245
|
+
};
|
|
1246
|
+
|
|
1100
1247
|
// src/lib/seam/connect/routes/acs-credentials.ts
|
|
1101
1248
|
var SeamHttpAcsCredentials = class _SeamHttpAcsCredentials {
|
|
1102
1249
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -1215,6 +1362,85 @@ var SeamHttpAcsCredentials = class _SeamHttpAcsCredentials {
|
|
|
1215
1362
|
}
|
|
1216
1363
|
};
|
|
1217
1364
|
|
|
1365
|
+
// src/lib/seam/connect/routes/acs-entrances.ts
|
|
1366
|
+
var SeamHttpAcsEntrances = class _SeamHttpAcsEntrances {
|
|
1367
|
+
constructor(apiKeyOrOptions = {}) {
|
|
1368
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
1369
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
1370
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
1371
|
+
}
|
|
1372
|
+
static fromClient(client, options = {}) {
|
|
1373
|
+
const constructorOptions = { ...options, client };
|
|
1374
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
1375
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
1376
|
+
}
|
|
1377
|
+
return new _SeamHttpAcsEntrances(constructorOptions);
|
|
1378
|
+
}
|
|
1379
|
+
static fromApiKey(apiKey, options = {}) {
|
|
1380
|
+
const constructorOptions = { ...options, apiKey };
|
|
1381
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
1382
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
1383
|
+
}
|
|
1384
|
+
return new _SeamHttpAcsEntrances(constructorOptions);
|
|
1385
|
+
}
|
|
1386
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
1387
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
1388
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
1389
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
1390
|
+
}
|
|
1391
|
+
return new _SeamHttpAcsEntrances(constructorOptions);
|
|
1392
|
+
}
|
|
1393
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
1394
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
1395
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
1396
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
1397
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1398
|
+
"The client option cannot be used with SeamHttp.fromPublishableKey"
|
|
1399
|
+
);
|
|
1400
|
+
}
|
|
1401
|
+
const client = createClient(clientOptions);
|
|
1402
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
1403
|
+
const { token } = await clientSessions.getOrCreate({
|
|
1404
|
+
user_identifier_key: userIdentifierKey
|
|
1405
|
+
});
|
|
1406
|
+
return _SeamHttpAcsEntrances.fromClientSessionToken(token, options);
|
|
1407
|
+
}
|
|
1408
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
1409
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
1410
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
1411
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1412
|
+
"Missing consoleSessionToken or workspaceId"
|
|
1413
|
+
);
|
|
1414
|
+
}
|
|
1415
|
+
return new _SeamHttpAcsEntrances(constructorOptions);
|
|
1416
|
+
}
|
|
1417
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
1418
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
1419
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
1420
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1421
|
+
"Missing personalAccessToken or workspaceId"
|
|
1422
|
+
);
|
|
1423
|
+
}
|
|
1424
|
+
return new _SeamHttpAcsEntrances(constructorOptions);
|
|
1425
|
+
}
|
|
1426
|
+
async get(body) {
|
|
1427
|
+
const { data } = await this.client.request({
|
|
1428
|
+
url: "/acs/entrances/get",
|
|
1429
|
+
method: "post",
|
|
1430
|
+
data: body
|
|
1431
|
+
});
|
|
1432
|
+
return data.acs_entrance;
|
|
1433
|
+
}
|
|
1434
|
+
async list(body) {
|
|
1435
|
+
const { data } = await this.client.request({
|
|
1436
|
+
url: "/acs/entrances/list",
|
|
1437
|
+
method: "post",
|
|
1438
|
+
data: body
|
|
1439
|
+
});
|
|
1440
|
+
return data.acs_entrances;
|
|
1441
|
+
}
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1218
1444
|
// src/lib/seam/connect/routes/acs-systems.ts
|
|
1219
1445
|
var SeamHttpAcsSystems = class _SeamHttpAcsSystems {
|
|
1220
1446
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -1487,9 +1713,21 @@ var SeamHttpAcs = class _SeamHttpAcs {
|
|
|
1487
1713
|
get accessGroups() {
|
|
1488
1714
|
return SeamHttpAcsAccessGroups.fromClient(this.client, this.defaults);
|
|
1489
1715
|
}
|
|
1716
|
+
get credentialPools() {
|
|
1717
|
+
return SeamHttpAcsCredentialPools.fromClient(this.client, this.defaults);
|
|
1718
|
+
}
|
|
1719
|
+
get credentialProvisioningAutomations() {
|
|
1720
|
+
return SeamHttpAcsCredentialProvisioningAutomations.fromClient(
|
|
1721
|
+
this.client,
|
|
1722
|
+
this.defaults
|
|
1723
|
+
);
|
|
1724
|
+
}
|
|
1490
1725
|
get credentials() {
|
|
1491
1726
|
return SeamHttpAcsCredentials.fromClient(this.client, this.defaults);
|
|
1492
1727
|
}
|
|
1728
|
+
get entrances() {
|
|
1729
|
+
return SeamHttpAcsEntrances.fromClient(this.client, this.defaults);
|
|
1730
|
+
}
|
|
1493
1731
|
get systems() {
|
|
1494
1732
|
return SeamHttpAcsSystems.fromClient(this.client, this.defaults);
|
|
1495
1733
|
}
|
|
@@ -3045,7 +3283,10 @@ exports.SeamHttpAccessCodes = SeamHttpAccessCodes;
|
|
|
3045
3283
|
exports.SeamHttpAccessCodesUnmanaged = SeamHttpAccessCodesUnmanaged;
|
|
3046
3284
|
exports.SeamHttpAcs = SeamHttpAcs;
|
|
3047
3285
|
exports.SeamHttpAcsAccessGroups = SeamHttpAcsAccessGroups;
|
|
3286
|
+
exports.SeamHttpAcsCredentialPools = SeamHttpAcsCredentialPools;
|
|
3287
|
+
exports.SeamHttpAcsCredentialProvisioningAutomations = SeamHttpAcsCredentialProvisioningAutomations;
|
|
3048
3288
|
exports.SeamHttpAcsCredentials = SeamHttpAcsCredentials;
|
|
3289
|
+
exports.SeamHttpAcsEntrances = SeamHttpAcsEntrances;
|
|
3049
3290
|
exports.SeamHttpAcsSystems = SeamHttpAcsSystems;
|
|
3050
3291
|
exports.SeamHttpAcsUsers = SeamHttpAcsUsers;
|
|
3051
3292
|
exports.SeamHttpActionAttempts = SeamHttpActionAttempts;
|