From 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 22 四月 2026 18:09:58 +0800
Subject: [PATCH] 上报转运调试
---
node_modules/undici-types/interceptors.d.ts | 38 ++++++++++++++++++++++++++++++++++++--
1 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/node_modules/undici-types/interceptors.d.ts b/node_modules/undici-types/interceptors.d.ts
index 74389db..1dfd04f 100644
--- a/node_modules/undici-types/interceptors.d.ts
+++ b/node_modules/undici-types/interceptors.d.ts
@@ -19,14 +19,47 @@
// DNS interceptor
export type DNSInterceptorRecord = { address: string, ttl: number, family: 4 | 6 }
- export type DNSInterceptorOriginRecords = { 4: { ips: DNSInterceptorRecord[] } | null, 6: { ips: DNSInterceptorRecord[] } | null }
+ export type DNSInterceptorOriginRecords = { records: { 4: { ips: DNSInterceptorRecord[] } | null, 6: { ips: DNSInterceptorRecord[] } | null } }
+ export type DNSStorage = {
+ size: number
+ get(origin: string): DNSInterceptorOriginRecords | null
+ set(origin: string, records: DNSInterceptorOriginRecords | null, options: { ttl: number }): void
+ delete(origin: string): void
+ full(): boolean
+ }
export type DNSInterceptorOpts = {
maxTTL?: number
maxItems?: number
- lookup?: (hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, addresses: DNSInterceptorRecord[]) => void) => void
+ lookup?: (origin: URL, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, addresses: DNSInterceptorRecord[]) => void) => void
pick?: (origin: URL, records: DNSInterceptorOriginRecords, affinity: 4 | 6) => DNSInterceptorRecord
dualStack?: boolean
affinity?: 4 | 6
+ storage?: DNSStorage
+ }
+
+ // Deduplicate interceptor
+ export type DeduplicateMethods = 'GET' | 'HEAD' | 'OPTIONS' | 'TRACE'
+ export type DeduplicateInterceptorOpts = {
+ /**
+ * The HTTP methods to deduplicate.
+ * Note: Only safe HTTP methods can be deduplicated.
+ * @default ['GET']
+ */
+ methods?: DeduplicateMethods[]
+ /**
+ * Header names that, if present in a request, will cause the request to skip deduplication.
+ * Header name matching is case-insensitive.
+ * @default []
+ */
+ skipHeaderNames?: string[]
+ /**
+ * Header names to exclude from the deduplication key.
+ * Requests with different values for these headers will still be deduplicated together.
+ * Useful for headers like `x-request-id` that vary per request but shouldn't affect deduplication.
+ * Header name matching is case-insensitive.
+ * @default []
+ */
+ excludeHeaderNames?: string[]
}
export function dump (opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
@@ -36,4 +69,5 @@
export function responseError (opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
export function cache (opts?: CacheInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
+ export function deduplicate (opts?: DeduplicateInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
}
--
Gitblit v1.9.3