import { Agent } from "node:https";
import { IncomingHttpHeaders, IncomingMessage } from "node:http";

//#region src/types/enums.d.ts
declare namespace enums_d_exports {
  export { AudioMediaTypesEnum, BusinessVerticalEnum, ButtonPositionEnum, CategoryEnum, ComponentTypesEnum, ConversationTypesEnum, CurrencyCodesEnum, DataLocalizationRegionEnum, DocumentMediaTypesEnum, HttpMethodsEnum, ImageMediaTypesEnum, InteractiveTypesEnum, LanguagesEnum, MessageTypesEnum, ParametersTypesEnum, ReferralSourceTypesEnum, RequestCodeMethodsEnum, StatusEnum, StickerMediaTypesEnum, SubTypeEnum, SystemChangeTypesEnum, TemplateStatusEnum, VideoMediaTypesEnum, WabaConfigEnum, WebhookTypesEnum };
}
declare enum CategoryEnum {
  Authentication = "AUTHENTICATION",
  Marketing = "MARKETING",
  Utility = "UTILITY"
}
declare enum TemplateStatusEnum {
  Approved = "APPROVED",
  Pending = "PENDING",
  Rejected = "REJECTED"
}
declare enum HttpMethodsEnum {
  Get = "GET",
  Post = "POST",
  Put = "PUT",
  Delete = "DELETE"
}
declare enum MessageTypesEnum {
  Audio = "audio",
  Contacts = "contacts",
  Document = "document",
  Image = "image",
  Interactive = "interactive",
  Location = "location",
  Reaction = "reaction",
  Sticker = "sticker",
  Template = "template",
  Text = "text",
  Video = "video",
  Button = "button",
  Order = "order",
  System = "system",
  Unsupported = "unsupported",
  Unknown = "unknown",
  /**
   * @deprecated Use WebhookProcessor.onStatus() instead of onMessage(MessageTypesEnum.Statuses)
   */
  Statuses = "statuses",
  '*' = "*"
}
declare enum ParametersTypesEnum {
  Action = "ACTION",
  CouponCode = "COUPON_CODE",
  Currency = "CURRENCY",
  DateTime = "DATE_TIME",
  Document = "DOCUMENT",
  ExpirationTimeMs = "EXPIRATION_TIME_MS",
  Image = "IMAGE",
  LimitedTimeOffer = "LIMITED_TIME_OFFER",
  Location = "LOCATION",
  OrderStatus = "ORDER_STATUS",
  Payload = "PAYLOAD",
  Product = "PRODUCT",
  Text = "TEXT",
  TtlMinutes = "TTL_MINUTES",
  Video = "VIDEO",
  WebviewInteraction = "WEBVIEW_INTERACTION",
  WebviewPresentation = "WEBVIEW_PRESENTATION"
}
declare enum InteractiveTypesEnum {
  Button = "button",
  List = "list",
  Product = "product",
  ProductList = "product_list",
  CatalogMessage = "catalog_message",
  CallPermissionRequest = "call_permission_request",
  CtaUrl = "cta_url",
  Carousel = "carousel",
  LocationRequest = "location_request_message",
  AddressMessage = "address_message",
  Flow = "flow"
}
declare enum ButtonPositionEnum {
  First = 1,
  Second = 2,
  Third = 3,
  Fourth = 4,
  Fifth = 5
}
declare enum SubTypeEnum {
  Catalog = "CATALOG",
  CopyCode = "COPY_CODE",
  Flow = "FLOW",
  Mpm = "MPM",
  OrderDetails = "ORDER_DETAILS",
  PhoneNumber = "PHONE_NUMBER",
  QuickReply = "QUICK_REPLY",
  Reminder = "REMINDER",
  Url = "URL",
  VoiceCall = "VOICE_CALL"
}
declare enum ComponentTypesEnum {
  Header = "HEADER",
  Body = "BODY",
  Button = "BUTTON",
  Footer = "FOOTER"
}
declare enum WabaConfigEnum {
  AppId = "M4D_APP_ID",
  Port = "WA_PORT",
  AppSecret = "M4D_APP_SECRET",
  PhoneNumberId = "WA_PHONE_NUMBER_ID",
  BusinessAcctId = "WA_BUSINESS_ACCOUNT_ID",
  APIVersion = "CLOUD_API_VERSION",
  AccessToken = "CLOUD_API_ACCESS_TOKEN",
  WebhookEndpoint = "WEBHOOK_ENDPOINT",
  WebhookVerificationToken = "WEBHOOK_VERIFICATION_TOKEN",
  ListenerPort = "LISTENER_PORT",
  MaxRetriesAfterWait = "MAX_RETRIES_AFTER_WAIT",
  RequestTimeout = "REQUEST_TIMEOUT",
  Debug = "DEBUG",
  PrivatePem = "FLOW_API_PRIVATE_PEM",
  Passphrase = "FLOW_API_PASSPHRASE"
}
declare enum ConversationTypesEnum {
  BusinessInitiated = "business_initiated",
  CustomerInitiated = "customer_initiated",
  ReferralConversion = "referral_conversion"
}
declare enum StatusEnum {
  Delivered = "delivered",
  Read = "read",
  Sent = "sent"
}
declare enum VideoMediaTypesEnum {
  Mp4 = "video/mp4",
  Threegp = "video/3gp"
}
declare enum StickerMediaTypesEnum {
  Webp = "image/webp"
}
declare enum ImageMediaTypesEnum {
  Jpeg = "image/jpeg",
  Png = "image/png"
}
declare enum DocumentMediaTypesEnum {
  Text = "text/plain",
  Pdf = "application/pdf",
  Ppt = "application/vnd.ms-powerpoint",
  Word = "application/msword",
  Excel = "application/vnd.ms-excel",
  OpenDoc = "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  OpenPres = "application/vnd.openxmlformats-officedocument.presentationml.presentation",
  OpenSheet = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
declare enum AudioMediaTypesEnum {
  Aac = "audio/aac",
  Mp4 = "audio/mp4",
  Mpeg = "audio/mpeg",
  Amr = "audio/amr",
  Ogg = "audio/ogg"
}
declare enum WebhookTypesEnum {
  Audio = "audio",
  Button = "button",
  Document = "document",
  Text = "text",
  Image = "image",
  Interactive = "interactive",
  Order = "order",
  Sticker = "sticker",
  System = "system",
  Unknown = "unknown",
  Video = "video"
}
declare enum SystemChangeTypesEnum {
  CustomerChangedNumber = "customer_changed_number",
  CustomerIdentityChanged = "customer_identity_changed"
}
declare enum ReferralSourceTypesEnum {
  Ad = "ad",
  Post = "post"
}
declare enum RequestCodeMethodsEnum {
  Sms = "SMS",
  Voice = "VOICE"
}
declare enum LanguagesEnum {
  Afrikaans = "af",
  Albanian = "sq",
  Arabic = "ar",
  Azerbaijani = "az",
  Bengali = "bn",
  Bulgarian = "bg",
  Catalan = "ca",
  Chinese_CHN = "zh_CN",
  Chinese_HKG = "zh_HK",
  Chinese_TAI = "zh_TW",
  Croatian = "hr",
  Czech = "cs",
  Danish = "da",
  Dutch = "nl",
  English = "en",
  English_UK = "en_GB",
  English_US = "en_US",
  Estonian = "et",
  Filipino = "fil",
  Finnish = "fi",
  French = "fr",
  Georgian = "ka",
  German = "de",
  Greek = "el",
  Gujarati = "gu",
  Hausa = "ha",
  Hebrew = "he",
  Hindi = "hi",
  Hungarian = "hu",
  Indonesian = "id",
  Irish = "ga",
  Italian = "it",
  Japanese = "ja",
  Kannada = "kn",
  Kazakh = "kk",
  Kinyarwanda = "rw_RW",
  Korean = "ko",
  Kyrgyz_Kyrgyzstan = "ky_KG",
  Lao = "lo",
  Latvian = "lv",
  Lithuanian = "lt",
  Macedonian = "mk",
  Malay = "ms",
  Malayalam = "ml",
  Marathi = "mr",
  Norwegian = "nb",
  Persian = "fa",
  Polish = "pl",
  Portuguese_BR = "pt_BR",
  Portuguese_POR = "pt_PT",
  Punjabi = "pa",
  Romanian = "ro",
  Russian = "ru",
  Serbian = "sr",
  Slovak = "sk",
  Slovenian = "sl",
  Spanish = "es",
  Spanish_ARG = "es_AR",
  Spanish_SPA = "es_ES",
  Spanish_MEX = "es_MX",
  Swahili = "sw",
  Swedish = "sv",
  Tamil = "ta",
  Telugu = "te",
  Thai = "th",
  Turkish = "tr",
  Ukrainian = "uk",
  Urdu = "ur",
  Uzbek = "uz",
  Vietnamese = "vi",
  Zulu = "zu"
}
declare enum CurrencyCodesEnum {
  AFN = "AFN",
  EUR = "EUR",
  ALL = "ALL",
  DZD = "DZD",
  USD = "USD",
  AOA = "AOA",
  XCD = "XCD",
  ARS = "ARS",
  AMD = "AMD",
  AWG = "AWG",
  AUD = "AUD",
  AZN = "AZN",
  BSD = "BSD",
  BHD = "BHD",
  BDT = "BDT",
  BBD = "BBD",
  BYN = "BYN",
  BZD = "BZD",
  XOF = "XOF",
  BMD = "BMD",
  INR = "INR",
  BTN = "BTN",
  BOB = "BOB",
  BOV = "BOV",
  BAM = "BAM",
  BWP = "BWP",
  NOK = "NOK",
  BRL = "BRL",
  BND = "BND",
  BGN = "BGN",
  BIF = "BIF",
  CVE = "CVE",
  KHR = "KHR",
  XAF = "XAF",
  CAD = "CAD",
  KYD = "KYD",
  CLP = "CLP",
  CLF = "CLF",
  CNY = "CNY",
  COP = "COP",
  COU = "COU",
  KMF = "KMF",
  CDF = "CDF",
  NZD = "NZD",
  CRC = "CRC",
  HRK = "HRK",
  CUP = "CUP",
  CUC = "CUC",
  ANG = "ANG",
  CZK = "CZK",
  DKK = "DKK",
  DJF = "DJF",
  DOP = "DOP",
  EGP = "EGP",
  SVC = "SVC",
  ERN = "ERN",
  SZL = "SZL",
  ETB = "ETB",
  FKP = "FKP",
  FJD = "FJD",
  XPF = "XPF",
  GMD = "GMD",
  GEL = "GEL",
  GHS = "GHS",
  GIP = "GIP",
  GTQ = "GTQ",
  GBP = "GBP",
  GNF = "GNF",
  GYD = "GYD",
  HTG = "HTG",
  HNL = "HNL",
  HKD = "HKD",
  HUF = "HUF",
  ISK = "ISK",
  IDR = "IDR",
  XDR = "XDR",
  IRR = "IRR",
  IQD = "IQD",
  ILS = "ILS",
  JMD = "JMD",
  JPY = "JPY",
  JOD = "JOD",
  KZT = "KZT",
  KES = "KES",
  KPW = "KPW",
  KRW = "KRW",
  KWD = "KWD",
  KGS = "KGS",
  LAK = "LAK",
  LBP = "LBP",
  LSL = "LSL",
  ZAR = "ZAR",
  LRD = "LRD",
  LYD = "LYD",
  CHF = "CHF",
  MOP = "MOP",
  MKD = "MKD",
  MGA = "MGA",
  MWK = "MWK",
  MYR = "MYR",
  MVR = "MVR",
  MRU = "MRU",
  MUR = "MUR",
  XUA = "XUA",
  MXN = "MXN",
  MXV = "MXV",
  MDL = "MDL",
  MNT = "MNT",
  MAD = "MAD",
  MZN = "MZN",
  MMK = "MMK",
  NAD = "NAD",
  NPR = "NPR",
  NIO = "NIO",
  NGN = "NGN",
  OMR = "OMR",
  PKR = "PKR",
  PAB = "PAB",
  PGK = "PGK",
  PYG = "PYG",
  PEN = "PEN",
  PHP = "PHP",
  PLN = "PLN",
  QAR = "QAR",
  RON = "RON",
  RUB = "RUB",
  RWF = "RWF",
  SHP = "SHP",
  WST = "WST",
  STN = "STN",
  SAR = "SAR",
  RSD = "RSD",
  SCR = "SCR",
  SLL = "SLL",
  SGD = "SGD",
  XSU = "XSU",
  SBD = "SBD",
  SOS = "SOS",
  SSP = "SSP",
  LKR = "LKR",
  SDG = "SDG",
  SRD = "SRD",
  SEK = "SEK",
  CHE = "CHE",
  CHW = "CHW",
  SYP = "SYP",
  TWD = "TWD",
  TJS = "TJS",
  TZS = "TZS",
  THB = "THB",
  TOP = "TOP",
  TTD = "TTD",
  TND = "TND",
  TRY = "TRY",
  TMT = "TMT",
  UGX = "UGX",
  UAH = "UAH",
  AED = "AED",
  USN = "USN",
  UYU = "UYU",
  UYI = "UYI",
  UYW = "UYW",
  UZS = "UZS",
  VUV = "VUV",
  VES = "VES",
  VND = "VND",
  YER = "YER",
  ZMW = "ZMW",
  ZWL = "ZWL",
  XBA = "XBA",
  XBB = "XBB",
  XBC = "XBC",
  XBD = "XBD",
  XTS = "XTS",
  XXX = "XXX",
  XAU = "XAU",
  XPD = "XPD",
  XPT = "XPT",
  XAG = "XAG",
  AFA = "AFA",
  FIM = "FIM",
  ALK = "ALK",
  ADP = "ADP",
  ESP = "ESP",
  FRF = "FRF",
  AOK = "AOK",
  AON = "AON",
  AOR = "AOR",
  ARA = "ARA",
  ARP = "ARP",
  ARY = "ARY",
  RUR = "RUR",
  ATS = "ATS",
  AYM = "AYM",
  AZM = "AZM",
  BYB = "BYB",
  BYR = "BYR",
  BEC = "BEC",
  BEF = "BEF",
  BEL = "BEL",
  BOP = "BOP",
  BAD = "BAD",
  BRB = "BRB",
  BRC = "BRC",
  BRE = "BRE",
  BRN = "BRN",
  BRR = "BRR",
  BGJ = "BGJ",
  BGK = "BGK",
  BGL = "BGL",
  BUK = "BUK",
  HRD = "HRD",
  CYP = "CYP",
  CSJ = "CSJ",
  CSK = "CSK",
  ECS = "ECS",
  ECV = "ECV",
  GQE = "GQE",
  EEK = "EEK",
  XEU = "XEU",
  GEK = "GEK",
  DDM = "DDM",
  DEM = "DEM",
  GHC = "GHC",
  GHP = "GHP",
  GRD = "GRD",
  GNE = "GNE",
  GNS = "GNS",
  GWE = "GWE",
  GWP = "GWP",
  ITL = "ITL",
  ISJ = "ISJ",
  IEP = "IEP",
  ILP = "ILP",
  ILR = "ILR",
  LAJ = "LAJ",
  LVL = "LVL",
  LVR = "LVR",
  LSM = "LSM",
  ZAL = "ZAL",
  LTL = "LTL",
  LTT = "LTT",
  LUC = "LUC",
  LUF = "LUF",
  LUL = "LUL",
  MGF = "MGF",
  MVQ = "MVQ",
  MLF = "MLF",
  MTL = "MTL",
  MTP = "MTP",
  MRO = "MRO",
  MXP = "MXP",
  MZE = "MZE",
  MZM = "MZM",
  NLG = "NLG",
  NIC = "NIC",
  PEH = "PEH",
  PEI = "PEI",
  PES = "PES",
  PLZ = "PLZ",
  PTE = "PTE",
  ROK = "ROK",
  ROL = "ROL",
  STD = "STD",
  CSD = "CSD",
  SKK = "SKK",
  SIT = "SIT",
  RHD = "RHD",
  ESA = "ESA",
  ESB = "ESB",
  SDD = "SDD",
  SDP = "SDP",
  SRG = "SRG",
  CHC = "CHC",
  TJR = "TJR",
  TPE = "TPE",
  TRL = "TRL",
  TMM = "TMM",
  UGS = "UGS",
  UGW = "UGW",
  UAK = "UAK",
  SUR = "SUR",
  USS = "USS",
  UYN = "UYN",
  UYP = "UYP",
  VEB = "VEB",
  VEF = "VEF",
  VNC = "VNC",
  YDD = "YDD",
  YUD = "YUD",
  YUM = "YUM",
  YUN = "YUN",
  ZRN = "ZRN",
  ZRZ = "ZRZ",
  ZMK = "ZMK",
  ZWC = "ZWC",
  ZWD = "ZWD",
  ZWN = "ZWN",
  ZWR = "ZWR",
  XFO = "XFO",
  XRE = "XRE",
  XFU = "XFU"
}
declare enum DataLocalizationRegionEnum {
  AU = "AU",
  // Australia
  ID = "ID",
  // Indonesia
  IN = "IN",
  // India
  JP = "JP",
  // Japan
  SG = "SG",
  // Singapore
  KR = "KR",
  // South Korea
  DE = "DE",
  // EU (Germany)
  CH = "CH",
  // Switzerland
  GB = "GB",
  // United Kingdom
  BR = "BR",
  // Brazil
  BH = "BH",
  // Bahrain
  ZA = "ZA",
  // South Africa
  AE = "AE",
  // United Arab Emirates
  CA = "CA"
}
/**
 * Business category values for WhatsApp Business Profile.
 * These values map to specific strings displayed in the WhatsApp client.
 */
declare enum BusinessVerticalEnum {
  /**
   * Alcoholic Beverages
   */
  ALCOHOL = "ALCOHOL",
  /**
   * Clothing and Apparel
   */
  APPAREL = "APPAREL",
  /**
   * Automotive
   */
  AUTO = "AUTO",
  /**
   * Beauty, Spa and Salon
   */
  BEAUTY = "BEAUTY",
  /**
   * Education
   */
  EDU = "EDU",
  /**
   * Entertainment
   */
  ENTERTAIN = "ENTERTAIN",
  /**
   * Event Planning and Service
   */
  EVENT_PLAN = "EVENT_PLAN",
  /**
   * Finance and Banking
   */
  FINANCE = "FINANCE",
  /**
   * Public Service
   */
  GOVT = "GOVT",
  /**
   * Food and Grocery
   */
  GROCERY = "GROCERY",
  /**
   * Medical and Health
   */
  HEALTH = "HEALTH",
  /**
   * Hotel and Lodging
   */
  HOTEL = "HOTEL",
  /**
   * Non-profit
   */
  NONPROFIT = "NONPROFIT",
  /**
   * Online Gambling & Gaming
   */
  ONLINE_GAMBLING = "ONLINE_GAMBLING",
  /**
   * Over-the-Counter Drugs
   */
  OTC_DRUGS = "OTC_DRUGS",
  /**
   * Other
   */
  OTHER = "OTHER",
  /**
   * Non-Online Gambling & Gaming (E.g. Brick and mortar)
   */
  PHYSICAL_GAMBLING = "PHYSICAL_GAMBLING",
  /**
   * Professional Services
   */
  PROF_SERVICES = "PROF_SERVICES",
  /**
   * Restaurant
   */
  RESTAURANT = "RESTAURANT",
  /**
   * Shopping and Retail
   */
  RETAIL = "RETAIL",
  /**
   * Travel and Transportation
   */
  TRAVEL = "TRAVEL"
}
//#endregion
//#region src/types/config.d.ts
/**
 * Configuration for automatic retry behavior on throttling errors.
 *
 * When the WhatsApp API returns a rate limit error (WhatsAppThrottlingError),
 * the SDK will automatically retry the request using exponential backoff.
 *
 * @example
 * ```typescript
 * const wa = new WhatsApp({
 *   accessToken: '...',
 *   phoneNumberId: 123,
 *   retry: { maxAttempts: 3, backoff: 'exponential', initialDelayMs: 1000 },
 * });
 * ```
 */
interface RetryConfig {
  /**
   * Maximum number of attempts (including the initial attempt).
   * Defaults to 3.
   */
  maxAttempts?: number;
  /**
   * Backoff strategy.
   * - 'exponential': delay doubles each attempt (1s → 2s → 4s)
   * - 'fixed': constant delay between attempts
   * Defaults to 'exponential'.
   */
  backoff?: 'exponential' | 'fixed';
  /**
   * Initial delay in milliseconds before the first retry.
   * Defaults to 1000 (1 second).
   */
  initialDelayMs?: number;
}
type WhatsAppConfig = {
  accessToken: string;
  appId?: string;
  appSecret?: string;
  phoneNumberId?: number;
  businessAcctId?: string;
  apiVersion?: string;
  webhookEndpoint?: string;
  webhookVerificationToken?: string;
  listenerPort?: number;
  debug?: boolean;
  maxRetriesAfterWait?: number;
  requestTimeout?: number;
  privatePem?: string;
  passphrase?: string; /** Automatic retry configuration for throttling errors. */
  retry?: RetryConfig;
};
type WabaConfigType = {
  /**
   * The Meta for Developers business application Id for this registered application.
   */
  [WabaConfigEnum.AppId]: string;
  /**
   * The Meta for Developers business application secret for this registered application.
   */
  [WabaConfigEnum.AppSecret]: string;
  /**
   * The Meta for Developers phone number id used by the registered business.
   */
  [WabaConfigEnum.PhoneNumberId]: number;
  /**
   * The Meta for Developers business id for the registered business.
   */
  [WabaConfigEnum.BusinessAcctId]: string;
  /**
   * The version of the Cloud API being used. Starts with a "v" and follows the major number.
   */
  [WabaConfigEnum.APIVersion]: string;
  /**
   * The access token to make calls on behalf of the signed in Meta for Developers account or business.
   */
  [WabaConfigEnum.AccessToken]: string;
  /**
   * The endpoint path (e.g. if the value here is webhook, the webhook URL would look like http/https://{host}/webhook).
   */
  [WabaConfigEnum.WebhookEndpoint]: string;
  /**
   * The verification token that needs to match what is sent by the Cloud API webhook in order to subscribe.
   */
  [WabaConfigEnum.WebhookVerificationToken]: string;
  /**
   * The listener port for the webhook web server.
   */
  [WabaConfigEnum.ListenerPort]: number;
  /**
   * To turn on global debugging of the logger to print verbose output across the APIs.
   */
  [WabaConfigEnum.Debug]: boolean;
  /**
   * The total number of times a request should be retried after the wait period if it fails.
   */
  [WabaConfigEnum.MaxRetriesAfterWait]: number;
  /**
   * The timeout period for a request to quit and destroy the attempt in ms.
   */
  [WabaConfigEnum.RequestTimeout]: number;
  /**
   * The private key for the Meta for Developers business.
   */
  [WabaConfigEnum.PrivatePem]: string;
  /**
   * The passphrase for the Meta for Developers business.
   */
  [WabaConfigEnum.Passphrase]: string;
  /**
   * Automatic retry configuration for throttling errors.
   * Passed through from WhatsAppConfig.
   */
  retry?: RetryConfig;
};
//#endregion
//#region src/types/request.d.ts
type GeneralRequestBody = Record<string, unknown>;
type UrlEncodedFormBody = Record<string, string | string[]>;
interface GeneralHeaderInterface {
  /**
   * Authorization token. This is required for all HTTP requests made to the graph API.
   * @default 'Bearer '
   */
  Authorization: string;
  /**
   * Content type of the message being sent. This is required for all HTTP requests made to the graph API.
   * @default 'application/json'
   */
  'Content-Type': string;
  /**
   * User agent field sent in all requests. This is used to gather SDK usage metrics and help
   * better triage support requests.
   * @default `WA_SDK/${ SDK_version } (Node.js ${ process.version })`
   */
  'User-Agent': string;
}
interface RequesterResponseInterface<T> {
  json: () => Promise<T>;
}
interface ResponseSuccess {
  success: boolean;
}
interface ResponseData<T> {
  data: T;
}
interface ResponsePagination<T> {
  data: T[];
  paging: Paging;
}
interface Paging {
  cursors: {
    before: string;
    after: string;
  };
  next: string;
}
/**
 * Common error detail structure used in Meta API responses
 * Used for individual item errors in bulk operations
 */
interface MetaErrorDetail {
  message: string;
  code: string;
  error_data?: {
    details: string;
  };
}
declare class RequesterClass {
  constructor(apiVersion: string, phoneNumberId: number, accessToken: string, businessAcctId: string, userAgent: string);
  sendRequest: (method: HttpMethodsEnum, path: string, timeout: number, body?: GeneralRequestBody, contentType?: string, additionalHeaders?: Record<string, string>) => Promise<RequesterResponseInterface<unknown>>;
  getJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: GeneralRequestBody, additionalHeaders?: Record<string, string>): Promise<T>;
  sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: FormData, additionalHeaders?: Record<string, string>): Promise<T>;
  sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: UrlEncodedFormBody, additionalHeaders?: Record<string, string>): Promise<T>;
  updateTimeout(timeout: number): void;
  updateAccessToken(accessToken: string): void;
}
//#endregion
//#region src/types/base.d.ts
declare class BaseClass {
  constructor(config: WabaConfigType);
}
declare class BaseAPI implements BaseClass {
  protected config: WabaConfigType;
  protected client: RequesterClass;
  constructor(config: WabaConfigType, client: RequesterClass);
  protected sendJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
  protected sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
  protected sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body: UrlEncodedFormBody): Promise<T>;
}
//#endregion
//#region src/api/blockUsers/types/blockUsers.d.ts
/**
 * Block Users API Types
 * @see https://developers.facebook.com/docs/whatsapp/cloud-api/block-users
 */
/**
 * User object for blocking/unblocking operations
 */
type BlockUserObject = {
  user: string;
};
/**
 * Blocked user information in response
 */
type BlockedUserInfo = {
  input: string;
  wa_id: string;
};
/**
 * Failed user information with error details
 * Uses common MetaErrorDetail type for consistency across APIs
 */
type FailedUserInfo = BlockedUserInfo & {
  errors?: MetaErrorDetail[];
};
/**
 * Request body for blocking users
 */
type BlockUsersRequest = {
  messaging_product: 'whatsapp';
  block_users: BlockUserObject[];
};
/**
 * Request body for unblocking users
 */
type UnblockUsersRequest = {
  messaging_product: 'whatsapp';
  block_users: BlockUserObject[];
};
/**
 * Response for block/unblock operations
 */
type BlockUsersResponse = {
  messaging_product: 'whatsapp';
  block_users: {
    added_users?: BlockedUserInfo[];
    failed_users?: FailedUserInfo[];
  };
};
/**
 * Pagination cursors for list operations
 */
type PagingCursors = {
  after?: string;
  before?: string;
};
/**
 * Pagination information
 */
type PagingInfo = {
  cursors?: PagingCursors;
  previous?: string;
  next?: string;
};
/**
 * List blocked users response
 */
type ListBlockedUsersResponse = {
  data: Array<{
    block_users: BlockedUserInfo[];
  }>;
  paging?: PagingInfo;
};
/**
 * Query parameters for listing blocked users
 */
type ListBlockedUsersParams = {
  limit?: number;
  after?: string;
  before?: string;
};
/**
 * Block Users API Interface
 */
interface BlockUsersClass {
  /**
   * Block one or more WhatsApp users
   * @param users - Array of phone numbers or WhatsApp IDs to block
   * @returns Response with successfully blocked and failed users
   * @throws Error if users have not messaged in last 24 hours
   * @see https://developers.facebook.com/docs/whatsapp/cloud-api/block-users#block-users
   */
  block(users: string[]): Promise<BlockUsersResponse>;
  /**
   * Unblock one or more WhatsApp users
   * @param users - Array of phone numbers or WhatsApp IDs to unblock
   * @returns Response with successfully unblocked and failed users
   * @see https://developers.facebook.com/docs/whatsapp/cloud-api/block-users#unblock-users
   */
  unblock(users: string[]): Promise<BlockUsersResponse>;
  /**
   * Get list of blocked WhatsApp users with pagination
   * @param params - Optional pagination parameters
   * @returns List of blocked users with pagination info
   * @see https://developers.facebook.com/docs/whatsapp/cloud-api/block-users#get-list-of-blocked-numbers
   */
  listBlockedUsers(params?: ListBlockedUsersParams): Promise<ListBlockedUsersResponse>;
}
//#endregion
//#region src/api/blockUsers/BlockUsersApi.d.ts
/**
 * API for blocking and unblocking WhatsApp users.
 *
 * Provides methods to block, unblock, and list blocked users for your
 * WhatsApp Business phone number.
 *
 * Limitations:
 * - Can only block users that have messaged your business in the last 24 hours
 * - 64k blocklist limit
 *
 * Endpoints covered:
 * - `POST /{PHONE_NUMBER_ID}/block_users` - Block one or more users
 * - `DELETE /{PHONE_NUMBER_ID}/block_users` - Unblock one or more users
 * - `GET /{PHONE_NUMBER_ID}/block_users` - List blocked users with pagination
 *
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/block-users/
 */
declare class BlockUsersApi extends BaseAPI implements BlockUsersClass {
  private readonly endpoint;
  /**
   * Build the request body for block/unblock operations.
   *
   * @param users - Array of phone numbers or WhatsApp IDs.
   * @returns The formatted request body.
   */
  private buildBlockUsersBody;
  /**
   * Block one or more WhatsApp users
   * @param users - Array of phone numbers or WhatsApp IDs to block
   * @returns Response with successfully blocked and failed users
   * @throws Error if users have not messaged in last 24 hours
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/block-users/
   *
   * @example
   * ```typescript
   * // Block single user
   * const result = await client.blockUsers.block(['1234567890']);
   *
   * // Block multiple users
   * const result = await client.blockUsers.block(['1234567890', '0987654321']);
   *
   * // Check results
   * console.log('Blocked:', result.block_users.added_users);
   * console.log('Failed:', result.block_users.failed_users);
   * ```
   */
  block(users: string[]): Promise<BlockUsersResponse>;
  /**
   * Unblock one or more WhatsApp users
   * @param users - Array of phone numbers or WhatsApp IDs to unblock
   * @returns Response with successfully unblocked and failed users
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/block-users/
   *
   * @example
   * ```typescript
   * // Unblock single user
   * const result = await client.blockUsers.unblock(['1234567890']);
   *
   * // Unblock multiple users
   * const result = await client.blockUsers.unblock(['1234567890', '0987654321']);
   *
   * // Check results
   * console.log('Unblocked:', result.block_users.added_users);
   * console.log('Failed:', result.block_users.failed_users);
   * ```
   */
  unblock(users: string[]): Promise<BlockUsersResponse>;
  /**
   * Get list of blocked WhatsApp users with pagination
   * @param params - Optional pagination parameters
   * @returns List of blocked users with pagination info
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/block-users/
   *
   * @example
   * ```typescript
   * // Get first 10 blocked users
   * const result = await client.blockUsers.listBlockedUsers({ limit: 10 });
   *
   * // Pagination with cursor
   * const nextPage = await client.blockUsers.listBlockedUsers({
   *   limit: 10,
   *   after: result.paging?.cursors?.after
   * });
   *
   * // Get all blocked users
   * const allBlocked = await client.blockUsers.listBlockedUsers();
   * ```
   */
  listBlockedUsers(params?: ListBlockedUsersParams): Promise<ListBlockedUsersResponse>;
}
//#endregion
//#region src/api/business/types/common.d.ts
type BusinessGraphObject = Record<string, unknown>;
type BusinessFieldsParam = string[] | string;
type CursorPaginationParams = {
  limit?: number;
  after?: string;
  before?: string;
};
type BusinessGraphListResponse<T = BusinessGraphObject> = {
  data: T[];
  paging?: Paging;
  summary?: BusinessGraphObject;
};
type BusinessListParams = CursorPaginationParams & {
  fields?: BusinessFieldsParam;
  filtering?: BusinessGraphObject[] | string;
  sort?: string;
};
type AddPhoneNumbersRequest = {
  phone_number: string;
  verified_name?: string;
  [key: string]: unknown;
};
type SharePreVerifiedPhoneNumberRequest = {
  preverified_id: string;
  partner_business_id: string;
};
type OnboardPartnersToMMLiteRequest = {
  solution_id?: string;
  [key: string]: unknown;
};
type RequestPreVerifiedPhoneNumberCodeRequest = {
  code_method: 'SMS' | 'VOICE';
  language?: string;
  [key: string]: unknown;
};
type VerifyPreVerifiedPhoneNumberCodeRequest = {
  code: string;
  [key: string]: unknown;
};
interface BusinessClass {
  getConnectedClientBusinesses(applicationId?: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  addPhoneNumbers(businessId: string, request: AddPhoneNumbersRequest): Promise<ResponseSuccess>;
  getBusinessPortfolio(businessId: string, fields?: BusinessFieldsParam): Promise<BusinessGraphObject>;
  getPreVerifiedPhoneNumbers(businessId: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  getClientWhatsAppBusinessAccounts(businessId: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  onboardPartnersToMMLite(businessId: string, request: OnboardPartnersToMMLiteRequest): Promise<BusinessGraphObject>;
  getOwnedWhatsAppBusinessAccounts(businessId: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  sharePreVerifiedPhoneNumber(businessId: string, request: SharePreVerifiedPhoneNumberRequest): Promise<ResponseSuccess>;
  getCreditLines(businessId: string): Promise<BusinessGraphListResponse>;
  getAssignedWhatsAppBusinessAccounts(userId: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  getWhatsAppAccountNumberDetails(accountNumberId: string, fields?: BusinessFieldsParam): Promise<BusinessGraphObject>;
  getPreVerifiedPhoneNumberDetails(preVerifiedPhoneNumberId: string, fields?: BusinessFieldsParam): Promise<BusinessGraphObject>;
  deletePreVerifiedPhoneNumber(preVerifiedPhoneNumberId: string): Promise<ResponseSuccess>;
  getPreVerifiedPhoneNumberPartners(preVerifiedPhoneNumberId: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  requestPreVerifiedPhoneNumberCode(preVerifiedPhoneNumberId: string, request: RequestPreVerifiedPhoneNumberCodeRequest): Promise<ResponseSuccess>;
  verifyPreVerifiedPhoneNumberCode(preVerifiedPhoneNumberId: string, request: VerifyPreVerifiedPhoneNumberCodeRequest): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/business/BusinessApi.d.ts
declare class BusinessApi extends BaseAPI implements BusinessClass {
  private toQuery;
  private fieldsQuery;
  getConnectedClientBusinesses(applicationId?: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  addPhoneNumbers(businessId: string, request: AddPhoneNumbersRequest): Promise<ResponseSuccess>;
  getBusinessPortfolio(businessId: string, fields?: BusinessFieldsParam): Promise<BusinessGraphObject>;
  getPreVerifiedPhoneNumbers(businessId: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  getClientWhatsAppBusinessAccounts(businessId: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  onboardPartnersToMMLite(businessId: string, request: OnboardPartnersToMMLiteRequest): Promise<BusinessGraphObject>;
  getOwnedWhatsAppBusinessAccounts(businessId: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  sharePreVerifiedPhoneNumber(businessId: string, request: SharePreVerifiedPhoneNumberRequest): Promise<ResponseSuccess>;
  getCreditLines(businessId: string): Promise<BusinessGraphListResponse>;
  getAssignedWhatsAppBusinessAccounts(userId: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  getWhatsAppAccountNumberDetails(accountNumberId: string, fields?: BusinessFieldsParam): Promise<BusinessGraphObject>;
  getPreVerifiedPhoneNumberDetails(preVerifiedPhoneNumberId: string, fields?: BusinessFieldsParam): Promise<BusinessGraphObject>;
  deletePreVerifiedPhoneNumber(preVerifiedPhoneNumberId: string): Promise<ResponseSuccess>;
  getPreVerifiedPhoneNumberPartners(preVerifiedPhoneNumberId: string, params?: BusinessListParams): Promise<BusinessGraphListResponse>;
  requestPreVerifiedPhoneNumberCode(preVerifiedPhoneNumberId: string, request: RequestPreVerifiedPhoneNumberCodeRequest): Promise<ResponseSuccess>;
  verifyPreVerifiedPhoneNumberCode(preVerifiedPhoneNumberId: string, request: VerifyPreVerifiedPhoneNumberCodeRequest): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/calling/types/calling.d.ts
/**
 * Calling API Types
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
 */
type CallingStatus = 'ENABLED' | 'DISABLED';
type CallIconVisibility = 'DEFAULT' | 'DISABLE_ALL';
type CallbackPermissionStatus = 'ENABLED' | 'DISABLED';
type CallHoursStatus = 'ENABLED' | 'DISABLED';
type SipStatus = 'ENABLED' | 'DISABLED';
type CallHoursDay = 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY';
type WeeklyOperatingHours = {
  day_of_week: CallHoursDay;
  open_time: string;
  close_time: string;
};
type HolidaySchedule = {
  date: string;
  start_time: string;
  end_time: string;
};
type CallHours = {
  status: CallHoursStatus;
  timezone_id: string;
  weekly_operating_hours: WeeklyOperatingHours[];
  holiday_schedule?: HolidaySchedule[];
};
type SipServer = {
  hostname: string;
  port?: number;
  request_uri_user_params?: Record<string, string>;
  sip_user_password?: string;
};
type SipSettings = {
  status: SipStatus;
  servers?: SipServer[];
};
type CallingSettings = {
  status?: CallingStatus;
  call_icon_visibility?: CallIconVisibility;
  call_hours?: CallHours;
  callback_permission_status?: CallbackPermissionStatus;
  sip?: SipSettings;
};
type UpdateCallingSettingsRequest = {
  calling: CallingSettings;
};
type CallingSettingsResponse = {
  calling?: CallingSettings;
  [key: string]: unknown;
};
type CallPermission = {
  status: string;
  expiration_time?: number;
};
type CallPermissionLimit = {
  time_period: string;
  max_allowed: number;
  current_usage: number;
  limit_expiration_time?: number;
};
type CallPermissionAction = {
  action_name: string;
  can_perform_action: boolean;
  limits?: CallPermissionLimit[];
};
type CallPermissionsResponse = {
  messaging_product: 'whatsapp';
  permission: CallPermission;
  actions?: CallPermissionAction[];
};
type CallSdpType = 'offer' | 'answer';
type CallSession = {
  sdp_type: CallSdpType;
  sdp: string;
};
type CallAction = 'connect' | 'pre_accept' | 'accept' | 'reject' | 'terminate';
type InitiateCallRequest = {
  to: string;
  session: CallSession;
  biz_opaque_callback_data?: string;
};
type PreAcceptCallRequest = {
  call_id: string;
  session?: CallSession;
};
type AcceptCallRequest = {
  call_id: string;
  session?: CallSession;
  biz_opaque_callback_data?: string;
};
type RejectCallRequest = {
  call_id: string;
};
type TerminateCallRequest = {
  call_id: string;
};
type InitiateCallResponse = {
  messaging_product: 'whatsapp';
  calls: Array<{
    id: string;
  }>;
};
type CallActionResponse = {
  messaging_product: 'whatsapp';
  success: boolean;
};
interface CallingClass {
  updateCallingSettings(params: UpdateCallingSettingsRequest): Promise<ResponseSuccess>;
  getCallingSettings(params?: {
    fields?: string[] | string;
    include_sip_credentials?: boolean;
  }): Promise<CallingSettingsResponse>;
  getCallPermissions(params: {
    userWaId: string;
  }): Promise<CallPermissionsResponse>;
  initiateCall(params: InitiateCallRequest): Promise<InitiateCallResponse>;
  preAcceptCall(params: PreAcceptCallRequest): Promise<CallActionResponse>;
  acceptCall(params: AcceptCallRequest): Promise<CallActionResponse>;
  rejectCall(params: RejectCallRequest): Promise<CallActionResponse>;
  terminateCall(params: TerminateCallRequest): Promise<CallActionResponse>;
}
//#endregion
//#region src/api/calling/CallingApi.d.ts
/**
 * API for WhatsApp Calling features.
 *
 * Provides methods to manage calling settings, permissions, and call lifecycle
 * (initiate, pre-accept, accept, reject, terminate).
 *
 * Endpoints covered:
 * - `POST /{PHONE_NUMBER_ID}/settings` - Update calling settings
 * - `GET /{PHONE_NUMBER_ID}/settings` - Get calling settings
 * - `GET /{PHONE_NUMBER_ID}/call_permissions` - Get call permissions for a user
 * - `POST /{PHONE_NUMBER_ID}/calls` - Initiate, pre-accept, accept, reject, or terminate a call
 *
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
 */
declare class CallingApi extends BaseAPI implements CallingClass {
  private readonly endpoint;
  /**
   * Update calling settings for the phone number, such as enabling/disabling calling
   * or configuring SIP credentials.
   *
   * @param params - The calling settings to update.
   * @returns A success response confirming the settings were updated.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
   */
  updateCallingSettings(params: UpdateCallingSettingsRequest): Promise<ResponseSuccess>;
  /**
   * Retrieve the current calling settings for the phone number.
   *
   * @param params - Optional query parameters to filter the response.
   * @param params.fields - Specific fields to include in the response.
   * @param params.include_sip_credentials - Whether to include SIP credentials in the response.
   * @returns The current calling settings configuration.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
   */
  getCallingSettings(params?: {
    fields?: string[] | string;
    include_sip_credentials?: boolean;
  }): Promise<CallingSettingsResponse>;
  /**
   * Get calling permissions for a specific WhatsApp user.
   *
   * @param params - The request parameters.
   * @param params.userWaId - The WhatsApp ID of the user to check permissions for.
   * @returns The call permissions for the specified user.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
   */
  getCallPermissions(params: {
    userWaId: string;
  }): Promise<CallPermissionsResponse>;
  /**
   * Initiate an outbound call to a WhatsApp user.
   *
   * @param params - The call initiation parameters.
   * @param params.to - The recipient's WhatsApp phone number.
   * @param params.session - The call session configuration.
   * @param params.biz_opaque_callback_data - Optional opaque data passed back in webhooks.
   * @returns The initiated call response with call ID and status.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
   */
  initiateCall(params: InitiateCallRequest): Promise<InitiateCallResponse>;
  /**
   * Pre-accept an incoming call, signaling readiness to connect before full acceptance.
   *
   * @param params - The pre-accept request parameters.
   * @param params.call_id - The ID of the call to pre-accept.
   * @param params.session - Optional session configuration for the call.
   * @returns The call action response confirming the pre-accept.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
   */
  preAcceptCall(params: PreAcceptCallRequest): Promise<CallActionResponse>;
  /**
   * Accept an incoming call and establish the connection.
   *
   * @param params - The accept request parameters.
   * @param params.call_id - The ID of the call to accept.
   * @param params.session - Optional session configuration for the call.
   * @param params.biz_opaque_callback_data - Optional opaque data passed back in webhooks.
   * @returns The call action response confirming acceptance.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
   */
  acceptCall(params: AcceptCallRequest): Promise<CallActionResponse>;
  /**
   * Reject an incoming call.
   *
   * @param params - The reject request parameters.
   * @param params.call_id - The ID of the call to reject.
   * @returns The call action response confirming rejection.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
   */
  rejectCall(params: RejectCallRequest): Promise<CallActionResponse>;
  /**
   * Terminate an active call.
   *
   * @param params - The terminate request parameters.
   * @param params.call_id - The ID of the call to terminate.
   * @returns The call action response confirming termination.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
   */
  terminateCall(params: TerminateCallRequest): Promise<CallActionResponse>;
}
//#endregion
//#region src/api/commerce/types/commerce.d.ts
/**
 * Commerce Settings API Types
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/catalogs/sell-products-and-services/set-commerce-settings/
 */
type CommerceSetting = {
  id: string;
  is_cart_enabled?: boolean;
  is_catalog_visible?: boolean;
};
type CommerceSettingsResponse = {
  data: CommerceSetting[];
};
type UpdateCommerceSettingsRequest = {
  is_cart_enabled?: boolean;
  is_catalog_visible?: boolean;
};
interface CommerceClass {
  getCommerceSettings(): Promise<CommerceSettingsResponse>;
  updateCommerceSettings(params: UpdateCommerceSettingsRequest): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/commerce/CommerceApi.d.ts
/**
 * API for WhatsApp Commerce Settings.
 *
 * Provides methods to retrieve and update commerce settings such as cart
 * and catalog visibility for your WhatsApp Business phone number.
 *
 * Endpoints covered:
 * - `GET /{PHONE_NUMBER_ID}/whatsapp_commerce_settings` - Get commerce settings
 * - `POST /{PHONE_NUMBER_ID}/whatsapp_commerce_settings` - Update commerce settings
 *
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/catalogs/sell-products-and-services/set-commerce-settings/
 */
declare class CommerceApi extends BaseAPI implements CommerceClass {
  private readonly endpoint;
  /**
   * Retrieve the current commerce settings for the phone number.
   *
   * @returns The current commerce settings including cart and catalog visibility state.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/catalogs/sell-products-and-services/set-commerce-settings/
   */
  getCommerceSettings(): Promise<CommerceSettingsResponse>;
  /**
   * Update commerce settings for the phone number (e.g., enable/disable cart or catalog).
   *
   * @param params - The commerce settings to update (e.g., is_cart_enabled, is_catalog_visible).
   * @returns A success response confirming the settings were updated.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/catalogs/sell-products-and-services/set-commerce-settings/
   */
  updateCommerceSettings(params: UpdateCommerceSettingsRequest): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/encryption/types/publicKey.d.ts
type EncryptionPublicKeyResponse = ResponseData<{
  business_public_key: string;
  business_public_key_signature_status: 'VALID' | 'MISMATCH';
}>;
//#endregion
//#region src/api/encryption/types/common.d.ts
interface EncryptionClass {
  getEncryptionPublicKey(): Promise<EncryptionPublicKeyResponse>;
  setEncryptionPublicKey(businessPublicKey: string): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/encryption/EncryptionApi.d.ts
/**
 * API for managing WhatsApp Business Encryption keys.
 *
 * Provides methods to get and set the public encryption key used for
 * end-to-end encrypted messaging with WhatsApp Business.
 *
 * Endpoints covered:
 * - `GET /{PHONE_NUMBER_ID}/whatsapp_business_encryption` - Get the current public encryption key
 * - `POST /{PHONE_NUMBER_ID}/whatsapp_business_encryption` - Set a new public encryption key
 *
 * @see https://developers.facebook.com/docs/whatsapp/cloud-api/reference/whatsapp-business-encryption/
 */
declare class EncryptionApi extends BaseAPI implements EncryptionClass {
  private readonly endpoint;
  /**
   * Retrieve the current public encryption key for the phone number.
   *
   * @returns The current public encryption key.
   * @see https://developers.facebook.com/docs/whatsapp/cloud-api/reference/whatsapp-business-encryption/
   */
  getEncryptionPublicKey(): Promise<EncryptionPublicKeyResponse>;
  /**
   * Set a new public encryption key for the phone number.
   *
   * @param businessPublicKey - The PEM-encoded public key string to set.
   * @returns A success response confirming the key was set.
   * @see https://developers.facebook.com/docs/whatsapp/cloud-api/reference/whatsapp-business-encryption/
   */
  setEncryptionPublicKey(businessPublicKey: string): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/groups/types/groups.d.ts
/**
 * Groups API Types
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
 */
type GroupJoinApprovalMode = 'approval_required' | 'auto_approve';
type GroupCreateRequest = {
  subject: string;
  description?: string;
  join_approval_mode?: GroupJoinApprovalMode;
};
type GroupCreateResponse = {
  messaging_product: 'whatsapp';
  id: string;
  invite_link?: string;
};
type GroupInfoField = 'join_approval_mode' | 'subject' | 'description' | 'suspended' | 'creation_timestamp' | 'participants' | 'total_participant_count';
type GroupInfoFieldsParam = GroupInfoField[] | string;
type GroupParticipant = {
  wa_id: string;
};
type GroupInfoResponse = {
  messaging_product: 'whatsapp';
  id: string;
  subject?: string;
  description?: string;
  suspended?: boolean;
  creation_timestamp?: number;
  participants?: GroupParticipant[];
  total_participant_count?: number;
  join_approval_mode?: GroupJoinApprovalMode;
};
type GroupInviteLinkResponse = {
  messaging_product: 'whatsapp';
  invite_link: string;
};
type GroupJoinRequest = {
  join_request_id: string;
  wa_id: string;
  creation_timestamp: number;
};
type GroupJoinRequestError = {
  code: number;
  message: string;
  title?: string;
  error_data?: {
    details?: string;
  };
};
type GroupJoinRequestFailure = {
  join_request_id: string;
  errors: GroupJoinRequestError[];
};
type GroupJoinRequestsResponse = {
  data: GroupJoinRequest[];
  paging?: PagingInfo$1;
};
type GroupJoinRequestsActionResponse = {
  messaging_product: 'whatsapp';
  approved_join_requests?: string[];
  rejected_join_requests?: string[];
  failed_join_requests?: GroupJoinRequestFailure[];
  errors?: GroupJoinRequestError[];
};
type GroupSummary = {
  id: string;
  subject: string;
  created_at: number;
};
type GroupListResponse = {
  data: {
    groups: GroupSummary[];
  };
  paging?: PagingInfo$1;
};
type GroupListParams = {
  limit?: number;
  after?: string;
  before?: string;
};
type GroupParticipantInput = {
  user: string;
};
type GroupParticipantsRequest = {
  participants: GroupParticipantInput[];
};
type UpdateGroupSettingsRequest = {
  subject?: string;
  description?: string;
  profilePictureFile?: Blob | Buffer;
};
type GroupSettingsResponse = ResponseSuccess;
interface GroupsClass {
  createGroup(params: GroupCreateRequest): Promise<GroupCreateResponse>;
  deleteGroup(groupId: string): Promise<ResponseSuccess>;
  getGroupInfo(groupId: string, fields?: GroupInfoFieldsParam): Promise<GroupInfoResponse>;
  getActiveGroups(params?: GroupListParams): Promise<GroupListResponse>;
  getGroupInviteLink(groupId: string): Promise<GroupInviteLinkResponse>;
  createGroupInviteLink(groupId: string): Promise<GroupInviteLinkResponse>;
  resetGroupInviteLink(groupId: string): Promise<GroupInviteLinkResponse>;
  deleteGroupInviteLink(groupId: string): Promise<ResponseSuccess>;
  getJoinRequests(groupId: string): Promise<GroupJoinRequestsResponse>;
  approveJoinRequests(groupId: string, joinRequestIds: string[]): Promise<GroupJoinRequestsActionResponse>;
  rejectJoinRequests(groupId: string, joinRequestIds: string[]): Promise<GroupJoinRequestsActionResponse>;
  addParticipants(groupId: string, participants: string[]): Promise<ResponseSuccess>;
  removeParticipants(groupId: string, participants: string[]): Promise<ResponseSuccess>;
  updateGroupSettings(groupId: string, params: UpdateGroupSettingsRequest): Promise<GroupSettingsResponse>;
}
type PagingInfo$1 = {
  cursors?: {
    before?: string;
    after?: string;
  };
  previous?: string;
  next?: string;
};
//#endregion
//#region src/api/messages/types/text.d.ts
type TextObject = {
  body: string;
  preview_url?: boolean;
};
interface TextMessageParams extends MessageRequestParams<TextObject | string> {
  previewUrl?: boolean;
}
//#endregion
//#region src/api/messages/types/template.d.ts
type LanguageObject = {
  policy: 'deterministic';
  code: LanguagesEnum | (string & {});
};
type ParametersObject<T extends ParametersTypesEnum> = {
  type: T;
};
type SimpleTextObject$1 = {
  text: string;
};
type TextParametersObject = ParametersObject<ParametersTypesEnum.Text> & SimpleTextObject$1;
type CouponCodeParametersObject = ParametersObject<ParametersTypesEnum.CouponCode> & {
  coupon_code: string;
};
type CurrencyObject = {
  fallback_value: string;
  code: CurrencyCodesEnum;
  amount_1000: number;
};
type CurrencyParametersObject = ParametersObject<ParametersTypesEnum.Currency> & {
  currency: CurrencyObject;
};
type DateTimeObject = {
  fallback_value: string;
};
type DateTimeParametersObject = ParametersObject<ParametersTypesEnum.Currency> & {
  date_time: DateTimeObject;
};
type DocumentMediaObject$2 = {
  id?: string;
  link?: string;
  caption?: string;
  filename?: string;
};
type ImageMediaObject$2 = {
  id?: string;
  link?: string;
  caption?: string;
};
type VideoMediaObject$2 = {
  id?: string;
  link?: string;
  caption?: string;
};
type DocumentParametersObject = ParametersObject<ParametersTypesEnum.Document> & DocumentMediaObject$2;
type ImageParametersObject = ParametersObject<ParametersTypesEnum.Image> & ImageMediaObject$2;
type VideoParametersObject = ParametersObject<ParametersTypesEnum.Video> & VideoMediaObject$2;
type ComponentObject<T extends ComponentTypesEnum> = {
  type: T;
  parameters: (CurrencyParametersObject | DateTimeParametersObject | DocumentParametersObject | ImageParametersObject | TextParametersObject | VideoParametersObject | CouponCodeParametersObject)[];
};
type ButtonComponentObject = ComponentObject<ComponentTypesEnum.Button> & {
  parameters?: (TextParametersObject | PayloadParametersObject)[];
  sub_type: SubTypeEnum;
  index: ButtonPositionEnum;
};
type PayloadParametersObject = ParametersObject<ParametersTypesEnum.Payload> & {
  payload: string;
};
type MessageTemplateObject<T extends ComponentTypesEnum> = {
  name: string;
  language: LanguageObject;
  components?: (ComponentObject<T> | ButtonComponentObject)[];
};
type MessageTemplateRequestBody<T extends ComponentTypesEnum> = MessageRequestBody<MessageTypesEnum.Template> & MessageTemplateObject<T>;
//#endregion
//#region src/api/messages/types/media.d.ts
type MetaMediaObject = {
  id: string;
  link?: never;
};
type HostedMediaObject = {
  id?: never;
  link: string;
};
type AudioMediaObject = MetaMediaObject | HostedMediaObject;
type MetaDocumentMediaObject = MetaMediaObject & {
  caption?: string;
  filename?: string;
};
type HostedDocumentMediaObject = HostedMediaObject & {
  caption?: string;
  filename?: string;
};
type DocumentMediaObject = MetaDocumentMediaObject | HostedDocumentMediaObject;
type MetaImageMediaObject = MetaMediaObject & {
  caption?: string;
};
type HostedImageMediaObject = HostedMediaObject & {
  caption?: string;
};
type ImageMediaObject = MetaImageMediaObject | HostedImageMediaObject;
type MetaVideoMediaObject = MetaMediaObject & {
  caption?: string;
};
type HostedVideoMediaObject = HostedMediaObject & {
  caption?: string;
};
type VideoMediaObject = MetaVideoMediaObject | HostedVideoMediaObject;
type StickerMediaObject = MetaMediaObject | HostedMediaObject;
//#endregion
//#region src/api/messages/types/contact.d.ts
type AddressesObject = {
  street?: string;
  city?: string;
  state?: string;
  zip?: string;
  country?: string;
  country_code?: string;
  type?: 'HOME' | 'WORK' | string;
};
type EmailObject = {
  email?: string;
  type?: 'HOME' | 'WORK' | string;
};
type NameObject = {
  formatted_name: string;
  first_name?: string;
  last_name?: string;
  middle_name?: string;
  suffix?: string;
  prefix?: string;
};
type OrgObject = {
  company?: string;
  department?: string;
  title?: string;
};
type PhoneObject = {
  phone?: string;
  type?: 'CELL' | 'MAIN' | 'IPHONE' | 'HOME' | 'WORK' | string;
  wa_id?: string;
};
type URLObject = {
  url?: string;
  type?: 'HOME' | 'WORK' | string;
};
type ContactObject = {
  addresses?: AddressesObject[];
  birthday?: `${number}${number}${number}${number}-${number}${number}-${number}${number}`;
  emails?: EmailObject[];
  name: NameObject;
  org?: OrgObject;
  phones?: PhoneObject[];
  urls?: URLObject[];
};
//#endregion
//#region src/api/messages/types/location.d.ts
type LocationObject = {
  longitude: number;
  latitude: number;
  name?: string;
  address?: string;
};
//#endregion
//#region src/api/messages/types/interactive.d.ts
type DocumentMediaObject$1 = {
  id?: string;
  link?: string;
  caption?: string;
  filename?: string;
};
type ImageMediaObject$1 = {
  id?: string;
  link?: string;
  caption?: string;
};
type VideoMediaObject$1 = {
  id?: string;
  link?: string;
  caption?: string;
};
type ProductObject = {
  product_retailer_id: string;
};
type SimpleTextObject = {
  text: string;
};
type RowObject = {
  id: string;
  title: string;
  description?: string;
};
type MultiProductSectionObject = {
  product_items: ProductObject[];
  rows?: never;
  title?: string;
};
type ListSectionObject = {
  product_items?: never;
  rows: RowObject[];
  title?: string;
};
type SectionObject = MultiProductSectionObject | ListSectionObject;
type ButtonObject = {
  title: string;
  id: string;
};
type ReplyButtonObject = {
  type: 'reply';
  reply: ButtonObject;
};
type ActionObject = {
  button?: string;
  buttons?: ReplyButtonObject[];
  catalog_id?: string;
  product_retailer_id?: string;
  sections?: SectionObject[];
};
type HeaderObject = {
  type: 'document' | 'image' | 'text' | 'video';
  document?: DocumentMediaObject$1;
  image?: ImageMediaObject$1;
  text?: string;
  sub_text?: string;
  video?: VideoMediaObject$1;
};
type ButtonInteractiveObject = {
  type: InteractiveTypesEnum.Button | 'button';
  body: SimpleTextObject;
  footer?: SimpleTextObject;
  header?: HeaderObject;
  action: ActionObject;
};
type ListInteractiveObject = {
  type: InteractiveTypesEnum.List | 'list';
  body: SimpleTextObject;
  footer?: SimpleTextObject;
  header?: HeaderObject;
  action: ActionObject;
};
type ProductInteractiveObject = {
  type: InteractiveTypesEnum.Product | 'product';
  body?: SimpleTextObject;
  footer?: SimpleTextObject;
  header?: HeaderObject;
  action: ActionObject;
};
type ProductListInteractiveObject = {
  type: InteractiveTypesEnum.ProductList | 'product_list';
  body: SimpleTextObject;
  footer?: SimpleTextObject;
  header: HeaderObject;
  action: ActionObject;
};
type CatalogMessageParameters = {
  thumbnail_product_retailer_id: string;
};
type CatalogMessageActionObject = {
  name: 'catalog_message';
  parameters?: CatalogMessageParameters;
};
type CatalogMessageInteractiveObject = {
  type: InteractiveTypesEnum.CatalogMessage | 'catalog_message';
  body?: SimpleTextObject;
  footer?: SimpleTextObject;
  header?: HeaderObject;
  action: CatalogMessageActionObject;
};
type CallPermissionRequestActionObject = {
  name: 'call_permission_request';
};
type CallPermissionRequestInteractiveObject = {
  type: InteractiveTypesEnum.CallPermissionRequest | 'call_permission_request';
  body?: SimpleTextObject;
  footer?: SimpleTextObject;
  header?: HeaderObject;
  action: CallPermissionRequestActionObject;
};
type CtaUrlParameters = {
  display_text: string;
  url: string;
};
type CtaUrlActionObject = {
  name: 'cta_url';
  parameters: CtaUrlParameters;
};
type CtaUrlInteractiveObject = {
  type: InteractiveTypesEnum.CtaUrl | 'cta_url';
  body?: SimpleTextObject;
  footer?: SimpleTextObject;
  header?: HeaderObject;
  action: CtaUrlActionObject;
};
type LocationRequestActionObject = {
  name: 'send_location';
};
type LocationRequestInteractiveObject = {
  type: InteractiveTypesEnum.LocationRequest | 'location_request_message';
  body: SimpleTextObject;
  footer?: SimpleTextObject;
  header?: HeaderObject;
  action: LocationRequestActionObject;
};
type AddressValues = {
  name?: string;
  phone_number?: string;
  in_pin_code?: string;
  house_number?: string;
  floor_number?: string;
  tower_number?: string;
  building_name?: string;
  address?: string;
  landmark_area?: string;
  city?: string;
  state?: string;
};
type SavedAddress = {
  id: string;
  value: AddressValues;
};
type ValidationErrors = { [key in keyof AddressValues]?: string };
type AddressMessageParameters = {
  country: string;
  values?: AddressValues;
  saved_addresses?: SavedAddress[];
  validation_errors?: ValidationErrors;
};
type AddressMessageActionObject = {
  name: 'address_message';
  parameters: AddressMessageParameters;
};
type AddressMessageInteractiveObject = {
  type: InteractiveTypesEnum.AddressMessage | 'address_message';
  body: SimpleTextObject;
  footer?: SimpleTextObject;
  header?: HeaderObject;
  action: AddressMessageActionObject;
};
type FlowParameters = {
  flow_message_version: string;
  flow_id?: string;
  flow_name?: string;
  flow_cta: string;
  mode?: 'draft' | 'published';
  flow_token?: string;
  flow_action?: 'navigate' | 'data_exchange';
  flow_action_payload?: {
    screen?: string;
    data?: Record<string, string>;
  };
};
type FlowActionObject = {
  name: 'flow';
  parameters: FlowParameters;
};
type FlowInteractiveObject = {
  type: InteractiveTypesEnum.Flow | 'flow';
  body: SimpleTextObject;
  footer?: SimpleTextObject;
  header?: HeaderObject;
  action: FlowActionObject;
};
type CarouselHeaderObject = {
  type: 'image' | 'video';
  image?: ImageMediaObject$1;
  video?: VideoMediaObject$1;
};
type CarouselQuickReply = {
  id: string;
  title: string;
};
type CarouselQuickReplyButton = {
  type: 'quick_reply';
  quick_reply: CarouselQuickReply;
};
type CarouselCtaUrlAction = {
  name: 'cta_url';
  parameters: CtaUrlParameters;
};
type CarouselQuickReplyAction = {
  buttons: CarouselQuickReplyButton[];
};
type MediaCarouselCard$1 = {
  card_index: number;
  type: 'cta_url';
  header: CarouselHeaderObject;
  body?: SimpleTextObject;
  action: CarouselCtaUrlAction | CarouselQuickReplyAction;
};
type ProductCarouselAction = {
  product_retailer_id: string;
  catalog_id: string;
};
type ProductCarouselCard$1 = {
  card_index: number;
  type: 'product';
  action: ProductCarouselAction;
};
type CarouselActionObject = {
  cards: Array<MediaCarouselCard$1 | ProductCarouselCard$1>;
};
type CarouselInteractiveObject = {
  type: InteractiveTypesEnum.Carousel | 'carousel';
  body: SimpleTextObject;
  action: CarouselActionObject;
};
type InteractiveObject = ButtonInteractiveObject | ListInteractiveObject | ProductInteractiveObject | ProductListInteractiveObject | CatalogMessageInteractiveObject | CallPermissionRequestInteractiveObject | CtaUrlInteractiveObject | CarouselInteractiveObject | LocationRequestInteractiveObject | AddressMessageInteractiveObject | FlowInteractiveObject;
//#endregion
//#region src/api/messages/types/reaction.d.ts
interface ReactionParams {
  messageId: string;
  emoji: string;
  to: string;
  recipientType?: MessageRecipientType;
}
//#endregion
//#region src/api/messages/types/common.d.ts
type GeneralMessageBody = GeneralRequestBody & {
  /**
   * The Meta messaging product name.
   * @default 'whatsapp'
   */
  messaging_product: 'whatsapp';
};
type StatusObject = {
  status: 'read' | 'typing';
  message_id: string;
  typing_indicator?: TypingIndicatorObject;
};
type TypingIndicatorObject = {
  type: 'text';
};
type StatusResponse = ResponseSuccess;
type ConTextObject = {
  message_id: string;
};
type MessageRecipientType = 'individual' | 'group';
type MessageRequestBody<T extends MessageTypesEnum> = GeneralMessageBody & {
  recipient_type?: MessageRecipientType;
  to: string;
  context?: ConTextObject;
  type?: T;
};
interface MessageRequestParams<T> {
  body: T;
  to: string;
  recipientType?: MessageRecipientType;
  replyMessageId?: string;
}
interface StatusParams {
  status: StatusObject['status'];
  messageId: string;
  typingIndicator?: TypingIndicatorObject;
}
type MessagesResponse = GeneralMessageBody & {
  contacts: Array<{
    input: string;
    wa_id: string;
  }>;
  messages: Array<{
    id: string;
    message_status?: 'accepted' | 'held_for_quality_assessment' | 'paused';
  }>;
};
type EncryptedMessageRequest = {
  messaging_product: 'whatsapp';
  encrypted_contents: string;
};
type EncryptedMessagesResponse = {
  encrypted_contents: string;
};
declare class MessagesClass extends BaseClass {
  text(params: TextMessageParams): Promise<MessagesResponse>;
  template(params: MessageRequestParams<MessageTemplateObject<ComponentTypesEnum>>): Promise<MessagesResponse>;
  audio(params: MessageRequestParams<AudioMediaObject>): Promise<MessagesResponse>;
  document(params: MessageRequestParams<DocumentMediaObject>): Promise<MessagesResponse>;
  image(params: MessageRequestParams<ImageMediaObject>): Promise<MessagesResponse>;
  video(params: MessageRequestParams<VideoMediaObject>): Promise<MessagesResponse>;
  sticker(params: MessageRequestParams<StickerMediaObject>): Promise<MessagesResponse>;
  contacts(params: MessageRequestParams<ContactObject[]>): Promise<MessagesResponse>;
  location(params: MessageRequestParams<LocationObject>): Promise<MessagesResponse>;
  interactive(params: MessageRequestParams<InteractiveObject>): Promise<MessagesResponse>;
  interactiveList(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.List;
  }>): Promise<MessagesResponse>;
  interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.CtaUrl;
  }>): Promise<MessagesResponse>;
  interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.LocationRequest;
  }>): Promise<MessagesResponse>;
  interactiveAddressMessage(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.AddressMessage;
  }>): Promise<MessagesResponse>;
  interactiveReplyButtons(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.Button;
  }>): Promise<MessagesResponse>;
  interactiveFlow(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.Flow;
  }>): Promise<MessagesResponse>;
  interactiveCarousel(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.Carousel;
  }>): Promise<MessagesResponse>;
  reaction(params: ReactionParams): Promise<MessagesResponse>;
  encrypted(params: EncryptedMessageRequest): Promise<EncryptedMessagesResponse>;
  markAsRead(params: {
    messageId: string;
  }): Promise<StatusResponse>;
  showTypingIndicator(params: {
    messageId: string;
  }): Promise<StatusResponse>;
  status(params: StatusParams): Promise<StatusResponse>;
}
//#endregion
//#region src/api/marketingMessages/types/marketingMessages.d.ts
/**
 * Marketing Messages API Types
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/marketing-messages/send-marketing-messages/
 */
type MarketingMessageRequest = {
  to: string;
  template: MessageTemplateObject<ComponentTypesEnum>;
  message_activity_sharing?: boolean;
  product_policy?: 'CLOUD_API_FALLBACK' | 'STRICT';
};
interface MarketingMessagesClass {
  sendTemplateMessage(params: MarketingMessageRequest): Promise<MessagesResponse>;
}
//#endregion
//#region src/api/media/types/common.d.ts
type MediaResponse = {
  id: string;
  url: string;
  mime_type: string;
  sha256: string;
  file_size: number;
  messaging_product: 'whatsapp';
};
type MediasResponse = {
  data: MediaResponse[];
  paging: {
    cursors: {
      before: string;
      after: string;
    };
  };
};
type UploadMediaResponse = {
  id: string;
};
interface MediaClass {
  getMediaById(mediaId: string): Promise<MediaResponse>;
  uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
  deleteMedia(mediaId: string): Promise<ResponseSuccess>;
  downloadMedia(mediaUrl: string): Promise<Blob>;
}
//#endregion
//#region src/api/payments/types/payments.d.ts
/**
 * Payments API Types (India Payment Configuration)
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/payments/payments-in/onboarding-apis/
 */
type PaymentConfigurationProvider = 'upi_vpa' | 'razorpay' | 'payu' | 'zaakpay';
type PaymentConfigurationStatus = 'Active' | 'Needs_Connecting' | 'Needs_Testing';
type PaymentConfigurationCode = {
  code: string;
  description?: string;
};
type PaymentConfiguration = {
  configuration_name: string;
  provider_name: string;
  provider_mid?: string;
  status?: PaymentConfigurationStatus;
  merchant_category_code?: PaymentConfigurationCode;
  purpose_code?: PaymentConfigurationCode;
  created_timestamp?: number;
  updated_timestamp?: number;
};
type PaymentConfigurationsResponse = {
  data: Array<{
    payment_configurations: PaymentConfiguration[];
  }>;
};
type PaymentConfigurationCreateRequest = {
  configuration_name: string;
  provider_name: PaymentConfigurationProvider;
  purpose_code?: string;
  merchant_category_code?: string;
  redirect_url?: string;
  merchant_vpa?: string;
};
type PaymentConfigurationUpdateRequest = {
  provider_name?: PaymentConfigurationProvider;
  purpose_code?: string;
  merchant_category_code?: string;
  redirect_url?: string;
  merchant_vpa?: string;
};
type PaymentConfigurationCreateResponse = {
  success: boolean;
  oauth_url?: string;
  expiration?: number;
};
type PaymentConfigurationUpdateResponse = PaymentConfigurationCreateResponse;
type PaymentConfigurationOauthLinkRequest = {
  configuration_name: string;
  redirect_url?: string;
};
type PaymentConfigurationOauthLinkResponse = {
  oauth_url: string;
  expiration?: number;
};
type PaymentConfigurationDeleteRequest = {
  configuration_name: string;
};
interface PaymentsClass {
  listPaymentConfigurations(wabaId: string): Promise<PaymentConfigurationsResponse>;
  getPaymentConfiguration(wabaId: string, configurationName: string): Promise<PaymentConfigurationsResponse>;
  createPaymentConfiguration(wabaId: string, params: PaymentConfigurationCreateRequest): Promise<PaymentConfigurationCreateResponse>;
  updatePaymentConfiguration(wabaId: string, configurationName: string, params: PaymentConfigurationUpdateRequest): Promise<PaymentConfigurationUpdateResponse>;
  generatePaymentConfigurationOauthLink(wabaId: string, params: PaymentConfigurationOauthLinkRequest): Promise<PaymentConfigurationOauthLinkResponse>;
  deletePaymentConfiguration(wabaId: string, params: PaymentConfigurationDeleteRequest): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/phone/types/common.d.ts
type QualityRating = 'GREEN' | 'YELLOW' | 'RED' | 'NA' | 'UNKNOWN';
type AccountMode = 'LIVE' | 'SANDBOX';
type CodeVerificationStatus = 'NOT_VERIFIED' | 'VERIFIED' | 'EXPIRED' | 'PENDING' | 'DELETED' | 'MIGRATED' | 'BANNED' | 'RESTRICTED' | 'RATE_LIMITED' | 'FLAGGED' | 'CONNECTED' | 'DISCONNECTED' | 'UNKNOWN' | 'UNVERIFIED';
type MessagingLimitTier = 'TIER_50' | 'TIER_250' | 'TIER_1K' | 'TIER_2K' | 'TIER_10K' | 'TIER_100K' | 'TIER_UNLIMITED' | (string & {});
type PlatformType = 'CLOUD_API' | 'ON_PREMISE' | 'NOT_APPLICABLE';
type ThroughputLevel = 'STANDARD' | 'HIGH' | 'NOT_APPLICABLE';
type PhoneNumberStatus = 'PENDING' | 'LINKED' | 'UNLINKED' | 'DELETED' | 'MIGRATED' | 'BANNED' | 'RESTRICTED';
type UnifiedCertStatus = 'APPROVED' | 'PENDING' | 'REJECTED' | 'EXPIRED' | 'NONE' | string;
type HostPlatform = 'CLOUD_API' | 'ON_PREMISE' | 'NOT_APPLICABLE' | string;
type HealthStatusEntity = {
  entity_type: string;
  id: string;
  can_send_message: string;
  additional_info?: string[];
  errors?: Array<{
    error_code: number;
    error_description: string;
    possible_solution: string;
  }>;
};
type HealthStatus = {
  can_send_message: string;
  entities: HealthStatusEntity[];
};
type QualityScore = {
  score: QualityRating;
};
type Throughput = {
  level: ThroughputLevel;
};
type PhoneNumberField = 'country_code' | 'country_dial_code' | 'display_phone_number' | 'id' | 'quality_rating' | 'verified_name' | 'account_mode' | 'certificate' | 'code_verification_status' | 'conversational_automation' | 'eligibility_for_api_business_global_search' | 'health_status' | 'host_platform' | 'is_official_business_account' | 'is_on_biz_app' | 'is_pin_enabled' | 'is_preverified_number' | 'last_onboarded_time' | 'messaging_limit_tier' | 'name_status' | 'new_certificate' | 'new_name_status' | 'platform_type' | 'quality_score' | 'search_visibility' | 'status' | 'throughput' | 'unified_cert_status' | 'username';
type PhoneNumberFieldsParam = PhoneNumberField[] | string;
type PhoneNumberSort = 'creation_time.asc' | 'creation_time.desc' | 'last_onboarded_time.asc' | 'last_onboarded_time.desc' | (string & {});
type PhoneNumberFilter = Record<string, unknown>;
type PhoneNumbersListParams = {
  fields?: PhoneNumberFieldsParam;
  filtering?: PhoneNumberFilter[] | string;
  sort?: PhoneNumberSort;
  limit?: number;
  after?: string;
  before?: string;
};
type GraphObject = Record<string, unknown>;
type CreatePhoneNumberRequest = {
  cc?: string;
  phone_number?: string;
  verified_name?: string;
  preverified_id?: string;
  [key: string]: unknown;
};
type CreatePhoneNumberResponse = {
  id: string;
  [key: string]: unknown;
};
type UpdatePhoneNumberStatusRequest = {
  connection_status?: 'CONNECTED' | 'DISCONNECTED' | (string & {});
  webhook_url?: string;
  whatsapp_business_api_data?: Record<string, unknown>;
  pin?: string;
};
type PhoneNumberSettingsFieldsParam = string[] | string;
type PhoneNumberSettingsParams = {
  fields?: PhoneNumberSettingsFieldsParam;
  include_sip_credentials?: boolean;
};
type PhoneNumberSettingsResponse = GraphObject;
type UpdatePhoneNumberSettingsRequest = {
  calling?: GraphObject;
  [key: string]: unknown;
};
type OfficialBusinessAccountStatusResponse = GraphObject;
type OfficialBusinessAccountAction = 'SUBMIT_APPLICATION' | 'WITHDRAW_APPLICATION' | 'RESUBMIT_APPLICATION';
type OfficialBusinessAccountApplicationData = {
  business_name?: string;
  business_description?: string;
  /**
   * OBA examples use `website_url`, while the schema also exposes `business_website_url`.
   * Both are accepted to track Meta's published OpenAPI variants.
   */
  website_url?: string;
  business_website_url?: string;
  contact_email?: string;
  primary_country_of_operation?: string;
  primary_language?: string;
  parent_business_or_brand?: string;
  [key: string]: unknown;
};
type UpdateOfficialBusinessAccountStatusRequest = {
  action?: OfficialBusinessAccountAction | (string & {});
  application_data?: OfficialBusinessAccountApplicationData;
  business_website_url?: string;
  primary_country_of_operation?: string;
  [key: string]: unknown;
};
type BusinessComplianceInfoResponse = GraphObject;
type UpdateBusinessComplianceInfoRequest = {
  [key: string]: unknown;
};
type PhoneNumberResponse = {
  display_phone_number: string;
  id: string;
  quality_rating: QualityRating;
  verified_name: string;
  account_mode?: AccountMode;
  certificate?: string;
  code_verification_status?: CodeVerificationStatus;
  conversational_automation?: Record<string, unknown>;
  country_code?: string;
  country_dial_code?: string;
  eligibility_for_api_business_global_search?: string;
  health_status?: HealthStatus;
  host_platform?: HostPlatform;
  is_official_business_account?: boolean;
  is_on_biz_app?: boolean;
  is_pin_enabled?: boolean;
  is_preverified_number?: boolean;
  last_onboarded_time?: string;
  messaging_limit_tier?: MessagingLimitTier;
  name_status?: string;
  new_certificate?: string;
  new_name_status?: string;
  platform_type?: PlatformType;
  quality_score?: QualityScore;
  search_visibility?: string;
  status?: PhoneNumberStatus | CodeVerificationStatus;
  throughput?: Throughput;
  unified_cert_status?: UnifiedCertStatus;
  username?: string;
};
type Cursors = {
  before: string;
  after: string;
};
type PhoneNumbersResponse = {
  data: PhoneNumberResponse[];
  paging: Paging;
};
type RequestVerificationCodeRequest = {
  code_method: 'SMS' | 'VOICE';
  language: string;
};
type VerifyCodeRequest = {
  code: string;
};
type TwoStepVerificationParams = {
  pin: string;
};
/**
 * Conversational Components - Commands
 */
type ConversationalCommand = {
  command_name: string;
  command_description: string;
};
/**
 * Conversational Components - Ice Breakers (Prompts)
 */
type ConversationalPrompt = string;
/**
 * Request payload for configuring conversational automation
 */
type ConversationalAutomationRequest = {
  enable_welcome_message?: boolean;
  commands?: ConversationalCommand[];
  prompts?: ConversationalPrompt[];
};
/**
 * Response from conversational automation GET endpoint
 */
type ConversationalAutomationResponse = {
  enable_welcome_message?: boolean;
  commands?: ConversationalCommand[];
  prompts?: ConversationalPrompt[];
  id: string;
};
/**
 * Response from throughput GET endpoint
 */
type ThroughputResponse = {
  throughput: Throughput;
  id: string;
};
interface PhoneNumberClass {
  getPhoneNumberById(fields?: PhoneNumberFieldsParam): Promise<PhoneNumberResponse>;
  getPhoneNumbers(params?: PhoneNumbersListParams): Promise<PhoneNumbersResponse>;
  createPhoneNumber(request: CreatePhoneNumberRequest, wabaId?: string): Promise<CreatePhoneNumberResponse>;
  updatePhoneNumberStatus(request: UpdatePhoneNumberStatusRequest): Promise<ResponseSuccess>;
  requestVerificationCode(params: RequestVerificationCodeRequest): Promise<ResponseSuccess>;
  verifyCode(params: VerifyCodeRequest): Promise<ResponseSuccess>;
  getPhoneNumberSettings(params?: PhoneNumberSettingsParams): Promise<PhoneNumberSettingsResponse>;
  updatePhoneNumberSettings(params: UpdatePhoneNumberSettingsRequest): Promise<ResponseSuccess>;
  setConversationalAutomation(params: ConversationalAutomationRequest): Promise<ResponseSuccess>;
  getConversationalAutomation(): Promise<ConversationalAutomationResponse>;
  getThroughput(): Promise<ThroughputResponse>;
  getOfficialBusinessAccountStatus(): Promise<OfficialBusinessAccountStatusResponse>;
  updateOfficialBusinessAccountStatus(params: UpdateOfficialBusinessAccountStatusRequest): Promise<ResponseSuccess>;
  getBusinessComplianceInfo(): Promise<BusinessComplianceInfoResponse>;
  updateBusinessComplianceInfo(params: UpdateBusinessComplianceInfoRequest): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/profile/types/upload.d.ts
/**
 * Upload session information for creating upload sessions.
 */
interface UploadSession {
  id: string;
  video?: boolean;
}
/**
 * Response from creating an upload session.
 */
interface UploadSessionResponse {
  id: string;
}
/**
 * Response from uploading business profile media.
 */
interface UploadBusinessProfileResponse {
  h: string;
}
/**
 * Upload handle information containing file details and handle.
 */
interface UploadHandle {
  handle: string;
  file_size: number;
  upload_result: {
    handle_type: string;
    name: string;
  };
}
/**
 * Request parameters for creating upload session.
 */
interface CreateUploadSessionParams {
  /**
   * Length of the file to be uploaded in bytes.
   */
  fileLength: number;
  /**
   * MIME type of the file (e.g., 'image/jpeg').
   */
  fileType: string;
  /**
   * Name of the file with extension.
   */
  fileName: string;
}
/**
 * Request parameters for uploading media.
 */
interface UploadMediaParams {
  /**
   * The upload session ID from createUploadSession response.
   */
  uploadId: string;
  /**
   * The binary data of the file (Buffer).
   */
  file: Buffer;
}
/**
 * Request parameters for getting upload handle.
 */
interface GetUploadHandleParams {
  /**
   * The upload session ID from createUploadSession response.
   */
  uploadId: string;
}
//#endregion
//#region src/api/profile/types/common.d.ts
/**
 * Available fields that can be requested when retrieving a business profile.
 */
type BusinessProfileField = 'about' | 'address' | 'description' | 'email' | 'messaging_product' | 'profile_picture_url' | 'websites' | 'vertical';
type BusinessProfileFieldsParam = BusinessProfileField[] | string;
/**
 * Business profile data structure containing all profile information.
 */
interface BusinessProfileData {
  /**
   * The business's About text. This text appears in the business's profile, beneath its profile image,
   * phone number, and contact buttons.
   * - String cannot be empty
   * - Strings must be between 1 and 139 characters
   * - Rendered emojis are supported however their unicode values are not.
   *   Emoji unicode values must be Java- or JavaScript-escape encoded
   * - Hyperlinks can be included but will not render as clickable links
   * - Markdown is not supported
   */
  about?: string;
  /**
   * Address of the business. Character limit 256.
   */
  address?: string;
  /**
   * Description of the business. Character limit 512.
   */
  description?: string;
  /**
   * The contact email address (in valid email format) of the business. Character limit 128.
   */
  email?: string;
  /**
   * The messaging service used for the request. Always set it to "whatsapp" if you are using
   * the WhatsApp Business API.
   */
  messaging_product: string;
  /**
   * Profile picture URL.
   */
  profile_picture_url?: string;
  /**
   * The URLs associated with the business. For instance, a website, Facebook Page, or Instagram.
   * - You must include the http:// or https:// portion of the URL
   * - There is a maximum of 2 websites with a maximum of 256 characters each
   */
  websites?: string[];
  /**
   * Business category. This can be either an empty string or one of the predefined business categories.
   * @see BusinessVerticalEnum for all available options
   */
  vertical?: BusinessVerticalEnum | string;
}
/**
 * Response structure for business profile GET requests.
 */
interface BusinessProfileResponse {
  data: BusinessProfileData[];
}
/**
 * Request structure for updating business profile.
 */
interface UpdateBusinessProfileRequest {
  /**
   * The messaging service used for the request. Always set it to "whatsapp" if you are using
   * the WhatsApp Business API.
   * @required
   */
  messaging_product: string;
  /**
   * The business's About text. This text appears in the business's profile, beneath its profile image,
   * phone number, and contact buttons.
   * - String cannot be empty
   * - Strings must be between 1 and 139 characters
   * - Rendered emojis are supported however their unicode values are not.
   *   Emoji unicode values must be Java- or JavaScript-escape encoded
   * - Hyperlinks can be included but will not render as clickable links
   * - Markdown is not supported
   */
  about?: string;
  /**
   * Address of the business. Character limit 256.
   */
  address?: string;
  /**
   * Description of the business. Character limit 512.
   */
  description?: string;
  /**
   * Business category. This can be either an empty string or one of the predefined business categories.
   * @see BusinessVerticalEnum for all available options
   */
  vertical?: BusinessVerticalEnum | string;
  /**
   * The contact email address (in valid email format) of the business. Character limit 128.
   */
  email?: string;
  /**
   * The URLs associated with the business. For instance, a website, Facebook Page, or Instagram.
   * - You must include the http:// or https:// portion of the URL
   * - There is a maximum of 2 websites with a maximum of 256 characters each
   */
  websites?: string[];
  /**
   * Handle of the profile picture. This handle is generated when you upload the binary file
   * for the profile picture to Meta using the Resumable Upload API.
   */
  profile_picture_handle?: string;
}
declare class BusinessProfileClass extends BaseClass {
  /**
   * Get your business profile.
   * @param fields Specific fields to be returned in the response. If not specified, all fields will be returned.
   */
  getBusinessProfile(fields?: BusinessProfileFieldsParam): Promise<BusinessProfileResponse>;
  /**
   * Update your business profile.
   * @param updateRequest The request object containing the fields to update.
   */
  updateBusinessProfile(updateRequest: UpdateBusinessProfileRequest): Promise<ResponseSuccess>;
  /**
   * Create an upload session for profile picture.
   * @param fileLength Length of the file to be uploaded in bytes.
   * @param fileType MIME type of the file (e.g., 'image/jpeg').
   * @param fileName Name of the file.
   */
  createUploadSession(fileLength: number, fileType: string, fileName: string): Promise<UploadSessionResponse>;
  /**
   * Upload media file to the upload session.
   * @param uploadId The ID of the upload session.
   * @param file The binary data of the file.
   */
  uploadMedia(uploadId: string, file: Buffer): Promise<UploadBusinessProfileResponse>;
  /**
   * Get the upload handle information.
   * @param uploadId The ID of the upload session.
   */
  getUploadHandle(uploadId: string): Promise<UploadHandle>;
}
//#endregion
//#region src/api/qrCode/types/common.d.ts
type QrCodeResponse = {
  code: string;
  prefilled_message: string;
  deep_link_url: string;
  qr_image_url?: string;
};
type QrCodesResponse = ResponseData<QrCodeResponse[]>;
type CreateQrCodeRequest = {
  prefilled_message: string;
  generate_qr_image?: 'SVG' | 'PNG';
};
type UpdateQrCodeRequest = {
  code: string;
  prefilled_message: string;
};
interface QrCodeClass {
  createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
  getQrCodes(): Promise<QrCodesResponse>;
  getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
  updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
  deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/registration/types/common.d.ts
type RegistrationRequest = {
  messaging_product: 'whatsapp';
  pin: string;
  data_localization_region?: DataLocalizationRegionEnum;
};
interface RegistrationClass {
  register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess>;
  deregister(): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/template/types/common.d.ts
type TemplateFormat = 'TEXT' | 'IMAGE' | 'VIDEO' | 'DOCUMENT' | 'LOCATION' | 'PRODUCT';
type PhoneNumberButton = {
  type: 'PHONE_NUMBER';
  text: string;
  phone_number: string;
};
type URLButton = {
  type: 'URL';
  text: string;
  url: string;
  example?: string[];
};
type QuickReplyButton = {
  type: 'QUICK_REPLY';
  text: string;
};
type CopyCodeButton = {
  type: 'COPY_CODE';
  example: string;
};
type FlowButton = {
  type: 'FLOW';
  text: string;
  flow_id?: string;
  flow_name?: string;
  flow_json?: string;
  flow_action?: 'navigate' | 'data_exchange';
  navigate_screen?: string;
};
type MPMButton = {
  type: 'MPM';
  action?: {
    thumbnail_product_retailer_id: string;
    sections: Array<{
      title?: string;
      product_items: Array<{
        product_retailer_id: string;
      }>;
    }>;
  };
};
type OTPButton = {
  type: 'OTP';
};
type SPMButton = {
  type: 'SPM';
  action?: {
    product_retailer_id: string;
  };
};
type CatalogButton = {
  type: 'CATALOG';
  action?: {
    thumbnail_product_retailer_id: string;
  };
};
type TemplateButton = PhoneNumberButton | URLButton | QuickReplyButton | CopyCodeButton | FlowButton | MPMButton | OTPButton | SPMButton | CatalogButton;
type TemplateHeaderExample = {
  header_text?: string[];
  header_text_named_params?: Array<{
    param_name: string;
    example: string;
  }>;
  header_handle?: string[];
};
type TemplateHeader = {
  type: 'HEADER';
  format: TemplateFormat;
  text?: string;
  example?: TemplateHeaderExample;
};
type TemplateBody = {
  type: 'BODY';
  text: string;
  example?: {
    body_text?: Array<Array<string>>;
    body_text_named_params?: Array<{
      param_name: string;
      example: string;
    }>;
  };
};
type TemplateFooter = {
  type: 'FOOTER';
  text: string;
};
type TemplateButtons = {
  type: 'BUTTONS';
  buttons: TemplateButton[];
};
type TemplateLimitedTimeOffer = {
  type: 'LIMITED_TIME_OFFER';
  limited_time_offer: {
    expiration_time_ms: number;
  };
};
type TemplateCarousel = {
  type: 'CAROUSEL';
  cards: Array<{
    card_index: number;
    components: ComponentTypes[];
  }>;
};
type MediaCarouselCard = {
  card_index: number;
  components: (TemplateHeader | TemplateBody | TemplateButtons)[];
};
type ProductCarouselCard = {
  card_index: number;
  components: TemplateHeader[];
};
type ComponentTypes = TemplateHeader | TemplateBody | TemplateFooter | TemplateButtons | TemplateLimitedTimeOffer | TemplateCarousel;
type TemplateRequestBody = GeneralRequestBody & {
  name: string;
  language: LanguagesEnum;
  category?: CategoryEnum;
  components?: ComponentTypes[];
};
type TemplateResponse = {
  id: string;
  status: string;
  language: LanguagesEnum;
  category: CategoryEnum;
  name: string;
  components: ComponentTypes[];
};
type TemplateGetParams = {
  limit?: number;
  name?: string;
  language?: LanguagesEnum;
  category?: CategoryEnum;
  status?: TemplateStatusEnum;
};
type TemplateDeleteParams = {
  hsm_id?: string;
  name: string;
};
declare class TemplateClass {
  getTemplate(templateId: string): Promise<TemplateResponse>;
  updateTemplate(templateId: string, template: Partial<TemplateRequestBody>): Promise<ResponseSuccess>;
  getTemplates(params?: TemplateGetParams): Promise<ResponsePagination<TemplateResponse>>;
  createTemplate(template: TemplateRequestBody): Promise<TemplateResponse>;
  deleteTemplate(params: TemplateDeleteParams): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/template/types/factory.d.ts
interface TextParameter {
  type: 'text';
  value: string;
}
interface CurrencyParameter {
  type: 'currency';
  amount_1000: number;
  code: CurrencyCodesEnum;
  fallback_value: string;
}
interface DateTimeParameter {
  type: 'date_time';
  fallback_value: string;
}
interface MediaParameter {
  type: 'image' | 'video' | 'document';
  handle?: string;
  link?: string;
}
interface LocationParameter {
  type: 'location';
  latitude?: number;
  longitude?: number;
  name?: string;
  address?: string;
}
interface ProductParameter {
  type: 'product';
  product_retailer_id: string;
}
type TemplateParameter = TextParameter | CurrencyParameter | DateTimeParameter | MediaParameter | LocationParameter | ProductParameter;
interface HeaderOptions {
  format: TemplateFormat;
  text?: string;
  parameters?: TemplateParameter[];
  example?: {
    header_text?: string[];
    header_text_named_params?: Array<{
      param_name: string;
      example: string;
    }>;
    header_handle?: string[];
  };
}
interface BodyOptions {
  text: string;
  parameters?: TemplateParameter[];
  example?: {
    body_text?: string[][];
    body_text_named_params?: Array<{
      param_name: string;
      example: string;
    }>;
  };
}
interface FooterOptions {
  text: string;
}
interface ButtonOptions {
  phone_number?: {
    text: string;
    phone_number: string;
  };
  url?: {
    text: string;
    url: string;
    example?: string;
  };
  quick_reply?: {
    text: string;
  }[];
  copy_code?: {
    example: string;
  };
  flow?: {
    text: string;
    flow_id?: string;
    flow_name?: string;
    flow_json?: string;
    flow_action?: 'navigate' | 'data_exchange';
    navigate_screen?: string;
  };
  mpm?: boolean;
  otp?: boolean;
  spm?: boolean;
}
interface CarouselCard {
  image?: string;
  video?: string;
  product?: string;
  body?: string;
  bodyParameters?: TemplateParameter[];
  buttons?: ButtonOptions;
}
interface CarouselOptions {
  cards: CarouselCard[];
}
interface LimitedTimeOfferOptions {
  expiration_time_ms: number;
}
interface ProductSection {
  title?: string;
  product_items: Array<{
    product_retailer_id: string;
  }>;
}
interface TemplateOptions {
  name: string;
  language: LanguagesEnum;
  category: CategoryEnum;
  header?: HeaderOptions;
  body?: BodyOptions;
  footer?: FooterOptions;
  buttons?: ButtonOptions;
  carousel?: CarouselOptions;
  limitedTimeOffer?: LimitedTimeOfferOptions;
}
interface OTPTemplateOptions {
  name: string;
  language: LanguagesEnum;
  code_expiration_minutes?: number;
  add_security_recommendation?: boolean;
}
interface AuthenticationTemplateOptions {
  name: string;
  language: LanguagesEnum;
  code_expiration_minutes?: number;
  add_security_recommendation?: boolean;
  copy_code_button?: boolean;
}
interface CatalogTemplateOptions {
  name: string;
  language: LanguagesEnum;
  header?: Omit<HeaderOptions, 'format'>;
  body: BodyOptions;
  footer?: FooterOptions;
  thumbnail_product_retailer_id: string;
}
interface CouponTemplateOptions {
  name: string;
  language: LanguagesEnum;
  header?: Omit<HeaderOptions, 'format'>;
  body: BodyOptions;
  footer?: FooterOptions;
  coupon_code: string;
}
interface LimitedTimeOfferTemplateOptions {
  name: string;
  language: LanguagesEnum;
  header?: Omit<HeaderOptions, 'format'>;
  body: BodyOptions;
  footer?: FooterOptions;
  expiration_time_ms: number;
}
interface MediaCardCarouselTemplateOptions {
  name: string;
  language: LanguagesEnum;
  cards: Array<{
    header: {
      format: 'IMAGE' | 'VIDEO';
      example: {
        header_handle: string[];
      };
    };
    body: BodyOptions;
    buttons?: ButtonOptions;
  }>;
}
interface MPMTemplateOptions {
  name: string;
  language: LanguagesEnum;
  header?: Omit<HeaderOptions, 'format'>;
  body: BodyOptions;
  footer?: FooterOptions;
  thumbnail_product_retailer_id: string;
  sections: ProductSection[];
}
interface ProductCardCarouselTemplateOptions {
  name: string;
  language: LanguagesEnum;
  header?: Omit<HeaderOptions, 'format'>;
  body: BodyOptions;
  footer?: FooterOptions;
  cards: Array<{
    product_retailer_id: string;
  }>;
}
interface SPMTemplateOptions {
  name: string;
  language: LanguagesEnum;
  header?: Omit<HeaderOptions, 'format'>;
  body: BodyOptions;
  footer?: FooterOptions;
  product_retailer_id: string;
}
//#endregion
//#region src/api/twoStepVerification/types/common.d.ts
type TwoStepVerificationRequest = {
  pin: string;
};
interface TwoStepVerificationClass {
  setTwoStepVerificationCode(pin: string): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/waba/types/common.d.ts
/**
 * WhatsApp Business Account subscription configuration
 */
type WabaSubscription = {
  whatsapp_business_api_data: {
    id: string;
    link: string;
    name: string;
    category: string;
  };
  override_callback_uri?: string;
};
/**
 * Parameters for updating WABA subscription
 */
interface UpdateWabaSubscription {
  override_callback_uri: string;
  verify_token: string;
}
/**
 * Response containing all WABA subscriptions
 */
interface WabaSubscriptions {
  data: Array<WabaSubscription>;
}
/**
 * WABA account review status enumeration
 */
declare enum WabaAccountReviewStatus {
  Approved = "APPROVED",
  Active = "ACTIVE",
  Inactive = "INACTIVE",
  Disabled = "DISABLED"
}
/**
 * WABA health status for message sending capability
 */
declare enum WabaHealthStatusCanSendMessage {
  Blocked = "BLOCKED",
  Limited = "LIMITED",
  Available = "AVAILABLE"
}
/**
 * WABA account status enumeration
 */
declare enum WabaAccountStatus {
  Approved = "APPROVED",
  Active = "ACTIVE",
  Inactive = "INACTIVE",
  Disabled = "DISABLED"
}
/**
 * Business verification status enumeration
 */
declare enum WabaBusinessVerificationStatus {
  Verified = "verified",
  PendingSubmission = "pending_submission",
  Unverified = "unverified",
  Rejected = "rejected"
}
/**
 * WABA health status error details
 */
interface WabaHealthStatusError {
  error_code?: number;
  error_description?: string;
  possible_solution?: string;
}
/**
 * WABA health status entity information
 */
interface WabaHealthStatusEntity {
  entity_type?: string;
  id?: string;
  can_send_message?: string;
  errors?: WabaHealthStatusError[];
}
/**
 * Overall WABA health status
 */
interface WabaHealthStatus {
  can_send_message?: WabaHealthStatusCanSendMessage;
  entities?: WabaHealthStatusEntity[];
}
/**
 * WhatsApp Business Account information
 */
interface WabaAccount {
  account_review_status?: WabaAccountReviewStatus;
  id?: string;
  health_status?: WabaHealthStatus;
  status?: WabaAccountStatus;
  business_verification_status?: WabaBusinessVerificationStatus;
  message_template_namespace?: string;
  name?: string;
  ownership_type?: string;
  timezone_id?: string;
  primary_business_location?: Record<string, unknown> | string;
  currency?: string;
  country?: string;
  analytics?: Record<string, unknown>;
  is_enabled_for_insights?: boolean;
  is_shared_with_partners?: boolean;
  marketing_messages_lite_api_status?: string;
  marketing_messages_onboarding_status?: string;
  on_behalf_of_business_info?: Record<string, unknown>;
  primary_funding_id?: string;
  purchase_order_number?: string;
  whatsapp_business_manager_messaging_limit?: string;
}
/**
 * Available fields for WABA account queries
 */
type WabaAccountFields = 'id' | 'name' | 'timezone_id' | 'account_review_status' | 'auth_international_rate_eligibility' | 'business_verification_status' | 'country' | 'currency' | 'health_status' | 'status' | 'ownership_type' | 'message_template_namespace' | 'primary_business_location' | 'analytics' | 'is_enabled_for_insights' | 'is_shared_with_partners' | 'marketing_messages_lite_api_status' | 'marketing_messages_onboarding_status' | 'on_behalf_of_business_info' | 'primary_funding_id' | 'purchase_order_number' | 'whatsapp_business_manager_messaging_limit';
/**
 * Parameter type for specifying which WABA account fields to retrieve
 */
type WabaAccountFieldsParam = WabaAccountFields[];
type WabaGraphObject = Record<string, unknown>;
type WabaFieldsParam = string[] | string;
type WabaListParams = {
  fields?: WabaFieldsParam;
  filtering?: WabaGraphObject[] | string;
  sort?: string;
  limit?: number;
  after?: string;
  before?: string;
};
type WabaListResponse<T = WabaGraphObject> = {
  data: T[];
  paging?: Paging;
  summary?: WabaGraphObject;
};
type UpdateWabaAccountRequest = {
  name?: string;
  timezone_id?: string;
  [key: string]: unknown;
};
type AssignedUsersListParams = WabaListParams & {
  business: string;
};
type AssignedUserRequest = {
  user: string;
  tasks: string[];
};
type RemoveAssignedUserRequest = {
  user: string;
  [key: string]: unknown;
};
type CreateOBOMobilityIntentRequest = {
  intent?: string;
  [key: string]: unknown;
};
type SetOBOMobilityIntentRequest = {
  [key: string]: unknown;
};
type CreateScheduleRequest = {
  name?: string;
  schedule_type?: string;
  [key: string]: unknown;
};
type UpdateWhatsAppBusinessProfileRequest = {
  [key: string]: unknown;
};
/**
 * Interface defining all WABA API methods
 */
interface WABAClass {
  getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
  updateWabaAccount(params: UpdateWabaAccountRequest): Promise<ResponseSuccess>;
  getWabaActivities(params?: WabaListParams): Promise<WabaListResponse>;
  getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
  updateWabaSubscription(params: UpdateWabaSubscription): Promise<ResponseSuccess>;
  unsubscribeFromWaba(): Promise<ResponseSuccess>;
  getAssignedUsers(params: AssignedUsersListParams, wabaId?: string): Promise<WabaListResponse>;
  addAssignedUser(params: AssignedUserRequest, wabaId?: string): Promise<ResponseSuccess>;
  removeAssignedUser(params: RemoveAssignedUserRequest, wabaId?: string): Promise<ResponseSuccess>;
  getInProgressOnBehalfRequests(params?: WabaListParams, wabaId?: string): Promise<WabaListResponse>;
  getOBOMobilityIntent(oboMobilityIntentId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;
  createOBOMobilityIntent(params: CreateOBOMobilityIntentRequest, wabaId?: string): Promise<WabaGraphObject>;
  setOBOMobilityIntent(params: SetOBOMobilityIntentRequest, wabaId?: string): Promise<WabaGraphObject>;
  getWabaSchedules(params?: WabaListParams, wabaId?: string): Promise<WabaListResponse>;
  createWabaSchedule(params: CreateScheduleRequest, wabaId?: string): Promise<WabaGraphObject>;
  getWhatsAppBusinessBotDetails(botId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;
  getWhatsAppBusinessProfileDetails(profileId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;
  updateWhatsAppBusinessProfile(profileId: string, params: UpdateWhatsAppBusinessProfileRequest): Promise<ResponseSuccess>;
}
//#endregion
//#region src/core/webhook/types/account.d.ts
/**
 * WABA event types for account_update webhook.
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/webhooks/reference/account_update
 */
type AccountUpdateEvent = 'ACCOUNT_DELETED' | 'ACCOUNT_OFFBOARDED' | 'ACCOUNT_RECONNECTED' | 'ACCOUNT_RESTRICTION' | 'ACCOUNT_VIOLATION' | 'AD_ACCOUNT_LINKED' | 'AUTH_INTL_PRICE_ELIGIBILITY_UPDATE' | 'BUSINESS_PRIMARY_LOCATION_COUNTRY_UPDATE' | 'DISABLED_UPDATE' | 'MM_LITE_TERMS_SIGNED' | 'PARTNER_ADDED' | 'PARTNER_APP_INSTALLED' | 'PARTNER_APP_UNINSTALLED' | 'PARTNER_CLIENT_CERTIFICATION_STATUS_UPDATE' | 'PARTNER_REMOVED' | 'VERIFIED_ACCOUNT' | 'VOLUME_BASED_PRICING_TIER_UPDATE';
/**
 * WABA ban state — present on DISABLED_UPDATE events.
 */
type WabaBanState = 'SCHEDULE_FOR_DISABLE' | 'DISABLE' | 'REINSTATE';
/**
 * Restriction types imposed on WABA — present on ACCOUNT_RESTRICTION events.
 */
type RestrictionType = 'RESTRICTION_ADD_PHONE_NUMBER_ACTION' | 'RESTRICTED_BIZ_INITIATED_MESSAGING' | 'RESTRICTED_CUSTOMER_INITIATED_MESSAGING';
/**
 * Reason for the disconnection — present on PARTNER_REMOVED events where
 * the business used both WhatsApp Business app and Cloud API.
 */
type DisconnectionReason = 'ACCOUNT_DISCONNECTED' | 'BUSINESS_DOWNGRADE' | 'CHANGE_NUMBER' | 'COMPANION_INACTIVITY' | 'PRIMARY_INACTIVITY' | 'USER_RE_REGISTERED';
/**
 * Who initiated the disconnection — present on PARTNER_REMOVED events.
 */
type DisconnectionInitiatedBy = 'SYSTEM' | 'USER';
/**
 * Status of the partner-led business verification submission.
 */
type PartnerClientCertificationStatus = 'APPROVED' | 'REJECTED' | 'DISCARDED';
/** Present on DISABLED_UPDATE events */
interface AccountUpdateBanInfo {
  waba_ban_state: WabaBanState;
  /** Unix timestamp of the ban date */
  waba_ban_date?: string;
}
/** Present on ACCOUNT_VIOLATION events */
interface AccountUpdateViolationInfo {
  violation_type: string;
}
/** Present on ACCOUNT_RESTRICTION events */
interface AccountUpdateRestrictionInfo {
  restriction_type: RestrictionType;
  /** Unix timestamp when the restriction expires */
  expiration?: number;
  /** Steps the business can take to remediate the restriction */
  remediation?: string;
}
/**
 * Present on PARTNER_ADDED, PARTNER_APP_INSTALLED, PARTNER_APP_UNINSTALLED,
 * PARTNER_REMOVED, AD_ACCOUNT_LINKED, and MM_LITE_TERMS_SIGNED events.
 */
interface AccountUpdateWabaInfo {
  /** Customer or own WABA ID */
  waba_id: string;
  /** Business portfolio ID */
  owner_business_id: string;
  /** Partner app ID — present on PARTNER_APP_INSTALLED / PARTNER_APP_UNINSTALLED */
  partner_app_id?: string;
  /** Ad account ID — present on AD_ACCOUNT_LINKED */
  ad_account_linked?: string;
  /** Solution ID — present when customer onboarded via multi-partner solution */
  solution_id?: string;
  /** Partner business portfolio IDs — present for multi-partner solutions */
  solution_partner_business_ids?: string[];
}
/** Present on AUTH_INTL_PRICE_ELIGIBILITY_UPDATE events */
interface AuthInternationalRateEligibility {
  /** Unix timestamp when authentication-international rates become effective */
  start_time: number;
  /** Countries with different start times */
  exception_countries?: Array<{
    /** ISO 3166-1 alpha-2 country code */country_code: string; /** Unix timestamp for this country's start time */
    start_time: number;
  }>;
}
/** Present on VOLUME_BASED_PRICING_TIER_UPDATE events */
interface VolumeTierInfo {
  /** Unix timestamp of the tier update */
  tier_update_time: number;
  /** Pricing category (e.g. "UTILITY") */
  pricing_category: string;
  /** Pricing tier identifier */
  tier: string;
  /** Effective month in YYYY-MM format (e.g. "2025-11") */
  effective_month: string;
  /** Region for the tier update (e.g. "India") */
  region: string;
}
/** Present on PARTNER_REMOVED events where disconnection_info is applicable */
interface DisconnectionInfo {
  reason: DisconnectionReason;
  initiated_by: DisconnectionInitiatedBy;
}
/** Present on PARTNER_CLIENT_CERTIFICATION_STATUS_UPDATE events */
interface PartnerClientCertificationInfo {
  /** Customer's business portfolio ID */
  client_business_id: string;
  /** Status of the verification submission */
  status: PartnerClientCertificationStatus;
  /** Rejection reasons — present when status is REJECTED */
  rejection_reasons?: string[];
}
interface AccountUpdateValue {
  /** Phone number associated with the WABA, if applicable */
  phone_number?: string;
  /**
   * Event type describing what changed.
   * @see AccountUpdateEvent
   */
  event: AccountUpdateEvent;
  /**
   * ISO 3166-1 alpha-2 country code.
   * Only included for BUSINESS_PRIMARY_LOCATION_COUNTRY_UPDATE events.
   */
  country?: string;
  /** Present on DISABLED_UPDATE events */
  ban_info?: AccountUpdateBanInfo;
  /** Present on ACCOUNT_VIOLATION events */
  violation_info?: AccountUpdateViolationInfo;
  /** Present on ACCOUNT_RESTRICTION events */
  restriction_info?: AccountUpdateRestrictionInfo[];
  /** Present on partner-related and AD_ACCOUNT_LINKED events */
  waba_info?: AccountUpdateWabaInfo;
  /** Present on AUTH_INTL_PRICE_ELIGIBILITY_UPDATE events */
  auth_international_rate_eligibility?: AuthInternationalRateEligibility;
  /** Present on VOLUME_BASED_PRICING_TIER_UPDATE events */
  volume_tier_info?: VolumeTierInfo;
  /** Present on PARTNER_REMOVED events where business used WhatsApp Business app + Cloud API */
  disconnection_info?: DisconnectionInfo;
  /** Present on PARTNER_CLIENT_CERTIFICATION_STATUS_UPDATE events */
  partner_client_certification_info?: PartnerClientCertificationInfo;
}
interface AccountUpdateWebhookValue {
  field: 'account_update';
  value: AccountUpdateValue;
}
/**
 * Account review decision
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#value--decision
 */
type ReviewDecision = 'APPROVED' | 'REJECTED' | 'DEFERRED';
interface AccountReviewUpdateValue {
  decision: ReviewDecision;
}
interface AccountReviewUpdateWebhookValue {
  field: 'account_review_update';
  value: AccountReviewUpdateValue;
}
/**
 * Entity type for alert
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#account-alerts
 */
type AlertEntityType = 'BUSINESS' | 'PHONE_NUMBER' | 'WABA';
/**
 * Alert severity level
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#account-alerts
 */
type AlertSeverity = 'CRITICAL' | 'WARNING' | 'INFO';
/**
 * Alert status
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#account-alerts
 */
type AlertStatus = 'ACTIVE' | 'RESOLVED';
/**
 * Alert types for messaging limit increases
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#account-alerts
 */
type AlertType = 'INCREASED_CAPABILITIES_ELIGIBILITY_FAILED' | 'INCREASED_CAPABILITIES_ELIGIBILITY_DEFERRED' | 'INCREASED_CAPABILITIES_ELIGIBILITY_NEED_MORE_INFO';
interface AccountAlertsValue {
  entity_type: AlertEntityType;
  entity_id: string;
  alert_severity: AlertSeverity;
  alert_status: AlertStatus;
  alert_type: AlertType;
  alert_description: string;
}
interface AccountAlertsWebhookValue {
  field: 'account_alerts';
  value: AccountAlertsValue;
}
interface AccountSettingsCallingConfig {
  /** Whether calling is enabled for this phone number */
  status: 'ENABLED' | 'DISABLED' | string;
  /** Visibility of the call icon in WhatsApp */
  call_icon_visibility?: string;
  /** Status of callback permission */
  callback_permission_status?: 'ENABLED' | 'DISABLED' | string;
  /** Call hours configuration */
  call_hours?: {
    status: 'ENABLED' | 'DISABLED' | string;
  };
  /** SIP (Session Initiation Protocol) configuration */
  sip?: {
    status: 'ENABLED' | 'DISABLED' | string;
  };
}
interface AccountSettingsPhoneNumberSettings {
  /** The phone number ID these settings apply to */
  phone_number_id: string;
  /** Calling feature configuration */
  calling?: AccountSettingsCallingConfig;
}
interface AccountSettingsUpdateValue {
  messaging_product: 'whatsapp';
  /** Unix timestamp of the settings change */
  timestamp: string;
  /**
   * Type of settings that changed.
   * Known value: "phone_number_settings"
   */
  type: 'phone_number_settings' | string;
  /** Present when type is "phone_number_settings" */
  phone_number_settings?: AccountSettingsPhoneNumberSettings;
}
interface AccountSettingsUpdateWebhookValue {
  field: 'account_settings_update';
  value: AccountSettingsUpdateValue;
}
//#endregion
//#region src/core/webhook/types/common.d.ts
/**
 * WhatsApp contact information
 */
interface WebhookContact {
  wa_id: string;
  user_id?: string;
  profile: {
    name: string;
    username?: string;
  };
  identity_key_hash?: string;
}
/**
 * Metadata included in all webhooks
 */
interface WebhookMetadata {
  display_phone_number: string;
  phone_number_id: string;
}
/**
 * Error object structure
 */
interface WebhookError {
  code: number;
  title: string;
  message: string;
  error_data?: {
    details: string;
  };
  href?: string;
}
/**
 * Click to WhatsApp ad referral information
 */
interface ReferralInfo {
  source_url: string;
  source_id: string;
  source_type: 'ad';
  body?: string;
  headline?: string;
  media_type?: 'image' | 'video';
  image_url?: string;
  video_url?: string;
  thumbnail_url?: string;
  ctwa_clid?: string;
  welcome_message?: {
    text: string;
  };
}
/**
 * Context for forwarded messages
 */
interface ForwardedContext {
  forwarded?: true;
  frequently_forwarded?: true;
}
/**
 * Context for product inquiry messages
 */
interface ProductContext {
  from: string;
  id: string;
  referred_product: {
    catalog_id: string;
    product_retailer_id: string;
  };
}
/**
 * Context for interactive/button replies
 */
interface ReplyContext {
  from: string;
  id: string;
}
//#endregion
//#region src/core/webhook/types/appStateSync.d.ts
/**
 * Contact data in state sync
 */
interface StateSyncContact {
  full_name: string;
  first_name: string;
  phone_number: string;
}
/**
 * State sync metadata
 */
interface StateSyncMetadata {
  timestamp: string;
  version: number;
}
/**
 * State sync data
 */
interface StateSyncData {
  type: string;
  contact: StateSyncContact;
  action: string;
  metadata: StateSyncMetadata;
}
/**
 * SMB App State Sync value
 */
interface SmbAppStateSyncValue {
  messaging_product: string;
  metadata: WebhookMetadata;
  state_sync: StateSyncData[];
}
interface SmbAppStateSyncWebhookValue {
  field: 'smb_app_state_sync';
  value: SmbAppStateSyncValue;
}
//#endregion
//#region src/core/webhook/types/business.d.ts
/**
 * Business capability limits
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#business-capability-updates
 */
interface BusinessCapabilityUpdateValue {
  max_daily_conversation_per_phone?: number;
  max_phone_numbers_per_business?: number;
  max_phone_numbers_per_waba?: number;
}
interface BusinessCapabilityUpdateWebhookValue {
  field: 'business_capability_update';
  value: BusinessCapabilityUpdateValue;
}
type BusinessStatusUpdateEvent = 'ACCOUNT_DELETED' | 'ACCOUNT_RESTRICTION' | 'ACCOUNT_VIOLATION' | 'DISABLED_UPDATE' | string;
interface BusinessStatusUpdateValue {
  /** Event type describing the status change */
  event: BusinessStatusUpdateEvent;
  [key: string]: unknown;
}
interface BusinessStatusUpdateWebhookValue {
  field: 'business_status_update';
  value: BusinessStatusUpdateValue;
}
//#endregion
//#region src/core/webhook/types/calls.d.ts
/**
 * Lifecycle event type for a call.
 *
 * - "connect"      — Call initiated; for consumer-initiated calls, respond with action=accept
 * - "call_status"  — Business-initiated call started ringing or was accepted (business-initiated only)
 * - "media_update" — Consumer-side media event; apply the new SDP to your peer connection (business-initiated only)
 * - "terminate"    — Call ended for any reason
 */
type CallEventType = 'connect' | 'call_status' | 'media_update' | 'terminate';
/**
 * Direction of the call.
 *
 * - "business_initiated" — The business placed the call
 * - "user_initiated"     — The user placed the call
 */
type CallDirection = 'business_initiated' | 'user_initiated';
/**
 * Status for business-initiated calls (call_status event).
 *
 * - "ringing"  — The outgoing call is ringing on the consumer's device
 * - "accepted" — The consumer accepted the call
 */
type CallStatusValue = 'ringing' | 'accepted';
/**
 * Final call outcome (terminate event).
 *
 * - "Completed" — Call finished normally (includes calls rejected by either party)
 * - "Failed"    — Call failed mid-connection
 */
type CallTerminateStatus = 'Completed' | 'Failed';
interface CallSdpRenegotiation {
  /** SDP type — always "offer" for incoming media_update events */
  sdp_type: 'offer';
  /** SDP data compliant with RFC 4566 */
  sdp: string;
}
interface CallSession$1 {
  /**
   * Incremented each time Meta provides new SDP.
   * If multiple media_update webhooks arrive, apply the one with the highest version.
   */
  version: number;
  /** Contains the SDP offer from Meta; generate an answer and apply to your peer connection */
  sdp_renegotiation: CallSdpRenegotiation;
}
interface CallEntry {
  /** Unique ID for the call — use in accept / reject / terminate API calls */
  id: string;
  /**
   * Lifecycle event type.
   * @see CallEventType
   */
  event: CallEventType;
  /** Unix timestamp */
  timestamp: number;
  /** Callee of the call (Page ID) — present on connect */
  to?: string;
  /** Caller of the call (PSID) — present on connect */
  from?: string;
  /** Whether the call was business- or user-initiated — present on connect */
  call_direction?: CallDirection;
  /** PSID of the consumer — present on call_status */
  recipient_id?: string;
  /** Ringing or accepted — present on call_status */
  call_status?: CallStatusValue;
  /** SDP session information; apply the offer to your local peer connection — present on media_update */
  session?: CallSession$1;
  /** Final status of the call — present on terminate */
  status?: CallTerminateStatus;
  /** When the call started (Unix timestamp) — present on terminate */
  start_time?: number;
  /** When the call ended (Unix timestamp) — present on terminate */
  end_time?: number;
  /**
   * Call duration in seconds, counted from when the business connects.
   * Empty if the business did not successfully connect.
   * Present on terminate.
   */
  duration?: number;
}
interface CallContact {
  profile: {
    /** Display name of the caller */name: string; /** Business-scoped username, when Meta includes it */
    username?: string;
  };
  /** WhatsApp ID of the caller */
  wa_id: string;
  /** Business-scoped user ID, when Meta includes it */
  user_id?: string;
}
interface CallsValue {
  messaging_product: 'whatsapp';
  metadata: {
    display_phone_number: string;
    phone_number_id: string;
  };
  /** Array of call lifecycle events */
  calls: CallEntry[];
  /** Contact profile information for the caller */
  contacts?: CallContact[];
}
interface CallsWebhookValue {
  field: 'calls';
  value: CallsValue;
}
//#endregion
//#region src/core/webhook/types/flows.d.ts
/**
 * Flow event types
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#value--event
 */
type FlowEvent = 'FLOW_STATUS_CHANGE' | 'FLOW_HEALTH_UPDATE' | 'FLOW_THROTTLED';
/**
 * Flow status values
 * @see https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#statuses
 */
type FlowStatus = 'DRAFT' | 'PUBLISHED' | 'DEPRECATED' | 'BLOCKED' | 'THROTTLED';
/**
 * Flow alert state
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#value--alert_state
 */
type FlowAlertState = 'ACTIVE' | 'RESOLVED';
/**
 * Flow endpoint request error
 */
interface FlowEndpointRequestError {
  error_code: string;
  error_message: string;
  error_count: number;
}
/**
 * Flow webhook value
 */
interface FlowsValue {
  event: FlowEvent;
  message?: string;
  flow_id: string;
  old_status?: FlowStatus;
  new_status?: FlowStatus;
  warning?: string;
  p90_latency?: number;
  p50_latency?: number;
  error_rate?: number;
  errors?: FlowEndpointRequestError[];
  requests_count?: number;
  availability?: number;
  threshold?: number;
  alert_state?: FlowAlertState;
}
interface FlowsWebhookValue {
  field: 'flows';
  value: FlowsValue;
}
//#endregion
//#region src/core/webhook/types/groups.d.ts
interface GroupWebhookError {
  /** Error code */
  code: string;
  /** Human-readable error message */
  message: string;
  /** Short title for the error */
  title: string;
  error_data?: {
    /** Detailed error description */details: string;
  };
}
interface GroupAddedParticipant {
  /** WhatsApp ID of the participant */
  wa_id: string;
  /** Phone number input provided when adding (optional) */
  input?: string;
}
interface GroupRemovedParticipant {
  /** Phone number or WhatsApp ID of the removed participant */
  input: string;
}
interface GroupFailedParticipant {
  /** Phone number or WhatsApp ID that failed */
  input: string;
  errors: GroupWebhookError[];
}
type GroupLifecycleEventType = 'group_create' | 'group_delete';
interface GroupLifecycleEntry {
  /** Unix timestamp of the event */
  timestamp: string;
  /** The group's WhatsApp ID */
  group_id: string;
  /** Event type: group_create or group_delete */
  type: GroupLifecycleEventType;
  /** Correlation ID for the API request that triggered this event */
  request_id: string;
  /** Group subject/name — present on group_create */
  subject?: string;
  /** Group description — present on group_create */
  description?: string;
  /** Invite link for the group — present on successful group_create */
  invite_link?: string;
  /** Whether users need admin approval to join — present on group_create */
  join_approval_mode?: string;
  /** Present when the operation failed */
  errors?: GroupWebhookError[];
}
interface GroupLifecycleUpdateValue {
  messaging_product: 'whatsapp';
  metadata: WebhookMetadata;
  /** Array of group lifecycle events */
  groups: GroupLifecycleEntry[];
}
interface GroupLifecycleUpdateWebhookValue {
  field: 'group_lifecycle_update';
  value: GroupLifecycleUpdateValue;
}
type GroupParticipantsEventType = 'group_participants_add' | 'group_participants_remove' | 'group_join_request_created' | 'group_join_request_revoked';
type GroupParticipantsAddReason = 'invite_link' | 'admin_added';
/** Who initiated the remove action */
type GroupParticipantsInitiatedBy = 'business' | 'participant';
interface GroupParticipantsEntry {
  /** Unix timestamp of the event */
  timestamp: string;
  /** The group's WhatsApp ID */
  group_id: string;
  /** Event type */
  type: GroupParticipantsEventType;
  /** Correlation ID for the API request */
  request_id?: string;
  /** Reason participants were added (e.g. invite_link) */
  reason?: GroupParticipantsAddReason | string;
  /** Participants successfully added */
  added_participants?: GroupAddedParticipant[];
  /** Whether business or participant initiated the removal */
  initiated_by?: GroupParticipantsInitiatedBy;
  /** Participants successfully removed */
  removed_participants?: GroupRemovedParticipant[];
  /** Participants that could not be removed */
  failed_participants?: GroupFailedParticipant[];
  /** ID of the join request */
  join_request_id?: string;
  /** WhatsApp ID of the user who submitted or cancelled the request */
  wa_id?: string;
  /** Present when the operation partially or fully failed */
  errors?: GroupWebhookError[];
}
interface GroupParticipantsUpdateValue {
  messaging_product: 'whatsapp';
  metadata: WebhookMetadata;
  /** Array of participant update events */
  groups: GroupParticipantsEntry[];
}
interface GroupParticipantsUpdateWebhookValue {
  field: 'group_participants_update';
  value: GroupParticipantsUpdateValue;
}
interface GroupSettingFieldResult {
  /** Whether this specific field was successfully updated */
  update_successful: boolean;
  /** Present on profile_picture updates */
  mime_type?: string;
  /** SHA-256 hash of the uploaded image — present on profile_picture updates */
  sha256?: string;
  /** New text value — present on group_subject / group_description updates */
  text?: string;
  /** Present when update_successful is false */
  errors?: GroupWebhookError[];
}
interface GroupSettingsEntry {
  /** Unix timestamp of the event */
  timestamp: string;
  /** The group's WhatsApp ID */
  group_id: string;
  /** Always "group_settings_update" */
  type: 'group_settings_update';
  /** Correlation ID for the API request */
  request_id?: string;
  /** Result of the profile picture update */
  profile_picture?: GroupSettingFieldResult;
  /** Result of the group subject (name) update */
  group_subject?: GroupSettingFieldResult;
  /** Result of the group description update */
  group_description?: GroupSettingFieldResult;
  /** Top-level errors when the entire update failed */
  errors?: GroupWebhookError[];
}
interface GroupSettingsUpdateValue {
  messaging_product: 'whatsapp';
  metadata: WebhookMetadata;
  /** Array of group settings update events */
  groups: GroupSettingsEntry[];
}
interface GroupSettingsUpdateWebhookValue {
  field: 'group_settings_update';
  value: GroupSettingsUpdateValue;
}
type GroupStatusEventType = 'group_suspend' | 'group_suspend_cleared';
interface GroupStatusEntry {
  /** Unix timestamp of the event */
  timestamp: string;
  /** The group's WhatsApp ID */
  group_id: string;
  /** Event type: group_suspend or group_suspend_cleared */
  type: GroupStatusEventType;
}
interface GroupStatusUpdateValue {
  messaging_product: 'whatsapp';
  metadata: WebhookMetadata;
  /** Array of group status events */
  groups: GroupStatusEntry[];
}
interface GroupStatusUpdateWebhookValue {
  field: 'group_status_update';
  value: GroupStatusUpdateValue;
}
//#endregion
//#region src/core/webhook/types/message.d.ts
/**
 * Base message properties common to all message types
 */
interface BaseMessage {
  from: string;
  id: string;
  timestamp: string;
}
interface TextMessage extends BaseMessage {
  type: MessageTypesEnum.Text;
  text: {
    body: string;
  };
  context?: ForwardedContext | ProductContext;
  referral?: ReferralInfo;
}
interface ImageMessage extends BaseMessage {
  type: MessageTypesEnum.Image;
  image: {
    caption?: string;
    mime_type: string;
    sha256: string;
    id: string;
    url: string;
  };
  context?: ForwardedContext;
  referral?: ReferralInfo;
}
interface VideoMessage extends BaseMessage {
  type: MessageTypesEnum.Video;
  video: {
    caption?: string;
    mime_type: string;
    sha256: string;
    id: string;
    url: string;
  };
  context?: ForwardedContext;
  referral?: ReferralInfo;
}
interface AudioMessage extends BaseMessage {
  type: MessageTypesEnum.Audio;
  audio: {
    mime_type: string;
    sha256: string;
    id: string;
    url: string;
    voice: boolean;
  };
  referral?: ReferralInfo;
}
interface DocumentMessage extends BaseMessage {
  type: MessageTypesEnum.Document;
  document: {
    caption?: string;
    filename: string;
    mime_type: string;
    sha256: string;
    id: string;
    url: string;
  };
  referral?: ReferralInfo;
}
interface StickerMessage extends BaseMessage {
  type: MessageTypesEnum.Sticker;
  sticker: {
    mime_type: string;
    sha256: string;
    id: string;
    url: string;
    animated: boolean;
  };
  referral?: ReferralInfo;
}
interface InteractiveListReplyMessage extends BaseMessage {
  type: MessageTypesEnum.Interactive;
  context: ReplyContext;
  interactive: {
    type: 'list_reply';
    list_reply: {
      id: string;
      title: string;
      description?: string;
    };
  };
}
interface InteractiveButtonReplyMessage extends BaseMessage {
  type: MessageTypesEnum.Interactive;
  context: ReplyContext;
  interactive: {
    type: 'button_reply';
    button_reply: {
      id: string;
      title: string;
    };
  };
}
interface InteractiveNfmReplyMessage extends BaseMessage {
  type: MessageTypesEnum.Interactive;
  context: ReplyContext;
  interactive: {
    type: 'nfm_reply';
    nfm_reply: {
      name: string;
      body: string;
      response_json: string;
    };
  };
}
type InteractiveMessage = InteractiveListReplyMessage | InteractiveButtonReplyMessage | InteractiveNfmReplyMessage;
interface ButtonMessage extends BaseMessage {
  type: MessageTypesEnum.Button;
  context: ReplyContext;
  button: {
    payload: string;
    text: string;
  };
}
interface LocationMessage extends BaseMessage {
  type: MessageTypesEnum.Location;
  location: {
    latitude: number;
    longitude: number;
    name?: string;
    address?: string;
    url?: string;
  };
  referral?: ReferralInfo;
}
interface ContactsMessage extends BaseMessage {
  type: MessageTypesEnum.Contacts;
  contacts: Array<{
    addresses?: Array<{
      city?: string;
      country?: string;
      country_code?: string;
      state?: string;
      street?: string;
      type?: string;
      zip?: string;
    }>;
    birthday?: string;
    emails?: Array<{
      email: string;
      type?: string;
    }>;
    name: {
      formatted_name: string;
      first_name?: string;
      last_name?: string;
      middle_name?: string;
      suffix?: string;
      prefix?: string;
    };
    org?: {
      company?: string;
      department?: string;
      title?: string;
    };
    phones?: Array<{
      phone: string;
      wa_id?: string;
      type?: string;
    }>;
    urls?: Array<{
      url: string;
      type?: string;
    }>;
  }>;
  referral?: ReferralInfo;
}
interface ReactionMessage extends BaseMessage {
  type: MessageTypesEnum.Reaction;
  reaction: {
    message_id: string;
    emoji?: string;
  };
}
interface OrderMessage extends BaseMessage {
  type: MessageTypesEnum.Order;
  order: {
    catalog_id: string;
    text?: string;
    product_items: Array<{
      product_retailer_id: string;
      quantity: number;
      item_price: number;
      currency: string;
    }>;
  };
}
interface SystemMessage extends BaseMessage {
  type: MessageTypesEnum.System;
  system: {
    body: string;
    wa_id: string;
    type: 'user_changed_number';
  };
}
interface UnsupportedMessage extends BaseMessage {
  type: MessageTypesEnum.Unsupported;
  errors: Array<WebhookError>;
}
type GroupMessage = {
  group_id: string;
} & (TextMessage | ImageMessage | VideoMessage | AudioMessage | DocumentMessage | LocationMessage | ContactsMessage);
type WhatsAppMessage = TextMessage | ImageMessage | VideoMessage | AudioMessage | DocumentMessage | StickerMessage | InteractiveMessage | ButtonMessage | LocationMessage | ContactsMessage | ReactionMessage | OrderMessage | SystemMessage | UnsupportedMessage | GroupMessage;
//#endregion
//#region src/core/webhook/types/history.d.ts
/**
 * History sync metadata
 */
interface HistorySyncMetadata {
  phase: number;
  chunk_order: number;
  progress: number;
}
/**
 * Reaction object in history
 */
interface HistoryReaction {
  message_id: string;
  emoji: string;
}
/**
 * Message echo data (sent messages)
 */
interface HistoryMessageEcho {
  from: string;
  to: string;
  id: string;
  timestamp: string;
  text?: {
    body: string;
  };
  interactive?: any;
  location?: any;
  image?: any;
  document?: any;
  voice?: any;
  audio?: any;
  video?: any;
  sticker?: any;
  button?: any;
  contacts?: any;
  reaction?: HistoryReaction;
  order?: any;
  biz_opaque_callback_data?: string;
  template?: any;
}
/**
 * History sync thread data
 */
interface HistorySyncThread {
  id: string;
  messages: WhatsAppMessage[];
}
/**
 * History sync error data
 */
interface HistorySyncError {
  message: string;
  error_data?: {
    details: string;
  };
}
/**
 * History sync data
 */
interface HistorySyncData {
  metadata: HistorySyncMetadata;
  threads?: HistorySyncThread[];
  errors?: HistorySyncError[];
}
/**
 * History webhook value
 */
interface HistoryValue {
  messaging_product: string;
  metadata: HistorySyncMetadata;
  history?: HistorySyncData[];
  messages?: WhatsAppMessage[];
  message_echoes?: HistoryMessageEcho[];
}
interface HistoryWebhookValue {
  field: 'history';
  value: HistoryValue;
}
//#endregion
//#region src/core/webhook/types/marketing.d.ts
/**
 * Detected event type.
 * Sample payload uses lowercase ("purchase"), docs use PascalCase ("Purchase").
 * Accept both forms.
 */
type AutomaticEventName = 'LeadSubmitted' | 'Purchase' | 'purchase' | 'lead_submitted' | string;
interface AutomaticEventCustomData {
  /** ISO 4217 currency code (e.g. "USD") — present on Purchase events */
  currency: string;
  /** Monetary value of the purchase — present on Purchase events */
  value: number;
}
interface AutomaticEvent {
  /** WhatsApp message ID that triggered the event detection */
  id: string;
  /**
   * Detected event type.
   * @see AutomaticEventName
   */
  event_name: AutomaticEventName;
  /** Unix timestamp of when the event was detected */
  timestamp: number;
  /**
   * Click-to-WhatsApp ad click ID — use with Conversions API.
   * Present when the event originated from a Click-to-WhatsApp ad.
   */
  ctwa_clid?: string;
  /** Present on Purchase events */
  custom_data?: AutomaticEventCustomData;
}
interface AutomaticEventsValue {
  messaging_product: 'whatsapp';
  metadata: WebhookMetadata;
  /** Array of detected automatic events */
  automatic_events: AutomaticEvent[];
}
interface AutomaticEventsWebhookValue {
  field: 'automatic_events';
  value: AutomaticEventsValue;
}
interface TrackingEventData {
  /** Unique identifier for the click, also appended to the destination URL */
  click_id?: string;
  /** Internal Meta token for processing and tracking */
  tracking_token?: string;
}
interface TrackingEvent {
  /**
   * Name of the tracked event.
   * Known values: "sent"
   */
  event_name: string;
  /** Unix timestamp of the event */
  timestamp: number;
  /** Tracking data associated with the event */
  tracking_data?: TrackingEventData;
}
interface TrackingEventsValue {
  messaging_product: 'whatsapp';
  metadata: WebhookMetadata;
  /** Array of tracking events */
  events: TrackingEvent[];
}
interface TrackingEventsWebhookValue {
  field: 'tracking_events';
  value: TrackingEventsValue;
}
//#endregion
//#region src/core/webhook/types/messageEchoes.d.ts
/**
 * Message echo error
 */
interface MessageEchoError {
  message: string;
  error_data?: {
    details: string;
  };
}
/**
 * Message echo data (sent messages from business)
 */
interface MessageEcho {
  from: string;
  to: string;
  id: string;
  timestamp: string;
  text?: {
    body: string;
  };
  interactive?: any;
  location?: any;
  image?: any;
  document?: any;
  voice?: any;
  audio?: any;
  video?: any;
  sticker?: any;
  button?: any;
  contacts?: any;
  reaction?: {
    message_id: string;
    emoji: string;
  };
  order?: any;
  biz_opaque_callback_data?: string;
  template?: any;
  system?: {
    type: string;
  };
  user_actions?: any[];
}
/**
 * SMB Message Echoes value
 */
interface SmbMessageEchoesValue {
  metadata: WebhookMetadata;
  errors?: MessageEchoError[];
  message_echoes: MessageEcho[];
}
interface SmbMessageEchoesWebhookValue {
  field: 'smb_message_echoes';
  value: SmbMessageEchoesValue;
}
interface MessageEchoSender {
  /** Page ID that sent the message */
  id: string;
}
interface MessageEchoRecipient {
  /** Page-scoped ID of the user who received the message */
  id: string;
}
interface MessageEchoAttachment {
  /** Attachment type: image, audio, video, file, template, fallback */
  type: string;
  /** URL of the attachment or fallback URL */
  url?: string;
  /** Template payload for template attachments */
  payload?: unknown;
  title?: string;
}
interface MessageEchoBody {
  /** Indicates the message was sent by the page */
  is_echo: true;
  /** ID of the app that sent the message */
  app_id: number;
  /** Custom metadata string set in the Send API request */
  metadata?: string;
  /** Message ID */
  mid: string;
  /** Text content — present on text messages */
  text?: string;
  /** Attachments — present on media/template messages */
  attachments?: MessageEchoAttachment[];
}
interface MessageEchoEntry {
  sender: MessageEchoSender;
  recipient: MessageEchoRecipient;
  /** Unix timestamp in milliseconds */
  timestamp: number;
  message: MessageEchoBody;
}
interface MessageEchoesValue {
  /** Array of echoed messages */
  messaging: MessageEchoEntry[];
}
interface MessageEchoesWebhookValue {
  field: 'message_echoes';
  value: MessageEchoesValue;
}
//#endregion
//#region src/core/webhook/types/messaging.d.ts
interface MessagingHandoverControlPassed {
  /** Optional metadata string passed with the handover */
  metadata?: string;
}
interface MessagingHandoversValue {
  messaging_product: 'whatsapp';
  /** The business phone number that received the handover event */
  recipient: {
    display_phone_number: string;
    phone_number_id: string;
  };
  /** The user involved in the handover */
  sender: {
    phone_number: string;
  };
  /** Unix timestamp of the event */
  timestamp: string;
  /** Present when thread control is passed to another app */
  control_passed?: MessagingHandoverControlPassed;
}
interface MessagingHandoversWebhookValue {
  field: 'messaging_handovers';
  value: MessagingHandoversValue;
}
interface StandbyValue {
  messaging_product: 'whatsapp';
  [key: string]: unknown;
}
interface StandbyWebhookValue {
  field: 'standby';
  value: StandbyValue;
}
interface UserPreferenceEntry {
  /** WhatsApp ID of the user */
  wa_id: string;
  /** Meta user ID (e.g. "US.1234567") */
  user_id: string;
  /** Human-readable description of the preference change */
  detail: string;
  /**
   * Category of the preference that changed.
   * Known value: "marketing_messages"
   */
  category: 'marketing_messages' | string;
  /**
   * New preference value.
   * Known value: "stop" (user opted out)
   */
  value: 'stop' | string;
  /** Unix timestamp of when the preference was changed */
  timestamp: number;
  /** Signup ID associated with the preference, if applicable */
  signup_id?: string;
}
interface UserPreferencesContact {
  profile: {
    /** Display name of the user */name: string; /** WhatsApp username, if available */
    username?: string;
  };
  /** WhatsApp ID of the user */
  wa_id: string;
  /** Meta user ID */
  user_id?: string;
}
interface UserPreferencesValue {
  messaging_product: 'whatsapp';
  metadata: WebhookMetadata;
  /** Array of user preference change events */
  user_preferences: UserPreferenceEntry[];
  /** Contact profile information for the users */
  contacts?: UserPreferencesContact[];
}
interface UserPreferencesWebhookValue {
  field: 'user_preferences';
  value: UserPreferencesValue;
}
//#endregion
//#region src/core/webhook/types/partner.d.ts
/**
 * Partner solution event types.
 * Known value: "SOLUTION_CREATED"
 */
type PartnerSolutionEvent = 'SOLUTION_CREATED' | string;
/**
 * Partner solution status values.
 * Known value: "INITIATED"
 */
type PartnerSolutionStatus = 'INITIATED' | string;
interface PartnerSolutionsValue {
  /** Type of partner solution event */
  event: PartnerSolutionEvent;
  /** Unique identifier for the partner solution */
  solution_id: string;
  /** Current status of the partner solution */
  solution_status: PartnerSolutionStatus;
}
interface PartnerSolutionsWebhookValue {
  field: 'partner_solutions';
  value: PartnerSolutionsValue;
}
//#endregion
//#region src/core/webhook/types/payments.d.ts
interface PaymentConfigurationUpdateValue {
  /** Name of the payment configuration */
  configuration_name: string;
  /** Payment provider name (e.g. "razorpay") */
  provider_name: string;
  /** Merchant ID assigned by the payment provider */
  provider_mid: string;
  /**
   * Current status of the payment configuration.
   * Known values: "Needs Testing"
   */
  status: string;
  /** Unix timestamp of when the configuration was created */
  created_timestamp: number;
  /** Unix timestamp of when the configuration was last updated */
  updated_timestamp: number;
}
interface PaymentConfigurationUpdateWebhookValue {
  field: 'payment_configuration_update';
  value: PaymentConfigurationUpdateValue;
}
//#endregion
//#region src/core/webhook/types/phoneNumber.d.ts
/**
 * Phone number name update decision
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#phone-number-updates
 */
type PhoneNumberDecision = 'APPROVED' | 'REJECTED' | 'DEFERRED';
interface PhoneNumberNameUpdateValue {
  display_phone_number: string;
  decision: PhoneNumberDecision;
  requested_verified_name: string;
  rejection_reason: string | null;
}
interface PhoneNumberNameUpdateWebhookValue {
  field: 'phone_number_name_update';
  value: PhoneNumberNameUpdateValue;
}
/**
 * Phone number quality events
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#value--event
 */
type PhoneNumberQualityEvent = 'FLAGGED' | 'UNFLAGGED' | 'UPGRADE' | 'DOWNGRADE' | 'ONBOARDING';
/**
 * Messaging tier limits
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#value--current_limit
 */
type CurrentLimit = 'TIER_50' | 'TIER_250' | 'TIER_1K' | 'TIER_10K' | 'TIER_100K' | 'TIER_UNLIMITED';
interface PhoneNumberQualityUpdateValue {
  display_phone_number: string;
  event: PhoneNumberQualityEvent;
  current_limit: CurrentLimit;
}
interface PhoneNumberQualityUpdateWebhookValue {
  field: 'phone_number_quality_update';
  value: PhoneNumberQualityUpdateValue;
}
//#endregion
//#region src/core/webhook/types/security.d.ts
/**
 * Two-step verification security events
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#value--event
 */
type SecurityEvent = 'PIN_CHANGED' | 'PIN_RESET_REQUEST' | 'PIN_RESET_SUCCESS';
interface SecurityValue {
  event: SecurityEvent;
  requester?: string;
}
interface SecurityWebhookValue {
  field: 'security';
  value: SecurityValue;
}
//#endregion
//#region src/core/webhook/types/status.d.ts
interface StatusWebhook {
  id: string;
  status: 'sent' | 'delivered' | 'read' | 'failed';
  timestamp: string;
  recipient_id: string;
  recipient_type?: 'group';
  recipient_participant_id?: string;
  recipient_identity_key_hash?: string;
  biz_opaque_callback_data?: string;
  conversation?: {
    id: string;
    expiration_timestamp?: string;
    origin: {
      type: 'authentication' | 'authentication_international' | 'marketing' | 'marketing_lite' | 'referral_conversion' | 'service' | 'utility';
    };
  };
  pricing?: {
    billable: boolean;
    pricing_model: 'CBP' | 'PMP';
    type: 'regular' | 'free_customer_service' | 'free_entry_point';
    category: 'authentication' | 'authentication_international' | 'marketing' | 'marketing_lite' | 'referral_conversion' | 'service' | 'utility';
  };
  errors?: Array<WebhookError>;
}
/**
 * Message status enum
 */
declare enum MessageStatus {
  DELIVERED = "delivered",
  READ = "read",
  SENT = "sent",
  FAILED = "failed"
}
//#endregion
//#region src/core/webhook/types/template.d.ts
/**
 * Message template status events
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#value--event
 */
type TemplateStatusEvent = 'APPROVED' | 'REJECTED' | 'PENDING' | 'DISABLED' | 'REINSTATED' | 'IN_APPEAL' | 'FLAGGED' | 'PAUSED' | 'PENDING_DELETION';
/**
 * Template rejection reasons
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#value--reason
 */
type TemplateRejectionReason = 'NONE' | 'ABUSIVE_CONTENT' | 'INCORRECT_CATEGORY' | 'INVALID_FORMAT' | 'SCAM';
interface TemplateDisableInfo {
  disable_date: string;
}
interface TemplatePauseInfo {
  title: string;
  description: string;
}
interface MessageTemplateStatusUpdateValue {
  event: TemplateStatusEvent;
  message_template_id: number;
  message_template_name: string;
  message_template_language: string;
  reason: TemplateRejectionReason | null;
  disable_info?: TemplateDisableInfo;
  other_info?: TemplatePauseInfo;
}
interface MessageTemplateStatusUpdateWebhookValue {
  field: 'message_template_status_update';
  value: MessageTemplateStatusUpdateValue;
}
/**
 * Template categories
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#value--event
 */
type TemplateCategory = 'MARKETING' | 'OTP' | 'TRANSACTIONAL' | 'AUTHENTICATION' | 'UTILITY';
interface TemplateCategoryUpdateValue {
  message_template_id: number;
  message_template_name: string;
  message_template_language: string;
  previous_category: TemplateCategory;
  new_category: TemplateCategory;
}
interface TemplateCategoryUpdateWebhookValue {
  field: 'template_category_update';
  value: TemplateCategoryUpdateValue;
}
/**
 * Template quality scores
 * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#value--event
 */
type TemplateQualityScore = 'GREEN' | 'YELLOW' | 'RED' | 'UNKNOWN';
interface MessageTemplateQualityUpdateValue {
  previous_quality_score: TemplateQualityScore;
  new_quality_score: TemplateQualityScore;
  message_template_id: number;
  message_template_name: string;
  message_template_language: string;
}
interface MessageTemplateQualityUpdateWebhookValue {
  field: 'message_template_quality_update';
  value: MessageTemplateQualityUpdateValue;
}
interface MessageTemplateComponentsUpdateValue {
  /** Numeric ID of the message template */
  message_template_id: number;
  /** Name of the message template */
  message_template_name: string;
  /** Language code of the message template (e.g. "en_US") */
  message_template_language: string;
  /** Event describing what changed */
  event: string;
  [key: string]: unknown;
}
interface MessageTemplateComponentsUpdateWebhookValue {
  field: 'message_template_components_update';
  value: MessageTemplateComponentsUpdateValue;
}
interface TemplateCorrectCategoryDetectionValue {
  /** Numeric ID of the affected message template */
  message_template_id: number;
  /** Name of the affected message template */
  message_template_name: string;
  /** Language code of the affected message template (e.g. "en_US") */
  message_template_language: string;
  /** The category WhatsApp determined the template should belong to */
  suggested_category: TemplateCategory;
  /** The template's current (approved) category */
  current_category: TemplateCategory;
}
interface TemplateCorrectCategoryDetectionWebhookValue {
  field: 'template_correct_category_detection';
  value: TemplateCorrectCategoryDetectionValue;
}
//#endregion
//#region src/core/webhook/types/webhookFields.d.ts
declare const WebhookField: {
  readonly Messages: "messages";
  readonly AccountUpdate: "account_update";
  readonly AccountReviewUpdate: "account_review_update";
  readonly AccountAlerts: "account_alerts";
  readonly AccountSettingsUpdate: "account_settings_update";
  readonly BusinessCapabilityUpdate: "business_capability_update";
  readonly BusinessStatusUpdate: "business_status_update";
  readonly PhoneNumberNameUpdate: "phone_number_name_update";
  readonly PhoneNumberQualityUpdate: "phone_number_quality_update";
  readonly MessageTemplateStatusUpdate: "message_template_status_update";
  readonly MessageTemplateQualityUpdate: "message_template_quality_update";
  readonly MessageTemplateComponentsUpdate: "message_template_components_update";
  readonly TemplateCategoryUpdate: "template_category_update";
  readonly TemplateCorrectCategoryDetection: "template_correct_category_detection";
  readonly Flows: "flows";
  readonly Security: "security";
  readonly History: "history";
  readonly SmbMessageEchoes: "smb_message_echoes";
  readonly SmbAppStateSync: "smb_app_state_sync";
  readonly AutomaticEvents: "automatic_events";
  readonly TrackingEvents: "tracking_events";
  readonly Calls: "calls";
  readonly GroupLifecycleUpdate: "group_lifecycle_update";
  readonly GroupParticipantsUpdate: "group_participants_update";
  readonly GroupSettingsUpdate: "group_settings_update";
  readonly GroupStatusUpdate: "group_status_update";
  readonly MessageEchoes: "message_echoes";
  readonly MessagingHandovers: "messaging_handovers";
  readonly PartnerSolutions: "partner_solutions";
  readonly PaymentConfigurationUpdate: "payment_configuration_update";
  readonly Standby: "standby";
  readonly UserPreferences: "user_preferences";
};
type WebhookFieldType = (typeof WebhookField)[keyof typeof WebhookField];
//#endregion
//#region src/core/webhook/types/index.d.ts
/**
 * Webhook value for incoming messages
 */
interface MessageWebhookValue {
  messaging_product: 'whatsapp';
  metadata: WebhookMetadata;
  contacts: Array<WebhookContact>;
  messages: Array<WhatsAppMessage>;
}
/**
 * Webhook value for status updates
 */
interface StatusWebhookValue {
  messaging_product: 'whatsapp';
  metadata: WebhookMetadata;
  statuses: Array<StatusWebhook>;
}
/**
 * Webhook value for errors (no contacts or messages)
 */
interface ErrorWebhookValue {
  messaging_product: 'whatsapp';
  metadata: WebhookMetadata;
  errors: Array<WebhookError>;
}
/**
 * Union type for all webhook value types
 */
type WebhookValue = MessageWebhookValue | StatusWebhookValue | ErrorWebhookValue;
/**
 * Union type for all webhook field values
 */
type WebhookFieldValue = AccountUpdateWebhookValue | AccountReviewUpdateWebhookValue | AccountAlertsWebhookValue | AccountSettingsUpdateWebhookValue | AutomaticEventsWebhookValue | BusinessCapabilityUpdateWebhookValue | BusinessStatusUpdateWebhookValue | CallsWebhookValue | FlowsWebhookValue | GroupLifecycleUpdateWebhookValue | GroupParticipantsUpdateWebhookValue | GroupSettingsUpdateWebhookValue | GroupStatusUpdateWebhookValue | HistoryWebhookValue | MessageEchoesWebhookValue | MessageTemplateComponentsUpdateWebhookValue | MessageTemplateQualityUpdateWebhookValue | MessageTemplateStatusUpdateWebhookValue | MessagingHandoversWebhookValue | PartnerSolutionsWebhookValue | PaymentConfigurationUpdateWebhookValue | PhoneNumberNameUpdateWebhookValue | PhoneNumberQualityUpdateWebhookValue | SecurityWebhookValue | SmbAppStateSyncWebhookValue | SmbMessageEchoesWebhookValue | StandbyWebhookValue | TemplateCategoryUpdateWebhookValue | TemplateCorrectCategoryDetectionWebhookValue | TrackingEventsWebhookValue | UserPreferencesWebhookValue;
interface WebhookPayload {
  object: 'whatsapp_business_account';
  entry: Array<{
    id: string;
    changes: Array<{
      value: WebhookValue;
      field: 'messages';
    } | WebhookFieldValue>;
  }>;
}
/**
 * @deprecated Use specific message types instead
 * Represents a message received through the webhook
 */
interface WebhookMessage {
  wabaId: string;
  id: string;
  from: string;
  timestamp: string;
  type: any;
  phoneNumberId: string;
  displayPhoneNumber: string;
  profileName: string;
  text?: any;
  image?: any;
  video?: any;
  audio?: any;
  document?: any;
  sticker?: any;
  location?: any;
  contacts?: any;
  interactive?: any;
  button?: any;
  order?: any;
  system?: any;
  reaction?: any;
  statuses?: StatusWebhook;
  originalData: any;
}
/**
 * Webhook event received from WhatsApp
 */
interface WebhookEvent {
  field: string;
  value: any;
  timestamp: number;
}
//#endregion
//#region src/utils/isMetaError.d.ts
type MetaErrorData = {
  message: string;
  type: string;
  code: number;
  error_data?: {
    messaging_product?: 'whatsapp';
    details?: string;
  };
  error_subcode?: number;
  fbtrace_id: string;
};
interface MetaError extends Error {
  error: MetaErrorData;
}
declare const WHATSAPP_ERROR_CODES: readonly [0, 1, 2, 3, 4, 10, 33, 100, 190, 200, 299, 368, 613, 80007, 130429, 130472, 130497, 131000, 131005, 131008, 131009, 131016, 131020, 131021, 131026, 131030, 131031, 131037, 131041, 131042, 131044, 131045, 131047, 131048, 131049, 131050, 131051, 131052, 131053, 131055, 131056, 131057, 131059, 131201, 131202, 131203, 131204, 131207, 131208, 131209, 131210, 131211, 131212, 131213, 131214, 131215, 132000, 132001, 132005, 132007, 132008, 132012, 132015, 132016, 132068, 132069, 133000, 133004, 133005, 133006, 133008, 133009, 133010, 133015, 133016, 134011, 134100, 134101, 134102, 135000, 137000, 138000, 138001, 138002, 138003, 138004, 138005, 138006, 138007, 138009, 138012, 138013, 138018, 139000, 139001, 139002, 139003, 139004, 139100, 139101, 139102, 139103, 200005, 200006, 200007, 1752041, 2388001, 2388012, 2388019, 2388040, 2388047, 2388072, 2388073, 2388091, 2388093, 2388103, 2388293, 2388299, 2494100, 2593079, 2593085, 2593107, 2593108];
type ApiPermissionErrorCode = number;
type WhatsAppErrorCode = (typeof WHATSAPP_ERROR_CODES)[number] | ApiPermissionErrorCode;
declare const AUTHORIZATION_ERROR_CODES: readonly [0, 3, 10, 190];
declare const THROTTLING_ERROR_CODES: readonly [4, 80007, 130429, 131048, 131056];
declare const INTEGRITY_ERROR_CODES: readonly [368, 130497, 131031];
declare const SEND_MESSAGE_ERROR_CODES: readonly [130472, 131000, 131005, 131008, 131009, 131016, 131021, 131026, 131030, 131042, 131044, 131045, 131047, 131050, 131051, 131052, 131053, 131056, 131057, 131048, 132000, 132001, 132005, 132007, 132008, 132012, 132015, 132016, 132068, 132069, 135000, 137000];
declare const FLOW_ERROR_CODES: readonly [139000, 139001, 139002, 139003, 139004];
declare const BLOCK_USER_ERROR_CODES: readonly [139100, 139101, 139102, 139103];
declare const CALLING_ERROR_CODES: readonly [138000, 138001, 138002, 138003, 138004, 138005, 138006, 138007, 138009, 138012, 138013, 138018, 613];
declare const GROUP_ERROR_CODES: readonly [131020, 131041, 131059, 131201, 131202, 131203, 131204, 131207, 131208, 131209, 131210, 131211, 131212, 131213, 131214, 131215];
declare function isWhatsAppErrorCode(code: number): code is WhatsAppErrorCode;
declare function isApiPermissionErrorCode(code: number): code is ApiPermissionErrorCode;
declare function isAuthorizationErrorCode(code: number): code is ApiPermissionErrorCode | (typeof AUTHORIZATION_ERROR_CODES)[number];
declare function isThrottlingErrorCode(code: number): code is (typeof THROTTLING_ERROR_CODES)[number];
declare function isIntegrityErrorCode(code: number): code is (typeof INTEGRITY_ERROR_CODES)[number];
declare function isSendMessageErrorCode(code: number): code is (typeof SEND_MESSAGE_ERROR_CODES)[number];
declare function isFlowErrorCode(code: number): code is (typeof FLOW_ERROR_CODES)[number];
declare function isBlockUserErrorCode(code: number): code is (typeof BLOCK_USER_ERROR_CODES)[number];
declare function isCallingErrorCode(code: number): code is (typeof CALLING_ERROR_CODES)[number];
declare function isGroupErrorCode(code: number): code is (typeof GROUP_ERROR_CODES)[number];
declare class WhatsAppError extends Error {
  constructor(message: string);
}
declare class WhatsAppApiError extends WhatsAppError {
  readonly error: MetaErrorData;
  readonly statusCode?: number;
  constructor(message: string, error: MetaErrorData, statusCode?: number);
}
declare class WhatsAppAuthorizationError extends WhatsAppApiError {
  constructor(message: string, error: MetaErrorData, statusCode?: number);
}
declare class WhatsAppThrottlingError extends WhatsAppApiError {
  constructor(message: string, error: MetaErrorData, statusCode?: number);
}
declare class WhatsAppIntegrityError extends WhatsAppApiError {
  constructor(message: string, error: MetaErrorData, statusCode?: number);
}
declare class WhatsAppSendMessageError extends WhatsAppApiError {
  constructor(message: string, error: MetaErrorData, statusCode?: number);
}
declare class WhatsAppFlowError extends WhatsAppApiError {
  constructor(message: string, error: MetaErrorData, statusCode?: number);
}
declare class WhatsAppBlockUserError extends WhatsAppApiError {
  constructor(message: string, error: MetaErrorData, statusCode?: number);
}
declare class WhatsAppCallingError extends WhatsAppApiError {
  constructor(message: string, error: MetaErrorData, statusCode?: number);
}
declare class WhatsAppGroupError extends WhatsAppApiError {
  constructor(message: string, error: MetaErrorData, statusCode?: number);
}
declare function createWhatsAppApiError(error: MetaErrorData, statusCode?: number): WhatsAppApiError;
declare class WhatsAppNetworkError extends WhatsAppError {
  readonly cause?: unknown;
  constructor(message: string, cause?: unknown);
}
declare class WhatsAppUnknownError extends WhatsAppError {
  readonly cause?: unknown;
  constructor(message: string, cause?: unknown);
}
/**
 * Thrown when an API method receives invalid input (e.g., malformed phone number,
 * empty required array). This error is thrown client-side before any API call is made.
 */
declare class WhatsAppValidationError extends Error {
  constructor(message: string);
}
/**
 * Determines if the error is a Meta API error response
 * @param error Any error object to check
 * @returns Type guard indicating if error is a Meta API error
 */
declare function isMetaError(error: any): error is MetaError;
declare function isWhatsAppApiErrorResponse(error: any): error is MetaError & {
  error: {
    code: WhatsAppErrorCode;
  };
};
declare function isWhatsAppAuthorizationError(error: unknown): error is WhatsAppAuthorizationError;
declare function isWhatsAppThrottlingError(error: unknown): error is WhatsAppThrottlingError;
declare function isWhatsAppIntegrityError(error: unknown): error is WhatsAppIntegrityError;
declare function isWhatsAppSendMessageError(error: unknown): error is WhatsAppSendMessageError;
declare function isWhatsAppFlowError(error: unknown): error is WhatsAppFlowError;
declare function isWhatsAppBlockUserError(error: unknown): error is WhatsAppBlockUserError;
declare function isWhatsAppCallingError(error: unknown): error is WhatsAppCallingError;
declare function isWhatsAppGroupError(error: unknown): error is WhatsAppGroupError;
declare function normalizeMetaError(errorData: unknown, statusCode?: number): MetaError;
//#endregion
//#region src/types/constants.d.ts
/**
 * As-const alternatives to enums.
 *
 * Every enum in enums.ts gets a matching `as const` object and a union type here.
 * Use whichever style you prefer:
 *   - Enum:  CategoryEnum.Marketing
 *   - Const: Category.Marketing  (value: 'MARKETING')
 *   - Type:  CategoryType        (union: 'AUTHENTICATION' | 'MARKETING' | 'UTILITY')
 */
declare const Category: {
  readonly Authentication: "AUTHENTICATION";
  readonly Marketing: "MARKETING";
  readonly Utility: "UTILITY";
};
type CategoryType = (typeof Category)[keyof typeof Category];
declare const TemplateStatus: {
  readonly Approved: "APPROVED";
  readonly Pending: "PENDING";
  readonly Rejected: "REJECTED";
};
type TemplateStatusType = (typeof TemplateStatus)[keyof typeof TemplateStatus];
declare const HttpMethods: {
  readonly Get: "GET";
  readonly Post: "POST";
  readonly Put: "PUT";
  readonly Delete: "DELETE";
};
type HttpMethodsType = (typeof HttpMethods)[keyof typeof HttpMethods];
declare const MessageTypes: {
  readonly Audio: "audio";
  readonly Contacts: "contacts";
  readonly Document: "document";
  readonly Image: "image";
  readonly Interactive: "interactive";
  readonly Location: "location";
  readonly Reaction: "reaction";
  readonly Sticker: "sticker";
  readonly Template: "template";
  readonly Text: "text";
  readonly Video: "video";
  readonly Button: "button";
  readonly Order: "order";
  readonly System: "system";
  readonly Unsupported: "unsupported";
  readonly Unknown: "unknown"; /** @deprecated Use WebhookProcessor.onStatus() instead */
  readonly Statuses: "statuses";
  readonly All: "*";
};
type MessageTypesType = (typeof MessageTypes)[keyof typeof MessageTypes];
declare const ParametersTypes: {
  readonly Action: "ACTION";
  readonly CouponCode: "COUPON_CODE";
  readonly Currency: "CURRENCY";
  readonly DateTime: "DATE_TIME";
  readonly Document: "DOCUMENT";
  readonly ExpirationTimeMs: "EXPIRATION_TIME_MS";
  readonly Image: "IMAGE";
  readonly LimitedTimeOffer: "LIMITED_TIME_OFFER";
  readonly Location: "LOCATION";
  readonly OrderStatus: "ORDER_STATUS";
  readonly Payload: "PAYLOAD";
  readonly Product: "PRODUCT";
  readonly Text: "TEXT";
  readonly TtlMinutes: "TTL_MINUTES";
  readonly Video: "VIDEO";
  readonly WebviewInteraction: "WEBVIEW_INTERACTION";
  readonly WebviewPresentation: "WEBVIEW_PRESENTATION";
};
type ParametersTypesType = (typeof ParametersTypes)[keyof typeof ParametersTypes];
declare const InteractiveTypes: {
  readonly Button: "button";
  readonly List: "list";
  readonly Product: "product";
  readonly ProductList: "product_list";
  readonly CtaUrl: "cta_url";
  readonly Carousel: "carousel";
  readonly LocationRequest: "location_request_message";
  readonly AddressMessage: "address_message";
  readonly Flow: "flow";
};
type InteractiveTypesType = (typeof InteractiveTypes)[keyof typeof InteractiveTypes];
declare const ButtonPosition: {
  readonly First: 1;
  readonly Second: 2;
  readonly Third: 3;
  readonly Fourth: 4;
  readonly Fifth: 5;
};
type ButtonPositionType = (typeof ButtonPosition)[keyof typeof ButtonPosition];
declare const SubType: {
  readonly Catalog: "CATALOG";
  readonly CopyCode: "COPY_CODE";
  readonly Flow: "FLOW";
  readonly Mpm: "MPM";
  readonly OrderDetails: "ORDER_DETAILS";
  readonly QuickReply: "QUICK_REPLY";
  readonly Reminder: "REMINDER";
  readonly Url: "URL";
  readonly VoiceCall: "VOICE_CALL";
};
type SubTypeType = (typeof SubType)[keyof typeof SubType];
declare const ComponentType: {
  readonly Header: "HEADER";
  readonly Body: "BODY";
  readonly Button: "BUTTON";
  readonly Footer: "FOOTER";
};
type ComponentTypeType = (typeof ComponentType)[keyof typeof ComponentType];
declare const ConversationTypes: {
  readonly BusinessInitiated: "business_initiated";
  readonly CustomerInitiated: "customer_initiated";
  readonly ReferralConversion: "referral_conversion";
};
type ConversationTypesType = (typeof ConversationTypes)[keyof typeof ConversationTypes];
declare const Status: {
  readonly Delivered: "delivered";
  readonly Read: "read";
  readonly Sent: "sent";
};
type StatusType = (typeof Status)[keyof typeof Status];
declare const VideoMediaTypes: {
  readonly Mp4: "video/mp4";
  readonly Threegp: "video/3gp";
};
type VideoMediaTypesType = (typeof VideoMediaTypes)[keyof typeof VideoMediaTypes];
declare const StickerMediaTypes: {
  readonly Webp: "image/webp";
};
type StickerMediaTypesType = (typeof StickerMediaTypes)[keyof typeof StickerMediaTypes];
declare const ImageMediaTypes: {
  readonly Jpeg: "image/jpeg";
  readonly Png: "image/png";
};
type ImageMediaTypesType = (typeof ImageMediaTypes)[keyof typeof ImageMediaTypes];
declare const DocumentMediaTypes: {
  readonly Text: "text/plain";
  readonly Pdf: "application/pdf";
  readonly Ppt: "application/vnd.ms-powerpoint";
  readonly Word: "application/msword";
  readonly Excel: "application/vnd.ms-excel";
  readonly OpenDoc: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
  readonly OpenPres: "application/vnd.openxmlformats-officedocument.presentationml.presentation";
  readonly OpenSheet: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
};
type DocumentMediaTypesType = (typeof DocumentMediaTypes)[keyof typeof DocumentMediaTypes];
declare const AudioMediaTypes: {
  readonly Aac: "audio/aac";
  readonly Mp4: "audio/mp4";
  readonly Mpeg: "audio/mpeg";
  readonly Amr: "audio/amr";
  readonly Ogg: "audio/ogg";
};
type AudioMediaTypesType = (typeof AudioMediaTypes)[keyof typeof AudioMediaTypes];
declare const WebhookTypes: {
  readonly Audio: "audio";
  readonly Button: "button";
  readonly Document: "document";
  readonly Text: "text";
  readonly Image: "image";
  readonly Interactive: "interactive";
  readonly Order: "order";
  readonly Sticker: "sticker";
  readonly System: "system";
  readonly Unknown: "unknown";
  readonly Video: "video";
};
type WebhookTypesType = (typeof WebhookTypes)[keyof typeof WebhookTypes];
declare const SystemChangeTypes: {
  readonly CustomerChangedNumber: "customer_changed_number";
  readonly CustomerIdentityChanged: "customer_identity_changed";
};
type SystemChangeTypesType = (typeof SystemChangeTypes)[keyof typeof SystemChangeTypes];
declare const ReferralSourceTypes: {
  readonly Ad: "ad";
  readonly Post: "post";
};
type ReferralSourceTypesType = (typeof ReferralSourceTypes)[keyof typeof ReferralSourceTypes];
declare const RequestCodeMethods: {
  readonly Sms: "SMS";
  readonly Voice: "VOICE";
};
type RequestCodeMethodsType = (typeof RequestCodeMethods)[keyof typeof RequestCodeMethods];
declare const Languages: {
  readonly Afrikaans: "af";
  readonly Albanian: "sq";
  readonly Arabic: "ar";
  readonly Azerbaijani: "az";
  readonly Bengali: "bn";
  readonly Bulgarian: "bg";
  readonly Catalan: "ca";
  readonly Chinese_CHN: "zh_CN";
  readonly Chinese_HKG: "zh_HK";
  readonly Chinese_TAI: "zh_TW";
  readonly Croatian: "hr";
  readonly Czech: "cs";
  readonly Danish: "da";
  readonly Dutch: "nl";
  readonly English: "en";
  readonly English_UK: "en_GB";
  readonly English_US: "en_US";
  readonly Estonian: "et";
  readonly Filipino: "fil";
  readonly Finnish: "fi";
  readonly French: "fr";
  readonly Georgian: "ka";
  readonly German: "de";
  readonly Greek: "el";
  readonly Gujarati: "gu";
  readonly Hausa: "ha";
  readonly Hebrew: "he";
  readonly Hindi: "hi";
  readonly Hungarian: "hu";
  readonly Indonesian: "id";
  readonly Irish: "ga";
  readonly Italian: "it";
  readonly Japanese: "ja";
  readonly Kannada: "kn";
  readonly Kazakh: "kk";
  readonly Kinyarwanda: "rw_RW";
  readonly Korean: "ko";
  readonly Kyrgyz_Kyrgyzstan: "ky_KG";
  readonly Lao: "lo";
  readonly Latvian: "lv";
  readonly Lithuanian: "lt";
  readonly Macedonian: "mk";
  readonly Malay: "ms";
  readonly Malayalam: "ml";
  readonly Marathi: "mr";
  readonly Norwegian: "nb";
  readonly Persian: "fa";
  readonly Polish: "pl";
  readonly Portuguese_BR: "pt_BR";
  readonly Portuguese_POR: "pt_PT";
  readonly Punjabi: "pa";
  readonly Romanian: "ro";
  readonly Russian: "ru";
  readonly Serbian: "sr";
  readonly Slovak: "sk";
  readonly Slovenian: "sl";
  readonly Spanish: "es";
  readonly Spanish_ARG: "es_AR";
  readonly Spanish_SPA: "es_ES";
  readonly Spanish_MEX: "es_MX";
  readonly Swahili: "sw";
  readonly Swedish: "sv";
  readonly Tamil: "ta";
  readonly Telugu: "te";
  readonly Thai: "th";
  readonly Turkish: "tr";
  readonly Ukrainian: "uk";
  readonly Urdu: "ur";
  readonly Uzbek: "uz";
  readonly Vietnamese: "vi";
  readonly Zulu: "zu";
};
type LanguagesType = (typeof Languages)[keyof typeof Languages];
declare const DataLocalizationRegion: {
  readonly AU: "AU";
  readonly ID: "ID";
  readonly IN: "IN";
  readonly JP: "JP";
  readonly SG: "SG";
  readonly KR: "KR";
  readonly DE: "DE";
  readonly CH: "CH";
  readonly GB: "GB";
  readonly BR: "BR";
  readonly BH: "BH";
  readonly ZA: "ZA";
  readonly AE: "AE";
  readonly CA: "CA";
};
type DataLocalizationRegionType = (typeof DataLocalizationRegion)[keyof typeof DataLocalizationRegion];
//#endregion
//#region src/types/httpsClient.d.ts
type ResponseHeaderValue = string | string[] | undefined;
type ResponseHeaders = Record<string, ResponseHeaderValue>;
type ResponseJSONBody = Record<string, unknown>;
declare class HttpsClientResponseClass {
  constructor(resp: Response);
  statusCode: () => number;
  headers: () => ResponseHeaders;
  rawResponse: () => Response;
  json: () => Promise<ResponseJSONBody>;
}
declare class HttpsClientClass {
  constructor();
  clearSockets: () => boolean;
  sendRequest: (host: string, path: string, method: HttpMethodsEnum, headers: HeadersInit, timeout: number, body?: BodyInit | null) => Promise<HttpsClientResponseClass>;
}
//#endregion
//#region src/types/logger.d.ts
interface LoggerInterface {
  log(...data: any[]): void;
  error(...data: any[]): void;
  warn(...data: any[]): void;
  info(...data: any[]): void;
  debug(...data: any[]): void;
}
//#endregion
//#region src/api/flow/types/common.d.ts
/**
 * Enum for Flow Status
 */
declare enum FlowStatusEnum {
  Draft = "DRAFT",
  Published = "PUBLISHED",
  Throttled = "THROTTLED",
  Blocked = "BLOCKED",
  Deprecated = "DEPRECATED"
}
/**
 * Enum for Flow Categories
 */
declare enum FlowCategoryEnum {
  SignUp = "SIGN_UP",
  SignIn = "SIGN_IN",
  AppointmentBooking = "APPOINTMENT_BOOKING",
  LeadGeneration = "LEAD_GENERATION",
  ContactUs = "CONTACT_US",
  CustomerSupport = "CUSTOMER_SUPPORT",
  Survey = "SURVEY",
  Other = "OTHER"
}
declare enum FlowActionEnum {
  INIT = "INIT",
  BACK = "BACK",
  DATA_EXCHANGE = "data_exchange"
}
/**
 * Enum for Flow Types in webhook handlers
 * Used to register handlers for specific flow events
 */
declare enum FlowTypeEnum {
  /** Health check/ping requests */
  Ping = "ping",
  /** Data exchange requests */
  Change = "data_exchange",
  /** Error notification requests */
  Error = "error",
  /** Match all flow action types */
  All = "*"
}
type FlowType = (typeof FlowTypeEnum)[keyof typeof FlowTypeEnum];
/**
 * Flow Validation Error Pointer
 */
interface FlowValidationErrorPointer {
  line_start: number;
  line_end: number;
  column_start: number;
  column_end: number;
  path: string;
}
/**
 * Flow Validation Error
 */
interface FlowValidationError {
  error: string;
  error_type: string;
  message: string;
  line_start: number;
  line_end: number;
  column_start: number;
  column_end: number;
  pointers: FlowValidationErrorPointer[];
}
/**
 * Flow Item
 */
interface Flow {
  id: string;
  name: string;
  status: FlowStatusEnum;
  categories: FlowCategoryEnum[];
  validation_errors: FlowValidationError[];
}
/**
 * Pagination Cursors
 */
interface PaginationCursors {
  before: string;
  after: string;
}
/**
 * Pagination Object
 */
interface Pagination {
  cursors: PaginationCursors;
}
/**
 * Flows List Response
 */
interface FlowsListResponse {
  data: Flow[];
  paging: Pagination;
}
/**
 * Flow Asset
 */
interface FlowAsset {
  name: string;
  asset_type: string;
  download_url: string;
}
/**
 * Flow Assets Response
 */
interface FlowAssetsResponse {
  data: FlowAsset[];
  paging: Pagination;
}
/**
 * Flow Preview
 */
interface FlowPreview {
  preview_url: string;
  expires_at: string;
}
/**
 * Flow Preview Response
 */
interface FlowPreviewResponse {
  preview: FlowPreview;
  id: string;
}
/**
 * Flow Migration Result
 */
interface FlowMigrationResult {
  source_name: string;
  source_id: string;
  migrated_id: string;
}
/**
 * Flow Migration Failure
 */
interface FlowMigrationFailure {
  source_name: string;
  error_code: string;
  error_message: string;
}
/**
 * Create Flow Response
 */
interface CreateFlowResponse {
  id: string;
  success: boolean;
  validation_errors?: FlowValidationError[];
}
/**
 * Update Flow Response
 */
interface UpdateFlowResponse {
  success: boolean;
  validation_errors?: FlowValidationError[];
}
/**
 * Flow Migration Response
 */
interface FlowMigrationResponse {
  migrated_flows: FlowMigrationResult[];
  failed_flows: FlowMigrationFailure[];
}
/**
 * Validate Flow JSON Response
 */
interface ValidateFlowJsonResponse {
  valid: boolean;
  success: boolean;
  validation_errors?: FlowValidationError[];
}
/**
 * WhatsApp Flow Endpoint - Encrypted Request Payload
 * Represents the raw encrypted data received from WhatsApp
 */
interface FlowEncryptedRequestPayload {
  encrypted_aes_key: string;
  encrypted_flow_data: string;
  initial_vector: string;
}
/**
 * WhatsApp Flow Endpoint - Decrypted Request Response
 * Represents the successfully decrypted data and encryption keys
 */
interface FlowDecryptedRequestResponse {
  decryptedBody: any;
  aesKeyBuffer: Buffer;
  initialVectorBuffer: Buffer;
}
/**
 * WhatsApp Flow Endpoint - HTTP Request with Body
 * Represents an HTTP request with the encrypted payload
 */
interface FlowHttpRequest extends IncomingMessage {
  body: FlowEncryptedRequestPayload;
  headers: IncomingHttpHeaders;
}
/**
 * WhatsApp Flow Endpoint - Health Check Request
 * Represents the structure of a health check request
 */
interface FlowHealthCheckRequest {
  action: 'ping';
  version: '3.0';
}
/**
 * WhatsApp Flow Endpoint - Health Check Response
 * The expected response structure for health check requests
 */
interface FlowHealthCheckResponse {
  data: {
    status: 'active';
  };
}
/**
 * WhatsApp Flow Endpoint - Data Exchange Request
 * Represents the structure of a data exchange request
 */
interface FlowDataExchangeRequest {
  version: '3.0';
  action: FlowActionEnum;
  screen: string;
  flow_token: string;
  data?: Record<string, any> & {
    error_message?: string;
  };
}
/**
 * WhatsApp Flow Endpoint - Data Exchange Response
 * The expected response structure for data exchange requests
 */
interface FlowDataExchangeResponse {
  screen?: string;
  data?: Record<string, any | {
    error_message?: string;
  }>;
}
/**
 * WhatsApp Flow Endpoint - Success Screen Response
 * The expected response structure for success screen requests
 */
interface FlowSuccessScreenResponse {
  screen: 'SUCCESS';
  data: {
    extension_message_response?: {
      params?: {
        flow_token: string;
        [key: string]: string;
      };
    };
  };
}
/**
 * WhatsApp Flow Endpoint - Error Notification Request
 * Represents the structure of an error notification request
 */
interface FlowErrorNotificationRequest {
  version: '3.0';
  action: Exclude<FlowActionEnum, FlowActionEnum.BACK>;
  screen: string;
  flow_token: string;
  data: {
    error: string;
    error_message: string;
  };
}
/**
 * WhatsApp Flow Endpoint - Error Notification Response
 * The expected response structure for error notification requests
 */
interface FlowErrorNotificationResponse {
  acknowledged: boolean;
}
/**
 * WhatsApp Flow Endpoint - Comprehensive Request Object
 * A combined type that includes all possible fields from different request types
 * with all fields being optional for flexibility
 */
interface FlowEndpointRequest {
  version?: '3.0';
  action?: 'ping' | FlowActionEnum;
  screen?: string;
  flow_token?: string;
  data?: Record<string, any> & {
    error_key?: string;
    error_message?: string;
  };
}
/**
 * WhatsApp Flow Endpoint - Response
 * Union type for all possible response types from a Flow endpoint
 */
type FlowEndpointResponse = FlowHealthCheckResponse | FlowDataExchangeResponse | FlowErrorNotificationResponse | FlowSuccessScreenResponse;
interface FlowClass {
  /**
   * List Flows
   *
   * @param wabaId - The WABA ID
   * @returns Promise with the list of flows
   */
  listFlows(wabaId: string): Promise<FlowsListResponse>;
  /**
   * Create Flow
   *
   * @param wabaId - The WABA ID
   * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
   * @returns Promise with the created flow ID
   */
  createFlow(wabaId: string, data: {
    name: string;
    categories?: FlowCategoryEnum[];
    endpoint_uri?: string;
    clone_flow_id?: string;
    flow_json?: string;
    publish?: boolean;
  }): Promise<CreateFlowResponse>;
  /**
   * Get Flow
   *
   * @param flowId - The flow ID
   * @param fields - Optional fields to return
   * @param dateFormat - Optional date format
   * @returns Promise with the flow details
   */
  getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
  /**
   * Update Flow Metadata
   *
   * @param flowId - The flow ID
   * @param data - The flow metadata to update
   * @returns Promise with the success status
   */
  updateFlowMetadata(flowId: string, data: {
    name?: string;
    categories?: FlowCategoryEnum[];
    endpoint_uri?: string;
    application_id?: string;
  }): Promise<ResponseSuccess>;
  /**
   * Delete Flow
   *
   * @param flowId - The flow ID
   * @returns Promise with the success status
   */
  deleteFlow(flowId: string): Promise<ResponseSuccess>;
  /**
   * List Assets (Get Flow JSON URL)
   *
   * @param flowId - The flow ID
   * @returns Promise with the list of assets
   */
  listAssets(flowId: string): Promise<FlowAssetsResponse>;
  /**
   * Update Flow JSON
   *
   * @param flowId - The flow ID
   * @param data - The asset data including asset_type, file, and name
   * @returns Promise with the success status and validation errors
   */
  updateFlowJson(flowId: string, data: {
    file: Blob | Buffer | object;
    name?: string;
  }): Promise<UpdateFlowResponse>;
  /**
   * Validate Flow JSON by attempting an update without publishing.
   * This is a convenience method; the API doesn't have a dedicated validation endpoint.
   *
   * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).
   * @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.
   * @returns Promise indicating if the JSON is valid and includes validation errors if any.
   */
  validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
  /**
   * Publish Flow
   *
   * @param flowId - The flow ID
   * @returns Promise with the success status
   */
  publishFlow(flowId: string): Promise<ResponseSuccess>;
  /**
   * Deprecate Flow
   *
   * @param flowId - The flow ID
   * @returns Promise with the success status
   */
  deprecateFlow(flowId: string): Promise<ResponseSuccess>;
  /**
   * Migrate Flows
   *
   * @param wabaId - The destination WABA ID
   * @param data - The migration data including source_waba_id and optional source_flow_names
   * @returns Promise with migration results
   */
  migrateFlows(wabaId: string, data: {
    source_waba_id: string;
    source_flow_names?: string[];
  }): Promise<FlowMigrationResponse>;
}
//#endregion
//#region src/api/flow/FlowApi.d.ts
/**
 * API for managing WhatsApp Flows.
 *
 * WhatsApp Flows allow businesses to build structured, interactive experiences
 * within WhatsApp conversations. Flows can be used for appointment booking,
 * lead generation, customer support, surveys, and more.
 *
 * This API allows you to:
 * - List flows for a WhatsApp Business Account (`GET /{WABA_ID}/flows`)
 * - Create new flows (`POST /{WABA_ID}/flows`)
 * - Get flow details and previews (`GET /{FLOW_ID}`)
 * - Update flow metadata (`POST /{FLOW_ID}`)
 * - Delete draft flows (`DELETE /{FLOW_ID}`)
 * - List flow assets / download Flow JSON (`GET /{FLOW_ID}/assets`)
 * - Upload or update Flow JSON (`POST /{FLOW_ID}/assets`)
 * - Publish flows (`POST /{FLOW_ID}/publish`)
 * - Deprecate flows (`POST /{FLOW_ID}/deprecate`)
 * - Migrate flows between WABAs (`POST /{DESTINATION_WABA_ID}/migrate_flows`)
 *
 * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi | Flows API Reference}
 * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/flows/ | WhatsApp Flows Documentation}
 */
declare class FlowApi extends BaseAPI implements FlowClass {
  private appendFormValue;
  /**
   * List all flows belonging to a WhatsApp Business Account.
   *
   * Retrieves a paginated list of all flows associated with the given WABA ID,
   * including their IDs, names, statuses, and categories.
   *
   * @param wabaId - The WhatsApp Business Account ID to list flows for.
   * @returns A promise that resolves with the list of flows and pagination info.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#list | List Flows}
   *
   * @example
   * ```ts
   * const response = await whatsappClient.flow.listFlows('WABA_ID');
   * for (const flow of response.data) {
   *     console.log(flow.id, flow.name, flow.status);
   * }
   * ```
   */
  listFlows(wabaId: string): Promise<FlowsListResponse>;
  /**
   * Create a new flow for a WhatsApp Business Account.
   *
   * Creates a new flow in DRAFT status. You can optionally clone an existing flow,
   * provide initial Flow JSON, and even publish the flow immediately upon creation.
   *
   * @param wabaId - The WhatsApp Business Account ID to create the flow under.
   * @param data - The flow creation parameters.
   * @param data.name - The name of the flow.
   * @param data.categories - Optional array of flow categories (e.g., LEAD_GENERATION, APPOINTMENT_BOOKING).
   * @param data.endpoint_uri - Optional URI for the flow endpoint that will receive flow action payloads.
   * @param data.clone_flow_id - Optional ID of an existing flow to clone.
   * @param data.flow_json - Optional Flow JSON definition as a string.
   * @param data.publish - Optional flag to publish the flow immediately after creation.
   * @returns A promise that resolves with the created flow ID and any validation errors.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#create | Create Flow}
   *
   * @example
   * ```ts
   * const result = await whatsappClient.flow.createFlow('WABA_ID', {
   *     name: 'Appointment Booking',
   *     categories: ['APPOINTMENT_BOOKING'],
   *     endpoint_uri: 'https://example.com/flow-endpoint',
   * });
   * console.log(result.id); // New flow ID
   * ```
   */
  createFlow(wabaId: string, data: {
    name: string;
    categories?: FlowCategoryEnum[];
    endpoint_uri?: string;
    clone_flow_id?: string;
    flow_json?: string;
    publish?: boolean;
  }): Promise<CreateFlowResponse>;
  /**
   * Get details of a specific flow.
   *
   * Retrieves flow information such as name, status, categories, JSON validation errors,
   * and optionally a preview URL. Use the `fields` parameter to request specific fields
   * or the preview endpoint.
   *
   * @param flowId - The ID of the flow to retrieve.
   * @param fields - Optional comma-separated list of fields to return (e.g., `'name,status,preview.invalidate(false)'`).
   * @param dateFormat - Optional date format string for date fields in the response.
   * @returns A promise that resolves with the flow details or preview response.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#details | Get Flow Details}
   *
   * @example
   * ```ts
   * // Get all flow details
   * const flow = await whatsappClient.flow.getFlow('FLOW_ID');
   * console.log(flow.name, flow.status);
   *
   * // Get specific fields only
   * const flow = await whatsappClient.flow.getFlow('FLOW_ID', 'name,status,categories');
   * ```
   */
  getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
  /**
   * Get a preview URL for a flow.
   *
   * Generates a shareable preview URL that allows viewing the flow without publishing it.
   * The preview can optionally be invalidated to force generation of a fresh URL.
   *
   * @param flowId - The ID of the flow to preview.
   * @param invalidate - If `true`, invalidates the existing preview and generates a new one. Defaults to `false`.
   * @returns A promise that resolves with the flow preview details including the preview URL.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#details | Get Flow Preview}
   *
   * @example
   * ```ts
   * // Get existing preview URL
   * const preview = await whatsappClient.flow.getFlowPreview('FLOW_ID');
   * console.log(preview.preview.preview_url);
   *
   * // Force a new preview URL
   * const freshPreview = await whatsappClient.flow.getFlowPreview('FLOW_ID', true);
   * ```
   */
  getFlowPreview(flowId: string, invalidate?: boolean): Promise<FlowPreviewResponse>;
  /**
   * Update the metadata of an existing flow.
   *
   * Allows updating a flow's name, categories, endpoint URI, or associated application ID.
   * The flow must be in DRAFT status to update certain fields.
   *
   * @param flowId - The ID of the flow to update.
   * @param data - The metadata fields to update.
   * @param data.name - Optional new name for the flow.
   * @param data.categories - Optional new categories for the flow.
   * @param data.endpoint_uri - Optional new endpoint URI for flow action payloads.
   * @param data.application_id - Optional application ID to associate with the flow.
   * @returns A promise that resolves with a success indicator.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#update | Update Flow}
   *
   * @example
   * ```ts
   * await whatsappClient.flow.updateFlowMetadata('FLOW_ID', {
   *     name: 'Updated Flow Name',
   *     endpoint_uri: 'https://example.com/new-endpoint',
   * });
   * ```
   */
  updateFlowMetadata(flowId: string, data: {
    name?: string;
    categories?: FlowCategoryEnum[];
    endpoint_uri?: string;
    application_id?: string;
  }): Promise<ResponseSuccess>;
  /**
   * Delete a flow.
   *
   * Permanently deletes a flow. Only flows in DRAFT status can be deleted.
   * Published or deprecated flows cannot be deleted.
   *
   * @param flowId - The ID of the flow to delete.
   * @returns A promise that resolves with a success indicator.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#delete | Delete Flow}
   *
   * @example
   * ```ts
   * await whatsappClient.flow.deleteFlow('FLOW_ID');
   * ```
   */
  deleteFlow(flowId: string): Promise<ResponseSuccess>;
  /**
   * List assets associated with a flow.
   *
   * Retrieves the list of assets (e.g., Flow JSON) associated with the flow.
   * The response includes download URLs for each asset.
   *
   * @param flowId - The ID of the flow to list assets for.
   * @returns A promise that resolves with the list of assets including download URLs.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#asset-list | List Flow Assets}
   *
   * @example
   * ```ts
   * const assets = await whatsappClient.flow.listAssets('FLOW_ID');
   * for (const asset of assets.data) {
   *     console.log(asset.name, asset.download_url);
   * }
   * ```
   */
  listAssets(flowId: string): Promise<FlowAssetsResponse>;
  /**
   * Upload or update the Flow JSON for a flow.
   *
   * Uploads a Flow JSON definition to the flow's assets. The JSON defines the screens,
   * layout, and logic of the flow. Accepts a Buffer, plain JSON object, or Blob.
   *
   * @param flowId - The ID of the flow to update.
   * @param data - Object containing the file data and optional name.
   * @param data.file - The Flow JSON content as a Buffer, JSON object, or Blob.
   * @param data.name - Optional name for the asset. Defaults to `'flow.json'`.
   * @returns A promise that resolves with the upload status and any validation errors.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#asset-upload | Upload Flow JSON}
   *
   * @example
   * ```ts
   * // Upload from a JSON object
   * const result = await whatsappClient.flow.updateFlowJson('FLOW_ID', {
   *     file: {
   *         version: '5.0',
   *         screens: [{ id: 'WELCOME', layout: { type: 'SingleColumnLayout', children: [] } }],
   *     },
   * });
   *
   * // Upload from a Buffer
   * const jsonBuffer = Buffer.from(JSON.stringify(flowDefinition));
   * await whatsappClient.flow.updateFlowJson('FLOW_ID', { file: jsonBuffer });
   * ```
   */
  updateFlowJson(flowId: string, data: {
    file: Blob | Buffer | object;
    name?: string;
  }): Promise<UpdateFlowResponse>;
  /**
   * Validate Flow JSON without publishing.
   *
   * This is a convenience method that uploads the Flow JSON and checks for validation
   * errors. The API does not have a dedicated validation endpoint, so this method
   * performs an update and inspects the response for errors.
   *
   * @param flowId - The ID of the flow to validate against (must exist, can be in DRAFT status).
   * @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.
   * @returns A promise that resolves with validation results, including a `valid` boolean
   *          and any `validation_errors` found.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#asset-upload | Upload Flow JSON (validation)}
   *
   * @example
   * ```ts
   * const result = await whatsappClient.flow.validateFlowJson('FLOW_ID', {
   *     version: '5.0',
   *     screens: [{ id: 'WELCOME', layout: { type: 'SingleColumnLayout', children: [] } }],
   * });
   * if (result.valid) {
   *     console.log('Flow JSON is valid');
   * } else {
   *     console.error('Validation errors:', result.validation_errors);
   * }
   * ```
   */
  validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
  /**
   * Publish a flow.
   *
   * Transitions a flow from DRAFT status to PUBLISHED. Once published, the flow
   * can be sent to users in WhatsApp messages. A published flow's JSON can no longer
   * be updated.
   *
   * @param flowId - The ID of the flow to publish.
   * @returns A promise that resolves with a success indicator.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#publish | Publish Flow}
   *
   * @example
   * ```ts
   * await whatsappClient.flow.publishFlow('FLOW_ID');
   * ```
   */
  publishFlow(flowId: string): Promise<ResponseSuccess>;
  /**
   * Deprecate a flow.
   *
   * Transitions a flow from PUBLISHED status to DEPRECATED. A deprecated flow
   * can no longer be sent to users but existing sessions will continue to work.
   * This action cannot be undone.
   *
   * @param flowId - The ID of the flow to deprecate.
   * @returns A promise that resolves with a success indicator.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#deprecate | Deprecate Flow}
   *
   * @example
   * ```ts
   * await whatsappClient.flow.deprecateFlow('FLOW_ID');
   * ```
   */
  deprecateFlow(flowId: string): Promise<ResponseSuccess>;
  /**
   * Migrate flows between WhatsApp Business Accounts.
   *
   * Copies flows from a source WABA to a destination WABA. You can optionally
   * specify which flows to migrate by name. Migrated flows are created in DRAFT
   * status in the destination WABA.
   *
   * @param destinationWabaId - The ID of the destination WhatsApp Business Account.
   * @param data - The migration parameters.
   * @param data.source_waba_id - The ID of the source WhatsApp Business Account to migrate flows from.
   * @param data.source_flow_names - Optional array of flow names to migrate. If omitted, all flows are migrated.
   * @returns A promise that resolves with migration results including successes and failures.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi#migrate | Migrate Flows}
   *
   * @example
   * ```ts
   * // Migrate all flows from one WABA to another
   * const result = await whatsappClient.flow.migrateFlows('DEST_WABA_ID', {
   *     source_waba_id: 'SOURCE_WABA_ID',
   * });
   *
   * // Migrate specific flows by name
   * const result = await whatsappClient.flow.migrateFlows('DEST_WABA_ID', {
   *     source_waba_id: 'SOURCE_WABA_ID',
   *     source_flow_names: ['Appointment Booking', 'Lead Gen Form'],
   * });
   * console.log(result.migrated_flows, result.failed_flows);
   * ```
   */
  migrateFlows(destinationWabaId: string, data: {
    source_waba_id: string;
    source_flow_names?: string[];
  }): Promise<FlowMigrationResponse>;
}
//#endregion
//#region src/api/groups/GroupsApi.d.ts
/**
 * API for managing WhatsApp Groups.
 *
 * This API allows you to:
 * - Create and delete groups
 * - Approve/reject join requests
 * - Manage group invite links
 * - Remove participants
 * - Update group settings
 * - Fetch group metadata and active groups
 *
 * Endpoints covered:
 * - `POST /{PHONE_NUMBER_ID}/groups` - Create a new group
 * - `DELETE /{GROUP_ID}` - Delete a group
 * - `GET /{GROUP_ID}` - Get group info
 * - `GET /{PHONE_NUMBER_ID}/groups` - List active groups
 * - `GET /{GROUP_ID}/invite_link` - Get group invite link
 * - `POST /{GROUP_ID}/invite_link` - Reset group invite link
 * - `GET /{GROUP_ID}/join_requests` - Get pending join requests
 * - `POST /{GROUP_ID}/join_requests` - Approve join requests
 * - `DELETE /{GROUP_ID}/join_requests` - Reject join requests
 * - `DELETE /{GROUP_ID}/participants` - Remove participants
 * - `POST /{GROUP_ID}` - Update group settings
 *
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
 */
declare class GroupsApi extends BaseAPI implements GroupsClass {
  /**
   * Create a new WhatsApp group.
   *
   * @param params - The group creation parameters.
   * @param params.subject - The name/subject of the group.
   * @param params.description - Optional description for the group.
   * @param params.join_approval_mode - Optional join approval mode setting.
   * @returns The created group response with group ID.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  createGroup(params: GroupCreateRequest): Promise<GroupCreateResponse>;
  /**
   * Delete a WhatsApp group.
   *
   * @param groupId - The ID of the group to delete.
   * @returns A success response confirming deletion.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  deleteGroup(groupId: string): Promise<ResponseSuccess>;
  /**
   * Retrieve metadata and information about a specific group.
   *
   * @param groupId - The ID of the group to retrieve.
   * @param fields - Optional fields to include in the response (e.g., subject, description, participants).
   * @returns The group information including metadata and requested fields.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  getGroupInfo(groupId: string, fields?: GroupInfoFieldsParam): Promise<GroupInfoResponse>;
  /**
   * List all active groups for the phone number with optional pagination.
   *
   * @param params - Optional pagination parameters.
   * @param params.limit - Maximum number of groups to return.
   * @param params.after - Cursor for forward pagination.
   * @param params.before - Cursor for backward pagination.
   * @returns A paginated list of active groups.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  getActiveGroups(params?: GroupListParams): Promise<GroupListResponse>;
  /**
   * Get the current invite link for a group.
   *
   * @param groupId - The ID of the group.
   * @returns The group invite link.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  getGroupInviteLink(groupId: string): Promise<GroupInviteLinkResponse>;
  /**
   * Create a group invite link.
   *
   * @param groupId - The ID of the group.
   * @returns The group invite link.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  createGroupInviteLink(groupId: string): Promise<GroupInviteLinkResponse>;
  /**
   * Reset and regenerate the invite link for a group, invalidating the previous link.
   *
   * @param groupId - The ID of the group.
   * @returns The new group invite link.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  resetGroupInviteLink(groupId: string): Promise<GroupInviteLinkResponse>;
  /**
   * Delete the current invite link for a group.
   *
   * @param groupId - The ID of the group.
   * @returns A success response confirming deletion.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  deleteGroupInviteLink(groupId: string): Promise<ResponseSuccess>;
  /**
   * Get pending join requests for a group.
   *
   * @param groupId - The ID of the group.
   * @returns A list of pending join requests.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  getJoinRequests(groupId: string): Promise<GroupJoinRequestsResponse>;
  /**
   * Approve one or more pending join requests for a group.
   *
   * @param groupId - The ID of the group.
   * @param joinRequestIds - Array of join request IDs to approve.
   * @returns The result of the approval action.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  approveJoinRequests(groupId: string, joinRequestIds: string[]): Promise<GroupJoinRequestsActionResponse>;
  /**
   * Reject one or more pending join requests for a group.
   *
   * @param groupId - The ID of the group.
   * @param joinRequestIds - Array of join request IDs to reject.
   * @returns The result of the rejection action.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  rejectJoinRequests(groupId: string, joinRequestIds: string[]): Promise<GroupJoinRequestsActionResponse>;
  /**
   * Add one or more participants to a group.
   *
   * @param groupId - The ID of the group.
   * @param participants - Array of user WhatsApp IDs to add to the group.
   * @returns A success response confirming the addition.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  addParticipants(groupId: string, participants: string[]): Promise<ResponseSuccess>;
  /**
   * Remove one or more participants from a group.
   *
   * @param groupId - The ID of the group.
   * @param participants - Array of user WhatsApp IDs to remove from the group.
   * @returns A success response confirming removal.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  removeParticipants(groupId: string, participants: string[]): Promise<ResponseSuccess>;
  /**
   * Update group settings such as subject, description, or profile picture.
   *
   * @param groupId - The ID of the group to update.
   * @param params - The settings to update.
   * @param params.subject - Optional new group subject/name.
   * @param params.description - Optional new group description.
   * @param params.profilePictureFile - Optional profile picture as a Buffer or Blob.
   * @returns The updated group settings response.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  updateGroupSettings(groupId: string, params: UpdateGroupSettingsRequest): Promise<GroupSettingsResponse>;
}
//#endregion
//#region src/api/marketingMessages/MarketingMessagesApi.d.ts
/**
 * API for WhatsApp Marketing Messages.
 *
 * Provides methods to send marketing template messages to WhatsApp users,
 * with support for message activity sharing opt-in.
 *
 * Endpoints covered:
 * - `POST /{PHONE_NUMBER_ID}/marketing_messages` - Send a marketing template message
 *
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/marketing-messages/send-marketing-messages/
 */
declare class MarketingMessagesApi extends BaseAPI implements MarketingMessagesClass {
  private readonly endpoint;
  /**
   * Send a marketing template message to a WhatsApp user.
   *
   * @param params - The marketing message request parameters.
   * @param params.to - The recipient's WhatsApp phone number.
   * @param params.template - The template configuration (name, language, components).
   * @param params.message_activity_sharing - Optional flag to enable message activity sharing.
   * @param params.product_policy - Optional product policy for marketing messages.
   * @returns The messages response with message ID and status.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/marketing-messages/send-marketing-messages/
   */
  sendTemplateMessage(params: MarketingMessageRequest): Promise<MessagesResponse>;
}
//#endregion
//#region src/api/media/MediaApi.d.ts
/**
 * WhatsApp Media API client for uploading, retrieving, downloading, and deleting media.
 *
 * Media uploaded to the WhatsApp API can be used in messages (images, audio, video,
 * documents, stickers). Each media object is identified by a unique media ID.
 *
 * **Covered endpoints:**
 * - `GET /{MEDIA_ID}` - Retrieve media info ({@link MediaApi.getMediaById})
 * - `POST /{PHONE_NUMBER_ID}/media` - Upload media ({@link MediaApi.uploadMedia})
 * - `DELETE /{MEDIA_ID}` - Delete media ({@link MediaApi.deleteMedia})
 * - `GET {MEDIA_URL}` - Download media content ({@link MediaApi.downloadMedia})
 *
 * **Supported media types and size limits:**
 * | Type | MIME Types | Max Size |
 * |------|-----------|----------|
 * | Audio | audio/aac, audio/mp4, audio/mpeg, audio/amr, audio/ogg | 16 MB |
 * | Document | Various (PDF, DOC, DOCX, PPT, XLS, etc.) | 100 MB |
 * | Image | image/jpeg, image/png | 5 MB |
 * | Sticker | image/webp | 100 KB (animated), 500 KB (static) |
 * | Video | video/mp4, video/3gp | 16 MB |
 *
 * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media | WhatsApp Media API Reference}
 * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/business-phone-numbers/media/ | WhatsApp Media Documentation}
 *
 * @example
 * ```ts
 * const client = new WhatsApp({ accessToken: '...', phoneNumberId: '...' });
 *
 * // Upload, send, then clean up
 * const { id } = await client.media.uploadMedia(file);
 * await client.messages.image({ body: { id }, to: '1234567890' });
 * await client.media.deleteMedia(id);
 * ```
 */
declare class MediaApi extends BaseAPI implements MediaClass {
  private readonly endpoint;
  /**
   * Retrieves media information by media ID.
   *
   * Returns metadata about the media object including its URL, MIME type, file size,
   * and SHA-256 hash. The returned URL can be used with {@link MediaApi.downloadMedia}
   * to fetch the actual media content.
   *
   * **Endpoint:** `GET /{MEDIA_ID}`
   *
   * @param mediaId - The unique identifier of the media to retrieve
   * @returns A promise resolving to the media metadata including `url`, `mime_type`, `sha256`, and `file_size`
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#get-media-id | Get Media ID Reference}
   *
   * @example
   * ```ts
   * const mediaInfo = await client.media.getMediaById('media_id_123');
   * console.log(mediaInfo.url);       // URL to download the media
   * console.log(mediaInfo.mime_type);  // e.g., "image/jpeg"
   * console.log(mediaInfo.file_size);  // size in bytes
   * ```
   */
  getMediaById(mediaId: string): Promise<MediaResponse>;
  /**
   * Uploads a media file to the WhatsApp Cloud API.
   *
   * The uploaded media is assigned a unique media ID that can be used to send
   * messages containing that media. Media is automatically encrypted and stored
   * on Meta's servers.
   *
   * **Endpoint:** `POST /{PHONE_NUMBER_ID}/media`
   *
   * @param file - The `File` object to upload. The `type` property must match a supported MIME type.
   * @param messagingProduct - The messaging product identifier (defaults to `'whatsapp'`)
   * @returns A promise resolving to the upload response containing the assigned `id` (media ID)
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#upload-media | Upload Media Reference}
   *
   * @example
   * ```ts
   * const file = new File([buffer], 'image.jpg', { type: 'image/jpeg' });
   * const { id } = await client.media.uploadMedia(file);
   * // Use the media ID to send an image message
   * await client.messages.image({ body: { id }, to: '1234567890' });
   * ```
   */
  uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
  /**
   * Deletes a media file from WhatsApp servers.
   *
   * Once deleted, the media ID can no longer be used in messages. Any messages
   * already sent with this media will continue to display the media.
   *
   * **Endpoint:** `DELETE /{MEDIA_ID}`
   *
   * @param mediaId - The unique identifier of the media to delete
   * @returns A promise resolving to a success response (`{ success: true }`)
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#delete-media | Delete Media Reference}
   *
   * @example
   * ```ts
   * const result = await client.media.deleteMedia('media_id_123');
   * console.log(result.success); // true
   * ```
   */
  deleteMedia(mediaId: string): Promise<ResponseSuccess>;
  /**
   * Downloads media content from a WhatsApp media URL.
   *
   * Use {@link MediaApi.getMediaById} first to obtain the media URL, then pass it
   * to this method to download the actual file content. The returned URL from
   * `getMediaById` is only valid for a limited time.
   *
   * **Endpoint:** `GET {MEDIA_URL}`
   *
   * @param mediaUrl - The media download URL obtained from {@link MediaApi.getMediaById}
   * @returns A promise resolving to a `Blob` containing the raw media data
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media | Download Media Reference}
   *
   * @example
   * ```ts
   * // First get the media URL, then download it
   * const mediaInfo = await client.media.getMediaById('media_id_123');
   * const blob = await client.media.downloadMedia(mediaInfo.url);
   * ```
   */
  downloadMedia(mediaUrl: string): Promise<Blob>;
}
//#endregion
//#region src/api/messageHistory/types/common.d.ts
type MessageHistoryFieldsParam = string[] | string;
type MessageHistoryListParams = {
  fields?: MessageHistoryFieldsParam;
  message_id?: string;
  start_time?: string | number;
  end_time?: string | number;
  limit?: number;
  after?: string;
  before?: string;
};
type MessageHistoryEventListParams = {
  status_filter?: 'SENT' | 'DELIVERED' | 'READ' | 'FAILED' | (string & {});
  fields?: MessageHistoryFieldsParam;
  limit?: number;
  after?: string;
  before?: string;
};
type MessageHistoryItem = Record<string, unknown>;
type MessageHistoryResponse<T = MessageHistoryItem> = {
  data: T[];
  paging?: Paging;
  summary?: Record<string, unknown>;
};
interface MessageHistoryClass {
  getMessageHistory(params?: MessageHistoryListParams): Promise<MessageHistoryResponse>;
  getMessageHistoryEvents(messageHistoryId: string, params?: MessageHistoryEventListParams): Promise<MessageHistoryResponse>;
}
//#endregion
//#region src/api/messageHistory/MessageHistoryApi.d.ts
declare class MessageHistoryApi extends BaseAPI implements MessageHistoryClass {
  private resolveFields;
  getMessageHistory(params?: MessageHistoryListParams): Promise<MessageHistoryResponse>;
  getMessageHistoryEvents(messageHistoryId: string, params?: MessageHistoryEventListParams): Promise<MessageHistoryResponse>;
}
//#endregion
//#region src/api/messages/MessageApi.d.ts
/**
 * Maps each message type to its appropriate payload type.
 *
 * This conditional type resolves the correct payload interface based on the {@link MessageTypesEnum} value,
 * ensuring type-safe message construction at compile time.
 */
type MessagePayloadType<T extends MessageTypesEnum> = T extends MessageTypesEnum.Audio ? AudioMediaObject : T extends MessageTypesEnum.Contacts ? ContactObject[] : T extends MessageTypesEnum.Document ? DocumentMediaObject : T extends MessageTypesEnum.Image ? ImageMediaObject : T extends MessageTypesEnum.Interactive ? InteractiveObject : T extends MessageTypesEnum.Location ? LocationObject : T extends MessageTypesEnum.Template ? MessageTemplateObject<ComponentTypesEnum> : T extends MessageTypesEnum.Sticker ? StickerMediaObject : T extends MessageTypesEnum.Text ? TextObject : T extends MessageTypesEnum.Video ? VideoMediaObject : T extends MessageTypesEnum.Reaction ? {
  message_id: string;
  emoji: string;
} : never;
/**
 * WhatsApp Messages API client for sending various message types.
 *
 * Provides methods to send text, media, interactive, template, location, contact,
 * reaction, and status messages through the WhatsApp Cloud API.
 *
 * **Endpoint:** `POST /{PHONE_NUMBER_ID}/messages`
 *
 * **Covered operations:**
 * - {@link MessagesApi.text | text} - Send plain text messages
 * - {@link MessagesApi.audio | audio} - Send audio messages
 * - {@link MessagesApi.image | image} - Send image messages
 * - {@link MessagesApi.video | video} - Send video messages
 * - {@link MessagesApi.document | document} - Send document messages
 * - {@link MessagesApi.sticker | sticker} - Send sticker messages
 * - {@link MessagesApi.location | location} - Send location messages
 * - {@link MessagesApi.contacts | contacts} - Send contact card(s)
 * - {@link MessagesApi.template | template} - Send template messages
 * - {@link MessagesApi.interactive | interactive} - Send interactive messages (generic)
 * - {@link MessagesApi.interactiveList | interactiveList} - Send list interactive messages
 * - {@link MessagesApi.interactiveCtaUrl | interactiveCtaUrl} - Send CTA URL interactive messages
 * - {@link MessagesApi.interactiveLocationRequest | interactiveLocationRequest} - Send location request messages
 * - {@link MessagesApi.interactiveAddressMessage | interactiveAddressMessage} - Send address message interactive messages
 * - {@link MessagesApi.interactiveReplyButtons | interactiveReplyButtons} - Send reply button interactive messages
 * - {@link MessagesApi.interactiveFlow | interactiveFlow} - Send flow interactive messages
 * - {@link MessagesApi.interactiveCarousel | interactiveCarousel} - Send carousel interactive messages
 * - {@link MessagesApi.reaction | reaction} - Send reaction emoji to a message
 * - {@link MessagesApi.status | status} - Update message status (read, typing)
 * - {@link MessagesApi.markAsRead | markAsRead} - Mark a message as read
 * - {@link MessagesApi.showTypingIndicator | showTypingIndicator} - Show typing indicator
 *
 * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages | WhatsApp Messages API Reference}
 * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/ | WhatsApp Messages Documentation}
 *
 * @example
 * ```ts
 * const client = new WhatsApp({ accessToken: '...', phoneNumberId: '...' });
 *
 * // Send a text message
 * await client.messages.text({ body: 'Hello!', to: '1234567890' });
 *
 * // Send an image
 * await client.messages.image({ body: { link: 'https://example.com/image.jpg' }, to: '1234567890' });
 * ```
 */
declare class MessagesApi extends BaseAPI implements MessagesClass {
  private readonly commonMethod;
  private readonly commonEndpoint;
  /**
   * Builds the request body for WhatsApp API messages.
   *
   * Constructs a properly formatted message payload including the messaging product,
   * recipient type, recipient phone number, message type, and optional reply context.
   *
   * @param type - The type of message to send (e.g., text, image, template)
   * @param payload - The message payload object matching the specified type
   * @param to - The recipient's phone number in international format (e.g., "1234567890")
   * @param replyMessageId - Optional message ID to reply to, setting the message context
   * @returns The formatted request body ready to be serialized and sent
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages | Messages API Reference}
   *
   * @example
   * ```ts
   * const body = messagesApi.bodyBuilder(
   *   MessageTypesEnum.Text,
   *   { body: 'Hello!' },
   *   '1234567890',
   * );
   * ```
   */
  bodyBuilder<T extends MessageTypesEnum>(type: T, payload: MessagePayloadType<T>, to: string, replyMessageId?: string, recipientType?: MessageRecipientType): MessageRequestBody<T>;
  /**
   * Sends a request to the WhatsApp Cloud API messages endpoint.
   *
   * Internal method that dispatches the serialized JSON body to
   * `POST /{PHONE_NUMBER_ID}/messages`.
   *
   * @param body - The serialized JSON request body to send
   * @returns A promise resolving to the WhatsApp messages API response containing the message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages | Messages API Reference}
   */
  private send;
  private sendEncrypted;
  /**
   * Sends an audio message via the WhatsApp Cloud API.
   *
   * The audio can be specified by a media ID (previously uploaded) or a public URL link.
   * Supported formats: audio/aac, audio/mp4, audio/mpeg, audio/amr, audio/ogg (with opus codec).
   * Maximum file size: 16 MB.
   *
   * @param params - The audio message parameters
   * @param params.body - Audio media object containing either `id` (media ID) or `link` (URL)
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#audio-object | Audio Object Reference}
   *
   * @example
   * ```ts
   * // Send audio by URL
   * await client.messages.audio({
   *   body: { link: 'https://example.com/audio.mp3' },
   *   to: '1234567890',
   * });
   *
   * // Send audio by media ID
   * await client.messages.audio({
   *   body: { id: 'media_id_123' },
   *   to: '1234567890',
   * });
   * ```
   */
  audio(params: MessageRequestParams<AudioMediaObject>): Promise<MessagesResponse>;
  /**
   * Sends one or more contact cards via the WhatsApp Cloud API.
   *
   * Contact messages allow sharing structured contact information including names,
   * phone numbers, email addresses, and more.
   *
   * @param params - The contact message parameters
   * @param params.body - Array of {@link m.ContactObject} containing contact details (name, phones, emails, etc.)
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#contacts-object | Contacts Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.contacts({
   *   body: [{
   *     name: { formatted_name: 'John Doe', first_name: 'John', last_name: 'Doe' },
   *     phones: [{ phone: '+1234567890', type: 'MOBILE' }],
   *   }],
   *   to: '1234567890',
   * });
   * ```
   */
  contacts(params: MessageRequestParams<ContactObject[]>): Promise<MessagesResponse>;
  /**
   * Sends a document message via the WhatsApp Cloud API.
   *
   * Documents can be specified by media ID or public URL. Supports various formats
   * including PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, and more.
   * Maximum file size: 100 MB.
   *
   * @param params - The document message parameters
   * @param params.body - Document media object containing `id` or `link`, and optional `caption` and `filename`
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#document-object | Document Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.document({
   *   body: {
   *     link: 'https://example.com/report.pdf',
   *     caption: 'Monthly Report',
   *     filename: 'report.pdf',
   *   },
   *   to: '1234567890',
   * });
   * ```
   */
  document(params: MessageRequestParams<DocumentMediaObject>): Promise<MessagesResponse>;
  /**
   * Sends an image message via the WhatsApp Cloud API.
   *
   * Images can be specified by media ID or public URL.
   * Supported formats: image/jpeg, image/png. Maximum file size: 5 MB.
   *
   * @param params - The image message parameters
   * @param params.body - Image media object containing `id` or `link`, and optional `caption`
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#image-object | Image Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.image({
   *   body: { link: 'https://example.com/photo.jpg', caption: 'Check this out!' },
   *   to: '1234567890',
   * });
   * ```
   */
  image(params: MessageRequestParams<ImageMediaObject>): Promise<MessagesResponse>;
  /**
   * Sends an interactive message via the WhatsApp Cloud API.
   *
   * Interactive messages allow rich user interactions such as lists, buttons, CTAs,
   * flows, location requests, address messages, and carousels. For type-specific
   * convenience methods, see {@link MessagesApi.interactiveList}, {@link MessagesApi.interactiveReplyButtons}, etc.
   *
   * @param params - The interactive message parameters
   * @param params.body - Interactive object containing the `type` and type-specific action/body/header/footer
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#interactive-object | Interactive Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.interactive({
   *   body: {
   *     type: 'button',
   *     body: { text: 'Choose an option' },
   *     action: {
   *       buttons: [
   *         { type: 'reply', reply: { id: 'btn1', title: 'Option 1' } },
   *         { type: 'reply', reply: { id: 'btn2', title: 'Option 2' } },
   *       ],
   *     },
   *   },
   *   to: '1234567890',
   * });
   * ```
   */
  interactive(params: MessageRequestParams<InteractiveObject>): Promise<MessagesResponse>;
  /**
   * Sends a location message via the WhatsApp Cloud API.
   *
   * Shares a geographic location with the recipient, displayed as a map pin.
   *
   * @param params - The location message parameters
   * @param params.body - Location object containing `latitude`, `longitude`, and optional `name` and `address`
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#location-object | Location Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.location({
   *   body: {
   *     latitude: 37.4220936,
   *     longitude: -122.083922,
   *     name: 'Googleplex',
   *     address: '1600 Amphitheatre Parkway, Mountain View, CA',
   *   },
   *   to: '1234567890',
   * });
   * ```
   */
  location(params: MessageRequestParams<LocationObject>): Promise<MessagesResponse>;
  /**
   * Sends a sticker message via the WhatsApp Cloud API.
   *
   * Stickers can be specified by media ID or public URL.
   * Supported format: image/webp. Maximum file size: 100 KB (animated), 500 KB (static).
   *
   * @param params - The sticker message parameters
   * @param params.body - Sticker media object containing `id` or `link`
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#sticker-object | Sticker Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.sticker({
   *   body: { link: 'https://example.com/sticker.webp' },
   *   to: '1234567890',
   * });
   * ```
   */
  sticker(params: MessageRequestParams<StickerMediaObject>): Promise<MessagesResponse>;
  /**
   * Sends a template message via the WhatsApp Cloud API.
   *
   * Template messages use pre-approved message templates and can include header,
   * body, and button components with dynamic parameters. Templates must be
   * approved before use.
   *
   * @param params - The template message parameters
   * @param params.body - Template object containing `name`, `language`, and optional `components`
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#template-object | Template Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.template({
   *   body: {
   *     name: 'hello_world',
   *     language: { code: 'en_US' },
   *     components: [
   *       { type: 'body', parameters: [{ type: 'text', text: 'John' }] },
   *     ],
   *   },
   *   to: '1234567890',
   * });
   * ```
   */
  template(params: MessageRequestParams<MessageTemplateObject<ComponentTypesEnum>>): Promise<MessagesResponse>;
  /**
   * Sends a text message via the WhatsApp Cloud API.
   *
   * Sends a plain text message. The `body` can be a string or a {@link m.TextObject}.
   * URL preview is enabled by default.
   *
   * @param params - The text message parameters
   * @param params.body - Message text as a string, or a {@link m.TextObject} with `body` and optional `preview_url`
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @param params.previewUrl - Whether to show a URL preview (defaults to `true`)
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#text-object | Text Object Reference}
   *
   * @example
   * ```ts
   * // Simple text
   * await client.messages.text({ body: 'Hello, World!', to: '1234567890' });
   *
   * // With URL preview disabled
   * await client.messages.text({
   *   body: { body: 'Visit https://example.com', preview_url: false },
   *   to: '1234567890',
   * });
   * ```
   */
  text(params: TextMessageParams): Promise<MessagesResponse>;
  /**
   * Sends a video message via the WhatsApp Cloud API.
   *
   * Videos can be specified by media ID or public URL.
   * Supported formats: video/mp4, video/3gp. Maximum file size: 16 MB.
   * Only H.264 video codec and AAC audio codec are supported.
   *
   * @param params - The video message parameters
   * @param params.body - Video media object containing `id` or `link`, and optional `caption`
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#video-object | Video Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.video({
   *   body: { link: 'https://example.com/video.mp4', caption: 'Watch this!' },
   *   to: '1234567890',
   * });
   * ```
   */
  video(params: MessageRequestParams<VideoMediaObject>): Promise<MessagesResponse>;
  /**
   * Updates the status of a message (e.g., mark as read or show typing indicator).
   *
   * This is the low-level status method. For convenience, use {@link MessagesApi.markAsRead}
   * or {@link MessagesApi.showTypingIndicator} instead.
   *
   * @param params - The status update parameters
   * @param params.status - The status to set (e.g., `'read'`, `'typing'`)
   * @param params.messageId - The ID of the message to update
   * @param params.typingIndicator - Optional typing indicator configuration
   * @returns A promise resolving to the API response
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#status-object | Status Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.status({
   *   status: 'read',
   *   messageId: 'wamid.ABC123',
   * });
   * ```
   */
  status(params: StatusParams): Promise<StatusResponse>;
  /**
   * Marks a message as read, sending a read receipt to the sender.
   *
   * This is a convenience wrapper around {@link MessagesApi.status} that sets the status to `'read'`.
   * When a message is marked as read, all previous messages in the conversation are also marked as read.
   *
   * @param params - The parameters
   * @param params.messageId - The ID of the incoming message to mark as read (the `wamid` value)
   * @returns A promise resolving to the API response
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#status-object | Status Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.markAsRead({ messageId: 'wamid.ABC123' });
   * ```
   */
  markAsRead(params: {
    messageId: string;
  }): Promise<StatusResponse>;
  /**
   * Shows a typing indicator to the user, indicating that a response is being composed.
   *
   * The typing indicator is displayed for approximately 25 seconds or until a message
   * is sent, whichever comes first.
   *
   * @param params - The parameters
   * @param params.messageId - The ID of the incoming message to associate the typing indicator with
   * @returns A promise resolving to the API response
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#status-object | Status Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.showTypingIndicator({ messageId: 'wamid.ABC123' });
   * ```
   */
  showTypingIndicator(params: {
    messageId: string;
  }): Promise<StatusResponse>;
  /**
   * Sends a list interactive message via the WhatsApp Cloud API.
   *
   * List messages present up to 10 selectable options in a menu-style list.
   * Each section can have a title and multiple rows with title, description, and ID.
   *
   * @param params - The list interactive message parameters
   * @param params.body - Interactive object with `type: 'list'` and action containing sections
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#list-messages | List Messages Reference}
   *
   * @example
   * ```ts
   * await client.messages.interactiveList({
   *   body: {
   *     type: 'list',
   *     body: { text: 'Choose an option' },
   *     action: {
   *       button: 'View Options',
   *       sections: [{ title: 'Section 1', rows: [{ id: '1', title: 'Option 1' }] }],
   *     },
   *   },
   *   to: '1234567890',
   * });
   * ```
   */
  interactiveList(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.List | 'list';
  }>): Promise<MessagesResponse>;
  /**
   * Sends a Call-to-Action (CTA) URL button interactive message via the WhatsApp Cloud API.
   *
   * CTA URL messages display a button that opens a URL when tapped.
   *
   * @param params - The CTA URL interactive message parameters
   * @param params.body - Interactive object with `type: 'cta_url'` and action containing the URL and display text
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#interactive-object | Interactive Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.interactiveCtaUrl({
   *   body: {
   *     type: 'cta_url',
   *     body: { text: 'Visit our website' },
   *     action: { name: 'cta_url', parameters: { display_text: 'Open', url: 'https://example.com' } },
   *   },
   *   to: '1234567890',
   * });
   * ```
   */
  interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.CtaUrl | 'cta_url';
  }>): Promise<MessagesResponse>;
  /**
   * Sends a location request interactive message via the WhatsApp Cloud API.
   *
   * Prompts the recipient to share their current location.
   *
   * @param params - The location request interactive message parameters
   * @param params.body - Interactive object with `type: 'location_request_message'`
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#interactive-object | Interactive Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.interactiveLocationRequest({
   *   body: {
   *     type: 'location_request_message',
   *     body: { text: 'Please share your location' },
   *     action: { name: 'send_location' },
   *   },
   *   to: '1234567890',
   * });
   * ```
   */
  interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.LocationRequest;
  }>): Promise<MessagesResponse>;
  /**
   * Sends an address message interactive message via the WhatsApp Cloud API.
   *
   * Prompts the recipient to provide or confirm a shipping/delivery address.
   *
   * @param params - The address message interactive message parameters
   * @param params.body - Interactive object with `type: 'address_message'`
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#interactive-object | Interactive Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.interactiveAddressMessage({
   *   body: {
   *     type: 'address_message',
   *     body: { text: 'Please confirm your delivery address' },
   *     action: { name: 'address_message', parameters: { country: 'US' } },
   *   },
   *   to: '1234567890',
   * });
   * ```
   */
  interactiveAddressMessage(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.AddressMessage;
  }>): Promise<MessagesResponse>;
  /**
   * Sends a reply buttons interactive message via the WhatsApp Cloud API.
   *
   * Reply button messages display up to 3 quick-reply buttons. Each button has
   * a unique ID and title (up to 20 characters).
   *
   * @param params - The reply buttons interactive message parameters
   * @param params.body - Interactive object with `type: 'button'` and action containing up to 3 reply buttons
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#reply-button | Reply Button Reference}
   *
   * @example
   * ```ts
   * await client.messages.interactiveReplyButtons({
   *   body: {
   *     type: 'button',
   *     body: { text: 'Do you agree?' },
   *     action: {
   *       buttons: [
   *         { type: 'reply', reply: { id: 'yes', title: 'Yes' } },
   *         { type: 'reply', reply: { id: 'no', title: 'No' } },
   *       ],
   *     },
   *   },
   *   to: '1234567890',
   * });
   * ```
   */
  interactiveReplyButtons(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.Button | 'button';
  }>): Promise<MessagesResponse>;
  /**
   * Sends a flow interactive message via the WhatsApp Cloud API.
   *
   * Flow messages launch a WhatsApp Flow, which provides structured multi-step interactions
   * (forms, surveys, appointment booking, etc.) within the chat.
   *
   * @param params - The flow interactive message parameters
   * @param params.body - Interactive object with `type: 'flow'` and action containing the flow token and configuration
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#interactive-object | Interactive Object Reference}
   * @see {@link https://developers.facebook.com/docs/whatsapp/flows | WhatsApp Flows Documentation}
   *
   * @example
   * ```ts
   * await client.messages.interactiveFlow({
   *   body: {
   *     type: 'flow',
   *     body: { text: 'Book an appointment' },
   *     action: {
   *       name: 'flow',
   *       parameters: { flow_message_version: '3', flow_id: '123456', flow_cta: 'Book Now' },
   *     },
   *   },
   *   to: '1234567890',
   * });
   * ```
   */
  interactiveFlow(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.Flow | 'flow';
  }>): Promise<MessagesResponse>;
  /**
   * Sends a carousel interactive message via the WhatsApp Cloud API.
   *
   * Carousel messages display a horizontally scrollable set of cards, each with
   * an image, body text, and up to 2 quick-reply buttons.
   *
   * @param params - The carousel interactive message parameters
   * @param params.body - Interactive object with `type: 'carousel'` and action containing carousel cards
   * @param params.to - Recipient phone number in international format
   * @param params.replyMessageId - Optional message ID to reply to
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#interactive-object | Interactive Object Reference}
   *
   * @example
   * ```ts
   * await client.messages.interactiveCarousel({
   *   body: {
   *     type: 'carousel',
   *     body: { text: 'Browse our products' },
   *     action: {
   *       cards: [
   *         {
   *           header: { type: 'image', image: { link: 'https://example.com/product1.jpg' } },
   *           body: { text: 'Product 1 - $10' },
   *           buttons: [{ type: 'reply', reply: { id: 'buy_1', title: 'Buy' } }],
   *         },
   *       ],
   *     },
   *   },
   *   to: '1234567890',
   * });
   * ```
   */
  interactiveCarousel(params: MessageRequestParams<InteractiveObject & {
    type: InteractiveTypesEnum.Carousel;
  }>): Promise<MessagesResponse>;
  /**
   * Sends a reaction emoji to an existing message via the WhatsApp Cloud API.
   *
   * Reactions allow users to respond to messages with a single emoji.
   * To remove a reaction, send an empty string as the emoji.
   *
   * @param params - The reaction parameters
   * @param params.messageId - The ID of the message to react to
   * @param params.emoji - The emoji character to react with (e.g., "\uD83D\uDC4D"), or empty string to remove reaction
   * @param params.to - Recipient phone number in international format
   * @returns A promise resolving to the message response with the sent message ID
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#reaction-object | Reaction Object Reference}
   *
   * @example
   * ```ts
   * // Add a reaction
   * await client.messages.reaction({
   *   messageId: 'wamid.ABC123',
   *   emoji: '\uD83D\uDC4D',
   *   to: '1234567890',
   * });
   *
   * // Remove a reaction
   * await client.messages.reaction({
   *   messageId: 'wamid.ABC123',
   *   emoji: '',
   *   to: '1234567890',
   * });
   * ```
   */
  reaction(params: ReactionParams): Promise<MessagesResponse>;
  /**
   * Send a message through the encrypted messages endpoint.
   *
   * The encrypted endpoint payload varies by encryption setup, so this method accepts
   * the Graph API payload shape directly while preserving the endpoint and response type.
   */
  encrypted(params: EncryptedMessageRequest): Promise<EncryptedMessagesResponse>;
}
//#endregion
//#region src/api/payments/PaymentsApi.d.ts
/**
 * API for WhatsApp Payments (India payment configuration).
 *
 * Provides methods to manage payment configurations for WhatsApp Business Accounts,
 * including creating, reading, updating, and deleting payment configurations,
 * as well as generating OAuth links for payment onboarding.
 *
 * Endpoints covered:
 * - `GET /{WABA_ID}/payment_configurations` - List all payment configurations
 * - `GET /{WABA_ID}/payment_configuration/{CONFIGURATION_NAME}` - Get a specific payment configuration
 * - `POST /{WABA_ID}/payment_configuration` - Create a new payment configuration
 * - `POST /{WABA_ID}/payment_configuration/{CONFIGURATION_NAME}` - Update a payment configuration
 * - `POST /{WABA_ID}/generate_payment_configuration_oauth_link` - Generate an OAuth link
 * - `DELETE /{WABA_ID}/payment_configuration` - Delete a payment configuration
 *
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/payments/payments-in/onboarding-apis/
 */
declare class PaymentsApi extends BaseAPI implements PaymentsClass {
  /**
   * List all payment configurations for a WhatsApp Business Account.
   *
   * @param wabaId - The WhatsApp Business Account ID.
   * @returns A list of all payment configurations.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/payments/payments-in/onboarding-apis/
   */
  listPaymentConfigurations(wabaId: string): Promise<PaymentConfigurationsResponse>;
  /**
   * Get a specific payment configuration by name.
   *
   * @param wabaId - The WhatsApp Business Account ID.
   * @param configurationName - The name of the payment configuration to retrieve.
   * @returns The payment configuration details.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/payments/payments-in/onboarding-apis/
   */
  getPaymentConfiguration(wabaId: string, configurationName: string): Promise<PaymentConfigurationsResponse>;
  /**
   * Create a new payment configuration for a WhatsApp Business Account.
   *
   * @param wabaId - The WhatsApp Business Account ID.
   * @param params - The payment configuration details to create.
   * @returns The created payment configuration response.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/payments/payments-in/onboarding-apis/
   */
  createPaymentConfiguration(wabaId: string, params: PaymentConfigurationCreateRequest): Promise<PaymentConfigurationCreateResponse>;
  /**
   * Update an existing payment configuration.
   *
   * @param wabaId - The WhatsApp Business Account ID.
   * @param configurationName - The name of the payment configuration to update.
   * @param params - The payment configuration fields to update.
   * @returns The updated payment configuration response.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/payments/payments-in/onboarding-apis/
   */
  updatePaymentConfiguration(wabaId: string, configurationName: string, params: PaymentConfigurationUpdateRequest): Promise<PaymentConfigurationUpdateResponse>;
  /**
   * Generate an OAuth link for payment configuration onboarding.
   *
   * @param wabaId - The WhatsApp Business Account ID.
   * @param params - The OAuth link generation parameters.
   * @returns The generated OAuth link response.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/payments/payments-in/onboarding-apis/
   */
  generatePaymentConfigurationOauthLink(wabaId: string, params: PaymentConfigurationOauthLinkRequest): Promise<PaymentConfigurationOauthLinkResponse>;
  /**
   * Delete a payment configuration from a WhatsApp Business Account.
   *
   * @param wabaId - The WhatsApp Business Account ID.
   * @param params - The payment configuration deletion parameters (includes configuration name).
   * @returns A success response confirming deletion.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/payments/payments-in/onboarding-apis/
   */
  deletePaymentConfiguration(wabaId: string, params: PaymentConfigurationDeleteRequest): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/phone/PhoneNumberApi.d.ts
/**
 * API for managing WhatsApp Business phone numbers.
 *
 * This API provides methods for phone number management, verification,
 * and conversational automation configuration within the WhatsApp Business Platform.
 *
 * Covered endpoints:
 * - Get phone number info by ID (`GET /{PHONE_NUMBER_ID}`)
 * - List all phone numbers for a WABA (`GET /{WABA_ID}/phone_numbers`)
 * - Request a verification code (`POST /{PHONE_NUMBER_ID}/request_code`)
 * - Verify a phone number with a code (`POST /{PHONE_NUMBER_ID}/verify_code`)
 * - Set conversational automation config (`POST /{PHONE_NUMBER_ID}/conversational_automation`)
 * - Get conversational automation config (`GET /{PHONE_NUMBER_ID}?fields=conversational_automation`)
 * - Get throughput info (`GET /{PHONE_NUMBER_ID}?fields=throughput`)
 *
 * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/phone-numbers | Phone Numbers API Reference}
 * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/business-phone-numbers/phone-numbers/ | Phone Numbers Documentation}
 */
declare class PhoneNumberApi extends BaseAPI implements PhoneNumberClass {
  private readonly endpoint;
  /**
   * Get phone number information by ID.
   *
   * Retrieves details about the configured phone number, including display phone number,
   * verified name, quality rating, platform type, and more. Use the `fields` parameter
   * to request only specific fields.
   *
   * @param fields - Optional fields to include in the response. Can be a comma-separated
   *   string (e.g., `'display_phone_number,verified_name'`) or an array of field names.
   * @returns A promise that resolves with the phone number information.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/phone-numbers#get-single | Get Phone Number}
   *
   * @example
   * ```ts
   * // Get all available fields
   * const phoneNumber = await whatsappClient.phoneNumber.getPhoneNumberById();
   *
   * // Get specific fields as a comma-separated string
   * const phoneNumber = await whatsappClient.phoneNumber.getPhoneNumberById(
   *     'display_phone_number,verified_name,quality_rating'
   * );
   *
   * // Get specific fields as an array
   * const phoneNumber = await whatsappClient.phoneNumber.getPhoneNumberById(
   *     ['display_phone_number', 'verified_name']
   * );
   * ```
   */
  getPhoneNumberById(fields?: PhoneNumberFieldsParam): Promise<PhoneNumberResponse>;
  /**
   * Get all phone numbers associated with the WhatsApp Business Account.
   *
   * Returns a list of all phone numbers registered under the configured WABA,
   * including their verification status, quality rating, and display information.
   *
   * @param params - Optional list query parameters such as fields, filtering, sort, and paging.
   * @returns A promise that resolves with the list of phone numbers.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/phone-numbers#get-all | List Phone Numbers}
   *
   * @example
   * ```ts
   * const response = await whatsappClient.phoneNumber.getPhoneNumbers();
   * for (const number of response.data) {
   *     console.log(number.display_phone_number, number.verified_name);
   * }
   * ```
   */
  getPhoneNumbers(params?: PhoneNumbersListParams): Promise<PhoneNumbersResponse>;
  /**
   * Create a phone number under a WABA.
   *
   * @param request - Phone number creation payload from the Graph API.
   * @param wabaId - Optional WABA ID. Defaults to the configured business account ID.
   */
  createPhoneNumber(request: CreatePhoneNumberRequest, wabaId?: string): Promise<CreatePhoneNumberResponse>;
  /**
   * Update phone number status or configuration on the phone number node.
   */
  updatePhoneNumberStatus(request: UpdatePhoneNumberStatusRequest): Promise<ResponseSuccess>;
  /**
   * Request a verification code for the phone number.
   *
   * Sends a verification code to the configured phone number via SMS or voice call.
   * This is the first step of the phone number verification process.
   *
   * @param request - The verification code request parameters.
   * @param request.code_method - The delivery method for the code: `'SMS'` or `'VOICE'`.
   * @param request.language - The language code for the verification message (e.g., `'en_US'`).
   * @returns A promise that resolves with a success indicator.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/phone-numbers#request-verification-code | Request Verification Code}
   *
   * @example
   * ```ts
   * await whatsappClient.phoneNumber.requestVerificationCode({
   *     code_method: 'SMS',
   *     language: 'en_US',
   * });
   * ```
   */
  requestVerificationCode(request: RequestVerificationCodeRequest): Promise<ResponseSuccess>;
  /**
   * Verify the phone number with a received verification code.
   *
   * Completes the phone number verification process by submitting the code
   * received via SMS or voice call from {@link requestVerificationCode}.
   *
   * @param request - The verification request parameters.
   * @param request.code - The 6-digit verification code received via SMS or voice call.
   * @returns A promise that resolves with a success indicator.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/phone-numbers#verify-code | Verify Code}
   *
   * @example
   * ```ts
   * await whatsappClient.phoneNumber.verifyCode({
   *     code: '123456',
   * });
   * ```
   */
  verifyCode(request: VerifyCodeRequest): Promise<ResponseSuccess>;
  /**
   * Get general phone number settings.
   *
   * Calling-specific settings can also be accessed through `calling.getCallingSettings()`.
   */
  getPhoneNumberSettings(params?: PhoneNumberSettingsParams): Promise<PhoneNumberSettingsResponse>;
  /**
   * Update general phone number settings.
   */
  updatePhoneNumberSettings(params: UpdatePhoneNumberSettingsRequest): Promise<ResponseSuccess>;
  /**
   * Configure conversational automation features for the phone number.
   *
   * Sets up welcome messages, ice breakers (prompts), and commands that users
   * see when they open a conversation with the business phone number.
   *
   * @param request - The conversational automation configuration.
   * @param request.enable_welcome_message - Optional. Enable or disable the welcome message.
   * @param request.commands - Optional. Array of command objects with `command_name` and `command_description`.
   * @param request.prompts - Optional. Array of ice breaker prompt strings shown to users.
   * @returns A promise that resolves with a success indicator.
   *
   * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/business-phone-numbers/phone-numbers/ | Conversational Automation}
   *
   * @example
   * ```ts
   * // Enable welcome message
   * await whatsappClient.phoneNumber.setConversationalAutomation({
   *     enable_welcome_message: true,
   * });
   *
   * // Configure commands and ice breakers
   * await whatsappClient.phoneNumber.setConversationalAutomation({
   *     enable_welcome_message: true,
   *     commands: [
   *         { command_name: 'tickets', command_description: 'Book flight tickets' },
   *         { command_name: 'hotel', command_description: 'Book a hotel room' },
   *     ],
   *     prompts: ['Book a flight', 'Plan a vacation'],
   * });
   * ```
   */
  setConversationalAutomation(request: ConversationalAutomationRequest): Promise<ResponseSuccess>;
  /**
   * Get the current conversational automation configuration for the phone number.
   *
   * Retrieves the current settings for welcome messages, ice breakers (prompts),
   * and commands configured on the phone number.
   *
   * @returns A promise that resolves with the current conversational automation settings,
   *   including welcome message status, commands, and prompts.
   *
   * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/business-phone-numbers/phone-numbers/ | Conversational Automation}
   *
   * @example
   * ```ts
   * const config = await whatsappClient.phoneNumber.getConversationalAutomation();
   * console.log(config.enable_welcome_message); // true or false
   * console.log(config.commands);               // Array of command objects
   * console.log(config.prompts);                // Array of ice breaker strings
   * ```
   */
  getConversationalAutomation(): Promise<ConversationalAutomationResponse>;
  /**
   * Get the current throughput level for the phone number.
   *
   * Throughput represents the maximum messages per second (MPS) that can be
   * sent or received on this phone number.
   *
   * Throughput levels:
   * - **STANDARD**: 80 MPS (default for most numbers)
   * - **HIGH**: 1,000 MPS (automatic upgrade for eligible numbers)
   * - **NOT_APPLICABLE**: Fixed at 5 MPS (WhatsApp Business app coexistence numbers)
   *
   * @returns A promise that resolves with the current throughput information,
   *   including the throughput level.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/phone-numbers | Phone Numbers - Throughput}
   *
   * @example
   * ```ts
   * const throughput = await whatsappClient.phoneNumber.getThroughput();
   * console.log(throughput.throughput.level); // 'STANDARD' | 'HIGH' | 'NOT_APPLICABLE'
   * ```
   */
  getThroughput(): Promise<ThroughputResponse>;
  getOfficialBusinessAccountStatus(): Promise<OfficialBusinessAccountStatusResponse>;
  updateOfficialBusinessAccountStatus(params: UpdateOfficialBusinessAccountStatusRequest): Promise<ResponseSuccess>;
  getBusinessComplianceInfo(): Promise<BusinessComplianceInfoResponse>;
  updateBusinessComplianceInfo(params: UpdateBusinessComplianceInfoRequest): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/profile/BusinessProfileApi.d.ts
/**
 * API for managing WhatsApp Business Profiles and profile pictures.
 *
 * Business profiles let customers see relevant information about your business,
 * such as a description, email, address, website, and profile picture.
 *
 * Covered endpoints:
 * - Get business profile (`GET /{PHONE_NUMBER_ID}/whatsapp_business_profile`)
 * - Update business profile (`POST /{PHONE_NUMBER_ID}/whatsapp_business_profile`)
 * - Create an upload session for profile pictures (`POST /app/uploads`)
 * - Upload file binary data (`POST /{UPLOAD_ID}`)
 * - Get upload handle (`GET /{UPLOAD_ID}`)
 *
 * Profile picture upload follows a three-step process:
 * 1. Create an upload session ({@link createUploadSession})
 * 2. Upload the image binary data ({@link uploadMedia})
 * 3. Get the upload handle ({@link getUploadHandle}) and pass it to {@link updateBusinessProfile}
 *
 * Available business profile fields: `about`, `address`, `description`, `email`,
 * `profile_picture_url`, `websites`, `vertical`, `messaging_product`.
 *
 * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/business-profiles | Business Profiles API Reference}
 * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/business-profiles/ | Business Profiles Documentation}
 */
declare class BusinessProfileApi extends BaseAPI implements BusinessProfileClass {
  private readonly endpoint;
  /**
   * Get your WhatsApp Business profile information.
   *
   * Retrieves the business profile details for the configured phone number.
   * You can request all fields or specify a subset using the `fields` parameter.
   *
   * @param fields - Optional fields to return. Can be a comma-separated string
   *   (e.g., `'about,address,email'`) or an array of field names. If omitted,
   *   all fields are returned. Available fields: `about`, `address`, `description`,
   *   `email`, `profile_picture_url`, `websites`, `vertical`.
   * @returns A promise that resolves with the business profile information.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/business-profiles#get-business-profile | Get Business Profile}
   *
   * @example
   * ```ts
   * // Get all business profile fields
   * const profile = await whatsappClient.businessProfile.getBusinessProfile();
   *
   * // Get specific fields as a string
   * const profile = await whatsappClient.businessProfile.getBusinessProfile('about,address,email');
   *
   * // Get specific fields as an array
   * const profile = await whatsappClient.businessProfile.getBusinessProfile(['about', 'address', 'email']);
   * ```
   */
  getBusinessProfile(fields?: BusinessProfileFieldsParam): Promise<BusinessProfileResponse>;
  /**
   * Update your WhatsApp Business profile.
   *
   * Updates one or more fields of the business profile for the configured phone number.
   * Only the fields included in the request body are updated; omitted fields remain unchanged.
   *
   * @param updateRequest - The profile fields to update.
   * @param updateRequest.messaging_product - Required. Must be set to `'whatsapp'`.
   * @param updateRequest.about - Optional. Business About text (1-139 characters).
   * @param updateRequest.address - Optional. Business address (max 256 characters).
   * @param updateRequest.description - Optional. Business description (max 512 characters).
   * @param updateRequest.vertical - Optional. Business industry/category.
   * @param updateRequest.email - Optional. Contact email address (max 128 characters).
   * @param updateRequest.websites - Optional. Up to 2 website URLs (max 256 characters each).
   * @param updateRequest.profile_picture_handle - Optional. Handle obtained from the upload process.
   * @returns A promise that resolves with a success indicator.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/business-profiles#update-business-profile | Update Business Profile}
   *
   * @example
   * ```ts
   * await whatsappClient.businessProfile.updateBusinessProfile({
   *     messaging_product: 'whatsapp',
   *     about: 'We provide excellent service',
   *     description: 'Your trusted partner for quality products',
   *     email: 'contact@example.com',
   *     websites: ['https://example.com'],
   * });
   * ```
   */
  updateBusinessProfile(updateRequest: UpdateBusinessProfileRequest): Promise<ResponseSuccess>;
  /**
   * Create an upload session for a profile picture.
   *
   * This is **step 1** of the three-step profile picture upload process.
   * It initializes a resumable upload session on the server and returns a session ID
   * to use in subsequent upload calls.
   *
   * @param fileLength - The size of the file in bytes.
   * @param fileType - The MIME type of the file (e.g., `'image/jpeg'`, `'image/png'`).
   * @param fileName - The file name with extension (e.g., `'profile.jpg'`).
   * @returns A promise that resolves with the upload session ID.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/business-profiles | Business Profiles - Upload}
   *
   * @example
   * ```ts
   * const session = await whatsappClient.businessProfile.createUploadSession(
   *     fileBuffer.length,
   *     'image/jpeg',
   *     'profile.jpg',
   * );
   * console.log(session.upload_session_id);
   * ```
   */
  createUploadSession(fileLength: number, fileType: string, fileName: string): Promise<UploadSessionResponse>;
  /**
   * Upload media file binary data to an upload session.
   *
   * This is **step 2** of the three-step profile picture upload process.
   * Uploads the raw binary content of the image to the previously created upload session.
   *
   * @param uploadId - The upload session ID returned from {@link createUploadSession}.
   * @param file - The binary data of the file as a Buffer.
   * @returns A promise that resolves with the upload response.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/business-profiles | Business Profiles - Upload}
   *
   * @example
   * ```ts
   * const fileBuffer = fs.readFileSync('profile.jpg');
   * await whatsappClient.businessProfile.uploadMedia(
   *     session.upload_session_id,
   *     fileBuffer,
   * );
   * ```
   */
  uploadMedia(uploadId: string, file: Buffer): Promise<UploadBusinessProfileResponse>;
  /**
   * Get the upload handle for a completed upload.
   *
   * This is **step 3** of the three-step profile picture upload process.
   * After uploading the file binary, retrieve the handle to use when updating
   * the business profile's `profile_picture_handle` field.
   *
   * @param uploadId - The upload session ID returned from {@link createUploadSession}.
   * @returns A promise that resolves with the upload handle information.
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/business-profiles | Business Profiles - Upload}
   *
   * @example
   * ```ts
   * // Complete three-step profile picture upload
   * const session = await whatsappClient.businessProfile.createUploadSession(
   *     fileBuffer.length, 'image/jpeg', 'profile.jpg',
   * );
   * await whatsappClient.businessProfile.uploadMedia(session.upload_session_id, fileBuffer);
   * const handleInfo = await whatsappClient.businessProfile.getUploadHandle(session.upload_session_id);
   *
   * // Use the handle to update the profile picture
   * await whatsappClient.businessProfile.updateBusinessProfile({
   *     messaging_product: 'whatsapp',
   *     profile_picture_handle: handleInfo.handle,
   * });
   * ```
   */
  getUploadHandle(uploadId: string): Promise<UploadHandle>;
}
//#endregion
//#region src/api/qrCode/QrCodeApi.d.ts
/**
 * API for managing WhatsApp QR Codes.
 *
 * This API allows you to:
 * - Create QR codes with prefilled messages
 * - Get all QR codes
 * - Get specific QR code details
 * - Update QR code messages
 * - Delete QR codes
 *
 * Endpoints covered:
 * - `POST /{PHONE_NUMBER_ID}/message_qrdls` - Create a new QR code
 * - `GET /{PHONE_NUMBER_ID}/message_qrdls` - Get all QR codes
 * - `GET /{PHONE_NUMBER_ID}/message_qrdls/{QR_CODE_ID}` - Get a specific QR code
 * - `POST /{PHONE_NUMBER_ID}/message_qrdls/{QR_CODE_ID}` - Update a QR code
 * - `DELETE /{PHONE_NUMBER_ID}/message_qrdls/{QR_CODE_ID}` - Delete a QR code
 *
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/qr-codes/
 */
declare class QrCodeApi extends BaseAPI implements QrCodeClass {
  private readonly endpoint;
  /**
   * Create a new QR code with a prefilled message.
   *
   * @param request - The QR code creation request containing the prefilled message and optional image format.
   * @returns QR code information including code, deep link URL, and optional image URL.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/qr-codes/
   *
   * @example
   * const qrCode = await whatsappClient.qrCode.createQrCode({
   *   prefilled_message: 'Hello from WhatsApp!',
   *   generate_qr_image: 'PNG'
   * });
   */
  createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
  /**
   * Get all QR codes for the current phone number.
   *
   * @returns List of all QR codes.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/qr-codes/
   *
   * @example
   * const qrCodes = await whatsappClient.qrCode.getQrCodes();
   */
  getQrCodes(): Promise<QrCodesResponse>;
  /**
   * Get a specific QR code by ID.
   *
   * @param qrCodeId - The QR code ID to retrieve.
   * @returns QR code information.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/qr-codes/
   *
   * @example
   * const qrCode = await whatsappClient.qrCode.getQrCode('qr_code_123');
   */
  getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
  /**
   * Update an existing QR code's prefilled message.
   *
   * @param request - The QR code update request containing code and new message.
   * @returns Updated QR code information.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/qr-codes/
   *
   * @example
   * const updatedQrCode = await whatsappClient.qrCode.updateQrCode({
   *   code: 'existing_qr_code',
   *   prefilled_message: 'Updated message!'
   * });
   */
  updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
  /**
   * Delete a QR code.
   *
   * @param qrCodeId - The QR code ID to delete.
   * @returns Response indicating success or failure.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/qr-codes/
   *
   * @example
   * await whatsappClient.qrCode.deleteQrCode('qr_code_123');
   */
  deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/registration/RegistrationApi.d.ts
/**
 * API for managing WhatsApp Business Account registration.
 *
 * This API allows you to:
 * - Register a WhatsApp Business Account with a PIN
 * - Deregister a WhatsApp Business Account
 *
 * Endpoints covered:
 * - `POST /{PHONE_NUMBER_ID}/register` - Register a phone number
 * - `POST /{PHONE_NUMBER_ID}/deregister` - Deregister a phone number
 *
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/business-phone-numbers/registration/
 */
declare class RegistrationApi extends BaseAPI implements RegistrationClass {
  /**
   * Register a WhatsApp Business Account using a PIN.
   *
   * @param pin - The registration PIN received via SMS or voice call.
   * @param dataLocalizationRegion - Optional data localization region for storage compliance.
   * @returns Response indicating success or failure.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/business-phone-numbers/registration/
   *
   * @example
   * await whatsappClient.registration.register('123456', DataLocalizationRegionEnum.Asia);
   */
  register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess>;
  /**
   * Deregister a WhatsApp Business Account.
   *
   * @returns Response indicating success or failure.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/business-phone-numbers/registration/
   *
   * @example
   * await whatsappClient.registration.deregister();
   */
  deregister(): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/solutions/types/common.d.ts
type SolutionGraphObject = Record<string, unknown>;
type SolutionFieldsParam = string[] | string;
type SolutionListParams = {
  fields?: SolutionFieldsParam;
  role?: 'OWNER' | 'PARTNER' | string;
  status?: string;
  limit?: number;
  after?: string;
  before?: string;
};
type SolutionListResponse<T = SolutionGraphObject> = {
  data: T[];
  paging?: Paging;
  summary?: SolutionGraphObject;
};
type CreateWhatsAppBusinessSolutionRequest = {
  partner_app_id?: string;
  partner_business_id?: string;
  [key: string]: unknown;
};
type AcceptSolutionRequest = {
  partner_app_id?: string;
  [key: string]: unknown;
};
type RejectSolutionRequest = {
  partner_app_id?: string;
  request_type?: string;
  reason?: string;
  [key: string]: unknown;
};
type SolutionDeactivationRequest = {
  reason?: string;
  [key: string]: unknown;
};
type SolutionMigrationIntent = 'INITIATE_MIGRATION' | 'CANCEL_MIGRATION' | 'CONFIRM_MIGRATION' | 'SCHEDULE_MIGRATION';
type SetSolutionMigrationIntentRequest = {
  solution_id: string;
  migration_intent: SolutionMigrationIntent;
  target_solution_id?: string;
  migration_reason?: string;
  scheduled_migration_time?: string;
};
interface SolutionsClass {
  createWhatsAppBusinessSolution(applicationId: string, request: CreateWhatsAppBusinessSolutionRequest): Promise<SolutionGraphObject>;
  getApplicationWhatsAppBusinessSolutions(applicationId: string, params?: SolutionListParams): Promise<SolutionListResponse>;
  getSolutionAccessToken(solutionId: string, fields?: SolutionFieldsParam): Promise<SolutionGraphObject>;
  acceptSolutionDeactivationRequest(solutionId: string, request?: SolutionDeactivationRequest): Promise<ResponseSuccess>;
  acceptSolution(solutionId: string, request?: AcceptSolutionRequest): Promise<ResponseSuccess>;
  getSolutionDetails(solutionId: string, fields?: SolutionFieldsParam): Promise<SolutionGraphObject>;
  rejectSolutionDeactivationRequest(solutionId: string, request?: SolutionDeactivationRequest): Promise<ResponseSuccess>;
  rejectSolutionRequest(solutionId: string, request?: RejectSolutionRequest): Promise<ResponseSuccess>;
  sendSolutionDeactivationRequest(solutionId: string, request?: SolutionDeactivationRequest): Promise<ResponseSuccess>;
  getMigrationIntentDetails(migrationIntentId: string, fields?: SolutionFieldsParam): Promise<SolutionGraphObject>;
  listWabaSolutions(wabaId?: string, params?: SolutionListParams): Promise<SolutionListResponse>;
  setSolutionMigrationIntent(wabaId: string, request: SetSolutionMigrationIntentRequest): Promise<SolutionGraphObject>;
}
//#endregion
//#region src/api/solutions/SolutionsApi.d.ts
declare class SolutionsApi extends BaseAPI implements SolutionsClass {
  private toQuery;
  private fieldsQuery;
  createWhatsAppBusinessSolution(applicationId: string, request: CreateWhatsAppBusinessSolutionRequest): Promise<SolutionGraphObject>;
  getApplicationWhatsAppBusinessSolutions(applicationId: string, params?: SolutionListParams): Promise<SolutionListResponse>;
  getSolutionAccessToken(solutionId: string, fields?: SolutionFieldsParam): Promise<SolutionGraphObject>;
  acceptSolutionDeactivationRequest(solutionId: string, request?: SolutionDeactivationRequest): Promise<ResponseSuccess>;
  acceptSolution(solutionId: string, request?: AcceptSolutionRequest): Promise<ResponseSuccess>;
  getSolutionDetails(solutionId: string, fields?: SolutionFieldsParam): Promise<SolutionGraphObject>;
  rejectSolutionDeactivationRequest(solutionId: string, request?: SolutionDeactivationRequest): Promise<ResponseSuccess>;
  rejectSolutionRequest(solutionId: string, request?: RejectSolutionRequest): Promise<ResponseSuccess>;
  sendSolutionDeactivationRequest(solutionId: string, request?: SolutionDeactivationRequest): Promise<ResponseSuccess>;
  getMigrationIntentDetails(migrationIntentId: string, fields?: SolutionFieldsParam): Promise<SolutionGraphObject>;
  listWabaSolutions(wabaId?: string, params?: SolutionListParams): Promise<SolutionListResponse>;
  setSolutionMigrationIntent(wabaId: string, request: SetSolutionMigrationIntentRequest): Promise<SolutionGraphObject>;
}
//#endregion
//#region src/api/template/factories/index.d.ts
declare function createTemplate(options: TemplateOptions): TemplateRequestBody;
declare function createOTPTemplate(options: OTPTemplateOptions): TemplateRequestBody;
declare function createAuthenticationTemplate(options: AuthenticationTemplateOptions): TemplateRequestBody;
declare function createCatalogTemplate(options: CatalogTemplateOptions): TemplateRequestBody;
declare function createCouponTemplate(options: CouponTemplateOptions): TemplateRequestBody;
declare function createLimitedTimeOfferTemplate(options: LimitedTimeOfferTemplateOptions): TemplateRequestBody;
declare function createMediaCardCarouselTemplate(options: MediaCardCarouselTemplateOptions): TemplateRequestBody;
declare function createMPMTemplate(options: MPMTemplateOptions): TemplateRequestBody;
declare function createProductCardCarouselTemplate(options: ProductCardCarouselTemplateOptions): TemplateRequestBody;
declare function createSPMTemplate(options: SPMTemplateOptions): TemplateRequestBody;
//#endregion
//#region src/api/template/TemplateApi.d.ts
/**
 * WhatsApp Message Templates API client for managing message templates.
 *
 * Message templates are pre-approved message formats that businesses can use to
 * send notifications and customer care messages. Templates must be approved by
 * Meta before they can be used to send messages.
 *
 * **Covered endpoints:**
 * - `GET /{TEMPLATE_ID}` - Get a single template ({@link TemplateApi.getTemplate})
 * - `POST /{TEMPLATE_ID}` - Update an existing template ({@link TemplateApi.updateTemplate})
 * - `GET /{WABA_ID}/message_templates` - List all templates ({@link TemplateApi.getTemplates})
 * - `POST /{WABA_ID}/message_templates` - Create a new template ({@link TemplateApi.createTemplate})
 * - `DELETE /{WABA_ID}/message_templates` - Delete a template ({@link TemplateApi.deleteTemplate})
 *
 * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/message-templates | Message Templates API Reference}
 * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/ | WhatsApp Templates Documentation}
 *
 * @example
 * ```ts
 * const client = new WhatsApp({ accessToken: '...', phoneNumberId: '...', businessAcctId: '...' });
 *
 * // Create a template
 * const template = await client.template.createTemplate({
 *   name: 'hello_world',
 *   language: 'en_US',
 *   category: 'MARKETING',
 *   components: [{ type: 'BODY', text: 'Hello {{1}}!' }],
 * });
 *
 * // List all templates
 * const templates = await client.template.getTemplates();
 * ```
 */
declare class TemplateApi extends BaseAPI implements TemplateClass {
  private readonly endpoint;
  /**
   * Retrieves a single message template by its ID.
   *
   * Returns the full template definition including name, language, status,
   * category, and components.
   *
   * **Endpoint:** `GET /{TEMPLATE_ID}`
   *
   * @param templateId - The unique identifier of the template to retrieve
   * @returns A promise resolving to the template details
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/message-templates | Message Templates Reference}
   *
   * @example
   * ```ts
   * const template = await client.template.getTemplate('template_id_123');
   * console.log(template.name);     // e.g., "hello_world"
   * console.log(template.status);   // e.g., "APPROVED"
   * ```
   */
  getTemplate(templateId: string): Promise<TemplateResponse>;
  /**
   * Updates an existing message template.
   *
   * Allows modifying template components and other properties. Note that editing
   * an approved template will resubmit it for review, changing its status back
   * to `PENDING`.
   *
   * **Endpoint:** `POST /{TEMPLATE_ID}`
   *
   * @param templateId - The unique identifier of the template to update
   * @param template - Partial template body containing only the fields to update
   * @returns A promise resolving to a success response (`{ success: true }`)
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/message-templates | Message Templates Reference}
   *
   * @example
   * ```ts
   * await client.template.updateTemplate('template_id_123', {
   *   components: [{ type: 'BODY', text: 'Updated greeting: Hello {{1}}!' }],
   * });
   * ```
   */
  updateTemplate(templateId: string, template: Partial<TemplateRequestBody>): Promise<ResponseSuccess>;
  /**
   * Lists message templates for the WhatsApp Business Account.
   *
   * Returns a paginated list of templates, optionally filtered by query parameters
   * such as category, language, name, status, or quality score.
   *
   * **Endpoint:** `GET /{WABA_ID}/message_templates`
   *
   * @param params - Optional query parameters to filter results
   * @param params.category - Filter by template category (e.g., `'MARKETING'`, `'UTILITY'`)
   * @param params.content - Filter by template content
   * @param params.language - Filter by language code (e.g., `'en_US'`)
   * @param params.name - Filter by exact template name
   * @param params.name_or_content - Filter by name or content (search)
   * @param params.quality_score - Filter by quality score
   * @param params.status - Filter by template status (e.g., `'APPROVED'`, `'PENDING'`, `'REJECTED'`)
   * @returns A promise resolving to a paginated response containing an array of templates
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/message-templates | Message Templates Reference}
   *
   * @example
   * ```ts
   * // List all templates
   * const allTemplates = await client.template.getTemplates();
   *
   * // Filter by category and status
   * const approved = await client.template.getTemplates({
   *   category: 'MARKETING',
   *   status: 'APPROVED',
   * });
   * ```
   */
  getTemplates(params?: TemplateGetParams): Promise<ResponsePagination<TemplateResponse>>;
  /**
   * Creates a new message template for the WhatsApp Business Account.
   *
   * The template will be submitted for review. Once approved, it can be used
   * to send template messages via {@link MessagesApi.template}.
   *
   * **Endpoint:** `POST /{WABA_ID}/message_templates`
   *
   * @param template - The template definition
   * @param template.name - Template name (lowercase alphanumeric and underscores only)
   * @param template.language - Language code (e.g., `'en_US'`)
   * @param template.category - Template category (`'MARKETING'`, `'UTILITY'`, or `'AUTHENTICATION'`)
   * @param template.components - Array of template components (header, body, footer, buttons)
   * @param template.allow_category_change - Whether Meta can auto-assign a different category
   * @param template.parameter_format - Parameter format (`'POSITIONAL'` or `'NAMED'`)
   * @param template.sub_category - Optional sub-category for the template
   * @param template.message_send_ttl_seconds - Optional TTL in seconds for message delivery attempts
   * @returns A promise resolving to the created template response with its assigned `id` and `status`
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/message-templates | Message Templates Reference}
   *
   * @example
   * ```ts
   * const template = await client.template.createTemplate({
   *   name: 'order_confirmation',
   *   language: 'en_US',
   *   category: 'UTILITY',
   *   components: [
   *     { type: 'BODY', text: 'Your order {{1}} has been confirmed.' },
   *   ],
   * });
   * console.log(template.id);     // Template ID
   * console.log(template.status); // "PENDING"
   * ```
   */
  createTemplate(template: TemplateRequestBody): Promise<TemplateResponse>;
  /**
   * Deletes a message template from the WhatsApp Business Account.
   *
   * Deleting a template removes all language variations of that template.
   * To delete a specific language version, provide the `hsm_id` parameter.
   *
   * **Endpoint:** `DELETE /{WABA_ID}/message_templates`
   *
   * @param params - The delete parameters
   * @param params.name - The name of the template to delete (required)
   * @param params.hsm_id - Optional template ID to delete a specific language version
   * @returns A promise resolving to a success response (`{ success: true }`)
   *
   * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/message-templates | Message Templates Reference}
   *
   * @example
   * ```ts
   * // Delete all language versions of a template
   * await client.template.deleteTemplate({ name: 'old_template' });
   *
   * // Delete a specific language version
   * await client.template.deleteTemplate({ name: 'old_template', hsm_id: '123456' });
   * ```
   */
  deleteTemplate(params: TemplateDeleteParams): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/twoStepVerification/TwoStepVerificationApi.d.ts
/**
 * API for managing WhatsApp Two-Step Verification.
 *
 * This API allows you to:
 * - Set a two-step verification PIN code
 * - Manage two-step verification settings
 *
 * Endpoints covered:
 * - `POST /{PHONE_NUMBER_ID}` - Set two-step verification PIN
 *
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/business-phone-numbers/two-step-verification/
 */
declare class TwoStepVerificationApi extends BaseAPI implements TwoStepVerificationClass {
  /**
   * Set a two-step verification PIN code.
   *
   * @param pin - The PIN code to set for two-step verification (6-digit numeric string).
   * @returns Response indicating success or failure.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/business-phone-numbers/two-step-verification/
   *
   * @example
   * await whatsappClient.twoStepVerification.setTwoStepVerificationCode('123456');
   */
  setTwoStepVerificationCode(pin: string): Promise<ResponseSuccess>;
}
//#endregion
//#region src/api/waba/WabaApi.d.ts
/**
 * API for managing WhatsApp Business Account (WABA).
 *
 * This API allows you to:
 * - Get WABA account information
 * - Manage WABA subscriptions
 * - Subscribe/unsubscribe from WABA webhooks
 * - Update subscription settings
 *
 * Endpoints covered:
 * - `GET /{WABA_ID}` - Get WABA account information
 * - `GET /{WABA_ID}/subscribed_apps` - Get all WABA subscriptions
 * - `POST /{WABA_ID}/subscribed_apps` - Update/create a WABA subscription
 * - `DELETE /{WABA_ID}/subscribed_apps` - Unsubscribe from WABA webhooks
 *
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/whatsapp-business-accounts/
 */
declare class WabaApi extends BaseAPI implements WABAClass {
  private toQuery;
  private fieldsQuery;
  /**
   * Retrieve WhatsApp Business Account information.
   *
   * @param fields - Optional array of specific fields to retrieve.
   * @returns WABA account information including status, health, verification status, etc.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/whatsapp-business-accounts/
   *
   * @example
   * const account = await whatsappClient.waba.getWabaAccount(['id', 'name', 'status']);
   */
  getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
  /**
   * Update WABA account fields such as name or timezone.
   */
  updateWabaAccount(params: UpdateWabaAccountRequest): Promise<ResponseSuccess>;
  /**
   * Get account activity events for a WABA.
   */
  getWabaActivities(params?: WabaListParams): Promise<WabaListResponse>;
  /**
   * Get all WABA subscriptions for the business account.
   *
   * @returns List of all subscribed apps and their configurations.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/whatsapp-business-accounts/
   *
   * @example
   * const subscriptions = await whatsappClient.waba.getAllWabaSubscriptions();
   */
  getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
  /**
   * Update WABA subscription configuration.
   *
   * @param params - Configuration parameters including callback URI and verify token.
   * @returns Response indicating success or failure.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/whatsapp-business-accounts/
   *
   * @example
   * await whatsappClient.waba.updateWabaSubscription({
   *   override_callback_uri: 'https://example.com/webhook',
   *   verify_token: 'your_verify_token'
   * });
   */
  updateWabaSubscription({
    override_callback_uri,
    verify_token
  }: UpdateWabaSubscription): Promise<ResponseSuccess>;
  /**
   * Unsubscribe from WABA webhooks.
   *
   * @returns Response indicating success or failure.
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/whatsapp-business-accounts/
   *
   * @example
   * await whatsappClient.waba.unsubscribeFromWaba();
   */
  unsubscribeFromWaba(): Promise<ResponseSuccess>;
  getAssignedUsers(params: AssignedUsersListParams, wabaId?: string): Promise<WabaListResponse>;
  addAssignedUser(params: AssignedUserRequest, wabaId?: string): Promise<ResponseSuccess>;
  removeAssignedUser(params: RemoveAssignedUserRequest, wabaId?: string): Promise<ResponseSuccess>;
  getInProgressOnBehalfRequests(params?: WabaListParams, wabaId?: string): Promise<WabaListResponse>;
  getOBOMobilityIntent(oboMobilityIntentId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;
  createOBOMobilityIntent(params: CreateOBOMobilityIntentRequest, wabaId?: string): Promise<WabaGraphObject>;
  setOBOMobilityIntent(params: SetOBOMobilityIntentRequest, wabaId?: string): Promise<WabaGraphObject>;
  getWabaSchedules(params?: WabaListParams, wabaId?: string): Promise<WabaListResponse>;
  createWabaSchedule(params: CreateScheduleRequest, wabaId?: string): Promise<WabaGraphObject>;
  getWhatsAppBusinessBotDetails(botId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;
  getWhatsAppBusinessProfileDetails(profileId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;
  updateWhatsAppBusinessProfile(profileId: string, params: UpdateWhatsAppBusinessProfileRequest): Promise<ResponseSuccess>;
}
//#endregion
//#region src/utils/flowEncryptionUtils.d.ts
/**
 * Environment model for encryption keys
 */
type EncryptionKeyPair = {
  passphrase: string;
  privateKey: string;
  publicKey: string;
};
/**
 * Generates RSA key pair for WhatsApp Business Flow API encryption
 *
 * This function generates a 2048-bit RSA key pair with:
 * - Public key in SPKI format (PEM)
 * - Private key in PKCS#8 format (PEM) encrypted with AES-256-CBC
 *
 * @param passphrase - Passphrase to encrypt the private key. If not provided, uses FLOW_API_PASSPHRASE from environment
 * @returns Object containing passphrase, privateKey, and publicKey
 * @throws {Error} If passphrase is empty or key generation fails
 * @throws {Error} If not running in Node.js environment
 *
 * @example
 * ```typescript
 * import { WhatsApp } from 'meta-cloud-api';
 *
 * const wa = new WhatsApp();
 *
 * try {
 *   // Uses FLOW_API_PASSPHRASE from environment
 *   const keys = wa.generateEncryption();
 *   console.log('Public Key:', keys.publicKey);
 *   console.log('Private Key:', keys.privateKey);
 *
 *   // Or provide custom passphrase
 *   const customKeys = wa.generateEncryption('my-secret-passphrase');
 * } catch (error) {
 *   console.error('Failed to generate keys:', error.message);
 * }
 * ```
 */
declare function generateEncryption(passphrase?: string): EncryptionKeyPair;
/**
 * Decrypt a WhatsApp Flow request
 * @param body - Encrypted request body containing encrypted_aes_key, encrypted_flow_data, and initial_vector
 * @param config - WABA configuration containing FLOW_API_PRIVATE_PEM and FLOW_API_PASSPHRASE
 * @returns Decrypted flow request body, AES key buffer, and initial vector buffer
 * @throws {Error} If required encryption properties are missing or decryption fails
 */
declare function decryptFlowRequest(body: any, config: WabaConfigType): {
  decryptedBody: FlowEndpointRequest;
  aesKeyBuffer: Buffer;
  initialVectorBuffer: Buffer;
};
/**
 * Encrypt a WhatsApp Flow response
 * @param response - Response object to encrypt
 * @param aesKeyBuffer - AES key buffer from the decrypted request
 * @param initialVectorBuffer - Initial vector buffer from the decrypted request
 * @returns Base64-encoded encrypted response
 * @throws {Error} If encryption fails
 */
declare function encryptFlowResponse(response: any, aesKeyBuffer: Buffer, initialVectorBuffer: Buffer): string;
//#endregion
//#region src/utils/http/httpsClient.d.ts
declare class HttpsClient implements HttpsClientClass {
  agent: Agent;
  constructor();
  clearSockets(): boolean;
  sendRequest(hostname: string, path: string, method: HttpMethodsEnum, headers: HeadersInit, timeout: number, body?: BodyInit | null): Promise<HttpsClientResponseClass>;
}
//#endregion
//#region src/utils/http/request.d.ts
declare class Requester implements RequesterClass {
  client: Readonly<HttpsClient>;
  accessToken: Readonly<string>;
  phoneNumberId: Readonly<number>;
  businessAcctId: Readonly<string>;
  apiVersion: Readonly<string>;
  userAgent: Readonly<string>;
  host: Readonly<string>;
  protocol: Readonly<string>;
  private retryConfig;
  constructor(apiVersion: string, phoneNumberId: number, accessToken: string, businessAcctId: string, userAgent: string, retryConfig?: RetryConfig);
  buildHeader(contentType: string, additionalHeaders?: Record<string, string>): HeadersInit;
  buildCAPIPath(endpoint: string): string;
  private normalizeApiVersion;
  private buildRequestTarget;
  sendRequest(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any, contentType?: string, additionalHeaders?: Record<string, string>): Promise<HttpsClientResponseClass>;
  getJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any, additionalHeaders?: Record<string, string>): Promise<T>;
  sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: FormData, additionalHeaders?: Record<string, string>): Promise<T>;
  updateTimeout(timeout: number): void;
  updateAccessToken(accessToken: string): void;
  sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: UrlEncodedFormBody, additionalHeaders?: Record<string, string>): Promise<T>;
}
//#endregion
//#region src/core/whatsapp/WhatsApp.d.ts
/**
 * WhatsApp SDK Main Class following official patterns
 * Provides unified access to WhatsApp Cloud API and Flows API
 */
declare class WhatsApp {
  config: WabaConfigType;
  requester: Readonly<Requester>;
  blockUsers: BlockUsersApi;
  business: BusinessApi;
  calling: CallingApi;
  commerce: CommerceApi;
  groups: GroupsApi;
  marketingMessages: MarketingMessagesApi;
  messageHistory: MessageHistoryApi;
  messages: MessagesApi;
  media: MediaApi;
  payments: PaymentsApi;
  phoneNumbers: PhoneNumberApi;
  solutions: SolutionsApi;
  twoStepVerification: TwoStepVerificationApi;
  flows: FlowApi;
  businessProfile: BusinessProfileApi;
  templates: TemplateApi;
  encryption: EncryptionApi;
  qrCode: QrCodeApi;
  registration: RegistrationApi;
  waba: WabaApi;
  constructor(config?: WhatsAppConfig);
  /**
   * Runtime configuration updates following official patterns
   */
  updateTimeout(timeout: number): void;
  updateSenderNumberId(phoneNumberId: number): void;
  updateAccessToken(accessToken: string): void;
  /**
   * Get SDK version
   */
  version(): string;
  /**
   * Static enums access
   */
  static get Enums(): typeof enums_d_exports;
  /**
   * Get User-Agent string
   */
  getUserAgent(): string;
  /**
   * Generate RSA encryption key pair for WhatsApp Business Flow API
   *
   * This method generates a 2048-bit RSA key pair with:
   * - Public key in SPKI format (PEM)
   * - Private key in PKCS#8 format (PEM) encrypted with AES-256-CBC
   *
   * @param passphrase - Optional passphrase to encrypt the private key. If not provided, uses FLOW_API_PASSPHRASE from config
   * @returns Object containing passphrase, privateKey, and publicKey
   * @throws {Error} If passphrase is empty or key generation fails
   * @throws {Error} If not running in Node.js environment
   *
   * @see https://developers.facebook.com/docs/whatsapp/cloud-api/reference/whatsapp-business-encryption/
   *
   * @example
   * ```typescript
   * const wa = new WhatsApp();
   *
   * // Uses FLOW_API_PASSPHRASE from environment/config
   * const keys = wa.generateEncryption();
   *
   * // Or provide custom passphrase
   * const customKeys = wa.generateEncryption('my-secret-passphrase');
   *
   * console.log('Public Key:', keys.publicKey);
   * console.log('Private Key:', keys.privateKey);
   * ```
   */
  generateEncryption(passphrase?: string): EncryptionKeyPair;
}
//#endregion
//#region src/core/webhook/utils/webhookUtils.d.ts
/**
 * Processed message with metadata for handlers
 */
type ProcessedMessage = {
  wabaId: string;
  phoneNumberId: string;
  displayPhoneNumber: string;
  profileName: string;
  message: WhatsAppMessage;
  /**
   * The message ID extracted from the appropriate location based on message type.
   * For most messages, this comes from message.id
   * For certain types like nfm_reply, this comes from message.context.id
   */
  messageId: string;
};
/**
 * Processed status with metadata for handlers
 */
type ProcessedStatus = {
  wabaId: string;
  phoneNumberId: string;
  displayPhoneNumber: string;
  status: StatusWebhook;
};
/**
 * Processed webhook field types for specialized handlers
 */
type ProcessedAccountUpdate = {
  wabaId: string;
  value: AccountUpdateWebhookValue['value'];
};
type ProcessedAccountReviewUpdate = {
  wabaId: string;
  value: AccountReviewUpdateWebhookValue['value'];
};
type ProcessedAccountAlerts = {
  wabaId: string;
  value: AccountAlertsWebhookValue['value'];
};
type ProcessedBusinessCapabilityUpdate = {
  wabaId: string;
  value: BusinessCapabilityUpdateWebhookValue['value'];
};
type ProcessedPhoneNumberNameUpdate = {
  wabaId: string;
  value: PhoneNumberNameUpdateWebhookValue['value'];
};
type ProcessedPhoneNumberQualityUpdate = {
  wabaId: string;
  value: PhoneNumberQualityUpdateWebhookValue['value'];
};
type ProcessedMessageTemplateStatusUpdate = {
  wabaId: string;
  value: MessageTemplateStatusUpdateWebhookValue['value'];
};
type ProcessedTemplateCategoryUpdate = {
  wabaId: string;
  value: TemplateCategoryUpdateWebhookValue['value'];
};
type ProcessedMessageTemplateQualityUpdate = {
  wabaId: string;
  value: MessageTemplateQualityUpdateWebhookValue['value'];
};
type ProcessedFlows = {
  wabaId: string;
  value: FlowsWebhookValue['value'];
};
type ProcessedSecurity = {
  wabaId: string;
  value: SecurityWebhookValue['value'];
};
type ProcessedHistory = {
  wabaId: string;
  value: HistoryWebhookValue['value'];
};
type ProcessedSmbMessageEchoes = {
  wabaId: string;
  value: SmbMessageEchoesWebhookValue['value'];
};
type ProcessedSmbAppStateSync = {
  wabaId: string;
  value: SmbAppStateSyncWebhookValue['value'];
};
type ProcessedAccountSettingsUpdate = {
  wabaId: string;
  value: AccountSettingsUpdateWebhookValue['value'];
};
type ProcessedAutomaticEvents = {
  wabaId: string;
  value: AutomaticEventsWebhookValue['value'];
};
type ProcessedBusinessStatusUpdate = {
  wabaId: string;
  value: BusinessStatusUpdateWebhookValue['value'];
};
type ProcessedCalls = {
  wabaId: string;
  value: CallsWebhookValue['value'];
};
type ProcessedGroupLifecycleUpdate = {
  wabaId: string;
  value: GroupLifecycleUpdateWebhookValue['value'];
};
type ProcessedGroupParticipantsUpdate = {
  wabaId: string;
  value: GroupParticipantsUpdateWebhookValue['value'];
};
type ProcessedGroupSettingsUpdate = {
  wabaId: string;
  value: GroupSettingsUpdateWebhookValue['value'];
};
type ProcessedGroupStatusUpdate = {
  wabaId: string;
  value: GroupStatusUpdateWebhookValue['value'];
};
type ProcessedMessageEchoes = {
  wabaId: string;
  value: MessageEchoesWebhookValue['value'];
};
type ProcessedMessageTemplateComponentsUpdate = {
  wabaId: string;
  value: MessageTemplateComponentsUpdateWebhookValue['value'];
};
type ProcessedMessagingHandovers = {
  wabaId: string;
  value: MessagingHandoversWebhookValue['value'];
};
type ProcessedPartnerSolutions = {
  wabaId: string;
  value: PartnerSolutionsWebhookValue['value'];
};
type ProcessedPaymentConfigurationUpdate = {
  wabaId: string;
  value: PaymentConfigurationUpdateWebhookValue['value'];
};
type ProcessedStandby = {
  wabaId: string;
  value: StandbyWebhookValue['value'];
};
type ProcessedTemplateCorrectCategoryDetection = {
  wabaId: string;
  value: TemplateCorrectCategoryDetectionWebhookValue['value'];
};
type ProcessedTrackingEvents = {
  wabaId: string;
  value: TrackingEventsWebhookValue['value'];
};
type ProcessedUserPreferences = {
  wabaId: string;
  value: UserPreferencesWebhookValue['value'];
};
type TextProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Text;
  }>;
};
type ImageProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Image;
  }>;
};
type VideoProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Video;
  }>;
};
type AudioProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Audio;
  }>;
};
type DocumentProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Document;
  }>;
};
type StickerProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Sticker;
  }>;
};
type InteractiveProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Interactive;
  }>;
};
type ButtonProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Button;
  }>;
};
type LocationProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Location;
  }>;
};
type ContactsProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Contacts;
  }>;
};
type ReactionProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Reaction;
  }>;
};
type OrderProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.Order;
  }>;
};
type SystemProcessedMessage = ProcessedMessage & {
  message: Extract<WhatsAppMessage, {
    type: MessageTypesEnum.System;
  }>;
};
/**
 * Original HTTP request context for WhatsApp webhook handlers.
 *
 * The `rawBody` and `headers` values preserve the incoming webhook request so
 * callers can forward or verify the request according to Meta's request syntax.
 *
 * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/webhooks/create-webhook-endpoint/#request-syntax-1
 */
type WebhookHandlerContext = {
  /** Original request headers from the incoming webhook request. */headers: Headers; /** Original request body string before JSON parsing or field filtering. */
  rawBody: string; /** Original request method. */
  method: string; /** Original request URL. */
  url: string;
};
type WebhookHandler<TProcessed, TReturn = void> = (whatsapp: WhatsApp, processed: TProcessed, context: WebhookHandlerContext) => TReturn | Promise<TReturn>;
type MessageHandler = WebhookHandler<ProcessedMessage>;
type StatusHandler = WebhookHandler<ProcessedStatus>;
type FlowHandler = WebhookHandler<FlowEndpointRequest, any>;
type RawWebhookHandler = WebhookHandler<WebhookPayload>;
type AccountUpdateHandler = WebhookHandler<ProcessedAccountUpdate>;
type AccountReviewUpdateHandler = WebhookHandler<ProcessedAccountReviewUpdate>;
type AccountAlertsHandler = WebhookHandler<ProcessedAccountAlerts>;
type BusinessCapabilityUpdateHandler = WebhookHandler<ProcessedBusinessCapabilityUpdate>;
type PhoneNumberNameUpdateHandler = WebhookHandler<ProcessedPhoneNumberNameUpdate>;
type PhoneNumberQualityUpdateHandler = WebhookHandler<ProcessedPhoneNumberQualityUpdate>;
type MessageTemplateStatusUpdateHandler = WebhookHandler<ProcessedMessageTemplateStatusUpdate>;
type TemplateCategoryUpdateHandler = WebhookHandler<ProcessedTemplateCategoryUpdate>;
type MessageTemplateQualityUpdateHandler = WebhookHandler<ProcessedMessageTemplateQualityUpdate>;
type FlowsHandler = WebhookHandler<ProcessedFlows>;
type SecurityHandler = WebhookHandler<ProcessedSecurity>;
type HistoryHandler = WebhookHandler<ProcessedHistory>;
type SmbMessageEchoesHandler = WebhookHandler<ProcessedSmbMessageEchoes>;
type SmbAppStateSyncHandler = WebhookHandler<ProcessedSmbAppStateSync>;
type AccountSettingsUpdateHandler = WebhookHandler<ProcessedAccountSettingsUpdate>;
type AutomaticEventsHandler = WebhookHandler<ProcessedAutomaticEvents>;
type BusinessStatusUpdateHandler = WebhookHandler<ProcessedBusinessStatusUpdate>;
type CallsHandler = WebhookHandler<ProcessedCalls>;
type GroupLifecycleUpdateHandler = WebhookHandler<ProcessedGroupLifecycleUpdate>;
type GroupParticipantsUpdateHandler = WebhookHandler<ProcessedGroupParticipantsUpdate>;
type GroupSettingsUpdateHandler = WebhookHandler<ProcessedGroupSettingsUpdate>;
type GroupStatusUpdateHandler = WebhookHandler<ProcessedGroupStatusUpdate>;
type MessageEchoesHandler = WebhookHandler<ProcessedMessageEchoes>;
type MessageTemplateComponentsUpdateHandler = WebhookHandler<ProcessedMessageTemplateComponentsUpdate>;
type MessagingHandoversHandler = WebhookHandler<ProcessedMessagingHandovers>;
type PartnerSolutionsHandler = WebhookHandler<ProcessedPartnerSolutions>;
type PaymentConfigurationUpdateHandler = WebhookHandler<ProcessedPaymentConfigurationUpdate>;
type StandbyHandler = WebhookHandler<ProcessedStandby>;
type TemplateCorrectCategoryDetectionHandler = WebhookHandler<ProcessedTemplateCorrectCategoryDetection>;
type TrackingEventsHandler = WebhookHandler<ProcessedTrackingEvents>;
type UserPreferencesHandler = WebhookHandler<ProcessedUserPreferences>;
type TextMessageHandler = WebhookHandler<TextProcessedMessage>;
type ImageMessageHandler = WebhookHandler<ImageProcessedMessage>;
type VideoMessageHandler = WebhookHandler<VideoProcessedMessage>;
type AudioMessageHandler = WebhookHandler<AudioProcessedMessage>;
type DocumentMessageHandler = WebhookHandler<DocumentProcessedMessage>;
type StickerMessageHandler = WebhookHandler<StickerProcessedMessage>;
type InteractiveMessageHandler = WebhookHandler<InteractiveProcessedMessage>;
type ButtonMessageHandler = WebhookHandler<ButtonProcessedMessage>;
type LocationMessageHandler = WebhookHandler<LocationProcessedMessage>;
type ContactsMessageHandler = WebhookHandler<ContactsProcessedMessage>;
type ReactionMessageHandler = WebhookHandler<ReactionProcessedMessage>;
type OrderMessageHandler = WebhookHandler<OrderProcessedMessage>;
type SystemMessageHandler = WebhookHandler<SystemProcessedMessage>;
/**
 * Process webhook messages
 */
declare function processWebhookMessages(request: Request, whatsapp: WhatsApp, handlers: {
  messageHandlers: Map<MessageTypesEnum, MessageHandler>;
  statusHandler?: StatusHandler;
  preProcessHandler?: MessageHandler;
  postProcessHandler?: MessageHandler;
  rawHandler?: RawWebhookHandler;
  rawHandlerFields?: WebhookFieldType[];
  accountUpdateHandler?: AccountUpdateHandler;
  accountReviewUpdateHandler?: AccountReviewUpdateHandler;
  accountAlertsHandler?: AccountAlertsHandler;
  businessCapabilityUpdateHandler?: BusinessCapabilityUpdateHandler;
  phoneNumberNameUpdateHandler?: PhoneNumberNameUpdateHandler;
  phoneNumberQualityUpdateHandler?: PhoneNumberQualityUpdateHandler;
  messageTemplateStatusUpdateHandler?: MessageTemplateStatusUpdateHandler;
  templateCategoryUpdateHandler?: TemplateCategoryUpdateHandler;
  messageTemplateQualityUpdateHandler?: MessageTemplateQualityUpdateHandler;
  flowsHandler?: FlowsHandler;
  securityHandler?: SecurityHandler;
  historyHandler?: HistoryHandler;
  smbMessageEchoesHandler?: SmbMessageEchoesHandler;
  smbAppStateSyncHandler?: SmbAppStateSyncHandler;
  accountSettingsUpdateHandler?: AccountSettingsUpdateHandler;
  automaticEventsHandler?: AutomaticEventsHandler;
  businessStatusUpdateHandler?: BusinessStatusUpdateHandler;
  callsHandler?: CallsHandler;
  groupLifecycleUpdateHandler?: GroupLifecycleUpdateHandler;
  groupParticipantsUpdateHandler?: GroupParticipantsUpdateHandler;
  groupSettingsUpdateHandler?: GroupSettingsUpdateHandler;
  groupStatusUpdateHandler?: GroupStatusUpdateHandler;
  messageEchoesHandler?: MessageEchoesHandler;
  messageTemplateComponentsUpdateHandler?: MessageTemplateComponentsUpdateHandler;
  messagingHandoversHandler?: MessagingHandoversHandler;
  partnerSolutionsHandler?: PartnerSolutionsHandler;
  paymentConfigurationUpdateHandler?: PaymentConfigurationUpdateHandler;
  standbyHandler?: StandbyHandler;
  templateCorrectCategoryDetectionHandler?: TemplateCorrectCategoryDetectionHandler;
  trackingEventsHandler?: TrackingEventsHandler;
  userPreferencesHandler?: UserPreferencesHandler;
}): Promise<Response>;
/**
 * Handle flow requests
 */
declare function processFlowRequest(request: Request, config: WabaConfigType, whatsapp: WhatsApp, flowHandlers: Map<FlowTypeEnum, FlowHandler>): Promise<Response>;
/**
 * Constructs a full URL from framework-specific request headers and URL
 * @param headers - Request headers containing host and protocol information
 * @param url - Relative URL path
 * @returns Full URL string
 */
declare function constructFullUrl(headers: Record<string, string | string[] | undefined>, url?: string): string;
//#endregion
//#region src/core/webhook/WebhookProcessor.d.ts
interface WebhookResponse {
  status: number;
  body: string;
  headers: Record<string, string>;
}
declare class WebhookProcessor {
  private config;
  private client;
  private messageHandlers;
  private statusHandler;
  private preProcessHandler;
  private postProcessHandler;
  private rawHandler;
  private flowHandlers;
  private accountUpdateHandler;
  private accountReviewUpdateHandler;
  private accountAlertsHandler;
  private businessCapabilityUpdateHandler;
  private phoneNumberNameUpdateHandler;
  private phoneNumberQualityUpdateHandler;
  private messageTemplateStatusUpdateHandler;
  private templateCategoryUpdateHandler;
  private messageTemplateQualityUpdateHandler;
  private flowsHandler;
  private securityHandler;
  private historyHandler;
  private smbMessageEchoesHandler;
  private smbAppStateSyncHandler;
  private accountSettingsUpdateHandler;
  private automaticEventsHandler;
  private businessStatusUpdateHandler;
  private callsHandler;
  private groupLifecycleUpdateHandler;
  private groupParticipantsUpdateHandler;
  private groupSettingsUpdateHandler;
  private groupStatusUpdateHandler;
  private messageEchoesHandler;
  private messageTemplateComponentsUpdateHandler;
  private messagingHandoversHandler;
  private partnerSolutionsHandler;
  private paymentConfigurationUpdateHandler;
  private standbyHandler;
  private templateCorrectCategoryDetectionHandler;
  private trackingEventsHandler;
  private userPreferencesHandler;
  constructor(config: WhatsAppConfig);
  processVerification(mode: string | null, token: string | null, challenge: string | null): Promise<WebhookResponse>;
  processWebhook(request: Request): Promise<WebhookResponse>;
  processFlow(request: Request): Promise<WebhookResponse>;
  onMessage(type: MessageTypesEnum | string, handler: MessageHandler): void;
  onStatus(handler: StatusHandler): void;
  onMessagePreProcess(handler: MessageHandler): void;
  onMessagePostProcess(handler: MessageHandler): void;
  onRaw(handler: RawWebhookHandler, fields?: WebhookFieldType[]): void;
  onFlow(type: FlowTypeEnum, handler: FlowHandler): void;
  /**
   * Register a handler for text messages
   * @param handler Type-safe handler that receives text messages with guaranteed text field
   */
  onText(handler: TextMessageHandler): void;
  /**
   * Register a handler for image messages
   * @param handler Type-safe handler that receives image messages with guaranteed image field
   */
  onImage(handler: ImageMessageHandler): void;
  /**
   * Register a handler for video messages
   * @param handler Type-safe handler that receives video messages with guaranteed video field
   */
  onVideo(handler: VideoMessageHandler): void;
  /**
   * Register a handler for audio messages
   * @param handler Type-safe handler that receives audio messages with guaranteed audio field
   */
  onAudio(handler: AudioMessageHandler): void;
  /**
   * Register a handler for document messages
   * @param handler Type-safe handler that receives document messages with guaranteed document field
   */
  onDocument(handler: DocumentMessageHandler): void;
  /**
   * Register a handler for sticker messages
   * @param handler Type-safe handler that receives sticker messages with guaranteed sticker field
   */
  onSticker(handler: StickerMessageHandler): void;
  /**
   * Register a handler for interactive messages (buttons, lists, flows)
   * @param handler Type-safe handler that receives interactive messages with guaranteed interactive field
   */
  onInteractive(handler: InteractiveMessageHandler): void;
  /**
   * Register a handler for button messages
   * @param handler Type-safe handler that receives button messages with guaranteed button field
   */
  onButton(handler: ButtonMessageHandler): void;
  /**
   * Register a handler for location messages
   * @param handler Type-safe handler that receives location messages with guaranteed location field
   */
  onLocation(handler: LocationMessageHandler): void;
  /**
   * Register a handler for contact messages
   * @param handler Type-safe handler that receives contact messages with guaranteed contacts field
   */
  onContacts(handler: ContactsMessageHandler): void;
  /**
   * Register a handler for reaction messages
   * @param handler Type-safe handler that receives reaction messages with guaranteed reaction field
   */
  onReaction(handler: ReactionMessageHandler): void;
  /**
   * Register a handler for order messages
   * @param handler Type-safe handler that receives order messages with guaranteed order field
   */
  onOrder(handler: OrderMessageHandler): void;
  /**
   * Register a handler for system messages
   * @param handler Type-safe handler that receives system messages with guaranteed system field
   */
  onSystem(handler: SystemMessageHandler): void;
  /**
   * Register a handler for account_update webhook field
   * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#account_update
   */
  onAccountUpdate(handler: AccountUpdateHandler): void;
  /**
   * Register a handler for account_review_update webhook field
   * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#account_review_update
   */
  onAccountReviewUpdate(handler: AccountReviewUpdateHandler): void;
  /**
   * Register a handler for account_alerts webhook field
   * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#account_alerts
   */
  onAccountAlerts(handler: AccountAlertsHandler): void;
  /**
   * Register a handler for business_capability_update webhook field
   * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#business_capability_update
   */
  onBusinessCapabilityUpdate(handler: BusinessCapabilityUpdateHandler): void;
  /**
   * Register a handler for phone_number_name_update webhook field
   * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#phone_number_name_update
   */
  onPhoneNumberNameUpdate(handler: PhoneNumberNameUpdateHandler): void;
  /**
   * Register a handler for phone_number_quality_update webhook field
   * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#phone_number_quality_update
   */
  onPhoneNumberQualityUpdate(handler: PhoneNumberQualityUpdateHandler): void;
  /**
   * Register a handler for message_template_status_update webhook field
   * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#message_template_status_update
   */
  onMessageTemplateStatusUpdate(handler: MessageTemplateStatusUpdateHandler): void;
  /**
   * Register a handler for template_category_update webhook field
   * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#template_category_update
   */
  onTemplateCategoryUpdate(handler: TemplateCategoryUpdateHandler): void;
  /**
   * Register a handler for message_template_quality_update webhook field
   * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#message_template_quality_update
   */
  onMessageTemplateQualityUpdate(handler: MessageTemplateQualityUpdateHandler): void;
  /**
   * Register a handler for flows webhook field
   * @see https://developers.facebook.com/docs/whatsapp/flows/guides/implementingyourflowendpoint#webhooks
   */
  onFlows(handler: FlowsHandler): void;
  /**
   * Register a handler for security webhook field
   * @see https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#security
   */
  onSecurity(handler: SecurityHandler): void;
  /**
   * Register a handler for history webhook field
   * @see https://developers.facebook.com/docs/graph-api/webhooks/reference/whatsapp-business-account#history
   */
  onHistory(handler: HistoryHandler): void;
  /**
   * Register a handler for smb_message_echoes webhook field
   * @see https://developers.facebook.com/docs/graph-api/webhooks/reference/whatsapp-business-account#smb_message_echoes
   */
  onSmbMessageEchoes(handler: SmbMessageEchoesHandler): void;
  /**
   * Register a handler for smb_app_state_sync webhook field
   * @see https://developers.facebook.com/docs/graph-api/webhooks/reference/whatsapp-business-account#smb_app_state_sync
   */
  onSmbAppStateSync(handler: SmbAppStateSyncHandler): void;
  /**
   * Register a handler for account_settings_update webhook field
   */
  onAccountSettingsUpdate(handler: AccountSettingsUpdateHandler): void;
  /**
   * Register a handler for automatic_events webhook field
   */
  onAutomaticEvents(handler: AutomaticEventsHandler): void;
  /**
   * Register a handler for business_status_update webhook field
   */
  onBusinessStatusUpdate(handler: BusinessStatusUpdateHandler): void;
  /**
   * Register a handler for calls webhook field
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/reference/
   */
  onCalls(handler: CallsHandler): void;
  /**
   * Register a handler for group_lifecycle_update webhook field
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  onGroupLifecycleUpdate(handler: GroupLifecycleUpdateHandler): void;
  /**
   * Register a handler for group_participants_update webhook field
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  onGroupParticipantsUpdate(handler: GroupParticipantsUpdateHandler): void;
  /**
   * Register a handler for group_settings_update webhook field
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  onGroupSettingsUpdate(handler: GroupSettingsUpdateHandler): void;
  /**
   * Register a handler for group_status_update webhook field
   * @see https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference/
   */
  onGroupStatusUpdate(handler: GroupStatusUpdateHandler): void;
  /**
   * Register a handler for message_echoes webhook field
   * @see https://developers.facebook.com/docs/graph-api/webhooks/reference/whatsapp-business-account#message_echoes
   */
  onMessageEchoes(handler: MessageEchoesHandler): void;
  /**
   * Register a handler for message_template_components_update webhook field
   */
  onMessageTemplateComponentsUpdate(handler: MessageTemplateComponentsUpdateHandler): void;
  /**
   * Register a handler for messaging_handovers webhook field
   */
  onMessagingHandovers(handler: MessagingHandoversHandler): void;
  /**
   * Register a handler for partner_solutions webhook field
   */
  onPartnerSolutions(handler: PartnerSolutionsHandler): void;
  /**
   * Register a handler for payment_configuration_update webhook field
   */
  onPaymentConfigurationUpdate(handler: PaymentConfigurationUpdateHandler): void;
  /**
   * Register a handler for standby webhook field
   */
  onStandby(handler: StandbyHandler): void;
  /**
   * Register a handler for template_correct_category_detection webhook field
   */
  onTemplateCorrectCategoryDetection(handler: TemplateCorrectCategoryDetectionHandler): void;
  /**
   * Register a handler for tracking_events webhook field
   */
  onTrackingEvents(handler: TrackingEventsHandler): void;
  /**
   * Register a handler for user_preferences webhook field
   */
  onUserPreferences(handler: UserPreferencesHandler): void;
  /**
   * Remove a registered message handler by type
   */
  offMessage(type: MessageTypesEnum | string): void;
  /**
   * Remove the pre-process handler
   */
  offMessagePreProcess(): void;
  /**
   * Remove the post-process handler
   */
  offMessagePostProcess(): void;
  /**
   * Remove the status handler
   */
  offStatus(): void;
  /**
   * Remove the raw webhook handler
   */
  offRaw(): void;
  /**
   * Remove a registered flow handler by type
   */
  offFlow(type: FlowTypeEnum): void;
  /**
   * Remove all registered handlers
   */
  removeAllHandlers(): void;
  getClient(): WhatsApp;
  getConfig(): WabaConfigType;
}
//#endregion
//#region src/core/webhook/frameworks/handler.d.ts
interface BaseRequest {
  method?: string;
  url?: string;
  headers: Record<string, string | string[] | undefined>;
  body?: any;
  query?: Record<string, any> | URLSearchParams;
  rawBody?: any;
}
interface BaseResponse<T = any> {
  status(code: number): T;
  json?(data: any): T | undefined;
  send?(data?: any): T | undefined;
  setHeader?(name: string, value: string): void;
}
interface BaseWebhookConfig extends WhatsAppConfig {}
//#endregion
//#region src/core/webhook/frameworks/express/express.d.ts
interface ExpressRequest extends BaseRequest {
  method: string;
  url: string;
  headers: Record<string, string | string[] | undefined>;
  body?: any;
  query: Record<string, any>;
  rawBody?: any;
}
interface ExpressResponse extends BaseResponse<ExpressResponse> {
  status(code: number): ExpressResponse;
  json(data: any): ExpressResponse;
  send(data?: any): ExpressResponse;
  setHeader(name: string, value: string): void;
}
type NextFunction = (error?: any) => void;
interface ExpressWebhookConfig extends BaseWebhookConfig {
  path?: string;
}
declare function expressWebhookHandler(config: ExpressWebhookConfig): {
  GET: (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => Promise<WebhookResponse>;
  POST: (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => Promise<WebhookResponse>;
  webhook: (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => Promise<any>;
  flow: (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => Promise<WebhookResponse>;
  processor: WebhookProcessor;
} & {
  destroy: () => void;
};
//#endregion
//#region src/core/webhook/frameworks/nextjs-app/nextjs-app.d.ts
interface NextJsAppWebhookConfig extends WhatsAppConfig {}
declare function nextjsAppWebhookHandler(config: NextJsAppWebhookConfig): any;
//#endregion
//#region src/core/webhook/frameworks/nextjs-page/nextjs-page.d.ts
interface BaseApiRequest extends BaseRequest {
  method?: string;
  url?: string;
  headers: Record<string, string | string[] | undefined>;
  body?: any;
  query: Partial<Record<string, string | string[]>>;
  rawBody?: any;
}
interface BaseApiResponse extends BaseResponse {
  status(code: number): any;
  json(data: any): undefined | any;
  send(data?: any): undefined | any;
  setHeader(name: string, value: string): void;
}
interface NextJsWebhookConfig extends BaseWebhookConfig {}
declare function nextjsPagesWebhookHandler<TRequest extends BaseApiRequest, TResponse extends BaseApiResponse>(config: NextJsWebhookConfig): {
  /**
   * Destroy this handler instance: removes all registered handlers
   * and clears it from the singleton cache so the next call creates a fresh instance.
   */
  destroy: () => void;
  GET: (req: TRequest, res: TResponse) => Promise<WebhookResponse>;
  POST: (req: TRequest, res: TResponse) => Promise<WebhookResponse>;
  webhook: (req: TRequest, res: TResponse) => Promise<any>;
  flow: (req: TRequest, res: TResponse) => Promise<WebhookResponse>;
  processor: WebhookProcessor;
};
//#endregion
//#region src/core/webhook/utils/extractMessageText.d.ts
/**
 * Extracts a human-readable display text from any incoming WhatsApp message.
 *
 * Useful for logging, notifications, chat previews, and storing message summaries.
 *
 * @param message - The incoming WhatsApp message from a webhook handler
 * @returns A display-friendly string representing the message content
 *
 * @example
 * ```ts
 * handler.processor.onText(async (whatsapp, processed) => {
 *   const text = extractMessageText(processed.message);
 *   console.log(`Message from ${processed.message.from}: ${text}`);
 * });
 * ```
 */
declare function extractMessageText(message: WhatsAppMessage): string;
//#endregion
//#region src/core/webhook/utils/generateXHub256Sig.d.ts
declare const generateXHub256Sig: (body: string, appSecret: string) => string;
//#endregion
//#region src/core/webhook/utils/messageHelpers.d.ts
declare function isTextMessage(msg: WhatsAppMessage): msg is TextMessage;
declare function isImageMessage(msg: WhatsAppMessage): msg is ImageMessage;
declare function isVideoMessage(msg: WhatsAppMessage): msg is VideoMessage;
declare function isAudioMessage(msg: WhatsAppMessage): msg is AudioMessage;
declare function isDocumentMessage(msg: WhatsAppMessage): msg is DocumentMessage;
declare function isStickerMessage(msg: WhatsAppMessage): msg is StickerMessage;
declare function isInteractiveMessage(msg: WhatsAppMessage): msg is InteractiveMessage;
declare function isButtonMessage(msg: WhatsAppMessage): msg is ButtonMessage;
declare function isLocationMessage(msg: WhatsAppMessage): msg is LocationMessage;
declare function isContactsMessage(msg: WhatsAppMessage): msg is ContactsMessage;
declare function isReactionMessage(msg: WhatsAppMessage): msg is ReactionMessage;
declare function isOrderMessage(msg: WhatsAppMessage): msg is OrderMessage;
declare function isSystemMessage(msg: WhatsAppMessage): msg is SystemMessage;
declare function isButtonReply(msg: WhatsAppMessage): msg is InteractiveButtonReplyMessage;
declare function isListReply(msg: WhatsAppMessage): msg is InteractiveListReplyMessage;
declare function isNfmReply(msg: WhatsAppMessage): msg is InteractiveNfmReplyMessage;
type MediaInfo = {
  id: string;
  mimeType: string;
  sha256: string;
  caption?: string;
  filename?: string;
  animated?: boolean;
  voice?: boolean;
};
/**
 * Extract media info from image/video/audio/document/sticker messages.
 * Returns null if the message is not a media message.
 *
 * @example
 * ```ts
 * const media = getMediaInfo(message);
 * if (media) {
 *   const url = await sdk.media.get(media.id);
 * }
 * ```
 */
declare function getMediaInfo(msg: WhatsAppMessage): MediaInfo | null;
type InteractiveReply = {
  type: 'button_reply' | 'list_reply' | 'nfm_reply';
  id: string;
  title: string;
  description?: string;
  responseJson?: string;
};
/**
 * Extract the user's selection from interactive messages (button reply, list reply, nfm reply).
 * Returns null if not an interactive message.
 *
 * @example
 * ```ts
 * const reply = getInteractiveReply(message);
 * if (reply) {
 *   console.log(`User selected: ${reply.title} (id: ${reply.id})`);
 * }
 * ```
 */
declare function getInteractiveReply(msg: WhatsAppMessage): InteractiveReply | null;
type LocationInfo = {
  latitude: number;
  longitude: number;
  name?: string;
  address?: string;
  url?: string;
};
/**
 * Extract location data from a location message.
 * Returns null if not a location message.
 */
declare function getLocationInfo(msg: WhatsAppMessage): LocationInfo | null;
type ContactInfo = {
  formattedName: string;
  firstName?: string;
  lastName?: string;
  phones: string[];
  emails: string[];
};
/**
 * Extract contact info from a contacts message.
 * Returns empty array if not a contacts message.
 */
declare function getContactsInfo(msg: WhatsAppMessage): ContactInfo[];
type ReactionInfo = {
  messageId: string;
  emoji: string | null;
};
/**
 * Extract reaction data from a reaction message.
 * Returns null if not a reaction message.
 */
declare function getReactionInfo(msg: WhatsAppMessage): ReactionInfo | null;
type OrderInfo = {
  catalogId: string;
  text?: string;
  items: Array<{
    productId: string;
    quantity: number;
    price: number;
    currency: string;
  }>;
};
/**
 * Extract order data from an order message.
 * Returns null if not an order message.
 */
declare function getOrderInfo(msg: WhatsAppMessage): OrderInfo | null;
//#endregion
//#region src/utils/buildFieldsQueryString.d.ts
declare function buildFieldsQueryString(fields?: string[] | string): string;
//#endregion
//#region src/utils/configTable.d.ts
/**
 * Formats configuration as a terminal table
 * @param config - The WABA configuration object
 * @param apiName - The name of the API being initialized
 * @returns Formatted table string
 */
declare function formatConfigTable(config: WabaConfigType): string;
//#endregion
//#region src/utils/logger.d.ts
declare class Logger implements LoggerInterface {
  private name;
  private debug;
  constructor(name: string, debug?: boolean);
  private formatData;
  log(...data: any[]): void;
  error(...data: any[]): void;
  warn(...data: any[]): void;
  info(...data: any[]): void;
}
//#endregion
//#region src/utils/objectToQueryString.d.ts
declare const objectToQueryString: (params: Record<string, any>) => string;
//#endregion
//#region src/utils/flowTypeGuards.d.ts
declare const DATA_EXCHANGE_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT, FlowActionEnum.BACK];
declare const ERROR_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT];
/**
 * Type guard to check if a request is a Data Exchange request
 * Validates the request structure according to the Flow API specifications
 *
 * @param request The Flow endpoint request to check
 * @returns True if the request is a valid Data Exchange request, false otherwise
 */
declare function isFlowDataExchangeRequest(request: FlowEndpointRequest): request is FlowDataExchangeRequest & {
  action: (typeof DATA_EXCHANGE_ACTIONS)[number];
  screen?: string;
  flow_token: string;
  data?: Record<string, any>;
};
/**
 * Type guard to check if a request is an Error Notification request
 * Validates the request structure according to the Flow API error specifications
 *
 * @param request The Flow endpoint request to check
 * @returns True if the request is a valid Error Notification request, false otherwise
 */
declare function isFlowErrorRequest(request: FlowEndpointRequest): request is FlowErrorNotificationRequest & {
  action: (typeof ERROR_ACTIONS)[number];
  screen: string;
  flow_token: string;
  data: {
    error: string;
    error_message: string;
  };
};
/**
 * Type guard to check if a request is a Ping (health check) request
 * Simple validation for health check endpoints in the Flow API
 *
 * @param request The Flow endpoint request to check
 * @returns True if the request is a Ping request, false otherwise
 */
declare function isFlowPingRequest(request: FlowEndpointRequest): request is FlowHealthCheckRequest;
//#endregion
export { AUTHORIZATION_ERROR_CODES, AcceptCallRequest, AcceptSolutionRequest, AccountMode, AddPhoneNumbersRequest, ApiPermissionErrorCode, AssignedUserRequest, AssignedUsersListParams, AudioMediaObject, AudioMediaTypes, AudioMediaTypesEnum, AudioMediaTypesType, AudioMessage, AudioMessageHandler, AudioProcessedMessage, AuthenticationTemplateOptions, BLOCK_USER_ERROR_CODES, BaseApiRequest, BaseApiResponse, BaseClass, BlockUserObject, BlockUsersApi, BlockUsersClass, BlockUsersRequest, BlockUsersResponse, BlockedUserInfo, BodyOptions, BusinessApi, BusinessClass, BusinessComplianceInfoResponse, BusinessFieldsParam, BusinessGraphListResponse, BusinessGraphObject, BusinessListParams, BusinessProfileApi, BusinessProfileClass, BusinessProfileData, BusinessProfileField, BusinessProfileFieldsParam, BusinessProfileResponse, BusinessVerticalEnum, ButtonMessage, ButtonMessageHandler, ButtonOptions, ButtonPosition, ButtonPositionEnum, ButtonPositionType, ButtonProcessedMessage, CALLING_ERROR_CODES, CallAction, CallActionResponse, CallHours, CallHoursDay, CallHoursStatus, CallIconVisibility, CallPermission, CallPermissionAction, CallPermissionLimit, CallPermissionsResponse, CallSdpType, CallSession, CallbackPermissionStatus, CallingApi, CallingClass, CallingSettings, CallingSettingsResponse, CallingStatus, CarouselCard, CarouselOptions, CatalogButton, CatalogTemplateOptions, Category, CategoryEnum, CategoryType, CodeVerificationStatus, CommerceApi, CommerceClass, CommerceSetting, CommerceSettingsResponse, ComponentType, ComponentTypeType, ComponentTypes, ComponentTypesEnum, ContactInfo, ContactObject, ContactsMessage, ContactsMessageHandler, ContactsProcessedMessage, ConversationTypes, ConversationTypesEnum, ConversationTypesType, ConversationalAutomationRequest, ConversationalAutomationResponse, ConversationalCommand, ConversationalPrompt, CopyCodeButton, CouponTemplateOptions, CreateFlowResponse, CreateOBOMobilityIntentRequest, CreatePhoneNumberRequest, CreatePhoneNumberResponse, CreateQrCodeRequest, CreateScheduleRequest, CreateUploadSessionParams, CreateWhatsAppBusinessSolutionRequest, CurrencyCodesEnum, CurrencyParameter, CursorPaginationParams, Cursors, DataLocalizationRegion, DataLocalizationRegionEnum, DataLocalizationRegionType, DateTimeParameter, DocumentMediaObject, DocumentMediaTypes, DocumentMediaTypesEnum, DocumentMediaTypesType, DocumentMessage, DocumentMessageHandler, DocumentProcessedMessage, EncryptedMessageRequest, EncryptedMessagesResponse, EncryptionApi, EncryptionClass, EncryptionKeyPair, EncryptionPublicKeyResponse, ErrorWebhookValue, ExpressRequest, ExpressResponse, ExpressWebhookConfig, FLOW_ERROR_CODES, FailedUserInfo, Flow, FlowActionEnum, FlowApi, FlowAsset, FlowAssetsResponse, FlowButton, FlowCategoryEnum, FlowClass, FlowDataExchangeRequest, FlowDataExchangeResponse, FlowDecryptedRequestResponse, FlowEncryptedRequestPayload, FlowEndpointRequest, FlowEndpointResponse, FlowErrorNotificationRequest, FlowErrorNotificationResponse, FlowHandler, FlowHealthCheckRequest, FlowHealthCheckResponse, FlowHttpRequest, FlowMigrationFailure, FlowMigrationResponse, FlowMigrationResult, FlowPreview, FlowPreviewResponse, FlowStatusEnum, FlowSuccessScreenResponse, FlowType, FlowTypeEnum, FlowValidationError, FlowValidationErrorPointer, FlowsListResponse, FooterOptions, GROUP_ERROR_CODES, GeneralHeaderInterface, GeneralMessageBody, GeneralRequestBody, GetUploadHandleParams, GraphObject, GroupCreateRequest, GroupCreateResponse, GroupInfoField, GroupInfoFieldsParam, GroupInfoResponse, GroupInviteLinkResponse, GroupJoinApprovalMode, GroupJoinRequest, GroupJoinRequestError, GroupJoinRequestFailure, GroupJoinRequestsActionResponse, GroupJoinRequestsResponse, GroupListParams, GroupListResponse, GroupMessage, GroupParticipant, GroupParticipantInput, GroupParticipantsRequest, GroupSettingsResponse, GroupsApi, GroupsClass, HeaderOptions, HealthStatus, HealthStatusEntity, HolidaySchedule, HostPlatform, HttpMethods, HttpMethodsEnum, HttpMethodsType, HttpsClientClass, HttpsClientResponseClass, INTEGRITY_ERROR_CODES, ImageMediaObject, ImageMediaTypes, ImageMediaTypesEnum, ImageMediaTypesType, ImageMessage, ImageMessageHandler, ImageProcessedMessage, InitiateCallRequest, InitiateCallResponse, InteractiveButtonReplyMessage, InteractiveListReplyMessage, InteractiveMessage, InteractiveMessageHandler, InteractiveObject, InteractiveProcessedMessage, InteractiveReply, InteractiveTypes, InteractiveTypesEnum, InteractiveTypesType, Languages, LanguagesEnum, LanguagesType, LimitedTimeOfferOptions, LimitedTimeOfferTemplateOptions, ListBlockedUsersParams, ListBlockedUsersResponse, LocationInfo, LocationMessage, LocationMessageHandler, LocationObject, LocationParameter, LocationProcessedMessage, Logger, LoggerInterface, MPMButton, MPMTemplateOptions, MarketingMessageRequest, MarketingMessagesApi, MarketingMessagesClass, MediaApi, MediaCardCarouselTemplateOptions, MediaCarouselCard, MediaClass, MediaInfo, MediaParameter, MediaResponse, MediasResponse, MessagesApi as MessageApi, MessagesApi, MessageHandler, MessageHistoryApi, MessageHistoryClass, MessageHistoryEventListParams, MessageHistoryFieldsParam, MessageHistoryItem, MessageHistoryListParams, MessageHistoryResponse, MessageRecipientType, MessageRequestBody, MessageRequestParams, MessageStatus, MessageTemplateObject, MessageTemplateRequestBody, MessageTypes, MessageTypesEnum, MessageTypesType, MessageWebhookValue, MessagesClass, MessagesResponse, MessagingLimitTier, MetaError, MetaErrorData, MetaErrorDetail, NextFunction, NextJsAppWebhookConfig, NextJsWebhookConfig, OTPButton, OTPTemplateOptions, OfficialBusinessAccountAction, OfficialBusinessAccountApplicationData, OfficialBusinessAccountStatusResponse, OnboardPartnersToMMLiteRequest, OrderInfo, OrderMessage, OrderMessageHandler, OrderProcessedMessage, Pagination, PaginationCursors, Paging, PagingCursors, PagingInfo, ParametersTypes, ParametersTypesEnum, ParametersTypesType, PaymentConfiguration, PaymentConfigurationCode, PaymentConfigurationCreateRequest, PaymentConfigurationCreateResponse, PaymentConfigurationDeleteRequest, PaymentConfigurationOauthLinkRequest, PaymentConfigurationOauthLinkResponse, PaymentConfigurationProvider, PaymentConfigurationStatus, PaymentConfigurationUpdateRequest, PaymentConfigurationUpdateResponse, PaymentConfigurationsResponse, PaymentsApi, PaymentsClass, PhoneNumberApi, PhoneNumberButton, PhoneNumberClass, PhoneNumberField, PhoneNumberFieldsParam, PhoneNumberFilter, PhoneNumberResponse, PhoneNumberSettingsFieldsParam, PhoneNumberSettingsParams, PhoneNumberSettingsResponse, PhoneNumberSort, PhoneNumberStatus, PhoneNumbersListParams, PhoneNumbersResponse, PlatformType, PreAcceptCallRequest, ProcessedMessage, ProcessedStatus, ProductCardCarouselTemplateOptions, ProductCarouselCard, ProductParameter, ProductSection, QrCodeApi, QrCodeClass, QrCodeResponse, QrCodesResponse, QualityRating, QualityScore, QuickReplyButton, ReactionInfo, ReactionMessage, ReactionMessageHandler, ReactionParams, ReactionProcessedMessage, ReferralSourceTypes, ReferralSourceTypesEnum, ReferralSourceTypesType, RegistrationApi, RegistrationClass, RegistrationRequest, RejectCallRequest, RejectSolutionRequest, RemoveAssignedUserRequest, RequestCodeMethods, RequestCodeMethodsEnum, RequestCodeMethodsType, RequestPreVerifiedPhoneNumberCodeRequest, RequestVerificationCodeRequest, RequesterClass, RequesterResponseInterface, ResponseData, ResponseHeaderValue, ResponseHeaders, ResponseJSONBody, ResponsePagination, ResponseSuccess, SEND_MESSAGE_ERROR_CODES, SPMButton, SPMTemplateOptions, SetOBOMobilityIntentRequest, SetSolutionMigrationIntentRequest, SharePreVerifiedPhoneNumberRequest, SipServer, SipSettings, SipStatus, SolutionDeactivationRequest, SolutionFieldsParam, SolutionGraphObject, SolutionListParams, SolutionListResponse, SolutionMigrationIntent, SolutionsApi, SolutionsClass, Status, StatusEnum, StatusHandler, StatusParams, StatusResponse, StatusType, StatusWebhook, StatusWebhookValue, StickerMediaObject, StickerMediaTypes, StickerMediaTypesEnum, StickerMediaTypesType, StickerMessage, StickerMessageHandler, StickerProcessedMessage, SubType, SubTypeEnum, SubTypeType, SystemChangeTypes, SystemChangeTypesEnum, SystemChangeTypesType, SystemMessage, SystemMessageHandler, SystemProcessedMessage, THROTTLING_ERROR_CODES, TemplateApi, TemplateBody, TemplateButton, TemplateButtons, TemplateCarousel, TemplateClass, TemplateDeleteParams, TemplateFooter, TemplateFormat, TemplateGetParams, TemplateHeader, TemplateHeaderExample, TemplateLimitedTimeOffer, TemplateOptions, TemplateParameter, TemplateRequestBody, TemplateResponse, TemplateStatus, TemplateStatusEnum, TemplateStatusType, TerminateCallRequest, TextMessage, TextMessageHandler, TextMessageParams, TextObject, TextParameter, TextProcessedMessage, Throughput, ThroughputLevel, ThroughputResponse, TwoStepVerificationApi, TwoStepVerificationClass, TwoStepVerificationParams, TwoStepVerificationRequest, URLButton, UnblockUsersRequest, UnifiedCertStatus, UnsupportedMessage, UpdateBusinessComplianceInfoRequest, UpdateBusinessProfileRequest, UpdateCallingSettingsRequest, UpdateCommerceSettingsRequest, UpdateFlowResponse, UpdateGroupSettingsRequest, UpdateOfficialBusinessAccountStatusRequest, UpdatePhoneNumberSettingsRequest, UpdatePhoneNumberStatusRequest, UpdateQrCodeRequest, UpdateWabaAccountRequest, UpdateWabaSubscription, UpdateWhatsAppBusinessProfileRequest, UploadBusinessProfileResponse, UploadHandle, UploadMediaParams, UploadMediaResponse, UploadSession, UploadSessionResponse, ValidateFlowJsonResponse, VerifyCodeRequest, VerifyPreVerifiedPhoneNumberCodeRequest, VideoMediaObject, VideoMediaTypes, VideoMediaTypesEnum, VideoMediaTypesType, VideoMessage, VideoMessageHandler, VideoProcessedMessage, WABAClass, WHATSAPP_ERROR_CODES, WabaAccount, WabaAccountFields, WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaApi, WabaBusinessVerificationStatus, WabaConfigEnum, WabaConfigType, WabaFieldsParam, WabaGraphObject, WabaHealthStatus, WabaHealthStatusCanSendMessage, WabaHealthStatusEntity, WabaHealthStatusError, WabaListParams, WabaListResponse, WabaSubscription, WabaSubscriptions, WebhookContact, WebhookEvent, WebhookHandlerContext, WebhookMessage, WebhookPayload, WebhookProcessor, WebhookResponse, WebhookTypes, WebhookTypesEnum, WebhookTypesType, WebhookValue, WeeklyOperatingHours, WhatsApp, WhatsAppApiError, WhatsAppAuthorizationError, WhatsAppBlockUserError, WhatsAppCallingError, WhatsAppConfig, WhatsAppError, WhatsAppErrorCode, WhatsAppFlowError, WhatsAppGroupError, WhatsAppIntegrityError, WhatsAppMessage, WhatsAppNetworkError, WhatsAppSendMessageError, WhatsAppThrottlingError, WhatsAppUnknownError, WhatsAppValidationError, buildFieldsQueryString, constructFullUrl, createAuthenticationTemplate, createCatalogTemplate, createCouponTemplate, createLimitedTimeOfferTemplate, createMPMTemplate, createMediaCardCarouselTemplate, createOTPTemplate, createProductCardCarouselTemplate, createSPMTemplate, createTemplate, createWhatsAppApiError, decryptFlowRequest, encryptFlowResponse, expressWebhookHandler, extractMessageText, formatConfigTable, generateEncryption, generateXHub256Sig, getContactsInfo, getInteractiveReply, getLocationInfo, getMediaInfo, getOrderInfo, getReactionInfo, isApiPermissionErrorCode, isAudioMessage, isAuthorizationErrorCode, isBlockUserErrorCode, isButtonMessage, isButtonReply, isCallingErrorCode, isContactsMessage, isDocumentMessage, isFlowDataExchangeRequest, isFlowErrorCode, isFlowErrorRequest, isFlowPingRequest, isGroupErrorCode, isImageMessage, isIntegrityErrorCode, isInteractiveMessage, isListReply, isLocationMessage, isMetaError, isNfmReply, isOrderMessage, isReactionMessage, isSendMessageErrorCode, isStickerMessage, isSystemMessage, isTextMessage, isThrottlingErrorCode, isVideoMessage, isWhatsAppApiErrorResponse, isWhatsAppAuthorizationError, isWhatsAppBlockUserError, isWhatsAppCallingError, isWhatsAppErrorCode, isWhatsAppFlowError, isWhatsAppGroupError, isWhatsAppIntegrityError, isWhatsAppSendMessageError, isWhatsAppThrottlingError, nextjsAppWebhookHandler, nextjsPagesWebhookHandler, normalizeMetaError, objectToQueryString, processFlowRequest, processWebhookMessages };
//# sourceMappingURL=index.d.mts.map