/** * Singles Schema Detail API Route Handlers for Next.js * * These route handlers can be re-exported in your Next.js application to provide * individual Single schema management endpoints at /api/singles/[slug]/schema. * * This is separate from the document endpoints (/api/singles/[slug]) which * handle the actual content/values of a Single. * * Services are auto-initialized on first request using environment variables: * - DB_DIALECT: Database dialect ("postgresql" | "mysql" | "sqlite") * - DATABASE_URL: Database connection string * * @example * ```typescript * // In your Next.js app: app/api/singles/[slug]/schema/route.ts * export { GET, PATCH, DELETE } from 'nextly/api/singles-schema-detail'; * ``` * * @module api/singles-schema-detail */ /** * Context object for dynamic route handlers. * Next.js 15+ requires params to be a Promise. */ interface RouteContext { params: Promise<{ slug: string; }>; } /** * GET handler for retrieving a Single's schema/metadata by slug. * * Requires a verified session or API key with read access to the Single, * matching the dispatcher's `getSingleSchema` authorization. */ declare const GET: (request: Request, context: RouteContext) => Promise; /** * PATCH handler for updating a Single's schema/metadata. * * Requires manage-settings, matching the dispatcher's `updateSingleSchema` * authorization. The registry returns 403 if the Single is locked * (code-first Singles cannot be modified via API). */ declare const PATCH: (request: Request, context: RouteContext) => Promise; /** * DELETE handler for removing a Single. * * Requires manage-settings, matching the dispatcher's `deleteSingle` * authorization. The registry returns 403 if the Single is locked * (code-first Singles cannot be deleted via API). Singles require * `force: true` to delete because they represent persistent site-wide * configuration. */ declare const DELETE: (request: Request, context: RouteContext) => Promise; export { DELETE, GET, PATCH };