diff --git a/sdk/core/core-https/review/core-https.api.md b/sdk/core/core-https/review/core-https.api.md index f13ccaa0b26a..565989bace8b 100644 --- a/sdk/core/core-https/review/core-https.api.md +++ b/sdk/core/core-https/review/core-https.api.md @@ -53,6 +53,9 @@ export const decompressResponsePolicyName = "decompressResponsePolicy"; // @public export function exponentialRetryPolicy(options?: ExponentialRetryPolicyOptions): PipelinePolicy; +// @public +export const exponentialRetryPolicyName = "exponentialRetryPolicy"; + // @public export interface ExponentialRetryPolicyOptions { maxRetries?: number; @@ -60,9 +63,6 @@ export interface ExponentialRetryPolicyOptions { retryDelayInMs?: number; } -// @public -export const expontentialRetryPolicyName = "exponentialRetryPolicy"; - // @public export type FormDataMap = { [key: string]: FormDataValue | FormDataValue[]; diff --git a/sdk/core/core-https/src/defaultHttpsClient.browser.ts b/sdk/core/core-https/src/defaultHttpsClient.browser.ts index f849d4c280ec..493cf8d91cee 100644 --- a/sdk/core/core-https/src/defaultHttpsClient.browser.ts +++ b/sdk/core/core-https/src/defaultHttpsClient.browser.ts @@ -1,4 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export { createXhrHttpsClient as createDefaultHttpsClient } from "./xhrHttpsClient"; +import { HttpsClient } from "./interfaces"; +import { createXhrHttpsClient } from "./xhrHttpsClient"; + +/** + * Create the correct HttpsClient for the current environment. + */ +export function createDefaultHttpsClient(): HttpsClient { + return createXhrHttpsClient(); +} diff --git a/sdk/core/core-https/src/defaultHttpsClient.ts b/sdk/core/core-https/src/defaultHttpsClient.ts index 60438b0962e0..1c6e74a30d73 100644 --- a/sdk/core/core-https/src/defaultHttpsClient.ts +++ b/sdk/core/core-https/src/defaultHttpsClient.ts @@ -1,4 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export { createNodeHttpsClient as createDefaultHttpsClient } from "./nodeHttpsClient"; +import { HttpsClient } from "./interfaces"; +import { createNodeHttpsClient } from "./nodeHttpsClient"; + +/** + * Create the correct HttpsClient for the current environment. + */ +export function createDefaultHttpsClient(): HttpsClient { + return createNodeHttpsClient(); +} diff --git a/sdk/core/core-https/src/index.ts b/sdk/core/core-https/src/index.ts index 4f4e5e19d5fb..5eb7b848251e 100644 --- a/sdk/core/core-https/src/index.ts +++ b/sdk/core/core-https/src/index.ts @@ -36,7 +36,7 @@ export { export { exponentialRetryPolicy, ExponentialRetryPolicyOptions, - expontentialRetryPolicyName + exponentialRetryPolicyName } from "./policies/exponentialRetryPolicy"; export { setClientRequestIdPolicy, diff --git a/sdk/core/core-https/src/nodeHttpsClient.ts b/sdk/core/core-https/src/nodeHttpsClient.ts index 3da33cffbf01..09b11fd540bb 100644 --- a/sdk/core/core-https/src/nodeHttpsClient.ts +++ b/sdk/core/core-https/src/nodeHttpsClient.ts @@ -310,6 +310,7 @@ function getBodyLength(body: RequestBodyType): number | null { /** * Create a new HttpsClient instance for the NodeJS environment. + * @internal */ export function createNodeHttpsClient(): HttpsClient { return new NodeHttpsClient(); diff --git a/sdk/core/core-https/src/policies/exponentialRetryPolicy.ts b/sdk/core/core-https/src/policies/exponentialRetryPolicy.ts index e85057b365e3..23784c619fd8 100644 --- a/sdk/core/core-https/src/policies/exponentialRetryPolicy.ts +++ b/sdk/core/core-https/src/policies/exponentialRetryPolicy.ts @@ -10,7 +10,7 @@ import { RestError } from "../restError"; /** * The programmatic identifier of the exponentialRetryPolicy. */ -export const expontentialRetryPolicyName = "exponentialRetryPolicy"; +export const exponentialRetryPolicyName = "exponentialRetryPolicy"; const DEFAULT_CLIENT_RETRY_COUNT = 10; // intervals are in ms @@ -152,7 +152,7 @@ export function exponentialRetryPolicy( } return { - name: expontentialRetryPolicyName, + name: exponentialRetryPolicyName, async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const retryData = { retryCount: 0, diff --git a/sdk/core/core-https/src/xhrHttpsClient.ts b/sdk/core/core-https/src/xhrHttpsClient.ts index 53a38a5a7900..de5267112b46 100644 --- a/sdk/core/core-https/src/xhrHttpsClient.ts +++ b/sdk/core/core-https/src/xhrHttpsClient.ts @@ -192,6 +192,7 @@ function rejectOnTerminalEvent( /** * Create a new HttpsClient instance for the browser environment. + * @internal */ export function createXhrHttpsClient(): HttpsClient { return new XhrHttpsClient();