@typespec/ts-http-runtime 0.3.4-alpha.20260227.2 → 0.3.4
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/browser/client/sendRequest.d.ts +10 -1
- package/dist/browser/client/sendRequest.js +8 -2
- package/dist/browser/client/sendRequest.js.map +1 -1
- package/dist/browser/defaultHttpClient.d.ts +1 -1
- package/dist/browser/defaultHttpClient.js +1 -1
- package/dist/browser/defaultHttpClient.js.map +1 -0
- package/dist/browser/index.d.ts +2 -2
- package/dist/browser/index.js +0 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/logger/log.d.ts +1 -1
- package/dist/browser/logger/log.js +1 -1
- package/dist/browser/logger/log.js.map +1 -0
- package/dist/browser/pipelineRequest.d.ts +1 -1
- package/dist/browser/pipelineRequest.js.map +1 -1
- package/dist/browser/policies/decompressResponsePolicy.d.ts +3 -2
- package/dist/browser/policies/decompressResponsePolicy.js +1 -4
- package/dist/browser/policies/decompressResponsePolicy.js.map +1 -0
- package/dist/browser/policies/internal.d.ts +7 -7
- package/dist/browser/policies/internal.js +2 -2
- package/dist/browser/policies/internal.js.map +1 -1
- package/dist/browser/policies/proxyPolicy.common.d.ts +7 -3
- package/dist/browser/policies/proxyPolicy.common.js +2 -2
- package/dist/browser/policies/proxyPolicy.common.js.map +1 -1
- package/dist/browser/policies/proxyPolicy.d.ts +1 -1
- package/dist/browser/policies/proxyPolicy.js +1 -1
- package/dist/browser/policies/proxyPolicy.js.map +1 -0
- package/dist/browser/policies/redirectPolicy.d.ts +7 -0
- package/dist/browser/policies/redirectPolicy.js +13 -4
- package/dist/browser/policies/redirectPolicy.js.map +1 -1
- package/dist/browser/util/bytesEncoding.d.ts +1 -1
- package/dist/browser/util/bytesEncoding.js +1 -1
- package/dist/browser/util/bytesEncoding.js.map +1 -0
- package/dist/browser/util/concat.common.d.ts +1 -2
- package/dist/browser/util/concat.common.js.map +1 -1
- package/dist/browser/util/concat.d.ts +1 -1
- package/dist/browser/util/concat.js +1 -1
- package/dist/browser/util/concat.js.map +1 -0
- package/dist/browser/util/inspect.d.ts +1 -1
- package/dist/browser/util/inspect.js +1 -1
- package/dist/browser/util/inspect.js.map +1 -0
- package/dist/browser/util/sha256.d.ts +1 -1
- package/dist/browser/util/sha256.js +1 -1
- package/dist/browser/util/sha256.js.map +1 -0
- package/dist/browser/util/userAgentPlatform.d.ts +1 -1
- package/dist/browser/util/userAgentPlatform.js +1 -1
- package/dist/browser/util/userAgentPlatform.js.map +1 -0
- package/dist/browser/util/uuidUtils.d.ts +1 -1
- package/dist/browser/util/uuidUtils.js +1 -1
- package/dist/browser/util/uuidUtils.js.map +1 -0
- package/dist/commonjs/abort-controller/AbortError.js +30 -40
- package/dist/commonjs/abort-controller/AbortError.js.map +7 -1
- package/dist/commonjs/auth/credentials.js +36 -25
- package/dist/commonjs/auth/credentials.js.map +7 -1
- package/dist/commonjs/auth/oauth2Flows.js +15 -5
- package/dist/commonjs/auth/oauth2Flows.js.map +7 -1
- package/dist/commonjs/auth/schemes.js +15 -5
- package/dist/commonjs/auth/schemes.js.map +7 -1
- package/dist/commonjs/client/apiVersionPolicy.js +39 -25
- package/dist/commonjs/client/apiVersionPolicy.js.map +7 -1
- package/dist/commonjs/client/clientHelpers.js +62 -39
- package/dist/commonjs/client/clientHelpers.js.map +7 -1
- package/dist/commonjs/client/common.js +15 -5
- package/dist/commonjs/client/common.js.map +7 -1
- package/dist/commonjs/client/getClient.js +170 -82
- package/dist/commonjs/client/getClient.js.map +7 -1
- package/dist/commonjs/client/multipart.js +119 -110
- package/dist/commonjs/client/multipart.js.map +7 -1
- package/dist/commonjs/client/operationOptionHelpers.js +36 -21
- package/dist/commonjs/client/operationOptionHelpers.js.map +7 -1
- package/dist/commonjs/client/restError.js +44 -26
- package/dist/commonjs/client/restError.js.map +7 -1
- package/dist/commonjs/client/sendRequest.d.ts +10 -1
- package/dist/commonjs/client/sendRequest.js +150 -164
- package/dist/commonjs/client/sendRequest.js.map +7 -1
- package/dist/commonjs/client/urlHelpers.js +124 -131
- package/dist/commonjs/client/urlHelpers.js.map +7 -1
- package/dist/commonjs/constants.js +30 -8
- package/dist/commonjs/constants.js.map +7 -1
- package/dist/commonjs/createPipelineFromOptions.js +56 -45
- package/dist/commonjs/createPipelineFromOptions.js.map +7 -1
- package/dist/commonjs/defaultHttpClient.js +28 -11
- package/dist/commonjs/defaultHttpClient.js.map +7 -1
- package/dist/commonjs/fetchHttpClient.js +211 -256
- package/dist/commonjs/fetchHttpClient.js.map +7 -1
- package/dist/commonjs/httpHeaders.js +97 -82
- package/dist/commonjs/httpHeaders.js.map +7 -1
- package/dist/commonjs/index.d.ts +2 -2
- package/dist/commonjs/index.js +67 -36
- package/dist/commonjs/index.js.map +7 -1
- package/dist/commonjs/interfaces.js +15 -5
- package/dist/commonjs/interfaces.js.map +7 -1
- package/dist/commonjs/log.js +28 -8
- package/dist/commonjs/log.js.map +7 -1
- package/dist/commonjs/logger/debug.js +150 -155
- package/dist/commonjs/logger/debug.js.map +7 -1
- package/dist/commonjs/logger/internal.js +27 -8
- package/dist/commonjs/logger/internal.js.map +7 -1
- package/dist/commonjs/logger/log.common.js +39 -23
- package/dist/commonjs/logger/log.common.js.map +7 -1
- package/dist/commonjs/logger/log.js +40 -11
- package/dist/commonjs/logger/log.js.map +7 -1
- package/dist/commonjs/logger/logger.js +120 -110
- package/dist/commonjs/logger/logger.js.map +7 -1
- package/dist/commonjs/nodeHttpClient.js +313 -321
- package/dist/commonjs/nodeHttpClient.js.map +7 -1
- package/dist/commonjs/pipeline.js +190 -247
- package/dist/commonjs/pipeline.js.map +7 -1
- package/dist/commonjs/pipelineRequest.d.ts +1 -1
- package/dist/commonjs/pipelineRequest.js +69 -54
- package/dist/commonjs/pipelineRequest.js.map +7 -1
- package/dist/commonjs/policies/agentPolicy.js +38 -24
- package/dist/commonjs/policies/agentPolicy.js.map +7 -1
- package/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js +45 -32
- package/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js.map +7 -1
- package/dist/commonjs/policies/auth/basicAuthenticationPolicy.js +50 -32
- package/dist/commonjs/policies/auth/basicAuthenticationPolicy.js.map +7 -1
- package/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js +47 -32
- package/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js.map +7 -1
- package/dist/commonjs/policies/auth/checkInsecureConnection.js +47 -44
- package/dist/commonjs/policies/auth/checkInsecureConnection.js.map +7 -1
- package/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js +45 -32
- package/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js.map +7 -1
- package/dist/commonjs/policies/decompressResponsePolicy.js +38 -25
- package/dist/commonjs/policies/decompressResponsePolicy.js.map +7 -1
- package/dist/commonjs/policies/defaultRetryPolicy.js +39 -27
- package/dist/commonjs/policies/defaultRetryPolicy.js.map +7 -1
- package/dist/commonjs/policies/exponentialRetryPolicy.js +43 -26
- package/dist/commonjs/policies/exponentialRetryPolicy.js.map +7 -1
- package/dist/commonjs/policies/formDataPolicy.js +101 -90
- package/dist/commonjs/policies/formDataPolicy.js.map +7 -1
- package/dist/commonjs/policies/internal.d.ts +7 -7
- package/dist/commonjs/policies/internal.js +94 -48
- package/dist/commonjs/policies/internal.js.map +7 -1
- package/dist/commonjs/policies/logPolicy.js +49 -35
- package/dist/commonjs/policies/logPolicy.js.map +7 -1
- package/dist/commonjs/policies/multipartPolicy.js +117 -99
- package/dist/commonjs/policies/multipartPolicy.js.map +7 -1
- package/dist/commonjs/policies/proxyPolicy.common.d.ts +7 -3
- package/dist/commonjs/policies/proxyPolicy.common.js +38 -25
- package/dist/commonjs/policies/proxyPolicy.common.js.map +7 -1
- package/dist/commonjs/policies/proxyPolicy.js +160 -171
- package/dist/commonjs/policies/proxyPolicy.js.map +7 -1
- package/dist/commonjs/policies/redirectPolicy.d.ts +7 -0
- package/dist/commonjs/policies/redirectPolicy.js +62 -51
- package/dist/commonjs/policies/redirectPolicy.js.map +7 -1
- package/dist/commonjs/policies/retryPolicy.js +123 -105
- package/dist/commonjs/policies/retryPolicy.js.map +7 -1
- package/dist/commonjs/policies/systemErrorRetryPolicy.js +46 -31
- package/dist/commonjs/policies/systemErrorRetryPolicy.js.map +7 -1
- package/dist/commonjs/policies/throttlingRetryPolicy.js +38 -30
- package/dist/commonjs/policies/throttlingRetryPolicy.js.map +7 -1
- package/dist/commonjs/policies/tlsPolicy.js +38 -24
- package/dist/commonjs/policies/tlsPolicy.js.map +7 -1
- package/dist/commonjs/policies/userAgentPolicy.js +41 -28
- package/dist/commonjs/policies/userAgentPolicy.js.map +7 -1
- package/dist/commonjs/restError.js +93 -90
- package/dist/commonjs/restError.js.map +7 -1
- package/dist/commonjs/retryStrategies/exponentialRetryStrategy.js +63 -62
- package/dist/commonjs/retryStrategies/exponentialRetryStrategy.js.map +7 -1
- package/dist/commonjs/retryStrategies/retryStrategy.js +15 -5
- package/dist/commonjs/retryStrategies/retryStrategy.js.map +7 -1
- package/dist/commonjs/retryStrategies/throttlingRetryStrategy.js +58 -69
- package/dist/commonjs/retryStrategies/throttlingRetryStrategy.js.map +7 -1
- package/dist/commonjs/util/arrayBuffer.js +34 -21
- package/dist/commonjs/util/arrayBuffer.js.map +7 -1
- package/dist/commonjs/util/bytesEncoding.common.js +83 -100
- package/dist/commonjs/util/bytesEncoding.common.js.map +7 -1
- package/dist/commonjs/util/bytesEncoding.js +30 -21
- package/dist/commonjs/util/bytesEncoding.js.map +7 -1
- package/dist/commonjs/util/checkEnvironment.js +45 -44
- package/dist/commonjs/util/checkEnvironment.js.map +7 -1
- package/dist/commonjs/util/concat.common.d.ts +1 -2
- package/dist/commonjs/util/concat.common.js +51 -52
- package/dist/commonjs/util/concat.common.js.map +7 -1
- package/dist/commonjs/util/concat.js +70 -61
- package/dist/commonjs/util/concat.js.map +7 -1
- package/dist/commonjs/util/delay.js +31 -21
- package/dist/commonjs/util/delay.js.map +7 -1
- package/dist/commonjs/util/error.js +33 -17
- package/dist/commonjs/util/error.js.map +7 -1
- package/dist/commonjs/util/helpers.js +65 -57
- package/dist/commonjs/util/helpers.js.map +7 -1
- package/dist/commonjs/util/inspect.common.js +27 -7
- package/dist/commonjs/util/inspect.common.js.map +7 -1
- package/dist/commonjs/util/inspect.js +28 -8
- package/dist/commonjs/util/inspect.js.map +7 -1
- package/dist/commonjs/util/internal.js +67 -32
- package/dist/commonjs/util/internal.js.map +7 -1
- package/dist/commonjs/util/object.js +27 -15
- package/dist/commonjs/util/object.js.map +7 -1
- package/dist/commonjs/util/random.js +30 -22
- package/dist/commonjs/util/random.js.map +7 -1
- package/dist/commonjs/util/sanitizer.js +157 -148
- package/dist/commonjs/util/sanitizer.js.map +7 -1
- package/dist/commonjs/util/sha256.common.js +61 -45
- package/dist/commonjs/util/sha256.common.js.map +7 -1
- package/dist/commonjs/util/sha256.js +32 -22
- package/dist/commonjs/util/sha256.js.map +7 -1
- package/dist/commonjs/util/typeGuards.js +41 -21
- package/dist/commonjs/util/typeGuards.js.map +7 -1
- package/dist/commonjs/util/userAgent.js +43 -28
- package/dist/commonjs/util/userAgent.js.map +7 -1
- package/dist/commonjs/util/userAgentPlatform.js +51 -29
- package/dist/commonjs/util/userAgentPlatform.js.map +7 -1
- package/dist/commonjs/util/uuidUtils.common.js +43 -39
- package/dist/commonjs/util/uuidUtils.common.js.map +7 -1
- package/dist/commonjs/util/uuidUtils.js +27 -12
- package/dist/commonjs/util/uuidUtils.js.map +7 -1
- package/dist/commonjs/xhrHttpClient.js +171 -163
- package/dist/commonjs/xhrHttpClient.js.map +7 -1
- package/dist/esm/client/sendRequest.d.ts +10 -1
- package/dist/esm/client/sendRequest.js +8 -2
- package/dist/esm/client/sendRequest.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pipelineRequest.d.ts +1 -1
- package/dist/esm/pipelineRequest.js.map +1 -1
- package/dist/esm/policies/internal.d.ts +7 -7
- package/dist/esm/policies/internal.js +2 -2
- package/dist/esm/policies/internal.js.map +1 -1
- package/dist/esm/policies/proxyPolicy.common.d.ts +7 -3
- package/dist/esm/policies/proxyPolicy.common.js +2 -2
- package/dist/esm/policies/proxyPolicy.common.js.map +1 -1
- package/dist/esm/policies/redirectPolicy.d.ts +7 -0
- package/dist/esm/policies/redirectPolicy.js +13 -4
- package/dist/esm/policies/redirectPolicy.js.map +1 -1
- package/dist/esm/util/concat.common.d.ts +1 -2
- package/dist/esm/util/concat.common.js.map +1 -1
- package/dist/react-native/client/sendRequest.d.ts +10 -1
- package/dist/react-native/client/sendRequest.js +8 -2
- package/dist/react-native/client/sendRequest.js.map +1 -1
- package/dist/react-native/defaultHttpClient.d.ts +1 -1
- package/dist/react-native/defaultHttpClient.js +1 -1
- package/dist/react-native/defaultHttpClient.js.map +1 -0
- package/dist/react-native/index.d.ts +2 -2
- package/dist/react-native/index.js +0 -2
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/logger/log.d.ts +1 -1
- package/dist/react-native/logger/log.js +1 -1
- package/dist/react-native/logger/log.js.map +1 -0
- package/dist/react-native/pipelineRequest.d.ts +1 -1
- package/dist/react-native/pipelineRequest.js.map +1 -1
- package/dist/react-native/policies/internal.d.ts +7 -7
- package/dist/react-native/policies/internal.js +2 -2
- package/dist/react-native/policies/internal.js.map +1 -1
- package/dist/react-native/policies/proxyPolicy.common.d.ts +7 -3
- package/dist/react-native/policies/proxyPolicy.common.js +2 -2
- package/dist/react-native/policies/proxyPolicy.common.js.map +1 -1
- package/dist/react-native/policies/proxyPolicy.d.ts +1 -1
- package/dist/react-native/policies/proxyPolicy.js +1 -1
- package/dist/react-native/policies/proxyPolicy.js.map +1 -0
- package/dist/react-native/policies/redirectPolicy.d.ts +7 -0
- package/dist/react-native/policies/redirectPolicy.js +13 -4
- package/dist/react-native/policies/redirectPolicy.js.map +1 -1
- package/dist/react-native/util/bytesEncoding.d.ts +1 -1
- package/dist/react-native/util/bytesEncoding.js +1 -1
- package/dist/react-native/util/bytesEncoding.js.map +1 -0
- package/dist/react-native/util/concat.common.d.ts +1 -2
- package/dist/react-native/util/concat.common.js.map +1 -1
- package/dist/react-native/util/concat.d.ts +1 -1
- package/dist/react-native/util/concat.js +1 -1
- package/dist/react-native/util/concat.js.map +1 -0
- package/dist/react-native/util/inspect.d.ts +1 -1
- package/dist/react-native/util/inspect.js +1 -1
- package/dist/react-native/util/inspect.js.map +1 -0
- package/dist/react-native/util/sha256.d.ts +1 -1
- package/dist/react-native/util/sha256.js +1 -1
- package/dist/react-native/util/sha256.js.map +1 -0
- package/dist/react-native/util/userAgentPlatform.d.ts +1 -1
- package/dist/react-native/util/userAgentPlatform.js +1 -1
- package/dist/react-native/util/userAgentPlatform.js.map +1 -0
- package/dist/react-native/util/uuidUtils.d.ts +1 -1
- package/dist/react-native/util/uuidUtils.js +1 -1
- package/dist/react-native/util/uuidUtils.js.map +1 -0
- package/package.json +1 -21
- package/dist/browser/defaultHttpClient-browser.mjs.map +0 -1
- package/dist/browser/logger/log-browser.mjs.map +0 -1
- package/dist/browser/policies/decompressResponsePolicy-browser.mjs.map +0 -1
- package/dist/browser/policies/proxyPolicy-browser.mjs.map +0 -1
- package/dist/browser/util/bytesEncoding-browser.mjs.map +0 -1
- package/dist/browser/util/concat-browser.mjs.map +0 -1
- package/dist/browser/util/inspect-browser.mjs.map +0 -1
- package/dist/browser/util/sha256-browser.mjs.map +0 -1
- package/dist/browser/util/userAgentPlatform-browser.mjs.map +0 -1
- package/dist/browser/util/uuidUtils-browser.mjs.map +0 -1
- package/dist/react-native/defaultHttpClient-react-native.mjs.map +0 -1
- package/dist/react-native/logger/log-react-native.mjs.map +0 -1
- package/dist/react-native/policies/proxyPolicy-react-native.mjs.map +0 -1
- package/dist/react-native/util/bytesEncoding-react-native.mjs.map +0 -1
- package/dist/react-native/util/concat-react-native.mjs.map +0 -1
- package/dist/react-native/util/inspect-react-native.mjs.map +0 -1
- package/dist/react-native/util/sha256-react-native.mjs.map +0 -1
- package/dist/react-native/util/userAgentPlatform-react-native.mjs.map +0 -1
- package/dist/react-native/util/uuidUtils-react-native.mjs.map +0 -1
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
exports
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var checkEnvironment_exports = {};
|
|
19
|
+
__export(checkEnvironment_exports, {
|
|
20
|
+
isBrowser: () => isBrowser,
|
|
21
|
+
isBun: () => isBun,
|
|
22
|
+
isDeno: () => isDeno,
|
|
23
|
+
isNodeLike: () => isNodeLike,
|
|
24
|
+
isNodeRuntime: () => isNodeRuntime,
|
|
25
|
+
isReactNative: () => isReactNative,
|
|
26
|
+
isWebWorker: () => isWebWorker
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(checkEnvironment_exports);
|
|
29
|
+
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
30
|
+
const isWebWorker = typeof self === "object" && typeof self?.importScripts === "function" && (self.constructor?.name === "DedicatedWorkerGlobalScope" || self.constructor?.name === "ServiceWorkerGlobalScope" || self.constructor?.name === "SharedWorkerGlobalScope");
|
|
31
|
+
const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
|
|
32
|
+
const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
|
|
33
|
+
const isNodeLike = typeof globalThis.process !== "undefined" && Boolean(globalThis.process.version) && Boolean(globalThis.process.versions?.node);
|
|
34
|
+
const isNodeRuntime = isNodeLike && !isBun && !isDeno;
|
|
35
|
+
const isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative";
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
isBrowser,
|
|
39
|
+
isBun,
|
|
40
|
+
isDeno,
|
|
41
|
+
isNodeLike,
|
|
42
|
+
isNodeRuntime,
|
|
43
|
+
isReactNative,
|
|
44
|
+
isWebWorker
|
|
45
|
+
});
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/core/ts-http-runtime/src/util/checkEnvironment.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\ninterface Window {\n document: unknown;\n}\n\ninterface DedicatedWorkerGlobalScope {\n constructor: {\n name: string;\n };\n\n importScripts: (...paths: string[]) => void;\n}\n\ninterface Navigator {\n product: string;\n}\n\ninterface DenoGlobal {\n version: {\n deno: string;\n };\n}\n\ninterface BunGlobal {\n version: string;\n}\n\n// eslint-disable-next-line @azure/azure-sdk/ts-no-window\ndeclare const window: Window;\ndeclare const self: DedicatedWorkerGlobalScope;\ndeclare const Deno: DenoGlobal;\ndeclare const Bun: BunGlobal;\ndeclare const navigator: Navigator;\n\n/**\n * A constant that indicates whether the environment the code is running is a Web Browser.\n */\n// eslint-disable-next-line @azure/azure-sdk/ts-no-window\nexport const isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n\n/**\n * A constant that indicates whether the environment the code is running is a Web Worker.\n */\nexport const isWebWorker =\n typeof self === \"object\" &&\n typeof self?.importScripts === \"function\" &&\n (self.constructor?.name === \"DedicatedWorkerGlobalScope\" ||\n self.constructor?.name === \"ServiceWorkerGlobalScope\" ||\n self.constructor?.name === \"SharedWorkerGlobalScope\");\n\n/**\n * A constant that indicates whether the environment the code is running is Deno.\n */\nexport const isDeno =\n typeof Deno !== \"undefined\" &&\n typeof Deno.version !== \"undefined\" &&\n typeof Deno.version.deno !== \"undefined\";\n\n/**\n * A constant that indicates whether the environment the code is running is Bun.sh.\n */\nexport const isBun = typeof Bun !== \"undefined\" && typeof Bun.version !== \"undefined\";\n\n/**\n * A constant that indicates whether the environment the code is running is a Node.js compatible environment.\n */\nexport const isNodeLike =\n typeof globalThis.process !== \"undefined\" &&\n Boolean(globalThis.process.version) &&\n Boolean(globalThis.process.versions?.node);\n\n/**\n * A constant that indicates whether the environment the code is running is Node.JS.\n */\nexport const isNodeRuntime = isNodeLike && !isBun && !isDeno;\n\n/**\n * A constant that indicates whether the environment the code is running is in React-Native.\n */\n// https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js\nexport const isReactNative =\n typeof navigator !== \"undefined\" && navigator?.product === \"ReactNative\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCO,MAAM,YAAY,OAAO,WAAW,eAAe,OAAO,OAAO,aAAa;AAK9E,MAAM,cACX,OAAO,SAAS,YAChB,OAAO,MAAM,kBAAkB,eAC9B,KAAK,aAAa,SAAS,gCAC1B,KAAK,aAAa,SAAS,8BAC3B,KAAK,aAAa,SAAS;AAKxB,MAAM,SACX,OAAO,SAAS,eAChB,OAAO,KAAK,YAAY,eACxB,OAAO,KAAK,QAAQ,SAAS;AAKxB,MAAM,QAAQ,OAAO,QAAQ,eAAe,OAAO,IAAI,YAAY;AAKnE,MAAM,aACX,OAAO,WAAW,YAAY,eAC9B,QAAQ,WAAW,QAAQ,OAAO,KAClC,QAAQ,WAAW,QAAQ,UAAU,IAAI;AAKpC,MAAM,gBAAgB,cAAc,CAAC,SAAS,CAAC;AAM/C,MAAM,gBACX,OAAO,cAAc,eAAe,WAAW,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
type ConcatSource = ReadableStream<Uint8Array> |
|
|
6
|
+
export type ConcatSource = ReadableStream<Uint8Array> | NodeJS.ReadableStream | Uint8Array | Blob;
|
|
7
7
|
/**
|
|
8
8
|
* Utility function that concatenates a set of binary inputs into one combined output.
|
|
9
9
|
*
|
|
@@ -14,5 +14,4 @@ type ConcatSource = ReadableStream<Uint8Array> | Blob | Uint8Array;
|
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
16
|
export declare function concat(sources: (ConcatSource | (() => ConcatSource))[]): Promise<(() => NodeJS.ReadableStream) | Blob>;
|
|
17
|
-
export {};
|
|
18
17
|
//# sourceMappingURL=concat.common.d.ts.map
|
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var concat_common_exports = {};
|
|
19
|
+
__export(concat_common_exports, {
|
|
20
|
+
concat: () => concat
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(concat_common_exports);
|
|
23
|
+
var import_typeGuards = require("./typeGuards.js");
|
|
11
24
|
function drain(stream) {
|
|
12
|
-
|
|
25
|
+
return new Response(stream).blob();
|
|
13
26
|
}
|
|
14
27
|
async function toBlobPart(source) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
if (source instanceof Blob || source instanceof Uint8Array) {
|
|
29
|
+
return source;
|
|
30
|
+
}
|
|
31
|
+
if ((0, import_typeGuards.isWebReadableStream)(source)) {
|
|
32
|
+
return drain(source);
|
|
33
|
+
} else {
|
|
34
|
+
throw new Error(
|
|
35
|
+
"Unsupported source type. Only Blob, Uint8Array, and ReadableStream are supported in browser."
|
|
36
|
+
);
|
|
37
|
+
}
|
|
24
38
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Converts a Uint8Array to a Uint8Array<ArrayBuffer>.
|
|
27
|
-
* @param source - The source Uint8Array.
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
39
|
function arrayToArrayBuffer(source) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// SharedArrayBuffer
|
|
36
|
-
return source.map((x) => x);
|
|
40
|
+
if ("resize" in source.buffer) {
|
|
41
|
+
return source;
|
|
42
|
+
}
|
|
43
|
+
return source.map((x) => x);
|
|
37
44
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Utility function that concatenates a set of binary inputs into one combined output.
|
|
40
|
-
*
|
|
41
|
-
* @param sources - array of sources for the concatenation
|
|
42
|
-
* @returns - in Node, a (() =\> NodeJS.ReadableStream) which, when read, produces a concatenation of all the inputs.
|
|
43
|
-
* In browser, returns a `Blob` representing all the concatenated inputs.
|
|
44
|
-
*
|
|
45
|
-
* @internal
|
|
46
|
-
*/
|
|
47
45
|
async function concat(sources) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// Uint8Array
|
|
56
|
-
parts.push(new Blob([arrayToArrayBuffer(blobPart)]));
|
|
57
|
-
}
|
|
46
|
+
const parts = [];
|
|
47
|
+
for (const source of sources) {
|
|
48
|
+
const blobPart = await toBlobPart(typeof source === "function" ? source() : source);
|
|
49
|
+
if (blobPart instanceof Blob) {
|
|
50
|
+
parts.push(blobPart);
|
|
51
|
+
} else {
|
|
52
|
+
parts.push(new Blob([arrayToArrayBuffer(blobPart)]));
|
|
58
53
|
}
|
|
59
|
-
|
|
54
|
+
}
|
|
55
|
+
return new Blob(parts);
|
|
60
56
|
}
|
|
61
|
-
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
concat
|
|
60
|
+
});
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/core/ts-http-runtime/src/util/concat.common.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isWebReadableStream } from \"./typeGuards.js\";\n\n/**\n * Drain the content of the given ReadableStream into a Blob.\n * The blob's content may end up in memory or on disk dependent on size.\n */\nfunction drain(stream: ReadableStream<Uint8Array>): Promise<Blob> {\n return new Response(stream).blob();\n}\n\nasync function toBlobPart(source: ConcatSource): Promise<Blob | Uint8Array> {\n if (source instanceof Blob || source instanceof Uint8Array) {\n return source;\n }\n\n if (isWebReadableStream(source)) {\n return drain(source);\n } else {\n throw new Error(\n \"Unsupported source type. Only Blob, Uint8Array, and ReadableStream are supported in browser.\",\n );\n }\n}\n\n/**\n * Converts a Uint8Array to a Uint8Array<ArrayBuffer>.\n * @param source - The source Uint8Array.\n * @returns\n */\nfunction arrayToArrayBuffer(source: Uint8Array): Uint8Array<ArrayBuffer> {\n if (\"resize\" in source.buffer) {\n // ArrayBuffer\n return source as Uint8Array<ArrayBuffer>;\n }\n // SharedArrayBuffer\n return source.map((x) => x);\n}\n\n/**\n * Accepted binary data types for concat\n *\n * @internal\n */\nexport type ConcatSource = ReadableStream<Uint8Array> | NodeJS.ReadableStream | Uint8Array | Blob;\n\n/**\n * Utility function that concatenates a set of binary inputs into one combined output.\n *\n * @param sources - array of sources for the concatenation\n * @returns - in Node, a (() =\\> NodeJS.ReadableStream) which, when read, produces a concatenation of all the inputs.\n * In browser, returns a `Blob` representing all the concatenated inputs.\n *\n * @internal\n */\nexport async function concat(\n sources: (ConcatSource | (() => ConcatSource))[],\n): Promise<(() => NodeJS.ReadableStream) | Blob> {\n const parts = [];\n for (const source of sources) {\n const blobPart = await toBlobPart(typeof source === \"function\" ? source() : source);\n if (blobPart instanceof Blob) {\n parts.push(blobPart);\n } else {\n // Uint8Array\n parts.push(new Blob([arrayToArrayBuffer(blobPart)]));\n }\n }\n\n return new Blob(parts);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAoC;AAMpC,SAAS,MAAM,QAAmD;AAChE,SAAO,IAAI,SAAS,MAAM,EAAE,KAAK;AACnC;AAEA,eAAe,WAAW,QAAkD;AAC1E,MAAI,kBAAkB,QAAQ,kBAAkB,YAAY;AAC1D,WAAO;AAAA,EACT;AAEA,UAAI,uCAAoB,MAAM,GAAG;AAC/B,WAAO,MAAM,MAAM;AAAA,EACrB,OAAO;AACL,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;AAOA,SAAS,mBAAmB,QAA6C;AACvE,MAAI,YAAY,OAAO,QAAQ;AAE7B,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,IAAI,CAAC,MAAM,CAAC;AAC5B;AAkBA,eAAsB,OACpB,SAC+C;AAC/C,QAAM,QAAQ,CAAC;AACf,aAAW,UAAU,SAAS;AAC5B,UAAM,WAAW,MAAM,WAAW,OAAO,WAAW,aAAa,OAAO,IAAI,MAAM;AAClF,QAAI,oBAAoB,MAAM;AAC5B,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AAEL,YAAM,KAAK,IAAI,KAAK,CAAC,mBAAmB,QAAQ,CAAC,CAAC,CAAC;AAAA,IACrD;AAAA,EACF;AAEA,SAAO,IAAI,KAAK,KAAK;AACvB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,72 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var concat_exports = {};
|
|
19
|
+
__export(concat_exports, {
|
|
20
|
+
concat: () => concat
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(concat_exports);
|
|
23
|
+
var import_stream = require("stream");
|
|
24
|
+
var import_typeGuards = require("./typeGuards.js");
|
|
8
25
|
async function* streamAsyncIterator() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
finally {
|
|
20
|
-
reader.releaseLock();
|
|
26
|
+
const reader = this.getReader();
|
|
27
|
+
try {
|
|
28
|
+
while (true) {
|
|
29
|
+
const { done, value } = await reader.read();
|
|
30
|
+
if (done) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
yield value;
|
|
21
34
|
}
|
|
35
|
+
} finally {
|
|
36
|
+
reader.releaseLock();
|
|
37
|
+
}
|
|
22
38
|
}
|
|
23
39
|
function makeAsyncIterable(webStream) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
if (!webStream[Symbol.asyncIterator]) {
|
|
41
|
+
webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream);
|
|
42
|
+
}
|
|
43
|
+
if (!webStream.values) {
|
|
44
|
+
webStream.values = streamAsyncIterator.bind(webStream);
|
|
45
|
+
}
|
|
30
46
|
}
|
|
31
47
|
function ensureNodeStream(stream) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
48
|
+
if (stream instanceof ReadableStream) {
|
|
49
|
+
makeAsyncIterable(stream);
|
|
50
|
+
return import_stream.Readable.fromWeb(stream);
|
|
51
|
+
} else {
|
|
52
|
+
return stream;
|
|
53
|
+
}
|
|
39
54
|
}
|
|
40
55
|
function toStream(source) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return ensureNodeStream(source);
|
|
49
|
-
}
|
|
56
|
+
if (source instanceof Uint8Array) {
|
|
57
|
+
return import_stream.Readable.from(Buffer.from(source));
|
|
58
|
+
} else if ((0, import_typeGuards.isBlob)(source)) {
|
|
59
|
+
return ensureNodeStream(source.stream());
|
|
60
|
+
} else {
|
|
61
|
+
return ensureNodeStream(source);
|
|
62
|
+
}
|
|
50
63
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Utility function that concatenates a set of binary inputs into one combined output.
|
|
53
|
-
*
|
|
54
|
-
* @param sources - array of sources for the concatenation
|
|
55
|
-
* @returns - in Node, a (() =\> NodeJS.ReadableStream) which, when read, produces a concatenation of all the inputs.
|
|
56
|
-
* In browser, returns a `Blob` representing all the concatenated inputs.
|
|
57
|
-
*
|
|
58
|
-
* @internal
|
|
59
|
-
*/
|
|
60
64
|
async function concat(sources) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
65
|
+
return function() {
|
|
66
|
+
const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream);
|
|
67
|
+
return import_stream.Readable.from(
|
|
68
|
+
(async function* () {
|
|
69
|
+
for (const stream of streams) {
|
|
70
|
+
for await (const chunk of stream) {
|
|
71
|
+
yield chunk;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
})()
|
|
75
|
+
);
|
|
76
|
+
};
|
|
71
77
|
}
|
|
72
|
-
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
concat
|
|
81
|
+
});
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/core/ts-http-runtime/src/util/concat.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Readable } from \"stream\";\nimport type { ReadableStream as AsyncIterableReadableStream } from \"stream/web\";\nimport { isBlob } from \"./typeGuards.js\";\n\nasync function* streamAsyncIterator(\n this: ReadableStream<Uint8Array>,\n): AsyncIterableIterator<Uint8Array> {\n const reader = this.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n return;\n }\n\n yield value;\n }\n } finally {\n reader.releaseLock();\n }\n}\n\nfunction makeAsyncIterable<T>(webStream: any): asserts webStream is AsyncIterableReadableStream<T> {\n if (!webStream[Symbol.asyncIterator]) {\n webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream);\n }\n\n if (!webStream.values) {\n webStream.values = streamAsyncIterator.bind(webStream);\n }\n}\n\nfunction ensureNodeStream(\n stream: ReadableStream<Uint8Array> | NodeJS.ReadableStream,\n): NodeJS.ReadableStream {\n if (stream instanceof ReadableStream) {\n makeAsyncIterable<Uint8Array>(stream);\n return Readable.fromWeb(stream);\n } else {\n return stream;\n }\n}\n\nfunction toStream(\n source: ReadableStream<Uint8Array> | NodeJS.ReadableStream | Uint8Array | Blob,\n): NodeJS.ReadableStream {\n if (source instanceof Uint8Array) {\n return Readable.from(Buffer.from(source));\n } else if (isBlob(source)) {\n return ensureNodeStream(source.stream());\n } else {\n return ensureNodeStream(source);\n }\n}\n\n/**\n * Accepted binary data types for concat\n *\n * @internal\n */\nexport type ConcatSource = ReadableStream<Uint8Array> | NodeJS.ReadableStream | Uint8Array | Blob;\n\n/**\n * Utility function that concatenates a set of binary inputs into one combined output.\n *\n * @param sources - array of sources for the concatenation\n * @returns - in Node, a (() =\\> NodeJS.ReadableStream) which, when read, produces a concatenation of all the inputs.\n * In browser, returns a `Blob` representing all the concatenated inputs.\n *\n * @internal\n */\nexport async function concat(\n sources: (ConcatSource | (() => ConcatSource))[],\n): Promise<(() => NodeJS.ReadableStream) | Blob> {\n return function () {\n const streams = sources.map((x) => (typeof x === \"function\" ? x() : x)).map(toStream);\n\n return Readable.from(\n (async function* () {\n for (const stream of streams as NodeJS.ReadableStream[]) {\n for await (const chunk of stream) {\n yield chunk;\n }\n }\n })(),\n );\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAyB;AAEzB,wBAAuB;AAEvB,gBAAgB,sBAEqB;AACnC,QAAM,SAAS,KAAK,UAAU;AAC9B,MAAI;AACF,WAAO,MAAM;AACX,YAAM,EAAE,MAAM,MAAM,IAAI,MAAM,OAAO,KAAK;AAC1C,UAAI,MAAM;AACR;AAAA,MACF;AAEA,YAAM;AAAA,IACR;AAAA,EACF,UAAE;AACA,WAAO,YAAY;AAAA,EACrB;AACF;AAEA,SAAS,kBAAqB,WAAqE;AACjG,MAAI,CAAC,UAAU,OAAO,aAAa,GAAG;AACpC,cAAU,OAAO,aAAa,IAAI,oBAAoB,KAAK,SAAS;AAAA,EACtE;AAEA,MAAI,CAAC,UAAU,QAAQ;AACrB,cAAU,SAAS,oBAAoB,KAAK,SAAS;AAAA,EACvD;AACF;AAEA,SAAS,iBACP,QACuB;AACvB,MAAI,kBAAkB,gBAAgB;AACpC,sBAA8B,MAAM;AACpC,WAAO,uBAAS,QAAQ,MAAM;AAAA,EAChC,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAEA,SAAS,SACP,QACuB;AACvB,MAAI,kBAAkB,YAAY;AAChC,WAAO,uBAAS,KAAK,OAAO,KAAK,MAAM,CAAC;AAAA,EAC1C,eAAW,0BAAO,MAAM,GAAG;AACzB,WAAO,iBAAiB,OAAO,OAAO,CAAC;AAAA,EACzC,OAAO;AACL,WAAO,iBAAiB,MAAM;AAAA,EAChC;AACF;AAkBA,eAAsB,OACpB,SAC+C;AAC/C,SAAO,WAAY;AACjB,UAAM,UAAU,QAAQ,IAAI,CAAC,MAAO,OAAO,MAAM,aAAa,EAAE,IAAI,CAAE,EAAE,IAAI,QAAQ;AAEpF,WAAO,uBAAS;AAAA,OACb,mBAAmB;AAClB,mBAAW,UAAU,SAAoC;AACvD,2BAAiB,SAAS,QAAQ;AAChC,kBAAM;AAAA,UACR;AAAA,QACF;AAAA,MACF,GAAG;AAAA,IACL;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var delay_exports = {};
|
|
19
|
+
__export(delay_exports, {
|
|
20
|
+
calculateRetryDelay: () => calculateRetryDelay
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(delay_exports);
|
|
23
|
+
var import_random = require("./random.js");
|
|
13
24
|
function calculateRetryDelay(retryAttempt, config) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// Allow the final value to have some "jitter" (within 50% of the delay size) so
|
|
19
|
-
// that retries across multiple clients don't occur simultaneously.
|
|
20
|
-
const retryAfterInMs = clampedDelay / 2 + (0, random_js_1.getRandomIntegerInclusive)(0, clampedDelay / 2);
|
|
21
|
-
return { retryAfterInMs };
|
|
25
|
+
const exponentialDelay = config.retryDelayInMs * Math.pow(2, retryAttempt);
|
|
26
|
+
const clampedDelay = Math.min(config.maxRetryDelayInMs, exponentialDelay);
|
|
27
|
+
const retryAfterInMs = clampedDelay / 2 + (0, import_random.getRandomIntegerInclusive)(0, clampedDelay / 2);
|
|
28
|
+
return { retryAfterInMs };
|
|
22
29
|
}
|
|
23
|
-
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
calculateRetryDelay
|
|
33
|
+
});
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/core/ts-http-runtime/src/util/delay.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getRandomIntegerInclusive } from \"./random.js\";\n\n/**\n * Calculates the delay interval for retry attempts using exponential delay with jitter.\n * @param retryAttempt - The current retry attempt number.\n * @param config - The exponential retry configuration.\n * @returns An object containing the calculated retry delay.\n */\nexport function calculateRetryDelay(\n retryAttempt: number,\n config: {\n retryDelayInMs: number;\n maxRetryDelayInMs: number;\n },\n): { retryAfterInMs: number } {\n // Exponentially increase the delay each time\n const exponentialDelay = config.retryDelayInMs * Math.pow(2, retryAttempt);\n\n // Don't let the delay exceed the maximum\n const clampedDelay = Math.min(config.maxRetryDelayInMs, exponentialDelay);\n\n // Allow the final value to have some \"jitter\" (within 50% of the delay size) so\n // that retries across multiple clients don't occur simultaneously.\n const retryAfterInMs = clampedDelay / 2 + getRandomIntegerInclusive(0, clampedDelay / 2);\n\n return { retryAfterInMs };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA0C;AAQnC,SAAS,oBACd,cACA,QAI4B;AAE5B,QAAM,mBAAmB,OAAO,iBAAiB,KAAK,IAAI,GAAG,YAAY;AAGzE,QAAM,eAAe,KAAK,IAAI,OAAO,mBAAmB,gBAAgB;AAIxE,QAAM,iBAAiB,eAAe,QAAI,yCAA0B,GAAG,eAAe,CAAC;AAEvF,SAAO,EAAE,eAAe;AAC1B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,19 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var error_exports = {};
|
|
19
|
+
__export(error_exports, {
|
|
20
|
+
isError: () => isError
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(error_exports);
|
|
23
|
+
var import_object = require("./object.js");
|
|
11
24
|
function isError(e) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
if ((0, import_object.isObject)(e)) {
|
|
26
|
+
const hasName = typeof e.name === "string";
|
|
27
|
+
const hasMessage = typeof e.message === "string";
|
|
28
|
+
return hasName && hasMessage;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
18
31
|
}
|
|
19
|
-
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
isError
|
|
35
|
+
});
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/core/ts-http-runtime/src/util/error.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isObject } from \"./object.js\";\n\n/**\n * Typeguard for an error object shape (has name and message)\n * @param e - Something caught by a catch clause.\n */\nexport function isError(e: unknown): e is Error {\n if (isObject(e)) {\n const hasName = typeof e.name === \"string\";\n const hasMessage = typeof e.message === \"string\";\n return hasName && hasMessage;\n }\n return false;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAyB;AAMlB,SAAS,QAAQ,GAAwB;AAC9C,UAAI,wBAAS,CAAC,GAAG;AACf,UAAM,UAAU,OAAO,EAAE,SAAS;AAClC,UAAM,aAAa,OAAO,EAAE,YAAY;AACxC,WAAO,WAAW;AAAA,EACpB;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|