UNPKG

ws-cloud-api

Version:

WhatsApp Cloud API for NodeJS

63 lines (60 loc) 2.46 kB
import { SendMessageResponse } from './messaging.mjs'; import { W as WsConfig } from './shared/ws-cloud-api.d6f9d022.mjs'; import { l as TemplateBodyParameter, k as TemplateHeaderParameter, j as TemplateFlowParameter } from './shared/ws-cloud-api.8bd1ac98.mjs'; import { t as templateFields, T as Templates, C as CreateTemplate, b as CreateTemplateResponse } from './shared/ws-cloud-api.0a2eee86.mjs'; import './shared/ws-cloud-api.fba8aa2f.mjs'; declare function sendTextTemplate({ to, templateName, language, parameters, config }: { to: string; templateName: string; language: string; parameters?: TemplateBodyParameter[]; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendMediaTemplate({ to, templateName, language, headerParameters, bodyParameters, config }: { to: string; templateName: string; language: string; headerParameters: TemplateHeaderParameter; bodyParameters?: TemplateBodyParameter[]; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendFlowTemplate({ to, templateName, language, flow, bodyParameters, config }: { to: string; templateName: string; language: string; flow: TemplateFlowParameter['action']; bodyParameters?: TemplateBodyParameter[]; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendAuthTemplate({ to, templateName, language, code, config }: { to: string; templateName: string; language: string; code: string; config?: WsConfig; }): Promise<SendMessageResponse>; type SendTemplateRequestResponse<T> = { success: true; data: T; } | { success: false; error: unknown; }; declare function sendTemplateRequest<T>({ query, body, method, config }: { query?: string; body?: string; method?: string; config?: WsConfig; }): Promise<SendTemplateRequestResponse<T>>; declare function getTemplates({ fields, limit, after, before, config }?: { fields?: templateFields[]; limit?: number; after?: string; before?: string; config?: WsConfig; }): Promise<SendTemplateRequestResponse<Templates>>; declare function createTemplate({ template, config }: { template: CreateTemplate; config?: WsConfig; }): Promise<SendTemplateRequestResponse<CreateTemplateResponse>>; export { type SendTemplateRequestResponse, createTemplate, getTemplates, sendAuthTemplate, sendFlowTemplate, sendMediaTemplate, sendTemplateRequest, sendTextTemplate };