@kevisual/api 0.0.16 → 0.0.18
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/package.json +12 -12
- package/query/query-proxy/index.ts +10 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kevisual/api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "mod.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
"keywords": [],
|
|
19
19
|
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
|
|
20
20
|
"license": "MIT",
|
|
21
|
-
"packageManager": "pnpm@10.
|
|
21
|
+
"packageManager": "pnpm@10.28.1",
|
|
22
22
|
"type": "module",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@kevisual/cache": "^0.0.
|
|
25
|
-
"@kevisual/query": "^0.0.
|
|
26
|
-
"@kevisual/router": "^0.0.
|
|
27
|
-
"@kevisual/types": "^0.0.
|
|
28
|
-
"@kevisual/use-config": "^1.0.
|
|
29
|
-
"@types/bun": "^1.3.
|
|
30
|
-
"@types/node": "^25.0.
|
|
24
|
+
"@kevisual/cache": "^0.0.5",
|
|
25
|
+
"@kevisual/query": "^0.0.35",
|
|
26
|
+
"@kevisual/router": "^0.0.60",
|
|
27
|
+
"@kevisual/types": "^0.0.11",
|
|
28
|
+
"@kevisual/use-config": "^1.0.28",
|
|
29
|
+
"@types/bun": "^1.3.6",
|
|
30
|
+
"@types/node": "^25.0.9",
|
|
31
31
|
"dotenv": "^17.2.3",
|
|
32
32
|
"fast-glob": "^3.3.3"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@kevisual/js-filter": "^0.0.
|
|
35
|
+
"@kevisual/js-filter": "^0.0.5",
|
|
36
36
|
"@kevisual/load": "^0.0.6",
|
|
37
|
-
"es-toolkit": "^1.
|
|
38
|
-
"eventemitter3": "^5.0.
|
|
37
|
+
"es-toolkit": "^1.44.0",
|
|
38
|
+
"eventemitter3": "^5.0.4",
|
|
39
39
|
"nanoid": "^5.1.6"
|
|
40
40
|
},
|
|
41
41
|
"exports": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Query, Result } from '@kevisual/query
|
|
1
|
+
import { QueryClient as Query, Result } from '@kevisual/query';
|
|
2
2
|
import { QueryRouterServer, Route } from '@kevisual/router/src/route.ts';
|
|
3
3
|
import { filter } from '@kevisual/js-filter'
|
|
4
4
|
import { EventEmitter } from 'eventemitter3';
|
|
@@ -8,14 +8,14 @@ export type RouterViewItemInfo = RouterViewApi | RouterViewContext | RouterViewW
|
|
|
8
8
|
export type RouterViewItem<T = {}> = RouterViewItemInfo & T;
|
|
9
9
|
|
|
10
10
|
type RouteViewBase = {
|
|
11
|
-
id: string;
|
|
12
|
-
title: string;
|
|
13
|
-
description: string;
|
|
14
|
-
enabled?: boolean;
|
|
15
11
|
/**
|
|
16
|
-
*
|
|
12
|
+
* _id 用于纯本地存储标识
|
|
17
13
|
*/
|
|
18
|
-
|
|
14
|
+
_id?: string;
|
|
15
|
+
id?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
enabled?: boolean;
|
|
19
19
|
/**
|
|
20
20
|
* 响应数据
|
|
21
21
|
*/
|
|
@@ -65,7 +65,7 @@ export type RouterViewWorker = {
|
|
|
65
65
|
* @returns
|
|
66
66
|
*/
|
|
67
67
|
export const pickRouterViewData = (item: RouterViewItem) => {
|
|
68
|
-
const {
|
|
68
|
+
const { action, response, _id, ...rest } = item;
|
|
69
69
|
if (rest.type === 'api') {
|
|
70
70
|
if (rest.api) {
|
|
71
71
|
delete rest.api.query;
|
|
@@ -141,7 +141,8 @@ export class QueryProxy {
|
|
|
141
141
|
if (item.type === 'api' && item.api?.url) {
|
|
142
142
|
const url = item.api.url;
|
|
143
143
|
if (item?.api?.query) return item;
|
|
144
|
-
|
|
144
|
+
const query = new Query({ url: url });
|
|
145
|
+
item['api'] = { url: url, query: query };
|
|
145
146
|
}
|
|
146
147
|
if (item.type === 'worker' && item.worker?.url) {
|
|
147
148
|
let viewItem = item as RouterViewWorker;
|