Stop depending on @types/tunnel for createTunnel

Porting fix from v1.x branch https://github.com/Azure/ms-rest-js/pull/434
This commit is contained in:
Jeremy Meng 2021-02-11 19:12:16 +00:00
Родитель 1309b8b528
Коммит db82efeba9
4 изменённых файлов: 28 добавлений и 3 удалений

Просмотреть файл

@ -1,5 +1,8 @@
# Changelog
## 2.2.3 - 2021-02-10
- Dependent projects of @azure/ms-rest-js no longer need to have a dev dependency on @types/tunnel.
## 2.2.2 - 2021-02-09
- Port fix for nextLink issue from core-http (PR [#426](https://github.com/Azure/ms-rest-js/pull/426))
- Fix abort signal event handler memory leak (PR [#425](https://github.com/Azure/ms-rest-js/pull/425))

Просмотреть файл

@ -40,10 +40,32 @@ export function createProxyAgent(
return proxyAgent;
}
// Duplicate tunnel.HttpsOverHttpsOptions to avoid exporting createTunnel() with dependency on @types/tunnel
// createIunnel() is only imported by tests.
export interface HttpsProxyOptions {
host: string;
port: number;
localAddress?: string;
proxyAuth?: string;
headers?: { [key: string]: any };
ca?: Buffer[];
servername?: string;
key?: Buffer;
cert?: Buffer;
}
interface HttpsOverHttpsOptions {
maxSockets?: number;
ca?: Buffer[];
key?: Buffer;
cert?: Buffer;
proxy?: HttpsProxyOptions;
}
export function createTunnel(
isRequestHttps: boolean,
isProxyHttps: boolean,
tunnelOptions: tunnel.HttpsOverHttpsOptions
tunnelOptions: HttpsOverHttpsOptions
): http.Agent | https.Agent {
if (isRequestHttps && isProxyHttps) {
return tunnel.httpsOverHttps(tunnelOptions);

Просмотреть файл

@ -7,7 +7,7 @@ export const Constants = {
* @const
* @type {string}
*/
msRestVersion: "2.2.2",
msRestVersion: "2.2.3",
/**
* Specifies HTTP.

Просмотреть файл

@ -5,7 +5,7 @@
"email": "azsdkteam@microsoft.com",
"url": "https://github.com/Azure/ms-rest-js"
},
"version": "2.2.2",
"version": "2.2.3",
"description": "Isomorphic client Runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest",
"tags": [
"isomorphic",