routes
type DiscoverSearchHandoff = object;
Optional post-search filter/sort applied after a Discover catalog query.
authors?: string[];
Seed include filters (server-applied).
excludeSources?: string[];
field?: "author" | "narrator" | "series" | "genre";
Storefront-scoped search (author / narrator / series / genre).
filterKind?: "all" | "authors" | "series" | "narrators" | "genres" | "sources";
legacy single-dimension filter
filterValue?: string;
genres?: string[];
hideVirtualVoice?: boolean;
When false, do not exclude Virtual Voice (default hide is on).
language?: string;
Hard language include (en, zh, …) or __all__ for no hard filter.
Omit to use the browser language default.
minRating?: number;
narrators?: string[];
q: string;
runtimeBucket?: "any" | "under6" | "6to12" | "12to20" | "over20";
series?: string[];
sort?:
| "relevance"
| "popularity"
| "rating"
| "title"
| "author"
| "price"
| "length";
sortDir?: "asc" | "desc";
sortKey?:
| "title"
| "author"
| "series"
| "relevance"
| "popularity"
| "rating"
| "price"
| "length";
sources?: string[];
type JoinPage =
| "approve"
| "clerk-approve"
| "callback"
| "clerk-callback"
| "player-approve";
A page that sign-in flows from other installs own: a branch's consent
(approve), a clerk's consent (clerk-approve), the joining install's
callback (callback), this install's library card callback
(clerk-callback), or a player app's consent (player-approve).
const CLERK_APPROVE_PATH: "/clerk/approve" = "/clerk/approve";
The library's consent page for a clerk's sign-in (a library card).
const CLERK_CALLBACK_PATH: "/clerk/callback" = "/clerk/callback";
Where a library sends the browser back after a library card sign-in.
const JOIN_APPROVE_PATH: "/join/approve" = "/join/approve";
The library's consent page for a branch's sign-in.
const JOIN_CALLBACK_PATH: "/join/callback" = "/join/callback";
Where a library sends the joining install's browser back.
const PLAYER_APPROVE_PATH: "/apps/approve" = "/apps/approve";
The library's consent page for a player app's browser sign-in.
function dropTicketUnlessInvitePath(): void;
Invite magic links are /invite?ticket= only. Drop ticket on any other
path so /discover?ticket= cannot open the accept-invite form.
void
function isAppPath(pathname): boolean;
Returns whether pathname is a known GUI route (not an API/static/unknown URL).
| Parameter | Type | Description |
|---|---|---|
pathname |
string |
Document pathname (may include a trailing slash). |
boolean
True when the path is owned by the React SPA.
function isConsentPage(page): boolean;
True for a consent page, which keeps its address across a sign-in.
boolean
Whether it is a branch's, a clerk's or a player app's consent page.
function isInvitePath(pathname?): boolean;
True when this document is the magic-link invite route.
| Parameter | Type | Default value | Description |
|---|---|---|---|
pathname? |
string |
window.location.pathname |
Document pathname. |
boolean
True for /invite (trailing slash ignored).
function joinPage(pathname?): JoinPage | null;
Which Join a library page this document is, if any.
| Parameter | Type | Default value | Description |
|---|---|---|---|
pathname? |
string |
window.location.pathname |
Document pathname. |
JoinPage | null
approve, clerk-approve, callback, clerk-callback,
player-approve, or null.
function normalizeAppView(v): AppView;
Coerces an unknown string into a valid AppView.
| Parameter | Type | Description |
|---|---|---|
v |
string | undefined |
Candidate view id from the session or URL. |
Valid view, defaulting to discover.
function normalizePathname(pathname): string;
Strips a trailing slash (except for /).
| Parameter | Type | Description |
|---|---|---|
pathname |
string |
Raw document pathname. |
string
Normalized pathname.
function pathForView(view): string;
Returns the canonical document path for an app view.
| Parameter | Type | Description |
|---|---|---|
view |
AppView |
SPA view id. |
string
Path such as /library.
function queueDiscoverSearch(handoff): void;
Queues a Discover catalog search for the next Discover page mount (cross-view).
| Parameter | Type | Description |
|---|---|---|
handoff |
string | DiscoverSearchHandoff |
Query string or full handoff object (ignored when q is under 2 chars). |
void
function resolveView(pathname, defaultView): AppView;
Resolves the view to show for the current URL plus signed-in default.
| Parameter | Type | Description |
|---|---|---|
pathname |
string |
Document pathname. |
defaultView |
string | undefined |
Session default view when the path is /. |
Effective AppView.
function syncUrlToView(view, mode?): void;
Updates the URL bar without a full reload.
Drops ticket and sso_error so a claimed invite URL is not kept on
/discover?ticket=… (a refresh of that path would skip the 410 invite page).
| Parameter | Type | Default value | Description |
|---|---|---|---|
view |
AppView |
undefined |
View to reflect in the path. |
mode? |
"replace" | "push" |
"push" |
History push (default) or replace. |
void
function takeQueuedDiscoverSearch(): DiscoverSearchHandoff | null;
Consumes a queued Discover search (once).
DiscoverSearchHandoff | null
Handoff payload, or null when none / invalid.
function viewFromPath(pathname): AppView | null;
Maps a document path to an app view, or null for / (use default_view).
| Parameter | Type | Description |
|---|---|---|
pathname |
string |
Document pathname. |
AppView | null
Matching AppView, or null when the path is / or unknown.
Generated from ui/src/lib at main · View as Markdown