feat: add Resend inbound webhook endpoint and client (refs #155)

- ResendInboundClient: webhook signature verification via Svix, email
  fetch/download/parse with mailparser
- POST /api/webhooks/resend/inbound endpoint with rawBody, signature
  verification, idempotency check, queue insertion, async processing
- Config: resend_webhook_secret (optional) in secrets schema
- Route registration in app.ts following Stripe webhook pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Eric Gullickson
2026-02-13 08:22:25 -06:00
parent 877f844be6
commit 2462fff34d
8 changed files with 519 additions and 15 deletions

View File

@@ -0,0 +1,14 @@
/**
* @ai-summary Email ingestion feature barrel export
* @ai-context Exports webhook routes for Resend inbound email processing
*/
export { emailIngestionWebhookRoutes } from './api/email-ingestion.routes';
export { ResendInboundClient } from './external/resend-inbound.client';
export type { ParsedEmailResult, ParsedEmailAttachment } from './external/resend-inbound.client';
export type {
EmailIngestionQueueRecord,
EmailIngestionStatus,
ResendWebhookEvent,
ResendWebhookEventData,
} from './domain/email-ingestion.types';