@typespec/ts-http-runtime 0.3.5 → 0.3.7
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/auth/credentials.js.map +1 -1
- package/dist/browser/auth/oauth2Flows.js.map +1 -1
- 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.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/logPolicy.js +1 -1
- package/dist/browser/policies/logPolicy.js.map +1 -1
- package/dist/browser/policies/multipartPolicy.js +6 -2
- 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 +3 -3
- package/dist/browser/util/internal.js +3 -3
- 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.js +1 -6
- package/dist/browser/util/uuidUtils.js.map +1 -1
- package/dist/commonjs/auth/credentials.js.map +2 -2
- package/dist/commonjs/auth/oauth2Flows.js.map +1 -1
- 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/logPolicy.js +1 -1
- package/dist/commonjs/policies/logPolicy.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/commonjs/util/uuidUtils.js +1 -1
- package/dist/commonjs/util/uuidUtils.js.map +2 -2
- package/dist/esm/auth/credentials.js.map +1 -1
- package/dist/esm/auth/oauth2Flows.js.map +1 -1
- 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/logPolicy.js +1 -1
- package/dist/esm/policies/logPolicy.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/esm/util/uuidUtils.js +1 -1
- package/dist/esm/util/uuidUtils.js.map +1 -1
- package/dist/react-native/auth/credentials.js.map +1 -1
- package/dist/react-native/auth/oauth2Flows.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/logPolicy.js +1 -1
- package/dist/react-native/policies/logPolicy.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 +7 -0
- package/dist/react-native/util/{uuidUtils.common.js → uuidUtils-react-native.mjs} +8 -3
- package/dist/react-native/util/uuidUtils-react-native.mjs.map +1 -0
- package/package.json +96 -11
- 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.common.d.ts +0 -13
- package/dist/browser/util/uuidUtils.common.js +0 -40
- package/dist/browser/util/uuidUtils.common.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.common.d.ts +0 -13
- package/dist/react-native/util/uuidUtils.common.js.map +0 -1
- package/dist/react-native/util/uuidUtils.d.ts +0 -2
- package/dist/react-native/util/uuidUtils.js +0 -4
- package/dist/react-native/util/uuidUtils.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export of `NodeJS.ReadableStream` for use in platform-neutral code.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type NodeReadableStream = NodeJS.ReadableStream;
|
|
7
|
+
/**
|
|
8
|
+
* Re-export of `Buffer` for use in platform-neutral code.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export type NodeBuffer = Buffer;
|
|
13
|
+
/**
|
|
14
|
+
* Re-export of the Web `ReadableStream` for use in platform-neutral code.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export type WebReadableStream<R = any> = ReadableStream<R>;
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(types_exports);
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Re-export of `NodeJS.ReadableStream` for use in platform-neutral code.\n *\n * @public\n */\nexport type NodeReadableStream = NodeJS.ReadableStream;\n\n/**\n * Re-export of `Buffer` for use in platform-neutral code.\n *\n * @public\n */\nexport type NodeBuffer = Buffer;\n\n/**\n * Re-export of the Web `ReadableStream` for use in platform-neutral code.\n *\n * @public\n */\nexport type WebReadableStream<R = any> = ReadableStream<R>;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
export type ConcatSource = ReadableStream<Uint8Array
|
|
6
|
+
export type ConcatSource = ReadableStream<Uint8Array<ArrayBuffer>> | NodeJS.ReadableStream | Uint8Array<ArrayBuffer> | Blob;
|
|
7
7
|
/**
|
|
8
8
|
* Utility function that concatenates a set of binary inputs into one combined output.
|
|
9
9
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/util/concat.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Readable } from \"stream\";\nimport type { ReadableStream as AsyncIterableReadableStream } from \"stream/web\";\nimport { isBlob } from \"./typeGuards.js\";\n\nasync function* streamAsyncIterator(\n this: ReadableStream<Uint8Array>,\n): AsyncIterableIterator<Uint8Array> {\n const reader = this.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n return;\n }\n\n yield value;\n }\n } finally {\n reader.releaseLock();\n }\n}\n\nfunction makeAsyncIterable<T>(webStream: any): asserts webStream is AsyncIterableReadableStream<T> {\n if (!webStream[Symbol.asyncIterator]) {\n webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream);\n }\n\n if (!webStream.values) {\n webStream.values = streamAsyncIterator.bind(webStream);\n }\n}\n\nfunction ensureNodeStream(\n stream: ReadableStream<Uint8Array> | NodeJS.ReadableStream,\n): NodeJS.ReadableStream {\n if (stream instanceof ReadableStream) {\n makeAsyncIterable<Uint8Array>(stream);\n return Readable.fromWeb(stream);\n } else {\n return stream;\n }\n}\n\nfunction toStream(\n source: ReadableStream<Uint8Array> | NodeJS.ReadableStream | Uint8Array | Blob,\n): NodeJS.ReadableStream {\n if (source instanceof Uint8Array) {\n return Readable.from(Buffer.from(source));\n } else if (isBlob(source)) {\n return ensureNodeStream(source.stream());\n } else {\n return ensureNodeStream(source);\n }\n}\n\n/**\n * Accepted binary data types for concat\n *\n * @internal\n */\nexport type ConcatSource
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAyB;AAEzB,wBAAuB;AAEvB,gBAAgB,sBAEqB;AACnC,QAAM,SAAS,KAAK,UAAU;AAC9B,MAAI;AACF,WAAO,MAAM;AACX,YAAM,EAAE,MAAM,MAAM,IAAI,MAAM,OAAO,KAAK;AAC1C,UAAI,MAAM;AACR;AAAA,MACF;AAEA,YAAM;AAAA,IACR;AAAA,EACF,UAAE;AACA,WAAO,YAAY;AAAA,EACrB;AACF;AAEA,SAAS,kBAAqB,WAAqE;AACjG,MAAI,CAAC,UAAU,OAAO,aAAa,GAAG;AACpC,cAAU,OAAO,aAAa,IAAI,oBAAoB,KAAK,SAAS;AAAA,EACtE;AAEA,MAAI,CAAC,UAAU,QAAQ;AACrB,cAAU,SAAS,oBAAoB,KAAK,SAAS;AAAA,EACvD;AACF;AAEA,SAAS,iBACP,QACuB;AACvB,MAAI,kBAAkB,gBAAgB;AACpC,sBAA8B,MAAM;AACpC,WAAO,uBAAS,QAAQ,MAAM;AAAA,EAChC,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAEA,SAAS,SACP,QACuB;AACvB,MAAI,kBAAkB,YAAY;AAChC,WAAO,uBAAS,KAAK,OAAO,KAAK,MAAM,CAAC;AAAA,EAC1C,eAAW,0BAAO,MAAM,GAAG;AACzB,WAAO,iBAAiB,OAAO,OAAO,CAAC;AAAA,EACzC,OAAO;AACL,WAAO,iBAAiB,MAAM;AAAA,EAChC;AACF;
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Readable } from \"stream\";\nimport type { ReadableStream as AsyncIterableReadableStream } from \"stream/web\";\nimport { isBlob } from \"./typeGuards.js\";\n\nasync function* streamAsyncIterator(\n this: ReadableStream<Uint8Array>,\n): AsyncIterableIterator<Uint8Array> {\n const reader = this.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n return;\n }\n\n yield value;\n }\n } finally {\n reader.releaseLock();\n }\n}\n\nfunction makeAsyncIterable<T>(webStream: any): asserts webStream is AsyncIterableReadableStream<T> {\n if (!webStream[Symbol.asyncIterator]) {\n webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream);\n }\n\n if (!webStream.values) {\n webStream.values = streamAsyncIterator.bind(webStream);\n }\n}\n\nfunction ensureNodeStream(\n stream: ReadableStream<Uint8Array> | NodeJS.ReadableStream,\n): NodeJS.ReadableStream {\n if (stream instanceof ReadableStream) {\n makeAsyncIterable<Uint8Array>(stream);\n return Readable.fromWeb(stream);\n } else {\n return stream;\n }\n}\n\nfunction toStream(\n source: ReadableStream<Uint8Array> | NodeJS.ReadableStream | Uint8Array | Blob,\n): NodeJS.ReadableStream {\n if (source instanceof Uint8Array) {\n return Readable.from(Buffer.from(source));\n } else if (isBlob(source)) {\n return ensureNodeStream(source.stream());\n } else {\n return ensureNodeStream(source);\n }\n}\n\n/**\n * Accepted binary data types for concat\n *\n * @internal\n */\nexport type ConcatSource =\n ReadableStream<Uint8Array<ArrayBuffer>> | NodeJS.ReadableStream | 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 - in Node, a (() =\\> NodeJS.ReadableStream) which, when read, produces a concatenation of all the inputs.\n * In browser, returns a `Blob` representing all the concatenated inputs.\n *\n * @internal\n */\nexport async function concat(\n sources: (ConcatSource | (() => ConcatSource))[],\n): Promise<(() => NodeJS.ReadableStream) | Blob> {\n return function () {\n const streams = sources.map((x) => (typeof x === \"function\" ? x() : x)).map(toStream);\n\n return Readable.from(\n (async function* () {\n for (const stream of streams) {\n for await (const chunk of stream) {\n yield chunk;\n }\n }\n })(),\n );\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAyB;AAEzB,wBAAuB;AAEvB,gBAAgB,sBAEqB;AACnC,QAAM,SAAS,KAAK,UAAU;AAC9B,MAAI;AACF,WAAO,MAAM;AACX,YAAM,EAAE,MAAM,MAAM,IAAI,MAAM,OAAO,KAAK;AAC1C,UAAI,MAAM;AACR;AAAA,MACF;AAEA,YAAM;AAAA,IACR;AAAA,EACF,UAAE;AACA,WAAO,YAAY;AAAA,EACrB;AACF;AAEA,SAAS,kBAAqB,WAAqE;AACjG,MAAI,CAAC,UAAU,OAAO,aAAa,GAAG;AACpC,cAAU,OAAO,aAAa,IAAI,oBAAoB,KAAK,SAAS;AAAA,EACtE;AAEA,MAAI,CAAC,UAAU,QAAQ;AACrB,cAAU,SAAS,oBAAoB,KAAK,SAAS;AAAA,EACvD;AACF;AAEA,SAAS,iBACP,QACuB;AACvB,MAAI,kBAAkB,gBAAgB;AACpC,sBAA8B,MAAM;AACpC,WAAO,uBAAS,QAAQ,MAAM;AAAA,EAChC,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAEA,SAAS,SACP,QACuB;AACvB,MAAI,kBAAkB,YAAY;AAChC,WAAO,uBAAS,KAAK,OAAO,KAAK,MAAM,CAAC;AAAA,EAC1C,eAAW,0BAAO,MAAM,GAAG;AACzB,WAAO,iBAAiB,OAAO,OAAO,CAAC;AAAA,EACzC,OAAO;AACL,WAAO,iBAAiB,MAAM;AAAA,EAChC;AACF;AAmBA,eAAsB,OACpB,SAC+C;AAC/C,SAAO,WAAY;AACjB,UAAM,UAAU,QAAQ,IAAI,CAAC,MAAO,OAAO,MAAM,aAAa,EAAE,IAAI,CAAE,EAAE,IAAI,QAAQ;AAEpF,WAAO,uBAAS;AAAA,OACb,mBAAmB;AAClB,mBAAW,UAAU,SAAS;AAC5B,2BAAiB,SAAS,QAAQ;AAChC,kBAAM;AAAA,UACR;AAAA,QACF;AAAA,MACF,GAAG;AAAA,IACL;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@ export { isObject, type UnknownObject } from "./object.js";
|
|
|
4
4
|
export { isError } from "./error.js";
|
|
5
5
|
export { computeSha256Hash, computeSha256Hmac } from "./sha256.js";
|
|
6
6
|
export { randomUUID } from "./uuidUtils.js";
|
|
7
|
-
export { isBrowser, isBun, isNodeLike, isNodeRuntime, isDeno, isReactNative, isWebWorker, } from "
|
|
7
|
+
export { isBrowser, isBun, isNodeLike, isNodeRuntime, isDeno, isReactNative, isWebWorker, } from "../env.js";
|
|
8
8
|
export { stringToUint8Array, uint8ArrayToString, type EncodingType } from "./bytesEncoding.js";
|
|
9
9
|
export { Sanitizer, type SanitizerOptions } from "./sanitizer.js";
|
|
10
10
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -22,16 +22,16 @@ __export(internal_exports, {
|
|
|
22
22
|
computeSha256Hash: () => import_sha256.computeSha256Hash,
|
|
23
23
|
computeSha256Hmac: () => import_sha256.computeSha256Hmac,
|
|
24
24
|
getRandomIntegerInclusive: () => import_random.getRandomIntegerInclusive,
|
|
25
|
-
isBrowser: () =>
|
|
26
|
-
isBun: () =>
|
|
27
|
-
isDeno: () =>
|
|
25
|
+
isBrowser: () => import_env.isBrowser,
|
|
26
|
+
isBun: () => import_env.isBun,
|
|
27
|
+
isDeno: () => import_env.isDeno,
|
|
28
28
|
isError: () => import_error.isError,
|
|
29
|
-
isNodeLike: () =>
|
|
30
|
-
isNodeRuntime: () =>
|
|
29
|
+
isNodeLike: () => import_env.isNodeLike,
|
|
30
|
+
isNodeRuntime: () => import_env.isNodeRuntime,
|
|
31
31
|
isObject: () => import_object.isObject,
|
|
32
|
-
isReactNative: () =>
|
|
33
|
-
isWebWorker: () =>
|
|
34
|
-
randomUUID: () =>
|
|
32
|
+
isReactNative: () => import_env.isReactNative,
|
|
33
|
+
isWebWorker: () => import_env.isWebWorker,
|
|
34
|
+
randomUUID: () => import_uuid.randomUUID,
|
|
35
35
|
stringToUint8Array: () => import_bytesEncoding.stringToUint8Array,
|
|
36
36
|
uint8ArrayToString: () => import_bytesEncoding.uint8ArrayToString
|
|
37
37
|
});
|
|
@@ -41,8 +41,8 @@ var import_random = require("./random.js");
|
|
|
41
41
|
var import_object = require("./object.js");
|
|
42
42
|
var import_error = require("./error.js");
|
|
43
43
|
var import_sha256 = require("./sha256.js");
|
|
44
|
-
var
|
|
45
|
-
var
|
|
44
|
+
var import_uuid = require("./uuidUtils.js");
|
|
45
|
+
var import_env = require("../env.js");
|
|
46
46
|
var import_bytesEncoding = require("./bytesEncoding.js");
|
|
47
47
|
var import_sanitizer = require("./sanitizer.js");
|
|
48
48
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/util/internal.ts"],
|
|
4
|
-
"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 \"
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAoC;AACpC,oBAA0C;AAC1C,oBAA6C;AAC7C,mBAAwB;AACxB,oBAAqD;AACrD,
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAoC;AACpC,oBAA0C;AAC1C,oBAA6C;AAC7C,mBAAwB;AACxB,oBAAqD;AACrD,kBAA2B;AAC3B,iBAQO;AACP,2BAA0E;AAC1E,uBAAiD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the given value is a Node.js readable stream.
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare function isNodeReadableStream(x: unknown): x is NodeJS.ReadableStream;
|
|
7
|
+
/**
|
|
8
|
+
* Checks if the given value is a web ReadableStream.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function isWebReadableStream(x: unknown): x is ReadableStream;
|
|
13
|
+
//# sourceMappingURL=typeGuards-node.d.ts.map
|
|
@@ -15,14 +15,22 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var
|
|
19
|
-
__export(
|
|
20
|
-
|
|
18
|
+
var typeGuards_node_exports = {};
|
|
19
|
+
__export(typeGuards_node_exports, {
|
|
20
|
+
isNodeReadableStream: () => isNodeReadableStream,
|
|
21
|
+
isWebReadableStream: () => isWebReadableStream
|
|
21
22
|
});
|
|
22
|
-
module.exports = __toCommonJS(
|
|
23
|
-
|
|
23
|
+
module.exports = __toCommonJS(typeGuards_node_exports);
|
|
24
|
+
var import_stream = require("stream");
|
|
25
|
+
function isNodeReadableStream(x) {
|
|
26
|
+
return x instanceof import_stream.Readable;
|
|
27
|
+
}
|
|
28
|
+
function isWebReadableStream(x) {
|
|
29
|
+
return x instanceof ReadableStream;
|
|
30
|
+
}
|
|
24
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
25
32
|
0 && (module.exports = {
|
|
26
|
-
|
|
33
|
+
isNodeReadableStream,
|
|
34
|
+
isWebReadableStream
|
|
27
35
|
});
|
|
28
|
-
//# sourceMappingURL=
|
|
36
|
+
//# sourceMappingURL=typeGuards-node.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/util/typeGuards-node.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Readable } from \"stream\";\n\n/**\n * Checks if the given value is a Node.js readable stream.\n *\n * @internal\n */\nexport function isNodeReadableStream(x: unknown): x is NodeJS.ReadableStream {\n return x instanceof Readable;\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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAyB;AAOlB,SAAS,qBAAqB,GAAwC;AAC3E,SAAO,aAAa;AACtB;AAOO,SAAS,oBAAoB,GAAiC;AACnE,SAAO,aAAa;AACtB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare function
|
|
1
|
+
import type { NodeReadableStream, WebReadableStream } from "../types.js";
|
|
2
|
+
import { isNodeReadableStream, isWebReadableStream } from "./typeGuards-node.js";
|
|
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
|
|
@@ -19,27 +19,20 @@ var typeGuards_exports = {};
|
|
|
19
19
|
__export(typeGuards_exports, {
|
|
20
20
|
isBinaryBody: () => isBinaryBody,
|
|
21
21
|
isBlob: () => isBlob,
|
|
22
|
-
isNodeReadableStream: () => isNodeReadableStream,
|
|
22
|
+
isNodeReadableStream: () => import_typeGuards.isNodeReadableStream,
|
|
23
23
|
isReadableStream: () => isReadableStream,
|
|
24
|
-
isWebReadableStream: () => isWebReadableStream
|
|
24
|
+
isWebReadableStream: () => import_typeGuards.isWebReadableStream
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(typeGuards_exports);
|
|
27
|
-
|
|
28
|
-
return Boolean(x && typeof x["pipe"] === "function");
|
|
29
|
-
}
|
|
30
|
-
function isWebReadableStream(x) {
|
|
31
|
-
return Boolean(
|
|
32
|
-
x && typeof x.getReader === "function" && typeof x.tee === "function"
|
|
33
|
-
);
|
|
34
|
-
}
|
|
27
|
+
var import_typeGuards = require("./typeGuards-node.js");
|
|
35
28
|
function isBinaryBody(body) {
|
|
36
|
-
return body !== void 0 && (body instanceof Uint8Array || isReadableStream(body) || typeof body === "function" ||
|
|
29
|
+
return body !== void 0 && (body instanceof Uint8Array || isReadableStream(body) || typeof body === "function" || body instanceof Blob);
|
|
37
30
|
}
|
|
38
31
|
function isReadableStream(x) {
|
|
39
|
-
return isNodeReadableStream(x) || isWebReadableStream(x);
|
|
32
|
+
return (0, import_typeGuards.isNodeReadableStream)(x) || (0, import_typeGuards.isWebReadableStream)(x);
|
|
40
33
|
}
|
|
41
34
|
function isBlob(x) {
|
|
42
|
-
return
|
|
35
|
+
return x instanceof Blob;
|
|
43
36
|
}
|
|
44
37
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45
38
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/util/typeGuards.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,wBAA0D;AAInD,SAAS,aACd,MAOO;AACP,SACE,SAAS,WACR,gBAAgB,cACf,iBAAiB,IAAI,KACrB,OAAO,SAAS,cAChB,gBAAgB;AAEtB;AAEO,SAAS,iBAAiB,GAAyD;AACxF,aAAO,wCAAqB,CAAC,SAAK,uCAAoB,CAAC;AACzD;AAEO,SAAS,OAAO,GAAuB;AAC5C,SAAO,aAAa;AACtB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,10 +18,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
18
18
|
var userAgent_exports = {};
|
|
19
19
|
__export(userAgent_exports, {
|
|
20
20
|
getUserAgentHeaderName: () => getUserAgentHeaderName,
|
|
21
|
-
getUserAgentValue: () => getUserAgentValue
|
|
21
|
+
getUserAgentValue: () => getUserAgentValue,
|
|
22
|
+
setPlatformSpecificData: () => import_userAgent.setPlatformSpecificData
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(userAgent_exports);
|
|
24
|
-
var
|
|
25
|
+
var import_userAgent = require("./userAgentPlatform.js");
|
|
25
26
|
var import_constants = require("../constants.js");
|
|
26
27
|
function getUserAgentString(telemetryInfo) {
|
|
27
28
|
const parts = [];
|
|
@@ -32,12 +33,12 @@ function getUserAgentString(telemetryInfo) {
|
|
|
32
33
|
return parts.join(" ");
|
|
33
34
|
}
|
|
34
35
|
function getUserAgentHeaderName() {
|
|
35
|
-
return (0,
|
|
36
|
+
return (0, import_userAgent.getHeaderName)();
|
|
36
37
|
}
|
|
37
38
|
async function getUserAgentValue(prefix) {
|
|
38
39
|
const runtimeInfo = /* @__PURE__ */ new Map();
|
|
39
40
|
runtimeInfo.set("ts-http-runtime", import_constants.SDK_VERSION);
|
|
40
|
-
await (0,
|
|
41
|
+
await (0, import_userAgent.setPlatformSpecificData)(runtimeInfo);
|
|
41
42
|
const defaultAgent = getUserAgentString(runtimeInfo);
|
|
42
43
|
const userAgentValue = prefix ? `${prefix} ${defaultAgent}` : defaultAgent;
|
|
43
44
|
return userAgentValue;
|
|
@@ -45,6 +46,7 @@ async function getUserAgentValue(prefix) {
|
|
|
45
46
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
47
|
0 && (module.exports = {
|
|
47
48
|
getUserAgentHeaderName,
|
|
48
|
-
getUserAgentValue
|
|
49
|
+
getUserAgentValue,
|
|
50
|
+
setPlatformSpecificData
|
|
49
51
|
});
|
|
50
52
|
//# sourceMappingURL=userAgent.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/util/userAgent.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getHeaderName, setPlatformSpecificData } from \"
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAuD;AACvD,uBAA4B;AAI5B,SAAS,mBAAmB,eAA4C;AACtE,QAAM,QAAkB,CAAC;AACzB,aAAW,CAAC,KAAK,KAAK,KAAK,eAAe;AACxC,UAAM,QAAQ,QAAQ,GAAG,GAAG,IAAI,KAAK,KAAK;AAC1C,UAAM,KAAK,KAAK;AAAA,EAClB;AACA,SAAO,MAAM,KAAK,GAAG;AACvB;AAKO,SAAS,yBAAiC;AAC/C,aAAO,gCAAc;AACvB;AAKA,eAAsB,kBAAkB,QAAkC;AACxE,QAAM,cAAc,oBAAI,IAAoB;AAC5C,cAAY,IAAI,mBAAmB,4BAAW;AAC9C,YAAM,0CAAwB,WAAW;AACzC,QAAM,eAAe,mBAAmB,WAAW;AACnD,QAAM,iBAAiB,SAAS,GAAG,MAAM,IAAI,YAAY,KAAK;AAC9D,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,7 +21,7 @@ __export(uuidUtils_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(uuidUtils_exports);
|
|
23
23
|
function randomUUID() {
|
|
24
|
-
return crypto.randomUUID();
|
|
24
|
+
return globalThis.crypto.randomUUID();
|
|
25
25
|
}
|
|
26
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
27
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/util/uuidUtils.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Generated Universally Unique Identifier\n *\n * @returns RFC4122 v4 UUID.\n */\nexport function randomUUID(): string {\n return crypto.randomUUID();\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\ninterface Crypto {\n randomUUID(): string;\n}\n\ndeclare const globalThis: {\n crypto: Crypto;\n};\n\n/**\n * Generated Universally Unique Identifier\n *\n * @returns RFC4122 v4 UUID.\n */\nexport function randomUUID(): string {\n return globalThis.crypto.randomUUID();\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,SAAS,aAAqB;AACnC,SAAO,WAAW,OAAO,WAAW;AACtC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../src/auth/credentials.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../src/auth/credentials.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAuElC;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,UAA4B;IAE5B,OAAO,gBAAgB,IAAI,UAAU,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,UAA4B;IAE5B,OAAO,gBAAgB,IAAI,UAAU,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAA4B;IAC5D,OAAO,UAAU,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAA4B;IAC7D,OAAO,KAAK,IAAI,UAAU,CAAC;AAC7B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OAuth2Flow } from \"./oauth2Flows.js\";\n\n/**\n * Options used when creating and sending get OAuth 2 requests for this operation.\n */\nexport interface GetOAuth2TokenOptions {\n /** Abort signal for the request */\n abortSignal?: AbortSignal;\n}\n\n/**\n * Options used when creating and sending get bearer token requests for this operation.\n */\nexport interface GetBearerTokenOptions {\n /** Abort signal for the request */\n abortSignal?: AbortSignal;\n}\n\n/**\n * Credential for OAuth2 authentication flows.\n */\nexport interface OAuth2TokenCredential<TFlows extends OAuth2Flow> {\n /**\n * Gets an OAuth2 token for the specified flows.\n * @param flows - The OAuth2 flows to use.\n * @param options - Options for the request.\n * @returns - a valid access token which was obtained through one of the flows specified in `flows`.\n */\n getOAuth2Token(flows: TFlows[], options?: GetOAuth2TokenOptions): Promise<string>;\n}\n\n/**\n * Credential for Bearer token authentication.\n */\nexport interface BearerTokenCredential {\n /**\n * Gets a Bearer token for the specified flows.\n * @param options - Options for the request.\n * @returns - a valid access token.\n */\n getBearerToken(options?: GetBearerTokenOptions): Promise<string>;\n}\n\n/**\n * Credential for HTTP Basic authentication.\n * Provides username and password for basic authentication headers.\n */\nexport interface BasicCredential {\n /** The username for basic authentication. */\n username: string;\n /** The password for basic authentication. */\n password: string;\n}\n\n/**\n * Credential for API Key authentication.\n * Provides an API key that will be used in the request headers.\n */\nexport interface ApiKeyCredential {\n /** The API key for authentication. */\n key: string;\n}\n\n/**\n * Union type of all supported authentication credentials.\n */\nexport type ClientCredential =\n OAuth2TokenCredential<OAuth2Flow> | BearerTokenCredential | BasicCredential | ApiKeyCredential;\n\n/**\n * Type guard to check if a credential is an OAuth2 token credential.\n */\nexport function isOAuth2TokenCredential(\n credential: ClientCredential,\n): credential is OAuth2TokenCredential<OAuth2Flow> {\n return \"getOAuth2Token\" in credential;\n}\n\n/**\n * Type guard to check if a credential is a Bearer token credential.\n */\nexport function isBearerTokenCredential(\n credential: ClientCredential,\n): credential is BearerTokenCredential {\n return \"getBearerToken\" in credential;\n}\n\n/**\n * Type guard to check if a credential is a Basic auth credential.\n */\nexport function isBasicCredential(credential: ClientCredential): credential is BasicCredential {\n return \"username\" in credential && \"password\" in credential;\n}\n\n/**\n * Type guard to check if a credential is an API key credential.\n */\nexport function isApiKeyCredential(credential: ClientCredential): credential is ApiKeyCredential {\n return \"key\" in credential;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2Flows.js","sourceRoot":"","sources":["../../../src/auth/oauth2Flows.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Represents OAuth2 Authorization Code flow configuration.\n */\nexport interface AuthorizationCodeFlow {\n /** Type of OAuth2 flow */\n kind: \"authorizationCode\";\n /** Authorization endpoint */\n authorizationUrl: string;\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Client Credentials flow configuration.\n */\nexport interface ClientCredentialsFlow {\n /** Type of OAuth2 flow */\n kind: \"clientCredentials\";\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoints */\n refreshUrl?: string[];\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Implicit flow configuration.\n */\nexport interface ImplicitFlow {\n /** Type of OAuth2 flow */\n kind: \"implicit\";\n /** Authorization endpoint */\n authorizationUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Password flow configuration.\n */\nexport interface PasswordFlow {\n /** Type of OAuth2 flow */\n kind: \"password\";\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/** Union type of all supported OAuth2 flows */\nexport type OAuth2Flow =\n
|
|
1
|
+
{"version":3,"file":"oauth2Flows.js","sourceRoot":"","sources":["../../../src/auth/oauth2Flows.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Represents OAuth2 Authorization Code flow configuration.\n */\nexport interface AuthorizationCodeFlow {\n /** Type of OAuth2 flow */\n kind: \"authorizationCode\";\n /** Authorization endpoint */\n authorizationUrl: string;\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Client Credentials flow configuration.\n */\nexport interface ClientCredentialsFlow {\n /** Type of OAuth2 flow */\n kind: \"clientCredentials\";\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoints */\n refreshUrl?: string[];\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Implicit flow configuration.\n */\nexport interface ImplicitFlow {\n /** Type of OAuth2 flow */\n kind: \"implicit\";\n /** Authorization endpoint */\n authorizationUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Password flow configuration.\n */\nexport interface PasswordFlow {\n /** Type of OAuth2 flow */\n kind: \"password\";\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/** Union type of all supported OAuth2 flows */\nexport type OAuth2Flow =\n AuthorizationCodeFlow | ClientCredentialsFlow | ImplicitFlow | PasswordFlow;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientHelpers.js","sourceRoot":"","sources":["../../../src/client/clientHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"clientHelpers.js","sourceRoot":"","sources":["../../../src/client/clientHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAE5F,IAAI,gBAAwC,CAAC;AAE7C;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAyB,EAAE;IAC/D,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEpD,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAE9C,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,uBAAuB,EAAE,GAAG,OAAO,CAAC;IACrE,IAAI,UAAU,EAAE,CAAC;QACf,IAAI,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;YACnC,QAAQ,CAAC,SAAS,CAChB,0BAA0B,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,uBAAuB,EAAE,CAAC,CACjF,CAAC;QACJ,CAAC;aAAM,IAAI,iBAAiB,CAAC,UAAU,CAAC,EAAE,CAAC;YACzC,QAAQ,CAAC,SAAS,CAChB,yBAAyB,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,uBAAuB,EAAE,CAAC,CAChF,CAAC;QACJ,CAAC;aAAM,IAAI,uBAAuB,CAAC,UAAU,CAAC,EAAE,CAAC;YAC/C,QAAQ,CAAC,SAAS,CAChB,0BAA0B,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,uBAAuB,EAAE,CAAC,CACjF,CAAC;QACJ,CAAC;aAAM,IAAI,uBAAuB,CAAC,UAAU,CAAC,EAAE,CAAC;YAC/C,QAAQ,CAAC,SAAS,CAChB,0BAA0B,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,uBAAuB,EAAE,CAAC,CACjF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,GAAG,uBAAuB,EAAE,CAAC;IAC/C,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","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"]}
|
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/client/common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","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"]}
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/client/common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","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"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { createDefaultPipeline } from "./clientHelpers.js";
|
|
4
4
|
import { sendRequest } from "./sendRequest.js";
|
|
5
5
|
import { buildRequestUrl } from "./urlHelpers.js";
|
|
6
|
-
import { isNodeLike } from "../
|
|
6
|
+
import { isNodeLike } from "../env.js";
|
|
7
7
|
/**
|
|
8
8
|
* Creates a client with a default pipeline
|
|
9
9
|
* @param endpoint - Base endpoint for the client
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getClient.js","sourceRoot":"","sources":["../../../src/client/getClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAU3D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getClient.js","sourceRoot":"","sources":["../../../src/client/getClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAU3D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,QAAgB,EAAE,gBAA+B,EAAE;IAC3E,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,IAAI,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAChF,IAAI,aAAa,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC;QAC7C,KAAK,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,aAAa,CAAC,kBAAkB,EAAE,CAAC;YACpE,2DAA2D;YAC3D,6CAA6C;YAC7C,MAAM,UAAU,GAAG,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAChE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE;gBACzB,UAAU;aACX,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,EAAE,uBAAuB,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IAC9D,MAAM,WAAW,GAAG,aAAa,CAAC,QAAQ,IAAI,QAAQ,CAAC;IACvD,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,GAAG,IAAgB,EAAqC,EAAE;QACtF,MAAM,MAAM,GAAG,CAAC,cAAiC,EAAU,EAAE,CAC3D,eAAe,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,uBAAuB,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC;QAE3F,OAAO;YACL,GAAG,EAAE,CAAC,iBAAoC,EAAE,EAAoB,EAAE;gBAChE,OAAO,cAAc,CACnB,KAAK,EACL,MAAM,CAAC,cAAc,CAAC,EACtB,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,UAAU,CACX,CAAC;YACJ,CAAC;YACD,IAAI,EAAE,CAAC,iBAAoC,EAAE,EAAoB,EAAE;gBACjE,OAAO,cAAc,CACnB,MAAM,EACN,MAAM,CAAC,cAAc,CAAC,EACtB,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,UAAU,CACX,CAAC;YACJ,CAAC;YACD,GAAG,EAAE,CAAC,iBAAoC,EAAE,EAAoB,EAAE;gBAChE,OAAO,cAAc,CACnB,KAAK,EACL,MAAM,CAAC,cAAc,CAAC,EACtB,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,UAAU,CACX,CAAC;YACJ,CAAC;YACD,KAAK,EAAE,CAAC,iBAAoC,EAAE,EAAoB,EAAE;gBAClE,OAAO,cAAc,CACnB,OAAO,EACP,MAAM,CAAC,cAAc,CAAC,EACtB,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,UAAU,CACX,CAAC;YACJ,CAAC;YACD,MAAM,EAAE,CAAC,iBAAoC,EAAE,EAAoB,EAAE;gBACnE,OAAO,cAAc,CACnB,QAAQ,EACR,MAAM,CAAC,cAAc,CAAC,EACtB,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,UAAU,CACX,CAAC;YACJ,CAAC;YACD,IAAI,EAAE,CAAC,iBAAoC,EAAE,EAAoB,EAAE;gBACjE,OAAO,cAAc,CACnB,MAAM,EACN,MAAM,CAAC,cAAc,CAAC,EACtB,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,UAAU,CACX,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,CAAC,iBAAoC,EAAE,EAAoB,EAAE;gBACpE,OAAO,cAAc,CACnB,SAAS,EACT,MAAM,CAAC,cAAc,CAAC,EACtB,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,UAAU,CACX,CAAC;YACJ,CAAC;YACD,KAAK,EAAE,CAAC,iBAAoC,EAAE,EAAoB,EAAE;gBAClE,OAAO,cAAc,CACnB,OAAO,EACP,MAAM,CAAC,cAAc,CAAC,EACtB,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,UAAU,CACX,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,aAAa,EAAE,MAAM;QACrB,QAAQ;KACT,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CACrB,MAAmB,EACnB,GAAW,EACX,QAAkB,EAClB,OAA0B,EAC1B,uBAAiC,EACjC,UAAuB;IAEvB,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,IAAI,uBAAuB,CAAC;IACrF,OAAO;QACL,IAAI,EAAE,UAAU,WAAW,EAAE,UAAU;YACrC,OAAO,WAAW,CAChB,MAAM,EACN,GAAG,EACH,QAAQ,EACR,EAAE,GAAG,OAAO,EAAE,uBAAuB,EAAE,EACvC,UAAU,CACX,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAClC,CAAC;QACD,KAAK,CAAC,eAAe;YACnB,IAAI,UAAU,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CACb,sPAAsP,CACvP,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,OAAO,WAAW,CAChB,MAAM,EACN,GAAG,EACH,QAAQ,EACR,EAAE,GAAG,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAC/D,UAAU,CAC2B,CAAC;YAC1C,CAAC;QACH,CAAC;QACD,KAAK,CAAC,YAAY;YAChB,IAAI,UAAU,EAAE,CAAC;gBACf,OAAO,WAAW,CAChB,MAAM,EACN,GAAG,EACH,QAAQ,EACR,EAAE,GAAG,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAC/D,UAAU,CACwB,CAAC;YACvC,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,uHAAuH,CACxH,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { HttpClient, HttpMethods } from \"../interfaces.js\";\nimport type { Pipeline } from \"../pipeline.js\";\nimport { createDefaultPipeline } from \"./clientHelpers.js\";\nimport type {\n Client,\n ClientOptions,\n HttpBrowserStreamResponse,\n HttpNodeStreamResponse,\n RequestParameters,\n ResourceMethods,\n StreamableMethod,\n} from \"./common.js\";\nimport { sendRequest } from \"./sendRequest.js\";\nimport { buildRequestUrl } from \"./urlHelpers.js\";\nimport { isNodeLike } from \"#platform/env\";\n\n/**\n * Creates a client with a default pipeline\n * @param endpoint - Base endpoint for the client\n * @param credentials - Credentials to authenticate the requests\n * @param options - Client options\n */\nexport function getClient(endpoint: string, clientOptions: ClientOptions = {}): Client {\n const pipeline = clientOptions.pipeline ?? createDefaultPipeline(clientOptions);\n if (clientOptions.additionalPolicies?.length) {\n for (const { policy, position } of clientOptions.additionalPolicies) {\n // Sign happens after Retry and is commonly needed to occur\n // before policies that intercept post-retry.\n const afterPhase = position === \"perRetry\" ? \"Sign\" : undefined;\n pipeline.addPolicy(policy, {\n afterPhase,\n });\n }\n }\n\n const { allowInsecureConnection, httpClient } = clientOptions;\n const endpointUrl = clientOptions.endpoint ?? endpoint;\n const client = (path: string, ...args: Array<any>): ResourceMethods<StreamableMethod> => {\n const getUrl = (requestOptions: RequestParameters): string =>\n buildRequestUrl(endpointUrl, path, args, { allowInsecureConnection, ...requestOptions });\n\n return {\n get: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"GET\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n post: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"POST\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n put: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"PUT\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n patch: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"PATCH\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n delete: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"DELETE\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n head: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"HEAD\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n options: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"OPTIONS\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n trace: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"TRACE\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n };\n };\n\n return {\n path: client,\n pathUnchecked: client,\n pipeline,\n };\n}\n\nfunction buildOperation(\n method: HttpMethods,\n url: string,\n pipeline: Pipeline,\n options: RequestParameters,\n allowInsecureConnection?: boolean,\n httpClient?: HttpClient,\n): StreamableMethod {\n allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection;\n return {\n then: function (onFulfilled, onrejected) {\n return sendRequest(\n method,\n url,\n pipeline,\n { ...options, allowInsecureConnection },\n httpClient,\n ).then(onFulfilled, onrejected);\n },\n async asBrowserStream() {\n if (isNodeLike) {\n throw new Error(\n \"`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`.\",\n );\n } else {\n return sendRequest(\n method,\n url,\n pipeline,\n { ...options, allowInsecureConnection, responseAsStream: true },\n httpClient,\n ) as Promise<HttpBrowserStreamResponse>;\n }\n },\n async asNodeStream() {\n if (isNodeLike) {\n return sendRequest(\n method,\n url,\n pipeline,\n { ...options, allowInsecureConnection, responseAsStream: true },\n httpClient,\n ) as Promise<HttpNodeStreamResponse>;\n } else {\n throw new Error(\n \"`isNodeStream` is not supported in the browser environment. Use `asBrowserStream` to obtain the response body stream.\",\n );\n }\n },\n };\n}\n"]}
|