UNPKG

@devmehq/email-validator-js

Version:

Advanced email validation with MX records, SMTP verification, disposable email detection, batch processing, and caching. Production-ready with TypeScript support.

60 lines (59 loc) 1.73 kB
/** * AWS Lambda adapter for email validation * Supports API Gateway and direct Lambda invocation */ import type { EmailValidationResult, ValidateEmailOptions } from '../../types'; export interface APIGatewayProxyEvent { body: string | null; headers: { [key: string]: string; }; httpMethod: string; path: string; queryStringParameters: { [key: string]: string; } | null; pathParameters: { [key: string]: string; } | null; } export interface APIGatewayProxyResult { statusCode: number; headers?: { [key: string]: string; }; body: string; } export interface LambdaContext { functionName: string; functionVersion: string; awsRequestId: string; remainingTimeInMillis: number; } interface ValidateRequest { email?: string; emails?: string[]; options?: ValidateEmailOptions; } interface ValidateResponse { success: boolean; data?: EmailValidationResult | EmailValidationResult[]; error?: string; } export declare function apiGatewayHandler(event: APIGatewayProxyEvent, _context: LambdaContext): Promise<APIGatewayProxyResult>; export declare function lambdaHandler(event: ValidateRequest, _context: LambdaContext): Promise<ValidateResponse>; export declare function cacheHandler(event: { action: 'clear' | 'stats'; }, _context: LambdaContext): Promise<{ success: boolean; message?: string; stats?: unknown; }>; export declare function handler(event: any, _context: any): Promise<any>; declare const _default: { apiGatewayHandler: typeof apiGatewayHandler; lambdaHandler: typeof lambdaHandler; cacheHandler: typeof cacheHandler; handler: typeof handler; }; export default _default;