mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 17:03:15 +00:00
chore(deps): update npm packages and adapt major upgrades
Resolve the MikroORM packages together and use the dispatcher adapter with older built-in fetch implementations. Preserve existing Lucide names and regenerate the Studio and SDK catalogs.
This commit is contained in:
@@ -2,7 +2,7 @@ import { readEnv } from '../app-config';
|
||||
import { embeddedTransitionIpv4, expandIpv6 } from './ipv6';
|
||||
|
||||
import dns from 'node:dns/promises';
|
||||
import { Agent, ProxyAgent, type Dispatcher } from 'undici';
|
||||
import { Agent, Dispatcher1Wrapper, ProxyAgent, type Dispatcher } from 'undici';
|
||||
|
||||
// Frozen at import on purpose (legacy timing; tests reload the module to change it).
|
||||
const ALLOW_INTERNAL_NETWORK = readEnv().net.allowInternalNetwork;
|
||||
@@ -700,8 +700,8 @@ export function createOutboundDispatcher(
|
||||
): Dispatcher {
|
||||
const proxy = proxyFor(url);
|
||||
const keepAliveMs = reuseConnections ? KEPT_ALIVE_MS : undefined;
|
||||
const create = (): Dispatcher =>
|
||||
proxy
|
||||
const create = (): Dispatcher => {
|
||||
const dispatcher = proxy
|
||||
? new ProxyAgent({
|
||||
uri: proxy,
|
||||
requestTls: { rejectUnauthorized },
|
||||
@@ -709,6 +709,9 @@ export function createOutboundDispatcher(
|
||||
...(keepAliveMs ? { keepAliveTimeout: keepAliveMs } : {}),
|
||||
})
|
||||
: createPinnedDispatcher(resolved, rejectUnauthorized, responseTimeoutMs, headersTimeoutMs, keepAliveMs);
|
||||
// Node's built-in fetch uses the dispatcher v1 handler contract until Undici 8.
|
||||
return Number.parseInt(process.versions.undici ?? '', 10) < 8 ? new Dispatcher1Wrapper(dispatcher) : dispatcher;
|
||||
};
|
||||
if (!reuseConnections) return create();
|
||||
// Through a proxy the proxy connects, so the addresses play no part in what the dispatcher does.
|
||||
const addresses = proxy ? [] : typeof resolved === 'string' ? [resolved] : [...resolved];
|
||||
|
||||
Reference in New Issue
Block a user