meta-cloud-api 1.1.7 → 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,674 +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 namespace enums_d_exports {
5
- 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 };
6
- }
7
- declare enum CategoryEnum {
8
- Authentication = "AUTHENTICATION",
9
- Marketing = "MARKETING",
10
- Utility = "UTILITY",
11
- }
12
- declare enum TemplateStatusEnum {
13
- Approved = "APPROVED",
14
- Pending = "PENDING",
15
- Rejected = "REJECTED",
16
- }
17
- declare enum HttpMethodsEnum {
18
- Get = "GET",
19
- Post = "POST",
20
- Put = "PUT",
21
- Delete = "DELETE",
22
- }
23
- declare enum MessageTypesEnum {
24
- Audio = "audio",
25
- Contacts = "contacts",
26
- Document = "document",
27
- Image = "image",
28
- Interactive = "interactive",
29
- Location = "location",
30
- Reaction = "reaction",
31
- Sticker = "sticker",
32
- Template = "template",
33
- Text = "text",
34
- Video = "video",
35
- Button = "button",
36
- Order = "order",
37
- System = "system",
38
- Unknown = "unknown",
39
- Statuses = "statuses",
40
- '*' = "*",
41
- }
42
- declare enum ParametersTypesEnum {
43
- Action = "ACTION",
44
- CouponCode = "COUPON_CODE",
45
- Currency = "CURRENCY",
46
- DateTime = "DATE_TIME",
47
- Document = "DOCUMENT",
48
- ExpirationTimeMs = "EXPIRATION_TIME_MS",
49
- Image = "IMAGE",
50
- LimitedTimeOffer = "LIMITED_TIME_OFFER",
51
- Location = "LOCATION",
52
- OrderStatus = "ORDER_STATUS",
53
- Payload = "PAYLOAD",
54
- Product = "PRODUCT",
55
- Text = "TEXT",
56
- TtlMinutes = "TTL_MINUTES",
57
- Video = "VIDEO",
58
- WebviewInteraction = "WEBVIEW_INTERACTION",
59
- WebviewPresentation = "WEBVIEW_PRESENTATION",
60
- }
61
- declare enum InteractiveTypesEnum {
62
- Button = "button",
63
- List = "list",
64
- Product = "product",
65
- ProductList = "product_list",
66
- CtaUrl = "cta_url",
67
- LocationRequest = "location_request_message",
68
- AddressMessage = "address_message",
69
- Flow = "flow",
70
- }
71
- declare enum ButtonPositionEnum {
72
- First = 1,
73
- Second = 2,
74
- Third = 3,
75
- Fourth = 4,
76
- Fifth = 5,
77
- }
78
- declare enum SubTypeEnum {
79
- Catalog = "CATALOG",
80
- CopyCode = "COPY_CODE",
81
- Flow = "FLOW",
82
- Mpm = "MPM",
83
- OrderDetails = "ORDER_DETAILS",
84
- QuickReply = "QUICK_REPLY",
85
- Reminder = "REMINDER",
86
- Url = "URL",
87
- VoiceCall = "VOICE_CALL",
88
- }
89
- declare enum ComponentTypesEnum {
90
- Header = "HEADER",
91
- Body = "BODY",
92
- Button = "BUTTON",
93
- Footer = "FOOTER",
94
- }
95
- declare enum WabaConfigEnum {
96
- AppId = "M4D_APP_ID",
97
- Port = "WA_PORT",
98
- AppSecret = "M4D_APP_SECRET",
99
- PhoneNumberId = "WA_PHONE_NUMBER_ID",
100
- BusinessAcctId = "WA_BUSINESS_ACCOUNT_ID",
101
- APIVersion = "CLOUD_API_VERSION",
102
- AccessToken = "CLOUD_API_ACCESS_TOKEN",
103
- WebhookEndpoint = "WEBHOOK_ENDPOINT",
104
- WebhookVerificationToken = "WEBHOOK_VERIFICATION_TOKEN",
105
- ListenerPort = "LISTENER_PORT",
106
- MaxRetriesAfterWait = "MAX_RETRIES_AFTER_WAIT",
107
- RequestTimeout = "REQUEST_TIMEOUT",
108
- Debug = "DEBUG",
109
- PrivatePem = "FLOW_API_PRIVATE_PEM",
110
- Passphrase = "FLOW_API_PASSPHRASE",
111
- }
112
- declare enum ConversationTypesEnum {
113
- BusinessInitiated = "business_initiated",
114
- CustomerInitiated = "customer_initiated",
115
- ReferralConversion = "referral_conversion",
116
- }
117
- declare enum StatusEnum {
118
- Delivered = "delivered",
119
- Read = "read",
120
- Sent = "sent",
121
- }
122
- declare enum VideoMediaTypesEnum {
123
- Mp4 = "video/mp4",
124
- Threegp = "video/3gp",
125
- }
126
- declare enum StickerMediaTypesEnum {
127
- Webp = "image/webp",
128
- }
129
- declare enum ImageMediaTypesEnum {
130
- Jpeg = "image/jpeg",
131
- Png = "image/png",
132
- }
133
- declare enum DocumentMediaTypesEnum {
134
- Text = "text/plain",
135
- Pdf = "application/pdf",
136
- Ppt = "application/vnd.ms-powerpoint",
137
- Word = "application/msword",
138
- Excel = "application/vnd.ms-excel",
139
- OpenDoc = "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
140
- OpenPres = "application/vnd.openxmlformats-officedocument.presentationml.presentation",
141
- OpenSheet = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
142
- }
143
- declare enum AudioMediaTypesEnum {
144
- Aac = "audio/aac",
145
- Mp4 = "audio/mp4",
146
- Mpeg = "audio/mpeg",
147
- Amr = "audio/amr",
148
- Ogg = "audio/ogg",
149
- }
150
- declare enum WebhookTypesEnum {
151
- Audio = "audio",
152
- Button = "button",
153
- Document = "document",
154
- Text = "text",
155
- Image = "image",
156
- Interactive = "interactive",
157
- Order = "order",
158
- Sticker = "sticker",
159
- System = "system",
160
- Unknown = "unknown",
161
- Video = "video",
162
- }
163
- declare enum SystemChangeTypesEnum {
164
- CustomerChangedNumber = "customer_changed_number",
165
- CustomerIdentityChanged = "customer_identity_changed",
166
- }
167
- declare enum ReferralSourceTypesEnum {
168
- Ad = "ad",
169
- Post = "post",
170
- }
171
- declare enum RequestCodeMethodsEnum {
172
- Sms = "SMS",
173
- Voice = "VOICE",
174
- }
175
- declare enum LanguagesEnum {
176
- Afrikaans = "af",
177
- Albanian = "sq",
178
- Arabic = "ar",
179
- Azerbaijani = "az",
180
- Bengali = "bn",
181
- Bulgarian = "bg",
182
- Catalan = "ca",
183
- Chinese_CHN = "zh_CN",
184
- Chinese_HKG = "zh_HK",
185
- Chinese_TAI = "zh_TW",
186
- Croatian = "hr",
187
- Czech = "cs",
188
- Danish = "da",
189
- Dutch = "nl",
190
- English = "en",
191
- English_UK = "en_GB",
192
- English_US = "en_US",
193
- Estonian = "et",
194
- Filipino = "fil",
195
- Finnish = "fi",
196
- French = "fr",
197
- Georgian = "ka",
198
- German = "de",
199
- Greek = "el",
200
- Gujarati = "gu",
201
- Hausa = "ha",
202
- Hebrew = "he",
203
- Hindi = "hi",
204
- Hungarian = "hu",
205
- Indonesian = "id",
206
- Irish = "ga",
207
- Italian = "it",
208
- Japanese = "ja",
209
- Kannada = "kn",
210
- Kazakh = "kk",
211
- Kinyarwanda = "rw_RW",
212
- Korean = "ko",
213
- Kyrgyz_Kyrgyzstan = "ky_KG",
214
- Lao = "lo",
215
- Latvian = "lv",
216
- Lithuanian = "lt",
217
- Macedonian = "mk",
218
- Malay = "ms",
219
- Malayalam = "ml",
220
- Marathi = "mr",
221
- Norwegian = "nb",
222
- Persian = "fa",
223
- Polish = "pl",
224
- Portuguese_BR = "pt_BR",
225
- Portuguese_POR = "pt_PT",
226
- Punjabi = "pa",
227
- Romanian = "ro",
228
- Russian = "ru",
229
- Serbian = "sr",
230
- Slovak = "sk",
231
- Slovenian = "sl",
232
- Spanish = "es",
233
- Spanish_ARG = "es_AR",
234
- Spanish_SPA = "es_ES",
235
- Spanish_MEX = "es_MX",
236
- Swahili = "sw",
237
- Swedish = "sv",
238
- Tamil = "ta",
239
- Telugu = "te",
240
- Thai = "th",
241
- Turkish = "tr",
242
- Ukrainian = "uk",
243
- Urdu = "ur",
244
- Uzbek = "uz",
245
- Vietnamese = "vi",
246
- Zulu = "zu",
247
- }
248
- declare enum CurrencyCodesEnum {
249
- AFN = "AFN",
250
- EUR = "EUR",
251
- ALL = "ALL",
252
- DZD = "DZD",
253
- USD = "USD",
254
- AOA = "AOA",
255
- XCD = "XCD",
256
- ARS = "ARS",
257
- AMD = "AMD",
258
- AWG = "AWG",
259
- AUD = "AUD",
260
- AZN = "AZN",
261
- BSD = "BSD",
262
- BHD = "BHD",
263
- BDT = "BDT",
264
- BBD = "BBD",
265
- BYN = "BYN",
266
- BZD = "BZD",
267
- XOF = "XOF",
268
- BMD = "BMD",
269
- INR = "INR",
270
- BTN = "BTN",
271
- BOB = "BOB",
272
- BOV = "BOV",
273
- BAM = "BAM",
274
- BWP = "BWP",
275
- NOK = "NOK",
276
- BRL = "BRL",
277
- BND = "BND",
278
- BGN = "BGN",
279
- BIF = "BIF",
280
- CVE = "CVE",
281
- KHR = "KHR",
282
- XAF = "XAF",
283
- CAD = "CAD",
284
- KYD = "KYD",
285
- CLP = "CLP",
286
- CLF = "CLF",
287
- CNY = "CNY",
288
- COP = "COP",
289
- COU = "COU",
290
- KMF = "KMF",
291
- CDF = "CDF",
292
- NZD = "NZD",
293
- CRC = "CRC",
294
- HRK = "HRK",
295
- CUP = "CUP",
296
- CUC = "CUC",
297
- ANG = "ANG",
298
- CZK = "CZK",
299
- DKK = "DKK",
300
- DJF = "DJF",
301
- DOP = "DOP",
302
- EGP = "EGP",
303
- SVC = "SVC",
304
- ERN = "ERN",
305
- SZL = "SZL",
306
- ETB = "ETB",
307
- FKP = "FKP",
308
- FJD = "FJD",
309
- XPF = "XPF",
310
- GMD = "GMD",
311
- GEL = "GEL",
312
- GHS = "GHS",
313
- GIP = "GIP",
314
- GTQ = "GTQ",
315
- GBP = "GBP",
316
- GNF = "GNF",
317
- GYD = "GYD",
318
- HTG = "HTG",
319
- HNL = "HNL",
320
- HKD = "HKD",
321
- HUF = "HUF",
322
- ISK = "ISK",
323
- IDR = "IDR",
324
- XDR = "XDR",
325
- IRR = "IRR",
326
- IQD = "IQD",
327
- ILS = "ILS",
328
- JMD = "JMD",
329
- JPY = "JPY",
330
- JOD = "JOD",
331
- KZT = "KZT",
332
- KES = "KES",
333
- KPW = "KPW",
334
- KRW = "KRW",
335
- KWD = "KWD",
336
- KGS = "KGS",
337
- LAK = "LAK",
338
- LBP = "LBP",
339
- LSL = "LSL",
340
- ZAR = "ZAR",
341
- LRD = "LRD",
342
- LYD = "LYD",
343
- CHF = "CHF",
344
- MOP = "MOP",
345
- MKD = "MKD",
346
- MGA = "MGA",
347
- MWK = "MWK",
348
- MYR = "MYR",
349
- MVR = "MVR",
350
- MRU = "MRU",
351
- MUR = "MUR",
352
- XUA = "XUA",
353
- MXN = "MXN",
354
- MXV = "MXV",
355
- MDL = "MDL",
356
- MNT = "MNT",
357
- MAD = "MAD",
358
- MZN = "MZN",
359
- MMK = "MMK",
360
- NAD = "NAD",
361
- NPR = "NPR",
362
- NIO = "NIO",
363
- NGN = "NGN",
364
- OMR = "OMR",
365
- PKR = "PKR",
366
- PAB = "PAB",
367
- PGK = "PGK",
368
- PYG = "PYG",
369
- PEN = "PEN",
370
- PHP = "PHP",
371
- PLN = "PLN",
372
- QAR = "QAR",
373
- RON = "RON",
374
- RUB = "RUB",
375
- RWF = "RWF",
376
- SHP = "SHP",
377
- WST = "WST",
378
- STN = "STN",
379
- SAR = "SAR",
380
- RSD = "RSD",
381
- SCR = "SCR",
382
- SLL = "SLL",
383
- SGD = "SGD",
384
- XSU = "XSU",
385
- SBD = "SBD",
386
- SOS = "SOS",
387
- SSP = "SSP",
388
- LKR = "LKR",
389
- SDG = "SDG",
390
- SRD = "SRD",
391
- SEK = "SEK",
392
- CHE = "CHE",
393
- CHW = "CHW",
394
- SYP = "SYP",
395
- TWD = "TWD",
396
- TJS = "TJS",
397
- TZS = "TZS",
398
- THB = "THB",
399
- TOP = "TOP",
400
- TTD = "TTD",
401
- TND = "TND",
402
- TRY = "TRY",
403
- TMT = "TMT",
404
- UGX = "UGX",
405
- UAH = "UAH",
406
- AED = "AED",
407
- USN = "USN",
408
- UYU = "UYU",
409
- UYI = "UYI",
410
- UYW = "UYW",
411
- UZS = "UZS",
412
- VUV = "VUV",
413
- VES = "VES",
414
- VND = "VND",
415
- YER = "YER",
416
- ZMW = "ZMW",
417
- ZWL = "ZWL",
418
- XBA = "XBA",
419
- XBB = "XBB",
420
- XBC = "XBC",
421
- XBD = "XBD",
422
- XTS = "XTS",
423
- XXX = "XXX",
424
- XAU = "XAU",
425
- XPD = "XPD",
426
- XPT = "XPT",
427
- XAG = "XAG",
428
- AFA = "AFA",
429
- FIM = "FIM",
430
- ALK = "ALK",
431
- ADP = "ADP",
432
- ESP = "ESP",
433
- FRF = "FRF",
434
- AOK = "AOK",
435
- AON = "AON",
436
- AOR = "AOR",
437
- ARA = "ARA",
438
- ARP = "ARP",
439
- ARY = "ARY",
440
- RUR = "RUR",
441
- ATS = "ATS",
442
- AYM = "AYM",
443
- AZM = "AZM",
444
- BYB = "BYB",
445
- BYR = "BYR",
446
- BEC = "BEC",
447
- BEF = "BEF",
448
- BEL = "BEL",
449
- BOP = "BOP",
450
- BAD = "BAD",
451
- BRB = "BRB",
452
- BRC = "BRC",
453
- BRE = "BRE",
454
- BRN = "BRN",
455
- BRR = "BRR",
456
- BGJ = "BGJ",
457
- BGK = "BGK",
458
- BGL = "BGL",
459
- BUK = "BUK",
460
- HRD = "HRD",
461
- CYP = "CYP",
462
- CSJ = "CSJ",
463
- CSK = "CSK",
464
- ECS = "ECS",
465
- ECV = "ECV",
466
- GQE = "GQE",
467
- EEK = "EEK",
468
- XEU = "XEU",
469
- GEK = "GEK",
470
- DDM = "DDM",
471
- DEM = "DEM",
472
- GHC = "GHC",
473
- GHP = "GHP",
474
- GRD = "GRD",
475
- GNE = "GNE",
476
- GNS = "GNS",
477
- GWE = "GWE",
478
- GWP = "GWP",
479
- ITL = "ITL",
480
- ISJ = "ISJ",
481
- IEP = "IEP",
482
- ILP = "ILP",
483
- ILR = "ILR",
484
- LAJ = "LAJ",
485
- LVL = "LVL",
486
- LVR = "LVR",
487
- LSM = "LSM",
488
- ZAL = "ZAL",
489
- LTL = "LTL",
490
- LTT = "LTT",
491
- LUC = "LUC",
492
- LUF = "LUF",
493
- LUL = "LUL",
494
- MGF = "MGF",
495
- MVQ = "MVQ",
496
- MLF = "MLF",
497
- MTL = "MTL",
498
- MTP = "MTP",
499
- MRO = "MRO",
500
- MXP = "MXP",
501
- MZE = "MZE",
502
- MZM = "MZM",
503
- NLG = "NLG",
504
- NIC = "NIC",
505
- PEH = "PEH",
506
- PEI = "PEI",
507
- PES = "PES",
508
- PLZ = "PLZ",
509
- PTE = "PTE",
510
- ROK = "ROK",
511
- ROL = "ROL",
512
- STD = "STD",
513
- CSD = "CSD",
514
- SKK = "SKK",
515
- SIT = "SIT",
516
- RHD = "RHD",
517
- ESA = "ESA",
518
- ESB = "ESB",
519
- SDD = "SDD",
520
- SDP = "SDP",
521
- SRG = "SRG",
522
- CHC = "CHC",
523
- TJR = "TJR",
524
- TPE = "TPE",
525
- TRL = "TRL",
526
- TMM = "TMM",
527
- UGS = "UGS",
528
- UGW = "UGW",
529
- UAK = "UAK",
530
- SUR = "SUR",
531
- USS = "USS",
532
- UYN = "UYN",
533
- UYP = "UYP",
534
- VEB = "VEB",
535
- VEF = "VEF",
536
- VNC = "VNC",
537
- YDD = "YDD",
538
- YUD = "YUD",
539
- YUM = "YUM",
540
- YUN = "YUN",
541
- ZRN = "ZRN",
542
- ZRZ = "ZRZ",
543
- ZMK = "ZMK",
544
- ZWC = "ZWC",
545
- ZWD = "ZWD",
546
- ZWN = "ZWN",
547
- ZWR = "ZWR",
548
- XFO = "XFO",
549
- XRE = "XRE",
550
- XFU = "XFU",
551
- }
552
- declare enum DataLocalizationRegionEnum {
553
- AU = "AU",
554
- // Australia
555
- ID = "ID",
556
- // Indonesia
557
- IN = "IN",
558
- // India
559
- JP = "JP",
560
- // Japan
561
- SG = "SG",
562
- // Singapore
563
- KR = "KR",
564
- // South Korea
565
- DE = "DE",
566
- // EU (Germany)
567
- CH = "CH",
568
- // Switzerland
569
- GB = "GB",
570
- // United Kingdom
571
- BR = "BR",
572
- // Brazil
573
- BH = "BH",
574
- // Bahrain
575
- ZA = "ZA",
576
- // South Africa
577
- AE = "AE",
578
- // United Arab Emirates
579
- CA = "CA",
580
- }
581
- /**
582
- * Business category values for WhatsApp Business Profile.
583
- * These values map to specific strings displayed in the WhatsApp client.
584
- */
585
- declare enum BusinessVerticalEnum {
586
- /**
587
- * Alcoholic Beverages
588
- */
589
- ALCOHOL = "ALCOHOL",
590
- /**
591
- * Clothing and Apparel
592
- */
593
- APPAREL = "APPAREL",
594
- /**
595
- * Automotive
596
- */
597
- AUTO = "AUTO",
598
- /**
599
- * Beauty, Spa and Salon
600
- */
601
- BEAUTY = "BEAUTY",
602
- /**
603
- * Education
604
- */
605
- EDU = "EDU",
606
- /**
607
- * Entertainment
608
- */
609
- ENTERTAIN = "ENTERTAIN",
610
- /**
611
- * Event Planning and Service
612
- */
613
- EVENT_PLAN = "EVENT_PLAN",
614
- /**
615
- * Finance and Banking
616
- */
617
- FINANCE = "FINANCE",
618
- /**
619
- * Public Service
620
- */
621
- GOVT = "GOVT",
622
- /**
623
- * Food and Grocery
624
- */
625
- GROCERY = "GROCERY",
626
- /**
627
- * Medical and Health
628
- */
629
- HEALTH = "HEALTH",
630
- /**
631
- * Hotel and Lodging
632
- */
633
- HOTEL = "HOTEL",
634
- /**
635
- * Non-profit
636
- */
637
- NONPROFIT = "NONPROFIT",
638
- /**
639
- * Online Gambling & Gaming
640
- */
641
- ONLINE_GAMBLING = "ONLINE_GAMBLING",
642
- /**
643
- * Over-the-Counter Drugs
644
- */
645
- OTC_DRUGS = "OTC_DRUGS",
646
- /**
647
- * Other
648
- */
649
- OTHER = "OTHER",
650
- /**
651
- * Non-Online Gambling & Gaming (E.g. Brick and mortar)
652
- */
653
- PHYSICAL_GAMBLING = "PHYSICAL_GAMBLING",
654
- /**
655
- * Professional Services
656
- */
657
- PROF_SERVICES = "PROF_SERVICES",
658
- /**
659
- * Restaurant
660
- */
661
- RESTAURANT = "RESTAURANT",
662
- /**
663
- * Shopping and Retail
664
- */
665
- RETAIL = "RETAIL",
666
- /**
667
- * Travel and Transportation
668
- */
669
- TRAVEL = "TRAVEL",
670
- }
671
- //#endregion
672
4
  //#region src/types/config.d.ts
673
5
  type WhatsAppConfig = {
674
6
  accessToken: string;
@@ -745,6 +77,15 @@ type WabaConfigType = {
745
77
  [WabaConfigEnum.Passphrase]: string;
746
78
  };
747
79
  //#endregion
80
+ //#region src/types/logger.d.ts
81
+ interface LoggerInterface {
82
+ log(...data: any[]): void;
83
+ error(...data: any[]): void;
84
+ warn(...data: any[]): void;
85
+ info(...data: any[]): void;
86
+ debug(...data: any[]): void;
87
+ }
88
+ //#endregion
748
89
  //#region src/types/request.d.ts
749
90
  type GeneralRequestBody = Record<string, unknown>;
750
91
  interface GeneralHeaderInterface {
@@ -814,902 +155,97 @@ declare class HttpsClientClass {
814
155
  declare class BaseClass {
815
156
  constructor(config: WabaConfigType);
816
157
  }
817
- declare class BaseAPI implements BaseClass {
818
- protected config: WabaConfigType;
819
- protected client: RequesterClass;
820
- constructor(config: WabaConfigType, client: RequesterClass);
821
- protected sendJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
822
- protected sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
823
- protected sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
824
- }
825
- //#endregion
826
- //#region src/api/encryption/types/publicKey.d.ts
827
- type EncryptionPublicKeyResponse = ResponseData<{
828
- business_public_key: string;
829
- business_public_key_signature_status: 'VALID' | 'MISMATCH';
830
- }>;
831
158
  //#endregion
832
- //#region src/api/encryption/types/common.d.ts
833
- interface EncryptionClass {
834
- getEncryptionPublicKey(): Promise<EncryptionPublicKeyResponse>;
835
- setEncryptionPublicKey(businessPublicKey: string): Promise<ResponseSuccess>;
159
+ //#region src/api/profile/types/upload.d.ts
160
+ /**
161
+ * Response from creating an upload session.
162
+ */
163
+ interface UploadSessionResponse {
164
+ id: string;
165
+ }
166
+ /**
167
+ * Response from uploading business profile media.
168
+ */
169
+ interface UploadBusinessProfileResponse {
170
+ h: string;
171
+ }
172
+ /**
173
+ * Upload handle information containing file details and handle.
174
+ */
175
+ interface UploadHandle {
176
+ handle: string;
177
+ file_size: number;
178
+ upload_result: {
179
+ handle_type: string;
180
+ name: string;
181
+ };
836
182
  }
183
+ /**
184
+ * Request parameters for creating upload session.
185
+ */
837
186
  //#endregion
838
- //#region src/core/webhook/types.d.ts
839
- interface WebhookContact {
187
+ //#region src/api/profile/types/common.d.ts
188
+ /**
189
+ * Available fields that can be requested when retrieving a business profile.
190
+ */
191
+ type BusinessProfileField = 'about' | 'address' | 'description' | 'email' | 'profile_picture_url' | 'websites' | 'vertical';
192
+ type BusinessProfileFieldsParam = BusinessProfileField[] | string;
193
+ /**
194
+ * Business profile data structure containing all profile information.
195
+ */
196
+ interface BusinessProfileData {
840
197
  /**
841
- * WhatsApp ID of the contact. Business can respond to this contact using this ID.
198
+ * The business's About text. This text appears in the business's profile, beneath its profile image,
199
+ * phone number, and contact buttons.
200
+ * - String cannot be empty
201
+ * - Strings must be between 1 and 139 characters
202
+ * - Rendered emojis are supported however their unicode values are not.
203
+ * Emoji unicode values must be Java- or JavaScript-escape encoded
204
+ * - Hyperlinks can be included but will not render as clickable links
205
+ * - Markdown is not supported
842
206
  */
843
- wa_id: string;
207
+ about?: string;
844
208
  /**
845
- * Additional unique, alphanumeric identifier for a WhatsApp user
209
+ * Address of the business. Character limit 256.
846
210
  */
847
- user_id?: string;
211
+ address?: string;
848
212
  /**
849
- * Profile of Whatsapp user
213
+ * Description of the business. Character limit 512.
850
214
  */
851
- profile: {
852
- /**
853
- * The display name of the contact
854
- */
855
- name: string;
856
- };
857
- }
858
- /**
859
- * Base message interface with common properties
860
- */
861
- interface BaseMessage {
862
- id: string;
863
- from: string;
864
- timestamp: string;
865
- type: MessageTypesEnum;
215
+ description?: string;
866
216
  /**
867
- * Context object, included when a user replies or interacts
217
+ * The contact email address (in valid email format) of the business. Character limit 128.
868
218
  */
869
- context?: {
870
- /**
871
- * ID of the message
872
- */
873
- id?: string;
874
- /**
875
- * ID of the sender
876
- */
877
- from?: string;
878
- /**
879
- * ID of the message being replied to or interacted with
880
- */
881
- message_id: string;
882
- /**
883
- * ID of the forwarded message, if applicable
884
- */
885
- forwarded?: boolean;
886
- /**
887
- * Frequently forwarded status
888
- */
889
- frequently_forwarded?: boolean;
890
- /**
891
- * Original message information if the message was referred
892
- */
893
- referred_product?: {
894
- /**
895
- * Catalog ID
896
- */
897
- catalog_id: string;
898
- /**
899
- * Product ID
900
- */
901
- product_retailer_id: string;
902
- };
903
- };
219
+ email?: string;
904
220
  /**
905
- * Errors array, if the message had errors
221
+ * The messaging service used for the request. Always set it to "whatsapp" if you are using
222
+ * the WhatsApp Business API.
906
223
  */
907
- errors?: Array<{
908
- /**
909
- * Error code
910
- */
911
- code: number;
912
- /**
913
- * Error title
914
- */
915
- title: string;
916
- /**
917
- * Error message
918
- */
919
- message: string;
920
- /**
921
- * Error details object
922
- */
923
- error_data?: {
924
- /**
925
- * Describes the error details
926
- */
927
- details: string;
928
- };
929
- }>;
930
- }
931
- /**
932
- * Text message interface
933
- */
934
- interface TextMessage extends BaseMessage {
935
- type: MessageTypesEnum.Text;
936
- text: {
937
- /**
938
- * The text content of the message
939
- */
940
- body: string;
941
- preview_url?: boolean;
942
- };
224
+ messaging_product: string;
225
+ /**
226
+ * Profile picture URL.
227
+ */
228
+ profile_picture_url?: string;
229
+ /**
230
+ * The URLs associated with the business. For instance, a website, Facebook Page, or Instagram.
231
+ * - You must include the http:// or https:// portion of the URL
232
+ * - There is a maximum of 2 websites with a maximum of 256 characters each
233
+ */
234
+ websites?: string[];
235
+ /**
236
+ * Business category. This can be either an empty string or one of the predefined business categories.
237
+ * @see BusinessVerticalEnum for all available options
238
+ */
239
+ vertical?: BusinessVerticalEnum | string;
943
240
  }
944
241
  /**
945
- * Image message interface
242
+ * Response structure for business profile GET requests.
946
243
  */
947
- interface ImageMessage extends BaseMessage {
948
- type: MessageTypesEnum.Image;
949
- image: {
950
- /**
951
- * The image caption (if provided)
952
- */
953
- caption?: string;
954
- /**
955
- * The SHA256 hash of the image
956
- */
957
- sha256?: string;
958
- /**
959
- * The ID for the image
960
- */
961
- id: string;
962
- /**
963
- * The MIME type of the image
964
- */
965
- mime_type: string;
966
- };
244
+ interface BusinessProfileResponse {
245
+ data: BusinessProfileData[];
967
246
  }
968
247
  /**
969
- * Video message interface
970
- */
971
- interface VideoMessage extends BaseMessage {
972
- type: MessageTypesEnum.Video;
973
- video: {
974
- /**
975
- * The video caption (if provided)
976
- */
977
- caption?: string;
978
- /**
979
- * The SHA256 hash of the video
980
- */
981
- sha256?: string;
982
- /**
983
- * The ID for the video
984
- */
985
- id: string;
986
- /**
987
- * The MIME type of the video
988
- */
989
- mime_type: string;
990
- };
991
- }
992
- /**
993
- * Audio message interface
994
- */
995
- interface AudioMessage extends BaseMessage {
996
- type: MessageTypesEnum.Audio;
997
- audio: {
998
- /**
999
- * The ID for the audio file
1000
- */
1001
- id: string;
1002
- /**
1003
- * The MIME type of the audio file
1004
- */
1005
- mime_type: string;
1006
- /**
1007
- * Whether the audio is a voice message
1008
- */
1009
- voice?: boolean;
1010
- };
1011
- }
1012
- /**
1013
- * Document message interface
1014
- */
1015
- interface DocumentMessage extends BaseMessage {
1016
- type: MessageTypesEnum.Document;
1017
- document: {
1018
- /**
1019
- * The document caption (if provided)
1020
- */
1021
- caption?: string;
1022
- /**
1023
- * The document filename
1024
- */
1025
- filename: string;
1026
- /**
1027
- * The SHA256 hash of the document
1028
- */
1029
- sha256?: string;
1030
- /**
1031
- * The ID for the document
1032
- */
1033
- id: string;
1034
- /**
1035
- * The MIME type of the document
1036
- */
1037
- mime_type: string;
1038
- };
1039
- }
1040
- /**
1041
- * Sticker message interface
1042
- */
1043
- interface StickerMessage extends BaseMessage {
1044
- type: MessageTypesEnum.Sticker;
1045
- sticker: {
1046
- /**
1047
- * The ID for the sticker
1048
- */
1049
- id: string;
1050
- /**
1051
- * Whether this is an animated sticker
1052
- */
1053
- animated: boolean;
1054
- /**
1055
- * The MIME type of the sticker
1056
- */
1057
- mime_type: string;
1058
- };
1059
- }
1060
- /**
1061
- * Reaction message interface
1062
- */
1063
- interface ReactionMessage extends BaseMessage {
1064
- type: MessageTypesEnum.Reaction;
1065
- reaction: {
1066
- /**
1067
- * The ID of the message being reacted to
1068
- */
1069
- message_id: string;
1070
- /**
1071
- * Emoji used for the reaction
1072
- */
1073
- emoji: string;
1074
- };
1075
- }
1076
- /**
1077
- * Contacts message interface
1078
- */
1079
- interface ContactsMessage extends BaseMessage {
1080
- type: MessageTypesEnum.Contacts;
1081
- contacts: Array<{
1082
- /**
1083
- * The contact's name
1084
- */
1085
- name: {
1086
- /**
1087
- * The formatted name
1088
- */
1089
- formatted_name: string;
1090
- /**
1091
- * The first name
1092
- */
1093
- first_name?: string;
1094
- /**
1095
- * The last name
1096
- */
1097
- last_name?: string;
1098
- /**
1099
- * The middle name
1100
- */
1101
- middle_name?: string;
1102
- /**
1103
- * The suffix
1104
- */
1105
- suffix?: string;
1106
- /**
1107
- * The prefix
1108
- */
1109
- prefix?: string;
1110
- };
1111
- /**
1112
- * The contact's phone numbers
1113
- */
1114
- phones?: Array<{
1115
- phone: string;
1116
- type?: string;
1117
- wa_id?: string;
1118
- }>;
1119
- /**
1120
- * The contact's emails
1121
- */
1122
- emails?: Array<{
1123
- email: string;
1124
- type?: string;
1125
- }>;
1126
- /**
1127
- * The contact's addresses
1128
- */
1129
- addresses?: Array<{
1130
- street?: string;
1131
- city?: string;
1132
- state?: string;
1133
- zip?: string;
1134
- country?: string;
1135
- country_code?: string;
1136
- type?: string;
1137
- }>;
1138
- /**
1139
- * The contact's organizations
1140
- */
1141
- org?: {
1142
- company?: string;
1143
- department?: string;
1144
- title?: string;
1145
- };
1146
- /**
1147
- * The contact's URLs
1148
- */
1149
- urls?: Array<{
1150
- url: string;
1151
- type?: string;
1152
- }>;
1153
- /**
1154
- * The contact's birthday (YYYY-MM-DD format)
1155
- */
1156
- birthday?: string;
1157
- }>;
1158
- }
1159
- /**
1160
- * Location message interface
1161
- */
1162
- interface LocationMessage extends BaseMessage {
1163
- type: MessageTypesEnum.Location;
1164
- location: {
1165
- /**
1166
- * Latitude of the location
1167
- */
1168
- latitude: number;
1169
- /**
1170
- * Longitude of the location
1171
- */
1172
- longitude: number;
1173
- /**
1174
- * Name of the location
1175
- */
1176
- name?: string;
1177
- /**
1178
- * Address of the location
1179
- */
1180
- address?: string;
1181
- };
1182
- }
1183
- /**
1184
- * Interactive message interface
1185
- */
1186
- interface InteractiveMessage extends BaseMessage {
1187
- type: MessageTypesEnum.Interactive;
1188
- interactive: {
1189
- /**
1190
- * Type of the interactive message
1191
- * Can be: button_reply, list_reply, flow, nfm_reply, etc.
1192
- */
1193
- type: string;
1194
- /**
1195
- * ID for the button that was clicked
1196
- */
1197
- button_reply?: {
1198
- id: string;
1199
- title: string;
1200
- };
1201
- /**
1202
- * ID for the list item that was selected
1203
- */
1204
- list_reply?: {
1205
- id: string;
1206
- title: string;
1207
- description?: string;
1208
- };
1209
- /**
1210
- * NFM (No-Code Flow Message) reply data
1211
- */
1212
- nfm_reply?: {
1213
- /**
1214
- * Response data in JSON format
1215
- */
1216
- response_json: string;
1217
- /**
1218
- * Body text of the reply
1219
- */
1220
- body: string;
1221
- /**
1222
- * Name of the flow
1223
- */
1224
- name: string;
1225
- };
1226
- };
1227
- }
1228
- /**
1229
- * System message interface
1230
- */
1231
- interface SystemMessage extends BaseMessage {
1232
- type: MessageTypesEnum.System;
1233
- system: {
1234
- /**
1235
- * The type of system update
1236
- */
1237
- type: string;
1238
- /**
1239
- * User's identity if the update is a customer identity change
1240
- */
1241
- identity?: string;
1242
- /**
1243
- * Old and new phone numbers if the update is a phone number change
1244
- */
1245
- customer?: {
1246
- /**
1247
- * The previous phone number
1248
- */
1249
- previous_wa_id: string;
1250
- /**
1251
- * The new phone number
1252
- */
1253
- wa_id: string;
1254
- };
1255
- };
1256
- }
1257
- /**
1258
- * Order message interface
1259
- */
1260
- interface OrderMessage extends BaseMessage {
1261
- type: MessageTypesEnum.Order;
1262
- order: {
1263
- /**
1264
- * Catalog ID
1265
- */
1266
- catalog_id: string;
1267
- /**
1268
- * Product items in the order
1269
- */
1270
- product_items: Array<{
1271
- /**
1272
- * Product ID
1273
- */
1274
- product_retailer_id: string;
1275
- /**
1276
- * Quantity of the product
1277
- */
1278
- quantity: number;
1279
- /**
1280
- * Item price
1281
- */
1282
- item_price: number;
1283
- /**
1284
- * Currency code
1285
- */
1286
- currency: string;
1287
- }>;
1288
- /**
1289
- * Text message included with the order
1290
- */
1291
- text?: string;
1292
- };
1293
- }
1294
- /**
1295
- * Button message interface
1296
- */
1297
- interface ButtonMessage extends BaseMessage {
1298
- type: MessageTypesEnum.Button;
1299
- button: {
1300
- /**
1301
- * The payload for the button
1302
- */
1303
- payload: string;
1304
- /**
1305
- * Button text
1306
- */
1307
- text: string;
1308
- };
1309
- }
1310
- /**
1311
- * Union type for all message types
1312
- */
1313
- type WhatsAppMessage = TextMessage | ImageMessage | VideoMessage | AudioMessage | DocumentMessage | StickerMessage | ReactionMessage | ContactsMessage | LocationMessage | InteractiveMessage | SystemMessage | OrderMessage | ButtonMessage;
1314
- interface WebhookMessageValue {
1315
- /**
1316
- * The messaging product
1317
- */
1318
- messaging_product: string;
1319
- /**
1320
- * The metadata
1321
- */
1322
- metadata: {
1323
- /**
1324
- * The display phone number of the whatsapp business account
1325
- */
1326
- display_phone_number: string;
1327
- /**
1328
- * The phone number ID of the whatsapp business account
1329
- */
1330
- phone_number_id: string;
1331
- };
1332
- contacts?: Array<{
1333
- profile: {
1334
- /**
1335
- * The display name of the whatsapp user
1336
- */
1337
- name: string;
1338
- };
1339
- /**
1340
- * The whatsapp ID of the user
1341
- */
1342
- wa_id: string;
1343
- }>;
1344
- messages: Array<WhatsAppMessage>;
1345
- statuses?: Array<{
1346
- /**
1347
- * The ID of the message
1348
- */
1349
- id: string;
1350
- /**
1351
- * The status of the message
1352
- */
1353
- status: MessageStatus;
1354
- /**
1355
- * The timestamp of the message
1356
- */
1357
- timestamp: string;
1358
- /**
1359
- * The recipient ID ( phone number of the user )
1360
- */
1361
- recipient_id: string;
1362
- }>;
1363
- errors?: Array<{
1364
- /**
1365
- * The error code
1366
- */
1367
- code: number;
1368
- /**
1369
- * The error title
1370
- */
1371
- title: string;
1372
- /**
1373
- * The error data
1374
- */
1375
- error_data?: {
1376
- /**
1377
- * The error details
1378
- */
1379
- details: string;
1380
- };
1381
- }>;
1382
- }
1383
- /**
1384
- * Represents a message received through the webhook
1385
- * Based on Meta's documentation: https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/components#messages-object
1386
- */
1387
- interface WebhookMessage {
1388
- /**
1389
- * The WhatsApp Business Account ID
1390
- */
1391
- wabaId: string;
1392
- /**
1393
- * The message ID
1394
- */
1395
- id: string;
1396
- /**
1397
- * The sender's phone number
1398
- */
1399
- from: string;
1400
- /**
1401
- * The timestamp of the message
1402
- */
1403
- timestamp: string;
1404
- /**
1405
- * The type of message (text, image, etc.)
1406
- */
1407
- type: MessageTypesEnum;
1408
- /**
1409
- * The phone number ID that received the message
1410
- */
1411
- phoneNumberId: string;
1412
- /**
1413
- * The display phone number that received the message
1414
- */
1415
- displayPhoneNumber: string;
1416
- /**
1417
- * The profile name of the sender
1418
- */
1419
- profileName: string;
1420
- text?: TextMessage['text'];
1421
- image?: ImageMessage['image'];
1422
- video?: VideoMessage['video'];
1423
- audio?: AudioMessage['audio'];
1424
- document?: DocumentMessage['document'];
1425
- sticker?: StickerMessage['sticker'];
1426
- location?: LocationMessage['location'];
1427
- contacts?: ContactsMessage['contacts'];
1428
- interactive?: InteractiveMessage['interactive'];
1429
- button?: ButtonMessage['button'];
1430
- order?: OrderMessage['order'];
1431
- system?: SystemMessage['system'];
1432
- reaction?: ReactionMessage['reaction'];
1433
- statuses?: {
1434
- /**
1435
- * Arbitrary string included in sent message
1436
- */
1437
- biz_opaque_callback_data?: string;
1438
- /**
1439
- * Information about the conversation
1440
- */
1441
- conversation?: {
1442
- /**
1443
- * Represents the ID of the conversation the given status notification belongs to
1444
- */
1445
- id: string;
1446
- /**
1447
- * Describes conversation category
1448
- */
1449
- origin: {
1450
- /**
1451
- * Indicates conversation category. This can also be referred to as a conversation entry point
1452
- * - authentication: Conversation opened by business sending template categorized as AUTHENTICATION
1453
- * - marketing: Conversation opened by business sending template categorized as MARKETING
1454
- * - utility: Conversation opened by business sending template categorized as UTILITY
1455
- * - service: Conversation opened by business replying to customer within service window
1456
- * - referral_conversion: Free entry point conversation
1457
- */
1458
- type: 'authentication' | 'marketing' | 'utility' | 'service' | 'referral_conversion';
1459
- };
1460
- /**
1461
- * Date when the conversation expires. Only present for messages with status 'sent'
1462
- */
1463
- expiration_timestamp?: string;
1464
- };
1465
- /**
1466
- * Array of error objects describing the error
1467
- */
1468
- errors?: Array<{
1469
- /**
1470
- * Error code
1471
- */
1472
- code: number;
1473
- /**
1474
- * Error code title
1475
- */
1476
- title: string;
1477
- /**
1478
- * Error code message
1479
- */
1480
- message: string;
1481
- /**
1482
- * Error details object
1483
- */
1484
- error_data?: {
1485
- /**
1486
- * Describes the error details
1487
- */
1488
- details: string;
1489
- };
1490
- }>;
1491
- /**
1492
- * The ID for the message that the business sent to a customer
1493
- */
1494
- id: string;
1495
- /**
1496
- * Pricing information for the message/conversation
1497
- */
1498
- pricing?: {
1499
- /**
1500
- * Indicates if the given message or conversation is billable
1501
- * @deprecated This field is deprecated. Visit the WhatsApp Changelog for more information.
1502
- */
1503
- billable?: boolean;
1504
- /**
1505
- * Indicates the conversation category:
1506
- * - authentication: Authentication conversation
1507
- * - authentication_international: Authentication-international conversation
1508
- * - marketing: Marketing conversation
1509
- * - utility: Utility conversation
1510
- * - service: Service conversation
1511
- * - referral_conversion: Free entry point conversation
1512
- */
1513
- category: 'authentication' | 'authentication_international' | 'marketing' | 'utility' | 'service' | 'referral_conversion';
1514
- /**
1515
- * Type of pricing model used by the business. Current supported value is CBP
1516
- */
1517
- pricing_model: 'CBP';
1518
- };
1519
- /**
1520
- * The customer's WhatsApp ID. Business can respond to customer using this ID.
1521
- * This ID may not match the customer's phone number.
1522
- */
1523
- recipient_id: string;
1524
- /**
1525
- * Status of the message:
1526
- * - delivered: Message has been delivered
1527
- * - read: Message has been read by the customer
1528
- * - sent: Message has been sent to the customer
1529
- */
1530
- status: 'delivered' | 'read' | 'sent';
1531
- /**
1532
- * Unix timestamp for the status message
1533
- */
1534
- timestamp: string;
1535
- };
1536
- /**
1537
- * The original message data as received from the webhook
1538
- */
1539
- originalData: any;
1540
- }
1541
- /**
1542
- * Webhook event received from WhatsApp
1543
- */
1544
- interface WebhookEvent {
1545
- /**
1546
- * The field type of the event
1547
- */
1548
- field: string;
1549
- /**
1550
- * The event data
1551
- */
1552
- value: any;
1553
- /**
1554
- * The timestamp when the event was received
1555
- */
1556
- timestamp: number;
1557
- }
1558
- /**
1559
- * Message handler function type
1560
- */
1561
- type MessageHandler = (message: WebhookMessage) => void | Promise<void>;
1562
- /**
1563
- * Message status enum
1564
- */
1565
- declare enum MessageStatus {
1566
- DELIVERED = "delivered",
1567
- READ = "read",
1568
- SENT = "sent",
1569
- }
1570
- //#endregion
1571
- //#region src/types/logger.d.ts
1572
- interface LoggerInterface {
1573
- log(...data: any[]): void;
1574
- error(...data: any[]): void;
1575
- warn(...data: any[]): void;
1576
- info(...data: any[]): void;
1577
- debug(...data: any[]): void;
1578
- }
1579
- //#endregion
1580
- //#region src/api/profile/types/upload.d.ts
1581
- /**
1582
- * Upload session information for creating upload sessions.
1583
- */
1584
- interface UploadSession {
1585
- id: string;
1586
- video?: boolean;
1587
- }
1588
- /**
1589
- * Response from creating an upload session.
1590
- */
1591
- interface UploadSessionResponse {
1592
- id: string;
1593
- }
1594
- /**
1595
- * Response from uploading business profile media.
1596
- */
1597
- interface UploadBusinessProfileResponse {
1598
- h: string;
1599
- }
1600
- /**
1601
- * Upload handle information containing file details and handle.
1602
- */
1603
- interface UploadHandle {
1604
- handle: string;
1605
- file_size: number;
1606
- upload_result: {
1607
- handle_type: string;
1608
- name: string;
1609
- };
1610
- }
1611
- /**
1612
- * Request parameters for creating upload session.
1613
- */
1614
- interface CreateUploadSessionParams {
1615
- /**
1616
- * Length of the file to be uploaded in bytes.
1617
- */
1618
- fileLength: number;
1619
- /**
1620
- * MIME type of the file (e.g., 'image/jpeg').
1621
- */
1622
- fileType: string;
1623
- /**
1624
- * Name of the file with extension.
1625
- */
1626
- fileName: string;
1627
- }
1628
- /**
1629
- * Request parameters for uploading media.
1630
- */
1631
- interface UploadMediaParams {
1632
- /**
1633
- * The upload session ID from createUploadSession response.
1634
- */
1635
- uploadId: string;
1636
- /**
1637
- * The binary data of the file (Buffer).
1638
- */
1639
- file: Buffer;
1640
- }
1641
- /**
1642
- * Request parameters for getting upload handle.
1643
- */
1644
- interface GetUploadHandleParams {
1645
- /**
1646
- * The upload session ID from createUploadSession response.
1647
- */
1648
- uploadId: string;
1649
- }
1650
- //#endregion
1651
- //#region src/api/profile/types/common.d.ts
1652
- /**
1653
- * Available fields that can be requested when retrieving a business profile.
1654
- */
1655
- type BusinessProfileField = 'about' | 'address' | 'description' | 'email' | 'profile_picture_url' | 'websites' | 'vertical';
1656
- type BusinessProfileFieldsParam = BusinessProfileField[] | string;
1657
- /**
1658
- * Business profile data structure containing all profile information.
1659
- */
1660
- interface BusinessProfileData {
1661
- /**
1662
- * The business's About text. This text appears in the business's profile, beneath its profile image,
1663
- * phone number, and contact buttons.
1664
- * - String cannot be empty
1665
- * - Strings must be between 1 and 139 characters
1666
- * - Rendered emojis are supported however their unicode values are not.
1667
- * Emoji unicode values must be Java- or JavaScript-escape encoded
1668
- * - Hyperlinks can be included but will not render as clickable links
1669
- * - Markdown is not supported
1670
- */
1671
- about?: string;
1672
- /**
1673
- * Address of the business. Character limit 256.
1674
- */
1675
- address?: string;
1676
- /**
1677
- * Description of the business. Character limit 512.
1678
- */
1679
- description?: string;
1680
- /**
1681
- * The contact email address (in valid email format) of the business. Character limit 128.
1682
- */
1683
- email?: string;
1684
- /**
1685
- * The messaging service used for the request. Always set it to "whatsapp" if you are using
1686
- * the WhatsApp Business API.
1687
- */
1688
- messaging_product: string;
1689
- /**
1690
- * Profile picture URL.
1691
- */
1692
- profile_picture_url?: string;
1693
- /**
1694
- * The URLs associated with the business. For instance, a website, Facebook Page, or Instagram.
1695
- * - You must include the http:// or https:// portion of the URL
1696
- * - There is a maximum of 2 websites with a maximum of 256 characters each
1697
- */
1698
- websites?: string[];
1699
- /**
1700
- * Business category. This can be either an empty string or one of the predefined business categories.
1701
- * @see BusinessVerticalEnum for all available options
1702
- */
1703
- vertical?: BusinessVerticalEnum | string;
1704
- }
1705
- /**
1706
- * Response structure for business profile GET requests.
1707
- */
1708
- interface BusinessProfileResponse {
1709
- data: BusinessProfileData[];
1710
- }
1711
- /**
1712
- * Request structure for updating business profile.
248
+ * Request structure for updating business profile.
1713
249
  */
1714
250
  interface UpdateBusinessProfileRequest {
1715
251
  /**
@@ -1972,10 +508,6 @@ type TemplateCarousel = {
1972
508
  components: ComponentTypes[];
1973
509
  }>;
1974
510
  };
1975
- type CarouselCard$1 = {
1976
- card_index: number;
1977
- components: ComponentTypes[];
1978
- };
1979
511
  type MediaCarouselCard = {
1980
512
  card_index: number;
1981
513
  components: (TemplateHeader | TemplateBody | TemplateButtons)[];
@@ -2220,9 +752,6 @@ type TextObject = {
2220
752
  body: string;
2221
753
  preview_url?: boolean;
2222
754
  };
2223
- type TextMessageRequestBody = MessageRequestBody<MessageTypesEnum.Text> & {
2224
- [MessageTypesEnum.Text]: [TextObject];
2225
- };
2226
755
  interface TextMessageParams extends MessageRequestParams<TextObject | string> {
2227
756
  previewUrl?: boolean;
2228
757
  }
@@ -2292,7 +821,6 @@ type MessageTemplateObject<T extends ComponentTypesEnum> = {
2292
821
  language: LanguageObject;
2293
822
  components?: (ComponentObject<T> | ButtonComponentObject)[];
2294
823
  };
2295
- type MessageTemplateRequestBody<T extends ComponentTypesEnum> = MessageRequestBody<MessageTypesEnum.Template> & MessageTemplateObject<T>;
2296
824
  //#endregion
2297
825
  //#region src/api/messages/types/media.d.ts
2298
826
  type MetaMediaObject = {
@@ -2304,9 +832,6 @@ type HostedMediaObject = {
2304
832
  link: string;
2305
833
  };
2306
834
  type AudioMediaObject = MetaMediaObject | HostedMediaObject;
2307
- type AudioMessageRequestBody = MessageRequestBody<MessageTypesEnum.Audio> & {
2308
- [MessageTypesEnum.Audio]: [AudioMediaObject];
2309
- };
2310
835
  type MetaDocumentMediaObject = MetaMediaObject & {
2311
836
  caption?: string;
2312
837
  filename?: string;
@@ -2316,9 +841,6 @@ type HostedDocumentMediaObject = HostedMediaObject & {
2316
841
  filename?: string;
2317
842
  };
2318
843
  type DocumentMediaObject = MetaDocumentMediaObject | HostedDocumentMediaObject;
2319
- type DocumentMessageRequestBody = MessageRequestBody<MessageTypesEnum.Document> & {
2320
- [MessageTypesEnum.Document]: [DocumentMediaObject];
2321
- };
2322
844
  type MetaImageMediaObject = MetaMediaObject & {
2323
845
  caption?: string;
2324
846
  };
@@ -2326,9 +848,6 @@ type HostedImageMediaObject = HostedMediaObject & {
2326
848
  caption?: string;
2327
849
  };
2328
850
  type ImageMediaObject = MetaImageMediaObject | HostedImageMediaObject;
2329
- type ImageMessageRequestBody = MessageRequestBody<MessageTypesEnum.Image> & {
2330
- [MessageTypesEnum.Image]: [ImageMediaObject];
2331
- };
2332
851
  type MetaVideoMediaObject = MetaMediaObject & {
2333
852
  caption?: string;
2334
853
  };
@@ -2336,13 +855,7 @@ type HostedVideoMediaObject = HostedMediaObject & {
2336
855
  caption?: string;
2337
856
  };
2338
857
  type VideoMediaObject = MetaVideoMediaObject | HostedVideoMediaObject;
2339
- type VideoMessageRequestBody = MessageRequestBody<MessageTypesEnum.Video> & {
2340
- [MessageTypesEnum.Video]: [VideoMediaObject];
2341
- };
2342
858
  type StickerMediaObject = MetaMediaObject | HostedMediaObject;
2343
- type StickerMessageRequestBody = MessageRequestBody<MessageTypesEnum.Sticker> & {
2344
- [MessageTypesEnum.Sticker]: [StickerMediaObject];
2345
- };
2346
859
  //#endregion
2347
860
  //#region src/api/messages/types/contact.d.ts
2348
861
  type AddressesObject = {
@@ -2389,9 +902,6 @@ type ContactObject = {
2389
902
  phones?: PhoneObject[];
2390
903
  urls?: URLObject[];
2391
904
  };
2392
- type ContactsMessageRequestBody = MessageRequestBody<MessageTypesEnum.Contacts> & {
2393
- [MessageTypesEnum.Contacts]: [ContactObject];
2394
- };
2395
905
  //#endregion
2396
906
  //#region src/api/messages/types/location.d.ts
2397
907
  type LocationObject = {
@@ -2400,9 +910,6 @@ type LocationObject = {
2400
910
  name?: string;
2401
911
  address?: string;
2402
912
  };
2403
- type LocationMessageRequestBody = MessageRequestBody<MessageTypesEnum.Location> & {
2404
- [MessageTypesEnum.Location]: [LocationObject];
2405
- };
2406
913
  //#endregion
2407
914
  //#region src/api/messages/types/interactive.d.ts
2408
915
  type DocumentMediaObject$1 = {
@@ -2577,16 +1084,8 @@ type FlowInteractiveObject = {
2577
1084
  action: FlowActionObject;
2578
1085
  };
2579
1086
  type InteractiveObject = ButtonInteractiveObject | ListInteractiveObject | ProductInteractiveObject | ProductListInteractiveObject | CtaUrlInteractiveObject | LocationRequestInteractiveObject | AddressMessageInteractiveObject | FlowInteractiveObject;
2580
- type InteractiveMessageRequestBody = MessageRequestBody<MessageTypesEnum.Interactive> & {
2581
- [MessageTypesEnum.Interactive]: InteractiveObject;
2582
- };
2583
1087
  //#endregion
2584
1088
  //#region src/api/messages/types/reaction.d.ts
2585
- type ReActionObject = {
2586
- message_id: string;
2587
- emoji: string;
2588
- };
2589
- type ReactionMessageRequestBody = MessageRequestBody<MessageTypesEnum.Reaction> & ReActionObject;
2590
1089
  interface ReactionParams {
2591
1090
  messageId: string;
2592
1091
  emoji: string;
@@ -2601,15 +1100,6 @@ type GeneralMessageBody = GeneralRequestBody & {
2601
1100
  */
2602
1101
  messaging_product: 'whatsapp';
2603
1102
  };
2604
- type StatusObject = {
2605
- status: 'read';
2606
- message_id: string;
2607
- typing_indicator?: TypingIndicatorObject;
2608
- };
2609
- type TypingIndicatorObject = {
2610
- type: 'text';
2611
- };
2612
- type StatusRequestBody = GeneralMessageBody & StatusObject;
2613
1103
  type ConTextObject = {
2614
1104
  message_id: string;
2615
1105
  };
@@ -2624,669 +1114,1330 @@ interface MessageRequestParams<T> {
2624
1114
  to: string;
2625
1115
  replyMessageId?: string;
2626
1116
  }
2627
- interface StatusParams {
2628
- status: string;
2629
- messageId: string;
2630
- typingIndicator?: {
2631
- type: string;
2632
- };
1117
+ interface StatusParams {
1118
+ status: string;
1119
+ messageId: string;
1120
+ typingIndicator?: {
1121
+ type: string;
1122
+ };
1123
+ }
1124
+ type MessagesResponse = GeneralMessageBody & {
1125
+ contacts: [{
1126
+ input: string;
1127
+ wa_id: string;
1128
+ }];
1129
+ messages: [{
1130
+ id: string;
1131
+ }];
1132
+ };
1133
+ declare class MessagesClass extends BaseClass {
1134
+ text(params: TextMessageParams): Promise<MessagesResponse>;
1135
+ template(params: MessageRequestParams<MessageTemplateObject<ComponentTypesEnum>>): Promise<MessagesResponse>;
1136
+ audio(params: MessageRequestParams<AudioMediaObject>): Promise<MessagesResponse>;
1137
+ document(params: MessageRequestParams<DocumentMediaObject>): Promise<MessagesResponse>;
1138
+ image(params: MessageRequestParams<ImageMediaObject>): Promise<MessagesResponse>;
1139
+ video(params: MessageRequestParams<VideoMediaObject>): Promise<MessagesResponse>;
1140
+ sticker(params: MessageRequestParams<StickerMediaObject>): Promise<MessagesResponse>;
1141
+ contacts(params: MessageRequestParams<[ContactObject]>): Promise<MessagesResponse>;
1142
+ location(params: MessageRequestParams<LocationObject>): Promise<MessagesResponse>;
1143
+ interactive(params: MessageRequestParams<InteractiveObject>): Promise<MessagesResponse>;
1144
+ interactiveList(params: MessageRequestParams<InteractiveObject & {
1145
+ type: InteractiveTypesEnum.List;
1146
+ }>): Promise<MessagesResponse>;
1147
+ interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
1148
+ type: InteractiveTypesEnum.CtaUrl;
1149
+ }>): Promise<MessagesResponse>;
1150
+ interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
1151
+ type: InteractiveTypesEnum.LocationRequest;
1152
+ }>): Promise<MessagesResponse>;
1153
+ interactiveAddressMessage(params: MessageRequestParams<InteractiveObject & {
1154
+ type: InteractiveTypesEnum.AddressMessage;
1155
+ }>): Promise<MessagesResponse>;
1156
+ interactiveReplyButtons(params: MessageRequestParams<InteractiveObject & {
1157
+ type: InteractiveTypesEnum.Button;
1158
+ }>): Promise<MessagesResponse>;
1159
+ interactiveFlow(params: MessageRequestParams<InteractiveObject & {
1160
+ type: InteractiveTypesEnum.Flow;
1161
+ }>): Promise<MessagesResponse>;
1162
+ reaction(params: ReactionParams): Promise<MessagesResponse>;
1163
+ markAsRead(params: {
1164
+ messageId: string;
1165
+ }): Promise<MessagesResponse>;
1166
+ showTypingIndicator(params: {
1167
+ messageId: string;
1168
+ }): Promise<MessagesResponse>;
1169
+ status(params: StatusParams): Promise<MessagesResponse>;
1170
+ }
1171
+ //#endregion
1172
+ //#region src/api/media/types/common.d.ts
1173
+ type MediaResponse = {
1174
+ id: string;
1175
+ url: string;
1176
+ mime_type: string;
1177
+ sha256: string;
1178
+ file_size: number;
1179
+ messaging_product: 'whatsapp';
1180
+ };
1181
+ type MediasResponse = {
1182
+ data: MediaResponse[];
1183
+ paging: {
1184
+ cursors: {
1185
+ before: string;
1186
+ after: string;
1187
+ };
1188
+ };
1189
+ };
1190
+ type UploadMediaResponse = {
1191
+ id: string;
1192
+ };
1193
+ interface MediaClass {
1194
+ getMediaById(mediaId: string, phone_number_id?: string): Promise<MediaResponse>;
1195
+ uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
1196
+ deleteMedia(mediaId: string, phone_number_id?: string): Promise<ResponseSuccess>;
1197
+ downloadMedia(mediaUrl: string): Promise<Blob>;
1198
+ }
1199
+ //#endregion
1200
+ //#region src/api/flow/types/common.d.ts
1201
+ /**
1202
+ * Enum for Flow Status
1203
+ */
1204
+ declare enum FlowStatusEnum {
1205
+ Draft = "DRAFT",
1206
+ Published = "PUBLISHED",
1207
+ Throttled = "THROTTLED",
1208
+ Blocked = "BLOCKED",
1209
+ Deprecated = "DEPRECATED",
1210
+ }
1211
+ /**
1212
+ * Enum for Flow Categories
1213
+ */
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",
1223
+ }
1224
+ declare enum FlowActionEnum {
1225
+ INIT = "INIT",
1226
+ BACK = "BACK",
1227
+ DATA_EXCHANGE = "data_exchange",
1228
+ }
1229
+ /**
1230
+ * Enum for Flow Types in webhook handlers
1231
+ * Used to register handlers for specific flow events
1232
+ */
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 = "*",
1242
+ }
1243
+ type FlowType = (typeof FlowTypeEnum)[keyof typeof FlowTypeEnum];
1244
+ /**
1245
+ * Flow Validation Error Pointer
1246
+ */
1247
+ interface FlowValidationErrorPointer {
1248
+ line_start: number;
1249
+ line_end: number;
1250
+ column_start: number;
1251
+ column_end: number;
1252
+ path: string;
1253
+ }
1254
+ /**
1255
+ * Flow Validation Error
1256
+ */
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[];
1266
+ }
1267
+ /**
1268
+ * Flow Item
1269
+ */
1270
+ interface Flow {
1271
+ id: string;
1272
+ name: string;
1273
+ status: FlowStatusEnum;
1274
+ categories: FlowCategoryEnum[];
1275
+ validation_errors: FlowValidationError[];
1276
+ }
1277
+ /**
1278
+ * Pagination Cursors
1279
+ */
1280
+ interface PaginationCursors {
1281
+ before: string;
1282
+ after: string;
1283
+ }
1284
+ /**
1285
+ * Pagination Object
1286
+ */
1287
+ interface Pagination {
1288
+ cursors: PaginationCursors;
1289
+ }
1290
+ /**
1291
+ * Flows List Response
1292
+ */
1293
+ interface FlowsListResponse {
1294
+ data: Flow[];
1295
+ paging: Pagination;
2633
1296
  }
2634
- type MessagesResponse = GeneralMessageBody & {
2635
- contacts: [{
2636
- input: string;
2637
- wa_id: string;
2638
- }];
2639
- messages: [{
2640
- id: string;
2641
- }];
2642
- };
2643
- declare class MessagesClass extends BaseClass {
2644
- text(params: TextMessageParams): Promise<MessagesResponse>;
2645
- template(params: MessageRequestParams<MessageTemplateObject<ComponentTypesEnum>>): Promise<MessagesResponse>;
2646
- audio(params: MessageRequestParams<AudioMediaObject>): Promise<MessagesResponse>;
2647
- document(params: MessageRequestParams<DocumentMediaObject>): Promise<MessagesResponse>;
2648
- image(params: MessageRequestParams<ImageMediaObject>): Promise<MessagesResponse>;
2649
- video(params: MessageRequestParams<VideoMediaObject>): Promise<MessagesResponse>;
2650
- sticker(params: MessageRequestParams<StickerMediaObject>): Promise<MessagesResponse>;
2651
- contacts(params: MessageRequestParams<[ContactObject]>): Promise<MessagesResponse>;
2652
- location(params: MessageRequestParams<LocationObject>): Promise<MessagesResponse>;
2653
- interactive(params: MessageRequestParams<InteractiveObject>): Promise<MessagesResponse>;
2654
- interactiveList(params: MessageRequestParams<InteractiveObject & {
2655
- type: InteractiveTypesEnum.List;
2656
- }>): Promise<MessagesResponse>;
2657
- interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
2658
- type: InteractiveTypesEnum.CtaUrl;
2659
- }>): Promise<MessagesResponse>;
2660
- interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
2661
- type: InteractiveTypesEnum.LocationRequest;
2662
- }>): Promise<MessagesResponse>;
2663
- interactiveAddressMessage(params: MessageRequestParams<InteractiveObject & {
2664
- type: InteractiveTypesEnum.AddressMessage;
2665
- }>): Promise<MessagesResponse>;
2666
- interactiveReplyButtons(params: MessageRequestParams<InteractiveObject & {
2667
- type: InteractiveTypesEnum.Button;
2668
- }>): Promise<MessagesResponse>;
2669
- interactiveFlow(params: MessageRequestParams<InteractiveObject & {
2670
- type: InteractiveTypesEnum.Flow;
2671
- }>): Promise<MessagesResponse>;
2672
- reaction(params: ReactionParams): Promise<MessagesResponse>;
2673
- markAsRead(params: {
2674
- messageId: string;
2675
- }): Promise<MessagesResponse>;
2676
- showTypingIndicator(params: {
2677
- messageId: string;
2678
- }): Promise<MessagesResponse>;
2679
- status(params: StatusParams): Promise<MessagesResponse>;
1297
+ /**
1298
+ * Flow Asset
1299
+ */
1300
+ interface FlowAsset {
1301
+ name: string;
1302
+ asset_type: string;
1303
+ download_url: string;
2680
1304
  }
2681
- //#endregion
2682
- //#region src/api/media/types/common.d.ts
2683
- type MediaResponse = {
1305
+ /**
1306
+ * Flow Assets Response
1307
+ */
1308
+ interface FlowAssetsResponse {
1309
+ data: FlowAsset[];
1310
+ paging: Pagination;
1311
+ }
1312
+ /**
1313
+ * Flow Preview
1314
+ */
1315
+ interface FlowPreview {
1316
+ preview_url: string;
1317
+ expires_at: string;
1318
+ }
1319
+ /**
1320
+ * Flow Preview Response
1321
+ */
1322
+ interface FlowPreviewResponse {
1323
+ preview: FlowPreview;
2684
1324
  id: string;
2685
- url: string;
2686
- mime_type: string;
2687
- sha256: string;
2688
- file_size: number;
2689
- messaging_product: 'whatsapp';
2690
- };
2691
- type MediasResponse = {
2692
- data: MediaResponse[];
2693
- paging: {
2694
- cursors: {
2695
- before: string;
2696
- after: string;
2697
- };
2698
- };
2699
- };
2700
- type UploadMediaResponse = {
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 {
2701
1346
  id: string;
2702
- };
2703
- interface MediaClass {
2704
- getMediaById(mediaId: string, phone_number_id?: string): Promise<MediaResponse>;
2705
- uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
2706
- deleteMedia(mediaId: string, phone_number_id?: string): Promise<ResponseSuccess>;
2707
- downloadMedia(mediaUrl: string): Promise<Blob>;
1347
+ success: boolean;
1348
+ validation_errors?: FlowValidationError[];
2708
1349
  }
2709
- //#endregion
2710
- //#region src/api/qrCode/types/common.d.ts
2711
- type QrCodeResponse = {
2712
- code: string;
2713
- prefilled_message: string;
2714
- deep_link_url: string;
2715
- qr_image_url?: string;
2716
- };
2717
- type QrCodesResponse = ResponseData<QrCodeResponse[]>;
2718
- type CreateQrCodeRequest = {
2719
- prefilled_message: string;
2720
- generate_qr_image?: 'SVG' | 'PNG';
2721
- };
2722
- type UpdateQrCodeRequest = {
2723
- code: string;
2724
- prefilled_message: string;
2725
- };
2726
- interface QrCodeClass {
2727
- createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
2728
- getQrCodes(): Promise<QrCodesResponse>;
2729
- getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
2730
- updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
2731
- deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
1350
+ /**
1351
+ * Update Flow Response
1352
+ */
1353
+ interface UpdateFlowResponse {
1354
+ success: boolean;
1355
+ validation_errors?: FlowValidationError[];
2732
1356
  }
2733
- //#endregion
2734
- //#region src/api/waba/types/common.d.ts
2735
1357
  /**
2736
- * WhatsApp Business Account subscription configuration
1358
+ * Flow Migration Response
2737
1359
  */
2738
- type WabaSubscription = {
2739
- whatsapp_business_api_data: {
2740
- id: string;
2741
- link: string;
2742
- name: string;
2743
- category: string;
2744
- };
2745
- override_callback_uri?: string;
2746
- };
1360
+ interface FlowMigrationResponse {
1361
+ migrated_flows: FlowMigrationResult[];
1362
+ failed_flows: FlowMigrationFailure[];
1363
+ }
2747
1364
  /**
2748
- * Parameters for updating WABA subscription
1365
+ * Validate Flow JSON Response
2749
1366
  */
2750
- interface UpdateWabaSubscription {
2751
- override_callback_uri: string;
2752
- verify_token: string;
1367
+ interface ValidateFlowJsonResponse {
1368
+ valid: boolean;
1369
+ success: boolean;
1370
+ validation_errors?: FlowValidationError[];
2753
1371
  }
2754
1372
  /**
2755
- * Response containing all WABA subscriptions
1373
+ * WhatsApp Flow Endpoint - Encrypted Request Payload
1374
+ * Represents the raw encrypted data received from WhatsApp
2756
1375
  */
2757
- interface WabaSubscriptions {
2758
- data: Array<WabaSubscription>;
1376
+ interface FlowEncryptedRequestPayload {
1377
+ encrypted_aes_key: string;
1378
+ encrypted_flow_data: string;
1379
+ initial_vector: string;
2759
1380
  }
2760
1381
  /**
2761
- * WABA account review status enumeration
1382
+ * WhatsApp Flow Endpoint - Decrypted Request Response
1383
+ * Represents the successfully decrypted data and encryption keys
2762
1384
  */
2763
- declare enum WabaAccountReviewStatus {
2764
- Approved = "APPROVED",
2765
- Active = "ACTIVE",
2766
- Inactive = "INACTIVE",
2767
- Disabled = "DISABLED",
1385
+ interface FlowDecryptedRequestResponse {
1386
+ decryptedBody: any;
1387
+ aesKeyBuffer: Buffer;
1388
+ initialVectorBuffer: Buffer;
2768
1389
  }
2769
1390
  /**
2770
- * WABA health status for message sending capability
1391
+ * WhatsApp Flow Endpoint - HTTP Request with Body
1392
+ * Represents an HTTP request with the encrypted payload
2771
1393
  */
2772
- declare enum WabaHealthStatusCanSendMessage {
2773
- Blocked = "BLOCKED",
2774
- Limited = "LIMITED",
2775
- Available = "AVAILABLE",
1394
+ interface FlowHttpRequest extends IncomingMessage {
1395
+ body: FlowEncryptedRequestPayload;
1396
+ headers: IncomingHttpHeaders;
2776
1397
  }
2777
1398
  /**
2778
- * WABA account status enumeration
1399
+ * WhatsApp Flow Endpoint - Health Check Request
1400
+ * Represents the structure of a health check request
2779
1401
  */
2780
- declare enum WabaAccountStatus {
2781
- Approved = "APPROVED",
2782
- Active = "ACTIVE",
2783
- Inactive = "INACTIVE",
2784
- Disabled = "DISABLED",
1402
+ interface FlowHealthCheckRequest {
1403
+ action: 'ping';
1404
+ version: '3.0';
2785
1405
  }
2786
1406
  /**
2787
- * Business verification status enumeration
1407
+ * WhatsApp Flow Endpoint - Health Check Response
1408
+ * The expected response structure for health check requests
2788
1409
  */
2789
- declare enum WabaBusinessVerificationStatus {
2790
- Verified = "verified",
2791
- PendingSubmission = "pending_submission",
2792
- Unverified = "unverified",
2793
- Rejected = "rejected",
1410
+ interface FlowHealthCheckResponse {
1411
+ data: {
1412
+ status: 'active';
1413
+ };
1414
+ }
1415
+ /**
1416
+ * WhatsApp Flow Endpoint - Data Exchange Request
1417
+ * Represents the structure of a data exchange request
1418
+ */
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
+ };
2794
1427
  }
2795
1428
  /**
2796
- * WABA health status error details
1429
+ * WhatsApp Flow Endpoint - Data Exchange Response
1430
+ * The expected response structure for data exchange requests
2797
1431
  */
2798
- interface WabaHealthStatusError {
2799
- error_code?: number;
2800
- error_description?: string;
2801
- possible_solution?: string;
1432
+ interface FlowDataExchangeResponse {
1433
+ screen?: string;
1434
+ data?: Record<string, any | {
1435
+ error_message?: string;
1436
+ }>;
2802
1437
  }
2803
1438
  /**
2804
- * WABA health status entity information
1439
+ * WhatsApp Flow Endpoint - Success Screen Response
1440
+ * The expected response structure for success screen requests
2805
1441
  */
2806
- interface WabaHealthStatusEntity {
2807
- entity_type?: string;
2808
- id?: string;
2809
- can_send_message?: string;
2810
- errors?: WabaHealthStatusError[];
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
+ };
2811
1452
  }
2812
1453
  /**
2813
- * Overall WABA health status
1454
+ * WhatsApp Flow Endpoint - Error Notification Request
1455
+ * Represents the structure of an error notification request
2814
1456
  */
2815
- interface WabaHealthStatus {
2816
- can_send_message?: WabaHealthStatusCanSendMessage;
2817
- entities?: WabaHealthStatusEntity[];
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
+ };
2818
1466
  }
2819
1467
  /**
2820
- * WhatsApp Business Account information
1468
+ * WhatsApp Flow Endpoint - Error Notification Response
1469
+ * The expected response structure for error notification requests
2821
1470
  */
2822
- interface WabaAccount {
2823
- account_review_status?: WabaAccountReviewStatus;
2824
- id?: string;
2825
- health_status?: WabaHealthStatus;
2826
- status?: WabaAccountStatus;
2827
- business_verification_status?: WabaBusinessVerificationStatus;
2828
- message_template_namespace?: string;
2829
- name?: string;
2830
- ownership_type?: string;
2831
- currency?: string;
1471
+ interface FlowErrorNotificationResponse {
1472
+ acknowledged: boolean;
2832
1473
  }
2833
1474
  /**
2834
- * Available fields for WABA account queries
2835
- */
2836
- type WabaAccountFields = 'id' | 'name' | 'account_review_status' | 'auth_international_rate_eligibility' | 'business_verification_status' | 'country' | 'currency' | 'health_status' | 'status' | 'ownership_type' | 'message_template_namespace';
2837
- /**
2838
- * 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
2839
1478
  */
2840
- 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
+ }
2841
1489
  /**
2842
- * Interface defining all WABA API methods
1490
+ * WhatsApp Flow Endpoint - Response
1491
+ * Union type for all possible response types from a Flow endpoint
2843
1492
  */
2844
- interface WABAClass {
2845
- getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
2846
- getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
2847
- updateWabaSubscription(params: UpdateWabaSubscription): Promise<ResponseSuccess>;
2848
- 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>;
2849
1598
  }
2850
1599
  //#endregion
2851
- //#region src/utils/isMetaError.d.ts
2852
- interface MetaError extends Error {
2853
- error: {
2854
- message: string;
2855
- 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
+ */
2856
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
+ */
2857
1685
  error_data?: {
2858
- messaging_product: 'whatsapp';
1686
+ /**
1687
+ * Describes the error details
1688
+ */
2859
1689
  details: string;
2860
1690
  };
2861
- error_subcode?: number;
2862
- fbtrace_id: string;
2863
- };
1691
+ }>;
2864
1692
  }
2865
1693
  /**
2866
- * Determines if the error is a Meta API error response
2867
- * @param error Any error object to check
2868
- * @returns Type guard indicating if error is a Meta API error
1694
+ * Text message interface
2869
1695
  */
2870
- declare function isMetaError(error: any): error is MetaError;
2871
- //#endregion
2872
- //#region src/api/registration/types/common.d.ts
2873
- type RegistrationRequest = {
2874
- messaging_product: 'whatsapp';
2875
- pin: string;
2876
- data_localization_region?: DataLocalizationRegionEnum;
2877
- };
2878
- interface RegistrationClass {
2879
- register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess>;
2880
- deregister(): Promise<ResponseSuccess>;
2881
- }
2882
- //#endregion
2883
- //#region src/api/twoStepVerification/types/common.d.ts
2884
- type TwoStepVerificationRequest = {
2885
- pin: string;
2886
- };
2887
- interface TwoStepVerificationClass {
2888
- setTwoStepVerificationCode(pin: string): Promise<ResponseSuccess>;
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
+ };
2889
1705
  }
2890
- //#endregion
2891
- //#region src/api/flow/types/common.d.ts
2892
1706
  /**
2893
- * Enum for Flow Status
1707
+ * Image message interface
2894
1708
  */
2895
- declare enum FlowStatusEnum {
2896
- Draft = "DRAFT",
2897
- Published = "PUBLISHED",
2898
- Throttled = "THROTTLED",
2899
- Blocked = "BLOCKED",
2900
- Deprecated = "DEPRECATED",
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
+ };
2901
1729
  }
2902
1730
  /**
2903
- * Enum for Flow Categories
1731
+ * Video message interface
2904
1732
  */
2905
- declare enum FlowCategoryEnum {
2906
- SignUp = "SIGN_UP",
2907
- SignIn = "SIGN_IN",
2908
- AppointmentBooking = "APPOINTMENT_BOOKING",
2909
- LeadGeneration = "LEAD_GENERATION",
2910
- ContactUs = "CONTACT_US",
2911
- CustomerSupport = "CUSTOMER_SUPPORT",
2912
- Survey = "SURVEY",
2913
- Other = "OTHER",
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
+ };
2914
1753
  }
2915
- declare enum FlowActionEnum {
2916
- INIT = "INIT",
2917
- BACK = "BACK",
2918
- DATA_EXCHANGE = "data_exchange",
1754
+ /**
1755
+ * Audio message interface
1756
+ */
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
+ };
2919
1773
  }
2920
1774
  /**
2921
- * Enum for Flow Types in webhook handlers
2922
- * Used to register handlers for specific flow events
1775
+ * Document message interface
2923
1776
  */
2924
- declare enum FlowTypeEnum {
2925
- /** Health check/ping requests */
2926
- Ping = "ping",
2927
- /** Data exchange requests */
2928
- Change = "data_exchange",
2929
- /** Error notification requests */
2930
- Error = "error",
2931
- /** Match all flow action types */
2932
- All = "*",
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
+ };
2933
1801
  }
2934
- type FlowType = (typeof FlowTypeEnum)[keyof typeof FlowTypeEnum];
2935
1802
  /**
2936
- * Flow Validation Error Pointer
1803
+ * Sticker message interface
2937
1804
  */
2938
- interface FlowValidationErrorPointer {
2939
- line_start: number;
2940
- line_end: number;
2941
- column_start: number;
2942
- column_end: number;
2943
- path: 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
+ };
2944
1821
  }
2945
1822
  /**
2946
- * Flow Validation Error
1823
+ * Reaction message interface
2947
1824
  */
2948
- interface FlowValidationError {
2949
- error: string;
2950
- error_type: string;
2951
- message: string;
2952
- line_start: number;
2953
- line_end: number;
2954
- column_start: number;
2955
- column_end: number;
2956
- pointers: FlowValidationErrorPointer[];
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
+ };
2957
1837
  }
2958
1838
  /**
2959
- * Flow Item
1839
+ * Contacts message interface
2960
1840
  */
2961
- interface Flow {
2962
- id: string;
2963
- name: string;
2964
- status: FlowStatusEnum;
2965
- categories: FlowCategoryEnum[];
2966
- validation_errors: FlowValidationError[];
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
+ }>;
2967
1920
  }
2968
1921
  /**
2969
- * Pagination Cursors
1922
+ * Location message interface
2970
1923
  */
2971
- interface PaginationCursors {
2972
- before: string;
2973
- after: 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
+ };
2974
1944
  }
2975
1945
  /**
2976
- * Pagination Object
1946
+ * Interactive message interface
2977
1947
  */
2978
- interface Pagination {
2979
- cursors: PaginationCursors;
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
+ };
2980
1989
  }
2981
1990
  /**
2982
- * Flows List Response
1991
+ * System message interface
2983
1992
  */
2984
- interface FlowsListResponse {
2985
- data: Flow[];
2986
- paging: Pagination;
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
+ };
2987
2018
  }
2988
2019
  /**
2989
- * Flow Asset
2020
+ * Order message interface
2990
2021
  */
2991
- interface FlowAsset {
2992
- name: string;
2993
- asset_type: string;
2994
- download_url: 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
+ };
2995
2055
  }
2996
2056
  /**
2997
- * Flow Assets Response
2057
+ * Button message interface
2998
2058
  */
2999
- interface FlowAssetsResponse {
3000
- data: FlowAsset[];
3001
- paging: Pagination;
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
+ };
3002
2071
  }
3003
2072
  /**
3004
- * Flow Preview
2073
+ * Union type for all message types
3005
2074
  */
3006
- interface FlowPreview {
3007
- preview_url: string;
3008
- expires_at: string;
3009
- }
2075
+
3010
2076
  /**
3011
- * Flow Preview 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
3012
2079
  */
3013
- interface FlowPreviewResponse {
3014
- preview: FlowPreview;
2080
+ interface WebhookMessage {
2081
+ /**
2082
+ * The WhatsApp Business Account ID
2083
+ */
2084
+ wabaId: string;
2085
+ /**
2086
+ * The message ID
2087
+ */
3015
2088
  id: string;
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;
3016
2233
  }
3017
2234
  /**
3018
- * Flow Migration Result
2235
+ * Webhook event received from WhatsApp
3019
2236
  */
3020
- interface FlowMigrationResult {
3021
- source_name: string;
3022
- source_id: string;
3023
- migrated_id: string;
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;
3024
2250
  }
3025
2251
  /**
3026
- * Flow Migration Failure
2252
+ * Message status enum
3027
2253
  */
3028
- interface FlowMigrationFailure {
3029
- source_name: string;
3030
- error_code: string;
3031
- error_message: string;
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>;
3032
2277
  }
2278
+ //#endregion
2279
+ //#region src/api/waba/types/common.d.ts
3033
2280
  /**
3034
- * Create Flow Response
2281
+ * WhatsApp Business Account subscription configuration
3035
2282
  */
3036
- interface CreateFlowResponse {
3037
- id: string;
3038
- success: boolean;
3039
- validation_errors?: FlowValidationError[];
3040
- }
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
+ };
3041
2292
  /**
3042
- * Update Flow Response
2293
+ * Parameters for updating WABA subscription
3043
2294
  */
3044
- interface UpdateFlowResponse {
3045
- success: boolean;
3046
- validation_errors?: FlowValidationError[];
2295
+ interface UpdateWabaSubscription {
2296
+ override_callback_uri: string;
2297
+ verify_token: string;
3047
2298
  }
3048
2299
  /**
3049
- * Flow Migration Response
2300
+ * Response containing all WABA subscriptions
3050
2301
  */
3051
- interface FlowMigrationResponse {
3052
- migrated_flows: FlowMigrationResult[];
3053
- failed_flows: FlowMigrationFailure[];
2302
+ interface WabaSubscriptions {
2303
+ data: Array<WabaSubscription>;
3054
2304
  }
3055
2305
  /**
3056
- * Validate Flow JSON Response
2306
+ * WABA account review status enumeration
3057
2307
  */
3058
- interface ValidateFlowJsonResponse {
3059
- valid: boolean;
3060
- success: boolean;
3061
- validation_errors?: FlowValidationError[];
2308
+ declare enum WabaAccountReviewStatus {
2309
+ Approved = "APPROVED",
2310
+ Active = "ACTIVE",
2311
+ Inactive = "INACTIVE",
2312
+ Disabled = "DISABLED",
3062
2313
  }
3063
2314
  /**
3064
- * WhatsApp Flow Endpoint - Encrypted Request Payload
3065
- * Represents the raw encrypted data received from WhatsApp
2315
+ * WABA health status for message sending capability
3066
2316
  */
3067
- interface FlowEncryptedRequestPayload {
3068
- encrypted_aes_key: string;
3069
- encrypted_flow_data: string;
3070
- initial_vector: string;
2317
+ declare enum WabaHealthStatusCanSendMessage {
2318
+ Blocked = "BLOCKED",
2319
+ Limited = "LIMITED",
2320
+ Available = "AVAILABLE",
3071
2321
  }
3072
2322
  /**
3073
- * WhatsApp Flow Endpoint - Decrypted Request Response
3074
- * Represents the successfully decrypted data and encryption keys
2323
+ * WABA account status enumeration
3075
2324
  */
3076
- interface FlowDecryptedRequestResponse {
3077
- decryptedBody: any;
3078
- aesKeyBuffer: Buffer;
3079
- initialVectorBuffer: Buffer;
2325
+ declare enum WabaAccountStatus {
2326
+ Approved = "APPROVED",
2327
+ Active = "ACTIVE",
2328
+ Inactive = "INACTIVE",
2329
+ Disabled = "DISABLED",
3080
2330
  }
3081
2331
  /**
3082
- * WhatsApp Flow Endpoint - HTTP Request with Body
3083
- * Represents an HTTP request with the encrypted payload
2332
+ * Business verification status enumeration
3084
2333
  */
3085
- interface FlowHttpRequest extends IncomingMessage {
3086
- body: FlowEncryptedRequestPayload;
3087
- headers: IncomingHttpHeaders;
2334
+ declare enum WabaBusinessVerificationStatus {
2335
+ Verified = "verified",
2336
+ PendingSubmission = "pending_submission",
2337
+ Unverified = "unverified",
2338
+ Rejected = "rejected",
3088
2339
  }
3089
2340
  /**
3090
- * WhatsApp Flow Endpoint - Health Check Request
3091
- * Represents the structure of a health check request
2341
+ * WABA health status error details
3092
2342
  */
3093
- interface FlowHealthCheckRequest {
3094
- action: 'ping';
3095
- version: '3.0';
2343
+ interface WabaHealthStatusError {
2344
+ error_code?: number;
2345
+ error_description?: string;
2346
+ possible_solution?: string;
3096
2347
  }
3097
2348
  /**
3098
- * WhatsApp Flow Endpoint - Health Check Response
3099
- * The expected response structure for health check requests
2349
+ * WABA health status entity information
3100
2350
  */
3101
- interface FlowHealthCheckResponse {
3102
- data: {
3103
- status: 'active';
3104
- };
2351
+ interface WabaHealthStatusEntity {
2352
+ entity_type?: string;
2353
+ id?: string;
2354
+ can_send_message?: string;
2355
+ errors?: WabaHealthStatusError[];
3105
2356
  }
3106
2357
  /**
3107
- * WhatsApp Flow Endpoint - Data Exchange Request
3108
- * Represents the structure of a data exchange request
2358
+ * Overall WABA health status
3109
2359
  */
3110
- interface FlowDataExchangeRequest {
3111
- version: '3.0';
3112
- action: FlowActionEnum;
3113
- screen: string;
3114
- flow_token: string;
3115
- data?: Record<string, any> & {
3116
- error_message?: string;
3117
- };
2360
+ interface WabaHealthStatus {
2361
+ can_send_message?: WabaHealthStatusCanSendMessage;
2362
+ entities?: WabaHealthStatusEntity[];
3118
2363
  }
3119
2364
  /**
3120
- * WhatsApp Flow Endpoint - Data Exchange Response
3121
- * The expected response structure for data exchange requests
2365
+ * WhatsApp Business Account information
3122
2366
  */
3123
- interface FlowDataExchangeResponse {
3124
- screen?: string;
3125
- data?: Record<string, any | {
3126
- error_message?: string;
3127
- }>;
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;
3128
2377
  }
3129
2378
  /**
3130
- * WhatsApp Flow Endpoint - Success Screen Response
3131
- * The expected response structure for success screen requests
2379
+ * Available fields for WABA account queries
3132
2380
  */
3133
- interface FlowSuccessScreenResponse {
3134
- screen: 'SUCCESS';
3135
- data: {
3136
- extension_message_response?: {
3137
- params?: {
3138
- flow_token: string;
3139
- [key: string]: string;
3140
- };
3141
- };
3142
- };
3143
- }
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';
3144
2382
  /**
3145
- * WhatsApp Flow Endpoint - Error Notification Request
3146
- * Represents the structure of an error notification request
2383
+ * Parameter type for specifying which WABA account fields to retrieve
3147
2384
  */
3148
- interface FlowErrorNotificationRequest {
3149
- version: '3.0';
3150
- action: Exclude<FlowActionEnum, FlowActionEnum.BACK>;
3151
- screen: string;
3152
- flow_token: string;
3153
- data: {
3154
- error: string;
3155
- error_message: string;
3156
- };
3157
- }
2385
+ type WabaAccountFieldsParam = WabaAccountFields[];
3158
2386
  /**
3159
- * WhatsApp Flow Endpoint - Error Notification Response
3160
- * The expected response structure for error notification requests
2387
+ * Interface defining all WABA API methods
3161
2388
  */
3162
- interface FlowErrorNotificationResponse {
3163
- acknowledged: boolean;
2389
+ interface WABAClass {
2390
+ getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
2391
+ getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
2392
+ updateWabaSubscription(params: UpdateWabaSubscription): Promise<ResponseSuccess>;
2393
+ unsubscribeFromWaba(): Promise<ResponseSuccess>;
3164
2394
  }
3165
- /**
3166
- * WhatsApp Flow Endpoint - Comprehensive Request Object
3167
- * A combined type that includes all possible fields from different request types
3168
- * with all fields being optional for flexibility
3169
- */
3170
- interface FlowEndpointRequest {
3171
- version?: '3.0';
3172
- action?: 'ping' | FlowActionEnum;
3173
- screen?: string;
3174
- flow_token?: string;
3175
- data?: Record<string, any> & {
3176
- error_key?: string;
3177
- error_message?: string;
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;
3178
2433
  };
3179
2434
  }
3180
2435
  /**
3181
- * WhatsApp Flow Endpoint - Response
3182
- * 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
3183
2439
  */
3184
- type FlowEndpointResponse = FlowHealthCheckResponse | FlowDataExchangeResponse | FlowErrorNotificationResponse | FlowSuccessScreenResponse;
3185
- interface FlowClass {
3186
- /**
3187
- * List Flows
3188
- *
3189
- * @param wabaId - The WABA ID
3190
- * @returns Promise with the list of flows
3191
- */
3192
- listFlows(wabaId: string): Promise<FlowsListResponse>;
3193
- /**
3194
- * Create Flow
3195
- *
3196
- * @param wabaId - The WABA ID
3197
- * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
3198
- * @returns Promise with the created flow ID
3199
- */
3200
- createFlow(wabaId: string, data: {
3201
- name: string;
3202
- categories?: FlowCategoryEnum[];
3203
- endpoint_uri?: string;
3204
- clone_flow_id?: string;
3205
- flow_json?: string;
3206
- publish?: boolean;
3207
- }): Promise<CreateFlowResponse>;
3208
- /**
3209
- * Get Flow
3210
- *
3211
- * @param flowId - The flow ID
3212
- * @param fields - Optional fields to return
3213
- * @param dateFormat - Optional date format
3214
- * @returns Promise with the flow details
3215
- */
3216
- getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
3217
- /**
3218
- * Update Flow Metadata
3219
- *
3220
- * @param flowId - The flow ID
3221
- * @param data - The flow metadata to update
3222
- * @returns Promise with the success status
3223
- */
3224
- updateFlowMetadata(flowId: string, data: {
3225
- name?: string;
3226
- categories?: FlowCategoryEnum[];
3227
- endpoint_uri?: string;
3228
- application_id?: string;
3229
- }): Promise<ResponseSuccess>;
3230
- /**
3231
- * Delete Flow
3232
- *
3233
- * @param flowId - The flow ID
3234
- * @returns Promise with the success status
3235
- */
3236
- deleteFlow(flowId: string): Promise<ResponseSuccess>;
3237
- /**
3238
- * List Assets (Get Flow JSON URL)
3239
- *
3240
- * @param flowId - The flow ID
3241
- * @returns Promise with the list of assets
3242
- */
3243
- listAssets(flowId: string): Promise<FlowAssetsResponse>;
3244
- /**
3245
- * Update Flow JSON
3246
- *
3247
- * @param flowId - The flow ID
3248
- * @param data - The asset data including asset_type, file, and name
3249
- * @returns Promise with the success status and validation errors
3250
- */
3251
- updateFlowJson(flowId: string, data: {
3252
- file: Blob | Buffer | object;
3253
- name?: string;
3254
- }): Promise<UpdateFlowResponse>;
3255
- /**
3256
- * Validate Flow JSON by attempting an update without publishing.
3257
- * This is a convenience method; the API doesn't have a dedicated validation endpoint.
3258
- *
3259
- * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).
3260
- * @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.
3261
- * @returns Promise indicating if the JSON is valid and includes validation errors if any.
3262
- */
3263
- validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
3264
- /**
3265
- * Publish Flow
3266
- *
3267
- * @param flowId - The flow ID
3268
- * @returns Promise with the success status
3269
- */
3270
- publishFlow(flowId: string): Promise<ResponseSuccess>;
3271
- /**
3272
- * Deprecate Flow
3273
- *
3274
- * @param flowId - The flow ID
3275
- * @returns Promise with the success status
3276
- */
3277
- deprecateFlow(flowId: string): Promise<ResponseSuccess>;
3278
- /**
3279
- * Migrate Flows
3280
- *
3281
- * @param wabaId - The destination WABA ID
3282
- * @param data - The migration data including source_waba_id and optional source_flow_names
3283
- * @returns Promise with migration results
3284
- */
3285
- migrateFlows(wabaId: string, data: {
3286
- source_waba_id: string;
3287
- source_flow_names?: string[];
3288
- }): Promise<FlowMigrationResponse>;
3289
- }
2440
+
3290
2441
  //#endregion
3291
- export { type AccountMode, type AudioMediaObject, AudioMediaTypesEnum, type AuthenticationTemplateOptions, BaseAPI, 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 CreateFlowResponse, type CreateQrCodeRequest, CurrencyCodesEnum, type CurrencyParameter, type Cursors, DataLocalizationRegionEnum, type DateTimeParameter, type DocumentMediaObject, DocumentMediaTypesEnum, EncryptionClass, 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, 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, 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, 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 TwoStepVerificationClass, type TwoStepVerificationParams, type TwoStepVerificationRequest, type URLButton, type UpdateBusinessProfileRequest, type UpdateFlowResponse, type UpdateQrCodeRequest, type UpdateWabaSubscription, type UploadBusinessProfileResponse, type UploadHandle, type UploadMediaResponse, type UploadSessionResponse, 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, enums_d_exports, isMetaError };
3292
- //# sourceMappingURL=index-C37I1sT7.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