@ahoo-wang/fetcher 0.5.5 → 0.6.0
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/README.md +68 -20
- package/dist/fetcher.d.ts +1 -1
- package/dist/fetcher.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +86 -72
- package/dist/index.umd.js +1 -1
- package/dist/interceptor.d.ts +15 -6
- package/dist/interceptor.d.ts.map +1 -1
- package/dist/orderedCapable.d.ts +44 -0
- package/dist/orderedCapable.d.ts.map +1 -0
- package/dist/requestBodyInterceptor.d.ts +2 -0
- package/dist/requestBodyInterceptor.d.ts.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -221,37 +221,85 @@ Global instance for managing multiple Fetcher instances by name.
|
|
|
221
221
|
|
|
222
222
|
### Interceptor System
|
|
223
223
|
|
|
224
|
-
####
|
|
224
|
+
#### Request Interceptors
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
```typescript
|
|
227
|
+
import { Fetcher } from '@ahoo-wang/fetcher';
|
|
227
228
|
|
|
228
|
-
|
|
229
|
+
const fetcher = new Fetcher({ baseURL: 'https://api.example.com' });
|
|
229
230
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
// Add request interceptor (e.g., for authentication)
|
|
232
|
+
const interceptorId = fetcher.interceptors.request.use({
|
|
233
|
+
name: 'auth-interceptor',
|
|
234
|
+
order: 100,
|
|
235
|
+
intercept(exchange) {
|
|
236
|
+
return {
|
|
237
|
+
...exchange,
|
|
238
|
+
request: {
|
|
239
|
+
...exchange.request,
|
|
240
|
+
headers: {
|
|
241
|
+
...exchange.request.headers,
|
|
242
|
+
Authorization: 'Bearer ' + getAuthToken(),
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
},
|
|
247
|
+
});
|
|
234
248
|
|
|
235
|
-
|
|
249
|
+
// Remove interceptor
|
|
250
|
+
fetcher.interceptors.request.eject('auth-interceptor');
|
|
251
|
+
```
|
|
236
252
|
|
|
237
|
-
|
|
253
|
+
### OrderedCapable System
|
|
238
254
|
|
|
239
|
-
|
|
255
|
+
The `OrderedCapable` system allows you to control the execution order of interceptors and other components.
|
|
240
256
|
|
|
241
|
-
|
|
242
|
-
- `response: InterceptorManager` - Response interceptor manager
|
|
243
|
-
- `error: InterceptorManager` - Error interceptor manager
|
|
257
|
+
#### Ordering Concept
|
|
244
258
|
|
|
245
|
-
|
|
259
|
+
```typescript
|
|
260
|
+
import { OrderedCapable } from '@ahoo-wang/fetcher';
|
|
246
261
|
|
|
247
|
-
|
|
262
|
+
// Lower order values have higher priority
|
|
263
|
+
const highPriority: OrderedCapable = { order: 1 }; // Executes first
|
|
264
|
+
const mediumPriority: OrderedCapable = { order: 10 }; // Executes second
|
|
265
|
+
const lowPriority: OrderedCapable = { order: 100 }; // Executes last
|
|
266
|
+
```
|
|
248
267
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
268
|
+
#### Interceptor Ordering
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
// Add interceptors with different orders
|
|
272
|
+
fetcher.interceptors.request.use({
|
|
273
|
+
name: 'logging-interceptor',
|
|
274
|
+
order: 10, // Executes early
|
|
275
|
+
intercept(exchange) {
|
|
276
|
+
console.log('Early logging');
|
|
277
|
+
return exchange;
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
fetcher.interceptors.request.use({
|
|
282
|
+
name: 'auth-interceptor',
|
|
283
|
+
order: 50, // Executes later
|
|
284
|
+
intercept(exchange) {
|
|
285
|
+
// Add auth headers
|
|
286
|
+
return exchange;
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
fetcher.interceptors.request.use({
|
|
291
|
+
name: 'timing-interceptor',
|
|
292
|
+
order: 5, // Executes very early
|
|
293
|
+
intercept(exchange) {
|
|
294
|
+
console.log('Very early timing');
|
|
295
|
+
return exchange;
|
|
296
|
+
},
|
|
297
|
+
});
|
|
252
298
|
|
|
253
|
-
|
|
254
|
-
|
|
299
|
+
// Execution order will be:
|
|
300
|
+
// 1. timing-interceptor (order: 5)
|
|
301
|
+
// 2. logging-interceptor (order: 10)
|
|
302
|
+
// 3. auth-interceptor (order: 50)
|
|
255
303
|
```
|
|
256
304
|
|
|
257
305
|
## 🤝 Contributing
|
package/dist/fetcher.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const DEFAULT_OPTIONS: FetcherOptions;
|
|
|
27
27
|
* const response = await fetcher.fetch('/users/{id}', request);
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
export interface FetcherRequest extends TimeoutCapable, Omit<RequestInit, 'body'> {
|
|
30
|
+
export interface FetcherRequest extends TimeoutCapable, HeadersCapable, Omit<RequestInit, 'body' | 'headers'> {
|
|
31
31
|
/**
|
|
32
32
|
* Path parameters for URL templating
|
|
33
33
|
*
|
package/dist/fetcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../src/fetcher.ts"],"names":[],"mappings":"AAcA,OAAO,EAAqC,cAAc,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EACL,cAAc,EAGd,cAAc,EAEd,YAAY,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnE;;GAEG;AACH,MAAM,WAAW,cACf,SAAQ,cAAc,EACpB,cAAc,EACd,cAAc;CACjB;AAMD,eAAO,MAAM,eAAe,EAAE,cAG7B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,cACf,SAAQ,cAAc,EACpB,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;
|
|
1
|
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AAG,YAAY,CAAC,IAAI,CAAM,GAC1E,OAAO,CAAC,QAAQ,CAAC;CAGrB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export * from './fetcher';
|
|
|
2
2
|
export * from './fetcherRegistrar';
|
|
3
3
|
export * from './interceptor';
|
|
4
4
|
export * from './namedFetcher';
|
|
5
|
+
export * from './orderedCapable';
|
|
6
|
+
export * from './requestBodyInterceptor';
|
|
5
7
|
export * from './timeout';
|
|
6
8
|
export * from './types';
|
|
7
9
|
export * from './urlBuilder';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
function
|
|
1
|
+
function w(r) {
|
|
2
2
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(r);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return
|
|
4
|
+
function I(r, e) {
|
|
5
|
+
return w(e) ? e : e ? r.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : r;
|
|
6
6
|
}
|
|
7
7
|
class P {
|
|
8
8
|
/**
|
|
@@ -23,7 +23,7 @@ class P {
|
|
|
23
23
|
* @throws 当路径参数中缺少必需的占位符时抛出错误
|
|
24
24
|
*/
|
|
25
25
|
build(e, t, s) {
|
|
26
|
-
const o =
|
|
26
|
+
const o = I(this.baseURL, e);
|
|
27
27
|
let i = this.interpolateUrl(o, t);
|
|
28
28
|
if (s) {
|
|
29
29
|
const n = new URLSearchParams(s).toString();
|
|
@@ -48,21 +48,30 @@ class P {
|
|
|
48
48
|
}) : e;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function A(r, e) {
|
|
52
52
|
return typeof r < "u" ? r : e;
|
|
53
53
|
}
|
|
54
|
-
class
|
|
54
|
+
class m extends Error {
|
|
55
55
|
constructor(e, t) {
|
|
56
56
|
const s = e.request?.method || "GET", o = `Request timeout of ${t}ms exceeded for ${s} ${e.url}`;
|
|
57
|
-
super(o), this.name = "FetchTimeoutError", this.exchange = e, Object.setPrototypeOf(this,
|
|
57
|
+
super(o), this.name = "FetchTimeoutError", this.exchange = e, Object.setPrototypeOf(this, m.prototype);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
var c = /* @__PURE__ */ ((r) => (r.GET = "GET", r.POST = "POST", r.PUT = "PUT", r.DELETE = "DELETE", r.PATCH = "PATCH", r.HEAD = "HEAD", r.OPTIONS = "OPTIONS", r))(c || {}),
|
|
61
|
-
const
|
|
60
|
+
var c = /* @__PURE__ */ ((r) => (r.GET = "GET", r.POST = "POST", r.PUT = "PUT", r.DELETE = "DELETE", r.PATCH = "PATCH", r.HEAD = "HEAD", r.OPTIONS = "OPTIONS", r))(c || {}), F = /* @__PURE__ */ ((r) => (r.METHOD = "method", r.BODY = "body", r))(F || {});
|
|
61
|
+
const f = "Content-Type";
|
|
62
62
|
var p = /* @__PURE__ */ ((r) => (r.APPLICATION_JSON = "application/json", r.TEXT_EVENT_STREAM = "text/event-stream", r))(p || {});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
function h(r, e) {
|
|
64
|
+
return e ? r.filter(e).sort((t, s) => t.order - s.order) : [...r].sort((t, s) => t.order - s.order);
|
|
65
|
+
}
|
|
66
|
+
class d {
|
|
67
|
+
constructor(e = []) {
|
|
68
|
+
this.sortedInterceptors = [], this.sortedInterceptors = h(e);
|
|
69
|
+
}
|
|
70
|
+
get name() {
|
|
71
|
+
return this.constructor.name;
|
|
72
|
+
}
|
|
73
|
+
get order() {
|
|
74
|
+
return Number.MIN_SAFE_INTEGER;
|
|
66
75
|
}
|
|
67
76
|
/**
|
|
68
77
|
* 添加拦截器到管理器中
|
|
@@ -70,21 +79,21 @@ class h {
|
|
|
70
79
|
* @returns 拦截器在管理器中的索引位置
|
|
71
80
|
*/
|
|
72
81
|
use(e) {
|
|
73
|
-
|
|
74
|
-
return this.interceptors.push(e), t;
|
|
82
|
+
return this.sortedInterceptors.some((t) => t.name === e.name) ? !1 : (this.sortedInterceptors = h([...this.sortedInterceptors, e]), !0);
|
|
75
83
|
}
|
|
76
84
|
/**
|
|
77
|
-
*
|
|
78
|
-
* @param
|
|
85
|
+
* 根据名称移除拦截器
|
|
86
|
+
* @param name 要移除的拦截器名称
|
|
79
87
|
*/
|
|
80
88
|
eject(e) {
|
|
81
|
-
|
|
89
|
+
const t = this.sortedInterceptors;
|
|
90
|
+
return this.sortedInterceptors = h(t, (s) => s.name !== e), t.length !== this.sortedInterceptors.length;
|
|
82
91
|
}
|
|
83
92
|
/**
|
|
84
93
|
* 清空所有拦截器
|
|
85
94
|
*/
|
|
86
95
|
clear() {
|
|
87
|
-
this.
|
|
96
|
+
this.sortedInterceptors = [];
|
|
88
97
|
}
|
|
89
98
|
/**
|
|
90
99
|
* 依次执行所有拦截器对数据的处理
|
|
@@ -93,17 +102,20 @@ class h {
|
|
|
93
102
|
*/
|
|
94
103
|
async intercept(e) {
|
|
95
104
|
let t = e;
|
|
96
|
-
for (const s of this.
|
|
97
|
-
|
|
105
|
+
for (const s of this.sortedInterceptors)
|
|
106
|
+
t = await s.intercept(t);
|
|
98
107
|
return t;
|
|
99
108
|
}
|
|
100
109
|
}
|
|
101
|
-
class
|
|
110
|
+
class O {
|
|
102
111
|
constructor() {
|
|
103
|
-
this.request = new
|
|
112
|
+
this.request = new d(), this.response = new d(), this.error = new d();
|
|
104
113
|
}
|
|
105
114
|
}
|
|
106
|
-
class
|
|
115
|
+
class S {
|
|
116
|
+
constructor() {
|
|
117
|
+
this.name = "RequestBodyInterceptor", this.order = Number.MIN_SAFE_INTEGER;
|
|
118
|
+
}
|
|
107
119
|
/**
|
|
108
120
|
* 尝试转换请求体为合法的 fetch API body 类型
|
|
109
121
|
*
|
|
@@ -134,23 +146,23 @@ class q {
|
|
|
134
146
|
const s = { ...t };
|
|
135
147
|
s.body = JSON.stringify(t.body), s.headers || (s.headers = {});
|
|
136
148
|
const o = s.headers;
|
|
137
|
-
return o[
|
|
149
|
+
return o[f] || (o[f] = p.APPLICATION_JSON), { ...e, request: s };
|
|
138
150
|
}
|
|
139
151
|
}
|
|
140
|
-
const
|
|
141
|
-
[
|
|
142
|
-
},
|
|
152
|
+
const T = {
|
|
153
|
+
[f]: p.APPLICATION_JSON
|
|
154
|
+
}, y = {
|
|
143
155
|
baseURL: "",
|
|
144
|
-
headers:
|
|
156
|
+
headers: T
|
|
145
157
|
};
|
|
146
|
-
class
|
|
158
|
+
class q {
|
|
147
159
|
/**
|
|
148
160
|
* Create a Fetcher instance
|
|
149
161
|
*
|
|
150
162
|
* @param options - Fetcher configuration options
|
|
151
163
|
*/
|
|
152
|
-
constructor(e =
|
|
153
|
-
this.headers =
|
|
164
|
+
constructor(e = y) {
|
|
165
|
+
this.headers = T, this.interceptors = new O(), this.urlBuilder = new P(e.baseURL), e.headers !== void 0 && (this.headers = e.headers), this.timeout = e.timeout, this.interceptors.request.use(new S());
|
|
154
166
|
}
|
|
155
167
|
/**
|
|
156
168
|
* Make an HTTP request
|
|
@@ -190,16 +202,16 @@ class S {
|
|
|
190
202
|
error: void 0
|
|
191
203
|
};
|
|
192
204
|
try {
|
|
193
|
-
const
|
|
205
|
+
const a = {
|
|
194
206
|
...n
|
|
195
207
|
};
|
|
196
|
-
n = await this.interceptors.request.intercept(
|
|
197
|
-
const
|
|
208
|
+
n = await this.interceptors.request.intercept(a), n.response = await this.timeoutFetch(n);
|
|
209
|
+
const u = {
|
|
198
210
|
...n
|
|
199
211
|
};
|
|
200
|
-
return n = await this.interceptors.response.intercept(
|
|
201
|
-
} catch (
|
|
202
|
-
if (n.error =
|
|
212
|
+
return n = await this.interceptors.response.intercept(u), n;
|
|
213
|
+
} catch (a) {
|
|
214
|
+
if (n.error = a, n = await this.interceptors.error.intercept(n), n.response)
|
|
203
215
|
return n;
|
|
204
216
|
throw n.error;
|
|
205
217
|
}
|
|
@@ -216,28 +228,28 @@ class S {
|
|
|
216
228
|
* @throws FetchTimeoutError Thrown when the request times out
|
|
217
229
|
*/
|
|
218
230
|
async timeoutFetch(e) {
|
|
219
|
-
const t = e.url, s = e.request, o = s.timeout, i =
|
|
231
|
+
const t = e.url, s = e.request, o = s.timeout, i = A(o, this.timeout);
|
|
220
232
|
if (!i)
|
|
221
233
|
return fetch(t, s);
|
|
222
|
-
const n = new AbortController(),
|
|
234
|
+
const n = new AbortController(), a = {
|
|
223
235
|
...s,
|
|
224
236
|
signal: n.signal
|
|
225
237
|
};
|
|
226
|
-
let
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
n.abort(
|
|
238
|
+
let u = null;
|
|
239
|
+
const g = new Promise((L, b) => {
|
|
240
|
+
u = setTimeout(() => {
|
|
241
|
+
u && clearTimeout(u);
|
|
242
|
+
const E = new m(e, i);
|
|
243
|
+
n.abort(E), b(E);
|
|
232
244
|
}, i);
|
|
233
245
|
});
|
|
234
246
|
try {
|
|
235
247
|
return await Promise.race([
|
|
236
|
-
fetch(t,
|
|
237
|
-
|
|
248
|
+
fetch(t, a),
|
|
249
|
+
g
|
|
238
250
|
]);
|
|
239
251
|
} finally {
|
|
240
|
-
|
|
252
|
+
u && clearTimeout(u);
|
|
241
253
|
}
|
|
242
254
|
}
|
|
243
255
|
/**
|
|
@@ -325,8 +337,8 @@ class S {
|
|
|
325
337
|
return this.methodFetch(c.OPTIONS, e, t);
|
|
326
338
|
}
|
|
327
339
|
}
|
|
328
|
-
const
|
|
329
|
-
class
|
|
340
|
+
const l = "default";
|
|
341
|
+
class N {
|
|
330
342
|
constructor() {
|
|
331
343
|
this.registrar = /* @__PURE__ */ new Map();
|
|
332
344
|
}
|
|
@@ -399,7 +411,7 @@ class R {
|
|
|
399
411
|
* const defaultFetcher = fetcherRegistrar.default;
|
|
400
412
|
*/
|
|
401
413
|
get default() {
|
|
402
|
-
return this.requiredGet(
|
|
414
|
+
return this.requiredGet(l);
|
|
403
415
|
}
|
|
404
416
|
/**
|
|
405
417
|
* Set the default Fetcher instance
|
|
@@ -410,7 +422,7 @@ class R {
|
|
|
410
422
|
* fetcherRegistrar.default = fetcher;
|
|
411
423
|
*/
|
|
412
424
|
set default(e) {
|
|
413
|
-
this.register(
|
|
425
|
+
this.register(l, e);
|
|
414
426
|
}
|
|
415
427
|
/**
|
|
416
428
|
* Get a copy of all registered fetchers
|
|
@@ -426,8 +438,8 @@ class R {
|
|
|
426
438
|
return new Map(this.registrar);
|
|
427
439
|
}
|
|
428
440
|
}
|
|
429
|
-
const
|
|
430
|
-
class
|
|
441
|
+
const R = new N();
|
|
442
|
+
class U extends q {
|
|
431
443
|
/**
|
|
432
444
|
* Create a NamedFetcher instance and automatically register it with the global fetcherRegistrar
|
|
433
445
|
*
|
|
@@ -445,28 +457,30 @@ class I extends S {
|
|
|
445
457
|
* headers: { 'Authorization': 'Bearer token' }
|
|
446
458
|
* });
|
|
447
459
|
*/
|
|
448
|
-
constructor(e, t =
|
|
449
|
-
super(t), this.name = e,
|
|
460
|
+
constructor(e, t = y) {
|
|
461
|
+
super(t), this.name = e, R.register(e, this);
|
|
450
462
|
}
|
|
451
463
|
}
|
|
452
|
-
const
|
|
464
|
+
const _ = new U(l);
|
|
453
465
|
export {
|
|
454
|
-
|
|
466
|
+
f as ContentTypeHeader,
|
|
455
467
|
p as ContentTypeValues,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
468
|
+
l as DEFAULT_FETCHER_NAME,
|
|
469
|
+
y as DEFAULT_OPTIONS,
|
|
470
|
+
m as FetchTimeoutError,
|
|
471
|
+
q as Fetcher,
|
|
472
|
+
O as FetcherInterceptors,
|
|
473
|
+
N as FetcherRegistrar,
|
|
462
474
|
c as HttpMethod,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
475
|
+
d as InterceptorManager,
|
|
476
|
+
U as NamedFetcher,
|
|
477
|
+
S as RequestBodyInterceptor,
|
|
478
|
+
F as RequestField,
|
|
466
479
|
P as UrlBuilder,
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
480
|
+
I as combineURLs,
|
|
481
|
+
_ as fetcher,
|
|
482
|
+
R as fetcherRegistrar,
|
|
483
|
+
w as isAbsoluteURL,
|
|
484
|
+
A as resolveTimeout,
|
|
485
|
+
h as toSorted
|
|
472
486
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(n=typeof globalThis<"u"?globalThis:n||self,h(n.Fetcher={}))})(this,(function(n){"use strict";function h(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function
|
|
1
|
+
(function(n,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(n=typeof globalThis<"u"?globalThis:n||self,h(n.Fetcher={}))})(this,(function(n){"use strict";function h(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function g(r,e){return h(e)?e:e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}class b{constructor(e){this.baseURL=e}build(e,t,s){const i=g(this.baseURL,e);let c=this.interpolateUrl(i,t);if(s){const o=new URLSearchParams(s).toString();o&&(c+="?"+o)}return c}interpolateUrl(e,t){return t?e.replace(/{([^}]+)}/g,(s,i)=>{const c=t[i];if(c===void 0)throw new Error(`Missing required path parameter: ${i}`);return String(c)}):e}}function F(r,e){return typeof r<"u"?r:e}class f extends Error{constructor(e,t){const s=e.request?.method||"GET",i=`Request timeout of ${t}ms exceeded for ${s} ${e.url}`;super(i),this.name="FetchTimeoutError",this.exchange=e,Object.setPrototypeOf(this,f.prototype)}}var u=(r=>(r.GET="GET",r.POST="POST",r.PUT="PUT",r.DELETE="DELETE",r.PATCH="PATCH",r.HEAD="HEAD",r.OPTIONS="OPTIONS",r))(u||{}),I=(r=>(r.METHOD="method",r.BODY="body",r))(I||{});const l="Content-Type";var m=(r=>(r.APPLICATION_JSON="application/json",r.TEXT_EVENT_STREAM="text/event-stream",r))(m||{});function T(r,e){return e?r.filter(e).sort((t,s)=>t.order-s.order):[...r].sort((t,s)=>t.order-s.order)}class E{constructor(e=[]){this.sortedInterceptors=[],this.sortedInterceptors=T(e)}get name(){return this.constructor.name}get order(){return Number.MIN_SAFE_INTEGER}use(e){return this.sortedInterceptors.some(t=>t.name===e.name)?!1:(this.sortedInterceptors=T([...this.sortedInterceptors,e]),!0)}eject(e){const t=this.sortedInterceptors;return this.sortedInterceptors=T(t,s=>s.name!==e),t.length!==this.sortedInterceptors.length}clear(){this.sortedInterceptors=[]}async intercept(e){let t=e;for(const s of this.sortedInterceptors)t=await s.intercept(t);return t}}class w{constructor(){this.request=new E,this.response=new E,this.error=new E}}class A{constructor(){this.name="RequestBodyInterceptor",this.order=Number.MIN_SAFE_INTEGER}intercept(e){const t=e.request;if(t.body===void 0||t.body===null||typeof t.body!="object"||t.body instanceof ArrayBuffer||ArrayBuffer.isView(t.body)||t.body instanceof Blob||t.body instanceof File||t.body instanceof URLSearchParams||t.body instanceof FormData||t.body instanceof ReadableStream)return e;const s={...t};s.body=JSON.stringify(t.body),s.headers||(s.headers={});const i=s.headers;return i[l]||(i[l]=m.APPLICATION_JSON),{...e,request:s}}}const P={[l]:m.APPLICATION_JSON},p={baseURL:"",headers:P};class O{constructor(e=p){this.headers=P,this.interceptors=new w,this.urlBuilder=new b(e.baseURL),e.headers!==void 0&&(this.headers=e.headers),this.timeout=e.timeout,this.interceptors.request.use(new A)}async fetch(e,t={}){const s=await this.request(e,t);if(!s.response)throw new Error(`Request to ${s.url} failed with no response`);return s.response}async request(e,t={}){const s={...this.headers||{},...t.headers||{}},i={...t,headers:Object.keys(s).length>0?s:void 0},c=this.urlBuilder.build(e,t.path,t.query);let o={fetcher:this,url:c,request:i,response:void 0,error:void 0};try{const d={...o};o=await this.interceptors.request.intercept(d),o.response=await this.timeoutFetch(o);const a={...o};return o=await this.interceptors.response.intercept(a),o}catch(d){if(o.error=d,o=await this.interceptors.error.intercept(o),o.response)return o;throw o.error}}async timeoutFetch(e){const t=e.url,s=e.request,i=s.timeout,c=F(i,this.timeout);if(!c)return fetch(t,s);const o=new AbortController,d={...s,signal:o.signal};let a=null;const L=new Promise((D,_)=>{a=setTimeout(()=>{a&&clearTimeout(a);const q=new f(e,c);o.abort(q),_(q)},c)});try{return await Promise.race([fetch(t,d),L])}finally{a&&clearTimeout(a)}}async methodFetch(e,t,s={}){return this.fetch(t,{...s,method:e})}async get(e,t={}){return this.methodFetch(u.GET,e,t)}async post(e,t={}){return this.methodFetch(u.POST,e,t)}async put(e,t={}){return this.methodFetch(u.PUT,e,t)}async delete(e,t={}){return this.methodFetch(u.DELETE,e,t)}async patch(e,t={}){return this.methodFetch(u.PATCH,e,t)}async head(e,t={}){return this.methodFetch(u.HEAD,e,t)}async options(e,t={}){return this.methodFetch(u.OPTIONS,e,t)}}const y="default";class R{constructor(){this.registrar=new Map}register(e,t){this.registrar.set(e,t)}unregister(e){return this.registrar.delete(e)}get(e){return this.registrar.get(e)}requiredGet(e){const t=this.get(e);if(!t)throw new Error(`Fetcher ${e} not found`);return t}get default(){return this.requiredGet(y)}set default(e){this.register(y,e)}get fetchers(){return new Map(this.registrar)}}const S=new R;class N extends O{constructor(e,t=p){super(t),this.name=e,S.register(e,this)}}const U=new N(y);n.ContentTypeHeader=l,n.ContentTypeValues=m,n.DEFAULT_FETCHER_NAME=y,n.DEFAULT_OPTIONS=p,n.FetchTimeoutError=f,n.Fetcher=O,n.FetcherInterceptors=w,n.FetcherRegistrar=R,n.HttpMethod=u,n.InterceptorManager=E,n.NamedFetcher=N,n.RequestBodyInterceptor=A,n.RequestField=I,n.UrlBuilder=b,n.combineURLs=g,n.fetcher=U,n.fetcherRegistrar=S,n.isAbsoluteURL=h,n.resolveTimeout=F,n.toSorted=T,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/interceptor.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Fetcher, FetcherRequest } from './fetcher';
|
|
2
|
+
import { NamedCapable } from './types';
|
|
3
|
+
import { OrderedCapable } from './orderedCapable';
|
|
2
4
|
export interface FetchExchange {
|
|
3
5
|
fetcher: Fetcher;
|
|
4
6
|
url: string;
|
|
@@ -10,7 +12,11 @@ export interface FetchExchange {
|
|
|
10
12
|
* 拦截器接口,定义了拦截器的基本结构
|
|
11
13
|
* @template T - 拦截器处理的数据类型
|
|
12
14
|
*/
|
|
13
|
-
export interface Interceptor {
|
|
15
|
+
export interface Interceptor extends NamedCapable, OrderedCapable {
|
|
16
|
+
/**
|
|
17
|
+
* 拦截器的名称,用于标识拦截器,不可重复
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
14
20
|
/**
|
|
15
21
|
* 拦截并处理数据
|
|
16
22
|
* @param exchange - 需要处理的数据
|
|
@@ -22,18 +28,21 @@ export interface Interceptor {
|
|
|
22
28
|
* 拦截器管理器类,用于管理同一类型的多个拦截器
|
|
23
29
|
*/
|
|
24
30
|
export declare class InterceptorManager implements Interceptor {
|
|
25
|
-
|
|
31
|
+
get name(): string;
|
|
32
|
+
get order(): number;
|
|
33
|
+
private sortedInterceptors;
|
|
34
|
+
constructor(interceptors?: Interceptor[]);
|
|
26
35
|
/**
|
|
27
36
|
* 添加拦截器到管理器中
|
|
28
37
|
* @param interceptor - 要添加的拦截器
|
|
29
38
|
* @returns 拦截器在管理器中的索引位置
|
|
30
39
|
*/
|
|
31
|
-
use(interceptor: Interceptor):
|
|
40
|
+
use(interceptor: Interceptor): boolean;
|
|
32
41
|
/**
|
|
33
|
-
*
|
|
34
|
-
* @param
|
|
42
|
+
* 根据名称移除拦截器
|
|
43
|
+
* @param name 要移除的拦截器名称
|
|
35
44
|
*/
|
|
36
|
-
eject(
|
|
45
|
+
eject(name: string): boolean;
|
|
37
46
|
/**
|
|
38
47
|
* 清空所有拦截器
|
|
39
48
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptor.d.ts","sourceRoot":"","sources":["../src/interceptor.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"interceptor.d.ts","sourceRoot":"","sources":["../src/interceptor.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,cAAc,EAAY,MAAM,kBAAkB,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,KAAK,EAAE,KAAK,GAAG,GAAG,GAAG,SAAS,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,YAAY,EAAE,cAAc;IAC/D;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC5E;AAED;;GAEG;AACH,qBAAa,kBAAmB,YAAW,WAAW;IACpD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,OAAO,CAAC,kBAAkB,CAAqB;gBAEnC,YAAY,GAAE,WAAW,EAAO;IAI5C;;;;OAIG;IACH,GAAG,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO;IAQtC;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAM5B;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;;;OAIG;IACG,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;CAQjE;AAED;;GAEG;AACH,qBAAa,mBAAmB;IAC9B;;OAEG;IACH,OAAO,EAAE,kBAAkB,CAA4B;IAEvD;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAA4B;IAExD;;OAEG;IACH,KAAK,EAAE,kBAAkB,CAA4B;CACtD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 具备排序能力的接口
|
|
3
|
+
*
|
|
4
|
+
* 实现该接口的类型需要提供一个排序属性,用于确定执行顺序。
|
|
5
|
+
* 数值越小优先级越高,相同数值的元素保持原有相对顺序。
|
|
6
|
+
*/
|
|
7
|
+
export interface OrderedCapable {
|
|
8
|
+
/**
|
|
9
|
+
* 排序值
|
|
10
|
+
*
|
|
11
|
+
* 数值越小优先级越高。负数、零和正数都支持。
|
|
12
|
+
* 当多个元素具有相同的order值时,它们的相对顺序将保持不变(稳定排序)。
|
|
13
|
+
*/
|
|
14
|
+
order: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 对实现了OrderedCapable接口的数组进行排序
|
|
18
|
+
*
|
|
19
|
+
* 该函数创建并返回一个新的排序数组,不会修改原始数组。
|
|
20
|
+
* 支持可选的过滤函数来筛选需要排序的元素。
|
|
21
|
+
*
|
|
22
|
+
* @template T - 数组元素类型,必须实现OrderedCapable接口
|
|
23
|
+
* @param array - 需要排序的数组
|
|
24
|
+
* @param filter - 可选的过滤函数,用于筛选需要参与排序的元素
|
|
25
|
+
* @returns 排序后的新数组,按照order值升序排列
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* const items: OrderedCapable[] = [
|
|
30
|
+
* { order: 10 },
|
|
31
|
+
* { order: 5 },
|
|
32
|
+
* { order: 1 },
|
|
33
|
+
* ];
|
|
34
|
+
*
|
|
35
|
+
* const sortedItems = toSorted(items);
|
|
36
|
+
* // 结果: [{ order: 1 }, { order: 5 }, { order: 10 }]
|
|
37
|
+
*
|
|
38
|
+
* // 使用过滤函数
|
|
39
|
+
* const filteredAndSorted = toSorted(items, item => item.order > 3);
|
|
40
|
+
* // 结果: [{ order: 5 }, { order: 10 }]
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function toSorted<T extends OrderedCapable>(array: T[], filter?: (item: T) => boolean): T[];
|
|
44
|
+
//# sourceMappingURL=orderedCapable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orderedCapable.d.ts","sourceRoot":"","sources":["../src/orderedCapable.ts"],"names":[],"mappings":"AAaA;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,cAAc,EAC/C,KAAK,EAAE,CAAC,EAAE,EACV,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAC5B,CAAC,EAAE,CAKL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestBodyInterceptor.d.ts","sourceRoot":"","sources":["../src/requestBodyInterceptor.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG3D;;GAEG;AACH,qBAAa,sBAAuB,YAAW,WAAW;IACxD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,aAAa;CA2ClD"}
|
|
1
|
+
{"version":3,"file":"requestBodyInterceptor.d.ts","sourceRoot":"","sources":["../src/requestBodyInterceptor.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG3D;;GAEG;AACH,qBAAa,sBAAuB,YAAW,WAAW;IACxD,IAAI,SAA4B;IAChC,KAAK,SAA2B;IAEhC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,aAAa;CA2ClD"}
|
package/dist/types.d.ts
CHANGED
|
@@ -32,7 +32,14 @@ export declare enum ContentTypeValues {
|
|
|
32
32
|
APPLICATION_JSON = "application/json",
|
|
33
33
|
TEXT_EVENT_STREAM = "text/event-stream"
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* 具备名称能力的接口
|
|
37
|
+
* 实现该接口的类型需要提供一个名称属性
|
|
38
|
+
*/
|
|
35
39
|
export interface NamedCapable {
|
|
40
|
+
/**
|
|
41
|
+
* 名称
|
|
42
|
+
*/
|
|
36
43
|
name: string;
|
|
37
44
|
}
|
|
38
45
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,oBAAY,iBAAiB;IAC3B,gBAAgB,qBAAqB;IACrC,iBAAiB,sBAAsB;CACxC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,oBAAY,iBAAiB;IAC3B,gBAAgB,qBAAqB;IACrC,iBAAiB,sBAAsB;CACxC;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,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