@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/index.cjs
CHANGED
|
@@ -92,6 +92,7 @@ __export(index_exports, {
|
|
|
92
92
|
SeamHttpEndpoints: () => SeamHttpEndpoints,
|
|
93
93
|
SeamHttpEndpointsWithoutWorkspace: () => SeamHttpEndpointsWithoutWorkspace,
|
|
94
94
|
SeamHttpEvents: () => SeamHttpEvents,
|
|
95
|
+
SeamHttpInstantKeys: () => SeamHttpInstantKeys,
|
|
95
96
|
SeamHttpInvalidInputError: () => SeamHttpInvalidInputError,
|
|
96
97
|
SeamHttpInvalidOptionsError: () => SeamHttpInvalidOptionsError,
|
|
97
98
|
SeamHttpInvalidTokenError: () => SeamHttpInvalidTokenError,
|
|
@@ -192,6 +193,7 @@ __export(connect_exports, {
|
|
|
192
193
|
SeamHttpEndpoints: () => SeamHttpEndpoints,
|
|
193
194
|
SeamHttpEndpointsWithoutWorkspace: () => SeamHttpEndpointsWithoutWorkspace,
|
|
194
195
|
SeamHttpEvents: () => SeamHttpEvents,
|
|
196
|
+
SeamHttpInstantKeys: () => SeamHttpInstantKeys,
|
|
195
197
|
SeamHttpInvalidInputError: () => SeamHttpInvalidInputError,
|
|
196
198
|
SeamHttpInvalidOptionsError: () => SeamHttpInvalidOptionsError,
|
|
197
199
|
SeamHttpInvalidTokenError: () => SeamHttpInvalidTokenError,
|
|
@@ -4635,6 +4637,100 @@ var _SeamHttpEvents = class _SeamHttpEvents {
|
|
|
4635
4637
|
_SeamHttpEvents.ltsVersion = seamApiLtsVersion;
|
|
4636
4638
|
var SeamHttpEvents = _SeamHttpEvents;
|
|
4637
4639
|
|
|
4640
|
+
// src/lib/seam/connect/routes/instant-keys/instant-keys.ts
|
|
4641
|
+
var _SeamHttpInstantKeys = class _SeamHttpInstantKeys {
|
|
4642
|
+
constructor(apiKeyOrOptions = {}) {
|
|
4643
|
+
this.ltsVersion = seamApiLtsVersion;
|
|
4644
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
4645
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
4646
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
4647
|
+
}
|
|
4648
|
+
static fromClient(client, options = {}) {
|
|
4649
|
+
const constructorOptions = { ...options, client };
|
|
4650
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
4651
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
4652
|
+
}
|
|
4653
|
+
return new _SeamHttpInstantKeys(constructorOptions);
|
|
4654
|
+
}
|
|
4655
|
+
static fromApiKey(apiKey, options = {}) {
|
|
4656
|
+
const constructorOptions = { ...options, apiKey };
|
|
4657
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
4658
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
4659
|
+
}
|
|
4660
|
+
return new _SeamHttpInstantKeys(constructorOptions);
|
|
4661
|
+
}
|
|
4662
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
4663
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
4664
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
4665
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
4666
|
+
}
|
|
4667
|
+
return new _SeamHttpInstantKeys(constructorOptions);
|
|
4668
|
+
}
|
|
4669
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
4670
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
4671
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
4672
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
4673
|
+
throw new SeamHttpInvalidOptionsError(
|
|
4674
|
+
"The client option cannot be used with SeamHttpInstantKeys.fromPublishableKey"
|
|
4675
|
+
);
|
|
4676
|
+
}
|
|
4677
|
+
const client = createClient(clientOptions);
|
|
4678
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
4679
|
+
const { token } = await clientSessions.getOrCreate({
|
|
4680
|
+
user_identifier_key: userIdentifierKey
|
|
4681
|
+
});
|
|
4682
|
+
return _SeamHttpInstantKeys.fromClientSessionToken(token, options);
|
|
4683
|
+
}
|
|
4684
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
4685
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
4686
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
4687
|
+
throw new SeamHttpInvalidOptionsError(
|
|
4688
|
+
"Missing consoleSessionToken or workspaceId"
|
|
4689
|
+
);
|
|
4690
|
+
}
|
|
4691
|
+
return new _SeamHttpInstantKeys(constructorOptions);
|
|
4692
|
+
}
|
|
4693
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
4694
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
4695
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
4696
|
+
throw new SeamHttpInvalidOptionsError(
|
|
4697
|
+
"Missing personalAccessToken or workspaceId"
|
|
4698
|
+
);
|
|
4699
|
+
}
|
|
4700
|
+
return new _SeamHttpInstantKeys(constructorOptions);
|
|
4701
|
+
}
|
|
4702
|
+
createPaginator(request) {
|
|
4703
|
+
return new SeamPaginator(this, request);
|
|
4704
|
+
}
|
|
4705
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
4706
|
+
const { headers } = this.client.defaults;
|
|
4707
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
4708
|
+
clientSessionToken
|
|
4709
|
+
});
|
|
4710
|
+
for (const key of Object.keys(authHeaders)) {
|
|
4711
|
+
if (headers[key] == null) {
|
|
4712
|
+
throw new Error(
|
|
4713
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
4714
|
+
);
|
|
4715
|
+
}
|
|
4716
|
+
}
|
|
4717
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
4718
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
4719
|
+
await clientSessions.get();
|
|
4720
|
+
}
|
|
4721
|
+
list(parameters, options = {}) {
|
|
4722
|
+
return new SeamHttpRequest(this, {
|
|
4723
|
+
pathname: "/instant_keys/list",
|
|
4724
|
+
method: "POST",
|
|
4725
|
+
body: parameters,
|
|
4726
|
+
responseKey: "instant_keys",
|
|
4727
|
+
options
|
|
4728
|
+
});
|
|
4729
|
+
}
|
|
4730
|
+
};
|
|
4731
|
+
_SeamHttpInstantKeys.ltsVersion = seamApiLtsVersion;
|
|
4732
|
+
var SeamHttpInstantKeys = _SeamHttpInstantKeys;
|
|
4733
|
+
|
|
4638
4734
|
// src/lib/seam/connect/routes/locks/simulate/simulate.ts
|
|
4639
4735
|
var _SeamHttpLocksSimulate = class _SeamHttpLocksSimulate {
|
|
4640
4736
|
constructor(apiKeyOrOptions = {}) {
|
|
@@ -5487,17 +5583,17 @@ var _SeamHttpSeamConsoleV1 = class _SeamHttpSeamConsoleV1 {
|
|
|
5487
5583
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
5488
5584
|
await clientSessions.get();
|
|
5489
5585
|
}
|
|
5490
|
-
|
|
5586
|
+
getResourceLocator(parameters, options = {}) {
|
|
5491
5587
|
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
5492
5588
|
throw new Error(
|
|
5493
5589
|
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
5494
5590
|
);
|
|
5495
5591
|
}
|
|
5496
5592
|
return new SeamHttpRequest(this, {
|
|
5497
|
-
pathname: "/seam/console/v1/
|
|
5593
|
+
pathname: "/seam/console/v1/get_resource_locator",
|
|
5498
5594
|
method: "GET",
|
|
5499
5595
|
params: parameters,
|
|
5500
|
-
responseKey: "
|
|
5596
|
+
responseKey: "resource_locator",
|
|
5501
5597
|
options
|
|
5502
5598
|
});
|
|
5503
5599
|
}
|
|
@@ -8584,6 +8680,9 @@ var _SeamHttp = class _SeamHttp {
|
|
|
8584
8680
|
get events() {
|
|
8585
8681
|
return SeamHttpEvents.fromClient(this.client, this.defaults);
|
|
8586
8682
|
}
|
|
8683
|
+
get instantKeys() {
|
|
8684
|
+
return SeamHttpInstantKeys.fromClient(this.client, this.defaults);
|
|
8685
|
+
}
|
|
8587
8686
|
get locks() {
|
|
8588
8687
|
return SeamHttpLocks.fromClient(this.client, this.defaults);
|
|
8589
8688
|
}
|
|
@@ -9559,6 +9658,13 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
9559
9658
|
return seam.list(...args);
|
|
9560
9659
|
};
|
|
9561
9660
|
}
|
|
9661
|
+
get ["/instant_keys/list"]() {
|
|
9662
|
+
const { client, defaults } = this;
|
|
9663
|
+
return function instantKeysList(...args) {
|
|
9664
|
+
const seam = SeamHttpInstantKeys.fromClient(client, defaults);
|
|
9665
|
+
return seam.list(...args);
|
|
9666
|
+
};
|
|
9667
|
+
}
|
|
9562
9668
|
get ["/locks/get"]() {
|
|
9563
9669
|
const { client, defaults } = this;
|
|
9564
9670
|
return function locksGet(...args) {
|
|
@@ -9693,16 +9799,16 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
9693
9799
|
return seam.createSandboxPhone(...args);
|
|
9694
9800
|
};
|
|
9695
9801
|
}
|
|
9696
|
-
get ["/seam/console/v1/
|
|
9802
|
+
get ["/seam/console/v1/get_resource_locator"]() {
|
|
9697
9803
|
const { client, defaults } = this;
|
|
9698
9804
|
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
9699
9805
|
throw new Error(
|
|
9700
9806
|
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
9701
9807
|
);
|
|
9702
9808
|
}
|
|
9703
|
-
return function
|
|
9809
|
+
return function seamConsoleV1GetResourceLocator(...args) {
|
|
9704
9810
|
const seam = SeamHttpSeamConsoleV1.fromClient(client, defaults);
|
|
9705
|
-
return seam.
|
|
9811
|
+
return seam.getResourceLocator(...args);
|
|
9706
9812
|
};
|
|
9707
9813
|
}
|
|
9708
9814
|
get ["/seam/customer/v1/automation_runs/list"]() {
|
|
@@ -10664,6 +10770,7 @@ exports.SeamHttpDevicesUnmanaged = SeamHttpDevicesUnmanaged;
|
|
|
10664
10770
|
exports.SeamHttpEndpoints = SeamHttpEndpoints;
|
|
10665
10771
|
exports.SeamHttpEndpointsWithoutWorkspace = SeamHttpEndpointsWithoutWorkspace;
|
|
10666
10772
|
exports.SeamHttpEvents = SeamHttpEvents;
|
|
10773
|
+
exports.SeamHttpInstantKeys = SeamHttpInstantKeys;
|
|
10667
10774
|
exports.SeamHttpInvalidInputError = SeamHttpInvalidInputError;
|
|
10668
10775
|
exports.SeamHttpInvalidOptionsError = SeamHttpInvalidOptionsError;
|
|
10669
10776
|
exports.SeamHttpInvalidTokenError = SeamHttpInvalidTokenError;
|