diff --git a/deps/undici/src/changelogs/v7.30.2.md b/deps/undici/src/changelogs/v7.30.2.md deleted file mode 100644 index f2c3eb1a1a26..000000000000 --- a/deps/undici/src/changelogs/v7.30.2.md +++ /dev/null @@ -1,27 +0,0 @@ -# undici 7.30.2 security fixes - -This release fixes six vulnerabilities. - -## CVE-2026-116592 / GHSA-mqg3-3v4r-cm32 (high) - -Undici 7.30.1 could cache the final response from a redirect chain under the original request key without applying the origin, cache policy, freshness, or `Vary` requirements of every intermediate hop. This could poison a cache or expose one user's response to another user. The fix validates every redirect hop, combines their `Vary` fields, limits freshness and stale serving to the most restrictive hop, and invalidates persistent SQLite entries written by vulnerable releases. - -## CVE-2026-120474 / GHSA-7xg3-fphp-28hg (medium) - -In Undici 7.x, a shared cache used with `compose(redirect(), cache())` could store a credential-dependent response from a same-origin redirect under the original URL. A later authenticated or unauthenticated request could then receive another user's response. Redirected requests carrying `Authorization`, `Cookie`, or `Proxy-Authorization` are no longer stored under the original alias key. - -## CVE-2026-116630 / GHSA-5rm8-gv32-r954 (medium) - -In Undici 7.x, a cross-origin redirect during cache revalidation could let a `304 Not Modified` response from the redirect target validate a cached response from the original origin. Undici now checks that the revalidation target matches the cached URL and that any returned validator matches the stored representation before replaying the cached body. - -## CVE-2026-120415 / GHSA-9v6h-8rgp-m69f (medium) - -In Undici 7.x, the redirect interceptor did not strip credentials correctly when request headers were supplied as an array of `[name, value]` pairs. With a header-normalizing interceptor outside `redirect()`, credentials could be sent to a cross-origin redirect target. Undici now handles both tuple arrays and flat header arrays when removing sensitive headers. - -## CVE-2026-120222 / GHSA-3g9m-rv3r-w5w2 (medium) - -In Undici 7.x, a downstream handler exception during cache replay could escape as an uncaught exception or unhandled promise rejection and terminate the process. This included `dump` size-limit failures, excessive `Content-Encoding` values in `decompress`, asynchronous cache-store failures, and cached-body replay after a `304`. These failures are now reported as request errors. - -## CVE-2026-120423 / GHSA-r4pc-4jcp-7pqc (medium) - -Undici 7.15.0 through 7.30.1 could skip Subresource Integrity verification when valid integrity metadata was separated or surrounded by ASCII whitespace other than a space, including a horizontal tab. Integrity metadata is now split on all ASCII whitespace before SHA-256, SHA-384, or SHA-512 verification. diff --git a/deps/undici/src/docs/docs/api/Dispatcher.md b/deps/undici/src/docs/docs/api/Dispatcher.md index 13b6540201db..b0e0229c09a2 100644 --- a/deps/undici/src/docs/docs/api/Dispatcher.md +++ b/deps/undici/src/docs/docs/api/Dispatcher.md @@ -871,6 +871,26 @@ Arguments: Returns: `Dispatcher`. +Because interceptors wrap each other, ordering is the end-user's responsibility. +Certain built-in interceptors are order-sensitive and will throw an +`InvalidArgumentError` if composed in an unsafe order. In particular, the +`cache` interceptor must be composed **after** the `redirect` interceptor. When +`cache` is composed before `redirect`, the cache handler is wrapped *above* the +redirect handler, so it never observes the redirect history and its +cross-origin / credential-bearing redirect guards are silently disabled. +This allows an attacker-controlled or cross-principal redirect response to be +stored under the trusted origin's cache key and replayed to unrelated callers +(see GHSA-75VM-9G8F-99J4, GHSA-MQG3-3V4R-CM32, GHSA-4W7W-5XRC-9H26 and +GHSA-7XG3-FPHP-28HG). + +```js +// Correct: cache is composed after redirect. +new Agent().compose(interceptors.redirect({ maxRedirections: 5 }), interceptors.cache({})) + +// Throws an InvalidArgumentError: cache composed before redirect. +new Agent().compose(interceptors.cache({}), interceptors.redirect({ maxRedirections: 5 })) +``` + #### Parameter: `Interceptor` A function that takes a `dispatch` method and returns a `dispatch`-like function. @@ -1215,6 +1235,18 @@ The `cache` interceptor implements client-side response caching as described in - `cacheByDefault` - The default expiration time to cache responses by if they don't have an explicit expiration and cannot have an heuristic expiry computed. If this isn't present, responses neither with an explicit expiration nor heuristically cacheable will not be cached. Default `undefined`. - `type` - The [type of cache](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching#types_of_caches) for Undici to act as. Can be `shared` or `private`. Default `shared`. `private` implies privately cacheable responses will be cached and potentially shared with other users of your application. +> **Ordering:** the `cache` interceptor must be composed **after** the +> `redirect` interceptor. When `cache` is composed before `redirect`, the cache +> handler is wrapped above the redirect handler, so it never observes the +> redirect history and its cross-origin / credential-bearing redirect guards are +> silently disabled, which lets an attacker-controlled or cross-principal +> redirect response be stored under the trusted origin's cache key and replayed +> to unrelated callers (GHSA-75VM-9G8F-99J4, GHSA-MQG3-3V4R-CM32, +> GHSA-4W7W-5XRC-9H26, GHSA-7XG3-FPHP-28HG). `compose()` throws an +> `InvalidArgumentError` for this unsafe order. The `deduplicate` interceptor +> participates in the same redirect-history contract and may be placed before or +> after `redirect`, as long as `cache` follows `redirect`. + **Usage with `fetch`** ```js diff --git a/deps/undici/src/docs/docs/api/EnvHttpProxyAgent.md b/deps/undici/src/docs/docs/api/EnvHttpProxyAgent.md index adc2a2424576..55f99f3d7e26 100644 --- a/deps/undici/src/docs/docs/api/EnvHttpProxyAgent.md +++ b/deps/undici/src/docs/docs/api/EnvHttpProxyAgent.md @@ -24,6 +24,15 @@ Extends: [`AgentOptions`](/docs/docs/api/Agent.md#parameter-agentoptions) * **httpsProxy** `string` (optional) - When set, it will override the `HTTPS_PROXY` environment variable. * **noProxy** `string` (optional) - When set, it will override the `NO_PROXY` environment variable. +The TLS options for the connection to the target server, given as `requestTls` +or as a `connect` object, apply on every route: direct (no proxy configured), +hosts matching `noProxy`, and proxied through an HTTP, HTTPS, or SOCKS5 proxy. +When both are set they are merged key by key, and keys set in `connect` take +precedence over `requestTls` on every route. `proxyTls` applies only to the connection to the +proxy server, and the target TLS options are never applied to it. When `connect` +is a function it is used as-is on direct routes, where `requestTls` is then not +applied, and it is not used on proxied routes. + Examples: ```js diff --git a/deps/undici/src/docs/docs/api/Errors.md b/deps/undici/src/docs/docs/api/Errors.md index 4402db47593c..f80e07aa2308 100644 --- a/deps/undici/src/docs/docs/api/Errors.md +++ b/deps/undici/src/docs/docs/api/Errors.md @@ -26,6 +26,7 @@ import { errors } from 'undici' | `InformationalError` | `UND_ERR_INFO` | expected error with reason | | `ResponseExceededMaxSizeError` | `UND_ERR_RES_EXCEEDED_MAX_SIZE` | response body exceed the max size allowed | | `SecureProxyConnectionError` | `UND_ERR_PRX_TLS` | tls connection to a proxy failed | +| `ProxyConnectionError` | `UND_ERR_PRX_CONN` | establishing the proxy `CONNECT` tunnel failed | | `MessageSizeExceededError` | `UND_ERR_WS_MESSAGE_SIZE_EXCEEDED` | WebSocket decompressed message exceeded the maximum allowed size | Be aware of the possible difference between the global dispatcher version and the actual undici version you might be using. We recommend to avoid the check `instanceof errors.UndiciError` and seek for the `error.code === ''` instead to avoid inconsistencies. diff --git a/deps/undici/src/lib/api/api-stream.js b/deps/undici/src/lib/api/api-stream.js index 5d0b3fbe6332..4c67107cf1a6 100644 --- a/deps/undici/src/lib/api/api-stream.js +++ b/deps/undici/src/lib/api/api-stream.js @@ -56,6 +56,9 @@ class StreamHandler extends AsyncResource { this.trailers = null this.body = body this.onInfo = onInfo || null + // Set once the factory's writable is tracked: from then on its lifecycle + // owns the callback, which must not be invoked from onError. + this.responseStarted = false if (util.isStream(body)) { body.on('error', (err) => { @@ -122,13 +125,17 @@ class StreamHandler extends AsyncResource { } this.callback = null - this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) + if (callback) { + this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) + } if (err) { abort() } }) + this.responseStarted = true + res.on('drain', resume) this.res = res @@ -170,7 +177,7 @@ class StreamHandler extends AsyncResource { if (res) { this.res = null util.destroy(res, err) - } else if (callback) { + } else if (callback && !this.responseStarted) { this.callback = null queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }) diff --git a/deps/undici/src/lib/api/readable.js b/deps/undici/src/lib/api/readable.js index cdede9599809..67e87b176a2b 100644 --- a/deps/undici/src/lib/api/readable.js +++ b/deps/undici/src/lib/api/readable.js @@ -88,7 +88,7 @@ class BodyReadable extends Readable { } if (err) { - this[kAbort]() + this[kAbort](err) } // Workaround for Node "bug". If the stream is destroyed in same diff --git a/deps/undici/src/lib/cache/memory-cache-store.js b/deps/undici/src/lib/cache/memory-cache-store.js index 17a2b84904a7..7fae9a46e9bb 100644 --- a/deps/undici/src/lib/cache/memory-cache-store.js +++ b/deps/undici/src/lib/cache/memory-cache-store.js @@ -2,7 +2,7 @@ const { Writable } = require('node:stream') const { EventEmitter } = require('node:events') -const { assertCacheKey, assertCacheValue } = require('../util/cache.js') +const { assertCacheKey, assertCacheValue, createBodyChunkCoalescer } = require('../util/cache.js') /** * @typedef {import('../../types/cache-interceptor.d.ts').default.CacheKey} CacheKey @@ -129,6 +129,7 @@ class MemoryCacheStore extends EventEmitter { const store = this const entry = { ...key, ...val, body: [], size: 0 } + const coalescer = createBodyChunkCoalescer(entry.body) return new Writable({ write (chunk, encoding, callback) { @@ -141,12 +142,14 @@ class MemoryCacheStore extends EventEmitter { if (entry.size >= store.#maxEntrySize) { this.destroy() } else { - entry.body.push(chunk) + coalescer.push(chunk) } callback(null) }, final (callback) { + coalescer.flush() + let entries = store.#entries.get(topLevelKey) if (!entries) { entries = [] diff --git a/deps/undici/src/lib/cache/sqlite-cache-store.js b/deps/undici/src/lib/cache/sqlite-cache-store.js index c5ba2def21e5..fcdbda002628 100644 --- a/deps/undici/src/lib/cache/sqlite-cache-store.js +++ b/deps/undici/src/lib/cache/sqlite-cache-store.js @@ -1,7 +1,7 @@ 'use strict' const { Writable } = require('node:stream') -const { assertCacheKey, assertCacheValue } = require('../util/cache.js') +const { assertCacheKey, assertCacheValue, createBodyChunkCoalescer } = require('../util/cache.js') let DatabaseSync @@ -318,6 +318,7 @@ module.exports = class SqliteCacheStore { * @type {Buffer[] | null} */ const body = [] + const coalescer = createBodyChunkCoalescer(body) const store = this return new Writable({ @@ -326,7 +327,7 @@ module.exports = class SqliteCacheStore { size += chunk.byteLength if (size < store.#maxEntrySize) { - body.push(chunk) + coalescer.push(chunk) } else { this.destroy() } @@ -334,6 +335,7 @@ module.exports = class SqliteCacheStore { callback() }, final (callback) { + coalescer.flush() store.set(key, { ...value, body }) callback() } diff --git a/deps/undici/src/lib/core/errors.js b/deps/undici/src/lib/core/errors.js index 5a7fcbff3adc..204c0e30c93a 100644 --- a/deps/undici/src/lib/core/errors.js +++ b/deps/undici/src/lib/core/errors.js @@ -403,6 +403,25 @@ class SecureProxyConnectionError extends UndiciError { } } +const kProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_CONN') +class ProxyConnectionError extends UndiciError { + constructor (cause, message, options = {}) { + super(message, { cause, ...options }) + this.name = 'ProxyConnectionError' + this.message = message || 'Proxy Connection failed' + this.code = 'UND_ERR_PRX_CONN' + this.cause = cause + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kProxyConnectionError] === true + } + + get [kProxyConnectionError] () { + return true + } +} + const kMaxOriginsReachedError = Symbol.for('undici.error.UND_ERR_MAX_ORIGINS_REACHED') class MaxOriginsReachedError extends UndiciError { constructor (message) { @@ -471,6 +490,7 @@ module.exports = { RequestRetryError, ResponseError, SecureProxyConnectionError, + ProxyConnectionError, MaxOriginsReachedError, Socks5ProxyError, MessageSizeExceededError diff --git a/deps/undici/src/lib/core/symbols.js b/deps/undici/src/lib/core/symbols.js index 754ea5c85c15..308a5f33744b 100644 --- a/deps/undici/src/lib/core/symbols.js +++ b/deps/undici/src/lib/core/symbols.js @@ -72,5 +72,6 @@ module.exports = { kNoProxyAgent: Symbol('no proxy agent'), kHttpProxyAgent: Symbol('http proxy agent'), kHttpsProxyAgent: Symbol('https proxy agent'), - kSocks5ProxyAgent: Symbol('socks5 proxy agent') + kSocks5ProxyAgent: Symbol('socks5 proxy agent'), + kInterceptorKind: Symbol('interceptor kind') } diff --git a/deps/undici/src/lib/dispatcher/client-h1.js b/deps/undici/src/lib/dispatcher/client-h1.js index 385f59e8aa29..010cdff631ff 100644 --- a/deps/undici/src/lib/dispatcher/client-h1.js +++ b/deps/undici/src/lib/dispatcher/client-h1.js @@ -372,10 +372,32 @@ class Parser { finish () { assert(currentParser === null) assert(this.ptr != null) - assert(!this.paused) const { llhttp } = this + // The peer closed the connection. If the body parser was paused by + // backpressure we must finish parsing before signalling EOF, otherwise + // llhttp_finish() would crash (it used to assert !paused) or report a + // half-parsed message. Backpressure is advisory here: onData keeps buffering + // delivered bytes into the response stream, so resume across pauses and + // drain whatever is still buffered on the socket. A Content-Length/chunked + // body reaches on_message_complete during execute(); an EOF-delimited body + // stays paused (its length is unknown) and is completed by llhttp_finish(). + if (this.paused) { + let data + do { + llhttp.llhttp_resume(this.ptr) + this.paused = false + data = this.socket.read() || EMPTY_BUF + this.execute(data) + } while (this.paused && data.length > 0) + + if (this.paused) { + llhttp.llhttp_resume(this.ptr) + this.paused = false + } + } + let ret try { diff --git a/deps/undici/src/lib/dispatcher/client-h2.js b/deps/undici/src/lib/dispatcher/client-h2.js index 83a18ff9ae61..55e1c4526a7d 100644 --- a/deps/undici/src/lib/dispatcher/client-h2.js +++ b/deps/undici/src/lib/dispatcher/client-h2.js @@ -44,6 +44,11 @@ const { const { channels } = require('../core/diagnostics.js') const kOpenStreams = Symbol('open streams') +const kHeldReplayAttempts = Symbol('held replay attempts') + +// How many times a request held without a stream may be replayed after the +// connection holding it goes away (see refuseHeldRequests). +const MAX_HELD_REPLAY_ATTEMPTS = 1 let extractBody @@ -349,6 +354,44 @@ function completeRequest (client, request, resetPendingIdx = false) { } } +// Count a connection that went away while holding the request against its +// replay budget. A peer that refuses every connection must eventually surface +// an error to the caller rather than being retried forever. +function registerHeldRefusal (request) { + const attempts = (request[kHeldReplayAttempts] ?? 0) + 1 + request[kHeldReplayAttempts] = attempts + + return attempts <= MAX_HELD_REPLAY_ATTEMPTS +} + +// Requests the session held back without opening a stream: a CONNECT or an +// extended CONNECT (WebSocket) waits for the peer's SETTINGS. No stream means +// no stream timeout ever applies to them. A connection that goes away in that +// state refused all of them, so count it against their replay budget. +// Otherwise a peer that keeps doing so turns one request into an unbounded +// reconnect loop. +function refuseHeldRequests (client, err) { + const queue = client[kQueue] + const failed = [] + let j = client[kPendingIdx] + + for (let i = client[kPendingIdx]; i < queue.length; i++) { + const request = queue[i] + + if (request != null && !registerHeldRefusal(request)) { + failed.push(request) + } else { + queue[j++] = request + } + } + + queue.length = j + + for (let i = 0; i < failed.length; i++) { + util.errorRequest(client, failed[i], err) + } +} + function onHttp2SessionGoAway (errorCode) { // TODO(mcollina): Verify if GOAWAY implements the spec correctly: // https://datatracker.ietf.org/doc/html/rfc7540#section-6.8 @@ -424,10 +467,16 @@ function onHttp2SocketClose () { this[kHTTP2Session].destroy(err) } + const held = client[kRunning] === 0 + client[kPendingIdx] = client[kRunningIdx] assert(client[kRunning] === 0) + if (held) { + refuseHeldRequests(client, err) + } + client.emit('disconnect', client[kUrl], [client], err) client[kResume]() diff --git a/deps/undici/src/lib/dispatcher/client.js b/deps/undici/src/lib/dispatcher/client.js index 8bc9bf6e02a3..9b6de8d2562f 100644 --- a/deps/undici/src/lib/dispatcher/client.js +++ b/deps/undici/src/lib/dispatcher/client.js @@ -629,6 +629,11 @@ function _resume (client, sync) { return } + if (request.aborted) { + client[kQueue].splice(client[kPendingIdx], 1) + continue + } + if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) { if (client[kRunning] > 0) { return diff --git a/deps/undici/src/lib/dispatcher/dispatcher.js b/deps/undici/src/lib/dispatcher/dispatcher.js index 824dfb6d8220..d60ee8e39b27 100644 --- a/deps/undici/src/lib/dispatcher/dispatcher.js +++ b/deps/undici/src/lib/dispatcher/dispatcher.js @@ -1,6 +1,8 @@ 'use strict' const EventEmitter = require('node:events') const WrapHandler = require('../handler/wrap-handler') +const { InvalidArgumentError } = require('../core/errors') +const { kInterceptorKind } = require('../core/symbols') const wrapInterceptor = (dispatch) => (opts, handler) => dispatch(opts, WrapHandler.wrap(handler)) @@ -22,6 +24,8 @@ class Dispatcher extends EventEmitter { const interceptors = Array.isArray(args[0]) ? args[0] : args let dispatch = this.dispatch.bind(this) + const orderSensitiveKinds = [] + for (const interceptor of interceptors) { if (interceptor == null) { continue @@ -31,6 +35,10 @@ class Dispatcher extends EventEmitter { throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`) } + if (interceptor[kInterceptorKind] != null) { + orderSensitiveKinds.push(interceptor[kInterceptorKind]) + } + dispatch = interceptor(dispatch) dispatch = wrapInterceptor(dispatch) @@ -39,6 +47,20 @@ class Dispatcher extends EventEmitter { } } + // Several shipped interceptors are order-sensitive: they cooperate through + // the redirect history threaded on the request context, and the cache + // handler only receives it when the redirect interceptor is composed before + // the cache interceptor. Composing `cache` before `redirect` silently + // disables the cache's redirect-origin guards (cross-origin cache + // poisoning, credential-bearing redirect replay), so fail fast instead of + // storing an attacker-controlled or cross-principal response under a key + // the application trusts. + const cacheIndex = orderSensitiveKinds.indexOf('cache') + const redirectIndex = orderSensitiveKinds.indexOf('redirect') + if (cacheIndex !== -1 && redirectIndex !== -1 && cacheIndex < redirectIndex) { + throw new InvalidArgumentError('the cache interceptor must be composed after the redirect interceptor; composing the cache before the redirect disables the cache\'s cross-origin and credential redirect guards (GHSA-75VM-9G8F-99J4, GHSA-MQG3-3V4R-CM32, GHSA-4W7W-5XRC-9H26, GHSA-7XG3-FPHP-28HG)') + } + return new Proxy(this, { get: (target, key) => key === 'dispatch' ? dispatch : target[key] }) diff --git a/deps/undici/src/lib/dispatcher/env-http-proxy-agent.js b/deps/undici/src/lib/dispatcher/env-http-proxy-agent.js index f88437f1936a..35fec7264ad9 100644 --- a/deps/undici/src/lib/dispatcher/env-http-proxy-agent.js +++ b/deps/undici/src/lib/dispatcher/env-http-proxy-agent.js @@ -21,18 +21,36 @@ class EnvHttpProxyAgent extends DispatcherBase { const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts - this[kNoProxyAgent] = new Agent(agentOpts) + // The environment picks the route (direct, NO_PROXY or proxied), so the + // TLS options for the target must apply on every route, merged the same + // way: field by field, `connect` over `requestTls` over `tls`. The direct + // Agent reads them from `connect` and `tls`, a ProxyAgent from + // `requestTls`. A `connect` function is a custom connector: it is used + // as-is on direct routes and cannot be applied to the target of a proxy. + const { connect, tls, requestTls } = agentOpts + const connectOpts = typeof connect === 'function' ? undefined : connect + const tlsOpts = typeof tls === 'object' ? tls : undefined + + this[kNoProxyAgent] = new Agent( + requestTls && typeof connect !== 'function' + ? { ...agentOpts, connect: { ...requestTls, ...connect } } + : agentOpts + ) + + const proxyOpts = connectOpts || tlsOpts + ? { ...agentOpts, requestTls: { ...tlsOpts, ...requestTls, ...connectOpts } } + : agentOpts const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY if (HTTP_PROXY) { - this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY }) + this[kHttpProxyAgent] = new ProxyAgent({ ...proxyOpts, uri: HTTP_PROXY }) } else { this[kHttpProxyAgent] = this[kNoProxyAgent] } const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY if (HTTPS_PROXY) { - this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY }) + this[kHttpsProxyAgent] = new ProxyAgent({ ...proxyOpts, uri: HTTPS_PROXY }) } else { this[kHttpsProxyAgent] = this[kHttpProxyAgent] } diff --git a/deps/undici/src/lib/dispatcher/proxy-agent.js b/deps/undici/src/lib/dispatcher/proxy-agent.js index d2a2f23cbff3..8a6b6f77821d 100644 --- a/deps/undici/src/lib/dispatcher/proxy-agent.js +++ b/deps/undici/src/lib/dispatcher/proxy-agent.js @@ -4,7 +4,7 @@ const { kProxy, kClose, kDestroy, kDispatch } = require('../core/symbols') const Agent = require('./agent') const Pool = require('./pool') const DispatcherBase = require('./dispatcher-base') -const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require('../core/errors') +const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError, ProxyConnectionError } = require('../core/errors') const buildConnector = require('../core/connect') const Client = require('./client') const { channels } = require('../core/diagnostics') @@ -113,7 +113,10 @@ class ProxyAgent extends DispatcherBase { this[kProxy] = { uri: href, protocol } this[kRequestTls] = opts.requestTls this[kProxyTls] = opts.proxyTls - this[kProxyHeaders] = opts.headers || {} + // Copy the caller's headers: proxy-authorization is added below, and it + // must not leak into an object the caller shares with other agents (such + // as the HTTP and HTTPS proxies of an EnvHttpProxyAgent) or requests. + this[kProxyHeaders] = { ...opts.headers } this[kTunnelProxy] = proxyTunnel if (opts.auth && opts.token) { @@ -222,6 +225,14 @@ class ProxyAgent extends DispatcherBase { if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { // Throw a custom error to avoid loop in client.js#connect callback(new SecureProxyConnectionError(err)) + } else if (err.code === 'UND_ERR_SOCKET') { + // A socket failure while establishing the tunnel means the CONNECT + // never completed, so there is nothing to recover - the proxy just + // tore down the connection. client.js#onError treats UND_ERR_SOCKET + // as a recoverable error on an established connection and leaves the + // request queued, which makes connect() retry forever. Surface it as + // a non-recoverable proxy error so the request fails instead. (#3897) + callback(new ProxyConnectionError(err)) } else { callback(err) } diff --git a/deps/undici/src/lib/handler/cache-handler.js b/deps/undici/src/lib/handler/cache-handler.js index 87c767621ce6..cf6231d86f97 100644 --- a/deps/undici/src/lib/handler/cache-handler.js +++ b/deps/undici/src/lib/handler/cache-handler.js @@ -5,10 +5,15 @@ const { kRedirectCacheControl } = require('../core/symbols') const { parseCacheControlHeader, hasInvalidCacheControlDirective, + revalidationResponseChangesVary, + revalidationTargetMatchesCacheKey, parseVaryHeader, hasVaryStar, isInvalidOrWildcardVaryHeader, - isEtagUsable + isEtagUsable, + trimOWS, + revalidationEtagMatchesCachedValue, + revalidationResponseAddsVary } = require('../util/cache') /** @@ -58,10 +63,6 @@ const MAX_RESPONSE_AGE = 2147483647000 // validator present); each successful revalidation re-stores the entry. const REVALIDATION_ONLY_RETENTION = 86400000 // 24 hours -function trimOWS (value) { - return value.replace(/^[\t ]+|[\t ]+$/g, '') -} - function arrayIncludes (array, value) { for (let i = 0; i < array.length; i++) { if (array[i] === value) { @@ -226,16 +227,26 @@ class CacheHandler { #pending304End /** - * @param {import('../../types/cache-interceptor.d.ts').default.CacheHandlerOptions} opts + * Called when a validating (304) response does not identify the same + * representation as the cached value, so the cached body must not be reused + * or freshened. Lets a background revalidation discard the stale body and + * re-fetch unconditionally. + * @type {((cacheKey: import('../../types/cache-interceptor.d.ts').default.CacheKey) => void) | undefined} + */ + #onInvalidRevalidation + + /** + * @param {import('../../types/cache-interceptor.d.ts').default.CacheHandlerOptions & { onInvalidRevalidation?: (cacheKey: import('../../types/cache-interceptor.d.ts').default.CacheKey) => void }} opts * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} cacheKey * @param {import('../../types/dispatcher.d.ts').default.DispatchHandler} handler */ - constructor ({ store, type, cacheByDefault }, cacheKey, handler) { + constructor ({ store, type, cacheByDefault, onInvalidRevalidation }, cacheKey, handler) { this.#store = store this.#cacheType = type this.#cacheByDefault = cacheByDefault this.#cacheKey = cacheKey this.#handler = handler + this.#onInvalidRevalidation = onInvalidRevalidation } onRequestStart (controller, context) { @@ -535,6 +546,42 @@ class CacheHandler { return } + // A 304 only freshens the stored response it validates (RFC 9111 + // §4.3.4). One produced by a redirect target, one carrying a different + // ETag, or one that changes the fields the response varies on does + // not: drop the stored entry rather than re-store its body under the + // 304's metadata. + // + // When the 304 came from the cached URL itself but names another + // representation (a different ETag, or a Vary field the stored + // response did not vary on), a background revalidation re-fetches + // unconditionally, mirroring the synchronous path. + const targetMatches = revalidationTargetMatchesCacheKey(this.#cacheKey, this.#history) + const refetch = targetMatches && ( + !revalidationEtagMatchesCachedValue(cachedValue, resHeaders) || + revalidationResponseAddsVary(cachedValue, varyDirectives) + ) + if ( + !targetMatches || + refetch || + revalidationResponseChangesVary(cachedValue, varyDirectives) + ) { + // The cached body fetched from the store will not be reused; destroy + // it so an async or remote store does not leak the underlying reader. + // In the SWR path the stream serving the stale response is a separate + // stream owned by sendCachedValue and is intentionally left untouched. + if (util.isStream(cachedValue.body)) { + cachedValue.body.on('error', noop).destroy() + } + deleteCachedValue(this.#store, this.#cacheKey) + downstreamOnHeaders() + finish304() + if (refetch) { + this.#onInvalidRevalidation?.(this.#cacheKey) + } + return + } + // Re-use the cached value: statuscode, statusmessage, headers and body value.statusCode = cachedValue.statusCode value.statusMessage = cachedValue.statusMessage @@ -987,7 +1034,7 @@ function getAge (ageHeader) { return MAX_RESPONSE_AGE } - const age = BigInt(ageValue.replace(/^[\t ]+|[\t ]+$/g, '')) + const age = BigInt(trimOWS(ageValue)) if (age >= BigInt(MAX_RESPONSE_AGE / 1000)) { return MAX_RESPONSE_AGE } diff --git a/deps/undici/src/lib/handler/redirect-handler.js b/deps/undici/src/lib/handler/redirect-handler.js index c62e491c9737..b13df2d10eb7 100644 --- a/deps/undici/src/lib/handler/redirect-handler.js +++ b/deps/undici/src/lib/handler/redirect-handler.js @@ -131,8 +131,12 @@ class RedirectHandler { ? null : headers.location - if (this.opts.origin) { - this.history.push(new URL(this.opts.path, this.opts.origin)) + const requestUrl = this.opts.origin + ? buildRequestUrl(this.opts.origin, this.opts.path) + : undefined + + if (requestUrl) { + this.history.push(requestUrl) } if (!this.location) { @@ -149,7 +153,7 @@ class RedirectHandler { receivedAt: Date.now() }) - const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))) + const { origin, pathname, search } = util.parseURL(new URL(this.location, requestUrl)) const path = search ? `${pathname}${search}` : pathname // Check for redirect loops by seeing if we've already visited this URL in our history @@ -165,8 +169,17 @@ class RedirectHandler { // Remove headers referring to the original URL. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers. // https://tools.ietf.org/html/rfc7231#section-6.4 - this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin) + // this.opts.origin may be a URL object or a non-canonical string, while + // origin is always URL.origin, so compare normalized origins. + const crossOrigin = !this.opts.origin || new URL(this.opts.origin).origin !== origin + this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, crossOrigin) this.opts.path = path + if (crossOrigin && this.opts.servername != null) { + // A TLS servername chosen for the original host must not be used to + // verify the certificate of another origin. Let the next request derive + // it from the new host instead. + this.opts.servername = null + } this.opts.origin = origin this.opts.query = null } @@ -216,6 +229,18 @@ class RedirectHandler { } } +// The URL a request was actually sent to. `new URL(path, origin)` is not +// equivalent: a path such as `//other.example/x` is parsed as a +// protocol-relative URL and replaces the origin's host, so a hop to one origin +// would be recorded as a hop to another. +function buildRequestUrl (origin, path) { + const base = new URL(origin) + if (typeof path === 'string' && path[0] === '/') { + return new URL(`${base.origin}${path}`) + } + return new URL(path, base) +} + // https://tools.ietf.org/html/rfc7231#section-6.4.4 function shouldRemoveHeader (header, removeContent, unknownOrigin) { if (header.length === 4) { diff --git a/deps/undici/src/lib/handler/retry-handler.js b/deps/undici/src/lib/handler/retry-handler.js index 94b27b8e666d..5bfb80a541bb 100644 --- a/deps/undici/src/lib/handler/retry-handler.js +++ b/deps/undici/src/lib/handler/retry-handler.js @@ -2,7 +2,7 @@ const assert = require('node:assert') const { kRetryHandlerDefaultRetry } = require('../core/symbols') -const { RequestRetryError } = require('../core/errors') +const { RequestRetryError, RequestAbortedError } = require('../core/errors') const WrapHandler = require('./wrap-handler') const { isDisturbed, @@ -226,6 +226,17 @@ class RetryHandler { } static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) { + // A malformed (undefined/null/non-object) error must not crash the process + // (an unhandled 'error' event on the Client), nor trigger an endless retry + // (a falsy error is treated by shouldRetry as "retry"). Normalize it to a + // terminal error so it is surfaced downstream instead of throwing while + // destructuring below. + if (typeof err !== 'object' || err === null) { + // `||` (not `??`) so any falsy value (undefined, null, false, 0, '') is + // replaced by a terminal error rather than retrying forever. + cb(err || new RequestAbortedError()) + return + } const { statusCode, code, headers } = err const { method, retryOptions } = opts const { diff --git a/deps/undici/src/lib/interceptor/cache.js b/deps/undici/src/lib/interceptor/cache.js index 3f724dd2261e..276205031fb2 100644 --- a/deps/undici/src/lib/interceptor/cache.js +++ b/deps/undici/src/lib/interceptor/cache.js @@ -11,13 +11,17 @@ const { assertCacheMethods, makeCacheKey, normalizeHeaders, + revalidationResponseAddsVary, + revalidationTargetMatchesCacheKey, parseCacheControlHeader, isInvalidOrWildcardVaryHeader, parseVaryHeader, - isEtagUsable + trimOWS, + revalidationEtagMatchesCachedValue } = require('../util/cache.js') const { AbortError } = require('../core/errors.js') const { parseHttpDate } = require('../util/date.js') +const { kInterceptorKind } = require('../core/symbols.js') /** * @param {(string | RegExp)[] | undefined} origins @@ -38,10 +42,6 @@ function assertCacheOrigins (origins, name) { const nop = () => {} -function trimOWS (value) { - return value.replace(/^[\t ]+|[\t ]+$/g, '') -} - function arrayIncludes (array, value) { for (let i = 0; i < array.length; i++) { if (array[i] === value) { @@ -76,6 +76,44 @@ function hasPragmaNoCache (headers) { return false } +const defaultPorts = { 'http:': '80', 'https:': '443' } + +/** + * The cache key is built from the origin, but an explicit Host header is what + * the server sees as the target authority. Only requests without one, or with + * one naming the origin's own host, may use the cache. + * @param {Record} headers normalized request headers + * @param {string | URL} origin + * @returns {boolean} + */ +function hostHeaderMatchesOrigin (headers, origin) { + if (!Object.hasOwn(headers, 'host')) { + return true + } + + const host = headers.host + if (typeof host !== 'string') { + return false + } + + let url + try { + url = new URL(origin) + } catch { + return false + } + + const value = host.toLowerCase() + if (value === url.host) { + return true + } + + // new URL() drops the default port, so `host:80` names the same authority. + return url.port === '' && + defaultPorts[url.protocol] !== undefined && + value === `${url.host}:${defaultPorts[url.protocol]}` +} + /** * @typedef {(options: import('../../types/dispatcher.d.ts').default.DispatchOptions, handler: import('../../types/dispatcher.d.ts').default.DispatchHandler) => void} DispatchFn */ @@ -147,25 +185,6 @@ function revalidationResponseUpdatesCacheControl (headers) { return headers['cache-control'] !== undefined } -/** - * @param {import('../../types/cache-interceptor.d.ts').default.GetResult} result - * @param {Record | undefined} varyDirectives - * @returns {boolean} - */ -function revalidationResponseAddsVary (result, varyDirectives) { - if (!varyDirectives) { - return false - } - - for (const key in varyDirectives) { - if (result.vary == null || !Object.hasOwn(result.vary, key)) { - return true - } - } - - return false -} - function deleteCachedValue (store, cacheKey) { try { store.delete(cacheKey)?.catch?.(nop) @@ -202,47 +221,6 @@ function makeRevalidationHeaders (opts, result) { return headers } -function revalidationTargetMatchesCacheKey (cacheKey, context) { - const history = context?.history - if (!Array.isArray(history) || history.length === 0) { - return true - } - - try { - const cachedUrl = new URL(cacheKey.path, cacheKey.origin) - const responseUrl = history[history.length - 1] - return responseUrl.origin === cachedUrl.origin && - responseUrl.pathname === cachedUrl.pathname && - responseUrl.search === cachedUrl.search - } catch { - return false - } -} - -function revalidationEtagMatchesCachedValue (result, headers) { - if (!Object.hasOwn(headers, 'etag')) { - return true - } - - const responseEtag = headers.etag - const cachedEtag = result.etag - if ( - typeof responseEtag !== 'string' || - typeof cachedEtag !== 'string' || - !isEtagUsable(responseEtag) || - !isEtagUsable(cachedEtag) - ) { - return false - } - - if (!responseEtag.startsWith('W/')) { - return responseEtag === cachedEtag - } - - const cachedOpaqueTag = cachedEtag.startsWith('W/') ? cachedEtag.slice(2) : cachedEtag - return responseEtag.slice(2) === cachedOpaqueTag -} - /** * @param {import('../../types/cache-interceptor.d.ts').default.GetResult} result * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives | undefined} cacheControlDirectives @@ -514,21 +492,43 @@ function handleResult ( queueMicrotask(() => { const headers = makeRevalidationHeaders(opts, result) + // Silent handler that just updates the cache + const updateCacheOnly = { + onRequestStart () {}, + onRequestUpgrade () {}, + onResponseStart () {}, + onResponseData () {}, + onResponseEnd () {}, + onResponseError () {} + } + + // If the background 304 does not identify the same representation as + // the cached body (a mismatched ETag, or a newly added Vary field), the + // cached body must not be freshened or replayed. Discard it and + // re-fetch unconditionally so the cache reflects the origin's current + // representation instead of binding the old body to a foreign + // validator. + const backgroundRefetch = () => { + // Do not destroy result.body here. In the stale-while-revalidate + // path it is the stream already being delivered to the caller by + // sendCachedValue, which owns its lifecycle; destroying it would + // truncate the in-flight stale response. (The synchronous refetch + // below can destroy its result.body because there it is never served.) + deleteCachedValue(globalOpts.store, cacheKey) + dispatch(opts, new CacheHandler(globalOpts, cacheKey, updateCacheOnly)) + } + // Background revalidation - update cache if we get new data dispatch( { ...opts, headers }, - new CacheHandler(globalOpts, cacheKey, { - // Silent handler that just updates the cache - onRequestStart () {}, - onRequestUpgrade () {}, - onResponseStart () {}, - onResponseData () {}, - onResponseEnd () {}, - onResponseError () {} - }) + new CacheHandler( + { ...globalOpts, onInvalidRevalidation: backgroundRefetch }, + cacheKey, + updateCacheOnly + ) ) }) @@ -564,7 +564,7 @@ function handleResult ( if (success) { if (statusCode === 304) { if ( - !revalidationTargetMatchesCacheKey(cacheKey, context) || + !revalidationTargetMatchesCacheKey(cacheKey, context?.history) || !revalidationEtagMatchesCachedValue(result, headers) || revalidationResponseDisallowsCachedReuse(globalOpts.type, headers) ) { @@ -642,7 +642,7 @@ module.exports = (opts = {}) => { } } - return dispatch => { + const interceptor = dispatch => { return (opts, handler) => { if (!opts.origin || arrayIncludes(safeMethodsToNotCache, opts.method)) { // Not a method we want to cache or we don't have the origin, skip @@ -687,6 +687,16 @@ module.exports = (opts = {}) => { return dispatch(opts, handler) } + // A Host header naming another authority targets a different URI than + // the cache key describes: neither look up, store nor invalidate. + if (!hostHeaderMatchesOrigin(opts.headers, opts.origin)) { + if (reqCacheControl?.['only-if-cached'] && arrayIncludes(util.safeHTTPMethods, opts.method)) { + // Nothing is cached for this target, so answer like any other miss. + return handleUncachedResponse(dispatch, globalOpts, undefined, handler, opts, reqCacheControl) + } + return dispatch(opts, handler) + } + /** * @type {import('../../types/cache-interceptor.d.ts').default.CacheKey} */ @@ -743,4 +753,6 @@ module.exports = (opts = {}) => { } } } + interceptor[kInterceptorKind] = 'cache' + return interceptor } diff --git a/deps/undici/src/lib/interceptor/deduplicate.js b/deps/undici/src/lib/interceptor/deduplicate.js index e81525ac5ea7..7450f2f5f8c1 100644 --- a/deps/undici/src/lib/interceptor/deduplicate.js +++ b/deps/undici/src/lib/interceptor/deduplicate.js @@ -4,6 +4,7 @@ const diagnosticsChannel = require('node:diagnostics_channel') const util = require('../core/util') const DeduplicationHandler = require('../handler/deduplication-handler') const { normalizeHeaders, makeCacheKey, makeDeduplicationKey } = require('../util/cache.js') +const { kInterceptorKind } = require('../core/symbols.js') const pendingRequestsChannel = diagnosticsChannel.channel('undici:request:pending-requests') @@ -57,7 +58,7 @@ module.exports = (opts = {}) => { */ const pendingRequests = new Map() - return dispatch => { + const interceptor = dispatch => { return (opts, handler) => { if (!opts.origin || methods.includes(opts.method) === false) { return dispatch(opts, handler) @@ -114,4 +115,6 @@ module.exports = (opts = {}) => { return dispatch(opts, deduplicationHandler) } } + interceptor[kInterceptorKind] = 'deduplicate' + return interceptor } diff --git a/deps/undici/src/lib/interceptor/dump.js b/deps/undici/src/lib/interceptor/dump.js index 09b57f2163fb..ded1cc2ac0a0 100644 --- a/deps/undici/src/lib/interceptor/dump.js +++ b/deps/undici/src/lib/interceptor/dump.js @@ -51,7 +51,7 @@ class DumpHandler extends DecoratorHandler { } onResponseError (controller, err) { - super.onResponseError(controller, this.aborted === true ? this.reason : err) + super.onResponseError(controller, this.aborted === true ? (this.reason ?? err ?? new RequestAbortedError()) : err) } onResponseData (controller, chunk) { @@ -72,7 +72,7 @@ class DumpHandler extends DecoratorHandler { onResponseEnd (controller, trailers) { if (this.aborted === true) { - super.onResponseError(controller, this.reason) + super.onResponseError(controller, this.reason ?? new RequestAbortedError()) return } diff --git a/deps/undici/src/lib/interceptor/redirect.js b/deps/undici/src/lib/interceptor/redirect.js index b7df180433e3..7c57f9842c0a 100644 --- a/deps/undici/src/lib/interceptor/redirect.js +++ b/deps/undici/src/lib/interceptor/redirect.js @@ -1,9 +1,10 @@ 'use strict' const RedirectHandler = require('../handler/redirect-handler') +const { kInterceptorKind } = require('../core/symbols.js') function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections } = {}) { - return (dispatch) => { + const interceptor = (dispatch) => { return function Intercept (opts, handler) { const { maxRedirections = defaultMaxRedirections, ...rest } = opts @@ -16,6 +17,8 @@ function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections } return dispatch(dispatchOpts, redirectHandler) } } + interceptor[kInterceptorKind] = 'redirect' + return interceptor } module.exports = createRedirectInterceptor diff --git a/deps/undici/src/lib/llhttp/wasm_build_env.txt b/deps/undici/src/lib/llhttp/wasm_build_env.txt index 8f7ac48d7c33..19ae20ba1610 100644 --- a/deps/undici/src/lib/llhttp/wasm_build_env.txt +++ b/deps/undici/src/lib/llhttp/wasm_build_env.txt @@ -1,5 +1,5 @@ -> undici@7.30.2 build:wasm +> undici@7.30.4 build:wasm > node build/wasm.js --docker > docker run --rm --platform=linux/x86_64 --user 1001:1001 --mount type=bind,source=/home/runner/work/node/node/deps/undici/src/lib/llhttp,target=/home/node/build/lib/llhttp --mount type=bind,source=/home/runner/work/node/node/deps/undici/src/build,target=/home/node/build/build --mount type=bind,source=/home/runner/work/node/node/deps/undici/src/deps,target=/home/node/build/deps -t ghcr.io/nodejs/wasm-builder@sha256:975f391d907e42a75b8c72eb77c782181e941608687d4d8694c3e9df415a0970 node build/wasm.js diff --git a/deps/undici/src/lib/util/cache.js b/deps/undici/src/lib/util/cache.js index b078ea0d936f..1b519d0f65aa 100644 --- a/deps/undici/src/lib/util/cache.js +++ b/deps/undici/src/lib/util/cache.js @@ -13,8 +13,19 @@ const MAX_DELTA_SECONDS = 2147483647 const RESTRICTIVE_DIRECTIVE_NAMES = ['no-store', 'private', 'no-cache'] const kInvalidCacheControlDirectives = Symbol('invalid cache-control directives') +// Optional whitespace (OWS) trimming per RFC 9110 §5.6.3. These run on +// server-controlled header values, so they must stay linear: regexes such as +// /[\t ]+$/ backtrack quadratically on a long internal whitespace run. +function isOWS (code) { + return code === 0x20 || code === 0x09 +} + function trimOWS (value) { - return value.replace(/^[\t ]+|[\t ]+$/g, '') + let start = 0 + let end = value.length + while (start < end && isOWS(value.charCodeAt(start))) start++ + while (end > start && isOWS(value.charCodeAt(end - 1))) end-- + return start === 0 && end === value.length ? value : value.substring(start, end) } function arrayIncludes (array, value) { @@ -28,11 +39,15 @@ function arrayIncludes (array, value) { } function trimOWSStart (value) { - return value.replace(/^[\t ]+/, '') + let start = 0 + while (start < value.length && isOWS(value.charCodeAt(start))) start++ + return start === 0 ? value : value.substring(start) } function trimOWSEnd (value) { - return value.replace(/[\t ]+$/, '') + let end = value.length + while (end > 0 && isOWS(value.charCodeAt(end - 1))) end-- + return end === value.length ? value : value.substring(0, end) } function findUnescapedQuote (value, start) { @@ -297,6 +312,59 @@ function assertCacheValue (value) { } } +// Small body chunks are coalesced into bounded buffers before a cache store retains +// them. A response body delivered as many tiny chunks (e.g. a single-byte HTTP/1.1 +// chunk per frame) would otherwise retain one `Buffer` object per chunk: the per-chunk +// object overhead vastly exceeds the byte length counted against the store limits and +// can exhaust the heap while those limits are still satisfied (GHSA-8GC2-Q8WW-GHWG). +const COALESCE_THRESHOLD = 64 * 1024 // 64 KiB +const COALESCE_MAX_CHUNKS = 1024 + +/** + * Collects body chunks into `body`, coalescing small chunks so that the number of + * retained buffers is bounded by byte size, not chunk count. `flush()` must be + * called once the body is complete. + * @param {Buffer[]} body + * @returns {{ push: (chunk: Buffer) => void, flush: () => void }} + */ +function createBodyChunkCoalescer (body) { + let pendingChunks = [] + let pendingSize = 0 + + const flush = () => { + if (pendingChunks.length === 1) { + body.push(pendingChunks[0]) + } else if (pendingChunks.length > 1) { + body.push(Buffer.concat(pendingChunks, pendingSize)) + } + pendingChunks = [] + pendingSize = 0 + } + + const push = (chunk) => { + if (chunk.byteLength >= COALESCE_THRESHOLD) { + // Large chunks are forwarded as-is rather than copied. + flush() + body.push(chunk) + } else { + pendingChunks.push(chunk) + pendingSize += chunk.byteLength + + // Flush once the accumulated bytes (or number of chunks) reaches a + // threshold. Bounding the chunk count keeps the transient pending set + // small even when every chunk is a single byte. + if ( + pendingSize >= COALESCE_THRESHOLD || + pendingChunks.length >= COALESCE_MAX_CHUNKS + ) { + flush() + } + } + } + + return { push, flush } +} + /** * @see https://www.rfc-editor.org/rfc/rfc9111.html#name-cache-control * @see https://www.iana.org/assignments/http-cache-directives/http-cache-directives.xhtml @@ -465,7 +533,11 @@ function parseCacheControlHeader (header) { output[key] = true } else if (output[key] !== true) { if (key in output) { - output[key] = output[key].concat(headers) + // Append in place: concat() would copy the accumulated list on + // every repeated directive, which is quadratic. + for (let j = 0; j < headers.length; j++) { + output[key].push(headers[j]) + } } else { output[key] = headers } @@ -478,7 +550,7 @@ function parseCacheControlHeader (header) { output[key] = true } else if (output[key] !== true) { if (key in output) { - output[key] = output[key].concat(fieldName) + output[key].push(fieldName) } else { output[key] = [fieldName] } @@ -595,6 +667,80 @@ function isInvalidOrWildcardVaryHeader (varyHeader) { return hasVaryStar(varyHeader) || parseVaryHeader(varyHeader, {}) === undefined } +/** + * Whether a revalidation response varies on a field the stored response did + * not vary on. + * + * @param {{ vary?: Record }} cachedValue + * @param {Record | undefined} varyDirectives + * The revalidation response's parsed Vary + * @returns {boolean} + */ +function revalidationResponseAddsVary (cachedValue, varyDirectives) { + if (!varyDirectives) { + return false + } + + for (const key in varyDirectives) { + if (cachedValue.vary == null || !Object.hasOwn(cachedValue.vary, key)) { + return true + } + } + + return false +} + +/** + * Whether a revalidation response's Vary adds or removes a field compared to + * the stored response. A response without Vary leaves the stored one as is. + * + * @param {{ vary?: Record }} cachedValue + * @param {Record | undefined} varyDirectives + * The revalidation response's parsed Vary + * @returns {boolean} + */ +function revalidationResponseChangesVary (cachedValue, varyDirectives) { + if (!varyDirectives) { + return false + } + + if (revalidationResponseAddsVary(cachedValue, varyDirectives)) { + return true + } + + for (const key in cachedValue.vary) { + if (!Object.hasOwn(varyDirectives, key)) { + return true + } + } + + return false +} + +/** + * Whether a revalidation response was produced by the cached URL itself, not by + * a redirect target. + * + * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} cacheKey + * @param {URL[] | undefined} history The URLs visited while following redirects + * @returns {boolean} + */ +function revalidationTargetMatchesCacheKey (cacheKey, history) { + if (!Array.isArray(history) || history.length === 0) { + return true + } + + try { + const cachedUrl = new URL(cacheKey.path, cacheKey.origin) + const responseUrl = history[history.length - 1] + return responseUrl.origin === cachedUrl.origin && + responseUrl.pathname === cachedUrl.pathname && + responseUrl.search === cachedUrl.search + } catch { + return false + } +} + /** * Note: this deviates from the spec a little. Empty etags ("", W/"") are valid, * however, including them in cached resposnes serves little to no purpose. @@ -629,6 +775,40 @@ function isEtagUsable (etag) { return false } +/** + * Whether a validating (304) response's ETag refers to the same selected + * representation as the cached value. A 304 may only freshen a stored response + * when it identifies the same representation (RFC 9111 §4.3.4); a mismatched + * validator must not be used to update freshness or metadata around an old body. + * + * @param {import('../../types/cache-interceptor.d.ts').default.CacheValue} cachedValue + * @param {Record | undefined} headers + * @returns {boolean} + */ +function revalidationEtagMatchesCachedValue (cachedValue, headers) { + if (!Object.hasOwn(headers ?? {}, 'etag')) { + return true + } + + const responseEtag = headers.etag + const cachedEtag = cachedValue.etag + if ( + typeof responseEtag !== 'string' || + typeof cachedEtag !== 'string' || + !isEtagUsable(responseEtag) || + !isEtagUsable(cachedEtag) + ) { + return false + } + + if (!responseEtag.startsWith('W/')) { + return responseEtag === cachedEtag + } + + const cachedOpaqueTag = cachedEtag.startsWith('W/') ? cachedEtag.slice(2) : cachedEtag + return responseEtag.slice(2) === cachedOpaqueTag +} + /** * @param {unknown} store * @returns {asserts store is import('../../types/cache-interceptor.d.ts').default.CacheStore} @@ -697,13 +877,19 @@ module.exports = { normalizeHeaders, assertCacheKey, assertCacheValue, + createBodyChunkCoalescer, parseCacheControlHeader, hasInvalidCacheControlDirective, parseVaryHeader, hasVaryStar, + revalidationResponseAddsVary, + revalidationResponseChangesVary, + revalidationTargetMatchesCacheKey, isInvalidOrWildcardVaryHeader, isEtagUsable, + revalidationEtagMatchesCachedValue, assertCacheMethods, assertCacheStore, - makeDeduplicationKey + makeDeduplicationKey, + trimOWS } diff --git a/deps/undici/src/lib/web/eventsource/eventsource.js b/deps/undici/src/lib/web/eventsource/eventsource.js index fc31f23821b7..7f87def9efee 100644 --- a/deps/undici/src/lib/web/eventsource/eventsource.js +++ b/deps/undici/src/lib/web/eventsource/eventsource.js @@ -8,9 +8,12 @@ const { EventSourceStream } = require('./eventsource-stream') const { parseMIMEType } = require('../fetch/data-url') const { createFastMessageEvent } = require('../websocket/events') const { isNetworkError } = require('../fetch/response') -const { kEnumerableProperty } = require('../../core/util') +const { isValidHeaderValue, kEnumerableProperty } = require('../../core/util') const { environmentSettingsObject } = require('../fetch/util') const { getGlobalDispatcher } = require('../../global') +const { isomorphicDecode } = require('../infra') + +const textEncoder = new TextEncoder() let experimentalWarned = false @@ -353,8 +356,12 @@ class EventSource extends EventTarget { // string, encoded as UTF-8. // 2. Set (`Last-Event-ID`, lastEventIDValue) in request's header // list. + this.#request.headersList.delete('last-event-id', true) if (this.#state.lastEventId.length) { - this.#request.headersList.set('last-event-id', this.#state.lastEventId, true) + const lastEventId = isomorphicDecode(textEncoder.encode(this.#state.lastEventId)) + if (isValidHeaderValue(lastEventId)) { + this.#request.headersList.set('last-event-id', lastEventId, true) + } } // 4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section. diff --git a/deps/undici/src/package-lock.json b/deps/undici/src/package-lock.json index a63b3a04ad51..8a74489e9283 100644 --- a/deps/undici/src/package-lock.json +++ b/deps/undici/src/package-lock.json @@ -1,12 +1,12 @@ { "name": "undici", - "version": "7.30.2", + "version": "7.30.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "undici", - "version": "7.30.2", + "version": "7.30.4", "license": "MIT", "devDependencies": { "@fastify/busboy": "3.2.0", @@ -76,13 +76,13 @@ "license": "MIT" }, "node_modules/@babel/code-frame": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", - "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.17.tgz", + "integrity": "sha512-IdlVpcDeoDATtN2cfmnVk0A4XJKhu7SlpGuSaiOFdko09YC1MD07WokWUSEdw5R2o4o8VObX2LzViQW6VXnzkA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.17", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" }, @@ -91,9 +91,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", - "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.17.tgz", + "integrity": "sha512-pC/HCNB1loXYCLB9S7FDieWKJiXH8LJTUGFvVAm+7hWUKBjL07EcvVITNH9KlXdS/TTSbChZHZCYx/yag6LbRw==", "dev": true, "license": "MIT", "engines": { @@ -101,21 +101,21 @@ } }, "node_modules/@babel/core": { - "version": "7.29.13", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.13.tgz", - "integrity": "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.17.tgz", + "integrity": "sha512-dP4g0UpATLviwEEb46bBaeL5MyW3q7LwqGoaQJvjXGS8tdpxckLtDTI9FBwA5ioVHnYoR2nRqCf1BmlMwbZV5A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.13", - "@babel/helper-compilation-targets": "^7.29.13", - "@babel/helper-module-transforms": "^7.29.13", - "@babel/helpers": "^7.29.13", - "@babel/parser": "^7.29.13", - "@babel/template": "^7.29.7", - "@babel/traverse": "^7.29.13", - "@babel/types": "^7.29.11", + "@babel/code-frame": "^7.29.17", + "@babel/generator": "^7.29.17", + "@babel/helper-compilation-targets": "^7.29.17", + "@babel/helper-module-transforms": "^7.29.17", + "@babel/helpers": "^7.29.17", + "@babel/parser": "^7.29.17", + "@babel/template": "^7.29.17", + "@babel/traverse": "^7.29.17", + "@babel/types": "^7.29.17", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", @@ -132,14 +132,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.29.13", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.13.tgz", - "integrity": "sha512-T5FRo+RzVHvGjWOuF1Ljc44b+NXAOazodHkGUHp4I3zCkQ4/sNVJm56h1S278LMR0bY5xBhztGziSbli8zObIw==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.17.tgz", + "integrity": "sha512-xjNUVINWex7s4U0vESYwa8ChCBnmvhCQ6nkAdnhM8WYPlhXvU9D9fPurOSYQLV4FwcNXacDkN/MWIPNHsTI2OA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.29.13", - "@babel/types": "^7.29.11", + "@babel/parser": "^7.29.17", + "@babel/types": "^7.29.17", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" @@ -149,14 +149,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.29.13", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.13.tgz", - "integrity": "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.17.tgz", + "integrity": "sha512-6uFqkZstBw0lSRaEr/7HNuqURHubX4BvnN0FbbIBNFa5/nUcKLp5AFubCcUlbik9mI/Ztsz3mdjjpqoF3dVqrA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.29.7", - "@babel/helper-validator-option": "^7.29.7", + "@babel/compat-data": "^7.29.17", + "@babel/helper-validator-option": "^7.29.17", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -166,9 +166,9 @@ } }, "node_modules/@babel/helper-globals": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", - "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.17.tgz", + "integrity": "sha512-SeQUwFlH8hH1vjUmBFeqwxt6Nsjp01MKEZOtZPJ86lpA4GBdb/o0dShjC+Awf7v74/+84KIL1RiJ4TOJj6gU+A==", "dev": true, "license": "MIT", "engines": { @@ -176,29 +176,29 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", - "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.17.tgz", + "integrity": "sha512-bLxkfvUEHeWShbadKTm7EfDCkosXZh6PjWEa9bYiCuob24c0nm388ara2Hz6KisGaXe+XCsi6VyfJNSJjeUUwg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.29.7", - "@babel/types": "^7.29.7" + "@babel/traverse": "^7.29.17", + "@babel/types": "^7.29.17" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.29.13", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.13.tgz", - "integrity": "sha512-/U96wOz+SCoZ7Da/8kjDGltcNY280JPQcRNPK0Hk3PTbdpaiBDQImtC6JsbVwb1HGMr3usZQU2WsWVjhYNmRzw==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.17.tgz", + "integrity": "sha512-eY/pAYlV7pC5biPmW0M7fDqv1D+opqI0Ioa6OQeg0AV3465b8K8g9I9fvZIV11u35f7jU6q5RXYlUD6k4QLC3w==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.29.7", - "@babel/helper-validator-identifier": "^7.29.7", - "@babel/traverse": "^7.29.13" + "@babel/helper-module-imports": "^7.29.17", + "@babel/helper-validator-identifier": "^7.29.17", + "@babel/traverse": "^7.29.17" }, "engines": { "node": ">=6.9.0" @@ -208,9 +208,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", - "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.17.tgz", + "integrity": "sha512-pdztM6tDPJu52CYy07frAD1XpDAvndtxPhPyehcarNv5Pyq5hutWmTVXd0XIPaI749vUIJ+vxG6KYWoVExn+lg==", "dev": true, "license": "MIT", "engines": { @@ -218,9 +218,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.29.13", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.13.tgz", - "integrity": "sha512-fWegr+WsEsiMVW4KUNdIIzzMTZSzNiqhy0//6+2MRi2d5NFNsL/AYwBQW8eBnRbTBVRnDVzjaJEUqKaCWjMMdQ==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.17.tgz", + "integrity": "sha512-iY5lvqFhfgMXp4o4zWads4NvQZXizBxzCoADPOgFMcMwk1XefAdBJbc9i1y94aflY57lokjOjRTa3AOOW9R7BQ==", "dev": true, "license": "MIT", "engines": { @@ -228,9 +228,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", - "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.17.tgz", + "integrity": "sha512-AG+olLB+teKhkQ2WYJeaZqJwNLjtWTz1waQIP/tEYITzVzpdHLP7IXx2c/bH2JTsNCgvWlkqdCv91xcb8lul8Q==", "dev": true, "license": "MIT", "engines": { @@ -238,9 +238,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", - "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.17.tgz", + "integrity": "sha512-Pr+bjfbd4TYVax16KyHVyElTnid5nbWQWQvA/dPlESoKVZ8B4eTAUhoqug/mtD9hWAEgIQIOyvjUBMI9HjdrGw==", "dev": true, "license": "MIT", "engines": { @@ -248,27 +248,27 @@ } }, "node_modules/@babel/helpers": { - "version": "7.29.13", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.13.tgz", - "integrity": "sha512-laoRpD/kO/iA4CDlgJbixHekg7oPvWALK0PQyK3Ob2I2njZRvVAD77RfWCIImtqWCq6KijoBoZK7bp/HlTWASQ==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.17.tgz", + "integrity": "sha512-Q7LRJjIiFAiOtfkVBzXe4op1tQ8dXYsRsdojKzLfERndnXcmyyn9RZIBlSJzFo0O3CouXV3Tvb8AGolaDr1M7A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.29.7", - "@babel/types": "^7.29.11" + "@babel/template": "^7.29.17", + "@babel/types": "^7.29.17" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.29.13", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.13.tgz", - "integrity": "sha512-fJM50YYjlTiBhgdkGmC1tBpv+FMAyo4annf2X6Aks+0yRlaiVkYW/3f07xAfVVkYIoZ9fFZp+mEThUFnuybhkQ==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.17.tgz", + "integrity": "sha512-I+0olVqWMm9bimQJc/5B3jn1nivNDXtnMtDVs07XdHzZLcWa2N/mlCTPmAsQg95QcKoXSuFD2Yz4fwdtoyk7DQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.29.11" + "@babel/types": "^7.29.17" }, "bin": { "parser": "bin/babel-parser.js" @@ -375,13 +375,13 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.29.7.tgz", - "integrity": "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.29.17.tgz", + "integrity": "sha512-HfwdKDLVNg6KjRb2z1QSkQC1EP0YIYQhg83vps+JyqOIrX9ZoVhcTYt9yeFkTy5U/iSRXRvW4S59sl/0eej5VA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.29.7" + "@babel/helper-plugin-utils": "^7.29.17" }, "engines": { "node": ">=6.9.0" @@ -501,13 +501,13 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.29.7.tgz", - "integrity": "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.29.17.tgz", + "integrity": "sha512-C1v4jKWUnV9aoCTbc7YSmxKflPzi0Geuh+mc7xuLSpNiRr3mO4i4elL8u97Ij9XKj9Iqy2aFnc1l1AMWL4DhbQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.29.7" + "@babel/helper-plugin-utils": "^7.29.17" }, "engines": { "node": ">=6.9.0" @@ -517,33 +517,33 @@ } }, "node_modules/@babel/template": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", - "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.17.tgz", + "integrity": "sha512-D4nOLKOzIBwn7/Z78h3UPEwzFObmPVTukBJ9+63BijgMVeLj6mQ77FJb6YCZ4QBo6VjAk/yj4QnpKusTcBy6vA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7" + "@babel/code-frame": "^7.29.17", + "@babel/parser": "^7.29.17", + "@babel/types": "^7.29.17" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.29.13", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.13.tgz", - "integrity": "sha512-0ve0xMlFA73dgY1oyJRY6RoW+/bncdcOQqg6jjYcVfXBK90OdLXjm9R6lmRetdZVrPjXkKIoMVBqYFPjcAlZ4Q==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.17.tgz", + "integrity": "sha512-q+CnfQcmNfDdOUARkt9FWtdR0HPOCcyQBj1Z7l2SOpFIfUB/XI3dXS0B5UOlZWwQCun80xVhgcv4ip6w128u9g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.13", - "@babel/helper-globals": "^7.29.7", - "@babel/parser": "^7.29.13", - "@babel/template": "^7.29.7", - "@babel/types": "^7.29.11", + "@babel/code-frame": "^7.29.17", + "@babel/generator": "^7.29.17", + "@babel/helper-globals": "^7.29.17", + "@babel/parser": "^7.29.17", + "@babel/template": "^7.29.17", + "@babel/types": "^7.29.17", "debug": "^4.3.1" }, "engines": { @@ -551,14 +551,14 @@ } }, "node_modules/@babel/types": { - "version": "7.29.11", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.11.tgz", - "integrity": "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ==", + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.17.tgz", + "integrity": "sha512-kzo3lZUbI0gARA4QvhmOTH/aws2SrZ880ECQRIjPPSrdfBM0bZCkj1U7UN2fB0GNeXayqCiLVXa2+1jAhn377Q==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.29.11", - "@babel/helper-validator-identifier": "^7.29.7" + "@babel/helper-string-parser": "^7.29.17", + "@babel/helper-validator-identifier": "^7.29.17" }, "engines": { "node": ">=6.9.0" @@ -1063,9 +1063,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", - "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "version": "4.12.4", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.4.tgz", + "integrity": "sha512-1qH3WeISXHFS8P3QI0lntHlMrlfTh1OarxlRbPNDEkSCqoyXC3apBE7MDyRKOL8HpuW48aQtff30wvEFww/4ww==", "dev": true, "license": "MIT", "engines": { @@ -1276,6 +1276,13 @@ "node": ">=12" } }, + "node_modules/@isaacs/nonrecursive-glob-match": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz", + "integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1541,9 +1548,9 @@ } }, "node_modules/@jest/fake-timers/node_modules/@sinonjs/fake-timers": { - "version": "15.4.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.4.0.tgz", - "integrity": "sha512-DsG+8/LscQIQg68J6Ef3dv10u6nVyetYn923s3/sus5eaGfTo1of5WMZSLf0UJc9KDuKPilPH0UDJCjvNbDNCA==", + "version": "15.5.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.5.0.tgz", + "integrity": "sha512-i7HpIYIsUmdSTQbtBjs2b3VqMgDsVDWfzVPV3MuUrXVqJNZmzFB8YJeM9SPms2bGg5zg7HvKH31sPS1WoLLRFg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -1667,9 +1674,9 @@ } }, "node_modules/@jest/reporters/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz", + "integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==", "dev": true, "license": "MIT", "dependencies": { @@ -1680,9 +1687,9 @@ } }, "node_modules/@jest/reporters/node_modules/glob": { - "version": "13.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", - "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "version": "13.0.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.7.tgz", + "integrity": "sha512-wfsFgXQ8A3SEI9XGf7Nl3Y9l7ffSrGh7SUCT7vU/2CzYPep9kjxAn1S40F9OPKxAMGCVl7HtNlJhrCJUeUq83g==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -1698,9 +1705,9 @@ } }, "node_modules/@jest/reporters/node_modules/lru-cache": { - "version": "11.5.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", - "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "version": "11.5.4", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.4.tgz", + "integrity": "sha512-B8nJCTi8JuSaDBg0tBdnImV6j5O2CXaqKfdj24ZTCFbyivN8KZ2Z+RL3aHjwJAfLutD9cNnObG4SIgW4gMufiw==", "dev": true, "license": "BlueOak-1.0.0", "engines": { @@ -1885,9 +1892,9 @@ } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz", + "integrity": "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g==", "dev": true, "license": "MIT", "engines": { @@ -2462,9 +2469,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz", - "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.11.tgz", + "integrity": "sha512-YBdNe5JcjYR0sPhJW1QIeRCmI11YhYvaRuGCs9+WCeTTb+Yhb2BE2XMe5/wAqF10FK5g3+q1PDhQABfT7aX0gg==", "dev": true, "license": "MIT" }, @@ -2551,17 +2558,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.1.tgz", - "integrity": "sha512-5CokTWXpmbylfFabsbvHC0CAw3XLaGnoa+nFJX5FR592h/LoZsENUE6p/rg5xvkKrFEXz6pYmgI29AgXc2N3BQ==", + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.74.0.tgz", + "integrity": "sha512-z3KXk1+Vm+d82ZRplOoC89ho4Rf1da5ju6sx8//92GnN532U62DGPjECXkkVqtYzIv0zoJlpO39SX2Z9tk6LVw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.72.1", - "@typescript-eslint/type-utils": "8.72.1", - "@typescript-eslint/utils": "8.72.1", - "@typescript-eslint/visitor-keys": "8.72.1", + "@typescript-eslint/scope-manager": "8.74.0", + "@typescript-eslint/type-utils": "8.74.0", + "@typescript-eslint/utils": "8.74.0", + "@typescript-eslint/visitor-keys": "8.74.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" @@ -2574,15 +2581,15 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.72.1", + "@typescript-eslint/parser": "^8.74.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.14", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.14.tgz", - "integrity": "sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ==", + "version": "7.0.17", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.17.tgz", + "integrity": "sha512-0c3zcBRlWmcKhcIQWckzkYncJRv5HHB8O32wO/FcWL8DDXWDJgiEF6SX9ThbTv5h/eZ+xJK+VvDjjQ+cQJhp3Q==", "dev": true, "license": "MIT", "engines": { @@ -2590,16 +2597,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.1.tgz", - "integrity": "sha512-ZGwZP4OCfyA0AQTpEAMWz+rtX01DRhQWW5hB0ucKDEIX5U7jdmPSaMx94rQfaPAQzIYz2BimOgKOJtjfpRFQ9g==", + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.74.0.tgz", + "integrity": "sha512-ecr8AYdig7avVkxaHdQvxHnIJ/mOyliO4Gv/uWF8q69vBew/z3sexqBwHUZX5Vql+Ns0w4sH6gBLkICGbOvJkA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.72.1", - "@typescript-eslint/types": "8.72.1", - "@typescript-eslint/typescript-estree": "8.72.1", - "@typescript-eslint/visitor-keys": "8.72.1", + "@typescript-eslint/scope-manager": "8.74.0", + "@typescript-eslint/types": "8.74.0", + "@typescript-eslint/typescript-estree": "8.74.0", + "@typescript-eslint/visitor-keys": "8.74.0", "debug": "^4.4.3" }, "engines": { @@ -2615,14 +2622,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.1.tgz", - "integrity": "sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg==", + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.74.0.tgz", + "integrity": "sha512-z/mymuE+JlEeSFIv3Mo70EvgG1Zz74Hl0IDfExfXutARAP834bt+MppTD7mVAwmZO0GdxdOAi0jbTam749eH6g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.72.1", - "@typescript-eslint/types": "^8.72.1", + "@typescript-eslint/tsconfig-utils": "^8.74.0", + "@typescript-eslint/types": "^8.74.0", "debug": "^4.4.3" }, "engines": { @@ -2637,14 +2644,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.1.tgz", - "integrity": "sha512-lC/t6eMCZZQAAKZEYGL6RDVSuFehpdmMT6h+nJIjIa6oylN/PwDgDVtEIbB7O9xFfZYtZAYLoLlDNWKJhtF+uQ==", + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.74.0.tgz", + "integrity": "sha512-kpOdpu4CpWN5U38ox3f727DwWRBtUAVhyUJtqTBYe5gf2wYoxac7PgKP14txrxN7ICVtcjlLdzjqfRgpSnDKvQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.72.1", - "@typescript-eslint/visitor-keys": "8.72.1" + "@typescript-eslint/types": "8.74.0", + "@typescript-eslint/visitor-keys": "8.74.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2655,9 +2662,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.1.tgz", - "integrity": "sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==", + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.74.0.tgz", + "integrity": "sha512-p07wAuaS6BjCYgOSXKJi4YhvTnAf7fiG37e9THcpnYaQEt2QiTTYZWKwUFNgeRiywiMudazhzgddAirZ0GgHtQ==", "dev": true, "license": "MIT", "engines": { @@ -2672,15 +2679,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.1.tgz", - "integrity": "sha512-iY2wlmyrXJmx4yxUGP3aYCFF3cA/6ShddOKmLU2dx7LnEykbAM8WThlxZEfd1NddqceF6eJmZUayxx9oKIYNlg==", + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.74.0.tgz", + "integrity": "sha512-CV3Y3la8l3F9ANfxcfpgSSiQgJTe4IeLEoZV4O/gcW86Ugp8X6SKiQ0vm+QegXaRIbbDMokZZSF3A1CgiU/kPw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.72.1", - "@typescript-eslint/typescript-estree": "8.72.1", - "@typescript-eslint/utils": "8.72.1", + "@typescript-eslint/types": "8.74.0", + "@typescript-eslint/typescript-estree": "8.74.0", + "@typescript-eslint/utils": "8.74.0", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, @@ -2697,9 +2704,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.1.tgz", - "integrity": "sha512-LmE5IhQet1BWOWEXqBrVtBPsMAOQ6Nzk35d+WLh3mk4EUF33sqlfxjio1MdYeSvKSG5skactKKuixBIKXhL4Rw==", + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.74.0.tgz", + "integrity": "sha512-MpnMrJCVNpP1iVL8NiHkQZgQqIMBH5ewDGUPBh1pqQXwFtMFjsl1M03QcYPXmv6stCKEiF0PN7CGbU1ZbXFzEA==", "dev": true, "license": "MIT", "engines": { @@ -2711,18 +2718,18 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.1.tgz", - "integrity": "sha512-DAlUoUV93hIvrtIQLwCbmZQYVZwOMhiHJrOVUUIWicFZaIYjTRqlY3I/NZevfkLmSqkNHRu2qYDcq9lrn16oOQ==", + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz", + "integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.72.1", - "@typescript-eslint/tsconfig-utils": "8.72.1", - "@typescript-eslint/types": "8.72.1", - "@typescript-eslint/visitor-keys": "8.72.1", + "@typescript-eslint/project-service": "8.74.0", + "@typescript-eslint/tsconfig-utils": "8.74.0", + "@typescript-eslint/types": "8.74.0", + "@typescript-eslint/visitor-keys": "8.74.0", "debug": "^4.4.3", - "minimatch": "^10.2.2", + "minimatch": "^11.0.1", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" @@ -2735,7 +2742,13 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { + "@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev", "typescript": ">=4.8.4 <6.1.0" + }, + "peerDependenciesMeta": { + "@typescript/native": { + "optional": true + } } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { @@ -2749,9 +2762,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz", + "integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==", "dev": true, "license": "MIT", "dependencies": { @@ -2762,16 +2775,17 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", - "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "version": "11.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.10.tgz", + "integrity": "sha512-L3/cjhQ5E6lft0VCp/2mO3Ic74RnutKy3rz7iGwp/6w1hKcO262g2rbfacFyw6eBig5OdI0nu5PpuA0/WQs9Tw==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^5.0.8" + "@isaacs/nonrecursive-glob-match": "^1.1.0", + "brace-expansion": "^5.0.12" }, "engines": { - "node": "18 || 20 || >=22" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2791,16 +2805,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.1.tgz", - "integrity": "sha512-5v5liypurJBFHCBNqh/RjsymAD+VWcE0djuGY/BUqp5fC3Qn+luWDEksjuTtWjPn6i5zQlUtkZCRG/CYG0yCkA==", + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.74.0.tgz", + "integrity": "sha512-IpWXPxXXomzxyTcvjhZJexgdvtTR1TooLAPpuxzaGqQ8BHll1lf4Ysp/BTE/l0U5TJ+x1j7B4bEM8pLRrvY+XA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.72.1", - "@typescript-eslint/types": "8.72.1", - "@typescript-eslint/typescript-estree": "8.72.1" + "@typescript-eslint/scope-manager": "8.74.0", + "@typescript-eslint/types": "8.74.0", + "@typescript-eslint/typescript-estree": "8.74.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2815,13 +2829,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.1.tgz", - "integrity": "sha512-SB8xqipSzZHUePCCLNeYxqnxq83X61/qzNhjQGbTfjxGZIeOEP7tBgWYX05Tcd6CgE02WdTJnh5b8kMZJ/+bnQ==", + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.74.0.tgz", + "integrity": "sha512-XSZmOtMUbWCBIM+2BK134FyMFxmll1mW2mPLk/PSwYQYzGIPMgJAqL929U4qXVizLv7Xq5b7r41/o7Ombuwk0g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.72.1", + "@typescript-eslint/types": "8.74.0", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -3246,9 +3260,9 @@ } }, "node_modules/ansi-regex": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.5.0.tgz", - "integrity": "sha512-zhvbbbdt1kbw7EJ9OQoxmQcuaNR9P5kTj7e/YdmOSU10aHWbycofJxA6jKfoEy3vlLdctOF9ZHaxLtmSm998wQ==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.6.0.tgz", + "integrity": "sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==", "dev": true, "license": "MIT", "engines": { @@ -3713,9 +3727,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.11.35", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.35.tgz", - "integrity": "sha512-GNk8KX52CHqeNKGk8+7tZnQab/2k1t/BgrUHPKNdijzpEhF1saPQZHVKb6m5loSAxB39gyrTYw34Qf9CQ3u1qQ==", + "version": "2.11.42", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.42.tgz", + "integrity": "sha512-zZavzWoNo65+3gcv5AQetEgQ86Rbsge3QPe3wjQFjl1D4/mYzqreOR6DkE0SMMBqYr95w0mLi+69+V0SSeOStQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -3750,9 +3764,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.21", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", - "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", + "version": "1.1.22", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.22.tgz", + "integrity": "sha512-CKLDTuSsN0+r1ThM0WkzzBI7dnPI6xEGfa/JnVYIK9JNBA1N1NyPwXVHor//NKD/y3sDxp764sZdLhFK7pH8XQ==", "dev": true, "license": "MIT", "dependencies": { @@ -3774,9 +3788,9 @@ } }, "node_modules/browserslist": { - "version": "4.29.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.5.tgz", - "integrity": "sha512-khTmKu5NGYTotqcYo8Bew2k4RAE9PuXRSFRXG2lQBrCEQHyeQ/vX6gKMxfokwywBsLiXZMnHsmWMG1pnO8J7uQ==", + "version": "4.29.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.6.tgz", + "integrity": "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w==", "dev": true, "funding": [ { @@ -3794,11 +3808,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.33", - "caniuse-lite": "^1.0.30001819", - "electron-to-chromium": "^1.5.464", - "node-releases": "^2.0.60", - "update-browserslist-db": "^1.3.4" + "baseline-browser-mapping": "^2.11.37", + "caniuse-lite": "^1.0.30001826", + "electron-to-chromium": "^1.5.486", + "node-releases": "^2.0.64", + "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" @@ -3999,9 +4013,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001820", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001820.tgz", - "integrity": "sha512-gfWD6MxqVCqAOwmODfZf7DchWvlrA+SRdNX7ceLfg3xRqe5ssjjpF7EgslC/0tiLiNTajdaNN/q8c/5u/7Gz8w==", + "version": "1.0.30001830", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001830.tgz", + "integrity": "sha512-0TFl6VuW52V0JxUPXnqjNNxZ9I8bAH9to34KYZZBUWe/5yD+YBWda/mBXxlwnLLHm5LSoGyyo2KeuNheSJXywA==", "dev": true, "funding": [ { @@ -4047,9 +4061,9 @@ } }, "node_modules/ci-info": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", - "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.5.0.tgz", + "integrity": "sha512-d1uM8k5UZEyPza1n/MG3ko8nKupKN0KJpFsipgPcgaCCvV+IqIfJ+NzTjetlLM+UcXZx3+cLrNr76+eAO7G1Mw==", "dev": true, "funding": [ { @@ -4186,9 +4200,9 @@ "license": "MIT" }, "node_modules/comment-parser": { - "version": "1.4.9", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.9.tgz", - "integrity": "sha512-+2AvZKjJaNq9GQljm3tr0utwrig5BL+jgJGvz5rDpGKNIp+ojcRXWUwBbh/sGIi1QCprR6PsKFakub+w1v+4hQ==", + "version": "1.4.11", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.11.tgz", + "integrity": "sha512-bZMt5Mw4GgsMmnOZ5mHsHzyexC5JgzDbyMk5P0/RMqVPbK9sL+qOQyTGO95xCWQ8VhUzCbTdKkgcgGuofaVjuw==", "dev": true, "license": "MIT", "engines": { @@ -4228,9 +4242,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.1.2.tgz", + "integrity": "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg==", "dev": true, "license": "MIT", "dependencies": { @@ -4511,9 +4525,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.477", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.477.tgz", - "integrity": "sha512-PN++F4zWZoVDGWinxMnSCpVqKhqFOJfLXxdU8bYJKudAEsHL/XKVITOKWVbfMt1r276Mi9RDLU9VHx9uKJ4RMQ==", + "version": "1.5.501", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.501.tgz", + "integrity": "sha512-UVcdnFm1UW3UZBBL/Nsi7mLqdxGqUbzW0rO0WsdEqwJr4vnFWrs93MBig2neS0TnQ5MUCwg3y91FhM/+oZE4hg==", "dev": true, "license": "ISC" }, @@ -4538,9 +4552,9 @@ "license": "MIT" }, "node_modules/enhanced-resolve": { - "version": "5.26.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.26.1.tgz", - "integrity": "sha512-PPnnSJq3azKOIewXR/uppBV/6h98dprBJ/WaQ9Qgj10xX1lJLNfg+XShpbsrSqcDSy2yYYyhfXM1wWhftqgyzw==", + "version": "5.27.2", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.27.2.tgz", + "integrity": "sha512-Cpp3nuaI7ZdgEsvVP6zzk08uxrfGTSUnDwijv6PZfe8qHjcUYv5X9bJF71WTt5HwOeaeVandf9zACK4jcWroNw==", "dev": true, "license": "MIT", "dependencies": { @@ -4991,13 +5005,13 @@ } }, "node_modules/eslint-import-context": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/eslint-import-context/-/eslint-import-context-0.1.9.tgz", - "integrity": "sha512-K9Hb+yRaGAGUbwjhFNHvSmmkZs9+zbuoe3kFQ4V1wYjrepUFYM2dZAfNtjbbj3qsPfUfsA68Bx/ICWQMi+C8Eg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/eslint-import-context/-/eslint-import-context-0.2.2.tgz", + "integrity": "sha512-YHdR+e47b1f3Ys+MZlgZ4oF+C9R9wJ39gAM0XfIaUyA7/08TfgbxT2vdr7i3CBfsXZDL5EUuvykIKs25sgAAng==", "dev": true, "license": "MIT", "dependencies": { - "get-tsconfig": "^4.10.1", + "get-tsconfig": "^4.14.3", "stable-hash-x": "^0.2.0" }, "engines": { @@ -5007,9 +5021,13 @@ "url": "https://opencollective.com/eslint-import-context" }, "peerDependencies": { + "@typescript-eslint/utils": ">=8.0.0", "unrs-resolver": "^1.0.0" }, "peerDependenciesMeta": { + "@typescript-eslint/utils": { + "optional": true + }, "unrs-resolver": { "optional": true } @@ -5073,21 +5091,23 @@ } }, "node_modules/eslint-plugin-import-x": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.17.1.tgz", - "integrity": "sha512-4cdstYkKCyjumM2Q9NSI03K8D2a9F4Ssz33K2lv2hQa4KmR9jPLwk3uWGtNvclfqBrPGfGuMBwsGMbe6dMRbfg==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.19.0.tgz", + "integrity": "sha512-s02TswBLKaJML77vJAUNJuB1BUKbXJUzvdWXN5tiWrSfJ7m43vpPkEh2TsgUP5UR8gTL+Ywuydcw4ndkun5vAQ==", "dev": true, "license": "MIT", "dependencies": { "@typescript-eslint/types": "^8.56.0", + "cjs-module-lexer": "^2.2.1", "comment-parser": "^1.4.1", "debug": "^4.4.1", - "eslint-import-context": "^0.1.9", + "es-module-lexer": "^3.0.3", + "eslint-import-context": "^0.1.9 || ^0.2.2", "is-glob": "^4.0.3", - "minimatch": "^9.0.3 || ^10.1.2", + "minimatch": "^9.0.3 || ^10.1.2 || ^11.0.8", "semver": "^7.7.2", "stable-hash-x": "^0.2.0", - "unrs-resolver": "^1.9.2" + "unrs-resolver": "^1.13.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5096,11 +5116,15 @@ "url": "https://opencollective.com/eslint-plugin-import-x" }, "peerDependencies": { + "@typescript-eslint/parser": "*", "@typescript-eslint/utils": "^8.56.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "eslint-import-resolver-node": "*" }, "peerDependenciesMeta": { + "@typescript-eslint/parser": { + "optional": true + }, "@typescript-eslint/utils": { "optional": true }, @@ -5120,9 +5144,9 @@ } }, "node_modules/eslint-plugin-import-x/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz", + "integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==", "dev": true, "license": "MIT", "dependencies": { @@ -5132,17 +5156,25 @@ "node": "20 || >=22" } }, + "node_modules/eslint-plugin-import-x/node_modules/es-module-lexer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-3.0.5.tgz", + "integrity": "sha512-RNq2lKJw53c7z9QRHeiKeA6Ez0oikOqiBGdmxQhKDxEiOX1g5QJR4IoFVwicn8uCZcRWNrXC3NZaJihgK7aEbg==", + "dev": true, + "license": "MIT" + }, "node_modules/eslint-plugin-import-x/node_modules/minimatch": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", - "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "version": "11.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.10.tgz", + "integrity": "sha512-L3/cjhQ5E6lft0VCp/2mO3Ic74RnutKy3rz7iGwp/6w1hKcO262g2rbfacFyw6eBig5OdI0nu5PpuA0/WQs9Tw==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^5.0.8" + "@isaacs/nonrecursive-glob-match": "^1.1.0", + "brace-expansion": "^5.0.12" }, "engines": { - "node": "18 || 20 || >=22" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -5506,9 +5538,9 @@ } }, "node_modules/fast-check": { - "version": "4.10.2", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.10.2.tgz", - "integrity": "sha512-iK2f+YrcmoeGqk6fA0ea2bptcu/itMIm4NfEozq6N25+aG6h7s5HZbB/k1aV7b5w5sFLMCbbtRUsTVR+BgC3xw==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.11.0.tgz", + "integrity": "sha512-V4Uc238rhQOdQlc+Gz7JG6SGBtrWnWL8d/6RyiBeCMcNKMhF6DZ0KkAVHJSyNV5r4lA0PmIpZ6iRpTVoz4qjoA==", "dev": true, "funding": [ { @@ -5692,9 +5724,9 @@ } }, "node_modules/flatted": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", - "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.6.0.tgz", + "integrity": "sha512-1Szo+c/GCm/cKBovrfT0Wpqw7fiqZg/xzlZtLtvWlYyvT4zUGZTS8Qo3sXPQ0nWqMg3N4nEFL2Ukzrjnsopwbg==", "dev": true, "license": "ISC" }, @@ -5890,9 +5922,9 @@ } }, "node_modules/get-tsconfig": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.3.tgz", - "integrity": "sha512-++QEw4DIY7WGoukz+/+A/8dGYPT9l9yIadnmSgZ8Rjr3YVSVDipQSO9CdnJo9ePqFqUUqh+wk9uIaoiAwsiPkA==", + "version": "4.14.6", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.6.tgz", + "integrity": "sha512-rAoS+bjL3OtXp9TsB5FQZc3qPh01/82Ymqn1/VQUvtp5f+rKIfxyKLm9ZcT5/lj5j1VAndqJUzMdxjjXe7GC+A==", "dev": true, "license": "MIT", "dependencies": { @@ -5938,9 +5970,9 @@ } }, "node_modules/glob/node_modules/brace-expansion": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", - "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.8.tgz", + "integrity": "sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig==", "dev": true, "license": "MIT", "dependencies": { @@ -6035,11 +6067,11 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.12.tgz", + "integrity": "sha512-iuyGF2E4oafQfPsRrG2wtY2ILupMhvtdrhzrxB+0VcjsPpSPttpfYdjnGFGsTi5MaJFjI1jOKHPQ6UTbTj9TAw==", "dev": true, - "license": "ISC" + "license": "BlueOak-1.0.0" }, "node_modules/hard-rejection": { "version": "2.1.0", @@ -7208,9 +7240,9 @@ } }, "node_modules/jest-config/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz", + "integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==", "dev": true, "license": "MIT", "dependencies": { @@ -7221,9 +7253,9 @@ } }, "node_modules/jest-config/node_modules/glob": { - "version": "13.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", - "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "version": "13.0.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.7.tgz", + "integrity": "sha512-wfsFgXQ8A3SEI9XGf7Nl3Y9l7ffSrGh7SUCT7vU/2CzYPep9kjxAn1S40F9OPKxAMGCVl7HtNlJhrCJUeUq83g==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -7239,9 +7271,9 @@ } }, "node_modules/jest-config/node_modules/lru-cache": { - "version": "11.5.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", - "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "version": "11.5.4", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.4.tgz", + "integrity": "sha512-B8nJCTi8JuSaDBg0tBdnImV6j5O2CXaqKfdj24ZTCFbyivN8KZ2Z+RL3aHjwJAfLutD9cNnObG4SIgW4gMufiw==", "dev": true, "license": "BlueOak-1.0.0", "engines": { @@ -7571,9 +7603,9 @@ } }, "node_modules/jest-runtime/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz", + "integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==", "dev": true, "license": "MIT", "dependencies": { @@ -7584,9 +7616,9 @@ } }, "node_modules/jest-runtime/node_modules/glob": { - "version": "13.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", - "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "version": "13.0.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.7.tgz", + "integrity": "sha512-wfsFgXQ8A3SEI9XGf7Nl3Y9l7ffSrGh7SUCT7vU/2CzYPep9kjxAn1S40F9OPKxAMGCVl7HtNlJhrCJUeUq83g==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -7602,9 +7634,9 @@ } }, "node_modules/jest-runtime/node_modules/lru-cache": { - "version": "11.5.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", - "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "version": "11.5.4", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.4.tgz", + "integrity": "sha512-B8nJCTi8JuSaDBg0tBdnImV6j5O2CXaqKfdj24ZTCFbyivN8KZ2Z+RL3aHjwJAfLutD9cNnObG4SIgW4gMufiw==", "dev": true, "license": "BlueOak-1.0.0", "engines": { @@ -8418,9 +8450,9 @@ } }, "node_modules/node-forge": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.3.tgz", - "integrity": "sha512-P6wzfh6t70avmV8FrVEAd/36sOPJQ+hkaJVX1Laap9J/77m7M0eyozDvc8SwnDf4P7MP94gwbAAo0rg3YVXT+g==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.4.tgz", + "integrity": "sha512-T6VRRpF3+czIGcXW/LOeoD7Ej28d8CF1UMEAbJyJRUtYMvyXAgxUPW2kbUibumvV9LiUQAznJOFyeYclzSJMMg==", "dev": true, "license": "(BSD-3-Clause OR GPL-2.0)", "engines": { @@ -8435,9 +8467,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.63", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.63.tgz", - "integrity": "sha512-6li2QanLsAXpIH2R6j77MzRyvOyrvdTqlKtO4CgBdHGNvN99ZZfyxszHc5o5+IZBWD5u6Hzwg83JoGXmqZNG9Q==", + "version": "2.0.67", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.67.tgz", + "integrity": "sha512-qgSZT38oj+YV4qyFmdPQEGRFQRP1l8a0wccOECrcrdGl9KldZlCXrEz7uOviThiOWR1KyqiQYeLrf7M9xRi1bg==", "dev": true, "license": "MIT", "engines": { @@ -8537,9 +8569,9 @@ } }, "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.14.0.tgz", + "integrity": "sha512-IVgHNlp/jwQX271+Xzoq9LZNTWXxZK+cEOrGBOBxXNbn7fapnZ+Ts6TVMgNOuAezwG2wdtnMX97tTPK6VEnuOQ==", "dev": true, "license": "MIT", "engines": { @@ -10201,9 +10233,9 @@ } }, "node_modules/tapable": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", - "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.4.tgz", + "integrity": "sha512-NHFiWnAbMJxNNpBwiO7jJVGDuqMxT9/oV8v57RR+fgBQShkJil5inGD8/xWy0hjLyHQyX1tu27QANhlz3KBqCg==", "dev": true, "license": "MIT", "engines": { @@ -10240,9 +10272,9 @@ } }, "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz", + "integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==", "dev": true, "license": "MIT", "dependencies": { @@ -10585,16 +10617,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.72.1.tgz", - "integrity": "sha512-3Li9FfPmQp45nxEtFD1ZCrYFI3cYK5kpyNtmm1H7lMagm8u9sy6PTjy3ytwQZs7KNukOyKFHAZ6z6GjYFeaeXw==", + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.74.0.tgz", + "integrity": "sha512-OsWQlsedt1ZpZXfZZMNK3m4SoQONFFcy4h/uRznsCeRfVuEic3gh4KGUs2pJJ5o0Jj0Jr7keUHQGN1Ns9aDw7Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.72.1", - "@typescript-eslint/parser": "8.72.1", - "@typescript-eslint/typescript-estree": "8.72.1", - "@typescript-eslint/utils": "8.72.1" + "@typescript-eslint/eslint-plugin": "8.74.0", + "@typescript-eslint/parser": "8.74.0", + "@typescript-eslint/typescript-estree": "8.74.0", + "@typescript-eslint/utils": "8.74.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10628,9 +10660,9 @@ } }, "node_modules/undici": { - "version": "6.29.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.1.tgz", - "integrity": "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==", + "version": "6.29.2", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.2.tgz", + "integrity": "sha512-C+UmjyhIX6k9Mtr3VtxoPU6FmxV44MSEX/y/TSJG67OkAAYdrCUyBf9V9WGGejinKm/x3vj9CYCTmF5NV0cq2w==", "dev": true, "license": "MIT", "engines": { @@ -10694,9 +10726,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", - "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.4.0.tgz", + "integrity": "sha512-WPJuOnjI9FWDct4fB+ej4Mz8opLaw5CDcZ2t44tFZ0vIQVYWzBhWR3mkixuUj/A7+vY4V9+ApOZ2YYLwdgq46w==", "dev": true, "funding": [ { @@ -10985,9 +11017,9 @@ } }, "node_modules/ws": { - "version": "8.22.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.1.tgz", - "integrity": "sha512-oyL6OPYme/CmiFvNuGzeoxCJ4nOrZE2O1FwM9MWM1AsGri6nLXB2pg+lNA8aLeXMSav0J6eIVS1j6vUPzUtK9g==", + "version": "8.23.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.23.1.tgz", + "integrity": "sha512-1rzWDSN0NOi3tpwgHsQExjWRoKUGtjCkJ2gZRaaRtzhYLboMytOI9pj9PU7yCgY37auqdd4OyLofZDbkeuZmPA==", "dev": true, "license": "MIT", "engines": { diff --git a/deps/undici/src/package.json b/deps/undici/src/package.json index d1a37891d309..a28f15fdfa1f 100644 --- a/deps/undici/src/package.json +++ b/deps/undici/src/package.json @@ -1,6 +1,6 @@ { "name": "undici", - "version": "7.30.2", + "version": "7.30.4", "description": "An HTTP/1.1 client, written from scratch for Node.js", "homepage": "https://undici.nodejs.org", "bugs": { diff --git a/deps/undici/src/types/errors.d.ts b/deps/undici/src/types/errors.d.ts index 94b902470c74..7155b9c0b1a8 100644 --- a/deps/undici/src/types/errors.d.ts +++ b/deps/undici/src/types/errors.d.ts @@ -154,6 +154,16 @@ declare namespace Errors { code: 'UND_ERR_PRX_TLS' } + export class ProxyConnectionError extends UndiciError { + constructor ( + cause?: Error, + message?: string, + options?: Record + ) + name: 'ProxyConnectionError' + code: 'UND_ERR_PRX_CONN' + } + export class MaxOriginsReachedError extends UndiciError { name: 'MaxOriginsReachedError' code: 'UND_ERR_MAX_ORIGINS_REACHED' diff --git a/deps/undici/undici.js b/deps/undici/undici.js index 98cfafc4a66f..8e98d2b6117c 100644 --- a/deps/undici/undici.js +++ b/deps/undici/undici.js @@ -413,6 +413,25 @@ var require_errors = __commonJS({ return true; } }; + var kProxyConnectionError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_PRX_CONN"); + var ProxyConnectionError = class extends UndiciError { + static { + __name(this, "ProxyConnectionError"); + } + constructor(cause, message, options = {}) { + super(message, { cause, ...options }); + this.name = "ProxyConnectionError"; + this.message = message || "Proxy Connection failed"; + this.code = "UND_ERR_PRX_CONN"; + this.cause = cause; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kProxyConnectionError] === true; + } + get [kProxyConnectionError]() { + return true; + } + }; var kMaxOriginsReachedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"); var MaxOriginsReachedError = class extends UndiciError { static { @@ -483,6 +502,7 @@ var require_errors = __commonJS({ RequestRetryError, ResponseError, SecureProxyConnectionError, + ProxyConnectionError, MaxOriginsReachedError, Socks5ProxyError, MessageSizeExceededError @@ -566,7 +586,8 @@ var require_symbols = __commonJS({ kNoProxyAgent: /* @__PURE__ */ Symbol("no proxy agent"), kHttpProxyAgent: /* @__PURE__ */ Symbol("http proxy agent"), kHttpsProxyAgent: /* @__PURE__ */ Symbol("https proxy agent"), - kSocks5ProxyAgent: /* @__PURE__ */ Symbol("socks5 proxy agent") + kSocks5ProxyAgent: /* @__PURE__ */ Symbol("socks5 proxy agent"), + kInterceptorKind: /* @__PURE__ */ Symbol("interceptor kind") }; } }); @@ -664,6 +685,8 @@ var require_dispatcher = __commonJS({ "use strict"; var EventEmitter = require("node:events"); var WrapHandler = require_wrap_handler(); + var { InvalidArgumentError } = require_errors(); + var { kInterceptorKind } = require_symbols(); var wrapInterceptor = /* @__PURE__ */ __name((dispatch) => (opts, handler) => dispatch(opts, WrapHandler.wrap(handler)), "wrapInterceptor"); var Dispatcher2 = class extends EventEmitter { static { @@ -681,6 +704,7 @@ var require_dispatcher = __commonJS({ compose(...args) { const interceptors = Array.isArray(args[0]) ? args[0] : args; let dispatch = this.dispatch.bind(this); + const orderSensitiveKinds = []; for (const interceptor of interceptors) { if (interceptor == null) { continue; @@ -688,12 +712,20 @@ var require_dispatcher = __commonJS({ if (typeof interceptor !== "function") { throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`); } + if (interceptor[kInterceptorKind] != null) { + orderSensitiveKinds.push(interceptor[kInterceptorKind]); + } dispatch = interceptor(dispatch); dispatch = wrapInterceptor(dispatch); if (dispatch == null || typeof dispatch !== "function" || dispatch.length !== 2) { throw new TypeError("invalid interceptor"); } } + const cacheIndex = orderSensitiveKinds.indexOf("cache"); + const redirectIndex = orderSensitiveKinds.indexOf("redirect"); + if (cacheIndex !== -1 && redirectIndex !== -1 && cacheIndex < redirectIndex) { + throw new InvalidArgumentError("the cache interceptor must be composed after the redirect interceptor; composing the cache before the redirect disables the cache's cross-origin and credential redirect guards (GHSA-75VM-9G8F-99J4, GHSA-MQG3-3V4R-CM32, GHSA-4W7W-5XRC-9H26, GHSA-7XG3-FPHP-28HG)"); + } return new Proxy(this, { get: /* @__PURE__ */ __name((target, key) => key === "dispatch" ? dispatch : target[key], "get") }); @@ -7446,8 +7478,20 @@ var require_client_h1 = __commonJS({ finish() { assert(currentParser === null); assert(this.ptr != null); - assert(!this.paused); const { llhttp } = this; + if (this.paused) { + let data; + do { + llhttp.llhttp_resume(this.ptr); + this.paused = false; + data = this.socket.read() || EMPTY_BUF; + this.execute(data); + } while (this.paused && data.length > 0); + if (this.paused) { + llhttp.llhttp_resume(this.ptr); + this.paused = false; + } + } let ret; try { currentParser = this; @@ -8500,6 +8544,8 @@ var require_client_h2 = __commonJS({ } = require_symbols(); var { channels } = require_diagnostics(); var kOpenStreams = /* @__PURE__ */ Symbol("open streams"); + var kHeldReplayAttempts = /* @__PURE__ */ Symbol("held replay attempts"); + var MAX_HELD_REPLAY_ATTEMPTS = 1; var extractBody; var http2; try { @@ -8723,6 +8769,30 @@ var require_client_h2 = __commonJS({ } } __name(completeRequest, "completeRequest"); + function registerHeldRefusal(request) { + const attempts = (request[kHeldReplayAttempts] ?? 0) + 1; + request[kHeldReplayAttempts] = attempts; + return attempts <= MAX_HELD_REPLAY_ATTEMPTS; + } + __name(registerHeldRefusal, "registerHeldRefusal"); + function refuseHeldRequests(client, err) { + const queue = client[kQueue]; + const failed = []; + let j = client[kPendingIdx]; + for (let i = client[kPendingIdx]; i < queue.length; i++) { + const request = queue[i]; + if (request != null && !registerHeldRefusal(request)) { + failed.push(request); + } else { + queue[j++] = request; + } + } + queue.length = j; + for (let i = 0; i < failed.length; i++) { + util.errorRequest(client, failed[i], err); + } + } + __name(refuseHeldRequests, "refuseHeldRequests"); function onHttp2SessionGoAway(errorCode) { const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${errorCode}`, util.getSocketInfo(this[kSocket])); const client = this[kClient]; @@ -8775,8 +8845,12 @@ var require_client_h2 = __commonJS({ if (this[kHTTP2Session] !== null) { this[kHTTP2Session].destroy(err); } + const held = client[kRunning] === 0; client[kPendingIdx] = client[kRunningIdx]; assert(client[kRunning] === 0); + if (held) { + refuseHeldRequests(client, err); + } client.emit("disconnect", client[kUrl], [client], err); client[kResume](); } @@ -9752,6 +9826,10 @@ var require_client = __commonJS({ if (request === null) { return; } + if (request.aborted) { + client[kQueue].splice(client[kPendingIdx], 1); + continue; + } if (client[kUrl].protocol === "https:" && client[kServerName] !== request.servername) { if (client[kRunning] > 0) { return; @@ -10805,7 +10883,7 @@ var require_proxy_agent = __commonJS({ var Agent = require_agent(); var Pool = require_pool(); var DispatcherBase = require_dispatcher_base(); - var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors(); + var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError, ProxyConnectionError } = require_errors(); var buildConnector = require_connect(); var Client = require_client(); var { channels } = require_diagnostics(); @@ -10901,7 +10979,7 @@ var require_proxy_agent = __commonJS({ this[kProxy] = { uri: href, protocol }; this[kRequestTls] = opts.requestTls; this[kProxyTls] = opts.proxyTls; - this[kProxyHeaders] = opts.headers || {}; + this[kProxyHeaders] = { ...opts.headers }; this[kTunnelProxy] = proxyTunnel; if (opts.auth && opts.token) { throw new InvalidArgumentError("opts.auth cannot be used in combination with opts.token"); @@ -10993,6 +11071,8 @@ var require_proxy_agent = __commonJS({ } catch (err) { if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { callback(new SecureProxyConnectionError(err)); + } else if (err.code === "UND_ERR_SOCKET") { + callback(new ProxyConnectionError(err)); } else { callback(err); } @@ -11088,16 +11168,22 @@ var require_env_http_proxy_agent = __commonJS({ super(); this.#opts = opts; const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts; - this[kNoProxyAgent] = new Agent(agentOpts); + const { connect, tls, requestTls } = agentOpts; + const connectOpts = typeof connect === "function" ? void 0 : connect; + const tlsOpts = typeof tls === "object" ? tls : void 0; + this[kNoProxyAgent] = new Agent( + requestTls && typeof connect !== "function" ? { ...agentOpts, connect: { ...requestTls, ...connect } } : agentOpts + ); + const proxyOpts = connectOpts || tlsOpts ? { ...agentOpts, requestTls: { ...tlsOpts, ...requestTls, ...connectOpts } } : agentOpts; const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY; if (HTTP_PROXY) { - this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY }); + this[kHttpProxyAgent] = new ProxyAgent({ ...proxyOpts, uri: HTTP_PROXY }); } else { this[kHttpProxyAgent] = this[kNoProxyAgent]; } const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY; if (HTTPS_PROXY) { - this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY }); + this[kHttpsProxyAgent] = new ProxyAgent({ ...proxyOpts, uri: HTTPS_PROXY }); } else { this[kHttpsProxyAgent] = this[kHttpProxyAgent]; } @@ -16457,9 +16543,11 @@ var require_eventsource = __commonJS({ var { parseMIMEType } = require_data_url(); var { createFastMessageEvent: createFastMessageEvent2 } = require_events(); var { isNetworkError } = require_response(); - var { kEnumerableProperty } = require_util(); + var { isValidHeaderValue, kEnumerableProperty } = require_util(); var { environmentSettingsObject } = require_util2(); var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2(); + var { isomorphicDecode } = require_infra(); + var textEncoder = new TextEncoder(); var experimentalWarned = false; var defaultReconnectionTime = 3e3; var CONNECTING = 0; @@ -16635,8 +16723,12 @@ var require_eventsource = __commonJS({ this.dispatchEvent(new Event("error")); setTimeout(() => { if (this.#readyState !== CONNECTING) return; + this.#request.headersList.delete("last-event-id", true); if (this.#state.lastEventId.length) { - this.#request.headersList.set("last-event-id", this.#state.lastEventId, true); + const lastEventId = isomorphicDecode(textEncoder.encode(this.#state.lastEventId)); + if (isValidHeaderValue(lastEventId)) { + this.#request.headersList.set("last-event-id", lastEventId, true); + } } this.#connect(); }, this.#state.reconnectionTime)?.unref(); @@ -16832,7 +16924,7 @@ var require_readable = __commonJS({ err = new RequestAbortedError(); } if (err) { - this[kAbort](); + this[kAbort](err); } if (!this[kUsed]) { setImmediate(callback, err); @@ -17475,6 +17567,7 @@ var require_api_stream = __commonJS({ this.trailers = null; this.body = body; this.onInfo = onInfo || null; + this.responseStarted = false; if (util.isStream(body)) { body.on("error", (err) => { this.onError(err); @@ -17520,11 +17613,14 @@ var require_api_stream = __commonJS({ util.destroy(res2, err); } this.callback = null; - this.runInAsyncScope(callback, null, err || null, { opaque: opaque2, trailers }); + if (callback) { + this.runInAsyncScope(callback, null, err || null, { opaque: opaque2, trailers }); + } if (err) { abort(); } }); + this.responseStarted = true; res.on("drain", resume); this.res = res; const needDrain = res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState?.needDrain; @@ -17550,7 +17646,7 @@ var require_api_stream = __commonJS({ if (res) { this.res = null; util.destroy(res, err); - } else if (callback) { + } else if (callback && !this.responseStarted) { this.callback = null; queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }); diff --git a/src/undici_version.h b/src/undici_version.h index 5b8e0a41e493..03560feef07d 100644 --- a/src/undici_version.h +++ b/src/undici_version.h @@ -2,5 +2,5 @@ // Refer to tools/dep_updaters/update-undici.sh #ifndef SRC_UNDICI_VERSION_H_ #define SRC_UNDICI_VERSION_H_ -#define UNDICI_VERSION "7.30.2" +#define UNDICI_VERSION "7.30.4" #endif // SRC_UNDICI_VERSION_H_