diff --git a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/LICENSE b/node_modules/@tootallnate/once/LICENSE similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/@tootallnate/once/LICENSE rename to node_modules/@tootallnate/once/LICENSE diff --git a/node_modules/@tootallnate/once/dist/index.d.ts b/node_modules/@tootallnate/once/dist/index.d.ts index a7efe943b2acb..93d02a9a348b5 100644 --- a/node_modules/@tootallnate/once/dist/index.d.ts +++ b/node_modules/@tootallnate/once/dist/index.d.ts @@ -1,14 +1,7 @@ /// import { EventEmitter } from 'events'; -declare function once(emitter: EventEmitter, name: string): once.CancelablePromise; -declare namespace once { - interface CancelFunction { - (): void; - } - interface CancelablePromise extends Promise { - cancel: CancelFunction; - } - type CancellablePromise = CancelablePromise; - function spread(emitter: EventEmitter, name: string): once.CancelablePromise; +import { EventNames, EventListenerParameters, AbortSignal } from './types'; +export interface OnceOptions { + signal?: AbortSignal; } -export = once; +export default function once>(emitter: Emitter, name: Event, { signal }?: OnceOptions): Promise>; diff --git a/node_modules/@tootallnate/once/dist/index.js b/node_modules/@tootallnate/once/dist/index.js index bfd0dc88f758b..ca6385b1b82f8 100644 --- a/node_modules/@tootallnate/once/dist/index.js +++ b/node_modules/@tootallnate/once/dist/index.js @@ -1,39 +1,24 @@ "use strict"; -function noop() { } -function once(emitter, name) { - const o = once.spread(emitter, name); - const r = o.then((args) => args[0]); - r.cancel = o.cancel; - return r; -} -(function (once) { - function spread(emitter, name) { - let c = null; - const p = new Promise((resolve, reject) => { - function cancel() { - emitter.removeListener(name, onEvent); - emitter.removeListener('error', onError); - p.cancel = noop; - } - function onEvent(...args) { - cancel(); - resolve(args); - } - function onError(err) { - cancel(); - reject(err); - } - c = cancel; - emitter.on(name, onEvent); - emitter.on('error', onError); - }); - if (!c) { - throw new TypeError('Could not get `cancel()` function'); +Object.defineProperty(exports, "__esModule", { value: true }); +function once(emitter, name, { signal } = {}) { + return new Promise((resolve, reject) => { + function cleanup() { + signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', cleanup); + emitter.removeListener(name, onEvent); + emitter.removeListener('error', onError); + } + function onEvent(...args) { + cleanup(); + resolve(args); } - p.cancel = c; - return p; - } - once.spread = spread; -})(once || (once = {})); -module.exports = once; + function onError(err) { + cleanup(); + reject(err); + } + signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', cleanup); + emitter.on(name, onEvent); + emitter.on('error', onError); + }); +} +exports.default = once; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tootallnate/once/dist/index.js.map b/node_modules/@tootallnate/once/dist/index.js.map index 30d20491dbca8..61708ca07f1b0 100644 --- a/node_modules/@tootallnate/once/dist/index.js.map +++ b/node_modules/@tootallnate/once/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,SAAS,IAAI,KAAI,CAAC;AAElB,SAAS,IAAI,CACZ,OAAqB,EACrB,IAAY;IAEZ,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAM,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAA8B,CAAC;IACtE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACpB,OAAO,CAAC,CAAC;AACV,CAAC;AAED,WAAU,IAAI;IAWb,SAAgB,MAAM,CACrB,OAAqB,EACrB,IAAY;QAEZ,IAAI,CAAC,GAA+B,IAAI,CAAC;QACzC,MAAM,CAAC,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC5C,SAAS,MAAM;gBACd,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBACtC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBACzC,CAAC,CAAC,MAA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,CAAC;QACD,SAAS,OAAO,CAAC,GAAU;YAC1B,OAAO,EAAE,CAAC;YACV,MAAM,CAAC,GAAG,CAAC,CAAC;QACb,CAAC;QACD,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC;AA1BD,uBA0BC"} \ No newline at end of file diff --git a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts b/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts rename to node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts diff --git a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/overloaded-parameters.js b/node_modules/@tootallnate/once/dist/overloaded-parameters.js similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/overloaded-parameters.js rename to node_modules/@tootallnate/once/dist/overloaded-parameters.js diff --git a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map b/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map rename to node_modules/@tootallnate/once/dist/overloaded-parameters.js.map diff --git a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/types.d.ts b/node_modules/@tootallnate/once/dist/types.d.ts similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/types.d.ts rename to node_modules/@tootallnate/once/dist/types.d.ts diff --git a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/types.js b/node_modules/@tootallnate/once/dist/types.js similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/types.js rename to node_modules/@tootallnate/once/dist/types.js diff --git a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/types.js.map b/node_modules/@tootallnate/once/dist/types.js.map similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/types.js.map rename to node_modules/@tootallnate/once/dist/types.js.map diff --git a/node_modules/@tootallnate/once/package.json b/node_modules/@tootallnate/once/package.json index 8343f9fad73ab..69ce947d9c310 100644 --- a/node_modules/@tootallnate/once/package.json +++ b/node_modules/@tootallnate/once/package.json @@ -1,6 +1,6 @@ { "name": "@tootallnate/once", - "version": "1.1.2", + "version": "2.0.0", "description": "Creates a Promise that waits for a single event", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -10,8 +10,7 @@ "scripts": { "prebuild": "rimraf dist", "build": "tsc", - "test": "mocha --reporter spec", - "test-lint": "eslint src --ext .js,.ts", + "test": "jest", "prepublishOnly": "npm run build" }, "repository": { @@ -25,21 +24,29 @@ "url": "https://github.com/TooTallNate/once/issues" }, "devDependencies": { + "@types/jest": "^27.0.2", "@types/node": "^12.12.11", - "@typescript-eslint/eslint-plugin": "1.6.0", - "@typescript-eslint/parser": "1.1.0", - "eslint": "5.16.0", - "eslint-config-airbnb": "17.1.0", - "eslint-config-prettier": "4.1.0", - "eslint-import-resolver-typescript": "1.1.1", - "eslint-plugin-import": "2.16.0", - "eslint-plugin-jsx-a11y": "6.2.1", - "eslint-plugin-react": "7.12.4", - "mocha": "^6.2.2", + "abort-controller": "^3.0.0", + "jest": "^27.2.1", "rimraf": "^3.0.0", - "typescript": "^3.7.3" + "ts-jest": "^27.0.5", + "typescript": "^4.4.3" }, "engines": { - "node": ">= 6" + "node": ">= 10" + }, + "jest": { + "preset": "ts-jest", + "globals": { + "ts-jest": { + "diagnostics": false, + "isolatedModules": true + } + }, + "verbose": false, + "testEnvironment": "node", + "testMatch": [ + "/test/**/*.test.ts" + ] } } diff --git a/node_modules/http-proxy-agent/dist/agent.js b/node_modules/http-proxy-agent/dist/agent.js index 0252850516819..aca8280431488 100644 --- a/node_modules/http-proxy-agent/dist/agent.js +++ b/node_modules/http-proxy-agent/dist/agent.js @@ -18,7 +18,7 @@ const url_1 = __importDefault(require("url")); const debug_1 = __importDefault(require("debug")); const once_1 = __importDefault(require("@tootallnate/once")); const agent_base_1 = require("agent-base"); -const debug = debug_1.default('http-proxy-agent'); +const debug = (0, debug_1.default)('http-proxy-agent'); function isHTTPS(protocol) { return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } @@ -86,7 +86,7 @@ class HttpProxyAgent extends agent_base_1.Agent { if (parsed.port === '80') { // if port is 80, then we can remove the port so that the // ":80" portion is not on the produced URL - delete parsed.port; + parsed.port = ''; } // Change the `http.ClientRequest` instance's "path" field // to the absolute path of the URL that will be requested. @@ -136,7 +136,7 @@ class HttpProxyAgent extends agent_base_1.Agent { // function throws instead of the `http` request machinery. This is // important for i.e. `PacProxyAgent` which determines a failed proxy // connection via the `callback()` function throwing. - yield once_1.default(socket, 'connect'); + yield (0, once_1.default)(socket, 'connect'); return socket; }); } diff --git a/node_modules/http-proxy-agent/dist/agent.js.map b/node_modules/http-proxy-agent/dist/agent.js.map index 7a407620d8e50..bd3b56aa6dfdb 100644 --- a/node_modules/http-proxy-agent/dist/agent.js.map +++ b/node_modules/http-proxy-agent/dist/agent.js.map @@ -1 +1 @@ -{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,kDAAgC;AAChC,6DAAqC;AACrC,2CAAkE;AAGlE,MAAM,KAAK,GAAG,eAAW,CAAC,kBAAkB,CAAC,CAAC;AAY9C,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC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AY;oBACZ,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACtB,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC5D,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;iBACvC;qBAAM,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;oBACvD,aAAa;oBACb,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBAC/B,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;wBACrB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC7C,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;iBACnD;aACD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,qEAAqE;YACrE,qDAAqD;YACrD,MAAM,IAAA,cAAI,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAE9B,OAAO,MAAM,CAAC;QACf,CAAC;KAAA;CACD;AA1ID,iCA0IC"} \ No newline at end of file diff --git a/node_modules/http-proxy-agent/package.json b/node_modules/http-proxy-agent/package.json index 870dd5d8af267..659d6e11e80e4 100644 --- a/node_modules/http-proxy-agent/package.json +++ b/node_modules/http-proxy-agent/package.json @@ -1,6 +1,6 @@ { "name": "http-proxy-agent", - "version": "4.0.1", + "version": "5.0.0", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTP", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -30,13 +30,13 @@ "url": "https://github.com/TooTallNate/node-http-proxy-agent/issues" }, "dependencies": { - "@tootallnate/once": "1", + "@tootallnate/once": "2", "agent-base": "6", "debug": "4" }, "devDependencies": { "@types/debug": "4", - "@types/node": "^12.12.11", + "@types/node": "^12.19.2", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "eslint": "5.16.0", @@ -49,7 +49,7 @@ "mocha": "^6.2.2", "proxy": "1", "rimraf": "^3.0.0", - "typescript": "^3.5.3" + "typescript": "^4.4.3" }, "engines": { "node": ">= 6" diff --git a/node_modules/make-fetch-happen/LICENSE b/node_modules/make-fetch-happen/LICENSE index 8d28acf866d93..1808eb2844231 100644 --- a/node_modules/make-fetch-happen/LICENSE +++ b/node_modules/make-fetch-happen/LICENSE @@ -1,6 +1,6 @@ ISC License -Copyright (c) npm, Inc. +Copyright 2017-2022 (c) npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the diff --git a/node_modules/make-fetch-happen/lib/agent.js b/node_modules/make-fetch-happen/lib/agent.js index 3675dd8ae981a..095c35c5a2523 100644 --- a/node_modules/make-fetch-happen/lib/agent.js +++ b/node_modules/make-fetch-happen/lib/agent.js @@ -50,11 +50,13 @@ function getAgent (uri, opts) { : isHttps ? require('https').globalAgent : require('http').globalAgent - if (isLambda && !pxuri) + if (isLambda && !pxuri) { return lambdaAgent + } - if (AGENT_CACHE.peek(key)) + if (AGENT_CACHE.peek(key)) { return AGENT_CACHE.get(key) + } if (pxuri) { const pxopts = isLambda ? { @@ -86,16 +88,19 @@ function getAgent (uri, opts) { function checkNoProxy (uri, opts) { const host = new url.URL(uri).hostname.split('.').reverse() let noproxy = (opts.noProxy || getProcessEnv('no_proxy')) - if (typeof noproxy === 'string') + if (typeof noproxy === 'string') { noproxy = noproxy.split(/\s*,\s*/g) + } return noproxy && noproxy.some(no => { const noParts = no.split('.').filter(x => x).reverse() - if (!noParts.length) + if (!noParts.length) { return false + } for (let i = 0; i < noParts.length; i++) { - if (host[i] !== noParts[i]) + if (host[i] !== noParts[i]) { return false + } } return true }) @@ -104,8 +109,9 @@ function checkNoProxy (uri, opts) { module.exports.getProcessEnv = getProcessEnv function getProcessEnv (env) { - if (!env) + if (!env) { return + } let value @@ -114,8 +120,9 @@ function getProcessEnv (env) { value = process.env[e] || process.env[e.toUpperCase()] || process.env[e.toLowerCase()] - if (typeof value !== 'undefined') + if (typeof value !== 'undefined') { break + } } } @@ -141,8 +148,9 @@ function getProxyUri (uri, opts) { protocol === 'http:' && getProcessEnv(['https_proxy', 'http_proxy', 'proxy']) ) - if (!proxy) + if (!proxy) { return null + } const parsedProxy = (typeof proxy === 'string') ? new url.URL(proxy) : proxy @@ -177,13 +185,14 @@ function getProxy (proxyUrl, opts, isHttps) { } if (proxyUrl.protocol === 'http:' || proxyUrl.protocol === 'https:') { - if (!isHttps) + if (!isHttps) { return new HttpProxyAgent(popts) - else + } else { return new HttpsProxyAgent(popts) - } else if (proxyUrl.protocol.startsWith('socks')) + } + } else if (proxyUrl.protocol.startsWith('socks')) { return new SocksProxyAgent(popts) - else { + } else { throw Object.assign( new Error(`unsupported proxy protocol: '${proxyUrl.protocol}'`), { diff --git a/node_modules/make-fetch-happen/lib/cache/entry.js b/node_modules/make-fetch-happen/lib/cache/entry.js index a2acea156ee6f..ae2ad8c7667f2 100644 --- a/node_modules/make-fetch-happen/lib/cache/entry.js +++ b/node_modules/make-fetch-happen/lib/cache/entry.js @@ -52,23 +52,31 @@ const getMetadata = (request, response, options) => { url: request.url, reqHeaders: {}, resHeaders: {}, + + // options on which we must match the request and vary the response + options: { + compress: options.compress != null ? options.compress : request.compress, + }, } // only save the status if it's not a 200 or 304 - if (response.status !== 200 && response.status !== 304) + if (response.status !== 200 && response.status !== 304) { metadata.status = response.status + } for (const name of KEEP_REQUEST_HEADERS) { - if (request.headers.has(name)) + if (request.headers.has(name)) { metadata.reqHeaders[name] = request.headers.get(name) + } } // if the request's host header differs from the host in the url // we need to keep it, otherwise it's just noise and we ignore it const host = request.headers.get('host') const parsedUrl = new url.URL(request.url) - if (host && parsedUrl.host !== host) + if (host && parsedUrl.host !== host) { metadata.reqHeaders.host = host + } // if the response has a vary header, make sure // we store the relevant request headers too @@ -82,25 +90,17 @@ const getMetadata = (request, response, options) => { // copy any other request headers that will vary the response const varyHeaders = vary.trim().toLowerCase().split(/\s*,\s*/) for (const name of varyHeaders) { - // explicitly ignore accept-encoding here - if (name !== 'accept-encoding' && request.headers.has(name)) + if (request.headers.has(name)) { metadata.reqHeaders[name] = request.headers.get(name) + } } } } for (const name of KEEP_RESPONSE_HEADERS) { - if (response.headers.has(name)) + if (response.headers.has(name)) { metadata.resHeaders[name] = response.headers.get(name) - } - - // we only store accept-encoding and content-encoding if the user - // has disabled automatic compression and decompression in minipass-fetch - // since if it's enabled (the default) then the content will have - // already been decompressed making the header a lie - if (options.compress === false) { - metadata.reqHeaders['accept-encoding'] = request.headers.get('accept-encoding') - metadata.resHeaders['content-encoding'] = response.headers.get('content-encoding') + } } return metadata @@ -121,8 +121,9 @@ class CacheEntry { // entry timestamp to determine staleness because cacache will update it // when it verifies its data this.entry.metadata.time = this.entry.metadata.time || this.entry.time - } else + } else { this.key = cacheKey(request) + } this.options = options @@ -143,9 +144,17 @@ class CacheEntry { return entryA.policy.satisfies(entryB.request) }, { validateEntry: (entry) => { + // clean out entries with a buggy content-encoding value + if (entry.metadata && + entry.metadata.resHeaders && + entry.metadata.resHeaders['content-encoding'] === null) { + return false + } + // if an integrity is null, it needs to have a status specified - if (entry.integrity === null) + if (entry.integrity === null) { return !!(entry.metadata && entry.metadata.status) + } return true }, @@ -158,8 +167,9 @@ class CacheEntry { // a cache mode of 'reload' means to behave as though we have no cache // on the way to the network. return undefined to allow cacheFetch to // create a brand new request no matter what. - if (options.cache === 'reload') + if (options.cache === 'reload') { return + } // find the specific entry that satisfies the request let match @@ -194,6 +204,7 @@ class CacheEntry { this[_request] = new Request(this.entry.metadata.url, { method: 'GET', headers: this.entry.metadata.reqHeaders, + ...this.entry.metadata.options, }) } @@ -235,7 +246,11 @@ class CacheEntry { // if we got a status other than 200, 301, or 308, // or the CachePolicy forbid storage, append the // cache status header and return it untouched - if (this.request.method !== 'GET' || ![200, 301, 308].includes(this.response.status) || !this.policy.storable()) { + if ( + this.request.method !== 'GET' || + ![200, 301, 308].includes(this.response.status) || + !this.policy.storable() + ) { this.response.headers.set('x-local-cache-status', 'skip') return this.response } @@ -276,7 +291,8 @@ class CacheEntry { abortStream = collector collector.on('collect', (data) => { // TODO if the cache write fails, log a warning but return the response anyway - cacache.put(this.options.cachePath, this.key, data, cacheOpts).then(cacheWriteResolve, cacheWriteReject) + cacache.put(this.options.cachePath, this.key, data, cacheOpts) + .then(cacheWriteResolve, cacheWriteReject) }) body.unshift(collector) body.unshift(this.response.body) @@ -305,8 +321,9 @@ class CacheEntry { // know to be invalid to the cache abortStream.destroy(err) }) - } else + } else { await cacache.index.insert(this.options.cachePath, this.key, null, cacheOpts) + } // note: we do not set the x-local-cache-hash header because we do not know // the hash value until after the write to the cache completes, which doesn't @@ -347,25 +364,37 @@ class CacheEntry { onResume = async () => { removeOnResume() try { - const content = await cacache.get.byDigest(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + const content = await cacache.get.byDigest( + this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } + ) body.end(content) } catch (err) { - if (err.code === 'EINTEGRITY') - await cacache.rm.content(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) - if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') + if (err.code === 'EINTEGRITY') { + await cacache.rm.content( + this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } + ) + } + if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') { await CacheEntry.invalidate(this.request, this.options) + } body.emit('error', err) } } } else { onResume = () => { - const cacheStream = cacache.get.stream.byDigest(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + const cacheStream = cacache.get.stream.byDigest( + this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } + ) cacheStream.on('error', async (err) => { cacheStream.pause() - if (err.code === 'EINTEGRITY') - await cacache.rm.content(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) - if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') + if (err.code === 'EINTEGRITY') { + await cacache.rm.content( + this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } + ) + } + if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') { await CacheEntry.invalidate(this.request, this.options) + } body.emit('error', err) cacheStream.resume() }) @@ -415,8 +444,9 @@ class CacheEntry { // if the network fetch fails, return the stale // cached response unless it has a cache-control // of 'must-revalidate' - if (!this.policy.mustRevalidate) + if (!this.policy.mustRevalidate) { return this.respond(request.method, options, 'stale') + } throw err } @@ -429,8 +459,12 @@ class CacheEntry { // in the old cache entry to the new one, if the new metadata does not already // include that header for (const name of KEEP_RESPONSE_HEADERS) { - if (!hasOwnProperty(metadata.resHeaders, name) && hasOwnProperty(this.entry.metadata.resHeaders, name)) + if ( + !hasOwnProperty(metadata.resHeaders, name) && + hasOwnProperty(this.entry.metadata.resHeaders, name) + ) { metadata.resHeaders[name] = this.entry.metadata.resHeaders[name] + } } try { diff --git a/node_modules/make-fetch-happen/lib/cache/errors.js b/node_modules/make-fetch-happen/lib/cache/errors.js index 31e97c4b033c0..67a66573bebe6 100644 --- a/node_modules/make-fetch-happen/lib/cache/errors.js +++ b/node_modules/make-fetch-happen/lib/cache/errors.js @@ -1,5 +1,6 @@ class NotCachedError extends Error { constructor (url) { + /* eslint-disable-next-line max-len */ super(`request to ${url} failed: cache mode is 'only-if-cached' but no cached response is available.`) this.code = 'ENOTCACHED' } diff --git a/node_modules/make-fetch-happen/lib/cache/index.js b/node_modules/make-fetch-happen/lib/cache/index.js index cca93d9b4eb5d..17a6425592bcf 100644 --- a/node_modules/make-fetch-happen/lib/cache/index.js +++ b/node_modules/make-fetch-happen/lib/cache/index.js @@ -8,8 +8,9 @@ const cacheFetch = async (request, options) => { const entry = await CacheEntry.find(request, options) if (!entry) { // no cached result, if the cache mode is 'only-if-cached' that's a failure - if (options.cache === 'only-if-cached') + if (options.cache === 'only-if-cached') { throw new NotCachedError(request.url) + } // otherwise, we make a request, store it and return it const response = await remote(request, options) @@ -19,8 +20,9 @@ const cacheFetch = async (request, options) => { // we have a cached response that satisfies this request, however if the cache // mode is 'no-cache' then we send the revalidation request no matter what - if (options.cache === 'no-cache') + if (options.cache === 'no-cache') { return entry.revalidate(request, options) + } // if the cached entry is not stale, or if the cache mode is 'force-cache' or // 'only-if-cached' we can respond with the cached entry. set the status @@ -28,16 +30,18 @@ const cacheFetch = async (request, options) => { const _needsRevalidation = entry.policy.needsRevalidation(request) if (options.cache === 'force-cache' || options.cache === 'only-if-cached' || - !_needsRevalidation) + !_needsRevalidation) { return entry.respond(request.method, options, _needsRevalidation ? 'stale' : 'hit') + } // if we got here, the cache entry is stale so revalidate it return entry.revalidate(request, options) } cacheFetch.invalidate = async (request, options) => { - if (!options.cachePath) + if (!options.cachePath) { return + } return CacheEntry.invalidate(request, options) } diff --git a/node_modules/make-fetch-happen/lib/cache/policy.js b/node_modules/make-fetch-happen/lib/cache/policy.js index e0959f64ddf9d..ada3c8600dae9 100644 --- a/node_modules/make-fetch-happen/lib/cache/policy.js +++ b/node_modules/make-fetch-happen/lib/cache/policy.js @@ -2,19 +2,6 @@ const CacheSemantics = require('http-cache-semantics') const Negotiator = require('negotiator') const ssri = require('ssri') -// HACK: negotiator lazy loads several of its own modules -// as a micro optimization. we need to be sure that they're -// in memory as soon as possible at startup so that we do -// not try to lazy load them after the directory has been -// retired during a self update of the npm CLI, we do this -// by calling all of the methods that trigger a lazy load -// on a fake instance. -const preloadNegotiator = new Negotiator({ headers: {} }) -preloadNegotiator.charsets() -preloadNegotiator.encodings() -preloadNegotiator.languages() -preloadNegotiator.mediaTypes() - // options passed to http-cache-semantics constructor const policyOptions = { shared: false, @@ -31,6 +18,7 @@ const requestObject = (request) => { method: request.method, url: request.url, headers: {}, + compress: request.compress, } request.headers.forEach((value, key) => { @@ -74,16 +62,19 @@ class CachePolicy { // static method to quickly determine if a request alone is storable static storable (request, options) { // no cachePath means no caching - if (!options.cachePath) + if (!options.cachePath) { return false + } // user explicitly asked not to cache - if (options.cache === 'no-store') + if (options.cache === 'no-store') { return false + } // we only cache GET and HEAD requests - if (!['GET', 'HEAD'].includes(request.method)) + if (!['GET', 'HEAD'].includes(request.method)) { return false + } // otherwise, let http-cache-semantics make the decision // based on the request's headers @@ -94,23 +85,32 @@ class CachePolicy { // returns true if the policy satisfies the request satisfies (request) { const _req = requestObject(request) - if (this.request.headers.host !== _req.headers.host) + if (this.request.headers.host !== _req.headers.host) { + return false + } + + if (this.request.compress !== _req.compress) { return false + } const negotiatorA = new Negotiator(this.request) const negotiatorB = new Negotiator(_req) - if (JSON.stringify(negotiatorA.mediaTypes()) !== JSON.stringify(negotiatorB.mediaTypes())) + if (JSON.stringify(negotiatorA.mediaTypes()) !== JSON.stringify(negotiatorB.mediaTypes())) { return false + } - if (JSON.stringify(negotiatorA.languages()) !== JSON.stringify(negotiatorB.languages())) + if (JSON.stringify(negotiatorA.languages()) !== JSON.stringify(negotiatorB.languages())) { return false + } - if (JSON.stringify(negotiatorA.encodings()) !== JSON.stringify(negotiatorB.encodings())) + if (JSON.stringify(negotiatorA.encodings()) !== JSON.stringify(negotiatorB.encodings())) { return false + } - if (this.options.integrity) + if (this.options.integrity) { return ssri.parse(this.options.integrity).match(this.entry.integrity) + } return true } diff --git a/node_modules/make-fetch-happen/lib/fetch.js b/node_modules/make-fetch-happen/lib/fetch.js index dfded79295da1..233ba67e16550 100644 --- a/node_modules/make-fetch-happen/lib/fetch.js +++ b/node_modules/make-fetch-happen/lib/fetch.js @@ -13,20 +13,28 @@ const remote = require('./remote.js') // in the fetch being rejected if the redirect is // possible but invalid for some reason const canFollowRedirect = (request, response, options) => { - if (!isRedirect(response.status)) + if (!isRedirect(response.status)) { return false + } - if (options.redirect === 'manual') + if (options.redirect === 'manual') { return false + } - if (options.redirect === 'error') - throw new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect', { code: 'ENOREDIRECT' }) + if (options.redirect === 'error') { + throw new FetchError(`redirect mode is set to error: ${request.url}`, + 'no-redirect', { code: 'ENOREDIRECT' }) + } - if (!response.headers.has('location')) - throw new FetchError(`redirect location header missing for: ${request.url}`, 'no-location', { code: 'EINVALIDREDIRECT' }) + if (!response.headers.has('location')) { + throw new FetchError(`redirect location header missing for: ${request.url}`, + 'no-location', { code: 'EINVALIDREDIRECT' }) + } - if (request.counter >= request.follow) - throw new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect', { code: 'EMAXREDIRECT' }) + if (request.counter >= request.follow) { + throw new FetchError(`maximum redirect reached at: ${request.url}`, + 'max-redirect', { code: 'EMAXREDIRECT' }) + } return true } @@ -39,26 +47,34 @@ const getRedirect = (request, response, options) => { const location = response.headers.get('location') const redirectUrl = new url.URL(location, /^https?:/.test(location) ? undefined : request.url) // Comment below is used under the following license: - // Copyright (c) 2010-2012 Mikeal Rogers - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // http://www.apache.org/licenses/LICENSE-2.0 - // Unless required by applicable law or agreed to in writing, - // software distributed under the License is distributed on an "AS - // IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - // express or implied. See the License for the specific language - // governing permissions and limitations under the License. + /** + * @license + * Copyright (c) 2010-2012 Mikeal Rogers + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an "AS + * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ // Remove authorization if changing hostnames (but not if just // changing ports or protocols). This matches the behavior of request: // https://github.com/request/request/blob/b12a6245/lib/redirect.js#L134-L138 - if (new url.URL(request.url).hostname !== redirectUrl.hostname) + if (new url.URL(request.url).hostname !== redirectUrl.hostname) { request.headers.delete('authorization') + request.headers.delete('cookie') + } // for POST request with 301/302 response, or any request with 303 response, // use GET when following redirect - if (response.status === 303 || (request.method === 'POST' && [301, 302].includes(response.status))) { + if ( + response.status === 303 || + (request.method === 'POST' && [301, 302].includes(response.status)) + ) { _opts.method = 'GET' _opts.body = null request.headers.delete('content-length') @@ -87,11 +103,13 @@ const fetch = async (request, options) => { // request url if (!['GET', 'HEAD'].includes(request.method) && response.status >= 200 && - response.status <= 399) + response.status <= 399) { await cache.invalidate(request, options) + } - if (!canFollowRedirect(request, response, options)) + if (!canFollowRedirect(request, response, options)) { return response + } const redirect = getRedirect(request, response, options) return fetch(redirect.request, redirect.options) diff --git a/node_modules/make-fetch-happen/lib/options.js b/node_modules/make-fetch-happen/lib/options.js index f6138e6e1d13a..a0c8664adf02a 100644 --- a/node_modules/make-fetch-happen/lib/options.js +++ b/node_modules/make-fetch-happen/lib/options.js @@ -7,36 +7,40 @@ const conditionalHeaders = [ ] const configureOptions = (opts) => { - const {strictSSL, ...options} = { ...opts } + const { strictSSL, ...options } = { ...opts } options.method = options.method ? options.method.toUpperCase() : 'GET' options.rejectUnauthorized = strictSSL !== false - if (!options.retry) + if (!options.retry) { options.retry = { retries: 0 } - else if (typeof options.retry === 'string') { + } else if (typeof options.retry === 'string') { const retries = parseInt(options.retry, 10) - if (isFinite(retries)) + if (isFinite(retries)) { options.retry = { retries } - else + } else { options.retry = { retries: 0 } - } else if (typeof options.retry === 'number') + } + } else if (typeof options.retry === 'number') { options.retry = { retries: options.retry } - else + } else { options.retry = { retries: 0, ...options.retry } + } options.cache = options.cache || 'default' if (options.cache === 'default') { const hasConditionalHeader = Object.keys(options.headers || {}).some((name) => { return conditionalHeaders.includes(name.toLowerCase()) }) - if (hasConditionalHeader) + if (hasConditionalHeader) { options.cache = 'no-store' + } } // cacheManager is deprecated, but if it's set and // cachePath is not we should copy it to the new field - if (options.cacheManager && !options.cachePath) + if (options.cacheManager && !options.cachePath) { options.cachePath = options.cacheManager + } return options } diff --git a/node_modules/make-fetch-happen/lib/remote.js b/node_modules/make-fetch-happen/lib/remote.js index 7e4ed24edb530..a8b8d2a0198d4 100644 --- a/node_modules/make-fetch-happen/lib/remote.js +++ b/node_modules/make-fetch-happen/lib/remote.js @@ -29,11 +29,13 @@ const RETRY_TYPES = [ // and verifying response integrity const remoteFetch = (request, options) => { const agent = getAgent(request.url, options) - if (!request.headers.has('connection')) + if (!request.headers.has('connection')) { request.headers.set('connection', agent ? 'keep-alive' : 'close') + } - if (!request.headers.has('user-agent')) + if (!request.headers.has('user-agent')) { request.headers.set('user-agent', USER_AGENT) + } // keep our own options since we're overriding the agent // and the redirect mode @@ -64,8 +66,9 @@ const remoteFetch = (request, options) => { ([408, 420, 429].includes(res.status) || res.status >= 500) if (isRetriable) { - if (typeof options.onRetry === 'function') + if (typeof options.onRetry === 'function') { options.onRetry(res) + } return retryHandler(res) } @@ -82,18 +85,21 @@ const remoteFetch = (request, options) => { const isRetryError = err.retried instanceof fetch.Response || (RETRY_ERRORS.includes(code) && RETRY_TYPES.includes(err.type)) - if (req.method === 'POST' || isRetryError) + if (req.method === 'POST' || isRetryError) { throw err + } - if (typeof options.onRetry === 'function') + if (typeof options.onRetry === 'function') { options.onRetry(err) + } return retryHandler(err) } }, options.retry).catch((err) => { // don't reject for http errors, just return them - if (err.status >= 400 && err.type !== 'system') + if (err.status >= 400 && err.type !== 'system') { return err + } throw err }) diff --git a/node_modules/make-fetch-happen/package.json b/node_modules/make-fetch-happen/package.json index dae7b37da4069..7b61953e56f57 100644 --- a/node_modules/make-fetch-happen/package.json +++ b/node_modules/make-fetch-happen/package.json @@ -1,20 +1,23 @@ { "name": "make-fetch-happen", - "version": "9.1.0", + "version": "10.0.0", "description": "Opinionated, caching, retrying fetch client", "main": "lib/index.js", "files": [ + "bin", "lib" ], "scripts": { - "preversion": "npm t", + "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push --follow-tags", + "prepublishOnly": "git push origin --follow-tags", "test": "tap", "posttest": "npm run lint", "eslint": "eslint", - "lint": "npm run eslint -- lib test", - "lintfix": "npm run lint -- --fix" + "lint": "eslint '**/*.js'", + "lintfix": "npm run lint -- --fix", + "postlint": "npm-template-check", + "snap": "tap" }, "repository": "https://github.com/npm/make-fetch-happen", "keywords": [ @@ -26,17 +29,13 @@ "cache", "subresource integrity" ], - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech", - "twitter": "maybekatz" - }, + "author": "GitHub Inc.", "license": "ISC", "dependencies": { "agentkeepalive": "^4.1.3", "cacache": "^15.2.0", "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", + "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^6.0.0", @@ -45,20 +44,17 @@ "minipass-fetch": "^1.3.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", + "negotiator": "^0.6.3", "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.0.0", "ssri": "^8.0.0" }, "devDependencies": { - "eslint": "^7.26.0", - "eslint-plugin-import": "^2.23.2", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^5.1.0", - "eslint-plugin-standard": "^5.0.0", + "@npmcli/template-oss": "^2.5.1", + "eslint": "^8.7.0", "mkdirp": "^1.0.4", "nock": "^13.0.11", - "npmlog": "^5.0.0", + "npmlog": "^6.0.0", "require-inject": "^1.4.2", "rimraf": "^3.0.2", "safe-buffer": "^5.2.1", @@ -66,11 +62,14 @@ "tap": "^15.0.9" }, "engines": { - "node": ">= 10" + "node": "^12.13.0 || ^14.15.0 || >=16" }, "tap": { "color": 1, "files": "test/*.js", "check-coverage": true + }, + "templateOSS": { + "version": "2.5.1" } } diff --git a/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.d.ts b/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.d.ts new file mode 100644 index 0000000000000..a7efe943b2acb --- /dev/null +++ b/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.d.ts @@ -0,0 +1,14 @@ +/// +import { EventEmitter } from 'events'; +declare function once(emitter: EventEmitter, name: string): once.CancelablePromise; +declare namespace once { + interface CancelFunction { + (): void; + } + interface CancelablePromise extends Promise { + cancel: CancelFunction; + } + type CancellablePromise = CancelablePromise; + function spread(emitter: EventEmitter, name: string): once.CancelablePromise; +} +export = once; diff --git a/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js b/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js new file mode 100644 index 0000000000000..bfd0dc88f758b --- /dev/null +++ b/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js @@ -0,0 +1,39 @@ +"use strict"; +function noop() { } +function once(emitter, name) { + const o = once.spread(emitter, name); + const r = o.then((args) => args[0]); + r.cancel = o.cancel; + return r; +} +(function (once) { + function spread(emitter, name) { + let c = null; + const p = new Promise((resolve, reject) => { + function cancel() { + emitter.removeListener(name, onEvent); + emitter.removeListener('error', onError); + p.cancel = noop; + } + function onEvent(...args) { + cancel(); + resolve(args); + } + function onError(err) { + cancel(); + reject(err); + } + c = cancel; + emitter.on(name, onEvent); + emitter.on('error', onError); + }); + if (!c) { + throw new TypeError('Could not get `cancel()` function'); + } + p.cancel = c; + return p; + } + once.spread = spread; +})(once || (once = {})); +module.exports = once; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js.map b/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js.map new file mode 100644 index 0000000000000..30d20491dbca8 --- /dev/null +++ b/node_modules/node-g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AAI,CAAC,CAAC,EAAE;YACP,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;SACzD;QACD,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACb,OAAO,CAAC,CAAC;IACV,CAAC;IA5Be,WAAM,SA4BrB,CAAA;AACF,CAAC,EAxCS,IAAI,KAAJ,IAAI,QAwCb;AAED,iBAAS,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/package.json b/node_modules/node-gyp/node_modules/@tootallnate/once/package.json similarity index 56% rename from node_modules/npm-registry-fetch/node_modules/@tootallnate/once/package.json rename to node_modules/node-gyp/node_modules/@tootallnate/once/package.json index 69ce947d9c310..8343f9fad73ab 100644 --- a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/package.json +++ b/node_modules/node-gyp/node_modules/@tootallnate/once/package.json @@ -1,6 +1,6 @@ { "name": "@tootallnate/once", - "version": "2.0.0", + "version": "1.1.2", "description": "Creates a Promise that waits for a single event", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -10,7 +10,8 @@ "scripts": { "prebuild": "rimraf dist", "build": "tsc", - "test": "jest", + "test": "mocha --reporter spec", + "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { @@ -24,29 +25,21 @@ "url": "https://github.com/TooTallNate/once/issues" }, "devDependencies": { - "@types/jest": "^27.0.2", "@types/node": "^12.12.11", - "abort-controller": "^3.0.0", - "jest": "^27.2.1", + "@typescript-eslint/eslint-plugin": "1.6.0", + "@typescript-eslint/parser": "1.1.0", + "eslint": "5.16.0", + "eslint-config-airbnb": "17.1.0", + "eslint-config-prettier": "4.1.0", + "eslint-import-resolver-typescript": "1.1.1", + "eslint-plugin-import": "2.16.0", + "eslint-plugin-jsx-a11y": "6.2.1", + "eslint-plugin-react": "7.12.4", + "mocha": "^6.2.2", "rimraf": "^3.0.0", - "ts-jest": "^27.0.5", - "typescript": "^4.4.3" + "typescript": "^3.7.3" }, "engines": { - "node": ">= 10" - }, - "jest": { - "preset": "ts-jest", - "globals": { - "ts-jest": { - "diagnostics": false, - "isolatedModules": true - } - }, - "verbose": false, - "testEnvironment": "node", - "testMatch": [ - "/test/**/*.test.ts" - ] + "node": ">= 6" } } diff --git a/node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/agent.d.ts b/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.d.ts similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/agent.d.ts rename to node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.d.ts diff --git a/node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/agent.js b/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js similarity index 97% rename from node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/agent.js rename to node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js index aca8280431488..0252850516819 100644 --- a/node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/agent.js +++ b/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js @@ -18,7 +18,7 @@ const url_1 = __importDefault(require("url")); const debug_1 = __importDefault(require("debug")); const once_1 = __importDefault(require("@tootallnate/once")); const agent_base_1 = require("agent-base"); -const debug = (0, debug_1.default)('http-proxy-agent'); +const debug = debug_1.default('http-proxy-agent'); function isHTTPS(protocol) { return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } @@ -86,7 +86,7 @@ class HttpProxyAgent extends agent_base_1.Agent { if (parsed.port === '80') { // if port is 80, then we can remove the port so that the // ":80" portion is not on the produced URL - parsed.port = ''; + delete parsed.port; } // Change the `http.ClientRequest` instance's "path" field // to the absolute path of the URL that will be requested. @@ -136,7 +136,7 @@ class HttpProxyAgent extends agent_base_1.Agent { // function throws instead of the `http` request machinery. This is // important for i.e. `PacProxyAgent` which determines a failed proxy // connection via the `callback()` function throwing. - yield (0, once_1.default)(socket, 'connect'); + yield once_1.default(socket, 'connect'); return socket; }); } diff --git a/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js.map b/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js.map new file mode 100644 index 0000000000000..7a407620d8e50 --- /dev/null +++ b/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,kDAAgC;AAChC,6DAAqC;AACrC,2CAAkE;AAGlE,MAAM,KAAK,GAAG,eAAW,CAAC,kBAAkB,CAAC,CAAC;AAY9C,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAqB,cAAe,SAAQ,kBAAK;IAIhD,YAAY,KAAqC;QAChD,IAAI,IAA2B,CAAC;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9D,CAAC;SACF;QACD,KAAK,CAAC,0CAA0C,EAAE,IAAI,CAAC,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,KAAK,qBAA+B,IAAI,CAAE,CAAC;QAEjD,wDAAwD;QACxD,uBAAuB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,+DAA+D;QAC/D,KAAK,CAAC,IAAI,GAAG,KAAK,CAA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,CAAC;oBAC7C,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC5D,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;iBACvC;qBAAM,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;oBACvD,aAAa;oBACb,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBAC/B,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;wBACrB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC7C,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;iBACnD;aACD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,qEAAqE;YACrE,qDAAqD;YACrD,MAAM,cAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAE9B,OAAO,MAAM,CAAC;QACf,CAAC;KAAA;CACD;AA1ID,iCA0IC"} \ No newline at end of file diff --git a/node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/index.d.ts b/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.d.ts similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/index.d.ts rename to node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.d.ts diff --git a/node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/index.js b/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/index.js rename to node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js diff --git a/node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/index.js.map b/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js.map similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/index.js.map rename to node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js.map diff --git a/node_modules/npm-registry-fetch/node_modules/http-proxy-agent/package.json b/node_modules/node-gyp/node_modules/http-proxy-agent/package.json similarity index 92% rename from node_modules/npm-registry-fetch/node_modules/http-proxy-agent/package.json rename to node_modules/node-gyp/node_modules/http-proxy-agent/package.json index 659d6e11e80e4..870dd5d8af267 100644 --- a/node_modules/npm-registry-fetch/node_modules/http-proxy-agent/package.json +++ b/node_modules/node-gyp/node_modules/http-proxy-agent/package.json @@ -1,6 +1,6 @@ { "name": "http-proxy-agent", - "version": "5.0.0", + "version": "4.0.1", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTP", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -30,13 +30,13 @@ "url": "https://github.com/TooTallNate/node-http-proxy-agent/issues" }, "dependencies": { - "@tootallnate/once": "2", + "@tootallnate/once": "1", "agent-base": "6", "debug": "4" }, "devDependencies": { "@types/debug": "4", - "@types/node": "^12.19.2", + "@types/node": "^12.12.11", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "eslint": "5.16.0", @@ -49,7 +49,7 @@ "mocha": "^6.2.2", "proxy": "1", "rimraf": "^3.0.0", - "typescript": "^4.4.3" + "typescript": "^3.5.3" }, "engines": { "node": ">= 6" diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/LICENSE b/node_modules/node-gyp/node_modules/make-fetch-happen/LICENSE similarity index 95% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/LICENSE rename to node_modules/node-gyp/node_modules/make-fetch-happen/LICENSE index 1808eb2844231..8d28acf866d93 100644 --- a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/LICENSE +++ b/node_modules/node-gyp/node_modules/make-fetch-happen/LICENSE @@ -1,6 +1,6 @@ ISC License -Copyright 2017-2022 (c) npm, Inc. +Copyright (c) npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/agent.js b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/agent.js similarity index 93% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/agent.js rename to node_modules/node-gyp/node_modules/make-fetch-happen/lib/agent.js index 095c35c5a2523..3675dd8ae981a 100644 --- a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/agent.js +++ b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/agent.js @@ -50,13 +50,11 @@ function getAgent (uri, opts) { : isHttps ? require('https').globalAgent : require('http').globalAgent - if (isLambda && !pxuri) { + if (isLambda && !pxuri) return lambdaAgent - } - if (AGENT_CACHE.peek(key)) { + if (AGENT_CACHE.peek(key)) return AGENT_CACHE.get(key) - } if (pxuri) { const pxopts = isLambda ? { @@ -88,19 +86,16 @@ function getAgent (uri, opts) { function checkNoProxy (uri, opts) { const host = new url.URL(uri).hostname.split('.').reverse() let noproxy = (opts.noProxy || getProcessEnv('no_proxy')) - if (typeof noproxy === 'string') { + if (typeof noproxy === 'string') noproxy = noproxy.split(/\s*,\s*/g) - } return noproxy && noproxy.some(no => { const noParts = no.split('.').filter(x => x).reverse() - if (!noParts.length) { + if (!noParts.length) return false - } for (let i = 0; i < noParts.length; i++) { - if (host[i] !== noParts[i]) { + if (host[i] !== noParts[i]) return false - } } return true }) @@ -109,9 +104,8 @@ function checkNoProxy (uri, opts) { module.exports.getProcessEnv = getProcessEnv function getProcessEnv (env) { - if (!env) { + if (!env) return - } let value @@ -120,9 +114,8 @@ function getProcessEnv (env) { value = process.env[e] || process.env[e.toUpperCase()] || process.env[e.toLowerCase()] - if (typeof value !== 'undefined') { + if (typeof value !== 'undefined') break - } } } @@ -148,9 +141,8 @@ function getProxyUri (uri, opts) { protocol === 'http:' && getProcessEnv(['https_proxy', 'http_proxy', 'proxy']) ) - if (!proxy) { + if (!proxy) return null - } const parsedProxy = (typeof proxy === 'string') ? new url.URL(proxy) : proxy @@ -185,14 +177,13 @@ function getProxy (proxyUrl, opts, isHttps) { } if (proxyUrl.protocol === 'http:' || proxyUrl.protocol === 'https:') { - if (!isHttps) { + if (!isHttps) return new HttpProxyAgent(popts) - } else { + else return new HttpsProxyAgent(popts) - } - } else if (proxyUrl.protocol.startsWith('socks')) { + } else if (proxyUrl.protocol.startsWith('socks')) return new SocksProxyAgent(popts) - } else { + else { throw Object.assign( new Error(`unsupported proxy protocol: '${proxyUrl.protocol}'`), { diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/entry.js b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/entry.js similarity index 88% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/entry.js rename to node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/entry.js index ae2ad8c7667f2..a2acea156ee6f 100644 --- a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/entry.js +++ b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/entry.js @@ -52,31 +52,23 @@ const getMetadata = (request, response, options) => { url: request.url, reqHeaders: {}, resHeaders: {}, - - // options on which we must match the request and vary the response - options: { - compress: options.compress != null ? options.compress : request.compress, - }, } // only save the status if it's not a 200 or 304 - if (response.status !== 200 && response.status !== 304) { + if (response.status !== 200 && response.status !== 304) metadata.status = response.status - } for (const name of KEEP_REQUEST_HEADERS) { - if (request.headers.has(name)) { + if (request.headers.has(name)) metadata.reqHeaders[name] = request.headers.get(name) - } } // if the request's host header differs from the host in the url // we need to keep it, otherwise it's just noise and we ignore it const host = request.headers.get('host') const parsedUrl = new url.URL(request.url) - if (host && parsedUrl.host !== host) { + if (host && parsedUrl.host !== host) metadata.reqHeaders.host = host - } // if the response has a vary header, make sure // we store the relevant request headers too @@ -90,17 +82,25 @@ const getMetadata = (request, response, options) => { // copy any other request headers that will vary the response const varyHeaders = vary.trim().toLowerCase().split(/\s*,\s*/) for (const name of varyHeaders) { - if (request.headers.has(name)) { + // explicitly ignore accept-encoding here + if (name !== 'accept-encoding' && request.headers.has(name)) metadata.reqHeaders[name] = request.headers.get(name) - } } } } for (const name of KEEP_RESPONSE_HEADERS) { - if (response.headers.has(name)) { + if (response.headers.has(name)) metadata.resHeaders[name] = response.headers.get(name) - } + } + + // we only store accept-encoding and content-encoding if the user + // has disabled automatic compression and decompression in minipass-fetch + // since if it's enabled (the default) then the content will have + // already been decompressed making the header a lie + if (options.compress === false) { + metadata.reqHeaders['accept-encoding'] = request.headers.get('accept-encoding') + metadata.resHeaders['content-encoding'] = response.headers.get('content-encoding') } return metadata @@ -121,9 +121,8 @@ class CacheEntry { // entry timestamp to determine staleness because cacache will update it // when it verifies its data this.entry.metadata.time = this.entry.metadata.time || this.entry.time - } else { + } else this.key = cacheKey(request) - } this.options = options @@ -144,17 +143,9 @@ class CacheEntry { return entryA.policy.satisfies(entryB.request) }, { validateEntry: (entry) => { - // clean out entries with a buggy content-encoding value - if (entry.metadata && - entry.metadata.resHeaders && - entry.metadata.resHeaders['content-encoding'] === null) { - return false - } - // if an integrity is null, it needs to have a status specified - if (entry.integrity === null) { + if (entry.integrity === null) return !!(entry.metadata && entry.metadata.status) - } return true }, @@ -167,9 +158,8 @@ class CacheEntry { // a cache mode of 'reload' means to behave as though we have no cache // on the way to the network. return undefined to allow cacheFetch to // create a brand new request no matter what. - if (options.cache === 'reload') { + if (options.cache === 'reload') return - } // find the specific entry that satisfies the request let match @@ -204,7 +194,6 @@ class CacheEntry { this[_request] = new Request(this.entry.metadata.url, { method: 'GET', headers: this.entry.metadata.reqHeaders, - ...this.entry.metadata.options, }) } @@ -246,11 +235,7 @@ class CacheEntry { // if we got a status other than 200, 301, or 308, // or the CachePolicy forbid storage, append the // cache status header and return it untouched - if ( - this.request.method !== 'GET' || - ![200, 301, 308].includes(this.response.status) || - !this.policy.storable() - ) { + if (this.request.method !== 'GET' || ![200, 301, 308].includes(this.response.status) || !this.policy.storable()) { this.response.headers.set('x-local-cache-status', 'skip') return this.response } @@ -291,8 +276,7 @@ class CacheEntry { abortStream = collector collector.on('collect', (data) => { // TODO if the cache write fails, log a warning but return the response anyway - cacache.put(this.options.cachePath, this.key, data, cacheOpts) - .then(cacheWriteResolve, cacheWriteReject) + cacache.put(this.options.cachePath, this.key, data, cacheOpts).then(cacheWriteResolve, cacheWriteReject) }) body.unshift(collector) body.unshift(this.response.body) @@ -321,9 +305,8 @@ class CacheEntry { // know to be invalid to the cache abortStream.destroy(err) }) - } else { + } else await cacache.index.insert(this.options.cachePath, this.key, null, cacheOpts) - } // note: we do not set the x-local-cache-hash header because we do not know // the hash value until after the write to the cache completes, which doesn't @@ -364,37 +347,25 @@ class CacheEntry { onResume = async () => { removeOnResume() try { - const content = await cacache.get.byDigest( - this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } - ) + const content = await cacache.get.byDigest(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) body.end(content) } catch (err) { - if (err.code === 'EINTEGRITY') { - await cacache.rm.content( - this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } - ) - } - if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') { + if (err.code === 'EINTEGRITY') + await cacache.rm.content(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') await CacheEntry.invalidate(this.request, this.options) - } body.emit('error', err) } } } else { onResume = () => { - const cacheStream = cacache.get.stream.byDigest( - this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } - ) + const cacheStream = cacache.get.stream.byDigest(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) cacheStream.on('error', async (err) => { cacheStream.pause() - if (err.code === 'EINTEGRITY') { - await cacache.rm.content( - this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } - ) - } - if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') { + if (err.code === 'EINTEGRITY') + await cacache.rm.content(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') await CacheEntry.invalidate(this.request, this.options) - } body.emit('error', err) cacheStream.resume() }) @@ -444,9 +415,8 @@ class CacheEntry { // if the network fetch fails, return the stale // cached response unless it has a cache-control // of 'must-revalidate' - if (!this.policy.mustRevalidate) { + if (!this.policy.mustRevalidate) return this.respond(request.method, options, 'stale') - } throw err } @@ -459,12 +429,8 @@ class CacheEntry { // in the old cache entry to the new one, if the new metadata does not already // include that header for (const name of KEEP_RESPONSE_HEADERS) { - if ( - !hasOwnProperty(metadata.resHeaders, name) && - hasOwnProperty(this.entry.metadata.resHeaders, name) - ) { + if (!hasOwnProperty(metadata.resHeaders, name) && hasOwnProperty(this.entry.metadata.resHeaders, name)) metadata.resHeaders[name] = this.entry.metadata.resHeaders[name] - } } try { diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/errors.js b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/errors.js similarity index 84% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/errors.js rename to node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/errors.js index 67a66573bebe6..31e97c4b033c0 100644 --- a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/errors.js +++ b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/errors.js @@ -1,6 +1,5 @@ class NotCachedError extends Error { constructor (url) { - /* eslint-disable-next-line max-len */ super(`request to ${url} failed: cache mode is 'only-if-cached' but no cached response is available.`) this.code = 'ENOTCACHED' } diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/index.js b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/index.js similarity index 91% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/index.js rename to node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/index.js index 17a6425592bcf..cca93d9b4eb5d 100644 --- a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/index.js +++ b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/index.js @@ -8,9 +8,8 @@ const cacheFetch = async (request, options) => { const entry = await CacheEntry.find(request, options) if (!entry) { // no cached result, if the cache mode is 'only-if-cached' that's a failure - if (options.cache === 'only-if-cached') { + if (options.cache === 'only-if-cached') throw new NotCachedError(request.url) - } // otherwise, we make a request, store it and return it const response = await remote(request, options) @@ -20,9 +19,8 @@ const cacheFetch = async (request, options) => { // we have a cached response that satisfies this request, however if the cache // mode is 'no-cache' then we send the revalidation request no matter what - if (options.cache === 'no-cache') { + if (options.cache === 'no-cache') return entry.revalidate(request, options) - } // if the cached entry is not stale, or if the cache mode is 'force-cache' or // 'only-if-cached' we can respond with the cached entry. set the status @@ -30,18 +28,16 @@ const cacheFetch = async (request, options) => { const _needsRevalidation = entry.policy.needsRevalidation(request) if (options.cache === 'force-cache' || options.cache === 'only-if-cached' || - !_needsRevalidation) { + !_needsRevalidation) return entry.respond(request.method, options, _needsRevalidation ? 'stale' : 'hit') - } // if we got here, the cache entry is stale so revalidate it return entry.revalidate(request, options) } cacheFetch.invalidate = async (request, options) => { - if (!options.cachePath) { + if (!options.cachePath) return - } return CacheEntry.invalidate(request, options) } diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/key.js b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/key.js similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/key.js rename to node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/key.js diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/policy.js b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/policy.js similarity index 82% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/policy.js rename to node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/policy.js index ada3c8600dae9..e0959f64ddf9d 100644 --- a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/cache/policy.js +++ b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/policy.js @@ -2,6 +2,19 @@ const CacheSemantics = require('http-cache-semantics') const Negotiator = require('negotiator') const ssri = require('ssri') +// HACK: negotiator lazy loads several of its own modules +// as a micro optimization. we need to be sure that they're +// in memory as soon as possible at startup so that we do +// not try to lazy load them after the directory has been +// retired during a self update of the npm CLI, we do this +// by calling all of the methods that trigger a lazy load +// on a fake instance. +const preloadNegotiator = new Negotiator({ headers: {} }) +preloadNegotiator.charsets() +preloadNegotiator.encodings() +preloadNegotiator.languages() +preloadNegotiator.mediaTypes() + // options passed to http-cache-semantics constructor const policyOptions = { shared: false, @@ -18,7 +31,6 @@ const requestObject = (request) => { method: request.method, url: request.url, headers: {}, - compress: request.compress, } request.headers.forEach((value, key) => { @@ -62,19 +74,16 @@ class CachePolicy { // static method to quickly determine if a request alone is storable static storable (request, options) { // no cachePath means no caching - if (!options.cachePath) { + if (!options.cachePath) return false - } // user explicitly asked not to cache - if (options.cache === 'no-store') { + if (options.cache === 'no-store') return false - } // we only cache GET and HEAD requests - if (!['GET', 'HEAD'].includes(request.method)) { + if (!['GET', 'HEAD'].includes(request.method)) return false - } // otherwise, let http-cache-semantics make the decision // based on the request's headers @@ -85,32 +94,23 @@ class CachePolicy { // returns true if the policy satisfies the request satisfies (request) { const _req = requestObject(request) - if (this.request.headers.host !== _req.headers.host) { - return false - } - - if (this.request.compress !== _req.compress) { + if (this.request.headers.host !== _req.headers.host) return false - } const negotiatorA = new Negotiator(this.request) const negotiatorB = new Negotiator(_req) - if (JSON.stringify(negotiatorA.mediaTypes()) !== JSON.stringify(negotiatorB.mediaTypes())) { + if (JSON.stringify(negotiatorA.mediaTypes()) !== JSON.stringify(negotiatorB.mediaTypes())) return false - } - if (JSON.stringify(negotiatorA.languages()) !== JSON.stringify(negotiatorB.languages())) { + if (JSON.stringify(negotiatorA.languages()) !== JSON.stringify(negotiatorB.languages())) return false - } - if (JSON.stringify(negotiatorA.encodings()) !== JSON.stringify(negotiatorB.encodings())) { + if (JSON.stringify(negotiatorA.encodings()) !== JSON.stringify(negotiatorB.encodings())) return false - } - if (this.options.integrity) { + if (this.options.integrity) return ssri.parse(this.options.integrity).match(this.entry.integrity) - } return true } diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/fetch.js b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/fetch.js similarity index 67% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/fetch.js rename to node_modules/node-gyp/node_modules/make-fetch-happen/lib/fetch.js index 233ba67e16550..dfded79295da1 100644 --- a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/fetch.js +++ b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/fetch.js @@ -13,28 +13,20 @@ const remote = require('./remote.js') // in the fetch being rejected if the redirect is // possible but invalid for some reason const canFollowRedirect = (request, response, options) => { - if (!isRedirect(response.status)) { + if (!isRedirect(response.status)) return false - } - if (options.redirect === 'manual') { + if (options.redirect === 'manual') return false - } - if (options.redirect === 'error') { - throw new FetchError(`redirect mode is set to error: ${request.url}`, - 'no-redirect', { code: 'ENOREDIRECT' }) - } + if (options.redirect === 'error') + throw new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect', { code: 'ENOREDIRECT' }) - if (!response.headers.has('location')) { - throw new FetchError(`redirect location header missing for: ${request.url}`, - 'no-location', { code: 'EINVALIDREDIRECT' }) - } + if (!response.headers.has('location')) + throw new FetchError(`redirect location header missing for: ${request.url}`, 'no-location', { code: 'EINVALIDREDIRECT' }) - if (request.counter >= request.follow) { - throw new FetchError(`maximum redirect reached at: ${request.url}`, - 'max-redirect', { code: 'EMAXREDIRECT' }) - } + if (request.counter >= request.follow) + throw new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect', { code: 'EMAXREDIRECT' }) return true } @@ -47,34 +39,26 @@ const getRedirect = (request, response, options) => { const location = response.headers.get('location') const redirectUrl = new url.URL(location, /^https?:/.test(location) ? undefined : request.url) // Comment below is used under the following license: - /** - * @license - * Copyright (c) 2010-2012 Mikeal Rogers - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an "AS - * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language - * governing permissions and limitations under the License. - */ + // Copyright (c) 2010-2012 Mikeal Rogers + // Licensed under the Apache License, Version 2.0 (the "License"); + // you may not use this file except in compliance with the License. + // You may obtain a copy of the License at + // http://www.apache.org/licenses/LICENSE-2.0 + // Unless required by applicable law or agreed to in writing, + // software distributed under the License is distributed on an "AS + // IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + // express or implied. See the License for the specific language + // governing permissions and limitations under the License. // Remove authorization if changing hostnames (but not if just // changing ports or protocols). This matches the behavior of request: // https://github.com/request/request/blob/b12a6245/lib/redirect.js#L134-L138 - if (new url.URL(request.url).hostname !== redirectUrl.hostname) { + if (new url.URL(request.url).hostname !== redirectUrl.hostname) request.headers.delete('authorization') - request.headers.delete('cookie') - } // for POST request with 301/302 response, or any request with 303 response, // use GET when following redirect - if ( - response.status === 303 || - (request.method === 'POST' && [301, 302].includes(response.status)) - ) { + if (response.status === 303 || (request.method === 'POST' && [301, 302].includes(response.status))) { _opts.method = 'GET' _opts.body = null request.headers.delete('content-length') @@ -103,13 +87,11 @@ const fetch = async (request, options) => { // request url if (!['GET', 'HEAD'].includes(request.method) && response.status >= 200 && - response.status <= 399) { + response.status <= 399) await cache.invalidate(request, options) - } - if (!canFollowRedirect(request, response, options)) { + if (!canFollowRedirect(request, response, options)) return response - } const redirect = getRedirect(request, response, options) return fetch(redirect.request, redirect.options) diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/index.js b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/index.js similarity index 100% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/index.js rename to node_modules/node-gyp/node_modules/make-fetch-happen/lib/index.js diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/options.js b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/options.js similarity index 75% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/options.js rename to node_modules/node-gyp/node_modules/make-fetch-happen/lib/options.js index a0c8664adf02a..f6138e6e1d13a 100644 --- a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/options.js +++ b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/options.js @@ -7,40 +7,36 @@ const conditionalHeaders = [ ] const configureOptions = (opts) => { - const { strictSSL, ...options } = { ...opts } + const {strictSSL, ...options} = { ...opts } options.method = options.method ? options.method.toUpperCase() : 'GET' options.rejectUnauthorized = strictSSL !== false - if (!options.retry) { + if (!options.retry) options.retry = { retries: 0 } - } else if (typeof options.retry === 'string') { + else if (typeof options.retry === 'string') { const retries = parseInt(options.retry, 10) - if (isFinite(retries)) { + if (isFinite(retries)) options.retry = { retries } - } else { + else options.retry = { retries: 0 } - } - } else if (typeof options.retry === 'number') { + } else if (typeof options.retry === 'number') options.retry = { retries: options.retry } - } else { + else options.retry = { retries: 0, ...options.retry } - } options.cache = options.cache || 'default' if (options.cache === 'default') { const hasConditionalHeader = Object.keys(options.headers || {}).some((name) => { return conditionalHeaders.includes(name.toLowerCase()) }) - if (hasConditionalHeader) { + if (hasConditionalHeader) options.cache = 'no-store' - } } // cacheManager is deprecated, but if it's set and // cachePath is not we should copy it to the new field - if (options.cacheManager && !options.cachePath) { + if (options.cacheManager && !options.cachePath) options.cachePath = options.cacheManager - } return options } diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/remote.js b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/remote.js similarity index 90% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/remote.js rename to node_modules/node-gyp/node_modules/make-fetch-happen/lib/remote.js index a8b8d2a0198d4..7e4ed24edb530 100644 --- a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/lib/remote.js +++ b/node_modules/node-gyp/node_modules/make-fetch-happen/lib/remote.js @@ -29,13 +29,11 @@ const RETRY_TYPES = [ // and verifying response integrity const remoteFetch = (request, options) => { const agent = getAgent(request.url, options) - if (!request.headers.has('connection')) { + if (!request.headers.has('connection')) request.headers.set('connection', agent ? 'keep-alive' : 'close') - } - if (!request.headers.has('user-agent')) { + if (!request.headers.has('user-agent')) request.headers.set('user-agent', USER_AGENT) - } // keep our own options since we're overriding the agent // and the redirect mode @@ -66,9 +64,8 @@ const remoteFetch = (request, options) => { ([408, 420, 429].includes(res.status) || res.status >= 500) if (isRetriable) { - if (typeof options.onRetry === 'function') { + if (typeof options.onRetry === 'function') options.onRetry(res) - } return retryHandler(res) } @@ -85,21 +82,18 @@ const remoteFetch = (request, options) => { const isRetryError = err.retried instanceof fetch.Response || (RETRY_ERRORS.includes(code) && RETRY_TYPES.includes(err.type)) - if (req.method === 'POST' || isRetryError) { + if (req.method === 'POST' || isRetryError) throw err - } - if (typeof options.onRetry === 'function') { + if (typeof options.onRetry === 'function') options.onRetry(err) - } return retryHandler(err) } }, options.retry).catch((err) => { // don't reject for http errors, just return them - if (err.status >= 400 && err.type !== 'system') { + if (err.status >= 400 && err.type !== 'system') return err - } throw err }) diff --git a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/package.json b/node_modules/node-gyp/node_modules/make-fetch-happen/package.json similarity index 69% rename from node_modules/npm-registry-fetch/node_modules/make-fetch-happen/package.json rename to node_modules/node-gyp/node_modules/make-fetch-happen/package.json index 7b61953e56f57..dae7b37da4069 100644 --- a/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/package.json +++ b/node_modules/node-gyp/node_modules/make-fetch-happen/package.json @@ -1,23 +1,20 @@ { "name": "make-fetch-happen", - "version": "10.0.0", + "version": "9.1.0", "description": "Opinionated, caching, retrying fetch client", "main": "lib/index.js", "files": [ - "bin", "lib" ], "scripts": { - "preversion": "npm test", + "preversion": "npm t", "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", + "prepublishOnly": "git push --follow-tags", "test": "tap", "posttest": "npm run lint", "eslint": "eslint", - "lint": "eslint '**/*.js'", - "lintfix": "npm run lint -- --fix", - "postlint": "npm-template-check", - "snap": "tap" + "lint": "npm run eslint -- lib test", + "lintfix": "npm run lint -- --fix" }, "repository": "https://github.com/npm/make-fetch-happen", "keywords": [ @@ -29,13 +26,17 @@ "cache", "subresource integrity" ], - "author": "GitHub Inc.", + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech", + "twitter": "maybekatz" + }, "license": "ISC", "dependencies": { "agentkeepalive": "^4.1.3", "cacache": "^15.2.0", "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^5.0.0", + "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^6.0.0", @@ -44,17 +45,20 @@ "minipass-fetch": "^1.3.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.3", + "negotiator": "^0.6.2", "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.0.0", "ssri": "^8.0.0" }, "devDependencies": { - "@npmcli/template-oss": "^2.5.1", - "eslint": "^8.7.0", + "eslint": "^7.26.0", + "eslint-plugin-import": "^2.23.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-standard": "^5.0.0", "mkdirp": "^1.0.4", "nock": "^13.0.11", - "npmlog": "^6.0.0", + "npmlog": "^5.0.0", "require-inject": "^1.4.2", "rimraf": "^3.0.2", "safe-buffer": "^5.2.1", @@ -62,14 +66,11 @@ "tap": "^15.0.9" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": ">= 10" }, "tap": { "color": 1, "files": "test/*.js", "check-coverage": true - }, - "templateOSS": { - "version": "2.5.1" } } diff --git a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/index.d.ts b/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/index.d.ts deleted file mode 100644 index 93d02a9a348b5..0000000000000 --- a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import { EventEmitter } from 'events'; -import { EventNames, EventListenerParameters, AbortSignal } from './types'; -export interface OnceOptions { - signal?: AbortSignal; -} -export default function once>(emitter: Emitter, name: Event, { signal }?: OnceOptions): Promise>; diff --git a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/index.js b/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/index.js deleted file mode 100644 index ca6385b1b82f8..0000000000000 --- a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/index.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function once(emitter, name, { signal } = {}) { - return new Promise((resolve, reject) => { - function cleanup() { - signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', cleanup); - emitter.removeListener(name, onEvent); - emitter.removeListener('error', onError); - } - function onEvent(...args) { - cleanup(); - resolve(args); - } - function onError(err) { - cleanup(); - reject(err); - } - signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', cleanup); - emitter.on(name, onEvent); - emitter.on('error', onError); - }); -} -exports.default = once; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/index.js.map b/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/index.js.map deleted file mode 100644 index 61708ca07f1b0..0000000000000 --- a/node_modules/npm-registry-fetch/node_modules/@tootallnate/once/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAOA,SAAwB,IAAI,CAI3B,OAAgB,EAChB,IAAW,EACX,EAAE,MAAM,KAAkB,EAAE;IAE5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,SAAS,OAAO;YACf,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9C,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACtC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1C,CAAC;QACD,SAAS,OAAO,CAAC,GAAG,IAAW;YAC9B,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,IAA+C,CAAC,CAAC;QAC1D,CAAC;QACD,SAAS,OAAO,CAAC,GAAU;YAC1B,OAAO,EAAE,CAAC;YACV,MAAM,CAAC,GAAG,CAAC,CAAC;QACb,CAAC;QACD,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC;AA1BD,uBA0BC"} \ No newline at end of file diff --git a/node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/agent.js.map b/node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/agent.js.map deleted file mode 100644 index bd3b56aa6dfdb..0000000000000 --- a/node_modules/npm-registry-fetch/node_modules/http-proxy-agent/dist/agent.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"agent.js","sourceRoot":"","sources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,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;oBACvD,aAAa;oBACb,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBAC/B,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;wBACrB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC7C,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;iBACnD;aACD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,qEAAqE;YACrE,qDAAqD;YACrD,MAAM,IAAA,cAAI,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAE9B,OAAO,MAAM,CAAC;QACf,CAAC;KAAA;CACD;AA1ID,iCA0IC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1ff08d57c986c..f4403b8373d72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -122,7 +122,7 @@ "libnpmsearch": "^4.0.0", "libnpmteam": "^3.0.0", "libnpmversion": "^2.0.2", - "make-fetch-happen": "^9.1.0", + "make-fetch-happen": "^10.0.0", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -1008,12 +1008,12 @@ } }, "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "inBundle": true, "engines": { - "node": ">= 6" + "node": ">= 10" } }, "node_modules/@types/hast": { @@ -3859,12 +3859,12 @@ "inBundle": true }, "node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "inBundle": true, "dependencies": { - "@tootallnate/once": "1", + "@tootallnate/once": "2", "agent-base": "6", "debug": "4" }, @@ -4669,15 +4669,6 @@ } } }, - "node_modules/jsdom/node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, "node_modules/jsdom/node_modules/acorn": { "version": "8.5.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", @@ -4690,20 +4681,6 @@ "node": ">=0.4.0" } }, - "node_modules/jsdom/node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "dev": true, - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -5039,15 +5016,15 @@ "peer": true }, "node_modules/make-fetch-happen": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", - "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.0.tgz", + "integrity": "sha512-CREcDkbKZZ64g5MN1FT+u58mDHX9FQFFtFyio5HonX44BdQdytqPZBXUz+6ibi2w/6ncji59f2phyXGSMGpgzA==", "inBundle": true, "dependencies": { "agentkeepalive": "^4.1.3", "cacache": "^15.2.0", "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", + "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^6.0.0", @@ -5056,13 +5033,13 @@ "minipass-fetch": "^1.3.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", + "negotiator": "^0.6.3", "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.0.0", "ssri": "^8.0.0" }, "engines": { - "node": ">= 10" + "node": "^12.13.0 || ^14.15.0 || >=16" } }, "node_modules/markdown-escapes": { @@ -5437,6 +5414,56 @@ "node": ">= 10.12.0" } }, + "node_modules/node-gyp/node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "inBundle": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/node-gyp/node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "inBundle": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/node-gyp/node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "inBundle": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/node-modules-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", @@ -5623,56 +5650,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16" } }, - "node_modules/npm-registry-fetch/node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "inBundle": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/npm-registry-fetch/node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "inBundle": true, - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/npm-registry-fetch/node_modules/make-fetch-happen": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.0.tgz", - "integrity": "sha512-CREcDkbKZZ64g5MN1FT+u58mDHX9FQFFtFyio5HonX44BdQdytqPZBXUz+6ibi2w/6ncji59f2phyXGSMGpgzA==", - "inBundle": true, - "dependencies": { - "agentkeepalive": "^4.1.3", - "cacache": "^15.2.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^6.0.0", - "minipass": "^3.1.3", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^1.3.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.3", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.0.0", - "ssri": "^8.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" - } - }, "node_modules/npm-user-validate": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-1.0.1.tgz", @@ -11650,9 +11627,9 @@ } }, "@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==" }, "@types/hast": { "version": "2.3.1", @@ -13776,11 +13753,11 @@ "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" }, "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "requires": { - "@tootallnate/once": "1", + "@tootallnate/once": "2", "agent-base": "6", "debug": "4" } @@ -14334,28 +14311,11 @@ "xml-name-validator": "^4.0.0" }, "dependencies": { - "@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true - }, "acorn": { "version": "8.5.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", "dev": true - }, - "http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "dev": true, - "requires": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - } } } }, @@ -14840,14 +14800,14 @@ "peer": true }, "make-fetch-happen": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", - "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.0.tgz", + "integrity": "sha512-CREcDkbKZZ64g5MN1FT+u58mDHX9FQFFtFyio5HonX44BdQdytqPZBXUz+6ibi2w/6ncji59f2phyXGSMGpgzA==", "requires": { "agentkeepalive": "^4.1.3", "cacache": "^15.2.0", "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", + "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^6.0.0", @@ -14856,7 +14816,7 @@ "minipass-fetch": "^1.3.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", + "negotiator": "^0.6.3", "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.0.0", "ssri": "^8.0.0" @@ -15130,6 +15090,46 @@ "semver": "^7.3.5", "tar": "^6.1.2", "which": "^2.0.2" + }, + "dependencies": { + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" + }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + } + }, + "make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "requires": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + } + } } }, "node-modules-regexp": { @@ -15266,46 +15266,6 @@ "minipass-json-stream": "^1.0.1", "minizlib": "^2.0.0", "npm-package-arg": "^8.0.0" - }, - "dependencies": { - "@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==" - }, - "http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "requires": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - } - }, - "make-fetch-happen": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.0.tgz", - "integrity": "sha512-CREcDkbKZZ64g5MN1FT+u58mDHX9FQFFtFyio5HonX44BdQdytqPZBXUz+6ibi2w/6ncji59f2phyXGSMGpgzA==", - "requires": { - "agentkeepalive": "^4.1.3", - "cacache": "^15.2.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^6.0.0", - "minipass": "^3.1.3", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^1.3.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.3", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.0.0", - "ssri": "^8.0.0" - } - } } }, "npm-user-validate": { diff --git a/package.json b/package.json index 111e3d96db0cb..e4e982ce8537a 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "libnpmsearch": "^4.0.0", "libnpmteam": "^3.0.0", "libnpmversion": "^2.0.2", - "make-fetch-happen": "^9.1.0", + "make-fetch-happen": "^10.0.0", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4",