Update generated content

This commit is contained in:
CrazyMax 2020-10-21 01:53:33 +02:00
parent cb13001a65
commit 55283a30e8
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
2 changed files with 21 additions and 25 deletions

43
dist/index.js generated vendored
View File

@ -1258,7 +1258,6 @@ class ExecState extends events.EventEmitter {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
const url = __webpack_require__(835);
const http = __webpack_require__(605); const http = __webpack_require__(605);
const https = __webpack_require__(211); const https = __webpack_require__(211);
const pm = __webpack_require__(443); const pm = __webpack_require__(443);
@ -1307,7 +1306,7 @@ var MediaTypes;
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/ */
function getProxyUrl(serverUrl) { function getProxyUrl(serverUrl) {
let proxyUrl = pm.getProxyUrl(url.parse(serverUrl)); let proxyUrl = pm.getProxyUrl(new URL(serverUrl));
return proxyUrl ? proxyUrl.href : ''; return proxyUrl ? proxyUrl.href : '';
} }
exports.getProxyUrl = getProxyUrl; exports.getProxyUrl = getProxyUrl;
@ -1326,6 +1325,15 @@ const HttpResponseRetryCodes = [
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
const ExponentialBackoffCeiling = 10; const ExponentialBackoffCeiling = 10;
const ExponentialBackoffTimeSlice = 5; const ExponentialBackoffTimeSlice = 5;
class HttpClientError extends Error {
constructor(message, statusCode) {
super(message);
this.name = 'HttpClientError';
this.statusCode = statusCode;
Object.setPrototypeOf(this, HttpClientError.prototype);
}
}
exports.HttpClientError = HttpClientError;
class HttpClientResponse { class HttpClientResponse {
constructor(message) { constructor(message) {
this.message = message; this.message = message;
@ -1344,7 +1352,7 @@ class HttpClientResponse {
} }
exports.HttpClientResponse = HttpClientResponse; exports.HttpClientResponse = HttpClientResponse;
function isHttps(requestUrl) { function isHttps(requestUrl) {
let parsedUrl = url.parse(requestUrl); let parsedUrl = new URL(requestUrl);
return parsedUrl.protocol === 'https:'; return parsedUrl.protocol === 'https:';
} }
exports.isHttps = isHttps; exports.isHttps = isHttps;
@ -1449,7 +1457,7 @@ class HttpClient {
if (this._disposed) { if (this._disposed) {
throw new Error('Client has already been disposed.'); throw new Error('Client has already been disposed.');
} }
let parsedUrl = url.parse(requestUrl); let parsedUrl = new URL(requestUrl);
let info = this._prepareRequest(verb, parsedUrl, headers); let info = this._prepareRequest(verb, parsedUrl, headers);
// Only perform retries on reads since writes may not be idempotent. // Only perform retries on reads since writes may not be idempotent.
let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
@ -1488,7 +1496,7 @@ class HttpClient {
// if there's no location to redirect to, we won't // if there's no location to redirect to, we won't
break; break;
} }
let parsedRedirectUrl = url.parse(redirectUrl); let parsedRedirectUrl = new URL(redirectUrl);
if (parsedUrl.protocol == 'https:' && if (parsedUrl.protocol == 'https:' &&
parsedUrl.protocol != parsedRedirectUrl.protocol && parsedUrl.protocol != parsedRedirectUrl.protocol &&
!this._allowRedirectDowngrade) { !this._allowRedirectDowngrade) {
@ -1604,7 +1612,7 @@ class HttpClient {
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/ */
getAgent(serverUrl) { getAgent(serverUrl) {
let parsedUrl = url.parse(serverUrl); let parsedUrl = new URL(serverUrl);
return this._getAgent(parsedUrl); return this._getAgent(parsedUrl);
} }
_prepareRequest(method, requestUrl, headers) { _prepareRequest(method, requestUrl, headers) {
@ -1677,7 +1685,7 @@ class HttpClient {
maxSockets: maxSockets, maxSockets: maxSockets,
keepAlive: this._keepAlive, keepAlive: this._keepAlive,
proxy: { proxy: {
proxyAuth: proxyUrl.auth, proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`,
host: proxyUrl.hostname, host: proxyUrl.hostname,
port: proxyUrl.port port: proxyUrl.port
} }
@ -1772,12 +1780,8 @@ class HttpClient {
else { else {
msg = 'Failed request: (' + statusCode + ')'; msg = 'Failed request: (' + statusCode + ')';
} }
let err = new Error(msg); let err = new HttpClientError(msg, statusCode);
// attach statusCode and body obj (if available) to the error object err.result = response.result;
err['statusCode'] = statusCode;
if (response.result) {
err['result'] = response.result;
}
reject(err); reject(err);
} }
else { else {
@ -1792,12 +1796,11 @@ exports.HttpClient = HttpClient;
/***/ }), /***/ }),
/***/ 443: /***/ 443:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { /***/ ((__unused_webpack_module, exports) => {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
const url = __webpack_require__(835);
function getProxyUrl(reqUrl) { function getProxyUrl(reqUrl) {
let usingSsl = reqUrl.protocol === 'https:'; let usingSsl = reqUrl.protocol === 'https:';
let proxyUrl; let proxyUrl;
@ -1812,7 +1815,7 @@ function getProxyUrl(reqUrl) {
proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
} }
if (proxyVar) { if (proxyVar) {
proxyUrl = url.parse(proxyVar); proxyUrl = new URL(proxyVar);
} }
return proxyUrl; return proxyUrl;
} }
@ -5222,14 +5225,6 @@ module.exports = require("tls");
/***/ }), /***/ }),
/***/ 835:
/***/ ((module) => {
"use strict";
module.exports = require("url");
/***/ }),
/***/ 669: /***/ 669:
/***/ ((module) => { /***/ ((module) => {

View File

@ -3,7 +3,8 @@
"target": "es6", "target": "es6",
"module": "commonjs", "module": "commonjs",
"lib": [ "lib": [
"es6" "es6",
"dom"
], ],
"newLine": "lf", "newLine": "lf",
"outDir": "./lib", "outDir": "./lib",