Reduce typings files (#83421)

This commit is contained in:
Christof Marti 2019-11-11 16:22:56 +01:00
parent 587e25ca53
commit c27fe98afe
8 changed files with 31 additions and 45 deletions

View file

@ -49,7 +49,7 @@
"v8-inspect-profiler": "^0.0.20",
"vscode-minimist": "^1.2.1",
"vscode-nsfw": "1.2.8",
"vscode-proxy-agent": "^0.5.1",
"vscode-proxy-agent": "^0.5.2",
"vscode-ripgrep": "^1.5.7",
"vscode-sqlite3": "4.0.9",
"vscode-textmate": "^4.3.0",
@ -65,6 +65,7 @@
"@types/chokidar": "2.1.3",
"@types/cookie": "^0.3.3",
"@types/graceful-fs": "4.1.2",
"@types/http-proxy-agent": "^2.0.1",
"@types/iconv-lite": "0.0.1",
"@types/keytar": "^4.4.0",
"@types/mocha": "2.2.39",

View file

@ -17,7 +17,7 @@
"spdlog": "^0.11.1",
"vscode-minimist": "^1.2.1",
"vscode-nsfw": "1.2.8",
"vscode-proxy-agent": "^0.5.1",
"vscode-proxy-agent": "^0.5.2",
"vscode-ripgrep": "^1.5.7",
"vscode-textmate": "^4.3.0",
"xterm": "4.3.0-beta17",
@ -27,7 +27,7 @@
"yazl": "^2.4.3"
},
"optionalDependencies": {
"vscode-windows-ca-certs": "0.1.0",
"vscode-windows-ca-certs": "0.2.0",
"vscode-windows-registry": "1.0.2"
}
}

View file

@ -384,10 +384,10 @@ vscode-nsfw@1.2.8:
lodash.isundefined "^3.0.1"
nan "^2.10.0"
vscode-proxy-agent@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/vscode-proxy-agent/-/vscode-proxy-agent-0.5.1.tgz#7fd15e157c02176a0dca9f87840ad0991a62ca57"
integrity sha512-Nnkc7gBk9iAbbZURYZm3p/wvDvRVwDvdzEvDqF1Jh40p6przwQU/JTlV1XLrmd4cCwh6TOAWD81Z3cq+K7Xdmw==
vscode-proxy-agent@^0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/vscode-proxy-agent/-/vscode-proxy-agent-0.5.2.tgz#0c90d24d353957b841d741da7b2701e3f0a044c4"
integrity sha512-1cCNPxrWIrmUwS+1XGaXxkh3G1y7z2fpXl1sT74OZvELaryQWYb3NMxMLJJ4Q/CpPLEyuhp/bAN7nzHxxFcQ5Q==
dependencies:
debug "^3.1.0"
http-proxy-agent "^2.1.0"
@ -406,10 +406,10 @@ vscode-textmate@^4.3.0:
dependencies:
oniguruma "^7.2.0"
vscode-windows-ca-certs@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/vscode-windows-ca-certs/-/vscode-windows-ca-certs-0.1.0.tgz#d58eeb40b536130918cfde2b01e6dc7e5c1bd757"
integrity sha512-ZfZbfJIE09Q0dwGqmqTj7kuAq4g6lul9WPJvo0DkKjln8/FL+dY3wUKIKbYwWQp4x56SBTLBq3tJkD72xQ9Gqw==
vscode-windows-ca-certs@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/vscode-windows-ca-certs/-/vscode-windows-ca-certs-0.2.0.tgz#086f0f4de57e2760a35ac6920831bff246237115"
integrity sha512-YBrJRT0zos+Yb1Qdn73GD8QZr7pa2IE96b5Y1hmmp6XeR8aYB7Iiq5gDAF/+/AxL+caSR9KPZQ6jiYWh5biD7w==
dependencies:
node-addon-api "1.6.2"

View file

@ -1,20 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'http-proxy-agent' {
interface IHttpProxyAgentOptions {
host: string;
port: number;
auth?: string;
}
class HttpProxyAgent {
constructor(proxy: string);
constructor(opts: IHttpProxyAgentOptions);
}
export = HttpProxyAgent;
}

View file

@ -1,6 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode-proxy-agent';

View file

@ -39,7 +39,7 @@ export async function getProxyAgent(rawRequestURL: string, options: IOptions = {
const opts = {
host: proxyEndpoint.hostname || '',
port: Number(proxyEndpoint.port),
port: proxyEndpoint.port || (proxyEndpoint.protocol === 'https' ? '443' : '80'),
auth: proxyEndpoint.auth,
rejectUnauthorized: isBoolean(options.strictSSL) ? options.strictSSL : true
};

View file

@ -343,9 +343,13 @@ function patches(originals: typeof http | typeof https, resolveProxy: ReturnType
return original.apply(null, arguments as unknown as any[]);
}
const optionsPatched = options.agent instanceof ProxyAgent;
const originalAgent = options.agent;
if (originalAgent === true) {
throw new Error('Unexpected agent option: true');
}
const optionsPatched = originalAgent instanceof ProxyAgent;
const config = onRequest && ((<any>options)._vscodeProxySupport || /* LS */ (<any>options)._vscodeSystemProxy) || proxySetting.config;
const useProxySettings = !optionsPatched && (config === 'override' || config === 'on' && !options.agent);
const useProxySettings = !optionsPatched && (config === 'override' || config === 'on' && originalAgent === undefined);
const useSystemCertificates = !optionsPatched && certSetting.config && originals === https && !(options as https.RequestOptions).ca;
if (useProxySettings || useSystemCertificates) {
@ -367,7 +371,7 @@ function patches(originals: typeof http | typeof https, resolveProxy: ReturnType
options.agent = new ProxyAgent({
resolveProxy: resolveProxy.bind(undefined, { useProxySettings, useSystemCertificates }),
defaultPort: originals === https ? 443 : 80,
originalAgent: options.agent
originalAgent
});
return original(options, callback);
}

View file

@ -133,6 +133,13 @@
dependencies:
"@types/node" "*"
"@types/http-proxy-agent@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@types/http-proxy-agent/-/http-proxy-agent-2.0.1.tgz#2f95077f6bfe7adc39cc0f0042da85997ae77fc7"
integrity sha512-dgsgbsgI3t+ZkdzF9H19uBaLsurIZJJjJsVpj4mCLp8B6YghQ7jVwyqhaL0PcVtuC3nOi0ZBhAi2Dd9jCUwdFA==
dependencies:
"@types/node" "*"
"@types/iconv-lite@0.0.1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@types/iconv-lite/-/iconv-lite-0.0.1.tgz#aa3b8bda2be512b1ae0a057b942e869c370a5569"
@ -9033,10 +9040,10 @@ vscode-nsfw@1.2.8:
lodash.isundefined "^3.0.1"
nan "^2.10.0"
vscode-proxy-agent@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/vscode-proxy-agent/-/vscode-proxy-agent-0.5.1.tgz#7fd15e157c02176a0dca9f87840ad0991a62ca57"
integrity sha512-Nnkc7gBk9iAbbZURYZm3p/wvDvRVwDvdzEvDqF1Jh40p6przwQU/JTlV1XLrmd4cCwh6TOAWD81Z3cq+K7Xdmw==
vscode-proxy-agent@^0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/vscode-proxy-agent/-/vscode-proxy-agent-0.5.2.tgz#0c90d24d353957b841d741da7b2701e3f0a044c4"
integrity sha512-1cCNPxrWIrmUwS+1XGaXxkh3G1y7z2fpXl1sT74OZvELaryQWYb3NMxMLJJ4Q/CpPLEyuhp/bAN7nzHxxFcQ5Q==
dependencies:
debug "^3.1.0"
http-proxy-agent "^2.1.0"