import * as _$ky from "ky"; import { KyInstance, Options } from "ky"; //#region src/types/PhoneNumber.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ /** A Phone Number. **Not** a Phone Number ID. */ type PhoneNumberString = `+${string}` | (string & NonNullable); /** WhatsApp Phone Number ID. **Not** necessarily a Phone Number. */ type PhoneNumberID = string; //#endregion //#region src/types/BusinessProfile/index.d.ts type BusinessProfileFields = "id" | "messaging_product" | "about" | "address" | "description" | "email" | "profile_picture_url" | "websites" | "vertical"; declare const BUSINESS_PROFILE_VERTICALS: readonly ["UNDEFINED", "AUTO", "BEAUTY", "APPAREL", "EDU", "ENTERTAIN", "EVENT_PLAN", "FINANCE", "GROCERY", "ONLINE_GAMBLING", "PHYSICAL_GAMBLING", "OTC_DRUGS", "ALCOHOL", "GOVT", "HOTEL", "HEALTH", "NONPROFIT", "PROF_SERVICES", "RETAIL", "TRAVEL", "RESTAURANT", "NOT_A_BIZ", "OTHER"]; type BusinessProfileVertical = (typeof BUSINESS_PROFILE_VERTICALS)[number]; type BusinessProfile = { about?: string; /** Business address. Maximum 256 characters. */ address?: string; description?: string; /** Business email address. Must be in valid email format. Maximum 128 characters. */ email?: string; messaging_product: "whatsapp"; profile_picture_url?: string; /** Business category. These values map to the following strings, which are displayed in the business profile in the WhatsApp client. */ vertical: BusinessProfileVertical; /** URLs associated with the business, such as a website, Facebook Page, or Instagram profile. */ websites?: [string] | [string, string] | (string[] & NonNullable); }; type GetBusinessProfileFields = Partial> | BusinessProfileFields[]; type GetBusinessProfileOptions = { phoneNumberID: PhoneNumberID; fields?: GetBusinessProfileFields; }; type GetBusinessProfilePayload = { data: [BusinessProfile]; }; type UpdateBusinessProfileOptions = { phoneNumberID: PhoneNumberID; about?: string; /** Business address. Maximum 256 characters. */ address?: string; description?: string; /** Business email address. Must be in valid email format. Maximum 128 characters. */ email?: string; profile_picture_handle?: string; /** Business category. These values map to the following strings, which are displayed in the business profile in the WhatsApp client. */ vertical?: BusinessProfileVertical; /** URLs associated with the business, such as a website, Facebook Page, or Instagram profile. */ websites?: [string] | [string, string] | (string[] & NonNullable); }; type UpdateBusinessProfilePayload = { success: boolean; }; //#endregion //#region src/BusinessProfile/index.d.ts interface MethodOptions$6 { request?: Options; } declare class BusinessProfile$1 { protected _transport: KyInstance; constructor(_transport: KyInstance); protected getEndpoint(phoneNumberID: PhoneNumberID): string; getBusinessProfile({ phoneNumberID, fields, request }: MethodOptions$6 & GetBusinessProfileOptions): _$ky.ResponsePromise; updateBusinessProfile({ phoneNumberID, request, ...json }: MethodOptions$6 & UpdateBusinessProfileOptions): _$ky.ResponsePromise; } //#endregion //#region src/types/Media.d.ts type MediaID = string; interface MediaUploadOptions { file: Blob; phoneNumberID: PhoneNumberID; filename?: string; mimeType: string; } type MediaUploadPayload = { id: MediaID; }; type MediaGetURLOptions = { phoneNumberID?: PhoneNumberID; mediaID: MediaID; }; type MediaGetURLPayload = { messaging_product: "whatsapp"; url: string; mime_type: string; sha256: string; file_size: string | number; id: MediaID; }; type MediaDeleteOptions = { phoneNumberID?: PhoneNumberID; mediaID: MediaID; }; type MediaDeletePayload = { success: boolean; }; //#endregion //#region src/Media/index.d.ts interface MethodOptions$5 { request?: Options; } interface DownloadOptions { mediaURL: string; } declare class Media { protected _transport: KyInstance; constructor(_transport: KyInstance); protected getEndpoint(phoneNumberID: PhoneNumberID): string; /** * Upload Media. * All media files sent through this endpoint are encrypted and persist for * 30 days, unless they are deleted earlier. */ upload({ phoneNumberID, file, filename, mimeType, request }: MethodOptions$5 & MediaUploadOptions): _$ky.ResponsePromise; /** * Retrieve Media URL. * Use the returned URL to download the media file. Note that clicking this * URL (i.e. performing a generic GET) will not return the media; you must * include an access token. * * A successful response includes an object with a media url. The URL is only * valid for 5 minutes. */ getURL({ mediaID, phoneNumberID, request }: MethodOptions$5 & MediaGetURLOptions): _$ky.ResponsePromise; delete({ mediaID, phoneNumberID, request }: MethodOptions$5 & MediaDeleteOptions): _$ky.ResponsePromise; /** * Download Media. * All media URLs expire after 5 minutes —you need to retrieve the media URL * again if it expires. If you directly click on the URL you get from a * `/MEDIA_ID` GET call, you get an access error. * * If successful, you will receive the binary data of media saved in * media_file, response headers contain a content-type header to indicate the * mime type of returned data. * * If media fails to download, you will receive a `404 Not Found` response * code. In that case, we recommend you try to retrieve a new media URL and * download it again. If doing so doesn't resolve the issue, please try to * renew the `ACCESS_TOKEN` then retry downloading the media. * * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#supported-media-types} * @example * // Download Media and Write to a File * const download = await sdk.media.download({ mediaURL }); * const file = await download.arrayBuffer(); * fs.writeFile("filename.ext", Buffer.from(file)); */ download({ mediaURL, request }: MethodOptions$5 & DownloadOptions): _$ky.ResponsePromise; } //#endregion //#region src/types/Account.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ /** * A WhatsApp End-User Account ID. */ type AccountID = string; //#endregion //#region src/types/Error.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ type WhatsappError = { code: number; message?: string; type: string; title?: string; error_data?: { messaging_product: "whatsapp"; /** * Error description and a description of the most likely reason for the * error. May also contain information on how to address the error, such as * which parameter is invalid or what values are acceptable. */ details: string; }; /** * Trace ID you can include when contacting Direct Support. The ID may help * support to debug the error. */ fbtrace_id: string; /** * @deprecated Since Graph API v16.0. */ error_subcode?: number; }; //#endregion //#region src/types/Message/MessageButton.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ type EventNotificationMessageButton = { text: string; payload?: string; }; //#endregion //#region src/types/Message/MessageContact.d.ts type CreateMessageContact = { /** * Full contact address(es) formatted as an addresses object. */ addresses: { type: "HOME" | "WORK" | (string & NonNullable); /** * Street number and name. * * @since 4.2.0 */ street?: string; /** * City name. * * @since 4.2.0 */ city?: string; /** * State abbreviation. * * @since 4.2.0 */ state?: string; /** * ZIP code. * * @since 4.2.0 */ zip?: string; /** * Full country name. * * @since 4.2.0 */ country?: string; /** * Two-letter country abbreviation. * * @since 4.2.0 */ country_code?: string; }[]; /** * YYYY-MM-DD formatted string. */ birthday?: `${number}${number}${number}${number}-${number}${number}-${number}${number}` | (string & NonNullable); /** * Contact email address(es) formatted as an emails object. */ emails: { type: "HOME" | "WORK" | (string & NonNullable); /** * Email address. */ email?: string; }[]; /** * Full contact name formatted as a name object. * This appears to fit the required fields pattern for VCF4 contact files. */ name: { /** * Full name, as it normally appears. */ formatted_name: string; /** * First name. */ first_name?: string; /** * Last name. * * @since 4.2.0 */ last_name?: string; /** * Middle name. * * @since 4.2.0 */ middle_name?: string; /** * Name suffix. * * @since 4.2.0 */ suffix?: string; /** * Name prefix. * * @since 4.2.0 */ prefix?: string; }; org?: { /** * Name of the contact's company. */ company?: string; /** * Name of the contact's department. */ department?: string; /** * Contact's business title. */ title?: string; }; phones?: { type?: "CELL" | "MAIN" | "IPHONE" | "HOME" | "WORK" | (string & NonNullable); /** * Automatically populated with the `wa_id` value as a formatted phone * number. */ phone?: PhoneNumberString; /** * WhatsApp ID. */ wa_id?: AccountID; }[]; urls: { type?: "HOME" | "WORK" | (string & NonNullable); /** * URL. * * @since 4.2.0 */ url?: string; }[]; }; //#endregion //#region src/types/Message/MessageLocation.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ type CreateMessageLocation = { /** * Longitude of the location. */ longitude: number; /** * Latitude of the location. */ latitude: number; /** * Name of the location. */ name: string; /** * Address of the location. */ address: string; }; //#endregion //#region src/types/Message/MessageMedia.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ type CreateMessageMedia = { /** * ID for the media file. */ id?: string; /** * Required when type is audio, document, image, sticker, or video and you * are not using an uploaded media ID (i.e. you are hosting the media asset * on your public server). * * The protocol and URL of the media to be sent. Use only with HTTP/HTTPS URLs. * * Do not use this field when message type is set to text. * * Cloud API users only: * * - See {@link https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#media-http-caching} * if you would like us to cache the media asset for future messages. * - When we request the media asset from your server you must indicate the * media's MIME type by including the `Content-Type` HTTP header. For * example: `Content-Type: video/mp4`. See * {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#supported-media-types} * for a list of supported media and their MIME types. */ link?: string; /** * Media asset caption. Do not use with audio or sticker media. * * On-Premises API users: * * - For v2.41.2 or newer, this field is limited to 1024 characters. * - Captions are currently not supported for `document` media. */ caption?: string; /** * Describes the filename for the specific document. Use only with document * media. * * The extension of the filename will specify what format the document is * displayed as in WhatsApp. */ filename?: string; }; type EventNotificationMessageMedia = { /** * ID for the media file. * * @since 5.0.0 */ id?: string; /** * Mime type of the media file. * * @since 5.0.0 */ mime_type: string; /** * Media asset caption. Do not use with audio or sticker media. * * On-Premises API users: * * - For v2.41.2 or newer, this field is limited to 1024 characters. * - Captions are currently not supported for `document` media. */ caption?: string; /** * Describes the filename for the specific document. Use only with document * media. * * The extension of the filename will specify what format the document is * displayed as in WhatsApp. */ filename?: string; /** * Image hash. */ sha256: string; }; //#endregion //#region src/types/Message/MessageReaction.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ type EventNotificationMessageReaction = { message_id: string; emoji: string; }; //#endregion //#region src/types/Message/MessageSystem.d.ts type EventNotificationMessageSystem = { /** * Describes the change to the customer's identity or phone number. */ body: string; /** * Hash for the identity fetched from server. */ identity: string; /** * The WhatsApp ID for the customer prior to the update. */ customer: AccountID; /** * Type of system update. */ type: "customer_changed_number" | "customer_identity_changed.js"; /** * New WhatsApp ID for the customer when their phone number is updated. * * @deprecated since Webhook v11.0 */ new_wa_id: AccountID; /** * New WhatsApp ID for the customer when their phone number is updated. */ wa_id: AccountID; }; //#endregion //#region src/types/Templates/TemplateLanguage.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ /** No, this is not all ISO language codes */ declare const TEMPLATE_LANGUAGES: readonly ["af", "sq", "ar", "ar_EG", "ar_AE", "ar_LB", "ar_MA", "ar_QA", "az", "be_BY", "bn", "bn_IN", "bg", "ca", "zh_CN", "zh_HK", "zh_TW", "hr", "cs", "da", "prs_AF", "nl", "nl_BE", "en", "en_GB", "en_US", "en_AE", "en_AU", "en_CA", "en_GH", "en_IE", "en_IN", "en_JM", "en_MY", "en_NZ", "en_QA", "en_SG", "en_UG", "en_ZA", "et", "fil", "fi", "fr", "fr_BE", "fr_CA", "fr_CH", "fr_CI", "fr_MA", "ka", "de", "de_AT", "de_CH", "el", "gu", "ha", "he", "hi", "hu", "id", "ga", "it", "ja", "kn", "kk", "rw_RW", "ko", "ky_KG", "lo", "lv", "lt", "mk", "ms", "ml", "mr", "nb", "ps_AF", "fa", "pl", "pt_BR", "pt_PT", "pa", "ro", "ru", "sr", "si_LK", "sk", "sl", "es", "es_AR", "es_CL", "es_CO", "es_CR", "es_DO", "es_EC", "es_HN", "es_MX", "es_PA", "es_PE", "es_ES", "es_UY", "sw", "sv", "ta", "te", "th", "th", "tr", "uk", "ur", "uz", "vi", "zu"]; type TemplateLanguage = (typeof TEMPLATE_LANGUAGES)[number]; //#endregion //#region src/types/Message/MessageType.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ declare enum MessageType { Audio = "audio", // for audio messages. Contacts = "contacts", // for contact messages. Document = "document", // for document messages. Image = "image", // for image messages. Interactive = "interactive", // for list and reply button messages. Location = "location", // for location messages. Reaction = "reaction", // for reaction messages. Sticker = "sticker", // for sticker messages. /** Not supported for Outgoing Messages. */ System = "system", /** Not supported for Outgoing Messages. */ Button = "button", /** Not supported for Outgoing Messages. */ Order = "order", Template = "template", // for template messages. Text and media (images and documents) message templates are supported. Text = "text", // for text messages. Video = "video", // for video messages Unsupported = "unsupported" } //#endregion //#region src/types/Message/MessageTemplate.d.ts type MessageTemplateComponentNamedParameter = { parameter_name: string; }; type MessageTemplateComponentPositionalParameter = { parameter_name?: never; }; type MessageTemplateButtonTextParameter = { type: "text"; /** * Developer-defined payload that is returned when the button is clicked in addition to the display text on the button. * * Required for `quick_reply` buttons. */ payload?: string; text?: string; } & T; type MessageTemplateButtonPayloadParameter = { type: "payload"; /** * Developer-defined payload that is returned when the button is clicked in addition to the display text on the button. * * Required for `quick_reply` buttons. */ payload?: string; /** * Developer-provided suffix that is appended to the predefined prefix URL in the template. * * Required for URL buttons. */ text?: string; } & T; type MessageTemplateTextParameter = { type: "text"; /** * The message’s text. Character limit varies based on the following included component type. * * For the header component type: * - 60 characters * * For the body component type: * - 1024 characters if other component types are included * - 32768 characters if body is the only component type included */ text: string; } & T; type MessageTemplateImageParameter = { type: MessageType.Image; [MessageType.Image]: Omit; } & T; type MessageTemplateDocumentParameter = { type: MessageType.Document; [MessageType.Document]: Omit; } & T; type MessageTemplateVideoParameter = { type: MessageType.Video; [MessageType.Video]: Omit; } & T; type MessageTemplateCurrencyParameter = { type: "currency"; currency: { /** Default text if localization fails. */fallback_value: string; /** Currency code as defined in ISO 4217. */ code: string; /** Amount multiplied by 1000. */ amount_1000: number; }; } & T; type MessageTemplateDateTimeParameter = { type: "date_time"; date_time: { /** Default text. For Cloud API, we always use the fallback value, and we do not attempt to localize using other optional fields. */fallback_value: string; }; } & T; type MessageTemplateHeaderLocationParameter = { type: "location"; location: { latitude: string; longitude: string; name: string; address: string; }; } & T; type MessageTemplateBodyParameter = MessageTemplateTextParameter | MessageTemplateImageParameter | MessageTemplateDocumentParameter | MessageTemplateVideoParameter | MessageTemplateCurrencyParameter | MessageTemplateDateTimeParameter; type MessageTemplateHeaderParameter = MessageTemplateTextParameter | MessageTemplateImageParameter | MessageTemplateDocumentParameter | MessageTemplateVideoParameter | MessageTemplateCurrencyParameter | MessageTemplateDateTimeParameter | MessageTemplateHeaderLocationParameter; type MessageTemplateButtonParameter = MessageTemplateButtonPayloadParameter | MessageTemplateButtonTextParameter; declare const MESSAGE_TEMPLATE_COMPONENT_TYPES: readonly ["header", "body", "footer", "button"]; type MessageTemplateComponentType = (typeof MESSAGE_TEMPLATE_COMPONENT_TYPES)[number]; type BaseMessageTemplateComponent = T; type HeaderMessageTemplateComponent = BaseMessageTemplateComponent<{ type: "header"; parameters: MessageTemplateHeaderParameter[]; }>; type BodyMessageTemplateComponent = BaseMessageTemplateComponent<{ type: "body"; parameters: MessageTemplateBodyParameter[]; }>; type ButtonMessageTemplateComponent = BaseMessageTemplateComponent<{ type: "button"; /** Numeric string */ index: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"; } & ({ sub_type: "quick_reply"; parameters: (MessageTemplateButtonParameter & { payload: Required["payload"]>; })[]; } | { sub_type: "url"; parameters: (MessageTemplateButtonParameter & { text: Required["text"]>; })[]; })>; type MessageTemplateComponent = HeaderMessageTemplateComponent | BodyMessageTemplateComponent | ButtonMessageTemplateComponent; type CreateMessageTemplate = { /** Name of the template. */name: string; /** Specifies the language the template may be rendered in. */ language: { /** * The language policy the message should follow. * * @see https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#language-policy-options */ policy?: "deterministic"; /** * The code of the language or locale to use. * * Accepts both language and language_locale formats (e.g., en and en_US). * * @see https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages */ code: TemplateLanguage; }; /** Array of components objects containing the parameters of the message. */ components: MessageTemplateComponent[] | MessageTemplateComponent[]; /** * Namespace of the template. * * @deprecated Used by On-Premises API Only */ namespace?: string; }; //#endregion //#region src/types/Message/MessageText.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ type CreateMessageText = { body: string; preview_url?: boolean; }; type EventNotificationMessageText = { body: string; }; //#endregion //#region src/types/Message/MessageUnsupported.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ type EventNotificationMessageUnsupported = { type: string; }; //#endregion //#region src/types/Message/index.d.ts /** * WhatsApp Message ID. * This ID likely starts with `wamid.`. */ type MessageID = `wamid.${string}` | (string & NonNullable); type MessageStatusType = "read" | (string & NonNullable); type MessageRecipientType = "individual" | "group" | (string & NonNullable); type BaseCreateMessageOptions = { phoneNumberID: PhoneNumberID; /** * WhatsApp ID or phone number of the customer you want to send a message to. */ to: PhoneNumberID | PhoneNumberString; /** * Currently, you can only send messages to individuals. * * @default "individual" * @see {@link https://developers.facebook.com/docs/graph-api/reference/whats-app-business-account-to-number-current-status/messages/#parameters} */ recipientType?: MessageRecipientType; /** * Required if replying to any message in the conversation. */ context?: { inReplyTo: MessageID; }; /** * An arbitrary 256B string, useful for tracking. For example, you could pass * the message template ID in this field to track your customer's journey * starting from the first message you send. You could then track the ROI of * different message template types to determine the most effective one. * * Any app subscribed to the messages webhook field on the WhatsApp Business * Account can get this string, as it is included in statuses object within * webhook payloads. * * Cloud API does not process this field, it just returns it as part of * sent/delivered/read message webhooks. * * @since November 14, 2023 */ biz_opaque_callback_data?: string; } & T; type CreateAudioMessageOptions = BaseCreateMessageOptions<{ type: MessageType.Audio; [MessageType.Audio]: Omit; }>; type CreateContactsMessageOptions = BaseCreateMessageOptions<{ type: MessageType.Contacts; [MessageType.Contacts]: CreateMessageContact[]; }>; type CreateDocumentMessageOptions = BaseCreateMessageOptions<{ type: MessageType.Document; [MessageType.Document]: CreateMessageMedia; }>; type CreateImageMessageOptions = BaseCreateMessageOptions<{ type: MessageType.Image; [MessageType.Image]: CreateMessageMedia; }>; type CreateInteractiveMessageOptions = BaseCreateMessageOptions<{ type: MessageType.Interactive; [MessageType.Interactive]: unknown; }>; type CreateLocationMessageOptions = BaseCreateMessageOptions<{ type: MessageType.Location; [MessageType.Location]: CreateMessageLocation; }>; type CreateReactionMessageOptions = BaseCreateMessageOptions<{ type: MessageType.Reaction; [MessageType.Reaction]: Omit; }>; type CreateStickerMessageOptions = BaseCreateMessageOptions<{ type: MessageType.Sticker; [MessageType.Sticker]: Omit; }>; type CreateTemplateMessageOptions = BaseCreateMessageOptions<{ type: MessageType.Template; [MessageType.Template]: CreateMessageTemplate; }>; type CreateTextMessageOptions = BaseCreateMessageOptions<{ type: MessageType.Text; [MessageType.Text]: CreateMessageText; }>; type CreateVideoMessageOptions = BaseCreateMessageOptions<{ type: MessageType.Video; [MessageType.Video]: CreateMessageMedia; }>; type CreateMessageOptions = CreateAudioMessageOptions | CreateContactsMessageOptions | CreateDocumentMessageOptions | CreateImageMessageOptions | CreateInteractiveMessageOptions | CreateLocationMessageOptions | CreateReactionMessageOptions | CreateStickerMessageOptions | CreateTemplateMessageOptions | CreateTextMessageOptions | CreateVideoMessageOptions; type CreateMessagePayload = { messaging_product: "whatsapp"; contacts: { input: PhoneNumberString; wa_id: AccountID; }[]; messages: { id: MessageID; message_status: "accepted" | "held_for_quality_assessment"; }[]; error: WhatsappError; }; type EventNotificationMessageMessageBase = { type: T; } & { [K in T]: O }; type EventNotificationMessageMessage = EventNotificationMessageMessageBase> | EventNotificationMessageMessageBase | EventNotificationMessageMessageBase | EventNotificationMessageMessageBase | EventNotificationMessageMessageBase | EventNotificationMessageMessageBase | EventNotificationMessageMessageBase | EventNotificationMessageMessageBase | EventNotificationMessageMessageBase | EventNotificationMessageMessageBase & { animated: boolean; }> | EventNotificationMessageMessageBase | EventNotificationMessageMessageBase> | EventNotificationMessageMessageBase | EventNotificationMessageMessageBase; //#endregion //#region src/types/Status.d.ts type CreateStatusOptions = { phoneNumberID: PhoneNumberID; message_id: MessageID; status: MessageStatusType; typing_indicator?: { type: "text"; }; [key: string]: unknown | undefined; }; type CreateStatusPayload = { success?: boolean; error: WhatsappError; }; //#endregion //#region src/Message/index.d.ts interface MethodOptions$4 { request?: Options; } declare class Message { protected _transport: KyInstance; constructor(_transport: KyInstance); protected getEndpoint(phoneNumberID: PhoneNumberID): string; /** * Create a Status Message. * * ```ts * const message = await sdk.message.createStatus({ * phoneNumberID: "123...809", * message_id: "...", * status: "read", * typing_indicator: { type: "text" }, * }); * ``` */ createStatus({ phoneNumberID, request, ...status }: MethodOptions$4 & CreateStatusOptions): _$ky.ResponsePromise; /** * Create a Message. * * ```ts * const message = await sdk.message.createMessage({ * phoneNumberID: "123...809", * to: "1234567890", * type: "text", * text: { body: "Hello" }, * }); * ``` */ createMessage({ phoneNumberID, recipientType, request, ...message }: MethodOptions$4 & CreateMessageOptions): _$ky.ResponsePromise; } //#endregion //#region src/types/WhatsappBusinessAccount/index.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ /** @deprecated use WhatsappBusinessAccountID */ type BusinessAccountID = WhatsappBusinessAccountID; /** WhatsApp Business Account ID */ type WhatsappBusinessAccountID = string; declare const WHATSAPP_BUSINESS_ACCOUNT_MESSAGE_ELIGIBILITY: readonly ["BLOCKED", "LIMITED", "AVAILABLE"]; type WhatsappBusinessAccountMessageEligibility = (typeof WHATSAPP_BUSINESS_ACCOUNT_MESSAGE_ELIGIBILITY)[number]; declare const WHATSAPP_BUSINESS_ACCOUNT_VERIFICATION_STATUS: readonly ["not_verified", "expired", "failed", "ineligible", "pending", "pending_need_more_info", "pending_submission", "rejected", "revoked", "verified"]; type WhatsappBusinessAccountVerificationStatus = (typeof WHATSAPP_BUSINESS_ACCOUNT_VERIFICATION_STATUS)[number]; type WhatsappBusinessAccountFields = "account_review_status" | "id" | "name" | "message_template_namespace" | "currency" | "on_behalf_of_business_info" | "primary_funding_id" | "purchase_order_number" | "timezone_id" | "owner_business_info" | "business_verification_status" | "country" | "currency" | "health_status" | "is_enabled_for_insights" | "marketing_messages_lite_api_status" | "marketing_messages_onboarding_status" | "ownership_type" | "status"; type WhatsappBusinessAccount = { id: WhatsappBusinessAccountID; name: string; account_review_status: string; message_template_namespace?: string; timezone_id: string; owner_business_info: { id: string; name: string; }; on_behalf_of_business_info?: { id: string; name: string; status: string; type: string; }; business_verification_status: WhatsappBusinessAccountVerificationStatus; country?: string; currency: string; is_enabled_for_insights: boolean; is_shared_with_partners?: boolean; primary_funding_id?: string; purchase_order_number?: string; marketing_messages_lite_api_status: "INELIGIBLE" | "ELIGIBLE" | "ONBOARDED" | "UNKNOWN"; marketing_messages_onboarding_status: "INELIGIBLE_ON_BEHALF_OF_WABA" | "INELIGIBLE_INACTIVE_OR_RESTRICTED" | "INELIGIBLE_COUNTRY_NOT_SUPPORTED" | "INELIGIBLE_USING_WHATSAPP_BUSINESS_APP" | "ELIGIBLE" | "PENDING_VALID_PAYMENT_METHOD" | "PENDING_INTERNAL_SETUP" | "ONBOARDED"; ownership_type: "CLIENT_OWNED" | unknown; status: "ACTIVE"; health_status: { can_send_message: WhatsappBusinessAccountMessageEligibility; entities: { id: string; entity_type: // | "PHONE_NUMBER" "WABA" | "BUSINESS" | "APP" | (string & NonNullable); can_send_message: WhatsappBusinessAccountMessageEligibility; additional_info?: string[]; errors?: { error_code?: string; error_description: string; possible_solution?: string; }[]; }[]; }; }; type GetWhatsappBusinessAccountOptions = { fields?: WhatsappBusinessAccountFields[]; }; type GetWhatsappBusinessAccountPayload = WhatsappBusinessAccount; //#endregion //#region src/types/PhoneNumbers/index.d.ts type PhoneNumberFields = "id" | "account_mode" | "code_verification_status" | "conversational_automation" | "display_phone_number" | "quality_rating" | "verified_name" | "name_status" | "eligibility_for_api_business_global_search" | "health_status" | "is_official_business_account" | "is_on_biz_app" | "is_pin_enabled" | "is_preverified_number" | "last_onboarded_time" | "messaging_limit_tier" | "platform_type" | "quality_score" | "status" | "throughput" | "webhook_configuration" | ["whatsapp_business_profile", BusinessProfileFields[]]; declare const PHONE_NUMBER_STATUS: readonly ["PENDING", "DELETED", "MIGRATED", "BANNED", "RESTRICTED", "RATE_LIMITED", "FLAGGED", "CONNECTED", "DISCONNECTED", "UNKNOWN", "UNVERIFIED"]; type PhoneNumberStatus = (typeof PHONE_NUMBER_STATUS)[number]; declare const PHONE_NUMBER_CODE_VERIFICATION_STATUS: readonly ["VERIFIED", "NOT_VERIFIED", "EXPIRED"]; type PhoneNumberCodeVerificationStatus = (typeof PHONE_NUMBER_CODE_VERIFICATION_STATUS)[number]; declare const PHONE_NUMBER_MESSAGE_ELIGIBILITY: readonly ["BLOCKED", "LIMITED", "AVAILABLE"]; type PhoneNumberMessageEligibility = (typeof PHONE_NUMBER_MESSAGE_ELIGIBILITY)[number]; declare const PHONE_NUMBER_QUALITY_RATING: readonly ["UNKNOWN", "RED", "YELLOW", "GREEN"]; type PhoneNumberQualityRating = (typeof PHONE_NUMBER_QUALITY_RATING)[number]; declare const PHONE_NUMBER_MESSAGING_LIMIT_TIER: readonly ["TIER_50", "TIER_250", "TIER_1K", "TIER_10K", "TIER_100K", "TIER_UNLIMITED"]; type PhoneNumberMessagingLimitTier = (typeof PHONE_NUMBER_MESSAGING_LIMIT_TIER)[number]; declare const PHONE_NUMBER_ACCOUNT_MODE: readonly ["LIVE", "SANDBOX"]; type PhoneNumberAccountMode = (typeof PHONE_NUMBER_ACCOUNT_MODE)[number]; declare const PHONE_NUMBER_NAME_STATUS: readonly ["APPROVED", "DECLINED", "EXPIRED", "PENDING_REVIEW", "AVAILABLE_WITHOUT_REVIEW", "NONE"]; type PhoneNumberNameStatus = (typeof PHONE_NUMBER_NAME_STATUS)[number]; declare const PHONE_NUMBER_PLATFORM_TYPE: readonly ["CLOUD_API", "ON_PREMISE", "NOT_APPLICABLE"]; type PhoneNumberPlatformType = (typeof PHONE_NUMBER_PLATFORM_TYPE)[number]; declare const PHONE_NUMBER_THROUGHPUT_LEVEL: readonly ["STANDARD", "HIGH", "NOT_APPLICABLE"]; type PhoneNumberThroughputLevel = (typeof PHONE_NUMBER_THROUGHPUT_LEVEL)[number]; type PhoneNumber = { id: string; status: PhoneNumberStatus; account_mode: PhoneNumberAccountMode; platform_type: PhoneNumberPlatformType; messaging_limit_tier: PhoneNumberMessagingLimitTier; code_verification_status: PhoneNumberCodeVerificationStatus; quality_rating: PhoneNumberQualityRating; display_phone_number: string; name_status: PhoneNumberNameStatus; verified_name: string; is_official_business_account: boolean; is_on_biz_app: boolean; is_pin_enabled: boolean; is_preverified_number: boolean; /** This field may not be set for test phone numbers */ last_onboarded_time?: string; webhook_configuration?: { /** If this Phone Number's webhook configuration is overriden at the WABA level, this field will be set */whatsapp_business_account?: string; application: string; }; throughput: { level: PhoneNumberThroughputLevel; }; health_status: { can_send_message: PhoneNumberMessageEligibility; entities: { id: string; entity_type: "PHONE_NUMBER" | "WABA" | "BUSINESS" | "APP" | (string & NonNullable); can_send_message: PhoneNumberMessageEligibility; additional_info?: string[]; errors?: { error_code?: string; error_description: string; possible_solution?: string; }[]; }[]; }; whatsapp_business_profile: { data: [BusinessProfile]; }; }; type ListPhoneNumbersOptions = { businessAccountID: BusinessAccountID; sort?: string; filtering?: string; fields?: PhoneNumberFields[]; }; type ListPhoneNumbersPaylod = { data: PhoneNumber[]; }; type GetPhoneNumberOptions = { phoneNumberID: PhoneNumberID; fields?: PhoneNumberFields[]; }; type GetPhoneNumberPayload = PhoneNumber; type UpdatePhoneNumberOptions = { phoneNumberID: PhoneNumberID; new_display_name?: string; }; type UpdatePhoneNumberPayload = { success: boolean; }; //#endregion //#region src/PhoneNumbers/index.d.ts interface MethodOptions$3 { request?: Options; } declare class PhoneNumbers { protected _transport: KyInstance; constructor(_transport: KyInstance); getEndpoint(businessAccountID: WhatsappBusinessAccountID): string; getPhoneNumber({ phoneNumberID, fields, request }: MethodOptions$3 & GetPhoneNumberOptions): _$ky.ResponsePromise; listPhoneNumbers({ businessAccountID, sort, filtering, fields, request }: MethodOptions$3 & ListPhoneNumbersOptions): _$ky.ResponsePromise; updatePhoneNumber({ phoneNumberID, new_display_name, request }: MethodOptions$3 & UpdatePhoneNumberOptions): _$ky.ResponsePromise; } //#endregion //#region src/types/SubscribedApps/index.d.ts type CreateSubscriptionOptions = { businessAccountID: WhatsappBusinessAccountID; } & ({ override_callback_uri: string; verify_token: string; } | { override_callback_uri?: never; verify_token?: string; }); type CreateSubscriptionPayload = { success: boolean; }; type ListSubscriptionsOptions = { businessAccountID: WhatsappBusinessAccountID; }; type ListSubscriptionsPayload = { data: { whatsapp_business_api_data: { id: string; link?: string | null; name: string; }; }[]; }; //#endregion //#region src/SubscribedApps/index.d.ts interface MethodOptions$2 { request?: Options; } declare class SubscribedApps { protected _transport: KyInstance; constructor(_transport: KyInstance); protected getEndpoint(businessAccountID: BusinessAccountID): string; createSubscription({ businessAccountID, request, ...subscription }: MethodOptions$2 & CreateSubscriptionOptions): _$ky.ResponsePromise; listSubscriptions({ businessAccountID, request }: MethodOptions$2 & ListSubscriptionsOptions): _$ky.ResponsePromise; } //#endregion //#region src/types/Templates/TemplateButton.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ declare const TEMPLATE_MAX_BUTTONS = 10; declare const TEMPLATE_BUTTON_TYPES: readonly ["QUICK_REPLY", "COPY_CODE", "URL", "PHONE_NUMBER", "OTP", "MPM", "SPM", "CATALOG", "FLOW", "VOICE_CALL", "APP"]; type TemplateButtonType = (typeof TEMPLATE_BUTTON_TYPES)[number]; declare const CREATE_TEMPLATE_BUTTON_TYPES: readonly ["QUICK_REPLY", "COPY_CODE", "URL", "PHONE_NUMBER", "OTP", "MPM", "SPM", "CATALOG", "FLOW", "VOICE_CALL", "APP"]; type CreateTemplateButtonType = (typeof CREATE_TEMPLATE_BUTTON_TYPES)[number]; type TemplateButtonBase = T; type CreateTemplateButtonBase = T; type TemplateButton = QuickReplyTemplateButton | CopyCodeTemplateButton | URLTemplateButton | PhoneNumberTemplateButton | OTPTemplateButton | MPMTemplateButton | CatalogTemplateButton | FlowTemplateButton | VoiceCallTemplateButton | AppTemplateButton; type CreateTemplateButton = CreateQuickReplyTemplateButton | CreateCopyCodeTemplateButton | CreateURLTemplateButton | CreatePhoneNumberTemplateButton | CreateOTPTemplateButton | CreateMPMTemplateButton | CreateSPMTemplateButton | CreateOTPTemplateButton | CreateFlowTemplateButton; type QuickReplyTemplateButton = TemplateButtonBase<{ type: "QUICK_REPLY"; text: string; }>; type CreateQuickReplyTemplateButton = CreateTemplateButtonBase<{ type: "QUICK_REPLY"; text: string; }>; type CopyCodeTemplateButton = TemplateButtonBase<{ type: "COPY_CODE"; text: string; }>; type CreateCopyCodeTemplateButton = CreateTemplateButtonBase<{ type: "COPY_CODE"; text: string; example: string; }>; type URLTemplateButton = TemplateButtonBase<{ type: "URL"; text: string; url: string; }>; type CreateURLTemplateButton = CreateTemplateButtonBase<{ type: "URL"; text: string; url: string; example?: [string]; }>; type PhoneNumberTemplateButton = TemplateButtonBase<{ type: "PHONE_NUMBER"; text: string; phone_number: string; }>; type CreatePhoneNumberTemplateButton = CreateTemplateButtonBase<{ type: "PHONE_NUMBER"; text: string; phone_number: string; }>; type OTPTemplateButton = TemplateButtonBase<{ type: "OTP"; text?: string; otp_type: "COPY_CODE" | "ONE_TAP" | "ZERO_TAP"; zero_tap_terms_accepted: "TRUE" | "FALSE"; code_expiration_minutes: number; }>; type CreateOneTapOTPTemplateButton = CreateTemplateButtonBase<{ type: "OTP"; otp_type: "ONE_TAP"; supported_apps: { package_name: string; signature_hash: string; }[]; }>; type CreateCopyCodeOTPTemplateButton = CreateTemplateButtonBase<{ type: "OTP"; otp_type: "COPY_CODE"; }>; type CreateZeroTapOTPTemplateButton = CreateTemplateButtonBase<{ type: "OTP"; otp_type: "ZERO_TAP"; }>; type CreateOTPTemplateButton = CreateOneTapOTPTemplateButton | CreateCopyCodeOTPTemplateButton | CreateZeroTapOTPTemplateButton; type MPMTemplateButton = TemplateButtonBase<{ type: "MPM"; text?: string; }>; type CreateMPMTemplateButton = CreateTemplateButtonBase<{ type: "MPM"; text: string; }>; type SPMTemplateButton = TemplateButtonBase<{ type: never; }>; type CreateSPMTemplateButton = CreateTemplateButtonBase<{ type: "SPM"; text: string; }>; type CatalogTemplateButton = TemplateButtonBase<{ type: "CATALOG"; text?: string; }>; type FlowTemplateButton = TemplateButtonBase<{ type: "FLOW"; text?: string; }>; type CreateFlowTemplateButton = CreateTemplateButtonBase<{ type: "FLOW"; text: string; flow_id?: string; flow_name?: string; flow_json?: string; flow_action?: string; navigate_screen?: string; icon?: "DOCUMENT" | "PROMOTION" | "REVIEW"; }>; type VoiceCallTemplateButton = TemplateButtonBase<{ type: "VOICE_CALL"; text?: string; }>; type AppTemplateButton = TemplateButtonBase<{ type: "APP"; text?: string; }>; //#endregion //#region src/types/Templates/TemplateCategory.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ declare const TEMPLATE_CATEGORIES: readonly ["AUTHENTICATION", "MARKETING", "UTILITY"]; type TemplateCategory = (typeof TEMPLATE_CATEGORIES)[number]; declare const TEMPLATE_SUBCATEGORIES: readonly ["ORDER_DETAILS", "ORDER_STATUS"]; type TemplateSubcategory = (typeof TEMPLATE_SUBCATEGORIES)[number]; declare const TEMPLATE_INDUSTRIES: readonly ["E_COMMERCE", "FINANCIAL_SERVICES"]; type TemplateIndustry = (typeof TEMPLATE_INDUSTRIES)[number]; declare const TEMPLATE_TOPICS: readonly ["ACCOUNT_UPDATES", "CUSTOMER_FEEDBACK", "EVENT_REMINDER", "FIXED_TEMPLATE_PRICE_TEST", "IDENTITY_VERIFICATION", "ORDER_MANAGEMENT", "PAYMENTS"]; type TemplateTopic = (typeof TEMPLATE_TOPICS)[number]; declare const TEMPLATE_USECASES: readonly ["ACCOUNT_CREATION_CONFIRMATION", "PAYMENT_DUE_REMINDER", "FEEDBACK_SURVEY", "PAYMENT_ACTION_REQUIRED", "SHIPMENT_CONFIRMATION", "PAYMENT_OVERDUE", "DELIVERY_UPDATE", "PAYMENT_CONFIRMATION", "ORDER_DELAY", "FRAUD_ALERT", "DELIVERY_FAILED", "AUTO_PAY_REMINDER", "DELIVERY_CONFIRMATION", "PAYMENT_SCHEDULED", "ORDER_PICK_UP", "PAYMENT_REJECT_FAIL", "ORDER_ACTION_NEEDED", "STATEMENT_AVAILABLE", "ORDER_CONFIRMATION", "LOW_BALANCE_WARNING", "ORDER_OR_TRANSACTION_CANCEL", "RECEIPT_ATTACHMENT", "RETURN_CONFIRMATION", "STATEMENT_ATTACHMENT", "TRANSACTION_ALERT"]; type TemplateUseCase = (typeof TEMPLATE_USECASES)[number]; //#endregion //#region src/types/Templates/TemplateComponents.d.ts declare const TEMPLATE_COMPONENT_TYPES: readonly ["HEADER", "BODY", "FOOTER", "BUTTONS"]; type TemplateComponentType = (typeof TEMPLATE_COMPONENT_TYPES)[number]; type BaseTemplateComponent = T; type TemplateComponent = HeaderTemplateComponent | BodyTemplateComponent | FooterTemplateComponent | ButtonsTemplateComponent; declare const HEADER_TEMPLATE_COMPONENT_FORMATS: readonly ["TEXT", "IMAGE", "VIDEO", "DOCUMENT", "LOCATION"]; type HeaderTemplateComponentFormat = (typeof HEADER_TEMPLATE_COMPONENT_FORMATS)[number]; type BaseHeaderTemplateComponent = BaseTemplateComponent; type HeaderTemplateComponent = BaseTemplateComponent<{ type: "HEADER"; format: "TEXT"; text: string; example?: { header_text: [string[]]; header_text_named_params?: never; } | { header_text?: never; header_text_named_params: { param_name: string; example: string; }[]; }; }>; type CreateHeaderTemplateComponent = CreateTextHeaderTemplateComponent | CreateImageHeaderTemplateComponent | CreateVideoHeaderTemplateComponent | CreateDocumentHeaderTemplateComponent | CreateLocationHeaderTemplateComponent; type CreateTextHeaderTemplateComponent = BaseHeaderTemplateComponent<{ type: "HEADER"; format: "TEXT"; text: string; example?: { header_text: string[]; header_text_named_params?: never; } | { header_text?: never; header_text_named_params: { param_name: string; example: string; }[]; }; }>; type CreateMediaHeaderTemplateComponent = BaseHeaderTemplateComponent<{ type: "HEADER"; format: T; example: { header_handle: [string]; }; }>; type CreateImageHeaderTemplateComponent = CreateMediaHeaderTemplateComponent<"IMAGE">; type CreateVideoHeaderTemplateComponent = CreateMediaHeaderTemplateComponent<"VIDEO">; type CreateDocumentHeaderTemplateComponent = CreateMediaHeaderTemplateComponent<"DOCUMENT">; type CreateLocationHeaderTemplateComponent = BaseHeaderTemplateComponent<{ type: "HEADER"; format: "LOCATION"; }>; type BodyTemplateComponent = BaseTemplateComponent<{ type: "BODY"; text: string; example?: { body_text: [string[]]; body_text_named_params?: never; } | { body_text?: never; body_text_named_params: { param_name: string; example: string; }[]; }; }>; type CreateBodyTemplateComponent = BaseTemplateComponent<{ type: "BODY"; text: string; add_security_recommendation?: boolean; example?: { body_text: string[]; body_text_named_params?: never; } | { body_text?: never; body_text_named_params: { param_name: string; example: string; }[]; }; }>; type FooterTemplateComponent = BaseTemplateComponent<{ type: "FOOTER"; text: string; }>; type CreateFooterTemplateComponent = BaseTemplateComponent<{ type: "FOOTER"; text: string; code_expiration_minutes?: number; }>; type ButtonsTemplateComponent = BaseTemplateComponent<{ type: "BUTTONS"; buttons: TemplateButton[]; }>; type CreateButtonsTemplateComponent = BaseTemplateComponent<{ type: "BUTTONS"; buttons: CreateTemplateButton[]; }>; type CreateTemplateComponent = CreateHeaderTemplateComponent | CreateBodyTemplateComponent | CreateFooterTemplateComponent | CreateButtonsTemplateComponent; //#endregion //#region src/types/Templates/TemplateStatus.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ declare const TEMPLATE_STATUSES: readonly ["PENDING", "APPROVED", "REJECTED", "IN_APPEAL", "PAUSED", "PENDING_DELETION", "DELETED", "DISABLED", "LIMIT_EXCEEDED"]; type TemplateStatus = (typeof TEMPLATE_STATUSES)[number]; declare const TEMPLATE_QUALITY_SCORES: readonly ["GREEN", "YELLOW", "RED", "UNKNOWN"]; type TemplateQualityScore = (typeof TEMPLATE_QUALITY_SCORES)[number]; declare const TEMPLATE_REJECTION_REASONS: readonly ["ABUSIVE_CONTENT", "INVALID_FORMAT", "PROMOTIONAL", "TAG_CONTENT_MISMATCH", "SCAM", "NONE"]; type TemplateRejectionReason = (typeof TEMPLATE_REJECTION_REASONS)[number]; declare const TEMPLATE_PARAMETER_FORMATS: readonly ["POSITIONAL", "NAMED"]; type TemplateParameterFormat = (typeof TEMPLATE_PARAMETER_FORMATS)[number]; //#endregion //#region src/types/Templates/index.d.ts type AccountTemplate = { id: string; name: string; category: TemplateCategory; correct_category?: TemplateCategory; sub_category?: TemplateSubcategory; previous_category?: TemplateCategory; status: TemplateStatus; rejected_reason: TemplateRejectionReason; cta_url_link_tracking_opted_out: boolean; library_template_name?: string; message_send_ttl_seconds?: number; parameter_format: TemplateParameterFormat; language: TemplateLanguage; quality_score: { /** Uses seconds since epoch */date: number; score: TemplateQualityScore; }; components: TemplateComponent[]; }; type LibraryTemplate = { /** Unique identifier for the template */id: string; /** Name of the template (unique per account, lowercase, underscores allowed) */ name: string; /** Language code for the template (e.g., 'en_US') */ language: TemplateLanguage; /** Category of the template (e.g., AUTHENTICATION, MARKETING, UTILITY) */ category: TemplateCategory; /** Topic of the template, used for classification */ topic: TemplateTopic; /** Use case for the template (e.g., ACCOUNT_CREATION_CONFIRMATION) */ usecase: TemplateUseCase; /** List of industries relevant to the template */ industry: TemplateIndustry[]; /** Header text of the template (optional, can be text, image, video, or document) */ header: string; /** Body text of the template (supports parameters, required) */ body: string; /** Optional list of parameter names used in the body */ body_params?: string[]; /** Types of parameters used in the body (e.g., TEXT, NUMBER, DATE) */ body_param_types: ("TEXT" | "ADDRESS" | "AMOUNT" | "DATE" | "PHONE NUMBER" | "EMAIL" | "NUMBER")[]; /** Array of buttons (quick replies, URLs, phone numbers, etc.) associated with the template */ buttons: TemplateButton[]; }; type GetTemplateFields = "name" | "parameter_format" | "components" | "category" | "correct_category" | "previous_category" | "sub_category" | "rejected_reason" | "language" | "library_template_name" | "quality_score" | "status"; type GetTemplateOptions = { fields?: GetTemplateFields[]; }; type GetTemplatePayload = AccountTemplate; type ListTemplatesFields = GetTemplateFields; type ListTemplatesOptions = { name_or_content?: string; category?: TemplateCategory | TemplateCategory[]; language?: TemplateLanguage | TemplateLanguage[]; status?: TemplateStatus | TemplateStatus[]; quality_score?: TemplateQualityScore | TemplateQualityScore[]; limit?: number; fields?: ListTemplatesFields[]; }; type ListTemplatesPayload = { data: AccountTemplate[]; paging: { cursors?: { before?: string; after?: string; }; }; }; type ListLibraryTemplatesOptions = { search?: string; category?: TemplateCategory | TemplateCategory[]; language?: TemplateLanguage | TemplateLanguage[]; topic?: TemplateTopic | TemplateTopic[]; usecase?: TemplateUseCase | TemplateUseCase[]; industry?: TemplateIndustry | TemplateIndustry[]; limit?: number; }; type ListLibraryTemplatesPayload = LibraryTemplate[]; type CreateCustomTemplateOptions = { parameter_format: TemplateParameterFormat; components?: CreateTemplateComponent[]; library_template_name?: never; library_template_button_inputs?: never; }; type CreateLibraryTemplateOptions = { library_template_name: string; /** Use `JSON.stringify([...])` to stringify */ library_template_button_inputs?: string; components?: never; parameter_format?: never; }; type CreateTemplateBaseOptions = { name: string; /** Set to "UTILITY" for Library Templates */ category: TemplateCategory; language: TemplateLanguage; add_contact_number?: boolean; add_learn_more_link?: boolean; add_security_recommendation?: boolean; add_track_package_link?: boolean; code_expiration_minutes?: number; /** @deprecated */ allow_category_change?: boolean; }; type CreateTemplateOptions = CreateTemplateBaseOptions & (CreateCustomTemplateOptions | CreateLibraryTemplateOptions); type CreateTemplatePayload = { id: string; status: TemplateStatus; category: TemplateCategory; }; type UpdateTemplateOptions = { category?: TemplateCategory; components?: CreateTemplateComponent[]; }; type UpdateTemplatePayload = { success: boolean; }; type DeleteTemplateOptions = { hsm_id?: string; name: string; }; type DeleteTemplatePayload = { success: boolean; }; //#endregion //#region src/Template/index.d.ts interface MethodOptions$1 { request?: Options; } declare class Template { protected _transport: KyInstance; constructor(_transport: KyInstance); protected getEndpoint(businessAccountID: WhatsappBusinessAccountID): string; /** * Get a Template. * * ```ts * const template = await sdk.template.get( * "123...456", * { fields: { name: true } } * ); * ``` */ get(templateID: string, { fields, request }: MethodOptions$1 & GetTemplateOptions): _$ky.ResponsePromise; /** * List Templates. * * ```ts * const templates = await sdk.template.list( * "123...456", * { fields: { name: true } } * ); * ``` */ list(businessAccountID: WhatsappBusinessAccountID, { name_or_content, category, language, status, quality_score, limit, fields, request }: MethodOptions$1 & ListTemplatesOptions): _$ky.ResponsePromise; /** * List Library Templates. * * ```ts * const libraryTemplates = await sdk.template.listLibrary(); * ``` */ listLibrary({ search, category, language, topic, usecase, industry, limit, request }: MethodOptions$1 & ListLibraryTemplatesOptions): _$ky.ResponsePromise; /** * Create a Template. * * ```ts * const { id } = await sdk.template.create( * "123...456", * { * name: "example_template_1", * library_template_name: "hello_world_1", * category: "UTILITY", * language: "en_US", * } * ); * ``` */ create(businessAccountID: WhatsappBusinessAccountID, { request, ...template }: MethodOptions$1 & CreateTemplateOptions): _$ky.ResponsePromise; /** * Update a Template. * * ```ts * const { success } = await sdk.template.delete( * "123...456", * { * category: "UTILITY", * components: [ * { * type: "TEXT", * text: "Hello, world!" * } * ] * } * ); * ``` */ update(templateID: string, { request, ...template }: MethodOptions$1 & UpdateTemplateOptions): _$ky.ResponsePromise; /** * Delete a Template. * * ```ts * const { success } = await sdk.template.delete( * "123...456", * { * hsm_id: "optional-template-id", * name: "required-template-name", * } * ); * ``` */ delete(businessAccountID: WhatsappBusinessAccountID, { request, ...template }: MethodOptions$1 & DeleteTemplateOptions): _$ky.ResponsePromise; } //#endregion //#region src/types/Message/MessageIdentity.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ type EventNotificationMessageIdentity = { /** * State of acknowledgment for the messages system customer_identity_changed. */ acknowledged: string; /** * The time when the WhatsApp Business Management API detected the customer * may have changed their profile information. */ created_timestamp: string; /** * The ID for the messages system customer_identity_changed. */ hash: string; }; //#endregion //#region src/types/Message/MessageReferral.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ type EventNotificationMessageReferral = { /** * The Meta URL that leads to the ad or post clicked by the customer. Opening * this URL takes you to the ad viewed by your customer. */ source_url: string; /** * The type of the ad's source. */ source_type: "ad" | "post" | (string & NonNullable); /** * Meta ID for an ad or a post. */ source_id: string; /** * Headline used in the ad or post. */ headline: string; /** * Body for the ad or post. */ body: string; /** * Media present in the ad or post. */ media_type: "image" | "video" | (string & NonNullable); /** * URL of the image, when media_type is an image. */ image_url: URL; /** * URL of the video, when media_type is a video. */ video_url: URL; /** * URL for the thumbnail, when media_type is a video. */ thumbnail_url: URL; /** * Click ID generated by Meta for ads that click to WhatsApp. * * @since September 27, 2023 */ ctwa_clid?: string; }; //#endregion //#region src/types/Webhook/WebhookEventNotification.d.ts type ConversationType = "authentication" | "marketing" | "utility" | "service" | "referral_conversation" | (string & NonNullable); type WebhookEventNotificationMessagesChanges = { /** Notification type. Value will be messages. */field: "messages"; /** A value object. */ value: { /** * Array of contact objects with information for the customer who sent a * message to the business. */ contacts: { /** * The customer's WhatsApp ID. A business can respond to a customer using * this ID. This ID may not match the customer's phone number, which is * returned by the API as input when sending a message to the customer. */ wa_id: AccountID; /** Additional unique, alphanumeric identifier for a WhatsApp user. */ user_id?: string; /** A customer profile object. */ profile: { /** The customer's name. */name: string; }; }[]; /** An array of error objects describing the error. */ errors: WhatsappError[]; /** * Product used to send the message. Value is always whatsapp. * * @default 'whatsapp' */ messaging_product: "whatsapp"; /** * Information about a message received by the business that is subscribed to * the webhook. */ messages?: ({ /** * The ID for the message that was received by the business. You could use * messages endpoint to mark this specific message as read. */ id: MessageID; /** * Unix timestamp indicating when the WhatsApp server received the message * from the customer. */ timestamp: string; /** * The customer's WhatsApp ID. A business can respond to a customer using * this ID. This ID may not match the customer's phone number, which is * returned by the API as input when sending a message to the customer. */ from: AccountID; /** * Context object. Only included when a user replies or interacts with one of * your messages. */ context?: { /** Set to true if the message received by the business has been forwarded. */forwarded: boolean; /** * Set to true if the message received by the business has been forwarded * more than 5 times. */ frequently_forwarded: boolean; /** The WhatsApp ID for the customer who replied to an inbound message. */ from: AccountID; /** The message ID for the sent message for an inbound reply. */ id: MessageID; /** * Referred product object describing the product the user is requesting * information about. You must parse this value if you support Product * Enquiry Messages. */ referred_product: { /** * Unique identifier of the Meta catalog linked to the WhatsApp Business * Account. */ catalog_id: string; /** Unique identifier of the product in a catalog. */ product_retailer_id: string; }; }; /** An array of error objects describing the error. */ errors?: WhatsappError[]; /** * An identity object. Webhook is triggered when a customer's phone number or * profile information has been updated. */ identity: EventNotificationMessageIdentity; /** * Referral object. When a customer clicks an ad that redirects to WhatsApp, * this object is included in the messages object. */ referral?: EventNotificationMessageReferral; } & EventNotificationMessageMessage)[]; /** * A metadata object describing the business subscribed to the webhook. */ metadata: { /** The phone number that is displayed for a business. */display_phone_number: PhoneNumberString; /** * ID for the phone number. A business can respond to a message using this * ID. */ phone_number_id: PhoneNumberID; }; /** * Status object for a message that was sent by the business that is * subscribed to the webhook. */ statuses?: { /** * The ID for the message that the business that is subscribed to the * webhooks sent to a customer. */ id: MessageID; /** * The customer's WhatsApp ID. A business can respond to a customer using * this ID. This ID may not match the customer's phone number, which is * returned by the API as input when sending a message to the customer. */ recipient_id: AccountID; /** * For a status to be read, it must have been delivered. In some scenarios, * such as when a user is in the chat screen and a message arrives, the * message is delivered and read almost simultaneously. In this or other * similar scenarios, the delivered notification will not be sent back, as it * is implied that a message has been delivered if it has been read. The * reason for this behavior is internal optimization. */ status: "delivered" | "read" | "sent" | "failed"; /** Date for the status message. */ timestamp: number; /** An object containing pricing information. */ pricing: { /** Indicates the conversation category. */category: ConversationType; /** Type of pricing model used by the business. */ pricing_model: "CBP" | (string & NonNullable); /** * Indicates if the given message or conversation is billable. Default is * true for all conversations, including those inside your free tier limit, * except those initiated from free entry points. Free entry point * conversation are not billable, false. You will not be charged for free * tier limit conversations, but they are considered billable and will be * reflected on your invoice. * * @deprecated */ billable: boolean; }; /** Information about the conversation. */ conversation: { /** * Represents the ID of the conversation the given status notification * belongs to. */ id: string; /** * Date when the conversation expires. This field is only present for * messages with a `status` set to `sent`. */ expiration_timestamp?: number; /** Describes conversation category. */ origin: { /** * Indicates conversation category. This can also be referred to as a * conversation entry point. */ type: ConversationType; }; }; /** Arbitrary string included in sent message. */ biz_opaque_callback_data?: string; }[]; }; }; type WebhookEventNotificationAccountUpdateChanges = { field: "account_update"; value: { event: "PARTNER_APP_INSTALLED" | (string & NonNullable); phone_number?: string; ban_info?: { waba_ban_state: string; waba_ban_date: string; }; /** Information about a violation on the account */ violation_info?: { violation_type: string; }; lock_info?: { expiration: string | number; }; /** Information about the restrictions on the account */ restriction_info?: { restriction_type: string; expiration: string | number; }; /** Business verification status */ business_verification_status: string; /** Information about the status of the partner's self certification for a client */ partner_client_certification_info?: { client_business_id: string; /** Status of certification */ status: "PENDING" | "APPROVED" | "FAILED" | "DISCARDED" | "REVOKED"; /** List of rejection reasons for why the request did not pass verification. */ rejection_reasons: ("LEGAL NAME NOT MATCHING" | "WEBSITE NOT MATCHING" | "NONE" | "BUSINESS NOT ELIGIBLE" | "LEGAL NAME NOT FOUND IN DOCUMENTS" | "MALFORMED DOCUMENTS" | "ADDRESS NOT MATCHING")[]; }; /** Information about a waba for business webhooks */ waba_info: { waba_id: AccountID; /** WABA owner business ID */ owner_business_id: WhatsappBusinessAccountID; /** The id of the solution through which this WABA was onboarded */ solution_id?: string; /** List of partner business ids part of the solution */ solution_partner_business_ids?: string[]; is_obo_to_shared_migrated?: boolean; ad_account_id?: string; partner_data?: string; partner_app_id: string; }; /** List of countries where two tier price wll be enforced on different time. */ auth_international_rate_eligibility?: { /** The unixtimestamp when the business will be enforced on the two tier pricing for the autentication message. */start: number; exception_countries: { /** Country code for the country where the two tier price will be enforced on a different time stamp. */country_code: string; /** The actual timestamp that two tier price will be enforced on the country */ start_time: number; }[]; }; }; }; type WebhookEventNotificationAccountAlertsChanges = { field: "account_alerts"; }; type WebhookEventNotificationMessageTemplateCategoryUpdateChanges = { field: "template_category_update"; value: { message_template_id: number; message_template_name: string; message_template_language: TemplateLanguage; previous_category: TemplateCategory; new_category: TemplateCategory; correct_category: TemplateCategory; }; }; type WebhookEventNotificationMessageTemplateComponentsUpdateChanges = { field: "message_template_components_update"; value: { message_template_id: number; message_template_name: string; message_template_language: string; message_template_title: string; message_template_element: string; message_template_footer: string; message_template_buttons: { message_template_button_type: TemplateButtonType; message_template_button_text: string; message_template_button_url?: string; message_template_button_phone_number?: string; }[]; }; }; type WebhookEventNotificationMessageTemplateQualityUpdateChanges = { field: "message_template_quality_update"; value: { message_template_id: number; message_template_name: string; message_template_language: string; previous_quality_score: TemplateQualityScore; new_quality_score: TemplateQualityScore; }; }; declare const TEMPLATE_STATUS_UPDATE_EVENTS: readonly ["APPROVED", "DISABLED", "IN_APPEAL", "PENDING", "REINSTATED", "REJECTED", "FLAGGED"]; type TemplateStatusUpdateEvent = (typeof TEMPLATE_STATUS_UPDATE_EVENTS)[number]; declare const TEMPLATE_STATUS_UPDATE_REASONS: readonly ["ABUSIVE_CONTENT", "INCORRECT_CATEGORY", "INVALID_FORMAT", "NONE", "SCAM"]; type TemplateStatusUpdateReason = (typeof TEMPLATE_STATUS_UPDATE_REASONS)[number]; type WebhookEventNotificationMessageTemplateStatusUpdateChanges = { field: "message_template_status_update"; value: { message_template_id: number; message_template_name: string; message_template_language: string; event: TemplateStatusUpdateEvent; reason: TemplateStatusUpdateReason; disable_info?: { disable_date: string; }; other_info?: { title?: string; description?: string; }; }; }; type WebhookEventNotificationPhoneNumberNameUpdateChanges = { field: "phone_number_name_update"; value: { display_phone_number: string; decision: string; requested_verified_name?: string; rejection_reason: string; }; }; type WebhookEventNotificationPhoneNumberQualityUpdateChanges = { field: "phone_number_quality_update"; value: { display_phone_number: string; event: string; current_limit: PhoneNumberMessagingLimitTier; old_limit: PhoneNumberMessagingLimitTier; max_daily_conversations_per_business: string; }; }; type WebhookEventNotificationAccountReviewUpdateChanges = { field: "account_review_update"; value: { decision: string; }; }; type WebhookEventNotificationPaymentConfigurationUpdateChanges = { field: "payment_configuration_update"; value: { configuration_name: string; provider_name: string; provider_mid: string; status: string; created_timestamp: number; updated_timestamp: number; }; }; type WebhookEventNotificationCallsChanges = { field: "calls"; }; type WebhookEventNotification = { /** * The specific webhook a business is subscribed to. The webhook is * whatsapp_business_account. */ object: string; /** An array of entry objects. */ entry: { /** * The WhatsApp Business Account ID for the business that is subscribed to * the webhook. */ id: WhatsappBusinessAccountID; /** An array of change objects. */ changes: (WebhookEventNotificationMessagesChanges | WebhookEventNotificationAccountUpdateChanges | WebhookEventNotificationAccountReviewUpdateChanges | WebhookEventNotificationAccountAlertsChanges | WebhookEventNotificationMessageTemplateStatusUpdateChanges | WebhookEventNotificationMessageTemplateCategoryUpdateChanges | WebhookEventNotificationMessageTemplateComponentsUpdateChanges | WebhookEventNotificationMessageTemplateQualityUpdateChanges | WebhookEventNotificationPhoneNumberNameUpdateChanges | WebhookEventNotificationPhoneNumberQualityUpdateChanges | WebhookEventNotificationPaymentConfigurationUpdateChanges | WebhookEventNotificationCallsChanges)[]; }[]; }; //#endregion //#region src/Webhook/WebhookError/index.d.ts /** * WhatsApp NodeJS SDK. * * @author Great Detail Ltd * @author Dom Webber * @see https://greatdetail.com */ declare class WebhookError extends Error {} //#endregion //#region src/Webhook/WebhookError/IncorrectMethodWebhookError.d.ts declare class IncorrectMethodWebhookError extends WebhookError {} //#endregion //#region src/Webhook/WebhookError/InvalidHubChallengeWebhookError.d.ts declare class InvalidHubChallengeWebhookError extends WebhookError {} //#endregion //#region src/Webhook/WebhookError/InvalidHubModeWebhookError.d.ts declare class InvalidHubModeWebhookError extends WebhookError {} //#endregion //#region src/Webhook/WebhookError/InvalidHubSignatureWebhookError.d.ts declare class InvalidHubSignatureWebhookError extends WebhookError {} //#endregion //#region src/Webhook/WebhookError/InvalidHubVerifyTokenWebhookError.d.ts declare class InvalidHubVerifyTokenWebhookError extends WebhookError {} //#endregion //#region src/Webhook/WebhookError/MissingBodyWebhookError.d.ts declare class MissingBodyWebhookError extends WebhookError {} //#endregion //#region src/Webhook/index.d.ts interface IncomingRequest { method: string; query: Record; body?: string; headers: Record; } declare class Webhook { errors: { WebhookError: typeof WebhookError; IncorrectMethodWebhookError: typeof IncorrectMethodWebhookError; InvalidHubChallengeWebhookError: typeof InvalidHubChallengeWebhookError; InvalidHubModeWebhookError: typeof InvalidHubModeWebhookError; InvalidHubSignatureWebhookError: typeof InvalidHubSignatureWebhookError; InvalidHubVerifyTokenWebhookError: typeof InvalidHubVerifyTokenWebhookError; MissingBodyWebhookError: typeof MissingBodyWebhookError; }; /** * Handle a Registration Webhook Request. * The handler for `GET` requests to your webhook endpoint. A registration * request is when WhatsApp sends a GET request to your webhook endpoint to * verify that it is valid. The challenge should be returned if valid. * * **ExpressJS**: * * ```ts * app.get( * "/path/to/webhook", * async (req, res) => { * const reg = await sdk.webhook.register({ * method: request.method, * query: req.query, * body: req.body, * headers: req.headers, * }); * // DIY: Check the reg.verifyToken value * if (reg.verifyToken !== "abcd") { * return res.end(reg.reject()); * } * return res.end(reg.accept()); * } * ); * ``` * * **Fastify**: * * ```ts * fastify.route({ * method: "GET", * url: "/path/to/webhook", * handler: (request, reply) => { * * const reg = await sdk.webhook.register({ * method: request.method, * query: request.query, * body: undefined, * headers: request.headers, * }); * // DIY: Check the reg.verifyToken value * if (reg.verifyToken !== "abcd") { * return reply.send(reg.reject()); * } * return reply.send(reg.accept()); * } * }); * ``` * * **Oak**: * * ```ts * router.get("/path/to/webhook", async (context) => { * const reg = await sdk.webhook.register({ * method: context.request.method, * query: Object.fromEntries(context.request.url.searchParams), * body: undefined, * headers: Object.fromEntries(context.request.headers), * }); * // DIY: Check the reg.verifyToken value * if (reg.verifyToken !== "abcd") { * context.response.body = reg.reject(); * return; * } * context.response.body = reg.accept(); * }); * ``` * * @throws {WebhookError} */ register(request: IncomingRequest): Promise<{ verifyToken: string; challenge: string; accept: () => string; reject: () => void; }>; /** * Handle an Event Notification Webhook Request. * The handler for `POST` requests to your webhook endpoint. * * **ExpressJS**: * * ```ts * app.use(express.raw()); // Important <- * app.post( * "/path/to/webhook", * async (req, res) => { * const event = sdk.webhook.eventNotification({ * method: request.method, * query: req.query, * body: req.body.toString(), * headers: req.headers, * }); * // DIY: Load the Meta App Secret * event.verifySignature("abcd-app-secret"); * // Non-200 status codes will be retried * // You may want to use the dreaded "successful error" * if (someFailedCondition) { * res.status(400); * return res.end(); * } * return res.end(event.accept()); * } * ); * ``` * * **Fastify**: * * ```ts * // See: https://github.com/fastify/fastify/issues/707#issuecomment-817224931 * fastify.addContentTypeParser("application/json", { parseAs: "buffer" }, (_req, body, done) => { * done(null, body); * }); * * fastify.route({ * method: "POST", * url: "/path/to/webhook", * handler: (request, reply) => { * // This SDK handles inbound webhook requests from a string for signature verification * assert(Buffer.isBuffer(request.body) || typeof request.body === "string"); * const body = request.body.toString(); * * const event = sdk.webhook.eventNotification({ * method: request.method, * query: request.query, * body, * headers: request.headers, * }); * // DIY: Load the Meta App Secret * event.verifySignature("abcd-app-secret"); * // Non-200 status codes will be retried * // You may want to use the dreaded "successful error" * if (someFailedCondition) { * return reply.code(400).send(); * } * return reply.send(event.accept()); * } * }); * ``` * * **Oak**; * * ```ts * router.post("/path/to/webhook", async (context) => { * const body = await context.request.body({ type: "text" }).value; * const event = sdk.webhook.eventNotification({ * method: context.request.method, * query: Object.fromEntries(context.request.url.searchParams), * body, * headers: Object.fromEntries(context.request.headers), * }); * // DIY: Load the Meta App Secret * event.verifySignature("abcd-app-secret"); * // Non-200 status codes will be retried * // You may want to use the dreaded "successful error" * if (someFailedCondition) { * context.response.status = 400; * context.response.body = ""; * return; * } * context.response.body = event.accept(); * }); * ``` */ eventNotification(request: IncomingRequest): Promise<{ /** Webhook Data */eventNotification: WebhookEventNotification; /** Algorithm-Specific X-Hub-Signatures */ signature: { sha1: { value: string; getCalculatedSignature: (appSecret: string) => Promise; check: (appSecret: string) => Promise; }; sha256: { value: string; getCalculatedSignature: (appSecret: string) => Promise; check: (appSecret: string) => Promise; }; }; /** Check X-Hub-Signature Validity */ checkSignature: (appSecret: string) => Promise; /** Asset X-Hub-Signature Validity */ verifySignature(appSecret: string): Promise; /** HTTP Response Content for Webhook Event Acceptance */ accept: () => void; }>; } //#endregion //#region src/WhatsappBusinessAccount/index.d.ts interface MethodOptions { request?: Options; } declare class WhatsappBusinessAccount$1 { protected _transport: KyInstance; constructor(_transport: KyInstance); get(businessAccountID: WhatsappBusinessAccountID, { fields, request }?: MethodOptions & GetWhatsappBusinessAccountOptions): _$ky.ResponsePromise; } //#endregion //#region src/Client.d.ts interface Options$1 { /** @deprecated Use `baseUrl` instead */ prefixUrl?: string; baseUrl?: string; graphVersion?: `v${string}` | (string & NonNullable); request?: Omit; } /** * The (Unofficial) WhatsApp SDK. * * ```ts * // Instantiate the SDK Client * const sdk = new Client({ * request: { * headers: { Authorization: "Bearer ..." }, * }, * }); * * // Use it! * const message = await sdk.message.createMessage({ * phoneNumberID: "123...809", * to: "1234567890", * type: "text", * text: { body: "Hello" }, * }); * ``` * * @see https://github.com/great-detail/WhatsApp-JS-SDK */ declare class Client { static DEFAULT_GRAPH_BASE_URL: string; static DEFAULT_GRAPH_VERSION: string; protected _transport: KyInstance; /** Business-Profile APIs */ businessProfile: BusinessProfile$1; /** Media APIs */ media: Media; /** Messaging APIs */ message: Message; /** Phone Number APIs */ phoneNumbers: PhoneNumbers; /** Subscribed App APIs */ subscribedApps: SubscribedApps; /** Template APIs */ template: Template; /** Webhook APIs */ webhook: Webhook; /** WhatsApp Business Account APIs */ whatsappBusinessAccount: WhatsappBusinessAccount$1; constructor({ baseUrl, prefixUrl, graphVersion, request }?: Options$1); } //#endregion export { AccountID, AccountTemplate, AppTemplateButton, BUSINESS_PROFILE_VERTICALS, BodyMessageTemplateComponent, BodyTemplateComponent, BusinessAccountID, BusinessProfile, BusinessProfileFields, BusinessProfileVertical, ButtonMessageTemplateComponent, ButtonsTemplateComponent, CREATE_TEMPLATE_BUTTON_TYPES, CatalogTemplateButton, Client, Client as CloudAPI, Client as default, ConversationType, CopyCodeTemplateButton, CreateAudioMessageOptions, CreateBodyTemplateComponent, CreateButtonsTemplateComponent, CreateContactsMessageOptions, CreateCopyCodeOTPTemplateButton, CreateCopyCodeTemplateButton, CreateCustomTemplateOptions, CreateDocumentHeaderTemplateComponent, CreateDocumentMessageOptions, CreateFlowTemplateButton, CreateFooterTemplateComponent, CreateHeaderTemplateComponent, CreateImageHeaderTemplateComponent, CreateImageMessageOptions, CreateInteractiveMessageOptions, CreateLibraryTemplateOptions, CreateLocationHeaderTemplateComponent, CreateLocationMessageOptions, CreateMPMTemplateButton, CreateMediaHeaderTemplateComponent, CreateMessageContact, CreateMessageLocation, CreateMessageMedia, CreateMessageOptions, CreateMessagePayload, CreateMessageTemplate, CreateMessageText, CreateOTPTemplateButton, CreateOneTapOTPTemplateButton, CreatePhoneNumberTemplateButton, CreateQuickReplyTemplateButton, CreateReactionMessageOptions, CreateSPMTemplateButton, CreateStatusOptions, CreateStatusPayload, CreateStickerMessageOptions, CreateSubscriptionOptions, CreateSubscriptionPayload, CreateTemplateBaseOptions, CreateTemplateButton, CreateTemplateButtonType, CreateTemplateComponent, CreateTemplateMessageOptions, CreateTemplateOptions, CreateTemplatePayload, CreateTextHeaderTemplateComponent, CreateTextMessageOptions, CreateURLTemplateButton, CreateVideoHeaderTemplateComponent, CreateVideoMessageOptions, CreateZeroTapOTPTemplateButton, DeleteTemplateOptions, DeleteTemplatePayload, EventNotificationMessageIdentity, EventNotificationMessageMedia, EventNotificationMessageMessage, EventNotificationMessageMessageBase, EventNotificationMessageReferral, EventNotificationMessageSystem, EventNotificationMessageText, FlowTemplateButton, FooterTemplateComponent, GetBusinessProfileFields, GetBusinessProfileOptions, GetBusinessProfilePayload, GetPhoneNumberOptions, GetPhoneNumberPayload, GetTemplateFields, GetTemplateOptions, GetTemplatePayload, GetWhatsappBusinessAccountOptions, GetWhatsappBusinessAccountPayload, HEADER_TEMPLATE_COMPONENT_FORMATS, HeaderMessageTemplateComponent, HeaderTemplateComponent, HeaderTemplateComponentFormat, LibraryTemplate, ListLibraryTemplatesOptions, ListLibraryTemplatesPayload, ListPhoneNumbersOptions, ListPhoneNumbersPaylod, ListSubscriptionsOptions, ListSubscriptionsPayload, ListTemplatesFields, ListTemplatesOptions, ListTemplatesPayload, MESSAGE_TEMPLATE_COMPONENT_TYPES, MPMTemplateButton, MediaDeleteOptions, MediaDeletePayload, MediaGetURLOptions, MediaGetURLPayload, MediaID, MediaUploadOptions, MediaUploadPayload, MessageID, MessageRecipientType, MessageStatusType, MessageTemplateBodyParameter, MessageTemplateButtonParameter, MessageTemplateButtonPayloadParameter, MessageTemplateButtonTextParameter, MessageTemplateComponent, MessageTemplateComponentNamedParameter, MessageTemplateComponentPositionalParameter, MessageTemplateComponentType, MessageTemplateCurrencyParameter, MessageTemplateDateTimeParameter, MessageTemplateDocumentParameter, MessageTemplateHeaderLocationParameter, MessageTemplateHeaderParameter, MessageTemplateImageParameter, MessageTemplateTextParameter, MessageTemplateVideoParameter, MessageType, OTPTemplateButton, PHONE_NUMBER_ACCOUNT_MODE, PHONE_NUMBER_CODE_VERIFICATION_STATUS, PHONE_NUMBER_MESSAGE_ELIGIBILITY, PHONE_NUMBER_MESSAGING_LIMIT_TIER, PHONE_NUMBER_NAME_STATUS, PHONE_NUMBER_PLATFORM_TYPE, PHONE_NUMBER_QUALITY_RATING, PHONE_NUMBER_STATUS, PHONE_NUMBER_THROUGHPUT_LEVEL, PhoneNumber, PhoneNumberAccountMode, PhoneNumberCodeVerificationStatus, PhoneNumberFields, PhoneNumberID, PhoneNumberMessageEligibility, PhoneNumberMessagingLimitTier, PhoneNumberNameStatus, PhoneNumberPlatformType, PhoneNumberQualityRating, PhoneNumberStatus, PhoneNumberString, PhoneNumberTemplateButton, PhoneNumberThroughputLevel, QuickReplyTemplateButton, SPMTemplateButton, TEMPLATE_BUTTON_TYPES, TEMPLATE_CATEGORIES, TEMPLATE_COMPONENT_TYPES, TEMPLATE_INDUSTRIES, TEMPLATE_LANGUAGES, TEMPLATE_MAX_BUTTONS, TEMPLATE_PARAMETER_FORMATS, TEMPLATE_QUALITY_SCORES, TEMPLATE_REJECTION_REASONS, TEMPLATE_STATUSES, TEMPLATE_STATUS_UPDATE_EVENTS, TEMPLATE_STATUS_UPDATE_REASONS, TEMPLATE_SUBCATEGORIES, TEMPLATE_TOPICS, TEMPLATE_USECASES, TemplateButton, TemplateButtonType, TemplateCategory, TemplateComponent, TemplateComponentType, TemplateIndustry, TemplateLanguage, TemplateParameterFormat, TemplateQualityScore, TemplateRejectionReason, TemplateStatus, TemplateStatusUpdateEvent, TemplateStatusUpdateReason, TemplateSubcategory, TemplateTopic, TemplateUseCase, URLTemplateButton, UpdateBusinessProfileOptions, UpdateBusinessProfilePayload, UpdatePhoneNumberOptions, UpdatePhoneNumberPayload, UpdateTemplateOptions, UpdateTemplatePayload, VoiceCallTemplateButton, WHATSAPP_BUSINESS_ACCOUNT_MESSAGE_ELIGIBILITY, WHATSAPP_BUSINESS_ACCOUNT_VERIFICATION_STATUS, WebhookEventNotification, WebhookEventNotificationAccountAlertsChanges, WebhookEventNotificationAccountReviewUpdateChanges, WebhookEventNotificationAccountUpdateChanges, WebhookEventNotificationCallsChanges, WebhookEventNotificationMessageTemplateCategoryUpdateChanges, WebhookEventNotificationMessageTemplateComponentsUpdateChanges, WebhookEventNotificationMessageTemplateQualityUpdateChanges, WebhookEventNotificationMessageTemplateStatusUpdateChanges, WebhookEventNotificationMessagesChanges, WebhookEventNotificationPaymentConfigurationUpdateChanges, WebhookEventNotificationPhoneNumberNameUpdateChanges, WebhookEventNotificationPhoneNumberQualityUpdateChanges, WhatsappBusinessAccount, WhatsappBusinessAccountFields, WhatsappBusinessAccountID, WhatsappBusinessAccountMessageEligibility, WhatsappBusinessAccountVerificationStatus, WhatsappError }; //# sourceMappingURL=index.d.ts.map