/** * Email Providers Detail API Route Handlers for Next.js * * These route handlers can be re-exported in your Next.js application to provide * individual email provider management endpoints at /api/email-providers/[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-providers/[id]/route.ts * export { GET, PATCH, DELETE } from 'nextly/api/email-providers-detail'; * ``` * * Auth is a header-only presence check; real verification lives downstream. * * @module api/email-providers-detail */ interface RouteContext { params: Promise<{ id: string; }>; } /** * GET handler for retrieving a single email provider by ID. * * Requires authentication. Returns provider with masked configuration. * * Response Codes: * - 200 OK: Provider retrieved successfully * - 401 Unauthorized: Authentication required * - 404 Not Found: Provider with ID does not exist * - 500 Internal Server Error: Failed to fetch provider * * Response: `{ "data": EmailProvider }` */ declare const GET: (request: Request, context: RouteContext) => Promise; /** * PATCH handler for updating an email provider. * * Requires authentication. Provider `type` cannot be changed after creation. * Configuration is re-encrypted before storage. * * Request Body (all fields optional): * - name: Display name * - fromEmail: From email address * - fromName: From display name * - configuration: Provider-specific config object * - unsetConfiguration: Configuration field names to remove * - isActive: Enable/disable provider * * Response Codes: * - 200 OK: Provider updated successfully * - 400 Bad Request: Invalid JSON body * - 401 Unauthorized: Authentication required * - 404 Not Found: Provider with ID does not exist * - 500 Internal Server Error: Update failed * * Response: `{ "data": EmailProvider }`; updated provider with masked * configuration. */ declare const PATCH: (request: Request, context: RouteContext) => Promise; /** * DELETE handler for removing an email provider. * * Requires authentication. Cannot delete the default provider; set another * provider as default first. * * Response Codes: * - 200 OK: Provider deleted successfully * - 401 Unauthorized: Authentication required * - 403 Forbidden: Cannot delete the default provider * - 404 Not Found: Provider 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 };