@ahoo-wang/fetcher 2.6.10 → 2.6.12
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/fetchExchange.d.ts.map +1 -1
- package/dist/fetcherError.d.ts +33 -0
- package/dist/fetcherError.d.ts.map +1 -1
- package/dist/index.es.js +214 -213
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/interceptorManager.d.ts +0 -33
- package/dist/interceptorManager.d.ts.map +1 -1
- package/dist/validateStatusInterceptor.d.ts +2 -3
- package/dist/validateStatusInterceptor.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,38 +1,5 @@
|
|
|
1
1
|
import { FetchExchange } from './fetchExchange';
|
|
2
|
-
import { FetcherError } from './fetcherError';
|
|
3
2
|
import { InterceptorRegistry } from './interceptor';
|
|
4
|
-
/**
|
|
5
|
-
* Custom error class for FetchExchange related errors.
|
|
6
|
-
*
|
|
7
|
-
* This error is thrown when there are issues with the HTTP exchange process,
|
|
8
|
-
* such as when a request fails and no response is generated. It provides
|
|
9
|
-
* comprehensive information about the failed request through the exchange object.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* try {
|
|
14
|
-
* await fetcher.get('/api/users');
|
|
15
|
-
* } catch (error) {
|
|
16
|
-
* if (error instanceof ExchangeError) {
|
|
17
|
-
* console.log('Request URL:', error.exchange.request.url);
|
|
18
|
-
* console.log('Request method:', error.exchange.request.method);
|
|
19
|
-
* if (error.exchange.error) {
|
|
20
|
-
* console.log('Underlying error:', error.exchange.error);
|
|
21
|
-
* }
|
|
22
|
-
* }
|
|
23
|
-
* }
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export declare class ExchangeError extends FetcherError {
|
|
27
|
-
readonly exchange: FetchExchange;
|
|
28
|
-
/**
|
|
29
|
-
* Creates a new ExchangeError instance.
|
|
30
|
-
*
|
|
31
|
-
* @param exchange - The FetchExchange object containing request/response/error information.
|
|
32
|
-
* @param errorMsg - An optional error message.
|
|
33
|
-
*/
|
|
34
|
-
constructor(exchange: FetchExchange, errorMsg?: string);
|
|
35
|
-
}
|
|
36
3
|
/**
|
|
37
4
|
* Collection of interceptor managers for the Fetcher client.
|
|
38
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptorManager.d.ts","sourceRoot":"","sources":["../src/interceptorManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"interceptorManager.d.ts","sourceRoot":"","sources":["../src/interceptorManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAIpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,qBAAa,kBAAkB;IAC7B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAIlC;IAEH;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAEnC;IAEH;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAA6B;IAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqFG;IACG,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;CAqBrE"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ResponseInterceptor } from './interceptor';
|
|
2
2
|
import { FetchExchange } from './fetchExchange';
|
|
3
|
-
import {
|
|
3
|
+
import { ExchangeError } from './fetcherError';
|
|
4
4
|
/**
|
|
5
5
|
* Error thrown when response status validation fails.
|
|
6
6
|
*
|
|
7
7
|
* This error is thrown by ValidateStatusInterceptor when the response status
|
|
8
8
|
* does not pass the validation defined by the validateStatus function.
|
|
9
9
|
*/
|
|
10
|
-
export declare class HttpStatusValidationError extends
|
|
11
|
-
readonly exchange: FetchExchange;
|
|
10
|
+
export declare class HttpStatusValidationError extends ExchangeError {
|
|
12
11
|
constructor(exchange: FetchExchange);
|
|
13
12
|
}
|
|
14
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateStatusInterceptor.d.ts","sourceRoot":"","sources":["../src/validateStatusInterceptor.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"validateStatusInterceptor.d.ts","sourceRoot":"","sources":["../src/validateStatusInterceptor.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;GAKG;AACH,qBAAa,yBAA0B,SAAQ,aAAa;gBAC9C,QAAQ,EAAE,aAAa;CAQpC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;AAKlD;;GAEG;AACH,eAAO,MAAM,gCAAgC,8BAA8B,CAAC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,QAAiC,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,yBAA0B,YAAW,mBAAmB;IAyBjE,OAAO,CAAC,QAAQ,CAAC,cAAc;IAxBjC;;;;OAIG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;OAIG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;;OAIG;gBAEgB,cAAc,GAAE,cAAwC;IAI3E;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,QAAQ,EAAE,aAAa;CAalC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ahoo-wang/fetcher",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.12",
|
|
4
4
|
"description": "Fetcher is not just another HTTP client—it's a complete ecosystem designed for modern web development with native LLM\nstreaming API support. Built on the native Fetch API, Fetcher provides an Axios-like experience with powerful features\nwhile maintaining an incredibly small footprint.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fetch",
|