Engineering manualAPI route source
/api/brand-studio/brand-delta
Exact current route handler: hosted-app/app/api/brand-studio/brand-delta/route.js
Methods: GET. Input signals: query parameters. Literal response-status signals: none detected.
Source: hosted-app/app/api/brand-studio/brand-delta/route.js. Imports: ../../../../lib/comprehensive-pull-handler.mjs, ../../../../lib/report-api.mjs, ../../../../lib/supabase-rest.mjs, next/server. Exact source is shown for inspection; its presence does not prove authentication, validation or live behavior.
All API routes · API and execution contract
// "Since your last report" — the trend line, hosted.
//
// The panel diffs two run directories on disk. Here the two pulls are two rows
// belonging to the same account, and the comparison itself is the SAME pure
// module both surfaces use (lib/local/all-rest-delta.mjs, a byte-copy of
// src/local/all-rest-delta.mjs), so the two origins cannot disagree about what
// moved or by how much.
//
// EVERY FAILURE IS A 404, and that is a product decision rather than laziness:
// the report renders nothing at all for a null trend, and "we could not
// compare these two pulls" must never be shown as "nothing changed".
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
import { NextResponse } from "next/server";
import { supabaseConfigFromEnv } from "../../../../lib/supabase-rest.mjs";
import { bearerTokenFromHeader } from "../../../../lib/comprehensive-pull-handler.mjs";
import { readPullTrend } from "../../../../lib/report-api.mjs";
export async function GET(request) {
const token = bearerTokenFromHeader(request.headers.get("authorization"));
const runId = new URL(request.url).searchParams.get("run_id") || "";
const result = await readPullTrend({ runId, token, config: supabaseConfigFromEnv(process.env) });
return NextResponse.json(result.body, { status: result.http_status });
}