1
0
forked from boos/BoosAPI
Commit Graph

211 Commits

Author SHA1 Message Date
cita 55b1ae564e feat: update error messages in NewApiAdapter tests to use correct Chinese translations
feat: enhance proxy usage parser to include cache read and creation tokens

feat: add billing details to ProxyLog interface and implement related formatting functions

fix: correct mojibake issues in source files and add regression test for mojibake detection

chore: add SQL migration for billing details in proxy_logs table

test: improve site speed button tests to ensure proper state updates without DOM lookups
2026-03-06 17:10:01 +08:00
Cita 4d9bd52c01 Update star history chart link format 2026-03-06 16:58:30 +08:00
cita 2a810facb8 feat: implement macOS notarization and ad-hoc signing in afterSign script
feat: add run-server script to manage server execution and compatibility checks

feat: create main application logic for desktop with window management, server handling, and auto-updater

test: add unit tests for desktop runtime helpers

feat: implement desktop server environment configuration and health check

test: add tests for server configuration and desktop routes

feat: add native module guard for better-sqlite3 compatibility

test: add tests for native module guard functionality

test: add comprehensive tests for account verification feedback handling

feat: implement account verification feedback helpers

chore: add TypeScript configuration for desktop builds
2026-03-06 16:24:41 +08:00
cita acdc846b13 Refactor logging timestamps to use formatUtcSqlDateTime function across proxy routes and services; add storedTimestampRepairService for fixing createdAt values in database 2026-03-06 11:57:30 +08:00
cita 7fda94f27d feat(models): update model selection logic and add comprehensive tests for /v1/models route 2026-03-05 21:52:35 +08:00
cita fdf4f30987 feat: add createdAt timestamps to check-in logs and improve i18n translations
- Added createdAt timestamps to various check-in log entries in checkinService.ts for better tracking.
- Updated i18n translations in Models.tsx to improve user experience with accurate Chinese translations.
- Reduced default page size in ProgramLogs.tsx and ProxyLogs.tsx from 80 and 100 to 50 for better performance.
- Enhanced ProxyLogs.tsx with memoization for filtered logs and summary statistics.
- Implemented support for parsing Unix timestamps and PostgreSQL-style timezone offsets in checkinLogTime.ts.
- Added comprehensive tests for database proxy query wrapper in index.proxy-wrap.test.ts to ensure functionality.
2026-03-05 21:18:49 +08:00
cita 0d5e56f478 feat(settings): add validation for SQLite connection strings and improve error messages 2026-03-05 19:37:09 +08:00
cita b122893796 Add tests for settings database runtime configuration API
- Implement tests for retrieving and saving runtime database configuration.
- Validate handling of invalid configuration payloads.
- Utilize Fastify for API testing with Vitest.
- Ensure proper cleanup of database state between tests.
2026-03-05 18:57:18 +08:00
cita 283c052fa5 test:Add database migration service with normalization and masking functions
- Implemented `normalizeMigrationInput` to standardize database migration input for sqlite, mysql, and postgres.
- Added `maskConnectionString` to obscure sensitive credentials in connection strings.
- Created comprehensive tests for migration input normalization and connection string masking.
- Established database schema creation logic for multiple dialects (sqlite, mysql, postgres).
- Developed functions for managing database transactions, including begin, commit, and rollback.
- Implemented data insertion logic from backup snapshots into the target database.
2026-03-05 17:38:52 +08:00
cita 0168592c95 Merge branch 'main' of https://github.com/cita-777/metapi 2026-03-05 14:28:12 +08:00
cita 4a61148b4f feat(accounts): extend rebind-session API to handle refresh token and expiration fields 2026-03-05 14:28:10 +08:00
Cita b6860df426 Update Star History chart image link in README 2026-03-05 13:25:17 +08:00
cita 27501b5a85 feat(ProgramLogs): add event status summary parsing and corresponding labels 2026-03-05 13:08:59 +08:00
cita 11fc61f4fa feat(donehub): add user self endpoint handling and balance calculation logic 2026-03-05 12:23:45 +08:00
cita 24769706e1 feat(proxy): enhance error handling for chat proxy requests with fallback logic 2026-03-04 22:12:02 +08:00
cita ecc117d7ee feat(proxy): update endpoint resolution order for 'anyrouter' platform 2026-03-04 21:48:26 +08:00
cita ebc5934547 feat(platforms): enhance platform detection by adding URL hinting logic 2026-03-04 21:05:30 +08:00
cita 9fbf434bd6 feat(proxy): enhance upstream endpoint handling and error summarization
- Added new utility functions for building minimal JSON headers and normalizing responses for compatibility.
- Implemented detailed error handling for unsupported media types and endpoint downgrade scenarios.
- Introduced a new endpoint flow mechanism to manage retries and downgrades between different upstream endpoints.
- Enhanced tests for endpoint flow and error summarization to cover various edge cases and scenarios.
- Updated CSS styles for accounts table to improve layout and responsiveness.
- Refactored ModelTester component to handle incremental text updates more effectively.
2026-03-04 20:59:48 +08:00
cita 82e9f3b601 Add tests for accounts login shield and proxy log retention service
- Implement tests for accounts login shield detection, verifying behavior when login fails with HTML JSON parse syntax error.
- Create tests for proxy log retention service, ensuring expired logs are deleted based on retention days and that cleanup is skipped when retention is disabled.
- Add tests for token router cache, validating that route snapshots are maintained within TTL until explicitly invalidated.
- Introduce necessary mock setups and database seeding for comprehensive testing.
2026-03-04 14:59:06 +08:00
cita 536d957a9e Merge branch 'main' of https://github.com/cita-777/metapi 2026-03-04 13:46:34 +08:00
cita e281e45e84 feat: add comprehensive tests for token candidates and proxy log path metadata
- Implemented tests for the `/api/models/token-candidates` endpoint to verify model availability and token coverage scenarios.
- Added tests for `composeProxyLogMessage` to ensure proper formatting of log messages with downstream and upstream metadata.
- Created utility functions for parsing proxy log path metadata and handling missing token hints.
- Developed tests for the `Sites` and `TokenRoutes` components to validate UI behavior and interactions, including scrolling and group expansion.
- Introduced a custom hook `useAnimatedVisibility` for managing visibility animations in components.
- Enhanced the documentation link for site resources.
2026-03-04 13:46:31 +08:00
Cita 4b77207d03 Update star history chart version in README 2026-03-03 18:50:28 +08:00
cita d49fcefa05 feat: 增强错误处理,添加对特定无效请求的处理逻辑 2026-03-03 17:29:37 +08:00
cita 9ff138f0b5 feat: 添加 Telegram 通知支持,更新配置和文档 2026-03-03 17:25:27 +08:00
ciat-777 cf6b2285fb feat: 更新文档,添加项目架构和界面预览部分 2026-03-03 15:13:52 +08:00
ciat-777 eff6f22f6d Add unit tests for backupService to validate import/export functionality 2026-03-03 14:50:59 +08:00
ciat-777 5cebc1554f feat: 增强聊天代理流行为,优化错误处理和工具调用逻辑 2026-03-03 00:03:34 +08:00
ciat-777 e2fce12e20 feat: 更新文档链接,增强客户端接入指南,优化代理日志记录和错误处理 2026-03-02 23:43:29 +08:00
ciat-777 fed7ea7023 feat: 增强测试用例以支持函数调用和输出,优化工具参数处理逻辑 2026-03-02 23:11:38 +08:00
ciat-777 555f6e15ab feat: enhance tool call handling and serialization in chat formats
- Added support for tool calls in NormalizedFinalResponse type.
- Implemented functions to collect and serialize tool calls from OpenAI and Claude responses.
- Updated convertClaudeRequestToOpenAiBody to handle tool use and tool result messages.
- Enhanced normalizeUpstreamFinalResponse to include tool calls in the response structure.
- Introduced utility functions for safe JSON stringification and parsing.
- Improved conversion functions for OpenAI tools to Anthropic format and vice versa.
- Updated input handling in convertOpenAiBodyToMessagesBody and convertOpenAiBodyToResponsesBody to accommodate tool messages.
- Refactored serialization logic in serializeFinalResponse and buildSyntheticOpenAiChunks to include tool calls.
2026-03-02 22:18:13 +08:00
ciat-777 515d083b2c feat: 添加 Zeabur 一键部署指南和相关变量说明 2026-03-02 21:08:07 +08:00
ciat-777 ed2b30c347 fix: 更新 Dockerfile,添加缺失的依赖项安装 2026-03-02 20:51:20 +08:00
ciat-777 605c5e1959 refactor: 更新未知平台的端点优先级逻辑 2026-03-02 20:46:02 +08:00
ciat-777 487bd23a02 Add platform adapters and tests for CLIProxyAPI, OneHub, Sub2API, and title hint detection
- Implemented `CliProxyApiAdapter` with detection logic for CLIProxyAPI.
- Added tests for `CliProxyApiAdapter` to verify detection and response handling.
- Created `OneHubAdapter` with methods for fetching models and user groups.
- Added tests for `OneHubAdapter` to ensure correct fallback and response parsing.
- Developed `Sub2ApiAdapter` with detection and user info fetching capabilities.
- Added comprehensive tests for `Sub2ApiAdapter` covering various scenarios.
- Introduced `TitleHintPlatform` type and detection logic based on HTML title.
- Implemented tests for title hint detection to identify platforms from URLs.
2026-03-02 20:26:02 +08:00
ciat-777 897273fad4 fix: 更新 Zeabur 部署链接和按钮样式 2026-03-02 17:34:08 +08:00
cita 264a12ed00 feat: 添加 Zeabur 部署模板和相关文档 2026-03-02 16:14:59 +08:00
cita 9471d3359b Merge branch 'main' of https://github.com/cita-777/metapi 2026-03-02 15:35:44 +08:00
cita 946907d66c Refactor code structure for improved readability and maintainability 2026-03-02 15:35:40 +08:00
Cita 515fcf1aaf Merge pull request #16 from cita-777/imgbot
[ImgBot] Optimize images
2026-03-02 14:46:13 +08:00
ImgBotApp 24f4b4aa56 [ImgBot] Optimize images
*Total -- 13,493.63kb -> 8,824.35kb (34.6%)

/docs/screenshots/account-balance.png -- 152.01kb -> 86.31kb (43.22%)
/docs/logos/drafts/logo1.png -- 5,242.26kb -> 3,141.12kb (40.08%)
/docs/screenshots/token-management.png -- 156.86kb -> 97.87kb (37.61%)
/docs/logos/logo.png -- 123.83kb -> 77.82kb (37.15%)
/docs/logos/logo-icon-128.png -- 34.64kb -> 21.89kb (36.81%)
/docs/logos/logo-icon-512.png -- 477.52kb -> 308.22kb (35.45%)
/src/web/public/logo.png -- 477.52kb -> 308.22kb (35.45%)
/docs/logos/drafts/logo2.png -- 1,789.13kb -> 1,186.45kb (33.69%)
/docs/logos/drafts/logo3.png -- 1,230.31kb -> 844.78kb (31.34%)
/docs/logos/logo-icon-64.png -- 9.81kb -> 6.77kb (30.99%)
/docs/screenshots/accounts.png -- 474.50kb -> 328.72kb (30.72%)
/docs/screenshots/dashboard.png -- 680.18kb -> 473.10kb (30.44%)
/docs/screenshots/model-marketplace.png -- 566.33kb -> 394.13kb (30.41%)
/docs/screenshots/routes.png -- 598.34kb -> 419.06kb (29.96%)
/docs/logos/logo-banner.png -- 94.92kb -> 67.79kb (28.58%)
/docs/screenshots/account-management.png -- 680.25kb -> 496.13kb (27.07%)
/docs/logos/logo-banner-sm.png -- 31.83kb -> 23.79kb (25.26%)
/docs/logos/logo-full.png -- 121.20kb -> 90.99kb (24.92%)
/docs/screenshots/allapi-hub-backup.png -- 193.06kb -> 145.82kb (24.47%)
/docs/screenshots/site-management.png -- 78.36kb -> 61.36kb (21.7%)
/docs/logos/logo-full-sm.png -- 40.96kb -> 32.34kb (21.06%)
/src/web/public/favicon-64.png -- 5.31kb -> 4.31kb (18.96%)
/docs/logos/logo-icon-32.png -- 2.84kb -> 2.32kb (18.11%)
/docs/screenshots/account-credentials.png -- 231.67kb -> 205.04kb (11.5%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2026-03-02 06:42:36 +00:00
cita a3f55a83f9 Refactor code structure for improved readability and maintainability 2026-03-02 14:37:49 +08:00
cita f6389a999a feat(tests): add comprehensive tests for TokenRouter and related components
- Implement tests for TokenRouter downstream policy, covering allowedRouteIds and site weight multipliers.
- Add tests for TokenRouter patterns and model mapping, including regex pattern matching and model mapping precedence.
- Create tests for BrandIcon component to verify brand detection logic.
- Develop tests for Accounts page, focusing on rebind panel behavior and refresh action on error.
- Introduce fuzzy search utility tests to validate substring and subsequence matching.
- Implement navigation focus helpers tests for building and parsing focus paths.
- Add progressive render tests to ensure correct initial and next visible counts.
- Create route model candidates index tests to validate route candidate indexing and matching logic.
2026-03-02 13:33:35 +08:00
cita 99c9e145c3 feat: 更新 Dockerfile 2026-03-01 18:17:04 +08:00
cita 5c1bbd0c62 feat: 更新 Dockerfile 和启动脚本,改用 Debian slim 基础镜像,增强 Node.js ABI 兼容性检查 2026-03-01 17:52:36 +08:00
cita 05a5ee9b9e feat: enhance upstream endpoint handling with new passthrough header extraction and response management
- Introduced new types for endpoint preferences to support 'responses'.
- Added functions to extract safe passthrough headers, Claude-specific headers, and responses-specific headers.
- Implemented logic to ensure proper handling of stream accept headers.
- Updated endpoint resolution logic to prioritize 'responses' in certain contexts.
- Enhanced request building for 'messages' and 'responses' endpoints with improved body sanitization and header management.
- Added comprehensive documentation for new features and usage instructions.
2026-03-01 17:26:50 +08:00
cita af63df808d Merge branch 'main' of https://github.com/cita-777/metapi 2026-03-01 16:19:17 +08:00
cita 906e8328d6 feat: 添加发布工作流和启动脚本,支持直接运行预打包的 Release 产物 2026-03-01 16:19:14 +08:00
Cita a667aad3d0 Update Star History Chart link with version 2026-03-01 16:08:40 +08:00
cita e41b6b7993 feat: 增强设置功能,支持当前识别的管理 IP 和白名单更新逻辑 2026-03-01 15:39:13 +08:00
cita 4d6cd683b3 Merge branch 'main' of https://github.com/cita-777/metapi 2026-03-01 15:21:19 +08:00