@typespec/ts-http-runtime 0.1.0 → 0.2.0-alpha.20250326.3
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/LICENSE +3 -3
- package/README.md +9 -10
- package/dist/browser/abort-controller/AbortError.d.ts +4 -1
- package/dist/browser/abort-controller/AbortError.js +4 -1
- package/dist/browser/abort-controller/AbortError.js.map +1 -1
- package/dist/browser/auth/credentials.d.ts +77 -0
- package/dist/browser/auth/credentials.js +27 -0
- package/dist/browser/auth/credentials.js.map +1 -0
- package/dist/browser/auth/oauth2Flows.d.ts +57 -0
- package/dist/{esm/abort-controller/AbortSignalLike.js → browser/auth/oauth2Flows.js} +1 -1
- package/dist/browser/auth/oauth2Flows.js.map +1 -0
- package/dist/browser/auth/schemes.d.ts +53 -0
- package/dist/{react-native/abort-controller/AbortSignalLike.js → browser/auth/schemes.js} +1 -1
- package/dist/browser/auth/schemes.js.map +1 -0
- package/dist/browser/client/clientHelpers.d.ts +1 -20
- package/dist/browser/client/clientHelpers.js +21 -30
- package/dist/browser/client/clientHelpers.js.map +1 -1
- package/dist/browser/client/common.d.ts +21 -16
- package/dist/browser/client/common.js.map +1 -1
- package/dist/browser/client/getClient.d.ts +1 -9
- package/dist/browser/client/getClient.js +21 -18
- package/dist/browser/client/getClient.js.map +1 -1
- package/dist/browser/client/multipart.js +1 -1
- package/dist/browser/client/multipart.js.map +1 -1
- package/dist/browser/client/restError.js +4 -4
- package/dist/browser/client/restError.js.map +1 -1
- package/dist/browser/client/sendRequest.js +2 -2
- package/dist/browser/client/sendRequest.js.map +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/createPipelineFromOptions.d.ts +3 -1
- package/dist/browser/createPipelineFromOptions.js +4 -0
- package/dist/browser/createPipelineFromOptions.js.map +1 -1
- package/dist/browser/fetchHttpClient.js +1 -1
- package/dist/browser/fetchHttpClient.js.map +1 -1
- package/dist/browser/index.d.ts +3 -3
- package/dist/browser/index.js +2 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/interfaces.d.ts +11 -2
- package/dist/browser/interfaces.js.map +1 -1
- package/dist/browser/nodeHttpClient.js +10 -3
- package/dist/browser/nodeHttpClient.js.map +1 -1
- package/dist/browser/pipelineRequest.d.ts +1 -2
- package/dist/browser/pipelineRequest.js.map +1 -1
- package/dist/browser/policies/agentPolicy.d.ts +11 -0
- package/dist/browser/policies/agentPolicy.js +22 -0
- package/dist/browser/policies/agentPolicy.js.map +1 -0
- package/dist/browser/policies/auth/apiKeyAuthenticationPolicy.d.ts +30 -0
- package/dist/browser/policies/auth/apiKeyAuthenticationPolicy.js +31 -0
- package/dist/browser/policies/auth/apiKeyAuthenticationPolicy.js.map +1 -0
- package/dist/browser/policies/auth/basicAuthenticationPolicy.d.ts +30 -0
- package/dist/browser/policies/auth/basicAuthenticationPolicy.js +31 -0
- package/dist/browser/policies/auth/basicAuthenticationPolicy.js.map +1 -0
- package/dist/browser/policies/auth/bearerAuthenticationPolicy.d.ts +30 -0
- package/dist/browser/policies/auth/bearerAuthenticationPolicy.js +31 -0
- package/dist/browser/policies/auth/bearerAuthenticationPolicy.js.map +1 -0
- package/dist/browser/policies/auth/checkInsecureConnection.d.ts +9 -0
- package/dist/browser/policies/auth/checkInsecureConnection.js +50 -0
- package/dist/browser/policies/auth/checkInsecureConnection.js.map +1 -0
- package/dist/browser/policies/auth/oauth2AuthenticationPolicy.d.ts +31 -0
- package/dist/browser/policies/auth/oauth2AuthenticationPolicy.js +31 -0
- package/dist/browser/policies/auth/oauth2AuthenticationPolicy.js.map +1 -0
- package/dist/browser/policies/retryPolicy.js +0 -1
- package/dist/browser/policies/retryPolicy.js.map +1 -1
- package/dist/browser/policies/throttlingRetryPolicy.d.ts +3 -3
- package/dist/browser/policies/throttlingRetryPolicy.js +3 -3
- package/dist/browser/policies/throttlingRetryPolicy.js.map +1 -1
- package/dist/browser/restError.js +9 -8
- package/dist/browser/restError.js.map +1 -1
- package/dist/browser/util/aborterUtils.d.ts +3 -4
- package/dist/browser/util/aborterUtils.js.map +1 -1
- package/dist/browser/util/file.js +3 -0
- package/dist/browser/util/file.js.map +1 -1
- package/dist/browser/util/helpers.d.ts +1 -2
- package/dist/browser/util/helpers.js.map +1 -1
- package/dist/browser/util/inspect.common.d.ts +1 -1
- package/dist/browser/util/inspect.common.js +1 -1
- package/dist/browser/util/inspect.common.js.map +1 -1
- package/dist/browser/xhrHttpClient.js +1 -1
- package/dist/browser/xhrHttpClient.js.map +1 -1
- package/dist/commonjs/abort-controller/AbortError.d.ts +4 -1
- package/dist/commonjs/abort-controller/AbortError.js +4 -1
- package/dist/commonjs/abort-controller/AbortError.js.map +1 -1
- package/dist/commonjs/auth/credentials.d.ts +77 -0
- package/dist/commonjs/auth/credentials.js +33 -0
- package/dist/commonjs/auth/credentials.js.map +1 -0
- package/dist/commonjs/auth/oauth2Flows.d.ts +57 -0
- package/dist/commonjs/{abort-controller/AbortSignalLike.js → auth/oauth2Flows.js} +1 -1
- package/dist/commonjs/auth/oauth2Flows.js.map +1 -0
- package/dist/commonjs/auth/schemes.d.ts +53 -0
- package/dist/commonjs/auth/schemes.js +5 -0
- package/dist/commonjs/auth/schemes.js.map +1 -0
- package/dist/commonjs/client/clientHelpers.d.ts +1 -20
- package/dist/commonjs/client/clientHelpers.js +21 -31
- package/dist/commonjs/client/clientHelpers.js.map +1 -1
- package/dist/commonjs/client/common.d.ts +21 -16
- package/dist/commonjs/client/common.js.map +1 -1
- package/dist/commonjs/client/getClient.d.ts +1 -9
- package/dist/commonjs/client/getClient.js +21 -18
- package/dist/commonjs/client/getClient.js.map +1 -1
- package/dist/commonjs/client/multipart.js +1 -1
- package/dist/commonjs/client/multipart.js.map +1 -1
- package/dist/commonjs/client/restError.js +4 -4
- package/dist/commonjs/client/restError.js.map +1 -1
- package/dist/commonjs/client/sendRequest.js +2 -2
- package/dist/commonjs/client/sendRequest.js.map +1 -1
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/createPipelineFromOptions.d.ts +3 -1
- package/dist/commonjs/createPipelineFromOptions.js +4 -0
- package/dist/commonjs/createPipelineFromOptions.js.map +1 -1
- package/dist/commonjs/fetchHttpClient.js +1 -1
- package/dist/commonjs/fetchHttpClient.js.map +1 -1
- package/dist/commonjs/index.d.ts +3 -3
- package/dist/commonjs/index.js +4 -5
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/interfaces.d.ts +11 -2
- package/dist/commonjs/interfaces.js.map +1 -1
- package/dist/commonjs/nodeHttpClient.js +10 -3
- package/dist/commonjs/nodeHttpClient.js.map +1 -1
- package/dist/commonjs/pipelineRequest.d.ts +1 -2
- package/dist/commonjs/pipelineRequest.js.map +1 -1
- package/dist/commonjs/policies/agentPolicy.d.ts +11 -0
- package/dist/commonjs/policies/agentPolicy.js +26 -0
- package/dist/commonjs/policies/agentPolicy.js.map +1 -0
- package/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.d.ts +30 -0
- package/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js +35 -0
- package/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js.map +1 -0
- package/dist/commonjs/policies/auth/basicAuthenticationPolicy.d.ts +30 -0
- package/dist/commonjs/policies/auth/basicAuthenticationPolicy.js +35 -0
- package/dist/commonjs/policies/auth/basicAuthenticationPolicy.js.map +1 -0
- package/dist/commonjs/policies/auth/bearerAuthenticationPolicy.d.ts +30 -0
- package/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js +35 -0
- package/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js.map +1 -0
- package/dist/commonjs/policies/auth/checkInsecureConnection.d.ts +9 -0
- package/dist/commonjs/policies/auth/checkInsecureConnection.js +53 -0
- package/dist/commonjs/policies/auth/checkInsecureConnection.js.map +1 -0
- package/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.d.ts +31 -0
- package/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js +35 -0
- package/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js.map +1 -0
- package/dist/commonjs/policies/retryPolicy.js +0 -1
- package/dist/commonjs/policies/retryPolicy.js.map +1 -1
- package/dist/commonjs/policies/throttlingRetryPolicy.d.ts +3 -3
- package/dist/commonjs/policies/throttlingRetryPolicy.js +3 -3
- package/dist/commonjs/policies/throttlingRetryPolicy.js.map +1 -1
- package/dist/commonjs/restError.js +9 -8
- package/dist/commonjs/restError.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/util/aborterUtils.d.ts +3 -4
- package/dist/commonjs/util/aborterUtils.js.map +1 -1
- package/dist/commonjs/util/file.js +3 -0
- package/dist/commonjs/util/file.js.map +1 -1
- package/dist/commonjs/util/helpers.d.ts +1 -2
- package/dist/commonjs/util/helpers.js.map +1 -1
- package/dist/commonjs/util/inspect.common.d.ts +1 -1
- package/dist/commonjs/util/inspect.common.js +1 -1
- package/dist/commonjs/util/inspect.common.js.map +1 -1
- package/dist/commonjs/xhrHttpClient.js +1 -1
- package/dist/commonjs/xhrHttpClient.js.map +1 -1
- package/dist/esm/abort-controller/AbortError.d.ts +4 -1
- package/dist/esm/abort-controller/AbortError.js +4 -1
- package/dist/esm/abort-controller/AbortError.js.map +1 -1
- package/dist/esm/auth/credentials.d.ts +77 -0
- package/dist/esm/auth/credentials.js +27 -0
- package/dist/esm/auth/credentials.js.map +1 -0
- package/dist/esm/auth/oauth2Flows.d.ts +57 -0
- package/dist/{browser/abort-controller/AbortSignalLike.js → esm/auth/oauth2Flows.js} +1 -1
- package/dist/esm/auth/oauth2Flows.js.map +1 -0
- package/dist/esm/auth/schemes.d.ts +53 -0
- package/dist/esm/auth/schemes.js +4 -0
- package/dist/esm/auth/schemes.js.map +1 -0
- package/dist/esm/client/clientHelpers.d.ts +1 -20
- package/dist/esm/client/clientHelpers.js +21 -30
- package/dist/esm/client/clientHelpers.js.map +1 -1
- package/dist/esm/client/common.d.ts +21 -16
- package/dist/esm/client/common.js.map +1 -1
- package/dist/esm/client/getClient.d.ts +1 -9
- package/dist/esm/client/getClient.js +21 -18
- package/dist/esm/client/getClient.js.map +1 -1
- package/dist/esm/client/multipart.js +1 -1
- package/dist/esm/client/multipart.js.map +1 -1
- package/dist/esm/client/restError.js +4 -4
- package/dist/esm/client/restError.js.map +1 -1
- package/dist/esm/client/sendRequest.js +2 -2
- package/dist/esm/client/sendRequest.js.map +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/createPipelineFromOptions.d.ts +3 -1
- package/dist/esm/createPipelineFromOptions.js +4 -0
- package/dist/esm/createPipelineFromOptions.js.map +1 -1
- package/dist/esm/fetchHttpClient.js +1 -1
- package/dist/esm/fetchHttpClient.js.map +1 -1
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces.d.ts +11 -2
- package/dist/esm/interfaces.js.map +1 -1
- package/dist/esm/nodeHttpClient.js +10 -3
- package/dist/esm/nodeHttpClient.js.map +1 -1
- package/dist/esm/pipelineRequest.d.ts +1 -2
- package/dist/esm/pipelineRequest.js.map +1 -1
- package/dist/esm/policies/agentPolicy.d.ts +11 -0
- package/dist/esm/policies/agentPolicy.js +22 -0
- package/dist/esm/policies/agentPolicy.js.map +1 -0
- package/dist/esm/policies/auth/apiKeyAuthenticationPolicy.d.ts +30 -0
- package/dist/esm/policies/auth/apiKeyAuthenticationPolicy.js +31 -0
- package/dist/esm/policies/auth/apiKeyAuthenticationPolicy.js.map +1 -0
- package/dist/esm/policies/auth/basicAuthenticationPolicy.d.ts +30 -0
- package/dist/esm/policies/auth/basicAuthenticationPolicy.js +31 -0
- package/dist/esm/policies/auth/basicAuthenticationPolicy.js.map +1 -0
- package/dist/esm/policies/auth/bearerAuthenticationPolicy.d.ts +30 -0
- package/dist/esm/policies/auth/bearerAuthenticationPolicy.js +31 -0
- package/dist/esm/policies/auth/bearerAuthenticationPolicy.js.map +1 -0
- package/dist/esm/policies/auth/checkInsecureConnection.d.ts +9 -0
- package/dist/esm/policies/auth/checkInsecureConnection.js +50 -0
- package/dist/esm/policies/auth/checkInsecureConnection.js.map +1 -0
- package/dist/esm/policies/auth/oauth2AuthenticationPolicy.d.ts +31 -0
- package/dist/esm/policies/auth/oauth2AuthenticationPolicy.js +31 -0
- package/dist/esm/policies/auth/oauth2AuthenticationPolicy.js.map +1 -0
- package/dist/esm/policies/retryPolicy.js +0 -1
- package/dist/esm/policies/retryPolicy.js.map +1 -1
- package/dist/esm/policies/throttlingRetryPolicy.d.ts +3 -3
- package/dist/esm/policies/throttlingRetryPolicy.js +3 -3
- package/dist/esm/policies/throttlingRetryPolicy.js.map +1 -1
- package/dist/esm/restError.js +9 -8
- package/dist/esm/restError.js.map +1 -1
- package/dist/esm/util/aborterUtils.d.ts +3 -4
- package/dist/esm/util/aborterUtils.js.map +1 -1
- package/dist/esm/util/file.js +3 -0
- package/dist/esm/util/file.js.map +1 -1
- package/dist/esm/util/helpers.d.ts +1 -2
- package/dist/esm/util/helpers.js.map +1 -1
- package/dist/esm/util/inspect.common.d.ts +1 -1
- package/dist/esm/util/inspect.common.js +1 -1
- package/dist/esm/util/inspect.common.js.map +1 -1
- package/dist/esm/xhrHttpClient.js +1 -1
- package/dist/esm/xhrHttpClient.js.map +1 -1
- package/dist/react-native/abort-controller/AbortError.d.ts +4 -1
- package/dist/react-native/abort-controller/AbortError.js +4 -1
- package/dist/react-native/abort-controller/AbortError.js.map +1 -1
- package/dist/react-native/auth/credentials.d.ts +77 -0
- package/dist/react-native/auth/credentials.js +27 -0
- package/dist/react-native/auth/credentials.js.map +1 -0
- package/dist/react-native/auth/oauth2Flows.d.ts +57 -0
- package/dist/react-native/auth/oauth2Flows.js +4 -0
- package/dist/react-native/auth/oauth2Flows.js.map +1 -0
- package/dist/react-native/auth/schemes.d.ts +53 -0
- package/dist/react-native/auth/schemes.js +4 -0
- package/dist/react-native/auth/schemes.js.map +1 -0
- package/dist/react-native/client/clientHelpers.d.ts +1 -20
- package/dist/react-native/client/clientHelpers.js +21 -30
- package/dist/react-native/client/clientHelpers.js.map +1 -1
- package/dist/react-native/client/common.d.ts +21 -16
- package/dist/react-native/client/common.js.map +1 -1
- package/dist/react-native/client/getClient.d.ts +1 -9
- package/dist/react-native/client/getClient.js +21 -18
- package/dist/react-native/client/getClient.js.map +1 -1
- package/dist/react-native/client/multipart.js +1 -1
- package/dist/react-native/client/multipart.js.map +1 -1
- package/dist/react-native/client/restError.js +4 -4
- package/dist/react-native/client/restError.js.map +1 -1
- package/dist/react-native/client/sendRequest.js +2 -2
- package/dist/react-native/client/sendRequest.js.map +1 -1
- package/dist/react-native/constants.js +1 -1
- package/dist/react-native/constants.js.map +1 -1
- package/dist/react-native/createPipelineFromOptions.d.ts +3 -1
- package/dist/react-native/createPipelineFromOptions.js +4 -0
- package/dist/react-native/createPipelineFromOptions.js.map +1 -1
- package/dist/react-native/fetchHttpClient.js +1 -1
- package/dist/react-native/fetchHttpClient.js.map +1 -1
- package/dist/react-native/index.d.ts +3 -3
- package/dist/react-native/index.js +2 -2
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/interfaces.d.ts +11 -2
- package/dist/react-native/interfaces.js.map +1 -1
- package/dist/react-native/nodeHttpClient.js +10 -3
- package/dist/react-native/nodeHttpClient.js.map +1 -1
- package/dist/react-native/pipelineRequest.d.ts +1 -2
- package/dist/react-native/pipelineRequest.js.map +1 -1
- package/dist/react-native/policies/agentPolicy.d.ts +11 -0
- package/dist/react-native/policies/agentPolicy.js +22 -0
- package/dist/react-native/policies/agentPolicy.js.map +1 -0
- package/dist/react-native/policies/auth/apiKeyAuthenticationPolicy.d.ts +30 -0
- package/dist/react-native/policies/auth/apiKeyAuthenticationPolicy.js +31 -0
- package/dist/react-native/policies/auth/apiKeyAuthenticationPolicy.js.map +1 -0
- package/dist/react-native/policies/auth/basicAuthenticationPolicy.d.ts +30 -0
- package/dist/react-native/policies/auth/basicAuthenticationPolicy.js +31 -0
- package/dist/react-native/policies/auth/basicAuthenticationPolicy.js.map +1 -0
- package/dist/react-native/policies/auth/bearerAuthenticationPolicy.d.ts +30 -0
- package/dist/react-native/policies/auth/bearerAuthenticationPolicy.js +31 -0
- package/dist/react-native/policies/auth/bearerAuthenticationPolicy.js.map +1 -0
- package/dist/react-native/policies/auth/checkInsecureConnection.d.ts +9 -0
- package/dist/react-native/policies/auth/checkInsecureConnection.js +50 -0
- package/dist/react-native/policies/auth/checkInsecureConnection.js.map +1 -0
- package/dist/react-native/policies/auth/oauth2AuthenticationPolicy.d.ts +31 -0
- package/dist/react-native/policies/auth/oauth2AuthenticationPolicy.js +31 -0
- package/dist/react-native/policies/auth/oauth2AuthenticationPolicy.js.map +1 -0
- package/dist/react-native/policies/retryPolicy.js +0 -1
- package/dist/react-native/policies/retryPolicy.js.map +1 -1
- package/dist/react-native/policies/throttlingRetryPolicy.d.ts +3 -3
- package/dist/react-native/policies/throttlingRetryPolicy.js +3 -3
- package/dist/react-native/policies/throttlingRetryPolicy.js.map +1 -1
- package/dist/react-native/restError.js +9 -8
- package/dist/react-native/restError.js.map +1 -1
- package/dist/react-native/util/aborterUtils.d.ts +3 -4
- package/dist/react-native/util/aborterUtils.js.map +1 -1
- package/dist/react-native/util/file.js +3 -0
- package/dist/react-native/util/file.js.map +1 -1
- package/dist/react-native/util/helpers.d.ts +1 -2
- package/dist/react-native/util/helpers.js.map +1 -1
- package/dist/react-native/util/inspect.common.d.ts +1 -1
- package/dist/react-native/util/inspect.common.js +1 -1
- package/dist/react-native/util/inspect.common.js.map +1 -1
- package/dist/react-native/xhrHttpClient.js +1 -1
- package/dist/react-native/xhrHttpClient.js.map +1 -1
- package/package.json +13 -11
- package/dist/browser/abort-controller/AbortError.d.ts.map +0 -1
- package/dist/browser/abort-controller/AbortSignalLike.d.ts +0 -19
- package/dist/browser/abort-controller/AbortSignalLike.d.ts.map +0 -1
- package/dist/browser/abort-controller/AbortSignalLike.js.map +0 -1
- package/dist/browser/accessTokenCache.d.ts +0 -40
- package/dist/browser/accessTokenCache.d.ts.map +0 -1
- package/dist/browser/accessTokenCache.js +0 -32
- package/dist/browser/accessTokenCache.js.map +0 -1
- package/dist/browser/auth/keyCredential.d.ts +0 -16
- package/dist/browser/auth/keyCredential.d.ts.map +0 -1
- package/dist/browser/auth/keyCredential.js +0 -12
- package/dist/browser/auth/keyCredential.js.map +0 -1
- package/dist/browser/auth/tokenCredential.d.ts +0 -71
- package/dist/browser/auth/tokenCredential.d.ts.map +0 -1
- package/dist/browser/auth/tokenCredential.js +0 -19
- package/dist/browser/auth/tokenCredential.js.map +0 -1
- package/dist/browser/client/apiVersionPolicy.d.ts.map +0 -1
- package/dist/browser/client/clientHelpers.d.ts.map +0 -1
- package/dist/browser/client/common.d.ts.map +0 -1
- package/dist/browser/client/getClient.d.ts.map +0 -1
- package/dist/browser/client/keyCredentialAuthenticationPolicy.d.ts +0 -8
- package/dist/browser/client/keyCredentialAuthenticationPolicy.d.ts.map +0 -1
- package/dist/browser/client/keyCredentialAuthenticationPolicy.js +0 -16
- package/dist/browser/client/keyCredentialAuthenticationPolicy.js.map +0 -1
- package/dist/browser/client/multipart.d.ts.map +0 -1
- package/dist/browser/client/operationOptionHelpers.d.ts.map +0 -1
- package/dist/browser/client/restError.d.ts.map +0 -1
- package/dist/browser/client/sendRequest.d.ts.map +0 -1
- package/dist/browser/client/urlHelpers.d.ts.map +0 -1
- package/dist/browser/constants.d.ts.map +0 -1
- package/dist/browser/createPipelineFromOptions.d.ts.map +0 -1
- package/dist/browser/defaultHttpClient-browser.d.mts.map +0 -1
- package/dist/browser/fetchHttpClient.d.ts.map +0 -1
- package/dist/browser/httpHeaders.d.ts.map +0 -1
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/interfaces.d.ts.map +0 -1
- package/dist/browser/log.d.ts.map +0 -1
- package/dist/browser/logger/debug.d.ts.map +0 -1
- package/dist/browser/logger/log-browser.d.mts.map +0 -1
- package/dist/browser/logger/log.common.d.ts.map +0 -1
- package/dist/browser/logger/logger.d.ts.map +0 -1
- package/dist/browser/nodeHttpClient.d.ts.map +0 -1
- package/dist/browser/pipeline.d.ts.map +0 -1
- package/dist/browser/pipelineRequest.d.ts.map +0 -1
- package/dist/browser/policies/bearerTokenAuthenticationPolicy.d.ts +0 -99
- package/dist/browser/policies/bearerTokenAuthenticationPolicy.d.ts.map +0 -1
- package/dist/browser/policies/bearerTokenAuthenticationPolicy.js +0 -107
- package/dist/browser/policies/bearerTokenAuthenticationPolicy.js.map +0 -1
- package/dist/browser/policies/decompressResponsePolicy-browser.d.mts.map +0 -1
- package/dist/browser/policies/defaultRetryPolicy.d.ts.map +0 -1
- package/dist/browser/policies/exponentialRetryPolicy.d.ts.map +0 -1
- package/dist/browser/policies/formDataPolicy.d.ts.map +0 -1
- package/dist/browser/policies/logPolicy.d.ts.map +0 -1
- package/dist/browser/policies/multipartPolicy.d.ts.map +0 -1
- package/dist/browser/policies/proxyPolicy-browser.d.mts.map +0 -1
- package/dist/browser/policies/proxyPolicy.common.d.ts.map +0 -1
- package/dist/browser/policies/redirectPolicy.d.ts.map +0 -1
- package/dist/browser/policies/retryPolicy.d.ts.map +0 -1
- package/dist/browser/policies/systemErrorRetryPolicy.d.ts.map +0 -1
- package/dist/browser/policies/throttlingRetryPolicy.d.ts.map +0 -1
- package/dist/browser/policies/tlsPolicy.d.ts.map +0 -1
- package/dist/browser/policies/userAgentPolicy.d.ts.map +0 -1
- package/dist/browser/restError.d.ts.map +0 -1
- package/dist/browser/retryStrategies/exponentialRetryStrategy.d.ts.map +0 -1
- package/dist/browser/retryStrategies/retryStrategy.d.ts.map +0 -1
- package/dist/browser/retryStrategies/throttlingRetryStrategy.d.ts.map +0 -1
- package/dist/browser/util/aborterUtils.d.ts.map +0 -1
- package/dist/browser/util/bytesEncoding-browser.d.mts.map +0 -1
- package/dist/browser/util/bytesEncoding.common.d.ts.map +0 -1
- package/dist/browser/util/checkEnvironment.d.ts.map +0 -1
- package/dist/browser/util/concat-browser.d.mts.map +0 -1
- package/dist/browser/util/concat.common.d.ts.map +0 -1
- package/dist/browser/util/createAbortablePromise.d.ts.map +0 -1
- package/dist/browser/util/delay.d.ts.map +0 -1
- package/dist/browser/util/error.d.ts.map +0 -1
- package/dist/browser/util/file.d.ts.map +0 -1
- package/dist/browser/util/helpers.d.ts.map +0 -1
- package/dist/browser/util/inspect-browser.d.mts.map +0 -1
- package/dist/browser/util/inspect.common.d.ts.map +0 -1
- package/dist/browser/util/object.d.ts.map +0 -1
- package/dist/browser/util/random.d.ts.map +0 -1
- package/dist/browser/util/sanitizer.d.ts.map +0 -1
- package/dist/browser/util/sha256-browser.d.mts.map +0 -1
- package/dist/browser/util/sha256.common.d.ts.map +0 -1
- package/dist/browser/util/tokenCycler.d.ts +0 -45
- package/dist/browser/util/tokenCycler.d.ts.map +0 -1
- package/dist/browser/util/tokenCycler.js +0 -162
- package/dist/browser/util/tokenCycler.js.map +0 -1
- package/dist/browser/util/typeGuards.d.ts.map +0 -1
- package/dist/browser/util/userAgent.d.ts.map +0 -1
- package/dist/browser/util/userAgentPlatform-browser.d.mts.map +0 -1
- package/dist/browser/util/uuidUtils-browser.d.mts.map +0 -1
- package/dist/browser/util/uuidUtils.common.d.ts.map +0 -1
- package/dist/browser/xhrHttpClient.d.ts.map +0 -1
- package/dist/commonjs/abort-controller/AbortError.d.ts.map +0 -1
- package/dist/commonjs/abort-controller/AbortSignalLike.d.ts +0 -19
- package/dist/commonjs/abort-controller/AbortSignalLike.d.ts.map +0 -1
- package/dist/commonjs/abort-controller/AbortSignalLike.js.map +0 -1
- package/dist/commonjs/accessTokenCache.d.ts +0 -40
- package/dist/commonjs/accessTokenCache.d.ts.map +0 -1
- package/dist/commonjs/accessTokenCache.js +0 -36
- package/dist/commonjs/accessTokenCache.js.map +0 -1
- package/dist/commonjs/auth/keyCredential.d.ts +0 -16
- package/dist/commonjs/auth/keyCredential.d.ts.map +0 -1
- package/dist/commonjs/auth/keyCredential.js +0 -15
- package/dist/commonjs/auth/keyCredential.js.map +0 -1
- package/dist/commonjs/auth/tokenCredential.d.ts +0 -71
- package/dist/commonjs/auth/tokenCredential.d.ts.map +0 -1
- package/dist/commonjs/auth/tokenCredential.js +0 -22
- package/dist/commonjs/auth/tokenCredential.js.map +0 -1
- package/dist/commonjs/client/apiVersionPolicy.d.ts.map +0 -1
- package/dist/commonjs/client/clientHelpers.d.ts.map +0 -1
- package/dist/commonjs/client/common.d.ts.map +0 -1
- package/dist/commonjs/client/getClient.d.ts.map +0 -1
- package/dist/commonjs/client/keyCredentialAuthenticationPolicy.d.ts +0 -8
- package/dist/commonjs/client/keyCredentialAuthenticationPolicy.d.ts.map +0 -1
- package/dist/commonjs/client/keyCredentialAuthenticationPolicy.js +0 -20
- package/dist/commonjs/client/keyCredentialAuthenticationPolicy.js.map +0 -1
- package/dist/commonjs/client/multipart.d.ts.map +0 -1
- package/dist/commonjs/client/operationOptionHelpers.d.ts.map +0 -1
- package/dist/commonjs/client/restError.d.ts.map +0 -1
- package/dist/commonjs/client/sendRequest.d.ts.map +0 -1
- package/dist/commonjs/client/urlHelpers.d.ts.map +0 -1
- package/dist/commonjs/constants.d.ts.map +0 -1
- package/dist/commonjs/createPipelineFromOptions.d.ts.map +0 -1
- package/dist/commonjs/defaultHttpClient.d.ts.map +0 -1
- package/dist/commonjs/fetchHttpClient.d.ts.map +0 -1
- package/dist/commonjs/httpHeaders.d.ts.map +0 -1
- package/dist/commonjs/index.d.ts.map +0 -1
- package/dist/commonjs/interfaces.d.ts.map +0 -1
- package/dist/commonjs/log.d.ts.map +0 -1
- package/dist/commonjs/logger/debug.d.ts.map +0 -1
- package/dist/commonjs/logger/log.common.d.ts.map +0 -1
- package/dist/commonjs/logger/log.d.ts.map +0 -1
- package/dist/commonjs/logger/logger.d.ts.map +0 -1
- package/dist/commonjs/nodeHttpClient.d.ts.map +0 -1
- package/dist/commonjs/pipeline.d.ts.map +0 -1
- package/dist/commonjs/pipelineRequest.d.ts.map +0 -1
- package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.d.ts +0 -99
- package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js +0 -111
- package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js.map +0 -1
- package/dist/commonjs/policies/decompressResponsePolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/defaultRetryPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/exponentialRetryPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/formDataPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/logPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/multipartPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/proxyPolicy.common.d.ts.map +0 -1
- package/dist/commonjs/policies/proxyPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/redirectPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/retryPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/systemErrorRetryPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/throttlingRetryPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/tlsPolicy.d.ts.map +0 -1
- package/dist/commonjs/policies/userAgentPolicy.d.ts.map +0 -1
- package/dist/commonjs/restError.d.ts.map +0 -1
- package/dist/commonjs/retryStrategies/exponentialRetryStrategy.d.ts.map +0 -1
- package/dist/commonjs/retryStrategies/retryStrategy.d.ts.map +0 -1
- package/dist/commonjs/retryStrategies/throttlingRetryStrategy.d.ts.map +0 -1
- package/dist/commonjs/util/aborterUtils.d.ts.map +0 -1
- package/dist/commonjs/util/bytesEncoding.common.d.ts.map +0 -1
- package/dist/commonjs/util/bytesEncoding.d.ts.map +0 -1
- package/dist/commonjs/util/checkEnvironment.d.ts.map +0 -1
- package/dist/commonjs/util/concat.common.d.ts.map +0 -1
- package/dist/commonjs/util/concat.d.ts.map +0 -1
- package/dist/commonjs/util/createAbortablePromise.d.ts.map +0 -1
- package/dist/commonjs/util/delay.d.ts.map +0 -1
- package/dist/commonjs/util/error.d.ts.map +0 -1
- package/dist/commonjs/util/file.d.ts.map +0 -1
- package/dist/commonjs/util/helpers.d.ts.map +0 -1
- package/dist/commonjs/util/inspect.common.d.ts.map +0 -1
- package/dist/commonjs/util/inspect.d.ts.map +0 -1
- package/dist/commonjs/util/object.d.ts.map +0 -1
- package/dist/commonjs/util/random.d.ts.map +0 -1
- package/dist/commonjs/util/sanitizer.d.ts.map +0 -1
- package/dist/commonjs/util/sha256.common.d.ts.map +0 -1
- package/dist/commonjs/util/sha256.d.ts.map +0 -1
- package/dist/commonjs/util/tokenCycler.d.ts +0 -45
- package/dist/commonjs/util/tokenCycler.d.ts.map +0 -1
- package/dist/commonjs/util/tokenCycler.js +0 -166
- package/dist/commonjs/util/tokenCycler.js.map +0 -1
- package/dist/commonjs/util/typeGuards.d.ts.map +0 -1
- package/dist/commonjs/util/userAgent.d.ts.map +0 -1
- package/dist/commonjs/util/userAgentPlatform.d.ts.map +0 -1
- package/dist/commonjs/util/uuidUtils.common.d.ts.map +0 -1
- package/dist/commonjs/util/uuidUtils.d.ts.map +0 -1
- package/dist/commonjs/xhrHttpClient.d.ts.map +0 -1
- package/dist/esm/abort-controller/AbortError.d.ts.map +0 -1
- package/dist/esm/abort-controller/AbortSignalLike.d.ts +0 -19
- package/dist/esm/abort-controller/AbortSignalLike.d.ts.map +0 -1
- package/dist/esm/abort-controller/AbortSignalLike.js.map +0 -1
- package/dist/esm/accessTokenCache.d.ts +0 -40
- package/dist/esm/accessTokenCache.d.ts.map +0 -1
- package/dist/esm/accessTokenCache.js +0 -32
- package/dist/esm/accessTokenCache.js.map +0 -1
- package/dist/esm/auth/keyCredential.d.ts +0 -16
- package/dist/esm/auth/keyCredential.d.ts.map +0 -1
- package/dist/esm/auth/keyCredential.js +0 -12
- package/dist/esm/auth/keyCredential.js.map +0 -1
- package/dist/esm/auth/tokenCredential.d.ts +0 -71
- package/dist/esm/auth/tokenCredential.d.ts.map +0 -1
- package/dist/esm/auth/tokenCredential.js +0 -19
- package/dist/esm/auth/tokenCredential.js.map +0 -1
- package/dist/esm/client/apiVersionPolicy.d.ts.map +0 -1
- package/dist/esm/client/clientHelpers.d.ts.map +0 -1
- package/dist/esm/client/common.d.ts.map +0 -1
- package/dist/esm/client/getClient.d.ts.map +0 -1
- package/dist/esm/client/keyCredentialAuthenticationPolicy.d.ts +0 -8
- package/dist/esm/client/keyCredentialAuthenticationPolicy.d.ts.map +0 -1
- package/dist/esm/client/keyCredentialAuthenticationPolicy.js +0 -16
- package/dist/esm/client/keyCredentialAuthenticationPolicy.js.map +0 -1
- package/dist/esm/client/multipart.d.ts.map +0 -1
- package/dist/esm/client/operationOptionHelpers.d.ts.map +0 -1
- package/dist/esm/client/restError.d.ts.map +0 -1
- package/dist/esm/client/sendRequest.d.ts.map +0 -1
- package/dist/esm/client/urlHelpers.d.ts.map +0 -1
- package/dist/esm/constants.d.ts.map +0 -1
- package/dist/esm/createPipelineFromOptions.d.ts.map +0 -1
- package/dist/esm/defaultHttpClient.d.ts.map +0 -1
- package/dist/esm/fetchHttpClient.d.ts.map +0 -1
- package/dist/esm/httpHeaders.d.ts.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/interfaces.d.ts.map +0 -1
- package/dist/esm/log.d.ts.map +0 -1
- package/dist/esm/logger/debug.d.ts.map +0 -1
- package/dist/esm/logger/log.common.d.ts.map +0 -1
- package/dist/esm/logger/log.d.ts.map +0 -1
- package/dist/esm/logger/logger.d.ts.map +0 -1
- package/dist/esm/nodeHttpClient.d.ts.map +0 -1
- package/dist/esm/pipeline.d.ts.map +0 -1
- package/dist/esm/pipelineRequest.d.ts.map +0 -1
- package/dist/esm/policies/bearerTokenAuthenticationPolicy.d.ts +0 -99
- package/dist/esm/policies/bearerTokenAuthenticationPolicy.d.ts.map +0 -1
- package/dist/esm/policies/bearerTokenAuthenticationPolicy.js +0 -107
- package/dist/esm/policies/bearerTokenAuthenticationPolicy.js.map +0 -1
- package/dist/esm/policies/decompressResponsePolicy.d.ts.map +0 -1
- package/dist/esm/policies/defaultRetryPolicy.d.ts.map +0 -1
- package/dist/esm/policies/exponentialRetryPolicy.d.ts.map +0 -1
- package/dist/esm/policies/formDataPolicy.d.ts.map +0 -1
- package/dist/esm/policies/logPolicy.d.ts.map +0 -1
- package/dist/esm/policies/multipartPolicy.d.ts.map +0 -1
- package/dist/esm/policies/proxyPolicy.common.d.ts.map +0 -1
- package/dist/esm/policies/proxyPolicy.d.ts.map +0 -1
- package/dist/esm/policies/redirectPolicy.d.ts.map +0 -1
- package/dist/esm/policies/retryPolicy.d.ts.map +0 -1
- package/dist/esm/policies/systemErrorRetryPolicy.d.ts.map +0 -1
- package/dist/esm/policies/throttlingRetryPolicy.d.ts.map +0 -1
- package/dist/esm/policies/tlsPolicy.d.ts.map +0 -1
- package/dist/esm/policies/userAgentPolicy.d.ts.map +0 -1
- package/dist/esm/restError.d.ts.map +0 -1
- package/dist/esm/retryStrategies/exponentialRetryStrategy.d.ts.map +0 -1
- package/dist/esm/retryStrategies/retryStrategy.d.ts.map +0 -1
- package/dist/esm/retryStrategies/throttlingRetryStrategy.d.ts.map +0 -1
- package/dist/esm/util/aborterUtils.d.ts.map +0 -1
- package/dist/esm/util/bytesEncoding.common.d.ts.map +0 -1
- package/dist/esm/util/bytesEncoding.d.ts.map +0 -1
- package/dist/esm/util/checkEnvironment.d.ts.map +0 -1
- package/dist/esm/util/concat.common.d.ts.map +0 -1
- package/dist/esm/util/concat.d.ts.map +0 -1
- package/dist/esm/util/createAbortablePromise.d.ts.map +0 -1
- package/dist/esm/util/delay.d.ts.map +0 -1
- package/dist/esm/util/error.d.ts.map +0 -1
- package/dist/esm/util/file.d.ts.map +0 -1
- package/dist/esm/util/helpers.d.ts.map +0 -1
- package/dist/esm/util/inspect.common.d.ts.map +0 -1
- package/dist/esm/util/inspect.d.ts.map +0 -1
- package/dist/esm/util/object.d.ts.map +0 -1
- package/dist/esm/util/random.d.ts.map +0 -1
- package/dist/esm/util/sanitizer.d.ts.map +0 -1
- package/dist/esm/util/sha256.common.d.ts.map +0 -1
- package/dist/esm/util/sha256.d.ts.map +0 -1
- package/dist/esm/util/tokenCycler.d.ts +0 -45
- package/dist/esm/util/tokenCycler.d.ts.map +0 -1
- package/dist/esm/util/tokenCycler.js +0 -162
- package/dist/esm/util/tokenCycler.js.map +0 -1
- package/dist/esm/util/typeGuards.d.ts.map +0 -1
- package/dist/esm/util/userAgent.d.ts.map +0 -1
- package/dist/esm/util/userAgentPlatform.d.ts.map +0 -1
- package/dist/esm/util/uuidUtils.common.d.ts.map +0 -1
- package/dist/esm/util/uuidUtils.d.ts.map +0 -1
- package/dist/esm/xhrHttpClient.d.ts.map +0 -1
- package/dist/react-native/abort-controller/AbortError.d.ts.map +0 -1
- package/dist/react-native/abort-controller/AbortSignalLike.d.ts +0 -19
- package/dist/react-native/abort-controller/AbortSignalLike.d.ts.map +0 -1
- package/dist/react-native/abort-controller/AbortSignalLike.js.map +0 -1
- package/dist/react-native/accessTokenCache.d.ts +0 -40
- package/dist/react-native/accessTokenCache.d.ts.map +0 -1
- package/dist/react-native/accessTokenCache.js +0 -32
- package/dist/react-native/accessTokenCache.js.map +0 -1
- package/dist/react-native/auth/keyCredential.d.ts +0 -16
- package/dist/react-native/auth/keyCredential.d.ts.map +0 -1
- package/dist/react-native/auth/keyCredential.js +0 -12
- package/dist/react-native/auth/keyCredential.js.map +0 -1
- package/dist/react-native/auth/tokenCredential.d.ts +0 -71
- package/dist/react-native/auth/tokenCredential.d.ts.map +0 -1
- package/dist/react-native/auth/tokenCredential.js +0 -19
- package/dist/react-native/auth/tokenCredential.js.map +0 -1
- package/dist/react-native/client/apiVersionPolicy.d.ts.map +0 -1
- package/dist/react-native/client/clientHelpers.d.ts.map +0 -1
- package/dist/react-native/client/common.d.ts.map +0 -1
- package/dist/react-native/client/getClient.d.ts.map +0 -1
- package/dist/react-native/client/keyCredentialAuthenticationPolicy.d.ts +0 -8
- package/dist/react-native/client/keyCredentialAuthenticationPolicy.d.ts.map +0 -1
- package/dist/react-native/client/keyCredentialAuthenticationPolicy.js +0 -16
- package/dist/react-native/client/keyCredentialAuthenticationPolicy.js.map +0 -1
- package/dist/react-native/client/multipart.d.ts.map +0 -1
- package/dist/react-native/client/operationOptionHelpers.d.ts.map +0 -1
- package/dist/react-native/client/restError.d.ts.map +0 -1
- package/dist/react-native/client/sendRequest.d.ts.map +0 -1
- package/dist/react-native/client/urlHelpers.d.ts.map +0 -1
- package/dist/react-native/constants.d.ts.map +0 -1
- package/dist/react-native/createPipelineFromOptions.d.ts.map +0 -1
- package/dist/react-native/defaultHttpClient-react-native.d.mts.map +0 -1
- package/dist/react-native/fetchHttpClient.d.ts.map +0 -1
- package/dist/react-native/httpHeaders.d.ts.map +0 -1
- package/dist/react-native/index.d.ts.map +0 -1
- package/dist/react-native/interfaces.d.ts.map +0 -1
- package/dist/react-native/log.d.ts.map +0 -1
- package/dist/react-native/logger/debug.d.ts.map +0 -1
- package/dist/react-native/logger/log-react-native.d.mts.map +0 -1
- package/dist/react-native/logger/log.common.d.ts.map +0 -1
- package/dist/react-native/logger/logger.d.ts.map +0 -1
- package/dist/react-native/nodeHttpClient.d.ts.map +0 -1
- package/dist/react-native/pipeline.d.ts.map +0 -1
- package/dist/react-native/pipelineRequest.d.ts.map +0 -1
- package/dist/react-native/policies/bearerTokenAuthenticationPolicy.d.ts +0 -99
- package/dist/react-native/policies/bearerTokenAuthenticationPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/bearerTokenAuthenticationPolicy.js +0 -107
- package/dist/react-native/policies/bearerTokenAuthenticationPolicy.js.map +0 -1
- package/dist/react-native/policies/decompressResponsePolicy.d.ts.map +0 -1
- package/dist/react-native/policies/defaultRetryPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/exponentialRetryPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/formDataPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/logPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/multipartPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/proxyPolicy-react-native.d.mts.map +0 -1
- package/dist/react-native/policies/proxyPolicy.common.d.ts.map +0 -1
- package/dist/react-native/policies/redirectPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/retryPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/systemErrorRetryPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/throttlingRetryPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/tlsPolicy.d.ts.map +0 -1
- package/dist/react-native/policies/userAgentPolicy.d.ts.map +0 -1
- package/dist/react-native/restError.d.ts.map +0 -1
- package/dist/react-native/retryStrategies/exponentialRetryStrategy.d.ts.map +0 -1
- package/dist/react-native/retryStrategies/retryStrategy.d.ts.map +0 -1
- package/dist/react-native/retryStrategies/throttlingRetryStrategy.d.ts.map +0 -1
- package/dist/react-native/util/aborterUtils.d.ts.map +0 -1
- package/dist/react-native/util/bytesEncoding-react-native.d.mts.map +0 -1
- package/dist/react-native/util/bytesEncoding.common.d.ts.map +0 -1
- package/dist/react-native/util/checkEnvironment.d.ts.map +0 -1
- package/dist/react-native/util/concat-react-native.d.mts.map +0 -1
- package/dist/react-native/util/concat.common.d.ts.map +0 -1
- package/dist/react-native/util/createAbortablePromise.d.ts.map +0 -1
- package/dist/react-native/util/delay.d.ts.map +0 -1
- package/dist/react-native/util/error.d.ts.map +0 -1
- package/dist/react-native/util/file.d.ts.map +0 -1
- package/dist/react-native/util/helpers.d.ts.map +0 -1
- package/dist/react-native/util/inspect-react-native.d.mts.map +0 -1
- package/dist/react-native/util/inspect.common.d.ts.map +0 -1
- package/dist/react-native/util/object.d.ts.map +0 -1
- package/dist/react-native/util/random.d.ts.map +0 -1
- package/dist/react-native/util/sanitizer.d.ts.map +0 -1
- package/dist/react-native/util/sha256-react-native.d.mts.map +0 -1
- package/dist/react-native/util/sha256.common.d.ts.map +0 -1
- package/dist/react-native/util/tokenCycler.d.ts +0 -45
- package/dist/react-native/util/tokenCycler.d.ts.map +0 -1
- package/dist/react-native/util/tokenCycler.js +0 -162
- package/dist/react-native/util/tokenCycler.js.map +0 -1
- package/dist/react-native/util/typeGuards.d.ts.map +0 -1
- package/dist/react-native/util/userAgent.d.ts.map +0 -1
- package/dist/react-native/util/userAgentPlatform-react-native.d.mts.map +0 -1
- package/dist/react-native/util/uuidUtils-react-native.d.mts.map +0 -1
- package/dist/react-native/util/uuidUtils.common.d.ts.map +0 -1
- package/dist/react-native/xhrHttpClient.d.ts.map +0 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { OAuth2Flow } from "./oauth2Flows.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options used when creating and sending get OAuth 2 requests for this operation.
|
|
4
|
+
*/
|
|
5
|
+
export interface GetOAuth2TokenOptions {
|
|
6
|
+
/** Abort signal for the request */
|
|
7
|
+
abortSignal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Options used when creating and sending get bearer token requests for this operation.
|
|
11
|
+
*/
|
|
12
|
+
export interface GetBearerTokenOptions {
|
|
13
|
+
/** Abort signal for the request */
|
|
14
|
+
abortSignal?: AbortSignal;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Credential for OAuth2 authentication flows.
|
|
18
|
+
*/
|
|
19
|
+
export interface OAuth2TokenCredential<TFlows extends OAuth2Flow> {
|
|
20
|
+
/**
|
|
21
|
+
* Gets an OAuth2 token for the specified flows.
|
|
22
|
+
* @param flows - The OAuth2 flows to use.
|
|
23
|
+
* @param options - Options for the request.
|
|
24
|
+
* @returns - a valid access token which was obtained through one of the flows specified in `flows`.
|
|
25
|
+
*/
|
|
26
|
+
getOAuth2Token(flows: TFlows[], options?: GetOAuth2TokenOptions): Promise<string>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Credential for Bearer token authentication.
|
|
30
|
+
*/
|
|
31
|
+
export interface BearerTokenCredential {
|
|
32
|
+
/**
|
|
33
|
+
* Gets a Bearer token for the specified flows.
|
|
34
|
+
* @param options - Options for the request.
|
|
35
|
+
* @returns - a valid access token.
|
|
36
|
+
*/
|
|
37
|
+
getBearerToken(options?: GetBearerTokenOptions): Promise<string>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Credential for HTTP Basic authentication.
|
|
41
|
+
* Provides username and password for basic authentication headers.
|
|
42
|
+
*/
|
|
43
|
+
export interface BasicCredential {
|
|
44
|
+
/** The username for basic authentication. */
|
|
45
|
+
username: string;
|
|
46
|
+
/** The password for basic authentication. */
|
|
47
|
+
password: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Credential for API Key authentication.
|
|
51
|
+
* Provides an API key that will be used in the request headers.
|
|
52
|
+
*/
|
|
53
|
+
export interface ApiKeyCredential {
|
|
54
|
+
/** The API key for authentication. */
|
|
55
|
+
key: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Union type of all supported authentication credentials.
|
|
59
|
+
*/
|
|
60
|
+
export type ClientCredential = OAuth2TokenCredential<OAuth2Flow> | BearerTokenCredential | BasicCredential | ApiKeyCredential;
|
|
61
|
+
/**
|
|
62
|
+
* Type guard to check if a credential is an OAuth2 token credential.
|
|
63
|
+
*/
|
|
64
|
+
export declare function isOAuth2TokenCredential(credential: ClientCredential): credential is OAuth2TokenCredential<OAuth2Flow>;
|
|
65
|
+
/**
|
|
66
|
+
* Type guard to check if a credential is a Bearer token credential.
|
|
67
|
+
*/
|
|
68
|
+
export declare function isBearerTokenCredential(credential: ClientCredential): credential is BearerTokenCredential;
|
|
69
|
+
/**
|
|
70
|
+
* Type guard to check if a credential is a Basic auth credential.
|
|
71
|
+
*/
|
|
72
|
+
export declare function isBasicCredential(credential: ClientCredential): credential is BasicCredential;
|
|
73
|
+
/**
|
|
74
|
+
* Type guard to check if a credential is an API key credential.
|
|
75
|
+
*/
|
|
76
|
+
export declare function isApiKeyCredential(credential: ClientCredential): credential is ApiKeyCredential;
|
|
77
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* Type guard to check if a credential is an OAuth2 token credential.
|
|
5
|
+
*/
|
|
6
|
+
export function isOAuth2TokenCredential(credential) {
|
|
7
|
+
return "getOAuth2Token" in credential;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Type guard to check if a credential is a Bearer token credential.
|
|
11
|
+
*/
|
|
12
|
+
export function isBearerTokenCredential(credential) {
|
|
13
|
+
return "getBearerToken" in credential;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Type guard to check if a credential is a Basic auth credential.
|
|
17
|
+
*/
|
|
18
|
+
export function isBasicCredential(credential) {
|
|
19
|
+
return "username" in credential && "password" in credential;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Type guard to check if a credential is an API key credential.
|
|
23
|
+
*/
|
|
24
|
+
export function isApiKeyCredential(credential) {
|
|
25
|
+
return "key" in credential;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../src/auth/credentials.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA0ElC;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,UAA4B;IAE5B,OAAO,gBAAgB,IAAI,UAAU,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,UAA4B;IAE5B,OAAO,gBAAgB,IAAI,UAAU,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAA4B;IAC5D,OAAO,UAAU,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAA4B;IAC7D,OAAO,KAAK,IAAI,UAAU,CAAC;AAC7B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OAuth2Flow } from \"./oauth2Flows.js\";\n\n/**\n * Options used when creating and sending get OAuth 2 requests for this operation.\n */\nexport interface GetOAuth2TokenOptions {\n /** Abort signal for the request */\n abortSignal?: AbortSignal;\n}\n\n/**\n * Options used when creating and sending get bearer token requests for this operation.\n */\nexport interface GetBearerTokenOptions {\n /** Abort signal for the request */\n abortSignal?: AbortSignal;\n}\n\n/**\n * Credential for OAuth2 authentication flows.\n */\nexport interface OAuth2TokenCredential<TFlows extends OAuth2Flow> {\n /**\n * Gets an OAuth2 token for the specified flows.\n * @param flows - The OAuth2 flows to use.\n * @param options - Options for the request.\n * @returns - a valid access token which was obtained through one of the flows specified in `flows`.\n */\n getOAuth2Token(flows: TFlows[], options?: GetOAuth2TokenOptions): Promise<string>;\n}\n\n/**\n * Credential for Bearer token authentication.\n */\nexport interface BearerTokenCredential {\n /**\n * Gets a Bearer token for the specified flows.\n * @param options - Options for the request.\n * @returns - a valid access token.\n */\n getBearerToken(options?: GetBearerTokenOptions): Promise<string>;\n}\n\n/**\n * Credential for HTTP Basic authentication.\n * Provides username and password for basic authentication headers.\n */\nexport interface BasicCredential {\n /** The username for basic authentication. */\n username: string;\n /** The password for basic authentication. */\n password: string;\n}\n\n/**\n * Credential for API Key authentication.\n * Provides an API key that will be used in the request headers.\n */\nexport interface ApiKeyCredential {\n /** The API key for authentication. */\n key: string;\n}\n\n/**\n * Union type of all supported authentication credentials.\n */\nexport type ClientCredential =\n | OAuth2TokenCredential<OAuth2Flow>\n | BearerTokenCredential\n | BasicCredential\n | ApiKeyCredential;\n\n/**\n * Type guard to check if a credential is an OAuth2 token credential.\n */\nexport function isOAuth2TokenCredential(\n credential: ClientCredential,\n): credential is OAuth2TokenCredential<OAuth2Flow> {\n return \"getOAuth2Token\" in credential;\n}\n\n/**\n * Type guard to check if a credential is a Bearer token credential.\n */\nexport function isBearerTokenCredential(\n credential: ClientCredential,\n): credential is BearerTokenCredential {\n return \"getBearerToken\" in credential;\n}\n\n/**\n * Type guard to check if a credential is a Basic auth credential.\n */\nexport function isBasicCredential(credential: ClientCredential): credential is BasicCredential {\n return \"username\" in credential && \"password\" in credential;\n}\n\n/**\n * Type guard to check if a credential is an API key credential.\n */\nexport function isApiKeyCredential(credential: ClientCredential): credential is ApiKeyCredential {\n return \"key\" in credential;\n}\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents OAuth2 Authorization Code flow configuration.
|
|
3
|
+
*/
|
|
4
|
+
export interface AuthorizationCodeFlow {
|
|
5
|
+
/** Type of OAuth2 flow */
|
|
6
|
+
kind: "authorizationCode";
|
|
7
|
+
/** Authorization endpoint */
|
|
8
|
+
authorizationUrl: string;
|
|
9
|
+
/** Token endpoint */
|
|
10
|
+
tokenUrl: string;
|
|
11
|
+
/** Refresh token endpoint */
|
|
12
|
+
refreshUrl?: string;
|
|
13
|
+
/** OAuth2 scopes */
|
|
14
|
+
scopes?: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Represents OAuth2 Client Credentials flow configuration.
|
|
18
|
+
*/
|
|
19
|
+
export interface ClientCredentialsFlow {
|
|
20
|
+
/** Type of OAuth2 flow */
|
|
21
|
+
kind: "clientCredentials";
|
|
22
|
+
/** Token endpoint */
|
|
23
|
+
tokenUrl: string;
|
|
24
|
+
/** Refresh token endpoints */
|
|
25
|
+
refreshUrl?: string[];
|
|
26
|
+
/** OAuth2 scopes */
|
|
27
|
+
scopes?: string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Represents OAuth2 Implicit flow configuration.
|
|
31
|
+
*/
|
|
32
|
+
export interface ImplicitFlow {
|
|
33
|
+
/** Type of OAuth2 flow */
|
|
34
|
+
kind: "implicit";
|
|
35
|
+
/** Authorization endpoint */
|
|
36
|
+
authorizationUrl: string;
|
|
37
|
+
/** Refresh token endpoint */
|
|
38
|
+
refreshUrl?: string;
|
|
39
|
+
/** OAuth2 scopes */
|
|
40
|
+
scopes?: string[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Represents OAuth2 Password flow configuration.
|
|
44
|
+
*/
|
|
45
|
+
export interface PasswordFlow {
|
|
46
|
+
/** Type of OAuth2 flow */
|
|
47
|
+
kind: "password";
|
|
48
|
+
/** Token endpoint */
|
|
49
|
+
tokenUrl: string;
|
|
50
|
+
/** Refresh token endpoint */
|
|
51
|
+
refreshUrl?: string;
|
|
52
|
+
/** OAuth2 scopes */
|
|
53
|
+
scopes?: string[];
|
|
54
|
+
}
|
|
55
|
+
/** Union type of all supported OAuth2 flows */
|
|
56
|
+
export type OAuth2Flow = AuthorizationCodeFlow | ClientCredentialsFlow | ImplicitFlow | PasswordFlow;
|
|
57
|
+
//# sourceMappingURL=oauth2Flows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth2Flows.js","sourceRoot":"","sources":["../../../src/auth/oauth2Flows.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Represents OAuth2 Authorization Code flow configuration.\n */\nexport interface AuthorizationCodeFlow {\n /** Type of OAuth2 flow */\n kind: \"authorizationCode\";\n /** Authorization endpoint */\n authorizationUrl: string;\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Client Credentials flow configuration.\n */\nexport interface ClientCredentialsFlow {\n /** Type of OAuth2 flow */\n kind: \"clientCredentials\";\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoints */\n refreshUrl?: string[];\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Implicit flow configuration.\n */\nexport interface ImplicitFlow {\n /** Type of OAuth2 flow */\n kind: \"implicit\";\n /** Authorization endpoint */\n authorizationUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Password flow configuration.\n */\nexport interface PasswordFlow {\n /** Type of OAuth2 flow */\n kind: \"password\";\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/** Union type of all supported OAuth2 flows */\nexport type OAuth2Flow =\n | AuthorizationCodeFlow\n | ClientCredentialsFlow\n | ImplicitFlow\n | PasswordFlow;\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { OAuth2Flow } from "./oauth2Flows.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents HTTP Basic authentication scheme.
|
|
4
|
+
* Basic authentication scheme requires a username and password to be provided with each request.
|
|
5
|
+
* The credentials are encoded using Base64 and included in the Authorization header.
|
|
6
|
+
*/
|
|
7
|
+
export interface BasicAuthScheme {
|
|
8
|
+
/** Type of auth scheme */
|
|
9
|
+
kind: "http";
|
|
10
|
+
/** Basic authentication scheme */
|
|
11
|
+
scheme: "basic";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Represents HTTP Bearer authentication scheme.
|
|
15
|
+
* Bearer authentication scheme requires a bearer token to be provided with each request.
|
|
16
|
+
* The token is included in the Authorization header with the "Bearer" prefix.
|
|
17
|
+
*/
|
|
18
|
+
export interface BearerAuthScheme {
|
|
19
|
+
/** Type of auth scheme */
|
|
20
|
+
kind: "http";
|
|
21
|
+
/** Bearer authentication scheme */
|
|
22
|
+
scheme: "bearer";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Represents an endpoint or operation that requires no authentication.
|
|
26
|
+
*/
|
|
27
|
+
export interface NoAuthAuthScheme {
|
|
28
|
+
/** Type of auth scheme */
|
|
29
|
+
kind: "noAuth";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Represents API Key authentication scheme.
|
|
33
|
+
* API Key authentication requires a key to be provided with each request.
|
|
34
|
+
* The key can be provided in different locations: query parameter, header, or cookie.
|
|
35
|
+
*/
|
|
36
|
+
export interface ApiKeyAuthScheme {
|
|
37
|
+
/** Type of auth scheme */
|
|
38
|
+
kind: "apiKey";
|
|
39
|
+
/** Location of the API key */
|
|
40
|
+
apiKeyLocation: "query" | "header" | "cookie";
|
|
41
|
+
/** Name of the API key parameter */
|
|
42
|
+
name: string;
|
|
43
|
+
}
|
|
44
|
+
/** Represents OAuth2 authentication scheme with specified flows */
|
|
45
|
+
export interface OAuth2AuthScheme<TFlows extends OAuth2Flow[]> {
|
|
46
|
+
/** Type of auth scheme */
|
|
47
|
+
kind: "oauth2";
|
|
48
|
+
/** Supported OAuth2 flows */
|
|
49
|
+
flows: TFlows;
|
|
50
|
+
}
|
|
51
|
+
/** Union type of all supported authentication schemes */
|
|
52
|
+
export type AuthScheme = BasicAuthScheme | BearerAuthScheme | NoAuthAuthScheme | ApiKeyAuthScheme | OAuth2AuthScheme<OAuth2Flow[]>;
|
|
53
|
+
//# sourceMappingURL=schemes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemes.js","sourceRoot":"","sources":["../../../src/auth/schemes.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OAuth2Flow } from \"./oauth2Flows.js\";\n\n/**\n * Represents HTTP Basic authentication scheme.\n * Basic authentication scheme requires a username and password to be provided with each request.\n * The credentials are encoded using Base64 and included in the Authorization header.\n */\nexport interface BasicAuthScheme {\n /** Type of auth scheme */\n kind: \"http\";\n /** Basic authentication scheme */\n scheme: \"basic\";\n}\n\n/**\n * Represents HTTP Bearer authentication scheme.\n * Bearer authentication scheme requires a bearer token to be provided with each request.\n * The token is included in the Authorization header with the \"Bearer\" prefix.\n */\nexport interface BearerAuthScheme {\n /** Type of auth scheme */\n kind: \"http\";\n /** Bearer authentication scheme */\n scheme: \"bearer\";\n}\n\n/**\n * Represents an endpoint or operation that requires no authentication.\n */\nexport interface NoAuthAuthScheme {\n /** Type of auth scheme */\n kind: \"noAuth\";\n}\n\n/**\n * Represents API Key authentication scheme.\n * API Key authentication requires a key to be provided with each request.\n * The key can be provided in different locations: query parameter, header, or cookie.\n */\nexport interface ApiKeyAuthScheme {\n /** Type of auth scheme */\n kind: \"apiKey\";\n /** Location of the API key */\n apiKeyLocation: \"query\" | \"header\" | \"cookie\";\n /** Name of the API key parameter */\n name: string;\n}\n\n/** Represents OAuth2 authentication scheme with specified flows */\nexport interface OAuth2AuthScheme<TFlows extends OAuth2Flow[]> {\n /** Type of auth scheme */\n kind: \"oauth2\";\n /** Supported OAuth2 flows */\n flows: TFlows;\n}\n\n/** Union type of all supported authentication schemes */\nexport type AuthScheme =\n | BasicAuthScheme\n | BearerAuthScheme\n | NoAuthAuthScheme\n | ApiKeyAuthScheme\n | OAuth2AuthScheme<OAuth2Flow[]>;\n"]}
|
|
@@ -1,28 +1,9 @@
|
|
|
1
1
|
import type { HttpClient } from "../interfaces.js";
|
|
2
2
|
import type { Pipeline } from "../pipeline.js";
|
|
3
|
-
import type { TokenCredential } from "../auth/tokenCredential.js";
|
|
4
|
-
import type { KeyCredential } from "../auth/keyCredential.js";
|
|
5
3
|
import type { ClientOptions } from "./common.js";
|
|
6
|
-
/**
|
|
7
|
-
* Optional parameters for adding a credential policy to the pipeline.
|
|
8
|
-
*/
|
|
9
|
-
export interface AddCredentialPipelinePolicyOptions {
|
|
10
|
-
/**
|
|
11
|
-
* Options related to the client.
|
|
12
|
-
*/
|
|
13
|
-
clientOptions?: ClientOptions;
|
|
14
|
-
/**
|
|
15
|
-
* The credential to use.
|
|
16
|
-
*/
|
|
17
|
-
credential?: TokenCredential | KeyCredential;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Adds a credential policy to the pipeline if a credential is provided. If none is provided, no policy is added.
|
|
21
|
-
*/
|
|
22
|
-
export declare function addCredentialPipelinePolicy(pipeline: Pipeline, endpoint: string, options?: AddCredentialPipelinePolicyOptions): void;
|
|
23
4
|
/**
|
|
24
5
|
* Creates a default rest pipeline to re-use accross Rest Level Clients
|
|
25
6
|
*/
|
|
26
|
-
export declare function createDefaultPipeline(
|
|
7
|
+
export declare function createDefaultPipeline(options?: ClientOptions): Pipeline;
|
|
27
8
|
export declare function getCachedDefaultHttpsClient(): HttpClient;
|
|
28
9
|
//# sourceMappingURL=clientHelpers.d.ts.map
|
|
@@ -1,44 +1,35 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { bearerTokenAuthenticationPolicy } from "../policies/bearerTokenAuthenticationPolicy.js";
|
|
4
3
|
import { createDefaultHttpClient } from "../defaultHttpClient.js";
|
|
5
4
|
import { createPipelineFromOptions } from "../createPipelineFromOptions.js";
|
|
6
|
-
import { isTokenCredential } from "../auth/tokenCredential.js";
|
|
7
|
-
import { isKeyCredential } from "../auth/keyCredential.js";
|
|
8
5
|
import { apiVersionPolicy } from "./apiVersionPolicy.js";
|
|
9
|
-
import {
|
|
6
|
+
import { isApiKeyCredential, isBasicCredential, isBearerTokenCredential, isOAuth2TokenCredential, } from "../auth/credentials.js";
|
|
7
|
+
import { apiKeyAuthenticationPolicy } from "../policies/auth/apiKeyAuthenticationPolicy.js";
|
|
8
|
+
import { basicAuthenticationPolicy } from "../policies/auth/basicAuthenticationPolicy.js";
|
|
9
|
+
import { bearerAuthenticationPolicy } from "../policies/auth/bearerAuthenticationPolicy.js";
|
|
10
|
+
import { oauth2AuthenticationPolicy } from "../policies/auth/oauth2AuthenticationPolicy.js";
|
|
10
11
|
let cachedHttpClient;
|
|
11
|
-
/**
|
|
12
|
-
* Adds a credential policy to the pipeline if a credential is provided. If none is provided, no policy is added.
|
|
13
|
-
*/
|
|
14
|
-
export function addCredentialPipelinePolicy(pipeline, endpoint, options = {}) {
|
|
15
|
-
var _a, _b, _c, _d;
|
|
16
|
-
const { credential, clientOptions } = options;
|
|
17
|
-
if (!credential) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
if (isTokenCredential(credential)) {
|
|
21
|
-
const tokenPolicy = bearerTokenAuthenticationPolicy({
|
|
22
|
-
credential,
|
|
23
|
-
scopes: (_b = (_a = clientOptions === null || clientOptions === void 0 ? void 0 : clientOptions.credentials) === null || _a === void 0 ? void 0 : _a.scopes) !== null && _b !== void 0 ? _b : `${endpoint}/.default`,
|
|
24
|
-
});
|
|
25
|
-
pipeline.addPolicy(tokenPolicy);
|
|
26
|
-
}
|
|
27
|
-
else if (isKeyCredential(credential)) {
|
|
28
|
-
if (!((_c = clientOptions === null || clientOptions === void 0 ? void 0 : clientOptions.credentials) === null || _c === void 0 ? void 0 : _c.apiKeyHeaderName)) {
|
|
29
|
-
throw new Error(`Missing API Key Header Name`);
|
|
30
|
-
}
|
|
31
|
-
const keyPolicy = keyCredentialAuthenticationPolicy(credential, (_d = clientOptions === null || clientOptions === void 0 ? void 0 : clientOptions.credentials) === null || _d === void 0 ? void 0 : _d.apiKeyHeaderName);
|
|
32
|
-
pipeline.addPolicy(keyPolicy);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
12
|
/**
|
|
36
13
|
* Creates a default rest pipeline to re-use accross Rest Level Clients
|
|
37
14
|
*/
|
|
38
|
-
export function createDefaultPipeline(
|
|
15
|
+
export function createDefaultPipeline(options = {}) {
|
|
39
16
|
const pipeline = createPipelineFromOptions(options);
|
|
40
17
|
pipeline.addPolicy(apiVersionPolicy(options));
|
|
41
|
-
|
|
18
|
+
const { credential, authSchemes } = options;
|
|
19
|
+
if (credential) {
|
|
20
|
+
if (isApiKeyCredential(credential)) {
|
|
21
|
+
pipeline.addPolicy(apiKeyAuthenticationPolicy({ authSchemes, credential }));
|
|
22
|
+
}
|
|
23
|
+
else if (isBasicCredential(credential)) {
|
|
24
|
+
pipeline.addPolicy(basicAuthenticationPolicy({ authSchemes, credential }));
|
|
25
|
+
}
|
|
26
|
+
else if (isBearerTokenCredential(credential)) {
|
|
27
|
+
pipeline.addPolicy(bearerAuthenticationPolicy({ authSchemes, credential }));
|
|
28
|
+
}
|
|
29
|
+
else if (isOAuth2TokenCredential(credential)) {
|
|
30
|
+
pipeline.addPolicy(oauth2AuthenticationPolicy({ authSchemes, credential }));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
42
33
|
return pipeline;
|
|
43
34
|
}
|
|
44
35
|
export function getCachedDefaultHttpsClient() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientHelpers.js","sourceRoot":"","sources":["../../../src/client/clientHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"clientHelpers.js","sourceRoot":"","sources":["../../../src/client/clientHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAE5F,IAAI,gBAAwC,CAAC;AAE7C;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAyB,EAAE;IAC/D,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEpD,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAE9C,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAC5C,IAAI,UAAU,EAAE,CAAC;QACf,IAAI,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;YACnC,QAAQ,CAAC,SAAS,CAAC,0BAA0B,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;QAC9E,CAAC;aAAM,IAAI,iBAAiB,CAAC,UAAU,CAAC,EAAE,CAAC;YACzC,QAAQ,CAAC,SAAS,CAAC,yBAAyB,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;QAC7E,CAAC;aAAM,IAAI,uBAAuB,CAAC,UAAU,CAAC,EAAE,CAAC;YAC/C,QAAQ,CAAC,SAAS,CAAC,0BAA0B,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;QAC9E,CAAC;aAAM,IAAI,uBAAuB,CAAC,UAAU,CAAC,EAAE,CAAC;YAC/C,QAAQ,CAAC,SAAS,CAAC,0BAA0B,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,GAAG,uBAAuB,EAAE,CAAC;IAC/C,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { HttpClient } from \"../interfaces.js\";\nimport type { Pipeline } from \"../pipeline.js\";\nimport { createDefaultHttpClient } from \"../defaultHttpClient.js\";\nimport { createPipelineFromOptions } from \"../createPipelineFromOptions.js\";\nimport type { ClientOptions } from \"./common.js\";\nimport { apiVersionPolicy } from \"./apiVersionPolicy.js\";\nimport {\n isApiKeyCredential,\n isBasicCredential,\n isBearerTokenCredential,\n isOAuth2TokenCredential,\n} from \"../auth/credentials.js\";\nimport { apiKeyAuthenticationPolicy } from \"../policies/auth/apiKeyAuthenticationPolicy.js\";\nimport { basicAuthenticationPolicy } from \"../policies/auth/basicAuthenticationPolicy.js\";\nimport { bearerAuthenticationPolicy } from \"../policies/auth/bearerAuthenticationPolicy.js\";\nimport { oauth2AuthenticationPolicy } from \"../policies/auth/oauth2AuthenticationPolicy.js\";\n\nlet cachedHttpClient: HttpClient | undefined;\n\n/**\n * Creates a default rest pipeline to re-use accross Rest Level Clients\n */\nexport function createDefaultPipeline(options: ClientOptions = {}): Pipeline {\n const pipeline = createPipelineFromOptions(options);\n\n pipeline.addPolicy(apiVersionPolicy(options));\n\n const { credential, authSchemes } = options;\n if (credential) {\n if (isApiKeyCredential(credential)) {\n pipeline.addPolicy(apiKeyAuthenticationPolicy({ authSchemes, credential }));\n } else if (isBasicCredential(credential)) {\n pipeline.addPolicy(basicAuthenticationPolicy({ authSchemes, credential }));\n } else if (isBearerTokenCredential(credential)) {\n pipeline.addPolicy(bearerAuthenticationPolicy({ authSchemes, credential }));\n } else if (isOAuth2TokenCredential(credential)) {\n pipeline.addPolicy(oauth2AuthenticationPolicy({ authSchemes, credential }));\n }\n }\n\n return pipeline;\n}\n\nexport function getCachedDefaultHttpsClient(): HttpClient {\n if (!cachedHttpClient) {\n cachedHttpClient = createDefaultHttpClient();\n }\n\n return cachedHttpClient;\n}\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { HttpClient, PipelineRequest, PipelineResponse, RawHttpHeaders, RequestBodyType, TransferProgressEvent, RawHttpHeadersInput } from "../interfaces.js";
|
|
2
2
|
import type { Pipeline, PipelinePolicy } from "../pipeline.js";
|
|
3
|
-
import type { AbortSignalLike } from "../abort-controller/AbortSignalLike.js";
|
|
4
3
|
import type { PipelineOptions } from "../createPipelineFromOptions.js";
|
|
5
4
|
import type { LogPolicyOptions } from "../policies/logPolicy.js";
|
|
5
|
+
import type { AuthScheme } from "../auth/schemes.js";
|
|
6
|
+
import type { ClientCredential } from "../auth/credentials.js";
|
|
6
7
|
/**
|
|
7
8
|
* Shape of the default request parameters, this may be overridden by the specific
|
|
8
9
|
* request types to provide strong types
|
|
@@ -54,7 +55,7 @@ export type RequestParameters = {
|
|
|
54
55
|
/**
|
|
55
56
|
* The signal which can be used to abort requests.
|
|
56
57
|
*/
|
|
57
|
-
abortSignal?:
|
|
58
|
+
abortSignal?: AbortSignal;
|
|
58
59
|
/**
|
|
59
60
|
* A function to be called each time a response is received from the server
|
|
60
61
|
* while performing the requested operation.
|
|
@@ -93,7 +94,7 @@ export interface OperationOptions {
|
|
|
93
94
|
/**
|
|
94
95
|
* The signal which can be used to abort requests.
|
|
95
96
|
*/
|
|
96
|
-
abortSignal?:
|
|
97
|
+
abortSignal?: AbortSignal;
|
|
97
98
|
/**
|
|
98
99
|
* Options used when creating and sending HTTP requests for this operation.
|
|
99
100
|
*/
|
|
@@ -153,7 +154,7 @@ export interface Client {
|
|
|
153
154
|
* This method will be used to send request that would check the path to provide
|
|
154
155
|
* strong types. When used by the codegen this type gets overridden with the generated
|
|
155
156
|
* types. For example:
|
|
156
|
-
* ```typescript snippet:
|
|
157
|
+
* ```typescript snippet:ReadmeSamplePathExample
|
|
157
158
|
* import { Client } from "@typespec/ts-http-runtime";
|
|
158
159
|
*
|
|
159
160
|
* type MyClient = Client & {
|
|
@@ -190,7 +191,14 @@ export type HttpBrowserStreamResponse = HttpResponse & {
|
|
|
190
191
|
* a raw stream
|
|
191
192
|
*/
|
|
192
193
|
export type StreamableMethod<TResponse = PathUncheckedResponse> = PromiseLike<TResponse> & {
|
|
194
|
+
/**
|
|
195
|
+
* Returns the response body as a NodeJS stream. Only available in Node-like environments.
|
|
196
|
+
*/
|
|
193
197
|
asNodeStream: () => Promise<HttpNodeStreamResponse>;
|
|
198
|
+
/**
|
|
199
|
+
* Returns the response body as a browser (Web) stream. Only available in the browser. If you require a Web Stream of the response in Node, consider using the
|
|
200
|
+
* `Readable.toWeb` Node API on the result of `asNodeStream`.
|
|
201
|
+
*/
|
|
194
202
|
asBrowserStream: () => Promise<HttpBrowserStreamResponse>;
|
|
195
203
|
};
|
|
196
204
|
/**
|
|
@@ -255,18 +263,15 @@ export interface AdditionalPolicyConfig {
|
|
|
255
263
|
*/
|
|
256
264
|
export type ClientOptions = PipelineOptions & {
|
|
257
265
|
/**
|
|
258
|
-
*
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
*/
|
|
268
|
-
apiKeyHeaderName?: string;
|
|
269
|
-
};
|
|
266
|
+
* List of authentication schemes supported by the client.
|
|
267
|
+
* These schemes define how the client can authenticate requests.
|
|
268
|
+
*/
|
|
269
|
+
authSchemes?: AuthScheme[];
|
|
270
|
+
/**
|
|
271
|
+
* The credential used to authenticate requests.
|
|
272
|
+
* Must be compatible with one of the specified authentication schemes.
|
|
273
|
+
*/
|
|
274
|
+
credential?: ClientCredential;
|
|
270
275
|
/**
|
|
271
276
|
* Endpoint for the client
|
|
272
277
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/client/common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n HttpClient,\n PipelineRequest,\n PipelineResponse,\n RawHttpHeaders,\n RequestBodyType,\n TransferProgressEvent,\n RawHttpHeadersInput,\n} from \"../interfaces.js\";\nimport type { Pipeline, PipelinePolicy } from \"../pipeline.js\";\nimport type { AbortSignalLike } from \"../abort-controller/AbortSignalLike.js\";\nimport type { PipelineOptions } from \"../createPipelineFromOptions.js\";\nimport type { LogPolicyOptions } from \"../policies/logPolicy.js\";\n\n/**\n * Shape of the default request parameters, this may be overridden by the specific\n * request types to provide strong types\n */\nexport type RequestParameters = {\n /**\n * Headers to send along with the request\n */\n headers?: RawHttpHeadersInput;\n /**\n * Sets the accept header to send to the service\n * defaults to 'application/json'. If also a header \"accept\" is set\n * this property will take precedence.\n */\n accept?: string;\n /**\n * Body to send with the request\n */\n body?: unknown;\n /**\n * Query parameters to send with the request\n */\n queryParameters?: Record<string, unknown>;\n /**\n * Set an explicit content-type to send with the request. If also a header \"content-type\" is set\n * this property will take precedence.\n */\n contentType?: string;\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n /** Set to true if you want to skip encoding the path parameters */\n skipUrlEncoding?: boolean;\n /**\n * Path parameters for custom the base url\n */\n pathParameters?: Record<string, any>;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n};\n\n/**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n// UNBRANDED DIFFERENCE: onResponse callback does not have a second __legacyError parameter which was provided for backwards compatibility\nexport type RawResponseCallback = (rawResponse: FullOperationResponse, error?: unknown) => void;\n\n/**\n * Wrapper object for http request and response. Deserialized object is stored in\n * the `parsedBody` property when the response body is received in JSON.\n */\nexport interface FullOperationResponse extends PipelineResponse {\n /**\n * The raw HTTP response headers.\n */\n rawHeaders?: RawHttpHeaders;\n\n /**\n * The response body as parsed JSON.\n */\n parsedBody?: RequestBodyType;\n\n /**\n * The request that generated the response.\n */\n request: PipelineRequest;\n}\n\n/**\n * The base options type for all operations.\n */\nexport interface OperationOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: OperationRequestOptions;\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n}\n\n/**\n * Options used when creating and sending HTTP requests for this operation.\n */\nexport interface OperationRequestOptions {\n /**\n * User defined custom request headers that\n * will be applied before the request is sent.\n */\n headers?: RawHttpHeadersInput;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Set to true if the request is sent over HTTP instead of HTTPS\n */\n allowInsecureConnection?: boolean;\n\n /**\n * Set to true if you want to skip encoding the path parameters\n */\n skipUrlEncoding?: boolean;\n}\n\n/**\n * Type to use with pathUnchecked, overrides the body type to any to allow flexibility\n */\nexport type PathUncheckedResponse = HttpResponse & { body: any };\n\n/**\n * Shape of a Rest Level Client\n */\nexport interface Client {\n /**\n * The pipeline used by this client to make requests\n */\n pipeline: Pipeline;\n /**\n * This method will be used to send request that would check the path to provide\n * strong types. When used by the codegen this type gets overridden with the generated\n * types. For example:\n * ```typescript snippet:path_example\n * import { Client } from \"@typespec/ts-http-runtime\";\n *\n * type MyClient = Client & {\n * path: Routes;\n * };\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n path: Function;\n /**\n * This method allows arbitrary paths and doesn't provide strong types\n */\n pathUnchecked: PathUnchecked;\n}\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpNodeStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: NodeJS.ReadableStream;\n};\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpBrowserStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: ReadableStream<Uint8Array>;\n};\n\n/**\n * Defines the type for a method that supports getting the response body as\n * a raw stream\n */\nexport type StreamableMethod<TResponse = PathUncheckedResponse> = PromiseLike<TResponse> & {\n asNodeStream: () => Promise<HttpNodeStreamResponse>;\n asBrowserStream: () => Promise<HttpBrowserStreamResponse>;\n};\n\n/**\n * Defines the signature for pathUnchecked.\n */\nexport type PathUnchecked = <TPath extends string>(\n path: TPath,\n ...args: PathParameters<TPath>\n) => ResourceMethods<StreamableMethod>;\n\n/**\n * Defines the methods that can be called on a resource\n */\nexport interface ResourceMethods<TResponse = PromiseLike<PathUncheckedResponse>> {\n /**\n * Definition of the GET HTTP method for a resource\n */\n get: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the POST HTTP method for a resource\n */\n post: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PUT HTTP method for a resource\n */\n put: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PATCH HTTP method for a resource\n */\n patch: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the DELETE HTTP method for a resource\n */\n delete: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the HEAD HTTP method for a resource\n */\n head: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the OPTIONS HTTP method for a resource\n */\n options: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the TRACE HTTP method for a resource\n */\n trace: (options?: RequestParameters) => TResponse;\n}\n\n/**\n * Used to configure additional policies added to the pipeline at construction.\n */\nexport interface AdditionalPolicyConfig {\n /**\n * A policy to be added.\n */\n policy: PipelinePolicy;\n /**\n * Determines if this policy be applied before or after retry logic.\n * Only use `perRetry` if you need to modify the request again\n * each time the operation is retried due to retryable service\n * issues.\n */\n position: \"perCall\" | \"perRetry\";\n}\n\n/**\n * General options that a Rest Level Client can take\n */\nexport type ClientOptions = PipelineOptions & {\n /**\n * Credentials information\n */\n credentials?: {\n /**\n * Authentication scopes for AAD\n */\n scopes?: string[];\n /**\n * Heder name for Client Secret authentication\n */\n apiKeyHeaderName?: string;\n };\n\n // UNBRANDED DIFFERENCE: The deprecated baseUrl property is removed in favor of the endpoint property in the unbranded Core package\n\n /**\n * Endpoint for the client\n */\n endpoint?: string;\n /**\n * Options for setting a custom apiVersion.\n */\n apiVersion?: string;\n /**\n * Option to allow calling http (insecure) endpoints\n */\n allowInsecureConnection?: boolean;\n /**\n * Additional policies to include in the HTTP pipeline.\n */\n additionalPolicies?: AdditionalPolicyConfig[];\n /**\n * Specify a custom HttpClient when making requests.\n */\n httpClient?: HttpClient;\n /**\n * Options to configure request/response logging.\n */\n loggingOptions?: LogPolicyOptions;\n};\n\n/**\n * Represents the shape of an HttpResponse\n */\nexport type HttpResponse = {\n /**\n * The request that generated this response.\n */\n request: PipelineRequest;\n /**\n * The HTTP response headers.\n */\n headers: RawHttpHeaders;\n /**\n * Parsed body\n */\n body: unknown;\n /**\n * The HTTP status code of the response.\n */\n status: string;\n};\n\n/**\n * Helper type used to detect parameters in a path template\n * text surrounded by \\{\\} will be considered a path parameter\n */\nexport type PathParameters<\n TRoute extends string,\n // This is trying to match the string in TRoute with a template where HEAD/{PARAM}/TAIL\n // for example in the followint path: /foo/{fooId}/bar/{barId}/baz the template will infer\n // HEAD: /foo\n // Param: fooId\n // Tail: /bar/{barId}/baz\n // The above sample path would return [pathParam: string, pathParam: string]\n> = TRoute extends `${infer _Head}/{${infer _Param}}${infer Tail}`\n ? // In case we have a match for the template above we know for sure\n // that we have at least one pathParameter, that's why we set the first pathParam\n // in the tuple. At this point we have only matched up until param, if we want to identify\n // additional parameters we can call RouteParameters recursively on the Tail to match the remaining parts,\n // in case the Tail has more parameters, it will return a tuple with the parameters found in tail.\n // We spread the second path params to end up with a single dimension tuple at the end.\n [\n pathParameter: string | number | PathParameterWithOptions,\n ...pathParameters: PathParameters<Tail>,\n ]\n : // When the path doesn't match the template, it means that we have no path parameters so we return\n // an empty tuple.\n [];\n\n/** A response containing error details. */\nexport interface ErrorResponse {\n /** The error object. */\n error: ErrorModel;\n}\n\n/** The error object. */\nexport interface ErrorModel {\n /** One of a server-defined set of error codes. */\n code: string;\n /** A human-readable representation of the error. */\n message: string;\n /** The target of the error. */\n target?: string;\n /** An array of details about specific errors that led to this reported error. */\n details: Array<ErrorModel>;\n /** An object containing more specific information than the current object about the error. */\n innererror?: InnerError;\n}\n\n/** An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. */\nexport interface InnerError {\n /** One of a server-defined set of error codes. */\n code: string;\n /** Inner error. */\n innererror?: InnerError;\n}\n\n/**\n * An object that can be passed as a path parameter, allowing for additional options to be set relating to how the parameter is encoded.\n */\nexport interface PathParameterWithOptions {\n /**\n * The value of the parameter.\n */\n value: string | number;\n\n /**\n * Whether to allow for reserved characters in the value. If set to true, special characters such as '/' in the parameter's value will not be URL encoded.\n * Defaults to false.\n */\n allowReserved?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/client/common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n HttpClient,\n PipelineRequest,\n PipelineResponse,\n RawHttpHeaders,\n RequestBodyType,\n TransferProgressEvent,\n RawHttpHeadersInput,\n} from \"../interfaces.js\";\nimport type { Pipeline, PipelinePolicy } from \"../pipeline.js\";\nimport type { PipelineOptions } from \"../createPipelineFromOptions.js\";\nimport type { LogPolicyOptions } from \"../policies/logPolicy.js\";\nimport type { AuthScheme } from \"../auth/schemes.js\";\nimport type { ClientCredential } from \"../auth/credentials.js\";\n\n/**\n * Shape of the default request parameters, this may be overridden by the specific\n * request types to provide strong types\n */\nexport type RequestParameters = {\n /**\n * Headers to send along with the request\n */\n headers?: RawHttpHeadersInput;\n /**\n * Sets the accept header to send to the service\n * defaults to 'application/json'. If also a header \"accept\" is set\n * this property will take precedence.\n */\n accept?: string;\n /**\n * Body to send with the request\n */\n body?: unknown;\n /**\n * Query parameters to send with the request\n */\n queryParameters?: Record<string, unknown>;\n /**\n * Set an explicit content-type to send with the request. If also a header \"content-type\" is set\n * this property will take precedence.\n */\n contentType?: string;\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n /** Set to true if you want to skip encoding the path parameters */\n skipUrlEncoding?: boolean;\n /**\n * Path parameters for custom the base url\n */\n pathParameters?: Record<string, any>;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignal;\n\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n};\n\n/**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n// UNBRANDED DIFFERENCE: onResponse callback does not have a second __legacyError parameter which was provided for backwards compatibility\nexport type RawResponseCallback = (rawResponse: FullOperationResponse, error?: unknown) => void;\n\n/**\n * Wrapper object for http request and response. Deserialized object is stored in\n * the `parsedBody` property when the response body is received in JSON.\n */\nexport interface FullOperationResponse extends PipelineResponse {\n /**\n * The raw HTTP response headers.\n */\n rawHeaders?: RawHttpHeaders;\n\n /**\n * The response body as parsed JSON.\n */\n parsedBody?: RequestBodyType;\n\n /**\n * The request that generated the response.\n */\n request: PipelineRequest;\n}\n\n/**\n * The base options type for all operations.\n */\nexport interface OperationOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignal;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: OperationRequestOptions;\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n}\n\n/**\n * Options used when creating and sending HTTP requests for this operation.\n */\nexport interface OperationRequestOptions {\n /**\n * User defined custom request headers that\n * will be applied before the request is sent.\n */\n headers?: RawHttpHeadersInput;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Set to true if the request is sent over HTTP instead of HTTPS\n */\n allowInsecureConnection?: boolean;\n\n /**\n * Set to true if you want to skip encoding the path parameters\n */\n skipUrlEncoding?: boolean;\n}\n\n/**\n * Type to use with pathUnchecked, overrides the body type to any to allow flexibility\n */\nexport type PathUncheckedResponse = HttpResponse & { body: any };\n\n/**\n * Shape of a Rest Level Client\n */\nexport interface Client {\n /**\n * The pipeline used by this client to make requests\n */\n pipeline: Pipeline;\n /**\n * This method will be used to send request that would check the path to provide\n * strong types. When used by the codegen this type gets overridden with the generated\n * types. For example:\n * ```typescript snippet:ReadmeSamplePathExample\n * import { Client } from \"@typespec/ts-http-runtime\";\n *\n * type MyClient = Client & {\n * path: Routes;\n * };\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n path: Function;\n /**\n * This method allows arbitrary paths and doesn't provide strong types\n */\n pathUnchecked: PathUnchecked;\n}\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpNodeStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: NodeJS.ReadableStream;\n};\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpBrowserStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: ReadableStream<Uint8Array>;\n};\n\n/**\n * Defines the type for a method that supports getting the response body as\n * a raw stream\n */\nexport type StreamableMethod<TResponse = PathUncheckedResponse> = PromiseLike<TResponse> & {\n /**\n * Returns the response body as a NodeJS stream. Only available in Node-like environments.\n */\n asNodeStream: () => Promise<HttpNodeStreamResponse>;\n /**\n * Returns the response body as a browser (Web) stream. Only available in the browser. If you require a Web Stream of the response in Node, consider using the\n * `Readable.toWeb` Node API on the result of `asNodeStream`.\n */\n asBrowserStream: () => Promise<HttpBrowserStreamResponse>;\n};\n\n/**\n * Defines the signature for pathUnchecked.\n */\nexport type PathUnchecked = <TPath extends string>(\n path: TPath,\n ...args: PathParameters<TPath>\n) => ResourceMethods<StreamableMethod>;\n\n/**\n * Defines the methods that can be called on a resource\n */\nexport interface ResourceMethods<TResponse = PromiseLike<PathUncheckedResponse>> {\n /**\n * Definition of the GET HTTP method for a resource\n */\n get: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the POST HTTP method for a resource\n */\n post: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PUT HTTP method for a resource\n */\n put: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PATCH HTTP method for a resource\n */\n patch: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the DELETE HTTP method for a resource\n */\n delete: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the HEAD HTTP method for a resource\n */\n head: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the OPTIONS HTTP method for a resource\n */\n options: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the TRACE HTTP method for a resource\n */\n trace: (options?: RequestParameters) => TResponse;\n}\n\n/**\n * Used to configure additional policies added to the pipeline at construction.\n */\nexport interface AdditionalPolicyConfig {\n /**\n * A policy to be added.\n */\n policy: PipelinePolicy;\n /**\n * Determines if this policy be applied before or after retry logic.\n * Only use `perRetry` if you need to modify the request again\n * each time the operation is retried due to retryable service\n * issues.\n */\n position: \"perCall\" | \"perRetry\";\n}\n\n/**\n * General options that a Rest Level Client can take\n */\nexport type ClientOptions = PipelineOptions & {\n /**\n * List of authentication schemes supported by the client.\n * These schemes define how the client can authenticate requests.\n */\n authSchemes?: AuthScheme[];\n\n /**\n * The credential used to authenticate requests.\n * Must be compatible with one of the specified authentication schemes.\n */\n credential?: ClientCredential;\n\n // UNBRANDED DIFFERENCE: The deprecated baseUrl property is removed in favor of the endpoint property in the unbranded Core package\n\n /**\n * Endpoint for the client\n */\n endpoint?: string;\n /**\n * Options for setting a custom apiVersion.\n */\n apiVersion?: string;\n /**\n * Option to allow calling http (insecure) endpoints\n */\n allowInsecureConnection?: boolean;\n /**\n * Additional policies to include in the HTTP pipeline.\n */\n additionalPolicies?: AdditionalPolicyConfig[];\n /**\n * Specify a custom HttpClient when making requests.\n */\n httpClient?: HttpClient;\n /**\n * Options to configure request/response logging.\n */\n loggingOptions?: LogPolicyOptions;\n};\n\n/**\n * Represents the shape of an HttpResponse\n */\nexport type HttpResponse = {\n /**\n * The request that generated this response.\n */\n request: PipelineRequest;\n /**\n * The HTTP response headers.\n */\n headers: RawHttpHeaders;\n /**\n * Parsed body\n */\n body: unknown;\n /**\n * The HTTP status code of the response.\n */\n status: string;\n};\n\n/**\n * Helper type used to detect parameters in a path template\n * text surrounded by \\{\\} will be considered a path parameter\n */\nexport type PathParameters<\n TRoute extends string,\n // This is trying to match the string in TRoute with a template where HEAD/{PARAM}/TAIL\n // for example in the followint path: /foo/{fooId}/bar/{barId}/baz the template will infer\n // HEAD: /foo\n // Param: fooId\n // Tail: /bar/{barId}/baz\n // The above sample path would return [pathParam: string, pathParam: string]\n> = TRoute extends `${infer _Head}/{${infer _Param}}${infer Tail}`\n ? // In case we have a match for the template above we know for sure\n // that we have at least one pathParameter, that's why we set the first pathParam\n // in the tuple. At this point we have only matched up until param, if we want to identify\n // additional parameters we can call RouteParameters recursively on the Tail to match the remaining parts,\n // in case the Tail has more parameters, it will return a tuple with the parameters found in tail.\n // We spread the second path params to end up with a single dimension tuple at the end.\n [\n pathParameter: string | number | PathParameterWithOptions,\n ...pathParameters: PathParameters<Tail>,\n ]\n : // When the path doesn't match the template, it means that we have no path parameters so we return\n // an empty tuple.\n [];\n\n/** A response containing error details. */\nexport interface ErrorResponse {\n /** The error object. */\n error: ErrorModel;\n}\n\n/** The error object. */\nexport interface ErrorModel {\n /** One of a server-defined set of error codes. */\n code: string;\n /** A human-readable representation of the error. */\n message: string;\n /** The target of the error. */\n target?: string;\n /** An array of details about specific errors that led to this reported error. */\n details: Array<ErrorModel>;\n /** An object containing more specific information than the current object about the error. */\n innererror?: InnerError;\n}\n\n/** An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. */\nexport interface InnerError {\n /** One of a server-defined set of error codes. */\n code: string;\n /** Inner error. */\n innererror?: InnerError;\n}\n\n/**\n * An object that can be passed as a path parameter, allowing for additional options to be set relating to how the parameter is encoded.\n */\nexport interface PathParameterWithOptions {\n /**\n * The value of the parameter.\n */\n value: string | number;\n\n /**\n * Whether to allow for reserved characters in the value. If set to true, special characters such as '/' in the parameter's value will not be URL encoded.\n * Defaults to false.\n */\n allowReserved?: boolean;\n}\n"]}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import type { TokenCredential } from "../auth/tokenCredential.js";
|
|
2
|
-
import type { KeyCredential } from "../auth/keyCredential.js";
|
|
3
1
|
import type { Client, ClientOptions } from "./common.js";
|
|
4
|
-
/**
|
|
5
|
-
* Creates a client with a default pipeline
|
|
6
|
-
* @param endpoint - Base endpoint for the client
|
|
7
|
-
* @param options - Client options
|
|
8
|
-
*/
|
|
9
|
-
export declare function getClient(endpoint: string, options?: ClientOptions): Client;
|
|
10
2
|
/**
|
|
11
3
|
* Creates a client with a default pipeline
|
|
12
4
|
* @param endpoint - Base endpoint for the client
|
|
13
5
|
* @param credentials - Credentials to authenticate the requests
|
|
14
6
|
* @param options - Client options
|
|
15
7
|
*/
|
|
16
|
-
export declare function getClient(endpoint: string,
|
|
8
|
+
export declare function getClient(endpoint: string, clientOptions?: ClientOptions): Client;
|
|
17
9
|
//# sourceMappingURL=getClient.d.ts.map
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { isTokenCredential } from "../auth/tokenCredential.js";
|
|
4
|
-
import { isKeyCredential } from "../auth/keyCredential.js";
|
|
5
3
|
import { createDefaultPipeline } from "./clientHelpers.js";
|
|
6
4
|
import { sendRequest } from "./sendRequest.js";
|
|
7
5
|
import { buildRequestUrl } from "./urlHelpers.js";
|
|
8
|
-
|
|
6
|
+
import { isNodeLike } from "../util/checkEnvironment.js";
|
|
7
|
+
/**
|
|
8
|
+
* Creates a client with a default pipeline
|
|
9
|
+
* @param endpoint - Base endpoint for the client
|
|
10
|
+
* @param credentials - Credentials to authenticate the requests
|
|
11
|
+
* @param options - Client options
|
|
12
|
+
*/
|
|
13
|
+
export function getClient(endpoint, clientOptions = {}) {
|
|
9
14
|
var _a, _b;
|
|
10
|
-
|
|
11
|
-
if (credentialsOrPipelineOptions) {
|
|
12
|
-
if (isCredential(credentialsOrPipelineOptions)) {
|
|
13
|
-
credentials = credentialsOrPipelineOptions;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
clientOptions = credentialsOrPipelineOptions !== null && credentialsOrPipelineOptions !== void 0 ? credentialsOrPipelineOptions : {};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
const pipeline = createDefaultPipeline(endpoint, credentials, clientOptions);
|
|
15
|
+
const pipeline = createDefaultPipeline(clientOptions);
|
|
20
16
|
if ((_a = clientOptions.additionalPolicies) === null || _a === void 0 ? void 0 : _a.length) {
|
|
21
17
|
for (const { policy, position } of clientOptions.additionalPolicies) {
|
|
22
18
|
// Sign happens after Retry and is commonly needed to occur
|
|
@@ -72,14 +68,21 @@ function buildOperation(method, url, pipeline, options, allowInsecureConnection,
|
|
|
72
68
|
return sendRequest(method, url, pipeline, Object.assign(Object.assign({}, options), { allowInsecureConnection }), httpClient).then(onFulfilled, onrejected);
|
|
73
69
|
},
|
|
74
70
|
async asBrowserStream() {
|
|
75
|
-
|
|
71
|
+
if (isNodeLike) {
|
|
72
|
+
throw new Error("`asBrowserStream` is supported only in the browser environment. Use `asNodeStream` instead to obtain the response body stream. If you require a Web stream of the response in Node, consider using `Readable.toWeb` on the result of `asNodeStream`.");
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
return sendRequest(method, url, pipeline, Object.assign(Object.assign({}, options), { allowInsecureConnection, responseAsStream: true }), httpClient);
|
|
76
|
+
}
|
|
76
77
|
},
|
|
77
78
|
async asNodeStream() {
|
|
78
|
-
|
|
79
|
+
if (isNodeLike) {
|
|
80
|
+
return sendRequest(method, url, pipeline, Object.assign(Object.assign({}, options), { allowInsecureConnection, responseAsStream: true }), httpClient);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
throw new Error("`isNodeStream` is not supported in the browser environment. Use `asBrowserStream` to obtain the response body stream.");
|
|
84
|
+
}
|
|
79
85
|
},
|
|
80
86
|
};
|
|
81
87
|
}
|
|
82
|
-
function isCredential(param) {
|
|
83
|
-
return isKeyCredential(param) || isTokenCredential(param);
|
|
84
|
-
}
|
|
85
88
|
//# sourceMappingURL=getClient.js.map
|