meta-cloud-api 1.1.8 → 1.1.9

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.
@@ -1,671 +1,6 @@
1
+ import { BusinessVerticalEnum, ButtonPositionEnum, CategoryEnum, ComponentTypesEnum, CurrencyCodesEnum, DataLocalizationRegionEnum, HttpMethodsEnum, InteractiveTypesEnum, LanguagesEnum, MessageTypesEnum, ParametersTypesEnum, SubTypeEnum, TemplateStatusEnum, WabaConfigEnum } from "./enums-C_tIIGBV.js";
1
2
  import { IncomingHttpHeaders, IncomingMessage } from "http";
2
3
 
3
- //#region src/types/enums.d.ts
4
- declare enum CategoryEnum {
5
- Authentication = "AUTHENTICATION",
6
- Marketing = "MARKETING",
7
- Utility = "UTILITY",
8
- }
9
- declare enum TemplateStatusEnum {
10
- Approved = "APPROVED",
11
- Pending = "PENDING",
12
- Rejected = "REJECTED",
13
- }
14
- declare enum HttpMethodsEnum {
15
- Get = "GET",
16
- Post = "POST",
17
- Put = "PUT",
18
- Delete = "DELETE",
19
- }
20
- declare enum MessageTypesEnum {
21
- Audio = "audio",
22
- Contacts = "contacts",
23
- Document = "document",
24
- Image = "image",
25
- Interactive = "interactive",
26
- Location = "location",
27
- Reaction = "reaction",
28
- Sticker = "sticker",
29
- Template = "template",
30
- Text = "text",
31
- Video = "video",
32
- Button = "button",
33
- Order = "order",
34
- System = "system",
35
- Unknown = "unknown",
36
- Statuses = "statuses",
37
- '*' = "*",
38
- }
39
- declare enum ParametersTypesEnum {
40
- Action = "ACTION",
41
- CouponCode = "COUPON_CODE",
42
- Currency = "CURRENCY",
43
- DateTime = "DATE_TIME",
44
- Document = "DOCUMENT",
45
- ExpirationTimeMs = "EXPIRATION_TIME_MS",
46
- Image = "IMAGE",
47
- LimitedTimeOffer = "LIMITED_TIME_OFFER",
48
- Location = "LOCATION",
49
- OrderStatus = "ORDER_STATUS",
50
- Payload = "PAYLOAD",
51
- Product = "PRODUCT",
52
- Text = "TEXT",
53
- TtlMinutes = "TTL_MINUTES",
54
- Video = "VIDEO",
55
- WebviewInteraction = "WEBVIEW_INTERACTION",
56
- WebviewPresentation = "WEBVIEW_PRESENTATION",
57
- }
58
- declare enum InteractiveTypesEnum {
59
- Button = "button",
60
- List = "list",
61
- Product = "product",
62
- ProductList = "product_list",
63
- CtaUrl = "cta_url",
64
- LocationRequest = "location_request_message",
65
- AddressMessage = "address_message",
66
- Flow = "flow",
67
- }
68
- declare enum ButtonPositionEnum {
69
- First = 1,
70
- Second = 2,
71
- Third = 3,
72
- Fourth = 4,
73
- Fifth = 5,
74
- }
75
- declare enum SubTypeEnum {
76
- Catalog = "CATALOG",
77
- CopyCode = "COPY_CODE",
78
- Flow = "FLOW",
79
- Mpm = "MPM",
80
- OrderDetails = "ORDER_DETAILS",
81
- QuickReply = "QUICK_REPLY",
82
- Reminder = "REMINDER",
83
- Url = "URL",
84
- VoiceCall = "VOICE_CALL",
85
- }
86
- declare enum ComponentTypesEnum {
87
- Header = "HEADER",
88
- Body = "BODY",
89
- Button = "BUTTON",
90
- Footer = "FOOTER",
91
- }
92
- declare enum WabaConfigEnum {
93
- AppId = "M4D_APP_ID",
94
- Port = "WA_PORT",
95
- AppSecret = "M4D_APP_SECRET",
96
- PhoneNumberId = "WA_PHONE_NUMBER_ID",
97
- BusinessAcctId = "WA_BUSINESS_ACCOUNT_ID",
98
- APIVersion = "CLOUD_API_VERSION",
99
- AccessToken = "CLOUD_API_ACCESS_TOKEN",
100
- WebhookEndpoint = "WEBHOOK_ENDPOINT",
101
- WebhookVerificationToken = "WEBHOOK_VERIFICATION_TOKEN",
102
- ListenerPort = "LISTENER_PORT",
103
- MaxRetriesAfterWait = "MAX_RETRIES_AFTER_WAIT",
104
- RequestTimeout = "REQUEST_TIMEOUT",
105
- Debug = "DEBUG",
106
- PrivatePem = "FLOW_API_PRIVATE_PEM",
107
- Passphrase = "FLOW_API_PASSPHRASE",
108
- }
109
- declare enum ConversationTypesEnum {
110
- BusinessInitiated = "business_initiated",
111
- CustomerInitiated = "customer_initiated",
112
- ReferralConversion = "referral_conversion",
113
- }
114
- declare enum StatusEnum {
115
- Delivered = "delivered",
116
- Read = "read",
117
- Sent = "sent",
118
- }
119
- declare enum VideoMediaTypesEnum {
120
- Mp4 = "video/mp4",
121
- Threegp = "video/3gp",
122
- }
123
- declare enum StickerMediaTypesEnum {
124
- Webp = "image/webp",
125
- }
126
- declare enum ImageMediaTypesEnum {
127
- Jpeg = "image/jpeg",
128
- Png = "image/png",
129
- }
130
- declare enum DocumentMediaTypesEnum {
131
- Text = "text/plain",
132
- Pdf = "application/pdf",
133
- Ppt = "application/vnd.ms-powerpoint",
134
- Word = "application/msword",
135
- Excel = "application/vnd.ms-excel",
136
- OpenDoc = "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
137
- OpenPres = "application/vnd.openxmlformats-officedocument.presentationml.presentation",
138
- OpenSheet = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
139
- }
140
- declare enum AudioMediaTypesEnum {
141
- Aac = "audio/aac",
142
- Mp4 = "audio/mp4",
143
- Mpeg = "audio/mpeg",
144
- Amr = "audio/amr",
145
- Ogg = "audio/ogg",
146
- }
147
- declare enum WebhookTypesEnum {
148
- Audio = "audio",
149
- Button = "button",
150
- Document = "document",
151
- Text = "text",
152
- Image = "image",
153
- Interactive = "interactive",
154
- Order = "order",
155
- Sticker = "sticker",
156
- System = "system",
157
- Unknown = "unknown",
158
- Video = "video",
159
- }
160
- declare enum SystemChangeTypesEnum {
161
- CustomerChangedNumber = "customer_changed_number",
162
- CustomerIdentityChanged = "customer_identity_changed",
163
- }
164
- declare enum ReferralSourceTypesEnum {
165
- Ad = "ad",
166
- Post = "post",
167
- }
168
- declare enum RequestCodeMethodsEnum {
169
- Sms = "SMS",
170
- Voice = "VOICE",
171
- }
172
- declare enum LanguagesEnum {
173
- Afrikaans = "af",
174
- Albanian = "sq",
175
- Arabic = "ar",
176
- Azerbaijani = "az",
177
- Bengali = "bn",
178
- Bulgarian = "bg",
179
- Catalan = "ca",
180
- Chinese_CHN = "zh_CN",
181
- Chinese_HKG = "zh_HK",
182
- Chinese_TAI = "zh_TW",
183
- Croatian = "hr",
184
- Czech = "cs",
185
- Danish = "da",
186
- Dutch = "nl",
187
- English = "en",
188
- English_UK = "en_GB",
189
- English_US = "en_US",
190
- Estonian = "et",
191
- Filipino = "fil",
192
- Finnish = "fi",
193
- French = "fr",
194
- Georgian = "ka",
195
- German = "de",
196
- Greek = "el",
197
- Gujarati = "gu",
198
- Hausa = "ha",
199
- Hebrew = "he",
200
- Hindi = "hi",
201
- Hungarian = "hu",
202
- Indonesian = "id",
203
- Irish = "ga",
204
- Italian = "it",
205
- Japanese = "ja",
206
- Kannada = "kn",
207
- Kazakh = "kk",
208
- Kinyarwanda = "rw_RW",
209
- Korean = "ko",
210
- Kyrgyz_Kyrgyzstan = "ky_KG",
211
- Lao = "lo",
212
- Latvian = "lv",
213
- Lithuanian = "lt",
214
- Macedonian = "mk",
215
- Malay = "ms",
216
- Malayalam = "ml",
217
- Marathi = "mr",
218
- Norwegian = "nb",
219
- Persian = "fa",
220
- Polish = "pl",
221
- Portuguese_BR = "pt_BR",
222
- Portuguese_POR = "pt_PT",
223
- Punjabi = "pa",
224
- Romanian = "ro",
225
- Russian = "ru",
226
- Serbian = "sr",
227
- Slovak = "sk",
228
- Slovenian = "sl",
229
- Spanish = "es",
230
- Spanish_ARG = "es_AR",
231
- Spanish_SPA = "es_ES",
232
- Spanish_MEX = "es_MX",
233
- Swahili = "sw",
234
- Swedish = "sv",
235
- Tamil = "ta",
236
- Telugu = "te",
237
- Thai = "th",
238
- Turkish = "tr",
239
- Ukrainian = "uk",
240
- Urdu = "ur",
241
- Uzbek = "uz",
242
- Vietnamese = "vi",
243
- Zulu = "zu",
244
- }
245
- declare enum CurrencyCodesEnum {
246
- AFN = "AFN",
247
- EUR = "EUR",
248
- ALL = "ALL",
249
- DZD = "DZD",
250
- USD = "USD",
251
- AOA = "AOA",
252
- XCD = "XCD",
253
- ARS = "ARS",
254
- AMD = "AMD",
255
- AWG = "AWG",
256
- AUD = "AUD",
257
- AZN = "AZN",
258
- BSD = "BSD",
259
- BHD = "BHD",
260
- BDT = "BDT",
261
- BBD = "BBD",
262
- BYN = "BYN",
263
- BZD = "BZD",
264
- XOF = "XOF",
265
- BMD = "BMD",
266
- INR = "INR",
267
- BTN = "BTN",
268
- BOB = "BOB",
269
- BOV = "BOV",
270
- BAM = "BAM",
271
- BWP = "BWP",
272
- NOK = "NOK",
273
- BRL = "BRL",
274
- BND = "BND",
275
- BGN = "BGN",
276
- BIF = "BIF",
277
- CVE = "CVE",
278
- KHR = "KHR",
279
- XAF = "XAF",
280
- CAD = "CAD",
281
- KYD = "KYD",
282
- CLP = "CLP",
283
- CLF = "CLF",
284
- CNY = "CNY",
285
- COP = "COP",
286
- COU = "COU",
287
- KMF = "KMF",
288
- CDF = "CDF",
289
- NZD = "NZD",
290
- CRC = "CRC",
291
- HRK = "HRK",
292
- CUP = "CUP",
293
- CUC = "CUC",
294
- ANG = "ANG",
295
- CZK = "CZK",
296
- DKK = "DKK",
297
- DJF = "DJF",
298
- DOP = "DOP",
299
- EGP = "EGP",
300
- SVC = "SVC",
301
- ERN = "ERN",
302
- SZL = "SZL",
303
- ETB = "ETB",
304
- FKP = "FKP",
305
- FJD = "FJD",
306
- XPF = "XPF",
307
- GMD = "GMD",
308
- GEL = "GEL",
309
- GHS = "GHS",
310
- GIP = "GIP",
311
- GTQ = "GTQ",
312
- GBP = "GBP",
313
- GNF = "GNF",
314
- GYD = "GYD",
315
- HTG = "HTG",
316
- HNL = "HNL",
317
- HKD = "HKD",
318
- HUF = "HUF",
319
- ISK = "ISK",
320
- IDR = "IDR",
321
- XDR = "XDR",
322
- IRR = "IRR",
323
- IQD = "IQD",
324
- ILS = "ILS",
325
- JMD = "JMD",
326
- JPY = "JPY",
327
- JOD = "JOD",
328
- KZT = "KZT",
329
- KES = "KES",
330
- KPW = "KPW",
331
- KRW = "KRW",
332
- KWD = "KWD",
333
- KGS = "KGS",
334
- LAK = "LAK",
335
- LBP = "LBP",
336
- LSL = "LSL",
337
- ZAR = "ZAR",
338
- LRD = "LRD",
339
- LYD = "LYD",
340
- CHF = "CHF",
341
- MOP = "MOP",
342
- MKD = "MKD",
343
- MGA = "MGA",
344
- MWK = "MWK",
345
- MYR = "MYR",
346
- MVR = "MVR",
347
- MRU = "MRU",
348
- MUR = "MUR",
349
- XUA = "XUA",
350
- MXN = "MXN",
351
- MXV = "MXV",
352
- MDL = "MDL",
353
- MNT = "MNT",
354
- MAD = "MAD",
355
- MZN = "MZN",
356
- MMK = "MMK",
357
- NAD = "NAD",
358
- NPR = "NPR",
359
- NIO = "NIO",
360
- NGN = "NGN",
361
- OMR = "OMR",
362
- PKR = "PKR",
363
- PAB = "PAB",
364
- PGK = "PGK",
365
- PYG = "PYG",
366
- PEN = "PEN",
367
- PHP = "PHP",
368
- PLN = "PLN",
369
- QAR = "QAR",
370
- RON = "RON",
371
- RUB = "RUB",
372
- RWF = "RWF",
373
- SHP = "SHP",
374
- WST = "WST",
375
- STN = "STN",
376
- SAR = "SAR",
377
- RSD = "RSD",
378
- SCR = "SCR",
379
- SLL = "SLL",
380
- SGD = "SGD",
381
- XSU = "XSU",
382
- SBD = "SBD",
383
- SOS = "SOS",
384
- SSP = "SSP",
385
- LKR = "LKR",
386
- SDG = "SDG",
387
- SRD = "SRD",
388
- SEK = "SEK",
389
- CHE = "CHE",
390
- CHW = "CHW",
391
- SYP = "SYP",
392
- TWD = "TWD",
393
- TJS = "TJS",
394
- TZS = "TZS",
395
- THB = "THB",
396
- TOP = "TOP",
397
- TTD = "TTD",
398
- TND = "TND",
399
- TRY = "TRY",
400
- TMT = "TMT",
401
- UGX = "UGX",
402
- UAH = "UAH",
403
- AED = "AED",
404
- USN = "USN",
405
- UYU = "UYU",
406
- UYI = "UYI",
407
- UYW = "UYW",
408
- UZS = "UZS",
409
- VUV = "VUV",
410
- VES = "VES",
411
- VND = "VND",
412
- YER = "YER",
413
- ZMW = "ZMW",
414
- ZWL = "ZWL",
415
- XBA = "XBA",
416
- XBB = "XBB",
417
- XBC = "XBC",
418
- XBD = "XBD",
419
- XTS = "XTS",
420
- XXX = "XXX",
421
- XAU = "XAU",
422
- XPD = "XPD",
423
- XPT = "XPT",
424
- XAG = "XAG",
425
- AFA = "AFA",
426
- FIM = "FIM",
427
- ALK = "ALK",
428
- ADP = "ADP",
429
- ESP = "ESP",
430
- FRF = "FRF",
431
- AOK = "AOK",
432
- AON = "AON",
433
- AOR = "AOR",
434
- ARA = "ARA",
435
- ARP = "ARP",
436
- ARY = "ARY",
437
- RUR = "RUR",
438
- ATS = "ATS",
439
- AYM = "AYM",
440
- AZM = "AZM",
441
- BYB = "BYB",
442
- BYR = "BYR",
443
- BEC = "BEC",
444
- BEF = "BEF",
445
- BEL = "BEL",
446
- BOP = "BOP",
447
- BAD = "BAD",
448
- BRB = "BRB",
449
- BRC = "BRC",
450
- BRE = "BRE",
451
- BRN = "BRN",
452
- BRR = "BRR",
453
- BGJ = "BGJ",
454
- BGK = "BGK",
455
- BGL = "BGL",
456
- BUK = "BUK",
457
- HRD = "HRD",
458
- CYP = "CYP",
459
- CSJ = "CSJ",
460
- CSK = "CSK",
461
- ECS = "ECS",
462
- ECV = "ECV",
463
- GQE = "GQE",
464
- EEK = "EEK",
465
- XEU = "XEU",
466
- GEK = "GEK",
467
- DDM = "DDM",
468
- DEM = "DEM",
469
- GHC = "GHC",
470
- GHP = "GHP",
471
- GRD = "GRD",
472
- GNE = "GNE",
473
- GNS = "GNS",
474
- GWE = "GWE",
475
- GWP = "GWP",
476
- ITL = "ITL",
477
- ISJ = "ISJ",
478
- IEP = "IEP",
479
- ILP = "ILP",
480
- ILR = "ILR",
481
- LAJ = "LAJ",
482
- LVL = "LVL",
483
- LVR = "LVR",
484
- LSM = "LSM",
485
- ZAL = "ZAL",
486
- LTL = "LTL",
487
- LTT = "LTT",
488
- LUC = "LUC",
489
- LUF = "LUF",
490
- LUL = "LUL",
491
- MGF = "MGF",
492
- MVQ = "MVQ",
493
- MLF = "MLF",
494
- MTL = "MTL",
495
- MTP = "MTP",
496
- MRO = "MRO",
497
- MXP = "MXP",
498
- MZE = "MZE",
499
- MZM = "MZM",
500
- NLG = "NLG",
501
- NIC = "NIC",
502
- PEH = "PEH",
503
- PEI = "PEI",
504
- PES = "PES",
505
- PLZ = "PLZ",
506
- PTE = "PTE",
507
- ROK = "ROK",
508
- ROL = "ROL",
509
- STD = "STD",
510
- CSD = "CSD",
511
- SKK = "SKK",
512
- SIT = "SIT",
513
- RHD = "RHD",
514
- ESA = "ESA",
515
- ESB = "ESB",
516
- SDD = "SDD",
517
- SDP = "SDP",
518
- SRG = "SRG",
519
- CHC = "CHC",
520
- TJR = "TJR",
521
- TPE = "TPE",
522
- TRL = "TRL",
523
- TMM = "TMM",
524
- UGS = "UGS",
525
- UGW = "UGW",
526
- UAK = "UAK",
527
- SUR = "SUR",
528
- USS = "USS",
529
- UYN = "UYN",
530
- UYP = "UYP",
531
- VEB = "VEB",
532
- VEF = "VEF",
533
- VNC = "VNC",
534
- YDD = "YDD",
535
- YUD = "YUD",
536
- YUM = "YUM",
537
- YUN = "YUN",
538
- ZRN = "ZRN",
539
- ZRZ = "ZRZ",
540
- ZMK = "ZMK",
541
- ZWC = "ZWC",
542
- ZWD = "ZWD",
543
- ZWN = "ZWN",
544
- ZWR = "ZWR",
545
- XFO = "XFO",
546
- XRE = "XRE",
547
- XFU = "XFU",
548
- }
549
- declare enum DataLocalizationRegionEnum {
550
- AU = "AU",
551
- // Australia
552
- ID = "ID",
553
- // Indonesia
554
- IN = "IN",
555
- // India
556
- JP = "JP",
557
- // Japan
558
- SG = "SG",
559
- // Singapore
560
- KR = "KR",
561
- // South Korea
562
- DE = "DE",
563
- // EU (Germany)
564
- CH = "CH",
565
- // Switzerland
566
- GB = "GB",
567
- // United Kingdom
568
- BR = "BR",
569
- // Brazil
570
- BH = "BH",
571
- // Bahrain
572
- ZA = "ZA",
573
- // South Africa
574
- AE = "AE",
575
- // United Arab Emirates
576
- CA = "CA",
577
- }
578
- /**
579
- * Business category values for WhatsApp Business Profile.
580
- * These values map to specific strings displayed in the WhatsApp client.
581
- */
582
- declare enum BusinessVerticalEnum {
583
- /**
584
- * Alcoholic Beverages
585
- */
586
- ALCOHOL = "ALCOHOL",
587
- /**
588
- * Clothing and Apparel
589
- */
590
- APPAREL = "APPAREL",
591
- /**
592
- * Automotive
593
- */
594
- AUTO = "AUTO",
595
- /**
596
- * Beauty, Spa and Salon
597
- */
598
- BEAUTY = "BEAUTY",
599
- /**
600
- * Education
601
- */
602
- EDU = "EDU",
603
- /**
604
- * Entertainment
605
- */
606
- ENTERTAIN = "ENTERTAIN",
607
- /**
608
- * Event Planning and Service
609
- */
610
- EVENT_PLAN = "EVENT_PLAN",
611
- /**
612
- * Finance and Banking
613
- */
614
- FINANCE = "FINANCE",
615
- /**
616
- * Public Service
617
- */
618
- GOVT = "GOVT",
619
- /**
620
- * Food and Grocery
621
- */
622
- GROCERY = "GROCERY",
623
- /**
624
- * Medical and Health
625
- */
626
- HEALTH = "HEALTH",
627
- /**
628
- * Hotel and Lodging
629
- */
630
- HOTEL = "HOTEL",
631
- /**
632
- * Non-profit
633
- */
634
- NONPROFIT = "NONPROFIT",
635
- /**
636
- * Online Gambling & Gaming
637
- */
638
- ONLINE_GAMBLING = "ONLINE_GAMBLING",
639
- /**
640
- * Over-the-Counter Drugs
641
- */
642
- OTC_DRUGS = "OTC_DRUGS",
643
- /**
644
- * Other
645
- */
646
- OTHER = "OTHER",
647
- /**
648
- * Non-Online Gambling & Gaming (E.g. Brick and mortar)
649
- */
650
- PHYSICAL_GAMBLING = "PHYSICAL_GAMBLING",
651
- /**
652
- * Professional Services
653
- */
654
- PROF_SERVICES = "PROF_SERVICES",
655
- /**
656
- * Restaurant
657
- */
658
- RESTAURANT = "RESTAURANT",
659
- /**
660
- * Shopping and Retail
661
- */
662
- RETAIL = "RETAIL",
663
- /**
664
- * Travel and Transportation
665
- */
666
- TRAVEL = "TRAVEL",
667
- }
668
- //#endregion
669
4
  //#region src/types/config.d.ts
670
5
  type WhatsAppConfig = {
671
6
  accessToken: string;
@@ -1862,1221 +1197,1247 @@ interface MediaClass {
1862
1197
  downloadMedia(mediaUrl: string): Promise<Blob>;
1863
1198
  }
1864
1199
  //#endregion
1865
- //#region src/core/webhook/types.d.ts
1866
- interface WebhookContact {
1867
- /**
1868
- * WhatsApp ID of the contact. Business can respond to this contact using this ID.
1869
- */
1870
- wa_id: string;
1871
- /**
1872
- * Additional unique, alphanumeric identifier for a WhatsApp user
1873
- */
1874
- user_id?: string;
1875
- /**
1876
- * Profile of Whatsapp user
1877
- */
1878
- profile: {
1879
- /**
1880
- * The display name of the contact
1881
- */
1882
- name: string;
1883
- };
1884
- }
1200
+ //#region src/api/flow/types/common.d.ts
1885
1201
  /**
1886
- * Base message interface with common properties
1202
+ * Enum for Flow Status
1887
1203
  */
1888
- interface BaseMessage {
1889
- id: string;
1890
- from: string;
1891
- timestamp: string;
1892
- type: MessageTypesEnum;
1893
- /**
1894
- * Context object, included when a user replies or interacts
1895
- */
1896
- context?: {
1897
- /**
1898
- * ID of the message
1899
- */
1900
- id?: string;
1901
- /**
1902
- * ID of the sender
1903
- */
1904
- from?: string;
1905
- /**
1906
- * ID of the message being replied to or interacted with
1907
- */
1908
- message_id: string;
1909
- /**
1910
- * ID of the forwarded message, if applicable
1911
- */
1912
- forwarded?: boolean;
1913
- /**
1914
- * Frequently forwarded status
1915
- */
1916
- frequently_forwarded?: boolean;
1917
- /**
1918
- * Original message information if the message was referred
1919
- */
1920
- referred_product?: {
1921
- /**
1922
- * Catalog ID
1923
- */
1924
- catalog_id: string;
1925
- /**
1926
- * Product ID
1927
- */
1928
- product_retailer_id: string;
1929
- };
1930
- };
1931
- /**
1932
- * Errors array, if the message had errors
1933
- */
1934
- errors?: Array<{
1935
- /**
1936
- * Error code
1937
- */
1938
- code: number;
1939
- /**
1940
- * Error title
1941
- */
1942
- title: string;
1943
- /**
1944
- * Error message
1945
- */
1946
- message: string;
1947
- /**
1948
- * Error details object
1949
- */
1950
- error_data?: {
1951
- /**
1952
- * Describes the error details
1953
- */
1954
- details: string;
1955
- };
1956
- }>;
1204
+ declare enum FlowStatusEnum {
1205
+ Draft = "DRAFT",
1206
+ Published = "PUBLISHED",
1207
+ Throttled = "THROTTLED",
1208
+ Blocked = "BLOCKED",
1209
+ Deprecated = "DEPRECATED",
1957
1210
  }
1958
1211
  /**
1959
- * Text message interface
1212
+ * Enum for Flow Categories
1960
1213
  */
1961
- interface TextMessage extends BaseMessage {
1962
- type: MessageTypesEnum.Text;
1963
- text: {
1964
- /**
1965
- * The text content of the message
1966
- */
1967
- body: string;
1968
- preview_url?: boolean;
1969
- };
1214
+ declare enum FlowCategoryEnum {
1215
+ SignUp = "SIGN_UP",
1216
+ SignIn = "SIGN_IN",
1217
+ AppointmentBooking = "APPOINTMENT_BOOKING",
1218
+ LeadGeneration = "LEAD_GENERATION",
1219
+ ContactUs = "CONTACT_US",
1220
+ CustomerSupport = "CUSTOMER_SUPPORT",
1221
+ Survey = "SURVEY",
1222
+ Other = "OTHER",
1970
1223
  }
1971
- /**
1972
- * Image message interface
1973
- */
1974
- interface ImageMessage extends BaseMessage {
1975
- type: MessageTypesEnum.Image;
1976
- image: {
1977
- /**
1978
- * The image caption (if provided)
1979
- */
1980
- caption?: string;
1981
- /**
1982
- * The SHA256 hash of the image
1983
- */
1984
- sha256?: string;
1985
- /**
1986
- * The ID for the image
1987
- */
1988
- id: string;
1989
- /**
1990
- * The MIME type of the image
1991
- */
1992
- mime_type: string;
1993
- };
1224
+ declare enum FlowActionEnum {
1225
+ INIT = "INIT",
1226
+ BACK = "BACK",
1227
+ DATA_EXCHANGE = "data_exchange",
1994
1228
  }
1995
1229
  /**
1996
- * Video message interface
1230
+ * Enum for Flow Types in webhook handlers
1231
+ * Used to register handlers for specific flow events
1997
1232
  */
1998
- interface VideoMessage extends BaseMessage {
1999
- type: MessageTypesEnum.Video;
2000
- video: {
2001
- /**
2002
- * The video caption (if provided)
2003
- */
2004
- caption?: string;
2005
- /**
2006
- * The SHA256 hash of the video
2007
- */
2008
- sha256?: string;
2009
- /**
2010
- * The ID for the video
2011
- */
2012
- id: string;
2013
- /**
2014
- * The MIME type of the video
2015
- */
2016
- mime_type: string;
2017
- };
1233
+ declare enum FlowTypeEnum {
1234
+ /** Health check/ping requests */
1235
+ Ping = "ping",
1236
+ /** Data exchange requests */
1237
+ Change = "data_exchange",
1238
+ /** Error notification requests */
1239
+ Error = "error",
1240
+ /** Match all flow action types */
1241
+ All = "*",
2018
1242
  }
1243
+ type FlowType = (typeof FlowTypeEnum)[keyof typeof FlowTypeEnum];
2019
1244
  /**
2020
- * Audio message interface
1245
+ * Flow Validation Error Pointer
2021
1246
  */
2022
- interface AudioMessage extends BaseMessage {
2023
- type: MessageTypesEnum.Audio;
2024
- audio: {
2025
- /**
2026
- * The ID for the audio file
2027
- */
2028
- id: string;
2029
- /**
2030
- * The MIME type of the audio file
2031
- */
2032
- mime_type: string;
2033
- /**
2034
- * Whether the audio is a voice message
2035
- */
2036
- voice?: boolean;
2037
- };
1247
+ interface FlowValidationErrorPointer {
1248
+ line_start: number;
1249
+ line_end: number;
1250
+ column_start: number;
1251
+ column_end: number;
1252
+ path: string;
2038
1253
  }
2039
1254
  /**
2040
- * Document message interface
1255
+ * Flow Validation Error
2041
1256
  */
2042
- interface DocumentMessage extends BaseMessage {
2043
- type: MessageTypesEnum.Document;
2044
- document: {
2045
- /**
2046
- * The document caption (if provided)
2047
- */
2048
- caption?: string;
2049
- /**
2050
- * The document filename
2051
- */
2052
- filename: string;
2053
- /**
2054
- * The SHA256 hash of the document
2055
- */
2056
- sha256?: string;
2057
- /**
2058
- * The ID for the document
2059
- */
2060
- id: string;
2061
- /**
2062
- * The MIME type of the document
2063
- */
2064
- mime_type: string;
2065
- };
2066
- }
2067
- /**
2068
- * Sticker message interface
2069
- */
2070
- interface StickerMessage extends BaseMessage {
2071
- type: MessageTypesEnum.Sticker;
2072
- sticker: {
2073
- /**
2074
- * The ID for the sticker
2075
- */
2076
- id: string;
2077
- /**
2078
- * Whether this is an animated sticker
2079
- */
2080
- animated: boolean;
2081
- /**
2082
- * The MIME type of the sticker
2083
- */
2084
- mime_type: string;
2085
- };
2086
- }
2087
- /**
2088
- * Reaction message interface
2089
- */
2090
- interface ReactionMessage extends BaseMessage {
2091
- type: MessageTypesEnum.Reaction;
2092
- reaction: {
2093
- /**
2094
- * The ID of the message being reacted to
2095
- */
2096
- message_id: string;
2097
- /**
2098
- * Emoji used for the reaction
2099
- */
2100
- emoji: string;
2101
- };
2102
- }
2103
- /**
2104
- * Contacts message interface
2105
- */
2106
- interface ContactsMessage extends BaseMessage {
2107
- type: MessageTypesEnum.Contacts;
2108
- contacts: Array<{
2109
- /**
2110
- * The contact's name
2111
- */
2112
- name: {
2113
- /**
2114
- * The formatted name
2115
- */
2116
- formatted_name: string;
2117
- /**
2118
- * The first name
2119
- */
2120
- first_name?: string;
2121
- /**
2122
- * The last name
2123
- */
2124
- last_name?: string;
2125
- /**
2126
- * The middle name
2127
- */
2128
- middle_name?: string;
2129
- /**
2130
- * The suffix
2131
- */
2132
- suffix?: string;
2133
- /**
2134
- * The prefix
2135
- */
2136
- prefix?: string;
2137
- };
2138
- /**
2139
- * The contact's phone numbers
2140
- */
2141
- phones?: Array<{
2142
- phone: string;
2143
- type?: string;
2144
- wa_id?: string;
2145
- }>;
2146
- /**
2147
- * The contact's emails
2148
- */
2149
- emails?: Array<{
2150
- email: string;
2151
- type?: string;
2152
- }>;
2153
- /**
2154
- * The contact's addresses
2155
- */
2156
- addresses?: Array<{
2157
- street?: string;
2158
- city?: string;
2159
- state?: string;
2160
- zip?: string;
2161
- country?: string;
2162
- country_code?: string;
2163
- type?: string;
2164
- }>;
2165
- /**
2166
- * The contact's organizations
2167
- */
2168
- org?: {
2169
- company?: string;
2170
- department?: string;
2171
- title?: string;
2172
- };
2173
- /**
2174
- * The contact's URLs
2175
- */
2176
- urls?: Array<{
2177
- url: string;
2178
- type?: string;
2179
- }>;
2180
- /**
2181
- * The contact's birthday (YYYY-MM-DD format)
2182
- */
2183
- birthday?: string;
2184
- }>;
2185
- }
2186
- /**
2187
- * Location message interface
2188
- */
2189
- interface LocationMessage extends BaseMessage {
2190
- type: MessageTypesEnum.Location;
2191
- location: {
2192
- /**
2193
- * Latitude of the location
2194
- */
2195
- latitude: number;
2196
- /**
2197
- * Longitude of the location
2198
- */
2199
- longitude: number;
2200
- /**
2201
- * Name of the location
2202
- */
2203
- name?: string;
2204
- /**
2205
- * Address of the location
2206
- */
2207
- address?: string;
2208
- };
2209
- }
2210
- /**
2211
- * Interactive message interface
2212
- */
2213
- interface InteractiveMessage extends BaseMessage {
2214
- type: MessageTypesEnum.Interactive;
2215
- interactive: {
2216
- /**
2217
- * Type of the interactive message
2218
- * Can be: button_reply, list_reply, flow, nfm_reply, etc.
2219
- */
2220
- type: string;
2221
- /**
2222
- * ID for the button that was clicked
2223
- */
2224
- button_reply?: {
2225
- id: string;
2226
- title: string;
2227
- };
2228
- /**
2229
- * ID for the list item that was selected
2230
- */
2231
- list_reply?: {
2232
- id: string;
2233
- title: string;
2234
- description?: string;
2235
- };
2236
- /**
2237
- * NFM (No-Code Flow Message) reply data
2238
- */
2239
- nfm_reply?: {
2240
- /**
2241
- * Response data in JSON format
2242
- */
2243
- response_json: string;
2244
- /**
2245
- * Body text of the reply
2246
- */
2247
- body: string;
2248
- /**
2249
- * Name of the flow
2250
- */
2251
- name: string;
2252
- };
2253
- };
2254
- }
2255
- /**
2256
- * System message interface
2257
- */
2258
- interface SystemMessage extends BaseMessage {
2259
- type: MessageTypesEnum.System;
2260
- system: {
2261
- /**
2262
- * The type of system update
2263
- */
2264
- type: string;
2265
- /**
2266
- * User's identity if the update is a customer identity change
2267
- */
2268
- identity?: string;
2269
- /**
2270
- * Old and new phone numbers if the update is a phone number change
2271
- */
2272
- customer?: {
2273
- /**
2274
- * The previous phone number
2275
- */
2276
- previous_wa_id: string;
2277
- /**
2278
- * The new phone number
2279
- */
2280
- wa_id: string;
2281
- };
2282
- };
2283
- }
2284
- /**
2285
- * Order message interface
2286
- */
2287
- interface OrderMessage extends BaseMessage {
2288
- type: MessageTypesEnum.Order;
2289
- order: {
2290
- /**
2291
- * Catalog ID
2292
- */
2293
- catalog_id: string;
2294
- /**
2295
- * Product items in the order
2296
- */
2297
- product_items: Array<{
2298
- /**
2299
- * Product ID
2300
- */
2301
- product_retailer_id: string;
2302
- /**
2303
- * Quantity of the product
2304
- */
2305
- quantity: number;
2306
- /**
2307
- * Item price
2308
- */
2309
- item_price: number;
2310
- /**
2311
- * Currency code
2312
- */
2313
- currency: string;
2314
- }>;
2315
- /**
2316
- * Text message included with the order
2317
- */
2318
- text?: string;
2319
- };
2320
- }
2321
- /**
2322
- * Button message interface
2323
- */
2324
- interface ButtonMessage extends BaseMessage {
2325
- type: MessageTypesEnum.Button;
2326
- button: {
2327
- /**
2328
- * The payload for the button
2329
- */
2330
- payload: string;
2331
- /**
2332
- * Button text
2333
- */
2334
- text: string;
2335
- };
2336
- }
2337
- /**
2338
- * Union type for all message types
2339
- */
2340
-
2341
- /**
2342
- * Represents a message received through the webhook
2343
- * Based on Meta's documentation: https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/components#messages-object
2344
- */
2345
- interface WebhookMessage {
2346
- /**
2347
- * The WhatsApp Business Account ID
2348
- */
2349
- wabaId: string;
2350
- /**
2351
- * The message ID
2352
- */
2353
- id: string;
2354
- /**
2355
- * The sender's phone number
2356
- */
2357
- from: string;
2358
- /**
2359
- * The timestamp of the message
2360
- */
2361
- timestamp: string;
2362
- /**
2363
- * The type of message (text, image, etc.)
2364
- */
2365
- type: MessageTypesEnum;
2366
- /**
2367
- * The phone number ID that received the message
2368
- */
2369
- phoneNumberId: string;
2370
- /**
2371
- * The display phone number that received the message
2372
- */
2373
- displayPhoneNumber: string;
2374
- /**
2375
- * The profile name of the sender
2376
- */
2377
- profileName: string;
2378
- text?: TextMessage['text'];
2379
- image?: ImageMessage['image'];
2380
- video?: VideoMessage['video'];
2381
- audio?: AudioMessage['audio'];
2382
- document?: DocumentMessage['document'];
2383
- sticker?: StickerMessage['sticker'];
2384
- location?: LocationMessage['location'];
2385
- contacts?: ContactsMessage['contacts'];
2386
- interactive?: InteractiveMessage['interactive'];
2387
- button?: ButtonMessage['button'];
2388
- order?: OrderMessage['order'];
2389
- system?: SystemMessage['system'];
2390
- reaction?: ReactionMessage['reaction'];
2391
- statuses?: {
2392
- /**
2393
- * Arbitrary string included in sent message
2394
- */
2395
- biz_opaque_callback_data?: string;
2396
- /**
2397
- * Information about the conversation
2398
- */
2399
- conversation?: {
2400
- /**
2401
- * Represents the ID of the conversation the given status notification belongs to
2402
- */
2403
- id: string;
2404
- /**
2405
- * Describes conversation category
2406
- */
2407
- origin: {
2408
- /**
2409
- * Indicates conversation category. This can also be referred to as a conversation entry point
2410
- * - authentication: Conversation opened by business sending template categorized as AUTHENTICATION
2411
- * - marketing: Conversation opened by business sending template categorized as MARKETING
2412
- * - utility: Conversation opened by business sending template categorized as UTILITY
2413
- * - service: Conversation opened by business replying to customer within service window
2414
- * - referral_conversion: Free entry point conversation
2415
- */
2416
- type: 'authentication' | 'marketing' | 'utility' | 'service' | 'referral_conversion';
2417
- };
2418
- /**
2419
- * Date when the conversation expires. Only present for messages with status 'sent'
2420
- */
2421
- expiration_timestamp?: string;
2422
- };
2423
- /**
2424
- * Array of error objects describing the error
2425
- */
2426
- errors?: Array<{
2427
- /**
2428
- * Error code
2429
- */
2430
- code: number;
2431
- /**
2432
- * Error code title
2433
- */
2434
- title: string;
2435
- /**
2436
- * Error code message
2437
- */
2438
- message: string;
2439
- /**
2440
- * Error details object
2441
- */
2442
- error_data?: {
2443
- /**
2444
- * Describes the error details
2445
- */
2446
- details: string;
2447
- };
2448
- }>;
2449
- /**
2450
- * The ID for the message that the business sent to a customer
2451
- */
2452
- id: string;
2453
- /**
2454
- * Pricing information for the message/conversation
2455
- */
2456
- pricing?: {
2457
- /**
2458
- * Indicates if the given message or conversation is billable
2459
- * @deprecated This field is deprecated. Visit the WhatsApp Changelog for more information.
2460
- */
2461
- billable?: boolean;
2462
- /**
2463
- * Indicates the conversation category:
2464
- * - authentication: Authentication conversation
2465
- * - authentication_international: Authentication-international conversation
2466
- * - marketing: Marketing conversation
2467
- * - utility: Utility conversation
2468
- * - service: Service conversation
2469
- * - referral_conversion: Free entry point conversation
2470
- */
2471
- category: 'authentication' | 'authentication_international' | 'marketing' | 'utility' | 'service' | 'referral_conversion';
2472
- /**
2473
- * Type of pricing model used by the business. Current supported value is CBP
2474
- */
2475
- pricing_model: 'CBP';
2476
- };
2477
- /**
2478
- * The customer's WhatsApp ID. Business can respond to customer using this ID.
2479
- * This ID may not match the customer's phone number.
2480
- */
2481
- recipient_id: string;
2482
- /**
2483
- * Status of the message:
2484
- * - delivered: Message has been delivered
2485
- * - read: Message has been read by the customer
2486
- * - sent: Message has been sent to the customer
2487
- */
2488
- status: 'delivered' | 'read' | 'sent';
2489
- /**
2490
- * Unix timestamp for the status message
2491
- */
2492
- timestamp: string;
2493
- };
2494
- /**
2495
- * The original message data as received from the webhook
2496
- */
2497
- originalData: any;
1257
+ interface FlowValidationError {
1258
+ error: string;
1259
+ error_type: string;
1260
+ message: string;
1261
+ line_start: number;
1262
+ line_end: number;
1263
+ column_start: number;
1264
+ column_end: number;
1265
+ pointers: FlowValidationErrorPointer[];
2498
1266
  }
2499
1267
  /**
2500
- * Webhook event received from WhatsApp
1268
+ * Flow Item
2501
1269
  */
2502
- interface WebhookEvent {
2503
- /**
2504
- * The field type of the event
2505
- */
2506
- field: string;
2507
- /**
2508
- * The event data
2509
- */
2510
- value: any;
2511
- /**
2512
- * The timestamp when the event was received
2513
- */
2514
- timestamp: number;
1270
+ interface Flow {
1271
+ id: string;
1272
+ name: string;
1273
+ status: FlowStatusEnum;
1274
+ categories: FlowCategoryEnum[];
1275
+ validation_errors: FlowValidationError[];
2515
1276
  }
2516
1277
  /**
2517
- * Message handler function type
1278
+ * Pagination Cursors
2518
1279
  */
2519
- //#endregion
2520
- //#region src/api/qrCode/types/common.d.ts
2521
- type QrCodeResponse = {
2522
- code: string;
2523
- prefilled_message: string;
2524
- deep_link_url: string;
2525
- qr_image_url?: string;
2526
- };
2527
- type QrCodesResponse = ResponseData<QrCodeResponse[]>;
2528
- type CreateQrCodeRequest = {
2529
- prefilled_message: string;
2530
- generate_qr_image?: 'SVG' | 'PNG';
2531
- };
2532
- type UpdateQrCodeRequest = {
2533
- code: string;
2534
- prefilled_message: string;
2535
- };
2536
- interface QrCodeClass {
2537
- createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
2538
- getQrCodes(): Promise<QrCodesResponse>;
2539
- getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
2540
- updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
2541
- deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
1280
+ interface PaginationCursors {
1281
+ before: string;
1282
+ after: string;
2542
1283
  }
2543
- //#endregion
2544
- //#region src/api/waba/types/common.d.ts
2545
1284
  /**
2546
- * WhatsApp Business Account subscription configuration
1285
+ * Pagination Object
2547
1286
  */
2548
- type WabaSubscription = {
2549
- whatsapp_business_api_data: {
2550
- id: string;
2551
- link: string;
2552
- name: string;
2553
- category: string;
2554
- };
2555
- override_callback_uri?: string;
2556
- };
1287
+ interface Pagination {
1288
+ cursors: PaginationCursors;
1289
+ }
2557
1290
  /**
2558
- * Parameters for updating WABA subscription
1291
+ * Flows List Response
2559
1292
  */
2560
- interface UpdateWabaSubscription {
2561
- override_callback_uri: string;
2562
- verify_token: string;
1293
+ interface FlowsListResponse {
1294
+ data: Flow[];
1295
+ paging: Pagination;
2563
1296
  }
2564
1297
  /**
2565
- * Response containing all WABA subscriptions
1298
+ * Flow Asset
2566
1299
  */
2567
- interface WabaSubscriptions {
2568
- data: Array<WabaSubscription>;
1300
+ interface FlowAsset {
1301
+ name: string;
1302
+ asset_type: string;
1303
+ download_url: string;
2569
1304
  }
2570
1305
  /**
2571
- * WABA account review status enumeration
1306
+ * Flow Assets Response
2572
1307
  */
2573
- declare enum WabaAccountReviewStatus {
2574
- Approved = "APPROVED",
2575
- Active = "ACTIVE",
2576
- Inactive = "INACTIVE",
2577
- Disabled = "DISABLED",
1308
+ interface FlowAssetsResponse {
1309
+ data: FlowAsset[];
1310
+ paging: Pagination;
2578
1311
  }
2579
1312
  /**
2580
- * WABA health status for message sending capability
1313
+ * Flow Preview
2581
1314
  */
2582
- declare enum WabaHealthStatusCanSendMessage {
2583
- Blocked = "BLOCKED",
2584
- Limited = "LIMITED",
2585
- Available = "AVAILABLE",
1315
+ interface FlowPreview {
1316
+ preview_url: string;
1317
+ expires_at: string;
2586
1318
  }
2587
1319
  /**
2588
- * WABA account status enumeration
1320
+ * Flow Preview Response
1321
+ */
1322
+ interface FlowPreviewResponse {
1323
+ preview: FlowPreview;
1324
+ id: string;
1325
+ }
1326
+ /**
1327
+ * Flow Migration Result
1328
+ */
1329
+ interface FlowMigrationResult {
1330
+ source_name: string;
1331
+ source_id: string;
1332
+ migrated_id: string;
1333
+ }
1334
+ /**
1335
+ * Flow Migration Failure
1336
+ */
1337
+ interface FlowMigrationFailure {
1338
+ source_name: string;
1339
+ error_code: string;
1340
+ error_message: string;
1341
+ }
1342
+ /**
1343
+ * Create Flow Response
1344
+ */
1345
+ interface CreateFlowResponse {
1346
+ id: string;
1347
+ success: boolean;
1348
+ validation_errors?: FlowValidationError[];
1349
+ }
1350
+ /**
1351
+ * Update Flow Response
1352
+ */
1353
+ interface UpdateFlowResponse {
1354
+ success: boolean;
1355
+ validation_errors?: FlowValidationError[];
1356
+ }
1357
+ /**
1358
+ * Flow Migration Response
1359
+ */
1360
+ interface FlowMigrationResponse {
1361
+ migrated_flows: FlowMigrationResult[];
1362
+ failed_flows: FlowMigrationFailure[];
1363
+ }
1364
+ /**
1365
+ * Validate Flow JSON Response
1366
+ */
1367
+ interface ValidateFlowJsonResponse {
1368
+ valid: boolean;
1369
+ success: boolean;
1370
+ validation_errors?: FlowValidationError[];
1371
+ }
1372
+ /**
1373
+ * WhatsApp Flow Endpoint - Encrypted Request Payload
1374
+ * Represents the raw encrypted data received from WhatsApp
1375
+ */
1376
+ interface FlowEncryptedRequestPayload {
1377
+ encrypted_aes_key: string;
1378
+ encrypted_flow_data: string;
1379
+ initial_vector: string;
1380
+ }
1381
+ /**
1382
+ * WhatsApp Flow Endpoint - Decrypted Request Response
1383
+ * Represents the successfully decrypted data and encryption keys
1384
+ */
1385
+ interface FlowDecryptedRequestResponse {
1386
+ decryptedBody: any;
1387
+ aesKeyBuffer: Buffer;
1388
+ initialVectorBuffer: Buffer;
1389
+ }
1390
+ /**
1391
+ * WhatsApp Flow Endpoint - HTTP Request with Body
1392
+ * Represents an HTTP request with the encrypted payload
1393
+ */
1394
+ interface FlowHttpRequest extends IncomingMessage {
1395
+ body: FlowEncryptedRequestPayload;
1396
+ headers: IncomingHttpHeaders;
1397
+ }
1398
+ /**
1399
+ * WhatsApp Flow Endpoint - Health Check Request
1400
+ * Represents the structure of a health check request
2589
1401
  */
2590
- declare enum WabaAccountStatus {
2591
- Approved = "APPROVED",
2592
- Active = "ACTIVE",
2593
- Inactive = "INACTIVE",
2594
- Disabled = "DISABLED",
1402
+ interface FlowHealthCheckRequest {
1403
+ action: 'ping';
1404
+ version: '3.0';
2595
1405
  }
2596
1406
  /**
2597
- * Business verification status enumeration
1407
+ * WhatsApp Flow Endpoint - Health Check Response
1408
+ * The expected response structure for health check requests
2598
1409
  */
2599
- declare enum WabaBusinessVerificationStatus {
2600
- Verified = "verified",
2601
- PendingSubmission = "pending_submission",
2602
- Unverified = "unverified",
2603
- Rejected = "rejected",
1410
+ interface FlowHealthCheckResponse {
1411
+ data: {
1412
+ status: 'active';
1413
+ };
2604
1414
  }
2605
1415
  /**
2606
- * WABA health status error details
1416
+ * WhatsApp Flow Endpoint - Data Exchange Request
1417
+ * Represents the structure of a data exchange request
2607
1418
  */
2608
- interface WabaHealthStatusError {
2609
- error_code?: number;
2610
- error_description?: string;
2611
- possible_solution?: string;
1419
+ interface FlowDataExchangeRequest {
1420
+ version: '3.0';
1421
+ action: FlowActionEnum;
1422
+ screen: string;
1423
+ flow_token: string;
1424
+ data?: Record<string, any> & {
1425
+ error_message?: string;
1426
+ };
2612
1427
  }
2613
1428
  /**
2614
- * WABA health status entity information
1429
+ * WhatsApp Flow Endpoint - Data Exchange Response
1430
+ * The expected response structure for data exchange requests
2615
1431
  */
2616
- interface WabaHealthStatusEntity {
2617
- entity_type?: string;
2618
- id?: string;
2619
- can_send_message?: string;
2620
- errors?: WabaHealthStatusError[];
1432
+ interface FlowDataExchangeResponse {
1433
+ screen?: string;
1434
+ data?: Record<string, any | {
1435
+ error_message?: string;
1436
+ }>;
2621
1437
  }
2622
1438
  /**
2623
- * Overall WABA health status
1439
+ * WhatsApp Flow Endpoint - Success Screen Response
1440
+ * The expected response structure for success screen requests
2624
1441
  */
2625
- interface WabaHealthStatus {
2626
- can_send_message?: WabaHealthStatusCanSendMessage;
2627
- entities?: WabaHealthStatusEntity[];
1442
+ interface FlowSuccessScreenResponse {
1443
+ screen: 'SUCCESS';
1444
+ data: {
1445
+ extension_message_response?: {
1446
+ params?: {
1447
+ flow_token: string;
1448
+ [key: string]: string;
1449
+ };
1450
+ };
1451
+ };
2628
1452
  }
2629
1453
  /**
2630
- * WhatsApp Business Account information
1454
+ * WhatsApp Flow Endpoint - Error Notification Request
1455
+ * Represents the structure of an error notification request
2631
1456
  */
2632
- interface WabaAccount {
2633
- account_review_status?: WabaAccountReviewStatus;
2634
- id?: string;
2635
- health_status?: WabaHealthStatus;
2636
- status?: WabaAccountStatus;
2637
- business_verification_status?: WabaBusinessVerificationStatus;
2638
- message_template_namespace?: string;
2639
- name?: string;
2640
- ownership_type?: string;
2641
- currency?: string;
1457
+ interface FlowErrorNotificationRequest {
1458
+ version: '3.0';
1459
+ action: Exclude<FlowActionEnum, FlowActionEnum.BACK>;
1460
+ screen: string;
1461
+ flow_token: string;
1462
+ data: {
1463
+ error: string;
1464
+ error_message: string;
1465
+ };
2642
1466
  }
2643
1467
  /**
2644
- * Available fields for WABA account queries
1468
+ * WhatsApp Flow Endpoint - Error Notification Response
1469
+ * The expected response structure for error notification requests
2645
1470
  */
2646
- type WabaAccountFields = 'id' | 'name' | 'account_review_status' | 'auth_international_rate_eligibility' | 'business_verification_status' | 'country' | 'currency' | 'health_status' | 'status' | 'ownership_type' | 'message_template_namespace';
1471
+ interface FlowErrorNotificationResponse {
1472
+ acknowledged: boolean;
1473
+ }
2647
1474
  /**
2648
- * Parameter type for specifying which WABA account fields to retrieve
1475
+ * WhatsApp Flow Endpoint - Comprehensive Request Object
1476
+ * A combined type that includes all possible fields from different request types
1477
+ * with all fields being optional for flexibility
2649
1478
  */
2650
- type WabaAccountFieldsParam = WabaAccountFields[];
1479
+ interface FlowEndpointRequest {
1480
+ version?: '3.0';
1481
+ action?: 'ping' | FlowActionEnum;
1482
+ screen?: string;
1483
+ flow_token?: string;
1484
+ data?: Record<string, any> & {
1485
+ error_key?: string;
1486
+ error_message?: string;
1487
+ };
1488
+ }
2651
1489
  /**
2652
- * Interface defining all WABA API methods
1490
+ * WhatsApp Flow Endpoint - Response
1491
+ * Union type for all possible response types from a Flow endpoint
2653
1492
  */
2654
- interface WABAClass {
2655
- getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
2656
- getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
2657
- updateWabaSubscription(params: UpdateWabaSubscription): Promise<ResponseSuccess>;
2658
- unsubscribeFromWaba(): Promise<ResponseSuccess>;
1493
+ type FlowEndpointResponse = FlowHealthCheckResponse | FlowDataExchangeResponse | FlowErrorNotificationResponse | FlowSuccessScreenResponse;
1494
+ interface FlowClass {
1495
+ /**
1496
+ * List Flows
1497
+ *
1498
+ * @param wabaId - The WABA ID
1499
+ * @returns Promise with the list of flows
1500
+ */
1501
+ listFlows(wabaId: string): Promise<FlowsListResponse>;
1502
+ /**
1503
+ * Create Flow
1504
+ *
1505
+ * @param wabaId - The WABA ID
1506
+ * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
1507
+ * @returns Promise with the created flow ID
1508
+ */
1509
+ createFlow(wabaId: string, data: {
1510
+ name: string;
1511
+ categories?: FlowCategoryEnum[];
1512
+ endpoint_uri?: string;
1513
+ clone_flow_id?: string;
1514
+ flow_json?: string;
1515
+ publish?: boolean;
1516
+ }): Promise<CreateFlowResponse>;
1517
+ /**
1518
+ * Get Flow
1519
+ *
1520
+ * @param flowId - The flow ID
1521
+ * @param fields - Optional fields to return
1522
+ * @param dateFormat - Optional date format
1523
+ * @returns Promise with the flow details
1524
+ */
1525
+ getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
1526
+ /**
1527
+ * Update Flow Metadata
1528
+ *
1529
+ * @param flowId - The flow ID
1530
+ * @param data - The flow metadata to update
1531
+ * @returns Promise with the success status
1532
+ */
1533
+ updateFlowMetadata(flowId: string, data: {
1534
+ name?: string;
1535
+ categories?: FlowCategoryEnum[];
1536
+ endpoint_uri?: string;
1537
+ application_id?: string;
1538
+ }): Promise<ResponseSuccess>;
1539
+ /**
1540
+ * Delete Flow
1541
+ *
1542
+ * @param flowId - The flow ID
1543
+ * @returns Promise with the success status
1544
+ */
1545
+ deleteFlow(flowId: string): Promise<ResponseSuccess>;
1546
+ /**
1547
+ * List Assets (Get Flow JSON URL)
1548
+ *
1549
+ * @param flowId - The flow ID
1550
+ * @returns Promise with the list of assets
1551
+ */
1552
+ listAssets(flowId: string): Promise<FlowAssetsResponse>;
1553
+ /**
1554
+ * Update Flow JSON
1555
+ *
1556
+ * @param flowId - The flow ID
1557
+ * @param data - The asset data including asset_type, file, and name
1558
+ * @returns Promise with the success status and validation errors
1559
+ */
1560
+ updateFlowJson(flowId: string, data: {
1561
+ file: Blob | Buffer | object;
1562
+ name?: string;
1563
+ }): Promise<UpdateFlowResponse>;
1564
+ /**
1565
+ * Validate Flow JSON by attempting an update without publishing.
1566
+ * This is a convenience method; the API doesn't have a dedicated validation endpoint.
1567
+ *
1568
+ * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).
1569
+ * @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.
1570
+ * @returns Promise indicating if the JSON is valid and includes validation errors if any.
1571
+ */
1572
+ validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
1573
+ /**
1574
+ * Publish Flow
1575
+ *
1576
+ * @param flowId - The flow ID
1577
+ * @returns Promise with the success status
1578
+ */
1579
+ publishFlow(flowId: string): Promise<ResponseSuccess>;
1580
+ /**
1581
+ * Deprecate Flow
1582
+ *
1583
+ * @param flowId - The flow ID
1584
+ * @returns Promise with the success status
1585
+ */
1586
+ deprecateFlow(flowId: string): Promise<ResponseSuccess>;
1587
+ /**
1588
+ * Migrate Flows
1589
+ *
1590
+ * @param wabaId - The destination WABA ID
1591
+ * @param data - The migration data including source_waba_id and optional source_flow_names
1592
+ * @returns Promise with migration results
1593
+ */
1594
+ migrateFlows(wabaId: string, data: {
1595
+ source_waba_id: string;
1596
+ source_flow_names?: string[];
1597
+ }): Promise<FlowMigrationResponse>;
2659
1598
  }
2660
1599
  //#endregion
2661
- //#region src/utils/isMetaError.d.ts
2662
- interface MetaError extends Error {
2663
- error: {
2664
- message: string;
2665
- type: string;
1600
+ //#region src/core/webhook/types.d.ts
1601
+ interface WebhookContact {
1602
+ /**
1603
+ * WhatsApp ID of the contact. Business can respond to this contact using this ID.
1604
+ */
1605
+ wa_id: string;
1606
+ /**
1607
+ * Additional unique, alphanumeric identifier for a WhatsApp user
1608
+ */
1609
+ user_id?: string;
1610
+ /**
1611
+ * Profile of Whatsapp user
1612
+ */
1613
+ profile: {
1614
+ /**
1615
+ * The display name of the contact
1616
+ */
1617
+ name: string;
1618
+ };
1619
+ }
1620
+ /**
1621
+ * Base message interface with common properties
1622
+ */
1623
+ interface BaseMessage {
1624
+ id: string;
1625
+ from: string;
1626
+ timestamp: string;
1627
+ type: MessageTypesEnum;
1628
+ /**
1629
+ * Context object, included when a user replies or interacts
1630
+ */
1631
+ context?: {
1632
+ /**
1633
+ * ID of the message
1634
+ */
1635
+ id?: string;
1636
+ /**
1637
+ * ID of the sender
1638
+ */
1639
+ from?: string;
1640
+ /**
1641
+ * ID of the message being replied to or interacted with
1642
+ */
1643
+ message_id: string;
1644
+ /**
1645
+ * ID of the forwarded message, if applicable
1646
+ */
1647
+ forwarded?: boolean;
1648
+ /**
1649
+ * Frequently forwarded status
1650
+ */
1651
+ frequently_forwarded?: boolean;
1652
+ /**
1653
+ * Original message information if the message was referred
1654
+ */
1655
+ referred_product?: {
1656
+ /**
1657
+ * Catalog ID
1658
+ */
1659
+ catalog_id: string;
1660
+ /**
1661
+ * Product ID
1662
+ */
1663
+ product_retailer_id: string;
1664
+ };
1665
+ };
1666
+ /**
1667
+ * Errors array, if the message had errors
1668
+ */
1669
+ errors?: Array<{
1670
+ /**
1671
+ * Error code
1672
+ */
2666
1673
  code: number;
1674
+ /**
1675
+ * Error title
1676
+ */
1677
+ title: string;
1678
+ /**
1679
+ * Error message
1680
+ */
1681
+ message: string;
1682
+ /**
1683
+ * Error details object
1684
+ */
2667
1685
  error_data?: {
2668
- messaging_product: 'whatsapp';
1686
+ /**
1687
+ * Describes the error details
1688
+ */
2669
1689
  details: string;
2670
1690
  };
2671
- error_subcode?: number;
2672
- fbtrace_id: string;
2673
- };
2674
- }
2675
- /**
2676
- * Determines if the error is a Meta API error response
2677
- * @param error Any error object to check
2678
- * @returns Type guard indicating if error is a Meta API error
2679
- */
2680
- //#endregion
2681
- //#region src/api/flow/types/common.d.ts
2682
- /**
2683
- * Enum for Flow Status
2684
- */
2685
- declare enum FlowStatusEnum {
2686
- Draft = "DRAFT",
2687
- Published = "PUBLISHED",
2688
- Throttled = "THROTTLED",
2689
- Blocked = "BLOCKED",
2690
- Deprecated = "DEPRECATED",
1691
+ }>;
2691
1692
  }
2692
1693
  /**
2693
- * Enum for Flow Categories
1694
+ * Text message interface
2694
1695
  */
2695
- declare enum FlowCategoryEnum {
2696
- SignUp = "SIGN_UP",
2697
- SignIn = "SIGN_IN",
2698
- AppointmentBooking = "APPOINTMENT_BOOKING",
2699
- LeadGeneration = "LEAD_GENERATION",
2700
- ContactUs = "CONTACT_US",
2701
- CustomerSupport = "CUSTOMER_SUPPORT",
2702
- Survey = "SURVEY",
2703
- Other = "OTHER",
2704
- }
2705
- declare enum FlowActionEnum {
2706
- INIT = "INIT",
2707
- BACK = "BACK",
2708
- DATA_EXCHANGE = "data_exchange",
1696
+ interface TextMessage extends BaseMessage {
1697
+ type: MessageTypesEnum.Text;
1698
+ text: {
1699
+ /**
1700
+ * The text content of the message
1701
+ */
1702
+ body: string;
1703
+ preview_url?: boolean;
1704
+ };
2709
1705
  }
2710
1706
  /**
2711
- * Enum for Flow Types in webhook handlers
2712
- * Used to register handlers for specific flow events
1707
+ * Image message interface
2713
1708
  */
2714
- declare enum FlowTypeEnum {
2715
- /** Health check/ping requests */
2716
- Ping = "ping",
2717
- /** Data exchange requests */
2718
- Change = "data_exchange",
2719
- /** Error notification requests */
2720
- Error = "error",
2721
- /** Match all flow action types */
2722
- All = "*",
1709
+ interface ImageMessage extends BaseMessage {
1710
+ type: MessageTypesEnum.Image;
1711
+ image: {
1712
+ /**
1713
+ * The image caption (if provided)
1714
+ */
1715
+ caption?: string;
1716
+ /**
1717
+ * The SHA256 hash of the image
1718
+ */
1719
+ sha256?: string;
1720
+ /**
1721
+ * The ID for the image
1722
+ */
1723
+ id: string;
1724
+ /**
1725
+ * The MIME type of the image
1726
+ */
1727
+ mime_type: string;
1728
+ };
2723
1729
  }
2724
- type FlowType = (typeof FlowTypeEnum)[keyof typeof FlowTypeEnum];
2725
1730
  /**
2726
- * Flow Validation Error Pointer
1731
+ * Video message interface
2727
1732
  */
2728
- interface FlowValidationErrorPointer {
2729
- line_start: number;
2730
- line_end: number;
2731
- column_start: number;
2732
- column_end: number;
2733
- path: string;
1733
+ interface VideoMessage extends BaseMessage {
1734
+ type: MessageTypesEnum.Video;
1735
+ video: {
1736
+ /**
1737
+ * The video caption (if provided)
1738
+ */
1739
+ caption?: string;
1740
+ /**
1741
+ * The SHA256 hash of the video
1742
+ */
1743
+ sha256?: string;
1744
+ /**
1745
+ * The ID for the video
1746
+ */
1747
+ id: string;
1748
+ /**
1749
+ * The MIME type of the video
1750
+ */
1751
+ mime_type: string;
1752
+ };
2734
1753
  }
2735
1754
  /**
2736
- * Flow Validation Error
1755
+ * Audio message interface
2737
1756
  */
2738
- interface FlowValidationError {
2739
- error: string;
2740
- error_type: string;
2741
- message: string;
2742
- line_start: number;
2743
- line_end: number;
2744
- column_start: number;
2745
- column_end: number;
2746
- pointers: FlowValidationErrorPointer[];
1757
+ interface AudioMessage extends BaseMessage {
1758
+ type: MessageTypesEnum.Audio;
1759
+ audio: {
1760
+ /**
1761
+ * The ID for the audio file
1762
+ */
1763
+ id: string;
1764
+ /**
1765
+ * The MIME type of the audio file
1766
+ */
1767
+ mime_type: string;
1768
+ /**
1769
+ * Whether the audio is a voice message
1770
+ */
1771
+ voice?: boolean;
1772
+ };
2747
1773
  }
2748
1774
  /**
2749
- * Flow Item
1775
+ * Document message interface
2750
1776
  */
2751
- interface Flow {
2752
- id: string;
2753
- name: string;
2754
- status: FlowStatusEnum;
2755
- categories: FlowCategoryEnum[];
2756
- validation_errors: FlowValidationError[];
1777
+ interface DocumentMessage extends BaseMessage {
1778
+ type: MessageTypesEnum.Document;
1779
+ document: {
1780
+ /**
1781
+ * The document caption (if provided)
1782
+ */
1783
+ caption?: string;
1784
+ /**
1785
+ * The document filename
1786
+ */
1787
+ filename: string;
1788
+ /**
1789
+ * The SHA256 hash of the document
1790
+ */
1791
+ sha256?: string;
1792
+ /**
1793
+ * The ID for the document
1794
+ */
1795
+ id: string;
1796
+ /**
1797
+ * The MIME type of the document
1798
+ */
1799
+ mime_type: string;
1800
+ };
2757
1801
  }
2758
1802
  /**
2759
- * Pagination Cursors
1803
+ * Sticker message interface
2760
1804
  */
2761
- interface PaginationCursors {
2762
- before: string;
2763
- after: string;
1805
+ interface StickerMessage extends BaseMessage {
1806
+ type: MessageTypesEnum.Sticker;
1807
+ sticker: {
1808
+ /**
1809
+ * The ID for the sticker
1810
+ */
1811
+ id: string;
1812
+ /**
1813
+ * Whether this is an animated sticker
1814
+ */
1815
+ animated: boolean;
1816
+ /**
1817
+ * The MIME type of the sticker
1818
+ */
1819
+ mime_type: string;
1820
+ };
2764
1821
  }
2765
1822
  /**
2766
- * Pagination Object
1823
+ * Reaction message interface
2767
1824
  */
2768
- interface Pagination {
2769
- cursors: PaginationCursors;
1825
+ interface ReactionMessage extends BaseMessage {
1826
+ type: MessageTypesEnum.Reaction;
1827
+ reaction: {
1828
+ /**
1829
+ * The ID of the message being reacted to
1830
+ */
1831
+ message_id: string;
1832
+ /**
1833
+ * Emoji used for the reaction
1834
+ */
1835
+ emoji: string;
1836
+ };
2770
1837
  }
2771
1838
  /**
2772
- * Flows List Response
1839
+ * Contacts message interface
2773
1840
  */
2774
- interface FlowsListResponse {
2775
- data: Flow[];
2776
- paging: Pagination;
1841
+ interface ContactsMessage extends BaseMessage {
1842
+ type: MessageTypesEnum.Contacts;
1843
+ contacts: Array<{
1844
+ /**
1845
+ * The contact's name
1846
+ */
1847
+ name: {
1848
+ /**
1849
+ * The formatted name
1850
+ */
1851
+ formatted_name: string;
1852
+ /**
1853
+ * The first name
1854
+ */
1855
+ first_name?: string;
1856
+ /**
1857
+ * The last name
1858
+ */
1859
+ last_name?: string;
1860
+ /**
1861
+ * The middle name
1862
+ */
1863
+ middle_name?: string;
1864
+ /**
1865
+ * The suffix
1866
+ */
1867
+ suffix?: string;
1868
+ /**
1869
+ * The prefix
1870
+ */
1871
+ prefix?: string;
1872
+ };
1873
+ /**
1874
+ * The contact's phone numbers
1875
+ */
1876
+ phones?: Array<{
1877
+ phone: string;
1878
+ type?: string;
1879
+ wa_id?: string;
1880
+ }>;
1881
+ /**
1882
+ * The contact's emails
1883
+ */
1884
+ emails?: Array<{
1885
+ email: string;
1886
+ type?: string;
1887
+ }>;
1888
+ /**
1889
+ * The contact's addresses
1890
+ */
1891
+ addresses?: Array<{
1892
+ street?: string;
1893
+ city?: string;
1894
+ state?: string;
1895
+ zip?: string;
1896
+ country?: string;
1897
+ country_code?: string;
1898
+ type?: string;
1899
+ }>;
1900
+ /**
1901
+ * The contact's organizations
1902
+ */
1903
+ org?: {
1904
+ company?: string;
1905
+ department?: string;
1906
+ title?: string;
1907
+ };
1908
+ /**
1909
+ * The contact's URLs
1910
+ */
1911
+ urls?: Array<{
1912
+ url: string;
1913
+ type?: string;
1914
+ }>;
1915
+ /**
1916
+ * The contact's birthday (YYYY-MM-DD format)
1917
+ */
1918
+ birthday?: string;
1919
+ }>;
2777
1920
  }
2778
1921
  /**
2779
- * Flow Asset
1922
+ * Location message interface
2780
1923
  */
2781
- interface FlowAsset {
2782
- name: string;
2783
- asset_type: string;
2784
- download_url: string;
1924
+ interface LocationMessage extends BaseMessage {
1925
+ type: MessageTypesEnum.Location;
1926
+ location: {
1927
+ /**
1928
+ * Latitude of the location
1929
+ */
1930
+ latitude: number;
1931
+ /**
1932
+ * Longitude of the location
1933
+ */
1934
+ longitude: number;
1935
+ /**
1936
+ * Name of the location
1937
+ */
1938
+ name?: string;
1939
+ /**
1940
+ * Address of the location
1941
+ */
1942
+ address?: string;
1943
+ };
2785
1944
  }
2786
1945
  /**
2787
- * Flow Assets Response
1946
+ * Interactive message interface
2788
1947
  */
2789
- interface FlowAssetsResponse {
2790
- data: FlowAsset[];
2791
- paging: Pagination;
1948
+ interface InteractiveMessage extends BaseMessage {
1949
+ type: MessageTypesEnum.Interactive;
1950
+ interactive: {
1951
+ /**
1952
+ * Type of the interactive message
1953
+ * Can be: button_reply, list_reply, flow, nfm_reply, etc.
1954
+ */
1955
+ type: string;
1956
+ /**
1957
+ * ID for the button that was clicked
1958
+ */
1959
+ button_reply?: {
1960
+ id: string;
1961
+ title: string;
1962
+ };
1963
+ /**
1964
+ * ID for the list item that was selected
1965
+ */
1966
+ list_reply?: {
1967
+ id: string;
1968
+ title: string;
1969
+ description?: string;
1970
+ };
1971
+ /**
1972
+ * NFM (No-Code Flow Message) reply data
1973
+ */
1974
+ nfm_reply?: {
1975
+ /**
1976
+ * Response data in JSON format
1977
+ */
1978
+ response_json: string;
1979
+ /**
1980
+ * Body text of the reply
1981
+ */
1982
+ body: string;
1983
+ /**
1984
+ * Name of the flow
1985
+ */
1986
+ name: string;
1987
+ };
1988
+ };
2792
1989
  }
2793
1990
  /**
2794
- * Flow Preview
1991
+ * System message interface
2795
1992
  */
2796
- interface FlowPreview {
2797
- preview_url: string;
2798
- expires_at: string;
1993
+ interface SystemMessage extends BaseMessage {
1994
+ type: MessageTypesEnum.System;
1995
+ system: {
1996
+ /**
1997
+ * The type of system update
1998
+ */
1999
+ type: string;
2000
+ /**
2001
+ * User's identity if the update is a customer identity change
2002
+ */
2003
+ identity?: string;
2004
+ /**
2005
+ * Old and new phone numbers if the update is a phone number change
2006
+ */
2007
+ customer?: {
2008
+ /**
2009
+ * The previous phone number
2010
+ */
2011
+ previous_wa_id: string;
2012
+ /**
2013
+ * The new phone number
2014
+ */
2015
+ wa_id: string;
2016
+ };
2017
+ };
2799
2018
  }
2800
2019
  /**
2801
- * Flow Preview Response
2020
+ * Order message interface
2802
2021
  */
2803
- interface FlowPreviewResponse {
2804
- preview: FlowPreview;
2805
- id: string;
2022
+ interface OrderMessage extends BaseMessage {
2023
+ type: MessageTypesEnum.Order;
2024
+ order: {
2025
+ /**
2026
+ * Catalog ID
2027
+ */
2028
+ catalog_id: string;
2029
+ /**
2030
+ * Product items in the order
2031
+ */
2032
+ product_items: Array<{
2033
+ /**
2034
+ * Product ID
2035
+ */
2036
+ product_retailer_id: string;
2037
+ /**
2038
+ * Quantity of the product
2039
+ */
2040
+ quantity: number;
2041
+ /**
2042
+ * Item price
2043
+ */
2044
+ item_price: number;
2045
+ /**
2046
+ * Currency code
2047
+ */
2048
+ currency: string;
2049
+ }>;
2050
+ /**
2051
+ * Text message included with the order
2052
+ */
2053
+ text?: string;
2054
+ };
2806
2055
  }
2807
2056
  /**
2808
- * Flow Migration Result
2057
+ * Button message interface
2809
2058
  */
2810
- interface FlowMigrationResult {
2811
- source_name: string;
2812
- source_id: string;
2813
- migrated_id: string;
2059
+ interface ButtonMessage extends BaseMessage {
2060
+ type: MessageTypesEnum.Button;
2061
+ button: {
2062
+ /**
2063
+ * The payload for the button
2064
+ */
2065
+ payload: string;
2066
+ /**
2067
+ * Button text
2068
+ */
2069
+ text: string;
2070
+ };
2814
2071
  }
2815
2072
  /**
2816
- * Flow Migration Failure
2817
- */
2818
- interface FlowMigrationFailure {
2819
- source_name: string;
2820
- error_code: string;
2821
- error_message: string;
2822
- }
2073
+ * Union type for all message types
2074
+ */
2075
+
2823
2076
  /**
2824
- * Create Flow Response
2077
+ * Represents a message received through the webhook
2078
+ * Based on Meta's documentation: https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/components#messages-object
2825
2079
  */
2826
- interface CreateFlowResponse {
2080
+ interface WebhookMessage {
2081
+ /**
2082
+ * The WhatsApp Business Account ID
2083
+ */
2084
+ wabaId: string;
2085
+ /**
2086
+ * The message ID
2087
+ */
2827
2088
  id: string;
2828
- success: boolean;
2829
- validation_errors?: FlowValidationError[];
2089
+ /**
2090
+ * The sender's phone number
2091
+ */
2092
+ from: string;
2093
+ /**
2094
+ * The timestamp of the message
2095
+ */
2096
+ timestamp: string;
2097
+ /**
2098
+ * The type of message (text, image, etc.)
2099
+ */
2100
+ type: MessageTypesEnum;
2101
+ /**
2102
+ * The phone number ID that received the message
2103
+ */
2104
+ phoneNumberId: string;
2105
+ /**
2106
+ * The display phone number that received the message
2107
+ */
2108
+ displayPhoneNumber: string;
2109
+ /**
2110
+ * The profile name of the sender
2111
+ */
2112
+ profileName: string;
2113
+ text?: TextMessage['text'];
2114
+ image?: ImageMessage['image'];
2115
+ video?: VideoMessage['video'];
2116
+ audio?: AudioMessage['audio'];
2117
+ document?: DocumentMessage['document'];
2118
+ sticker?: StickerMessage['sticker'];
2119
+ location?: LocationMessage['location'];
2120
+ contacts?: ContactsMessage['contacts'];
2121
+ interactive?: InteractiveMessage['interactive'];
2122
+ button?: ButtonMessage['button'];
2123
+ order?: OrderMessage['order'];
2124
+ system?: SystemMessage['system'];
2125
+ reaction?: ReactionMessage['reaction'];
2126
+ statuses?: {
2127
+ /**
2128
+ * Arbitrary string included in sent message
2129
+ */
2130
+ biz_opaque_callback_data?: string;
2131
+ /**
2132
+ * Information about the conversation
2133
+ */
2134
+ conversation?: {
2135
+ /**
2136
+ * Represents the ID of the conversation the given status notification belongs to
2137
+ */
2138
+ id: string;
2139
+ /**
2140
+ * Describes conversation category
2141
+ */
2142
+ origin: {
2143
+ /**
2144
+ * Indicates conversation category. This can also be referred to as a conversation entry point
2145
+ * - authentication: Conversation opened by business sending template categorized as AUTHENTICATION
2146
+ * - marketing: Conversation opened by business sending template categorized as MARKETING
2147
+ * - utility: Conversation opened by business sending template categorized as UTILITY
2148
+ * - service: Conversation opened by business replying to customer within service window
2149
+ * - referral_conversion: Free entry point conversation
2150
+ */
2151
+ type: 'authentication' | 'marketing' | 'utility' | 'service' | 'referral_conversion';
2152
+ };
2153
+ /**
2154
+ * Date when the conversation expires. Only present for messages with status 'sent'
2155
+ */
2156
+ expiration_timestamp?: string;
2157
+ };
2158
+ /**
2159
+ * Array of error objects describing the error
2160
+ */
2161
+ errors?: Array<{
2162
+ /**
2163
+ * Error code
2164
+ */
2165
+ code: number;
2166
+ /**
2167
+ * Error code title
2168
+ */
2169
+ title: string;
2170
+ /**
2171
+ * Error code message
2172
+ */
2173
+ message: string;
2174
+ /**
2175
+ * Error details object
2176
+ */
2177
+ error_data?: {
2178
+ /**
2179
+ * Describes the error details
2180
+ */
2181
+ details: string;
2182
+ };
2183
+ }>;
2184
+ /**
2185
+ * The ID for the message that the business sent to a customer
2186
+ */
2187
+ id: string;
2188
+ /**
2189
+ * Pricing information for the message/conversation
2190
+ */
2191
+ pricing?: {
2192
+ /**
2193
+ * Indicates if the given message or conversation is billable
2194
+ * @deprecated This field is deprecated. Visit the WhatsApp Changelog for more information.
2195
+ */
2196
+ billable?: boolean;
2197
+ /**
2198
+ * Indicates the conversation category:
2199
+ * - authentication: Authentication conversation
2200
+ * - authentication_international: Authentication-international conversation
2201
+ * - marketing: Marketing conversation
2202
+ * - utility: Utility conversation
2203
+ * - service: Service conversation
2204
+ * - referral_conversion: Free entry point conversation
2205
+ */
2206
+ category: 'authentication' | 'authentication_international' | 'marketing' | 'utility' | 'service' | 'referral_conversion';
2207
+ /**
2208
+ * Type of pricing model used by the business. Current supported value is CBP
2209
+ */
2210
+ pricing_model: 'CBP';
2211
+ };
2212
+ /**
2213
+ * The customer's WhatsApp ID. Business can respond to customer using this ID.
2214
+ * This ID may not match the customer's phone number.
2215
+ */
2216
+ recipient_id: string;
2217
+ /**
2218
+ * Status of the message:
2219
+ * - delivered: Message has been delivered
2220
+ * - read: Message has been read by the customer
2221
+ * - sent: Message has been sent to the customer
2222
+ */
2223
+ status: 'delivered' | 'read' | 'sent';
2224
+ /**
2225
+ * Unix timestamp for the status message
2226
+ */
2227
+ timestamp: string;
2228
+ };
2229
+ /**
2230
+ * The original message data as received from the webhook
2231
+ */
2232
+ originalData: any;
2830
2233
  }
2831
2234
  /**
2832
- * Update Flow Response
2235
+ * Webhook event received from WhatsApp
2833
2236
  */
2834
- interface UpdateFlowResponse {
2835
- success: boolean;
2836
- validation_errors?: FlowValidationError[];
2237
+ interface WebhookEvent {
2238
+ /**
2239
+ * The field type of the event
2240
+ */
2241
+ field: string;
2242
+ /**
2243
+ * The event data
2244
+ */
2245
+ value: any;
2246
+ /**
2247
+ * The timestamp when the event was received
2248
+ */
2249
+ timestamp: number;
2837
2250
  }
2838
2251
  /**
2839
- * Flow Migration Response
2252
+ * Message status enum
2840
2253
  */
2841
- interface FlowMigrationResponse {
2842
- migrated_flows: FlowMigrationResult[];
2843
- failed_flows: FlowMigrationFailure[];
2254
+ //#endregion
2255
+ //#region src/api/qrCode/types/common.d.ts
2256
+ type QrCodeResponse = {
2257
+ code: string;
2258
+ prefilled_message: string;
2259
+ deep_link_url: string;
2260
+ qr_image_url?: string;
2261
+ };
2262
+ type QrCodesResponse = ResponseData<QrCodeResponse[]>;
2263
+ type CreateQrCodeRequest = {
2264
+ prefilled_message: string;
2265
+ generate_qr_image?: 'SVG' | 'PNG';
2266
+ };
2267
+ type UpdateQrCodeRequest = {
2268
+ code: string;
2269
+ prefilled_message: string;
2270
+ };
2271
+ interface QrCodeClass {
2272
+ createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
2273
+ getQrCodes(): Promise<QrCodesResponse>;
2274
+ getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
2275
+ updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
2276
+ deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
2844
2277
  }
2278
+ //#endregion
2279
+ //#region src/api/waba/types/common.d.ts
2845
2280
  /**
2846
- * Validate Flow JSON Response
2281
+ * WhatsApp Business Account subscription configuration
2847
2282
  */
2848
- interface ValidateFlowJsonResponse {
2849
- valid: boolean;
2850
- success: boolean;
2851
- validation_errors?: FlowValidationError[];
2283
+ type WabaSubscription = {
2284
+ whatsapp_business_api_data: {
2285
+ id: string;
2286
+ link: string;
2287
+ name: string;
2288
+ category: string;
2289
+ };
2290
+ override_callback_uri?: string;
2291
+ };
2292
+ /**
2293
+ * Parameters for updating WABA subscription
2294
+ */
2295
+ interface UpdateWabaSubscription {
2296
+ override_callback_uri: string;
2297
+ verify_token: string;
2852
2298
  }
2853
2299
  /**
2854
- * WhatsApp Flow Endpoint - Encrypted Request Payload
2855
- * Represents the raw encrypted data received from WhatsApp
2300
+ * Response containing all WABA subscriptions
2856
2301
  */
2857
- interface FlowEncryptedRequestPayload {
2858
- encrypted_aes_key: string;
2859
- encrypted_flow_data: string;
2860
- initial_vector: string;
2302
+ interface WabaSubscriptions {
2303
+ data: Array<WabaSubscription>;
2861
2304
  }
2862
2305
  /**
2863
- * WhatsApp Flow Endpoint - Decrypted Request Response
2864
- * Represents the successfully decrypted data and encryption keys
2306
+ * WABA account review status enumeration
2865
2307
  */
2866
- interface FlowDecryptedRequestResponse {
2867
- decryptedBody: any;
2868
- aesKeyBuffer: Buffer;
2869
- initialVectorBuffer: Buffer;
2308
+ declare enum WabaAccountReviewStatus {
2309
+ Approved = "APPROVED",
2310
+ Active = "ACTIVE",
2311
+ Inactive = "INACTIVE",
2312
+ Disabled = "DISABLED",
2870
2313
  }
2871
2314
  /**
2872
- * WhatsApp Flow Endpoint - HTTP Request with Body
2873
- * Represents an HTTP request with the encrypted payload
2315
+ * WABA health status for message sending capability
2874
2316
  */
2875
- interface FlowHttpRequest extends IncomingMessage {
2876
- body: FlowEncryptedRequestPayload;
2877
- headers: IncomingHttpHeaders;
2317
+ declare enum WabaHealthStatusCanSendMessage {
2318
+ Blocked = "BLOCKED",
2319
+ Limited = "LIMITED",
2320
+ Available = "AVAILABLE",
2878
2321
  }
2879
2322
  /**
2880
- * WhatsApp Flow Endpoint - Health Check Request
2881
- * Represents the structure of a health check request
2323
+ * WABA account status enumeration
2882
2324
  */
2883
- interface FlowHealthCheckRequest {
2884
- action: 'ping';
2885
- version: '3.0';
2325
+ declare enum WabaAccountStatus {
2326
+ Approved = "APPROVED",
2327
+ Active = "ACTIVE",
2328
+ Inactive = "INACTIVE",
2329
+ Disabled = "DISABLED",
2886
2330
  }
2887
2331
  /**
2888
- * WhatsApp Flow Endpoint - Health Check Response
2889
- * The expected response structure for health check requests
2332
+ * Business verification status enumeration
2890
2333
  */
2891
- interface FlowHealthCheckResponse {
2892
- data: {
2893
- status: 'active';
2894
- };
2334
+ declare enum WabaBusinessVerificationStatus {
2335
+ Verified = "verified",
2336
+ PendingSubmission = "pending_submission",
2337
+ Unverified = "unverified",
2338
+ Rejected = "rejected",
2895
2339
  }
2896
2340
  /**
2897
- * WhatsApp Flow Endpoint - Data Exchange Request
2898
- * Represents the structure of a data exchange request
2341
+ * WABA health status error details
2899
2342
  */
2900
- interface FlowDataExchangeRequest {
2901
- version: '3.0';
2902
- action: FlowActionEnum;
2903
- screen: string;
2904
- flow_token: string;
2905
- data?: Record<string, any> & {
2906
- error_message?: string;
2907
- };
2343
+ interface WabaHealthStatusError {
2344
+ error_code?: number;
2345
+ error_description?: string;
2346
+ possible_solution?: string;
2908
2347
  }
2909
2348
  /**
2910
- * WhatsApp Flow Endpoint - Data Exchange Response
2911
- * The expected response structure for data exchange requests
2349
+ * WABA health status entity information
2912
2350
  */
2913
- interface FlowDataExchangeResponse {
2914
- screen?: string;
2915
- data?: Record<string, any | {
2916
- error_message?: string;
2917
- }>;
2351
+ interface WabaHealthStatusEntity {
2352
+ entity_type?: string;
2353
+ id?: string;
2354
+ can_send_message?: string;
2355
+ errors?: WabaHealthStatusError[];
2918
2356
  }
2919
2357
  /**
2920
- * WhatsApp Flow Endpoint - Success Screen Response
2921
- * The expected response structure for success screen requests
2358
+ * Overall WABA health status
2922
2359
  */
2923
- interface FlowSuccessScreenResponse {
2924
- screen: 'SUCCESS';
2925
- data: {
2926
- extension_message_response?: {
2927
- params?: {
2928
- flow_token: string;
2929
- [key: string]: string;
2930
- };
2931
- };
2932
- };
2360
+ interface WabaHealthStatus {
2361
+ can_send_message?: WabaHealthStatusCanSendMessage;
2362
+ entities?: WabaHealthStatusEntity[];
2933
2363
  }
2934
2364
  /**
2935
- * WhatsApp Flow Endpoint - Error Notification Request
2936
- * Represents the structure of an error notification request
2365
+ * WhatsApp Business Account information
2937
2366
  */
2938
- interface FlowErrorNotificationRequest {
2939
- version: '3.0';
2940
- action: Exclude<FlowActionEnum, FlowActionEnum.BACK>;
2941
- screen: string;
2942
- flow_token: string;
2943
- data: {
2944
- error: string;
2945
- error_message: string;
2946
- };
2367
+ interface WabaAccount {
2368
+ account_review_status?: WabaAccountReviewStatus;
2369
+ id?: string;
2370
+ health_status?: WabaHealthStatus;
2371
+ status?: WabaAccountStatus;
2372
+ business_verification_status?: WabaBusinessVerificationStatus;
2373
+ message_template_namespace?: string;
2374
+ name?: string;
2375
+ ownership_type?: string;
2376
+ currency?: string;
2947
2377
  }
2948
2378
  /**
2949
- * WhatsApp Flow Endpoint - Error Notification Response
2950
- * The expected response structure for error notification requests
2379
+ * Available fields for WABA account queries
2951
2380
  */
2952
- interface FlowErrorNotificationResponse {
2953
- acknowledged: boolean;
2954
- }
2381
+ type WabaAccountFields = 'id' | 'name' | 'account_review_status' | 'auth_international_rate_eligibility' | 'business_verification_status' | 'country' | 'currency' | 'health_status' | 'status' | 'ownership_type' | 'message_template_namespace';
2955
2382
  /**
2956
- * WhatsApp Flow Endpoint - Comprehensive Request Object
2957
- * A combined type that includes all possible fields from different request types
2958
- * with all fields being optional for flexibility
2383
+ * Parameter type for specifying which WABA account fields to retrieve
2959
2384
  */
2960
- interface FlowEndpointRequest {
2961
- version?: '3.0';
2962
- action?: 'ping' | FlowActionEnum;
2963
- screen?: string;
2964
- flow_token?: string;
2965
- data?: Record<string, any> & {
2966
- error_key?: string;
2967
- error_message?: string;
2385
+ type WabaAccountFieldsParam = WabaAccountFields[];
2386
+ /**
2387
+ * Interface defining all WABA API methods
2388
+ */
2389
+ interface WABAClass {
2390
+ getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
2391
+ getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
2392
+ updateWabaSubscription(params: UpdateWabaSubscription): Promise<ResponseSuccess>;
2393
+ unsubscribeFromWaba(): Promise<ResponseSuccess>;
2394
+ }
2395
+ //#endregion
2396
+ //#region src/api/registration/types/common.d.ts
2397
+ type RegistrationRequest = {
2398
+ messaging_product: 'whatsapp';
2399
+ pin: string;
2400
+ data_localization_region?: DataLocalizationRegionEnum;
2401
+ };
2402
+ interface RegistrationClass {
2403
+ register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess>;
2404
+ deregister(): Promise<ResponseSuccess>;
2405
+ }
2406
+ //#endregion
2407
+ //#region src/api/twoStepVerification/types/common.d.ts
2408
+ type TwoStepVerificationRequest = {
2409
+ pin: string;
2410
+ };
2411
+ interface TwoStepVerificationClass {
2412
+ setTwoStepVerificationCode(pin: string): Promise<ResponseSuccess>;
2413
+ }
2414
+ //#endregion
2415
+ //#region src/api/encryption/types/publicKey.d.ts
2416
+ type EncryptionPublicKeyResponse = ResponseData<{
2417
+ business_public_key: string;
2418
+ business_public_key_signature_status: 'VALID' | 'MISMATCH';
2419
+ }>;
2420
+ //#endregion
2421
+ //#region src/utils/isMetaError.d.ts
2422
+ interface MetaError extends Error {
2423
+ error: {
2424
+ message: string;
2425
+ type: string;
2426
+ code: number;
2427
+ error_data?: {
2428
+ messaging_product: 'whatsapp';
2429
+ details: string;
2430
+ };
2431
+ error_subcode?: number;
2432
+ fbtrace_id: string;
2968
2433
  };
2969
2434
  }
2970
2435
  /**
2971
- * WhatsApp Flow Endpoint - Response
2972
- * Union type for all possible response types from a Flow endpoint
2436
+ * Determines if the error is a Meta API error response
2437
+ * @param error Any error object to check
2438
+ * @returns Type guard indicating if error is a Meta API error
2973
2439
  */
2974
- type FlowEndpointResponse = FlowHealthCheckResponse | FlowDataExchangeResponse | FlowErrorNotificationResponse | FlowSuccessScreenResponse;
2975
- interface FlowClass {
2976
- /**
2977
- * List Flows
2978
- *
2979
- * @param wabaId - The WABA ID
2980
- * @returns Promise with the list of flows
2981
- */
2982
- listFlows(wabaId: string): Promise<FlowsListResponse>;
2983
- /**
2984
- * Create Flow
2985
- *
2986
- * @param wabaId - The WABA ID
2987
- * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
2988
- * @returns Promise with the created flow ID
2989
- */
2990
- createFlow(wabaId: string, data: {
2991
- name: string;
2992
- categories?: FlowCategoryEnum[];
2993
- endpoint_uri?: string;
2994
- clone_flow_id?: string;
2995
- flow_json?: string;
2996
- publish?: boolean;
2997
- }): Promise<CreateFlowResponse>;
2998
- /**
2999
- * Get Flow
3000
- *
3001
- * @param flowId - The flow ID
3002
- * @param fields - Optional fields to return
3003
- * @param dateFormat - Optional date format
3004
- * @returns Promise with the flow details
3005
- */
3006
- getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
3007
- /**
3008
- * Update Flow Metadata
3009
- *
3010
- * @param flowId - The flow ID
3011
- * @param data - The flow metadata to update
3012
- * @returns Promise with the success status
3013
- */
3014
- updateFlowMetadata(flowId: string, data: {
3015
- name?: string;
3016
- categories?: FlowCategoryEnum[];
3017
- endpoint_uri?: string;
3018
- application_id?: string;
3019
- }): Promise<ResponseSuccess>;
3020
- /**
3021
- * Delete Flow
3022
- *
3023
- * @param flowId - The flow ID
3024
- * @returns Promise with the success status
3025
- */
3026
- deleteFlow(flowId: string): Promise<ResponseSuccess>;
3027
- /**
3028
- * List Assets (Get Flow JSON URL)
3029
- *
3030
- * @param flowId - The flow ID
3031
- * @returns Promise with the list of assets
3032
- */
3033
- listAssets(flowId: string): Promise<FlowAssetsResponse>;
3034
- /**
3035
- * Update Flow JSON
3036
- *
3037
- * @param flowId - The flow ID
3038
- * @param data - The asset data including asset_type, file, and name
3039
- * @returns Promise with the success status and validation errors
3040
- */
3041
- updateFlowJson(flowId: string, data: {
3042
- file: Blob | Buffer | object;
3043
- name?: string;
3044
- }): Promise<UpdateFlowResponse>;
3045
- /**
3046
- * Validate Flow JSON by attempting an update without publishing.
3047
- * This is a convenience method; the API doesn't have a dedicated validation endpoint.
3048
- *
3049
- * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).
3050
- * @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.
3051
- * @returns Promise indicating if the JSON is valid and includes validation errors if any.
3052
- */
3053
- validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
3054
- /**
3055
- * Publish Flow
3056
- *
3057
- * @param flowId - The flow ID
3058
- * @returns Promise with the success status
3059
- */
3060
- publishFlow(flowId: string): Promise<ResponseSuccess>;
3061
- /**
3062
- * Deprecate Flow
3063
- *
3064
- * @param flowId - The flow ID
3065
- * @returns Promise with the success status
3066
- */
3067
- deprecateFlow(flowId: string): Promise<ResponseSuccess>;
3068
- /**
3069
- * Migrate Flows
3070
- *
3071
- * @param wabaId - The destination WABA ID
3072
- * @param data - The migration data including source_waba_id and optional source_flow_names
3073
- * @returns Promise with migration results
3074
- */
3075
- migrateFlows(wabaId: string, data: {
3076
- source_waba_id: string;
3077
- source_flow_names?: string[];
3078
- }): Promise<FlowMigrationResponse>;
3079
- }
2440
+
3080
2441
  //#endregion
3081
- export { type AccountMode, type AudioMediaObject, AudioMediaTypesEnum, type AuthenticationTemplateOptions, type BaseClass, type BodyOptions, 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, type Flow, FlowActionEnum, 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 HttpsClientClass, type HttpsClientResponseClass, type ImageMediaObject, ImageMediaTypesEnum, type InteractiveObject, InteractiveTypesEnum, LanguagesEnum, type LimitedTimeOfferOptions, type LimitedTimeOfferTemplateOptions, type LocationObject, type LocationParameter, type LoggerInterface, type MPMButton, type MPMTemplateOptions, type MediaCardCarouselTemplateOptions, type MediaCarouselCard, type MediaClass, type MediaParameter, type MediaResponse, type MediasResponse, type MessageRequestBody, type MessageRequestParams, type MessageTemplateObject, MessageTypesEnum, type MessagesClass, type MessagesResponse, type MessagingLimitTier, type MetaError, type OTPButton, type OTPTemplateOptions, type Pagination, type PaginationCursors, type Paging, ParametersTypesEnum, type PhoneNumberButton, type PhoneNumberClass, type PhoneNumberResponse, type PhoneNumbersResponse, type PlatformType, type ProductCardCarouselTemplateOptions, type ProductCarouselCard, type ProductParameter, type ProductSection, type QrCodeClass, type QrCodeResponse, type QrCodesResponse, type QualityRating, type QualityScore, type QuickReplyButton, type ReactionParams, ReferralSourceTypesEnum, 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, 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, type TwoStepVerificationParams, 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, WabaBusinessVerificationStatus, WabaConfigEnum, type WabaConfigType, type WabaHealthStatus, WabaHealthStatusCanSendMessage, type WabaHealthStatusEntity, type WabaHealthStatusError, type WabaSubscription, type WabaSubscriptions, type WebhookContact, type WebhookEvent, type WebhookMessage, WebhookTypesEnum, type WhatsAppConfig };
3082
- //# sourceMappingURL=types.d.ts.map
2442
+ export { type AccountMode, type AudioMediaObject, type AuthenticationTemplateOptions, type BaseClass, type BodyOptions, type BusinessProfileClass, type BusinessProfileData, type BusinessProfileField, type BusinessProfileFieldsParam, type BusinessProfileResponse, type ButtonOptions, type CarouselCard, type CarouselOptions, type CatalogButton, type CatalogTemplateOptions, type CodeVerificationStatus, type ComponentTypes, type ContactObject, type CopyCodeButton, type CouponTemplateOptions, CreateFlowResponse, type CreateQrCodeRequest, type CurrencyParameter, type Cursors, type DateTimeParameter, type DocumentMediaObject, type EncryptionPublicKeyResponse, type Flow, FlowActionEnum, 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, type HttpsClientClass, type HttpsClientResponseClass, type ImageMediaObject, type InteractiveObject, type LimitedTimeOfferOptions, type LimitedTimeOfferTemplateOptions, type LocationObject, type LocationParameter, type LoggerInterface, type MPMButton, type MPMTemplateOptions, type MediaCardCarouselTemplateOptions, type MediaCarouselCard, MediaClass, type MediaParameter, MediaResponse, MediasResponse, type MessageRequestBody, type MessageRequestParams, type MessageTemplateObject, type MessagesClass, type MessagesResponse, type MessagingLimitTier, type MetaError, type OTPButton, type OTPTemplateOptions, type Pagination, type PaginationCursors, type Paging, type PhoneNumberButton, type PhoneNumberClass, type PhoneNumberResponse, type PhoneNumbersResponse, type PlatformType, type ProductCardCarouselTemplateOptions, type ProductCarouselCard, type ProductParameter, type ProductSection, type QrCodeClass, type QrCodeResponse, type QrCodesResponse, type QualityRating, type QualityScore, type QuickReplyButton, type ReactionParams, type RegistrationClass, type RegistrationRequest, type RequestVerificationCodeRequest, type RequesterClass, type RequesterResponseInterface, type ResponseData, type ResponseHeaderValue, type ResponseHeaders, type ResponseJSONBody, type ResponsePagination, type ResponseSuccess, type SPMButton, type SPMTemplateOptions, type StatusParams, type StickerMediaObject, 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, type TextMessageParams, type TextObject, type TextParameter, type Throughput, type ThroughputLevel, type TwoStepVerificationClass, type TwoStepVerificationParams, type TwoStepVerificationRequest, type URLButton, type UpdateBusinessProfileRequest, type UpdateFlowResponse, type UpdateQrCodeRequest, type UpdateWabaSubscription, UploadMediaResponse, type ValidateFlowJsonResponse, type VerifyCodeRequest, type VideoMediaObject, type WABAClass, type WabaAccount, type WabaAccountFields, type WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaBusinessVerificationStatus, type WabaConfigType, type WabaHealthStatus, WabaHealthStatusCanSendMessage, type WabaHealthStatusEntity, type WabaHealthStatusError, type WabaSubscription, type WabaSubscriptions, type WebhookContact, type WebhookEvent, type WebhookMessage, type WhatsAppConfig };
2443
+ //# sourceMappingURL=index.d.ts.map