@azure/core-rest-pipeline 1.19.2-alpha.20250418.1 → 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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AAa,CAAC,IAAqB;IACjD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,CAAC,CAAC;IACX,CAAC;SAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;SAAM,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IAClC,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB;IAClC,OAAO,IAAI,cAAc,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport * as http from \"node:http\";\nimport * as https from \"node:https\";\nimport * as zlib from \"node:zlib\";\nimport { Transform } from \"node:stream\";\nimport { AbortError } from \"@azure/abort-controller\";\nimport type {\n HttpClient,\n HttpHeaders,\n PipelineRequest,\n PipelineResponse,\n RequestBodyType,\n TlsSettings,\n TransferProgressEvent,\n} from \"./interfaces.js\";\nimport { createHttpHeaders } from \"./httpHeaders.js\";\nimport { RestError } from \"./restError.js\";\nimport type { IncomingMessage } from \"node:http\";\nimport { logger } from \"./log.js\";\nimport { Sanitizer } from \"./util/sanitizer.js\";\n\nconst DEFAULT_TLS_SETTINGS = {};\n\nfunction isReadableStream(body: any): body is NodeJS.ReadableStream {\n return body && typeof body.pipe === \"function\";\n}\n\nfunction isStreamComplete(stream: NodeJS.ReadableStream): Promise<void> {\n if (stream.readable === false) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n const handler = (): void => {\n resolve();\n stream.removeListener(\"close\", handler);\n stream.removeListener(\"end\", handler);\n stream.removeListener(\"error\", handler);\n };\n\n stream.on(\"close\", handler);\n stream.on(\"end\", handler);\n stream.on(\"error\", handler);\n });\n}\n\nfunction isArrayBuffer(body: any): body is ArrayBuffer | ArrayBufferView {\n return body && typeof body.byteLength === \"number\";\n}\n\nclass ReportTransform extends Transform {\n private loadedBytes = 0;\n private progressCallback: (progress: TransferProgressEvent) => void;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n _transform(chunk: string | Buffer, _encoding: string, callback: Function): void {\n this.push(chunk);\n this.loadedBytes += chunk.length;\n try {\n this.progressCallback({ loadedBytes: this.loadedBytes });\n callback();\n } catch (e: any) {\n callback(e);\n }\n }\n\n constructor(progressCallback: (progress: TransferProgressEvent) => void) {\n super();\n this.progressCallback = progressCallback;\n }\n}\n\n/**\n * A HttpClient implementation that uses Node's \"https\" module to send HTTPS requests.\n * @internal\n */\nclass NodeHttpClient implements HttpClient {\n private cachedHttpAgent?: http.Agent;\n private cachedHttpsAgents: WeakMap<TlsSettings, https.Agent> = new WeakMap();\n\n /**\n * Makes a request over an underlying transport layer and returns the response.\n * @param request - The request to be made.\n */\n public async sendRequest(request: PipelineRequest): Promise<PipelineResponse> {\n const abortController = new AbortController();\n let abortListener: ((event: any) => void) | undefined;\n if (request.abortSignal) {\n if (request.abortSignal.aborted) {\n throw new AbortError(\"The operation was aborted. Request has already been canceled.\");\n }\n\n abortListener = (event: Event) => {\n if (event.type === \"abort\") {\n abortController.abort();\n }\n };\n request.abortSignal.addEventListener(\"abort\", abortListener);\n }\n\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n if (request.timeout > 0) {\n timeoutId = setTimeout(() => {\n const sanitizer = new Sanitizer();\n logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`);\n abortController.abort();\n }, request.timeout);\n }\n\n const acceptEncoding = request.headers.get(\"Accept-Encoding\");\n const shouldDecompress =\n acceptEncoding?.includes(\"gzip\") || acceptEncoding?.includes(\"deflate\");\n\n let body = typeof request.body === \"function\" ? request.body() : request.body;\n if (body && !request.headers.has(\"Content-Length\")) {\n const bodyLength = getBodyLength(body);\n if (bodyLength !== null) {\n request.headers.set(\"Content-Length\", bodyLength);\n }\n }\n\n let responseStream: NodeJS.ReadableStream | undefined;\n try {\n if (body && request.onUploadProgress) {\n const onUploadProgress = request.onUploadProgress;\n const uploadReportStream = new ReportTransform(onUploadProgress);\n uploadReportStream.on(\"error\", (e) => {\n logger.error(\"Error in upload progress\", e);\n });\n if (isReadableStream(body)) {\n body.pipe(uploadReportStream);\n } else {\n uploadReportStream.end(body);\n }\n\n body = uploadReportStream;\n }\n\n const res = await this.makeRequest(request, abortController, body);\n\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n }\n\n const headers = getResponseHeaders(res);\n\n const status = res.statusCode ?? 0;\n const response: PipelineResponse = {\n status,\n headers,\n request,\n };\n\n // Responses to HEAD must not have a body.\n // If they do return a body, that body must be ignored.\n if (request.method === \"HEAD\") {\n // call resume() and not destroy() to avoid closing the socket\n // and losing keep alive\n res.resume();\n return response;\n }\n\n responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res;\n\n const onDownloadProgress = request.onDownloadProgress;\n if (onDownloadProgress) {\n const downloadReportStream = new ReportTransform(onDownloadProgress);\n downloadReportStream.on(\"error\", (e) => {\n logger.error(\"Error in download progress\", e);\n });\n responseStream.pipe(downloadReportStream);\n responseStream = downloadReportStream;\n }\n\n if (\n // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code\n request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) ||\n request.streamResponseStatusCodes?.has(response.status)\n ) {\n response.readableStreamBody = responseStream;\n } else {\n response.bodyAsText = await streamToText(responseStream);\n }\n\n return response;\n } finally {\n // clean up event listener\n if (request.abortSignal && abortListener) {\n let uploadStreamDone = Promise.resolve();\n if (isReadableStream(body)) {\n uploadStreamDone = isStreamComplete(body);\n }\n let downloadStreamDone = Promise.resolve();\n if (isReadableStream(responseStream)) {\n downloadStreamDone = isStreamComplete(responseStream);\n }\n Promise.all([uploadStreamDone, downloadStreamDone])\n .then(() => {\n // eslint-disable-next-line promise/always-return\n if (abortListener) {\n request.abortSignal?.removeEventListener(\"abort\", abortListener);\n }\n })\n .catch((e) => {\n logger.warning(\"Error when cleaning up abortListener on httpRequest\", e);\n });\n }\n }\n }\n\n private makeRequest(\n request: PipelineRequest,\n abortController: AbortController,\n body?: RequestBodyType,\n ): Promise<http.IncomingMessage> {\n const url = new URL(request.url);\n\n const isInsecure = url.protocol !== \"https:\";\n\n if (isInsecure && !request.allowInsecureConnection) {\n throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`);\n }\n\n const agent = (request.agent as http.Agent) ?? this.getOrCreateAgent(request, isInsecure);\n const options: http.RequestOptions = {\n agent,\n hostname: url.hostname,\n path: `${url.pathname}${url.search}`,\n port: url.port,\n method: request.method,\n headers: request.headers.toJSON({ preserveCase: true }),\n };\n\n return new Promise<http.IncomingMessage>((resolve, reject) => {\n const req = isInsecure ? http.request(options, resolve) : https.request(options, resolve);\n\n req.once(\"error\", (err: Error & { code?: string }) => {\n reject(\n new RestError(err.message, { code: err.code ?? RestError.REQUEST_SEND_ERROR, request }),\n );\n });\n\n abortController.signal.addEventListener(\"abort\", () => {\n const abortError = new AbortError(\n \"The operation was aborted. Rejecting from abort signal callback while making request.\",\n );\n req.destroy(abortError);\n reject(abortError);\n });\n if (body && isReadableStream(body)) {\n body.pipe(req);\n } else if (body) {\n if (typeof body === \"string\" || Buffer.isBuffer(body)) {\n req.end(body);\n } else if (isArrayBuffer(body)) {\n req.end(ArrayBuffer.isView(body) ? Buffer.from(body.buffer) : Buffer.from(body));\n } else {\n logger.error(\"Unrecognized body type\", body);\n reject(new RestError(\"Unrecognized body type\"));\n }\n } else {\n // streams don't like \"undefined\" being passed as data\n req.end();\n }\n });\n }\n\n private getOrCreateAgent(request: PipelineRequest, isInsecure: boolean): http.Agent {\n const disableKeepAlive = request.disableKeepAlive;\n\n // Handle Insecure requests first\n if (isInsecure) {\n if (disableKeepAlive) {\n // keepAlive:false is the default so we don't need a custom Agent\n return http.globalAgent;\n }\n\n if (!this.cachedHttpAgent) {\n // If there is no cached agent create a new one and cache it.\n this.cachedHttpAgent = new http.Agent({ keepAlive: true });\n }\n return this.cachedHttpAgent;\n } else {\n if (disableKeepAlive && !request.tlsSettings) {\n // When there are no tlsSettings and keepAlive is false\n // we don't need a custom agent\n return https.globalAgent;\n }\n\n // We use the tlsSettings to index cached clients\n const tlsSettings = request.tlsSettings ?? DEFAULT_TLS_SETTINGS;\n\n // Get the cached agent or create a new one with the\n // provided values for keepAlive and tlsSettings\n let agent = this.cachedHttpsAgents.get(tlsSettings);\n\n if (agent && agent.options.keepAlive === !disableKeepAlive) {\n return agent;\n }\n\n logger.info(\"No cached TLS Agent exist, creating a new Agent\");\n agent = new https.Agent({\n // keepAlive is true if disableKeepAlive is false.\n keepAlive: !disableKeepAlive,\n // Since we are spreading, if no tslSettings were provided, nothing is added to the agent options.\n ...tlsSettings,\n });\n\n this.cachedHttpsAgents.set(tlsSettings, agent);\n return agent;\n }\n }\n}\n\nfunction getResponseHeaders(res: IncomingMessage): HttpHeaders {\n const headers = createHttpHeaders();\n for (const header of Object.keys(res.headers)) {\n const value = res.headers[header];\n if (Array.isArray(value)) {\n if (value.length > 0) {\n headers.set(header, value[0]);\n }\n } else if (value) {\n headers.set(header, value);\n }\n }\n return headers;\n}\n\nfunction getDecodedResponseStream(\n stream: IncomingMessage,\n headers: HttpHeaders,\n): NodeJS.ReadableStream {\n const contentEncoding = headers.get(\"Content-Encoding\");\n if (contentEncoding === \"gzip\") {\n const unzip = zlib.createGunzip();\n stream.pipe(unzip);\n return unzip;\n } else if (contentEncoding === \"deflate\") {\n const inflate = zlib.createInflate();\n stream.pipe(inflate);\n return inflate;\n }\n\n return stream;\n}\n\nfunction streamToText(stream: NodeJS.ReadableStream): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const buffer: Buffer[] = [];\n\n stream.on(\"data\", (chunk) => {\n if (Buffer.isBuffer(chunk)) {\n buffer.push(chunk);\n } else {\n buffer.push(Buffer.from(chunk));\n }\n });\n stream.on(\"end\", () => {\n resolve(Buffer.concat(buffer).toString(\"utf8\"));\n });\n stream.on(\"error\", (e) => {\n if (e && e?.name === \"AbortError\") {\n reject(e);\n } else {\n reject(\n new RestError(`Error reading response as text: ${e.message}`, {\n code: RestError.PARSE_ERROR,\n }),\n );\n }\n });\n });\n}\n\n/** @internal */\nexport function getBodyLength(body: RequestBodyType): number | null {\n if (!body) {\n return 0;\n } else if (Buffer.isBuffer(body)) {\n return body.length;\n } else if (isReadableStream(body)) {\n return null;\n } else if (isArrayBuffer(body)) {\n return body.byteLength;\n } else if (typeof body === \"string\") {\n return Buffer.from(body).length;\n } else {\n return null;\n }\n}\n\n/**\n * Create a new HttpClient instance for the NodeJS environment.\n * @internal\n */\nexport function createNodeHttpClient(): HttpClient {\n return new NodeHttpClient();\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare const proxyPolicyName = "proxyPolicy";
|
|
2
|
-
export declare function getDefaultProxySettings(): never;
|
|
3
|
-
/**
|
|
4
|
-
* proxyPolicy is not supported in the browser and attempting
|
|
5
|
-
* to use it will raise an error.
|
|
6
|
-
*/
|
|
7
|
-
export declare function proxyPolicy(): never;
|
|
8
|
-
/**
|
|
9
|
-
* A function to reset the cached agents.
|
|
10
|
-
* proxyPolicy is not supported in the browser and attempting
|
|
11
|
-
* to use it will raise an error.
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare function resetCachedProxyAgents(): never;
|
|
15
|
-
//# sourceMappingURL=proxyPolicy.common.d.ts.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.proxyPolicyName = void 0;
|
|
6
|
-
exports.getDefaultProxySettings = getDefaultProxySettings;
|
|
7
|
-
exports.proxyPolicy = proxyPolicy;
|
|
8
|
-
exports.resetCachedProxyAgents = resetCachedProxyAgents;
|
|
9
|
-
exports.proxyPolicyName = "proxyPolicy";
|
|
10
|
-
const errorMessage = "proxyPolicy is not supported in browser environment";
|
|
11
|
-
function getDefaultProxySettings() {
|
|
12
|
-
throw new Error(errorMessage);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* proxyPolicy is not supported in the browser and attempting
|
|
16
|
-
* to use it will raise an error.
|
|
17
|
-
*/
|
|
18
|
-
function proxyPolicy() {
|
|
19
|
-
throw new Error(errorMessage);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* A function to reset the cached agents.
|
|
23
|
-
* proxyPolicy is not supported in the browser and attempting
|
|
24
|
-
* to use it will raise an error.
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
function resetCachedProxyAgents() {
|
|
28
|
-
throw new Error(errorMessage);
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=proxyPolicy.common.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxyPolicy.common.js","sourceRoot":"","sources":["../../../src/policies/proxyPolicy.common.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAKlC,0DAEC;AAMD,kCAEC;AAQD,wDAEC;AAvBY,QAAA,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,YAAY,GAAG,qDAAqD,CAAC;AAE3E,SAAgB,uBAAuB;IACrC,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AAChC,CAAC;AAED;;;GAGG;AACH,SAAgB,WAAW;IACzB,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB;IACpC,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AAChC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const proxyPolicyName = \"proxyPolicy\";\nconst errorMessage = \"proxyPolicy is not supported in browser environment\";\n\nexport function getDefaultProxySettings(): never {\n throw new Error(errorMessage);\n}\n\n/**\n * proxyPolicy is not supported in the browser and attempting\n * to use it will raise an error.\n */\nexport function proxyPolicy(): never {\n throw new Error(errorMessage);\n}\n\n/**\n * A function to reset the cached agents.\n * proxyPolicy is not supported in the browser and attempting\n * to use it will raise an error.\n * @internal\n */\nexport function resetCachedProxyAgents(): never {\n throw new Error(errorMessage);\n}\n"]}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { PipelineResponse } from "../interfaces.js";
|
|
2
|
-
import type { RestError } from "../restError.js";
|
|
3
|
-
import type { RetryStrategy } from "./retryStrategy.js";
|
|
4
|
-
/**
|
|
5
|
-
* A retry strategy that retries with an exponentially increasing delay in these two cases:
|
|
6
|
-
* - When there are errors in the underlying transport layer (e.g. DNS lookup failures).
|
|
7
|
-
* - Or otherwise if the outgoing request fails (408, greater or equal than 500, except for 501 and 505).
|
|
8
|
-
*/
|
|
9
|
-
export declare function exponentialRetryStrategy(options?: {
|
|
10
|
-
/**
|
|
11
|
-
* The amount of delay in milliseconds between retry attempts. Defaults to 1000
|
|
12
|
-
* (1 second.) The delay increases exponentially with each retry up to a maximum
|
|
13
|
-
* specified by maxRetryDelayInMs.
|
|
14
|
-
*/
|
|
15
|
-
retryDelayInMs?: number;
|
|
16
|
-
/**
|
|
17
|
-
* The maximum delay in milliseconds allowed before retrying an operation. Defaults
|
|
18
|
-
* to 64000 (64 seconds).
|
|
19
|
-
*/
|
|
20
|
-
maxRetryDelayInMs?: number;
|
|
21
|
-
/**
|
|
22
|
-
* If true it won't retry if it received a system error.
|
|
23
|
-
*/
|
|
24
|
-
ignoreSystemErrors?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* If true it won't retry if it received a non-fatal HTTP status code.
|
|
27
|
-
*/
|
|
28
|
-
ignoreHttpStatusCodes?: boolean;
|
|
29
|
-
}): RetryStrategy;
|
|
30
|
-
/**
|
|
31
|
-
* A response is a retry response if it has status codes:
|
|
32
|
-
* - 408, or
|
|
33
|
-
* - Greater or equal than 500, except for 501 and 505.
|
|
34
|
-
*/
|
|
35
|
-
export declare function isExponentialRetryResponse(response?: PipelineResponse): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Determines whether an error from a pipeline response was triggered in the network layer.
|
|
38
|
-
*/
|
|
39
|
-
export declare function isSystemError(err?: RestError): boolean;
|
|
40
|
-
//# sourceMappingURL=exponentialRetryStrategy.d.ts.map
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.exponentialRetryStrategy = exponentialRetryStrategy;
|
|
6
|
-
exports.isExponentialRetryResponse = isExponentialRetryResponse;
|
|
7
|
-
exports.isSystemError = isSystemError;
|
|
8
|
-
const core_util_1 = require("@azure/core-util");
|
|
9
|
-
const throttlingRetryStrategy_js_1 = require("./throttlingRetryStrategy.js");
|
|
10
|
-
// intervals are in milliseconds
|
|
11
|
-
const DEFAULT_CLIENT_RETRY_INTERVAL = 1000;
|
|
12
|
-
const DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 64;
|
|
13
|
-
/**
|
|
14
|
-
* A retry strategy that retries with an exponentially increasing delay in these two cases:
|
|
15
|
-
* - When there are errors in the underlying transport layer (e.g. DNS lookup failures).
|
|
16
|
-
* - Or otherwise if the outgoing request fails (408, greater or equal than 500, except for 501 and 505).
|
|
17
|
-
*/
|
|
18
|
-
function exponentialRetryStrategy(options = {}) {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL;
|
|
21
|
-
const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL;
|
|
22
|
-
return {
|
|
23
|
-
name: "exponentialRetryStrategy",
|
|
24
|
-
retry({ retryCount, response, responseError }) {
|
|
25
|
-
const matchedSystemError = isSystemError(responseError);
|
|
26
|
-
const ignoreSystemErrors = matchedSystemError && options.ignoreSystemErrors;
|
|
27
|
-
const isExponential = isExponentialRetryResponse(response);
|
|
28
|
-
const ignoreExponentialResponse = isExponential && options.ignoreHttpStatusCodes;
|
|
29
|
-
const unknownResponse = response && ((0, throttlingRetryStrategy_js_1.isThrottlingRetryResponse)(response) || !isExponential);
|
|
30
|
-
if (unknownResponse || ignoreExponentialResponse || ignoreSystemErrors) {
|
|
31
|
-
return { skipStrategy: true };
|
|
32
|
-
}
|
|
33
|
-
if (responseError && !matchedSystemError && !isExponential) {
|
|
34
|
-
return { errorToThrow: responseError };
|
|
35
|
-
}
|
|
36
|
-
return (0, core_util_1.calculateRetryDelay)(retryCount, {
|
|
37
|
-
retryDelayInMs: retryInterval,
|
|
38
|
-
maxRetryDelayInMs: maxRetryInterval,
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* A response is a retry response if it has status codes:
|
|
45
|
-
* - 408, or
|
|
46
|
-
* - Greater or equal than 500, except for 501 and 505.
|
|
47
|
-
*/
|
|
48
|
-
function isExponentialRetryResponse(response) {
|
|
49
|
-
return Boolean(response &&
|
|
50
|
-
response.status !== undefined &&
|
|
51
|
-
(response.status >= 500 || response.status === 408) &&
|
|
52
|
-
response.status !== 501 &&
|
|
53
|
-
response.status !== 505);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Determines whether an error from a pipeline response was triggered in the network layer.
|
|
57
|
-
*/
|
|
58
|
-
function isSystemError(err) {
|
|
59
|
-
if (!err) {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
return (err.code === "ETIMEDOUT" ||
|
|
63
|
-
err.code === "ESOCKETTIMEDOUT" ||
|
|
64
|
-
err.code === "ECONNREFUSED" ||
|
|
65
|
-
err.code === "ECONNRESET" ||
|
|
66
|
-
err.code === "ENOENT" ||
|
|
67
|
-
err.code === "ENOTFOUND");
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=exponentialRetryStrategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exponentialRetryStrategy.js","sourceRoot":"","sources":["../../../src/retryStrategies/exponentialRetryStrategy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAiBlC,4DAqDC;AAOD,gEAQC;AAKD,sCAYC;AAlGD,gDAAuD;AAEvD,6EAAyE;AAEzE,gCAAgC;AAChC,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAC3C,MAAM,iCAAiC,GAAG,IAAI,GAAG,EAAE,CAAC;AAEpD;;;;GAIG;AACH,SAAgB,wBAAwB,CACtC,UAuBI,EAAE;;IAEN,MAAM,aAAa,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,6BAA6B,CAAC;IAC9E,MAAM,gBAAgB,GAAG,MAAA,OAAO,CAAC,iBAAiB,mCAAI,iCAAiC,CAAC;IAExF,OAAO;QACL,IAAI,EAAE,0BAA0B;QAChC,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE;YAC3C,MAAM,kBAAkB,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;YACxD,MAAM,kBAAkB,GAAG,kBAAkB,IAAI,OAAO,CAAC,kBAAkB,CAAC;YAE5E,MAAM,aAAa,GAAG,0BAA0B,CAAC,QAAQ,CAAC,CAAC;YAC3D,MAAM,yBAAyB,GAAG,aAAa,IAAI,OAAO,CAAC,qBAAqB,C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T License.\n\nimport type { PipelineResponse } from \"../interfaces.js\";\nimport type { RestError } from \"../restError.js\";\nimport { calculateRetryDelay } from \"@azure/core-util\";\nimport type { RetryStrategy } from \"./retryStrategy.js\";\nimport { isThrottlingRetryResponse } from \"./throttlingRetryStrategy.js\";\n\n// intervals are in milliseconds\nconst DEFAULT_CLIENT_RETRY_INTERVAL = 1000;\nconst DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 64;\n\n/**\n * A retry strategy that retries with an exponentially increasing delay in these two cases:\n * - When there are errors in the underlying transport layer (e.g. DNS lookup failures).\n * - Or otherwise if the outgoing request fails (408, greater or equal than 500, except for 501 and 505).\n */\nexport function exponentialRetryStrategy(\n options: {\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 * If true it won't retry if it received a system error.\n */\n ignoreSystemErrors?: boolean;\n\n /**\n * If true it won't retry if it received a non-fatal HTTP status code.\n */\n ignoreHttpStatusCodes?: boolean;\n } = {},\n): RetryStrategy {\n const retryInterval = options.retryDelayInMs ?? DEFAULT_CLIENT_RETRY_INTERVAL;\n const maxRetryInterval = options.maxRetryDelayInMs ?? DEFAULT_CLIENT_MAX_RETRY_INTERVAL;\n\n return {\n name: \"exponentialRetryStrategy\",\n retry({ retryCount, response, responseError }) {\n const matchedSystemError = isSystemError(responseError);\n const ignoreSystemErrors = matchedSystemError && options.ignoreSystemErrors;\n\n const isExponential = isExponentialRetryResponse(response);\n const ignoreExponentialResponse = isExponential && options.ignoreHttpStatusCodes;\n const unknownResponse = response && (isThrottlingRetryResponse(response) || !isExponential);\n\n if (unknownResponse || ignoreExponentialResponse || ignoreSystemErrors) {\n return { skipStrategy: true };\n }\n\n if (responseError && !matchedSystemError && !isExponential) {\n return { errorToThrow: responseError };\n }\n\n return calculateRetryDelay(retryCount, {\n retryDelayInMs: retryInterval,\n maxRetryDelayInMs: maxRetryInterval,\n });\n },\n };\n}\n\n/**\n * A response is a retry response if it has status codes:\n * - 408, or\n * - Greater or equal than 500, except for 501 and 505.\n */\nexport function isExponentialRetryResponse(response?: PipelineResponse): boolean {\n return Boolean(\n response &&\n response.status !== undefined &&\n (response.status >= 500 || response.status === 408) &&\n response.status !== 501 &&\n response.status !== 505,\n );\n}\n\n/**\n * Determines whether an error from a pipeline response was triggered in the network layer.\n */\nexport function isSystemError(err?: RestError): boolean {\n if (!err) {\n return false;\n }\n return (\n err.code === \"ETIMEDOUT\" ||\n err.code === \"ESOCKETTIMEDOUT\" ||\n err.code === \"ECONNREFUSED\" ||\n err.code === \"ECONNRESET\" ||\n err.code === \"ENOENT\" ||\n err.code === \"ENOTFOUND\"\n );\n}\n"]}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { AzureLogger } from "@azure/logger";
|
|
2
|
-
import type { PipelineResponse } from "../interfaces.js";
|
|
3
|
-
import type { RestError } from "../restError.js";
|
|
4
|
-
/**
|
|
5
|
-
* Information provided to the retry strategy about the current progress of the retry policy.
|
|
6
|
-
*/
|
|
7
|
-
export interface RetryInformation {
|
|
8
|
-
/**
|
|
9
|
-
* A {@link PipelineResponse}, if the last retry attempt succeeded.
|
|
10
|
-
*/
|
|
11
|
-
response?: PipelineResponse;
|
|
12
|
-
/**
|
|
13
|
-
* A {@link RestError}, if the last retry attempt failed.
|
|
14
|
-
*/
|
|
15
|
-
responseError?: RestError;
|
|
16
|
-
/**
|
|
17
|
-
* Total number of retries so far.
|
|
18
|
-
*/
|
|
19
|
-
retryCount: number;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Properties that can modify the behavior of the retry policy.
|
|
23
|
-
*/
|
|
24
|
-
export interface RetryModifiers {
|
|
25
|
-
/**
|
|
26
|
-
* If true, allows skipping the current strategy from running on the retry policy.
|
|
27
|
-
*/
|
|
28
|
-
skipStrategy?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Indicates to retry against this URL.
|
|
31
|
-
*/
|
|
32
|
-
redirectTo?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Controls whether to retry in a given number of milliseconds.
|
|
35
|
-
* If provided, a new retry will be attempted.
|
|
36
|
-
*/
|
|
37
|
-
retryAfterInMs?: number;
|
|
38
|
-
/**
|
|
39
|
-
* Indicates to throw this error instead of retrying.
|
|
40
|
-
*/
|
|
41
|
-
errorToThrow?: RestError;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* A retry strategy is intended to define whether to retry or not, and how to retry.
|
|
45
|
-
*/
|
|
46
|
-
export interface RetryStrategy {
|
|
47
|
-
/**
|
|
48
|
-
* Name of the retry strategy. Used for logging.
|
|
49
|
-
*/
|
|
50
|
-
name: string;
|
|
51
|
-
/**
|
|
52
|
-
* Logger. If it's not provided, a default logger for all retry strategies is used.
|
|
53
|
-
*/
|
|
54
|
-
logger?: AzureLogger;
|
|
55
|
-
/**
|
|
56
|
-
* Function that determines how to proceed with the subsequent requests.
|
|
57
|
-
* @param state - Retry state
|
|
58
|
-
*/
|
|
59
|
-
retry(state: RetryInformation): RetryModifiers;
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=retryStrategy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retryStrategy.js","sourceRoot":"","sources":["../../../src/retryStrategies/retryStrategy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AzureLogger } from \"@azure/logger\";\nimport type { PipelineResponse } from \"../interfaces.js\";\nimport type { RestError } from \"../restError.js\";\n\n/**\n * Information provided to the retry strategy about the current progress of the retry policy.\n */\nexport interface RetryInformation {\n /**\n * A {@link PipelineResponse}, if the last retry attempt succeeded.\n */\n response?: PipelineResponse;\n /**\n * A {@link RestError}, if the last retry attempt failed.\n */\n responseError?: RestError;\n /**\n * Total number of retries so far.\n */\n retryCount: number;\n}\n\n/**\n * Properties that can modify the behavior of the retry policy.\n */\nexport interface RetryModifiers {\n /**\n * If true, allows skipping the current strategy from running on the retry policy.\n */\n skipStrategy?: boolean;\n /**\n * Indicates to retry against this URL.\n */\n redirectTo?: string;\n /**\n * Controls whether to retry in a given number of milliseconds.\n * If provided, a new retry will be attempted.\n */\n retryAfterInMs?: number;\n /**\n * Indicates to throw this error instead of retrying.\n */\n errorToThrow?: RestError;\n}\n\n/**\n * A retry strategy is intended to define whether to retry or not, and how to retry.\n */\nexport interface RetryStrategy {\n /**\n * Name of the retry strategy. Used for logging.\n */\n name: string;\n /**\n * Logger. If it's not provided, a default logger for all retry strategies is used.\n */\n logger?: AzureLogger;\n /**\n * Function that determines how to proceed with the subsequent requests.\n * @param state - Retry state\n */\n retry(state: RetryInformation): RetryModifiers;\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { PipelineResponse } from "../index.js";
|
|
2
|
-
import type { RetryStrategy } from "./retryStrategy.js";
|
|
3
|
-
/**
|
|
4
|
-
* A response is a retry response if it has a throttling status code (429 or 503),
|
|
5
|
-
* as long as one of the [ "Retry-After" or "retry-after-ms" or "x-ms-retry-after-ms" ] headers has a valid value.
|
|
6
|
-
*/
|
|
7
|
-
export declare function isThrottlingRetryResponse(response?: PipelineResponse): boolean;
|
|
8
|
-
export declare function throttlingRetryStrategy(): RetryStrategy;
|
|
9
|
-
//# sourceMappingURL=throttlingRetryStrategy.d.ts.map
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.isThrottlingRetryResponse = isThrottlingRetryResponse;
|
|
6
|
-
exports.throttlingRetryStrategy = throttlingRetryStrategy;
|
|
7
|
-
const helpers_js_1 = require("../util/helpers.js");
|
|
8
|
-
/**
|
|
9
|
-
* The header that comes back from Azure services representing
|
|
10
|
-
* the amount of time (minimum) to wait to retry (in seconds or timestamp after which we can retry).
|
|
11
|
-
*/
|
|
12
|
-
const RetryAfterHeader = "Retry-After";
|
|
13
|
-
/**
|
|
14
|
-
* The headers that come back from Azure services representing
|
|
15
|
-
* the amount of time (minimum) to wait to retry.
|
|
16
|
-
*
|
|
17
|
-
* "retry-after-ms", "x-ms-retry-after-ms" : milliseconds
|
|
18
|
-
* "Retry-After" : seconds or timestamp
|
|
19
|
-
*/
|
|
20
|
-
const AllRetryAfterHeaders = ["retry-after-ms", "x-ms-retry-after-ms", RetryAfterHeader];
|
|
21
|
-
/**
|
|
22
|
-
* A response is a throttling retry response if it has a throttling status code (429 or 503),
|
|
23
|
-
* as long as one of the [ "Retry-After" or "retry-after-ms" or "x-ms-retry-after-ms" ] headers has a valid value.
|
|
24
|
-
*
|
|
25
|
-
* Returns the `retryAfterInMs` value if the response is a throttling retry response.
|
|
26
|
-
* If not throttling retry response, returns `undefined`.
|
|
27
|
-
*
|
|
28
|
-
* @internal
|
|
29
|
-
*/
|
|
30
|
-
function getRetryAfterInMs(response) {
|
|
31
|
-
if (!(response && [429, 503].includes(response.status)))
|
|
32
|
-
return undefined;
|
|
33
|
-
try {
|
|
34
|
-
// Headers: "retry-after-ms", "x-ms-retry-after-ms", "Retry-After"
|
|
35
|
-
for (const header of AllRetryAfterHeaders) {
|
|
36
|
-
const retryAfterValue = (0, helpers_js_1.parseHeaderValueAsNumber)(response, header);
|
|
37
|
-
if (retryAfterValue === 0 || retryAfterValue) {
|
|
38
|
-
// "Retry-After" header ==> seconds
|
|
39
|
-
// "retry-after-ms", "x-ms-retry-after-ms" headers ==> milli-seconds
|
|
40
|
-
const multiplyingFactor = header === RetryAfterHeader ? 1000 : 1;
|
|
41
|
-
return retryAfterValue * multiplyingFactor; // in milli-seconds
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// RetryAfterHeader ("Retry-After") has a special case where it might be formatted as a date instead of a number of seconds
|
|
45
|
-
const retryAfterHeader = response.headers.get(RetryAfterHeader);
|
|
46
|
-
if (!retryAfterHeader)
|
|
47
|
-
return;
|
|
48
|
-
const date = Date.parse(retryAfterHeader);
|
|
49
|
-
const diff = date - Date.now();
|
|
50
|
-
// negative diff would mean a date in the past, so retry asap with 0 milliseconds
|
|
51
|
-
return Number.isFinite(diff) ? Math.max(0, diff) : undefined;
|
|
52
|
-
}
|
|
53
|
-
catch (_a) {
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* A response is a retry response if it has a throttling status code (429 or 503),
|
|
59
|
-
* as long as one of the [ "Retry-After" or "retry-after-ms" or "x-ms-retry-after-ms" ] headers has a valid value.
|
|
60
|
-
*/
|
|
61
|
-
function isThrottlingRetryResponse(response) {
|
|
62
|
-
return Number.isFinite(getRetryAfterInMs(response));
|
|
63
|
-
}
|
|
64
|
-
function throttlingRetryStrategy() {
|
|
65
|
-
return {
|
|
66
|
-
name: "throttlingRetryStrategy",
|
|
67
|
-
retry({ response }) {
|
|
68
|
-
const retryAfterInMs = getRetryAfterInMs(response);
|
|
69
|
-
if (!Number.isFinite(retryAfterInMs)) {
|
|
70
|
-
return { skipStrategy: true };
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
retryAfterInMs,
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=throttlingRetryStrategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"throttlingRetryStrategy.js","sourceRoot":"","sources":["../../../src/retryStrategies/throttlingRetryStrategy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA4DlC,8DAEC;AAED,0DAaC;AA1ED,mDAA8D;AAG9D;;;GAGG;AACH,M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AS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,QAA2B;IACnE,OAAO,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,SAAgB,uBAAuB;IACrC,OAAO;QACL,IAAI,EAAE,yBAAyB;QAC/B,KAAK,CAAC,EAAE,QAAQ,EAAE;YAChB,MAAM,cAAc,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;YACnD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;gBACrC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;YAChC,CAAC;YACD,OAAO;gBACL,cAAc;aACf,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelineResponse } from \"../index.js\";\nimport { parseHeaderValueAsNumber } from \"../util/helpers.js\";\nimport type { RetryStrategy } from \"./retryStrategy.js\";\n\n/**\n * The header that comes back from Azure services representing\n * the amount of time (minimum) to wait to retry (in seconds or timestamp after which we can retry).\n */\nconst RetryAfterHeader = \"Retry-After\";\n/**\n * The headers that come back from Azure services representing\n * the amount of time (minimum) to wait to retry.\n *\n * \"retry-after-ms\", \"x-ms-retry-after-ms\" : milliseconds\n * \"Retry-After\" : seconds or timestamp\n */\nconst AllRetryAfterHeaders: string[] = [\"retry-after-ms\", \"x-ms-retry-after-ms\", RetryAfterHeader];\n\n/**\n * A response is a throttling retry response if it has a throttling status code (429 or 503),\n * as long as one of the [ \"Retry-After\" or \"retry-after-ms\" or \"x-ms-retry-after-ms\" ] headers has a valid value.\n *\n * Returns the `retryAfterInMs` value if the response is a throttling retry response.\n * If not throttling retry response, returns `undefined`.\n *\n * @internal\n */\nfunction getRetryAfterInMs(response?: PipelineResponse): number | undefined {\n if (!(response && [429, 503].includes(response.status))) return undefined;\n try {\n // Headers: \"retry-after-ms\", \"x-ms-retry-after-ms\", \"Retry-After\"\n for (const header of AllRetryAfterHeaders) {\n const retryAfterValue = parseHeaderValueAsNumber(response, header);\n if (retryAfterValue === 0 || retryAfterValue) {\n // \"Retry-After\" header ==> seconds\n // \"retry-after-ms\", \"x-ms-retry-after-ms\" headers ==> milli-seconds\n const multiplyingFactor = header === RetryAfterHeader ? 1000 : 1;\n return retryAfterValue * multiplyingFactor; // in milli-seconds\n }\n }\n\n // RetryAfterHeader (\"Retry-After\") has a special case where it might be formatted as a date instead of a number of seconds\n const retryAfterHeader = response.headers.get(RetryAfterHeader);\n if (!retryAfterHeader) return;\n\n const date = Date.parse(retryAfterHeader);\n const diff = date - Date.now();\n // negative diff would mean a date in the past, so retry asap with 0 milliseconds\n return Number.isFinite(diff) ? Math.max(0, diff) : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * A response is a retry response if it has a throttling status code (429 or 503),\n * as long as one of the [ \"Retry-After\" or \"retry-after-ms\" or \"x-ms-retry-after-ms\" ] headers has a valid value.\n */\nexport function isThrottlingRetryResponse(response?: PipelineResponse): boolean {\n return Number.isFinite(getRetryAfterInMs(response));\n}\n\nexport function throttlingRetryStrategy(): RetryStrategy {\n return {\n name: \"throttlingRetryStrategy\",\n retry({ response }) {\n const retryAfterInMs = getRetryAfterInMs(response);\n if (!Number.isFinite(retryAfterInMs)) {\n return { skipStrategy: true };\n }\n return {\n retryAfterInMs,\n };\n },\n };\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Accepted binary data types for concat
|
|
3
|
-
*
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
type ConcatSource = ReadableStream<Uint8Array> | Blob | Uint8Array;
|
|
7
|
-
/**
|
|
8
|
-
* Utility function that concatenates a set of binary inputs into one combined output.
|
|
9
|
-
*
|
|
10
|
-
* @param sources - array of sources for the concatenation
|
|
11
|
-
* @returns - in Node, a (() =\> NodeJS.ReadableStream) which, when read, produces a concatenation of all the inputs.
|
|
12
|
-
* In browser, returns a `Blob` representing all the concatenated inputs.
|
|
13
|
-
*
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
export declare function concat(sources: (ConcatSource | (() => ConcatSource))[]): Promise<(() => NodeJS.ReadableStream) | Blob>;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=concat.common.d.ts.map
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.concat = concat;
|
|
6
|
-
const file_js_1 = require("./file.js");
|
|
7
|
-
const typeGuards_js_1 = require("./typeGuards.js");
|
|
8
|
-
/**
|
|
9
|
-
* Drain the content of the given ReadableStream into a Blob.
|
|
10
|
-
* The blob's content may end up in memory or on disk dependent on size.
|
|
11
|
-
*/
|
|
12
|
-
function drain(stream) {
|
|
13
|
-
return new Response(stream).blob();
|
|
14
|
-
}
|
|
15
|
-
async function toBlobPart(source) {
|
|
16
|
-
if (source instanceof Blob || source instanceof Uint8Array) {
|
|
17
|
-
return source;
|
|
18
|
-
}
|
|
19
|
-
if ((0, typeGuards_js_1.isWebReadableStream)(source)) {
|
|
20
|
-
return drain(source);
|
|
21
|
-
}
|
|
22
|
-
// If it's not a true Blob, and it's not a Uint8Array, we can assume the source
|
|
23
|
-
// is a fake File created by createFileFromStream and we can get the original stream
|
|
24
|
-
// using getRawContent.
|
|
25
|
-
const rawContent = (0, file_js_1.getRawContent)(source);
|
|
26
|
-
// Shouldn't happen but guard for it anyway
|
|
27
|
-
if ((0, typeGuards_js_1.isNodeReadableStream)(rawContent)) {
|
|
28
|
-
throw new Error("Encountered unexpected type. In the browser, `concat` supports Web ReadableStream, Blob, Uint8Array, and files created using `createFile` only.");
|
|
29
|
-
}
|
|
30
|
-
return toBlobPart(rawContent);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Utility function that concatenates a set of binary inputs into one combined output.
|
|
34
|
-
*
|
|
35
|
-
* @param sources - array of sources for the concatenation
|
|
36
|
-
* @returns - in Node, a (() =\> NodeJS.ReadableStream) which, when read, produces a concatenation of all the inputs.
|
|
37
|
-
* In browser, returns a `Blob` representing all the concatenated inputs.
|
|
38
|
-
*
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
async function concat(sources) {
|
|
42
|
-
const parts = [];
|
|
43
|
-
for (const source of sources) {
|
|
44
|
-
parts.push(await toBlobPart(typeof source === "function" ? source() : source));
|
|
45
|
-
}
|
|
46
|
-
return new Blob(parts);
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=concat.common.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"concat.common.js","sourceRoot":"","sources":["../../../src/util/concat.common.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAuDlC,wBASC;AA9DD,uCAA0C;AAC1C,mDAA4E;AAE5E;;;GAGG;AACH,SAAS,KAAK,CAAC,MAAkC;IAC/C,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AACrC,CAAC;AAED,KAAK,UAAU,UAAU,CACvB,MAAsD;IAEtD,IAAI,MAAM,YAAY,IAAI,IAAI,MAAM,YAAY,UAAU,EAAE,CAAC;QAC3D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,IAAA,mCAAmB,EAAC,MAAM,CAAC,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,+EAA+E;IAC/E,oFAAoF;IACpF,uBAAuB;IACvB,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,MAAM,CAAC,CAAC;IAEzC,2CAA2C;IAC3C,IAAI,IAAA,oCAAoB,EAAC,UAAU,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,iJAAiJ,CAClJ,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC;AASD;;;;;;;;GAQG;AACI,KAAK,UAAU,MAAM,CAC1B,OAAgD;IAEhD,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,MAAM,UAAU,CAAC,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getRawContent } from \"./file.js\";\nimport { isNodeReadableStream, isWebReadableStream } from \"./typeGuards.js\";\n\n/**\n * Drain the content of the given ReadableStream into a Blob.\n * The blob's content may end up in memory or on disk dependent on size.\n */\nfunction drain(stream: ReadableStream<Uint8Array>): Promise<Blob> {\n return new Response(stream).blob();\n}\n\nasync function toBlobPart(\n source: ReadableStream<Uint8Array> | Blob | Uint8Array,\n): Promise<BlobPart> {\n if (source instanceof Blob || source instanceof Uint8Array) {\n return source;\n }\n\n if (isWebReadableStream(source)) {\n return drain(source);\n }\n\n // If it's not a true Blob, and it's not a Uint8Array, we can assume the source\n // is a fake File created by createFileFromStream and we can get the original stream\n // using getRawContent.\n const rawContent = getRawContent(source);\n\n // Shouldn't happen but guard for it anyway\n if (isNodeReadableStream(rawContent)) {\n throw new Error(\n \"Encountered unexpected type. In the browser, `concat` supports Web ReadableStream, Blob, Uint8Array, and files created using `createFile` only.\",\n );\n }\n\n return toBlobPart(rawContent);\n}\n\n/**\n * Accepted binary data types for concat\n *\n * @internal\n */\ntype ConcatSource = ReadableStream<Uint8Array> | Blob | Uint8Array;\n\n/**\n * Utility function that concatenates a set of binary inputs into one combined output.\n *\n * @param sources - array of sources for the concatenation\n * @returns - in Node, a (() =\\> NodeJS.ReadableStream) which, when read, produces a concatenation of all the inputs.\n * In browser, returns a `Blob` representing all the concatenated inputs.\n *\n * @internal\n */\nexport async function concat(\n sources: (ConcatSource | (() => ConcatSource))[],\n): Promise<(() => NodeJS.ReadableStream) | Blob> {\n const parts = [];\n for (const source of sources) {\n parts.push(await toBlobPart(typeof source === \"function\" ? source() : source));\n }\n\n return new Blob(parts);\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Accepted binary data types for concat
|
|
3
|
-
*
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export type ConcatSource = ReadableStream<Uint8Array> | NodeJS.ReadableStream | Uint8Array | Blob;
|
|
7
|
-
/**
|
|
8
|
-
* Utility function that concatenates a set of binary inputs into one combined output.
|
|
9
|
-
*
|
|
10
|
-
* @param sources - array of sources for the concatenation
|
|
11
|
-
* @returns - in Node, a (() =\> NodeJS.ReadableStream) which, when read, produces a concatenation of all the inputs.
|
|
12
|
-
* In browser, returns a `Blob` representing all the concatenated inputs.
|
|
13
|
-
*
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
export declare function concat(sources: (ConcatSource | (() => ConcatSource))[]): Promise<(() => NodeJS.ReadableStream) | Blob>;
|
|
17
|
-
//# sourceMappingURL=concat.d.ts.map
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.concat = concat;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
const node_stream_1 = require("node:stream");
|
|
8
|
-
const typeGuards_js_1 = require("./typeGuards.js");
|
|
9
|
-
const file_js_1 = require("./file.js");
|
|
10
|
-
function streamAsyncIterator() {
|
|
11
|
-
return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() {
|
|
12
|
-
const reader = this.getReader();
|
|
13
|
-
try {
|
|
14
|
-
while (true) {
|
|
15
|
-
const { done, value } = yield tslib_1.__await(reader.read());
|
|
16
|
-
if (done) {
|
|
17
|
-
return yield tslib_1.__await(void 0);
|
|
18
|
-
}
|
|
19
|
-
yield yield tslib_1.__await(value);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
finally {
|
|
23
|
-
reader.releaseLock();
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function makeAsyncIterable(webStream) {
|
|
28
|
-
if (!webStream[Symbol.asyncIterator]) {
|
|
29
|
-
webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream);
|
|
30
|
-
}
|
|
31
|
-
if (!webStream.values) {
|
|
32
|
-
webStream.values = streamAsyncIterator.bind(webStream);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function ensureNodeStream(stream) {
|
|
36
|
-
if (stream instanceof ReadableStream) {
|
|
37
|
-
makeAsyncIterable(stream);
|
|
38
|
-
return node_stream_1.Readable.fromWeb(stream);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
return stream;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function toStream(source) {
|
|
45
|
-
if (source instanceof Uint8Array) {
|
|
46
|
-
return node_stream_1.Readable.from(Buffer.from(source));
|
|
47
|
-
}
|
|
48
|
-
else if ((0, typeGuards_js_1.isBlob)(source)) {
|
|
49
|
-
return toStream((0, file_js_1.getRawContent)(source));
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
return ensureNodeStream(source);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Utility function that concatenates a set of binary inputs into one combined output.
|
|
57
|
-
*
|
|
58
|
-
* @param sources - array of sources for the concatenation
|
|
59
|
-
* @returns - in Node, a (() =\> NodeJS.ReadableStream) which, when read, produces a concatenation of all the inputs.
|
|
60
|
-
* In browser, returns a `Blob` representing all the concatenated inputs.
|
|
61
|
-
*
|
|
62
|
-
* @internal
|
|
63
|
-
*/
|
|
64
|
-
async function concat(sources) {
|
|
65
|
-
return function () {
|
|
66
|
-
const streams = sources.map((x) => (typeof x === "function" ? x() : x)).map(toStream);
|
|
67
|
-
return node_stream_1.Readable.from((function () {
|
|
68
|
-
return tslib_1.__asyncGenerator(this, arguments, function* () {
|
|
69
|
-
var _a, e_1, _b, _c;
|
|
70
|
-
for (const stream of streams) {
|
|
71
|
-
try {
|
|
72
|
-
for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) {
|
|
73
|
-
_c = stream_1_1.value;
|
|
74
|
-
_d = false;
|
|
75
|
-
const chunk = _c;
|
|
76
|
-
yield yield tslib_1.__await(chunk);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
80
|
-
finally {
|
|
81
|
-
try {
|
|
82
|
-
if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1));
|
|
83
|
-
}
|
|
84
|
-
finally { if (e_1) throw e_1.error; }
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
})());
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=concat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"concat.js","sourceRoot":"","sources":["../../../src/util/concat.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA0ElC,wBAgBC;;AAxFD,6CAAuC;AAEvC,mDAAyC;AACzC,uCAA0C;AAE1C,SAAgB,mBAAmB;;QAGjC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,IAAI,CAAC;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BAAgB,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;AACH,CAAC;AASD;;;;;;;;GAQG;AACI,KAAK,UAAU,MAAM,CAC1B,OAAgD;IAEhD,OAAO;QACL,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAEtF,OAAO,sBAAQ,CAAC,IAAI,CAClB,CAAC;;;gBACC,KAAK,MAAM,MAAM,IAAI,OAAkC,EAAE,CAAC;;wBACxD,KAA0B,eAAA,0BAAA,sBAAA,MAAM,CAAA,CAAA,YAAA,6FAAE,CAAC;4BAAT,sBAAM;4BAAN,WAAM;4BAArB,MAAM,KAAK,KAAA,CAAA;4BACpB,4BAAM,KAAK,CAAA,CAAC;wBACd,CAAC;;;;;;;;;gBACH,CAAC;YACH,CAAC;SAAA,CAAC,EAAE,CACL,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Readable } from \"node:stream\";\nimport type { ReadableStream as AsyncIterableReadableStream } from \"node:stream/web\";\nimport { isBlob } from \"./typeGuards.js\";\nimport { getRawContent } from \"./file.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 toStream(getRawContent(source));\n } else {\n return ensureNodeStream(source);\n }\n}\n\n/**\n * Accepted binary data types for concat\n *\n * @internal\n */\nexport type ConcatSource = ReadableStream<Uint8Array> | NodeJS.ReadableStream | Uint8Array | Blob;\n\n/**\n * Utility function that concatenates a set of binary inputs into one combined output.\n *\n * @param sources - array of sources for the concatenation\n * @returns - in Node, a (() =\\> NodeJS.ReadableStream) which, when read, produces a concatenation of all the inputs.\n * In browser, returns a `Blob` representing all the concatenated inputs.\n *\n * @internal\n */\nexport async function concat(\n sources: (ConcatSource | (() => ConcatSource))[],\n): Promise<(() => NodeJS.ReadableStream) | Blob> {\n return function () {\n const streams = sources.map((x) => (typeof x === \"function\" ? x() : x)).map(toStream);\n\n return Readable.from(\n (async function* () {\n for (const stream of streams as NodeJS.ReadableStream[]) {\n for await (const chunk of stream) {\n yield chunk;\n }\n }\n })(),\n );\n };\n}\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type AbortSignalLike } from "@azure/abort-controller";
|
|
2
|
-
import type { PipelineResponse } from "../interfaces.js";
|
|
3
|
-
/**
|
|
4
|
-
* A wrapper for setTimeout that resolves a promise after delayInMs milliseconds.
|
|
5
|
-
* @param delayInMs - The number of milliseconds to be delayed.
|
|
6
|
-
* @param value - The value to be resolved with after a timeout of t milliseconds.
|
|
7
|
-
* @param options - The options for delay - currently abort options
|
|
8
|
-
* - abortSignal - The abortSignal associated with containing operation.
|
|
9
|
-
* - abortErrorMsg - The abort error message associated with containing operation.
|
|
10
|
-
* @returns Resolved promise
|
|
11
|
-
*/
|
|
12
|
-
export declare function delay<T>(delayInMs: number, value?: T, options?: {
|
|
13
|
-
abortSignal?: AbortSignalLike;
|
|
14
|
-
abortErrorMsg?: string;
|
|
15
|
-
}): Promise<T | void>;
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
* @returns the parsed value or undefined if the parsed value is invalid.
|
|
19
|
-
*/
|
|
20
|
-
export declare function parseHeaderValueAsNumber(response: PipelineResponse, headerName: string): number | undefined;
|
|
21
|
-
//# sourceMappingURL=helpers.d.ts.map
|