wrolpi/modules/repos/schema.py
Roland 5c80ad7ba4
repos: search Repos by name and README
repository_fts (FTS5, external content) indexes each Repo's search_name
(name and owner) and readme_text; a name match outranks a README
mention.  The downloader stores the README as plain text (markdown
syntax removed so snippets read well), writing it only when it changed.

* POST /api/repos/search: by search and/or Tag, with README headlines.
* /api/search_other_estimates takes an optional search_str and returns
  repo_count, so Repos count toward the global search's Other tab.
* /api/search_suggestions suggests Repos by name.

The repository FTS DDL is installed only once the repository table
exists: the baseline migration also runs install_raw_ddl, before that
table is created.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:56:09 -06:00

29 lines
676 B
Python

from dataclasses import dataclass, field
from typing import Optional, List
@dataclass
class RepoCreateRequest:
url: str
tag_name: Optional[str] = None
frequency: Optional[int] = None
mode: Optional[str] = None
branch: Optional[str] = None
name: Optional[str] = None
description: Optional[str] = None
@dataclass
class RepoSearchRequest:
search_str: Optional[str] = None
tag_names: List[str] = field(default_factory=list)
limit: int = 20
offset: int = 0
@dataclass
class RepoUpdateRequest:
description: Optional[str] = None
frequency: Optional[int] = None
mode: Optional[str] = None
branch: Optional[str] = None