@route-forge/core 1.0.2 → 1.0.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.
- package/dist/codegen.cjs +31 -5
- package/dist/codegen.cjs.map +1 -1
- package/dist/codegen.d.cts +8 -1
- package/dist/codegen.d.ts +8 -1
- package/dist/codegen.js +31 -5
- package/dist/codegen.js.map +1 -1
- package/dist/index.cjs +90 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +90 -8
- package/dist/index.js.map +1 -1
- package/dist/{types-DExMMUu1.d.cts → types-pHQLqpYF.d.cts} +10 -0
- package/dist/{types-DExMMUu1.d.ts → types-pHQLqpYF.d.ts} +10 -0
- package/package.json +11 -11
- package/LICENSE +0 -21
|
@@ -130,6 +130,8 @@ interface RequestConfig {
|
|
|
130
130
|
timeout?: number;
|
|
131
131
|
/** 自定义 query 序列化函数 */
|
|
132
132
|
paramsSerializer?: (params: Record<string, unknown>) => string;
|
|
133
|
+
/** 请求取消信号(AbortSignal),用于取消已发出的请求 */
|
|
134
|
+
signal?: AbortSignal;
|
|
133
135
|
}
|
|
134
136
|
/**
|
|
135
137
|
* 响应拦截器首段接收的完整数据对象
|
|
@@ -180,6 +182,14 @@ interface ApiCallParams {
|
|
|
180
182
|
* 单次请求超时覆盖(毫秒);不传时使用 createRouteForge({ timeout }) 全局值
|
|
181
183
|
*/
|
|
182
184
|
timeout?: number;
|
|
185
|
+
/**
|
|
186
|
+
* 请求取消信号(AbortSignal);调用 AbortController.abort() 即可取消请求
|
|
187
|
+
* @example
|
|
188
|
+
* const controller = new AbortController();
|
|
189
|
+
* forge.api('admin', 'users.index', { signal: controller.signal });
|
|
190
|
+
* controller.abort(); // 取消请求
|
|
191
|
+
*/
|
|
192
|
+
signal?: AbortSignal;
|
|
183
193
|
}
|
|
184
194
|
/**
|
|
185
195
|
* 缓存存储介质
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@route-forge/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "框架无关的命名路由客户端核心:分级懒加载、隔离缓存、并发去重、拦截器",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "阿杰很厉害 <506907958@qq.com>",
|
|
@@ -30,6 +30,15 @@
|
|
|
30
30
|
"dist",
|
|
31
31
|
"README.md"
|
|
32
32
|
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsup",
|
|
35
|
+
"dev": "tsup --watch",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"test:watch": "vitest",
|
|
38
|
+
"lint": "tsc --noEmit",
|
|
39
|
+
"typecheck": "tsc --noEmit",
|
|
40
|
+
"clean": "rimraf dist .turbo"
|
|
41
|
+
},
|
|
33
42
|
"bin": {
|
|
34
43
|
"route-forge-codegen": "./dist/codegen.js"
|
|
35
44
|
},
|
|
@@ -47,14 +56,5 @@
|
|
|
47
56
|
},
|
|
48
57
|
"publishConfig": {
|
|
49
58
|
"access": "public"
|
|
50
|
-
},
|
|
51
|
-
"scripts": {
|
|
52
|
-
"build": "tsup",
|
|
53
|
-
"dev": "tsup --watch",
|
|
54
|
-
"test": "vitest run",
|
|
55
|
-
"test:watch": "vitest",
|
|
56
|
-
"lint": "tsc --noEmit",
|
|
57
|
-
"typecheck": "tsc --noEmit",
|
|
58
|
-
"clean": "rimraf dist .turbo"
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 阿杰很厉害
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|