Refa:migrate agent webhook routes to REST APIs (#14330)

### What problem does this PR solve?

migrate agent webhook routes to REST APIs

### Type of change
- [x] Refactoring
This commit is contained in:
buua436
2026-04-24 17:55:53 +08:00
committed by GitHub
parent b8d831c1c3
commit 9ad752f497
8 changed files with 2256 additions and 840 deletions

View File

@@ -3,6 +3,6 @@ import { useParams } from 'react-router';
export function useBuildWebhookUrl() {
const { id } = useParams();
const text = `${location.protocol}//${location.host}/api/v1/webhook/${id}`;
const text = `${location.protocol}//${location.host}/api/v1/agents/${id}/webhook`;
return text;
}

View File

@@ -28,7 +28,7 @@ enum WebhookTraceTabType {
const WebhookSheet = ({ hideModal }: RunSheetProps) => {
const { t } = useTranslation();
const { id } = useParams();
const text = `${location.protocol}//${location.host}/api/v1/webhook_test/${id}`;
const text = `${location.protocol}//${location.host}/api/v1/agents/${id}/webhook/test`;
const { data } = useFetchWebhookTrace(true);

View File

@@ -211,8 +211,8 @@ export default {
prompt: `${restAPIv1}/agents/prompts`,
cancelDataflow: (id: string) => `${webAPI}/canvas/cancel/${id}`,
downloadFile: `${restAPIv1}/agents/download`,
testWebhook: (id: string) => `${restAPIv1}/webhook_test/${id}`,
fetchWebhookTrace: (id: string) => `${restAPIv1}/webhook_trace/${id}`,
testWebhook: (id: string) => `${restAPIv1}/agents/${id}/webhook/test`,
fetchWebhookTrace: (id: string) => `${restAPIv1}/agents/${id}/webhook/logs`,
// explore