feat: content provenance and complete frame management workflows
This commit is contained in:
@@ -346,3 +346,47 @@ class Reconciliation(BaseModel):
|
||||
expected_image_id: int | None
|
||||
cloud_images: list[GalleryImage]
|
||||
resolved: bool
|
||||
|
||||
|
||||
class CurrentDisplay(BaseModel):
|
||||
device_id: str
|
||||
image_id: int | None
|
||||
synced: bool
|
||||
source_known: bool
|
||||
source: dict[str, Any] | None
|
||||
asset_id: str | None
|
||||
operation_id: str | None
|
||||
preview_url: str | None
|
||||
previous_image_id: int | None
|
||||
overrides: list[dict[str, Any]]
|
||||
|
||||
|
||||
class WeatherConfig(StrictModel):
|
||||
provider: Literal["mock", "open-meteo"] = "mock"
|
||||
location: str = Field(
|
||||
default="示例地点 / Shanghai Jinshan", min_length=1, max_length=120
|
||||
)
|
||||
latitude: float = Field(default=30.74, ge=-90, le=90)
|
||||
longitude: float = Field(default=121.34, ge=-180, le=180)
|
||||
|
||||
|
||||
class WeatherView(BaseModel):
|
||||
config: WeatherConfig
|
||||
current: dict[str, Any]
|
||||
forecast: list[dict[str, Any]]
|
||||
|
||||
|
||||
class ImageURLConfig(StrictModel):
|
||||
allowed_hosts: list[str] = Field(default_factory=list, max_length=30)
|
||||
|
||||
@model_validator(mode="after")
|
||||
def hosts(self):
|
||||
import re
|
||||
|
||||
if any(
|
||||
not re.fullmatch(r"[a-zA-Z0-9](?:[a-zA-Z0-9.-]{0,251}[a-zA-Z0-9])?", h)
|
||||
for h in self.allowed_hosts
|
||||
):
|
||||
raise ValueError("Use hostnames only, without URLs or wildcards")
|
||||
self.allowed_hosts = sorted(set(h.lower() for h in self.allowed_hosts))
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user