@seamapi/http 1.49.0 → 1.50.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 +237 -146
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +63 -47
- package/dist/index.cjs +241 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/lib/seam/connect/routes/index.d.ts +0 -1
- package/lib/seam/connect/routes/index.js +0 -1
- package/lib/seam/connect/routes/index.js.map +1 -1
- package/lib/seam/connect/routes/seam/console/console.d.ts +21 -0
- package/lib/seam/connect/routes/seam/console/console.js +93 -0
- package/lib/seam/connect/routes/seam/console/console.js.map +1 -0
- package/lib/seam/connect/routes/seam/console/index.d.ts +2 -0
- package/lib/seam/connect/routes/seam/console/index.js +7 -0
- package/lib/seam/connect/routes/seam/console/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/console/v1/index.d.ts +1 -0
- package/lib/seam/connect/routes/{networks → seam/console/v1}/index.js +1 -1
- package/lib/seam/connect/routes/seam/console/v1/index.js.map +1 -0
- package/lib/seam/connect/routes/{networks/networks.d.ts → seam/console/v1/v1.d.ts} +21 -34
- package/lib/seam/connect/routes/{networks/networks.js → seam/console/v1/v1.js} +23 -35
- package/lib/seam/connect/routes/seam/console/v1/v1.js.map +1 -0
- package/lib/seam/connect/routes/seam/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/index.js +1 -0
- package/lib/seam/connect/routes/seam/index.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints.d.ts +5 -5
- package/lib/seam/connect/routes/seam-http-endpoints.js +21 -21
- package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
- package/lib/seam/connect/routes/seam-http.d.ts +0 -2
- package/lib/seam/connect/routes/seam-http.js +0 -4
- package/lib/seam/connect/routes/seam-http.js.map +1 -1
- package/lib/seam/connect/routes/workspaces/workspaces.d.ts +13 -0
- package/lib/seam/connect/routes/workspaces/workspaces.js +12 -0
- package/lib/seam/connect/routes/workspaces/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/index.ts +0 -1
- package/src/lib/seam/connect/routes/seam/console/console.ts +173 -0
- package/src/lib/seam/connect/routes/seam/console/index.ts +7 -0
- package/src/lib/seam/connect/routes/{networks → seam/console/v1}/index.ts +1 -1
- package/src/lib/seam/connect/routes/{networks/networks.ts → seam/console/v1/v1.ts} +35 -70
- package/src/lib/seam/connect/routes/seam/index.ts +1 -0
- package/src/lib/seam/connect/routes/seam-http-endpoints.ts +47 -47
- package/src/lib/seam/connect/routes/seam-http.ts +0 -5
- package/src/lib/seam/connect/routes/workspaces/workspaces.ts +41 -0
- package/src/lib/version.ts +1 -1
- package/lib/seam/connect/routes/networks/index.d.ts +0 -1
- package/lib/seam/connect/routes/networks/index.js.map +0 -1
- package/lib/seam/connect/routes/networks/networks.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -98,13 +98,14 @@ __export(index_exports, {
|
|
|
98
98
|
SeamHttpLocks: () => SeamHttpLocks,
|
|
99
99
|
SeamHttpLocksSimulate: () => SeamHttpLocksSimulate,
|
|
100
100
|
SeamHttpMultiWorkspace: () => SeamHttpMultiWorkspace,
|
|
101
|
-
SeamHttpNetworks: () => SeamHttpNetworks,
|
|
102
101
|
SeamHttpNoiseSensors: () => SeamHttpNoiseSensors,
|
|
103
102
|
SeamHttpNoiseSensorsNoiseThresholds: () => SeamHttpNoiseSensorsNoiseThresholds,
|
|
104
103
|
SeamHttpNoiseSensorsSimulate: () => SeamHttpNoiseSensorsSimulate,
|
|
105
104
|
SeamHttpPhones: () => SeamHttpPhones,
|
|
106
105
|
SeamHttpPhonesSimulate: () => SeamHttpPhonesSimulate,
|
|
107
106
|
SeamHttpRequest: () => SeamHttpRequest,
|
|
107
|
+
SeamHttpSeamConsole: () => SeamHttpSeamConsole,
|
|
108
|
+
SeamHttpSeamConsoleV1: () => SeamHttpSeamConsoleV1,
|
|
108
109
|
SeamHttpSeamCustomerV1: () => SeamHttpSeamCustomerV1,
|
|
109
110
|
SeamHttpSeamCustomerV1AutomationRuns: () => SeamHttpSeamCustomerV1AutomationRuns,
|
|
110
111
|
SeamHttpSeamCustomerV1Automations: () => SeamHttpSeamCustomerV1Automations,
|
|
@@ -197,13 +198,14 @@ __export(connect_exports, {
|
|
|
197
198
|
SeamHttpLocks: () => SeamHttpLocks,
|
|
198
199
|
SeamHttpLocksSimulate: () => SeamHttpLocksSimulate,
|
|
199
200
|
SeamHttpMultiWorkspace: () => SeamHttpMultiWorkspace,
|
|
200
|
-
SeamHttpNetworks: () => SeamHttpNetworks,
|
|
201
201
|
SeamHttpNoiseSensors: () => SeamHttpNoiseSensors,
|
|
202
202
|
SeamHttpNoiseSensorsNoiseThresholds: () => SeamHttpNoiseSensorsNoiseThresholds,
|
|
203
203
|
SeamHttpNoiseSensorsSimulate: () => SeamHttpNoiseSensorsSimulate,
|
|
204
204
|
SeamHttpPhones: () => SeamHttpPhones,
|
|
205
205
|
SeamHttpPhonesSimulate: () => SeamHttpPhonesSimulate,
|
|
206
206
|
SeamHttpRequest: () => SeamHttpRequest,
|
|
207
|
+
SeamHttpSeamConsole: () => SeamHttpSeamConsole,
|
|
208
|
+
SeamHttpSeamConsoleV1: () => SeamHttpSeamConsoleV1,
|
|
207
209
|
SeamHttpSeamCustomerV1: () => SeamHttpSeamCustomerV1,
|
|
208
210
|
SeamHttpSeamCustomerV1AutomationRuns: () => SeamHttpSeamCustomerV1AutomationRuns,
|
|
209
211
|
SeamHttpSeamCustomerV1Automations: () => SeamHttpSeamCustomerV1Automations,
|
|
@@ -4860,124 +4862,6 @@ var _SeamHttpLocks = class _SeamHttpLocks {
|
|
|
4860
4862
|
_SeamHttpLocks.ltsVersion = seamApiLtsVersion;
|
|
4861
4863
|
var SeamHttpLocks = _SeamHttpLocks;
|
|
4862
4864
|
|
|
4863
|
-
// src/lib/seam/connect/routes/networks/networks.ts
|
|
4864
|
-
var _SeamHttpNetworks = class _SeamHttpNetworks {
|
|
4865
|
-
constructor(apiKeyOrOptions = {}) {
|
|
4866
|
-
this.ltsVersion = seamApiLtsVersion;
|
|
4867
|
-
const options = parseOptions(apiKeyOrOptions);
|
|
4868
|
-
if (!options.isUndocumentedApiEnabled) {
|
|
4869
|
-
throw new Error(
|
|
4870
|
-
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
4871
|
-
);
|
|
4872
|
-
}
|
|
4873
|
-
this.client = "client" in options ? options.client : createClient(options);
|
|
4874
|
-
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
4875
|
-
}
|
|
4876
|
-
static fromClient(client, options = {}) {
|
|
4877
|
-
const constructorOptions = { ...options, client };
|
|
4878
|
-
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
4879
|
-
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
4880
|
-
}
|
|
4881
|
-
return new _SeamHttpNetworks(constructorOptions);
|
|
4882
|
-
}
|
|
4883
|
-
static fromApiKey(apiKey, options = {}) {
|
|
4884
|
-
const constructorOptions = { ...options, apiKey };
|
|
4885
|
-
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
4886
|
-
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
4887
|
-
}
|
|
4888
|
-
return new _SeamHttpNetworks(constructorOptions);
|
|
4889
|
-
}
|
|
4890
|
-
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
4891
|
-
const constructorOptions = { ...options, clientSessionToken };
|
|
4892
|
-
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
4893
|
-
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
4894
|
-
}
|
|
4895
|
-
return new _SeamHttpNetworks(constructorOptions);
|
|
4896
|
-
}
|
|
4897
|
-
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
4898
|
-
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
4899
|
-
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
4900
|
-
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
4901
|
-
throw new SeamHttpInvalidOptionsError(
|
|
4902
|
-
"The client option cannot be used with SeamHttpNetworks.fromPublishableKey"
|
|
4903
|
-
);
|
|
4904
|
-
}
|
|
4905
|
-
const client = createClient(clientOptions);
|
|
4906
|
-
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
4907
|
-
const { token } = await clientSessions.getOrCreate({
|
|
4908
|
-
user_identifier_key: userIdentifierKey
|
|
4909
|
-
});
|
|
4910
|
-
return _SeamHttpNetworks.fromClientSessionToken(token, options);
|
|
4911
|
-
}
|
|
4912
|
-
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
4913
|
-
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
4914
|
-
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
4915
|
-
throw new SeamHttpInvalidOptionsError(
|
|
4916
|
-
"Missing consoleSessionToken or workspaceId"
|
|
4917
|
-
);
|
|
4918
|
-
}
|
|
4919
|
-
return new _SeamHttpNetworks(constructorOptions);
|
|
4920
|
-
}
|
|
4921
|
-
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
4922
|
-
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
4923
|
-
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
4924
|
-
throw new SeamHttpInvalidOptionsError(
|
|
4925
|
-
"Missing personalAccessToken or workspaceId"
|
|
4926
|
-
);
|
|
4927
|
-
}
|
|
4928
|
-
return new _SeamHttpNetworks(constructorOptions);
|
|
4929
|
-
}
|
|
4930
|
-
createPaginator(request) {
|
|
4931
|
-
return new SeamPaginator(this, request);
|
|
4932
|
-
}
|
|
4933
|
-
async updateClientSessionToken(clientSessionToken) {
|
|
4934
|
-
const { headers } = this.client.defaults;
|
|
4935
|
-
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
4936
|
-
clientSessionToken
|
|
4937
|
-
});
|
|
4938
|
-
for (const key of Object.keys(authHeaders)) {
|
|
4939
|
-
if (headers[key] == null) {
|
|
4940
|
-
throw new Error(
|
|
4941
|
-
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
4942
|
-
);
|
|
4943
|
-
}
|
|
4944
|
-
}
|
|
4945
|
-
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
4946
|
-
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
4947
|
-
await clientSessions.get();
|
|
4948
|
-
}
|
|
4949
|
-
get(parameters, options = {}) {
|
|
4950
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
4951
|
-
throw new Error(
|
|
4952
|
-
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
4953
|
-
);
|
|
4954
|
-
}
|
|
4955
|
-
return new SeamHttpRequest(this, {
|
|
4956
|
-
pathname: "/networks/get",
|
|
4957
|
-
method: "POST",
|
|
4958
|
-
body: parameters,
|
|
4959
|
-
responseKey: "network",
|
|
4960
|
-
options
|
|
4961
|
-
});
|
|
4962
|
-
}
|
|
4963
|
-
list(parameters, options = {}) {
|
|
4964
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
4965
|
-
throw new Error(
|
|
4966
|
-
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
4967
|
-
);
|
|
4968
|
-
}
|
|
4969
|
-
return new SeamHttpRequest(this, {
|
|
4970
|
-
pathname: "/networks/list",
|
|
4971
|
-
method: "POST",
|
|
4972
|
-
body: parameters,
|
|
4973
|
-
responseKey: "networks",
|
|
4974
|
-
options
|
|
4975
|
-
});
|
|
4976
|
-
}
|
|
4977
|
-
};
|
|
4978
|
-
_SeamHttpNetworks.ltsVersion = seamApiLtsVersion;
|
|
4979
|
-
var SeamHttpNetworks = _SeamHttpNetworks;
|
|
4980
|
-
|
|
4981
4865
|
// src/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.ts
|
|
4982
4866
|
var _SeamHttpNoiseSensorsNoiseThresholds = class _SeamHttpNoiseSensorsNoiseThresholds {
|
|
4983
4867
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -5517,6 +5401,203 @@ var _SeamHttpPhones = class _SeamHttpPhones {
|
|
|
5517
5401
|
_SeamHttpPhones.ltsVersion = seamApiLtsVersion;
|
|
5518
5402
|
var SeamHttpPhones = _SeamHttpPhones;
|
|
5519
5403
|
|
|
5404
|
+
// src/lib/seam/connect/routes/seam/console/v1/v1.ts
|
|
5405
|
+
var _SeamHttpSeamConsoleV1 = class _SeamHttpSeamConsoleV1 {
|
|
5406
|
+
constructor(apiKeyOrOptions = {}) {
|
|
5407
|
+
this.ltsVersion = seamApiLtsVersion;
|
|
5408
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
5409
|
+
if (!options.isUndocumentedApiEnabled) {
|
|
5410
|
+
throw new Error(
|
|
5411
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
5412
|
+
);
|
|
5413
|
+
}
|
|
5414
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
5415
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
5416
|
+
}
|
|
5417
|
+
static fromClient(client, options = {}) {
|
|
5418
|
+
const constructorOptions = { ...options, client };
|
|
5419
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
5420
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
5421
|
+
}
|
|
5422
|
+
return new _SeamHttpSeamConsoleV1(constructorOptions);
|
|
5423
|
+
}
|
|
5424
|
+
static fromApiKey(apiKey, options = {}) {
|
|
5425
|
+
const constructorOptions = { ...options, apiKey };
|
|
5426
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
5427
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
5428
|
+
}
|
|
5429
|
+
return new _SeamHttpSeamConsoleV1(constructorOptions);
|
|
5430
|
+
}
|
|
5431
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
5432
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
5433
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
5434
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
5435
|
+
}
|
|
5436
|
+
return new _SeamHttpSeamConsoleV1(constructorOptions);
|
|
5437
|
+
}
|
|
5438
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
5439
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
5440
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
5441
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
5442
|
+
throw new SeamHttpInvalidOptionsError(
|
|
5443
|
+
"The client option cannot be used with SeamHttpSeamConsoleV1.fromPublishableKey"
|
|
5444
|
+
);
|
|
5445
|
+
}
|
|
5446
|
+
const client = createClient(clientOptions);
|
|
5447
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
5448
|
+
const { token } = await clientSessions.getOrCreate({
|
|
5449
|
+
user_identifier_key: userIdentifierKey
|
|
5450
|
+
});
|
|
5451
|
+
return _SeamHttpSeamConsoleV1.fromClientSessionToken(token, options);
|
|
5452
|
+
}
|
|
5453
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
5454
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
5455
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
5456
|
+
throw new SeamHttpInvalidOptionsError(
|
|
5457
|
+
"Missing consoleSessionToken or workspaceId"
|
|
5458
|
+
);
|
|
5459
|
+
}
|
|
5460
|
+
return new _SeamHttpSeamConsoleV1(constructorOptions);
|
|
5461
|
+
}
|
|
5462
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
5463
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
5464
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
5465
|
+
throw new SeamHttpInvalidOptionsError(
|
|
5466
|
+
"Missing personalAccessToken or workspaceId"
|
|
5467
|
+
);
|
|
5468
|
+
}
|
|
5469
|
+
return new _SeamHttpSeamConsoleV1(constructorOptions);
|
|
5470
|
+
}
|
|
5471
|
+
createPaginator(request) {
|
|
5472
|
+
return new SeamPaginator(this, request);
|
|
5473
|
+
}
|
|
5474
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
5475
|
+
const { headers } = this.client.defaults;
|
|
5476
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
5477
|
+
clientSessionToken
|
|
5478
|
+
});
|
|
5479
|
+
for (const key of Object.keys(authHeaders)) {
|
|
5480
|
+
if (headers[key] == null) {
|
|
5481
|
+
throw new Error(
|
|
5482
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
5483
|
+
);
|
|
5484
|
+
}
|
|
5485
|
+
}
|
|
5486
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
5487
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
5488
|
+
await clientSessions.get();
|
|
5489
|
+
}
|
|
5490
|
+
getResourceType(parameters, options = {}) {
|
|
5491
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
5492
|
+
throw new Error(
|
|
5493
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
5494
|
+
);
|
|
5495
|
+
}
|
|
5496
|
+
return new SeamHttpRequest(this, {
|
|
5497
|
+
pathname: "/seam/console/v1/get_resource_type",
|
|
5498
|
+
method: "GET",
|
|
5499
|
+
params: parameters,
|
|
5500
|
+
responseKey: "resource_type",
|
|
5501
|
+
options
|
|
5502
|
+
});
|
|
5503
|
+
}
|
|
5504
|
+
};
|
|
5505
|
+
_SeamHttpSeamConsoleV1.ltsVersion = seamApiLtsVersion;
|
|
5506
|
+
var SeamHttpSeamConsoleV1 = _SeamHttpSeamConsoleV1;
|
|
5507
|
+
|
|
5508
|
+
// src/lib/seam/connect/routes/seam/console/console.ts
|
|
5509
|
+
var _SeamHttpSeamConsole = class _SeamHttpSeamConsole {
|
|
5510
|
+
constructor(apiKeyOrOptions = {}) {
|
|
5511
|
+
this.ltsVersion = seamApiLtsVersion;
|
|
5512
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
5513
|
+
if (!options.isUndocumentedApiEnabled) {
|
|
5514
|
+
throw new Error(
|
|
5515
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
5516
|
+
);
|
|
5517
|
+
}
|
|
5518
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
5519
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
5520
|
+
}
|
|
5521
|
+
static fromClient(client, options = {}) {
|
|
5522
|
+
const constructorOptions = { ...options, client };
|
|
5523
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
5524
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
5525
|
+
}
|
|
5526
|
+
return new _SeamHttpSeamConsole(constructorOptions);
|
|
5527
|
+
}
|
|
5528
|
+
static fromApiKey(apiKey, options = {}) {
|
|
5529
|
+
const constructorOptions = { ...options, apiKey };
|
|
5530
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
5531
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
5532
|
+
}
|
|
5533
|
+
return new _SeamHttpSeamConsole(constructorOptions);
|
|
5534
|
+
}
|
|
5535
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
5536
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
5537
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
5538
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
5539
|
+
}
|
|
5540
|
+
return new _SeamHttpSeamConsole(constructorOptions);
|
|
5541
|
+
}
|
|
5542
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
5543
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
5544
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
5545
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
5546
|
+
throw new SeamHttpInvalidOptionsError(
|
|
5547
|
+
"The client option cannot be used with SeamHttpSeamConsole.fromPublishableKey"
|
|
5548
|
+
);
|
|
5549
|
+
}
|
|
5550
|
+
const client = createClient(clientOptions);
|
|
5551
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
5552
|
+
const { token } = await clientSessions.getOrCreate({
|
|
5553
|
+
user_identifier_key: userIdentifierKey
|
|
5554
|
+
});
|
|
5555
|
+
return _SeamHttpSeamConsole.fromClientSessionToken(token, options);
|
|
5556
|
+
}
|
|
5557
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
5558
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
5559
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
5560
|
+
throw new SeamHttpInvalidOptionsError(
|
|
5561
|
+
"Missing consoleSessionToken or workspaceId"
|
|
5562
|
+
);
|
|
5563
|
+
}
|
|
5564
|
+
return new _SeamHttpSeamConsole(constructorOptions);
|
|
5565
|
+
}
|
|
5566
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
5567
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
5568
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
5569
|
+
throw new SeamHttpInvalidOptionsError(
|
|
5570
|
+
"Missing personalAccessToken or workspaceId"
|
|
5571
|
+
);
|
|
5572
|
+
}
|
|
5573
|
+
return new _SeamHttpSeamConsole(constructorOptions);
|
|
5574
|
+
}
|
|
5575
|
+
createPaginator(request) {
|
|
5576
|
+
return new SeamPaginator(this, request);
|
|
5577
|
+
}
|
|
5578
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
5579
|
+
const { headers } = this.client.defaults;
|
|
5580
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
5581
|
+
clientSessionToken
|
|
5582
|
+
});
|
|
5583
|
+
for (const key of Object.keys(authHeaders)) {
|
|
5584
|
+
if (headers[key] == null) {
|
|
5585
|
+
throw new Error(
|
|
5586
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
5587
|
+
);
|
|
5588
|
+
}
|
|
5589
|
+
}
|
|
5590
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
5591
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
5592
|
+
await clientSessions.get();
|
|
5593
|
+
}
|
|
5594
|
+
get v1() {
|
|
5595
|
+
return SeamHttpSeamConsoleV1.fromClient(this.client, this.defaults);
|
|
5596
|
+
}
|
|
5597
|
+
};
|
|
5598
|
+
_SeamHttpSeamConsole.ltsVersion = seamApiLtsVersion;
|
|
5599
|
+
var SeamHttpSeamConsole = _SeamHttpSeamConsole;
|
|
5600
|
+
|
|
5520
5601
|
// src/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.ts
|
|
5521
5602
|
var _SeamHttpSeamCustomerV1AutomationRuns = class _SeamHttpSeamCustomerV1AutomationRuns {
|
|
5522
5603
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -8332,6 +8413,20 @@ var _SeamHttpWorkspaces = class _SeamHttpWorkspaces {
|
|
|
8332
8413
|
options
|
|
8333
8414
|
});
|
|
8334
8415
|
}
|
|
8416
|
+
findResources(parameters, options = {}) {
|
|
8417
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
8418
|
+
throw new Error(
|
|
8419
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
8420
|
+
);
|
|
8421
|
+
}
|
|
8422
|
+
return new SeamHttpRequest(this, {
|
|
8423
|
+
pathname: "/workspaces/find_resources",
|
|
8424
|
+
method: "GET",
|
|
8425
|
+
params: parameters,
|
|
8426
|
+
responseKey: "batch",
|
|
8427
|
+
options
|
|
8428
|
+
});
|
|
8429
|
+
}
|
|
8335
8430
|
get(parameters, options = {}) {
|
|
8336
8431
|
return new SeamHttpRequest(this, {
|
|
8337
8432
|
pathname: "/workspaces/get",
|
|
@@ -8492,9 +8587,6 @@ var _SeamHttp = class _SeamHttp {
|
|
|
8492
8587
|
get locks() {
|
|
8493
8588
|
return SeamHttpLocks.fromClient(this.client, this.defaults);
|
|
8494
8589
|
}
|
|
8495
|
-
get networks() {
|
|
8496
|
-
return SeamHttpNetworks.fromClient(this.client, this.defaults);
|
|
8497
|
-
}
|
|
8498
8590
|
get noiseSensors() {
|
|
8499
8591
|
return SeamHttpNoiseSensors.fromClient(this.client, this.defaults);
|
|
8500
8592
|
}
|
|
@@ -9509,30 +9601,6 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
9509
9601
|
return seam.manualLockViaKeypad(...args);
|
|
9510
9602
|
};
|
|
9511
9603
|
}
|
|
9512
|
-
get ["/networks/get"]() {
|
|
9513
|
-
const { client, defaults } = this;
|
|
9514
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
9515
|
-
throw new Error(
|
|
9516
|
-
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
9517
|
-
);
|
|
9518
|
-
}
|
|
9519
|
-
return function networksGet(...args) {
|
|
9520
|
-
const seam = SeamHttpNetworks.fromClient(client, defaults);
|
|
9521
|
-
return seam.get(...args);
|
|
9522
|
-
};
|
|
9523
|
-
}
|
|
9524
|
-
get ["/networks/list"]() {
|
|
9525
|
-
const { client, defaults } = this;
|
|
9526
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
9527
|
-
throw new Error(
|
|
9528
|
-
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
9529
|
-
);
|
|
9530
|
-
}
|
|
9531
|
-
return function networksList(...args) {
|
|
9532
|
-
const seam = SeamHttpNetworks.fromClient(client, defaults);
|
|
9533
|
-
return seam.list(...args);
|
|
9534
|
-
};
|
|
9535
|
-
}
|
|
9536
9604
|
get ["/noise_sensors/list"]() {
|
|
9537
9605
|
const { client, defaults } = this;
|
|
9538
9606
|
return function noiseSensorsList(...args) {
|
|
@@ -9625,6 +9693,18 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
9625
9693
|
return seam.createSandboxPhone(...args);
|
|
9626
9694
|
};
|
|
9627
9695
|
}
|
|
9696
|
+
get ["/seam/console/v1/get_resource_type"]() {
|
|
9697
|
+
const { client, defaults } = this;
|
|
9698
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
9699
|
+
throw new Error(
|
|
9700
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
9701
|
+
);
|
|
9702
|
+
}
|
|
9703
|
+
return function seamConsoleV1GetResourceType(...args) {
|
|
9704
|
+
const seam = SeamHttpSeamConsoleV1.fromClient(client, defaults);
|
|
9705
|
+
return seam.getResourceType(...args);
|
|
9706
|
+
};
|
|
9707
|
+
}
|
|
9628
9708
|
get ["/seam/customer/v1/automation_runs/list"]() {
|
|
9629
9709
|
const { client, defaults } = this;
|
|
9630
9710
|
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
@@ -10399,6 +10479,18 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
10399
10479
|
return seam.create(...args);
|
|
10400
10480
|
};
|
|
10401
10481
|
}
|
|
10482
|
+
get ["/workspaces/find_resources"]() {
|
|
10483
|
+
const { client, defaults } = this;
|
|
10484
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
10485
|
+
throw new Error(
|
|
10486
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
10487
|
+
);
|
|
10488
|
+
}
|
|
10489
|
+
return function workspacesFindResources(...args) {
|
|
10490
|
+
const seam = SeamHttpWorkspaces.fromClient(client, defaults);
|
|
10491
|
+
return seam.findResources(...args);
|
|
10492
|
+
};
|
|
10493
|
+
}
|
|
10402
10494
|
get ["/workspaces/get"]() {
|
|
10403
10495
|
const { client, defaults } = this;
|
|
10404
10496
|
return function workspacesGet(...args) {
|
|
@@ -10578,13 +10670,14 @@ exports.SeamHttpInvalidTokenError = SeamHttpInvalidTokenError;
|
|
|
10578
10670
|
exports.SeamHttpLocks = SeamHttpLocks;
|
|
10579
10671
|
exports.SeamHttpLocksSimulate = SeamHttpLocksSimulate;
|
|
10580
10672
|
exports.SeamHttpMultiWorkspace = SeamHttpMultiWorkspace;
|
|
10581
|
-
exports.SeamHttpNetworks = SeamHttpNetworks;
|
|
10582
10673
|
exports.SeamHttpNoiseSensors = SeamHttpNoiseSensors;
|
|
10583
10674
|
exports.SeamHttpNoiseSensorsNoiseThresholds = SeamHttpNoiseSensorsNoiseThresholds;
|
|
10584
10675
|
exports.SeamHttpNoiseSensorsSimulate = SeamHttpNoiseSensorsSimulate;
|
|
10585
10676
|
exports.SeamHttpPhones = SeamHttpPhones;
|
|
10586
10677
|
exports.SeamHttpPhonesSimulate = SeamHttpPhonesSimulate;
|
|
10587
10678
|
exports.SeamHttpRequest = SeamHttpRequest;
|
|
10679
|
+
exports.SeamHttpSeamConsole = SeamHttpSeamConsole;
|
|
10680
|
+
exports.SeamHttpSeamConsoleV1 = SeamHttpSeamConsoleV1;
|
|
10588
10681
|
exports.SeamHttpSeamCustomerV1 = SeamHttpSeamCustomerV1;
|
|
10589
10682
|
exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationRuns;
|
|
10590
10683
|
exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;
|