import { hmacSign } from './hmac'; import type { WebhookPayload } from './webhook-adapter'; /** Email-shaped provider payload (as the adapter's normalize input). */ export const emailFixture: WebhookPayload = { eventId: 'email-1', from: 'someone@example.com', displayName: 'Someone', threadRef: 'mail-thread-1', subject: 'Question about my plot', text: 'Hello, I have a question.', }; /** WhatsApp-shaped provider payload. */ export const whatsappFixture: WebhookPayload = { eventId: 'wa-1', from: '+15551234567', displayName: 'WA User', threadRef: 'wa-group-1', text: 'hi from whatsapp', }; /** Produce a signed request (body + headers) for tests/smoke. */ export function signedFixture(payload: object, secret: string): { body: string; headers: Record } { const body = JSON.stringify(payload); return { body, headers: { 'x-iios-signature': hmacSign(body, secret), 'content-type': 'application/json' } }; }