feat(web): Add Feishu and Yuque knowledge base sync support

- Add API endpoints for creating sync tasks and checking Feishu/Yuque authentication
- Add new sync-related UI components for Feishu and Yuque platform integration
- Add internationalization strings for sync operations and authentication messages in English and Chinese
- Add form fields for Feishu (App ID, App Secret, Folder Token) and Yuque (User ID, Token) credentials
- Add web crawler configuration fields (entry URL, max pages, delay, timeout, user agent)
- Add sync status messages (syncing, success, completed, timeout, failed, error states)
- Update CreateDataset component to support new data source types
- Update KnowledgeBase types to include new sync-related properties
- Enable users to synchronize knowledge base content from Feishu and Yuque platforms with proper authentication and error handling
This commit is contained in:
yujiangping
2026-02-06 17:19:56 +08:00
parent 6e0407f404
commit 1eb44defb6
8 changed files with 485 additions and 60 deletions

View File

@@ -220,6 +220,21 @@ export const createDocumentAndUpload = async ( data: any, params: PathQuery) =>
const response = await request.post(`${apiPrefix}/files/customtext`, data, { params } );
return response as any;
};
// web feishu yuque
export const createSync = async (knowledge_id: string) => {
const response = await request.post(`${apiPrefix}/knowledges/${knowledge_id}/sync`);
return response as any;
};
// check feishu
export const checkFeishuSync = async (params: any) => {
const response = await request.get(`${apiPrefix}/knowledges/check/feishu/auth`, undefined, { params });
return response as any;
};
// check yuque
export const checkYuqueSync = async (params: any) => {
const response = await request.get(`${apiPrefix}/knowledges/check/yuque/auth`, undefined, { params });
return response as any;
};
// 更新文档
export const updateDocument = async (id: string, data: KnowledgeBaseDocumentData) => {
const response = await request.put(`${apiPrefix}/documents/${id}`, data);