@typespec/ts-http-runtime 1.0.0-alpha.20240119.1 → 1.0.0-alpha.20240202.3

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 (54) hide show
  1. package/dist/index.js +11 -6
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/src/accessTokenCache.js.map +1 -1
  4. package/dist-esm/src/client/apiVersionPolicy.js.map +1 -1
  5. package/dist-esm/src/client/clientHelpers.js.map +1 -1
  6. package/dist-esm/src/client/getClient.js.map +1 -1
  7. package/dist-esm/src/client/helpers/getBinaryBody.js.map +1 -1
  8. package/dist-esm/src/client/sendRequest.js.map +1 -1
  9. package/dist-esm/src/client/urlHelpers.js.map +1 -1
  10. package/dist-esm/src/createPipelineFromOptions.js.map +1 -1
  11. package/dist-esm/src/fetchHttpClient.js.map +1 -1
  12. package/dist-esm/src/httpHeaders.js.map +1 -1
  13. package/dist-esm/src/logger/debug.js.map +1 -1
  14. package/dist-esm/src/logger/log.browser.js.map +1 -1
  15. package/dist-esm/src/logger/logger.js.map +1 -1
  16. package/dist-esm/src/nodeHttpClient.js.map +1 -1
  17. package/dist-esm/src/pipeline.js.map +1 -1
  18. package/dist-esm/src/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
  19. package/dist-esm/src/policies/decompressResponsePolicy.js.map +1 -1
  20. package/dist-esm/src/policies/formDataPolicy.js.map +1 -1
  21. package/dist-esm/src/policies/logPolicy.js.map +1 -1
  22. package/dist-esm/src/policies/multipartPolicy.js.map +1 -1
  23. package/dist-esm/src/policies/proxyPolicy.js.map +1 -1
  24. package/dist-esm/src/policies/redirectPolicy.js.map +1 -1
  25. package/dist-esm/src/policies/retryPolicy.js.map +1 -1
  26. package/dist-esm/src/policies/tlsPolicy.js.map +1 -1
  27. package/dist-esm/src/policies/tracingPolicy.js.map +1 -1
  28. package/dist-esm/src/policies/userAgentPolicy.js.map +1 -1
  29. package/dist-esm/src/restError.js.map +1 -1
  30. package/dist-esm/src/retryStrategies/exponentialRetryStrategy.js.map +1 -1
  31. package/dist-esm/src/retryStrategies/throttlingRetryStrategy.js.map +1 -1
  32. package/dist-esm/src/tracing/instrumenter.js.map +1 -1
  33. package/dist-esm/src/tracing/tracingClient.js.map +1 -1
  34. package/dist-esm/src/tracing/tracingContext.js.map +1 -1
  35. package/dist-esm/src/util/aborterUtils.js.map +1 -1
  36. package/dist-esm/src/util/bytesEncoding.browser.js.map +1 -1
  37. package/dist-esm/src/util/checkEnvironment.js +9 -4
  38. package/dist-esm/src/util/checkEnvironment.js.map +1 -1
  39. package/dist-esm/src/util/createAbortablePromise.js.map +1 -1
  40. package/dist-esm/src/util/error.js.map +1 -1
  41. package/dist-esm/src/util/helpers.js.map +1 -1
  42. package/dist-esm/src/util/sanitizer.js.map +1 -1
  43. package/dist-esm/src/util/sha256.browser.js.map +1 -1
  44. package/dist-esm/src/util/stream.browser.js.map +1 -1
  45. package/dist-esm/src/util/stream.js.map +1 -1
  46. package/dist-esm/src/util/tokenCycler.js +2 -2
  47. package/dist-esm/src/util/tokenCycler.js.map +1 -1
  48. package/dist-esm/src/util/typeGuards.js.map +1 -1
  49. package/dist-esm/src/util/userAgent.js.map +1 -1
  50. package/dist-esm/src/util/userAgentPlatform.native.js.map +1 -1
  51. package/dist-esm/src/util/uuidUtils.js.map +1 -1
  52. package/dist-esm/src/util/uuidUtils.native.js.map +1 -1
  53. package/dist-esm/src/xhrHttpClient.js.map +1 -1
  54. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1688,9 +1688,9 @@ const isWebWorker = typeof self === "object" &&
1688
1688
  ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" ||
1689
1689
  ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope");
1690
1690
  /**
1691
- * A constant that indicates whether the environment the code is running is Node.JS.
1691
+ * A constant that indicates whether the environment the code is running is Bun.sh.
1692
1692
  */
1693
- const isNode = typeof process !== "undefined" && Boolean(process.version) && Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node);
1693
+ const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
1694
1694
  /**
1695
1695
  * A constant that indicates whether the environment the code is running is Deno.
1696
1696
  */
@@ -1698,9 +1698,14 @@ const isDeno = typeof Deno !== "undefined" &&
1698
1698
  typeof Deno.version !== "undefined" &&
1699
1699
  typeof Deno.version.deno !== "undefined";
1700
1700
  /**
1701
- * A constant that indicates whether the environment the code is running is Bun.sh.
1701
+ * A constant that indicates whether the environment the code is running is Node.JS.
1702
1702
  */
1703
- const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
1703
+ const isNode = typeof process !== "undefined" &&
1704
+ Boolean(process.version) &&
1705
+ Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node) &&
1706
+ // Deno thought it was a good idea to spoof process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
1707
+ !isDeno &&
1708
+ !isBun;
1704
1709
  /**
1705
1710
  * A constant that indicates whether the environment the code is running is in React-Native.
1706
1711
  */
@@ -2702,8 +2707,8 @@ function createPipelineRequest(options) {
2702
2707
  // Licensed under the MIT license.
2703
2708
  // Default options for the cycler if none are provided
2704
2709
  const DEFAULT_CYCLER_OPTIONS = {
2705
- forcedRefreshWindowInMs: 1000,
2706
- retryIntervalInMs: 3000,
2710
+ forcedRefreshWindowInMs: 1000, // Force waiting for a refresh 1s before the token expires
2711
+ retryIntervalInMs: 3000, // Allow refresh attempts every 3s
2707
2712
  refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry
2708
2713
  };
2709
2714
  /**