/** * Email Templates Detail API Route Handlers for Next.js * * These route handlers can be re-exported in your Next.js application to provide * individual email template management endpoints at /api/email-templates/[id]. * * 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/[id]/route.ts * export { GET, PATCH, DELETE } from 'nextly/api/email-templates-detail'; * ``` * * @module api/email-templates-detail */ interface RouteContext { params: Promise<{ id: string; }>; } /** * GET handler for retrieving a single email template by ID. * * Requires authentication. * * Response Codes: * - 200 OK: Template retrieved successfully * - 401 Unauthorized: Authentication required * - 404 Not Found: Template with ID does not exist * - 500 Internal Server Error: Failed to fetch template * * Response: `{ "data": EmailTemplate }` */ declare const GET: (request: Request, context: RouteContext) => Promise; /** * PATCH handler for updating an email template. * * Requires authentication. Template `slug` cannot be changed after creation. * * Request Body (all fields optional): * - name, subject, htmlContent, plainTextContent, variables, useLayout, * isActive, providerId. * * Response Codes: * - 200 OK: Template updated successfully * - 400 Bad Request: Invalid JSON body * - 401 Unauthorized: Authentication required * - 404 Not Found: Template with ID does not exist * - 500 Internal Server Error: Update failed * * Response: `{ "data": EmailTemplate }` */ declare const PATCH: (request: Request, context: RouteContext) => Promise; /** * DELETE handler for removing an email template. * * Requires authentication. Cannot delete layout templates (`_email-header`, * `_email-footer`); use the layout endpoint to modify them. * * Response Codes: * - 200 OK: Template deleted successfully * - 401 Unauthorized: Authentication required * - 403 Forbidden: Cannot delete layout templates * - 404 Not Found: Template with ID does not exist * - 500 Internal Server Error: Deletion failed * * Response: `{ "data": { "success": true } }` */ declare const DELETE: (request: Request, context: RouteContext) => Promise; export { DELETE, GET, PATCH };