@seamapi/http 1.32.0 → 1.34.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 +637 -210
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +537 -85
- package/lib/seam/connect/resolve-action-attempt.d.ts +488 -52
- package/lib/seam/connect/routes/access-codes.d.ts +4 -0
- package/lib/seam/connect/routes/access-codes.js +8 -0
- package/lib/seam/connect/routes/access-codes.js.map +1 -1
- package/lib/seam/connect/routes/access-grants.d.ts +35 -0
- package/lib/seam/connect/routes/access-grants.js +116 -0
- package/lib/seam/connect/routes/access-grants.js.map +1 -0
- package/lib/seam/connect/routes/{networks.d.ts → access-methods.d.ts} +19 -15
- package/lib/seam/connect/routes/{bridges.js → access-methods.js} +20 -12
- package/lib/seam/connect/routes/access-methods.js.map +1 -0
- package/lib/seam/connect/routes/acs-encoders.d.ts +4 -0
- package/lib/seam/connect/routes/acs-encoders.js +9 -0
- package/lib/seam/connect/routes/acs-encoders.js.map +1 -1
- package/lib/seam/connect/routes/connected-accounts.d.ts +4 -0
- package/lib/seam/connect/routes/connected-accounts.js +8 -0
- package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
- package/lib/seam/connect/routes/index.d.ts +5 -2
- package/lib/seam/connect/routes/index.js +5 -2
- package/lib/seam/connect/routes/index.js.map +1 -1
- package/lib/seam/connect/routes/spaces.d.ts +55 -0
- package/lib/seam/connect/routes/spaces.js +156 -0
- package/lib/seam/connect/routes/spaces.js.map +1 -0
- package/lib/seam/connect/routes/thermostats-daily-programs.d.ts +31 -0
- package/lib/seam/connect/routes/thermostats-daily-programs.js +109 -0
- package/lib/seam/connect/routes/thermostats-daily-programs.js.map +1 -0
- package/lib/seam/connect/routes/thermostats.d.ts +6 -0
- package/lib/seam/connect/routes/thermostats.js +13 -0
- package/lib/seam/connect/routes/thermostats.js.map +1 -1
- package/lib/seam/connect/routes/{bridges.d.ts → unstable-partner.d.ts} +8 -18
- package/lib/seam/connect/routes/{networks.js → unstable-partner.js} +8 -25
- package/lib/seam/connect/routes/unstable-partner.js.map +1 -0
- package/lib/seam/connect/routes/workspaces.d.ts +4 -0
- package/lib/seam/connect/routes/workspaces.js +8 -0
- package/lib/seam/connect/routes/workspaces.js.map +1 -1
- package/lib/seam/connect/seam-http.d.ts +4 -2
- package/lib/seam/connect/seam-http.js +10 -4
- package/lib/seam/connect/seam-http.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -4
- package/src/lib/seam/connect/routes/access-codes.ts +20 -0
- package/src/lib/seam/connect/routes/access-grants.ts +237 -0
- package/src/lib/seam/connect/routes/{networks.ts → access-methods.ts} +47 -29
- package/src/lib/seam/connect/routes/acs-encoders.ts +25 -0
- package/src/lib/seam/connect/routes/connected-accounts.ts +18 -0
- package/src/lib/seam/connect/routes/index.ts +5 -2
- package/src/lib/seam/connect/routes/spaces.ts +329 -0
- package/src/lib/seam/connect/routes/thermostats-daily-programs.ts +234 -0
- package/src/lib/seam/connect/routes/thermostats.ts +33 -0
- package/src/lib/seam/connect/routes/{bridges.ts → unstable-partner.ts} +14 -53
- package/src/lib/seam/connect/routes/workspaces.ts +17 -0
- package/src/lib/seam/connect/seam-http.ts +15 -5
- package/src/lib/version.ts +1 -1
- package/lib/seam/connect/routes/bridges.js.map +0 -1
- package/lib/seam/connect/routes/networks.js.map +0 -1
package/dist/connect.cjs
CHANGED
|
@@ -1336,6 +1336,14 @@ var SeamHttpAccessCodes = class _SeamHttpAccessCodes {
|
|
|
1336
1336
|
responseKey: "access_code"
|
|
1337
1337
|
});
|
|
1338
1338
|
}
|
|
1339
|
+
reportDeviceConstraints(body) {
|
|
1340
|
+
return new SeamHttpRequest(this, {
|
|
1341
|
+
pathname: "/access_codes/report_device_constraints",
|
|
1342
|
+
method: "post",
|
|
1343
|
+
body,
|
|
1344
|
+
responseKey: void 0
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1339
1347
|
update(body) {
|
|
1340
1348
|
return new SeamHttpRequest(this, {
|
|
1341
1349
|
pathname: "/access_codes/update",
|
|
@@ -1354,6 +1362,226 @@ var SeamHttpAccessCodes = class _SeamHttpAccessCodes {
|
|
|
1354
1362
|
}
|
|
1355
1363
|
};
|
|
1356
1364
|
|
|
1365
|
+
// src/lib/seam/connect/routes/access-grants.ts
|
|
1366
|
+
var SeamHttpAccessGrants = class _SeamHttpAccessGrants {
|
|
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 _SeamHttpAccessGrants(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 _SeamHttpAccessGrants(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 _SeamHttpAccessGrants(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 _SeamHttpAccessGrants.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 _SeamHttpAccessGrants(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 _SeamHttpAccessGrants(constructorOptions);
|
|
1425
|
+
}
|
|
1426
|
+
createPaginator(request) {
|
|
1427
|
+
return new SeamPaginator(this, request);
|
|
1428
|
+
}
|
|
1429
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
1430
|
+
const { headers } = this.client.defaults;
|
|
1431
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
1432
|
+
clientSessionToken
|
|
1433
|
+
});
|
|
1434
|
+
for (const key of Object.keys(authHeaders)) {
|
|
1435
|
+
if (headers[key] == null) {
|
|
1436
|
+
throw new Error(
|
|
1437
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
1438
|
+
);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
1442
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
1443
|
+
await clientSessions.get();
|
|
1444
|
+
}
|
|
1445
|
+
create(body) {
|
|
1446
|
+
return new SeamHttpRequest(this, {
|
|
1447
|
+
pathname: "/access_grants/create",
|
|
1448
|
+
method: "post",
|
|
1449
|
+
body,
|
|
1450
|
+
responseKey: "access_grant"
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
delete(body) {
|
|
1454
|
+
return new SeamHttpRequest(this, {
|
|
1455
|
+
pathname: "/access_grants/delete",
|
|
1456
|
+
method: "post",
|
|
1457
|
+
body,
|
|
1458
|
+
responseKey: void 0
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1461
|
+
get(body) {
|
|
1462
|
+
return new SeamHttpRequest(this, {
|
|
1463
|
+
pathname: "/access_grants/get",
|
|
1464
|
+
method: "post",
|
|
1465
|
+
body,
|
|
1466
|
+
responseKey: "access_grant"
|
|
1467
|
+
});
|
|
1468
|
+
}
|
|
1469
|
+
list(body) {
|
|
1470
|
+
return new SeamHttpRequest(this, {
|
|
1471
|
+
pathname: "/access_grants/list",
|
|
1472
|
+
method: "post",
|
|
1473
|
+
body,
|
|
1474
|
+
responseKey: "access_grants"
|
|
1475
|
+
});
|
|
1476
|
+
}
|
|
1477
|
+
};
|
|
1478
|
+
|
|
1479
|
+
// src/lib/seam/connect/routes/access-methods.ts
|
|
1480
|
+
var SeamHttpAccessMethods = class _SeamHttpAccessMethods {
|
|
1481
|
+
constructor(apiKeyOrOptions = {}) {
|
|
1482
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
1483
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
1484
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
1485
|
+
}
|
|
1486
|
+
static fromClient(client, options = {}) {
|
|
1487
|
+
const constructorOptions = { ...options, client };
|
|
1488
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
1489
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
1490
|
+
}
|
|
1491
|
+
return new _SeamHttpAccessMethods(constructorOptions);
|
|
1492
|
+
}
|
|
1493
|
+
static fromApiKey(apiKey, options = {}) {
|
|
1494
|
+
const constructorOptions = { ...options, apiKey };
|
|
1495
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
1496
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
1497
|
+
}
|
|
1498
|
+
return new _SeamHttpAccessMethods(constructorOptions);
|
|
1499
|
+
}
|
|
1500
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
1501
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
1502
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
1503
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
1504
|
+
}
|
|
1505
|
+
return new _SeamHttpAccessMethods(constructorOptions);
|
|
1506
|
+
}
|
|
1507
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
1508
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
1509
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
1510
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
1511
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1512
|
+
"The client option cannot be used with SeamHttp.fromPublishableKey"
|
|
1513
|
+
);
|
|
1514
|
+
}
|
|
1515
|
+
const client = createClient(clientOptions);
|
|
1516
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
1517
|
+
const { token } = await clientSessions.getOrCreate({
|
|
1518
|
+
user_identifier_key: userIdentifierKey
|
|
1519
|
+
});
|
|
1520
|
+
return _SeamHttpAccessMethods.fromClientSessionToken(token, options);
|
|
1521
|
+
}
|
|
1522
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
1523
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
1524
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
1525
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1526
|
+
"Missing consoleSessionToken or workspaceId"
|
|
1527
|
+
);
|
|
1528
|
+
}
|
|
1529
|
+
return new _SeamHttpAccessMethods(constructorOptions);
|
|
1530
|
+
}
|
|
1531
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
1532
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
1533
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
1534
|
+
throw new SeamHttpInvalidOptionsError(
|
|
1535
|
+
"Missing personalAccessToken or workspaceId"
|
|
1536
|
+
);
|
|
1537
|
+
}
|
|
1538
|
+
return new _SeamHttpAccessMethods(constructorOptions);
|
|
1539
|
+
}
|
|
1540
|
+
createPaginator(request) {
|
|
1541
|
+
return new SeamPaginator(this, request);
|
|
1542
|
+
}
|
|
1543
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
1544
|
+
const { headers } = this.client.defaults;
|
|
1545
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
1546
|
+
clientSessionToken
|
|
1547
|
+
});
|
|
1548
|
+
for (const key of Object.keys(authHeaders)) {
|
|
1549
|
+
if (headers[key] == null) {
|
|
1550
|
+
throw new Error(
|
|
1551
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
1552
|
+
);
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
1556
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
1557
|
+
await clientSessions.get();
|
|
1558
|
+
}
|
|
1559
|
+
delete(body) {
|
|
1560
|
+
return new SeamHttpRequest(this, {
|
|
1561
|
+
pathname: "/access_methods/delete",
|
|
1562
|
+
method: "post",
|
|
1563
|
+
body,
|
|
1564
|
+
responseKey: void 0
|
|
1565
|
+
});
|
|
1566
|
+
}
|
|
1567
|
+
get(body) {
|
|
1568
|
+
return new SeamHttpRequest(this, {
|
|
1569
|
+
pathname: "/access_methods/get",
|
|
1570
|
+
method: "post",
|
|
1571
|
+
body,
|
|
1572
|
+
responseKey: "access_method"
|
|
1573
|
+
});
|
|
1574
|
+
}
|
|
1575
|
+
list(body) {
|
|
1576
|
+
return new SeamHttpRequest(this, {
|
|
1577
|
+
pathname: "/access_methods/list",
|
|
1578
|
+
method: "post",
|
|
1579
|
+
body,
|
|
1580
|
+
responseKey: "access_methods"
|
|
1581
|
+
});
|
|
1582
|
+
}
|
|
1583
|
+
};
|
|
1584
|
+
|
|
1357
1585
|
// src/lib/seam/connect/routes/acs-access-groups.ts
|
|
1358
1586
|
var SeamHttpAcsAccessGroups = class _SeamHttpAcsAccessGroups {
|
|
1359
1587
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -1827,6 +2055,15 @@ var SeamHttpAcsEncoders = class _SeamHttpAcsEncoders {
|
|
|
1827
2055
|
get simulate() {
|
|
1828
2056
|
return SeamHttpAcsEncodersSimulate.fromClient(this.client, this.defaults);
|
|
1829
2057
|
}
|
|
2058
|
+
encodeAccessMethod(body, options = {}) {
|
|
2059
|
+
return new SeamHttpRequest(this, {
|
|
2060
|
+
pathname: "/acs/encoders/encode_access_method",
|
|
2061
|
+
method: "post",
|
|
2062
|
+
body,
|
|
2063
|
+
responseKey: "action_attempt",
|
|
2064
|
+
options
|
|
2065
|
+
});
|
|
2066
|
+
}
|
|
1830
2067
|
encodeCredential(body, options = {}) {
|
|
1831
2068
|
return new SeamHttpRequest(this, {
|
|
1832
2069
|
pathname: "/acs/encoders/encode_credential",
|
|
@@ -2452,104 +2689,6 @@ var SeamHttpActionAttempts = class _SeamHttpActionAttempts {
|
|
|
2452
2689
|
}
|
|
2453
2690
|
};
|
|
2454
2691
|
|
|
2455
|
-
// src/lib/seam/connect/routes/bridges.ts
|
|
2456
|
-
var SeamHttpBridges = class _SeamHttpBridges {
|
|
2457
|
-
constructor(apiKeyOrOptions = {}) {
|
|
2458
|
-
const options = parseOptions(apiKeyOrOptions);
|
|
2459
|
-
this.client = "client" in options ? options.client : createClient(options);
|
|
2460
|
-
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
2461
|
-
}
|
|
2462
|
-
static fromClient(client, options = {}) {
|
|
2463
|
-
const constructorOptions = { ...options, client };
|
|
2464
|
-
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
2465
|
-
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
2466
|
-
}
|
|
2467
|
-
return new _SeamHttpBridges(constructorOptions);
|
|
2468
|
-
}
|
|
2469
|
-
static fromApiKey(apiKey, options = {}) {
|
|
2470
|
-
const constructorOptions = { ...options, apiKey };
|
|
2471
|
-
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
2472
|
-
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
2473
|
-
}
|
|
2474
|
-
return new _SeamHttpBridges(constructorOptions);
|
|
2475
|
-
}
|
|
2476
|
-
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
2477
|
-
const constructorOptions = { ...options, clientSessionToken };
|
|
2478
|
-
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
2479
|
-
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
2480
|
-
}
|
|
2481
|
-
return new _SeamHttpBridges(constructorOptions);
|
|
2482
|
-
}
|
|
2483
|
-
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
2484
|
-
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
2485
|
-
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
2486
|
-
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
2487
|
-
throw new SeamHttpInvalidOptionsError(
|
|
2488
|
-
"The client option cannot be used with SeamHttp.fromPublishableKey"
|
|
2489
|
-
);
|
|
2490
|
-
}
|
|
2491
|
-
const client = createClient(clientOptions);
|
|
2492
|
-
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
2493
|
-
const { token } = await clientSessions.getOrCreate({
|
|
2494
|
-
user_identifier_key: userIdentifierKey
|
|
2495
|
-
});
|
|
2496
|
-
return _SeamHttpBridges.fromClientSessionToken(token, options);
|
|
2497
|
-
}
|
|
2498
|
-
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
2499
|
-
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
2500
|
-
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
2501
|
-
throw new SeamHttpInvalidOptionsError(
|
|
2502
|
-
"Missing consoleSessionToken or workspaceId"
|
|
2503
|
-
);
|
|
2504
|
-
}
|
|
2505
|
-
return new _SeamHttpBridges(constructorOptions);
|
|
2506
|
-
}
|
|
2507
|
-
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
2508
|
-
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
2509
|
-
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
2510
|
-
throw new SeamHttpInvalidOptionsError(
|
|
2511
|
-
"Missing personalAccessToken or workspaceId"
|
|
2512
|
-
);
|
|
2513
|
-
}
|
|
2514
|
-
return new _SeamHttpBridges(constructorOptions);
|
|
2515
|
-
}
|
|
2516
|
-
createPaginator(request) {
|
|
2517
|
-
return new SeamPaginator(this, request);
|
|
2518
|
-
}
|
|
2519
|
-
async updateClientSessionToken(clientSessionToken) {
|
|
2520
|
-
const { headers } = this.client.defaults;
|
|
2521
|
-
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
2522
|
-
clientSessionToken
|
|
2523
|
-
});
|
|
2524
|
-
for (const key of Object.keys(authHeaders)) {
|
|
2525
|
-
if (headers[key] == null) {
|
|
2526
|
-
throw new Error(
|
|
2527
|
-
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
2528
|
-
);
|
|
2529
|
-
}
|
|
2530
|
-
}
|
|
2531
|
-
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
2532
|
-
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
2533
|
-
await clientSessions.get();
|
|
2534
|
-
}
|
|
2535
|
-
get(body) {
|
|
2536
|
-
return new SeamHttpRequest(this, {
|
|
2537
|
-
pathname: "/bridges/get",
|
|
2538
|
-
method: "post",
|
|
2539
|
-
body,
|
|
2540
|
-
responseKey: "bridge"
|
|
2541
|
-
});
|
|
2542
|
-
}
|
|
2543
|
-
list(body) {
|
|
2544
|
-
return new SeamHttpRequest(this, {
|
|
2545
|
-
pathname: "/bridges/list",
|
|
2546
|
-
method: "post",
|
|
2547
|
-
body,
|
|
2548
|
-
responseKey: "bridges"
|
|
2549
|
-
});
|
|
2550
|
-
}
|
|
2551
|
-
};
|
|
2552
|
-
|
|
2553
2692
|
// src/lib/seam/connect/routes/connect-webviews.ts
|
|
2554
2693
|
var SeamHttpConnectWebviews = class _SeamHttpConnectWebviews {
|
|
2555
2694
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -2768,6 +2907,14 @@ var SeamHttpConnectedAccounts = class _SeamHttpConnectedAccounts {
|
|
|
2768
2907
|
responseKey: "connected_accounts"
|
|
2769
2908
|
});
|
|
2770
2909
|
}
|
|
2910
|
+
sync(body) {
|
|
2911
|
+
return new SeamHttpRequest(this, {
|
|
2912
|
+
pathname: "/connected_accounts/sync",
|
|
2913
|
+
method: "post",
|
|
2914
|
+
body,
|
|
2915
|
+
responseKey: void 0
|
|
2916
|
+
});
|
|
2917
|
+
}
|
|
2771
2918
|
update(body) {
|
|
2772
2919
|
return new SeamHttpRequest(this, {
|
|
2773
2920
|
pathname: "/connected_accounts/update",
|
|
@@ -3324,8 +3471,8 @@ var SeamHttpLocks = class _SeamHttpLocks {
|
|
|
3324
3471
|
}
|
|
3325
3472
|
};
|
|
3326
3473
|
|
|
3327
|
-
// src/lib/seam/connect/routes/
|
|
3328
|
-
var
|
|
3474
|
+
// src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts
|
|
3475
|
+
var SeamHttpNoiseSensorsNoiseThresholds = class _SeamHttpNoiseSensorsNoiseThresholds {
|
|
3329
3476
|
constructor(apiKeyOrOptions = {}) {
|
|
3330
3477
|
const options = parseOptions(apiKeyOrOptions);
|
|
3331
3478
|
this.client = "client" in options ? options.client : createClient(options);
|
|
@@ -3336,21 +3483,21 @@ var SeamHttpNetworks = class _SeamHttpNetworks {
|
|
|
3336
3483
|
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
3337
3484
|
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
3338
3485
|
}
|
|
3339
|
-
return new
|
|
3486
|
+
return new _SeamHttpNoiseSensorsNoiseThresholds(constructorOptions);
|
|
3340
3487
|
}
|
|
3341
3488
|
static fromApiKey(apiKey, options = {}) {
|
|
3342
3489
|
const constructorOptions = { ...options, apiKey };
|
|
3343
3490
|
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
3344
3491
|
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
3345
3492
|
}
|
|
3346
|
-
return new
|
|
3493
|
+
return new _SeamHttpNoiseSensorsNoiseThresholds(constructorOptions);
|
|
3347
3494
|
}
|
|
3348
3495
|
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
3349
3496
|
const constructorOptions = { ...options, clientSessionToken };
|
|
3350
3497
|
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
3351
3498
|
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
3352
3499
|
}
|
|
3353
|
-
return new
|
|
3500
|
+
return new _SeamHttpNoiseSensorsNoiseThresholds(constructorOptions);
|
|
3354
3501
|
}
|
|
3355
3502
|
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
3356
3503
|
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
@@ -3365,7 +3512,10 @@ var SeamHttpNetworks = class _SeamHttpNetworks {
|
|
|
3365
3512
|
const { token } = await clientSessions.getOrCreate({
|
|
3366
3513
|
user_identifier_key: userIdentifierKey
|
|
3367
3514
|
});
|
|
3368
|
-
return
|
|
3515
|
+
return _SeamHttpNoiseSensorsNoiseThresholds.fromClientSessionToken(
|
|
3516
|
+
token,
|
|
3517
|
+
options
|
|
3518
|
+
);
|
|
3369
3519
|
}
|
|
3370
3520
|
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
3371
3521
|
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
@@ -3374,7 +3524,7 @@ var SeamHttpNetworks = class _SeamHttpNetworks {
|
|
|
3374
3524
|
"Missing consoleSessionToken or workspaceId"
|
|
3375
3525
|
);
|
|
3376
3526
|
}
|
|
3377
|
-
return new
|
|
3527
|
+
return new _SeamHttpNoiseSensorsNoiseThresholds(constructorOptions);
|
|
3378
3528
|
}
|
|
3379
3529
|
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
3380
3530
|
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
@@ -3383,7 +3533,7 @@ var SeamHttpNetworks = class _SeamHttpNetworks {
|
|
|
3383
3533
|
"Missing personalAccessToken or workspaceId"
|
|
3384
3534
|
);
|
|
3385
3535
|
}
|
|
3386
|
-
return new
|
|
3536
|
+
return new _SeamHttpNoiseSensorsNoiseThresholds(constructorOptions);
|
|
3387
3537
|
}
|
|
3388
3538
|
createPaginator(request) {
|
|
3389
3539
|
return new SeamPaginator(this, request);
|
|
@@ -3404,26 +3554,50 @@ var SeamHttpNetworks = class _SeamHttpNetworks {
|
|
|
3404
3554
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
3405
3555
|
await clientSessions.get();
|
|
3406
3556
|
}
|
|
3557
|
+
create(body) {
|
|
3558
|
+
return new SeamHttpRequest(this, {
|
|
3559
|
+
pathname: "/noise_sensors/noise_thresholds/create",
|
|
3560
|
+
method: "post",
|
|
3561
|
+
body,
|
|
3562
|
+
responseKey: "noise_threshold"
|
|
3563
|
+
});
|
|
3564
|
+
}
|
|
3565
|
+
delete(body) {
|
|
3566
|
+
return new SeamHttpRequest(this, {
|
|
3567
|
+
pathname: "/noise_sensors/noise_thresholds/delete",
|
|
3568
|
+
method: "post",
|
|
3569
|
+
body,
|
|
3570
|
+
responseKey: void 0
|
|
3571
|
+
});
|
|
3572
|
+
}
|
|
3407
3573
|
get(body) {
|
|
3408
3574
|
return new SeamHttpRequest(this, {
|
|
3409
|
-
pathname: "/
|
|
3575
|
+
pathname: "/noise_sensors/noise_thresholds/get",
|
|
3410
3576
|
method: "post",
|
|
3411
3577
|
body,
|
|
3412
|
-
responseKey: "
|
|
3578
|
+
responseKey: "noise_threshold"
|
|
3413
3579
|
});
|
|
3414
3580
|
}
|
|
3415
3581
|
list(body) {
|
|
3416
3582
|
return new SeamHttpRequest(this, {
|
|
3417
|
-
pathname: "/
|
|
3583
|
+
pathname: "/noise_sensors/noise_thresholds/list",
|
|
3418
3584
|
method: "post",
|
|
3419
3585
|
body,
|
|
3420
|
-
responseKey: "
|
|
3586
|
+
responseKey: "noise_thresholds"
|
|
3587
|
+
});
|
|
3588
|
+
}
|
|
3589
|
+
update(body) {
|
|
3590
|
+
return new SeamHttpRequest(this, {
|
|
3591
|
+
pathname: "/noise_sensors/noise_thresholds/update",
|
|
3592
|
+
method: "post",
|
|
3593
|
+
body,
|
|
3594
|
+
responseKey: void 0
|
|
3421
3595
|
});
|
|
3422
3596
|
}
|
|
3423
3597
|
};
|
|
3424
3598
|
|
|
3425
|
-
// src/lib/seam/connect/routes/noise-sensors-
|
|
3426
|
-
var
|
|
3599
|
+
// src/lib/seam/connect/routes/noise-sensors-simulate.ts
|
|
3600
|
+
var SeamHttpNoiseSensorsSimulate = class _SeamHttpNoiseSensorsSimulate {
|
|
3427
3601
|
constructor(apiKeyOrOptions = {}) {
|
|
3428
3602
|
const options = parseOptions(apiKeyOrOptions);
|
|
3429
3603
|
this.client = "client" in options ? options.client : createClient(options);
|
|
@@ -3434,21 +3608,21 @@ var SeamHttpNoiseSensorsNoiseThresholds = class _SeamHttpNoiseSensorsNoiseThresh
|
|
|
3434
3608
|
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
3435
3609
|
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
3436
3610
|
}
|
|
3437
|
-
return new
|
|
3611
|
+
return new _SeamHttpNoiseSensorsSimulate(constructorOptions);
|
|
3438
3612
|
}
|
|
3439
3613
|
static fromApiKey(apiKey, options = {}) {
|
|
3440
3614
|
const constructorOptions = { ...options, apiKey };
|
|
3441
3615
|
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
3442
3616
|
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
3443
3617
|
}
|
|
3444
|
-
return new
|
|
3618
|
+
return new _SeamHttpNoiseSensorsSimulate(constructorOptions);
|
|
3445
3619
|
}
|
|
3446
3620
|
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
3447
3621
|
const constructorOptions = { ...options, clientSessionToken };
|
|
3448
3622
|
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
3449
3623
|
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
3450
3624
|
}
|
|
3451
|
-
return new
|
|
3625
|
+
return new _SeamHttpNoiseSensorsSimulate(constructorOptions);
|
|
3452
3626
|
}
|
|
3453
3627
|
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
3454
3628
|
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
@@ -3463,10 +3637,7 @@ var SeamHttpNoiseSensorsNoiseThresholds = class _SeamHttpNoiseSensorsNoiseThresh
|
|
|
3463
3637
|
const { token } = await clientSessions.getOrCreate({
|
|
3464
3638
|
user_identifier_key: userIdentifierKey
|
|
3465
3639
|
});
|
|
3466
|
-
return
|
|
3467
|
-
token,
|
|
3468
|
-
options
|
|
3469
|
-
);
|
|
3640
|
+
return _SeamHttpNoiseSensorsSimulate.fromClientSessionToken(token, options);
|
|
3470
3641
|
}
|
|
3471
3642
|
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
3472
3643
|
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
@@ -3475,7 +3646,7 @@ var SeamHttpNoiseSensorsNoiseThresholds = class _SeamHttpNoiseSensorsNoiseThresh
|
|
|
3475
3646
|
"Missing consoleSessionToken or workspaceId"
|
|
3476
3647
|
);
|
|
3477
3648
|
}
|
|
3478
|
-
return new
|
|
3649
|
+
return new _SeamHttpNoiseSensorsSimulate(constructorOptions);
|
|
3479
3650
|
}
|
|
3480
3651
|
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
3481
3652
|
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
@@ -3484,7 +3655,7 @@ var SeamHttpNoiseSensorsNoiseThresholds = class _SeamHttpNoiseSensorsNoiseThresh
|
|
|
3484
3655
|
"Missing personalAccessToken or workspaceId"
|
|
3485
3656
|
);
|
|
3486
3657
|
}
|
|
3487
|
-
return new
|
|
3658
|
+
return new _SeamHttpNoiseSensorsSimulate(constructorOptions);
|
|
3488
3659
|
}
|
|
3489
3660
|
createPaginator(request) {
|
|
3490
3661
|
return new SeamPaginator(this, request);
|
|
@@ -3505,50 +3676,117 @@ var SeamHttpNoiseSensorsNoiseThresholds = class _SeamHttpNoiseSensorsNoiseThresh
|
|
|
3505
3676
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
3506
3677
|
await clientSessions.get();
|
|
3507
3678
|
}
|
|
3508
|
-
|
|
3509
|
-
return new SeamHttpRequest(this, {
|
|
3510
|
-
pathname: "/noise_sensors/noise_thresholds/create",
|
|
3511
|
-
method: "post",
|
|
3512
|
-
body,
|
|
3513
|
-
responseKey: "noise_threshold"
|
|
3514
|
-
});
|
|
3515
|
-
}
|
|
3516
|
-
delete(body) {
|
|
3679
|
+
triggerNoiseThreshold(body) {
|
|
3517
3680
|
return new SeamHttpRequest(this, {
|
|
3518
|
-
pathname: "/noise_sensors/
|
|
3681
|
+
pathname: "/noise_sensors/simulate/trigger_noise_threshold",
|
|
3519
3682
|
method: "post",
|
|
3520
3683
|
body,
|
|
3521
3684
|
responseKey: void 0
|
|
3522
3685
|
});
|
|
3523
3686
|
}
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3687
|
+
};
|
|
3688
|
+
|
|
3689
|
+
// src/lib/seam/connect/routes/noise-sensors.ts
|
|
3690
|
+
var SeamHttpNoiseSensors = class _SeamHttpNoiseSensors {
|
|
3691
|
+
constructor(apiKeyOrOptions = {}) {
|
|
3692
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
3693
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
3694
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
3695
|
+
}
|
|
3696
|
+
static fromClient(client, options = {}) {
|
|
3697
|
+
const constructorOptions = { ...options, client };
|
|
3698
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
3699
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
3700
|
+
}
|
|
3701
|
+
return new _SeamHttpNoiseSensors(constructorOptions);
|
|
3702
|
+
}
|
|
3703
|
+
static fromApiKey(apiKey, options = {}) {
|
|
3704
|
+
const constructorOptions = { ...options, apiKey };
|
|
3705
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
3706
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
3707
|
+
}
|
|
3708
|
+
return new _SeamHttpNoiseSensors(constructorOptions);
|
|
3709
|
+
}
|
|
3710
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
3711
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
3712
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
3713
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
3714
|
+
}
|
|
3715
|
+
return new _SeamHttpNoiseSensors(constructorOptions);
|
|
3716
|
+
}
|
|
3717
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
3718
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
3719
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
3720
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
3721
|
+
throw new SeamHttpInvalidOptionsError(
|
|
3722
|
+
"The client option cannot be used with SeamHttp.fromPublishableKey"
|
|
3723
|
+
);
|
|
3724
|
+
}
|
|
3725
|
+
const client = createClient(clientOptions);
|
|
3726
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
3727
|
+
const { token } = await clientSessions.getOrCreate({
|
|
3728
|
+
user_identifier_key: userIdentifierKey
|
|
3530
3729
|
});
|
|
3730
|
+
return _SeamHttpNoiseSensors.fromClientSessionToken(token, options);
|
|
3531
3731
|
}
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3732
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
3733
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
3734
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
3735
|
+
throw new SeamHttpInvalidOptionsError(
|
|
3736
|
+
"Missing consoleSessionToken or workspaceId"
|
|
3737
|
+
);
|
|
3738
|
+
}
|
|
3739
|
+
return new _SeamHttpNoiseSensors(constructorOptions);
|
|
3740
|
+
}
|
|
3741
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
3742
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
3743
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
3744
|
+
throw new SeamHttpInvalidOptionsError(
|
|
3745
|
+
"Missing personalAccessToken or workspaceId"
|
|
3746
|
+
);
|
|
3747
|
+
}
|
|
3748
|
+
return new _SeamHttpNoiseSensors(constructorOptions);
|
|
3749
|
+
}
|
|
3750
|
+
createPaginator(request) {
|
|
3751
|
+
return new SeamPaginator(this, request);
|
|
3752
|
+
}
|
|
3753
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
3754
|
+
const { headers } = this.client.defaults;
|
|
3755
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
3756
|
+
clientSessionToken
|
|
3538
3757
|
});
|
|
3758
|
+
for (const key of Object.keys(authHeaders)) {
|
|
3759
|
+
if (headers[key] == null) {
|
|
3760
|
+
throw new Error(
|
|
3761
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
3762
|
+
);
|
|
3763
|
+
}
|
|
3764
|
+
}
|
|
3765
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
3766
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
3767
|
+
await clientSessions.get();
|
|
3539
3768
|
}
|
|
3540
|
-
|
|
3769
|
+
get noiseThresholds() {
|
|
3770
|
+
return SeamHttpNoiseSensorsNoiseThresholds.fromClient(
|
|
3771
|
+
this.client,
|
|
3772
|
+
this.defaults
|
|
3773
|
+
);
|
|
3774
|
+
}
|
|
3775
|
+
get simulate() {
|
|
3776
|
+
return SeamHttpNoiseSensorsSimulate.fromClient(this.client, this.defaults);
|
|
3777
|
+
}
|
|
3778
|
+
list(body) {
|
|
3541
3779
|
return new SeamHttpRequest(this, {
|
|
3542
|
-
pathname: "/noise_sensors/
|
|
3780
|
+
pathname: "/noise_sensors/list",
|
|
3543
3781
|
method: "post",
|
|
3544
3782
|
body,
|
|
3545
|
-
responseKey:
|
|
3783
|
+
responseKey: "devices"
|
|
3546
3784
|
});
|
|
3547
3785
|
}
|
|
3548
3786
|
};
|
|
3549
3787
|
|
|
3550
|
-
// src/lib/seam/connect/routes/
|
|
3551
|
-
var
|
|
3788
|
+
// src/lib/seam/connect/routes/phones-simulate.ts
|
|
3789
|
+
var SeamHttpPhonesSimulate = class _SeamHttpPhonesSimulate {
|
|
3552
3790
|
constructor(apiKeyOrOptions = {}) {
|
|
3553
3791
|
const options = parseOptions(apiKeyOrOptions);
|
|
3554
3792
|
this.client = "client" in options ? options.client : createClient(options);
|
|
@@ -3559,21 +3797,21 @@ var SeamHttpNoiseSensorsSimulate = class _SeamHttpNoiseSensorsSimulate {
|
|
|
3559
3797
|
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
3560
3798
|
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
3561
3799
|
}
|
|
3562
|
-
return new
|
|
3800
|
+
return new _SeamHttpPhonesSimulate(constructorOptions);
|
|
3563
3801
|
}
|
|
3564
3802
|
static fromApiKey(apiKey, options = {}) {
|
|
3565
3803
|
const constructorOptions = { ...options, apiKey };
|
|
3566
3804
|
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
3567
3805
|
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
3568
3806
|
}
|
|
3569
|
-
return new
|
|
3807
|
+
return new _SeamHttpPhonesSimulate(constructorOptions);
|
|
3570
3808
|
}
|
|
3571
3809
|
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
3572
3810
|
const constructorOptions = { ...options, clientSessionToken };
|
|
3573
3811
|
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
3574
3812
|
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
3575
3813
|
}
|
|
3576
|
-
return new
|
|
3814
|
+
return new _SeamHttpPhonesSimulate(constructorOptions);
|
|
3577
3815
|
}
|
|
3578
3816
|
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
3579
3817
|
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
@@ -3588,7 +3826,7 @@ var SeamHttpNoiseSensorsSimulate = class _SeamHttpNoiseSensorsSimulate {
|
|
|
3588
3826
|
const { token } = await clientSessions.getOrCreate({
|
|
3589
3827
|
user_identifier_key: userIdentifierKey
|
|
3590
3828
|
});
|
|
3591
|
-
return
|
|
3829
|
+
return _SeamHttpPhonesSimulate.fromClientSessionToken(token, options);
|
|
3592
3830
|
}
|
|
3593
3831
|
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
3594
3832
|
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
@@ -3597,7 +3835,7 @@ var SeamHttpNoiseSensorsSimulate = class _SeamHttpNoiseSensorsSimulate {
|
|
|
3597
3835
|
"Missing consoleSessionToken or workspaceId"
|
|
3598
3836
|
);
|
|
3599
3837
|
}
|
|
3600
|
-
return new
|
|
3838
|
+
return new _SeamHttpPhonesSimulate(constructorOptions);
|
|
3601
3839
|
}
|
|
3602
3840
|
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
3603
3841
|
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
@@ -3606,7 +3844,7 @@ var SeamHttpNoiseSensorsSimulate = class _SeamHttpNoiseSensorsSimulate {
|
|
|
3606
3844
|
"Missing personalAccessToken or workspaceId"
|
|
3607
3845
|
);
|
|
3608
3846
|
}
|
|
3609
|
-
return new
|
|
3847
|
+
return new _SeamHttpPhonesSimulate(constructorOptions);
|
|
3610
3848
|
}
|
|
3611
3849
|
createPaginator(request) {
|
|
3612
3850
|
return new SeamPaginator(this, request);
|
|
@@ -3627,18 +3865,18 @@ var SeamHttpNoiseSensorsSimulate = class _SeamHttpNoiseSensorsSimulate {
|
|
|
3627
3865
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
3628
3866
|
await clientSessions.get();
|
|
3629
3867
|
}
|
|
3630
|
-
|
|
3868
|
+
createSandboxPhone(body) {
|
|
3631
3869
|
return new SeamHttpRequest(this, {
|
|
3632
|
-
pathname: "/
|
|
3870
|
+
pathname: "/phones/simulate/create_sandbox_phone",
|
|
3633
3871
|
method: "post",
|
|
3634
3872
|
body,
|
|
3635
|
-
responseKey:
|
|
3873
|
+
responseKey: "phone"
|
|
3636
3874
|
});
|
|
3637
3875
|
}
|
|
3638
3876
|
};
|
|
3639
3877
|
|
|
3640
|
-
// src/lib/seam/connect/routes/
|
|
3641
|
-
var
|
|
3878
|
+
// src/lib/seam/connect/routes/phones.ts
|
|
3879
|
+
var SeamHttpPhones = class _SeamHttpPhones {
|
|
3642
3880
|
constructor(apiKeyOrOptions = {}) {
|
|
3643
3881
|
const options = parseOptions(apiKeyOrOptions);
|
|
3644
3882
|
this.client = "client" in options ? options.client : createClient(options);
|
|
@@ -3649,21 +3887,21 @@ var SeamHttpNoiseSensors = class _SeamHttpNoiseSensors {
|
|
|
3649
3887
|
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
3650
3888
|
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
3651
3889
|
}
|
|
3652
|
-
return new
|
|
3890
|
+
return new _SeamHttpPhones(constructorOptions);
|
|
3653
3891
|
}
|
|
3654
3892
|
static fromApiKey(apiKey, options = {}) {
|
|
3655
3893
|
const constructorOptions = { ...options, apiKey };
|
|
3656
3894
|
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
3657
3895
|
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
3658
3896
|
}
|
|
3659
|
-
return new
|
|
3897
|
+
return new _SeamHttpPhones(constructorOptions);
|
|
3660
3898
|
}
|
|
3661
3899
|
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
3662
3900
|
const constructorOptions = { ...options, clientSessionToken };
|
|
3663
3901
|
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
3664
3902
|
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
3665
3903
|
}
|
|
3666
|
-
return new
|
|
3904
|
+
return new _SeamHttpPhones(constructorOptions);
|
|
3667
3905
|
}
|
|
3668
3906
|
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
3669
3907
|
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
@@ -3678,7 +3916,7 @@ var SeamHttpNoiseSensors = class _SeamHttpNoiseSensors {
|
|
|
3678
3916
|
const { token } = await clientSessions.getOrCreate({
|
|
3679
3917
|
user_identifier_key: userIdentifierKey
|
|
3680
3918
|
});
|
|
3681
|
-
return
|
|
3919
|
+
return _SeamHttpPhones.fromClientSessionToken(token, options);
|
|
3682
3920
|
}
|
|
3683
3921
|
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
3684
3922
|
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
@@ -3687,7 +3925,7 @@ var SeamHttpNoiseSensors = class _SeamHttpNoiseSensors {
|
|
|
3687
3925
|
"Missing consoleSessionToken or workspaceId"
|
|
3688
3926
|
);
|
|
3689
3927
|
}
|
|
3690
|
-
return new
|
|
3928
|
+
return new _SeamHttpPhones(constructorOptions);
|
|
3691
3929
|
}
|
|
3692
3930
|
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
3693
3931
|
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
@@ -3696,7 +3934,7 @@ var SeamHttpNoiseSensors = class _SeamHttpNoiseSensors {
|
|
|
3696
3934
|
"Missing personalAccessToken or workspaceId"
|
|
3697
3935
|
);
|
|
3698
3936
|
}
|
|
3699
|
-
return new
|
|
3937
|
+
return new _SeamHttpPhones(constructorOptions);
|
|
3700
3938
|
}
|
|
3701
3939
|
createPaginator(request) {
|
|
3702
3940
|
return new SeamPaginator(this, request);
|
|
@@ -3717,27 +3955,37 @@ var SeamHttpNoiseSensors = class _SeamHttpNoiseSensors {
|
|
|
3717
3955
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
3718
3956
|
await clientSessions.get();
|
|
3719
3957
|
}
|
|
3720
|
-
get noiseThresholds() {
|
|
3721
|
-
return SeamHttpNoiseSensorsNoiseThresholds.fromClient(
|
|
3722
|
-
this.client,
|
|
3723
|
-
this.defaults
|
|
3724
|
-
);
|
|
3725
|
-
}
|
|
3726
3958
|
get simulate() {
|
|
3727
|
-
return
|
|
3959
|
+
return SeamHttpPhonesSimulate.fromClient(this.client, this.defaults);
|
|
3960
|
+
}
|
|
3961
|
+
deactivate(body) {
|
|
3962
|
+
return new SeamHttpRequest(this, {
|
|
3963
|
+
pathname: "/phones/deactivate",
|
|
3964
|
+
method: "post",
|
|
3965
|
+
body,
|
|
3966
|
+
responseKey: void 0
|
|
3967
|
+
});
|
|
3968
|
+
}
|
|
3969
|
+
get(body) {
|
|
3970
|
+
return new SeamHttpRequest(this, {
|
|
3971
|
+
pathname: "/phones/get",
|
|
3972
|
+
method: "post",
|
|
3973
|
+
body,
|
|
3974
|
+
responseKey: "phone"
|
|
3975
|
+
});
|
|
3728
3976
|
}
|
|
3729
3977
|
list(body) {
|
|
3730
3978
|
return new SeamHttpRequest(this, {
|
|
3731
|
-
pathname: "/
|
|
3979
|
+
pathname: "/phones/list",
|
|
3732
3980
|
method: "post",
|
|
3733
3981
|
body,
|
|
3734
|
-
responseKey: "
|
|
3982
|
+
responseKey: "phones"
|
|
3735
3983
|
});
|
|
3736
3984
|
}
|
|
3737
3985
|
};
|
|
3738
3986
|
|
|
3739
|
-
// src/lib/seam/connect/routes/
|
|
3740
|
-
var
|
|
3987
|
+
// src/lib/seam/connect/routes/spaces.ts
|
|
3988
|
+
var SeamHttpSpaces = class _SeamHttpSpaces {
|
|
3741
3989
|
constructor(apiKeyOrOptions = {}) {
|
|
3742
3990
|
const options = parseOptions(apiKeyOrOptions);
|
|
3743
3991
|
this.client = "client" in options ? options.client : createClient(options);
|
|
@@ -3748,21 +3996,21 @@ var SeamHttpPhonesSimulate = class _SeamHttpPhonesSimulate {
|
|
|
3748
3996
|
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
3749
3997
|
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
3750
3998
|
}
|
|
3751
|
-
return new
|
|
3999
|
+
return new _SeamHttpSpaces(constructorOptions);
|
|
3752
4000
|
}
|
|
3753
4001
|
static fromApiKey(apiKey, options = {}) {
|
|
3754
4002
|
const constructorOptions = { ...options, apiKey };
|
|
3755
4003
|
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
3756
4004
|
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
3757
4005
|
}
|
|
3758
|
-
return new
|
|
4006
|
+
return new _SeamHttpSpaces(constructorOptions);
|
|
3759
4007
|
}
|
|
3760
4008
|
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
3761
4009
|
const constructorOptions = { ...options, clientSessionToken };
|
|
3762
4010
|
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
3763
4011
|
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
3764
4012
|
}
|
|
3765
|
-
return new
|
|
4013
|
+
return new _SeamHttpSpaces(constructorOptions);
|
|
3766
4014
|
}
|
|
3767
4015
|
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
3768
4016
|
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
@@ -3777,7 +4025,7 @@ var SeamHttpPhonesSimulate = class _SeamHttpPhonesSimulate {
|
|
|
3777
4025
|
const { token } = await clientSessions.getOrCreate({
|
|
3778
4026
|
user_identifier_key: userIdentifierKey
|
|
3779
4027
|
});
|
|
3780
|
-
return
|
|
4028
|
+
return _SeamHttpSpaces.fromClientSessionToken(token, options);
|
|
3781
4029
|
}
|
|
3782
4030
|
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
3783
4031
|
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
@@ -3786,7 +4034,7 @@ var SeamHttpPhonesSimulate = class _SeamHttpPhonesSimulate {
|
|
|
3786
4034
|
"Missing consoleSessionToken or workspaceId"
|
|
3787
4035
|
);
|
|
3788
4036
|
}
|
|
3789
|
-
return new
|
|
4037
|
+
return new _SeamHttpSpaces(constructorOptions);
|
|
3790
4038
|
}
|
|
3791
4039
|
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
3792
4040
|
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
@@ -3795,7 +4043,7 @@ var SeamHttpPhonesSimulate = class _SeamHttpPhonesSimulate {
|
|
|
3795
4043
|
"Missing personalAccessToken or workspaceId"
|
|
3796
4044
|
);
|
|
3797
4045
|
}
|
|
3798
|
-
return new
|
|
4046
|
+
return new _SeamHttpSpaces(constructorOptions);
|
|
3799
4047
|
}
|
|
3800
4048
|
createPaginator(request) {
|
|
3801
4049
|
return new SeamPaginator(this, request);
|
|
@@ -3816,18 +4064,82 @@ var SeamHttpPhonesSimulate = class _SeamHttpPhonesSimulate {
|
|
|
3816
4064
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
3817
4065
|
await clientSessions.get();
|
|
3818
4066
|
}
|
|
3819
|
-
|
|
4067
|
+
addAcsEntrances(body) {
|
|
3820
4068
|
return new SeamHttpRequest(this, {
|
|
3821
|
-
pathname: "/
|
|
4069
|
+
pathname: "/spaces/add_acs_entrances",
|
|
3822
4070
|
method: "post",
|
|
3823
4071
|
body,
|
|
3824
|
-
responseKey:
|
|
4072
|
+
responseKey: void 0
|
|
4073
|
+
});
|
|
4074
|
+
}
|
|
4075
|
+
addDevices(body) {
|
|
4076
|
+
return new SeamHttpRequest(this, {
|
|
4077
|
+
pathname: "/spaces/add_devices",
|
|
4078
|
+
method: "post",
|
|
4079
|
+
body,
|
|
4080
|
+
responseKey: void 0
|
|
4081
|
+
});
|
|
4082
|
+
}
|
|
4083
|
+
create(body) {
|
|
4084
|
+
return new SeamHttpRequest(this, {
|
|
4085
|
+
pathname: "/spaces/create",
|
|
4086
|
+
method: "post",
|
|
4087
|
+
body,
|
|
4088
|
+
responseKey: "space"
|
|
4089
|
+
});
|
|
4090
|
+
}
|
|
4091
|
+
delete(body) {
|
|
4092
|
+
return new SeamHttpRequest(this, {
|
|
4093
|
+
pathname: "/spaces/delete",
|
|
4094
|
+
method: "post",
|
|
4095
|
+
body,
|
|
4096
|
+
responseKey: void 0
|
|
4097
|
+
});
|
|
4098
|
+
}
|
|
4099
|
+
get(body) {
|
|
4100
|
+
return new SeamHttpRequest(this, {
|
|
4101
|
+
pathname: "/spaces/get",
|
|
4102
|
+
method: "post",
|
|
4103
|
+
body,
|
|
4104
|
+
responseKey: "space"
|
|
4105
|
+
});
|
|
4106
|
+
}
|
|
4107
|
+
list(body) {
|
|
4108
|
+
return new SeamHttpRequest(this, {
|
|
4109
|
+
pathname: "/spaces/list",
|
|
4110
|
+
method: "post",
|
|
4111
|
+
body,
|
|
4112
|
+
responseKey: "spaces"
|
|
4113
|
+
});
|
|
4114
|
+
}
|
|
4115
|
+
removeAcsEntrances(body) {
|
|
4116
|
+
return new SeamHttpRequest(this, {
|
|
4117
|
+
pathname: "/spaces/remove_acs_entrances",
|
|
4118
|
+
method: "post",
|
|
4119
|
+
body,
|
|
4120
|
+
responseKey: void 0
|
|
4121
|
+
});
|
|
4122
|
+
}
|
|
4123
|
+
removeDevices(body) {
|
|
4124
|
+
return new SeamHttpRequest(this, {
|
|
4125
|
+
pathname: "/spaces/remove_devices",
|
|
4126
|
+
method: "post",
|
|
4127
|
+
body,
|
|
4128
|
+
responseKey: void 0
|
|
4129
|
+
});
|
|
4130
|
+
}
|
|
4131
|
+
update(body) {
|
|
4132
|
+
return new SeamHttpRequest(this, {
|
|
4133
|
+
pathname: "/spaces/update",
|
|
4134
|
+
method: "post",
|
|
4135
|
+
body,
|
|
4136
|
+
responseKey: "space"
|
|
3825
4137
|
});
|
|
3826
4138
|
}
|
|
3827
4139
|
};
|
|
3828
4140
|
|
|
3829
|
-
// src/lib/seam/connect/routes/
|
|
3830
|
-
var
|
|
4141
|
+
// src/lib/seam/connect/routes/thermostats-daily-programs.ts
|
|
4142
|
+
var SeamHttpThermostatsDailyPrograms = class _SeamHttpThermostatsDailyPrograms {
|
|
3831
4143
|
constructor(apiKeyOrOptions = {}) {
|
|
3832
4144
|
const options = parseOptions(apiKeyOrOptions);
|
|
3833
4145
|
this.client = "client" in options ? options.client : createClient(options);
|
|
@@ -3838,21 +4150,21 @@ var SeamHttpPhones = class _SeamHttpPhones {
|
|
|
3838
4150
|
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
3839
4151
|
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
3840
4152
|
}
|
|
3841
|
-
return new
|
|
4153
|
+
return new _SeamHttpThermostatsDailyPrograms(constructorOptions);
|
|
3842
4154
|
}
|
|
3843
4155
|
static fromApiKey(apiKey, options = {}) {
|
|
3844
4156
|
const constructorOptions = { ...options, apiKey };
|
|
3845
4157
|
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
3846
4158
|
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
3847
4159
|
}
|
|
3848
|
-
return new
|
|
4160
|
+
return new _SeamHttpThermostatsDailyPrograms(constructorOptions);
|
|
3849
4161
|
}
|
|
3850
4162
|
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
3851
4163
|
const constructorOptions = { ...options, clientSessionToken };
|
|
3852
4164
|
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
3853
4165
|
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
3854
4166
|
}
|
|
3855
|
-
return new
|
|
4167
|
+
return new _SeamHttpThermostatsDailyPrograms(constructorOptions);
|
|
3856
4168
|
}
|
|
3857
4169
|
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
3858
4170
|
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
@@ -3867,7 +4179,10 @@ var SeamHttpPhones = class _SeamHttpPhones {
|
|
|
3867
4179
|
const { token } = await clientSessions.getOrCreate({
|
|
3868
4180
|
user_identifier_key: userIdentifierKey
|
|
3869
4181
|
});
|
|
3870
|
-
return
|
|
4182
|
+
return _SeamHttpThermostatsDailyPrograms.fromClientSessionToken(
|
|
4183
|
+
token,
|
|
4184
|
+
options
|
|
4185
|
+
);
|
|
3871
4186
|
}
|
|
3872
4187
|
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
3873
4188
|
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
@@ -3876,7 +4191,7 @@ var SeamHttpPhones = class _SeamHttpPhones {
|
|
|
3876
4191
|
"Missing consoleSessionToken or workspaceId"
|
|
3877
4192
|
);
|
|
3878
4193
|
}
|
|
3879
|
-
return new
|
|
4194
|
+
return new _SeamHttpThermostatsDailyPrograms(constructorOptions);
|
|
3880
4195
|
}
|
|
3881
4196
|
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
3882
4197
|
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
@@ -3885,7 +4200,7 @@ var SeamHttpPhones = class _SeamHttpPhones {
|
|
|
3885
4200
|
"Missing personalAccessToken or workspaceId"
|
|
3886
4201
|
);
|
|
3887
4202
|
}
|
|
3888
|
-
return new
|
|
4203
|
+
return new _SeamHttpThermostatsDailyPrograms(constructorOptions);
|
|
3889
4204
|
}
|
|
3890
4205
|
createPaginator(request) {
|
|
3891
4206
|
return new SeamPaginator(this, request);
|
|
@@ -3906,31 +4221,29 @@ var SeamHttpPhones = class _SeamHttpPhones {
|
|
|
3906
4221
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
3907
4222
|
await clientSessions.get();
|
|
3908
4223
|
}
|
|
3909
|
-
|
|
3910
|
-
return SeamHttpPhonesSimulate.fromClient(this.client, this.defaults);
|
|
3911
|
-
}
|
|
3912
|
-
deactivate(body) {
|
|
4224
|
+
create(body) {
|
|
3913
4225
|
return new SeamHttpRequest(this, {
|
|
3914
|
-
pathname: "/
|
|
4226
|
+
pathname: "/thermostats/daily_programs/create",
|
|
3915
4227
|
method: "post",
|
|
3916
4228
|
body,
|
|
3917
|
-
responseKey:
|
|
4229
|
+
responseKey: "thermostat_daily_program"
|
|
3918
4230
|
});
|
|
3919
4231
|
}
|
|
3920
|
-
|
|
4232
|
+
delete(body) {
|
|
3921
4233
|
return new SeamHttpRequest(this, {
|
|
3922
|
-
pathname: "/
|
|
4234
|
+
pathname: "/thermostats/daily_programs/delete",
|
|
3923
4235
|
method: "post",
|
|
3924
4236
|
body,
|
|
3925
|
-
responseKey:
|
|
4237
|
+
responseKey: void 0
|
|
3926
4238
|
});
|
|
3927
4239
|
}
|
|
3928
|
-
|
|
4240
|
+
update(body, options = {}) {
|
|
3929
4241
|
return new SeamHttpRequest(this, {
|
|
3930
|
-
pathname: "/
|
|
4242
|
+
pathname: "/thermostats/daily_programs/update",
|
|
3931
4243
|
method: "post",
|
|
3932
4244
|
body,
|
|
3933
|
-
responseKey: "
|
|
4245
|
+
responseKey: "action_attempt",
|
|
4246
|
+
options
|
|
3934
4247
|
});
|
|
3935
4248
|
}
|
|
3936
4249
|
};
|
|
@@ -4241,6 +4554,12 @@ var SeamHttpThermostats = class _SeamHttpThermostats {
|
|
|
4241
4554
|
get simulate() {
|
|
4242
4555
|
return SeamHttpThermostatsSimulate.fromClient(this.client, this.defaults);
|
|
4243
4556
|
}
|
|
4557
|
+
get dailyPrograms() {
|
|
4558
|
+
return SeamHttpThermostatsDailyPrograms.fromClient(
|
|
4559
|
+
this.client,
|
|
4560
|
+
this.defaults
|
|
4561
|
+
);
|
|
4562
|
+
}
|
|
4244
4563
|
activateClimatePreset(body, options = {}) {
|
|
4245
4564
|
return new SeamHttpRequest(this, {
|
|
4246
4565
|
pathname: "/thermostats/activate_climate_preset",
|
|
@@ -4352,6 +4671,97 @@ var SeamHttpThermostats = class _SeamHttpThermostats {
|
|
|
4352
4671
|
responseKey: void 0
|
|
4353
4672
|
});
|
|
4354
4673
|
}
|
|
4674
|
+
updateWeeklyProgram(body, options = {}) {
|
|
4675
|
+
return new SeamHttpRequest(this, {
|
|
4676
|
+
pathname: "/thermostats/update_weekly_program",
|
|
4677
|
+
method: "post",
|
|
4678
|
+
body,
|
|
4679
|
+
responseKey: "action_attempt",
|
|
4680
|
+
options
|
|
4681
|
+
});
|
|
4682
|
+
}
|
|
4683
|
+
};
|
|
4684
|
+
|
|
4685
|
+
// src/lib/seam/connect/routes/unstable-partner.ts
|
|
4686
|
+
var SeamHttpUnstablePartner = class _SeamHttpUnstablePartner {
|
|
4687
|
+
constructor(apiKeyOrOptions = {}) {
|
|
4688
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
4689
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
4690
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
4691
|
+
}
|
|
4692
|
+
static fromClient(client, options = {}) {
|
|
4693
|
+
const constructorOptions = { ...options, client };
|
|
4694
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
4695
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
4696
|
+
}
|
|
4697
|
+
return new _SeamHttpUnstablePartner(constructorOptions);
|
|
4698
|
+
}
|
|
4699
|
+
static fromApiKey(apiKey, options = {}) {
|
|
4700
|
+
const constructorOptions = { ...options, apiKey };
|
|
4701
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
4702
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
4703
|
+
}
|
|
4704
|
+
return new _SeamHttpUnstablePartner(constructorOptions);
|
|
4705
|
+
}
|
|
4706
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
4707
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
4708
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
4709
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
4710
|
+
}
|
|
4711
|
+
return new _SeamHttpUnstablePartner(constructorOptions);
|
|
4712
|
+
}
|
|
4713
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
4714
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
4715
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
4716
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
4717
|
+
throw new SeamHttpInvalidOptionsError(
|
|
4718
|
+
"The client option cannot be used with SeamHttp.fromPublishableKey"
|
|
4719
|
+
);
|
|
4720
|
+
}
|
|
4721
|
+
const client = createClient(clientOptions);
|
|
4722
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
4723
|
+
const { token } = await clientSessions.getOrCreate({
|
|
4724
|
+
user_identifier_key: userIdentifierKey
|
|
4725
|
+
});
|
|
4726
|
+
return _SeamHttpUnstablePartner.fromClientSessionToken(token, options);
|
|
4727
|
+
}
|
|
4728
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
4729
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
4730
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
4731
|
+
throw new SeamHttpInvalidOptionsError(
|
|
4732
|
+
"Missing consoleSessionToken or workspaceId"
|
|
4733
|
+
);
|
|
4734
|
+
}
|
|
4735
|
+
return new _SeamHttpUnstablePartner(constructorOptions);
|
|
4736
|
+
}
|
|
4737
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
4738
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
4739
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
4740
|
+
throw new SeamHttpInvalidOptionsError(
|
|
4741
|
+
"Missing personalAccessToken or workspaceId"
|
|
4742
|
+
);
|
|
4743
|
+
}
|
|
4744
|
+
return new _SeamHttpUnstablePartner(constructorOptions);
|
|
4745
|
+
}
|
|
4746
|
+
createPaginator(request) {
|
|
4747
|
+
return new SeamPaginator(this, request);
|
|
4748
|
+
}
|
|
4749
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
4750
|
+
const { headers } = this.client.defaults;
|
|
4751
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
4752
|
+
clientSessionToken
|
|
4753
|
+
});
|
|
4754
|
+
for (const key of Object.keys(authHeaders)) {
|
|
4755
|
+
if (headers[key] == null) {
|
|
4756
|
+
throw new Error(
|
|
4757
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
4758
|
+
);
|
|
4759
|
+
}
|
|
4760
|
+
}
|
|
4761
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
4762
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
4763
|
+
await clientSessions.get();
|
|
4764
|
+
}
|
|
4355
4765
|
};
|
|
4356
4766
|
|
|
4357
4767
|
// src/lib/seam/connect/routes/user-identities-enrollment-automations.ts
|
|
@@ -4898,6 +5308,14 @@ var SeamHttpWorkspaces = class _SeamHttpWorkspaces {
|
|
|
4898
5308
|
options
|
|
4899
5309
|
});
|
|
4900
5310
|
}
|
|
5311
|
+
update(body) {
|
|
5312
|
+
return new SeamHttpRequest(this, {
|
|
5313
|
+
pathname: "/workspaces/update",
|
|
5314
|
+
method: "post",
|
|
5315
|
+
body,
|
|
5316
|
+
responseKey: void 0
|
|
5317
|
+
});
|
|
5318
|
+
}
|
|
4901
5319
|
};
|
|
4902
5320
|
|
|
4903
5321
|
// src/lib/seam/connect/seam-http.ts
|
|
@@ -4984,6 +5402,12 @@ var _SeamHttp = class _SeamHttp {
|
|
|
4984
5402
|
get accessCodes() {
|
|
4985
5403
|
return SeamHttpAccessCodes.fromClient(this.client, this.defaults);
|
|
4986
5404
|
}
|
|
5405
|
+
get accessGrants() {
|
|
5406
|
+
return SeamHttpAccessGrants.fromClient(this.client, this.defaults);
|
|
5407
|
+
}
|
|
5408
|
+
get accessMethods() {
|
|
5409
|
+
return SeamHttpAccessMethods.fromClient(this.client, this.defaults);
|
|
5410
|
+
}
|
|
4987
5411
|
get acs() {
|
|
4988
5412
|
return SeamHttpAcs.fromClient(this.client, this.defaults);
|
|
4989
5413
|
}
|
|
@@ -5008,15 +5432,15 @@ var _SeamHttp = class _SeamHttp {
|
|
|
5008
5432
|
get locks() {
|
|
5009
5433
|
return SeamHttpLocks.fromClient(this.client, this.defaults);
|
|
5010
5434
|
}
|
|
5011
|
-
get networks() {
|
|
5012
|
-
return SeamHttpNetworks.fromClient(this.client, this.defaults);
|
|
5013
|
-
}
|
|
5014
5435
|
get noiseSensors() {
|
|
5015
5436
|
return SeamHttpNoiseSensors.fromClient(this.client, this.defaults);
|
|
5016
5437
|
}
|
|
5017
5438
|
get phones() {
|
|
5018
5439
|
return SeamHttpPhones.fromClient(this.client, this.defaults);
|
|
5019
5440
|
}
|
|
5441
|
+
get spaces() {
|
|
5442
|
+
return SeamHttpSpaces.fromClient(this.client, this.defaults);
|
|
5443
|
+
}
|
|
5020
5444
|
get thermostats() {
|
|
5021
5445
|
return SeamHttpThermostats.fromClient(this.client, this.defaults);
|
|
5022
5446
|
}
|
|
@@ -5081,6 +5505,8 @@ exports.SeamHttp = SeamHttp;
|
|
|
5081
5505
|
exports.SeamHttpAccessCodes = SeamHttpAccessCodes;
|
|
5082
5506
|
exports.SeamHttpAccessCodesSimulate = SeamHttpAccessCodesSimulate;
|
|
5083
5507
|
exports.SeamHttpAccessCodesUnmanaged = SeamHttpAccessCodesUnmanaged;
|
|
5508
|
+
exports.SeamHttpAccessGrants = SeamHttpAccessGrants;
|
|
5509
|
+
exports.SeamHttpAccessMethods = SeamHttpAccessMethods;
|
|
5084
5510
|
exports.SeamHttpAcs = SeamHttpAcs;
|
|
5085
5511
|
exports.SeamHttpAcsAccessGroups = SeamHttpAcsAccessGroups;
|
|
5086
5512
|
exports.SeamHttpAcsCredentials = SeamHttpAcsCredentials;
|
|
@@ -5091,7 +5517,6 @@ exports.SeamHttpAcsSystems = SeamHttpAcsSystems;
|
|
|
5091
5517
|
exports.SeamHttpAcsUsers = SeamHttpAcsUsers;
|
|
5092
5518
|
exports.SeamHttpActionAttempts = SeamHttpActionAttempts;
|
|
5093
5519
|
exports.SeamHttpApiError = SeamHttpApiError;
|
|
5094
|
-
exports.SeamHttpBridges = SeamHttpBridges;
|
|
5095
5520
|
exports.SeamHttpClientSessions = SeamHttpClientSessions;
|
|
5096
5521
|
exports.SeamHttpConnectWebviews = SeamHttpConnectWebviews;
|
|
5097
5522
|
exports.SeamHttpConnectedAccounts = SeamHttpConnectedAccounts;
|
|
@@ -5105,17 +5530,19 @@ exports.SeamHttpInvalidTokenError = SeamHttpInvalidTokenError;
|
|
|
5105
5530
|
exports.SeamHttpLocks = SeamHttpLocks;
|
|
5106
5531
|
exports.SeamHttpMultiWorkspace = SeamHttpMultiWorkspace;
|
|
5107
5532
|
exports.SeamHttpMultiWorkspaceInvalidOptionsError = SeamHttpMultiWorkspaceInvalidOptionsError;
|
|
5108
|
-
exports.SeamHttpNetworks = SeamHttpNetworks;
|
|
5109
5533
|
exports.SeamHttpNoiseSensors = SeamHttpNoiseSensors;
|
|
5110
5534
|
exports.SeamHttpNoiseSensorsNoiseThresholds = SeamHttpNoiseSensorsNoiseThresholds;
|
|
5111
5535
|
exports.SeamHttpNoiseSensorsSimulate = SeamHttpNoiseSensorsSimulate;
|
|
5112
5536
|
exports.SeamHttpPhones = SeamHttpPhones;
|
|
5113
5537
|
exports.SeamHttpPhonesSimulate = SeamHttpPhonesSimulate;
|
|
5114
5538
|
exports.SeamHttpRequest = SeamHttpRequest;
|
|
5539
|
+
exports.SeamHttpSpaces = SeamHttpSpaces;
|
|
5115
5540
|
exports.SeamHttpThermostats = SeamHttpThermostats;
|
|
5541
|
+
exports.SeamHttpThermostatsDailyPrograms = SeamHttpThermostatsDailyPrograms;
|
|
5116
5542
|
exports.SeamHttpThermostatsSchedules = SeamHttpThermostatsSchedules;
|
|
5117
5543
|
exports.SeamHttpThermostatsSimulate = SeamHttpThermostatsSimulate;
|
|
5118
5544
|
exports.SeamHttpUnauthorizedError = SeamHttpUnauthorizedError;
|
|
5545
|
+
exports.SeamHttpUnstablePartner = SeamHttpUnstablePartner;
|
|
5119
5546
|
exports.SeamHttpUserIdentities = SeamHttpUserIdentities;
|
|
5120
5547
|
exports.SeamHttpUserIdentitiesEnrollmentAutomations = SeamHttpUserIdentitiesEnrollmentAutomations;
|
|
5121
5548
|
exports.SeamHttpWebhooks = SeamHttpWebhooks;
|