reviewUrl
The review page for a contribution on an HTTP remote (with the token in its fragment), if it is one.
import type { Codebase } from "#codebase/tcmts/cli/codebase"; import type { RemoteConfig } from "#codebase/tcmts/cli/sync"; export function reviewUrl(cb: Codebase, remote: string, id?: number): string | undefined { const configured = cb.store.getSetting(`remote.${remote}`); if (!configured) return undefined; const c = JSON.parse(configured) as RemoteConfig; if (!c.url.startsWith("http")) return undefined; return `${c.url.replace(/\/$/, "")}/forge/contributions${id === undefined ? "" : `/${id}`}${c.token ? `#token=${encodeURIComponent(c.token)}` : ""}`; }