From e06e7e9a5943b5a1b28eaebb2f66c20cdf5c5c7b Mon Sep 17 00:00:00 2001 From: killagu Date: Wed, 4 Dec 2024 19:03:20 +0800 Subject: [PATCH 1/2] feat: exports undici --- src/fetch.ts | 6 +++--- src/index.ts | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fetch.ts b/src/fetch.ts index 5c51b083..0238bfa8 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -223,11 +223,11 @@ export class FetchFactory { res = await UndiciFetch(input, init); }); } catch (e: any) { - channels.response.publish({ + channels.fetchResponse.publish({ fetch: fetchMeta, - error: e, + error: e,n } as FetchResponseDiagnosticsMessage); - channels.fetchResponse.publish({ + channels.response.publish({ request: reqMeta, response: urllibResponse, error: e, diff --git a/src/index.ts b/src/index.ts index 0d4c5f28..141e1bee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,7 +44,8 @@ export { MockAgent, ProxyAgent, Agent, Dispatcher, setGlobalDispatcher, getGlobalDispatcher, Request, RequestInfo, RequestInit, - Response, + Response, BodyInit, ResponseInit, + Headers, FormData, File, } from 'undici'; // HttpClient2 is keep compatible with urllib@2 HttpClient2 export { From 4c3dbe83a9c59658a549c2779cded6cb15a22fc1 Mon Sep 17 00:00:00 2001 From: killagu Date: Wed, 4 Dec 2024 19:08:45 +0800 Subject: [PATCH 2/2] f --- src/fetch.ts | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fetch.ts b/src/fetch.ts index 0238bfa8..f47fd98d 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -225,7 +225,7 @@ export class FetchFactory { } catch (e: any) { channels.fetchResponse.publish({ fetch: fetchMeta, - error: e,n + error: e, } as FetchResponseDiagnosticsMessage); channels.response.publish({ request: reqMeta, diff --git a/src/index.ts b/src/index.ts index 141e1bee..ded47ff3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -45,7 +45,7 @@ export { setGlobalDispatcher, getGlobalDispatcher, Request, RequestInfo, RequestInit, Response, BodyInit, ResponseInit, - Headers, FormData, File, + Headers, FormData, } from 'undici'; // HttpClient2 is keep compatible with urllib@2 HttpClient2 export {