/** * Parse Meta WhatsApp webhook envelope into a normalized event. */ import type { InboundEnvelope, InboundEvent } from '../types.js'; /** * v0.15: normalized status update from Meta's webhook `statuses` array. * `pricingCategory` tracks Meta's classification (utility/marketing/ * authentication/service) — right for the alarm that catches * UTILITY→MARKETING reclassification. */ export interface StatusUpdate { wamid: string; status: 'sent' | 'delivered' | 'read' | 'failed'; pricingCategory?: 'utility' | 'marketing' | 'authentication' | 'service'; timestampMs: number; recipient?: string; errors?: unknown[]; } /** * v0.15: extract normalized status updates from a webhook envelope. * Complements `extractInbound` (which handles inbound messages) — Meta * webhooks can carry EITHER messages OR statuses in the same shape. * Returns `[]` when the envelope has no statuses. */ export declare function extractStatuses(envelope: InboundEnvelope | undefined | null): StatusUpdate[]; export declare function extractInbound(envelope: InboundEnvelope | undefined | null): InboundEvent; //# sourceMappingURL=extract.d.ts.map