import { Message, SendMessageResponse, GetBusinessPhoneNumberResponse, RequestPhoneNumberVerificationCodeArgs, VerifyPhoneNumberArgs, RegisterPhoneArgs, SetUpTwoFactorAuthArgs, DefaultResponse, BusinessProfile, BusinessProfileFieldsQuery, UpdateBusinessProfilePayload, GetMediaResponse, UploadMediaPayload, UploadMediaResponse, BusinessPhoneNumber, UpdateIdentityCheckState, HealthStatusResponse } from "./types"; import { createRestClient } from "./utils/restClient"; interface WABAClientArgs { apiToken: string; phoneId: string; accountId: string; } /** * Connector for the Whatsapp Cloud API. * * documentation: https://developers.facebook.com/docs/whatsapp/cloud-api/guides */ export declare class WABAClient { restClient: ReturnType; phoneId: string; accountId: string; constructor({ apiToken, phoneId, accountId }: WABAClientArgs); /** * * Retrieves your business profile. Customers can view your business profile by clicking your business's name or number in a conversation thread. * * @param fields you can specify which data you want to get from your business. If not passed, defaults to all fields. */ getBusinessProfile(fields?: BusinessProfileFieldsQuery): Promise; /** * @param payload provide the fields that you wish to update. */ updateBusinessProfile(payload: UpdateBusinessProfilePayload): Promise; /** * All media files sent through this endpoint are encrypted and persist for 30 days, unless they are deleted earlier. * * A successful response returns an object with the uploaded media's ID. */ uploadMedia({ file, type }: Omit): Promise; /** * Retrieves your media’s 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. */ getMedia(mediaId: string): Promise; deleteMedia(mediaId: string): Promise; /** * @param mediaUrl your media’s URL * @param pathToSaveFile the path where you want to store the media */ downloadMedia(mediaUrl: string, pathToSaveFile: string): Promise; /** * Yu can use the API to send the following free-form messages types: * Text * Reaction * Media * Location * Contacts * Interactive * Address * messages * template * * For more information refer here: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages * * If you are working with template messages refer here: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-message-templates * */ sendMessage(payload: Omit): Promise; /** * When you receive an incoming message from Webhooks, * you can use the /messages endpoint to mark the message as * read by changing its status to read. Messages marked as read display two blue check marks alongside their timestamp. */ markMessageAsRead(message_id: string): Promise; getBusinessPhoneNumbers(): Promise; getSingleBusinessPhoneNumber(phoneNumberId: string): Promise; /** * You may want us to verify a customer's identity before we deliver your message to them. * You can have us do this by enabling the identity change check setting on your business phone number. */ updateIdentityCheckState({ enable_identity_key_check }: UpdateIdentityCheckState): Promise; requestPhoneNumberVerificationCode({ phoneNumberId, ...payload }: RequestPhoneNumberVerificationCodeArgs): Promise; verifyPhoneNumberCode({ phoneNumberId, ...payload }: VerifyPhoneNumberArgs): Promise; registerPhone({ phoneNumberId, ...payload }: RegisterPhoneArgs): Promise; deregisterPhone(phoneNumber: string): Promise; setupTwoStepAuth({ phoneNumberId, ...payload }: SetUpTwoFactorAuthArgs): Promise; /** * * @param nodeId is optional, defaults to the account_id */ getHealthStatus(nodeId?: string): Promise; } export {};