ws-cloud-api
Version:
WhatsApp Cloud API for NodeJS
41 lines (38 loc) • 1.04 kB
text/typescript
import { a as MessageStatus } from './shared/ws-cloud-api.fba8aa2f.mjs';
import { W as WebhookSubscribeQuery, a as WsRequest } from './shared/ws-cloud-api.4cf5c678.mjs';
type Source = 'user' | 'button' | 'list' | 'flow';
declare function verifyWebhook(input: WebhookSubscribeQuery): {
statusCode: 200 | 401;
body?: string;
};
declare function handleWebhook(input: WsRequest): Promise<{
type: 'statusUpdate';
messageId: string;
userId: string;
status: MessageStatus.Read | MessageStatus.Delivered | MessageStatus.Sent | MessageStatus.Failed;
} | {
type: 'message';
from: string;
id: string;
message: string;
source: Source;
} | {
type: 'media';
from: string;
id: string;
blob: Blob;
mimeType: string;
message: string;
source: Source;
} | {
type: 'flowReply';
from: string;
id: string;
data: Record<string, unknown>;
} | {
type: 'reaction';
from: string;
id: string;
emoji: string;
} | undefined>;
export { handleWebhook, verifyWebhook };