/** * GET /dashboard/consolidation — pending consolidation proposal list with * accept/reject (FEAT-410 wave 2, SLICE-410-2; replaces SLICE-410-1's stub * render internals). * * POST /dashboard/consolidation/proposals/:id/accept|reject — the actual * mutation targets for the row forms below. These are DASHBOARD-scoped * routes, not the Bearer-only `/consolidation/proposals/:id/accept|reject` * API routes in src/server/routes/consolidation.ts (which stay untouched * for programmatic clients). The original design pointed the forms straight * at the API routes, but that never worked from a real browser: a plain * HTML form cannot send an `Authorization` header, the API routes are * gated by app.ts's Bearer-only preHandler (which never reads cookies), * and the `astramem_dash` session cookie is scoped `Path=/dashboard` so a * browser wouldn't even attach it to `/consolidation/...`. These * dashboard-scoped routes are gated by the same `checkDashboardAuth` helper * every other /dashboard* route uses, so the cookie set by * `GET /dashboard?token=` attaches naturally; resolution logic itself is * NOT duplicated — both surfaces call `resolveProposal` (consolidation.ts). * On success this redirects (303, POST-redirect-GET) back to * `/dashboard/consolidation` so a page refresh doesn't resubmit the form. * * Auth is the shared `checkDashboardAuth` helper (dashboard-auth.ts) — Bearer * header, the HttpOnly `astramem_dash` cookie bootstrapped by * src/server/routes/dashboard.ts, or (when active) devNoAuth's loopback-only * bypass (itself hardened against the form-CSRF hole — see that helper's * doc comment and lib/origin-guard.ts). */ import type { FastifyInstance } from 'fastify'; import type { DB } from '../../storage/db.js'; /** `db` backs the real proposal + memory lookups (SLICE-410-1's stub * accepted but ignored it, keeping this factory's signature stable). */ export declare function dashboardConsolidationRoute(db: DB, token: string, devNoAuthActive?: boolean): (app: FastifyInstance) => Promise;