feat(trigger): enhance trigger subscription management and processing

- Refactor trigger provider classes to improve naming consistency and clarity
- Introduce new methods for managing trigger subscriptions, including validation and dispatching
- Update API endpoints to reflect changes in subscription handling
- Implement logging and request management for endpoint interactions
- Enhance data models to support subscription attributes and lifecycle management

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Harry
2025-09-01 12:08:48 +08:00
parent 6acc77d86d
commit 2f08306695
16 changed files with 1630 additions and 101 deletions

View File

@ -143,12 +143,19 @@ class Subscription(BaseModel):
Contains all information needed to manage the subscription lifecycle.
"""
expire_at: int = Field(
expires_at: int = Field(
..., description="The timestamp when the subscription will expire, this for refresh the subscription"
)
metadata: dict[str, Any] = Field(
..., description="Metadata about the subscription in the external service, defined in subscription_schema"
endpoint: str = Field(..., description="The webhook endpoint URL allocated by Dify for receiving events")
parameters: dict[str, Any] | None = Field(
default=None,
description="""The parameters of the subscription, this is the creation parameters.
Only available when creating a new subscription by credentials(auto subscription), not manual subscription""",
)
properties: dict[str, Any] = Field(
..., description="Subscription data containing all properties and provider-specific information"
)