@ahoo-wang/fetcher 2.11.2 → 2.11.3
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.
|
@@ -45,6 +45,24 @@ export declare const VALIDATE_STATUS_INTERCEPTOR_NAME = "ValidateStatusIntercept
|
|
|
45
45
|
* but still allows other interceptors to run after it if needed.
|
|
46
46
|
*/
|
|
47
47
|
export declare const VALIDATE_STATUS_INTERCEPTOR_ORDER: number;
|
|
48
|
+
/**
|
|
49
|
+
* Attribute key used to skip status validation for a specific request.
|
|
50
|
+
*
|
|
51
|
+
* When set to `true` in the exchange attributes, the ValidateStatusInterceptor
|
|
52
|
+
* will skip status validation and allow the response to pass through without
|
|
53
|
+
* throwing an HttpStatusValidationError, regardless of the response status code.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* // Skip status validation for this request
|
|
58
|
+
* const exchange = new FetchExchange({
|
|
59
|
+
* fetcher,
|
|
60
|
+
* request,
|
|
61
|
+
* attributes: new Map([[IGNORE_VALIDATE_STATUS, true]])
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare const IGNORE_VALIDATE_STATUS = "__ignoreValidateStatus__";
|
|
48
66
|
/**
|
|
49
67
|
* Response interceptor that validates HTTP status codes.
|
|
50
68
|
*
|
|
@@ -104,6 +122,9 @@ export declare class ValidateStatusInterceptor implements ResponseInterceptor {
|
|
|
104
122
|
* are caught and converted to HttpStatusValidationError early in the pipeline,
|
|
105
123
|
* preventing other response handlers from attempting to process them. Valid responses
|
|
106
124
|
* proceed through the rest of the response interceptor chain normally.
|
|
125
|
+
*
|
|
126
|
+
* If the exchange attributes contain IGNORE_VALIDATE_STATUS set to true, status
|
|
127
|
+
* validation is skipped entirely, allowing any response status to pass through.
|
|
107
128
|
*/
|
|
108
129
|
intercept(exchange: FetchExchange): void;
|
|
109
130
|
}
|
|
@@ -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,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;
|
|
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;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,6BAA6B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;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;IAG3E;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,QAAQ,EAAE,aAAa;CAiBlC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ahoo-wang/fetcher",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.3",
|
|
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",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"dist"
|
|
43
43
|
],
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@eslint/js": "^9.
|
|
45
|
+
"@eslint/js": "^9.38.0",
|
|
46
46
|
"@vitest/coverage-v8": "^3.2.4",
|
|
47
47
|
"@vitest/ui": "^3.2.4",
|
|
48
|
-
"eslint": "^9.
|
|
48
|
+
"eslint": "^9.38.0",
|
|
49
49
|
"globals": "^16.4.0",
|
|
50
50
|
"prettier": "^3.6.2",
|
|
51
51
|
"typescript": "^5.9.3",
|