@seamapi/http 0.27.0 → 0.29.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 +1 -1
- package/dist/connect.cjs +198 -7
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +48 -8
- package/lib/seam/connect/routes/access-codes-simulate.d.ts +21 -0
- package/lib/seam/connect/routes/access-codes-simulate.js +88 -0
- package/lib/seam/connect/routes/access-codes-simulate.js.map +1 -0
- package/lib/seam/connect/routes/access-codes.d.ts +2 -0
- package/lib/seam/connect/routes/access-codes.js +4 -0
- package/lib/seam/connect/routes/access-codes.js.map +1 -1
- package/lib/seam/connect/routes/acs-credentials.d.ts +3 -3
- package/lib/seam/connect/routes/acs-credentials.js +3 -3
- package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
- package/lib/seam/connect/routes/acs-systems.d.ts +4 -0
- package/lib/seam/connect/routes/acs-systems.js +8 -0
- package/lib/seam/connect/routes/acs-systems.js.map +1 -1
- package/lib/seam/connect/routes/client-sessions.d.ts +1 -1
- package/lib/seam/connect/routes/client-sessions.js +1 -1
- package/lib/seam/connect/routes/client-sessions.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/seam/connect/routes/noise-sensors-simulate.d.ts +21 -0
- package/lib/seam/connect/routes/noise-sensors-simulate.js +88 -0
- package/lib/seam/connect/routes/noise-sensors-simulate.js.map +1 -0
- package/lib/seam/connect/routes/noise-sensors.d.ts +2 -0
- package/lib/seam/connect/routes/noise-sensors.js +4 -0
- package/lib/seam/connect/routes/noise-sensors.js.map +1 -1
- package/lib/seam/connect/routes/user-identities.d.ts +1 -1
- package/lib/seam/connect/routes/user-identities.js +1 -1
- package/lib/seam/connect/routes/user-identities.js.map +1 -1
- package/lib/seam/connect/routes/workspaces.d.ts +2 -2
- package/lib/seam/connect/routes/workspaces.js +3 -2
- package/lib/seam/connect/routes/workspaces.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/access-codes-simulate.ts +182 -0
- package/src/lib/seam/connect/routes/access-codes.ts +5 -0
- package/src/lib/seam/connect/routes/acs-credentials.ts +6 -10
- package/src/lib/seam/connect/routes/acs-systems.ts +26 -0
- package/src/lib/seam/connect/routes/client-sessions.ts +2 -2
- package/src/lib/seam/connect/routes/index.ts +2 -0
- package/src/lib/seam/connect/routes/noise-sensors-simulate.ts +176 -0
- package/src/lib/seam/connect/routes/noise-sensors.ts +5 -0
- package/src/lib/seam/connect/routes/user-identities.ts +2 -5
- package/src/lib/seam/connect/routes/workspaces.ts +8 -3
- package/src/lib/version.ts +1 -1
package/README.md
CHANGED
|
@@ -351,7 +351,7 @@ const workspaces = await seam.workspaces.list()
|
|
|
351
351
|
|
|
352
352
|
#### Additional Options
|
|
353
353
|
|
|
354
|
-
In addition the various authentication options,
|
|
354
|
+
In addition to the various authentication options,
|
|
355
355
|
the constructor takes some advanced options that affect behavior.
|
|
356
356
|
|
|
357
357
|
```ts
|
package/dist/connect.cjs
CHANGED
|
@@ -857,7 +857,7 @@ var SeamHttpClientSessions = class _SeamHttpClientSessions {
|
|
|
857
857
|
path: "/client_sessions/grant_access",
|
|
858
858
|
method: "post",
|
|
859
859
|
body,
|
|
860
|
-
responseKey:
|
|
860
|
+
responseKey: void 0
|
|
861
861
|
});
|
|
862
862
|
}
|
|
863
863
|
list(body) {
|
|
@@ -878,6 +878,93 @@ var SeamHttpClientSessions = class _SeamHttpClientSessions {
|
|
|
878
878
|
}
|
|
879
879
|
};
|
|
880
880
|
|
|
881
|
+
// src/lib/seam/connect/routes/access-codes-simulate.ts
|
|
882
|
+
var SeamHttpAccessCodesSimulate = class _SeamHttpAccessCodesSimulate {
|
|
883
|
+
constructor(apiKeyOrOptions = {}) {
|
|
884
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
885
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
886
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
887
|
+
}
|
|
888
|
+
static fromClient(client, options = {}) {
|
|
889
|
+
const constructorOptions = { ...options, client };
|
|
890
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
891
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
892
|
+
}
|
|
893
|
+
return new _SeamHttpAccessCodesSimulate(constructorOptions);
|
|
894
|
+
}
|
|
895
|
+
static fromApiKey(apiKey, options = {}) {
|
|
896
|
+
const constructorOptions = { ...options, apiKey };
|
|
897
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
898
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
899
|
+
}
|
|
900
|
+
return new _SeamHttpAccessCodesSimulate(constructorOptions);
|
|
901
|
+
}
|
|
902
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
903
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
904
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
905
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
906
|
+
}
|
|
907
|
+
return new _SeamHttpAccessCodesSimulate(constructorOptions);
|
|
908
|
+
}
|
|
909
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
910
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
911
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
912
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
913
|
+
throw new SeamHttpInvalidOptionsError(
|
|
914
|
+
"The client option cannot be used with SeamHttp.fromPublishableKey"
|
|
915
|
+
);
|
|
916
|
+
}
|
|
917
|
+
const client = createClient(clientOptions);
|
|
918
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
919
|
+
const { token } = await clientSessions.getOrCreate({
|
|
920
|
+
user_identifier_key: userIdentifierKey
|
|
921
|
+
});
|
|
922
|
+
return _SeamHttpAccessCodesSimulate.fromClientSessionToken(token, options);
|
|
923
|
+
}
|
|
924
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
925
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
926
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
927
|
+
throw new SeamHttpInvalidOptionsError(
|
|
928
|
+
"Missing consoleSessionToken or workspaceId"
|
|
929
|
+
);
|
|
930
|
+
}
|
|
931
|
+
return new _SeamHttpAccessCodesSimulate(constructorOptions);
|
|
932
|
+
}
|
|
933
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
934
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
935
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
936
|
+
throw new SeamHttpInvalidOptionsError(
|
|
937
|
+
"Missing personalAccessToken or workspaceId"
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
return new _SeamHttpAccessCodesSimulate(constructorOptions);
|
|
941
|
+
}
|
|
942
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
943
|
+
const { headers } = this.client.defaults;
|
|
944
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
945
|
+
clientSessionToken
|
|
946
|
+
});
|
|
947
|
+
for (const key of Object.keys(authHeaders)) {
|
|
948
|
+
if (headers[key] == null) {
|
|
949
|
+
throw new Error(
|
|
950
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
951
|
+
);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
955
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
956
|
+
await clientSessions.get();
|
|
957
|
+
}
|
|
958
|
+
createUnmanagedAccessCode(body) {
|
|
959
|
+
return new SeamHttpRequest(this, {
|
|
960
|
+
path: "/access_codes/simulate/create_unmanaged_access_code",
|
|
961
|
+
method: "post",
|
|
962
|
+
body,
|
|
963
|
+
responseKey: "access_code"
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
|
|
881
968
|
// src/lib/seam/connect/routes/access-codes-unmanaged.ts
|
|
882
969
|
var SeamHttpAccessCodesUnmanaged = class _SeamHttpAccessCodesUnmanaged {
|
|
883
970
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -1077,6 +1164,9 @@ var SeamHttpAccessCodes = class _SeamHttpAccessCodes {
|
|
|
1077
1164
|
get unmanaged() {
|
|
1078
1165
|
return SeamHttpAccessCodesUnmanaged.fromClient(this.client, this.defaults);
|
|
1079
1166
|
}
|
|
1167
|
+
get simulate() {
|
|
1168
|
+
return SeamHttpAccessCodesSimulate.fromClient(this.client, this.defaults);
|
|
1169
|
+
}
|
|
1080
1170
|
create(body) {
|
|
1081
1171
|
return new SeamHttpRequest(this, {
|
|
1082
1172
|
path: "/access_codes/create",
|
|
@@ -1521,7 +1611,7 @@ var SeamHttpAcsCredentials = class _SeamHttpAcsCredentials {
|
|
|
1521
1611
|
path: "/acs/credentials/assign",
|
|
1522
1612
|
method: "post",
|
|
1523
1613
|
body,
|
|
1524
|
-
responseKey:
|
|
1614
|
+
responseKey: void 0
|
|
1525
1615
|
});
|
|
1526
1616
|
}
|
|
1527
1617
|
create(body) {
|
|
@@ -1561,7 +1651,7 @@ var SeamHttpAcsCredentials = class _SeamHttpAcsCredentials {
|
|
|
1561
1651
|
path: "/acs/credentials/unassign",
|
|
1562
1652
|
method: "post",
|
|
1563
1653
|
body,
|
|
1564
|
-
responseKey:
|
|
1654
|
+
responseKey: void 0
|
|
1565
1655
|
});
|
|
1566
1656
|
}
|
|
1567
1657
|
update(body) {
|
|
@@ -1569,7 +1659,7 @@ var SeamHttpAcsCredentials = class _SeamHttpAcsCredentials {
|
|
|
1569
1659
|
path: "/acs/credentials/update",
|
|
1570
1660
|
method: "post",
|
|
1571
1661
|
body,
|
|
1572
|
-
responseKey:
|
|
1662
|
+
responseKey: void 0
|
|
1573
1663
|
});
|
|
1574
1664
|
}
|
|
1575
1665
|
};
|
|
@@ -1778,6 +1868,14 @@ var SeamHttpAcsSystems = class _SeamHttpAcsSystems {
|
|
|
1778
1868
|
responseKey: "acs_systems"
|
|
1779
1869
|
});
|
|
1780
1870
|
}
|
|
1871
|
+
listCompatibleCredentialManagerAcsSystems(body) {
|
|
1872
|
+
return new SeamHttpRequest(this, {
|
|
1873
|
+
path: "/acs/systems/list_compatible_credential_manager_acs_systems",
|
|
1874
|
+
method: "post",
|
|
1875
|
+
body,
|
|
1876
|
+
responseKey: "acs_systems"
|
|
1877
|
+
});
|
|
1878
|
+
}
|
|
1781
1879
|
};
|
|
1782
1880
|
|
|
1783
1881
|
// src/lib/seam/connect/routes/acs-users.ts
|
|
@@ -3108,6 +3206,93 @@ var SeamHttpNoiseSensorsNoiseThresholds = class _SeamHttpNoiseSensorsNoiseThresh
|
|
|
3108
3206
|
}
|
|
3109
3207
|
};
|
|
3110
3208
|
|
|
3209
|
+
// src/lib/seam/connect/routes/noise-sensors-simulate.ts
|
|
3210
|
+
var SeamHttpNoiseSensorsSimulate = class _SeamHttpNoiseSensorsSimulate {
|
|
3211
|
+
constructor(apiKeyOrOptions = {}) {
|
|
3212
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
3213
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
3214
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
3215
|
+
}
|
|
3216
|
+
static fromClient(client, options = {}) {
|
|
3217
|
+
const constructorOptions = { ...options, client };
|
|
3218
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
3219
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
3220
|
+
}
|
|
3221
|
+
return new _SeamHttpNoiseSensorsSimulate(constructorOptions);
|
|
3222
|
+
}
|
|
3223
|
+
static fromApiKey(apiKey, options = {}) {
|
|
3224
|
+
const constructorOptions = { ...options, apiKey };
|
|
3225
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
3226
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
3227
|
+
}
|
|
3228
|
+
return new _SeamHttpNoiseSensorsSimulate(constructorOptions);
|
|
3229
|
+
}
|
|
3230
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
3231
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
3232
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
3233
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
3234
|
+
}
|
|
3235
|
+
return new _SeamHttpNoiseSensorsSimulate(constructorOptions);
|
|
3236
|
+
}
|
|
3237
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
3238
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
3239
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
3240
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
3241
|
+
throw new SeamHttpInvalidOptionsError(
|
|
3242
|
+
"The client option cannot be used with SeamHttp.fromPublishableKey"
|
|
3243
|
+
);
|
|
3244
|
+
}
|
|
3245
|
+
const client = createClient(clientOptions);
|
|
3246
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
3247
|
+
const { token } = await clientSessions.getOrCreate({
|
|
3248
|
+
user_identifier_key: userIdentifierKey
|
|
3249
|
+
});
|
|
3250
|
+
return _SeamHttpNoiseSensorsSimulate.fromClientSessionToken(token, options);
|
|
3251
|
+
}
|
|
3252
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
3253
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
3254
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
3255
|
+
throw new SeamHttpInvalidOptionsError(
|
|
3256
|
+
"Missing consoleSessionToken or workspaceId"
|
|
3257
|
+
);
|
|
3258
|
+
}
|
|
3259
|
+
return new _SeamHttpNoiseSensorsSimulate(constructorOptions);
|
|
3260
|
+
}
|
|
3261
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
3262
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
3263
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
3264
|
+
throw new SeamHttpInvalidOptionsError(
|
|
3265
|
+
"Missing personalAccessToken or workspaceId"
|
|
3266
|
+
);
|
|
3267
|
+
}
|
|
3268
|
+
return new _SeamHttpNoiseSensorsSimulate(constructorOptions);
|
|
3269
|
+
}
|
|
3270
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
3271
|
+
const { headers } = this.client.defaults;
|
|
3272
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
3273
|
+
clientSessionToken
|
|
3274
|
+
});
|
|
3275
|
+
for (const key of Object.keys(authHeaders)) {
|
|
3276
|
+
if (headers[key] == null) {
|
|
3277
|
+
throw new Error(
|
|
3278
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
3279
|
+
);
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
3283
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
3284
|
+
await clientSessions.get();
|
|
3285
|
+
}
|
|
3286
|
+
triggerNoiseThreshold(body) {
|
|
3287
|
+
return new SeamHttpRequest(this, {
|
|
3288
|
+
path: "/noise_sensors/simulate/trigger_noise_threshold",
|
|
3289
|
+
method: "post",
|
|
3290
|
+
body,
|
|
3291
|
+
responseKey: void 0
|
|
3292
|
+
});
|
|
3293
|
+
}
|
|
3294
|
+
};
|
|
3295
|
+
|
|
3111
3296
|
// src/lib/seam/connect/routes/noise-sensors.ts
|
|
3112
3297
|
var SeamHttpNoiseSensors = class _SeamHttpNoiseSensors {
|
|
3113
3298
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -3191,6 +3376,9 @@ var SeamHttpNoiseSensors = class _SeamHttpNoiseSensors {
|
|
|
3191
3376
|
this.defaults
|
|
3192
3377
|
);
|
|
3193
3378
|
}
|
|
3379
|
+
get simulate() {
|
|
3380
|
+
return SeamHttpNoiseSensorsSimulate.fromClient(this.client, this.defaults);
|
|
3381
|
+
}
|
|
3194
3382
|
};
|
|
3195
3383
|
|
|
3196
3384
|
// src/lib/seam/connect/routes/phones-simulate.ts
|
|
@@ -3904,7 +4092,7 @@ var SeamHttpUserIdentities = class _SeamHttpUserIdentities {
|
|
|
3904
4092
|
path: "/user_identities/list_accessible_devices",
|
|
3905
4093
|
method: "post",
|
|
3906
4094
|
body,
|
|
3907
|
-
responseKey: "
|
|
4095
|
+
responseKey: "devices"
|
|
3908
4096
|
});
|
|
3909
4097
|
}
|
|
3910
4098
|
listAcsSystems(body) {
|
|
@@ -4169,12 +4357,13 @@ var SeamHttpWorkspaces = class _SeamHttpWorkspaces {
|
|
|
4169
4357
|
responseKey: "workspaces"
|
|
4170
4358
|
});
|
|
4171
4359
|
}
|
|
4172
|
-
resetSandbox(body) {
|
|
4360
|
+
resetSandbox(body, options = {}) {
|
|
4173
4361
|
return new SeamHttpRequest(this, {
|
|
4174
4362
|
path: "/workspaces/reset_sandbox",
|
|
4175
4363
|
method: "post",
|
|
4176
4364
|
body,
|
|
4177
|
-
responseKey:
|
|
4365
|
+
responseKey: "action_attempt",
|
|
4366
|
+
options
|
|
4178
4367
|
});
|
|
4179
4368
|
}
|
|
4180
4369
|
};
|
|
@@ -4355,6 +4544,7 @@ exports.SeamActionAttemptFailedError = SeamActionAttemptFailedError;
|
|
|
4355
4544
|
exports.SeamActionAttemptTimeoutError = SeamActionAttemptTimeoutError;
|
|
4356
4545
|
exports.SeamHttp = SeamHttp;
|
|
4357
4546
|
exports.SeamHttpAccessCodes = SeamHttpAccessCodes;
|
|
4547
|
+
exports.SeamHttpAccessCodesSimulate = SeamHttpAccessCodesSimulate;
|
|
4358
4548
|
exports.SeamHttpAccessCodesUnmanaged = SeamHttpAccessCodesUnmanaged;
|
|
4359
4549
|
exports.SeamHttpAcs = SeamHttpAcs;
|
|
4360
4550
|
exports.SeamHttpAcsAccessGroups = SeamHttpAcsAccessGroups;
|
|
@@ -4382,6 +4572,7 @@ exports.SeamHttpMultiWorkspaceInvalidOptionsError = SeamHttpMultiWorkspaceInvali
|
|
|
4382
4572
|
exports.SeamHttpNetworks = SeamHttpNetworks;
|
|
4383
4573
|
exports.SeamHttpNoiseSensors = SeamHttpNoiseSensors;
|
|
4384
4574
|
exports.SeamHttpNoiseSensorsNoiseThresholds = SeamHttpNoiseSensorsNoiseThresholds;
|
|
4575
|
+
exports.SeamHttpNoiseSensorsSimulate = SeamHttpNoiseSensorsSimulate;
|
|
4385
4576
|
exports.SeamHttpPhones = SeamHttpPhones;
|
|
4386
4577
|
exports.SeamHttpPhonesSimulate = SeamHttpPhonesSimulate;
|
|
4387
4578
|
exports.SeamHttpRequest = SeamHttpRequest;
|