1
1
mirror of https://github.com/ZeroCatDev/ClassworksKV.git synced 2025-12-07 13:03:09 +00:00

37 Commits

Author SHA1 Message Date
Sunwuyuan
21d6ddf164
feat: 实现批量upsert方法,优化键值对处理性能 2025-12-07 13:33:47 +08:00
Sunwuyuan
ab8904b549
feat: 修复POST /:key处理,确保kvStore.upsert操作为异步执行 2025-12-06 13:10:02 +08:00
Sunwuyuan
da633ca5b6
feat: 增强POST /:key处理,支持空值和JSON格式验证 2025-12-06 13:09:00 +08:00
Sunwuyuan
f985b6a11a
Update validation logic for request body
Allow empty arrays to pass validation while intercepting empty objects.
2025-12-01 20:20:17 +08:00
tempChanghong
f0de2cd59b Fix:修改语法错误 2025-12-01 16:01:20 +08:00
tempChanghong
d52ed81a29 Fix: 允许保存空数组,修复无法删除最后一条通知的Bug 2025-12-01 15:06:52 +08:00
Sunwuyuan
79ec5b94a4
feat: 添加Dlass登录 2025-11-29 19:54:50 +08:00
Sunwuyuan
c545612c9c
规范代码格式 2025-11-16 16:15:05 +08:00
Sunwuyuan
4ae023afb0
feat: 添加设备信息提取功能,增强 UUID 认证中间件的错误处理 2025-11-16 14:46:05 +08:00
Sunwuyuan
a1deb5e6e3
feat: 更新设备列表接口,添加 namespace 字段;修改 token 设置名称的条件,支持家长类型 2025-11-15 20:40:00 +08:00
Sunwuyuan
1d7078874b
feat: 添加 Prometheus 指标支持,跟踪在线设备和注册设备总数 2025-11-15 16:21:40 +08:00
Sunwuyuan
87a408d904
feat: 更新/_info接口响应,优化设备信息返回逻辑 2025-11-09 14:32:22 +08:00
SunWuyuan
296473633c
feat: 为新设备添加默认自动登录配置 2025-11-02 11:53:55 +08:00
SunWuyuan
2ab90ffebc
feat: Implement Refresh Token system with enhanced security and user experience
- Added refresh token support in the account model with new fields: refreshToken, refreshTokenExpiry, and tokenVersion.
- Created a new token management utility (utils/tokenManager.js) for generating and verifying access and refresh tokens.
- Updated JWT utility (utils/jwt.js) to maintain backward compatibility while introducing new token generation methods.
- Enhanced middleware for JWT authentication to support new token types and automatic token refreshing.
- Expanded API endpoints in routes/accounts.js to include refresh token functionality, logout options, and token info retrieval.
- Introduced automatic token refresh mechanism in the front-end integration examples.
- Comprehensive migration checklist and documentation for the new refresh token system.
- Added database migration script to accommodate new fields in the Account table.
2025-11-02 09:48:03 +08:00
SunWuyuan
bb61e6e6f5
feat: Add AutoAuth functionality and enhance Apps API
- Introduced AutoAuth model to manage automatic authorization configurations for devices.
- Added new endpoint to obtain token via namespace and password for automatic authorization.
- Implemented functionality to set student names for student-type tokens.
- Enhanced AppInstall model to include deviceType and isReadOnly fields.
- Updated device creation to allow custom namespaces and ensure uniqueness.
- Added routes for managing AutoAuth configurations, including CRUD operations.
- Implemented checks for read-only tokens in KV operations.
- Created detailed API documentation for AutoAuth and new Apps API endpoints.
- Added migration scripts to accommodate new database schema changes.
2025-11-01 19:31:46 +08:00
SunWuyuan
02c0da037f
feat: integrate Socket.IO for real-time updates and online device management
- Added Socket.IO dependency to enable real-time communication.
- Initialized Socket.IO in the server and bound it to the HTTP server.
- Implemented functionality to allow clients to join device channels using KV tokens.
- Added endpoints to retrieve online devices and broadcast key changes.
- Enhanced existing routes to include device names in responses.
- Implemented broadcasting of key changes for KV operations.
- Updated documentation to reflect the new Socket.IO integration and usage.
2025-10-25 17:10:22 +08:00
SunWuyuan
3c64226562
移除账户模型中的refreshToken字段,并将accessToken字段修改为可选 2025-10-07 20:17:11 +08:00
SunWuyuan
f8f63d1ddd
添加OAuth提供者和用户资料中的网站字段 2025-10-07 15:08:16 +08:00
SunWuyuan
6c05d71506
添加智教联盟登录 2025-10-07 14:46:53 +08:00
SunWuyuan
0576a02d6e
修复厚浪云的缩写 2025-10-06 16:45:15 +08:00
SunWuyuan
d83d748da0
添加厚浪云(Logto)作为OAuth提供者 2025-10-06 16:41:23 +08:00
SunWuyuan
aec482cbcb
cskv 2025-10-06 10:49:48 +08:00
SunWuyuan
7b1e224f70
继续一大堆功能实现 2025-10-03 21:22:18 +08:00
SunWuyuan
521522c1d2
更新到一半 2025-10-02 12:07:50 +08:00
SunWuyuan
22838ee71a
feat(kv): 添加获取键名列表功能
新增 listKeysOnly 方法用于获取指定命名空间下的键名列表,并添加对应的路由接口 /:namespace/_keys 支持分页和排序查询。返回结果包含键名数组、总数和分页信息,便于前端展示大量键名时使用。
2025-08-29 16:54:03 +08:00
SunWuyuan
35d05df925
Refactor project structure by reorganizing imports, removing unused files, and updating .gitignore to include additional environment and build directories. Delete legacy migration scripts and Docker configurations to streamline the codebase. 2025-05-25 09:25:58 +08:00
SunWuyuan
0e490e5def
Refactor Dockerfile to include build arguments for database type and set production environment. Update npm commands for dependency installation and Prisma client generation. Modify GitHub Actions workflow to support multiple database types in Docker image builds. Adjust Express server port and enhance logging in www.js. Update Prisma schema to use SQLite and clean up model definitions. Revise routes in kv.js to improve key-value management functionality and update front-end fetch calls in index.ejs for batch import and UUID generation. 2025-05-24 14:57:57 +08:00
SunWuyuan
cf646d619f
Add bcrypt and js-base64 dependencies in package.json and pnpm-lock.yaml. Enhance authentication middleware in auth.js with password hint functionality and improve error handling. Update device management routes in kv.js to support password hint retrieval and modification, ensuring better security and user experience. 2025-05-18 14:33:16 +08:00
SunWuyuan
b312756d5f
Refactor authentication middleware in auth.js to improve site key validation and device access control. Update access types to use an enum in the Prisma schema. Enhance rate limiting in rateLimiter.js for API and write operations. Modify routes in kv.js to support new access types and password management features, including a new endpoint for password removal. 2025-05-18 10:54:41 +08:00
SunWuyuan
3bff254a22
Implement device authentication middleware and Prisma model for device management. Update routes to include device info retrieval and password management, enhancing security and functionality. 2025-05-17 20:02:55 +08:00
SunWuyuan
810491fd2f
Enable static file serving in app.js, implement a batch import endpoint in kv.js for bulk key-value pair uploads, and add a corresponding rate limiter. Enhance the front-end in index.ejs with a form for batch data import and improve styling for better user experience. 2025-05-11 12:04:06 +08:00
SunWuyuan
1b05d73405
Remove unused homework and config models from Prisma schema; update home page rendering in index.js to simplify response. 2025-05-11 07:58:29 +08:00
SunWuyuan
eeacc317a9
app.js 重构为 ES 模块,新增 KV 存储功能,并实现请求超时中间件。更新 package.json 中的依赖项并移除未使用的路由。完善 README,补充项目特性与安装使用说明。 2025-05-10 13:47:02 +08:00
SunWuyuan
3ad77e6602
1 2025-03-15 17:21:46 +08:00
SunWuyuan
2d055f6400
1 2025-03-02 16:36:01 +08:00
SunWuyuan
f0f9568eb6
1 2025-02-23 14:36:22 +08:00
8ad86c103f first 2024-11-17 16:16:16 +08:00