@codebucket/whatsapp
Version:
A reusable WhatsApp Business API client with template and non-template support, webhook handling, pluggable storage, and text sanitization
22 lines (21 loc) • 795 B
TypeScript
import { ComponentDef, TemplateVariables, Mode } from './types';
export declare function extractKeys(components: ComponentDef[]): string[];
export declare function normalizeVariables(vars: TemplateVariables, mode: Mode, keys: string[]): {
variables: TemplateVariables;
warnings: string[];
};
export declare function buildComponents(components: ComponentDef[], variables: TemplateVariables, mode: Mode, keys: string[]): any[];
/**
* Creates a template payload and returns payload plus validation warnings.
*/
export declare function createWhatsAppTemplatePayload(opts: {
businessAccountId: string;
accessToken: string;
to: string;
templateName: string;
language?: string;
variables: TemplateVariables;
}): Promise<{
payload: any;
warnings: string[];
}>;