Phase 3: Graph view, backlinks, quick switcher, export
- Add outgoing_links (JSON) and backlinks_count to Document model
- POST /documents/{id}/detect-links — detect [[uuid]] patterns in content
- GET /documents/{id}/backlinks — documents referencing this doc
- GET /documents/{id}/outgoing-links — documents this doc references
- GET /documents/{id}/links — combined incoming + outgoing
- GET /projects/{id}/graph — full project relationship graph
- GET /search/quick — fuzzy search (Quick Switcher Cmd+K)
- GET /projects/{id}/documents/search — project-scoped search
- GET /documents/{id}/export — markdown|json export
- GET /projects/{id}/export — json|zip export
- 27 new tests
This commit is contained in:
@@ -16,3 +16,39 @@ class SearchResult(BaseModel):
|
||||
|
||||
class SearchResponse(BaseModel):
|
||||
results: list[SearchResult]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Phase 3: Quick Switcher Schemas (Fuzzy Search)
|
||||
# =============================================================================
|
||||
|
||||
class QuickSwitcherItem(BaseModel):
|
||||
id: str
|
||||
type: str # "document" | "project"
|
||||
title: str
|
||||
subtitle: str | None = None
|
||||
highlight: str | None = None # HTML with <mark> tags
|
||||
icon: str | None = None
|
||||
project_id: str | None = None
|
||||
|
||||
|
||||
class QuickSwitcherResponse(BaseModel):
|
||||
query: str
|
||||
results: list[QuickSwitcherItem]
|
||||
total: int
|
||||
search_type: str = "fuzzy"
|
||||
|
||||
|
||||
class ProjectDocumentSearchItem(BaseModel):
|
||||
document_id: str
|
||||
title: str
|
||||
excerpt: str
|
||||
updated_at: datetime
|
||||
score: float
|
||||
|
||||
|
||||
class ProjectDocumentSearchResponse(BaseModel):
|
||||
project_id: str
|
||||
query: str
|
||||
results: list[ProjectDocumentSearchItem]
|
||||
total: int
|
||||
|
||||
Reference in New Issue
Block a user