@seamapi/http 1.50.0 → 1.52.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.
Files changed (35) hide show
  1. package/dist/connect.cjs +127 -6
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +68 -23
  4. package/dist/index.cjs +129 -6
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/lib/seam/connect/resolve-action-attempt.d.ts +16 -16
  8. package/lib/seam/connect/routes/index.d.ts +1 -0
  9. package/lib/seam/connect/routes/index.js +1 -0
  10. package/lib/seam/connect/routes/index.js.map +1 -1
  11. package/lib/seam/connect/routes/instant-keys/index.d.ts +1 -0
  12. package/lib/seam/connect/routes/instant-keys/index.js +6 -0
  13. package/lib/seam/connect/routes/instant-keys/index.js.map +1 -0
  14. package/lib/seam/connect/routes/instant-keys/instant-keys.d.ts +47 -0
  15. package/lib/seam/connect/routes/instant-keys/instant-keys.js +105 -0
  16. package/lib/seam/connect/routes/instant-keys/instant-keys.js.map +1 -0
  17. package/lib/seam/connect/routes/seam/console/v1/v1.d.ts +8 -8
  18. package/lib/seam/connect/routes/seam/console/v1/v1.js +3 -3
  19. package/lib/seam/connect/routes/seam/console/v1/v1.js.map +1 -1
  20. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +6 -3
  21. package/lib/seam/connect/routes/seam-http-endpoints.js +18 -3
  22. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  23. package/lib/seam/connect/routes/seam-http.d.ts +2 -0
  24. package/lib/seam/connect/routes/seam-http.js +4 -0
  25. package/lib/seam/connect/routes/seam-http.js.map +1 -1
  26. package/lib/version.d.ts +1 -1
  27. package/lib/version.js +1 -1
  28. package/package.json +3 -3
  29. package/src/lib/seam/connect/routes/index.ts +1 -0
  30. package/src/lib/seam/connect/routes/instant-keys/index.ts +6 -0
  31. package/src/lib/seam/connect/routes/instant-keys/instant-keys.ts +235 -0
  32. package/src/lib/seam/connect/routes/seam/console/v1/v1.ts +18 -18
  33. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +49 -12
  34. package/src/lib/seam/connect/routes/seam-http.ts +5 -0
  35. 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,109 @@ 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
+ get(parameters, options = {}) {
4722
+ return new SeamHttpRequest(this, {
4723
+ pathname: "/instant_keys/get",
4724
+ method: "POST",
4725
+ body: parameters,
4726
+ responseKey: "instant_key",
4727
+ options
4728
+ });
4729
+ }
4730
+ list(parameters, options = {}) {
4731
+ return new SeamHttpRequest(this, {
4732
+ pathname: "/instant_keys/list",
4733
+ method: "POST",
4734
+ body: parameters,
4735
+ responseKey: "instant_keys",
4736
+ options
4737
+ });
4738
+ }
4739
+ };
4740
+ _SeamHttpInstantKeys.ltsVersion = seamApiLtsVersion;
4741
+ var SeamHttpInstantKeys = _SeamHttpInstantKeys;
4742
+
4638
4743
  // src/lib/seam/connect/routes/locks/simulate/simulate.ts
4639
4744
  var _SeamHttpLocksSimulate = class _SeamHttpLocksSimulate {
4640
4745
  constructor(apiKeyOrOptions = {}) {
@@ -5487,17 +5592,17 @@ var _SeamHttpSeamConsoleV1 = class _SeamHttpSeamConsoleV1 {
5487
5592
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
5488
5593
  await clientSessions.get();
5489
5594
  }
5490
- getResourceType(parameters, options = {}) {
5595
+ getResourceLocator(parameters, options = {}) {
5491
5596
  if (!this.defaults.isUndocumentedApiEnabled) {
5492
5597
  throw new Error(
5493
5598
  "Cannot use undocumented API without isUndocumentedApiEnabled"
5494
5599
  );
5495
5600
  }
5496
5601
  return new SeamHttpRequest(this, {
5497
- pathname: "/seam/console/v1/get_resource_type",
5602
+ pathname: "/seam/console/v1/get_resource_locator",
5498
5603
  method: "GET",
5499
5604
  params: parameters,
5500
- responseKey: "resource_type",
5605
+ responseKey: "resource_locator",
5501
5606
  options
5502
5607
  });
5503
5608
  }
@@ -8584,6 +8689,9 @@ var _SeamHttp = class _SeamHttp {
8584
8689
  get events() {
8585
8690
  return SeamHttpEvents.fromClient(this.client, this.defaults);
8586
8691
  }
8692
+ get instantKeys() {
8693
+ return SeamHttpInstantKeys.fromClient(this.client, this.defaults);
8694
+ }
8587
8695
  get locks() {
8588
8696
  return SeamHttpLocks.fromClient(this.client, this.defaults);
8589
8697
  }
@@ -9559,6 +9667,20 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9559
9667
  return seam.list(...args);
9560
9668
  };
9561
9669
  }
9670
+ get ["/instant_keys/get"]() {
9671
+ const { client, defaults } = this;
9672
+ return function instantKeysGet(...args) {
9673
+ const seam = SeamHttpInstantKeys.fromClient(client, defaults);
9674
+ return seam.get(...args);
9675
+ };
9676
+ }
9677
+ get ["/instant_keys/list"]() {
9678
+ const { client, defaults } = this;
9679
+ return function instantKeysList(...args) {
9680
+ const seam = SeamHttpInstantKeys.fromClient(client, defaults);
9681
+ return seam.list(...args);
9682
+ };
9683
+ }
9562
9684
  get ["/locks/get"]() {
9563
9685
  const { client, defaults } = this;
9564
9686
  return function locksGet(...args) {
@@ -9693,16 +9815,16 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9693
9815
  return seam.createSandboxPhone(...args);
9694
9816
  };
9695
9817
  }
9696
- get ["/seam/console/v1/get_resource_type"]() {
9818
+ get ["/seam/console/v1/get_resource_locator"]() {
9697
9819
  const { client, defaults } = this;
9698
9820
  if (!this.defaults.isUndocumentedApiEnabled) {
9699
9821
  throw new Error(
9700
9822
  "Cannot use undocumented API without isUndocumentedApiEnabled"
9701
9823
  );
9702
9824
  }
9703
- return function seamConsoleV1GetResourceType(...args) {
9825
+ return function seamConsoleV1GetResourceLocator(...args) {
9704
9826
  const seam = SeamHttpSeamConsoleV1.fromClient(client, defaults);
9705
- return seam.getResourceType(...args);
9827
+ return seam.getResourceLocator(...args);
9706
9828
  };
9707
9829
  }
9708
9830
  get ["/seam/customer/v1/automation_runs/list"]() {
@@ -10664,6 +10786,7 @@ exports.SeamHttpDevicesUnmanaged = SeamHttpDevicesUnmanaged;
10664
10786
  exports.SeamHttpEndpoints = SeamHttpEndpoints;
10665
10787
  exports.SeamHttpEndpointsWithoutWorkspace = SeamHttpEndpointsWithoutWorkspace;
10666
10788
  exports.SeamHttpEvents = SeamHttpEvents;
10789
+ exports.SeamHttpInstantKeys = SeamHttpInstantKeys;
10667
10790
  exports.SeamHttpInvalidInputError = SeamHttpInvalidInputError;
10668
10791
  exports.SeamHttpInvalidOptionsError = SeamHttpInvalidOptionsError;
10669
10792
  exports.SeamHttpInvalidTokenError = SeamHttpInvalidTokenError;