Engineering manualAPI route source
/api/notifications/preferences
Exact current route handler: hosted-app/app/api/notifications/preferences/route.js
Methods: GET, POST. Input signals: none detected. Literal response-status signals: none detected.
Source: hosted-app/app/api/notifications/preferences/route.js. Imports: ../../../../lib/bounded-http.mjs, ../../../../lib/comprehensive-pull.mjs, ../../../../lib/notification-preferences.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
import { NextResponse } from 'next/server';
import { readBoundedJsonRequest } from '../../../../lib/bounded-http.mjs';
import { supabaseConfigFromEnv } from '../../../../lib/supabase-rest.mjs';
import { bearerTokenFromHeader } from '../../../../lib/comprehensive-pull.mjs';
import { notificationPreferences } from '../../../../lib/notification-preferences.mjs';
export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';
const reply = result => NextResponse.json(result.body, { status: result.http_status, headers: { 'cache-control': 'private, no-store', 'x-content-type-options': 'nosniff' } });
const run = (request, body) => notificationPreferences({ token: bearerTokenFromHeader(request.headers.get('authorization')), config: supabaseConfigFromEnv(process.env), body });
export async function GET(request) { return reply(await run(request, null)); }
export async function POST(request) {
const body = await readBoundedJsonRequest(request, 2048).catch(() => null);
if (!body || typeof body !== 'object' || Array.isArray(body)) return reply({ http_status: 400, body: { status: 'refused', reason: 'invalid_notification_input' } });
return reply(await run(request, body));
}