feat: introduce payload field to TriggerDispatchResponse and a better typing

This commit is contained in:
Yeuoly 2025-10-18 19:12:43 +08:00
parent a711a8e759
commit d790d2b6bc
1 changed files with 8 additions and 5 deletions

View File

@ -247,9 +247,14 @@ class TriggerInvokeEventResponse(BaseModel):
class PluginTriggerDispatchResponse(BaseModel):
"""
Original response from plugin daemon
"""
user_id: str
events: list[str]
raw_http_response: str
payload: Mapping[str, Any] = Field(default_factory=dict)
class TriggerSubscriptionResponse(BaseModel):
@ -260,12 +265,10 @@ class TriggerValidateProviderCredentialsResponse(BaseModel):
result: bool
class TriggerDispatchResponse:
class TriggerDispatchResponse(BaseModel):
user_id: str
events: list[str]
response: Response
payload: Mapping[str, Any] = Field(default_factory=dict)
def __init__(self, user_id: str, events: list[str], response: Response):
self.user_id = user_id
self.events = events
self.response = response
model_config = ConfigDict(protected_namespaces=(), arbitrary_types_allowed=True)