From 80bd6112ada57c97b4094ee13ec27f1595f765de Mon Sep 17 00:00:00 2001 From: abearxiong Date: Sat, 3 Jan 2026 18:20:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20@kevisual/api=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E8=87=B3=200.0.17=EF=BC=8C=E5=8D=87=E7=BA=A7=20@kevis?= =?UTF-8?q?ual/cache=20=E5=92=8C=20@kevisual/query=20=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E8=87=B3=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E6=9E=84=20QueryProxy=20=E7=B1=BB=E4=BB=A5=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20API=20=E6=9F=A5=E8=AF=A2=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- pnpm-lock.yaml | 22 ++++++++++++---------- query/query-proxy/index.ts | 15 ++++++++------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index a4df259..7aa9aa9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/api", - "version": "0.0.16", + "version": "0.0.17", "description": "", "main": "mod.ts", "scripts": { @@ -21,8 +21,8 @@ "packageManager": "pnpm@10.27.0", "type": "module", "devDependencies": { - "@kevisual/cache": "^0.0.4", - "@kevisual/query": "^0.0.33", + "@kevisual/cache": "^0.0.5", + "@kevisual/query": "^0.0.34", "@kevisual/router": "^0.0.52", "@kevisual/types": "^0.0.10", "@kevisual/use-config": "^1.0.21", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index adfb8f8..33488db 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,11 +25,11 @@ importers: version: 5.1.6 devDependencies: '@kevisual/cache': - specifier: ^0.0.4 - version: 0.0.4 + specifier: ^0.0.5 + version: 0.0.5 '@kevisual/query': - specifier: ^0.0.33 - version: 0.0.33 + specifier: ^0.0.34 + version: 0.0.34 '@kevisual/router': specifier: ^0.0.52 version: 0.0.52 @@ -74,8 +74,8 @@ importers: packages: - '@kevisual/cache@0.0.4': - resolution: {integrity: sha512-NlyriJ9fC27TgQhWYbEH9hG84R2k0lIofOxo/+nVHN6a6LJSLnVbpDIysRcnH8MI52n/XHfWwLSjeDDL3D1/cQ==} + '@kevisual/cache@0.0.5': + resolution: {integrity: sha512-fgtUYGUUq/DY0KFV4CkWszNqvQUaA8XvMTUjoR9ZXRpau5IIDolD/Wen2TFsZ7G3Rfy+lef5dnaiZVDkZwdVKg==} '@kevisual/js-filter@0.0.3': resolution: {integrity: sha512-vgUB2fUAWS75GUFr/a/tGSSDrPUUmVDktO38k3hIKwU3ZE4tpuhcVxrpUbkXlFS5i0rbL2mAQeID1C6kIlMGRg==} @@ -86,8 +86,8 @@ packages: '@kevisual/query@0.0.18': resolution: {integrity: sha512-I2vHTu0I6AyD9PJyr+vxyp9jIJ6rd2EZqLVHTv/+zrVKVc2SS76Tg7aGNkmAFqqLSCB8kLLsmMGtSJU1Qb8VVg==} - '@kevisual/query@0.0.33': - resolution: {integrity: sha512-3w74bcLpwV3z483eg8n0DgkftfjWC6iLONXBvfyjW6IZf6jMOuouFaM4Rk+uEsTgElU6XGMKseNTp6dlQdWYkg==} + '@kevisual/query@0.0.34': + resolution: {integrity: sha512-UHA0qEJYzU76pffUx0OhcOL5zKuxR/Kg269OHjrFm7+7RO85Qzv4ON1vUJDFp61hRuRVwiwOEKucQLHLE6UpMg==} '@kevisual/router@0.0.20': resolution: {integrity: sha512-uSwDYWh+kvAu6i0m0SJVgcLR/CYz7WvIWGz0nSF8Vg6smJuAgI+laHR4ESO8Fbz+Xn8bPHuSwmM//HHLMLx2FA==} @@ -526,7 +526,7 @@ packages: snapshots: - '@kevisual/cache@0.0.4': + '@kevisual/cache@0.0.5': dependencies: idb-keyval: 6.2.2 lru-cache: 11.2.4 @@ -546,7 +546,9 @@ snapshots: - ws - zod - '@kevisual/query@0.0.33': {} + '@kevisual/query@0.0.34': + dependencies: + tslib: 2.8.1 '@kevisual/router@0.0.20': dependencies: diff --git a/query/query-proxy/index.ts b/query/query-proxy/index.ts index 8793698..0b81daa 100644 --- a/query/query-proxy/index.ts +++ b/query/query-proxy/index.ts @@ -1,4 +1,4 @@ -import { Query, Result } from '@kevisual/query/query'; +import { QueryClient as Query, Result } from '@kevisual/query'; import { QueryRouterServer, Route } from '@kevisual/router/src/route.ts'; import { filter } from '@kevisual/js-filter' import { EventEmitter } from 'eventemitter3'; @@ -8,14 +8,14 @@ export type RouterViewItemInfo = RouterViewApi | RouterViewContext | RouterViewW export type RouterViewItem = RouterViewItemInfo & T; type RouteViewBase = { + /** + * _id 用于纯本地存储标识 + */ + _id: string; id: string; title: string; description: string; enabled?: boolean; - /** - * 提示问题 - */ - question?: string; /** * 响应数据 */ @@ -65,7 +65,7 @@ export type RouterViewWorker = { * @returns */ export const pickRouterViewData = (item: RouterViewItem) => { - const { question, action, response, ...rest } = item; + const { action, response, _id, ...rest } = item; if (rest.type === 'api') { if (rest.api) { delete rest.api.query; @@ -141,7 +141,8 @@ export class QueryProxy { if (item.type === 'api' && item.api?.url) { const url = item.api.url; if (item?.api?.query) return item; - item['api'] = { url: url, query: new Query({ url: url }) }; + const query = new Query({ url: url }); + item['api'] = { url: url, query: query }; } if (item.type === 'worker' && item.worker?.url) { let viewItem = item as RouterViewWorker;