/** * Email Providers API Route Handlers for Next.js * * These route handlers can be re-exported in your Next.js application to provide * email provider management endpoints at /api/email-providers. * * 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/route.ts * export { GET, POST } from 'nextly/api/email-providers'; * ``` * * The list endpoint is not server-paginated; admin code reads the array * length directly. There is no synthetic `meta.total`. * * @module api/email-providers */ /** * GET handler for listing all email providers. * * Requires authentication. Returns providers with masked configuration * (sensitive fields like API keys and passwords are replaced with "••••••••"). * * Response Codes: * - 200 OK: Providers list retrieved successfully * - 401 Unauthorized: Authentication required * - 500 Internal Server Error: Failed to fetch providers * * Response: `{ "data": EmailProvider[] }`; non-paginated list. * * @example * ```bash * curl -H "Authorization: Bearer " \ * "http://localhost:3000/api/email-providers" * # => {"data":[...]} * ``` */ declare const GET: (request: Request) => Promise; /** * POST handler for creating a new email provider. * * Requires authentication. Creates a provider with encrypted configuration. * If `isDefault` is true, the previous default provider is unset atomically. * * Request Body: * - name: Display name (required) * - type: Provider type, one of "smtp", "resend", or "sendlayer" (required) * - fromEmail: From email address (required) * - fromName: From display name (optional) * - configuration: Provider-specific config object (required) * - isDefault: Set as default provider (optional, default: false) * - isActive: Enable provider (optional, default: true) * * Response Codes: * - 201 Created: Provider created successfully * - 400 Bad Request: Invalid input * - 401 Unauthorized: Authentication required * - 500 Internal Server Error: Creation failed * * Response: `{ "data": EmailProvider }`; created provider with masked * configuration. Status 201. */ declare const POST: (request: Request) => Promise; export { GET, POST };