/** * Pure `/go` indirection for self-deployed SDK boards. * * Mirrors the hosted-app contract: * - `/go/job/` → 302 to jobDetailPath(companySlug, jobSlug) * - `/go/alerts-manage` / `/go/alerts-confirm` → 302 carrying query * - unknown / unresolvable → 302 to BOARD_PATHS.jobs * - every response: `X-Robots-Tag: noindex, nofollow` * * Framework-portable: takes a standard Request, returns a standard * Response. No Next.js imports (same discipline as the sitemap walker). */ interface ResolvedJobSlugs { companySlug: string; jobSlug: string; } interface GoRedirectResult { location: string; status: 302; } /** * Optional job-id → slugs lookup. The public Board API currently exposes * job retrieve **by slug only** (`board.jobs.retrieve(jobSlug)`); there is * no publishable-key endpoint that resolves an immutable job id to slugs. * * When `lookupJob` is omitted, `/go/job/` degrades to the jobs index * (safe, never 404). Pass a custom lookup when a data-plane endpoint lands * (see TODO). */ type GoJobLookup = (jobId: string) => Promise | ResolvedJobSlugs | null; interface CreateGoHandlerConfig { /** * Optional job resolver. Injected so tests can fake the data client and * so callers can wire a future Board API id-lookup without an SDK release. */ lookupJob?: GoJobLookup; /** * Base origin used to absolutize Location (e.g. `https://jobs.example.com`). * When omitted, Location is absolute against the incoming request URL — * correct for same-host mounts. */ origin?: string; } declare function goResponseHeaders(): Record; /** * Pure role → location resolver. Shared by the handler so unit tests can * assert the contract without spinning a Request. */ declare function resolveGoRedirect(parts: readonly string[] | undefined, search: string, resolvedJob: ResolvedJobSlugs | null): GoRedirectResult; /** * Create a `(request) => Response` handler the starter mounts at `/go/*`. * * @example * // Next.js App Router * import { createGoHandler } from '@cavuno/board/go'; * export const GET = createGoHandler({}); * * // With a future id-lookup: * export const GET = createGoHandler({ * lookupJob: async (id) => board.jobs.retrieveById?.(id) ?? null, * }); */ declare function createGoHandler(config?: CreateGoHandlerConfig): (request: Request) => Promise; export { type CreateGoHandlerConfig, type GoJobLookup, type GoRedirectResult, type ResolvedJobSlugs, createGoHandler, goResponseHeaders, resolveGoRedirect };