mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 08:58:09 +08:00
feat(trigger): enhance subscription schema and provider configuration
- Update ProviderConfig to allow a list as a default value - Introduce SubscriptionSchema for better organization of subscription-related configurations - Modify TriggerProviderApiEntity to use Optional for subscription_schema - Add custom_model_schema to TriggerProviderEntity for additional configuration options Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@ -99,6 +99,20 @@ class OAuthSchema(BaseModel):
|
||||
default_factory=list, description="The schema of the OAuth credentials"
|
||||
)
|
||||
|
||||
class SubscriptionSchema(BaseModel):
|
||||
"""
|
||||
The subscription schema of the trigger provider
|
||||
"""
|
||||
|
||||
parameters_schema: list[ProviderConfig] | None = Field(
|
||||
default_factory=list,
|
||||
description="The parameters schema required to create a subscription",
|
||||
)
|
||||
|
||||
properties_schema: list[ProviderConfig] | None = Field(
|
||||
default_factory=list,
|
||||
description="The configuration schema stored in the subscription entity",
|
||||
)
|
||||
|
||||
class TriggerProviderEntity(BaseModel):
|
||||
"""
|
||||
@ -114,8 +128,7 @@ class TriggerProviderEntity(BaseModel):
|
||||
default=None,
|
||||
description="The OAuth schema of the trigger provider if OAuth is supported",
|
||||
)
|
||||
subscription_schema: list[ProviderConfig] = Field(
|
||||
default_factory=list,
|
||||
subscription_schema: SubscriptionSchema = Field(
|
||||
description="The subscription schema for trigger(webhook, polling, etc.) subscription parameters",
|
||||
)
|
||||
triggers: list[TriggerEntity] = Field(default=[], description="The triggers of the trigger provider")
|
||||
|
||||
Reference in New Issue
Block a user