@seamapi/http 1.50.0 → 1.51.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 +111 -6
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +54 -23
- package/dist/index.cjs +113 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/lib/seam/connect/resolve-action-attempt.d.ts +16 -16
- package/lib/seam/connect/routes/index.d.ts +1 -0
- package/lib/seam/connect/routes/index.js +1 -0
- package/lib/seam/connect/routes/index.js.map +1 -1
- package/lib/seam/connect/routes/instant-keys/index.d.ts +1 -0
- package/lib/seam/connect/routes/instant-keys/index.js +6 -0
- package/lib/seam/connect/routes/instant-keys/index.js.map +1 -0
- package/lib/seam/connect/routes/instant-keys/instant-keys.d.ts +34 -0
- package/lib/seam/connect/routes/instant-keys/instant-keys.js +96 -0
- package/lib/seam/connect/routes/instant-keys/instant-keys.js.map +1 -0
- package/lib/seam/connect/routes/seam/console/v1/v1.d.ts +8 -8
- package/lib/seam/connect/routes/seam/console/v1/v1.js +3 -3
- package/lib/seam/connect/routes/seam/console/v1/v1.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints.d.ts +5 -3
- package/lib/seam/connect/routes/seam-http-endpoints.js +11 -3
- package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
- package/lib/seam/connect/routes/seam-http.d.ts +2 -0
- package/lib/seam/connect/routes/seam-http.js +4 -0
- package/lib/seam/connect/routes/seam-http.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 +1 -0
- package/src/lib/seam/connect/routes/instant-keys/index.ts +6 -0
- package/src/lib/seam/connect/routes/instant-keys/instant-keys.ts +200 -0
- package/src/lib/seam/connect/routes/seam/console/v1/v1.ts +18 -18
- package/src/lib/seam/connect/routes/seam-http-endpoints.ts +32 -12
- package/src/lib/seam/connect/routes/seam-http.ts +5 -0
- package/src/lib/version.ts +1 -1
package/dist/connect.cjs
CHANGED
|
@@ -4399,6 +4399,100 @@ var _SeamHttpEvents = class _SeamHttpEvents {
|
|
|
4399
4399
|
_SeamHttpEvents.ltsVersion = seamApiLtsVersion;
|
|
4400
4400
|
var SeamHttpEvents = _SeamHttpEvents;
|
|
4401
4401
|
|
|
4402
|
+
// src/lib/seam/connect/routes/instant-keys/instant-keys.ts
|
|
4403
|
+
var _SeamHttpInstantKeys = class _SeamHttpInstantKeys {
|
|
4404
|
+
constructor(apiKeyOrOptions = {}) {
|
|
4405
|
+
this.ltsVersion = seamApiLtsVersion;
|
|
4406
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
4407
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
4408
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
4409
|
+
}
|
|
4410
|
+
static fromClient(client, options = {}) {
|
|
4411
|
+
const constructorOptions = { ...options, client };
|
|
4412
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
4413
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
4414
|
+
}
|
|
4415
|
+
return new _SeamHttpInstantKeys(constructorOptions);
|
|
4416
|
+
}
|
|
4417
|
+
static fromApiKey(apiKey, options = {}) {
|
|
4418
|
+
const constructorOptions = { ...options, apiKey };
|
|
4419
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
4420
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
4421
|
+
}
|
|
4422
|
+
return new _SeamHttpInstantKeys(constructorOptions);
|
|
4423
|
+
}
|
|
4424
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
4425
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
4426
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
4427
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
4428
|
+
}
|
|
4429
|
+
return new _SeamHttpInstantKeys(constructorOptions);
|
|
4430
|
+
}
|
|
4431
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
4432
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
4433
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
4434
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
4435
|
+
throw new SeamHttpInvalidOptionsError(
|
|
4436
|
+
"The client option cannot be used with SeamHttpInstantKeys.fromPublishableKey"
|
|
4437
|
+
);
|
|
4438
|
+
}
|
|
4439
|
+
const client = createClient(clientOptions);
|
|
4440
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
4441
|
+
const { token } = await clientSessions.getOrCreate({
|
|
4442
|
+
user_identifier_key: userIdentifierKey
|
|
4443
|
+
});
|
|
4444
|
+
return _SeamHttpInstantKeys.fromClientSessionToken(token, options);
|
|
4445
|
+
}
|
|
4446
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
4447
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
4448
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
4449
|
+
throw new SeamHttpInvalidOptionsError(
|
|
4450
|
+
"Missing consoleSessionToken or workspaceId"
|
|
4451
|
+
);
|
|
4452
|
+
}
|
|
4453
|
+
return new _SeamHttpInstantKeys(constructorOptions);
|
|
4454
|
+
}
|
|
4455
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
4456
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
4457
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
4458
|
+
throw new SeamHttpInvalidOptionsError(
|
|
4459
|
+
"Missing personalAccessToken or workspaceId"
|
|
4460
|
+
);
|
|
4461
|
+
}
|
|
4462
|
+
return new _SeamHttpInstantKeys(constructorOptions);
|
|
4463
|
+
}
|
|
4464
|
+
createPaginator(request) {
|
|
4465
|
+
return new SeamPaginator(this, request);
|
|
4466
|
+
}
|
|
4467
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
4468
|
+
const { headers } = this.client.defaults;
|
|
4469
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
4470
|
+
clientSessionToken
|
|
4471
|
+
});
|
|
4472
|
+
for (const key of Object.keys(authHeaders)) {
|
|
4473
|
+
if (headers[key] == null) {
|
|
4474
|
+
throw new Error(
|
|
4475
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
4476
|
+
);
|
|
4477
|
+
}
|
|
4478
|
+
}
|
|
4479
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
4480
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
4481
|
+
await clientSessions.get();
|
|
4482
|
+
}
|
|
4483
|
+
list(parameters, options = {}) {
|
|
4484
|
+
return new SeamHttpRequest(this, {
|
|
4485
|
+
pathname: "/instant_keys/list",
|
|
4486
|
+
method: "POST",
|
|
4487
|
+
body: parameters,
|
|
4488
|
+
responseKey: "instant_keys",
|
|
4489
|
+
options
|
|
4490
|
+
});
|
|
4491
|
+
}
|
|
4492
|
+
};
|
|
4493
|
+
_SeamHttpInstantKeys.ltsVersion = seamApiLtsVersion;
|
|
4494
|
+
var SeamHttpInstantKeys = _SeamHttpInstantKeys;
|
|
4495
|
+
|
|
4402
4496
|
// src/lib/seam/connect/routes/locks/simulate/simulate.ts
|
|
4403
4497
|
var _SeamHttpLocksSimulate = class _SeamHttpLocksSimulate {
|
|
4404
4498
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -5251,17 +5345,17 @@ var _SeamHttpSeamConsoleV1 = class _SeamHttpSeamConsoleV1 {
|
|
|
5251
5345
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
5252
5346
|
await clientSessions.get();
|
|
5253
5347
|
}
|
|
5254
|
-
|
|
5348
|
+
getResourceLocator(parameters, options = {}) {
|
|
5255
5349
|
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
5256
5350
|
throw new Error(
|
|
5257
5351
|
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
5258
5352
|
);
|
|
5259
5353
|
}
|
|
5260
5354
|
return new SeamHttpRequest(this, {
|
|
5261
|
-
pathname: "/seam/console/v1/
|
|
5355
|
+
pathname: "/seam/console/v1/get_resource_locator",
|
|
5262
5356
|
method: "GET",
|
|
5263
5357
|
params: parameters,
|
|
5264
|
-
responseKey: "
|
|
5358
|
+
responseKey: "resource_locator",
|
|
5265
5359
|
options
|
|
5266
5360
|
});
|
|
5267
5361
|
}
|
|
@@ -8348,6 +8442,9 @@ var _SeamHttp = class _SeamHttp {
|
|
|
8348
8442
|
get events() {
|
|
8349
8443
|
return SeamHttpEvents.fromClient(this.client, this.defaults);
|
|
8350
8444
|
}
|
|
8445
|
+
get instantKeys() {
|
|
8446
|
+
return SeamHttpInstantKeys.fromClient(this.client, this.defaults);
|
|
8447
|
+
}
|
|
8351
8448
|
get locks() {
|
|
8352
8449
|
return SeamHttpLocks.fromClient(this.client, this.defaults);
|
|
8353
8450
|
}
|
|
@@ -9323,6 +9420,13 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
9323
9420
|
return seam.list(...args);
|
|
9324
9421
|
};
|
|
9325
9422
|
}
|
|
9423
|
+
get ["/instant_keys/list"]() {
|
|
9424
|
+
const { client, defaults } = this;
|
|
9425
|
+
return function instantKeysList(...args) {
|
|
9426
|
+
const seam = SeamHttpInstantKeys.fromClient(client, defaults);
|
|
9427
|
+
return seam.list(...args);
|
|
9428
|
+
};
|
|
9429
|
+
}
|
|
9326
9430
|
get ["/locks/get"]() {
|
|
9327
9431
|
const { client, defaults } = this;
|
|
9328
9432
|
return function locksGet(...args) {
|
|
@@ -9457,16 +9561,16 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
9457
9561
|
return seam.createSandboxPhone(...args);
|
|
9458
9562
|
};
|
|
9459
9563
|
}
|
|
9460
|
-
get ["/seam/console/v1/
|
|
9564
|
+
get ["/seam/console/v1/get_resource_locator"]() {
|
|
9461
9565
|
const { client, defaults } = this;
|
|
9462
9566
|
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
9463
9567
|
throw new Error(
|
|
9464
9568
|
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
9465
9569
|
);
|
|
9466
9570
|
}
|
|
9467
|
-
return function
|
|
9571
|
+
return function seamConsoleV1GetResourceLocator(...args) {
|
|
9468
9572
|
const seam = SeamHttpSeamConsoleV1.fromClient(client, defaults);
|
|
9469
|
-
return seam.
|
|
9573
|
+
return seam.getResourceLocator(...args);
|
|
9470
9574
|
};
|
|
9471
9575
|
}
|
|
9472
9576
|
get ["/seam/customer/v1/automation_runs/list"]() {
|
|
@@ -10422,6 +10526,7 @@ exports.SeamHttpDevicesUnmanaged = SeamHttpDevicesUnmanaged;
|
|
|
10422
10526
|
exports.SeamHttpEndpoints = SeamHttpEndpoints;
|
|
10423
10527
|
exports.SeamHttpEndpointsWithoutWorkspace = SeamHttpEndpointsWithoutWorkspace;
|
|
10424
10528
|
exports.SeamHttpEvents = SeamHttpEvents;
|
|
10529
|
+
exports.SeamHttpInstantKeys = SeamHttpInstantKeys;
|
|
10425
10530
|
exports.SeamHttpInvalidInputError = SeamHttpInvalidInputError;
|
|
10426
10531
|
exports.SeamHttpInvalidOptionsError = SeamHttpInvalidOptionsError;
|
|
10427
10532
|
exports.SeamHttpInvalidTokenError = SeamHttpInvalidTokenError;
|