@azure/core-rest-pipeline 1.19.2-alpha.20250417.3 → 1.20.0
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/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/createPipelineFromOptions.js +2 -0
- package/dist/browser/createPipelineFromOptions.js.map +1 -1
- package/dist/browser/defaultHttpClient.d.ts +1 -1
- package/dist/browser/defaultHttpClient.js +21 -3
- package/dist/browser/defaultHttpClient.js.map +1 -0
- package/dist/browser/httpHeaders.js +2 -80
- package/dist/browser/httpHeaders.js.map +1 -1
- package/dist/browser/index.d.ts +1 -2
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/interfaces.d.ts +11 -0
- package/dist/browser/interfaces.js.map +1 -1
- package/dist/browser/pipeline.js +2 -253
- package/dist/browser/pipeline.js.map +1 -1
- package/dist/browser/pipelineRequest.d.ts +11 -0
- package/dist/browser/pipelineRequest.js +5 -28
- package/dist/browser/pipelineRequest.js.map +1 -1
- package/dist/browser/policies/agentPolicy.js +3 -11
- package/dist/browser/policies/agentPolicy.js.map +1 -1
- package/dist/browser/policies/decompressResponsePolicy.d.ts +8 -4
- package/dist/browser/policies/decompressResponsePolicy.js +8 -7
- package/dist/browser/policies/decompressResponsePolicy.js.map +1 -0
- package/dist/browser/policies/defaultRetryPolicy.js +3 -12
- package/dist/browser/policies/defaultRetryPolicy.js.map +1 -1
- package/dist/browser/policies/exponentialRetryPolicy.js +3 -10
- package/dist/browser/policies/exponentialRetryPolicy.js.map +1 -1
- package/dist/browser/policies/formDataPolicy.js +3 -85
- package/dist/browser/policies/formDataPolicy.js.map +1 -1
- package/dist/browser/policies/logPolicy.js +3 -21
- package/dist/browser/policies/logPolicy.js.map +1 -1
- package/dist/browser/policies/multipartPolicy.js +12 -95
- package/dist/browser/policies/multipartPolicy.js.map +1 -1
- package/dist/browser/policies/proxyPolicy.d.ts +26 -2
- package/dist/browser/policies/proxyPolicy.js +26 -2
- package/dist/browser/policies/proxyPolicy.js.map +1 -0
- package/dist/browser/policies/redirectPolicy.js +3 -38
- package/dist/browser/policies/redirectPolicy.js.map +1 -1
- package/dist/browser/policies/retryPolicy.d.ts +59 -1
- package/dist/browser/policies/retryPolicy.js +5 -94
- package/dist/browser/policies/retryPolicy.js.map +1 -1
- package/dist/browser/policies/systemErrorRetryPolicy.js +3 -13
- package/dist/browser/policies/systemErrorRetryPolicy.js.map +1 -1
- package/dist/browser/policies/throttlingRetryPolicy.js +3 -11
- package/dist/browser/policies/throttlingRetryPolicy.js.map +1 -1
- package/dist/browser/policies/tlsPolicy.js +3 -11
- package/dist/browser/policies/tlsPolicy.js.map +1 -1
- package/dist/browser/policies/tracingPolicy.js +1 -1
- package/dist/browser/policies/tracingPolicy.js.map +1 -1
- package/dist/browser/policies/wrapAbortSignalLikePolicy.d.ts +10 -0
- package/dist/browser/policies/wrapAbortSignalLikePolicy.js +30 -0
- package/dist/browser/policies/wrapAbortSignalLikePolicy.js.map +1 -0
- package/dist/browser/restError.js +8 -27
- package/dist/browser/restError.js.map +1 -1
- package/dist/browser/util/file.d.ts +28 -2
- package/dist/browser/util/file.js +9 -4
- package/dist/browser/util/file.js.map +1 -1
- package/dist/browser/util/tokenCycler.js +1 -1
- package/dist/browser/util/tokenCycler.js.map +1 -1
- package/dist/browser/util/wrapAbortSignal.d.ts +12 -0
- package/dist/browser/util/wrapAbortSignal.js +31 -0
- package/dist/browser/util/wrapAbortSignal.js.map +1 -0
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/createPipelineFromOptions.js +2 -0
- package/dist/commonjs/createPipelineFromOptions.js.map +1 -1
- package/dist/commonjs/defaultHttpClient.js +20 -2
- package/dist/commonjs/defaultHttpClient.js.map +1 -1
- package/dist/commonjs/httpHeaders.js +2 -80
- package/dist/commonjs/httpHeaders.js.map +1 -1
- package/dist/commonjs/index.d.ts +1 -2
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/interfaces.d.ts +11 -0
- package/dist/commonjs/interfaces.js.map +1 -1
- package/dist/commonjs/pipeline.js +2 -253
- package/dist/commonjs/pipeline.js.map +1 -1
- package/dist/commonjs/pipelineRequest.d.ts +11 -0
- package/dist/commonjs/pipelineRequest.js +5 -28
- package/dist/commonjs/pipelineRequest.js.map +1 -1
- package/dist/commonjs/policies/agentPolicy.js +3 -11
- package/dist/commonjs/policies/agentPolicy.js.map +1 -1
- package/dist/commonjs/policies/decompressResponsePolicy.js +3 -11
- package/dist/commonjs/policies/decompressResponsePolicy.js.map +1 -1
- package/dist/commonjs/policies/defaultRetryPolicy.js +3 -12
- package/dist/commonjs/policies/defaultRetryPolicy.js.map +1 -1
- package/dist/commonjs/policies/exponentialRetryPolicy.js +3 -10
- package/dist/commonjs/policies/exponentialRetryPolicy.js.map +1 -1
- package/dist/commonjs/policies/formDataPolicy.js +3 -85
- package/dist/commonjs/policies/formDataPolicy.js.map +1 -1
- package/dist/commonjs/policies/logPolicy.js +3 -21
- package/dist/commonjs/policies/logPolicy.js.map +1 -1
- package/dist/commonjs/policies/multipartPolicy.js +12 -95
- package/dist/commonjs/policies/multipartPolicy.js.map +1 -1
- package/dist/commonjs/policies/proxyPolicy.d.ts +0 -6
- package/dist/commonjs/policies/proxyPolicy.js +5 -169
- package/dist/commonjs/policies/proxyPolicy.js.map +1 -1
- package/dist/commonjs/policies/redirectPolicy.js +3 -38
- package/dist/commonjs/policies/redirectPolicy.js.map +1 -1
- package/dist/commonjs/policies/retryPolicy.d.ts +59 -1
- package/dist/commonjs/policies/retryPolicy.js +5 -94
- package/dist/commonjs/policies/retryPolicy.js.map +1 -1
- package/dist/commonjs/policies/systemErrorRetryPolicy.js +3 -13
- package/dist/commonjs/policies/systemErrorRetryPolicy.js.map +1 -1
- package/dist/commonjs/policies/throttlingRetryPolicy.js +3 -11
- package/dist/commonjs/policies/throttlingRetryPolicy.js.map +1 -1
- package/dist/commonjs/policies/tlsPolicy.js +3 -11
- package/dist/commonjs/policies/tlsPolicy.js.map +1 -1
- package/dist/commonjs/policies/tracingPolicy.js +2 -2
- package/dist/commonjs/policies/tracingPolicy.js.map +1 -1
- package/dist/commonjs/policies/wrapAbortSignalLikePolicy.d.ts +10 -0
- package/dist/commonjs/policies/wrapAbortSignalLikePolicy.js +34 -0
- package/dist/commonjs/policies/wrapAbortSignalLikePolicy.js.map +1 -0
- package/dist/commonjs/restError.js +8 -27
- package/dist/commonjs/restError.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/util/file.d.ts +28 -2
- package/dist/commonjs/util/file.js +10 -4
- package/dist/commonjs/util/file.js.map +1 -1
- package/dist/commonjs/util/tokenCycler.js +2 -2
- package/dist/commonjs/util/tokenCycler.js.map +1 -1
- package/dist/commonjs/util/wrapAbortSignal.d.ts +12 -0
- package/dist/commonjs/util/wrapAbortSignal.js +34 -0
- package/dist/commonjs/util/wrapAbortSignal.js.map +1 -0
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/createPipelineFromOptions.js +2 -0
- package/dist/esm/createPipelineFromOptions.js.map +1 -1
- package/dist/esm/defaultHttpClient.js +20 -2
- package/dist/esm/defaultHttpClient.js.map +1 -1
- package/dist/esm/httpHeaders.js +2 -80
- package/dist/esm/httpHeaders.js.map +1 -1
- package/dist/esm/index.d.ts +1 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces.d.ts +11 -0
- package/dist/esm/interfaces.js.map +1 -1
- package/dist/esm/pipeline.js +2 -253
- package/dist/esm/pipeline.js.map +1 -1
- package/dist/esm/pipelineRequest.d.ts +11 -0
- package/dist/esm/pipelineRequest.js +5 -28
- package/dist/esm/pipelineRequest.js.map +1 -1
- package/dist/esm/policies/agentPolicy.js +3 -11
- package/dist/esm/policies/agentPolicy.js.map +1 -1
- package/dist/esm/policies/decompressResponsePolicy.js +3 -11
- package/dist/esm/policies/decompressResponsePolicy.js.map +1 -1
- package/dist/esm/policies/defaultRetryPolicy.js +3 -12
- package/dist/esm/policies/defaultRetryPolicy.js.map +1 -1
- package/dist/esm/policies/exponentialRetryPolicy.js +3 -10
- package/dist/esm/policies/exponentialRetryPolicy.js.map +1 -1
- package/dist/esm/policies/formDataPolicy.js +3 -85
- package/dist/esm/policies/formDataPolicy.js.map +1 -1
- package/dist/esm/policies/logPolicy.js +3 -21
- package/dist/esm/policies/logPolicy.js.map +1 -1
- package/dist/esm/policies/multipartPolicy.js +12 -95
- package/dist/esm/policies/multipartPolicy.js.map +1 -1
- package/dist/esm/policies/proxyPolicy.d.ts +0 -6
- package/dist/esm/policies/proxyPolicy.js +4 -167
- package/dist/esm/policies/proxyPolicy.js.map +1 -1
- package/dist/esm/policies/redirectPolicy.js +3 -38
- package/dist/esm/policies/redirectPolicy.js.map +1 -1
- package/dist/esm/policies/retryPolicy.d.ts +59 -1
- package/dist/esm/policies/retryPolicy.js +5 -94
- package/dist/esm/policies/retryPolicy.js.map +1 -1
- package/dist/esm/policies/systemErrorRetryPolicy.js +3 -13
- package/dist/esm/policies/systemErrorRetryPolicy.js.map +1 -1
- package/dist/esm/policies/throttlingRetryPolicy.js +3 -11
- package/dist/esm/policies/throttlingRetryPolicy.js.map +1 -1
- package/dist/esm/policies/tlsPolicy.js +3 -11
- package/dist/esm/policies/tlsPolicy.js.map +1 -1
- package/dist/esm/policies/tracingPolicy.js +1 -1
- package/dist/esm/policies/tracingPolicy.js.map +1 -1
- package/dist/esm/policies/wrapAbortSignalLikePolicy.d.ts +10 -0
- package/dist/esm/policies/wrapAbortSignalLikePolicy.js +30 -0
- package/dist/esm/policies/wrapAbortSignalLikePolicy.js.map +1 -0
- package/dist/esm/restError.js +8 -27
- package/dist/esm/restError.js.map +1 -1
- package/dist/esm/util/file.d.ts +28 -2
- package/dist/esm/util/file.js +9 -4
- package/dist/esm/util/file.js.map +1 -1
- package/dist/esm/util/tokenCycler.js +1 -1
- package/dist/esm/util/tokenCycler.js.map +1 -1
- package/dist/esm/util/wrapAbortSignal.d.ts +12 -0
- package/dist/esm/util/wrapAbortSignal.js +31 -0
- package/dist/esm/util/wrapAbortSignal.js.map +1 -0
- package/dist/react-native/constants.js +1 -1
- package/dist/react-native/constants.js.map +1 -1
- package/dist/react-native/createPipelineFromOptions.js +2 -0
- package/dist/react-native/createPipelineFromOptions.js.map +1 -1
- package/dist/react-native/defaultHttpClient.d.ts +1 -1
- package/dist/react-native/defaultHttpClient.js +21 -3
- package/dist/react-native/defaultHttpClient.js.map +1 -0
- package/dist/react-native/httpHeaders.js +2 -80
- package/dist/react-native/httpHeaders.js.map +1 -1
- package/dist/react-native/index.d.ts +1 -2
- package/dist/react-native/index.js +1 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/interfaces.d.ts +11 -0
- package/dist/react-native/interfaces.js.map +1 -1
- package/dist/react-native/pipeline.js +2 -253
- package/dist/react-native/pipeline.js.map +1 -1
- package/dist/react-native/pipelineRequest.d.ts +11 -0
- package/dist/react-native/pipelineRequest.js +5 -28
- package/dist/react-native/pipelineRequest.js.map +1 -1
- package/dist/react-native/policies/agentPolicy.js +3 -11
- package/dist/react-native/policies/agentPolicy.js.map +1 -1
- package/dist/react-native/policies/decompressResponsePolicy.js +3 -11
- package/dist/react-native/policies/decompressResponsePolicy.js.map +1 -1
- package/dist/react-native/policies/defaultRetryPolicy.js +3 -12
- package/dist/react-native/policies/defaultRetryPolicy.js.map +1 -1
- package/dist/react-native/policies/exponentialRetryPolicy.js +3 -10
- package/dist/react-native/policies/exponentialRetryPolicy.js.map +1 -1
- package/dist/react-native/policies/formDataPolicy.js +3 -85
- package/dist/react-native/policies/formDataPolicy.js.map +1 -1
- package/dist/react-native/policies/logPolicy.js +3 -21
- package/dist/react-native/policies/logPolicy.js.map +1 -1
- package/dist/react-native/policies/multipartPolicy.js +12 -95
- package/dist/react-native/policies/multipartPolicy.js.map +1 -1
- package/dist/react-native/policies/proxyPolicy.d.ts +26 -2
- package/dist/react-native/policies/proxyPolicy.js +26 -2
- package/dist/react-native/policies/proxyPolicy.js.map +1 -0
- package/dist/react-native/policies/redirectPolicy.js +3 -38
- package/dist/react-native/policies/redirectPolicy.js.map +1 -1
- package/dist/react-native/policies/retryPolicy.d.ts +59 -1
- package/dist/react-native/policies/retryPolicy.js +5 -94
- package/dist/react-native/policies/retryPolicy.js.map +1 -1
- package/dist/react-native/policies/systemErrorRetryPolicy.js +3 -13
- package/dist/react-native/policies/systemErrorRetryPolicy.js.map +1 -1
- package/dist/react-native/policies/throttlingRetryPolicy.js +3 -11
- package/dist/react-native/policies/throttlingRetryPolicy.js.map +1 -1
- package/dist/react-native/policies/tlsPolicy.js +3 -11
- package/dist/react-native/policies/tlsPolicy.js.map +1 -1
- package/dist/react-native/policies/tracingPolicy.js +1 -1
- package/dist/react-native/policies/tracingPolicy.js.map +1 -1
- package/dist/react-native/policies/wrapAbortSignalLikePolicy.d.ts +10 -0
- package/dist/react-native/policies/wrapAbortSignalLikePolicy.js +30 -0
- package/dist/react-native/policies/wrapAbortSignalLikePolicy.js.map +1 -0
- package/dist/react-native/restError.js +8 -27
- package/dist/react-native/restError.js.map +1 -1
- package/dist/react-native/util/file.d.ts +28 -2
- package/dist/react-native/util/file.js +9 -4
- package/dist/react-native/util/file.js.map +1 -1
- package/dist/react-native/util/tokenCycler.js +1 -1
- package/dist/react-native/util/tokenCycler.js.map +1 -1
- package/dist/react-native/util/wrapAbortSignal.d.ts +12 -0
- package/dist/react-native/util/wrapAbortSignal.js +31 -0
- package/dist/react-native/util/wrapAbortSignal.js.map +1 -0
- package/package.json +5 -6
- package/dist/browser/accessTokenCache.d.ts +0 -40
- package/dist/browser/accessTokenCache.js +0 -32
- package/dist/browser/accessTokenCache.js.map +0 -1
- package/dist/browser/defaultHttpClient-browser.mjs.map +0 -1
- package/dist/browser/fetchHttpClient.d.ts +0 -7
- package/dist/browser/fetchHttpClient.js +0 -256
- package/dist/browser/fetchHttpClient.js.map +0 -1
- package/dist/browser/nodeHttpClient.d.ts +0 -9
- package/dist/browser/nodeHttpClient.js +0 -348
- package/dist/browser/nodeHttpClient.js.map +0 -1
- package/dist/browser/policies/decompressResponsePolicy-browser.mjs.map +0 -1
- package/dist/browser/policies/proxyPolicy-browser.mjs.map +0 -1
- package/dist/browser/policies/proxyPolicy.common.d.ts +0 -15
- package/dist/browser/policies/proxyPolicy.common.js +0 -24
- package/dist/browser/policies/proxyPolicy.common.js.map +0 -1
- package/dist/browser/retryStrategies/exponentialRetryStrategy.d.ts +0 -40
- package/dist/browser/retryStrategies/exponentialRetryStrategy.js +0 -64
- package/dist/browser/retryStrategies/exponentialRetryStrategy.js.map +0 -1
- package/dist/browser/retryStrategies/retryStrategy.d.ts +0 -61
- package/dist/browser/retryStrategies/retryStrategy.js +0 -4
- package/dist/browser/retryStrategies/retryStrategy.js.map +0 -1
- package/dist/browser/retryStrategies/throttlingRetryStrategy.d.ts +0 -9
- package/dist/browser/retryStrategies/throttlingRetryStrategy.js +0 -74
- package/dist/browser/retryStrategies/throttlingRetryStrategy.js.map +0 -1
- package/dist/browser/util/concat-browser.mjs.map +0 -1
- package/dist/browser/util/concat.common.d.ts +0 -18
- package/dist/browser/util/concat.common.js +0 -45
- package/dist/browser/util/concat.common.js.map +0 -1
- package/dist/browser/util/concat.d.ts +0 -2
- package/dist/browser/util/concat.js +0 -4
- package/dist/browser/util/helpers.d.ts +0 -21
- package/dist/browser/util/helpers.js +0 -58
- package/dist/browser/util/helpers.js.map +0 -1
- package/dist/browser/util/inspect-browser.mjs.map +0 -1
- package/dist/browser/util/inspect.common.d.ts +0 -2
- package/dist/browser/util/inspect.common.js +0 -4
- package/dist/browser/util/inspect.common.js.map +0 -1
- package/dist/browser/util/inspect.d.ts +0 -2
- package/dist/browser/util/inspect.js +0 -4
- package/dist/browser/util/sanitizer.d.ts +0 -30
- package/dist/browser/util/sanitizer.js +0 -139
- package/dist/browser/util/sanitizer.js.map +0 -1
- package/dist/browser/util/typeGuards.d.ts +0 -5
- package/dist/browser/util/typeGuards.js +0 -17
- package/dist/browser/util/typeGuards.js.map +0 -1
- package/dist/browser/xhrHttpClient.d.ts +0 -7
- package/dist/browser/xhrHttpClient.js +0 -167
- package/dist/browser/xhrHttpClient.js.map +0 -1
- package/dist/commonjs/accessTokenCache.d.ts +0 -40
- package/dist/commonjs/accessTokenCache.js +0 -36
- package/dist/commonjs/accessTokenCache.js.map +0 -1
- package/dist/commonjs/fetchHttpClient.d.ts +0 -7
- package/dist/commonjs/fetchHttpClient.js +0 -259
- package/dist/commonjs/fetchHttpClient.js.map +0 -1
- package/dist/commonjs/nodeHttpClient.d.ts +0 -9
- package/dist/commonjs/nodeHttpClient.js +0 -353
- package/dist/commonjs/nodeHttpClient.js.map +0 -1
- package/dist/commonjs/policies/proxyPolicy.common.d.ts +0 -15
- package/dist/commonjs/policies/proxyPolicy.common.js +0 -30
- package/dist/commonjs/policies/proxyPolicy.common.js.map +0 -1
- package/dist/commonjs/retryStrategies/exponentialRetryStrategy.d.ts +0 -40
- package/dist/commonjs/retryStrategies/exponentialRetryStrategy.js +0 -69
- package/dist/commonjs/retryStrategies/exponentialRetryStrategy.js.map +0 -1
- package/dist/commonjs/retryStrategies/retryStrategy.d.ts +0 -61
- package/dist/commonjs/retryStrategies/retryStrategy.js +0 -5
- package/dist/commonjs/retryStrategies/retryStrategy.js.map +0 -1
- package/dist/commonjs/retryStrategies/throttlingRetryStrategy.d.ts +0 -9
- package/dist/commonjs/retryStrategies/throttlingRetryStrategy.js +0 -78
- package/dist/commonjs/retryStrategies/throttlingRetryStrategy.js.map +0 -1
- package/dist/commonjs/util/concat.common.d.ts +0 -18
- package/dist/commonjs/util/concat.common.js +0 -48
- package/dist/commonjs/util/concat.common.js.map +0 -1
- package/dist/commonjs/util/concat.d.ts +0 -17
- package/dist/commonjs/util/concat.js +0 -91
- package/dist/commonjs/util/concat.js.map +0 -1
- package/dist/commonjs/util/helpers.d.ts +0 -21
- package/dist/commonjs/util/helpers.js +0 -62
- package/dist/commonjs/util/helpers.js.map +0 -1
- package/dist/commonjs/util/inspect.common.d.ts +0 -2
- package/dist/commonjs/util/inspect.common.js +0 -7
- package/dist/commonjs/util/inspect.common.js.map +0 -1
- package/dist/commonjs/util/inspect.d.ts +0 -2
- package/dist/commonjs/util/inspect.js +0 -8
- package/dist/commonjs/util/inspect.js.map +0 -1
- package/dist/commonjs/util/sanitizer.d.ts +0 -30
- package/dist/commonjs/util/sanitizer.js +0 -143
- package/dist/commonjs/util/sanitizer.js.map +0 -1
- package/dist/commonjs/util/typeGuards.d.ts +0 -5
- package/dist/commonjs/util/typeGuards.js +0 -23
- package/dist/commonjs/util/typeGuards.js.map +0 -1
- package/dist/commonjs/xhrHttpClient.d.ts +0 -7
- package/dist/commonjs/xhrHttpClient.js +0 -170
- package/dist/commonjs/xhrHttpClient.js.map +0 -1
- package/dist/esm/accessTokenCache.d.ts +0 -40
- package/dist/esm/accessTokenCache.js +0 -32
- package/dist/esm/accessTokenCache.js.map +0 -1
- package/dist/esm/fetchHttpClient.d.ts +0 -7
- package/dist/esm/fetchHttpClient.js +0 -256
- package/dist/esm/fetchHttpClient.js.map +0 -1
- package/dist/esm/nodeHttpClient.d.ts +0 -9
- package/dist/esm/nodeHttpClient.js +0 -348
- package/dist/esm/nodeHttpClient.js.map +0 -1
- package/dist/esm/policies/proxyPolicy.common.d.ts +0 -15
- package/dist/esm/policies/proxyPolicy.common.js +0 -24
- package/dist/esm/policies/proxyPolicy.common.js.map +0 -1
- package/dist/esm/retryStrategies/exponentialRetryStrategy.d.ts +0 -40
- package/dist/esm/retryStrategies/exponentialRetryStrategy.js +0 -64
- package/dist/esm/retryStrategies/exponentialRetryStrategy.js.map +0 -1
- package/dist/esm/retryStrategies/retryStrategy.d.ts +0 -61
- package/dist/esm/retryStrategies/retryStrategy.js +0 -4
- package/dist/esm/retryStrategies/retryStrategy.js.map +0 -1
- package/dist/esm/retryStrategies/throttlingRetryStrategy.d.ts +0 -9
- package/dist/esm/retryStrategies/throttlingRetryStrategy.js +0 -74
- package/dist/esm/retryStrategies/throttlingRetryStrategy.js.map +0 -1
- package/dist/esm/util/concat.common.d.ts +0 -18
- package/dist/esm/util/concat.common.js +0 -45
- package/dist/esm/util/concat.common.js.map +0 -1
- package/dist/esm/util/concat.d.ts +0 -17
- package/dist/esm/util/concat.js +0 -88
- package/dist/esm/util/concat.js.map +0 -1
- package/dist/esm/util/helpers.d.ts +0 -21
- package/dist/esm/util/helpers.js +0 -58
- package/dist/esm/util/helpers.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/inspect.d.ts +0 -2
- package/dist/esm/util/inspect.js +0 -5
- package/dist/esm/util/inspect.js.map +0 -1
- package/dist/esm/util/sanitizer.d.ts +0 -30
- package/dist/esm/util/sanitizer.js +0 -139
- package/dist/esm/util/sanitizer.js.map +0 -1
- package/dist/esm/util/typeGuards.d.ts +0 -5
- package/dist/esm/util/typeGuards.js +0 -17
- package/dist/esm/util/typeGuards.js.map +0 -1
- package/dist/esm/xhrHttpClient.d.ts +0 -7
- package/dist/esm/xhrHttpClient.js +0 -167
- package/dist/esm/xhrHttpClient.js.map +0 -1
- package/dist/react-native/accessTokenCache.d.ts +0 -40
- package/dist/react-native/accessTokenCache.js +0 -32
- package/dist/react-native/accessTokenCache.js.map +0 -1
- package/dist/react-native/defaultHttpClient-react-native.mjs.map +0 -1
- package/dist/react-native/fetchHttpClient.d.ts +0 -7
- package/dist/react-native/fetchHttpClient.js +0 -256
- package/dist/react-native/fetchHttpClient.js.map +0 -1
- package/dist/react-native/nodeHttpClient.d.ts +0 -9
- package/dist/react-native/nodeHttpClient.js +0 -348
- package/dist/react-native/nodeHttpClient.js.map +0 -1
- package/dist/react-native/policies/proxyPolicy-react-native.mjs.map +0 -1
- package/dist/react-native/policies/proxyPolicy.common.d.ts +0 -15
- package/dist/react-native/policies/proxyPolicy.common.js +0 -24
- package/dist/react-native/policies/proxyPolicy.common.js.map +0 -1
- package/dist/react-native/retryStrategies/exponentialRetryStrategy.d.ts +0 -40
- package/dist/react-native/retryStrategies/exponentialRetryStrategy.js +0 -64
- package/dist/react-native/retryStrategies/exponentialRetryStrategy.js.map +0 -1
- package/dist/react-native/retryStrategies/retryStrategy.d.ts +0 -61
- package/dist/react-native/retryStrategies/retryStrategy.js +0 -4
- package/dist/react-native/retryStrategies/retryStrategy.js.map +0 -1
- package/dist/react-native/retryStrategies/throttlingRetryStrategy.d.ts +0 -9
- package/dist/react-native/retryStrategies/throttlingRetryStrategy.js +0 -74
- package/dist/react-native/retryStrategies/throttlingRetryStrategy.js.map +0 -1
- package/dist/react-native/util/concat-react-native.mjs.map +0 -1
- package/dist/react-native/util/concat.common.d.ts +0 -18
- package/dist/react-native/util/concat.common.js +0 -45
- package/dist/react-native/util/concat.common.js.map +0 -1
- package/dist/react-native/util/concat.d.ts +0 -2
- package/dist/react-native/util/concat.js +0 -4
- package/dist/react-native/util/helpers.d.ts +0 -21
- package/dist/react-native/util/helpers.js +0 -58
- package/dist/react-native/util/helpers.js.map +0 -1
- package/dist/react-native/util/inspect-react-native.mjs.map +0 -1
- package/dist/react-native/util/inspect.common.d.ts +0 -2
- package/dist/react-native/util/inspect.common.js +0 -4
- package/dist/react-native/util/inspect.common.js.map +0 -1
- package/dist/react-native/util/inspect.d.ts +0 -2
- package/dist/react-native/util/inspect.js +0 -4
- package/dist/react-native/util/sanitizer.d.ts +0 -30
- package/dist/react-native/util/sanitizer.js +0 -139
- package/dist/react-native/util/sanitizer.js.map +0 -1
- package/dist/react-native/util/typeGuards.d.ts +0 -5
- package/dist/react-native/util/typeGuards.js +0 -17
- package/dist/react-native/util/typeGuards.js.map +0 -1
- package/dist/react-native/xhrHttpClient.d.ts +0 -7
- package/dist/react-native/xhrHttpClient.js +0 -167
- package/dist/react-native/xhrHttpClient.js.map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mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;YAC1C,kEAAkE;YAClE,UAAU,EAAE,CAAC;YACb,6DAA6D;YAC7D,6BAA6B;YAC7B,0CAA0C;YAC1C,IAAI,MAAM,CAAC,MAAM,IAAI,mBAAmB,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;gBAC1D,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;YACnF,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { HttpClient, PipelineRequest, PipelineResponse, SendRequest } from \"./interfaces.js\";\n\n/**\n * Policies are executed in phases.\n * The execution order is:\n * 1. Serialize Phase\n * 2. Policies not in a phase\n * 3. Deserialize Phase\n * 4. Retry Phase\n * 5. Sign Phase\n */\nexport type PipelinePhase = \"Deserialize\" | \"Serialize\" | \"Retry\" | \"Sign\";\n\nconst ValidPhaseNames = new Set<PipelinePhase>([\"Deserialize\", \"Serialize\", \"Retry\", \"Sign\"]);\n\n/**\n * Options when adding a policy to the pipeline.\n * Used to express dependencies on other policies.\n */\nexport interface AddPolicyOptions {\n /**\n * Policies that this policy must come before.\n */\n beforePolicies?: string[];\n /**\n * Policies that this policy must come after.\n */\n afterPolicies?: string[];\n /**\n * The phase that this policy must come after.\n */\n afterPhase?: PipelinePhase;\n /**\n * The phase this policy belongs to.\n */\n phase?: PipelinePhase;\n}\n\n/**\n * A pipeline policy manipulates a request as it travels through the pipeline.\n * It is conceptually a middleware that is allowed to modify the request before\n * it is made as well as the response when it is received.\n */\nexport interface PipelinePolicy {\n /**\n * The policy name. Must be a unique string in the pipeline.\n */\n name: string;\n /**\n * The main method to implement that manipulates a request/response.\n * @param request - The request being performed.\n * @param next - The next policy in the pipeline. Must be called to continue the pipeline.\n */\n sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse>;\n}\n\n/**\n * Represents a pipeline for making a HTTP request to a URL.\n * Pipelines can have multiple policies to manage manipulating each request\n * before and after it is made to the server.\n */\nexport interface Pipeline {\n /**\n * Add a new policy to the pipeline.\n * @param policy - A policy that manipulates a request.\n * @param options - A set of options for when the policy should run.\n */\n addPolicy(policy: PipelinePolicy, options?: AddPolicyOptions): void;\n /**\n * Remove a policy from the pipeline.\n * @param options - Options that let you specify which policies to remove.\n */\n removePolicy(options: { name?: string; phase?: PipelinePhase }): PipelinePolicy[];\n /**\n * Uses the pipeline to make a HTTP request.\n * @param httpClient - The HttpClient that actually performs the request.\n * @param request - The request to be made.\n */\n sendRequest(httpClient: HttpClient, request: PipelineRequest): Promise<PipelineResponse>;\n /**\n * Returns the current set of policies in the pipeline in the order in which\n * they will be applied to the request. Later in the list is closer to when\n * the request is performed.\n */\n getOrderedPolicies(): PipelinePolicy[];\n /**\n * Duplicates this pipeline to allow for modifying an existing one without mutating it.\n */\n clone(): Pipeline;\n}\n\ninterface PipelineDescriptor {\n policy: PipelinePolicy;\n options: AddPolicyOptions;\n}\n\ninterface PolicyGraphNode {\n policy: PipelinePolicy;\n dependsOn: Set<PolicyGraphNode>;\n dependants: Set<PolicyGraphNode>;\n afterPhase?: Phase;\n}\n\ninterface Phase {\n name: PipelinePhase | \"None\";\n policies: Set<PolicyGraphNode>;\n hasRun: boolean;\n hasAfterPolicies: boolean;\n}\n\n/**\n * A private implementation of Pipeline.\n * Do not export this class from the package.\n * @internal\n */\nclass HttpPipeline implements Pipeline {\n private _policies: PipelineDescriptor[] = [];\n private _orderedPolicies?: PipelinePolicy[];\n\n private constructor(policies?: PipelineDescriptor[]) {\n this._policies = policies?.slice(0) ?? [];\n this._orderedPolicies = undefined;\n }\n\n public addPolicy(policy: PipelinePolicy, options: AddPolicyOptions = {}): void {\n if (options.phase && options.afterPhase) {\n throw new Error(\"Policies inside a phase cannot specify afterPhase.\");\n }\n if (options.phase && !ValidPhaseNames.has(options.phase)) {\n throw new Error(`Invalid phase name: ${options.phase}`);\n }\n if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) {\n throw new Error(`Invalid afterPhase name: ${options.afterPhase}`);\n }\n this._policies.push({\n policy,\n options,\n });\n this._orderedPolicies = undefined;\n }\n\n public removePolicy(options: { name?: string; phase?: string }): PipelinePolicy[] {\n const removedPolicies: PipelinePolicy[] = [];\n\n this._policies = this._policies.filter((policyDescriptor) => {\n if (\n (options.name && policyDescriptor.policy.name === options.name) ||\n (options.phase && policyDescriptor.options.phase === options.phase)\n ) {\n removedPolicies.push(policyDescriptor.policy);\n return false;\n } else {\n return true;\n }\n });\n this._orderedPolicies = undefined;\n\n return removedPolicies;\n }\n\n public sendRequest(httpClient: HttpClient, request: PipelineRequest): Promise<PipelineResponse> {\n const policies = this.getOrderedPolicies();\n\n const pipeline = policies.reduceRight<SendRequest>(\n (next, policy) => {\n return (req: PipelineRequest) => {\n return policy.sendRequest(req, next);\n };\n },\n (req: PipelineRequest) => httpClient.sendRequest(req),\n );\n\n return pipeline(request);\n }\n\n public getOrderedPolicies(): PipelinePolicy[] {\n if (!this._orderedPolicies) {\n this._orderedPolicies = this.orderPolicies();\n }\n return this._orderedPolicies;\n }\n\n public clone(): Pipeline {\n return new HttpPipeline(this._policies);\n }\n\n public static create(): Pipeline {\n return new HttpPipeline();\n }\n\n private orderPolicies(): PipelinePolicy[] {\n /**\n * The goal of this method is to reliably order pipeline policies\n * based on their declared requirements when they were added.\n *\n * Order is first determined by phase:\n *\n * 1. Serialize Phase\n * 2. Policies not in a phase\n * 3. Deserialize Phase\n * 4. Retry Phase\n * 5. Sign Phase\n *\n * Within each phase, policies are executed in the order\n * they were added unless they were specified to execute\n * before/after other policies or after a particular phase.\n *\n * To determine the final order, we will walk the policy list\n * in phase order multiple times until all dependencies are\n * satisfied.\n *\n * `afterPolicies` are the set of policies that must be\n * executed before a given policy. This requirement is\n * considered satisfied when each of the listed policies\n * have been scheduled.\n *\n * `beforePolicies` are the set of policies that must be\n * executed after a given policy. Since this dependency\n * can be expressed by converting it into a equivalent\n * `afterPolicies` declarations, they are normalized\n * into that form for simplicity.\n *\n * An `afterPhase` dependency is considered satisfied when all\n * policies in that phase have scheduled.\n *\n */\n const result: PipelinePolicy[] = [];\n\n // Track all policies we know about.\n const policyMap: Map<string, PolicyGraphNode> = new Map<string, PolicyGraphNode>();\n\n function createPhase(name: PipelinePhase | \"None\"): Phase {\n return {\n name,\n policies: new Set<PolicyGraphNode>(),\n hasRun: false,\n hasAfterPolicies: false,\n };\n }\n\n // Track policies for each phase.\n const serializePhase = createPhase(\"Serialize\");\n const noPhase = createPhase(\"None\");\n const deserializePhase = createPhase(\"Deserialize\");\n const retryPhase = createPhase(\"Retry\");\n const signPhase = createPhase(\"Sign\");\n\n // a list of phases in order\n const orderedPhases = [serializePhase, noPhase, deserializePhase, retryPhase, signPhase];\n\n // Small helper function to map phase name to each Phase\n function getPhase(phase: PipelinePhase | undefined): Phase {\n if (phase === \"Retry\") {\n return retryPhase;\n } else if (phase === \"Serialize\") {\n return serializePhase;\n } else if (phase === \"Deserialize\") {\n return deserializePhase;\n } else if (phase === \"Sign\") {\n return signPhase;\n } else {\n return noPhase;\n }\n }\n\n // First walk each policy and create a node to track metadata.\n for (const descriptor of this._policies) {\n const policy = descriptor.policy;\n const options = descriptor.options;\n const policyName = policy.name;\n if (policyMap.has(policyName)) {\n throw new Error(\"Duplicate policy names not allowed in pipeline\");\n }\n const node: PolicyGraphNode = {\n policy,\n dependsOn: new Set<PolicyGraphNode>(),\n dependants: new Set<PolicyGraphNode>(),\n };\n if (options.afterPhase) {\n node.afterPhase = getPhase(options.afterPhase);\n node.afterPhase.hasAfterPolicies = true;\n }\n policyMap.set(policyName, node);\n const phase = getPhase(options.phase);\n phase.policies.add(node);\n }\n\n // Now that each policy has a node, connect dependency references.\n for (const descriptor of this._policies) {\n const { policy, options } = descriptor;\n const policyName = policy.name;\n const node = policyMap.get(policyName);\n if (!node) {\n throw new Error(`Missing node for policy ${policyName}`);\n }\n\n if (options.afterPolicies) {\n for (const afterPolicyName of options.afterPolicies) {\n const afterNode = policyMap.get(afterPolicyName);\n if (afterNode) {\n // Linking in both directions helps later\n // when we want to notify dependants.\n node.dependsOn.add(afterNode);\n afterNode.dependants.add(node);\n }\n }\n }\n if (options.beforePolicies) {\n for (const beforePolicyName of options.beforePolicies) {\n const beforeNode = policyMap.get(beforePolicyName);\n if (beforeNode) {\n // To execute before another node, make it\n // depend on the current node.\n beforeNode.dependsOn.add(node);\n node.dependants.add(beforeNode);\n }\n }\n }\n }\n\n function walkPhase(phase: Phase): void {\n phase.hasRun = true;\n // Sets iterate in insertion order\n for (const node of phase.policies) {\n if (node.afterPhase && (!node.afterPhase.hasRun || node.afterPhase.policies.size)) {\n // If this node is waiting on a phase to complete,\n // we need to skip it for now.\n // Even if the phase is empty, we should wait for it\n // to be walked to avoid re-ordering policies.\n continue;\n }\n if (node.dependsOn.size === 0) {\n // If there's nothing else we're waiting for, we can\n // add this policy to the result list.\n result.push(node.policy);\n // Notify anything that depends on this policy that\n // the policy has been scheduled.\n for (const dependant of node.dependants) {\n dependant.dependsOn.delete(node);\n }\n policyMap.delete(node.policy.name);\n phase.policies.delete(node);\n }\n }\n }\n\n function walkPhases(): void {\n for (const phase of orderedPhases) {\n walkPhase(phase);\n // if the phase isn't complete\n if (phase.policies.size > 0 && phase !== noPhase) {\n if (!noPhase.hasRun) {\n // Try running noPhase to see if that unblocks this phase next tick.\n // This can happen if a phase that happens before noPhase\n // is waiting on a noPhase policy to complete.\n walkPhase(noPhase);\n }\n // Don't proceed to the next phase until this phase finishes.\n return;\n }\n\n if (phase.hasAfterPolicies) {\n // Run any policies unblocked by this phase\n walkPhase(noPhase);\n }\n }\n }\n\n // Iterate until we've put every node in the result list.\n let iteration = 0;\n while (policyMap.size > 0) {\n iteration++;\n const initialResultLength = result.length;\n // Keep walking each phase in order until we can order every node.\n walkPhases();\n // The result list *should* get at least one larger each time\n // after the first full pass.\n // Otherwise, we're going to loop forever.\n if (result.length <= initialResultLength && iteration > 1) {\n throw new Error(\"Cannot satisfy policy dependencies due to requirements cycle.\");\n }\n }\n\n return result;\n }\n}\n\n/**\n * Creates a totally empty pipeline.\n * Useful for testing or creating a custom one.\n */\nexport function createEmptyPipeline(): Pipeline {\n return HttpPipeline.create();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/pipeline.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAyF1F;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,sBAAsB,EAAc,CAAC;AAC9C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { HttpClient, PipelineRequest, PipelineResponse, SendRequest } from \"./interfaces.js\";\nimport { createEmptyPipeline as tspCreateEmptyPipeline } from \"@typespec/ts-http-runtime\";\n\n/**\n * Policies are executed in phases.\n * The execution order is:\n * 1. Serialize Phase\n * 2. Policies not in a phase\n * 3. Deserialize Phase\n * 4. Retry Phase\n * 5. Sign Phase\n */\nexport type PipelinePhase = \"Deserialize\" | \"Serialize\" | \"Retry\" | \"Sign\";\n\n/**\n * Options when adding a policy to the pipeline.\n * Used to express dependencies on other policies.\n */\nexport interface AddPolicyOptions {\n /**\n * Policies that this policy must come before.\n */\n beforePolicies?: string[];\n /**\n * Policies that this policy must come after.\n */\n afterPolicies?: string[];\n /**\n * The phase that this policy must come after.\n */\n afterPhase?: PipelinePhase;\n /**\n * The phase this policy belongs to.\n */\n phase?: PipelinePhase;\n}\n\n/**\n * A pipeline policy manipulates a request as it travels through the pipeline.\n * It is conceptually a middleware that is allowed to modify the request before\n * it is made as well as the response when it is received.\n */\nexport interface PipelinePolicy {\n /**\n * The policy name. Must be a unique string in the pipeline.\n */\n name: string;\n /**\n * The main method to implement that manipulates a request/response.\n * @param request - The request being performed.\n * @param next - The next policy in the pipeline. Must be called to continue the pipeline.\n */\n sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse>;\n}\n\n/**\n * Represents a pipeline for making a HTTP request to a URL.\n * Pipelines can have multiple policies to manage manipulating each request\n * before and after it is made to the server.\n */\nexport interface Pipeline {\n /**\n * Add a new policy to the pipeline.\n * @param policy - A policy that manipulates a request.\n * @param options - A set of options for when the policy should run.\n */\n addPolicy(policy: PipelinePolicy, options?: AddPolicyOptions): void;\n /**\n * Remove a policy from the pipeline.\n * @param options - Options that let you specify which policies to remove.\n */\n removePolicy(options: { name?: string; phase?: PipelinePhase }): PipelinePolicy[];\n /**\n * Uses the pipeline to make a HTTP request.\n * @param httpClient - The HttpClient that actually performs the request.\n * @param request - The request to be made.\n */\n sendRequest(httpClient: HttpClient, request: PipelineRequest): Promise<PipelineResponse>;\n /**\n * Returns the current set of policies in the pipeline in the order in which\n * they will be applied to the request. Later in the list is closer to when\n * the request is performed.\n */\n getOrderedPolicies(): PipelinePolicy[];\n /**\n * Duplicates this pipeline to allow for modifying an existing one without mutating it.\n */\n clone(): Pipeline;\n}\n\n/**\n * Creates a totally empty pipeline.\n * Useful for testing or creating a custom one.\n */\nexport function createEmptyPipeline(): Pipeline {\n return tspCreateEmptyPipeline() as Pipeline;\n}\n"]}
|
|
@@ -95,6 +95,17 @@ export interface PipelineRequestOptions {
|
|
|
95
95
|
onDownloadProgress?: (progress: TransferProgressEvent) => void;
|
|
96
96
|
/** Set to true if the request is sent over HTTP instead of HTTPS */
|
|
97
97
|
allowInsecureConnection?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Additional options to set on the request. This provides a way to override
|
|
100
|
+
* existing ones or provide request properties that are not declared.
|
|
101
|
+
*
|
|
102
|
+
* For possible valid properties, see
|
|
103
|
+
* - NodeJS https.request options: https://nodejs.org/api/http.html#httprequestoptions-callback
|
|
104
|
+
* - Browser RequestInit: https://developer.mozilla.org/en-US/docs/Web/API/RequestInit
|
|
105
|
+
*
|
|
106
|
+
* WARNING: Options specified here will override any properties of same names when request is sent by {@link HttpClient}.
|
|
107
|
+
*/
|
|
108
|
+
requestOverrides?: Record<string, unknown>;
|
|
98
109
|
}
|
|
99
110
|
/**
|
|
100
111
|
* Creates a new pipeline request with the given options.
|
|
@@ -1,38 +1,15 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import {
|
|
4
|
-
import { randomUUID } from "@azure/core-util";
|
|
5
|
-
class PipelineRequestImpl {
|
|
6
|
-
constructor(options) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
8
|
-
this.url = options.url;
|
|
9
|
-
this.body = options.body;
|
|
10
|
-
this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : createHttpHeaders();
|
|
11
|
-
this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET";
|
|
12
|
-
this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0;
|
|
13
|
-
this.multipartBody = options.multipartBody;
|
|
14
|
-
this.formData = options.formData;
|
|
15
|
-
this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false;
|
|
16
|
-
this.proxySettings = options.proxySettings;
|
|
17
|
-
this.streamResponseStatusCodes = options.streamResponseStatusCodes;
|
|
18
|
-
this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false;
|
|
19
|
-
this.abortSignal = options.abortSignal;
|
|
20
|
-
this.tracingOptions = options.tracingOptions;
|
|
21
|
-
this.onUploadProgress = options.onUploadProgress;
|
|
22
|
-
this.onDownloadProgress = options.onDownloadProgress;
|
|
23
|
-
this.requestId = options.requestId || randomUUID();
|
|
24
|
-
this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false;
|
|
25
|
-
this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false;
|
|
26
|
-
this.agent = options.agent;
|
|
27
|
-
this.tlsSettings = options.tlsSettings;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
3
|
+
import { createPipelineRequest as tspCreatePipelineRequest, } from "@typespec/ts-http-runtime";
|
|
30
4
|
/**
|
|
31
5
|
* Creates a new pipeline request with the given options.
|
|
32
6
|
* This method is to allow for the easy setting of default values and not required.
|
|
33
7
|
* @param options - The options to create the request with.
|
|
34
8
|
*/
|
|
35
9
|
export function createPipelineRequest(options) {
|
|
36
|
-
|
|
10
|
+
// Cast required due to difference between ts-http-runtime requiring AbortSignal while core-rest-pipeline allows
|
|
11
|
+
// the more generic AbortSignalLike. The wrapAbortSignalLike pipeline policy will take care of ensuring that any AbortSignalLike in the request
|
|
12
|
+
// is converted into a true AbortSignal.
|
|
13
|
+
return tspCreatePipelineRequest(options);
|
|
37
14
|
}
|
|
38
15
|
//# sourceMappingURL=pipelineRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipelineRequest.js","sourceRoot":"","sources":["../../src/pipelineRequest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"pipelineRequest.js","sourceRoot":"","sources":["../../src/pipelineRequest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAgBlC,OAAO,EACL,qBAAqB,IAAI,wBAAwB,GAElD,MAAM,2BAA2B,CAAC;AAgInC;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA+B;IACnE,gHAAgH;IAChH,+IAA+I;IAC/I,wCAAwC;IACxC,OAAO,wBAAwB,CAAC,OAAoC,CAAC,CAAC;AACxE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n Agent,\n FormDataMap,\n HttpHeaders,\n MultipartRequestBody,\n PipelineRequest,\n ProxySettings,\n RequestBodyType,\n TlsSettings,\n TransferProgressEvent,\n} from \"./interfaces.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { OperationTracingOptions } from \"@azure/core-tracing\";\nimport type { HttpMethods } from \"@azure/core-util\";\nimport {\n createPipelineRequest as tspCreatePipelineRequest,\n type PipelineRequestOptions as TspPipelineRequestOptions,\n} from \"@typespec/ts-http-runtime\";\n\n/**\n * Settings to initialize a request.\n * Almost equivalent to Partial<PipelineRequest>, but url is mandatory.\n */\nexport interface PipelineRequestOptions {\n /**\n * The URL to make the request to.\n */\n url: string;\n\n /**\n * The HTTP method to use when making the request.\n */\n method?: HttpMethods;\n\n /**\n * The HTTP headers to use when making the request.\n */\n headers?: HttpHeaders;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n * If the request is terminated, an `AbortError` is thrown.\n * Defaults to 0, which disables the timeout.\n */\n timeout?: number;\n\n /**\n * If credentials (cookies) should be sent along during an XHR.\n * Defaults to false.\n */\n withCredentials?: boolean;\n\n /**\n * A unique identifier for the request. Used for logging and tracing.\n */\n requestId?: string;\n\n /**\n * The HTTP body content (if any)\n */\n body?: RequestBodyType;\n\n /**\n * Body for a multipart request.\n */\n multipartBody?: MultipartRequestBody;\n\n /**\n * To simulate a browser form post\n */\n formData?: FormDataMap;\n\n /**\n * A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.\n */\n streamResponseStatusCodes?: Set<number>;\n\n /**\n * NODEJS ONLY\n *\n * A Node-only option to provide a custom `http.Agent`/`https.Agent`.\n * NOTE: usually this should be one instance shared by multiple requests so that the underlying\n * connection to the service can be reused.\n * Does nothing when running in the browser.\n */\n agent?: Agent;\n\n /**\n * BROWSER ONLY\n *\n * A browser only option to enable use of the Streams API. If this option is set and streaming is used\n * (see `streamResponseStatusCodes`), the response will have a property `browserStream` instead of\n * `blobBody` which will be undefined.\n *\n * Default value is false\n */\n enableBrowserStreams?: boolean;\n\n /** Settings for configuring TLS authentication */\n tlsSettings?: TlsSettings;\n\n /**\n * Proxy configuration.\n */\n proxySettings?: ProxySettings;\n\n /**\n * If the connection should not be reused.\n */\n disableKeepAlive?: boolean;\n\n /**\n * Used to abort the request later.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * Options used to create a span when tracing is enabled.\n */\n tracingOptions?: OperationTracingOptions;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /** Callback which fires upon download progress. */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n\n /**\n * Additional options to set on the request. This provides a way to override\n * existing ones or provide request properties that are not declared.\n *\n * For possible valid properties, see\n * - NodeJS https.request options: https://nodejs.org/api/http.html#httprequestoptions-callback\n * - Browser RequestInit: https://developer.mozilla.org/en-US/docs/Web/API/RequestInit\n *\n * WARNING: Options specified here will override any properties of same names when request is sent by {@link HttpClient}.\n */\n requestOverrides?: Record<string, unknown>;\n}\n\n/**\n * Creates a new pipeline request with the given options.\n * This method is to allow for the easy setting of default values and not required.\n * @param options - The options to create the request with.\n */\nexport function createPipelineRequest(options: PipelineRequestOptions): PipelineRequest {\n // Cast required due to difference between ts-http-runtime requiring AbortSignal while core-rest-pipeline allows\n // the more generic AbortSignalLike. The wrapAbortSignalLike pipeline policy will take care of ensuring that any AbortSignalLike in the request\n // is converted into a true AbortSignal.\n return tspCreatePipelineRequest(options as TspPipelineRequestOptions);\n}\n"]}
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
+
import { agentPolicyName as tspAgentPolicyName, agentPolicy as tspAgentPolicy, } from "@typespec/ts-http-runtime/internal/policies";
|
|
3
4
|
/**
|
|
4
5
|
* Name of the Agent Policy
|
|
5
6
|
*/
|
|
6
|
-
export const agentPolicyName =
|
|
7
|
+
export const agentPolicyName = tspAgentPolicyName;
|
|
7
8
|
/**
|
|
8
9
|
* Gets a pipeline policy that sets http.agent
|
|
9
10
|
*/
|
|
10
11
|
export function agentPolicy(agent) {
|
|
11
|
-
return
|
|
12
|
-
name: agentPolicyName,
|
|
13
|
-
sendRequest: async (req, next) => {
|
|
14
|
-
// Users may define an agent on the request, honor it over the client level one
|
|
15
|
-
if (!req.agent) {
|
|
16
|
-
req.agent = agent;
|
|
17
|
-
}
|
|
18
|
-
return next(req);
|
|
19
|
-
},
|
|
20
|
-
};
|
|
12
|
+
return tspAgentPolicy(agent);
|
|
21
13
|
}
|
|
22
14
|
//# sourceMappingURL=agentPolicy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentPolicy.js","sourceRoot":"","sources":["../../../src/policies/agentPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"agentPolicy.js","sourceRoot":"","sources":["../../../src/policies/agentPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EACL,eAAe,IAAI,kBAAkB,EACrC,WAAW,IAAI,cAAc,GAC9B,MAAM,6CAA6C,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelinePolicy } from \"../pipeline.js\";\nimport type { Agent } from \"../interfaces.js\";\nimport {\n agentPolicyName as tspAgentPolicyName,\n agentPolicy as tspAgentPolicy,\n} from \"@typespec/ts-http-runtime/internal/policies\";\n\n/**\n * Name of the Agent Policy\n */\nexport const agentPolicyName = tspAgentPolicyName;\n\n/**\n * Gets a pipeline policy that sets http.agent\n */\nexport function agentPolicy(agent?: Agent): PipelinePolicy {\n return tspAgentPolicy(agent);\n}\n"]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import type { PipelinePolicy } from "../pipeline.js";
|
|
2
|
+
/**
|
|
3
|
+
* The programmatic identifier of the decompressResponsePolicy.
|
|
4
|
+
*/
|
|
1
5
|
export declare const decompressResponsePolicyName = "decompressResponsePolicy";
|
|
2
6
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
7
|
+
* A policy to enable response decompression according to Accept-Encoding header
|
|
8
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding
|
|
5
9
|
*/
|
|
6
|
-
export declare function decompressResponsePolicy():
|
|
7
|
-
//# sourceMappingURL=decompressResponsePolicy
|
|
10
|
+
export declare function decompressResponsePolicy(): PipelinePolicy;
|
|
11
|
+
//# sourceMappingURL=decompressResponsePolicy.d.ts.map
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { decompressResponsePolicyName as tspDecompressResponsePolicyName, decompressResponsePolicy as tspDecompressResponsePolicy, } from "@typespec/ts-http-runtime/internal/policies";
|
|
4
|
+
/**
|
|
5
|
+
* The programmatic identifier of the decompressResponsePolicy.
|
|
5
6
|
*/
|
|
6
|
-
export const decompressResponsePolicyName =
|
|
7
|
+
export const decompressResponsePolicyName = tspDecompressResponsePolicyName;
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* A policy to enable response decompression according to Accept-Encoding header
|
|
10
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding
|
|
10
11
|
*/
|
|
11
12
|
export function decompressResponsePolicy() {
|
|
12
|
-
|
|
13
|
+
return tspDecompressResponsePolicy();
|
|
13
14
|
}
|
|
14
|
-
//# sourceMappingURL=decompressResponsePolicy
|
|
15
|
+
//# sourceMappingURL=decompressResponsePolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decompressResponsePolicy.js","sourceRoot":"","sources":["../../../src/policies/decompressResponsePolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EACL,4BAA4B,IAAI,+BAA+B,EAC/D,wBAAwB,IAAI,2BAA2B,GACxD,MAAM,6CAA6C,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,+BAA+B,CAAC;AAE5E;;;GAGG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO,2BAA2B,EAAE,CAAC;AACvC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelinePolicy } from \"../pipeline.js\";\n\nimport {\n decompressResponsePolicyName as tspDecompressResponsePolicyName,\n decompressResponsePolicy as tspDecompressResponsePolicy,\n} from \"@typespec/ts-http-runtime/internal/policies\";\n\n/**\n * The programmatic identifier of the decompressResponsePolicy.\n */\nexport const decompressResponsePolicyName = tspDecompressResponsePolicyName;\n\n/**\n * A policy to enable response decompression according to Accept-Encoding header\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding\n */\nexport function decompressResponsePolicy(): PipelinePolicy {\n return tspDecompressResponsePolicy();\n}\n"]}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import {
|
|
4
|
-
import { throttlingRetryStrategy } from "../retryStrategies/throttlingRetryStrategy.js";
|
|
5
|
-
import { retryPolicy } from "./retryPolicy.js";
|
|
6
|
-
import { DEFAULT_RETRY_POLICY_COUNT } from "../constants.js";
|
|
3
|
+
import { defaultRetryPolicyName as tspDefaultRetryPolicyName, defaultRetryPolicy as tspDefaultRetryPolicy, } from "@typespec/ts-http-runtime/internal/policies";
|
|
7
4
|
/**
|
|
8
5
|
* Name of the {@link defaultRetryPolicy}
|
|
9
6
|
*/
|
|
10
|
-
export const defaultRetryPolicyName =
|
|
7
|
+
export const defaultRetryPolicyName = tspDefaultRetryPolicyName;
|
|
11
8
|
/**
|
|
12
9
|
* A policy that retries according to three strategies:
|
|
13
10
|
* - When the server sends a 429 response with a Retry-After header.
|
|
@@ -15,12 +12,6 @@ export const defaultRetryPolicyName = "defaultRetryPolicy";
|
|
|
15
12
|
* - Or otherwise if the outgoing request fails, it will retry with an exponentially increasing delay.
|
|
16
13
|
*/
|
|
17
14
|
export function defaultRetryPolicy(options = {}) {
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
name: defaultRetryPolicyName,
|
|
21
|
-
sendRequest: retryPolicy([throttlingRetryStrategy(), exponentialRetryStrategy(options)], {
|
|
22
|
-
maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_POLICY_COUNT,
|
|
23
|
-
}).sendRequest,
|
|
24
|
-
};
|
|
15
|
+
return tspDefaultRetryPolicy(options);
|
|
25
16
|
}
|
|
26
17
|
//# sourceMappingURL=defaultRetryPolicy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultRetryPolicy.js","sourceRoot":"","sources":["../../../src/policies/defaultRetryPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"defaultRetryPolicy.js","sourceRoot":"","sources":["../../../src/policies/defaultRetryPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EACL,sBAAsB,IAAI,yBAAyB,EACnD,kBAAkB,IAAI,qBAAqB,GAC5C,MAAM,6CAA6C,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,yBAAyB,CAAC;AAOhE;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAqC,EAAE;IACxE,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelineRetryOptions } from \"../interfaces.js\";\nimport type { PipelinePolicy } from \"../pipeline.js\";\n\nimport {\n defaultRetryPolicyName as tspDefaultRetryPolicyName,\n defaultRetryPolicy as tspDefaultRetryPolicy,\n} from \"@typespec/ts-http-runtime/internal/policies\";\n\n/**\n * Name of the {@link defaultRetryPolicy}\n */\nexport const defaultRetryPolicyName = tspDefaultRetryPolicyName;\n\n/**\n * Options that control how to retry failed requests.\n */\nexport interface DefaultRetryPolicyOptions extends PipelineRetryOptions {}\n\n/**\n * A policy that retries according to three strategies:\n * - When the server sends a 429 response with a Retry-After header.\n * - When there are errors in the underlying transport layer (e.g. DNS lookup failures).\n * - Or otherwise if the outgoing request fails, it will retry with an exponentially increasing delay.\n */\nexport function defaultRetryPolicy(options: DefaultRetryPolicyOptions = {}): PipelinePolicy {\n return tspDefaultRetryPolicy(options);\n}\n"]}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import {
|
|
4
|
-
import { retryPolicy } from "./retryPolicy.js";
|
|
5
|
-
import { DEFAULT_RETRY_POLICY_COUNT } from "../constants.js";
|
|
3
|
+
import { exponentialRetryPolicyName as tspExponentialRetryPolicyName, exponentialRetryPolicy as tspExponentialRetryPolicy, } from "@typespec/ts-http-runtime/internal/policies";
|
|
6
4
|
/**
|
|
7
5
|
* The programmatic identifier of the exponentialRetryPolicy.
|
|
8
6
|
*/
|
|
9
|
-
export const exponentialRetryPolicyName =
|
|
7
|
+
export const exponentialRetryPolicyName = tspExponentialRetryPolicyName;
|
|
10
8
|
/**
|
|
11
9
|
* A policy that attempts to retry requests while introducing an exponentially increasing delay.
|
|
12
10
|
* @param options - Options that configure retry logic.
|
|
13
11
|
*/
|
|
14
12
|
export function exponentialRetryPolicy(options = {}) {
|
|
15
|
-
|
|
16
|
-
return retryPolicy([
|
|
17
|
-
exponentialRetryStrategy(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })),
|
|
18
|
-
], {
|
|
19
|
-
maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_POLICY_COUNT,
|
|
20
|
-
});
|
|
13
|
+
return tspExponentialRetryPolicy(options);
|
|
21
14
|
}
|
|
22
15
|
//# sourceMappingURL=exponentialRetryPolicy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exponentialRetryPolicy.js","sourceRoot":"","sources":["../../../src/policies/exponentialRetryPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"exponentialRetryPolicy.js","sourceRoot":"","sources":["../../../src/policies/exponentialRetryPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EACL,0BAA0B,IAAI,6BAA6B,EAC3D,sBAAsB,IAAI,yBAAyB,GACpD,MAAM,6CAA6C,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAyBxE;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,UAAyC,EAAE;IAE3C,OAAO,yBAAyB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelinePolicy } from \"../pipeline.js\";\n\nimport {\n exponentialRetryPolicyName as tspExponentialRetryPolicyName,\n exponentialRetryPolicy as tspExponentialRetryPolicy,\n} from \"@typespec/ts-http-runtime/internal/policies\";\n\n/**\n * The programmatic identifier of the exponentialRetryPolicy.\n */\nexport const exponentialRetryPolicyName = tspExponentialRetryPolicyName;\n\n/**\n * Options that control how to retry failed requests.\n */\nexport interface ExponentialRetryPolicyOptions {\n /**\n * The maximum number of retry attempts. Defaults to 3.\n */\n maxRetries?: number;\n\n /**\n * The amount of delay in milliseconds between retry attempts. Defaults to 1000\n * (1 second.) The delay increases exponentially with each retry up to a maximum\n * specified by maxRetryDelayInMs.\n */\n retryDelayInMs?: number;\n\n /**\n * The maximum delay in milliseconds allowed before retrying an operation. Defaults\n * to 64000 (64 seconds).\n */\n maxRetryDelayInMs?: number;\n}\n\n/**\n * A policy that attempts to retry requests while introducing an exponentially increasing delay.\n * @param options - Options that configure retry logic.\n */\nexport function exponentialRetryPolicy(\n options: ExponentialRetryPolicyOptions = {},\n): PipelinePolicy {\n return tspExponentialRetryPolicy(options);\n}\n"]}
|
|
@@ -1,96 +1,14 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import {
|
|
4
|
-
import { createHttpHeaders } from "../httpHeaders.js";
|
|
3
|
+
import { formDataPolicyName as tspFormDataPolicyName, formDataPolicy as tspFormDataPolicy, } from "@typespec/ts-http-runtime/internal/policies";
|
|
5
4
|
/**
|
|
6
5
|
* The programmatic identifier of the formDataPolicy.
|
|
7
6
|
*/
|
|
8
|
-
export const formDataPolicyName =
|
|
9
|
-
function formDataToFormDataMap(formData) {
|
|
10
|
-
var _a;
|
|
11
|
-
const formDataMap = {};
|
|
12
|
-
for (const [key, value] of formData.entries()) {
|
|
13
|
-
(_a = formDataMap[key]) !== null && _a !== void 0 ? _a : (formDataMap[key] = []);
|
|
14
|
-
formDataMap[key].push(value);
|
|
15
|
-
}
|
|
16
|
-
return formDataMap;
|
|
17
|
-
}
|
|
7
|
+
export const formDataPolicyName = tspFormDataPolicyName;
|
|
18
8
|
/**
|
|
19
9
|
* A policy that encodes FormData on the request into the body.
|
|
20
10
|
*/
|
|
21
11
|
export function formDataPolicy() {
|
|
22
|
-
return
|
|
23
|
-
name: formDataPolicyName,
|
|
24
|
-
async sendRequest(request, next) {
|
|
25
|
-
if (isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) {
|
|
26
|
-
request.formData = formDataToFormDataMap(request.body);
|
|
27
|
-
request.body = undefined;
|
|
28
|
-
}
|
|
29
|
-
if (request.formData) {
|
|
30
|
-
const contentType = request.headers.get("Content-Type");
|
|
31
|
-
if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) {
|
|
32
|
-
request.body = wwwFormUrlEncode(request.formData);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
await prepareFormData(request.formData, request);
|
|
36
|
-
}
|
|
37
|
-
request.formData = undefined;
|
|
38
|
-
}
|
|
39
|
-
return next(request);
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function wwwFormUrlEncode(formData) {
|
|
44
|
-
const urlSearchParams = new URLSearchParams();
|
|
45
|
-
for (const [key, value] of Object.entries(formData)) {
|
|
46
|
-
if (Array.isArray(value)) {
|
|
47
|
-
for (const subValue of value) {
|
|
48
|
-
urlSearchParams.append(key, subValue.toString());
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
urlSearchParams.append(key, value.toString());
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return urlSearchParams.toString();
|
|
56
|
-
}
|
|
57
|
-
async function prepareFormData(formData, request) {
|
|
58
|
-
// validate content type (multipart/form-data)
|
|
59
|
-
const contentType = request.headers.get("Content-Type");
|
|
60
|
-
if (contentType && !contentType.startsWith("multipart/form-data")) {
|
|
61
|
-
// content type is specified and is not multipart/form-data. Exit.
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? contentType : "multipart/form-data");
|
|
65
|
-
// set body to MultipartRequestBody using content from FormDataMap
|
|
66
|
-
const parts = [];
|
|
67
|
-
for (const [fieldName, values] of Object.entries(formData)) {
|
|
68
|
-
for (const value of Array.isArray(values) ? values : [values]) {
|
|
69
|
-
if (typeof value === "string") {
|
|
70
|
-
parts.push({
|
|
71
|
-
headers: createHttpHeaders({
|
|
72
|
-
"Content-Disposition": `form-data; name="${fieldName}"`,
|
|
73
|
-
}),
|
|
74
|
-
body: stringToUint8Array(value, "utf-8"),
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
else if (value === undefined || value === null || typeof value !== "object") {
|
|
78
|
-
throw new Error(`Unexpected value for key ${fieldName}: ${value}. Value should be serialized to string first.`);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
// using || instead of ?? here since if value.name is empty we should create a file name
|
|
82
|
-
const fileName = value.name || "blob";
|
|
83
|
-
const headers = createHttpHeaders();
|
|
84
|
-
headers.set("Content-Disposition", `form-data; name="${fieldName}"; filename="${fileName}"`);
|
|
85
|
-
// again, || is used since an empty value.type means the content type is unset
|
|
86
|
-
headers.set("Content-Type", value.type || "application/octet-stream");
|
|
87
|
-
parts.push({
|
|
88
|
-
headers,
|
|
89
|
-
body: value,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
request.multipartBody = { parts };
|
|
12
|
+
return tspFormDataPolicy();
|
|
95
13
|
}
|
|
96
14
|
//# sourceMappingURL=formDataPolicy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formDataPolicy.js","sourceRoot":"","sources":["../../../src/policies/formDataPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"formDataPolicy.js","sourceRoot":"","sources":["../../../src/policies/formDataPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EACL,kBAAkB,IAAI,qBAAqB,EAC3C,cAAc,IAAI,iBAAiB,GACpC,MAAM,6CAA6C,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,iBAAiB,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelinePolicy } from \"../pipeline.js\";\n\nimport {\n formDataPolicyName as tspFormDataPolicyName,\n formDataPolicy as tspFormDataPolicy,\n} from \"@typespec/ts-http-runtime/internal/policies\";\n\n/**\n * The programmatic identifier of the formDataPolicy.\n */\nexport const formDataPolicyName = tspFormDataPolicyName;\n\n/**\n * A policy that encodes FormData on the request into the body.\n */\nexport function formDataPolicy(): PipelinePolicy {\n return tspFormDataPolicy();\n}\n"]}
|
|
@@ -1,34 +1,16 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { logger as coreLogger } from "../log.js";
|
|
4
|
-
import {
|
|
4
|
+
import { logPolicyName as tspLogPolicyName, logPolicy as tspLogPolicy, } from "@typespec/ts-http-runtime/internal/policies";
|
|
5
5
|
/**
|
|
6
6
|
* The programmatic identifier of the logPolicy.
|
|
7
7
|
*/
|
|
8
|
-
export const logPolicyName =
|
|
8
|
+
export const logPolicyName = tspLogPolicyName;
|
|
9
9
|
/**
|
|
10
10
|
* A policy that logs all requests and responses.
|
|
11
11
|
* @param options - Options to configure logPolicy.
|
|
12
12
|
*/
|
|
13
13
|
export function logPolicy(options = {}) {
|
|
14
|
-
|
|
15
|
-
const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : coreLogger.info;
|
|
16
|
-
const sanitizer = new Sanitizer({
|
|
17
|
-
additionalAllowedHeaderNames: options.additionalAllowedHeaderNames,
|
|
18
|
-
additionalAllowedQueryParameters: options.additionalAllowedQueryParameters,
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
name: logPolicyName,
|
|
22
|
-
async sendRequest(request, next) {
|
|
23
|
-
if (!logger.enabled) {
|
|
24
|
-
return next(request);
|
|
25
|
-
}
|
|
26
|
-
logger(`Request: ${sanitizer.sanitize(request)}`);
|
|
27
|
-
const response = await next(request);
|
|
28
|
-
logger(`Response status code: ${response.status}`);
|
|
29
|
-
logger(`Headers: ${sanitizer.sanitize(response.headers)}`);
|
|
30
|
-
return response;
|
|
31
|
-
},
|
|
32
|
-
};
|
|
14
|
+
return tspLogPolicy(Object.assign({ logger: coreLogger.info }, options));
|
|
33
15
|
}
|
|
34
16
|
//# sourceMappingURL=logPolicy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logPolicy.js","sourceRoot":"","sources":["../../../src/policies/logPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"logPolicy.js","sourceRoot":"","sources":["../../../src/policies/logPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,aAAa,IAAI,gBAAgB,EACjC,SAAS,IAAI,YAAY,GAC1B,MAAM,6CAA6C,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AA4B9C;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,UAA4B,EAAE;IACtD,OAAO,YAAY,iBACjB,MAAM,EAAE,UAAU,CAAC,IAAI,IACpB,OAAO,EACV,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Debugger } from \"@azure/logger\";\nimport type { PipelinePolicy } from \"../pipeline.js\";\nimport { logger as coreLogger } from \"../log.js\";\nimport {\n logPolicyName as tspLogPolicyName,\n logPolicy as tspLogPolicy,\n} from \"@typespec/ts-http-runtime/internal/policies\";\n\n/**\n * The programmatic identifier of the logPolicy.\n */\nexport const logPolicyName = tspLogPolicyName;\n\n/**\n * Options to configure the logPolicy.\n */\nexport interface LogPolicyOptions {\n /**\n * Header names whose values will be logged when logging is enabled.\n * Defaults include a list of well-known safe headers. Any headers\n * specified in this field will be added to that list. Any other values will\n * be written to logs as \"REDACTED\".\n */\n additionalAllowedHeaderNames?: string[];\n\n /**\n * Query string names whose values will be logged when logging is enabled. By default no\n * query string values are logged.\n */\n additionalAllowedQueryParameters?: string[];\n\n /**\n * The log function to use for writing pipeline logs.\n * Defaults to core-http's built-in logger.\n * Compatible with the `debug` library.\n */\n logger?: Debugger;\n}\n\n/**\n * A policy that logs all requests and responses.\n * @param options - Options to configure logPolicy.\n */\nexport function logPolicy(options: LogPolicyOptions = {}): PipelinePolicy {\n return tspLogPolicy({\n logger: coreLogger.info,\n ...options,\n });\n}\n"]}
|