Commit Graph

3761 Commits

Author SHA1 Message Date
Innei
574f02b2f1 refactor(tests): remove zx globals import from global.d.ts and lifecycle.ts
- Eliminated unnecessary import of 'zx/globals' from both global.d.ts and lifecycle.ts files to streamline test setup.
- Ensured that the test lifecycle remains intact while improving code clarity.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-06 00:55:51 +08:00
Innei
d75dcd72c8 chore(deps): add mongodb-memory-server and redis-memory-server to pnpm-lock.yaml
- Updated pnpm-lock.yaml to include `mongodb-memory-server` version 10.1.4 and `redis-memory-server` version 0.12.1 as dependencies.
- Removed optional flags from several dependencies for consistency.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-06 00:53:48 +08:00
Innei
c657e9a80a feat(ci): add custom action for MongoDB and Redis setup
- Introduced a new GitHub Action to streamline the setup of MongoDB and Redis for testing environments.
- Updated CI workflows to utilize the new action, replacing direct MongoDB and Redis setup steps for improved maintainability.
- Added `mongodb-memory-server` and `redis-memory-server` as dependencies in the project.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-06 00:52:50 +08:00
Innei
5077535eda feat(ci): add custom Node.js and pnpm setup action
- Introduced a new GitHub Action for setting up Node.js and pnpm with caching capabilities.
- Updated workflows to utilize the new action, changing the Node.js version to 22.x across CI, API client, and release workflows.
- Streamlined dependency installation and caching processes for improved build performance.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-06 00:41:49 +08:00
Innei
423cc7de14 chore(deps): update package dependencies to use catalog references
- Updated `package.json` and `pnpm-lock.yaml` to replace specific version references with catalog entries for various dependencies, including `@types/cors`, `@types/express`, `abort-controller`, `axios`, `camelcase-keys`, `cors`, `express`, `form-data`, `lodash`, `tsup`, `umi-request`, and `vite`.
- Removed obsolete conflict catalog for `@types/node`.
- Adjusted `pnpm-workspace.yaml` to reflect the new catalog structure for dependencies.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-06 00:36:30 +08:00
Innei
8a5048f067 feat(ai): add deep reading model and controller method
- Introduced `AIDeepReadingModel` to define the structure for deep reading responses.
- Added `getDeepReading` method in `AIController` to fetch deep reading data for a given article ID.
- Updated imports in `ai.ts` to include the new deep reading model.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-06 00:27:18 +08:00
Innei
c385c58943 feat(ai): introduce deep reading functionality and refactor AI module
- Added `AiDeepReadingController`, `AiDeepReadingService`, and related DTOs and models to support deep reading capabilities using AI.
- Integrated new methods for generating and managing deep readings, including error handling and caching mechanisms.
- Updated `AiModule` to include dependencies for deep reading services and controllers.
- Removed the obsolete `AiAgentModule` and its associated test controller.
- Enhanced configuration options to enable or disable deep reading features.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-06 00:16:46 +08:00
Innei
17f3febb5c release: v8.2.0 v8.2.0 2025-05-05 21:19:00 +08:00
Innei
f8555216b6 fix(comment): refine AI evaluation method and update comment options
- Updated `evaluateCommentWithAI` to enforce stricter type checks for `aiReviewType`, now only allowing 'binary' or 'score'.
- Added test calls in the constructor of `CommentService` to evaluate comments using AI.
- Enhanced the response handling in `evaluateCommentWithAI` to improve error management and ensure proper parsing of AI responses.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-05 21:09:41 +08:00
Innei
86fdb9e1f6 refactor(core): 再次延长获取配置等待时间以避免极端情况发生
Signed-off-by: Innei <tukon479@gmail.com>
2025-05-05 21:04:54 +08:00
Innei
d2956f3398 feat: implement AI-based comment evaluation in CommentService
- Added a new private method `evaluateCommentWithAI` to assess comment content using AI, supporting both scoring and spam detection modes.
- Integrated the `JsonOutputToolsParser` for handling AI responses.
- Updated the `checkSpam` method to utilize the new AI evaluation method, improving comment moderation capabilities.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-05 21:02:30 +08:00
Innei
46704d2498 feat: update ai integration (#2422)
* init

Signed-off-by: Innei <tukon479@gmail.com>

* update

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update package dependencies and remove unused code

- Updated package manager version in package.json to pnpm@10.10.0.
- Removed references to `@modelcontextprotocol/sdk` from core application files.
- Deleted unused `mcp.controller.ts` and cleaned up related imports in `mcp.module.ts`.
- Adjusted optional dependencies in pnpm-lock.yaml.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: update AI summary and writer services to use new tools parser

- Replaced `JsonOutputFunctionsParser` with `JsonOutputToolsParser` in both `ai-summary.service.ts` and `ai-writer.service.ts`.
- Updated function definitions to align with the new tools structure, including changes to how functions are defined and invoked.
- Enhanced error handling to return empty objects when no results are found.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-05 20:50:52 +08:00
renovate[bot]
bb7e9a38b1 chore(deps): update robinraju/release-downloader action to v1.12 (#2417)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 20:49:45 +08:00
Innei
9214609eb4 release: v8.1.2 v8.1.2 2025-05-05 16:18:51 +08:00
Innei
af67ca184f chore: enhance CORS configuration in bootstrap and auth implementation
- Added comprehensive CORS methods support in `bootstrap.ts` to allow various HTTP methods.
- Removed redundant CORS headers from the `CreateAuth` function in `auth.implement.ts` to streamline the response handling.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-05 16:18:23 +08:00
Innei
d2e945fbe4 chore: update ESLint configuration
- Modified ESLint configuration to disable markdown support and sortKeys, while ensuring prettier and pnpm support are enabled.
- Removed redundant configuration options for prettier and markdown.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-04 15:10:27 +08:00
Innei
e055f5cd27 chore: update dependencies and improve health controller
- Updated various dependencies in package.json and pnpm-lock.yaml, including:
  - `@aws-sdk/client-s3` from 3.782.0 to 3.802.0
  - `@babel/core` from 7.26.10 to 7.27.1
  - `@nestjs/common` and `@nestjs/core` from 11.0.13 to 11.1.0
  - `axios` from 1.8.3 to 1.9.0
  - `mongoose` from 8.13.2 to 8.14.1
  - Other minor updates across various packages.

- Refactored `getAllCron` method in `cron.controller.ts` to use `job?.isActive` instead of `job?.running` for better clarity on job status.

Signed-off-by: Innei <tukon479@gmail.com>
2025-05-04 15:05:24 +08:00
Innei
7a4ee66011 release: v8.1.1 v8.1.1 2025-04-06 23:07:41 +08:00
Innei
c26e9ef0a6 chore: remove unused imports and update TypeScript version
- Removed unused imports `getSessionCookie` and `getSessionFromCtx` from `auth.implement.ts`.
- Updated TypeScript version from 5.8.3 to 5.7.3 in `package.json` and `pnpm-lock.yaml`.

Signed-off-by: Innei <tukon479@gmail.com>
2025-04-06 23:02:57 +08:00
Innei
5bf93975f3 chore: update dependencies and improve auth implementation
- Updated various dependencies in package.json and pnpm-lock.yaml, including:
  - `redis-memory-server` from 0.11.0 to 0.12.1
  - `@sxzz/eslint-config` from 4.6.0 to 6.1.1
  - `@types/node` from 22.13.10 to 22.14.0
  - `eslint` from ^9.17.0 to ^9.24.0
  - `lint-staged` from 15.3.0 to 15.5.0
  - `typescript` from 5.7.3 to 5.8.3
  - Other minor updates across various packages.

- Refactored `CreateAuth` function in `auth.implement.ts` to utilize `createAuthMiddleware` for better session handling.
- Enhanced exports in `auth.ts` to include new utility functions from `better-auth`.

Signed-off-by: Innei <tukon479@gmail.com>
2025-04-06 23:00:39 +08:00
nyaruta
577d5c5401 fix: deploy script (#2409) 2025-04-06 22:21:18 +08:00
indoordiary
e0f511668a fix: mask custom connection string passwords (CLI & env) (#2410) 2025-04-06 22:20:46 +08:00
Innei
96263782d0 fix: lint and fix cache service
Signed-off-by: Innei <tukon479@gmail.com>
2025-04-06 22:18:48 +08:00
nyaruta
128b92cbee fix(gateway/auth): broadcast failure (#2413) 2025-04-06 22:12:10 +08:00
Innei
f70faa2aa4 release: v8.1.0 v8.1.0 2025-03-25 15:39:59 +08:00
Innei
ef2fa7b294 chore: update script 2025-03-25 15:39:35 +08:00
nyaruta
a0ad1a2337 chore(ci): remove useless input (#2404) 2025-03-25 13:38:32 +08:00
nyaruta
539601408f Init (#2405) 2025-03-25 13:38:05 +08:00
nyaruta
4ec4814959 feat: AI antispam (#2406)
* Init

* Fix: add AiModule dependency to CommentModule and inject AiService in CommentService

* Finallize
2025-03-25 13:37:08 +08:00
Innei
2f4600bead release: v8.0.3 v8.0.3 2025-03-23 19:40:13 +08:00
renovate[bot]
511587a617 fix(deps): update nest monorepo to v11.0.12 (#2397)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-20 22:40:35 +00:00
Innei
5b9952c18a fix: ai summary prompt
Signed-off-by: Innei <tukon479@gmail.com>
2025-03-21 00:51:58 +08:00
renovate[bot]
a2b8e23450 chore(deps): update dependency eslint to v9.22.0 (#2401)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-20 15:40:36 +00:00
renovate[bot]
f6d7f0b6d8 fix(deps): update dependency openai to v4.87.4 (#2396)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-20 09:53:48 +00:00
renovate[bot]
ad41ec42bf fix(deps): update dependency axios to v1.8.4 (#2399)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-20 06:05:53 +00:00
renovate[bot]
3cb310008a chore(deps): update dependency @types/express to v5.0.1 (#2398)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-20 02:46:55 +00:00
renovate[bot]
fc028a4989 fix(deps): update dependency @langchain/openai to v0.4.5 (#2395)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-19 22:25:28 +00:00
renovate[bot]
11ea69c3db chore(deps): update pnpm to v9.15.9 (#2394)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-19 18:38:53 +00:00
renovate[bot]
7913d20962 chore(deps): update dependency prettier to v3.5.3 (#2393)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-19 15:32:59 +00:00
renovate[bot]
0bfd90f71d chore(deps): update dependency nanoid to v5.1.5 (#2392)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-19 10:35:56 +00:00
renovate[bot]
1f25eb90cc chore(deps): update dependency mongodb-memory-server to v10.1.4 (#2391)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-19 07:28:08 +00:00
renovate[bot]
c4e9785ffc chore(deps): update dependency axios to v1.8.3 (#2390)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-19 03:24:14 +00:00
renovate[bot]
789b26f84f chore(deps): update dependency @types/node to v22.13.10 (#2389)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-18 23:22:36 +00:00
renovate[bot]
424dd2b7be chore(deps): update dependency @swc/core to v1.11.11 (#2388)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-18 19:28:27 +00:00
renovate[bot]
4822c9d82a chore(deps): update docker/setup-qemu-action action to v3.6.0 (#2373)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-18 23:36:19 +08:00
renovate[bot]
af77b700a5 chore(deps): update pnpm/action-setup action to v4.1.0 (#2356)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-18 23:36:00 +08:00
renovate[bot]
a313c24000 chore(deps): update dependency nanoid to v5.1.4 (#2372)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-18 23:35:49 +08:00
Innei
84286ff62c release: v8.0.2 v8.0.2 2025-03-18 00:04:53 +08:00
renovate[bot]
3e71774e90 chore(deps): update dependency axios to v1.8.2 [security] (#2384)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-17 23:46:20 +08:00
Teror Fox
400d217aac feat: 添加推送到Bing支持 (#2379)
* feat(core): 添加 Bing 搜索推送功能

- 在 errorCode.constant.ts 中添加 Bing 相关的错误代码
- 在 configs.dto.ts 中添加 BingSearchOptionDto 类用于配置 Bing 推送选项
- 在 helper.cron.service.ts 中实现 pushToBingSearch 方法进行 Bing 搜索推送

* feat(core): 添加必应搜索推送配置并优化相关功能

- 在默认配置中添加 bingSearchOptions 项
- 更新 BingSearchOptionDto 类,统一字段命名
- 在 IConfig 接口中添加 bingSearchOptions 字段
- 修改 CronService 中的 pushToBingSearch 方法,适配新配置

* build: 更新下载资源链接

- 将 CDN 下载 URL 从 `https://mirror.ghproxy.com/` 更改为 `https://ghfast.top/`

* feat(api-client): 添加 Bing 搜索配置模型

- 新增 BingSearchOptionsModel 类,用于 Bing 搜索的配置选项
- 该模型包括 enable 和 token 两个属性,与 BaiduSearchOptionsModel 类似

* refactor(configs): 统一配置类命名规则

- 将 BingSearchOptionDto 重命名为 BingSearchOptionsDto,与 BaiduSearchOptionsDto 保持一致
- 更新相关引用和配置字段类型

* feat(core): 添加每日凌晨1点执行的 Bing 搜索推送任务

- 在 CronService 类中添加了 pushToBingSearch 方法
- 使用 @CronOnce 装饰器设置任务执行时间为每天凌晨1点
- 任务名称为 'pushToBingSearch'
- 方法描述为 '推送到Bing'

* chore: 添加.eslintcache到.gitignore

- 在.gitignore文件中添加.eslintcache,避免eslint缓存文件被版本控制

* feat(docs): 更新readme

* refactor(core): 优化 Bing 站长提交日志输出

- 修改了 Bing 站长提交结果的日志输出格式
- 当提交成功时,输出简短的成功日志
- 当提交失败时,仍输出详细的错误信息

* Update apps/core/src/processors/helper/helper.cron.service.ts

Co-authored-by: Innei <tukon479@gmail.com>
Signed-off-by: Teror Fox <i@trfox.top>

* chore: 删除废弃的服务器部署脚本

* feat(core): 添加 Bing API 域名无效错误码

- 在 ErrorCodeEnum 枚举中添加 BingDomainInvalid 错误码
- 在 ErrorCode 对象中添加对应的错误信息和状态码

* refactor(core): 修复 Bing 推送异常时返回值问题

---------

Signed-off-by: Teror Fox <i@trfox.top>
Co-authored-by: Innei <tukon479@gmail.com>
2025-03-17 23:46:05 +08:00