- 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>
63 lines
2.7 KiB
Python
63 lines
2.7 KiB
Python
"""Audio capture template and engine schemas."""
|
|
|
|
from datetime import datetime
|
|
from typing import Dict, List, Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class AudioTemplateCreate(BaseModel):
|
|
"""Request to create an audio capture template."""
|
|
|
|
name: str = Field(description="Template name", min_length=1, max_length=100)
|
|
engine_type: str = Field(description="Audio engine type (e.g., 'wasapi', 'sounddevice')", min_length=1)
|
|
engine_config: Dict = Field(default_factory=dict, description="Engine-specific configuration")
|
|
description: Optional[str] = Field(None, description="Template description", max_length=500)
|
|
tags: List[str] = Field(default_factory=list, description="User-defined tags")
|
|
|
|
|
|
class AudioTemplateUpdate(BaseModel):
|
|
"""Request to update an audio template."""
|
|
|
|
name: Optional[str] = Field(None, description="Template name", min_length=1, max_length=100)
|
|
engine_type: Optional[str] = Field(None, description="Audio engine type")
|
|
engine_config: Optional[Dict] = Field(None, description="Engine-specific configuration")
|
|
description: Optional[str] = Field(None, description="Template description", max_length=500)
|
|
tags: Optional[List[str]] = None
|
|
|
|
|
|
class AudioTemplateResponse(BaseModel):
|
|
"""Audio template information response."""
|
|
|
|
id: str = Field(description="Template ID")
|
|
name: str = Field(description="Template name")
|
|
engine_type: str = Field(description="Engine type identifier")
|
|
engine_config: Dict = Field(description="Engine-specific configuration")
|
|
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 AudioTemplateListResponse(BaseModel):
|
|
"""List of audio templates response."""
|
|
|
|
templates: List[AudioTemplateResponse] = Field(description="List of audio templates")
|
|
count: int = Field(description="Number of templates")
|
|
|
|
|
|
class AudioEngineInfo(BaseModel):
|
|
"""Audio capture engine information."""
|
|
|
|
type: str = Field(description="Engine type identifier (e.g., 'wasapi', 'sounddevice')")
|
|
name: str = Field(description="Human-readable engine name")
|
|
default_config: Dict = Field(description="Default configuration for this engine")
|
|
available: bool = Field(description="Whether engine is available on this system")
|
|
|
|
|
|
class AudioEngineListResponse(BaseModel):
|
|
"""List of audio engines response."""
|
|
|
|
engines: List[AudioEngineInfo] = Field(description="Available audio engines")
|
|
count: int = Field(description="Number of engines")
|