Files
liumangmang 7adc7c00ab Add remote browser pages and website sync
Enable managed remote browser custom pages with login autofill and add website sync workflows so external admin surfaces can be handled inside SmartUp.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 15:43:58 +08:00

38 lines
949 B
Python

from datetime import datetime
from typing import Optional, List
from pydantic import BaseModel
ALLOWED_EVENTS = ["upstream_rate_changed", "website_rate_changed", "upstream_unhealthy", "upstream_recovered"]
class WebhookCreate(BaseModel):
name: str
type: str = "generic" # generic | dingtalk
url: str
secret: str = ""
enabled: bool = True
events: List[str] = ["upstream_rate_changed", "website_rate_changed"]
class WebhookUpdate(BaseModel):
name: Optional[str] = None
type: Optional[str] = None
url: Optional[str] = None
secret: Optional[str] = None
enabled: Optional[bool] = None
events: Optional[List[str]] = None
class WebhookResponse(BaseModel):
id: int
name: str
type: str
url: str
secret_masked: str # always "***" if set, else ""
enabled: bool
events: List[str]
created_at: datetime
updated_at: datetime
model_config = {"from_attributes": True}