// A PAGE citation as a POST citation of the page record its capture became // (release 37): the ONE builder both paths use — umtool's Import this capture // (controller/handEdits.ts replacePageCitationWithRecord) and find-copy's page // mode (publish/findCopyPages.ts, its items' `as`) — so they write identical // citations. Its words and editorial fields kept; the page's address, title // and archived copy kept as its `fallback`. Pure, client-safe. import type { PageCitation, PostCitation } from "./schema"; export function pageCitationAsPost(c: PageCitation, pointTo: { channel: string; id: string }): PostCitation { const { kind: _kind, url, title, archiveUrl, ...common } = c; return { kind: "post", channel: pointTo.channel, id: pointTo.id, ...common, fallback: { kind: "page", url, ...(title ? { title } : {}), ...(archiveUrl ? { archiveUrl } : {}) }, }; }