import { reextractPagesAction } from "../../../channels/[slug]/waybackPagesActions"; import { jobResponse, ops, optBool, reqSlug } from "../_lib"; export const dynamic = "force-dynamic"; // POST { slug, dryRun? } -> { ok: true, jobId } // // A Wayback pages channel's records re-derived from the raw captures it // stores (release 37 S1): no request. A `reextract-pages` job on the // archive.org queue (beside no import into the channel); its log ends with // `@@reextract-pages {captures, stale, records: {added, changed, removed, // unchanged, kept}, written}`. `dryRun` counts and writes nothing. export async function POST(request: Request) { return ops(request, ["slug", "dryRun"], async (body) => jobResponse(await reextractPagesAction(reqSlug(body, "slug"), optBool(body, "dryRun") === true)), ); }