ws-cloud-api
Version:
WhatsApp Cloud API for NodeJS
55 lines (52 loc) • 2.11 kB
TypeScript
import { SendMessageResponse } from './messaging.js';
import { W as WsConfig } from './shared/ws-cloud-api.d6f9d022.js';
import { k as TemplateBodyParameter, j as TemplateHeaderParameter } from './shared/ws-cloud-api.0548a85b.js';
import { t as templateFields, T as Templates, C as CreateTemplate, b as CreateTemplateResponse } from './shared/ws-cloud-api.fa1e35d4.js';
import './shared/ws-cloud-api.fba8aa2f.js';
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 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, sendMediaTemplate, sendTemplateRequest, sendTextTemplate };