/** * Email Templates API Route Handlers for Next.js * * These route handlers can be re-exported in your Next.js application to provide * email template management endpoints at /api/email-templates. * * 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/email-templates/route.ts * export { GET, POST } from 'nextly/api/email-templates'; * ``` * * The list endpoint is not server-paginated; admin code reads the array * length directly. There is no synthetic `meta.total`. * * @module api/email-templates */ /** * GET handler for listing all email templates. * * Requires authentication. Returns all templates except layout templates * (`_email-header`, `_email-footer`). Use the layout endpoint to access those. * * Response Codes: * - 200 OK: Templates list retrieved successfully * - 401 Unauthorized: Authentication required * - 500 Internal Server Error: Failed to fetch templates * * Response: `{ "data": EmailTemplate[] }`; non-paginated list. * * @example * ```bash * curl -H "Authorization: Bearer " \ * "http://localhost:3000/api/email-templates" * # => {"data":[...]} * ``` */ declare const GET: (request: Request) => Promise; /** * POST handler for creating a new email template. * * Requires authentication. Cannot use reserved slugs (`_email-header`, * `_email-footer`); use the layout endpoint instead. * * Request Body: see `createTemplateSchema` above for the full shape. * * Response Codes: * - 201 Created: Template created successfully * - 400 Bad Request: Invalid input or reserved slug * - 401 Unauthorized: Authentication required * - 500 Internal Server Error: Creation failed * * Response: `{ "data": EmailTemplate }`; the created template. Status 201. */ declare const POST: (request: Request) => Promise; export { GET, POST };