mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 23:18:05 +08:00
feat(trigger): enhance trigger event handling and introduce new debug event polling
- Refactored the `DraftWorkflowTriggerNodeApi` and related services to utilize the new `TriggerService` for polling debug events, improving modularity and clarity. - Added `poll_debug_event` methods in `TriggerService`, `ScheduleService`, and `WebhookService` to streamline event handling for different trigger types. - Introduced `ScheduleDebugEvent` and updated `PluginTriggerDebugEvent` to include a more structured approach for event data. - Enhanced the `invoke_trigger_event` method to improve error handling and data validation during trigger invocations. - Updated frontend API calls to align with the new event structure, removing deprecated parameters for cleaner integration.
This commit is contained in:
@ -381,18 +381,10 @@ const useOneStepRun = <T>({
|
||||
headers.set('Authorization', `Bearer ${accessToken}`)
|
||||
headers.set('Content-Type', 'application/json')
|
||||
|
||||
// Reason: Plugin trigger requires event_name, subscription_id, provider_id from node data
|
||||
const requestBody = {
|
||||
event_name: (data as any).event_name,
|
||||
subscription_id: (data as any).subscription_id,
|
||||
provider_id: (data as any).provider_id,
|
||||
}
|
||||
|
||||
const response = await fetch(urlWithPrefix, {
|
||||
...baseOptions,
|
||||
method: 'POST',
|
||||
headers,
|
||||
body: JSON.stringify(requestBody),
|
||||
signal: controller.signal,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user