- Add `tags: List[str]` field to all 13 entity types (devices, output targets, CSS sources, picture sources, audio sources, value sources, sync clocks, automations, scene presets, capture/audio/PP/pattern templates) - Update all stores, schemas, and route handlers for tag CRUD - Add GET /api/v1/tags endpoint aggregating unique tags across all stores - Create TagInput component with chip display, autocomplete dropdown, keyboard navigation, and API-backed suggestions - Display tag chips on all entity cards (searchable via existing text filter) - Add tag input to all 14 editor modals with dirty check support - Add CSS styles and i18n keys (en/ru/zh) for tag UI - Also includes code review fixes: thread safety, perf, store dedup Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
53 lines
2.3 KiB
Python
53 lines
2.3 KiB
Python
"""Postprocessing template schemas."""
|
|
|
|
from datetime import datetime
|
|
from typing import List, Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from .filters import FilterInstanceSchema
|
|
|
|
|
|
class PostprocessingTemplateCreate(BaseModel):
|
|
"""Request to create a postprocessing template."""
|
|
|
|
name: str = Field(description="Template name", min_length=1, max_length=100)
|
|
filters: List[FilterInstanceSchema] = Field(default_factory=list, description="Ordered list of filter instances")
|
|
description: Optional[str] = Field(None, description="Template description", max_length=500)
|
|
tags: List[str] = Field(default_factory=list, description="User-defined tags")
|
|
|
|
|
|
class PostprocessingTemplateUpdate(BaseModel):
|
|
"""Request to update a postprocessing template."""
|
|
|
|
name: Optional[str] = Field(None, description="Template name", min_length=1, max_length=100)
|
|
filters: Optional[List[FilterInstanceSchema]] = Field(None, description="Ordered list of filter instances")
|
|
description: Optional[str] = Field(None, description="Template description", max_length=500)
|
|
tags: Optional[List[str]] = None
|
|
|
|
|
|
class PostprocessingTemplateResponse(BaseModel):
|
|
"""Postprocessing template information response."""
|
|
|
|
id: str = Field(description="Template ID")
|
|
name: str = Field(description="Template name")
|
|
filters: List[FilterInstanceSchema] = Field(description="Ordered list of filter instances")
|
|
tags: List[str] = Field(default_factory=list, description="User-defined tags")
|
|
created_at: datetime = Field(description="Creation timestamp")
|
|
updated_at: datetime = Field(description="Last update timestamp")
|
|
description: Optional[str] = Field(None, description="Template description")
|
|
|
|
|
|
class PostprocessingTemplateListResponse(BaseModel):
|
|
"""List of postprocessing templates response."""
|
|
|
|
templates: List[PostprocessingTemplateResponse] = Field(description="List of postprocessing templates")
|
|
count: int = Field(description="Number of templates")
|
|
|
|
|
|
class PPTemplateTestRequest(BaseModel):
|
|
"""Request to test a postprocessing template against a source stream."""
|
|
|
|
source_stream_id: str = Field(description="ID of the source picture source to capture from")
|
|
capture_duration: float = Field(default=5.0, ge=1.0, le=30.0, description="Duration to capture in seconds")
|