@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/connect.cjs CHANGED
@@ -4399,6 +4399,109 @@ 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
+ get(parameters, options = {}) {
4484
+ return new SeamHttpRequest(this, {
4485
+ pathname: "/instant_keys/get",
4486
+ method: "POST",
4487
+ body: parameters,
4488
+ responseKey: "instant_key",
4489
+ options
4490
+ });
4491
+ }
4492
+ list(parameters, options = {}) {
4493
+ return new SeamHttpRequest(this, {
4494
+ pathname: "/instant_keys/list",
4495
+ method: "POST",
4496
+ body: parameters,
4497
+ responseKey: "instant_keys",
4498
+ options
4499
+ });
4500
+ }
4501
+ };
4502
+ _SeamHttpInstantKeys.ltsVersion = seamApiLtsVersion;
4503
+ var SeamHttpInstantKeys = _SeamHttpInstantKeys;
4504
+
4402
4505
  // src/lib/seam/connect/routes/locks/simulate/simulate.ts
4403
4506
  var _SeamHttpLocksSimulate = class _SeamHttpLocksSimulate {
4404
4507
  constructor(apiKeyOrOptions = {}) {
@@ -5251,17 +5354,17 @@ var _SeamHttpSeamConsoleV1 = class _SeamHttpSeamConsoleV1 {
5251
5354
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
5252
5355
  await clientSessions.get();
5253
5356
  }
5254
- getResourceType(parameters, options = {}) {
5357
+ getResourceLocator(parameters, options = {}) {
5255
5358
  if (!this.defaults.isUndocumentedApiEnabled) {
5256
5359
  throw new Error(
5257
5360
  "Cannot use undocumented API without isUndocumentedApiEnabled"
5258
5361
  );
5259
5362
  }
5260
5363
  return new SeamHttpRequest(this, {
5261
- pathname: "/seam/console/v1/get_resource_type",
5364
+ pathname: "/seam/console/v1/get_resource_locator",
5262
5365
  method: "GET",
5263
5366
  params: parameters,
5264
- responseKey: "resource_type",
5367
+ responseKey: "resource_locator",
5265
5368
  options
5266
5369
  });
5267
5370
  }
@@ -8348,6 +8451,9 @@ var _SeamHttp = class _SeamHttp {
8348
8451
  get events() {
8349
8452
  return SeamHttpEvents.fromClient(this.client, this.defaults);
8350
8453
  }
8454
+ get instantKeys() {
8455
+ return SeamHttpInstantKeys.fromClient(this.client, this.defaults);
8456
+ }
8351
8457
  get locks() {
8352
8458
  return SeamHttpLocks.fromClient(this.client, this.defaults);
8353
8459
  }
@@ -9323,6 +9429,20 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9323
9429
  return seam.list(...args);
9324
9430
  };
9325
9431
  }
9432
+ get ["/instant_keys/get"]() {
9433
+ const { client, defaults } = this;
9434
+ return function instantKeysGet(...args) {
9435
+ const seam = SeamHttpInstantKeys.fromClient(client, defaults);
9436
+ return seam.get(...args);
9437
+ };
9438
+ }
9439
+ get ["/instant_keys/list"]() {
9440
+ const { client, defaults } = this;
9441
+ return function instantKeysList(...args) {
9442
+ const seam = SeamHttpInstantKeys.fromClient(client, defaults);
9443
+ return seam.list(...args);
9444
+ };
9445
+ }
9326
9446
  get ["/locks/get"]() {
9327
9447
  const { client, defaults } = this;
9328
9448
  return function locksGet(...args) {
@@ -9457,16 +9577,16 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9457
9577
  return seam.createSandboxPhone(...args);
9458
9578
  };
9459
9579
  }
9460
- get ["/seam/console/v1/get_resource_type"]() {
9580
+ get ["/seam/console/v1/get_resource_locator"]() {
9461
9581
  const { client, defaults } = this;
9462
9582
  if (!this.defaults.isUndocumentedApiEnabled) {
9463
9583
  throw new Error(
9464
9584
  "Cannot use undocumented API without isUndocumentedApiEnabled"
9465
9585
  );
9466
9586
  }
9467
- return function seamConsoleV1GetResourceType(...args) {
9587
+ return function seamConsoleV1GetResourceLocator(...args) {
9468
9588
  const seam = SeamHttpSeamConsoleV1.fromClient(client, defaults);
9469
- return seam.getResourceType(...args);
9589
+ return seam.getResourceLocator(...args);
9470
9590
  };
9471
9591
  }
9472
9592
  get ["/seam/customer/v1/automation_runs/list"]() {
@@ -10422,6 +10542,7 @@ exports.SeamHttpDevicesUnmanaged = SeamHttpDevicesUnmanaged;
10422
10542
  exports.SeamHttpEndpoints = SeamHttpEndpoints;
10423
10543
  exports.SeamHttpEndpointsWithoutWorkspace = SeamHttpEndpointsWithoutWorkspace;
10424
10544
  exports.SeamHttpEvents = SeamHttpEvents;
10545
+ exports.SeamHttpInstantKeys = SeamHttpInstantKeys;
10425
10546
  exports.SeamHttpInvalidInputError = SeamHttpInvalidInputError;
10426
10547
  exports.SeamHttpInvalidOptionsError = SeamHttpInvalidOptionsError;
10427
10548
  exports.SeamHttpInvalidTokenError = SeamHttpInvalidTokenError;