fix: 更新 @kevisual/api 依赖至 0.0.57,并移除过时的查询配置文件
This commit is contained in:
@@ -59,7 +59,7 @@
|
|||||||
"unstorage": "^1.17.4"
|
"unstorage": "^1.17.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@kevisual/api": "^0.0.55",
|
"@kevisual/api": "^0.0.57",
|
||||||
"@kevisual/cnb": "^0.0.28",
|
"@kevisual/cnb": "^0.0.28",
|
||||||
"@kevisual/dts": "^0.0.4",
|
"@kevisual/dts": "^0.0.4",
|
||||||
"@kevisual/load": "^0.0.6",
|
"@kevisual/load": "^0.0.6",
|
||||||
|
|||||||
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@@ -58,8 +58,8 @@ importers:
|
|||||||
version: 1.17.4(idb-keyval@6.2.2)(ioredis@5.9.3(supports-color@10.2.2))
|
version: 1.17.4(idb-keyval@6.2.2)(ioredis@5.9.3(supports-color@10.2.2))
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@kevisual/api':
|
'@kevisual/api':
|
||||||
specifier: ^0.0.55
|
specifier: ^0.0.57
|
||||||
version: 0.0.55(@types/react@19.2.10)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
version: 0.0.57(@types/react@19.2.10)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||||
'@kevisual/cnb':
|
'@kevisual/cnb':
|
||||||
specifier: ^0.0.28
|
specifier: ^0.0.28
|
||||||
version: 0.0.28(dotenv@17.3.1)(idb-keyval@6.2.2)(ioredis@5.9.3)
|
version: 0.0.28(dotenv@17.3.1)(idb-keyval@6.2.2)(ioredis@5.9.3)
|
||||||
@@ -1290,9 +1290,6 @@ packages:
|
|||||||
'@kevisual/api@0.0.28':
|
'@kevisual/api@0.0.28':
|
||||||
resolution: {integrity: sha512-WQluRlu2qGM1qktIhPLODie8x382a6jEMfFOcay/rnkCgXK0BRpnqOKwlX7IMLdMqka7GY/BD69kSMnK1Exf5g==}
|
resolution: {integrity: sha512-WQluRlu2qGM1qktIhPLODie8x382a6jEMfFOcay/rnkCgXK0BRpnqOKwlX7IMLdMqka7GY/BD69kSMnK1Exf5g==}
|
||||||
|
|
||||||
'@kevisual/api@0.0.55':
|
|
||||||
resolution: {integrity: sha512-ylWpX12tzAULuvxJHhvt7N21SmVOiIV2eVbKSdJ51soo9XO2J7rGNrLcczQ1vPdaSHzCq+9RlAUyd0ogleGJCA==}
|
|
||||||
|
|
||||||
'@kevisual/api@0.0.57':
|
'@kevisual/api@0.0.57':
|
||||||
resolution: {integrity: sha512-U2nz+ckWZ4XGASC08xJT6WKQajhFQDd1iDb9tU1dHZECsvNvIzpHLG7RHFN1vahG1MdbQtppPmHgVTF2Zw7RWg==}
|
resolution: {integrity: sha512-U2nz+ckWZ4XGASC08xJT6WKQajhFQDd1iDb9tU1dHZECsvNvIzpHLG7RHFN1vahG1MdbQtppPmHgVTF2Zw7RWg==}
|
||||||
|
|
||||||
@@ -6612,27 +6609,6 @@ snapshots:
|
|||||||
fuse.js: 7.1.0
|
fuse.js: 7.1.0
|
||||||
nanoid: 5.1.6
|
nanoid: 5.1.6
|
||||||
|
|
||||||
'@kevisual/api@0.0.55(@types/react@19.2.10)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)':
|
|
||||||
dependencies:
|
|
||||||
'@kevisual/context': 0.0.8
|
|
||||||
'@kevisual/js-filter': 0.0.5
|
|
||||||
'@kevisual/load': 0.0.6
|
|
||||||
'@paralleldrive/cuid2': 3.3.0
|
|
||||||
es-toolkit: 1.44.0
|
|
||||||
eventemitter3: 5.0.4
|
|
||||||
fuse.js: 7.1.0
|
|
||||||
nanoid: 5.1.6
|
|
||||||
path-browserify-esm: 1.0.6
|
|
||||||
sonner: 2.0.7(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
|
||||||
spark-md5: 3.0.2
|
|
||||||
zustand: 5.0.11(@types/react@19.2.10)(react@19.2.4)
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- '@types/react'
|
|
||||||
- immer
|
|
||||||
- react
|
|
||||||
- react-dom
|
|
||||||
- use-sync-external-store
|
|
||||||
|
|
||||||
'@kevisual/api@0.0.57(@types/react@19.2.10)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)':
|
'@kevisual/api@0.0.57(@types/react@19.2.10)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@kevisual/context': 0.0.8
|
'@kevisual/context': 0.0.8
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { program, Command } from '@/program.ts';
|
import { program, Command } from '@/program.ts';
|
||||||
import { query } from '@/module/query.ts';
|
import { query } from '@/module/query.ts';
|
||||||
import { QueryConfig } from '@/query/query-config/query-config.ts';
|
import { QueryConfig } from '@kevisual/api/query-config';
|
||||||
import { showMore } from '@/uitls/show-more.ts';
|
import { showMore } from '@/uitls/show-more.ts';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { program, Command } from '@/program.ts';
|
import { program, Command } from '@/program.ts';
|
||||||
import { query } from '@/module/query.ts';
|
import { query } from '@/module/query.ts';
|
||||||
import { QueryConfig } from '@/query/query-secret/query-secret.ts';
|
import { QueryConfig } from '@kevisual/api/query-secret';
|
||||||
import { showMore } from '@/uitls/show-more.ts';
|
import { showMore } from '@/uitls/show-more.ts';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import './command/app/index.ts';
|
|||||||
import './command/gist/index.ts';
|
import './command/gist/index.ts';
|
||||||
import './command/config-remote.ts';
|
import './command/config-remote.ts';
|
||||||
import './command/config-secret-remote.ts';
|
import './command/config-secret-remote.ts';
|
||||||
import './command/ai.ts';
|
// import './command/ai.ts';
|
||||||
import './command/coding-plan/cc.ts'
|
import './command/coding-plan/cc.ts'
|
||||||
import './command/coding-plan/oc.ts'
|
import './command/coding-plan/oc.ts'
|
||||||
import './command/docker.ts';
|
import './command/docker.ts';
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { QueryLoginNode, StorageNode } from '@kevisual/api/login-node';
|
|||||||
const config = getConfig();
|
const config = getConfig();
|
||||||
export const baseURL = config?.baseURL || 'https://kevisual.cn';
|
export const baseURL = config?.baseURL || 'https://kevisual.cn';
|
||||||
export const storage = new StorageNode({ load: true });
|
export const storage = new StorageNode({ load: true });
|
||||||
|
|
||||||
export const getBaseURL = () => {
|
export const getBaseURL = () => {
|
||||||
return baseURL;
|
return baseURL;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,121 +0,0 @@
|
|||||||
/**
|
|
||||||
* 配置查询
|
|
||||||
* @updatedAt 2025-12-03 10:33:00
|
|
||||||
*/
|
|
||||||
import { Query } from '@kevisual/query';
|
|
||||||
import type { Result } from '@kevisual/query/query';
|
|
||||||
type QueryConfigOpts = {
|
|
||||||
query?: Query;
|
|
||||||
};
|
|
||||||
export type Config<T = any> = {
|
|
||||||
id?: string;
|
|
||||||
title?: string;
|
|
||||||
key?: string;
|
|
||||||
description?: string;
|
|
||||||
data?: T;
|
|
||||||
createdAt?: string;
|
|
||||||
updatedAt?: string;
|
|
||||||
};
|
|
||||||
export type UploadConfig = {
|
|
||||||
key?: string;
|
|
||||||
version?: string;
|
|
||||||
};
|
|
||||||
type PostOpts = {
|
|
||||||
token?: string;
|
|
||||||
payload?: Record<string, any>;
|
|
||||||
};
|
|
||||||
export const defaultConfigKeys = ['upload.json', 'workspace.json', 'ai.json', 'user.json', 'life.json'] as const;
|
|
||||||
type DefaultConfigKey = (typeof defaultConfigKeys)[number];
|
|
||||||
|
|
||||||
export class QueryConfig {
|
|
||||||
query: Query;
|
|
||||||
constructor(opts?: QueryConfigOpts) {
|
|
||||||
this.query = opts?.query || new Query();
|
|
||||||
}
|
|
||||||
async post<T = Config>(data: any) {
|
|
||||||
return this.query.post<T>({ path: 'config', ...data });
|
|
||||||
}
|
|
||||||
async getConfig({ id, key }: { id?: string; key?: string }, opts?: PostOpts) {
|
|
||||||
return this.post({
|
|
||||||
key: 'get',
|
|
||||||
data: {
|
|
||||||
id,
|
|
||||||
key,
|
|
||||||
},
|
|
||||||
...opts,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async updateConfig(data: Config, opts?: PostOpts) {
|
|
||||||
return this.post({
|
|
||||||
key: 'update',
|
|
||||||
data,
|
|
||||||
...opts,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async deleteConfig(data: { id?: string, key?: string }, opts?: PostOpts) {
|
|
||||||
console.log('Delete Config Params:', data);
|
|
||||||
return this.post({
|
|
||||||
key: 'delete',
|
|
||||||
data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async listConfig(opts?: PostOpts) {
|
|
||||||
return this.post<{ list: Config[] }>({
|
|
||||||
key: 'list',
|
|
||||||
...opts,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取上传配置
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
async getUploadConfig(opts?: PostOpts) {
|
|
||||||
return this.post<Result<Config<UploadConfig>>>({
|
|
||||||
key: 'getUploadConfig',
|
|
||||||
...opts,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 更新上传配置
|
|
||||||
* @param data
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
async updateUploadConfig(data: Config, opts?: PostOpts) {
|
|
||||||
return this.post<Result<Config<UploadConfig>>>({
|
|
||||||
key: 'updateUploadConfig',
|
|
||||||
data,
|
|
||||||
...opts,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检测配置是否存在
|
|
||||||
* @param id
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
async detectConfig(opts?: PostOpts) {
|
|
||||||
return this.post<{ updateList: Config[] }>({
|
|
||||||
key: 'detect',
|
|
||||||
...opts,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取配置, 获取默认的配置项
|
|
||||||
* @param key
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
async getConfigByKey(key: DefaultConfigKey, opts?: PostOpts) {
|
|
||||||
return this.post<Result<Config>>({
|
|
||||||
key: 'defaultConfig',
|
|
||||||
configKey: key,
|
|
||||||
...opts,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async getByKey<T = any>(key: string, opts?: PostOpts) {
|
|
||||||
return this.post<Result<Config<T>>>({
|
|
||||||
key: 'get',
|
|
||||||
...opts,
|
|
||||||
data: { key },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
/**
|
|
||||||
* 配置查询
|
|
||||||
* @updatedAt 2025-12-03 10:33:00
|
|
||||||
*/
|
|
||||||
import { Query } from '@kevisual/query';
|
|
||||||
import type { Result } from '@kevisual/query/query';
|
|
||||||
type QueryConfigOpts = {
|
|
||||||
query?: Query;
|
|
||||||
};
|
|
||||||
export type Config<T = any> = {
|
|
||||||
id?: string;
|
|
||||||
title?: string;
|
|
||||||
key?: string;
|
|
||||||
description?: string;
|
|
||||||
data?: T;
|
|
||||||
createdAt?: string;
|
|
||||||
updatedAt?: string;
|
|
||||||
};
|
|
||||||
export type UploadConfig = {
|
|
||||||
key?: string;
|
|
||||||
version?: string;
|
|
||||||
};
|
|
||||||
type PostOpts = {
|
|
||||||
token?: string;
|
|
||||||
payload?: Record<string, any>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export class QueryConfig {
|
|
||||||
query: Query;
|
|
||||||
constructor(opts?: QueryConfigOpts) {
|
|
||||||
this.query = opts?.query || new Query();
|
|
||||||
}
|
|
||||||
async post<T = Config>(data: any) {
|
|
||||||
return this.query.post<T>({ path: 'secret', ...data });
|
|
||||||
}
|
|
||||||
async getItem({ id, key }: { id?: string; key?: string }, opts?: PostOpts) {
|
|
||||||
return this.post({
|
|
||||||
key: 'get',
|
|
||||||
data: {
|
|
||||||
id,
|
|
||||||
key,
|
|
||||||
},
|
|
||||||
...opts,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async updateItem(data: Config, opts?: PostOpts) {
|
|
||||||
return this.post({
|
|
||||||
key: 'update',
|
|
||||||
data,
|
|
||||||
...opts,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async deleteItem(data: { id?: string, key?: string }, opts?: PostOpts) {
|
|
||||||
return this.post({
|
|
||||||
key: 'delete',
|
|
||||||
data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async listItems(opts?: PostOpts) {
|
|
||||||
return this.post<{ list: Config[] }>({
|
|
||||||
key: 'list',
|
|
||||||
...opts,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user