Commit 3ac40877 by Archer Committed by GitHub

adapt old version config (#7158)

* adapt old version config

* fix: log

* fix: ts

* fix: align openapi output option types

* doc
parent f3404e6a
---
title: 'V4.14.25'
description: 'FastGPT V4.14.25 release notes'
---
## Upgrade Guide
### 1. Update image tags
- Update the fastgpt-app image tag (FastGPT main service): v4.14.25
- Update the fastgpt-pro image tag (FastGPT commercial edition): v4.14.25
## Changes
1. Fixed permission issues for the portal page and chat logs.
---
title: 'V4.14.25'
description: 'FastGPT V4.14.25 更新说明'
---
## 升级指南
### 1. 更新镜像 tag
- 更新 fastgpt-app(fastgpt 主服务) 镜像 tag: v4.14.25
- 更新 fastgpt-pro(fastgpt 商业版) 镜像 tag: v4.14.25
## 变更说明
1. 修复门户页,日志权限问题。
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"title": "4.14.x", "title": "4.14.x",
"description": "", "description": "",
"pages": [ "pages": [
"41425",
"41424", "41424",
"41422", "41422",
"41421", "41421",
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"title": "4.14.x", "title": "4.14.x",
"description": "", "description": "",
"pages": [ "pages": [
"41425",
"41424", "41424",
"41422", "41422",
"41421", "41421",
......
...@@ -130,6 +130,7 @@ description: FastGPT Toc ...@@ -130,6 +130,7 @@ description: FastGPT Toc
- [/en/self-host/upgrading/4-14/41421](/en/self-host/upgrading/4-14/41421) - [/en/self-host/upgrading/4-14/41421](/en/self-host/upgrading/4-14/41421)
- [/en/self-host/upgrading/4-14/41422](/en/self-host/upgrading/4-14/41422) - [/en/self-host/upgrading/4-14/41422](/en/self-host/upgrading/4-14/41422)
- [/en/self-host/upgrading/4-14/41424](/en/self-host/upgrading/4-14/41424) - [/en/self-host/upgrading/4-14/41424](/en/self-host/upgrading/4-14/41424)
- [/en/self-host/upgrading/4-14/41425](/en/self-host/upgrading/4-14/41425)
- [/en/self-host/upgrading/4-14/4143](/en/self-host/upgrading/4-14/4143) - [/en/self-host/upgrading/4-14/4143](/en/self-host/upgrading/4-14/4143)
- [/en/self-host/upgrading/4-14/4144](/en/self-host/upgrading/4-14/4144) - [/en/self-host/upgrading/4-14/4144](/en/self-host/upgrading/4-14/4144)
- [/en/self-host/upgrading/4-14/4145](/en/self-host/upgrading/4-14/4145) - [/en/self-host/upgrading/4-14/4145](/en/self-host/upgrading/4-14/4145)
......
...@@ -132,6 +132,7 @@ description: FastGPT 文档目录 ...@@ -132,6 +132,7 @@ description: FastGPT 文档目录
- [/self-host/upgrading/4-14/41421](/self-host/upgrading/4-14/41421) - [/self-host/upgrading/4-14/41421](/self-host/upgrading/4-14/41421)
- [/self-host/upgrading/4-14/41422](/self-host/upgrading/4-14/41422) - [/self-host/upgrading/4-14/41422](/self-host/upgrading/4-14/41422)
- [/self-host/upgrading/4-14/41424](/self-host/upgrading/4-14/41424) - [/self-host/upgrading/4-14/41424](/self-host/upgrading/4-14/41424)
- [/self-host/upgrading/4-14/41425](/self-host/upgrading/4-14/41425)
- [/self-host/upgrading/4-14/4143](/self-host/upgrading/4-14/4143) - [/self-host/upgrading/4-14/4143](/self-host/upgrading/4-14/4143)
- [/self-host/upgrading/4-14/4144](/self-host/upgrading/4-14/4144) - [/self-host/upgrading/4-14/4144](/self-host/upgrading/4-14/4144)
- [/self-host/upgrading/4-14/4145](/self-host/upgrading/4-14/4145) - [/self-host/upgrading/4-14/4145](/self-host/upgrading/4-14/4145)
......
...@@ -21,8 +21,10 @@ ...@@ -21,8 +21,10 @@
"content/guide/build/publish/dingtalk.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/publish/dingtalk.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/publish/feishu.en.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/publish/feishu.en.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/publish/feishu.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/publish/feishu.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/publish/mcp_server.en.mdx": "2026-06-21T22:52:47+08:00", "content/guide/build/publish/link.en.mdx": "2026-06-22T11:01:59+08:00",
"content/guide/build/publish/mcp_server.mdx": "2026-06-21T22:52:47+08:00", "content/guide/build/publish/link.mdx": "2026-06-22T11:01:59+08:00",
"content/guide/build/publish/mcp_server.en.mdx": "2026-06-22T11:01:59+08:00",
"content/guide/build/publish/mcp_server.mdx": "2026-06-22T11:01:59+08:00",
"content/guide/build/publish/official_account.en.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/publish/official_account.en.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/publish/official_account.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/publish/official_account.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/publish/openapi.en.mdx": "2026-06-18T10:43:42+08:00", "content/guide/build/publish/openapi.en.mdx": "2026-06-18T10:43:42+08:00",
...@@ -43,8 +45,8 @@ ...@@ -43,8 +45,8 @@
"content/guide/build/tools/mcp_tools.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/tools/mcp_tools.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/tools/system-plugins/upload_system_tool.en.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/tools/system-plugins/upload_system_tool.en.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/tools/system-plugins/upload_system_tool.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/tools/system-plugins/upload_system_tool.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/intro.en.mdx": "2026-06-21T22:52:47+08:00", "content/guide/build/workflow/intro.en.mdx": "2026-06-22T11:01:59+08:00",
"content/guide/build/workflow/intro.mdx": "2026-06-21T22:52:47+08:00", "content/guide/build/workflow/intro.mdx": "2026-06-22T11:01:59+08:00",
"content/guide/build/workflow/nodes/ai_chat.en.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/ai_chat.en.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/nodes/ai_chat.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/ai_chat.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/nodes/content_extract.en.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/content_extract.en.mdx": "2026-05-07T15:06:40+08:00",
...@@ -59,8 +61,8 @@ ...@@ -59,8 +61,8 @@
"content/guide/build/workflow/nodes/document_parsing.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/document_parsing.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/nodes/form_input.en.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/form_input.en.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/nodes/form_input.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/form_input.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/nodes/http.en.mdx": "2026-06-21T22:52:47+08:00", "content/guide/build/workflow/nodes/http.en.mdx": "2026-06-22T11:01:59+08:00",
"content/guide/build/workflow/nodes/http.mdx": "2026-06-21T22:52:47+08:00", "content/guide/build/workflow/nodes/http.mdx": "2026-06-22T11:01:59+08:00",
"content/guide/build/workflow/nodes/knowledge_base_search_merge.en.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/knowledge_base_search_merge.en.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/nodes/knowledge_base_search_merge.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/knowledge_base_search_merge.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/nodes/loop.en.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/loop.en.mdx": "2026-05-07T15:06:40+08:00",
...@@ -69,8 +71,8 @@ ...@@ -69,8 +71,8 @@
"content/guide/build/workflow/nodes/loop_run.mdx": "2026-06-12T00:30:58+08:00", "content/guide/build/workflow/nodes/loop_run.mdx": "2026-06-12T00:30:58+08:00",
"content/guide/build/workflow/nodes/parallel_run.en.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/parallel_run.en.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/nodes/parallel_run.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/parallel_run.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/nodes/question_classify.en.mdx": "2026-06-21T22:52:47+08:00", "content/guide/build/workflow/nodes/question_classify.en.mdx": "2026-06-22T11:01:59+08:00",
"content/guide/build/workflow/nodes/question_classify.mdx": "2026-06-21T22:52:47+08:00", "content/guide/build/workflow/nodes/question_classify.mdx": "2026-06-22T11:01:59+08:00",
"content/guide/build/workflow/nodes/reply.en.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/reply.en.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/nodes/reply.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/reply.mdx": "2026-05-07T15:06:40+08:00",
"content/guide/build/workflow/nodes/sandbox-v2.en.mdx": "2026-05-07T15:06:40+08:00", "content/guide/build/workflow/nodes/sandbox-v2.en.mdx": "2026-05-07T15:06:40+08:00",
...@@ -153,10 +155,10 @@ ...@@ -153,10 +155,10 @@
"content/plugin/model-presets.mdx": "2026-06-04T16:10:15+08:00", "content/plugin/model-presets.mdx": "2026-06-04T16:10:15+08:00",
"content/plugin/system-tool-development.en.mdx": "2026-06-09T16:03:58+08:00", "content/plugin/system-tool-development.en.mdx": "2026-06-09T16:03:58+08:00",
"content/plugin/system-tool-development.mdx": "2026-06-09T16:03:58+08:00", "content/plugin/system-tool-development.mdx": "2026-06-09T16:03:58+08:00",
"content/self-host/config/env.en.mdx": "2026-06-22T10:22:41+08:00", "content/self-host/config/env.en.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/config/env.mdx": "2026-06-22T10:22:41+08:00", "content/self-host/config/env.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/config/json.en.mdx": "2026-06-21T22:52:47+08:00", "content/self-host/config/json.en.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/config/json.mdx": "2026-06-21T22:52:47+08:00", "content/self-host/config/json.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/config/model/intro.en.mdx": "2026-06-04T16:10:15+08:00", "content/self-host/config/model/intro.en.mdx": "2026-06-04T16:10:15+08:00",
"content/self-host/config/model/intro.mdx": "2026-06-04T16:10:15+08:00", "content/self-host/config/model/intro.mdx": "2026-06-04T16:10:15+08:00",
"content/self-host/config/model/minimax.en.mdx": "2026-06-03T10:40:17+08:00", "content/self-host/config/model/minimax.en.mdx": "2026-06-03T10:40:17+08:00",
...@@ -169,11 +171,11 @@ ...@@ -169,11 +171,11 @@
"content/self-host/config/signoz.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/config/signoz.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/custom-models/bge-rerank.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/custom-models/bge-rerank.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/custom-models/bge-rerank.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/custom-models/bge-rerank.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/custom-models/chatglm2-m3e.en.mdx": "2026-06-21T22:52:47+08:00", "content/self-host/custom-models/chatglm2-m3e.en.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/custom-models/chatglm2-m3e.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/custom-models/chatglm2-m3e.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/custom-models/chatglm2.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/custom-models/chatglm2.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/custom-models/chatglm2.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/custom-models/chatglm2.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/custom-models/m3e.en.mdx": "2026-06-21T22:52:47+08:00", "content/self-host/custom-models/m3e.en.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/custom-models/m3e.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/custom-models/m3e.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/custom-models/marker.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/custom-models/marker.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/custom-models/marker.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/custom-models/marker.mdx": "2026-04-26T21:08:47+08:00",
...@@ -273,8 +275,9 @@ ...@@ -273,8 +275,9 @@
"content/self-host/upgrading/4-14/41481.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/4-14/41481.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/4-14/4149.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/4-14/4149.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/4-14/4149.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/4-14/4149.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/4-15/41500.en.mdx": "2026-06-22T10:22:41+08:00", "content/self-host/upgrading/4-15/41500.en.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/4-15/41500.mdx": "2026-06-22T10:22:41+08:00", "content/self-host/upgrading/4-15/41500.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/4-15/41501.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/4-15/41502.en.mdx": "2026-05-25T11:21:30+08:00", "content/self-host/upgrading/4-15/41502.en.mdx": "2026-05-25T11:21:30+08:00",
"content/self-host/upgrading/4-15/41502.mdx": "2026-05-25T11:21:30+08:00", "content/self-host/upgrading/4-15/41502.mdx": "2026-05-25T11:21:30+08:00",
"content/self-host/upgrading/4-15/41503.en.mdx": "2026-05-28T16:21:09+08:00", "content/self-host/upgrading/4-15/41503.en.mdx": "2026-05-28T16:21:09+08:00",
...@@ -282,7 +285,7 @@ ...@@ -282,7 +285,7 @@
"content/self-host/upgrading/4-15/41504.en.mdx": "2026-06-10T19:02:59+08:00", "content/self-host/upgrading/4-15/41504.en.mdx": "2026-06-10T19:02:59+08:00",
"content/self-host/upgrading/4-15/41504.mdx": "2026-06-15T23:34:43+08:00", "content/self-host/upgrading/4-15/41504.mdx": "2026-06-15T23:34:43+08:00",
"content/self-host/upgrading/4-15/41505.en.mdx": "2026-06-12T20:47:04+08:00", "content/self-host/upgrading/4-15/41505.en.mdx": "2026-06-12T20:47:04+08:00",
"content/self-host/upgrading/4-15/41505.mdx": "2026-06-21T22:52:47+08:00", "content/self-host/upgrading/4-15/41505.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/outdated/40.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/40.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/40.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/40.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/41.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/41.en.mdx": "2026-04-26T21:08:47+08:00",
...@@ -327,8 +330,8 @@ ...@@ -327,8 +330,8 @@
"content/self-host/upgrading/outdated/462.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/462.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/463.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/463.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/463.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/463.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/464.en.mdx": "2026-05-07T15:06:40+08:00", "content/self-host/upgrading/outdated/464.en.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/outdated/464.mdx": "2026-05-07T15:06:40+08:00", "content/self-host/upgrading/outdated/464.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/outdated/465.en.mdx": "2026-05-07T15:06:40+08:00", "content/self-host/upgrading/outdated/465.en.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/outdated/465.mdx": "2026-05-07T15:06:40+08:00", "content/self-host/upgrading/outdated/465.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/outdated/466.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/466.en.mdx": "2026-04-26T21:08:47+08:00",
...@@ -337,8 +340,8 @@ ...@@ -337,8 +340,8 @@
"content/self-host/upgrading/outdated/467.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/467.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/468.en.mdx": "2026-05-07T15:06:40+08:00", "content/self-host/upgrading/outdated/468.en.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/outdated/468.mdx": "2026-05-07T15:06:40+08:00", "content/self-host/upgrading/outdated/468.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/outdated/469.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/469.en.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/outdated/469.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/469.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/outdated/47.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/47.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/47.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/47.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/471.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/outdated/471.en.mdx": "2026-04-26T21:08:47+08:00",
...@@ -423,6 +426,6 @@ ...@@ -423,6 +426,6 @@
"content/self-host/upgrading/outdated/499.mdx": "2026-05-07T15:06:40+08:00", "content/self-host/upgrading/outdated/499.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/upgrade-intruction.en.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/upgrade-intruction.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/upgrade-intruction.mdx": "2026-04-26T21:08:47+08:00", "content/self-host/upgrading/upgrade-intruction.mdx": "2026-04-26T21:08:47+08:00",
"content/toc.en.mdx": "2026-06-22T10:22:41+08:00", "content/toc.en.mdx": "2026-06-22T11:01:59+08:00",
"content/toc.mdx": "2026-06-22T10:22:41+08:00" "content/toc.mdx": "2026-06-22T11:01:59+08:00"
} }
\ No newline at end of file
...@@ -59,14 +59,73 @@ export const OpenAPIAppScheduledTriggerConfigSchema = z ...@@ -59,14 +59,73 @@ export const OpenAPIAppScheduledTriggerConfigSchema = z
description: '应用定时触发配置' description: '应用定时触发配置'
}); });
const OpenAPIVariableItemSchema = VariableItemTypeSchema.meta({ const OpenAPIAppQGConfigSchema = z.object({
description: '应用对话变量配置项' open: BoolSchema.meta({
description: '是否开启问题引导'
}),
model: z.string().optional().meta({
description: '生成问题引导时使用的模型'
}),
customPrompt: z.string().optional().meta({
description: '生成问题引导时追加的自定义提示词'
})
}); });
const OpenAPIVariableItemSchema = VariableItemTypeSchema.omit({
list: true,
enums: true
})
.extend({
// 运行时 schema 会通过 transform 为旧版选项补齐 label;OpenAPI 响应 schema 不能包含 transform。
list: z
.array(
z.object({
label: z.string().meta({
description: '变量选项展示名称'
}),
value: z.string().meta({
description: '变量选项实际值'
}),
icon: z.string().optional().meta({
description: '变量选项图标'
}),
description: z.string().optional().meta({
description: '变量选项说明'
})
})
)
.optional()
.meta({
description: '选择类变量的可选项'
}),
enums: z
.array(
z.object({
value: z.string().meta({
description: '枚举项实际值'
}),
label: z.string().meta({
description: '枚举项展示名称'
})
})
)
.optional()
.meta({
description: '已废弃:旧版枚举变量选项',
deprecated: true
})
})
.meta({
description: '应用对话变量配置项'
});
export const OpenAPIAppChatConfigSchema = AppChatConfigTypeSchema.extend({ export const OpenAPIAppChatConfigSchema = AppChatConfigTypeSchema.extend({
variables: z.array(OpenAPIVariableItemSchema).optional().meta({ variables: z.array(OpenAPIVariableItemSchema).optional().meta({
description: '应用启动对话前需要用户填写的变量列表' description: '应用启动对话前需要用户填写的变量列表'
}), }),
questionGuide: OpenAPIAppQGConfigSchema.optional().meta({
description: '问题引导配置'
}),
scheduledTriggerConfig: OpenAPIAppScheduledTriggerConfigSchema.optional().meta({ scheduledTriggerConfig: OpenAPIAppScheduledTriggerConfigSchema.optional().meta({
description: '定时触发配置' description: '定时触发配置'
}) })
......
...@@ -3,7 +3,10 @@ import { ...@@ -3,7 +3,10 @@ import {
FlowNodeTemplateTypeSchema, FlowNodeTemplateTypeSchema,
NodeTemplateListItemTypeSchema NodeTemplateListItemTypeSchema
} from '../../../../core/workflow/type/node'; } from '../../../../core/workflow/type/node';
import { OpenAPIFlowNodeOutputItemTypeSchema } from '../../workflow/node'; import {
OpenAPIFlowNodeInputItemTypeSchema,
OpenAPIFlowNodeOutputItemTypeSchema
} from '../../workflow/node';
import { BoolSchema } from '../../../../common/zod'; import { BoolSchema } from '../../../../common/zod';
const ToolNodeTemplateListItemSchema = NodeTemplateListItemTypeSchema.extend({ const ToolNodeTemplateListItemSchema = NodeTemplateListItemTypeSchema.extend({
...@@ -13,8 +16,10 @@ const ToolNodeTemplateListItemSchema = NodeTemplateListItemTypeSchema.extend({ ...@@ -13,8 +16,10 @@ const ToolNodeTemplateListItemSchema = NodeTemplateListItemTypeSchema.extend({
}).catchall(z.any()); }).catchall(z.any());
const ToolPreviewNodeResponseSchema = FlowNodeTemplateTypeSchema.omit({ const ToolPreviewNodeResponseSchema = FlowNodeTemplateTypeSchema.omit({
inputs: true,
outputs: true outputs: true
}).extend({ }).extend({
inputs: z.array(OpenAPIFlowNodeInputItemTypeSchema),
outputs: z.array(OpenAPIFlowNodeOutputItemTypeSchema) outputs: z.array(OpenAPIFlowNodeOutputItemTypeSchema)
}); });
......
...@@ -2,11 +2,12 @@ import z from 'zod'; ...@@ -2,11 +2,12 @@ import z from 'zod';
import { ObjectIdSchema } from '../../../../common/type/mongo'; import { ObjectIdSchema } from '../../../../common/type/mongo';
import { ChatCompletionMessageParamSchema } from '../../../../core/ai/llm/type'; import { ChatCompletionMessageParamSchema } from '../../../../core/ai/llm/type';
import { getNanoid } from '../../../../common/string/tools'; import { getNanoid } from '../../../../common/string/tools';
import { AppChatConfigTypeSchema, AppSchemaTypeSchema } from '../../../../core/app/type'; import { AppSchemaTypeSchema } from '../../../../core/app/type';
import { AuthUserTypeEnum } from '../../../../support/permission/constant'; import { AuthUserTypeEnum } from '../../../../support/permission/constant';
import { OutLinkChatAuthSchema } from '../../../../support/permission/chat'; import { OutLinkChatAuthSchema } from '../../../../support/permission/chat';
import { StoreEdgeItemTypeSchema } from '../../../../core/workflow/type/edge'; import { StoreEdgeItemTypeSchema } from '../../../../core/workflow/type/edge';
import { OpenAPIStoreNodeItemTypeSchema } from '../../workflow/node'; import { OpenAPIStoreNodeItemTypeSchema } from '../../workflow/node';
import { OpenAPIAppChatConfigSchema } from '../../app/common/api';
const nullishToUndefined = <T extends z.ZodTypeAny>(schema: T) => const nullishToUndefined = <T extends z.ZodTypeAny>(schema: T) =>
z.preprocess((v) => v ?? undefined, schema); z.preprocess((v) => v ?? undefined, schema);
...@@ -163,7 +164,7 @@ export const ChatTestPropsSchema = z.object({ ...@@ -163,7 +164,7 @@ export const ChatTestPropsSchema = z.object({
.meta({ description: '自定义响应的 assistant 的消息 ID,如果不传入,则自动生成一个' }), .meta({ description: '自定义响应的 assistant 的消息 ID,如果不传入,则自动生成一个' }),
nodes: z.array(OpenAPIStoreNodeItemTypeSchema).meta({ description: '节点列表' }), nodes: z.array(OpenAPIStoreNodeItemTypeSchema).meta({ description: '节点列表' }),
edges: z.array(StoreEdgeItemTypeSchema).meta({ description: '边列表' }), edges: z.array(StoreEdgeItemTypeSchema).meta({ description: '边列表' }),
chatConfig: AppChatConfigTypeSchema.meta({ description: '聊天配置' }), chatConfig: OpenAPIAppChatConfigSchema.meta({ description: '聊天配置' }),
variables: nullishToUndefined(z.record(z.string(), z.any()).default({})).meta({ variables: nullishToUndefined(z.record(z.string(), z.any()).default({})).meta({
description: '全局变量或插件输入' description: '全局变量或插件输入'
}), }),
......
import { OutLinkChatAuthSchema } from '../../../../support/permission/chat'; import { OutLinkChatAuthSchema } from '../../../../support/permission/chat';
import { ObjectIdSchema } from '../../../../common/type/mongo'; import { ObjectIdSchema } from '../../../../common/type/mongo';
import z from 'zod'; import z from 'zod';
import { AppChatConfigTypeSchema } from '../../../../core/app/type';
import { AppTypeEnum } from '../../../../core/app/constants'; import { AppTypeEnum } from '../../../../core/app/constants';
import { FlowNodeInputItemTypeSchema } from '../../../../core/workflow/type/io';
import { ChatGenerateStatusEnum } from '../../../../core/chat/constants'; import { ChatGenerateStatusEnum } from '../../../../core/chat/constants';
import { OpenAPIFlowNodeInputItemTypeSchema } from '../../workflow/node';
import { OpenAPIAppChatConfigSchema } from '../../app/common/api';
/* Init */ /* Init */
// Online chat // Online chat
...@@ -42,14 +42,14 @@ export const InitChatResponseSchema = z.object({ ...@@ -42,14 +42,14 @@ export const InitChatResponseSchema = z.object({
hasBeenRead: z.boolean().optional().describe('是否已读'), hasBeenRead: z.boolean().optional().describe('是否已读'),
app: z app: z
.object({ .object({
chatConfig: AppChatConfigTypeSchema.optional().describe('聊天配置'), chatConfig: OpenAPIAppChatConfigSchema.optional().describe('聊天配置'),
chatModels: z.array(z.string()).optional().describe('聊天模型'), chatModels: z.array(z.string()).optional().describe('聊天模型'),
name: z.string().min(1).describe('应用名称'), name: z.string().min(1).describe('应用名称'),
avatar: z.string().describe('应用头像'), avatar: z.string().describe('应用头像'),
intro: z.string().describe('应用简介'), intro: z.string().describe('应用简介'),
canUse: z.boolean().optional().describe('是否可用'), canUse: z.boolean().optional().describe('是否可用'),
type: z.enum(AppTypeEnum).describe('应用类型'), type: z.enum(AppTypeEnum).describe('应用类型'),
pluginInputs: z.array(FlowNodeInputItemTypeSchema).describe('插件输入'), pluginInputs: z.array(OpenAPIFlowNodeInputItemTypeSchema).describe('插件输入'),
useAgentSandbox: z.boolean().optional().describe('是否使用虚拟机') useAgentSandbox: z.boolean().optional().describe('是否使用虚拟机')
}) })
.describe('应用配置') .describe('应用配置')
......
...@@ -10,9 +10,53 @@ import { ...@@ -10,9 +10,53 @@ import {
} from '../../../core/workflow/type/node'; } from '../../../core/workflow/type/node';
import { BoolSchema, NumSchema } from '../../../common/zod'; import { BoolSchema, NumSchema } from '../../../common/zod';
const OpenAPIFlowNodeInputItemTypeSchema = FlowNodeInputItemTypeSchema.meta({ export const OpenAPIFlowNodeInputItemTypeSchema = FlowNodeInputItemTypeSchema.omit({
description: '工作流节点输入配置' list: true,
}); enums: true
})
.extend({
// 运行时 schema 会通过 transform 为旧版选项补齐 label;OpenAPI 响应 schema 不能包含 transform。
list: z
.array(
z.object({
label: z.string().meta({
description: '变量选项展示名称'
}),
value: z.string().meta({
description: '变量选项实际值'
}),
icon: z.string().optional().meta({
description: '变量选项图标'
}),
description: z.string().optional().meta({
description: '变量选项说明'
})
})
)
.optional()
.meta({
description: '选择类变量的可选项'
}),
enums: z
.array(
z.object({
value: z.string().meta({
description: '枚举项实际值'
}),
label: z.string().meta({
description: '枚举项展示名称'
})
})
)
.optional()
.meta({
description: '已废弃:旧版枚举变量选项',
deprecated: true
})
})
.meta({
description: '工作流节点输入配置'
});
// `invalidCondition` in FlowNodeOutputItemTypeSchema is a Zod function schema used only // `invalidCondition` in FlowNodeOutputItemTypeSchema is a Zod function schema used only
// by the editor to validate outputs; function schemas cannot be represented in JSON // by the editor to validate outputs; function schemas cannot be represented in JSON
......
...@@ -15,7 +15,10 @@ import { type PermissionValueType } from '@fastgpt/global/support/permission/typ ...@@ -15,7 +15,10 @@ import { type PermissionValueType } from '@fastgpt/global/support/permission/typ
import { AppFolderTypeList, AppTypeEnum } from '@fastgpt/global/core/app/constants'; import { AppFolderTypeList, AppTypeEnum } from '@fastgpt/global/core/app/constants';
import { type ParentIdType } from '@fastgpt/global/common/parentFolder/type'; import { type ParentIdType } from '@fastgpt/global/common/parentFolder/type';
import { type AuthModeType, type AuthResponseType } from '../type'; import { type AuthModeType, type AuthResponseType } from '../type';
import { AppReadChatLogPerVal } from '@fastgpt/global/support/permission/app/constant'; import {
AppReadChatLogPerVal,
AppReadChatLogRoleVal
} from '@fastgpt/global/support/permission/app/constant';
import { parseHeaderCert } from '../auth/common'; import { parseHeaderCert } from '../auth/common';
import { sumPer } from '@fastgpt/global/support/permission/utils'; import { sumPer } from '@fastgpt/global/support/permission/utils';
...@@ -80,7 +83,10 @@ export const authAppByTmbId = async ({ ...@@ -80,7 +83,10 @@ export const authAppByTmbId = async ({
return { return {
...app, ...app,
permission: new AppPermission({ isOwner: false, role: ReadRoleVal }) permission: new AppPermission({
isOwner: false,
role: sumPer(ReadRoleVal, AppReadChatLogRoleVal)
})
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment