npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kevisual/api

v0.0.17

Published

对 kevisual 相关的query router 的模块整理

Readme

@kevisual/api

对 kevisual 相关的query router 的模块整理

包含的模块:

query-config - 配置管理模块

提供配置的增删改查功能,支持默认配置项管理。

主要功能:

  • 配置的获取、更新、删除
  • 上传配置管理
  • 默认配置项支持(upload.json, workspace.json, ai.json, user.json, life.json)
  • 配置检测功能

使用示例:

import { QueryConfig } from './query-config/query-config';

const config = new QueryConfig();
await config.getConfig({ key: 'upload.json' });
await config.updateConfig({ key: 'config.json', data: { setting: true } });

query-secret - 密钥管理模块

用于管理敏感信息和密钥的存储与检索。

主要功能:

  • 密钥的存储和获取
  • 支持按ID或key检索
  • 密钥列表管理

query-proxy - 代理路由模块

提供动态路由代理功能,可以将请求转发到不同的后端服务。

主要功能:

  • 动态路由注册
  • 请求转发代理
  • 路由列表管理
  • Token认证支持

使用示例:

import { QueryProxy } from './query-proxy/index';

const proxy = new QueryProxy({
  query: new Query(),
  token: 'your-token'
});
await proxy.init(); // 初始化路由
const result = await proxy.run({ path: 'api', key: 'getData' });

query-upload - 文件上传模块

功能完整的文件上传解决方案,支持多种上传方式。

主要功能:

  • 普通文件上传
  • 分片上传(大文件)
  • 上传进度跟踪
  • 文件过滤工具
  • 文件格式转换

核心组件:

  • uploadFiles - 基础文件上传
  • uploadFileChunked - 分片上传
  • UploadProgress - 进度管理
  • filterFiles - 文件过滤
  • toFile - 格式转换

使用示例:

import { uploadFiles, UploadProgress } from './query-upload/query-upload';

const progress = new UploadProgress();
await uploadFiles(files, {
  onProgress: (loaded, total) => {
    console.log(`上传进度: ${loaded}/${total}`);
  }
});

query-app - 应用管理模块

管理应用的注册、获取和列表功能。

主要功能:

  • 获取应用列表
  • 获取公开应用
  • 获取私有应用
  • 应用定义管理

query-shop - 应用商店模块

应用商店功能,处理应用的安装和获取。

主要功能:

  • 应用安装
  • 商店应用管理

query-ai - AI对话模块

集成AI聊天功能,支持多种模型和对话管理。

主要功能:

  • AI对话(支持GPT等模型)
  • 模型列表获取
  • 聊天使用统计
  • 缓存管理
  • 使用限制管理

使用示例:

import { QueryAI } from './query-ai/query-ai';

const ai = new QueryAI({ query: new Query() });
const models = await ai.getModelList();
const response = await ai.chat(
  { message: '你好' },
  { username: 'user', model: 'gpt-3.5', group: 'default' }
);

query-login - 登录认证模块

完整的登录认证解决方案,支持token管理和缓存。

主要功能:

  • 用户登录认证
  • Token管理(access/refresh token)
  • 登录状态缓存
  • 浏览器/Node.js环境支持
  • 自动token刷新

核心组件:

  • QueryLogin - 主登录类
  • LoginCacheStore - 登录缓存
  • Cache - 通用缓存接口

query-resources - 资源管理模块

管理用户资源的访问和获取。

主要功能:

  • 资源文件获取
  • 资源列表管理
  • 用户认证支持
  • 文件预览功能

使用示例:

import { QueryResources } from './query-resources/index';

const resources = new QueryResources({ username: 'user' });
const fileList = await resources.getList('images/');
const fileContent = await resources.fetchFile('document.pdf');

架构特点

  • 模块化设计:每个模块职责单一,可独立使用
  • 统一接口:基于 @kevisual/query 的统一查询接口
  • 环境兼容:支持浏览器和Node.js环境
  • 类型安全:完整的TypeScript类型定义
  • 扩展性:易于扩展和自定义