Skip to content

Commit 0a24c62

Browse files
authored
[core-https] Fix API review comments (Azure#13943)
- Fix typo in exponentialRetryPolicyName constant. - Make sure concrete HttpsClient types stay hidden.
1 parent 0db4909 commit 0a24c62

File tree

7 files changed

+26
-8
lines changed

7 files changed

+26
-8
lines changed

sdk/core/core-https/review/core-https.api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ export const decompressResponsePolicyName = "decompressResponsePolicy";
5353
// @public
5454
export function exponentialRetryPolicy(options?: ExponentialRetryPolicyOptions): PipelinePolicy;
5555

56+
// @public
57+
export const exponentialRetryPolicyName = "exponentialRetryPolicy";
58+
5659
// @public
5760
export interface ExponentialRetryPolicyOptions {
5861
maxRetries?: number;
5962
maxRetryDelayInMs?: number;
6063
retryDelayInMs?: number;
6164
}
6265

63-
// @public
64-
export const expontentialRetryPolicyName = "exponentialRetryPolicy";
65-
6666
// @public
6767
export type FormDataMap = {
6868
[key: string]: FormDataValue | FormDataValue[];
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33

4-
export { createXhrHttpsClient as createDefaultHttpsClient } from "./xhrHttpsClient";
4+
import { HttpsClient } from "./interfaces";
5+
import { createXhrHttpsClient } from "./xhrHttpsClient";
6+
7+
/**
8+
* Create the correct HttpsClient for the current environment.
9+
*/
10+
export function createDefaultHttpsClient(): HttpsClient {
11+
return createXhrHttpsClient();
12+
}
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33

4-
export { createNodeHttpsClient as createDefaultHttpsClient } from "./nodeHttpsClient";
4+
import { HttpsClient } from "./interfaces";
5+
import { createNodeHttpsClient } from "./nodeHttpsClient";
6+
7+
/**
8+
* Create the correct HttpsClient for the current environment.
9+
*/
10+
export function createDefaultHttpsClient(): HttpsClient {
11+
return createNodeHttpsClient();
12+
}

sdk/core/core-https/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export {
3636
export {
3737
exponentialRetryPolicy,
3838
ExponentialRetryPolicyOptions,
39-
expontentialRetryPolicyName
39+
exponentialRetryPolicyName
4040
} from "./policies/exponentialRetryPolicy";
4141
export {
4242
setClientRequestIdPolicy,

sdk/core/core-https/src/nodeHttpsClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ function getBodyLength(body: RequestBodyType): number | null {
310310

311311
/**
312312
* Create a new HttpsClient instance for the NodeJS environment.
313+
* @internal
313314
*/
314315
export function createNodeHttpsClient(): HttpsClient {
315316
return new NodeHttpsClient();

sdk/core/core-https/src/policies/exponentialRetryPolicy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { RestError } from "../restError";
1010
/**
1111
* The programmatic identifier of the exponentialRetryPolicy.
1212
*/
13-
export const expontentialRetryPolicyName = "exponentialRetryPolicy";
13+
export const exponentialRetryPolicyName = "exponentialRetryPolicy";
1414

1515
const DEFAULT_CLIENT_RETRY_COUNT = 10;
1616
// intervals are in ms
@@ -152,7 +152,7 @@ export function exponentialRetryPolicy(
152152
}
153153

154154
return {
155-
name: expontentialRetryPolicyName,
155+
name: exponentialRetryPolicyName,
156156
async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {
157157
const retryData = {
158158
retryCount: 0,

sdk/core/core-https/src/xhrHttpsClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ function rejectOnTerminalEvent(
192192

193193
/**
194194
* Create a new HttpsClient instance for the browser environment.
195+
* @internal
195196
*/
196197
export function createXhrHttpsClient(): HttpsClient {
197198
return new XhrHttpsClient();

0 commit comments

Comments
 (0)