File size: 988 Bytes
6bff5d9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | """Request / response models for catalog-related routes."""
from datetime import datetime
from pydantic import BaseModel, Field
class CatalogRebuildRequest(BaseModel):
user_id: str
class CatalogRebuildResponse(BaseModel):
user_id: str
sources_rebuilt: int
class CatalogIndexEntry(BaseModel):
"""One row in the per-user catalog index — used by the refresher to decide
which sources to rebuild and by the UI to list registered sources.
"""
source_id: str = Field(..., description="Stable internal source identifier.")
source_type: str = Field(..., description="schema | tabular | unstructured.")
name: str = Field(..., description="Display name (DB name or filename).")
location_ref: str = Field(..., description="URI: dbclient://… or az_blob://…")
table_count: int = Field(..., description="Number of tables/sheets in this source.")
updated_at: datetime = Field(..., description="Last time this source was (re)introspected.")
|