@ahoo-wang/fetcher 1.8.2 → 1.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fetcher.d.ts +11 -0
- package/dist/fetcher.d.ts.map +1 -1
- package/dist/index.es.js +58 -45
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/fetcher.d.ts
CHANGED
|
@@ -99,6 +99,17 @@ export declare class Fetcher implements UrlBuilderCapable, RequestHeadersCapable
|
|
|
99
99
|
* @throws Error if an unhandled error occurs during request processing
|
|
100
100
|
*/
|
|
101
101
|
request<R = FetchExchange>(request: FetchRequest, options?: RequestOptions): Promise<R>;
|
|
102
|
+
/**
|
|
103
|
+
* Processes an HTTP request through the Fetcher's internal workflow.
|
|
104
|
+
*
|
|
105
|
+
* This method creates a FetchExchange object and passes it through the interceptor chain.
|
|
106
|
+
* It handles header merging, timeout resolution, and result extractor configuration.
|
|
107
|
+
*
|
|
108
|
+
* @param request - The HTTP request configuration to process
|
|
109
|
+
* @param options - Optional request options including result extractor and attributes
|
|
110
|
+
* @returns Promise that resolves to the processed FetchExchange object
|
|
111
|
+
*/
|
|
112
|
+
exchange(request: FetchRequest, options?: RequestOptions): Promise<FetchExchange>;
|
|
102
113
|
/**
|
|
103
114
|
* Executes an HTTP request with the specified URL and options.
|
|
104
115
|
*
|
package/dist/fetcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../src/fetcher.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EACV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Q,CAAM,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC;IAIb;;;;;;;;;;;;;;;OAeG;IACG,MAAM,CAAC,CAAC,GAAG,QAAQ,EACvB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAM,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC;IAIb;;;;;;;;;;;;;;;;OAgBG;IACG,IAAI,CAAC,CAAC,GAAG,QAAQ,EACrB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,MAAM,CAAM,EACvD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC;IAIb;;;;;;;;;;;;;;;;OAgBG;IACG,OAAO,CAAC,CAAC,GAAG,QAAQ,EACxB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,MAAM,CAAM,EACvD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC;CAGd"}
|
package/dist/index.es.js
CHANGED
|
@@ -23,7 +23,7 @@ function S(e, t) {
|
|
|
23
23
|
r.push(s[1]);
|
|
24
24
|
return r;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const a = class a {
|
|
27
27
|
/**
|
|
28
28
|
* Extracts path parameters from a URL string.
|
|
29
29
|
*
|
|
@@ -50,7 +50,7 @@ const c = class c {
|
|
|
50
50
|
extractPathParams(t) {
|
|
51
51
|
return S(
|
|
52
52
|
t,
|
|
53
|
-
|
|
53
|
+
a.PATH_PARAM_REGEX
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
@@ -92,14 +92,14 @@ const c = class c {
|
|
|
92
92
|
resolve(t, r) {
|
|
93
93
|
return N(
|
|
94
94
|
t,
|
|
95
|
-
|
|
95
|
+
a.PATH_PARAM_REGEX,
|
|
96
96
|
r
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
|
|
101
|
-
let
|
|
102
|
-
const G = new
|
|
100
|
+
a.PATH_PARAM_REGEX = /{([^}]+)}/g;
|
|
101
|
+
let m = a;
|
|
102
|
+
const G = new m(), h = class h {
|
|
103
103
|
/**
|
|
104
104
|
* Extracts path parameters from an Express-style URL string.
|
|
105
105
|
*
|
|
@@ -211,8 +211,8 @@ class j {
|
|
|
211
211
|
const s = r?.path, o = r?.query, n = D(this.baseURL, t);
|
|
212
212
|
let u = this.urlTemplateResolver.resolve(n, s);
|
|
213
213
|
if (o) {
|
|
214
|
-
const
|
|
215
|
-
|
|
214
|
+
const c = new URLSearchParams(o).toString();
|
|
215
|
+
c && (u += "?" + c);
|
|
216
216
|
}
|
|
217
217
|
return u;
|
|
218
218
|
}
|
|
@@ -241,7 +241,7 @@ class l extends Error {
|
|
|
241
241
|
super(s), this.cause = r, this.name = "FetcherError", r?.stack && (this.stack = r.stack), Object.setPrototypeOf(this, l.prototype);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
class
|
|
244
|
+
class g extends l {
|
|
245
245
|
/**
|
|
246
246
|
* Creates a new FetchTimeoutError instance.
|
|
247
247
|
*
|
|
@@ -249,7 +249,7 @@ class _ extends l {
|
|
|
249
249
|
*/
|
|
250
250
|
constructor(t) {
|
|
251
251
|
const r = t.method || "GET", s = `Request timeout of ${t.timeout}ms exceeded for ${r} ${t.url}`;
|
|
252
|
-
super(s), this.name = "FetchTimeoutError", this.request = t, Object.setPrototypeOf(this,
|
|
252
|
+
super(s), this.name = "FetchTimeoutError", this.request = t, Object.setPrototypeOf(this, g.prototype);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
function B(e, t) {
|
|
@@ -264,10 +264,10 @@ async function $(e) {
|
|
|
264
264
|
const o = e.abortController ?? new AbortController();
|
|
265
265
|
s.signal = o.signal;
|
|
266
266
|
let n = null;
|
|
267
|
-
const u = new Promise((
|
|
267
|
+
const u = new Promise((c, p) => {
|
|
268
268
|
n = setTimeout(() => {
|
|
269
269
|
n && clearTimeout(n);
|
|
270
|
-
const I = new
|
|
270
|
+
const I = new g(e);
|
|
271
271
|
o.abort(I), p(I);
|
|
272
272
|
}, r);
|
|
273
273
|
});
|
|
@@ -292,7 +292,7 @@ class V {
|
|
|
292
292
|
r.url = t.fetcher.urlBuilder.resolveRequestUrl(r);
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
var
|
|
295
|
+
var i = /* @__PURE__ */ ((e) => (e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.DELETE = "DELETE", e.PATCH = "PATCH", e.HEAD = "HEAD", e.OPTIONS = "OPTIONS", e))(i || {});
|
|
296
296
|
const Et = "Content-Type", d = class d {
|
|
297
297
|
};
|
|
298
298
|
d.APPLICATION_JSON = "application/json", d.TEXT_EVENT_STREAM = "text/event-stream";
|
|
@@ -386,7 +386,7 @@ class K {
|
|
|
386
386
|
function T(e, t) {
|
|
387
387
|
return t ? e.filter(t).sort((r, s) => r.order - s.order) : [...e].sort((r, s) => r.order - s.order);
|
|
388
388
|
}
|
|
389
|
-
class
|
|
389
|
+
class f {
|
|
390
390
|
/**
|
|
391
391
|
* Initializes a new InterceptorRegistry instance.
|
|
392
392
|
*
|
|
@@ -479,11 +479,11 @@ class m {
|
|
|
479
479
|
await r.intercept(t);
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
class
|
|
482
|
+
class _ extends l {
|
|
483
483
|
constructor(t) {
|
|
484
484
|
super(
|
|
485
485
|
`Request failed with status code ${t.response?.status} for ${t.request.url}`
|
|
486
|
-
), this.exchange = t, this.name = "HttpStatusValidationError", Object.setPrototypeOf(this,
|
|
486
|
+
), this.exchange = t, this.name = "HttpStatusValidationError", Object.setPrototypeOf(this, _.prototype);
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
const W = (e) => e >= 200 && e < 300, Z = "ValidateStatusInterceptor", tt = Number.MAX_SAFE_INTEGER - 1e3;
|
|
@@ -530,7 +530,7 @@ class et {
|
|
|
530
530
|
return;
|
|
531
531
|
const r = t.response.status;
|
|
532
532
|
if (!this.validateStatus(r))
|
|
533
|
-
throw new
|
|
533
|
+
throw new _(t);
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
class R extends l {
|
|
@@ -547,13 +547,13 @@ class R extends l {
|
|
|
547
547
|
}
|
|
548
548
|
class rt {
|
|
549
549
|
constructor() {
|
|
550
|
-
this.request = new
|
|
550
|
+
this.request = new f([
|
|
551
551
|
new V(),
|
|
552
552
|
new Q(),
|
|
553
553
|
new K()
|
|
554
|
-
]), this.response = new
|
|
554
|
+
]), this.response = new f([
|
|
555
555
|
new et()
|
|
556
|
-
]), this.error = new
|
|
556
|
+
]), this.error = new f();
|
|
557
557
|
}
|
|
558
558
|
/**
|
|
559
559
|
* Processes a FetchExchange through the interceptor pipeline.
|
|
@@ -651,7 +651,7 @@ class rt {
|
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
const st = (e) => e, ot = (e) => e.requiredResponse, nt = (e) => e.requiredResponse.json(), ut = (e) => e.requiredResponse.text(),
|
|
654
|
+
const st = (e) => e, ot = (e) => e.requiredResponse, nt = (e) => e.requiredResponse.json(), ut = (e) => e.requiredResponse.text(), O = {
|
|
655
655
|
Exchange: st,
|
|
656
656
|
Response: ot,
|
|
657
657
|
Json: nt,
|
|
@@ -673,9 +673,9 @@ function it(e, t) {
|
|
|
673
673
|
t.set(r, s);
|
|
674
674
|
return t;
|
|
675
675
|
}
|
|
676
|
-
class
|
|
676
|
+
class ct {
|
|
677
677
|
constructor(t) {
|
|
678
|
-
this.fetcher = t.fetcher, this.request = t.request, this.resultExtractor = t.resultExtractor ??
|
|
678
|
+
this.fetcher = t.fetcher, this.request = t.request, this.resultExtractor = t.resultExtractor ?? O.Exchange, this.attributes = it(t.attributes), this._response = t.response, this.error = t.error;
|
|
679
679
|
}
|
|
680
680
|
/**
|
|
681
681
|
* Ensures that request headers object exists, creating it if necessary.
|
|
@@ -779,7 +779,7 @@ function dt(e, t) {
|
|
|
779
779
|
}, s = {
|
|
780
780
|
...e.headers,
|
|
781
781
|
...t.headers
|
|
782
|
-
}, o = t.method ?? e.method, n = t.body ?? e.body, u = t.timeout ?? e.timeout,
|
|
782
|
+
}, o = t.method ?? e.method, n = t.body ?? e.body, u = t.timeout ?? e.timeout, c = t.signal ?? e.signal, p = t.abortController ?? e.abortController;
|
|
783
783
|
return {
|
|
784
784
|
...e,
|
|
785
785
|
...t,
|
|
@@ -788,7 +788,7 @@ function dt(e, t) {
|
|
|
788
788
|
headers: s,
|
|
789
789
|
body: n,
|
|
790
790
|
timeout: u,
|
|
791
|
-
signal:
|
|
791
|
+
signal: c,
|
|
792
792
|
abortController: p
|
|
793
793
|
};
|
|
794
794
|
}
|
|
@@ -803,8 +803,8 @@ const A = {
|
|
|
803
803
|
}, x = {
|
|
804
804
|
baseURL: "",
|
|
805
805
|
headers: A
|
|
806
|
-
}, C = { resultExtractor:
|
|
807
|
-
resultExtractor:
|
|
806
|
+
}, C = { resultExtractor: O.Exchange }, at = {
|
|
807
|
+
resultExtractor: O.Response
|
|
808
808
|
};
|
|
809
809
|
class U {
|
|
810
810
|
/**
|
|
@@ -842,6 +842,19 @@ class U {
|
|
|
842
842
|
* @throws Error if an unhandled error occurs during request processing
|
|
843
843
|
*/
|
|
844
844
|
async request(t, r) {
|
|
845
|
+
return (await this.exchange(t, r)).extractResult();
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Processes an HTTP request through the Fetcher's internal workflow.
|
|
849
|
+
*
|
|
850
|
+
* This method creates a FetchExchange object and passes it through the interceptor chain.
|
|
851
|
+
* It handles header merging, timeout resolution, and result extractor configuration.
|
|
852
|
+
*
|
|
853
|
+
* @param request - The HTTP request configuration to process
|
|
854
|
+
* @param options - Optional request options including result extractor and attributes
|
|
855
|
+
* @returns Promise that resolves to the processed FetchExchange object
|
|
856
|
+
*/
|
|
857
|
+
async exchange(t, r) {
|
|
845
858
|
const s = {
|
|
846
859
|
...this.headers,
|
|
847
860
|
...t.headers
|
|
@@ -852,13 +865,13 @@ class U {
|
|
|
852
865
|
}, {
|
|
853
866
|
resultExtractor: n,
|
|
854
867
|
attributes: u
|
|
855
|
-
} = w(C, r),
|
|
868
|
+
} = w(C, r), c = new ct({
|
|
856
869
|
fetcher: this,
|
|
857
870
|
request: o,
|
|
858
871
|
resultExtractor: n,
|
|
859
872
|
attributes: u
|
|
860
873
|
});
|
|
861
|
-
return
|
|
874
|
+
return this.interceptors.exchange(c);
|
|
862
875
|
}
|
|
863
876
|
/**
|
|
864
877
|
* Executes an HTTP request with the specified URL and options.
|
|
@@ -880,7 +893,7 @@ class U {
|
|
|
880
893
|
*/
|
|
881
894
|
async fetch(t, r = {}, s) {
|
|
882
895
|
const o = r;
|
|
883
|
-
return o.url = t, this.request(o, w(
|
|
896
|
+
return o.url = t, this.request(o, w(at, s));
|
|
884
897
|
}
|
|
885
898
|
/**
|
|
886
899
|
* Internal helper method for making HTTP requests with a specific method.
|
|
@@ -928,7 +941,7 @@ class U {
|
|
|
928
941
|
* @returns Promise that resolves to the HTTP response
|
|
929
942
|
*/
|
|
930
943
|
async get(t, r = {}, s) {
|
|
931
|
-
return this.methodFetch(
|
|
944
|
+
return this.methodFetch(i.GET, t, r, s);
|
|
932
945
|
}
|
|
933
946
|
/**
|
|
934
947
|
* Makes a PUT HTTP request.
|
|
@@ -947,7 +960,7 @@ class U {
|
|
|
947
960
|
* @returns Promise that resolves to the HTTP response
|
|
948
961
|
*/
|
|
949
962
|
async put(t, r = {}, s) {
|
|
950
|
-
return this.methodFetch(
|
|
963
|
+
return this.methodFetch(i.PUT, t, r, s);
|
|
951
964
|
}
|
|
952
965
|
/**
|
|
953
966
|
* Makes a POST HTTP request.
|
|
@@ -966,7 +979,7 @@ class U {
|
|
|
966
979
|
* @returns Promise that resolves to the HTTP response
|
|
967
980
|
*/
|
|
968
981
|
async post(t, r = {}, s) {
|
|
969
|
-
return this.methodFetch(
|
|
982
|
+
return this.methodFetch(i.POST, t, r, s);
|
|
970
983
|
}
|
|
971
984
|
/**
|
|
972
985
|
* Makes a PATCH HTTP request.
|
|
@@ -985,7 +998,7 @@ class U {
|
|
|
985
998
|
* @returns Promise that resolves to the HTTP response
|
|
986
999
|
*/
|
|
987
1000
|
async patch(t, r = {}, s) {
|
|
988
|
-
return this.methodFetch(
|
|
1001
|
+
return this.methodFetch(i.PATCH, t, r, s);
|
|
989
1002
|
}
|
|
990
1003
|
/**
|
|
991
1004
|
* Makes a DELETE HTTP request.
|
|
@@ -1004,7 +1017,7 @@ class U {
|
|
|
1004
1017
|
* @returns Promise that resolves to the HTTP response
|
|
1005
1018
|
*/
|
|
1006
1019
|
async delete(t, r = {}, s) {
|
|
1007
|
-
return this.methodFetch(
|
|
1020
|
+
return this.methodFetch(i.DELETE, t, r, s);
|
|
1008
1021
|
}
|
|
1009
1022
|
/**
|
|
1010
1023
|
* Makes a HEAD HTTP request.
|
|
@@ -1024,7 +1037,7 @@ class U {
|
|
|
1024
1037
|
* @returns Promise that resolves to the HTTP response
|
|
1025
1038
|
*/
|
|
1026
1039
|
async head(t, r = {}, s) {
|
|
1027
|
-
return this.methodFetch(
|
|
1040
|
+
return this.methodFetch(i.HEAD, t, r, s);
|
|
1028
1041
|
}
|
|
1029
1042
|
/**
|
|
1030
1043
|
* Makes an OPTIONS HTTP request.
|
|
@@ -1044,7 +1057,7 @@ class U {
|
|
|
1044
1057
|
* @returns Promise that resolves to the HTTP response
|
|
1045
1058
|
*/
|
|
1046
1059
|
async options(t, r = {}, s) {
|
|
1047
|
-
return this.methodFetch(
|
|
1060
|
+
return this.methodFetch(i.OPTIONS, t, r, s);
|
|
1048
1061
|
}
|
|
1049
1062
|
}
|
|
1050
1063
|
const y = "default";
|
|
@@ -1179,7 +1192,7 @@ export {
|
|
|
1179
1192
|
Et as CONTENT_TYPE_HEADER,
|
|
1180
1193
|
E as ContentTypeValues,
|
|
1181
1194
|
y as DEFAULT_FETCHER_NAME,
|
|
1182
|
-
|
|
1195
|
+
at as DEFAULT_FETCH_OPTIONS,
|
|
1183
1196
|
x as DEFAULT_OPTIONS,
|
|
1184
1197
|
C as DEFAULT_REQUEST_OPTIONS,
|
|
1185
1198
|
R as ExchangeError,
|
|
@@ -1187,27 +1200,27 @@ export {
|
|
|
1187
1200
|
P as ExpressUrlTemplateResolver,
|
|
1188
1201
|
Y as FETCH_INTERCEPTOR_NAME,
|
|
1189
1202
|
z as FETCH_INTERCEPTOR_ORDER,
|
|
1190
|
-
|
|
1203
|
+
ct as FetchExchange,
|
|
1191
1204
|
K as FetchInterceptor,
|
|
1192
|
-
|
|
1205
|
+
g as FetchTimeoutError,
|
|
1193
1206
|
U as Fetcher,
|
|
1194
1207
|
l as FetcherError,
|
|
1195
1208
|
ht as FetcherRegistrar,
|
|
1196
|
-
|
|
1197
|
-
|
|
1209
|
+
i as HttpMethod,
|
|
1210
|
+
_ as HttpStatusValidationError,
|
|
1198
1211
|
rt as InterceptorManager,
|
|
1199
|
-
|
|
1212
|
+
f as InterceptorRegistry,
|
|
1200
1213
|
nt as JsonResultExtractor,
|
|
1201
1214
|
lt as NamedFetcher,
|
|
1202
1215
|
k as REQUEST_BODY_INTERCEPTOR_NAME,
|
|
1203
1216
|
J as REQUEST_BODY_INTERCEPTOR_ORDER,
|
|
1204
1217
|
Q as RequestBodyInterceptor,
|
|
1205
1218
|
ot as ResponseResultExtractor,
|
|
1206
|
-
|
|
1219
|
+
O as ResultExtractors,
|
|
1207
1220
|
ut as TextResultExtractor,
|
|
1208
1221
|
X as URL_RESOLVE_INTERCEPTOR_NAME,
|
|
1209
1222
|
F as URL_RESOLVE_INTERCEPTOR_ORDER,
|
|
1210
|
-
|
|
1223
|
+
m as UriTemplateResolver,
|
|
1211
1224
|
j as UrlBuilder,
|
|
1212
1225
|
V as UrlResolveInterceptor,
|
|
1213
1226
|
L as UrlTemplateStyle,
|