feat(trigger): enhance trigger debugging with polling API and new subscription retrieval

- Refactored DraftWorkflowTriggerNodeApi and DraftWorkflowTriggerRunApi to implement polling for trigger events instead of listening, improving responsiveness and reliability.
- Introduced TriggerSubscriptionBuilderGetApi to retrieve subscription instances for trigger providers, enhancing the API's capabilities.
- Removed deprecated trigger event classes and streamlined event handling in TriggerDebugService, ensuring a cleaner architecture.
- Updated Queue and Stream entities to reflect the changes in trigger event handling, improving overall clarity and maintainability.

These enhancements significantly improve the trigger debugging experience and API usability.
This commit is contained in:
Harry
2025-09-14 19:12:20 +08:00
parent 91e5e33440
commit 76850749e4
11 changed files with 233 additions and 618 deletions

View File

@ -269,15 +269,6 @@ class TriggerInputs(BaseModel):
trigger_name: str
subscription_id: str
@classmethod
def from_trigger_data(cls, trigger_data: TriggerEventData) -> "TriggerInputs":
"""Create from debug event data."""
return cls(
request_id=trigger_data.request_id,
trigger_name=trigger_data.triggers[0] if trigger_data.triggers else "",
subscription_id=trigger_data.subscription_id,
)
@classmethod
def from_trigger_entity(cls, request_id: str, subscription_id: str, trigger: TriggerEntity) -> "TriggerInputs":
"""Create from trigger entity (for production)."""