All checks were successful
CD / Build and push images (push) Successful in 4m0s
CD / Deploy to Test (push) Successful in 9s
CI / Lint, typecheck, test (push) Successful in 4m21s
CI / Build container images (push) Has been skipped
CD / Smoke tests against Test (push) Successful in 1m16s
CD / Promote to Int (push) Successful in 11s
CI / Auth e2e pack (push) Successful in 5m41s
CI / Import/export fidelity gate (push) Successful in 47s
GET /ponds/:pondId/links returns the caller's readable slice of the wikilink graph in one read: nodes (id, title, slug, labelIds for the coloring), resolved edges deduplicated per direction (a rename can leave several slugs pointing at one target), and phantom targets with their referrer ids. An edge survives only when both endpoints are readable; a phantom disappears entirely once its last readable referrer is filtered — a hidden page's existence never leaks through any of the three collections. Trashed pages and their links are excluded. Shared PondGraphView types feed the knowledge-graph views (#112/#113). DB tests cover the owner's full graph, the label-DENY reader slice, edge dedup, trash exclusion, and labelIds on nodes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
55 lines
1.6 KiB
TypeScript
55 lines
1.6 KiB
TypeScript
/**
|
|
* Wikilink index views shared between api and web (issue #47/#48). The index
|
|
* (`page_links`) is maintained on every content change; these are the read
|
|
* shapes for the backlinks panel and the pond's missing-pages view.
|
|
*/
|
|
|
|
/** A page that links to the page being viewed (its backlink). */
|
|
export interface BacklinkView {
|
|
pageId: string;
|
|
title: string;
|
|
slug: string;
|
|
/** A short plain-text preview of the linking page, for context (#48). */
|
|
snippet: string;
|
|
}
|
|
|
|
/** A referenced-but-missing target and the pages that link to it. */
|
|
export interface PhantomLinkView {
|
|
targetSlug: string;
|
|
referencedBy: BacklinkView[];
|
|
}
|
|
|
|
/**
|
|
* The pond's readable wikilink graph (issue #111, `GET /ponds/:id/links`):
|
|
* nodes are the caller-readable pages, edges the resolved wikilinks whose
|
|
* BOTH endpoints are readable, and phantoms the missing targets with their
|
|
* readable referrers — an unreadable page's existence never leaks through
|
|
* any of the three collections. Consumed by the knowledge-graph views
|
|
* (#112/#113).
|
|
*/
|
|
export interface GraphNodeView {
|
|
id: string;
|
|
title: string;
|
|
slug: string;
|
|
/** For label-based node coloring; resolved via the pond's label tree. */
|
|
labelIds: string[];
|
|
}
|
|
|
|
/** One resolved wikilink, by page ids (deduplicated per direction). */
|
|
export interface GraphEdgeView {
|
|
from: string;
|
|
to: string;
|
|
}
|
|
|
|
/** A phantom target with the node ids that reference it. */
|
|
export interface GraphPhantomView {
|
|
targetSlug: string;
|
|
referencedBy: string[];
|
|
}
|
|
|
|
export interface PondGraphView {
|
|
nodes: GraphNodeView[];
|
|
edges: GraphEdgeView[];
|
|
phantoms: GraphPhantomView[];
|
|
}
|