meta-cloud-api 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/dist/{common-CvPVD1o6.d.ts → api/flow/types/common.d.ts} +2 -2
  2. package/dist/{common-CvPVD1o6.d.ts.map → api/flow/types/common.d.ts.map} +1 -1
  3. package/dist/api/flow/types/common.js +51 -0
  4. package/dist/{common-C6FXBDm7.js.map → api/flow/types/common.js.map} +1 -1
  5. package/dist/api/flow/types/index.d.ts +1 -0
  6. package/dist/api/flow/types/index.js +1 -0
  7. package/dist/api/media/types/common.d.ts +32 -0
  8. package/dist/api/media/types/common.d.ts.map +1 -0
  9. package/dist/api/media/types/index.d.ts +1 -0
  10. package/dist/api/messages/types/common.d.ts +99 -0
  11. package/dist/api/messages/types/common.d.ts.map +1 -0
  12. package/dist/api/messages/types/contact.d.ts +54 -0
  13. package/dist/api/messages/types/contact.d.ts.map +1 -0
  14. package/dist/api/messages/types/index.d.ts +8 -0
  15. package/dist/api/messages/types/interactive.d.ts +182 -0
  16. package/dist/api/messages/types/interactive.d.ts.map +1 -0
  17. package/dist/api/messages/types/location.d.ts +16 -0
  18. package/dist/api/messages/types/location.d.ts.map +1 -0
  19. package/dist/api/messages/types/media.d.ts +55 -0
  20. package/dist/api/messages/types/media.d.ts.map +1 -0
  21. package/dist/api/messages/types/reaction.d.ts +17 -0
  22. package/dist/api/messages/types/reaction.d.ts.map +1 -0
  23. package/dist/api/messages/types/template.d.ts +72 -0
  24. package/dist/api/messages/types/template.d.ts.map +1 -0
  25. package/dist/api/messages/types/text.d.ts +17 -0
  26. package/dist/api/messages/types/text.d.ts.map +1 -0
  27. package/dist/api/phone/types/common.d.ts +83 -0
  28. package/dist/api/phone/types/common.d.ts.map +1 -0
  29. package/dist/api/phone/types/index.d.ts +1 -0
  30. package/dist/api/profile/types/common.d.ts +149 -0
  31. package/dist/api/profile/types/common.d.ts.map +1 -0
  32. package/dist/api/profile/types/index.d.ts +2 -0
  33. package/dist/api/profile/types/upload.d.ts +73 -0
  34. package/dist/api/profile/types/upload.d.ts.map +1 -0
  35. package/dist/api/qrCode/types/common.d.ts +28 -0
  36. package/dist/api/qrCode/types/common.d.ts.map +1 -0
  37. package/dist/api/qrCode/types/index.d.ts +1 -0
  38. package/dist/api/template/types/common.d.ts +155 -0
  39. package/dist/api/template/types/common.d.ts.map +1 -0
  40. package/dist/api/template/types/factory.d.ts +202 -0
  41. package/dist/api/template/types/factory.d.ts.map +1 -0
  42. package/dist/api/template/types/index.d.ts +2 -0
  43. package/dist/{index-CeTmbIXi.d.ts → api/waba/types/common.d.ts} +3 -61
  44. package/dist/api/waba/types/common.d.ts.map +1 -0
  45. package/dist/api/waba/types/common.js +44 -0
  46. package/dist/api/waba/types/common.js.map +1 -0
  47. package/dist/api/waba/types/index.d.ts +1 -0
  48. package/dist/api/waba/types/index.js +1 -0
  49. package/dist/chunk-PECeCxCb.js +15 -0
  50. package/dist/client.d.ts +25 -0
  51. package/dist/client.js +6 -0
  52. package/dist/{WebhookProcessor-Dq2Pa2cY.d.ts → core/webhook/types.d.ts} +74 -55
  53. package/dist/core/webhook/types.d.ts.map +1 -0
  54. package/dist/{base-CfDkvT1x.d.ts → enums.d.ts} +3 -142
  55. package/dist/enums.d.ts.map +1 -0
  56. package/dist/enums.js +681 -0
  57. package/dist/enums.js.map +1 -0
  58. package/dist/index.d.ts +4386 -21
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +3436 -1
  61. package/dist/index.js.map +1 -1
  62. package/dist/types/base.d.ts +19 -0
  63. package/dist/types/base.d.ts.map +1 -0
  64. package/dist/types/config.d.ts +80 -0
  65. package/dist/types/config.d.ts.map +1 -0
  66. package/dist/types/enums.d.ts +668 -0
  67. package/dist/types/enums.d.ts.map +1 -0
  68. package/dist/types/enums.js +681 -0
  69. package/dist/types/enums.js.map +1 -0
  70. package/dist/{index-DQkgkiB6.d.ts → types/httpsClient.d.ts} +3 -12
  71. package/dist/types/httpsClient.d.ts.map +1 -0
  72. package/dist/types/index.d.ts +24 -3
  73. package/dist/types/index.js +5 -1
  74. package/dist/types/logger.d.ts +11 -0
  75. package/dist/types/logger.d.ts.map +1 -0
  76. package/dist/types/request.d.ts +52 -0
  77. package/dist/types/request.d.ts.map +1 -0
  78. package/dist/utils/isMetaError.d.ts +23 -0
  79. package/dist/utils/isMetaError.d.ts.map +1 -0
  80. package/package.json +19 -22
  81. package/dist/WebhookProcessor-BUZFeZD_.js +0 -3
  82. package/dist/WebhookProcessor-BUZFeZD_.js.map +0 -1
  83. package/dist/WebhookProcessor-Dq2Pa2cY.d.ts.map +0 -1
  84. package/dist/api/encryption/index.d.ts +0 -3
  85. package/dist/api/encryption/index.js +0 -1
  86. package/dist/api/flow/index.d.ts +0 -5
  87. package/dist/api/flow/index.js +0 -1
  88. package/dist/api/index.d.ts +0 -17
  89. package/dist/api/index.js +0 -1
  90. package/dist/api/media/index.d.ts +0 -3
  91. package/dist/api/media/index.js +0 -1
  92. package/dist/api/messages/builders/index.d.ts +0 -539
  93. package/dist/api/messages/builders/index.d.ts.map +0 -1
  94. package/dist/api/messages/builders/index.js +0 -2
  95. package/dist/api/messages/builders/index.js.map +0 -1
  96. package/dist/api/messages/index.d.ts +0 -4
  97. package/dist/api/messages/index.js +0 -1
  98. package/dist/api/phone/index.d.ts +0 -3
  99. package/dist/api/phone/index.js +0 -1
  100. package/dist/api/profile/index.d.ts +0 -3
  101. package/dist/api/profile/index.js +0 -1
  102. package/dist/api/qrCode/index.d.ts +0 -3
  103. package/dist/api/qrCode/index.js +0 -1
  104. package/dist/api/registration/index.d.ts +0 -3
  105. package/dist/api/registration/index.js +0 -1
  106. package/dist/api/template/index.d.ts +0 -3
  107. package/dist/api/template/index.js +0 -1
  108. package/dist/api/twoStepVerification/index.d.ts +0 -3
  109. package/dist/api/twoStepVerification/index.js +0 -1
  110. package/dist/api/waba/index.d.ts +0 -3
  111. package/dist/api/waba/index.js +0 -1
  112. package/dist/api-8hRAOyaL.js +0 -1
  113. package/dist/base-CfDkvT1x.d.ts.map +0 -1
  114. package/dist/base-D-cXu_lA.js +0 -2
  115. package/dist/base-D-cXu_lA.js.map +0 -1
  116. package/dist/buildFieldsQueryString-Cr-jz3p0.js +0 -2
  117. package/dist/buildFieldsQueryString-Cr-jz3p0.js.map +0 -1
  118. package/dist/chunk-CTAAG5j7.js +0 -1
  119. package/dist/common-C6FXBDm7.js +0 -2
  120. package/dist/common-CVbsmD26.d.ts +0 -426
  121. package/dist/common-CVbsmD26.d.ts.map +0 -1
  122. package/dist/core/webhook/frameworks/express.d.ts +0 -20
  123. package/dist/core/webhook/frameworks/express.js +0 -1
  124. package/dist/core/webhook/frameworks/nextjs-app.d.ts +0 -45
  125. package/dist/core/webhook/frameworks/nextjs-app.d.ts.map +0 -1
  126. package/dist/core/webhook/frameworks/nextjs-app.js +0 -2
  127. package/dist/core/webhook/frameworks/nextjs-app.js.map +0 -1
  128. package/dist/core/webhook/frameworks/nextjs.d.ts +0 -20
  129. package/dist/core/webhook/frameworks/nextjs.js +0 -1
  130. package/dist/core/webhook/index.d.ts +0 -20
  131. package/dist/core/webhook/index.js +0 -1
  132. package/dist/core/whatsapp/index.d.ts +0 -18
  133. package/dist/core/whatsapp/index.js +0 -1
  134. package/dist/encryption-Cwc0xcVL.js +0 -2
  135. package/dist/encryption-Cwc0xcVL.js.map +0 -1
  136. package/dist/enums-CSUpFXb8.js +0 -2
  137. package/dist/enums-CSUpFXb8.js.map +0 -1
  138. package/dist/express-B6fQdflY.d.ts +0 -78
  139. package/dist/express-B6fQdflY.d.ts.map +0 -1
  140. package/dist/express-CrfNLYMM.js +0 -2
  141. package/dist/express-CrfNLYMM.js.map +0 -1
  142. package/dist/flow-CVes0Qus.js +0 -2
  143. package/dist/flow-CVes0Qus.js.map +0 -1
  144. package/dist/flowTypeGuards-Gn3-slCW.js +0 -2
  145. package/dist/flowTypeGuards-Gn3-slCW.js.map +0 -1
  146. package/dist/handler-BGqjZ0xg.js +0 -2
  147. package/dist/handler-BGqjZ0xg.js.map +0 -1
  148. package/dist/index-3KglHVAg.d.ts +0 -354
  149. package/dist/index-3KglHVAg.d.ts.map +0 -1
  150. package/dist/index-BNeg6hHx.d.ts +0 -99
  151. package/dist/index-BNeg6hHx.d.ts.map +0 -1
  152. package/dist/index-BiTq23oi.d.ts +0 -34
  153. package/dist/index-BiTq23oi.d.ts.map +0 -1
  154. package/dist/index-BmfnREgM.d.ts +0 -47
  155. package/dist/index-BmfnREgM.d.ts.map +0 -1
  156. package/dist/index-CaGffSja.d.ts +0 -24
  157. package/dist/index-CaGffSja.d.ts.map +0 -1
  158. package/dist/index-CeTmbIXi.d.ts.map +0 -1
  159. package/dist/index-CoyByMuM.d.ts +0 -137
  160. package/dist/index-CoyByMuM.d.ts.map +0 -1
  161. package/dist/index-CwujtcvH.d.ts +0 -370
  162. package/dist/index-CwujtcvH.d.ts.map +0 -1
  163. package/dist/index-DQ7z58xp.d.ts +0 -104
  164. package/dist/index-DQ7z58xp.d.ts.map +0 -1
  165. package/dist/index-DQkgkiB6.d.ts.map +0 -1
  166. package/dist/index-LKrIp3Oo.d.ts +0 -1
  167. package/dist/index-_-06JPan.d.ts +0 -143
  168. package/dist/index-_-06JPan.d.ts.map +0 -1
  169. package/dist/index-a_YS40Iv.d.ts +0 -91
  170. package/dist/index-a_YS40Iv.d.ts.map +0 -1
  171. package/dist/index-d7TLqtYh.d.ts +0 -171
  172. package/dist/index-d7TLqtYh.d.ts.map +0 -1
  173. package/dist/isMetaError-B3AglYeY.d.ts +0 -66
  174. package/dist/isMetaError-B3AglYeY.d.ts.map +0 -1
  175. package/dist/media-Dw5OGzDD.js +0 -2
  176. package/dist/media-Dw5OGzDD.js.map +0 -1
  177. package/dist/messages-h5-NW8QO.js +0 -2
  178. package/dist/messages-h5-NW8QO.js.map +0 -1
  179. package/dist/nextjs-DxRCL4t3.js +0 -2
  180. package/dist/nextjs-DxRCL4t3.js.map +0 -1
  181. package/dist/objectToQueryString-CAHI0qTs.js +0 -2
  182. package/dist/objectToQueryString-CAHI0qTs.js.map +0 -1
  183. package/dist/phone-CZyWLyWB.js +0 -2
  184. package/dist/phone-CZyWLyWB.js.map +0 -1
  185. package/dist/profile-Bb7GDP0n.js +0 -2
  186. package/dist/profile-Bb7GDP0n.js.map +0 -1
  187. package/dist/qrCode-CeZEtX9J.js +0 -2
  188. package/dist/qrCode-CeZEtX9J.js.map +0 -1
  189. package/dist/registration-BkjhC3xw.js +0 -2
  190. package/dist/registration-BkjhC3xw.js.map +0 -1
  191. package/dist/template-Bgy-BCXJ.js +0 -2
  192. package/dist/template-Bgy-BCXJ.js.map +0 -1
  193. package/dist/twoStepVerification-DYlYF_P5.js +0 -2
  194. package/dist/twoStepVerification-DYlYF_P5.js.map +0 -1
  195. package/dist/utils/index.d.ts +0 -43
  196. package/dist/utils/index.d.ts.map +0 -1
  197. package/dist/utils/index.js +0 -1
  198. package/dist/version-BUuqrHc6.js +0 -3
  199. package/dist/version-BUuqrHc6.js.map +0 -1
  200. package/dist/waba-SF2W3z2U.js +0 -2
  201. package/dist/waba-SF2W3z2U.js.map +0 -1
  202. package/dist/webhook-D4DQ01Xq.js +0 -2
  203. package/dist/webhook-D4DQ01Xq.js.map +0 -1
  204. package/dist/whatsapp-B85mxH5f.js +0 -10
  205. package/dist/whatsapp-B85mxH5f.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,21 +1,4386 @@
1
- import { AudioMediaTypesEnum, BusinessVerticalEnum, ButtonPositionEnum, CategoryEnum, ComponentTypesEnum, ConversationTypesEnum, CurrencyCodesEnum, DataLocalizationRegionEnum, DocumentMediaTypesEnum, GeneralHeaderInterface, GeneralRequestBody, HttpMethodsEnum, ImageMediaTypesEnum, InteractiveTypesEnum, LanguagesEnum, MessageTypesEnum, Paging, ParametersTypesEnum, RequestCodeMethodsEnum, RequesterResponseInterface, ResponseData, ResponsePagination, ResponseSuccess, StatusEnum, StickerMediaTypesEnum, SubTypeEnum, SystemChangeTypesEnum, TemplateStatusEnum, VideoMediaTypesEnum, WabaConfigEnum, WabaConfigType, WebhookTypesEnum, WhatsAppConfig } from "./base-CfDkvT1x.js";
2
- import { EncryptionApi, EncryptionPublicKeyResponse } from "./index-CaGffSja.js";
3
- import "./index-DQkgkiB6.js";
4
- import { Flow, FlowActionEnum, FlowAsset, FlowAssetsResponse, FlowCategoryEnum, FlowClass, FlowDataExchangeRequest, FlowDataExchangeResponse, FlowDecryptedRequestResponse, FlowEncryptedRequestPayload, FlowEndpointRequest, FlowEndpointResponse, FlowErrorNotificationRequest, FlowErrorNotificationResponse, FlowHealthCheckRequest, FlowHealthCheckResponse, FlowHttpRequest, FlowMigrationFailure, FlowMigrationResponse, FlowMigrationResult, FlowPreview, FlowPreviewResponse, FlowStatusEnum, FlowSuccessScreenResponse, FlowType, FlowTypeEnum, FlowValidationError, FlowValidationErrorPointer, FlowsListResponse, Pagination, PaginationCursors, UpdateFlowResponse, ValidateFlowJsonResponse } from "./common-CvPVD1o6.js";
5
- import { FlowApi } from "./index-CoyByMuM.js";
6
- import { MediaApi, MediaClass, MediaResponse, MediasResponse, UploadMediaResponse } from "./index-a_YS40Iv.js";
7
- import { AudioMediaObject, ContactObject, DocumentMediaObject, GeneralMessageBody, ImageMediaObject, InteractiveObject, LocationObject, MessageRequestBody, MessageRequestParams, MessageTemplateObject, MessagesClass, MessagesResponse, ReactionParams, StatusParams, StickerMediaObject, TextMessageParams, TextObject, VideoMediaObject } from "./common-CVbsmD26.js";
8
- import { MessagesApi } from "./index-d7TLqtYh.js";
9
- import { AccountMode, CodeVerificationStatus, Cursors, HealthStatus, HealthStatusEntity, MessagingLimitTier, PhoneNumberApi, PhoneNumberClass, PhoneNumberResponse, PhoneNumbersResponse, PlatformType, QualityRating, QualityScore, RequestVerificationCodeRequest, Throughput, ThroughputLevel, TwoStepVerificationParams, VerifyCodeRequest } from "./index-_-06JPan.js";
10
- import { BusinessProfileApi, BusinessProfileClass, BusinessProfileData, BusinessProfileField, BusinessProfileFieldsParam, BusinessProfileResponse, UpdateBusinessProfileRequest } from "./index-3KglHVAg.js";
11
- import { CreateQrCodeRequest, QrCodeApi, QrCodeClass, QrCodeResponse, QrCodesResponse, UpdateQrCodeRequest } from "./index-BNeg6hHx.js";
12
- import { RegistrationApi, RegistrationClass, RegistrationRequest } from "./index-BmfnREgM.js";
13
- import { AuthenticationTemplateOptions, BodyOptions, ButtonOptions, CarouselCard, CarouselOptions, CatalogButton, CatalogTemplateOptions, ComponentTypes, CopyCodeButton, CouponTemplateOptions, CurrencyParameter, DateTimeParameter, FlowButton, FooterOptions, HeaderOptions, LimitedTimeOfferOptions, LimitedTimeOfferTemplateOptions, LocationParameter, MPMButton, MPMTemplateOptions, MediaCardCarouselTemplateOptions, MediaCarouselCard, MediaParameter, OTPButton, OTPTemplateOptions, PhoneNumberButton, ProductCardCarouselTemplateOptions, ProductCarouselCard, ProductParameter, ProductSection, QuickReplyButton, SPMButton, SPMTemplateOptions, TemplateApi, TemplateBody, TemplateButton, TemplateButtons, TemplateCarousel, TemplateClass, TemplateDeleteParams, TemplateFooter, TemplateFormat, TemplateGetParams, TemplateHeader, TemplateHeaderExample, TemplateLimitedTimeOffer, TemplateOptions, TemplateParameter, TemplateRequestBody, TemplateResponse, TextParameter, URLButton } from "./index-CwujtcvH.js";
14
- import { TwoStepVerificationApi, TwoStepVerificationClass, TwoStepVerificationRequest } from "./index-BiTq23oi.js";
15
- import { UpdateWabaSubscription, WABAClass, WabaAccount, WabaAccountFields, WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaApi, WabaBusinessVerificationStatus, WabaHealthStatus, WabaHealthStatusCanSendMessage, WabaHealthStatusEntity, WabaHealthStatusError, WabaSubscription, WabaSubscriptions } from "./index-CeTmbIXi.js";
16
- import "./index-LKrIp3Oo.js";
17
- import { WhatsApp } from "./index-DQ7z58xp.js";
18
- import { WebhookContact, WebhookEvent, WebhookMessage } from "./WebhookProcessor-Dq2Pa2cY.js";
19
- import { webhookHandler, webhookHandler$1 } from "./express-B6fQdflY.js";
20
- import { MetaError, isFlowDataExchangeRequest, isFlowErrorRequest, isFlowPingRequest, isMetaError } from "./isMetaError-B3AglYeY.js";
21
- export { type AccountMode, type AudioMediaObject, AudioMediaTypesEnum, type AuthenticationTemplateOptions, type BodyOptions, BusinessProfileApi, type BusinessProfileClass, type BusinessProfileData, type BusinessProfileField, type BusinessProfileFieldsParam, type BusinessProfileResponse, BusinessVerticalEnum, type ButtonOptions, ButtonPositionEnum, type CarouselCard, type CarouselOptions, type CatalogButton, type CatalogTemplateOptions, CategoryEnum, type CodeVerificationStatus, type ComponentTypes, ComponentTypesEnum, type ContactObject, ConversationTypesEnum, type CopyCodeButton, type CouponTemplateOptions, type CreateQrCodeRequest, CurrencyCodesEnum, type CurrencyParameter, type Cursors, DataLocalizationRegionEnum, type DateTimeParameter, type DocumentMediaObject, DocumentMediaTypesEnum, EncryptionApi, type EncryptionPublicKeyResponse, webhookHandler as ExpressWebhook, type Flow, FlowActionEnum, FlowApi, type FlowAsset, type FlowAssetsResponse, type FlowButton, FlowCategoryEnum, type FlowClass, type FlowDataExchangeRequest, type FlowDataExchangeResponse, type FlowDecryptedRequestResponse, type FlowEncryptedRequestPayload, type FlowEndpointRequest, type FlowEndpointResponse, type FlowErrorNotificationRequest, type FlowErrorNotificationResponse, type FlowHealthCheckRequest, type FlowHealthCheckResponse, type FlowHttpRequest, type FlowMigrationFailure, type FlowMigrationResponse, type FlowMigrationResult, type FlowPreview, type FlowPreviewResponse, FlowStatusEnum, type FlowSuccessScreenResponse, type FlowType, FlowTypeEnum, type FlowValidationError, type FlowValidationErrorPointer, type FlowsListResponse, type FooterOptions, type GeneralHeaderInterface, type GeneralMessageBody, type GeneralRequestBody, type HeaderOptions, type HealthStatus, type HealthStatusEntity, HttpMethodsEnum, type ImageMediaObject, ImageMediaTypesEnum, type InteractiveObject, InteractiveTypesEnum, LanguagesEnum, type LimitedTimeOfferOptions, type LimitedTimeOfferTemplateOptions, type LocationObject, type LocationParameter, type MPMButton, type MPMTemplateOptions, MediaApi, type MediaCardCarouselTemplateOptions, type MediaCarouselCard, type MediaClass, type MediaParameter, type MediaResponse, type MediasResponse, type MessageRequestBody, type MessageRequestParams, type MessageTemplateObject, MessageTypesEnum, MessagesApi, type MessagesClass, type MessagesResponse, type MessagingLimitTier, type MetaError, webhookHandler$1 as NextJsWebhook, type OTPButton, type OTPTemplateOptions, type Pagination, type PaginationCursors, type Paging, ParametersTypesEnum, PhoneNumberApi, type PhoneNumberButton, type PhoneNumberClass, type PhoneNumberResponse, type PhoneNumbersResponse, type PlatformType, type ProductCardCarouselTemplateOptions, type ProductCarouselCard, type ProductParameter, type ProductSection, QrCodeApi, type QrCodeClass, type QrCodeResponse, type QrCodesResponse, type QualityRating, type QualityScore, type QuickReplyButton, type ReactionParams, RegistrationApi, type RegistrationClass, type RegistrationRequest, RequestCodeMethodsEnum, type RequestVerificationCodeRequest, type RequesterResponseInterface, type ResponseData, type ResponsePagination, type ResponseSuccess, type SPMButton, type SPMTemplateOptions, StatusEnum, type StatusParams, type StickerMediaObject, StickerMediaTypesEnum, SubTypeEnum, SystemChangeTypesEnum, TemplateApi, type TemplateBody, type TemplateButton, type TemplateButtons, type TemplateCarousel, type TemplateClass, type TemplateDeleteParams, type TemplateFooter, type TemplateFormat, type TemplateGetParams, type TemplateHeader, type TemplateHeaderExample, type TemplateLimitedTimeOffer, type TemplateOptions, type TemplateParameter, type TemplateRequestBody, type TemplateResponse, TemplateStatusEnum, type TextMessageParams, type TextObject, type TextParameter, type Throughput, type ThroughputLevel, TwoStepVerificationApi, type TwoStepVerificationClass, type TwoStepVerificationParams, type TwoStepVerificationRequest, type URLButton, type UpdateBusinessProfileRequest, type UpdateFlowResponse, type UpdateQrCodeRequest, type UpdateWabaSubscription, type UploadMediaResponse, type ValidateFlowJsonResponse, type VerifyCodeRequest, type VideoMediaObject, VideoMediaTypesEnum, type WABAClass, type WabaAccount, type WabaAccountFields, type WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaApi, WabaBusinessVerificationStatus, WabaConfigEnum, type WabaConfigType, type WabaHealthStatus, WabaHealthStatusCanSendMessage, type WabaHealthStatusEntity, type WabaHealthStatusError, type WabaSubscription, type WabaSubscriptions, type WebhookContact, type WebhookEvent, type WebhookMessage, WebhookTypesEnum, WhatsApp, type WhatsAppConfig, WhatsApp as WhatsAppLegacy, isFlowDataExchangeRequest, isFlowErrorRequest, isFlowPingRequest, isMetaError };
1
+ import { Agent } from "https";
2
+ import { IncomingHttpHeaders, IncomingMessage } from "http";
3
+
4
+ //#region src/types/enums.d.ts
5
+ declare namespace enums_d_exports {
6
+ 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 };
7
+ }
8
+ declare enum CategoryEnum {
9
+ Authentication = "AUTHENTICATION",
10
+ Marketing = "MARKETING",
11
+ Utility = "UTILITY",
12
+ }
13
+ declare enum TemplateStatusEnum {
14
+ Approved = "APPROVED",
15
+ Pending = "PENDING",
16
+ Rejected = "REJECTED",
17
+ }
18
+ declare enum HttpMethodsEnum {
19
+ Get = "GET",
20
+ Post = "POST",
21
+ Put = "PUT",
22
+ Delete = "DELETE",
23
+ }
24
+ declare enum MessageTypesEnum {
25
+ Audio = "audio",
26
+ Contacts = "contacts",
27
+ Document = "document",
28
+ Image = "image",
29
+ Interactive = "interactive",
30
+ Location = "location",
31
+ Reaction = "reaction",
32
+ Sticker = "sticker",
33
+ Template = "template",
34
+ Text = "text",
35
+ Video = "video",
36
+ Button = "button",
37
+ Order = "order",
38
+ System = "system",
39
+ Unknown = "unknown",
40
+ Statuses = "statuses",
41
+ '*' = "*",
42
+ }
43
+ declare enum ParametersTypesEnum {
44
+ Action = "ACTION",
45
+ CouponCode = "COUPON_CODE",
46
+ Currency = "CURRENCY",
47
+ DateTime = "DATE_TIME",
48
+ Document = "DOCUMENT",
49
+ ExpirationTimeMs = "EXPIRATION_TIME_MS",
50
+ Image = "IMAGE",
51
+ LimitedTimeOffer = "LIMITED_TIME_OFFER",
52
+ Location = "LOCATION",
53
+ OrderStatus = "ORDER_STATUS",
54
+ Payload = "PAYLOAD",
55
+ Product = "PRODUCT",
56
+ Text = "TEXT",
57
+ TtlMinutes = "TTL_MINUTES",
58
+ Video = "VIDEO",
59
+ WebviewInteraction = "WEBVIEW_INTERACTION",
60
+ WebviewPresentation = "WEBVIEW_PRESENTATION",
61
+ }
62
+ declare enum InteractiveTypesEnum {
63
+ Button = "button",
64
+ List = "list",
65
+ Product = "product",
66
+ ProductList = "product_list",
67
+ CtaUrl = "cta_url",
68
+ LocationRequest = "location_request_message",
69
+ AddressMessage = "address_message",
70
+ Flow = "flow",
71
+ }
72
+ declare enum ButtonPositionEnum {
73
+ First = 1,
74
+ Second = 2,
75
+ Third = 3,
76
+ Fourth = 4,
77
+ Fifth = 5,
78
+ }
79
+ declare enum SubTypeEnum {
80
+ Catalog = "CATALOG",
81
+ CopyCode = "COPY_CODE",
82
+ Flow = "FLOW",
83
+ Mpm = "MPM",
84
+ OrderDetails = "ORDER_DETAILS",
85
+ QuickReply = "QUICK_REPLY",
86
+ Reminder = "REMINDER",
87
+ Url = "URL",
88
+ VoiceCall = "VOICE_CALL",
89
+ }
90
+ declare enum ComponentTypesEnum {
91
+ Header = "HEADER",
92
+ Body = "BODY",
93
+ Button = "BUTTON",
94
+ Footer = "FOOTER",
95
+ }
96
+ declare enum WabaConfigEnum {
97
+ AppId = "M4D_APP_ID",
98
+ Port = "WA_PORT",
99
+ AppSecret = "M4D_APP_SECRET",
100
+ PhoneNumberId = "WA_PHONE_NUMBER_ID",
101
+ BusinessAcctId = "WA_BUSINESS_ACCOUNT_ID",
102
+ APIVersion = "CLOUD_API_VERSION",
103
+ AccessToken = "CLOUD_API_ACCESS_TOKEN",
104
+ WebhookEndpoint = "WEBHOOK_ENDPOINT",
105
+ WebhookVerificationToken = "WEBHOOK_VERIFICATION_TOKEN",
106
+ ListenerPort = "LISTENER_PORT",
107
+ MaxRetriesAfterWait = "MAX_RETRIES_AFTER_WAIT",
108
+ RequestTimeout = "REQUEST_TIMEOUT",
109
+ Debug = "DEBUG",
110
+ PrivatePem = "FLOW_API_PRIVATE_PEM",
111
+ Passphrase = "FLOW_API_PASSPHRASE",
112
+ }
113
+ declare enum ConversationTypesEnum {
114
+ BusinessInitiated = "business_initiated",
115
+ CustomerInitiated = "customer_initiated",
116
+ ReferralConversion = "referral_conversion",
117
+ }
118
+ declare enum StatusEnum {
119
+ Delivered = "delivered",
120
+ Read = "read",
121
+ Sent = "sent",
122
+ }
123
+ declare enum VideoMediaTypesEnum {
124
+ Mp4 = "video/mp4",
125
+ Threegp = "video/3gp",
126
+ }
127
+ declare enum StickerMediaTypesEnum {
128
+ Webp = "image/webp",
129
+ }
130
+ declare enum ImageMediaTypesEnum {
131
+ Jpeg = "image/jpeg",
132
+ Png = "image/png",
133
+ }
134
+ declare enum DocumentMediaTypesEnum {
135
+ Text = "text/plain",
136
+ Pdf = "application/pdf",
137
+ Ppt = "application/vnd.ms-powerpoint",
138
+ Word = "application/msword",
139
+ Excel = "application/vnd.ms-excel",
140
+ OpenDoc = "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
141
+ OpenPres = "application/vnd.openxmlformats-officedocument.presentationml.presentation",
142
+ OpenSheet = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
143
+ }
144
+ declare enum AudioMediaTypesEnum {
145
+ Aac = "audio/aac",
146
+ Mp4 = "audio/mp4",
147
+ Mpeg = "audio/mpeg",
148
+ Amr = "audio/amr",
149
+ Ogg = "audio/ogg",
150
+ }
151
+ declare enum WebhookTypesEnum {
152
+ Audio = "audio",
153
+ Button = "button",
154
+ Document = "document",
155
+ Text = "text",
156
+ Image = "image",
157
+ Interactive = "interactive",
158
+ Order = "order",
159
+ Sticker = "sticker",
160
+ System = "system",
161
+ Unknown = "unknown",
162
+ Video = "video",
163
+ }
164
+ declare enum SystemChangeTypesEnum {
165
+ CustomerChangedNumber = "customer_changed_number",
166
+ CustomerIdentityChanged = "customer_identity_changed",
167
+ }
168
+ declare enum ReferralSourceTypesEnum {
169
+ Ad = "ad",
170
+ Post = "post",
171
+ }
172
+ declare enum RequestCodeMethodsEnum {
173
+ Sms = "SMS",
174
+ Voice = "VOICE",
175
+ }
176
+ declare enum LanguagesEnum {
177
+ Afrikaans = "af",
178
+ Albanian = "sq",
179
+ Arabic = "ar",
180
+ Azerbaijani = "az",
181
+ Bengali = "bn",
182
+ Bulgarian = "bg",
183
+ Catalan = "ca",
184
+ Chinese_CHN = "zh_CN",
185
+ Chinese_HKG = "zh_HK",
186
+ Chinese_TAI = "zh_TW",
187
+ Croatian = "hr",
188
+ Czech = "cs",
189
+ Danish = "da",
190
+ Dutch = "nl",
191
+ English = "en",
192
+ English_UK = "en_GB",
193
+ English_US = "en_US",
194
+ Estonian = "et",
195
+ Filipino = "fil",
196
+ Finnish = "fi",
197
+ French = "fr",
198
+ Georgian = "ka",
199
+ German = "de",
200
+ Greek = "el",
201
+ Gujarati = "gu",
202
+ Hausa = "ha",
203
+ Hebrew = "he",
204
+ Hindi = "hi",
205
+ Hungarian = "hu",
206
+ Indonesian = "id",
207
+ Irish = "ga",
208
+ Italian = "it",
209
+ Japanese = "ja",
210
+ Kannada = "kn",
211
+ Kazakh = "kk",
212
+ Kinyarwanda = "rw_RW",
213
+ Korean = "ko",
214
+ Kyrgyz_Kyrgyzstan = "ky_KG",
215
+ Lao = "lo",
216
+ Latvian = "lv",
217
+ Lithuanian = "lt",
218
+ Macedonian = "mk",
219
+ Malay = "ms",
220
+ Malayalam = "ml",
221
+ Marathi = "mr",
222
+ Norwegian = "nb",
223
+ Persian = "fa",
224
+ Polish = "pl",
225
+ Portuguese_BR = "pt_BR",
226
+ Portuguese_POR = "pt_PT",
227
+ Punjabi = "pa",
228
+ Romanian = "ro",
229
+ Russian = "ru",
230
+ Serbian = "sr",
231
+ Slovak = "sk",
232
+ Slovenian = "sl",
233
+ Spanish = "es",
234
+ Spanish_ARG = "es_AR",
235
+ Spanish_SPA = "es_ES",
236
+ Spanish_MEX = "es_MX",
237
+ Swahili = "sw",
238
+ Swedish = "sv",
239
+ Tamil = "ta",
240
+ Telugu = "te",
241
+ Thai = "th",
242
+ Turkish = "tr",
243
+ Ukrainian = "uk",
244
+ Urdu = "ur",
245
+ Uzbek = "uz",
246
+ Vietnamese = "vi",
247
+ Zulu = "zu",
248
+ }
249
+ declare enum CurrencyCodesEnum {
250
+ AFN = "AFN",
251
+ EUR = "EUR",
252
+ ALL = "ALL",
253
+ DZD = "DZD",
254
+ USD = "USD",
255
+ AOA = "AOA",
256
+ XCD = "XCD",
257
+ ARS = "ARS",
258
+ AMD = "AMD",
259
+ AWG = "AWG",
260
+ AUD = "AUD",
261
+ AZN = "AZN",
262
+ BSD = "BSD",
263
+ BHD = "BHD",
264
+ BDT = "BDT",
265
+ BBD = "BBD",
266
+ BYN = "BYN",
267
+ BZD = "BZD",
268
+ XOF = "XOF",
269
+ BMD = "BMD",
270
+ INR = "INR",
271
+ BTN = "BTN",
272
+ BOB = "BOB",
273
+ BOV = "BOV",
274
+ BAM = "BAM",
275
+ BWP = "BWP",
276
+ NOK = "NOK",
277
+ BRL = "BRL",
278
+ BND = "BND",
279
+ BGN = "BGN",
280
+ BIF = "BIF",
281
+ CVE = "CVE",
282
+ KHR = "KHR",
283
+ XAF = "XAF",
284
+ CAD = "CAD",
285
+ KYD = "KYD",
286
+ CLP = "CLP",
287
+ CLF = "CLF",
288
+ CNY = "CNY",
289
+ COP = "COP",
290
+ COU = "COU",
291
+ KMF = "KMF",
292
+ CDF = "CDF",
293
+ NZD = "NZD",
294
+ CRC = "CRC",
295
+ HRK = "HRK",
296
+ CUP = "CUP",
297
+ CUC = "CUC",
298
+ ANG = "ANG",
299
+ CZK = "CZK",
300
+ DKK = "DKK",
301
+ DJF = "DJF",
302
+ DOP = "DOP",
303
+ EGP = "EGP",
304
+ SVC = "SVC",
305
+ ERN = "ERN",
306
+ SZL = "SZL",
307
+ ETB = "ETB",
308
+ FKP = "FKP",
309
+ FJD = "FJD",
310
+ XPF = "XPF",
311
+ GMD = "GMD",
312
+ GEL = "GEL",
313
+ GHS = "GHS",
314
+ GIP = "GIP",
315
+ GTQ = "GTQ",
316
+ GBP = "GBP",
317
+ GNF = "GNF",
318
+ GYD = "GYD",
319
+ HTG = "HTG",
320
+ HNL = "HNL",
321
+ HKD = "HKD",
322
+ HUF = "HUF",
323
+ ISK = "ISK",
324
+ IDR = "IDR",
325
+ XDR = "XDR",
326
+ IRR = "IRR",
327
+ IQD = "IQD",
328
+ ILS = "ILS",
329
+ JMD = "JMD",
330
+ JPY = "JPY",
331
+ JOD = "JOD",
332
+ KZT = "KZT",
333
+ KES = "KES",
334
+ KPW = "KPW",
335
+ KRW = "KRW",
336
+ KWD = "KWD",
337
+ KGS = "KGS",
338
+ LAK = "LAK",
339
+ LBP = "LBP",
340
+ LSL = "LSL",
341
+ ZAR = "ZAR",
342
+ LRD = "LRD",
343
+ LYD = "LYD",
344
+ CHF = "CHF",
345
+ MOP = "MOP",
346
+ MKD = "MKD",
347
+ MGA = "MGA",
348
+ MWK = "MWK",
349
+ MYR = "MYR",
350
+ MVR = "MVR",
351
+ MRU = "MRU",
352
+ MUR = "MUR",
353
+ XUA = "XUA",
354
+ MXN = "MXN",
355
+ MXV = "MXV",
356
+ MDL = "MDL",
357
+ MNT = "MNT",
358
+ MAD = "MAD",
359
+ MZN = "MZN",
360
+ MMK = "MMK",
361
+ NAD = "NAD",
362
+ NPR = "NPR",
363
+ NIO = "NIO",
364
+ NGN = "NGN",
365
+ OMR = "OMR",
366
+ PKR = "PKR",
367
+ PAB = "PAB",
368
+ PGK = "PGK",
369
+ PYG = "PYG",
370
+ PEN = "PEN",
371
+ PHP = "PHP",
372
+ PLN = "PLN",
373
+ QAR = "QAR",
374
+ RON = "RON",
375
+ RUB = "RUB",
376
+ RWF = "RWF",
377
+ SHP = "SHP",
378
+ WST = "WST",
379
+ STN = "STN",
380
+ SAR = "SAR",
381
+ RSD = "RSD",
382
+ SCR = "SCR",
383
+ SLL = "SLL",
384
+ SGD = "SGD",
385
+ XSU = "XSU",
386
+ SBD = "SBD",
387
+ SOS = "SOS",
388
+ SSP = "SSP",
389
+ LKR = "LKR",
390
+ SDG = "SDG",
391
+ SRD = "SRD",
392
+ SEK = "SEK",
393
+ CHE = "CHE",
394
+ CHW = "CHW",
395
+ SYP = "SYP",
396
+ TWD = "TWD",
397
+ TJS = "TJS",
398
+ TZS = "TZS",
399
+ THB = "THB",
400
+ TOP = "TOP",
401
+ TTD = "TTD",
402
+ TND = "TND",
403
+ TRY = "TRY",
404
+ TMT = "TMT",
405
+ UGX = "UGX",
406
+ UAH = "UAH",
407
+ AED = "AED",
408
+ USN = "USN",
409
+ UYU = "UYU",
410
+ UYI = "UYI",
411
+ UYW = "UYW",
412
+ UZS = "UZS",
413
+ VUV = "VUV",
414
+ VES = "VES",
415
+ VND = "VND",
416
+ YER = "YER",
417
+ ZMW = "ZMW",
418
+ ZWL = "ZWL",
419
+ XBA = "XBA",
420
+ XBB = "XBB",
421
+ XBC = "XBC",
422
+ XBD = "XBD",
423
+ XTS = "XTS",
424
+ XXX = "XXX",
425
+ XAU = "XAU",
426
+ XPD = "XPD",
427
+ XPT = "XPT",
428
+ XAG = "XAG",
429
+ AFA = "AFA",
430
+ FIM = "FIM",
431
+ ALK = "ALK",
432
+ ADP = "ADP",
433
+ ESP = "ESP",
434
+ FRF = "FRF",
435
+ AOK = "AOK",
436
+ AON = "AON",
437
+ AOR = "AOR",
438
+ ARA = "ARA",
439
+ ARP = "ARP",
440
+ ARY = "ARY",
441
+ RUR = "RUR",
442
+ ATS = "ATS",
443
+ AYM = "AYM",
444
+ AZM = "AZM",
445
+ BYB = "BYB",
446
+ BYR = "BYR",
447
+ BEC = "BEC",
448
+ BEF = "BEF",
449
+ BEL = "BEL",
450
+ BOP = "BOP",
451
+ BAD = "BAD",
452
+ BRB = "BRB",
453
+ BRC = "BRC",
454
+ BRE = "BRE",
455
+ BRN = "BRN",
456
+ BRR = "BRR",
457
+ BGJ = "BGJ",
458
+ BGK = "BGK",
459
+ BGL = "BGL",
460
+ BUK = "BUK",
461
+ HRD = "HRD",
462
+ CYP = "CYP",
463
+ CSJ = "CSJ",
464
+ CSK = "CSK",
465
+ ECS = "ECS",
466
+ ECV = "ECV",
467
+ GQE = "GQE",
468
+ EEK = "EEK",
469
+ XEU = "XEU",
470
+ GEK = "GEK",
471
+ DDM = "DDM",
472
+ DEM = "DEM",
473
+ GHC = "GHC",
474
+ GHP = "GHP",
475
+ GRD = "GRD",
476
+ GNE = "GNE",
477
+ GNS = "GNS",
478
+ GWE = "GWE",
479
+ GWP = "GWP",
480
+ ITL = "ITL",
481
+ ISJ = "ISJ",
482
+ IEP = "IEP",
483
+ ILP = "ILP",
484
+ ILR = "ILR",
485
+ LAJ = "LAJ",
486
+ LVL = "LVL",
487
+ LVR = "LVR",
488
+ LSM = "LSM",
489
+ ZAL = "ZAL",
490
+ LTL = "LTL",
491
+ LTT = "LTT",
492
+ LUC = "LUC",
493
+ LUF = "LUF",
494
+ LUL = "LUL",
495
+ MGF = "MGF",
496
+ MVQ = "MVQ",
497
+ MLF = "MLF",
498
+ MTL = "MTL",
499
+ MTP = "MTP",
500
+ MRO = "MRO",
501
+ MXP = "MXP",
502
+ MZE = "MZE",
503
+ MZM = "MZM",
504
+ NLG = "NLG",
505
+ NIC = "NIC",
506
+ PEH = "PEH",
507
+ PEI = "PEI",
508
+ PES = "PES",
509
+ PLZ = "PLZ",
510
+ PTE = "PTE",
511
+ ROK = "ROK",
512
+ ROL = "ROL",
513
+ STD = "STD",
514
+ CSD = "CSD",
515
+ SKK = "SKK",
516
+ SIT = "SIT",
517
+ RHD = "RHD",
518
+ ESA = "ESA",
519
+ ESB = "ESB",
520
+ SDD = "SDD",
521
+ SDP = "SDP",
522
+ SRG = "SRG",
523
+ CHC = "CHC",
524
+ TJR = "TJR",
525
+ TPE = "TPE",
526
+ TRL = "TRL",
527
+ TMM = "TMM",
528
+ UGS = "UGS",
529
+ UGW = "UGW",
530
+ UAK = "UAK",
531
+ SUR = "SUR",
532
+ USS = "USS",
533
+ UYN = "UYN",
534
+ UYP = "UYP",
535
+ VEB = "VEB",
536
+ VEF = "VEF",
537
+ VNC = "VNC",
538
+ YDD = "YDD",
539
+ YUD = "YUD",
540
+ YUM = "YUM",
541
+ YUN = "YUN",
542
+ ZRN = "ZRN",
543
+ ZRZ = "ZRZ",
544
+ ZMK = "ZMK",
545
+ ZWC = "ZWC",
546
+ ZWD = "ZWD",
547
+ ZWN = "ZWN",
548
+ ZWR = "ZWR",
549
+ XFO = "XFO",
550
+ XRE = "XRE",
551
+ XFU = "XFU",
552
+ }
553
+ declare enum DataLocalizationRegionEnum {
554
+ AU = "AU",
555
+ // Australia
556
+ ID = "ID",
557
+ // Indonesia
558
+ IN = "IN",
559
+ // India
560
+ JP = "JP",
561
+ // Japan
562
+ SG = "SG",
563
+ // Singapore
564
+ KR = "KR",
565
+ // South Korea
566
+ DE = "DE",
567
+ // EU (Germany)
568
+ CH = "CH",
569
+ // Switzerland
570
+ GB = "GB",
571
+ // United Kingdom
572
+ BR = "BR",
573
+ // Brazil
574
+ BH = "BH",
575
+ // Bahrain
576
+ ZA = "ZA",
577
+ // South Africa
578
+ AE = "AE",
579
+ // United Arab Emirates
580
+ CA = "CA",
581
+ }
582
+ /**
583
+ * Business category values for WhatsApp Business Profile.
584
+ * These values map to specific strings displayed in the WhatsApp client.
585
+ */
586
+ declare enum BusinessVerticalEnum {
587
+ /**
588
+ * Alcoholic Beverages
589
+ */
590
+ ALCOHOL = "ALCOHOL",
591
+ /**
592
+ * Clothing and Apparel
593
+ */
594
+ APPAREL = "APPAREL",
595
+ /**
596
+ * Automotive
597
+ */
598
+ AUTO = "AUTO",
599
+ /**
600
+ * Beauty, Spa and Salon
601
+ */
602
+ BEAUTY = "BEAUTY",
603
+ /**
604
+ * Education
605
+ */
606
+ EDU = "EDU",
607
+ /**
608
+ * Entertainment
609
+ */
610
+ ENTERTAIN = "ENTERTAIN",
611
+ /**
612
+ * Event Planning and Service
613
+ */
614
+ EVENT_PLAN = "EVENT_PLAN",
615
+ /**
616
+ * Finance and Banking
617
+ */
618
+ FINANCE = "FINANCE",
619
+ /**
620
+ * Public Service
621
+ */
622
+ GOVT = "GOVT",
623
+ /**
624
+ * Food and Grocery
625
+ */
626
+ GROCERY = "GROCERY",
627
+ /**
628
+ * Medical and Health
629
+ */
630
+ HEALTH = "HEALTH",
631
+ /**
632
+ * Hotel and Lodging
633
+ */
634
+ HOTEL = "HOTEL",
635
+ /**
636
+ * Non-profit
637
+ */
638
+ NONPROFIT = "NONPROFIT",
639
+ /**
640
+ * Online Gambling & Gaming
641
+ */
642
+ ONLINE_GAMBLING = "ONLINE_GAMBLING",
643
+ /**
644
+ * Over-the-Counter Drugs
645
+ */
646
+ OTC_DRUGS = "OTC_DRUGS",
647
+ /**
648
+ * Other
649
+ */
650
+ OTHER = "OTHER",
651
+ /**
652
+ * Non-Online Gambling & Gaming (E.g. Brick and mortar)
653
+ */
654
+ PHYSICAL_GAMBLING = "PHYSICAL_GAMBLING",
655
+ /**
656
+ * Professional Services
657
+ */
658
+ PROF_SERVICES = "PROF_SERVICES",
659
+ /**
660
+ * Restaurant
661
+ */
662
+ RESTAURANT = "RESTAURANT",
663
+ /**
664
+ * Shopping and Retail
665
+ */
666
+ RETAIL = "RETAIL",
667
+ /**
668
+ * Travel and Transportation
669
+ */
670
+ TRAVEL = "TRAVEL",
671
+ }
672
+ //#endregion
673
+ //#region src/types/config.d.ts
674
+ type WhatsAppConfig = {
675
+ accessToken: string;
676
+ appId?: string;
677
+ appSecret?: string;
678
+ phoneNumberId?: number;
679
+ businessAcctId?: string;
680
+ apiVersion?: string;
681
+ webhookEndpoint?: string;
682
+ webhookVerificationToken?: string;
683
+ listenerPort?: number;
684
+ debug?: boolean;
685
+ maxRetriesAfterWait?: number;
686
+ requestTimeout?: number;
687
+ privatePem?: string;
688
+ passphrase?: string;
689
+ };
690
+ type WabaConfigType = {
691
+ /**
692
+ * The Meta for Developers business application Id for this registered application.
693
+ */
694
+ [WabaConfigEnum.AppId]: string;
695
+ /**
696
+ * The Meta for Developers business application secret for this registered application.
697
+ */
698
+ [WabaConfigEnum.AppSecret]: string;
699
+ /**
700
+ * The Meta for Developers phone number id used by the registered business.
701
+ */
702
+ [WabaConfigEnum.PhoneNumberId]: number;
703
+ /**
704
+ * The Meta for Developers business id for the registered business.
705
+ */
706
+ [WabaConfigEnum.BusinessAcctId]: string;
707
+ /**
708
+ * The version of the Cloud API being used. Starts with a "v" and follows the major number.
709
+ */
710
+ [WabaConfigEnum.APIVersion]: string;
711
+ /**
712
+ * The access token to make calls on behalf of the signed in Meta for Developers account or business.
713
+ */
714
+ [WabaConfigEnum.AccessToken]: string;
715
+ /**
716
+ * The endpoint path (e.g. if the value here is webhook, the webhook URL would look like http/https://{host}/webhook).
717
+ */
718
+ [WabaConfigEnum.WebhookEndpoint]: string;
719
+ /**
720
+ * The verification token that needs to match what is sent by the Cloud API webhook in order to subscribe.
721
+ */
722
+ [WabaConfigEnum.WebhookVerificationToken]: string;
723
+ /**
724
+ * The listener port for the webhook web server.
725
+ */
726
+ [WabaConfigEnum.ListenerPort]: number;
727
+ /**
728
+ * To turn on global debugging of the logger to print verbose output across the APIs.
729
+ */
730
+ [WabaConfigEnum.Debug]: boolean;
731
+ /**
732
+ * The total number of times a request should be retried after the wait period if it fails.
733
+ */
734
+ [WabaConfigEnum.MaxRetriesAfterWait]: number;
735
+ /**
736
+ * The timeout period for a request to quit and destroy the attempt in ms.
737
+ */
738
+ [WabaConfigEnum.RequestTimeout]: number;
739
+ /**
740
+ * The private key for the Meta for Developers business.
741
+ */
742
+ [WabaConfigEnum.PrivatePem]: string;
743
+ /**
744
+ * The passphrase for the Meta for Developers business.
745
+ */
746
+ [WabaConfigEnum.Passphrase]: string;
747
+ };
748
+ //#endregion
749
+ //#region src/types/request.d.ts
750
+ type GeneralRequestBody = Record<string, unknown>;
751
+ interface GeneralHeaderInterface {
752
+ /**
753
+ * Authorization token. This is required for all HTTP requests made to the graph API.
754
+ * @default 'Bearer '
755
+ */
756
+ Authorization: string;
757
+ /**
758
+ * Content type of the message being sent. This is required for all HTTP requests made to the graph API.
759
+ * @default 'application/json'
760
+ */
761
+ 'Content-Type': string;
762
+ /**
763
+ * User agent field sent in all requests. This is used to gather SDK usage metrics and help
764
+ * better triage support requests.
765
+ * @default `WA_SDK/${ SDK_version } (Node.js ${ process.version })`
766
+ */
767
+ 'User-Agent': string;
768
+ }
769
+ interface RequesterResponseInterface<T> {
770
+ json: () => Promise<T>;
771
+ }
772
+ interface ResponseSuccess {
773
+ success: boolean;
774
+ }
775
+ interface ResponseData<T> {
776
+ data: T;
777
+ }
778
+ interface ResponsePagination<T> {
779
+ data: T[];
780
+ paging: Paging;
781
+ }
782
+ interface Paging {
783
+ cursors: {
784
+ before: string;
785
+ after: string;
786
+ };
787
+ next: string;
788
+ }
789
+ declare class RequesterClass {
790
+ constructor(apiVersion: string, phoneNumberId: number, accessToken: string, businessAcctId: string, userAgent: string);
791
+ sendRequest: (method: HttpMethodsEnum, path: string, timeout: number, body?: GeneralRequestBody, contentType?: string, additionalHeaders?: Record<string, string>) => Promise<RequesterResponseInterface<unknown>>;
792
+ getJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: GeneralRequestBody, additionalHeaders?: Record<string, string>): Promise<T>;
793
+ sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: FormData, additionalHeaders?: Record<string, string>): Promise<T>;
794
+ sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: Record<string, string>, additionalHeaders?: Record<string, string>): Promise<T>;
795
+ }
796
+ //#endregion
797
+ //#region src/types/httpsClient.d.ts
798
+ type ResponseHeaderValue = string | string[] | undefined;
799
+ type ResponseHeaders = Record<string, ResponseHeaderValue>;
800
+ type ResponseJSONBody = Record<string, unknown>;
801
+ declare class HttpsClientResponseClass {
802
+ constructor(resp: Response);
803
+ statusCode: () => number;
804
+ headers: () => ResponseHeaders;
805
+ rawResponse: () => Response;
806
+ json: () => Promise<ResponseJSONBody>;
807
+ }
808
+ declare class HttpsClientClass {
809
+ constructor();
810
+ clearSockets: () => boolean;
811
+ sendRequest: (host: string, path: string, method: HttpMethodsEnum, headers: HeadersInit, timeout: number, body?: BodyInit | null) => Promise<HttpsClientResponseClass>;
812
+ }
813
+ //#endregion
814
+ //#region src/utils/http/httpsClient.d.ts
815
+ declare class HttpsClient implements HttpsClientClass {
816
+ agent: Agent;
817
+ constructor();
818
+ clearSockets(): boolean;
819
+ sendRequest(hostname: string, path: string, method: HttpMethodsEnum, headers: HeadersInit, timeout: number, body?: BodyInit | null): Promise<HttpsClientResponseClass>;
820
+ }
821
+ declare class HttpsClientResponse implements HttpsClientResponseClass {
822
+ res: Response;
823
+ respStatusCode: number;
824
+ respHeaders: ResponseHeaders;
825
+ constructor(resp: Response);
826
+ statusCode(): number;
827
+ headers(): ResponseHeaders;
828
+ rawResponse(): Response;
829
+ json(): Promise<ResponseJSONBody>;
830
+ }
831
+ //#endregion
832
+ //#region src/utils/http/request.d.ts
833
+ declare class Requester implements RequesterClass {
834
+ client: Readonly<HttpsClient>;
835
+ accessToken: Readonly<string>;
836
+ phoneNumberId: Readonly<number>;
837
+ businessAcctId: Readonly<string>;
838
+ apiVersion: Readonly<string>;
839
+ userAgent: Readonly<string>;
840
+ host: Readonly<string>;
841
+ protocol: Readonly<string>;
842
+ constructor(apiVersion: string, phoneNumberId: number, accessToken: string, businessAcctId: string, userAgent: string);
843
+ buildHeader(contentType: string, additionalHeaders?: Record<string, string>): HeadersInit;
844
+ buildCAPIPath(endpoint: string): string;
845
+ sendRequest(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any, contentType?: string, additionalHeaders?: Record<string, string>): Promise<HttpsClientResponseClass>;
846
+ getJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any, additionalHeaders?: Record<string, string>): Promise<T>;
847
+ sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: FormData, additionalHeaders?: Record<string, string>): Promise<T>;
848
+ sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: Record<string, string>, additionalHeaders?: Record<string, string>): Promise<T>;
849
+ }
850
+ //#endregion
851
+ //#region src/types/base.d.ts
852
+ declare class BaseClass {
853
+ constructor(config: WabaConfigType);
854
+ }
855
+ declare class BaseAPI implements BaseClass {
856
+ protected config: WabaConfigType;
857
+ protected client: RequesterClass;
858
+ constructor(config: WabaConfigType, client: RequesterClass);
859
+ protected sendJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
860
+ protected sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
861
+ protected sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
862
+ }
863
+ //#endregion
864
+ //#region src/api/encryption/types/publicKey.d.ts
865
+ type EncryptionPublicKeyResponse = ResponseData<{
866
+ business_public_key: string;
867
+ business_public_key_signature_status: 'VALID' | 'MISMATCH';
868
+ }>;
869
+ //#endregion
870
+ //#region src/api/encryption/types/common.d.ts
871
+ interface EncryptionClass {
872
+ getEncryptionPublicKey(): Promise<EncryptionPublicKeyResponse>;
873
+ setEncryptionPublicKey(businessPublicKey: string): Promise<ResponseSuccess>;
874
+ }
875
+ //#endregion
876
+ //#region src/api/encryption/EncryptionApi.d.ts
877
+ declare class EncryptionApi extends BaseAPI implements EncryptionClass {
878
+ private readonly endpoint;
879
+ constructor(config: WabaConfigType, client: RequesterClass);
880
+ getEncryptionPublicKey(): Promise<EncryptionPublicKeyResponse>;
881
+ setEncryptionPublicKey(businessPublicKey: string): Promise<ResponseSuccess>;
882
+ }
883
+ //#endregion
884
+ //#region src/types/logger.d.ts
885
+ interface LoggerInterface {
886
+ log(...data: any[]): void;
887
+ error(...data: any[]): void;
888
+ warn(...data: any[]): void;
889
+ info(...data: any[]): void;
890
+ debug(...data: any[]): void;
891
+ }
892
+ //#endregion
893
+ //#region src/api/profile/types/upload.d.ts
894
+ /**
895
+ * Upload session information for creating upload sessions.
896
+ */
897
+ interface UploadSession {
898
+ id: string;
899
+ video?: boolean;
900
+ }
901
+ /**
902
+ * Response from creating an upload session.
903
+ */
904
+ interface UploadSessionResponse {
905
+ id: string;
906
+ }
907
+ /**
908
+ * Response from uploading business profile media.
909
+ */
910
+ interface UploadBusinessProfileResponse {
911
+ h: string;
912
+ }
913
+ /**
914
+ * Upload handle information containing file details and handle.
915
+ */
916
+ interface UploadHandle {
917
+ handle: string;
918
+ file_size: number;
919
+ upload_result: {
920
+ handle_type: string;
921
+ name: string;
922
+ };
923
+ }
924
+ /**
925
+ * Request parameters for creating upload session.
926
+ */
927
+ interface CreateUploadSessionParams {
928
+ /**
929
+ * Length of the file to be uploaded in bytes.
930
+ */
931
+ fileLength: number;
932
+ /**
933
+ * MIME type of the file (e.g., 'image/jpeg').
934
+ */
935
+ fileType: string;
936
+ /**
937
+ * Name of the file with extension.
938
+ */
939
+ fileName: string;
940
+ }
941
+ /**
942
+ * Request parameters for uploading media.
943
+ */
944
+ interface UploadMediaParams {
945
+ /**
946
+ * The upload session ID from createUploadSession response.
947
+ */
948
+ uploadId: string;
949
+ /**
950
+ * The binary data of the file (Buffer).
951
+ */
952
+ file: Buffer;
953
+ }
954
+ /**
955
+ * Request parameters for getting upload handle.
956
+ */
957
+ interface GetUploadHandleParams {
958
+ /**
959
+ * The upload session ID from createUploadSession response.
960
+ */
961
+ uploadId: string;
962
+ }
963
+ //#endregion
964
+ //#region src/api/profile/types/common.d.ts
965
+ /**
966
+ * Available fields that can be requested when retrieving a business profile.
967
+ */
968
+ type BusinessProfileField = 'about' | 'address' | 'description' | 'email' | 'profile_picture_url' | 'websites' | 'vertical';
969
+ type BusinessProfileFieldsParam = BusinessProfileField[] | string;
970
+ /**
971
+ * Business profile data structure containing all profile information.
972
+ */
973
+ interface BusinessProfileData {
974
+ /**
975
+ * The business's About text. This text appears in the business's profile, beneath its profile image,
976
+ * phone number, and contact buttons.
977
+ * - String cannot be empty
978
+ * - Strings must be between 1 and 139 characters
979
+ * - Rendered emojis are supported however their unicode values are not.
980
+ * Emoji unicode values must be Java- or JavaScript-escape encoded
981
+ * - Hyperlinks can be included but will not render as clickable links
982
+ * - Markdown is not supported
983
+ */
984
+ about?: string;
985
+ /**
986
+ * Address of the business. Character limit 256.
987
+ */
988
+ address?: string;
989
+ /**
990
+ * Description of the business. Character limit 512.
991
+ */
992
+ description?: string;
993
+ /**
994
+ * The contact email address (in valid email format) of the business. Character limit 128.
995
+ */
996
+ email?: string;
997
+ /**
998
+ * The messaging service used for the request. Always set it to "whatsapp" if you are using
999
+ * the WhatsApp Business API.
1000
+ */
1001
+ messaging_product: string;
1002
+ /**
1003
+ * Profile picture URL.
1004
+ */
1005
+ profile_picture_url?: string;
1006
+ /**
1007
+ * The URLs associated with the business. For instance, a website, Facebook Page, or Instagram.
1008
+ * - You must include the http:// or https:// portion of the URL
1009
+ * - There is a maximum of 2 websites with a maximum of 256 characters each
1010
+ */
1011
+ websites?: string[];
1012
+ /**
1013
+ * Business category. This can be either an empty string or one of the predefined business categories.
1014
+ * @see BusinessVerticalEnum for all available options
1015
+ */
1016
+ vertical?: BusinessVerticalEnum | string;
1017
+ }
1018
+ /**
1019
+ * Response structure for business profile GET requests.
1020
+ */
1021
+ interface BusinessProfileResponse {
1022
+ data: BusinessProfileData[];
1023
+ }
1024
+ /**
1025
+ * Request structure for updating business profile.
1026
+ */
1027
+ interface UpdateBusinessProfileRequest {
1028
+ /**
1029
+ * The messaging service used for the request. Always set it to "whatsapp" if you are using
1030
+ * the WhatsApp Business API.
1031
+ * @required
1032
+ */
1033
+ messaging_product: string;
1034
+ /**
1035
+ * The business's About text. This text appears in the business's profile, beneath its profile image,
1036
+ * phone number, and contact buttons.
1037
+ * - String cannot be empty
1038
+ * - Strings must be between 1 and 139 characters
1039
+ * - Rendered emojis are supported however their unicode values are not.
1040
+ * Emoji unicode values must be Java- or JavaScript-escape encoded
1041
+ * - Hyperlinks can be included but will not render as clickable links
1042
+ * - Markdown is not supported
1043
+ */
1044
+ about?: string;
1045
+ /**
1046
+ * Address of the business. Character limit 256.
1047
+ */
1048
+ address?: string;
1049
+ /**
1050
+ * Description of the business. Character limit 512.
1051
+ */
1052
+ description?: string;
1053
+ /**
1054
+ * Business category. This can be either an empty string or one of the predefined business categories.
1055
+ * @see BusinessVerticalEnum for all available options
1056
+ */
1057
+ vertical?: BusinessVerticalEnum | string;
1058
+ /**
1059
+ * The contact email address (in valid email format) of the business. Character limit 128.
1060
+ */
1061
+ email?: string;
1062
+ /**
1063
+ * The URLs associated with the business. For instance, a website, Facebook Page, or Instagram.
1064
+ * - You must include the http:// or https:// portion of the URL
1065
+ * - There is a maximum of 2 websites with a maximum of 256 characters each
1066
+ */
1067
+ websites?: string[];
1068
+ /**
1069
+ * Handle of the profile picture. This handle is generated when you upload the binary file
1070
+ * for the profile picture to Meta using the Resumable Upload API.
1071
+ */
1072
+ profile_picture_handle?: string;
1073
+ }
1074
+ declare class BusinessProfileClass extends BaseClass {
1075
+ /**
1076
+ * Get your business profile.
1077
+ * @param fields Specific fields to be returned in the response. If not specified, all fields will be returned.
1078
+ */
1079
+ getBusinessProfile(fields?: BusinessProfileFieldsParam): Promise<BusinessProfileResponse>;
1080
+ /**
1081
+ * Update your business profile.
1082
+ * @param updateRequest The request object containing the fields to update.
1083
+ */
1084
+ updateBusinessProfile(updateRequest: UpdateBusinessProfileRequest): Promise<ResponseSuccess>;
1085
+ /**
1086
+ * Create an upload session for profile picture.
1087
+ * @param fileLength Length of the file to be uploaded in bytes.
1088
+ * @param fileType MIME type of the file (e.g., 'image/jpeg').
1089
+ * @param fileName Name of the file.
1090
+ */
1091
+ createUploadSession(fileLength: number, fileType: string, fileName: string): Promise<UploadSessionResponse>;
1092
+ /**
1093
+ * Upload media file to the upload session.
1094
+ * @param uploadId The ID of the upload session.
1095
+ * @param file The binary data of the file.
1096
+ */
1097
+ uploadMedia(uploadId: string, file: Buffer): Promise<UploadBusinessProfileResponse>;
1098
+ /**
1099
+ * Get the upload handle information.
1100
+ * @param uploadId The ID of the upload session.
1101
+ */
1102
+ getUploadHandle(uploadId: string): Promise<UploadHandle>;
1103
+ }
1104
+ //#endregion
1105
+ //#region src/api/phone/types/common.d.ts
1106
+ type QualityRating = 'GREEN' | 'YELLOW' | 'RED' | 'NA';
1107
+ type AccountMode = 'LIVE' | 'SANDBOX';
1108
+ type CodeVerificationStatus = 'NOT_VERIFIED' | 'VERIFIED' | 'EXPIRED' | 'PENDING' | 'DELETED' | 'MIGRATED' | 'BANNED' | 'RESTRICTED' | 'RATE_LIMITED' | 'FLAGGED' | 'CONNECTED' | 'DISCONNECTED' | 'UNKNOWN' | 'UNVERIFIED';
1109
+ type MessagingLimitTier = 'TIER_50' | 'TIER_250' | 'TIER_1K' | 'TIER_10K' | 'TIER_100K' | 'TIER_UNLIMITED';
1110
+ type PlatformType = 'CLOUD_API' | 'ON_PREMISE' | 'NOT_APPLICABLE';
1111
+ type ThroughputLevel = 'STANDARD' | 'HIGH' | 'NOT_APPLICABLE';
1112
+ type HealthStatusEntity = {
1113
+ entity_type: string;
1114
+ id: string;
1115
+ can_send_message: string;
1116
+ additional_info?: string[];
1117
+ errors?: Array<{
1118
+ error_code: number;
1119
+ error_description: string;
1120
+ possible_solution: string;
1121
+ }>;
1122
+ };
1123
+ type HealthStatus = {
1124
+ can_send_message: string;
1125
+ entities: HealthStatusEntity[];
1126
+ };
1127
+ type QualityScore = {
1128
+ score: QualityRating;
1129
+ };
1130
+ type Throughput = {
1131
+ level: ThroughputLevel;
1132
+ };
1133
+ type PhoneNumberResponse = {
1134
+ display_phone_number: string;
1135
+ id: string;
1136
+ quality_rating: QualityRating;
1137
+ verified_name: string;
1138
+ account_mode?: AccountMode;
1139
+ certificate?: string;
1140
+ code_verification_status?: CodeVerificationStatus;
1141
+ conversational_automation?: Record<string, unknown>;
1142
+ eligibility_for_api_business_global_search?: string;
1143
+ health_status?: HealthStatus;
1144
+ is_official_business_account?: boolean;
1145
+ is_on_biz_app?: boolean;
1146
+ is_pin_enabled?: boolean;
1147
+ is_preverified_number?: boolean;
1148
+ last_onboarded_time?: string;
1149
+ messaging_limit_tier?: MessagingLimitTier;
1150
+ name_status?: string;
1151
+ new_certificate?: string;
1152
+ new_name_status?: string;
1153
+ platform_type?: PlatformType;
1154
+ quality_score?: QualityScore;
1155
+ search_visibility?: string;
1156
+ status?: CodeVerificationStatus;
1157
+ throughput?: Throughput;
1158
+ };
1159
+ type Cursors = {
1160
+ before: string;
1161
+ after: string;
1162
+ };
1163
+ type PhoneNumbersResponse = {
1164
+ data: PhoneNumberResponse[];
1165
+ paging: Paging;
1166
+ };
1167
+ type RequestVerificationCodeRequest = {
1168
+ code_method: 'SMS' | 'VOICE';
1169
+ language: string;
1170
+ };
1171
+ type VerifyCodeRequest = {
1172
+ code: string;
1173
+ };
1174
+ type TwoStepVerificationParams = {
1175
+ pin: string;
1176
+ };
1177
+ interface PhoneNumberClass {
1178
+ getPhoneNumberById(fields?: string): Promise<PhoneNumberResponse>;
1179
+ getPhoneNumbers(): Promise<PhoneNumbersResponse>;
1180
+ requestVerificationCode(params: RequestVerificationCodeRequest): Promise<ResponseSuccess>;
1181
+ verifyCode(params: VerifyCodeRequest): Promise<ResponseSuccess>;
1182
+ }
1183
+ //#endregion
1184
+ //#region src/api/template/types/common.d.ts
1185
+ type TemplateFormat = 'TEXT' | 'IMAGE' | 'VIDEO' | 'DOCUMENT' | 'LOCATION' | 'PRODUCT';
1186
+ type PhoneNumberButton = {
1187
+ type: 'PHONE_NUMBER';
1188
+ text: string;
1189
+ phone_number: string;
1190
+ };
1191
+ type URLButton = {
1192
+ type: 'URL';
1193
+ text: string;
1194
+ url: string;
1195
+ example?: string[];
1196
+ };
1197
+ type QuickReplyButton = {
1198
+ type: 'QUICK_REPLY';
1199
+ text: string;
1200
+ };
1201
+ type CopyCodeButton = {
1202
+ type: 'COPY_CODE';
1203
+ example: string;
1204
+ };
1205
+ type FlowButton = {
1206
+ type: 'FLOW';
1207
+ text: string;
1208
+ flow_id?: string;
1209
+ flow_name?: string;
1210
+ flow_json?: string;
1211
+ flow_action?: 'navigate' | 'data_exchange';
1212
+ navigate_screen?: string;
1213
+ };
1214
+ type MPMButton = {
1215
+ type: 'MPM';
1216
+ action?: {
1217
+ thumbnail_product_retailer_id: string;
1218
+ sections: Array<{
1219
+ title?: string;
1220
+ product_items: Array<{
1221
+ product_retailer_id: string;
1222
+ }>;
1223
+ }>;
1224
+ };
1225
+ };
1226
+ type OTPButton = {
1227
+ type: 'OTP';
1228
+ };
1229
+ type SPMButton = {
1230
+ type: 'SPM';
1231
+ action?: {
1232
+ product_retailer_id: string;
1233
+ };
1234
+ };
1235
+ type CatalogButton = {
1236
+ type: 'CATALOG';
1237
+ action?: {
1238
+ thumbnail_product_retailer_id: string;
1239
+ };
1240
+ };
1241
+ type TemplateButton = PhoneNumberButton | URLButton | QuickReplyButton | CopyCodeButton | FlowButton | MPMButton | OTPButton | SPMButton | CatalogButton;
1242
+ type TemplateHeaderExample = {
1243
+ header_text?: string[];
1244
+ header_text_named_params?: Array<{
1245
+ param_name: string;
1246
+ example: string;
1247
+ }>;
1248
+ header_handle?: string[];
1249
+ };
1250
+ type TemplateHeader = {
1251
+ type: 'HEADER';
1252
+ format: TemplateFormat;
1253
+ text?: string;
1254
+ example?: TemplateHeaderExample;
1255
+ };
1256
+ type TemplateBody = {
1257
+ type: 'BODY';
1258
+ text: string;
1259
+ example?: {
1260
+ body_text?: Array<Array<string>>;
1261
+ body_text_named_params?: Array<{
1262
+ param_name: string;
1263
+ example: string;
1264
+ }>;
1265
+ };
1266
+ };
1267
+ type TemplateFooter = {
1268
+ type: 'FOOTER';
1269
+ text: string;
1270
+ };
1271
+ type TemplateButtons = {
1272
+ type: 'BUTTONS';
1273
+ buttons: TemplateButton[];
1274
+ };
1275
+ type TemplateLimitedTimeOffer = {
1276
+ type: 'LIMITED_TIME_OFFER';
1277
+ limited_time_offer: {
1278
+ expiration_time_ms: number;
1279
+ };
1280
+ };
1281
+ type TemplateCarousel = {
1282
+ type: 'CAROUSEL';
1283
+ cards: Array<{
1284
+ card_index: number;
1285
+ components: ComponentTypes[];
1286
+ }>;
1287
+ };
1288
+ type CarouselCard$1 = {
1289
+ card_index: number;
1290
+ components: ComponentTypes[];
1291
+ };
1292
+ type MediaCarouselCard = {
1293
+ card_index: number;
1294
+ components: (TemplateHeader | TemplateBody | TemplateButtons)[];
1295
+ };
1296
+ type ProductCarouselCard = {
1297
+ card_index: number;
1298
+ components: TemplateHeader[];
1299
+ };
1300
+ type ComponentTypes = TemplateHeader | TemplateBody | TemplateFooter | TemplateButtons | TemplateLimitedTimeOffer | TemplateCarousel;
1301
+ type TemplateRequestBody = GeneralRequestBody & {
1302
+ name: string;
1303
+ language: LanguagesEnum;
1304
+ category?: CategoryEnum;
1305
+ components?: ComponentTypes[];
1306
+ };
1307
+ type TemplateResponse = {
1308
+ id: string;
1309
+ status: string;
1310
+ language: LanguagesEnum;
1311
+ category: CategoryEnum;
1312
+ name: string;
1313
+ components: ComponentTypes[];
1314
+ };
1315
+ type TemplateGetParams = {
1316
+ limit?: number;
1317
+ name?: string;
1318
+ language?: LanguagesEnum;
1319
+ category?: CategoryEnum;
1320
+ status?: TemplateStatusEnum;
1321
+ };
1322
+ type TemplateDeleteParams = {
1323
+ hsm_id: string;
1324
+ name: string;
1325
+ };
1326
+ declare class TemplateClass {
1327
+ getTemplate(templateId: string): Promise<TemplateResponse>;
1328
+ updateTemplate(templateId: string, template: Partial<TemplateRequestBody>): Promise<ResponseSuccess>;
1329
+ getTemplates(params?: TemplateGetParams): Promise<ResponsePagination<TemplateResponse>>;
1330
+ createTemplate(template: TemplateRequestBody): Promise<TemplateResponse>;
1331
+ deleteTemplate(params: TemplateDeleteParams): Promise<ResponseSuccess>;
1332
+ }
1333
+ //#endregion
1334
+ //#region src/api/template/types/factory.d.ts
1335
+ interface TextParameter {
1336
+ type: 'text';
1337
+ value: string;
1338
+ }
1339
+ interface CurrencyParameter {
1340
+ type: 'currency';
1341
+ amount_1000: number;
1342
+ code: CurrencyCodesEnum;
1343
+ fallback_value: string;
1344
+ }
1345
+ interface DateTimeParameter {
1346
+ type: 'date_time';
1347
+ fallback_value: string;
1348
+ }
1349
+ interface MediaParameter {
1350
+ type: 'image' | 'video' | 'document';
1351
+ handle?: string;
1352
+ link?: string;
1353
+ }
1354
+ interface LocationParameter {
1355
+ type: 'location';
1356
+ latitude?: number;
1357
+ longitude?: number;
1358
+ name?: string;
1359
+ address?: string;
1360
+ }
1361
+ interface ProductParameter {
1362
+ type: 'product';
1363
+ product_retailer_id: string;
1364
+ }
1365
+ type TemplateParameter = TextParameter | CurrencyParameter | DateTimeParameter | MediaParameter | LocationParameter | ProductParameter;
1366
+ interface HeaderOptions {
1367
+ format: TemplateFormat;
1368
+ text?: string;
1369
+ parameters?: TemplateParameter[];
1370
+ example?: {
1371
+ header_text?: string[];
1372
+ header_text_named_params?: Array<{
1373
+ param_name: string;
1374
+ example: string;
1375
+ }>;
1376
+ header_handle?: string[];
1377
+ };
1378
+ }
1379
+ interface BodyOptions {
1380
+ text: string;
1381
+ parameters?: TemplateParameter[];
1382
+ example?: {
1383
+ body_text?: string[][];
1384
+ body_text_named_params?: Array<{
1385
+ param_name: string;
1386
+ example: string;
1387
+ }>;
1388
+ };
1389
+ }
1390
+ interface FooterOptions {
1391
+ text: string;
1392
+ }
1393
+ interface ButtonOptions {
1394
+ phone_number?: {
1395
+ text: string;
1396
+ phone_number: string;
1397
+ };
1398
+ url?: {
1399
+ text: string;
1400
+ url: string;
1401
+ example?: string;
1402
+ };
1403
+ quick_reply?: {
1404
+ text: string;
1405
+ }[];
1406
+ copy_code?: {
1407
+ example: string;
1408
+ };
1409
+ flow?: {
1410
+ text: string;
1411
+ flow_id?: string;
1412
+ flow_name?: string;
1413
+ flow_json?: string;
1414
+ flow_action?: 'navigate' | 'data_exchange';
1415
+ navigate_screen?: string;
1416
+ };
1417
+ mpm?: boolean;
1418
+ otp?: boolean;
1419
+ spm?: boolean;
1420
+ }
1421
+ interface CarouselCard {
1422
+ image?: string;
1423
+ video?: string;
1424
+ product?: string;
1425
+ body?: string;
1426
+ bodyParameters?: TemplateParameter[];
1427
+ buttons?: ButtonOptions;
1428
+ }
1429
+ interface CarouselOptions {
1430
+ cards: CarouselCard[];
1431
+ }
1432
+ interface LimitedTimeOfferOptions {
1433
+ expiration_time_ms: number;
1434
+ }
1435
+ interface ProductSection {
1436
+ title?: string;
1437
+ product_items: Array<{
1438
+ product_retailer_id: string;
1439
+ }>;
1440
+ }
1441
+ interface TemplateOptions {
1442
+ name: string;
1443
+ language: LanguagesEnum;
1444
+ category: CategoryEnum;
1445
+ header?: HeaderOptions;
1446
+ body?: BodyOptions;
1447
+ footer?: FooterOptions;
1448
+ buttons?: ButtonOptions;
1449
+ carousel?: CarouselOptions;
1450
+ limitedTimeOffer?: LimitedTimeOfferOptions;
1451
+ }
1452
+ interface OTPTemplateOptions {
1453
+ name: string;
1454
+ language: LanguagesEnum;
1455
+ code_expiration_minutes?: number;
1456
+ add_security_recommendation?: boolean;
1457
+ }
1458
+ interface AuthenticationTemplateOptions {
1459
+ name: string;
1460
+ language: LanguagesEnum;
1461
+ code_expiration_minutes?: number;
1462
+ add_security_recommendation?: boolean;
1463
+ copy_code_button?: boolean;
1464
+ }
1465
+ interface CatalogTemplateOptions {
1466
+ name: string;
1467
+ language: LanguagesEnum;
1468
+ header?: Omit<HeaderOptions, 'format'>;
1469
+ body: BodyOptions;
1470
+ footer?: FooterOptions;
1471
+ thumbnail_product_retailer_id: string;
1472
+ }
1473
+ interface CouponTemplateOptions {
1474
+ name: string;
1475
+ language: LanguagesEnum;
1476
+ header?: Omit<HeaderOptions, 'format'>;
1477
+ body: BodyOptions;
1478
+ footer?: FooterOptions;
1479
+ coupon_code: string;
1480
+ }
1481
+ interface LimitedTimeOfferTemplateOptions {
1482
+ name: string;
1483
+ language: LanguagesEnum;
1484
+ header?: Omit<HeaderOptions, 'format'>;
1485
+ body: BodyOptions;
1486
+ footer?: FooterOptions;
1487
+ expiration_time_ms: number;
1488
+ }
1489
+ interface MediaCardCarouselTemplateOptions {
1490
+ name: string;
1491
+ language: LanguagesEnum;
1492
+ cards: Array<{
1493
+ header: {
1494
+ format: 'IMAGE' | 'VIDEO';
1495
+ example: {
1496
+ header_handle: string[];
1497
+ };
1498
+ };
1499
+ body: BodyOptions;
1500
+ buttons?: ButtonOptions;
1501
+ }>;
1502
+ }
1503
+ interface MPMTemplateOptions {
1504
+ name: string;
1505
+ language: LanguagesEnum;
1506
+ header?: Omit<HeaderOptions, 'format'>;
1507
+ body: BodyOptions;
1508
+ footer?: FooterOptions;
1509
+ thumbnail_product_retailer_id: string;
1510
+ sections: ProductSection[];
1511
+ }
1512
+ interface ProductCardCarouselTemplateOptions {
1513
+ name: string;
1514
+ language: LanguagesEnum;
1515
+ header?: Omit<HeaderOptions, 'format'>;
1516
+ body: BodyOptions;
1517
+ footer?: FooterOptions;
1518
+ cards: Array<{
1519
+ product_retailer_id: string;
1520
+ }>;
1521
+ }
1522
+ interface SPMTemplateOptions {
1523
+ name: string;
1524
+ language: LanguagesEnum;
1525
+ header?: Omit<HeaderOptions, 'format'>;
1526
+ body: BodyOptions;
1527
+ footer?: FooterOptions;
1528
+ product_retailer_id: string;
1529
+ }
1530
+ //#endregion
1531
+ //#region src/api/messages/types/text.d.ts
1532
+ type TextObject = {
1533
+ body: string;
1534
+ preview_url?: boolean;
1535
+ };
1536
+ type TextMessageRequestBody = MessageRequestBody<MessageTypesEnum.Text> & {
1537
+ [MessageTypesEnum.Text]: [TextObject];
1538
+ };
1539
+ interface TextMessageParams extends MessageRequestParams<TextObject | string> {
1540
+ previewUrl?: boolean;
1541
+ }
1542
+ //#endregion
1543
+ //#region src/api/messages/types/template.d.ts
1544
+ type LanguageObject = {
1545
+ policy: 'deterministic';
1546
+ code: LanguagesEnum;
1547
+ };
1548
+ type ParametersObject<T extends ParametersTypesEnum> = {
1549
+ type: T;
1550
+ };
1551
+ type SimpleTextObject$1 = {
1552
+ text: string;
1553
+ };
1554
+ type TextParametersObject = ParametersObject<ParametersTypesEnum.Text> & SimpleTextObject$1;
1555
+ type CouponCodeParametersObject = ParametersObject<ParametersTypesEnum.CouponCode> & {
1556
+ coupon_code: string;
1557
+ };
1558
+ type CurrencyObject = {
1559
+ fallback_value: string;
1560
+ code: CurrencyCodesEnum;
1561
+ amount_1000: number;
1562
+ };
1563
+ type CurrencyParametersObject = ParametersObject<ParametersTypesEnum.Currency> & {
1564
+ currency: CurrencyObject;
1565
+ };
1566
+ type DateTimeObject = {
1567
+ fallback_value: string;
1568
+ };
1569
+ type DateTimeParametersObject = ParametersObject<ParametersTypesEnum.Currency> & {
1570
+ date_time: DateTimeObject;
1571
+ };
1572
+ type DocumentMediaObject$2 = {
1573
+ id?: string;
1574
+ link?: string;
1575
+ caption?: string;
1576
+ filename?: string;
1577
+ };
1578
+ type ImageMediaObject$2 = {
1579
+ id?: string;
1580
+ link?: string;
1581
+ caption?: string;
1582
+ };
1583
+ type VideoMediaObject$2 = {
1584
+ id?: string;
1585
+ link?: string;
1586
+ caption?: string;
1587
+ };
1588
+ type DocumentParametersObject = ParametersObject<ParametersTypesEnum.Document> & DocumentMediaObject$2;
1589
+ type ImageParametersObject = ParametersObject<ParametersTypesEnum.Image> & ImageMediaObject$2;
1590
+ type VideoParametersObject = ParametersObject<ParametersTypesEnum.Video> & VideoMediaObject$2;
1591
+ type ComponentObject<T extends ComponentTypesEnum> = {
1592
+ type: T;
1593
+ parameters: (CurrencyParametersObject | DateTimeParametersObject | DocumentParametersObject | ImageParametersObject | TextParametersObject | VideoParametersObject | CouponCodeParametersObject)[];
1594
+ };
1595
+ type ButtonComponentObject = ComponentObject<ComponentTypesEnum.Button> & {
1596
+ parameters?: (TextParametersObject | PayloadParametersObject)[];
1597
+ sub_type: SubTypeEnum;
1598
+ index: ButtonPositionEnum;
1599
+ };
1600
+ type PayloadParametersObject = ParametersObject<ParametersTypesEnum.Payload> & {
1601
+ payload: string;
1602
+ };
1603
+ type MessageTemplateObject<T extends ComponentTypesEnum> = {
1604
+ name: string;
1605
+ language: LanguageObject;
1606
+ components?: (ComponentObject<T> | ButtonComponentObject)[];
1607
+ };
1608
+ type MessageTemplateRequestBody<T extends ComponentTypesEnum> = MessageRequestBody<MessageTypesEnum.Template> & MessageTemplateObject<T>;
1609
+ //#endregion
1610
+ //#region src/api/messages/types/media.d.ts
1611
+ type MetaMediaObject = {
1612
+ id: string;
1613
+ link?: never;
1614
+ };
1615
+ type HostedMediaObject = {
1616
+ id?: never;
1617
+ link: string;
1618
+ };
1619
+ type AudioMediaObject = MetaMediaObject | HostedMediaObject;
1620
+ type AudioMessageRequestBody = MessageRequestBody<MessageTypesEnum.Audio> & {
1621
+ [MessageTypesEnum.Audio]: [AudioMediaObject];
1622
+ };
1623
+ type MetaDocumentMediaObject = MetaMediaObject & {
1624
+ caption?: string;
1625
+ filename?: string;
1626
+ };
1627
+ type HostedDocumentMediaObject = HostedMediaObject & {
1628
+ caption?: string;
1629
+ filename?: string;
1630
+ };
1631
+ type DocumentMediaObject = MetaDocumentMediaObject | HostedDocumentMediaObject;
1632
+ type DocumentMessageRequestBody = MessageRequestBody<MessageTypesEnum.Document> & {
1633
+ [MessageTypesEnum.Document]: [DocumentMediaObject];
1634
+ };
1635
+ type MetaImageMediaObject = MetaMediaObject & {
1636
+ caption?: string;
1637
+ };
1638
+ type HostedImageMediaObject = HostedMediaObject & {
1639
+ caption?: string;
1640
+ };
1641
+ type ImageMediaObject = MetaImageMediaObject | HostedImageMediaObject;
1642
+ type ImageMessageRequestBody = MessageRequestBody<MessageTypesEnum.Image> & {
1643
+ [MessageTypesEnum.Image]: [ImageMediaObject];
1644
+ };
1645
+ type MetaVideoMediaObject = MetaMediaObject & {
1646
+ caption?: string;
1647
+ };
1648
+ type HostedVideoMediaObject = HostedMediaObject & {
1649
+ caption?: string;
1650
+ };
1651
+ type VideoMediaObject = MetaVideoMediaObject | HostedVideoMediaObject;
1652
+ type VideoMessageRequestBody = MessageRequestBody<MessageTypesEnum.Video> & {
1653
+ [MessageTypesEnum.Video]: [VideoMediaObject];
1654
+ };
1655
+ type StickerMediaObject = MetaMediaObject | HostedMediaObject;
1656
+ type StickerMessageRequestBody = MessageRequestBody<MessageTypesEnum.Sticker> & {
1657
+ [MessageTypesEnum.Sticker]: [StickerMediaObject];
1658
+ };
1659
+ //#endregion
1660
+ //#region src/api/messages/types/contact.d.ts
1661
+ type AddressesObject = {
1662
+ street?: string;
1663
+ city?: string;
1664
+ state?: string;
1665
+ zip?: string;
1666
+ country?: string;
1667
+ country_code?: string;
1668
+ type?: 'HOME' | 'WORK' | string;
1669
+ };
1670
+ type EmailObject = {
1671
+ email?: string;
1672
+ type?: 'HOME' | 'WORK' | string;
1673
+ };
1674
+ type NameObject = {
1675
+ formatted_name: string;
1676
+ first_name?: string;
1677
+ last_name?: string;
1678
+ middle_name?: string;
1679
+ suffix?: string;
1680
+ prefix?: string;
1681
+ };
1682
+ type OrgObject = {
1683
+ company?: string;
1684
+ department?: string;
1685
+ title?: string;
1686
+ };
1687
+ type PhoneObject = {
1688
+ phone?: 'PHONE_NUMBER';
1689
+ type?: 'CELL' | 'MAIN' | 'IPHONE' | 'HOME' | 'WORK' | string;
1690
+ wa_id?: string;
1691
+ };
1692
+ type URLObject = {
1693
+ url?: string;
1694
+ type?: 'HOME' | 'WORK' | string;
1695
+ };
1696
+ type ContactObject = {
1697
+ addresses?: AddressesObject[];
1698
+ birthday?: `${number}${number}${number}${number}-${number}${number}-${number}${number}`;
1699
+ emails?: EmailObject[];
1700
+ name: NameObject;
1701
+ org?: OrgObject;
1702
+ phones?: PhoneObject[];
1703
+ urls?: URLObject[];
1704
+ };
1705
+ type ContactsMessageRequestBody = MessageRequestBody<MessageTypesEnum.Contacts> & {
1706
+ [MessageTypesEnum.Contacts]: [ContactObject];
1707
+ };
1708
+ //#endregion
1709
+ //#region src/api/messages/types/location.d.ts
1710
+ type LocationObject = {
1711
+ longitude: number;
1712
+ latitude: number;
1713
+ name?: string;
1714
+ address?: string;
1715
+ };
1716
+ type LocationMessageRequestBody = MessageRequestBody<MessageTypesEnum.Location> & {
1717
+ [MessageTypesEnum.Location]: [LocationObject];
1718
+ };
1719
+ //#endregion
1720
+ //#region src/api/messages/types/interactive.d.ts
1721
+ type DocumentMediaObject$1 = {
1722
+ id?: string;
1723
+ link?: string;
1724
+ caption?: string;
1725
+ filename?: string;
1726
+ };
1727
+ type ImageMediaObject$1 = {
1728
+ id?: string;
1729
+ link?: string;
1730
+ caption?: string;
1731
+ };
1732
+ type VideoMediaObject$1 = {
1733
+ id?: string;
1734
+ link?: string;
1735
+ caption?: string;
1736
+ };
1737
+ type ProductObject = {
1738
+ product_retailer_id: string;
1739
+ };
1740
+ type SimpleTextObject = {
1741
+ text: string;
1742
+ };
1743
+ type RowObject = {
1744
+ id: string;
1745
+ title: string;
1746
+ description?: string;
1747
+ };
1748
+ type MultiProductSectionObject = {
1749
+ product_items: ProductObject[];
1750
+ rows?: never;
1751
+ title?: string;
1752
+ };
1753
+ type ListSectionObject = {
1754
+ product_items?: never;
1755
+ rows: RowObject[];
1756
+ title?: string;
1757
+ };
1758
+ type SectionObject = MultiProductSectionObject | ListSectionObject;
1759
+ type ButtonObject = {
1760
+ title: string;
1761
+ id: string;
1762
+ };
1763
+ type ReplyButtonObject = {
1764
+ type: 'reply';
1765
+ reply: ButtonObject;
1766
+ };
1767
+ type ActionObject = {
1768
+ buttons?: ReplyButtonObject[];
1769
+ catalog_id?: string;
1770
+ product_retailer_id?: string;
1771
+ sections?: SectionObject[];
1772
+ };
1773
+ type HeaderObject = {
1774
+ type: 'document' | 'image' | 'text' | 'video';
1775
+ document?: DocumentMediaObject$1;
1776
+ image?: ImageMediaObject$1;
1777
+ text?: string;
1778
+ video?: VideoMediaObject$1;
1779
+ };
1780
+ type ButtonInteractiveObject = {
1781
+ type: InteractiveTypesEnum.Button;
1782
+ body: SimpleTextObject;
1783
+ footer?: SimpleTextObject;
1784
+ header?: HeaderObject;
1785
+ action: ActionObject;
1786
+ };
1787
+ type ListInteractiveObject = {
1788
+ type: InteractiveTypesEnum.List;
1789
+ body: SimpleTextObject;
1790
+ footer?: SimpleTextObject;
1791
+ header?: HeaderObject;
1792
+ action: ActionObject;
1793
+ };
1794
+ type ProductInteractiveObject = {
1795
+ type: InteractiveTypesEnum.Product;
1796
+ body?: SimpleTextObject;
1797
+ footer?: SimpleTextObject;
1798
+ header?: HeaderObject;
1799
+ action: ActionObject;
1800
+ };
1801
+ type ProductListInteractiveObject = {
1802
+ type: InteractiveTypesEnum.ProductList;
1803
+ body: SimpleTextObject;
1804
+ footer?: SimpleTextObject;
1805
+ header: HeaderObject;
1806
+ action: ActionObject;
1807
+ };
1808
+ type CtaUrlParameters = {
1809
+ display_text: string;
1810
+ url: string;
1811
+ };
1812
+ type CtaUrlActionObject = {
1813
+ name: 'cta_url';
1814
+ parameters: CtaUrlParameters;
1815
+ };
1816
+ type CtaUrlInteractiveObject = {
1817
+ type: InteractiveTypesEnum.CtaUrl;
1818
+ body?: SimpleTextObject;
1819
+ footer?: SimpleTextObject;
1820
+ header?: HeaderObject;
1821
+ action: CtaUrlActionObject;
1822
+ };
1823
+ type LocationRequestActionObject = {
1824
+ name: 'send_location';
1825
+ };
1826
+ type LocationRequestInteractiveObject = {
1827
+ type: InteractiveTypesEnum.LocationRequest;
1828
+ body: SimpleTextObject;
1829
+ footer?: SimpleTextObject;
1830
+ header?: HeaderObject;
1831
+ action: LocationRequestActionObject;
1832
+ };
1833
+ type AddressValues = {
1834
+ name?: string;
1835
+ phone_number?: string;
1836
+ in_pin_code?: string;
1837
+ house_number?: string;
1838
+ floor_number?: string;
1839
+ tower_number?: string;
1840
+ building_name?: string;
1841
+ address?: string;
1842
+ landmark_area?: string;
1843
+ city?: string;
1844
+ state?: string;
1845
+ };
1846
+ type SavedAddress = {
1847
+ id: string;
1848
+ value: AddressValues;
1849
+ };
1850
+ type ValidationErrors = { [key in keyof AddressValues]?: string };
1851
+ type AddressMessageParameters = {
1852
+ country: string;
1853
+ values?: AddressValues;
1854
+ saved_addresses?: SavedAddress[];
1855
+ validation_errors?: ValidationErrors;
1856
+ };
1857
+ type AddressMessageActionObject = {
1858
+ name: 'address_message';
1859
+ parameters: AddressMessageParameters;
1860
+ };
1861
+ type AddressMessageInteractiveObject = {
1862
+ type: InteractiveTypesEnum.AddressMessage;
1863
+ body: SimpleTextObject;
1864
+ footer?: SimpleTextObject;
1865
+ header?: HeaderObject;
1866
+ action: AddressMessageActionObject;
1867
+ };
1868
+ type FlowParameters = {
1869
+ flow_message_version: string;
1870
+ flow_id?: string;
1871
+ flow_name?: string;
1872
+ flow_cta: string;
1873
+ mode?: 'draft' | 'published';
1874
+ flow_token: string;
1875
+ flow_action: 'navigate' | 'data_exchange';
1876
+ flow_action_payload?: {
1877
+ screen?: string;
1878
+ data?: Record<string, string>;
1879
+ };
1880
+ };
1881
+ type FlowActionObject = {
1882
+ name: 'flow';
1883
+ parameters: FlowParameters;
1884
+ };
1885
+ type FlowInteractiveObject = {
1886
+ type: InteractiveTypesEnum.Flow;
1887
+ body: SimpleTextObject;
1888
+ footer?: SimpleTextObject;
1889
+ header?: HeaderObject;
1890
+ action: FlowActionObject;
1891
+ };
1892
+ type InteractiveObject = ButtonInteractiveObject | ListInteractiveObject | ProductInteractiveObject | ProductListInteractiveObject | CtaUrlInteractiveObject | LocationRequestInteractiveObject | AddressMessageInteractiveObject | FlowInteractiveObject;
1893
+ type InteractiveMessageRequestBody = MessageRequestBody<MessageTypesEnum.Interactive> & {
1894
+ [MessageTypesEnum.Interactive]: InteractiveObject;
1895
+ };
1896
+ //#endregion
1897
+ //#region src/api/messages/types/reaction.d.ts
1898
+ type ReActionObject = {
1899
+ message_id: string;
1900
+ emoji: string;
1901
+ };
1902
+ type ReactionMessageRequestBody = MessageRequestBody<MessageTypesEnum.Reaction> & ReActionObject;
1903
+ interface ReactionParams {
1904
+ messageId: string;
1905
+ emoji: string;
1906
+ to: string;
1907
+ }
1908
+ //#endregion
1909
+ //#region src/api/messages/types/common.d.ts
1910
+ type GeneralMessageBody = GeneralRequestBody & {
1911
+ /**
1912
+ * The Meta messaging product name.
1913
+ * @default 'whatsapp'
1914
+ */
1915
+ messaging_product: 'whatsapp';
1916
+ };
1917
+ type StatusObject = {
1918
+ status: 'read';
1919
+ message_id: string;
1920
+ typing_indicator?: TypingIndicatorObject;
1921
+ };
1922
+ type TypingIndicatorObject = {
1923
+ type: 'text';
1924
+ };
1925
+ type StatusRequestBody = GeneralMessageBody & StatusObject;
1926
+ type ConTextObject = {
1927
+ message_id: string;
1928
+ };
1929
+ type MessageRequestBody<T extends MessageTypesEnum> = GeneralMessageBody & {
1930
+ recipient_type?: string;
1931
+ to: string;
1932
+ context?: ConTextObject;
1933
+ type?: T;
1934
+ };
1935
+ interface MessageRequestParams<T> {
1936
+ body: T;
1937
+ to: string;
1938
+ replyMessageId?: string;
1939
+ }
1940
+ interface StatusParams {
1941
+ status: string;
1942
+ messageId: string;
1943
+ typingIndicator?: {
1944
+ type: string;
1945
+ };
1946
+ }
1947
+ type MessagesResponse = GeneralMessageBody & {
1948
+ contacts: [{
1949
+ input: string;
1950
+ wa_id: string;
1951
+ }];
1952
+ messages: [{
1953
+ id: string;
1954
+ }];
1955
+ };
1956
+ declare class MessagesClass extends BaseClass {
1957
+ text(params: TextMessageParams): Promise<MessagesResponse>;
1958
+ template(params: MessageRequestParams<MessageTemplateObject<ComponentTypesEnum>>): Promise<MessagesResponse>;
1959
+ audio(params: MessageRequestParams<AudioMediaObject>): Promise<MessagesResponse>;
1960
+ document(params: MessageRequestParams<DocumentMediaObject>): Promise<MessagesResponse>;
1961
+ image(params: MessageRequestParams<ImageMediaObject>): Promise<MessagesResponse>;
1962
+ video(params: MessageRequestParams<VideoMediaObject>): Promise<MessagesResponse>;
1963
+ sticker(params: MessageRequestParams<StickerMediaObject>): Promise<MessagesResponse>;
1964
+ contacts(params: MessageRequestParams<[ContactObject]>): Promise<MessagesResponse>;
1965
+ location(params: MessageRequestParams<LocationObject>): Promise<MessagesResponse>;
1966
+ interactive(params: MessageRequestParams<InteractiveObject>): Promise<MessagesResponse>;
1967
+ interactiveList(params: MessageRequestParams<InteractiveObject & {
1968
+ type: InteractiveTypesEnum.List;
1969
+ }>): Promise<MessagesResponse>;
1970
+ interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
1971
+ type: InteractiveTypesEnum.CtaUrl;
1972
+ }>): Promise<MessagesResponse>;
1973
+ interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
1974
+ type: InteractiveTypesEnum.LocationRequest;
1975
+ }>): Promise<MessagesResponse>;
1976
+ interactiveAddressMessage(params: MessageRequestParams<InteractiveObject & {
1977
+ type: InteractiveTypesEnum.AddressMessage;
1978
+ }>): Promise<MessagesResponse>;
1979
+ interactiveReplyButtons(params: MessageRequestParams<InteractiveObject & {
1980
+ type: InteractiveTypesEnum.Button;
1981
+ }>): Promise<MessagesResponse>;
1982
+ interactiveFlow(params: MessageRequestParams<InteractiveObject & {
1983
+ type: InteractiveTypesEnum.Flow;
1984
+ }>): Promise<MessagesResponse>;
1985
+ reaction(params: ReactionParams): Promise<MessagesResponse>;
1986
+ markAsRead(params: {
1987
+ messageId: string;
1988
+ }): Promise<MessagesResponse>;
1989
+ showTypingIndicator(params: {
1990
+ messageId: string;
1991
+ }): Promise<MessagesResponse>;
1992
+ status(params: StatusParams): Promise<MessagesResponse>;
1993
+ }
1994
+ //#endregion
1995
+ //#region src/api/media/types/common.d.ts
1996
+ type MediaResponse = {
1997
+ id: string;
1998
+ url: string;
1999
+ mime_type: string;
2000
+ sha256: string;
2001
+ file_size: number;
2002
+ messaging_product: 'whatsapp';
2003
+ };
2004
+ type MediasResponse = {
2005
+ data: MediaResponse[];
2006
+ paging: {
2007
+ cursors: {
2008
+ before: string;
2009
+ after: string;
2010
+ };
2011
+ };
2012
+ };
2013
+ type UploadMediaResponse = {
2014
+ id: string;
2015
+ };
2016
+ interface MediaClass {
2017
+ getMediaById(mediaId: string, phone_number_id?: string): Promise<MediaResponse>;
2018
+ uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
2019
+ deleteMedia(mediaId: string, phone_number_id?: string): Promise<ResponseSuccess>;
2020
+ downloadMedia(mediaUrl: string): Promise<Blob>;
2021
+ }
2022
+ //#endregion
2023
+ //#region src/core/webhook/types.d.ts
2024
+ interface WebhookContact {
2025
+ /**
2026
+ * WhatsApp ID of the contact. Business can respond to this contact using this ID.
2027
+ */
2028
+ wa_id: string;
2029
+ /**
2030
+ * Additional unique, alphanumeric identifier for a WhatsApp user
2031
+ */
2032
+ user_id?: string;
2033
+ /**
2034
+ * Profile of Whatsapp user
2035
+ */
2036
+ profile: {
2037
+ /**
2038
+ * The display name of the contact
2039
+ */
2040
+ name: string;
2041
+ };
2042
+ }
2043
+ /**
2044
+ * Base message interface with common properties
2045
+ */
2046
+ interface BaseMessage {
2047
+ id: string;
2048
+ from: string;
2049
+ timestamp: string;
2050
+ type: MessageTypesEnum;
2051
+ /**
2052
+ * Context object, included when a user replies or interacts
2053
+ */
2054
+ context?: {
2055
+ /**
2056
+ * ID of the message
2057
+ */
2058
+ id?: string;
2059
+ /**
2060
+ * ID of the sender
2061
+ */
2062
+ from?: string;
2063
+ /**
2064
+ * ID of the message being replied to or interacted with
2065
+ */
2066
+ message_id: string;
2067
+ /**
2068
+ * ID of the forwarded message, if applicable
2069
+ */
2070
+ forwarded?: boolean;
2071
+ /**
2072
+ * Frequently forwarded status
2073
+ */
2074
+ frequently_forwarded?: boolean;
2075
+ /**
2076
+ * Original message information if the message was referred
2077
+ */
2078
+ referred_product?: {
2079
+ /**
2080
+ * Catalog ID
2081
+ */
2082
+ catalog_id: string;
2083
+ /**
2084
+ * Product ID
2085
+ */
2086
+ product_retailer_id: string;
2087
+ };
2088
+ };
2089
+ /**
2090
+ * Errors array, if the message had errors
2091
+ */
2092
+ errors?: Array<{
2093
+ /**
2094
+ * Error code
2095
+ */
2096
+ code: number;
2097
+ /**
2098
+ * Error title
2099
+ */
2100
+ title: string;
2101
+ /**
2102
+ * Error message
2103
+ */
2104
+ message: string;
2105
+ /**
2106
+ * Error details object
2107
+ */
2108
+ error_data?: {
2109
+ /**
2110
+ * Describes the error details
2111
+ */
2112
+ details: string;
2113
+ };
2114
+ }>;
2115
+ }
2116
+ /**
2117
+ * Text message interface
2118
+ */
2119
+ interface TextMessage extends BaseMessage {
2120
+ type: MessageTypesEnum.Text;
2121
+ text: {
2122
+ /**
2123
+ * The text content of the message
2124
+ */
2125
+ body: string;
2126
+ preview_url?: boolean;
2127
+ };
2128
+ }
2129
+ /**
2130
+ * Image message interface
2131
+ */
2132
+ interface ImageMessage extends BaseMessage {
2133
+ type: MessageTypesEnum.Image;
2134
+ image: {
2135
+ /**
2136
+ * The image caption (if provided)
2137
+ */
2138
+ caption?: string;
2139
+ /**
2140
+ * The SHA256 hash of the image
2141
+ */
2142
+ sha256?: string;
2143
+ /**
2144
+ * The ID for the image
2145
+ */
2146
+ id: string;
2147
+ /**
2148
+ * The MIME type of the image
2149
+ */
2150
+ mime_type: string;
2151
+ };
2152
+ }
2153
+ /**
2154
+ * Video message interface
2155
+ */
2156
+ interface VideoMessage extends BaseMessage {
2157
+ type: MessageTypesEnum.Video;
2158
+ video: {
2159
+ /**
2160
+ * The video caption (if provided)
2161
+ */
2162
+ caption?: string;
2163
+ /**
2164
+ * The SHA256 hash of the video
2165
+ */
2166
+ sha256?: string;
2167
+ /**
2168
+ * The ID for the video
2169
+ */
2170
+ id: string;
2171
+ /**
2172
+ * The MIME type of the video
2173
+ */
2174
+ mime_type: string;
2175
+ };
2176
+ }
2177
+ /**
2178
+ * Audio message interface
2179
+ */
2180
+ interface AudioMessage extends BaseMessage {
2181
+ type: MessageTypesEnum.Audio;
2182
+ audio: {
2183
+ /**
2184
+ * The ID for the audio file
2185
+ */
2186
+ id: string;
2187
+ /**
2188
+ * The MIME type of the audio file
2189
+ */
2190
+ mime_type: string;
2191
+ /**
2192
+ * Whether the audio is a voice message
2193
+ */
2194
+ voice?: boolean;
2195
+ };
2196
+ }
2197
+ /**
2198
+ * Document message interface
2199
+ */
2200
+ interface DocumentMessage extends BaseMessage {
2201
+ type: MessageTypesEnum.Document;
2202
+ document: {
2203
+ /**
2204
+ * The document caption (if provided)
2205
+ */
2206
+ caption?: string;
2207
+ /**
2208
+ * The document filename
2209
+ */
2210
+ filename: string;
2211
+ /**
2212
+ * The SHA256 hash of the document
2213
+ */
2214
+ sha256?: string;
2215
+ /**
2216
+ * The ID for the document
2217
+ */
2218
+ id: string;
2219
+ /**
2220
+ * The MIME type of the document
2221
+ */
2222
+ mime_type: string;
2223
+ };
2224
+ }
2225
+ /**
2226
+ * Sticker message interface
2227
+ */
2228
+ interface StickerMessage extends BaseMessage {
2229
+ type: MessageTypesEnum.Sticker;
2230
+ sticker: {
2231
+ /**
2232
+ * The ID for the sticker
2233
+ */
2234
+ id: string;
2235
+ /**
2236
+ * Whether this is an animated sticker
2237
+ */
2238
+ animated: boolean;
2239
+ /**
2240
+ * The MIME type of the sticker
2241
+ */
2242
+ mime_type: string;
2243
+ };
2244
+ }
2245
+ /**
2246
+ * Reaction message interface
2247
+ */
2248
+ interface ReactionMessage extends BaseMessage {
2249
+ type: MessageTypesEnum.Reaction;
2250
+ reaction: {
2251
+ /**
2252
+ * The ID of the message being reacted to
2253
+ */
2254
+ message_id: string;
2255
+ /**
2256
+ * Emoji used for the reaction
2257
+ */
2258
+ emoji: string;
2259
+ };
2260
+ }
2261
+ /**
2262
+ * Contacts message interface
2263
+ */
2264
+ interface ContactsMessage extends BaseMessage {
2265
+ type: MessageTypesEnum.Contacts;
2266
+ contacts: Array<{
2267
+ /**
2268
+ * The contact's name
2269
+ */
2270
+ name: {
2271
+ /**
2272
+ * The formatted name
2273
+ */
2274
+ formatted_name: string;
2275
+ /**
2276
+ * The first name
2277
+ */
2278
+ first_name?: string;
2279
+ /**
2280
+ * The last name
2281
+ */
2282
+ last_name?: string;
2283
+ /**
2284
+ * The middle name
2285
+ */
2286
+ middle_name?: string;
2287
+ /**
2288
+ * The suffix
2289
+ */
2290
+ suffix?: string;
2291
+ /**
2292
+ * The prefix
2293
+ */
2294
+ prefix?: string;
2295
+ };
2296
+ /**
2297
+ * The contact's phone numbers
2298
+ */
2299
+ phones?: Array<{
2300
+ phone: string;
2301
+ type?: string;
2302
+ wa_id?: string;
2303
+ }>;
2304
+ /**
2305
+ * The contact's emails
2306
+ */
2307
+ emails?: Array<{
2308
+ email: string;
2309
+ type?: string;
2310
+ }>;
2311
+ /**
2312
+ * The contact's addresses
2313
+ */
2314
+ addresses?: Array<{
2315
+ street?: string;
2316
+ city?: string;
2317
+ state?: string;
2318
+ zip?: string;
2319
+ country?: string;
2320
+ country_code?: string;
2321
+ type?: string;
2322
+ }>;
2323
+ /**
2324
+ * The contact's organizations
2325
+ */
2326
+ org?: {
2327
+ company?: string;
2328
+ department?: string;
2329
+ title?: string;
2330
+ };
2331
+ /**
2332
+ * The contact's URLs
2333
+ */
2334
+ urls?: Array<{
2335
+ url: string;
2336
+ type?: string;
2337
+ }>;
2338
+ /**
2339
+ * The contact's birthday (YYYY-MM-DD format)
2340
+ */
2341
+ birthday?: string;
2342
+ }>;
2343
+ }
2344
+ /**
2345
+ * Location message interface
2346
+ */
2347
+ interface LocationMessage extends BaseMessage {
2348
+ type: MessageTypesEnum.Location;
2349
+ location: {
2350
+ /**
2351
+ * Latitude of the location
2352
+ */
2353
+ latitude: number;
2354
+ /**
2355
+ * Longitude of the location
2356
+ */
2357
+ longitude: number;
2358
+ /**
2359
+ * Name of the location
2360
+ */
2361
+ name?: string;
2362
+ /**
2363
+ * Address of the location
2364
+ */
2365
+ address?: string;
2366
+ };
2367
+ }
2368
+ /**
2369
+ * Interactive message interface
2370
+ */
2371
+ interface InteractiveMessage extends BaseMessage {
2372
+ type: MessageTypesEnum.Interactive;
2373
+ interactive: {
2374
+ /**
2375
+ * Type of the interactive message
2376
+ * Can be: button_reply, list_reply, flow, nfm_reply, etc.
2377
+ */
2378
+ type: string;
2379
+ /**
2380
+ * ID for the button that was clicked
2381
+ */
2382
+ button_reply?: {
2383
+ id: string;
2384
+ title: string;
2385
+ };
2386
+ /**
2387
+ * ID for the list item that was selected
2388
+ */
2389
+ list_reply?: {
2390
+ id: string;
2391
+ title: string;
2392
+ description?: string;
2393
+ };
2394
+ /**
2395
+ * NFM (No-Code Flow Message) reply data
2396
+ */
2397
+ nfm_reply?: {
2398
+ /**
2399
+ * Response data in JSON format
2400
+ */
2401
+ response_json: string;
2402
+ /**
2403
+ * Body text of the reply
2404
+ */
2405
+ body: string;
2406
+ /**
2407
+ * Name of the flow
2408
+ */
2409
+ name: string;
2410
+ };
2411
+ };
2412
+ }
2413
+ /**
2414
+ * System message interface
2415
+ */
2416
+ interface SystemMessage extends BaseMessage {
2417
+ type: MessageTypesEnum.System;
2418
+ system: {
2419
+ /**
2420
+ * The type of system update
2421
+ */
2422
+ type: string;
2423
+ /**
2424
+ * User's identity if the update is a customer identity change
2425
+ */
2426
+ identity?: string;
2427
+ /**
2428
+ * Old and new phone numbers if the update is a phone number change
2429
+ */
2430
+ customer?: {
2431
+ /**
2432
+ * The previous phone number
2433
+ */
2434
+ previous_wa_id: string;
2435
+ /**
2436
+ * The new phone number
2437
+ */
2438
+ wa_id: string;
2439
+ };
2440
+ };
2441
+ }
2442
+ /**
2443
+ * Order message interface
2444
+ */
2445
+ interface OrderMessage extends BaseMessage {
2446
+ type: MessageTypesEnum.Order;
2447
+ order: {
2448
+ /**
2449
+ * Catalog ID
2450
+ */
2451
+ catalog_id: string;
2452
+ /**
2453
+ * Product items in the order
2454
+ */
2455
+ product_items: Array<{
2456
+ /**
2457
+ * Product ID
2458
+ */
2459
+ product_retailer_id: string;
2460
+ /**
2461
+ * Quantity of the product
2462
+ */
2463
+ quantity: number;
2464
+ /**
2465
+ * Item price
2466
+ */
2467
+ item_price: number;
2468
+ /**
2469
+ * Currency code
2470
+ */
2471
+ currency: string;
2472
+ }>;
2473
+ /**
2474
+ * Text message included with the order
2475
+ */
2476
+ text?: string;
2477
+ };
2478
+ }
2479
+ /**
2480
+ * Button message interface
2481
+ */
2482
+ interface ButtonMessage extends BaseMessage {
2483
+ type: MessageTypesEnum.Button;
2484
+ button: {
2485
+ /**
2486
+ * The payload for the button
2487
+ */
2488
+ payload: string;
2489
+ /**
2490
+ * Button text
2491
+ */
2492
+ text: string;
2493
+ };
2494
+ }
2495
+ /**
2496
+ * Union type for all message types
2497
+ */
2498
+ type WhatsAppMessage = TextMessage | ImageMessage | VideoMessage | AudioMessage | DocumentMessage | StickerMessage | ReactionMessage | ContactsMessage | LocationMessage | InteractiveMessage | SystemMessage | OrderMessage | ButtonMessage;
2499
+ interface WebhookMessageValue {
2500
+ /**
2501
+ * The messaging product
2502
+ */
2503
+ messaging_product: string;
2504
+ /**
2505
+ * The metadata
2506
+ */
2507
+ metadata: {
2508
+ /**
2509
+ * The display phone number of the whatsapp business account
2510
+ */
2511
+ display_phone_number: string;
2512
+ /**
2513
+ * The phone number ID of the whatsapp business account
2514
+ */
2515
+ phone_number_id: string;
2516
+ };
2517
+ contacts?: Array<{
2518
+ profile: {
2519
+ /**
2520
+ * The display name of the whatsapp user
2521
+ */
2522
+ name: string;
2523
+ };
2524
+ /**
2525
+ * The whatsapp ID of the user
2526
+ */
2527
+ wa_id: string;
2528
+ }>;
2529
+ messages: Array<WhatsAppMessage>;
2530
+ statuses?: Array<{
2531
+ /**
2532
+ * The ID of the message
2533
+ */
2534
+ id: string;
2535
+ /**
2536
+ * The status of the message
2537
+ */
2538
+ status: MessageStatus;
2539
+ /**
2540
+ * The timestamp of the message
2541
+ */
2542
+ timestamp: string;
2543
+ /**
2544
+ * The recipient ID ( phone number of the user )
2545
+ */
2546
+ recipient_id: string;
2547
+ }>;
2548
+ errors?: Array<{
2549
+ /**
2550
+ * The error code
2551
+ */
2552
+ code: number;
2553
+ /**
2554
+ * The error title
2555
+ */
2556
+ title: string;
2557
+ /**
2558
+ * The error data
2559
+ */
2560
+ error_data?: {
2561
+ /**
2562
+ * The error details
2563
+ */
2564
+ details: string;
2565
+ };
2566
+ }>;
2567
+ }
2568
+ /**
2569
+ * Represents a message received through the webhook
2570
+ * Based on Meta's documentation: https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/components#messages-object
2571
+ */
2572
+ interface WebhookMessage {
2573
+ /**
2574
+ * The WhatsApp Business Account ID
2575
+ */
2576
+ wabaId: string;
2577
+ /**
2578
+ * The message ID
2579
+ */
2580
+ id: string;
2581
+ /**
2582
+ * The sender's phone number
2583
+ */
2584
+ from: string;
2585
+ /**
2586
+ * The timestamp of the message
2587
+ */
2588
+ timestamp: string;
2589
+ /**
2590
+ * The type of message (text, image, etc.)
2591
+ */
2592
+ type: MessageTypesEnum;
2593
+ /**
2594
+ * The phone number ID that received the message
2595
+ */
2596
+ phoneNumberId: string;
2597
+ /**
2598
+ * The display phone number that received the message
2599
+ */
2600
+ displayPhoneNumber: string;
2601
+ /**
2602
+ * The profile name of the sender
2603
+ */
2604
+ profileName: string;
2605
+ text?: TextMessage['text'];
2606
+ image?: ImageMessage['image'];
2607
+ video?: VideoMessage['video'];
2608
+ audio?: AudioMessage['audio'];
2609
+ document?: DocumentMessage['document'];
2610
+ sticker?: StickerMessage['sticker'];
2611
+ location?: LocationMessage['location'];
2612
+ contacts?: ContactsMessage['contacts'];
2613
+ interactive?: InteractiveMessage['interactive'];
2614
+ button?: ButtonMessage['button'];
2615
+ order?: OrderMessage['order'];
2616
+ system?: SystemMessage['system'];
2617
+ reaction?: ReactionMessage['reaction'];
2618
+ statuses?: {
2619
+ /**
2620
+ * Arbitrary string included in sent message
2621
+ */
2622
+ biz_opaque_callback_data?: string;
2623
+ /**
2624
+ * Information about the conversation
2625
+ */
2626
+ conversation?: {
2627
+ /**
2628
+ * Represents the ID of the conversation the given status notification belongs to
2629
+ */
2630
+ id: string;
2631
+ /**
2632
+ * Describes conversation category
2633
+ */
2634
+ origin: {
2635
+ /**
2636
+ * Indicates conversation category. This can also be referred to as a conversation entry point
2637
+ * - authentication: Conversation opened by business sending template categorized as AUTHENTICATION
2638
+ * - marketing: Conversation opened by business sending template categorized as MARKETING
2639
+ * - utility: Conversation opened by business sending template categorized as UTILITY
2640
+ * - service: Conversation opened by business replying to customer within service window
2641
+ * - referral_conversion: Free entry point conversation
2642
+ */
2643
+ type: 'authentication' | 'marketing' | 'utility' | 'service' | 'referral_conversion';
2644
+ };
2645
+ /**
2646
+ * Date when the conversation expires. Only present for messages with status 'sent'
2647
+ */
2648
+ expiration_timestamp?: string;
2649
+ };
2650
+ /**
2651
+ * Array of error objects describing the error
2652
+ */
2653
+ errors?: Array<{
2654
+ /**
2655
+ * Error code
2656
+ */
2657
+ code: number;
2658
+ /**
2659
+ * Error code title
2660
+ */
2661
+ title: string;
2662
+ /**
2663
+ * Error code message
2664
+ */
2665
+ message: string;
2666
+ /**
2667
+ * Error details object
2668
+ */
2669
+ error_data?: {
2670
+ /**
2671
+ * Describes the error details
2672
+ */
2673
+ details: string;
2674
+ };
2675
+ }>;
2676
+ /**
2677
+ * The ID for the message that the business sent to a customer
2678
+ */
2679
+ id: string;
2680
+ /**
2681
+ * Pricing information for the message/conversation
2682
+ */
2683
+ pricing?: {
2684
+ /**
2685
+ * Indicates if the given message or conversation is billable
2686
+ * @deprecated This field is deprecated. Visit the WhatsApp Changelog for more information.
2687
+ */
2688
+ billable?: boolean;
2689
+ /**
2690
+ * Indicates the conversation category:
2691
+ * - authentication: Authentication conversation
2692
+ * - authentication_international: Authentication-international conversation
2693
+ * - marketing: Marketing conversation
2694
+ * - utility: Utility conversation
2695
+ * - service: Service conversation
2696
+ * - referral_conversion: Free entry point conversation
2697
+ */
2698
+ category: 'authentication' | 'authentication_international' | 'marketing' | 'utility' | 'service' | 'referral_conversion';
2699
+ /**
2700
+ * Type of pricing model used by the business. Current supported value is CBP
2701
+ */
2702
+ pricing_model: 'CBP';
2703
+ };
2704
+ /**
2705
+ * The customer's WhatsApp ID. Business can respond to customer using this ID.
2706
+ * This ID may not match the customer's phone number.
2707
+ */
2708
+ recipient_id: string;
2709
+ /**
2710
+ * Status of the message:
2711
+ * - delivered: Message has been delivered
2712
+ * - read: Message has been read by the customer
2713
+ * - sent: Message has been sent to the customer
2714
+ */
2715
+ status: 'delivered' | 'read' | 'sent';
2716
+ /**
2717
+ * Unix timestamp for the status message
2718
+ */
2719
+ timestamp: string;
2720
+ };
2721
+ /**
2722
+ * The original message data as received from the webhook
2723
+ */
2724
+ originalData: any;
2725
+ }
2726
+ /**
2727
+ * Webhook event received from WhatsApp
2728
+ */
2729
+ interface WebhookEvent {
2730
+ /**
2731
+ * The field type of the event
2732
+ */
2733
+ field: string;
2734
+ /**
2735
+ * The event data
2736
+ */
2737
+ value: any;
2738
+ /**
2739
+ * The timestamp when the event was received
2740
+ */
2741
+ timestamp: number;
2742
+ }
2743
+ /**
2744
+ * Message handler function type
2745
+ */
2746
+ type MessageHandler$1 = (message: WebhookMessage) => void | Promise<void>;
2747
+ /**
2748
+ * Message status enum
2749
+ */
2750
+ declare enum MessageStatus {
2751
+ DELIVERED = "delivered",
2752
+ READ = "read",
2753
+ SENT = "sent",
2754
+ }
2755
+ //#endregion
2756
+ //#region src/api/qrCode/types/common.d.ts
2757
+ type QrCodeResponse = {
2758
+ code: string;
2759
+ prefilled_message: string;
2760
+ deep_link_url: string;
2761
+ qr_image_url?: string;
2762
+ };
2763
+ type QrCodesResponse = ResponseData<QrCodeResponse[]>;
2764
+ type CreateQrCodeRequest = {
2765
+ prefilled_message: string;
2766
+ generate_qr_image?: 'SVG' | 'PNG';
2767
+ };
2768
+ type UpdateQrCodeRequest = {
2769
+ code: string;
2770
+ prefilled_message: string;
2771
+ };
2772
+ interface QrCodeClass {
2773
+ createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
2774
+ getQrCodes(): Promise<QrCodesResponse>;
2775
+ getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
2776
+ updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
2777
+ deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
2778
+ }
2779
+ //#endregion
2780
+ //#region src/api/waba/types/common.d.ts
2781
+ /**
2782
+ * WhatsApp Business Account subscription configuration
2783
+ */
2784
+ type WabaSubscription = {
2785
+ whatsapp_business_api_data: {
2786
+ id: string;
2787
+ link: string;
2788
+ name: string;
2789
+ category: string;
2790
+ };
2791
+ override_callback_uri?: string;
2792
+ };
2793
+ /**
2794
+ * Parameters for updating WABA subscription
2795
+ */
2796
+ interface UpdateWabaSubscription {
2797
+ override_callback_uri: string;
2798
+ verify_token: string;
2799
+ }
2800
+ /**
2801
+ * Response containing all WABA subscriptions
2802
+ */
2803
+ interface WabaSubscriptions {
2804
+ data: Array<WabaSubscription>;
2805
+ }
2806
+ /**
2807
+ * WABA account review status enumeration
2808
+ */
2809
+ declare enum WabaAccountReviewStatus {
2810
+ Approved = "APPROVED",
2811
+ Active = "ACTIVE",
2812
+ Inactive = "INACTIVE",
2813
+ Disabled = "DISABLED",
2814
+ }
2815
+ /**
2816
+ * WABA health status for message sending capability
2817
+ */
2818
+ declare enum WabaHealthStatusCanSendMessage {
2819
+ Blocked = "BLOCKED",
2820
+ Limited = "LIMITED",
2821
+ Available = "AVAILABLE",
2822
+ }
2823
+ /**
2824
+ * WABA account status enumeration
2825
+ */
2826
+ declare enum WabaAccountStatus {
2827
+ Approved = "APPROVED",
2828
+ Active = "ACTIVE",
2829
+ Inactive = "INACTIVE",
2830
+ Disabled = "DISABLED",
2831
+ }
2832
+ /**
2833
+ * Business verification status enumeration
2834
+ */
2835
+ declare enum WabaBusinessVerificationStatus {
2836
+ Verified = "verified",
2837
+ PendingSubmission = "pending_submission",
2838
+ Unverified = "unverified",
2839
+ Rejected = "rejected",
2840
+ }
2841
+ /**
2842
+ * WABA health status error details
2843
+ */
2844
+ interface WabaHealthStatusError {
2845
+ error_code?: number;
2846
+ error_description?: string;
2847
+ possible_solution?: string;
2848
+ }
2849
+ /**
2850
+ * WABA health status entity information
2851
+ */
2852
+ interface WabaHealthStatusEntity {
2853
+ entity_type?: string;
2854
+ id?: string;
2855
+ can_send_message?: string;
2856
+ errors?: WabaHealthStatusError[];
2857
+ }
2858
+ /**
2859
+ * Overall WABA health status
2860
+ */
2861
+ interface WabaHealthStatus {
2862
+ can_send_message?: WabaHealthStatusCanSendMessage;
2863
+ entities?: WabaHealthStatusEntity[];
2864
+ }
2865
+ /**
2866
+ * WhatsApp Business Account information
2867
+ */
2868
+ interface WabaAccount {
2869
+ account_review_status?: WabaAccountReviewStatus;
2870
+ id?: string;
2871
+ health_status?: WabaHealthStatus;
2872
+ status?: WabaAccountStatus;
2873
+ business_verification_status?: WabaBusinessVerificationStatus;
2874
+ message_template_namespace?: string;
2875
+ name?: string;
2876
+ ownership_type?: string;
2877
+ currency?: string;
2878
+ }
2879
+ /**
2880
+ * Available fields for WABA account queries
2881
+ */
2882
+ type WabaAccountFields = 'id' | 'name' | 'account_review_status' | 'auth_international_rate_eligibility' | 'business_verification_status' | 'country' | 'currency' | 'health_status' | 'status' | 'ownership_type' | 'message_template_namespace';
2883
+ /**
2884
+ * Parameter type for specifying which WABA account fields to retrieve
2885
+ */
2886
+ type WabaAccountFieldsParam = WabaAccountFields[];
2887
+ /**
2888
+ * Interface defining all WABA API methods
2889
+ */
2890
+ interface WABAClass {
2891
+ getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
2892
+ getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
2893
+ updateWabaSubscription(params: UpdateWabaSubscription): Promise<ResponseSuccess>;
2894
+ unsubscribeFromWaba(): Promise<ResponseSuccess>;
2895
+ }
2896
+ //#endregion
2897
+ //#region src/utils/isMetaError.d.ts
2898
+ interface MetaError extends Error {
2899
+ error: {
2900
+ message: string;
2901
+ type: string;
2902
+ code: number;
2903
+ error_data?: {
2904
+ messaging_product: 'whatsapp';
2905
+ details: string;
2906
+ };
2907
+ error_subcode?: number;
2908
+ fbtrace_id: string;
2909
+ };
2910
+ }
2911
+ /**
2912
+ * Determines if the error is a Meta API error response
2913
+ * @param error Any error object to check
2914
+ * @returns Type guard indicating if error is a Meta API error
2915
+ */
2916
+ declare function isMetaError(error: any): error is MetaError;
2917
+ //#endregion
2918
+ //#region src/api/flow/types/common.d.ts
2919
+ /**
2920
+ * Enum for Flow Status
2921
+ */
2922
+ declare enum FlowStatusEnum {
2923
+ Draft = "DRAFT",
2924
+ Published = "PUBLISHED",
2925
+ Throttled = "THROTTLED",
2926
+ Blocked = "BLOCKED",
2927
+ Deprecated = "DEPRECATED",
2928
+ }
2929
+ /**
2930
+ * Enum for Flow Categories
2931
+ */
2932
+ declare enum FlowCategoryEnum {
2933
+ SignUp = "SIGN_UP",
2934
+ SignIn = "SIGN_IN",
2935
+ AppointmentBooking = "APPOINTMENT_BOOKING",
2936
+ LeadGeneration = "LEAD_GENERATION",
2937
+ ContactUs = "CONTACT_US",
2938
+ CustomerSupport = "CUSTOMER_SUPPORT",
2939
+ Survey = "SURVEY",
2940
+ Other = "OTHER",
2941
+ }
2942
+ declare enum FlowActionEnum {
2943
+ INIT = "INIT",
2944
+ BACK = "BACK",
2945
+ DATA_EXCHANGE = "data_exchange",
2946
+ }
2947
+ /**
2948
+ * Enum for Flow Types in webhook handlers
2949
+ * Used to register handlers for specific flow events
2950
+ */
2951
+ declare enum FlowTypeEnum {
2952
+ /** Health check/ping requests */
2953
+ Ping = "ping",
2954
+ /** Data exchange requests */
2955
+ Change = "data_exchange",
2956
+ /** Error notification requests */
2957
+ Error = "error",
2958
+ /** Match all flow action types */
2959
+ All = "*",
2960
+ }
2961
+ type FlowType = (typeof FlowTypeEnum)[keyof typeof FlowTypeEnum];
2962
+ /**
2963
+ * Flow Validation Error Pointer
2964
+ */
2965
+ interface FlowValidationErrorPointer {
2966
+ line_start: number;
2967
+ line_end: number;
2968
+ column_start: number;
2969
+ column_end: number;
2970
+ path: string;
2971
+ }
2972
+ /**
2973
+ * Flow Validation Error
2974
+ */
2975
+ interface FlowValidationError {
2976
+ error: string;
2977
+ error_type: string;
2978
+ message: string;
2979
+ line_start: number;
2980
+ line_end: number;
2981
+ column_start: number;
2982
+ column_end: number;
2983
+ pointers: FlowValidationErrorPointer[];
2984
+ }
2985
+ /**
2986
+ * Flow Item
2987
+ */
2988
+ interface Flow {
2989
+ id: string;
2990
+ name: string;
2991
+ status: FlowStatusEnum;
2992
+ categories: FlowCategoryEnum[];
2993
+ validation_errors: FlowValidationError[];
2994
+ }
2995
+ /**
2996
+ * Pagination Cursors
2997
+ */
2998
+ interface PaginationCursors {
2999
+ before: string;
3000
+ after: string;
3001
+ }
3002
+ /**
3003
+ * Pagination Object
3004
+ */
3005
+ interface Pagination {
3006
+ cursors: PaginationCursors;
3007
+ }
3008
+ /**
3009
+ * Flows List Response
3010
+ */
3011
+ interface FlowsListResponse {
3012
+ data: Flow[];
3013
+ paging: Pagination;
3014
+ }
3015
+ /**
3016
+ * Flow Asset
3017
+ */
3018
+ interface FlowAsset {
3019
+ name: string;
3020
+ asset_type: string;
3021
+ download_url: string;
3022
+ }
3023
+ /**
3024
+ * Flow Assets Response
3025
+ */
3026
+ interface FlowAssetsResponse {
3027
+ data: FlowAsset[];
3028
+ paging: Pagination;
3029
+ }
3030
+ /**
3031
+ * Flow Preview
3032
+ */
3033
+ interface FlowPreview {
3034
+ preview_url: string;
3035
+ expires_at: string;
3036
+ }
3037
+ /**
3038
+ * Flow Preview Response
3039
+ */
3040
+ interface FlowPreviewResponse {
3041
+ preview: FlowPreview;
3042
+ id: string;
3043
+ }
3044
+ /**
3045
+ * Flow Migration Result
3046
+ */
3047
+ interface FlowMigrationResult {
3048
+ source_name: string;
3049
+ source_id: string;
3050
+ migrated_id: string;
3051
+ }
3052
+ /**
3053
+ * Flow Migration Failure
3054
+ */
3055
+ interface FlowMigrationFailure {
3056
+ source_name: string;
3057
+ error_code: string;
3058
+ error_message: string;
3059
+ }
3060
+ /**
3061
+ * Create Flow Response
3062
+ */
3063
+ interface CreateFlowResponse {
3064
+ id: string;
3065
+ success: boolean;
3066
+ validation_errors?: FlowValidationError[];
3067
+ }
3068
+ /**
3069
+ * Update Flow Response
3070
+ */
3071
+ interface UpdateFlowResponse {
3072
+ success: boolean;
3073
+ validation_errors?: FlowValidationError[];
3074
+ }
3075
+ /**
3076
+ * Flow Migration Response
3077
+ */
3078
+ interface FlowMigrationResponse {
3079
+ migrated_flows: FlowMigrationResult[];
3080
+ failed_flows: FlowMigrationFailure[];
3081
+ }
3082
+ /**
3083
+ * Validate Flow JSON Response
3084
+ */
3085
+ interface ValidateFlowJsonResponse {
3086
+ valid: boolean;
3087
+ success: boolean;
3088
+ validation_errors?: FlowValidationError[];
3089
+ }
3090
+ /**
3091
+ * WhatsApp Flow Endpoint - Encrypted Request Payload
3092
+ * Represents the raw encrypted data received from WhatsApp
3093
+ */
3094
+ interface FlowEncryptedRequestPayload {
3095
+ encrypted_aes_key: string;
3096
+ encrypted_flow_data: string;
3097
+ initial_vector: string;
3098
+ }
3099
+ /**
3100
+ * WhatsApp Flow Endpoint - Decrypted Request Response
3101
+ * Represents the successfully decrypted data and encryption keys
3102
+ */
3103
+ interface FlowDecryptedRequestResponse {
3104
+ decryptedBody: any;
3105
+ aesKeyBuffer: Buffer;
3106
+ initialVectorBuffer: Buffer;
3107
+ }
3108
+ /**
3109
+ * WhatsApp Flow Endpoint - HTTP Request with Body
3110
+ * Represents an HTTP request with the encrypted payload
3111
+ */
3112
+ interface FlowHttpRequest extends IncomingMessage {
3113
+ body: FlowEncryptedRequestPayload;
3114
+ headers: IncomingHttpHeaders;
3115
+ }
3116
+ /**
3117
+ * WhatsApp Flow Endpoint - Health Check Request
3118
+ * Represents the structure of a health check request
3119
+ */
3120
+ interface FlowHealthCheckRequest {
3121
+ action: 'ping';
3122
+ version: '3.0';
3123
+ }
3124
+ /**
3125
+ * WhatsApp Flow Endpoint - Health Check Response
3126
+ * The expected response structure for health check requests
3127
+ */
3128
+ interface FlowHealthCheckResponse {
3129
+ data: {
3130
+ status: 'active';
3131
+ };
3132
+ }
3133
+ /**
3134
+ * WhatsApp Flow Endpoint - Data Exchange Request
3135
+ * Represents the structure of a data exchange request
3136
+ */
3137
+ interface FlowDataExchangeRequest {
3138
+ version: '3.0';
3139
+ action: FlowActionEnum;
3140
+ screen: string;
3141
+ flow_token: string;
3142
+ data?: Record<string, any> & {
3143
+ error_message?: string;
3144
+ };
3145
+ }
3146
+ /**
3147
+ * WhatsApp Flow Endpoint - Data Exchange Response
3148
+ * The expected response structure for data exchange requests
3149
+ */
3150
+ interface FlowDataExchangeResponse {
3151
+ screen?: string;
3152
+ data?: Record<string, any | {
3153
+ error_message?: string;
3154
+ }>;
3155
+ }
3156
+ /**
3157
+ * WhatsApp Flow Endpoint - Success Screen Response
3158
+ * The expected response structure for success screen requests
3159
+ */
3160
+ interface FlowSuccessScreenResponse {
3161
+ screen: 'SUCCESS';
3162
+ data: {
3163
+ extension_message_response?: {
3164
+ params?: {
3165
+ flow_token: string;
3166
+ [key: string]: string;
3167
+ };
3168
+ };
3169
+ };
3170
+ }
3171
+ /**
3172
+ * WhatsApp Flow Endpoint - Error Notification Request
3173
+ * Represents the structure of an error notification request
3174
+ */
3175
+ interface FlowErrorNotificationRequest {
3176
+ version: '3.0';
3177
+ action: Exclude<FlowActionEnum, FlowActionEnum.BACK>;
3178
+ screen: string;
3179
+ flow_token: string;
3180
+ data: {
3181
+ error: string;
3182
+ error_message: string;
3183
+ };
3184
+ }
3185
+ /**
3186
+ * WhatsApp Flow Endpoint - Error Notification Response
3187
+ * The expected response structure for error notification requests
3188
+ */
3189
+ interface FlowErrorNotificationResponse {
3190
+ acknowledged: boolean;
3191
+ }
3192
+ /**
3193
+ * WhatsApp Flow Endpoint - Comprehensive Request Object
3194
+ * A combined type that includes all possible fields from different request types
3195
+ * with all fields being optional for flexibility
3196
+ */
3197
+ interface FlowEndpointRequest {
3198
+ version?: '3.0';
3199
+ action?: 'ping' | FlowActionEnum;
3200
+ screen?: string;
3201
+ flow_token?: string;
3202
+ data?: Record<string, any> & {
3203
+ error_key?: string;
3204
+ error_message?: string;
3205
+ };
3206
+ }
3207
+ /**
3208
+ * WhatsApp Flow Endpoint - Response
3209
+ * Union type for all possible response types from a Flow endpoint
3210
+ */
3211
+ type FlowEndpointResponse = FlowHealthCheckResponse | FlowDataExchangeResponse | FlowErrorNotificationResponse | FlowSuccessScreenResponse;
3212
+ interface FlowClass {
3213
+ /**
3214
+ * List Flows
3215
+ *
3216
+ * @param wabaId - The WABA ID
3217
+ * @returns Promise with the list of flows
3218
+ */
3219
+ listFlows(wabaId: string): Promise<FlowsListResponse>;
3220
+ /**
3221
+ * Create Flow
3222
+ *
3223
+ * @param wabaId - The WABA ID
3224
+ * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
3225
+ * @returns Promise with the created flow ID
3226
+ */
3227
+ createFlow(wabaId: string, data: {
3228
+ name: string;
3229
+ categories?: FlowCategoryEnum[];
3230
+ endpoint_uri?: string;
3231
+ clone_flow_id?: string;
3232
+ flow_json?: string;
3233
+ publish?: boolean;
3234
+ }): Promise<CreateFlowResponse>;
3235
+ /**
3236
+ * Get Flow
3237
+ *
3238
+ * @param flowId - The flow ID
3239
+ * @param fields - Optional fields to return
3240
+ * @param dateFormat - Optional date format
3241
+ * @returns Promise with the flow details
3242
+ */
3243
+ getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
3244
+ /**
3245
+ * Update Flow Metadata
3246
+ *
3247
+ * @param flowId - The flow ID
3248
+ * @param data - The flow metadata to update
3249
+ * @returns Promise with the success status
3250
+ */
3251
+ updateFlowMetadata(flowId: string, data: {
3252
+ name?: string;
3253
+ categories?: FlowCategoryEnum[];
3254
+ endpoint_uri?: string;
3255
+ application_id?: string;
3256
+ }): Promise<ResponseSuccess>;
3257
+ /**
3258
+ * Delete Flow
3259
+ *
3260
+ * @param flowId - The flow ID
3261
+ * @returns Promise with the success status
3262
+ */
3263
+ deleteFlow(flowId: string): Promise<ResponseSuccess>;
3264
+ /**
3265
+ * List Assets (Get Flow JSON URL)
3266
+ *
3267
+ * @param flowId - The flow ID
3268
+ * @returns Promise with the list of assets
3269
+ */
3270
+ listAssets(flowId: string): Promise<FlowAssetsResponse>;
3271
+ /**
3272
+ * Update Flow JSON
3273
+ *
3274
+ * @param flowId - The flow ID
3275
+ * @param data - The asset data including asset_type, file, and name
3276
+ * @returns Promise with the success status and validation errors
3277
+ */
3278
+ updateFlowJson(flowId: string, data: {
3279
+ file: Blob | Buffer | object;
3280
+ name?: string;
3281
+ }): Promise<UpdateFlowResponse>;
3282
+ /**
3283
+ * Validate Flow JSON by attempting an update without publishing.
3284
+ * This is a convenience method; the API doesn't have a dedicated validation endpoint.
3285
+ *
3286
+ * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).
3287
+ * @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.
3288
+ * @returns Promise indicating if the JSON is valid and includes validation errors if any.
3289
+ */
3290
+ validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
3291
+ /**
3292
+ * Publish Flow
3293
+ *
3294
+ * @param flowId - The flow ID
3295
+ * @returns Promise with the success status
3296
+ */
3297
+ publishFlow(flowId: string): Promise<ResponseSuccess>;
3298
+ /**
3299
+ * Deprecate Flow
3300
+ *
3301
+ * @param flowId - The flow ID
3302
+ * @returns Promise with the success status
3303
+ */
3304
+ deprecateFlow(flowId: string): Promise<ResponseSuccess>;
3305
+ /**
3306
+ * Migrate Flows
3307
+ *
3308
+ * @param wabaId - The destination WABA ID
3309
+ * @param data - The migration data including source_waba_id and optional source_flow_names
3310
+ * @returns Promise with migration results
3311
+ */
3312
+ migrateFlows(wabaId: string, data: {
3313
+ source_waba_id: string;
3314
+ source_flow_names?: string[];
3315
+ }): Promise<FlowMigrationResponse>;
3316
+ }
3317
+ //#endregion
3318
+ //#region src/api/flow/FlowApi.d.ts
3319
+ /**
3320
+ * API for managing WhatsApp Flows.
3321
+ *
3322
+ * This API allows you to:
3323
+ * - List flows
3324
+ * - Create flows
3325
+ * - Get flow details and previews
3326
+ * - Update flow metadata and JSON
3327
+ * - Delete flows
3328
+ * - Publish and deprecate flows
3329
+ * - Migrate flows between WABAs
3330
+ * - Validate flow JSON
3331
+ */
3332
+ declare class FlowApi extends BaseAPI implements FlowClass {
3333
+ constructor(config: WabaConfigType, client: RequesterClass);
3334
+ /**
3335
+ * List Flows
3336
+ *
3337
+ * @param wabaId - The WABA ID
3338
+ * @returns Promise with the list of flows
3339
+ */
3340
+ listFlows(wabaId: string): Promise<FlowsListResponse>;
3341
+ /**
3342
+ * Create Flow
3343
+ *
3344
+ * @param wabaId - The WABA ID
3345
+ * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
3346
+ * @returns Promise with the created flow ID and validation errors if any
3347
+ */
3348
+ createFlow(wabaId: string, data: {
3349
+ name: string;
3350
+ categories?: FlowCategoryEnum[];
3351
+ endpoint_uri?: string;
3352
+ clone_flow_id?: string;
3353
+ flow_json?: string;
3354
+ publish?: boolean;
3355
+ }): Promise<CreateFlowResponse>;
3356
+ /**
3357
+ * Get Flow details
3358
+ *
3359
+ * @param flowId - The flow ID
3360
+ * @param fields - Optional fields to return (e.g., 'name,status,preview.invalidate(false)')
3361
+ * @param dateFormat - Optional date format
3362
+ * @returns Promise with the flow details or preview response
3363
+ */
3364
+ getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
3365
+ /**
3366
+ * Get Flow Preview URL
3367
+ *
3368
+ * @param flowId - The flow ID
3369
+ * @param invalidate - Optional. If true, invalidates existing preview and generates a new one. Defaults to false.
3370
+ * @returns Promise with the flow preview details
3371
+ */
3372
+ getFlowPreview(flowId: string, invalidate?: boolean): Promise<FlowPreviewResponse>;
3373
+ /**
3374
+ * Update Flow Metadata
3375
+ *
3376
+ * @param flowId - The flow ID
3377
+ * @param data - The flow metadata to update (name, categories, endpoint_uri, application_id)
3378
+ * @returns Promise with the success status
3379
+ */
3380
+ updateFlowMetadata(flowId: string, data: {
3381
+ name?: string;
3382
+ categories?: FlowCategoryEnum[];
3383
+ endpoint_uri?: string;
3384
+ application_id?: string;
3385
+ }): Promise<ResponseSuccess>;
3386
+ /**
3387
+ * Delete Flow (only works if the Flow is in DRAFT status)
3388
+ *
3389
+ * @param flowId - The flow ID
3390
+ * @returns Promise with the success status
3391
+ */
3392
+ deleteFlow(flowId: string): Promise<ResponseSuccess>;
3393
+ /**
3394
+ * List Assets (e.g., get Flow JSON download URL)
3395
+ *
3396
+ * @param flowId - The flow ID
3397
+ * @returns Promise with the list of assets
3398
+ */
3399
+ listAssets(flowId: string): Promise<FlowAssetsResponse>;
3400
+ /**
3401
+ * Update Flow JSON by uploading a file, buffer, JSON object, or Blob.
3402
+ *
3403
+ * @param flowId - The flow ID
3404
+ * @param data - Object containing the file data and optional name.
3405
+ * @param data.file - The Flow JSON content as a Buffer, JSON object, or Blob.
3406
+ * @param data.name - Optional name for the asset, defaults to 'flow.json'.
3407
+ * @returns Promise with the success status and validation errors, if any.
3408
+ */
3409
+ updateFlowJson(flowId: string, data: {
3410
+ file: Blob | Buffer | object;
3411
+ name?: string;
3412
+ }): Promise<UpdateFlowResponse>;
3413
+ /**
3414
+ * Validate Flow JSON by attempting an update without publishing.
3415
+ * This is a convenience method; the API doesn't have a dedicated validation endpoint.
3416
+ *
3417
+ * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).
3418
+ * @param flowJsonData - The Flow JSON content as a file path (string), Buffer, JSON object, or Blob.
3419
+ * @returns Promise indicating if the JSON is valid and includes validation errors if any.
3420
+ */
3421
+ validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
3422
+ /**
3423
+ * Publish Flow
3424
+ *
3425
+ * @param flowId - The flow ID
3426
+ * @returns Promise with the success status
3427
+ */
3428
+ publishFlow(flowId: string): Promise<ResponseSuccess>;
3429
+ /**
3430
+ * Deprecate Flow
3431
+ *
3432
+ * @param flowId - The flow ID
3433
+ * @returns Promise with the success status
3434
+ */
3435
+ deprecateFlow(flowId: string): Promise<ResponseSuccess>;
3436
+ /**
3437
+ * Migrate Flows between WABAs
3438
+ *
3439
+ * @param destinationWabaId - The destination WABA ID
3440
+ * @param data - The migration data including source_waba_id and optional source_flow_names
3441
+ * @returns Promise with migration results (successes and failures)
3442
+ */
3443
+ migrateFlows(destinationWabaId: string, data: {
3444
+ source_waba_id: string;
3445
+ source_flow_names?: string[];
3446
+ }): Promise<FlowMigrationResponse>;
3447
+ }
3448
+ //#endregion
3449
+ //#region src/api/media/MediaApi.d.ts
3450
+ /**
3451
+ * API for managing WhatsApp Media.
3452
+ *
3453
+ * This API allows you to:
3454
+ * - Get media information by ID
3455
+ * - Upload media files
3456
+ * - Delete media files
3457
+ * - Download media files from URLs
3458
+ */
3459
+ declare class MediaApi extends BaseAPI implements MediaClass {
3460
+ private readonly endpoint;
3461
+ constructor(config: WabaConfigType, client: RequesterClass);
3462
+ /**
3463
+ * Retrieve media information by media ID.
3464
+ *
3465
+ * @param mediaId The media ID to retrieve information for
3466
+ * @param phone_number_id Optional phone number ID (defaults to configured one)
3467
+ * @returns Media information including URL, mime type, file size, etc.
3468
+ *
3469
+ * @example
3470
+ * const mediaInfo = await whatsappClient.media.getMediaById('media_id_123');
3471
+ */
3472
+ getMediaById(mediaId: string, phone_number_id?: string): Promise<MediaResponse>;
3473
+ /**
3474
+ * Upload a media file to WhatsApp.
3475
+ *
3476
+ * @param file The file to upload
3477
+ * @param messagingProduct The messaging product (default: 'whatsapp')
3478
+ * @returns Upload response containing the media ID
3479
+ *
3480
+ * @example
3481
+ * const file = new File([buffer], 'image.jpg', { type: 'image/jpeg' });
3482
+ * const result = await whatsappClient.media.uploadMedia(file);
3483
+ */
3484
+ uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
3485
+ /**
3486
+ * Delete a media file.
3487
+ *
3488
+ * @param mediaId The media ID to delete
3489
+ * @param phone_number_id Optional phone number ID (defaults to configured one)
3490
+ * @returns Response indicating success or failure
3491
+ *
3492
+ * @example
3493
+ * await whatsappClient.media.deleteMedia('media_id_123');
3494
+ */
3495
+ deleteMedia(mediaId: string, phone_number_id?: string): Promise<ResponseSuccess>;
3496
+ /**
3497
+ * Download media from a URL.
3498
+ *
3499
+ * @param mediaUrl The URL to download media from
3500
+ * @returns Blob containing the media data
3501
+ *
3502
+ * @example
3503
+ * const blob = await whatsappClient.media.downloadMedia('https://...');
3504
+ */
3505
+ downloadMedia(mediaUrl: string): Promise<Blob>;
3506
+ }
3507
+ //#endregion
3508
+ //#region src/api/messages/MessageApi.d.ts
3509
+ /**
3510
+ * Maps each message type to its appropriate payload type
3511
+ */
3512
+ 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 ? {
3513
+ message_id: string;
3514
+ emoji: string;
3515
+ } : never;
3516
+ declare class MessagesApi extends BaseAPI implements MessagesClass {
3517
+ private readonly commonMethod;
3518
+ private readonly commonEndpoint;
3519
+ constructor(config: WabaConfigType, client: RequesterClass);
3520
+ /**
3521
+ * Builds the request body for WhatsApp API messages
3522
+ * @param type The type of message to send
3523
+ * @param payload The message payload object
3524
+ * @param to The recipient's phone number
3525
+ * @param replyMessageId Optional message ID to reply to
3526
+ * @returns The formatted request body
3527
+ */
3528
+ bodyBuilder<T extends MessageTypesEnum>(type: T, payload: MessagePayloadType<T>, to: string, replyMessageId?: string): MessageRequestBody<T>;
3529
+ /**
3530
+ * Sends a request to the WhatsApp API
3531
+ * @param body The request body to send
3532
+ * @returns Promise with the API response
3533
+ */
3534
+ private send;
3535
+ /**
3536
+ * Sends an audio message via WhatsApp
3537
+ * @param params The audio message parameter object
3538
+ * @returns Promise with the message response
3539
+ */
3540
+ audio(params: MessageRequestParams<AudioMediaObject>): Promise<MessagesResponse>;
3541
+ /**
3542
+ * Sends a contact card via WhatsApp
3543
+ * @param params The contact message parameter object
3544
+ * @returns Promise with the message response
3545
+ */
3546
+ contacts(params: MessageRequestParams<[ContactObject]>): Promise<MessagesResponse>;
3547
+ /**
3548
+ * Sends a document via WhatsApp
3549
+ * @param params The document message parameter object
3550
+ * @returns Promise with the message response
3551
+ */
3552
+ document(params: MessageRequestParams<DocumentMediaObject>): Promise<MessagesResponse>;
3553
+ /**
3554
+ * Sends an image via WhatsApp
3555
+ * @param params The image message parameter object
3556
+ * @returns Promise with the message response
3557
+ */
3558
+ image(params: MessageRequestParams<ImageMediaObject>): Promise<MessagesResponse>;
3559
+ /**
3560
+ * Sends an interactive message via WhatsApp
3561
+ * @param params The interactive message parameter object
3562
+ * @returns Promise with the message response
3563
+ */
3564
+ interactive(params: MessageRequestParams<InteractiveObject>): Promise<MessagesResponse>;
3565
+ /**
3566
+ * Sends a location via WhatsApp
3567
+ * @param params The location message parameter object
3568
+ * @returns Promise with the message response
3569
+ */
3570
+ location(params: MessageRequestParams<LocationObject>): Promise<MessagesResponse>;
3571
+ /**
3572
+ * Sends a sticker via WhatsApp
3573
+ * @param params The sticker message parameter object
3574
+ * @returns Promise with the message response
3575
+ */
3576
+ sticker(params: MessageRequestParams<StickerMediaObject>): Promise<MessagesResponse>;
3577
+ /**
3578
+ * Sends a template message via WhatsApp
3579
+ * @param params The template message parameter object
3580
+ * @returns Promise with the message response
3581
+ */
3582
+ template(params: MessageRequestParams<MessageTemplateObject<ComponentTypesEnum>>): Promise<MessagesResponse>;
3583
+ /**
3584
+ * Sends a text message via WhatsApp
3585
+ * @param params The text message parameter object
3586
+ * @returns Promise with the message response
3587
+ */
3588
+ text(params: TextMessageParams): Promise<MessagesResponse>;
3589
+ /**
3590
+ * Sends a video message via WhatsApp
3591
+ * @param params The video message parameter object
3592
+ * @returns Promise with the message response
3593
+ */
3594
+ video(params: MessageRequestParams<VideoMediaObject>): Promise<MessagesResponse>;
3595
+ /**
3596
+ * Updates message status (mark as read, etc.)
3597
+ * @param params The status update parameters
3598
+ * @returns Promise with the API response
3599
+ */
3600
+ status(params: StatusParams): Promise<MessagesResponse>;
3601
+ /**
3602
+ * Marks a message as read
3603
+ * @param params Object containing messageId
3604
+ * @returns Promise with the API response
3605
+ */
3606
+ markAsRead(params: {
3607
+ messageId: string;
3608
+ }): Promise<MessagesResponse>;
3609
+ /**
3610
+ * Shows typing indicator
3611
+ * @param params Object containing messageId
3612
+ * @returns Promise with the API response
3613
+ */
3614
+ showTypingIndicator(params: {
3615
+ messageId: string;
3616
+ }): Promise<MessagesResponse>;
3617
+ /**
3618
+ * Sends a list interactive message
3619
+ * @param params The list interactive message parameters
3620
+ * @returns Promise with the message response
3621
+ */
3622
+ interactiveList(params: MessageRequestParams<InteractiveObject & {
3623
+ type: InteractiveTypesEnum.List;
3624
+ }>): Promise<MessagesResponse>;
3625
+ /**
3626
+ * Sends a CTA URL interactive message
3627
+ * @param params The CTA URL interactive message parameters
3628
+ * @returns Promise with the message response
3629
+ */
3630
+ interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
3631
+ type: InteractiveTypesEnum.CtaUrl;
3632
+ }>): Promise<MessagesResponse>;
3633
+ /**
3634
+ * Sends a location request interactive message
3635
+ * @param params The location request interactive message parameters
3636
+ * @returns Promise with the message response
3637
+ */
3638
+ interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
3639
+ type: InteractiveTypesEnum.LocationRequest;
3640
+ }>): Promise<MessagesResponse>;
3641
+ /**
3642
+ * Sends an address message interactive message
3643
+ * @param params The address message interactive message parameters
3644
+ * @returns Promise with the message response
3645
+ */
3646
+ interactiveAddressMessage(params: MessageRequestParams<InteractiveObject & {
3647
+ type: InteractiveTypesEnum.AddressMessage;
3648
+ }>): Promise<MessagesResponse>;
3649
+ /**
3650
+ * Sends a reply buttons interactive message
3651
+ * @param params The reply buttons interactive message parameters
3652
+ * @returns Promise with the message response
3653
+ */
3654
+ interactiveReplyButtons(params: MessageRequestParams<InteractiveObject & {
3655
+ type: InteractiveTypesEnum.Button;
3656
+ }>): Promise<MessagesResponse>;
3657
+ /**
3658
+ * Sends a flow interactive message
3659
+ * @param params The flow interactive message parameters
3660
+ * @returns Promise with the message response
3661
+ */
3662
+ interactiveFlow(params: MessageRequestParams<InteractiveObject & {
3663
+ type: InteractiveTypesEnum.Flow;
3664
+ }>): Promise<MessagesResponse>;
3665
+ /**
3666
+ * Sends a reaction to a message
3667
+ * @param params The reaction parameters
3668
+ * @returns Promise with the message response
3669
+ */
3670
+ reaction(params: ReactionParams): Promise<MessagesResponse>;
3671
+ }
3672
+ //#endregion
3673
+ //#region src/api/phone/PhoneNumberApi.d.ts
3674
+ /**
3675
+ * API for managing WhatsApp Phone Numb ers.
3676
+ *
3677
+ * This API allows you to:
3678
+ * - Get phone number information by ID
3679
+ * - Get all phone numbers for a business account
3680
+ * - Request verification codes for phone numbers
3681
+ * - Verify phone numbers with codes
3682
+ */
3683
+ declare class PhoneNumberApi extends BaseAPI implements PhoneNumberClass {
3684
+ private readonly endpoint;
3685
+ constructor(config: WabaConfigType, client: RequesterClass);
3686
+ /**
3687
+ * Get phone number information by ID.
3688
+ *
3689
+ * @param fields Optional comma-separated list of fields to include in the response
3690
+ * @returns Phone number information including verification status, quality rating, etc.
3691
+ *
3692
+ * @example
3693
+ * const phoneNumber = await whatsappClient.phoneNumber.getPhoneNumberById();
3694
+ * const phoneNumberWithFields = await whatsappClient.phoneNumber.getPhoneNumberById('display_phone_number,verified_name');
3695
+ */
3696
+ getPhoneNumberById(fields?: string): Promise<PhoneNumberResponse>;
3697
+ /**
3698
+ * Get all phone numbers for the business account.
3699
+ *
3700
+ * @returns List of phone numbers associated with the business account
3701
+ *
3702
+ * @example
3703
+ * const phoneNumbers = await whatsappClient.phoneNumber.getPhoneNumbers();
3704
+ */
3705
+ getPhoneNumbers(): Promise<PhoneNumbersResponse>;
3706
+ /**
3707
+ * Request a verification code for the phone number.
3708
+ *
3709
+ * @param request Verification code request containing method and language
3710
+ * @returns Response indicating success or failure
3711
+ *
3712
+ * @example
3713
+ * await whatsappClient.phoneNumber.requestVerificationCode({
3714
+ * code_method: 'SMS',
3715
+ * language: 'en_US'
3716
+ * });
3717
+ */
3718
+ requestVerificationCode(request: RequestVerificationCodeRequest): Promise<ResponseSuccess>;
3719
+ /**
3720
+ * Verify the phone number with the received code.
3721
+ *
3722
+ * @param request Verification request containing the code
3723
+ * @returns Response indicating success or failure
3724
+ *
3725
+ * @example
3726
+ * await whatsappClient.phoneNumber.verifyCode({
3727
+ * code: '123456'
3728
+ * });
3729
+ */
3730
+ verifyCode(request: VerifyCodeRequest): Promise<ResponseSuccess>;
3731
+ }
3732
+ //#endregion
3733
+ //#region src/api/profile/BusinessProfileApi.d.ts
3734
+ /**
3735
+ * API for managing WhatsApp Business Profiles and profile pictures.
3736
+ *
3737
+ * This API allows you to:
3738
+ * - Get business profile information
3739
+ * - Update business profile details
3740
+ * - Upload profile pictures using a three-step process:
3741
+ * 1. Create an upload session
3742
+ * 2. Upload the image binary data
3743
+ * 3. Get the upload handle to use when updating the profile
3744
+ */
3745
+ declare class BusinessProfileApi extends BaseAPI implements BusinessProfileClass {
3746
+ private readonly endpoint;
3747
+ constructor(config: WabaConfigType, client: RequesterClass);
3748
+ /**
3749
+ * Get your business profile information.
3750
+ *
3751
+ * Use this method to retrieve details about your WhatsApp business profile, including
3752
+ * about text, address, description, email, profile picture URL, websites, and vertical.
3753
+ *
3754
+ * @param fields Fields to be returned in the response. If not specified, all fields will be returned.
3755
+ * Possible values: about, address, description, email, profile_picture_url, websites, vertical
3756
+ * @returns The business profile information.
3757
+ *
3758
+ * @example
3759
+ * // Get all business profile fields
3760
+ * const profile = await whatsappClient.businessProfile.getBusinessProfile();
3761
+ *
3762
+ * // Get specific business profile fields
3763
+ * const profile = await whatsappClient.businessProfile.getBusinessProfile('about,address,email');
3764
+ *
3765
+ * // Using the BusinessProfileFieldsParam type
3766
+ * const profile = await whatsappClient.businessProfile.getBusinessProfile(['about', 'address', 'email']);
3767
+ */
3768
+ getBusinessProfile(fields?: BusinessProfileFieldsParam): Promise<BusinessProfileResponse>;
3769
+ /**
3770
+ * Update your business profile.
3771
+ *
3772
+ * Use this method to update one or more fields of your WhatsApp business profile.
3773
+ *
3774
+ * @param updateRequest The request object containing the fields to update.
3775
+ * - messaging_product: Required. Always set to "whatsapp".
3776
+ * - about: Optional. Business's About text (1-139 characters).
3777
+ * - address: Optional. Business address (max 256 characters).
3778
+ * - description: Optional. Business description (max 512 characters).
3779
+ * - vertical: Optional. Business category (use BusinessVerticalEnum for type safety).
3780
+ * - email: Optional. Contact email (valid format, max 128 characters).
3781
+ * - websites: Optional. Up to 2 URLs (max 256 characters each).
3782
+ * - profile_picture_handle: Optional. Handle from upload process.
3783
+ * @returns Response indicating success or failure.
3784
+ *
3785
+ * @example
3786
+ * // Update business profile with multiple fields including vertical using enum
3787
+ * await whatsappClient.businessProfile.updateBusinessProfile({
3788
+ * messaging_product: 'whatsapp',
3789
+ * about: 'We provide excellent service',
3790
+ * email: 'contact@example.com',
3791
+ * websites: ['https://example.com'],
3792
+ * vertical: BusinessVerticalEnum.RETAIL
3793
+ * });
3794
+ */
3795
+ updateBusinessProfile(updateRequest: UpdateBusinessProfileRequest): Promise<ResponseSuccess>;
3796
+ /**
3797
+ * Create an upload session for a profile picture.
3798
+ *
3799
+ * This is the first step in the profile picture upload process.
3800
+ *
3801
+ * @param fileLength Length of the file to be uploaded in bytes.
3802
+ * @param fileType MIME type of the file (e.g., 'image/jpeg').
3803
+ * @param fileName Name of the file with extension.
3804
+ * @returns Response containing the upload session ID needed for the next step.
3805
+ *
3806
+ * @example
3807
+ * // Create upload session for profile picture
3808
+ * const session = await whatsappClient.businessProfile.createUploadSession(
3809
+ * fileBuffer.length,
3810
+ * 'image/jpeg',
3811
+ * 'profile.jpg'
3812
+ * );
3813
+ * const uploadSessionId = session.upload_session_id;
3814
+ */
3815
+ createUploadSession(fileLength: number, fileType: string, fileName: string): Promise<UploadSessionResponse>;
3816
+ /**
3817
+ * Upload media file to the upload session.
3818
+ *
3819
+ * This is the second step in the profile picture upload process.
3820
+ * Upload the binary content of the file to the previously created upload session.
3821
+ *
3822
+ * @param uploadId The upload session ID from createUploadSession response.
3823
+ * @param file The binary data of the file (Buffer).
3824
+ * @returns Response indicating success or failure.
3825
+ *
3826
+ * @example
3827
+ * // Upload the actual file content
3828
+ * await whatsappClient.businessProfile.uploadMedia(
3829
+ * uploadSessionId,
3830
+ * fileBuffer
3831
+ * );
3832
+ */
3833
+ uploadMedia(uploadId: string, file: Buffer): Promise<UploadBusinessProfileResponse>;
3834
+ /**
3835
+ * Get the upload handle information.
3836
+ *
3837
+ * This is the third step in the profile picture upload process.
3838
+ * After uploading the file, get the handle to use when updating the profile.
3839
+ *
3840
+ * @param uploadId The upload session ID from createUploadSession response.
3841
+ * @returns Response containing the upload handle information.
3842
+ *
3843
+ * @example
3844
+ * // Complete profile picture update process
3845
+ * // 1. Create upload session
3846
+ * const session = await whatsappClient.businessProfile.createUploadSession(
3847
+ * fileBuffer.length, 'image/jpeg', 'profile.jpg'
3848
+ * );
3849
+ *
3850
+ * // 2. Upload the image data
3851
+ * await whatsappClient.businessProfile.uploadMedia(
3852
+ * session.upload_session_id, fileBuffer
3853
+ * );
3854
+ *
3855
+ * // 3. Get the handle for the uploaded file
3856
+ * const handleInfo = await whatsappClient.businessProfile.getUploadHandle(
3857
+ * session.upload_session_id
3858
+ * );
3859
+ *
3860
+ * // 4. Update profile with new picture and business information
3861
+ * await whatsappClient.businessProfile.updateBusinessProfile({
3862
+ * messaging_product: 'whatsapp',
3863
+ * profile_picture_handle: handleInfo.handle,
3864
+ * vertical: BusinessVerticalEnum.RESTAURANT,
3865
+ * about: 'Delicious food served daily'
3866
+ * });
3867
+ */
3868
+ getUploadHandle(uploadId: string): Promise<UploadHandle>;
3869
+ }
3870
+ //#endregion
3871
+ //#region src/api/qrCode/QrCodeApi.d.ts
3872
+ /**
3873
+ * API for managing WhatsApp QR Codes.
3874
+ *
3875
+ * This API allows you to:
3876
+ * - Create QR codes with prefilled messages
3877
+ * - Get all QR codes
3878
+ * - Get specific QR code details
3879
+ * - Update QR code messages
3880
+ * - Delete QR codes
3881
+ */
3882
+ declare class QrCodeApi extends BaseAPI implements QrCodeClass {
3883
+ private readonly endpoint;
3884
+ constructor(config: WabaConfigType, client: RequesterClass);
3885
+ /**
3886
+ * Create a new QR code with a prefilled message.
3887
+ *
3888
+ * @param request The QR code creation request
3889
+ * @returns QR code information including code, deep link URL, and optional image URL
3890
+ *
3891
+ * @example
3892
+ * const qrCode = await whatsappClient.qrCode.createQrCode({
3893
+ * prefilled_message: 'Hello from WhatsApp!',
3894
+ * generate_qr_image: 'PNG'
3895
+ * });
3896
+ */
3897
+ createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
3898
+ /**
3899
+ * Get all QR codes for the current phone number.
3900
+ *
3901
+ * @returns List of all QR codes
3902
+ *
3903
+ * @example
3904
+ * const qrCodes = await whatsappClient.qrCode.getQrCodes();
3905
+ */
3906
+ getQrCodes(): Promise<QrCodesResponse>;
3907
+ /**
3908
+ * Get a specific QR code by ID.
3909
+ *
3910
+ * @param qrCodeId The QR code ID to retrieve
3911
+ * @returns QR code information
3912
+ *
3913
+ * @example
3914
+ * const qrCode = await whatsappClient.qrCode.getQrCode('qr_code_123');
3915
+ */
3916
+ getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
3917
+ /**
3918
+ * Update an existing QR code's prefilled message.
3919
+ *
3920
+ * @param request The QR code update request containing code and new message
3921
+ * @returns Updated QR code information
3922
+ *
3923
+ * @example
3924
+ * const updatedQrCode = await whatsappClient.qrCode.updateQrCode({
3925
+ * code: 'existing_qr_code',
3926
+ * prefilled_message: 'Updated message!'
3927
+ * });
3928
+ */
3929
+ updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
3930
+ /**
3931
+ * Delete a QR code.
3932
+ *
3933
+ * @param qrCodeId The QR code ID to delete
3934
+ * @returns Response indicating success or failure
3935
+ *
3936
+ * @example
3937
+ * await whatsappClient.qrCode.deleteQrCode('qr_code_123');
3938
+ */
3939
+ deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
3940
+ }
3941
+ //#endregion
3942
+ //#region src/api/registration/types/common.d.ts
3943
+ type RegistrationRequest = {
3944
+ messaging_product: 'whatsapp';
3945
+ pin: string;
3946
+ data_localization_region?: DataLocalizationRegionEnum;
3947
+ };
3948
+ interface RegistrationClass {
3949
+ register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess>;
3950
+ deregister(): Promise<ResponseSuccess>;
3951
+ }
3952
+ //#endregion
3953
+ //#region src/api/registration/RegistrationApi.d.ts
3954
+ /**
3955
+ * API for managing WhatsApp Business Account registration.
3956
+ *
3957
+ * This API allows you to:
3958
+ * - Register a WhatsApp Business Account with a PIN
3959
+ * - Deregister a WhatsApp Business Account
3960
+ */
3961
+ declare class RegistrationApi extends BaseAPI implements RegistrationClass {
3962
+ constructor(config: WabaConfigType, client: RequesterClass);
3963
+ /**
3964
+ * Register a WhatsApp Business Account using a PIN.
3965
+ *
3966
+ * @param pin The registration PIN received via SMS or voice call
3967
+ * @param dataLocalizationRegion Optional data localization region
3968
+ * @returns Response indicating success or failure
3969
+ *
3970
+ * @example
3971
+ * await whatsappClient.registration.register('123456', DataLocalizationRegionEnum.Asia);
3972
+ */
3973
+ register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess>;
3974
+ /**
3975
+ * Deregister a WhatsApp Business Account.
3976
+ *
3977
+ * @returns Response indicating success or failure
3978
+ *
3979
+ * @example
3980
+ * await whatsappClient.registration.deregister();
3981
+ */
3982
+ deregister(): Promise<ResponseSuccess>;
3983
+ }
3984
+ //#endregion
3985
+ //#region src/api/template/TemplateApi.d.ts
3986
+ declare class TemplateApi extends BaseAPI implements TemplateClass {
3987
+ private readonly endpoint;
3988
+ constructor(config: WabaConfigType, client: RequesterClass);
3989
+ getTemplate(templateId: string): Promise<TemplateResponse>;
3990
+ updateTemplate(templateId: string, template: Partial<TemplateRequestBody>): Promise<ResponseSuccess>;
3991
+ getTemplates(params?: TemplateGetParams): Promise<ResponsePagination<TemplateResponse>>;
3992
+ createTemplate(template: TemplateRequestBody): Promise<TemplateResponse>;
3993
+ deleteTemplate(params: TemplateDeleteParams): Promise<ResponseSuccess>;
3994
+ }
3995
+ //#endregion
3996
+ //#region src/api/template/factories/index.d.ts
3997
+ declare function createTemplate(options: TemplateOptions): TemplateRequestBody;
3998
+ declare function createOTPTemplate(options: OTPTemplateOptions): TemplateRequestBody;
3999
+ declare function createAuthenticationTemplate(options: AuthenticationTemplateOptions): TemplateRequestBody;
4000
+ declare function createCatalogTemplate(options: CatalogTemplateOptions): TemplateRequestBody;
4001
+ declare function createCouponTemplate(options: CouponTemplateOptions): TemplateRequestBody;
4002
+ declare function createLimitedTimeOfferTemplate(options: LimitedTimeOfferTemplateOptions): TemplateRequestBody;
4003
+ declare function createMediaCardCarouselTemplate(options: MediaCardCarouselTemplateOptions): TemplateRequestBody;
4004
+ declare function createMPMTemplate(options: MPMTemplateOptions): TemplateRequestBody;
4005
+ declare function createProductCardCarouselTemplate(options: ProductCardCarouselTemplateOptions): TemplateRequestBody;
4006
+ declare function createSPMTemplate(options: SPMTemplateOptions): TemplateRequestBody;
4007
+ //#endregion
4008
+ //#region src/api/twoStepVerification/types/common.d.ts
4009
+ type TwoStepVerificationRequest = {
4010
+ pin: string;
4011
+ };
4012
+ interface TwoStepVerificationClass {
4013
+ setTwoStepVerificationCode(pin: string): Promise<ResponseSuccess>;
4014
+ }
4015
+ //#endregion
4016
+ //#region src/api/twoStepVerification/TwoStepVerificationApi.d.ts
4017
+ /**
4018
+ * API for managing WhatsApp Two-Step Verification.
4019
+ *
4020
+ * This API allows you to:
4021
+ * - Set a two-step verification PIN code
4022
+ * - Manage two-step verification settings
4023
+ */
4024
+ declare class TwoStepVerificationApi extends BaseAPI implements TwoStepVerificationClass {
4025
+ constructor(config: WabaConfigType, client: RequesterClass);
4026
+ /**
4027
+ * Set a two-step verification PIN code.
4028
+ *
4029
+ * @param pin The PIN code to set for two-step verification (6-digit numeric string)
4030
+ * @returns Response indicating success or failure
4031
+ *
4032
+ * @example
4033
+ * await whatsappClient.twoStepVerification.setTwoStepVerificationCode('123456');
4034
+ */
4035
+ setTwoStepVerificationCode(pin: string): Promise<ResponseSuccess>;
4036
+ }
4037
+ //#endregion
4038
+ //#region src/api/waba/WabaApi.d.ts
4039
+ /**
4040
+ * API for managing WhatsApp Business Account (WABA).
4041
+ *
4042
+ * This API allows you to:
4043
+ * - Get WABA account information
4044
+ * - Manage WABA subscriptions
4045
+ * - Subscribe/unsubscribe from WABA webhooks
4046
+ * - Update subscription settings
4047
+ */
4048
+ declare class WabaApi extends BaseAPI implements WABAClass {
4049
+ constructor(config: WabaConfigType, client: RequesterClass);
4050
+ /**
4051
+ * Retrieve WhatsApp Business Account information.
4052
+ *
4053
+ * @param fields Optional array of specific fields to retrieve
4054
+ * @returns WABA account information including status, health, verification status, etc.
4055
+ *
4056
+ * @example
4057
+ * const account = await whatsappClient.waba.getWabaAccount(['id', 'name', 'status']);
4058
+ */
4059
+ getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
4060
+ /**
4061
+ * Get all WABA subscriptions for the business account.
4062
+ *
4063
+ * @returns List of all subscribed apps and their configurations
4064
+ *
4065
+ * @example
4066
+ * const subscriptions = await whatsappClient.waba.getAllWabaSubscriptions();
4067
+ */
4068
+ getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
4069
+ /**
4070
+ * Update WABA subscription configuration.
4071
+ *
4072
+ * @param params Configuration parameters including callback URI and verify token
4073
+ * @returns Response indicating success or failure
4074
+ *
4075
+ * @example
4076
+ * await whatsappClient.waba.updateWabaSubscription({
4077
+ * override_callback_uri: 'https://example.com/webhook',
4078
+ * verify_token: 'your_verify_token'
4079
+ * });
4080
+ */
4081
+ updateWabaSubscription({
4082
+ override_callback_uri,
4083
+ verify_token
4084
+ }: UpdateWabaSubscription): Promise<ResponseSuccess>;
4085
+ /**
4086
+ * Unsubscribe from WABA webhooks.
4087
+ *
4088
+ * @returns Response indicating success or failure
4089
+ *
4090
+ * @example
4091
+ * await whatsappClient.waba.unsubscribeFromWaba();
4092
+ */
4093
+ unsubscribeFromWaba(): Promise<ResponseSuccess>;
4094
+ }
4095
+ //#endregion
4096
+ //#region src/core/whatsapp/WhatsApp.d.ts
4097
+ /**
4098
+ * WhatsApp SDK Main Class following official patterns
4099
+ * Provides unified access to WhatsApp Cloud API and Flows API
4100
+ */
4101
+ declare class WhatsApp {
4102
+ config: WabaConfigType;
4103
+ requester: Readonly<Requester>;
4104
+ messages: MessagesApi;
4105
+ media: MediaApi;
4106
+ phoneNumbers: PhoneNumberApi;
4107
+ twoStepVerification: TwoStepVerificationApi;
4108
+ flows: FlowApi;
4109
+ businessProfile: BusinessProfileApi;
4110
+ templates: TemplateApi;
4111
+ encryption: EncryptionApi;
4112
+ qrCode: QrCodeApi;
4113
+ registration: RegistrationApi;
4114
+ waba: WabaApi;
4115
+ constructor(config?: WhatsAppConfig);
4116
+ /**
4117
+ * Runtime configuration updates following official patterns
4118
+ */
4119
+ updateTimeout(timeout: number): void;
4120
+ updateSenderNumberId(phoneNumberId: number): void;
4121
+ updateAccessToken(accessToken: string): void;
4122
+ /**
4123
+ * Get SDK version
4124
+ */
4125
+ version(): string;
4126
+ /**
4127
+ * Static enums access
4128
+ */
4129
+ static get Enums(): typeof enums_d_exports;
4130
+ /**
4131
+ * Get User-Agent string
4132
+ */
4133
+ getUserAgent(): string;
4134
+ }
4135
+ //#endregion
4136
+ //#region src/utils/flowTypeGuards.d.ts
4137
+ declare const DATA_EXCHANGE_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT, FlowActionEnum.BACK];
4138
+ declare const ERROR_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT];
4139
+ /**
4140
+ * Type guard to check if a request is a Data Exchange request
4141
+ * Validates the request structure according to the Flow API specifications
4142
+ *
4143
+ * @param request The Flow endpoint request to check
4144
+ * @returns True if the request is a valid Data Exchange request, false otherwise
4145
+ */
4146
+ declare function isFlowDataExchangeRequest(request: FlowEndpointRequest): request is FlowDataExchangeRequest & {
4147
+ action: (typeof DATA_EXCHANGE_ACTIONS)[number];
4148
+ screen?: string;
4149
+ flow_token: string;
4150
+ data?: Record<string, any>;
4151
+ };
4152
+ /**
4153
+ * Type guard to check if a request is an Error Notification request
4154
+ * Validates the request structure according to the Flow API error specifications
4155
+ *
4156
+ * @param request The Flow endpoint request to check
4157
+ * @returns True if the request is a valid Error Notification request, false otherwise
4158
+ */
4159
+ declare function isFlowErrorRequest(request: FlowEndpointRequest): request is FlowErrorNotificationRequest & {
4160
+ action: (typeof ERROR_ACTIONS)[number];
4161
+ screen: string;
4162
+ flow_token: string;
4163
+ data: {
4164
+ error: string;
4165
+ error_message: string;
4166
+ };
4167
+ };
4168
+ /**
4169
+ * Type guard to check if a request is a Ping (health check) request
4170
+ * Simple validation for health check endpoints in the Flow API
4171
+ *
4172
+ * @param request The Flow endpoint request to check
4173
+ * @returns True if the request is a Ping request, false otherwise
4174
+ */
4175
+ declare function isFlowPingRequest(request: FlowEndpointRequest): request is FlowHealthCheckRequest;
4176
+ //#endregion
4177
+ //#region src/core/whatsapp/types.d.ts
4178
+ declare class WhatsAppClass {
4179
+ constructor(config?: WhatsAppConfig);
4180
+ readonly messages: MessagesApi;
4181
+ readonly templates: TemplateApi;
4182
+ readonly phoneNumber: PhoneNumberApi;
4183
+ readonly qrCode: QrCodeApi;
4184
+ readonly encryption: EncryptionApi;
4185
+ readonly twoStepVerification: TwoStepVerificationApi;
4186
+ readonly registration: RegistrationApi;
4187
+ readonly media: MediaApi;
4188
+ readonly waba: WabaApi;
4189
+ readonly flow: FlowApi;
4190
+ readonly businessProfile: BusinessProfileApi;
4191
+ updateTimeout(ms: number): boolean;
4192
+ updatePhoneNumberId(phoneNumberId: number): boolean;
4193
+ updateAccessToken(accessToken: string): boolean;
4194
+ updateWabaId(wabaId: string): boolean;
4195
+ }
4196
+ //#endregion
4197
+ //#region src/core/webhook/utils/webhookUtils.d.ts
4198
+ type MessageHandler = (whatsapp: WhatsApp, message: WebhookMessage) => void | Promise<void>;
4199
+ type FlowHandler = (whatsapp: WhatsApp, request: FlowEndpointRequest) => any | Promise<any>;
4200
+ /**
4201
+ * Process webhook messages
4202
+ */
4203
+ declare function processWebhookMessages(request: Request, whatsapp: WhatsApp, handlers: {
4204
+ messageHandlers: Map<MessageTypesEnum, MessageHandler>;
4205
+ preProcessHandler?: MessageHandler;
4206
+ postProcessHandler?: MessageHandler;
4207
+ }): Promise<Response>;
4208
+ /**
4209
+ * Handle flow requests
4210
+ */
4211
+ declare function processFlowRequest(request: Request, config: WabaConfigType, whatsapp: WhatsApp, flowHandlers: Map<FlowTypeEnum, FlowHandler>): Promise<Response>;
4212
+ /**
4213
+ * Constructs a full URL from framework-specific request headers and URL
4214
+ * @param headers - Request headers containing host and protocol information
4215
+ * @param url - Relative URL path
4216
+ * @returns Full URL string
4217
+ */
4218
+ declare function constructFullUrl(headers: Record<string, string | string[] | undefined>, url?: string): string;
4219
+ //#endregion
4220
+ //#region src/core/webhook/WebhookProcessor.d.ts
4221
+ interface WebhookResponse {
4222
+ status: number;
4223
+ body: string;
4224
+ headers: Record<string, string>;
4225
+ }
4226
+ declare class WebhookProcessor {
4227
+ private config;
4228
+ private client;
4229
+ private messageHandlers;
4230
+ private preProcessHandler;
4231
+ private postProcessHandler;
4232
+ private flowHandlers;
4233
+ constructor(config: WhatsAppConfig);
4234
+ processVerification(mode: string | null, token: string | null, challenge: string | null): Promise<WebhookResponse>;
4235
+ processWebhook(request: Request): Promise<WebhookResponse>;
4236
+ processFlow(request: Request): Promise<WebhookResponse>;
4237
+ onMessage(type: MessageTypesEnum, handler: MessageHandler): void;
4238
+ onMessagePreProcess(handler: MessageHandler): void;
4239
+ onMessagePostProcess(handler: MessageHandler): void;
4240
+ onFlow(type: FlowTypeEnum, handler: FlowHandler): void;
4241
+ getClient(): WhatsApp;
4242
+ getConfig(): WabaConfigType;
4243
+ }
4244
+ //#endregion
4245
+ //#region src/core/webhook/frameworks/handler.d.ts
4246
+ interface BaseRequest {
4247
+ method?: string;
4248
+ url?: string;
4249
+ headers: Record<string, string | string[] | undefined>;
4250
+ body?: any;
4251
+ query?: Record<string, any> | URLSearchParams;
4252
+ rawBody?: any;
4253
+ }
4254
+ interface BaseResponse<T = any> {
4255
+ status(code: number): T;
4256
+ json?(data: any): T | void;
4257
+ send?(data?: any): T | void;
4258
+ setHeader?(name: string, value: string): void;
4259
+ }
4260
+ interface BaseWebhookConfig extends WhatsAppConfig {}
4261
+ interface WebhookResult {
4262
+ status: number;
4263
+ headers: Record<string, string>;
4264
+ body: any;
4265
+ }
4266
+ /**
4267
+ * Abstract base class for framework-agnostic webhook handlers
4268
+ * Provides common architecture and functionality across all frameworks
4269
+ */
4270
+ declare abstract class BaseWebhookHandler<TRequest extends BaseRequest, TResponse extends BaseResponse> {
4271
+ protected processor: WebhookProcessor;
4272
+ constructor(config: BaseWebhookConfig);
4273
+ /**
4274
+ * Abstract method for handling GET requests (webhook verification)
4275
+ * Each framework implements this based on their request/response patterns
4276
+ */
4277
+ protected abstract handleGet(req: TRequest, res: TResponse, ...args: any[]): Promise<any>;
4278
+ /**
4279
+ * Abstract method for handling POST requests (webhook processing)
4280
+ * Each framework implements this based on their request/response patterns
4281
+ */
4282
+ protected abstract handlePost(req: TRequest, res: TResponse, ...args: any[]): Promise<any>;
4283
+ /**
4284
+ * Abstract method for handling flow requests
4285
+ * Each framework implements this based on their request/response patterns
4286
+ */
4287
+ protected abstract handleFlow(req: TRequest, res: TResponse, ...args: any[]): Promise<any>;
4288
+ /**
4289
+ * Common webhook verification logic
4290
+ */
4291
+ protected processVerification(mode: string | null, token: string | null, challenge: string | null): Promise<WebhookResult>;
4292
+ /**
4293
+ * Common webhook processing logic
4294
+ */
4295
+ protected processWebhook(request: Request): Promise<WebhookResult>;
4296
+ /**
4297
+ * Common flow processing logic
4298
+ */
4299
+ protected processFlow(request: Request): Promise<WebhookResult>;
4300
+ /**
4301
+ * Helper to construct full URL from headers and path
4302
+ */
4303
+ protected constructFullUrl(headers: Record<string, string | string[] | undefined>, url?: string): string;
4304
+ /**
4305
+ * Helper to apply result headers to response
4306
+ */
4307
+ protected applyHeaders(result: WebhookResult, res: TResponse): void;
4308
+ /**
4309
+ * Auto-routing method handler that dispatches based on request method
4310
+ */
4311
+ protected autoRoute(req: TRequest, res: TResponse, ...args: any[]): Promise<any>;
4312
+ /**
4313
+ * Get the processor instance for handler registration
4314
+ */
4315
+ get webhookProcessor(): WebhookProcessor;
4316
+ /**
4317
+ * Abstract method to return the clean handler object
4318
+ * Each framework implements this to return their specific handler structure
4319
+ */
4320
+ abstract getHandlers(): {
4321
+ GET: (...args: any[]) => Promise<any>;
4322
+ POST: (...args: any[]) => Promise<any>;
4323
+ webhook: (...args: any[]) => Promise<any>;
4324
+ flow: (...args: any[]) => Promise<any>;
4325
+ processor: WebhookProcessor;
4326
+ };
4327
+ }
4328
+ //#endregion
4329
+ //#region src/core/webhook/frameworks/express.d.ts
4330
+ interface ExpressRequest extends BaseRequest {
4331
+ method: string;
4332
+ url: string;
4333
+ headers: Record<string, string | string[] | undefined>;
4334
+ body?: any;
4335
+ query: Record<string, any>;
4336
+ rawBody?: any;
4337
+ }
4338
+ interface ExpressResponse extends BaseResponse<ExpressResponse> {
4339
+ status(code: number): ExpressResponse;
4340
+ json(data: any): ExpressResponse;
4341
+ send(data?: any): ExpressResponse;
4342
+ setHeader(name: string, value: string): void;
4343
+ }
4344
+ interface NextFunction {
4345
+ (error?: any): void;
4346
+ }
4347
+ interface ExpressWebhookConfig extends BaseWebhookConfig {
4348
+ path?: string;
4349
+ }
4350
+ declare function webhookHandler(config: ExpressWebhookConfig): {
4351
+ GET: (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => Promise<ExpressResponse>;
4352
+ POST: (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => Promise<ExpressResponse>;
4353
+ webhook: (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => Promise<any>;
4354
+ flow: (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => Promise<ExpressResponse>;
4355
+ processor: WebhookProcessor;
4356
+ };
4357
+ //#endregion
4358
+ //#region src/core/webhook/frameworks/nextjs.d.ts
4359
+ interface BaseApiRequest extends BaseRequest {
4360
+ method?: string;
4361
+ url?: string;
4362
+ headers: Record<string, string | string[] | undefined>;
4363
+ body?: any;
4364
+ query: Partial<Record<string, string | string[]>>;
4365
+ rawBody?: any;
4366
+ }
4367
+ interface BaseApiResponse extends BaseResponse {
4368
+ status(code: number): any;
4369
+ json(data: any): void | any;
4370
+ send(data?: any): void | any;
4371
+ setHeader(name: string, value: string): void;
4372
+ }
4373
+ interface NextJsWebhookConfig extends BaseWebhookConfig {}
4374
+ declare function webhookHandler$1<TRequest extends BaseApiRequest, TResponse extends BaseApiResponse>(config: NextJsWebhookConfig): {
4375
+ GET: (req: TRequest, res: TResponse) => Promise<any>;
4376
+ POST: (req: TRequest, res: TResponse) => Promise<any>;
4377
+ webhook: (req: TRequest, res: TResponse) => Promise<any>;
4378
+ flow: (req: TRequest, res: TResponse) => Promise<any>;
4379
+ processor: WebhookProcessor;
4380
+ };
4381
+ //#endregion
4382
+ //#region src/core/webhook/utils/generateXHub256Sig.d.ts
4383
+ declare const generateXHub256Sig: (body: string, appSecret: string) => string;
4384
+ //#endregion
4385
+ export { type AccountMode, type AudioMediaObject, AudioMediaTypesEnum, type AuthenticationTemplateOptions, type BaseClass, type BodyOptions, BusinessProfileApi, type BusinessProfileClass, type BusinessProfileData, type BusinessProfileField, type BusinessProfileFieldsParam, type BusinessProfileResponse, BusinessVerticalEnum, type ButtonOptions, ButtonPositionEnum, type CarouselCard, type CarouselOptions, type CatalogButton, type CatalogTemplateOptions, CategoryEnum, type CodeVerificationStatus, type ComponentTypes, ComponentTypesEnum, type ContactObject, ConversationTypesEnum, type CopyCodeButton, type CouponTemplateOptions, type CreateQrCodeRequest, CurrencyCodesEnum, type CurrencyParameter, type Cursors, DataLocalizationRegionEnum, type DateTimeParameter, type DocumentMediaObject, DocumentMediaTypesEnum, EncryptionApi, type EncryptionPublicKeyResponse, webhookHandler as ExpressWebhook, type Flow, type FlowActionEnum, FlowApi, type FlowAsset, type FlowAssetsResponse, type FlowButton, type FlowCategoryEnum, type FlowClass, type FlowDataExchangeRequest, type FlowDataExchangeResponse, type FlowDecryptedRequestResponse, type FlowEncryptedRequestPayload, type FlowEndpointRequest, type FlowEndpointResponse, type FlowErrorNotificationRequest, type FlowErrorNotificationResponse, type FlowHealthCheckRequest, type FlowHealthCheckResponse, type FlowHttpRequest, type FlowMigrationFailure, type FlowMigrationResponse, type FlowMigrationResult, type FlowPreview, type FlowPreviewResponse, type FlowStatusEnum, type FlowSuccessScreenResponse, type FlowType, type FlowTypeEnum, type FlowValidationError, type FlowValidationErrorPointer, type FlowsListResponse, type FooterOptions, type GeneralHeaderInterface, type GeneralMessageBody, type GeneralRequestBody, type HeaderOptions, type HealthStatus, type HealthStatusEntity, HttpMethodsEnum, type HttpsClientClass, type HttpsClientResponseClass, type ImageMediaObject, ImageMediaTypesEnum, type InteractiveObject, InteractiveTypesEnum, LanguagesEnum, type LimitedTimeOfferOptions, type LimitedTimeOfferTemplateOptions, type LocationObject, type LocationParameter, type LoggerInterface, type MPMButton, type MPMTemplateOptions, MediaApi, type MediaCardCarouselTemplateOptions, type MediaCarouselCard, type MediaClass, type MediaParameter, type MediaResponse, type MediasResponse, type MessageRequestBody, type MessageRequestParams, type MessageTemplateObject, MessageTypesEnum, MessagesApi, type MessagesClass, type MessagesResponse, type MessagingLimitTier, type MetaError, webhookHandler$1 as NextJsWebhook, type OTPButton, type OTPTemplateOptions, type Pagination, type PaginationCursors, type Paging, ParametersTypesEnum, PhoneNumberApi, type PhoneNumberButton, type PhoneNumberClass, type PhoneNumberResponse, type PhoneNumbersResponse, type PlatformType, type ProductCardCarouselTemplateOptions, type ProductCarouselCard, type ProductParameter, type ProductSection, QrCodeApi, type QrCodeClass, type QrCodeResponse, type QrCodesResponse, type QualityRating, type QualityScore, type QuickReplyButton, type ReactionParams, ReferralSourceTypesEnum, RegistrationApi, type RegistrationClass, type RegistrationRequest, RequestCodeMethodsEnum, type RequestVerificationCodeRequest, type RequesterClass, type RequesterResponseInterface, type ResponseData, type ResponseHeaderValue, type ResponseHeaders, type ResponseJSONBody, type ResponsePagination, type ResponseSuccess, type SPMButton, type SPMTemplateOptions, StatusEnum, type StatusParams, type StickerMediaObject, StickerMediaTypesEnum, SubTypeEnum, SystemChangeTypesEnum, TemplateApi, type TemplateBody, type TemplateButton, type TemplateButtons, type TemplateCarousel, type TemplateClass, type TemplateDeleteParams, type TemplateFooter, type TemplateFormat, type TemplateGetParams, type TemplateHeader, type TemplateHeaderExample, type TemplateLimitedTimeOffer, type TemplateOptions, type TemplateParameter, type TemplateRequestBody, type TemplateResponse, TemplateStatusEnum, type TextMessageParams, type TextObject, type TextParameter, type Throughput, type ThroughputLevel, TwoStepVerificationApi, type TwoStepVerificationClass, type TwoStepVerificationParams, type TwoStepVerificationRequest, type URLButton, type UpdateBusinessProfileRequest, type UpdateFlowResponse, type UpdateQrCodeRequest, type UpdateWabaSubscription, type UploadMediaResponse, type ValidateFlowJsonResponse, type VerifyCodeRequest, type VideoMediaObject, VideoMediaTypesEnum, type WABAClass, type WabaAccount, type WabaAccountFields, type WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaApi, WabaBusinessVerificationStatus, WabaConfigEnum, type WabaConfigType, type WabaHealthStatus, WabaHealthStatusCanSendMessage, type WabaHealthStatusEntity, type WabaHealthStatusError, type WabaSubscription, type WabaSubscriptions, type WebhookContact, type WebhookEvent, type WebhookMessage, WebhookTypesEnum, WhatsApp, type WhatsAppConfig, WhatsApp as WhatsAppLegacy, isFlowDataExchangeRequest, isFlowErrorRequest, isFlowPingRequest, isMetaError };
4386
+ //# sourceMappingURL=index.d.ts.map