/** * WhatsApp Cloud inbound: parse Meta's webhook → ShuttleMessages, verify the * request signature, and handle the GET verification handshake. All pure/testable. */ import type { ShuttleMessage } from '../adapter.js'; export interface WhatsAppWebhookBody { readonly object?: string; readonly entry?: ReadonlyArray<{ readonly changes?: ReadonlyArray<{ readonly value?: { readonly messaging_product?: string; readonly metadata?: { readonly phone_number_id?: string; }; readonly messages?: ReadonlyArray<{ readonly from?: string; readonly id?: string; readonly type?: string; readonly text?: { readonly body?: string; }; }>; readonly statuses?: ReadonlyArray<{ readonly id?: string; readonly status?: string; readonly timestamp?: string; readonly errors?: ReadonlyArray<{ readonly code?: number; readonly title?: string; }>; }>; }; readonly field?: string; }>; }>; } /** Extract text messages (ignores statuses, non-text). Every number = its own DM. */ export declare function parseWhatsAppWebhook(body: WhatsAppWebhookBody): ShuttleMessage[]; /** Verify `X-Hub-Signature-256` = `sha256=` + HMAC-SHA256(appSecret, rawBody). */ export declare function verifyWhatsAppSignature(appSecret: string, rawBody: string, signatureHeader: string): boolean; /** GET webhook verification: echo `hub.challenge` when the token matches, else null. */ export declare function verifyWebhookChallenge(params: { readonly 'hub.mode'?: string; readonly 'hub.verify_token'?: string; readonly 'hub.challenge'?: string; }, verifyToken: string): string | null; //# sourceMappingURL=message.d.ts.map