whoIs
uses tcmts.registry.people, which uses tcmts.server.table, which uses tcmts.server.Table, which uses #tcm/host (database)
Who a page's @<handle> (or @<DID>) is: someone the registry knows, by the handle they have now.
import { people, someone } from "#codebase/tcmts/registry"; import type { Someone } from "#codebase/tcmts/registry"; export async function whoIs(who: string): Promise<Someone | undefined> { const id = who.replace(/^@/, ""); const p = id.startsWith("did:") ? await people.findOne({ did: id }) : await people.findOne({ handle: id }); return p ? someone(p.value) : id.startsWith("did:") ? { did: id } : undefined; }