feat(trigger): refactor trigger debug event handling and improve response structures

- Renamed and refactored trigger debug event classes to enhance clarity and consistency, including changes from `TriggerDebugEventData` to `TriggerEventData` and related response classes.
- Updated `DraftWorkflowTriggerNodeApi` and `DraftWorkflowTriggerRunApi` to utilize the new event structures, improving the handling of trigger events.
- Removed the `TriggerDebugEventGenerator` class, consolidating event generation directly within the API logic for streamlined processing.
- Enhanced error handling and response formatting for trigger events, ensuring structured outputs for better integration and debugging.

This refactor improves the overall architecture of trigger debugging, making it more intuitive and maintainable.
This commit is contained in:
Harry
2025-09-11 16:55:38 +08:00
parent c3ebb22a4b
commit 57c0bc9fb6
9 changed files with 102 additions and 176 deletions

View File

@ -8,7 +8,7 @@ from sqlalchemy.orm import Session
from core.plugin.entities.plugin import TriggerProviderID
from core.plugin.utils.http_parser import serialize_request
from core.trigger.entities.entities import TriggerDebugEventData, TriggerEntity, TriggerInputs
from core.trigger.entities.entities import TriggerEntity, TriggerEventData, TriggerInputs
from core.trigger.trigger_manager import TriggerManager
from extensions.ext_database import db
from extensions.ext_storage import storage
@ -133,7 +133,7 @@ class TriggerService:
"""
try:
# Prepare streamlined event data using Pydantic model
debug_data = TriggerDebugEventData(
debug_data = TriggerEventData(
subscription_id=subscription_id,
triggers=triggers,
request_id=request_id,