diff --git a/.licenses/npm/typed-rest-client.dep.yml b/.licenses/npm/typed-rest-client.dep.yml index 6c9721b5..4eebeca9 100644 --- a/.licenses/npm/typed-rest-client.dep.yml +++ b/.licenses/npm/typed-rest-client.dep.yml @@ -1,6 +1,6 @@ --- name: typed-rest-client -version: 2.0.2 +version: 2.1.0 type: npm summary: Node Rest and Http Clients for use with TypeScript homepage: https://github.com/Microsoft/typed-rest-client#readme diff --git a/dist/index.js b/dist/index.js index 3115aecb..88fbe1b2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -11783,7 +11783,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpCodes = void 0; +exports.HttpClient = exports.HttpClientResponse = exports.HttpCodes = void 0; +exports.isHttps = isHttps; const url = __nccwpck_require__(7310); const http = __nccwpck_require__(3685); const https = __nccwpck_require__(5687); @@ -11863,7 +11864,6 @@ function isHttps(requestUrl) { let parsedUrl = url.parse(requestUrl); return parsedUrl.protocol === 'https:'; } -exports.isHttps = isHttps; var EnvironmentVariables; (function (EnvironmentVariables) { EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY"; @@ -11880,6 +11880,10 @@ class HttpClient { this._maxRetries = 1; this._keepAlive = false; this._disposed = false; + this._httpGlobalAgentOptions = { + keepAlive: false, + timeout: 30000 + }; this.userAgent = userAgent; this.handlers = handlers || []; let no_proxy = process.env[EnvironmentVariables.NO_PROXY]; @@ -11902,6 +11906,9 @@ class HttpClient { this._httpProxyBypassHosts.push(new RegExp(bypass, 'i')); }); } + if (requestOptions.globalAgentOptions) { + this._httpGlobalAgentOptions = requestOptions.globalAgentOptions; + } this._certConfig = requestOptions.cert; if (this._certConfig) { // If using cert, need fs @@ -12212,7 +12219,11 @@ class HttpClient { } // if not using private agent and tunnel agent isn't setup then use global agent if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; + const globalAgentOptions = { + keepAlive: this._httpGlobalAgentOptions.keepAlive, + timeout: this._httpGlobalAgentOptions.timeout + }; + agent = usingSsl ? new https.Agent(globalAgentOptions) : new http.Agent(globalAgentOptions); } if (usingSsl && this._ignoreSslError) { // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process @@ -12525,7 +12536,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.obtainContentCharset = exports.buildProxyBypassRegexFromEnv = exports.decompressGzippedContent = exports.getUrl = void 0; +exports.getUrl = getUrl; +exports.decompressGzippedContent = decompressGzippedContent; +exports.buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv; +exports.obtainContentCharset = obtainContentCharset; const qs = __nccwpck_require__(2760); const url = __nccwpck_require__(7310); const path = __nccwpck_require__(1017); @@ -12563,7 +12577,6 @@ function getUrl(resource, baseUrl, queryParams) { getUrlWithParsedQueryParams(requestUrl, queryParams) : requestUrl; } -exports.getUrl = getUrl; /** * * @param {string} requestUrl @@ -12613,7 +12626,6 @@ function decompressGzippedContent(buffer, charset) { })); }); } -exports.decompressGzippedContent = decompressGzippedContent; /** * Builds a RegExp to test urls against for deciding * wether to bypass proxy from an entry of the @@ -12635,7 +12647,6 @@ function buildProxyBypassRegexFromEnv(bypass) { throw err; } } -exports.buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv; /** * Obtain Response's Content Charset. * Through inspecting `content-type` response header. @@ -12659,7 +12670,6 @@ function obtainContentCharset(response) { } return 'utf-8'; } -exports.obtainContentCharset = obtainContentCharset; /***/ }), diff --git a/package-lock.json b/package-lock.json index 87883bfa..247bfba0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "@actions/core": "^1.10.1", "@actions/tool-cache": "^2.0.1", "semver": "^7.6.3", - "typed-rest-client": "^2.0.2" + "typed-rest-client": "^2.1.0" }, "devDependencies": { "@actions/io": "^1.1.3", @@ -9701,9 +9701,9 @@ } }, "node_modules/typed-rest-client": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-2.0.2.tgz", - "integrity": "sha512-rmAQM2gZw/PQpK5+5aSs+I6ZBv4PFC2BT1o+0ADS1SgSejA+14EmbI2Lt8uXwkX7oeOMkwFmg0pHKwe8D9IT5A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-2.1.0.tgz", + "integrity": "sha512-Nel9aPbgSzRxfs1+4GoSB4wexCF+4Axlk7OSGVQCMa+4fWcyxIsN/YNmkp0xTT2iQzMD98h8yFLav/cNaULmRA==", "dependencies": { "des.js": "^1.1.0", "js-md4": "^0.3.2", @@ -17148,9 +17148,9 @@ } }, "typed-rest-client": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-2.0.2.tgz", - "integrity": "sha512-rmAQM2gZw/PQpK5+5aSs+I6ZBv4PFC2BT1o+0ADS1SgSejA+14EmbI2Lt8uXwkX7oeOMkwFmg0pHKwe8D9IT5A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-2.1.0.tgz", + "integrity": "sha512-Nel9aPbgSzRxfs1+4GoSB4wexCF+4Axlk7OSGVQCMa+4fWcyxIsN/YNmkp0xTT2iQzMD98h8yFLav/cNaULmRA==", "requires": { "des.js": "^1.1.0", "js-md4": "^0.3.2", diff --git a/package.json b/package.json index e70ededc..9575ff17 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@actions/core": "^1.10.1", "@actions/tool-cache": "^2.0.1", "semver": "^7.6.3", - "typed-rest-client": "^2.0.2" + "typed-rest-client": "^2.1.0" }, "devDependencies": { "@actions/io": "^1.1.3",