@typespec/ts-http-runtime 0.3.5 → 0.3.6
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/clientHelpers.js +1 -1
- package/dist/browser/client/clientHelpers.js.map +1 -1
- package/dist/browser/client/common.d.ts +3 -2
- package/dist/browser/client/common.js.map +1 -1
- package/dist/browser/client/getClient.js +1 -1
- package/dist/browser/client/getClient.js.map +1 -1
- package/dist/browser/client/multipart.js +1 -1
- package/dist/browser/client/multipart.js.map +1 -1
- package/dist/browser/client/restError.js +5 -4
- package/dist/browser/client/restError.js.map +1 -1
- package/dist/browser/client/sendRequest.js +13 -10
- package/dist/browser/client/sendRequest.js.map +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/createPipelineFromOptions.d.ts +1 -1
- package/dist/browser/createPipelineFromOptions.js +2 -21
- package/dist/browser/createPipelineFromOptions.js.map +1 -1
- package/dist/browser/{defaultHttpClient.d.ts → defaultHttpClient-browser.d.mts} +1 -1
- package/dist/browser/{defaultHttpClient.js → defaultHttpClient-browser.mjs} +1 -1
- package/dist/browser/defaultHttpClient-browser.mjs.map +1 -0
- package/dist/browser/encoding.d.ts +13 -0
- package/dist/browser/encoding.js +19 -0
- package/dist/browser/encoding.js.map +1 -0
- package/dist/{commonjs/util/checkEnvironment.d.ts → browser/env-browser.d.mts} +21 -1
- package/dist/{esm/util/checkEnvironment.js → browser/env-browser.mjs} +26 -12
- package/dist/browser/env-browser.mjs.map +1 -0
- package/dist/browser/formData-web.d.mts +9 -0
- package/dist/browser/formData-web.mjs +12 -0
- package/dist/browser/formData-web.mjs.map +1 -0
- package/dist/browser/httpHeaders.js +11 -1
- package/dist/browser/httpHeaders.js.map +1 -1
- package/dist/browser/index.d.ts +3 -14
- package/dist/browser/index.js +2 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/interfaces.d.ts +15 -14
- package/dist/browser/interfaces.js.map +1 -1
- package/dist/browser/logger/debug.js +3 -2
- package/dist/browser/logger/debug.js.map +1 -1
- package/dist/{react-native/logger/log.d.ts → browser/logger/log-web.d.mts} +1 -1
- package/dist/browser/logger/{log.js → log-web.mjs} +1 -1
- package/dist/browser/logger/log-web.mjs.map +1 -0
- package/dist/browser/logger/logger.js +2 -2
- package/dist/browser/logger/logger.js.map +1 -1
- package/dist/browser/pipelineRequest.js +1 -1
- package/dist/browser/pipelineRequest.js.map +1 -1
- package/dist/browser/policies/auth/basicAuthenticationPolicy.js +1 -1
- package/dist/browser/policies/auth/basicAuthenticationPolicy.js.map +1 -1
- package/dist/browser/policies/auth/checkInsecureConnection.js +3 -2
- package/dist/browser/policies/auth/checkInsecureConnection.js.map +1 -1
- package/dist/browser/policies/{decompressResponsePolicy.d.ts → decompressResponsePolicy-web.d.mts} +1 -1
- package/dist/browser/policies/{decompressResponsePolicy.js → decompressResponsePolicy-web.mjs} +1 -1
- package/dist/browser/policies/decompressResponsePolicy-web.mjs.map +1 -0
- package/dist/browser/policies/formDataPolicy.js +5 -12
- package/dist/browser/policies/formDataPolicy.js.map +1 -1
- package/dist/browser/policies/internal.d.ts +2 -2
- package/dist/browser/policies/internal.js +2 -2
- package/dist/browser/policies/internal.js.map +1 -1
- package/dist/browser/policies/multipartPolicy.js +7 -3
- package/dist/browser/policies/multipartPolicy.js.map +1 -1
- package/dist/browser/policies/platformPolicies-web.d.mts +10 -0
- package/dist/browser/policies/platformPolicies-web.mjs +12 -0
- package/dist/browser/policies/platformPolicies-web.mjs.map +1 -0
- package/dist/browser/policies/platformPolicies.d.ts +25 -0
- package/dist/browser/policies/platformPolicies.js +30 -0
- package/dist/browser/policies/platformPolicies.js.map +1 -0
- package/dist/browser/policies/proxyPolicy-web.d.mts +2 -0
- package/dist/{react-native/policies/proxyPolicy.js → browser/policies/proxyPolicy-web.mjs} +1 -1
- package/dist/browser/policies/proxyPolicy-web.mjs.map +1 -0
- package/dist/browser/restError.js +1 -1
- package/dist/browser/restError.js.map +1 -1
- package/dist/browser/types-browser.d.mts +19 -0
- package/dist/browser/types-browser.mjs +4 -0
- package/dist/browser/types-browser.mjs.map +1 -0
- package/dist/browser/util/bytesEncoding-web.d.mts +2 -0
- package/dist/{react-native/util/bytesEncoding.js → browser/util/bytesEncoding-web.mjs} +1 -1
- package/dist/browser/util/bytesEncoding-web.mjs.map +1 -0
- package/dist/browser/util/bytesEncoding.common.d.ts +4 -4
- package/dist/browser/util/bytesEncoding.common.js +3 -4
- package/dist/browser/util/bytesEncoding.common.js.map +1 -1
- package/dist/browser/util/concat-browser.d.mts +16 -0
- package/dist/browser/util/{concat.js → concat-browser.mjs} +4 -11
- package/dist/browser/util/concat-browser.mjs.map +1 -0
- package/dist/browser/util/inspect-web.d.mts +2 -0
- package/dist/{react-native/util/inspect.js → browser/util/inspect-web.mjs} +1 -1
- package/dist/browser/util/inspect-web.mjs.map +1 -0
- package/dist/browser/util/internal.d.ts +4 -4
- package/dist/browser/util/internal.js +4 -4
- package/dist/browser/util/internal.js.map +1 -1
- package/dist/browser/util/sha256-web.d.mts +2 -0
- package/dist/{react-native/util/sha256.js → browser/util/sha256-web.mjs} +1 -1
- package/dist/browser/util/sha256-web.mjs.map +1 -0
- package/dist/browser/util/sha256.common.js +1 -1
- package/dist/browser/util/sha256.common.js.map +1 -1
- package/dist/browser/util/typeGuards-browser.d.mts +14 -0
- package/dist/browser/util/typeGuards-browser.mjs +26 -0
- package/dist/browser/util/typeGuards-browser.mjs.map +1 -0
- package/dist/browser/util/typeGuards.d.ts +5 -4
- package/dist/browser/util/typeGuards.js +4 -10
- package/dist/browser/util/typeGuards.js.map +1 -1
- package/dist/browser/util/userAgent.d.ts +2 -0
- package/dist/browser/util/userAgent.js +2 -1
- package/dist/browser/util/userAgent.js.map +1 -1
- package/dist/browser/util/{userAgentPlatform.d.ts → userAgentPlatform-browser.d.mts} +1 -1
- package/dist/browser/util/{userAgentPlatform.js → userAgentPlatform-browser.mjs} +1 -1
- package/dist/browser/util/userAgentPlatform-browser.mjs.map +1 -0
- package/dist/browser/util/{uuidUtils.d.ts → uuidUtils-browser.d.mts} +1 -1
- package/dist/browser/util/{uuidUtils.js → uuidUtils-browser.mjs} +1 -1
- package/dist/browser/util/uuidUtils-browser.mjs.map +1 -0
- package/dist/commonjs/client/clientHelpers.js +2 -2
- package/dist/commonjs/client/clientHelpers.js.map +2 -2
- package/dist/commonjs/client/common.d.ts +3 -2
- package/dist/commonjs/client/common.js.map +1 -1
- package/dist/commonjs/client/getClient.js +3 -3
- package/dist/commonjs/client/getClient.js.map +2 -2
- package/dist/commonjs/client/multipart.js.map +1 -1
- package/dist/commonjs/client/restError.js +5 -4
- package/dist/commonjs/client/restError.js.map +2 -2
- package/dist/commonjs/client/sendRequest.js +26 -8
- package/dist/commonjs/client/sendRequest.js.map +2 -2
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/createPipelineFromOptions.d.ts +1 -1
- package/dist/commonjs/createPipelineFromOptions.js +2 -19
- package/dist/commonjs/createPipelineFromOptions.js.map +2 -2
- package/dist/{browser/util/checkEnvironment.d.ts → commonjs/env.d.ts} +21 -1
- package/dist/commonjs/env.js +67 -0
- package/dist/commonjs/env.js.map +7 -0
- package/dist/commonjs/formData.d.ts +10 -0
- package/dist/commonjs/{logger/log.common.js → formData.js} +18 -19
- package/dist/commonjs/formData.js.map +7 -0
- package/dist/commonjs/httpHeaders.js +4 -1
- package/dist/commonjs/httpHeaders.js.map +2 -2
- package/dist/commonjs/index.d.ts +1 -12
- package/dist/commonjs/index.js +2 -2
- package/dist/commonjs/index.js.map +2 -2
- package/dist/commonjs/interfaces.d.ts +15 -14
- package/dist/commonjs/interfaces.js.map +1 -1
- package/dist/commonjs/logger/debug.js +2 -1
- package/dist/commonjs/logger/debug.js.map +2 -2
- package/dist/commonjs/logger/logger.js +2 -1
- package/dist/commonjs/logger/logger.js.map +2 -2
- package/dist/commonjs/nodeHttpClient.js +3 -1
- package/dist/commonjs/nodeHttpClient.js.map +2 -2
- package/dist/commonjs/pipelineRequest.js +2 -2
- package/dist/commonjs/pipelineRequest.js.map +2 -2
- package/dist/commonjs/policies/auth/basicAuthenticationPolicy.js.map +1 -1
- package/dist/commonjs/policies/auth/checkInsecureConnection.js +3 -2
- package/dist/commonjs/policies/auth/checkInsecureConnection.js.map +2 -2
- package/dist/commonjs/policies/formDataPolicy.js +4 -11
- package/dist/commonjs/policies/formDataPolicy.js.map +2 -2
- package/dist/commonjs/policies/internal.d.ts +1 -1
- package/dist/commonjs/policies/internal.js +7 -7
- package/dist/commonjs/policies/internal.js.map +2 -2
- package/dist/commonjs/policies/multipartPolicy.js +2 -2
- package/dist/commonjs/policies/multipartPolicy.js.map +2 -2
- package/dist/commonjs/policies/platformPolicies.d.ts +25 -0
- package/dist/commonjs/policies/platformPolicies.js +43 -0
- package/dist/commonjs/policies/platformPolicies.js.map +7 -0
- package/dist/commonjs/restError.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/types.d.ts +19 -0
- package/dist/commonjs/types.js +16 -0
- package/dist/commonjs/types.js.map +7 -0
- package/dist/commonjs/util/concat.d.ts +1 -1
- package/dist/commonjs/util/concat.js.map +2 -2
- package/dist/commonjs/util/internal.d.ts +1 -1
- package/dist/commonjs/util/internal.js +10 -10
- package/dist/commonjs/util/internal.js.map +2 -2
- package/dist/commonjs/util/typeGuards-node.d.ts +13 -0
- package/dist/commonjs/util/{inspect.common.js → typeGuards-node.js} +15 -7
- package/dist/commonjs/util/typeGuards-node.js.map +7 -0
- package/dist/commonjs/util/typeGuards.d.ts +5 -4
- package/dist/commonjs/util/typeGuards.js +6 -13
- package/dist/commonjs/util/typeGuards.js.map +2 -2
- package/dist/commonjs/util/userAgent.d.ts +2 -0
- package/dist/commonjs/util/userAgent.js +7 -5
- package/dist/commonjs/util/userAgent.js.map +2 -2
- package/dist/esm/client/clientHelpers.js.map +1 -1
- package/dist/esm/client/common.d.ts +3 -2
- package/dist/esm/client/common.js.map +1 -1
- package/dist/esm/client/getClient.js +1 -1
- package/dist/esm/client/getClient.js.map +1 -1
- package/dist/esm/client/multipart.js.map +1 -1
- package/dist/esm/client/restError.js +5 -4
- package/dist/esm/client/restError.js.map +1 -1
- package/dist/esm/client/sendRequest.js +13 -10
- package/dist/esm/client/sendRequest.js.map +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/createPipelineFromOptions.d.ts +1 -1
- package/dist/esm/createPipelineFromOptions.js +2 -21
- package/dist/esm/createPipelineFromOptions.js.map +1 -1
- package/dist/{react-native/util/checkEnvironment.d.ts → esm/env.d.ts} +21 -1
- package/dist/esm/env.js +48 -0
- package/dist/esm/env.js.map +1 -0
- package/dist/esm/formData.d.ts +10 -0
- package/dist/esm/formData.js +26 -0
- package/dist/esm/formData.js.map +1 -0
- package/dist/esm/httpHeaders.js +11 -1
- package/dist/esm/httpHeaders.js.map +1 -1
- package/dist/esm/index.d.ts +1 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces.d.ts +15 -14
- package/dist/esm/interfaces.js.map +1 -1
- package/dist/esm/logger/debug.js +2 -1
- package/dist/esm/logger/debug.js.map +1 -1
- package/dist/esm/logger/logger.js +2 -2
- package/dist/esm/logger/logger.js.map +1 -1
- package/dist/esm/nodeHttpClient.js +3 -1
- package/dist/esm/nodeHttpClient.js.map +1 -1
- package/dist/esm/pipelineRequest.js.map +1 -1
- package/dist/esm/policies/auth/basicAuthenticationPolicy.js.map +1 -1
- package/dist/esm/policies/auth/checkInsecureConnection.js +3 -2
- package/dist/esm/policies/auth/checkInsecureConnection.js.map +1 -1
- package/dist/esm/policies/formDataPolicy.js +4 -11
- package/dist/esm/policies/formDataPolicy.js.map +1 -1
- package/dist/esm/policies/internal.d.ts +1 -1
- package/dist/esm/policies/internal.js +1 -1
- package/dist/esm/policies/internal.js.map +1 -1
- package/dist/esm/policies/multipartPolicy.js +4 -0
- package/dist/esm/policies/multipartPolicy.js.map +1 -1
- package/dist/esm/policies/platformPolicies.d.ts +25 -0
- package/dist/esm/policies/platformPolicies.js +30 -0
- package/dist/esm/policies/platformPolicies.js.map +1 -0
- package/dist/esm/restError.js.map +1 -1
- package/dist/esm/types.d.ts +19 -0
- package/dist/esm/types.js +4 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/util/concat.d.ts +1 -1
- package/dist/esm/util/concat.js.map +1 -1
- package/dist/esm/util/internal.d.ts +1 -1
- package/dist/esm/util/internal.js +1 -1
- package/dist/esm/util/internal.js.map +1 -1
- package/dist/esm/util/typeGuards-node.d.ts +13 -0
- package/dist/esm/util/typeGuards-node.js +20 -0
- package/dist/esm/util/typeGuards-node.js.map +1 -0
- package/dist/esm/util/typeGuards.d.ts +5 -4
- package/dist/esm/util/typeGuards.js +4 -10
- package/dist/esm/util/typeGuards.js.map +1 -1
- package/dist/esm/util/userAgent.d.ts +2 -0
- package/dist/esm/util/userAgent.js +1 -0
- package/dist/esm/util/userAgent.js.map +1 -1
- package/dist/react-native/client/clientHelpers.js +1 -1
- package/dist/react-native/client/clientHelpers.js.map +1 -1
- package/dist/react-native/client/common.d.ts +3 -2
- package/dist/react-native/client/common.js.map +1 -1
- package/dist/react-native/client/getClient.js +1 -1
- package/dist/react-native/client/getClient.js.map +1 -1
- package/dist/react-native/client/multipart.js +1 -1
- package/dist/react-native/client/multipart.js.map +1 -1
- package/dist/react-native/client/restError.js +5 -4
- package/dist/react-native/client/restError.js.map +1 -1
- package/dist/react-native/client/sendRequest.js +13 -10
- package/dist/react-native/client/sendRequest.js.map +1 -1
- package/dist/react-native/constants.js +1 -1
- package/dist/react-native/constants.js.map +1 -1
- package/dist/react-native/createPipelineFromOptions.d.ts +1 -1
- package/dist/react-native/createPipelineFromOptions.js +2 -21
- package/dist/react-native/createPipelineFromOptions.js.map +1 -1
- package/dist/react-native/{defaultHttpClient.d.ts → defaultHttpClient-react-native.d.mts} +1 -1
- package/dist/react-native/{defaultHttpClient.js → defaultHttpClient-react-native.mjs} +1 -1
- package/dist/react-native/defaultHttpClient-react-native.mjs.map +1 -0
- package/dist/react-native/encoding-react-native.d.mts +21 -0
- package/dist/react-native/encoding-react-native.mjs +25 -0
- package/dist/react-native/encoding-react-native.mjs.map +1 -0
- package/dist/{esm/util/checkEnvironment.d.ts → react-native/env-react-native.d.mts} +21 -1
- package/dist/react-native/env-react-native.mjs +50 -0
- package/dist/react-native/env-react-native.mjs.map +1 -0
- package/dist/react-native/formData-web.d.mts +9 -0
- package/dist/react-native/formData-web.mjs +12 -0
- package/dist/react-native/formData-web.mjs.map +1 -0
- package/dist/react-native/httpHeaders.js +11 -1
- package/dist/react-native/httpHeaders.js.map +1 -1
- package/dist/react-native/index.d.ts +3 -14
- package/dist/react-native/index.js +2 -2
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/interfaces.d.ts +15 -14
- package/dist/react-native/interfaces.js.map +1 -1
- package/dist/react-native/logger/debug.js +3 -2
- package/dist/react-native/logger/debug.js.map +1 -1
- package/dist/{browser/logger/log.d.ts → react-native/logger/log-web.d.mts} +1 -1
- package/dist/react-native/logger/{log.js → log-web.mjs} +1 -1
- package/dist/react-native/logger/log-web.mjs.map +1 -0
- package/dist/react-native/logger/logger.js +2 -2
- package/dist/react-native/logger/logger.js.map +1 -1
- package/dist/react-native/pipelineRequest.js +1 -1
- package/dist/react-native/pipelineRequest.js.map +1 -1
- package/dist/react-native/policies/auth/basicAuthenticationPolicy.js +1 -1
- package/dist/react-native/policies/auth/basicAuthenticationPolicy.js.map +1 -1
- package/dist/react-native/policies/auth/checkInsecureConnection.js +3 -2
- package/dist/react-native/policies/auth/checkInsecureConnection.js.map +1 -1
- package/dist/react-native/policies/decompressResponsePolicy-web.d.mts +8 -0
- package/dist/react-native/policies/decompressResponsePolicy-web.mjs +11 -0
- package/dist/react-native/policies/decompressResponsePolicy-web.mjs.map +1 -0
- package/dist/react-native/policies/formDataPolicy.js +5 -12
- package/dist/react-native/policies/formDataPolicy.js.map +1 -1
- package/dist/react-native/policies/internal.d.ts +2 -2
- package/dist/react-native/policies/internal.js +2 -2
- package/dist/react-native/policies/internal.js.map +1 -1
- package/dist/react-native/policies/multipartPolicy.js +7 -3
- package/dist/react-native/policies/multipartPolicy.js.map +1 -1
- package/dist/react-native/policies/platformPolicies-web.d.mts +10 -0
- package/dist/react-native/policies/platformPolicies-web.mjs +12 -0
- package/dist/react-native/policies/platformPolicies-web.mjs.map +1 -0
- package/dist/react-native/policies/platformPolicies.d.ts +25 -0
- package/dist/react-native/policies/platformPolicies.js +30 -0
- package/dist/react-native/policies/platformPolicies.js.map +1 -0
- package/dist/react-native/policies/proxyPolicy-web.d.mts +2 -0
- package/dist/{browser/policies/proxyPolicy.js → react-native/policies/proxyPolicy-web.mjs} +1 -1
- package/dist/react-native/policies/proxyPolicy-web.mjs.map +1 -0
- package/dist/react-native/restError.js +1 -1
- package/dist/react-native/restError.js.map +1 -1
- package/dist/react-native/types-react-native.d.mts +19 -0
- package/dist/react-native/types-react-native.mjs +4 -0
- package/dist/react-native/types-react-native.mjs.map +1 -0
- package/dist/react-native/util/bytesEncoding-web.d.mts +2 -0
- package/dist/{browser/util/bytesEncoding.js → react-native/util/bytesEncoding-web.mjs} +1 -1
- package/dist/react-native/util/bytesEncoding-web.mjs.map +1 -0
- package/dist/react-native/util/bytesEncoding.common.d.ts +4 -4
- package/dist/react-native/util/bytesEncoding.common.js +3 -4
- package/dist/react-native/util/bytesEncoding.common.js.map +1 -1
- package/dist/react-native/util/{concat.d.ts → concat-react-native.d.mts} +10 -3
- package/dist/react-native/util/{concat.js → concat-react-native.mjs} +2 -2
- package/dist/react-native/util/concat-react-native.mjs.map +1 -0
- package/dist/react-native/util/inspect-web.d.mts +2 -0
- package/dist/{browser/util/inspect.js → react-native/util/inspect-web.mjs} +1 -1
- package/dist/react-native/util/inspect-web.mjs.map +1 -0
- package/dist/react-native/util/internal.d.ts +4 -4
- package/dist/react-native/util/internal.js +4 -4
- package/dist/react-native/util/internal.js.map +1 -1
- package/dist/react-native/util/sha256-web.d.mts +2 -0
- package/dist/{browser/util/sha256.js → react-native/util/sha256-web.mjs} +1 -1
- package/dist/react-native/util/sha256-web.mjs.map +1 -0
- package/dist/react-native/util/sha256.common.js +1 -1
- package/dist/react-native/util/sha256.common.js.map +1 -1
- package/dist/react-native/util/typeGuards-react-native.d.mts +16 -0
- package/dist/react-native/util/typeGuards-react-native.mjs +34 -0
- package/dist/react-native/util/typeGuards-react-native.mjs.map +1 -0
- package/dist/react-native/util/typeGuards.d.ts +5 -4
- package/dist/react-native/util/typeGuards.js +4 -10
- package/dist/react-native/util/typeGuards.js.map +1 -1
- package/dist/react-native/util/userAgent.d.ts +2 -0
- package/dist/react-native/util/userAgent.js +2 -1
- package/dist/react-native/util/userAgent.js.map +1 -1
- package/dist/react-native/util/{userAgentPlatform.d.ts → userAgentPlatform-react-native.d.mts} +1 -1
- package/dist/react-native/util/{userAgentPlatform.js → userAgentPlatform-react-native.mjs} +1 -1
- package/dist/react-native/util/userAgentPlatform-react-native.mjs.map +1 -0
- package/dist/react-native/util/uuidUtils-react-native.d.mts +2 -0
- package/dist/react-native/util/{uuidUtils.js → uuidUtils-react-native.mjs} +1 -1
- package/dist/react-native/util/uuidUtils-react-native.mjs.map +1 -0
- package/package.json +94 -8
- package/dist/browser/defaultHttpClient.js.map +0 -1
- package/dist/browser/logger/log.js.map +0 -1
- package/dist/browser/nodeHttpClient.d.ts +0 -9
- package/dist/browser/nodeHttpClient.js +0 -347
- package/dist/browser/nodeHttpClient.js.map +0 -1
- package/dist/browser/policies/decompressResponsePolicy.js.map +0 -1
- package/dist/browser/policies/proxyPolicy.d.ts +0 -2
- package/dist/browser/policies/proxyPolicy.js.map +0 -1
- package/dist/browser/util/bytesEncoding.d.ts +0 -2
- package/dist/browser/util/bytesEncoding.js.map +0 -1
- package/dist/browser/util/checkEnvironment.js +0 -41
- package/dist/browser/util/checkEnvironment.js.map +0 -1
- package/dist/browser/util/concat.d.ts +0 -17
- package/dist/browser/util/concat.js.map +0 -1
- package/dist/browser/util/inspect.d.ts +0 -2
- package/dist/browser/util/inspect.js.map +0 -1
- package/dist/browser/util/sha256.d.ts +0 -2
- package/dist/browser/util/sha256.js.map +0 -1
- package/dist/browser/util/userAgentPlatform.js.map +0 -1
- package/dist/browser/util/uuidUtils.js.map +0 -1
- package/dist/browser/xhrHttpClient.d.ts +0 -7
- package/dist/browser/xhrHttpClient.js +0 -174
- package/dist/browser/xhrHttpClient.js.map +0 -1
- package/dist/commonjs/fetchHttpClient.d.ts +0 -12
- package/dist/commonjs/fetchHttpClient.js +0 -238
- package/dist/commonjs/fetchHttpClient.js.map +0 -7
- package/dist/commonjs/logger/log.common.d.ts +0 -2
- package/dist/commonjs/logger/log.common.js.map +0 -7
- package/dist/commonjs/policies/proxyPolicy.common.d.ts +0 -19
- package/dist/commonjs/policies/proxyPolicy.common.js +0 -44
- package/dist/commonjs/policies/proxyPolicy.common.js.map +0 -7
- package/dist/commonjs/util/arrayBuffer.d.ts +0 -7
- package/dist/commonjs/util/arrayBuffer.js +0 -37
- package/dist/commonjs/util/arrayBuffer.js.map +0 -7
- package/dist/commonjs/util/bytesEncoding.common.d.ts +0 -61
- package/dist/commonjs/util/bytesEncoding.common.js +0 -106
- package/dist/commonjs/util/bytesEncoding.common.js.map +0 -7
- package/dist/commonjs/util/checkEnvironment.js +0 -46
- package/dist/commonjs/util/checkEnvironment.js.map +0 -7
- package/dist/commonjs/util/inspect.common.d.ts +0 -2
- package/dist/commonjs/util/inspect.common.js.map +0 -7
- package/dist/commonjs/util/sha256.common.d.ts +0 -14
- package/dist/commonjs/util/sha256.common.js +0 -70
- package/dist/commonjs/util/sha256.common.js.map +0 -7
- package/dist/commonjs/util/uuidUtils.common.d.ts +0 -13
- package/dist/commonjs/util/uuidUtils.common.js +0 -49
- package/dist/commonjs/util/uuidUtils.common.js.map +0 -7
- package/dist/commonjs/xhrHttpClient.d.ts +0 -7
- package/dist/commonjs/xhrHttpClient.js +0 -186
- package/dist/commonjs/xhrHttpClient.js.map +0 -7
- package/dist/esm/fetchHttpClient.d.ts +0 -12
- package/dist/esm/fetchHttpClient.js +0 -279
- package/dist/esm/fetchHttpClient.js.map +0 -1
- package/dist/esm/logger/log.common.d.ts +0 -2
- package/dist/esm/logger/log.common.js +0 -23
- package/dist/esm/logger/log.common.js.map +0 -1
- package/dist/esm/policies/proxyPolicy.common.d.ts +0 -19
- package/dist/esm/policies/proxyPolicy.common.js +0 -24
- package/dist/esm/policies/proxyPolicy.common.js.map +0 -1
- package/dist/esm/util/arrayBuffer.d.ts +0 -7
- package/dist/esm/util/arrayBuffer.js +0 -20
- package/dist/esm/util/arrayBuffer.js.map +0 -1
- package/dist/esm/util/bytesEncoding.common.d.ts +0 -61
- package/dist/esm/util/bytesEncoding.common.js +0 -110
- package/dist/esm/util/bytesEncoding.common.js.map +0 -1
- package/dist/esm/util/checkEnvironment.js.map +0 -1
- package/dist/esm/util/inspect.common.d.ts +0 -2
- package/dist/esm/util/inspect.common.js +0 -4
- package/dist/esm/util/inspect.common.js.map +0 -1
- package/dist/esm/util/sha256.common.d.ts +0 -14
- package/dist/esm/util/sha256.common.js +0 -49
- package/dist/esm/util/sha256.common.js.map +0 -1
- package/dist/esm/util/uuidUtils.common.d.ts +0 -13
- package/dist/esm/util/uuidUtils.common.js +0 -40
- package/dist/esm/util/uuidUtils.common.js.map +0 -1
- package/dist/esm/xhrHttpClient.d.ts +0 -7
- package/dist/esm/xhrHttpClient.js +0 -174
- package/dist/esm/xhrHttpClient.js.map +0 -1
- package/dist/react-native/defaultHttpClient.js.map +0 -1
- package/dist/react-native/fetchHttpClient.d.ts +0 -12
- package/dist/react-native/fetchHttpClient.js +0 -279
- package/dist/react-native/fetchHttpClient.js.map +0 -1
- package/dist/react-native/logger/log.js.map +0 -1
- package/dist/react-native/nodeHttpClient.d.ts +0 -9
- package/dist/react-native/nodeHttpClient.js +0 -347
- package/dist/react-native/nodeHttpClient.js.map +0 -1
- package/dist/react-native/policies/decompressResponsePolicy.d.ts +0 -11
- package/dist/react-native/policies/decompressResponsePolicy.js +0 -23
- package/dist/react-native/policies/decompressResponsePolicy.js.map +0 -1
- package/dist/react-native/policies/proxyPolicy.d.ts +0 -2
- package/dist/react-native/policies/proxyPolicy.js.map +0 -1
- package/dist/react-native/util/bytesEncoding.d.ts +0 -2
- package/dist/react-native/util/bytesEncoding.js.map +0 -1
- package/dist/react-native/util/checkEnvironment.js +0 -41
- package/dist/react-native/util/checkEnvironment.js.map +0 -1
- package/dist/react-native/util/concat.js.map +0 -1
- package/dist/react-native/util/inspect.d.ts +0 -2
- package/dist/react-native/util/inspect.js.map +0 -1
- package/dist/react-native/util/sha256.d.ts +0 -2
- package/dist/react-native/util/sha256.js.map +0 -1
- package/dist/react-native/util/userAgentPlatform.js.map +0 -1
- package/dist/react-native/util/uuidUtils.d.ts +0 -2
- package/dist/react-native/util/uuidUtils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bytesEncoding.common.js","sourceRoot":"","sources":["../../../src/util/bytesEncoding.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"bytesEncoding.common.js","sourceRoot":"","sources":["../../../src/util/bytesEncoding.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAW5D;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAiB,EAAE,MAAoB;IACxE,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO;YACV,OAAO,sBAAsB,CAAC,KAAK,CAAC,CAAC;QACvC,KAAK,QAAQ;YACX,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACnC,KAAK,WAAW;YACd,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;QACtC,KAAK,KAAK;YACR,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa,EAAE,MAAoB;IACpE,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO;YACV,OAAO,sBAAsB,CAAC,KAAK,CAAC,CAAC;QACvC,KAAK,QAAQ;YACX,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACnC,KAAK,WAAW;YACd,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;QACtC,KAAK,KAAK;YACR,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAiB;IAClD,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAiB;IACrD,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC7F,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAiB;IACtD,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAiB;IACrD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAClD,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa;IACjD,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACjE,OAAO,kBAAkB,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,wBAAwB,CAAC,CAAC;AAEpD;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa;IACjD,sGAAsG;IACtG,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC1C,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACnC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC5D,oFAAoF;YACpF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,UAAU,GAAG,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { decodeUtf8, encodeUtf8 } from \"#platform/encoding\";\n\ndeclare global {\n // stub these out for the browser\n function btoa(input: string): string;\n function atob(input: string): string;\n}\n\n/** The supported character encoding type */\nexport type EncodingType = \"utf-8\" | \"base64\" | \"base64url\" | \"hex\";\n\n/**\n * The helper that transforms bytes with specific character encoding into string\n * @param bytes - the uint8array bytes\n * @param format - the format we use to encode the byte\n * @returns a string of the encoded string\n */\nexport function uint8ArrayToString(bytes: Uint8Array, format: EncodingType): string {\n switch (format) {\n case \"utf-8\":\n return uint8ArrayToUtf8String(bytes);\n case \"base64\":\n return uint8ArrayToBase64(bytes);\n case \"base64url\":\n return uint8ArrayToBase64Url(bytes);\n case \"hex\":\n return uint8ArrayToHexString(bytes);\n }\n}\n\n/**\n * The helper that transforms string to specific character encoded bytes array.\n * @param value - the string to be converted\n * @param format - the format we use to decode the value\n * @returns a uint8array\n */\nexport function stringToUint8Array(value: string, format: EncodingType): Uint8Array {\n switch (format) {\n case \"utf-8\":\n return utf8StringToUint8Array(value);\n case \"base64\":\n return base64ToUint8Array(value);\n case \"base64url\":\n return base64UrlToUint8Array(value);\n case \"hex\":\n return hexStringToUint8Array(value);\n }\n}\n\n/**\n * Decodes a Uint8Array into a Base64 string.\n * @internal\n */\nexport function uint8ArrayToBase64(bytes: Uint8Array): string {\n return btoa([...bytes].map((x) => String.fromCharCode(x)).join(\"\"));\n}\n\n/**\n * Decodes a Uint8Array into a Base64Url string.\n * @internal\n */\nexport function uint8ArrayToBase64Url(bytes: Uint8Array): string {\n return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\n\n/**\n * Decodes a Uint8Array into a javascript string.\n * @internal\n */\nexport function uint8ArrayToUtf8String(bytes: Uint8Array): string {\n return decodeUtf8(bytes);\n}\n\n/**\n * Decodes a Uint8Array into a hex string\n * @internal\n */\nexport function uint8ArrayToHexString(bytes: Uint8Array): string {\n return [...bytes].map((x) => x.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\n/**\n * Encodes a JavaScript string into a Uint8Array.\n * @internal\n */\nexport function utf8StringToUint8Array(value: string): Uint8Array<ArrayBuffer> {\n return encodeUtf8(value);\n}\n\n/**\n * Encodes a Base64 string into a Uint8Array.\n * @internal\n */\nexport function base64ToUint8Array(value: string): Uint8Array<ArrayBuffer> {\n return new Uint8Array([...atob(value)].map((x) => x.charCodeAt(0)));\n}\n\n/**\n * Encodes a Base64Url string into a Uint8Array.\n * @internal\n */\nexport function base64UrlToUint8Array(value: string): Uint8Array<ArrayBuffer> {\n const base64String = value.replace(/-/g, \"+\").replace(/_/g, \"/\");\n return base64ToUint8Array(base64String);\n}\n\nconst hexDigits = new Set(\"0123456789abcdefABCDEF\");\n\n/**\n * Encodes a hex string into a Uint8Array\n * @internal\n */\nexport function hexStringToUint8Array(value: string): Uint8Array<ArrayBuffer> {\n // If value has odd length, the last character will be ignored, consistent with NodeJS Buffer behavior\n const bytes = new Uint8Array(value.length / 2);\n for (let i = 0; i < value.length / 2; ++i) {\n const highNibble = value[2 * i];\n const lowNibble = value[2 * i + 1];\n if (!hexDigits.has(highNibble) || !hexDigits.has(lowNibble)) {\n // Replicate Node Buffer behavior by exiting early when we encounter an invalid byte\n return bytes.slice(0, i);\n }\n\n bytes[i] = parseInt(`${highNibble}${lowNibble}`, 16);\n }\n\n return bytes;\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accepted binary data types for concat
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export type ConcatSource = ReadableStream<Uint8Array<ArrayBuffer>> | Uint8Array<ArrayBuffer> | Blob;
|
|
7
|
+
/**
|
|
8
|
+
* Utility function that concatenates a set of binary inputs into one combined output.
|
|
9
|
+
*
|
|
10
|
+
* @param sources - array of sources for the concatenation
|
|
11
|
+
* @returns a `Blob` representing all the concatenated inputs.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function concat(sources: (ConcatSource | (() => ConcatSource))[]): Promise<Blob>;
|
|
16
|
+
//# sourceMappingURL=concat-browser.d.mts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { isWebReadableStream } from "./typeGuards.
|
|
3
|
+
import { isWebReadableStream } from "./typeGuards-browser.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* Drain the content of the given ReadableStream into a Blob.
|
|
6
|
-
* The blob's content may end up in memory or on disk dependent on size.
|
|
7
6
|
*/
|
|
8
7
|
function drain(stream) {
|
|
9
8
|
return new Response(stream).blob();
|
|
@@ -15,14 +14,10 @@ async function toBlobPart(source) {
|
|
|
15
14
|
if (isWebReadableStream(source)) {
|
|
16
15
|
return drain(source);
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
throw new Error("Unsupported source type. Only Blob, Uint8Array, and ReadableStream are supported in browser.");
|
|
20
|
-
}
|
|
17
|
+
throw new Error("Unsupported source type. Only Blob, Uint8Array, and ReadableStream are supported in browser.");
|
|
21
18
|
}
|
|
22
19
|
/**
|
|
23
20
|
* Converts a Uint8Array to a Uint8Array<ArrayBuffer>.
|
|
24
|
-
* @param source - The source Uint8Array.
|
|
25
|
-
* @returns
|
|
26
21
|
*/
|
|
27
22
|
function arrayToArrayBuffer(source) {
|
|
28
23
|
if ("resize" in source.buffer) {
|
|
@@ -36,8 +31,7 @@ function arrayToArrayBuffer(source) {
|
|
|
36
31
|
* Utility function that concatenates a set of binary inputs into one combined output.
|
|
37
32
|
*
|
|
38
33
|
* @param sources - array of sources for the concatenation
|
|
39
|
-
* @returns
|
|
40
|
-
* In browser, returns a `Blob` representing all the concatenated inputs.
|
|
34
|
+
* @returns a `Blob` representing all the concatenated inputs.
|
|
41
35
|
*
|
|
42
36
|
* @internal
|
|
43
37
|
*/
|
|
@@ -49,10 +43,9 @@ export async function concat(sources) {
|
|
|
49
43
|
parts.push(blobPart);
|
|
50
44
|
}
|
|
51
45
|
else {
|
|
52
|
-
// Uint8Array
|
|
53
46
|
parts.push(new Blob([arrayToArrayBuffer(blobPart)]));
|
|
54
47
|
}
|
|
55
48
|
}
|
|
56
49
|
return new Blob(parts);
|
|
57
50
|
}
|
|
58
|
-
//# sourceMappingURL=concat.
|
|
51
|
+
//# sourceMappingURL=concat-browser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concat-browser.mjs","sourceRoot":"","sources":["../../../src/util/concat-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;GAEG;AACH,SAAS,KAAK,CAAC,MAA+C;IAC5D,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AACrC,CAAC;AAED,KAAK,UAAU,UAAU,CACvB,MAAgF;IAEhF,IAAI,MAAM,YAAY,IAAI,IAAI,MAAM,YAAY,UAAU,EAAE,CAAC;QAC3D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,IAAI,KAAK,CACb,8FAA8F,CAC/F,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,MAAkB;IAC5C,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAC9B,cAAc;QACd,OAAO,MAAiC,CAAC;IAC3C,CAAC;IACD,oBAAoB;IACpB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC;AASD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAgD;IAC3E,MAAM,KAAK,GAAW,EAAE,CAAC;IACzB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACpF,IAAI,QAAQ,YAAY,IAAI,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isWebReadableStream } from \"#platform/typeGuards\";\n\n/**\n * Drain the content of the given ReadableStream into a Blob.\n */\nfunction drain(stream: ReadableStream<Uint8Array<ArrayBuffer>>): Promise<Blob> {\n return new Response(stream).blob();\n}\n\nasync function toBlobPart(\n source: ReadableStream<Uint8Array<ArrayBuffer>> | Uint8Array<ArrayBuffer> | Blob,\n): Promise<Blob | Uint8Array<ArrayBuffer>> {\n if (source instanceof Blob || source instanceof Uint8Array) {\n return source;\n }\n\n if (isWebReadableStream(source)) {\n return drain(source);\n }\n\n throw new Error(\n \"Unsupported source type. Only Blob, Uint8Array, and ReadableStream are supported in browser.\",\n );\n}\n\n/**\n * Converts a Uint8Array to a Uint8Array<ArrayBuffer>.\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<ArrayBuffer>> | Uint8Array<ArrayBuffer> | 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 a `Blob` representing all the concatenated inputs.\n *\n * @internal\n */\nexport async function concat(sources: (ConcatSource | (() => ConcatSource))[]): Promise<Blob> {\n const parts: Blob[] = [];\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 parts.push(new Blob([arrayToArrayBuffer(blobPart)]));\n }\n }\n\n return new Blob(parts);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect-web.mjs","sourceRoot":"","sources":["../../../src/util/inspect-web.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,qBAAqB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./inspect.common.js\";\n"]}
|
|
@@ -2,9 +2,9 @@ export { calculateRetryDelay } from "./delay.js";
|
|
|
2
2
|
export { getRandomIntegerInclusive } from "./random.js";
|
|
3
3
|
export { isObject, type UnknownObject } from "./object.js";
|
|
4
4
|
export { isError } from "./error.js";
|
|
5
|
-
export { computeSha256Hash, computeSha256Hmac } from "./sha256.
|
|
6
|
-
export { randomUUID } from "./uuidUtils.
|
|
7
|
-
export { isBrowser, isBun, isNodeLike, isNodeRuntime, isDeno, isReactNative, isWebWorker, } from "
|
|
8
|
-
export { stringToUint8Array, uint8ArrayToString, type EncodingType } from "./bytesEncoding.
|
|
5
|
+
export { computeSha256Hash, computeSha256Hmac } from "./sha256-web.mjs";
|
|
6
|
+
export { randomUUID } from "./uuidUtils-browser.mjs";
|
|
7
|
+
export { isBrowser, isBun, isNodeLike, isNodeRuntime, isDeno, isReactNative, isWebWorker, } from "../env-browser.mjs";
|
|
8
|
+
export { stringToUint8Array, uint8ArrayToString, type EncodingType } from "./bytesEncoding-web.mjs";
|
|
9
9
|
export { Sanitizer, type SanitizerOptions } from "./sanitizer.js";
|
|
10
10
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -4,9 +4,9 @@ export { calculateRetryDelay } from "./delay.js";
|
|
|
4
4
|
export { getRandomIntegerInclusive } from "./random.js";
|
|
5
5
|
export { isObject } from "./object.js";
|
|
6
6
|
export { isError } from "./error.js";
|
|
7
|
-
export { computeSha256Hash, computeSha256Hmac } from "./sha256.
|
|
8
|
-
export { randomUUID } from "./uuidUtils.
|
|
9
|
-
export { isBrowser, isBun, isNodeLike, isNodeRuntime, isDeno, isReactNative, isWebWorker, } from "
|
|
10
|
-
export { stringToUint8Array, uint8ArrayToString } from "./bytesEncoding.
|
|
7
|
+
export { computeSha256Hash, computeSha256Hmac } from "./sha256-web.mjs";
|
|
8
|
+
export { randomUUID } from "./uuidUtils-browser.mjs";
|
|
9
|
+
export { isBrowser, isBun, isNodeLike, isNodeRuntime, isDeno, isReactNative, isWebWorker, } from "../env-browser.mjs";
|
|
10
|
+
export { stringToUint8Array, uint8ArrayToString } from "./bytesEncoding-web.mjs";
|
|
11
11
|
export { Sanitizer } from "./sanitizer.js";
|
|
12
12
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/util/internal.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAsB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/util/internal.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAsB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,KAAK,EACL,UAAU,EACV,aAAa,EACb,MAAM,EACN,aAAa,EACb,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAqB,MAAM,yBAAyB,CAAC;AACpG,OAAO,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { calculateRetryDelay } from \"./delay.js\";\nexport { getRandomIntegerInclusive } from \"./random.js\";\nexport { isObject, type UnknownObject } from \"./object.js\";\nexport { isError } from \"./error.js\";\nexport { computeSha256Hash, computeSha256Hmac } from \"#platform/sha256\";\nexport { randomUUID } from \"#platform/uuid\";\nexport {\n isBrowser,\n isBun,\n isNodeLike,\n isNodeRuntime,\n isDeno,\n isReactNative,\n isWebWorker,\n} from \"#platform/env\";\nexport { stringToUint8Array, uint8ArrayToString, type EncodingType } from \"#platform/bytesEncoding\";\nexport { Sanitizer, type SanitizerOptions } from \"./sanitizer.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha256-web.mjs","sourceRoot":"","sources":["../../../src/util/sha256-web.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./sha256.common.js\";\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { stringToUint8Array, uint8ArrayToString } from "./bytesEncoding.js";
|
|
3
|
+
import { stringToUint8Array, uint8ArrayToString } from "./bytesEncoding.common.js";
|
|
4
4
|
let subtleCrypto;
|
|
5
5
|
/**
|
|
6
6
|
* Returns a cached reference to the Web API crypto.subtle object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sha256.common.js","sourceRoot":"","sources":["../../../src/util/sha256.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sha256.common.js","sourceRoot":"","sources":["../../../src/util/sha256.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AA6CnF,IAAI,YAAsC,CAAC;AAE3C;;;GAGG;AACH,SAAS,SAAS;IAChB,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACvF,CAAC;IAED,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAClC,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAAW,EACX,YAAoB,EACpB,QAA0B;IAE1B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACnD,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAEpE,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,SAAS,CACtC,KAAK,EACL,QAAQ,EACR;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC1B,EACD,KAAK,EACL,CAAC,MAAM,CAAC,CACT,CAAC;IACF,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,IAAI,CACjC;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC1B,EACD,SAAS,EACT,iBAAiB,CAClB,CAAC;IAEF,OAAO,kBAAkB,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;AACjE,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAAe,EACf,QAA0B;IAE1B,MAAM,YAAY,GAAG,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,YAAY,CAAC,CAAC;IAE3E,OAAO,kBAAkB,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { stringToUint8Array, uint8ArrayToString } from \"./bytesEncoding.common.js\";\n\n// stubs for browser self.crypto\ninterface JsonWebKey {}\ninterface CryptoKey {}\ntype KeyUsage =\n | \"decrypt\"\n | \"deriveBits\"\n | \"deriveKey\"\n | \"encrypt\"\n | \"sign\"\n | \"unwrapKey\"\n | \"verify\"\n | \"wrapKey\";\ninterface Algorithm {\n name: string;\n}\ninterface SubtleCrypto {\n importKey(\n format: string,\n keyData: JsonWebKey,\n algorithm: HmacImportParams,\n extractable: boolean,\n usage: KeyUsage[],\n ): Promise<CryptoKey>;\n sign(\n algorithm: HmacImportParams,\n key: CryptoKey,\n data: ArrayBufferView | ArrayBuffer,\n ): Promise<ArrayBuffer>;\n digest(algorithm: Algorithm, data: ArrayBufferView | ArrayBuffer): Promise<ArrayBuffer>;\n}\ninterface Crypto {\n readonly subtle: SubtleCrypto;\n getRandomValues<T extends ArrayBufferView | null>(array: T): T;\n}\ndeclare const self: {\n crypto: Crypto;\n};\ninterface HmacImportParams {\n name: string;\n hash: Algorithm;\n length?: number;\n}\n\nlet subtleCrypto: SubtleCrypto | undefined;\n\n/**\n * Returns a cached reference to the Web API crypto.subtle object.\n * @internal\n */\nfunction getCrypto(): SubtleCrypto {\n if (subtleCrypto) {\n return subtleCrypto;\n }\n\n if (!self.crypto || !self.crypto.subtle) {\n throw new Error(\"Your browser environment does not support cryptography functions.\");\n }\n\n subtleCrypto = self.crypto.subtle;\n return subtleCrypto;\n}\n\n/**\n * Generates a SHA-256 HMAC signature.\n * @param key - The HMAC key represented as a base64 string, used to generate the cryptographic HMAC hash.\n * @param stringToSign - The data to be signed.\n * @param encoding - The textual encoding to use for the returned HMAC digest.\n */\nexport async function computeSha256Hmac(\n key: string,\n stringToSign: string,\n encoding: \"base64\" | \"hex\",\n): Promise<string> {\n const crypto = getCrypto();\n const keyBytes = stringToUint8Array(key, \"base64\");\n const stringToSignBytes = stringToUint8Array(stringToSign, \"utf-8\");\n\n const cryptoKey = await crypto.importKey(\n \"raw\",\n keyBytes,\n {\n name: \"HMAC\",\n hash: { name: \"SHA-256\" },\n },\n false,\n [\"sign\"],\n );\n const signature = await crypto.sign(\n {\n name: \"HMAC\",\n hash: { name: \"SHA-256\" },\n },\n cryptoKey,\n stringToSignBytes,\n );\n\n return uint8ArrayToString(new Uint8Array(signature), encoding);\n}\n\n/**\n * Generates a SHA-256 hash.\n * @param content - The data to be included in the hash.\n * @param encoding - The textual encoding to use for the returned hash.\n */\nexport async function computeSha256Hash(\n content: string,\n encoding: \"base64\" | \"hex\",\n): Promise<string> {\n const contentBytes = stringToUint8Array(content, \"utf-8\");\n const digest = await getCrypto().digest({ name: \"SHA-256\" }, contentBytes);\n\n return uint8ArrayToString(new Uint8Array(digest), encoding);\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js readable streams are not natively available in the browser, but apps
|
|
3
|
+
* may polyfill them. Use duck-typing so polyfilled streams are detected at runtime.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function isNodeReadableStream(x: unknown): x is never;
|
|
8
|
+
/**
|
|
9
|
+
* Checks if the given value is a web ReadableStream.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function isWebReadableStream(x: unknown): x is ReadableStream;
|
|
14
|
+
//# sourceMappingURL=typeGuards-browser.d.mts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* Node.js readable streams are not natively available in the browser, but apps
|
|
5
|
+
* may polyfill them. Use duck-typing so polyfilled streams are detected at runtime.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export function isNodeReadableStream(x) {
|
|
10
|
+
return (x !== null &&
|
|
11
|
+
x !== undefined &&
|
|
12
|
+
typeof x === "object" &&
|
|
13
|
+
"pipe" in x &&
|
|
14
|
+
typeof x.pipe === "function" &&
|
|
15
|
+
"read" in x &&
|
|
16
|
+
typeof x.read === "function");
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Checks if the given value is a web ReadableStream.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export function isWebReadableStream(x) {
|
|
24
|
+
return x instanceof ReadableStream;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=typeGuards-browser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeGuards-browser.mjs","sourceRoot":"","sources":["../../../src/util/typeGuards-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,CAAU;IAC7C,OAAO,CACL,CAAC,KAAK,IAAI;QACV,CAAC,KAAK,SAAS;QACf,OAAO,CAAC,KAAK,QAAQ;QACrB,MAAM,IAAI,CAAC;QACX,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU;QAC5B,MAAM,IAAI,CAAC;QACX,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAC7B,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,CAAU;IAC5C,OAAO,CAAC,YAAY,cAAc,CAAC;AACrC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Node.js readable streams are not natively available in the browser, but apps\n * may polyfill them. Use duck-typing so polyfilled streams are detected at runtime.\n *\n * @internal\n */\nexport function isNodeReadableStream(x: unknown): x is never {\n return (\n x !== null &&\n x !== undefined &&\n typeof x === \"object\" &&\n \"pipe\" in x &&\n typeof x.pipe === \"function\" &&\n \"read\" in x &&\n typeof x.read === \"function\"\n );\n}\n\n/**\n * Checks if the given value is a web ReadableStream.\n *\n * @internal\n */\nexport function isWebReadableStream(x: unknown): x is ReadableStream {\n return x instanceof ReadableStream;\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare function
|
|
1
|
+
import type { NodeReadableStream, WebReadableStream } from "../types-browser.mjs";
|
|
2
|
+
import { isNodeReadableStream, isWebReadableStream } from "./typeGuards-browser.mjs";
|
|
3
|
+
export { isNodeReadableStream, isWebReadableStream };
|
|
4
|
+
export declare function isBinaryBody(body: unknown): body is Uint8Array | NodeReadableStream | WebReadableStream<Uint8Array> | (() => NodeReadableStream) | (() => WebReadableStream<Uint8Array>) | Blob;
|
|
5
|
+
export declare function isReadableStream(x: unknown): x is WebReadableStream | NodeReadableStream;
|
|
5
6
|
export declare function isBlob(x: unknown): x is Blob;
|
|
6
7
|
//# sourceMappingURL=typeGuards.d.ts.map
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export function isWebReadableStream(x) {
|
|
7
|
-
return Boolean(x &&
|
|
8
|
-
typeof x.getReader === "function" &&
|
|
9
|
-
typeof x.tee === "function");
|
|
10
|
-
}
|
|
3
|
+
import { isNodeReadableStream, isWebReadableStream } from "./typeGuards-browser.mjs";
|
|
4
|
+
export { isNodeReadableStream, isWebReadableStream };
|
|
11
5
|
export function isBinaryBody(body) {
|
|
12
6
|
return (body !== undefined &&
|
|
13
7
|
(body instanceof Uint8Array ||
|
|
14
8
|
isReadableStream(body) ||
|
|
15
9
|
typeof body === "function" ||
|
|
16
|
-
|
|
10
|
+
body instanceof Blob));
|
|
17
11
|
}
|
|
18
12
|
export function isReadableStream(x) {
|
|
19
13
|
return isNodeReadableStream(x) || isWebReadableStream(x);
|
|
20
14
|
}
|
|
21
15
|
export function isBlob(x) {
|
|
22
|
-
return
|
|
16
|
+
return x instanceof Blob;
|
|
23
17
|
}
|
|
24
18
|
//# sourceMappingURL=typeGuards.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.js","sourceRoot":"","sources":["../../../src/util/typeGuards.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"typeGuards.js","sourceRoot":"","sources":["../../../src/util/typeGuards.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;AAErD,MAAM,UAAU,YAAY,CAC1B,IAAa;IAQb,OAAO,CACL,IAAI,KAAK,SAAS;QAClB,CAAC,IAAI,YAAY,UAAU;YACzB,gBAAgB,CAAC,IAAI,CAAC;YACtB,OAAO,IAAI,KAAK,UAAU;YAC1B,IAAI,YAAY,IAAI,CAAC,CACxB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,CAAU;IACzC,OAAO,oBAAoB,CAAC,CAAC,CAAC,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,CAAU;IAC/B,OAAO,CAAC,YAAY,IAAI,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { NodeReadableStream, WebReadableStream } from \"#platform/types\";\nimport { isNodeReadableStream, isWebReadableStream } from \"#platform/typeGuards\";\n\nexport { isNodeReadableStream, isWebReadableStream };\n\nexport function isBinaryBody(\n body: unknown,\n): body is\n | Uint8Array\n | NodeReadableStream\n | WebReadableStream<Uint8Array>\n | (() => NodeReadableStream)\n | (() => WebReadableStream<Uint8Array>)\n | Blob {\n return (\n body !== undefined &&\n (body instanceof Uint8Array ||\n isReadableStream(body) ||\n typeof body === \"function\" ||\n body instanceof Blob)\n );\n}\n\nexport function isReadableStream(x: unknown): x is WebReadableStream | NodeReadableStream {\n return isNodeReadableStream(x) || isWebReadableStream(x);\n}\n\nexport function isBlob(x: unknown): x is Blob {\n return x instanceof Blob;\n}\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { getHeaderName, setPlatformSpecificData } from "./userAgentPlatform.
|
|
3
|
+
import { getHeaderName, setPlatformSpecificData } from "./userAgentPlatform-browser.mjs";
|
|
4
4
|
import { SDK_VERSION } from "../constants.js";
|
|
5
|
+
export { setPlatformSpecificData };
|
|
5
6
|
function getUserAgentString(telemetryInfo) {
|
|
6
7
|
const parts = [];
|
|
7
8
|
for (const [key, value] of telemetryInfo) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userAgent.js","sourceRoot":"","sources":["../../../src/util/userAgent.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"userAgent.js","sourceRoot":"","sources":["../../../src/util/userAgent.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,SAAS,kBAAkB,CAAC,aAAkC;IAC5D,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,aAAa,EAAE,CAAC;QACzC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QAC9C,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,aAAa,EAAE,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAe;IACrD,MAAM,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC9C,WAAW,CAAC,GAAG,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;IAChD,MAAM,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,YAAY,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACrD,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,YAAY,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;IAC3E,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getHeaderName, setPlatformSpecificData } from \"#platform/userAgent\";\nimport { SDK_VERSION } from \"../constants.js\";\n\nexport { setPlatformSpecificData };\n\nfunction getUserAgentString(telemetryInfo: Map<string, string>): string {\n const parts: string[] = [];\n for (const [key, value] of telemetryInfo) {\n const token = value ? `${key}/${value}` : key;\n parts.push(token);\n }\n return parts.join(\" \");\n}\n\n/**\n * @internal\n */\nexport function getUserAgentHeaderName(): string {\n return getHeaderName();\n}\n\n/**\n * @internal\n */\nexport async function getUserAgentValue(prefix?: string): Promise<string> {\n const runtimeInfo = new Map<string, string>();\n runtimeInfo.set(\"ts-http-runtime\", SDK_VERSION);\n await setPlatformSpecificData(runtimeInfo);\n const defaultAgent = getUserAgentString(runtimeInfo);\n const userAgentValue = prefix ? `${prefix} ${defaultAgent}` : defaultAgent;\n return userAgentValue;\n}\n"]}
|
|
@@ -34,4 +34,4 @@ export declare function getHeaderName(): string;
|
|
|
34
34
|
*/
|
|
35
35
|
export declare function setPlatformSpecificData(map: Map<string, string>): Promise<void>;
|
|
36
36
|
export {};
|
|
37
|
-
//# sourceMappingURL=userAgentPlatform.d.
|
|
37
|
+
//# sourceMappingURL=userAgentPlatform-browser.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userAgentPlatform-browser.mjs","sourceRoot":"","sources":["../../../src/util/userAgentPlatform-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkClC;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB;IACvC,MAAM,cAAc,GAAG;QACrB,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,mBAAmB,EAAE;QAC/C,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,2BAA2B,EAAE;KACvD,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,cAAc,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAsB;IACnD,MAAM,UAAU,GAAG,CAAC,eAAe,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACrF,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QACzD,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,GAAwB;IACpE,MAAM,GAAG,GAAG,UAAU,CAAC,SAAS,CAAC;IACjC,IAAI,MAAM,GAAG,SAAS,CAAC;IAEvB,IAAI,GAAG,EAAE,aAAa,EAAE,CAAC;QACvB,MAAM,aAAa,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC,oBAAoB,CAAC;YACjE,cAAc;YACd,iBAAiB;SAClB,CAAC,CAAC;QACH,MAAM,GAAG,GAAG,aAAa,CAAC,QAAQ,IAAI,aAAa,CAAC,eAAe,KAAK,aAAa,CAAC,YAAY,EAAE,CAAC;QAErG,MAAM,KAAK,GAAG,qBAAqB,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC9D,IAAI,KAAK,EAAE,CAAC;YACV,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;SAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC;QACtB,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC5C,IAAI,KAAK,EAAE,CAAC;YACV,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QAC3C,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,WAAW,KAAK,MAAM,GAAG,CAAC,CAAC;IACvD,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\ninterface BrowserBrand {\n brand: string;\n version: string;\n}\n\ninterface UserAgentData {\n brands: BrowserBrand[];\n mobile: boolean;\n platform?: string;\n getHighEntropyValues: (hints: string[]) => Promise<{\n architecture: string;\n bitness: string;\n brands: BrowserBrand[];\n formFactor: string;\n fullVersionList: BrowserBrand[];\n mobile: boolean;\n model: string;\n platform: string;\n platformVersion: string;\n wow64: boolean;\n }>;\n}\n\ndeclare global {\n interface Navigator {\n userAgentData?: UserAgentData;\n }\n\n // Vercel Edge Runtime global\n var EdgeRuntime: string | undefined;\n}\n\n/**\n * @internal\n */\nexport function getHeaderName(): string {\n return \"x-ms-useragent\";\n}\n\nfunction getBrowserInfo(userAgent: string): BrowserBrand | undefined {\n const browserRegexes = [\n { name: \"Firefox\", regex: /Firefox\\/([\\d.]+)/ },\n { name: \"Safari\", regex: /Version\\/([\\d.]+).*Safari/ },\n ];\n\n for (const browser of browserRegexes) {\n const match = userAgent.match(browser.regex);\n if (match) {\n return { brand: browser.name, version: match[1] };\n }\n }\n\n return undefined;\n}\n\nfunction getBrandVersionString(brands: BrowserBrand[]): BrowserBrand | undefined {\n const brandOrder = [\"Google Chrome\", \"Microsoft Edge\", \"Opera\", \"Brave\", \"Chromium\"];\n for (const brand of brandOrder) {\n const foundBrand = brands.find((b) => b.brand === brand);\n if (foundBrand) {\n return foundBrand;\n }\n }\n return undefined;\n}\n\n/**\n * @internal\n */\nexport async function setPlatformSpecificData(map: Map<string, string>): Promise<void> {\n const nav = globalThis.navigator;\n let osInfo = \"unknown\";\n\n if (nav?.userAgentData) {\n const entropyValues = await nav.userAgentData.getHighEntropyValues([\n \"architecture\",\n \"platformVersion\",\n ]);\n osInfo = `${entropyValues.platform} ${entropyValues.platformVersion}; ${entropyValues.architecture}`;\n\n const brand = getBrandVersionString(nav.userAgentData.brands);\n if (brand) {\n map.set(brand.brand, `${brand.version} (${osInfo})`);\n }\n } else if (nav?.platform) {\n osInfo = nav.platform;\n const brand = getBrowserInfo(nav.userAgent);\n if (brand) {\n map.set(brand.brand, `${brand.version} (${osInfo})`);\n }\n } else if (typeof EdgeRuntime === \"string\") {\n map.set(\"EdgeRuntime\", `${EdgeRuntime} (${osInfo})`);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuidUtils-browser.mjs","sourceRoot":"","sources":["../../../src/util/uuidUtils-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAUrD,gEAAgE;AAChE,MAAM,YAAY,GAChB,OAAO,UAAU,EAAE,MAAM,EAAE,UAAU,KAAK,UAAU;IAClD,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IACtD,CAAC,CAAC,YAAY,CAAC;AAEnB;;;;GAIG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,YAAY,EAAE,CAAC;AACxB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { generateUUID } from \"./uuidUtils.common.js\";\n\ninterface Crypto {\n randomUUID(): string;\n}\n\ndeclare const globalThis: {\n crypto: Crypto;\n};\n\n// NOTE: This could be undefined if not used in a secure context\nconst uuidFunction =\n typeof globalThis?.crypto?.randomUUID === \"function\"\n ? globalThis.crypto.randomUUID.bind(globalThis.crypto)\n : generateUUID;\n\n/**\n * Generated Universally Unique Identifier\n *\n * @returns RFC4122 v4 UUID.\n */\nexport function randomUUID(): string {\n return uuidFunction();\n}\n"]}
|
|
@@ -21,7 +21,7 @@ __export(clientHelpers_exports, {
|
|
|
21
21
|
getCachedDefaultHttpsClient: () => getCachedDefaultHttpsClient
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(clientHelpers_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_httpClient = require("../defaultHttpClient.js");
|
|
25
25
|
var import_createPipelineFromOptions = require("../createPipelineFromOptions.js");
|
|
26
26
|
var import_apiVersionPolicy = require("./apiVersionPolicy.js");
|
|
27
27
|
var import_credentials = require("../auth/credentials.js");
|
|
@@ -57,7 +57,7 @@ function createDefaultPipeline(options = {}) {
|
|
|
57
57
|
}
|
|
58
58
|
function getCachedDefaultHttpsClient() {
|
|
59
59
|
if (!cachedHttpClient) {
|
|
60
|
-
cachedHttpClient = (0,
|
|
60
|
+
cachedHttpClient = (0, import_httpClient.createDefaultHttpClient)();
|
|
61
61
|
}
|
|
62
62
|
return cachedHttpClient;
|
|
63
63
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/client/clientHelpers.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { HttpClient } from \"../interfaces.js\";\nimport type { Pipeline } from \"../pipeline.js\";\nimport { createDefaultHttpClient } from \"
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { HttpClient } from \"../interfaces.js\";\nimport type { Pipeline } from \"../pipeline.js\";\nimport { createDefaultHttpClient } from \"#platform/httpClient\";\nimport { createPipelineFromOptions } from \"../createPipelineFromOptions.js\";\nimport type { ClientOptions } from \"./common.js\";\nimport { apiVersionPolicy } from \"./apiVersionPolicy.js\";\nimport {\n isApiKeyCredential,\n isBasicCredential,\n isBearerTokenCredential,\n isOAuth2TokenCredential,\n} from \"../auth/credentials.js\";\nimport { apiKeyAuthenticationPolicy } from \"../policies/auth/apiKeyAuthenticationPolicy.js\";\nimport { basicAuthenticationPolicy } from \"../policies/auth/basicAuthenticationPolicy.js\";\nimport { bearerAuthenticationPolicy } from \"../policies/auth/bearerAuthenticationPolicy.js\";\nimport { oauth2AuthenticationPolicy } from \"../policies/auth/oauth2AuthenticationPolicy.js\";\n\nlet cachedHttpClient: HttpClient | undefined;\n\n/**\n * Creates a default rest pipeline to re-use accross Rest Level Clients\n */\nexport function createDefaultPipeline(options: ClientOptions = {}): Pipeline {\n const pipeline = createPipelineFromOptions(options);\n\n pipeline.addPolicy(apiVersionPolicy(options));\n\n const { credential, authSchemes, allowInsecureConnection } = options;\n if (credential) {\n if (isApiKeyCredential(credential)) {\n pipeline.addPolicy(\n apiKeyAuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n } else if (isBasicCredential(credential)) {\n pipeline.addPolicy(\n basicAuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n } else if (isBearerTokenCredential(credential)) {\n pipeline.addPolicy(\n bearerAuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n } else if (isOAuth2TokenCredential(credential)) {\n pipeline.addPolicy(\n oauth2AuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n }\n }\n\n return pipeline;\n}\n\nexport function getCachedDefaultHttpsClient(): HttpClient {\n if (!cachedHttpClient) {\n cachedHttpClient = createDefaultHttpClient();\n }\n\n return cachedHttpClient;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,wBAAwC;AACxC,uCAA0C;AAE1C,8BAAiC;AACjC,yBAKO;AACP,wCAA2C;AAC3C,uCAA0C;AAC1C,wCAA2C;AAC3C,wCAA2C;AAE3C,IAAI;AAKG,SAAS,sBAAsB,UAAyB,CAAC,GAAa;AAC3E,QAAM,eAAW,4DAA0B,OAAO;AAElD,WAAS,cAAU,0CAAiB,OAAO,CAAC;AAE5C,QAAM,EAAE,YAAY,aAAa,wBAAwB,IAAI;AAC7D,MAAI,YAAY;AACd,YAAI,uCAAmB,UAAU,GAAG;AAClC,eAAS;AAAA,YACP,8DAA2B,EAAE,aAAa,YAAY,wBAAwB,CAAC;AAAA,MACjF;AAAA,IACF,eAAW,sCAAkB,UAAU,GAAG;AACxC,eAAS;AAAA,YACP,4DAA0B,EAAE,aAAa,YAAY,wBAAwB,CAAC;AAAA,MAChF;AAAA,IACF,eAAW,4CAAwB,UAAU,GAAG;AAC9C,eAAS;AAAA,YACP,8DAA2B,EAAE,aAAa,YAAY,wBAAwB,CAAC;AAAA,MACjF;AAAA,IACF,eAAW,4CAAwB,UAAU,GAAG;AAC9C,eAAS;AAAA,YACP,8DAA2B,EAAE,aAAa,YAAY,wBAAwB,CAAC;AAAA,MACjF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,8BAA0C;AACxD,MAAI,CAAC,kBAAkB;AACrB,2BAAmB,2CAAwB;AAAA,EAC7C;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,7 @@ import type { HttpClient, PipelineRequest, PipelineResponse, RawHttpHeaders, Req
|
|
|
2
2
|
import type { Pipeline, PipelinePolicy } from "../pipeline.js";
|
|
3
3
|
import type { PipelineOptions } from "../createPipelineFromOptions.js";
|
|
4
4
|
import type { LogPolicyOptions } from "../policies/logPolicy.js";
|
|
5
|
+
import type { NodeReadableStream, WebReadableStream } from "../types.js";
|
|
5
6
|
import type { AuthScheme } from "../auth/schemes.js";
|
|
6
7
|
import type { ClientCredential } from "../auth/credentials.js";
|
|
7
8
|
/**
|
|
@@ -175,7 +176,7 @@ export type HttpNodeStreamResponse = HttpResponse & {
|
|
|
175
176
|
/**
|
|
176
177
|
* Streamable body
|
|
177
178
|
*/
|
|
178
|
-
body?:
|
|
179
|
+
body?: NodeReadableStream;
|
|
179
180
|
};
|
|
180
181
|
/**
|
|
181
182
|
* Http Response which body is a NodeJS stream object
|
|
@@ -184,7 +185,7 @@ export type HttpBrowserStreamResponse = HttpResponse & {
|
|
|
184
185
|
/**
|
|
185
186
|
* Streamable body
|
|
186
187
|
*/
|
|
187
|
-
body?:
|
|
188
|
+
body?: WebReadableStream<Uint8Array>;
|
|
188
189
|
};
|
|
189
190
|
/**
|
|
190
191
|
* Defines the type for a method that supports getting the response body as
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/client/common.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n HttpClient,\n PipelineRequest,\n PipelineResponse,\n RawHttpHeaders,\n RequestBodyType,\n TransferProgressEvent,\n RawHttpHeadersInput,\n} from \"../interfaces.js\";\nimport type { Pipeline, PipelinePolicy } from \"../pipeline.js\";\nimport type { PipelineOptions } from \"../createPipelineFromOptions.js\";\nimport type { LogPolicyOptions } from \"../policies/logPolicy.js\";\nimport type { AuthScheme } from \"../auth/schemes.js\";\nimport type { ClientCredential } from \"../auth/credentials.js\";\n\n/**\n * Shape of the default request parameters, this may be overridden by the specific\n * request types to provide strong types\n */\nexport type RequestParameters = {\n /**\n * Headers to send along with the request\n */\n headers?: RawHttpHeadersInput;\n /**\n * Sets the accept header to send to the service\n * defaults to 'application/json'. If also a header \"accept\" is set\n * this property will take precedence.\n */\n accept?: string;\n /**\n * Body to send with the request\n */\n body?: unknown;\n /**\n * Query parameters to send with the request\n */\n queryParameters?: Record<string, unknown>;\n /**\n * Set an explicit content-type to send with the request. If also a header \"content-type\" is set\n * this property will take precedence.\n */\n contentType?: string;\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n /** Set to true if you want to skip encoding the path parameters */\n skipUrlEncoding?: boolean;\n /**\n * Path parameters for custom the base url\n */\n pathParameters?: Record<string, any>;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignal;\n\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n};\n\n/**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n// UNBRANDED DIFFERENCE: onResponse callback does not have a second __legacyError parameter which was provided for backwards compatibility\nexport type RawResponseCallback = (rawResponse: FullOperationResponse, error?: unknown) => void;\n\n/**\n * Wrapper object for http request and response. Deserialized object is stored in\n * the `parsedBody` property when the response body is received in JSON.\n */\nexport interface FullOperationResponse extends PipelineResponse {\n /**\n * The raw HTTP response headers.\n */\n rawHeaders?: RawHttpHeaders;\n\n /**\n * The response body as parsed JSON.\n */\n parsedBody?: RequestBodyType;\n\n /**\n * The request that generated the response.\n */\n request: PipelineRequest;\n}\n\n/**\n * The base options type for all operations.\n */\nexport interface OperationOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignal;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: OperationRequestOptions;\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n}\n\n/**\n * Options used when creating and sending HTTP requests for this operation.\n */\nexport interface OperationRequestOptions {\n /**\n * User defined custom request headers that\n * will be applied before the request is sent.\n */\n headers?: RawHttpHeadersInput;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Set to true if the request is sent over HTTP instead of HTTPS\n */\n allowInsecureConnection?: boolean;\n\n /**\n * Set to true if you want to skip encoding the path parameters\n */\n skipUrlEncoding?: boolean;\n}\n\n/**\n * Type to use with pathUnchecked, overrides the body type to any to allow flexibility\n */\nexport type PathUncheckedResponse = HttpResponse & { body: any };\n\n/**\n * Shape of a Rest Level Client\n */\nexport interface Client {\n /**\n * The pipeline used by this client to make requests\n */\n pipeline: Pipeline;\n /**\n * This method will be used to send request that would check the path to provide\n * strong types. When used by the codegen this type gets overridden with the generated\n * types. For example:\n * ```typescript snippet:ReadmeSamplePathExample\n * import { Client } from \"@typespec/ts-http-runtime\";\n *\n * type MyClient = Client & {\n * path: Routes;\n * };\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n path: Function;\n /**\n * This method allows arbitrary paths and doesn't provide strong types\n */\n pathUnchecked: PathUnchecked;\n}\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpNodeStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: NodeJS.ReadableStream;\n};\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpBrowserStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: ReadableStream<Uint8Array>;\n};\n\n/**\n * Defines the type for a method that supports getting the response body as\n * a raw stream\n */\nexport type StreamableMethod<TResponse = PathUncheckedResponse> = PromiseLike<TResponse> & {\n /**\n * Returns the response body as a NodeJS stream. Only available in Node-like environments.\n */\n asNodeStream: () => Promise<HttpNodeStreamResponse>;\n /**\n * Returns the response body as a browser (Web) stream. Only available in the browser. If you require a Web Stream of the response in Node, consider using the\n * `Readable.toWeb` Node API on the result of `asNodeStream`.\n */\n asBrowserStream: () => Promise<HttpBrowserStreamResponse>;\n};\n\n/**\n * Defines the signature for pathUnchecked.\n */\nexport type PathUnchecked = <TPath extends string>(\n path: TPath,\n ...args: PathParameters<TPath>\n) => ResourceMethods<StreamableMethod>;\n\n/**\n * Defines the methods that can be called on a resource\n */\nexport interface ResourceMethods<TResponse = PromiseLike<PathUncheckedResponse>> {\n /**\n * Definition of the GET HTTP method for a resource\n */\n get: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the POST HTTP method for a resource\n */\n post: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PUT HTTP method for a resource\n */\n put: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PATCH HTTP method for a resource\n */\n patch: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the DELETE HTTP method for a resource\n */\n delete: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the HEAD HTTP method for a resource\n */\n head: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the OPTIONS HTTP method for a resource\n */\n options: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the TRACE HTTP method for a resource\n */\n trace: (options?: RequestParameters) => TResponse;\n}\n\n/**\n * Used to configure additional policies added to the pipeline at construction.\n */\nexport interface AdditionalPolicyConfig {\n /**\n * A policy to be added.\n */\n policy: PipelinePolicy;\n /**\n * Determines if this policy be applied before or after retry logic.\n * Only use `perRetry` if you need to modify the request again\n * each time the operation is retried due to retryable service\n * issues.\n */\n position: \"perCall\" | \"perRetry\";\n}\n\n/**\n * General options that a Rest Level Client can take\n */\nexport type ClientOptions = PipelineOptions & {\n /**\n * List of authentication schemes supported by the client.\n * These schemes define how the client can authenticate requests.\n */\n authSchemes?: AuthScheme[];\n\n /**\n * The credential used to authenticate requests.\n * Must be compatible with one of the specified authentication schemes.\n */\n credential?: ClientCredential;\n\n // UNBRANDED DIFFERENCE: The deprecated baseUrl property is removed in favor of the endpoint property in the unbranded Core package\n\n /**\n * Endpoint for the client\n */\n endpoint?: string;\n /**\n * Options for setting a custom apiVersion.\n */\n apiVersion?: string;\n /**\n * Option to allow calling http (insecure) endpoints\n */\n allowInsecureConnection?: boolean;\n /**\n * Additional policies to include in the HTTP pipeline.\n */\n additionalPolicies?: AdditionalPolicyConfig[];\n /**\n * Specify a custom HttpClient when making requests.\n */\n httpClient?: HttpClient;\n /**\n * Options to configure request/response logging.\n */\n loggingOptions?: LogPolicyOptions;\n /**\n * Pipeline to use for the client. If not provided, a default pipeline will be created using the options provided.\n * Use with caution -- when setting this option, all client options that are used in the creation of the default pipeline\n * will be ignored.\n */\n pipeline?: Pipeline;\n};\n\n/**\n * Represents the shape of an HttpResponse\n */\nexport type HttpResponse = {\n /**\n * The request that generated this response.\n */\n request: PipelineRequest;\n /**\n * The HTTP response headers.\n */\n headers: RawHttpHeaders;\n /**\n * Parsed body\n */\n body: unknown;\n /**\n * The HTTP status code of the response.\n */\n status: string;\n};\n\n/**\n * Helper type used to detect parameters in a path template\n * text surrounded by \\{\\} will be considered a path parameter\n */\nexport type PathParameters<\n TRoute extends string,\n // This is trying to match the string in TRoute with a template where HEAD/{PARAM}/TAIL\n // for example in the followint path: /foo/{fooId}/bar/{barId}/baz the template will infer\n // HEAD: /foo\n // Param: fooId\n // Tail: /bar/{barId}/baz\n // The above sample path would return [pathParam: string, pathParam: string]\n> = TRoute extends `${infer _Head}/{${infer _Param}}${infer Tail}`\n ? // In case we have a match for the template above we know for sure\n // that we have at least one pathParameter, that's why we set the first pathParam\n // in the tuple. At this point we have only matched up until param, if we want to identify\n // additional parameters we can call RouteParameters recursively on the Tail to match the remaining parts,\n // in case the Tail has more parameters, it will return a tuple with the parameters found in tail.\n // We spread the second path params to end up with a single dimension tuple at the end.\n [\n pathParameter: string | number | PathParameterWithOptions,\n ...pathParameters: PathParameters<Tail>,\n ]\n : // When the path doesn't match the template, it means that we have no path parameters so we return\n // an empty tuple.\n [];\n\n/** A response containing error details. */\nexport interface ErrorResponse {\n /** The error object. */\n error: ErrorModel;\n}\n\n/** The error object. */\nexport interface ErrorModel {\n /** One of a server-defined set of error codes. */\n code: string;\n /** A human-readable representation of the error. */\n message: string;\n /** The target of the error. */\n target?: string;\n /** An array of details about specific errors that led to this reported error. */\n details: Array<ErrorModel>;\n /** An object containing more specific information than the current object about the error. */\n innererror?: InnerError;\n}\n\n/** An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. */\nexport interface InnerError {\n /** One of a server-defined set of error codes. */\n code: string;\n /** Inner error. */\n innererror?: InnerError;\n}\n\n/**\n * An object that can be passed as a path parameter, allowing for additional options to be set relating to how the parameter is encoded.\n */\nexport interface PathParameterWithOptions {\n /**\n * The value of the parameter.\n */\n value: string | number;\n\n /**\n * Whether to allow for reserved characters in the value. If set to true, special characters such as '/' in the parameter's value will not be URL encoded.\n * Defaults to false.\n */\n allowReserved?: boolean;\n}\n"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n HttpClient,\n PipelineRequest,\n PipelineResponse,\n RawHttpHeaders,\n RequestBodyType,\n TransferProgressEvent,\n RawHttpHeadersInput,\n} from \"../interfaces.js\";\nimport type { Pipeline, PipelinePolicy } from \"../pipeline.js\";\nimport type { PipelineOptions } from \"../createPipelineFromOptions.js\";\nimport type { LogPolicyOptions } from \"../policies/logPolicy.js\";\nimport type { NodeReadableStream, WebReadableStream } from \"#platform/types\";\nimport type { AuthScheme } from \"../auth/schemes.js\";\nimport type { ClientCredential } from \"../auth/credentials.js\";\n\n/**\n * Shape of the default request parameters, this may be overridden by the specific\n * request types to provide strong types\n */\nexport type RequestParameters = {\n /**\n * Headers to send along with the request\n */\n headers?: RawHttpHeadersInput;\n /**\n * Sets the accept header to send to the service\n * defaults to 'application/json'. If also a header \"accept\" is set\n * this property will take precedence.\n */\n accept?: string;\n /**\n * Body to send with the request\n */\n body?: unknown;\n /**\n * Query parameters to send with the request\n */\n queryParameters?: Record<string, unknown>;\n /**\n * Set an explicit content-type to send with the request. If also a header \"content-type\" is set\n * this property will take precedence.\n */\n contentType?: string;\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n /** Set to true if you want to skip encoding the path parameters */\n skipUrlEncoding?: boolean;\n /**\n * Path parameters for custom the base url\n */\n pathParameters?: Record<string, any>;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignal;\n\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n};\n\n/**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n// UNBRANDED DIFFERENCE: onResponse callback does not have a second __legacyError parameter which was provided for backwards compatibility\nexport type RawResponseCallback = (rawResponse: FullOperationResponse, error?: unknown) => void;\n\n/**\n * Wrapper object for http request and response. Deserialized object is stored in\n * the `parsedBody` property when the response body is received in JSON.\n */\nexport interface FullOperationResponse extends PipelineResponse {\n /**\n * The raw HTTP response headers.\n */\n rawHeaders?: RawHttpHeaders;\n\n /**\n * The response body as parsed JSON.\n */\n parsedBody?: RequestBodyType;\n\n /**\n * The request that generated the response.\n */\n request: PipelineRequest;\n}\n\n/**\n * The base options type for all operations.\n */\nexport interface OperationOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignal;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: OperationRequestOptions;\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n}\n\n/**\n * Options used when creating and sending HTTP requests for this operation.\n */\nexport interface OperationRequestOptions {\n /**\n * User defined custom request headers that\n * will be applied before the request is sent.\n */\n headers?: RawHttpHeadersInput;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Set to true if the request is sent over HTTP instead of HTTPS\n */\n allowInsecureConnection?: boolean;\n\n /**\n * Set to true if you want to skip encoding the path parameters\n */\n skipUrlEncoding?: boolean;\n}\n\n/**\n * Type to use with pathUnchecked, overrides the body type to any to allow flexibility\n */\nexport type PathUncheckedResponse = HttpResponse & { body: any };\n\n/**\n * Shape of a Rest Level Client\n */\nexport interface Client {\n /**\n * The pipeline used by this client to make requests\n */\n pipeline: Pipeline;\n /**\n * This method will be used to send request that would check the path to provide\n * strong types. When used by the codegen this type gets overridden with the generated\n * types. For example:\n * ```typescript snippet:ReadmeSamplePathExample\n * import { Client } from \"@typespec/ts-http-runtime\";\n *\n * type MyClient = Client & {\n * path: Routes;\n * };\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n path: Function;\n /**\n * This method allows arbitrary paths and doesn't provide strong types\n */\n pathUnchecked: PathUnchecked;\n}\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpNodeStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: NodeReadableStream;\n};\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpBrowserStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: WebReadableStream<Uint8Array>;\n};\n\n/**\n * Defines the type for a method that supports getting the response body as\n * a raw stream\n */\nexport type StreamableMethod<TResponse = PathUncheckedResponse> = PromiseLike<TResponse> & {\n /**\n * Returns the response body as a NodeJS stream. Only available in Node-like environments.\n */\n asNodeStream: () => Promise<HttpNodeStreamResponse>;\n /**\n * Returns the response body as a browser (Web) stream. Only available in the browser. If you require a Web Stream of the response in Node, consider using the\n * `Readable.toWeb` Node API on the result of `asNodeStream`.\n */\n asBrowserStream: () => Promise<HttpBrowserStreamResponse>;\n};\n\n/**\n * Defines the signature for pathUnchecked.\n */\nexport type PathUnchecked = <TPath extends string>(\n path: TPath,\n ...args: PathParameters<TPath>\n) => ResourceMethods<StreamableMethod>;\n\n/**\n * Defines the methods that can be called on a resource\n */\nexport interface ResourceMethods<TResponse = PromiseLike<PathUncheckedResponse>> {\n /**\n * Definition of the GET HTTP method for a resource\n */\n get: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the POST HTTP method for a resource\n */\n post: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PUT HTTP method for a resource\n */\n put: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PATCH HTTP method for a resource\n */\n patch: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the DELETE HTTP method for a resource\n */\n delete: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the HEAD HTTP method for a resource\n */\n head: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the OPTIONS HTTP method for a resource\n */\n options: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the TRACE HTTP method for a resource\n */\n trace: (options?: RequestParameters) => TResponse;\n}\n\n/**\n * Used to configure additional policies added to the pipeline at construction.\n */\nexport interface AdditionalPolicyConfig {\n /**\n * A policy to be added.\n */\n policy: PipelinePolicy;\n /**\n * Determines if this policy be applied before or after retry logic.\n * Only use `perRetry` if you need to modify the request again\n * each time the operation is retried due to retryable service\n * issues.\n */\n position: \"perCall\" | \"perRetry\";\n}\n\n/**\n * General options that a Rest Level Client can take\n */\nexport type ClientOptions = PipelineOptions & {\n /**\n * List of authentication schemes supported by the client.\n * These schemes define how the client can authenticate requests.\n */\n authSchemes?: AuthScheme[];\n\n /**\n * The credential used to authenticate requests.\n * Must be compatible with one of the specified authentication schemes.\n */\n credential?: ClientCredential;\n\n // UNBRANDED DIFFERENCE: The deprecated baseUrl property is removed in favor of the endpoint property in the unbranded Core package\n\n /**\n * Endpoint for the client\n */\n endpoint?: string;\n /**\n * Options for setting a custom apiVersion.\n */\n apiVersion?: string;\n /**\n * Option to allow calling http (insecure) endpoints\n */\n allowInsecureConnection?: boolean;\n /**\n * Additional policies to include in the HTTP pipeline.\n */\n additionalPolicies?: AdditionalPolicyConfig[];\n /**\n * Specify a custom HttpClient when making requests.\n */\n httpClient?: HttpClient;\n /**\n * Options to configure request/response logging.\n */\n loggingOptions?: LogPolicyOptions;\n /**\n * Pipeline to use for the client. If not provided, a default pipeline will be created using the options provided.\n * Use with caution -- when setting this option, all client options that are used in the creation of the default pipeline\n * will be ignored.\n */\n pipeline?: Pipeline;\n};\n\n/**\n * Represents the shape of an HttpResponse\n */\nexport type HttpResponse = {\n /**\n * The request that generated this response.\n */\n request: PipelineRequest;\n /**\n * The HTTP response headers.\n */\n headers: RawHttpHeaders;\n /**\n * Parsed body\n */\n body: unknown;\n /**\n * The HTTP status code of the response.\n */\n status: string;\n};\n\n/**\n * Helper type used to detect parameters in a path template\n * text surrounded by \\{\\} will be considered a path parameter\n */\nexport type PathParameters<\n TRoute extends string,\n // This is trying to match the string in TRoute with a template where HEAD/{PARAM}/TAIL\n // for example in the followint path: /foo/{fooId}/bar/{barId}/baz the template will infer\n // HEAD: /foo\n // Param: fooId\n // Tail: /bar/{barId}/baz\n // The above sample path would return [pathParam: string, pathParam: string]\n> = TRoute extends `${infer _Head}/{${infer _Param}}${infer Tail}`\n ? // In case we have a match for the template above we know for sure\n // that we have at least one pathParameter, that's why we set the first pathParam\n // in the tuple. At this point we have only matched up until param, if we want to identify\n // additional parameters we can call RouteParameters recursively on the Tail to match the remaining parts,\n // in case the Tail has more parameters, it will return a tuple with the parameters found in tail.\n // We spread the second path params to end up with a single dimension tuple at the end.\n [\n pathParameter: string | number | PathParameterWithOptions,\n ...pathParameters: PathParameters<Tail>,\n ]\n : // When the path doesn't match the template, it means that we have no path parameters so we return\n // an empty tuple.\n [];\n\n/** A response containing error details. */\nexport interface ErrorResponse {\n /** The error object. */\n error: ErrorModel;\n}\n\n/** The error object. */\nexport interface ErrorModel {\n /** One of a server-defined set of error codes. */\n code: string;\n /** A human-readable representation of the error. */\n message: string;\n /** The target of the error. */\n target?: string;\n /** An array of details about specific errors that led to this reported error. */\n details: Array<ErrorModel>;\n /** An object containing more specific information than the current object about the error. */\n innererror?: InnerError;\n}\n\n/** An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. */\nexport interface InnerError {\n /** One of a server-defined set of error codes. */\n code: string;\n /** Inner error. */\n innererror?: InnerError;\n}\n\n/**\n * An object that can be passed as a path parameter, allowing for additional options to be set relating to how the parameter is encoded.\n */\nexport interface PathParameterWithOptions {\n /**\n * The value of the parameter.\n */\n value: string | number;\n\n /**\n * Whether to allow for reserved characters in the value. If set to true, special characters such as '/' in the parameter's value will not be URL encoded.\n * Defaults to false.\n */\n allowReserved?: boolean;\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -23,7 +23,7 @@ module.exports = __toCommonJS(getClient_exports);
|
|
|
23
23
|
var import_clientHelpers = require("./clientHelpers.js");
|
|
24
24
|
var import_sendRequest = require("./sendRequest.js");
|
|
25
25
|
var import_urlHelpers = require("./urlHelpers.js");
|
|
26
|
-
var
|
|
26
|
+
var import_env = require("../env.js");
|
|
27
27
|
function getClient(endpoint, clientOptions = {}) {
|
|
28
28
|
const pipeline = clientOptions.pipeline ?? (0, import_clientHelpers.createDefaultPipeline)(clientOptions);
|
|
29
29
|
if (clientOptions.additionalPolicies?.length) {
|
|
@@ -140,7 +140,7 @@ function buildOperation(method, url, pipeline, options, allowInsecureConnection,
|
|
|
140
140
|
).then(onFulfilled, onrejected);
|
|
141
141
|
},
|
|
142
142
|
async asBrowserStream() {
|
|
143
|
-
if (
|
|
143
|
+
if (import_env.isNodeLike) {
|
|
144
144
|
throw new Error(
|
|
145
145
|
"`asBrowserStream` is supported only in the browser environment. Use `asNodeStream` instead to obtain the response body stream. If you require a Web stream of the response in Node, consider using `Readable.toWeb` on the result of `asNodeStream`."
|
|
146
146
|
);
|
|
@@ -155,7 +155,7 @@ function buildOperation(method, url, pipeline, options, allowInsecureConnection,
|
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
157
|
async asNodeStream() {
|
|
158
|
-
if (
|
|
158
|
+
if (import_env.isNodeLike) {
|
|
159
159
|
return (0, import_sendRequest.sendRequest)(
|
|
160
160
|
method,
|
|
161
161
|
url,
|