@bytescale/sdk 3.0.0-alpha.8 → 3.0.0-alpha.9

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.
@@ -2482,6 +2482,7 @@ var AuthManager = /*#__PURE__*/function (_BaseAPI) {
2482
2482
  _this.contentTypeJson = "application/json";
2483
2483
  _this.contentTypeText = "text/plain";
2484
2484
  _this.minJwtTtlSeconds = 10;
2485
+ _this.maxJwtTtlSeconds = 2147483; // Max value for window.setTimeout is 2147483647ms -- if we go over this, the timeout fires immediately.
2485
2486
  _this.retryAuthAfterErrorSeconds = 5;
2486
2487
  _this.refreshBeforeExpirySeconds = 20;
2487
2488
  var cdnUrl = BytescaleApiClientConfigUtils.getCdnUrl(config);
@@ -2564,6 +2565,8 @@ var AuthManager = /*#__PURE__*/function (_BaseAPI) {
2564
2565
  if (desiredTtl !== timeout) {
2565
2566
  ConsoleUtils.warn("JWT expiration is too short: waiting for ".concat(timeout, " seconds before refreshing."));
2566
2567
  }
2568
+ // There's need to print a warning for this: it's OK to silently request the JWT before it expires. Also, this is 24 days in this case!
2569
+ timeout = Math.min(timeout, _this7.maxJwtTtlSeconds);
2567
2570
  session.accessToken = setTokenResult.accessToken;
2568
2571
  });
2569
2572
  });
@@ -7,6 +7,7 @@ export declare class AuthManager extends BaseAPI implements AuthManagerInterface
7
7
  private readonly contentTypeJson;
8
8
  private readonly contentTypeText;
9
9
  private readonly minJwtTtlSeconds;
10
+ private readonly maxJwtTtlSeconds;
10
11
  private readonly retryAuthAfterErrorSeconds;
11
12
  private readonly refreshBeforeExpirySeconds;
12
13
  constructor(config: BytescaleApiClientConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytescale/sdk",
3
- "version": "3.0.0-alpha.8",
3
+ "version": "3.0.0-alpha.9",
4
4
  "description": "Bytescale JavaScript SDK",
5
5
  "author": "Bytescale <hello@bytescale.com> (https://www.bytescale.com)",
6
6
  "license": "MIT",