feat: implement IM channel management in agent editor

- Introduced a new IMChannelPanel component for managing WeCom and Feishu channels.
- Added CRUD operations for IM channels, including create, update, delete, and list functionalities.
- Enhanced the backend with new API endpoints for IM channel management.
- Updated documentation to reflect changes in IM integration and channel management.
- Improved localization support for new IM-related UI elements across multiple languages.
This commit is contained in:
wizardchen
2026-03-16 02:23:22 +08:00
parent e5a397faeb
commit 6159e8e3f7
18 changed files with 1571 additions and 518 deletions
+36
View File
@@ -175,3 +175,39 @@ export interface PlaceholdersResponse {
export function getPlaceholders() {
return get<{ data: PlaceholdersResponse }>('/api/v1/agents/placeholders');
}
// ===== IM渠道 =====
export interface IMChannel {
id: string;
tenant_id?: number;
agent_id: string;
platform: 'wecom' | 'feishu';
name: string;
enabled: boolean;
mode: 'webhook' | 'websocket';
output_mode: 'stream' | 'full';
credentials: Record<string, any>;
created_at?: string;
updated_at?: string;
}
export function listIMChannels(agentId: string) {
return get<{ data: IMChannel[] }>(`/api/v1/agents/${agentId}/im-channels`);
}
export function createIMChannel(agentId: string, data: Partial<IMChannel>) {
return post<{ data: IMChannel }>(`/api/v1/agents/${agentId}/im-channels`, data);
}
export function updateIMChannel(id: string, data: Partial<IMChannel>) {
return put<{ data: IMChannel }>(`/api/v1/im-channels/${id}`, data);
}
export function deleteIMChannel(id: string) {
return del<{ success: boolean }>(`/api/v1/im-channels/${id}`);
}
export function toggleIMChannel(id: string) {
return post<{ data: IMChannel }>(`/api/v1/im-channels/${id}/toggle`);
}