meta-cloud-api 0.0.17 → 0.0.18

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.
@@ -394,51 +394,51 @@ declare class MessagesClass extends BaseClass {
394
394
  /**
395
395
  * Sends an audio message via WhatsApp
396
396
  * @param body The audio media object
397
- * @param recipient Recipient's phone number
397
+ * @param to Recipient's phone number
398
398
  * @param replyMessageId Optional message ID to reply to
399
399
  * @returns Promise with the message response
400
400
  */
401
- audio(body: AudioMediaObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
401
+ audio(body: AudioMediaObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
402
402
  /**
403
403
  * Sends a contact card via WhatsApp
404
404
  * @param body The contact object
405
- * @param recipient Recipient's phone number
405
+ * @param to Recipient's phone number
406
406
  * @param replyMessageId Optional message ID to reply to
407
407
  * @returns Promise with the message response
408
408
  */
409
- contacts(body: [ContactObject], recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
409
+ contacts(body: [ContactObject], to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
410
410
  /**
411
411
  * Sends a document via WhatsApp
412
412
  * @param body The document media object
413
- * @param recipient Recipient's phone number
413
+ * @param to Recipient's phone number
414
414
  * @param replyMessageId Optional message ID to reply to
415
415
  * @returns Promise with the message response
416
416
  */
417
- document(body: DocumentMediaObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
417
+ document(body: DocumentMediaObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
418
418
  /**
419
419
  * Sends an image via WhatsApp
420
420
  * @param body The image media object
421
- * @param recipient Recipient's phone number
421
+ * @param to Recipient's phone number
422
422
  * @param replyMessageId Optional message ID to reply to
423
423
  * @returns Promise with the message response
424
424
  */
425
- image(body: ImageMediaObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
425
+ image(body: ImageMediaObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
426
426
  /**
427
427
  * Sends an interactive message via WhatsApp
428
428
  * @param body The interactive object (buttons, lists, etc.)
429
- * @param recipient Recipient's phone number
429
+ * @param to Recipient's phone number
430
430
  * @param replyMessageId Optional message ID to reply to
431
431
  * @returns Promise with the message response
432
432
  */
433
- interactive(body: InteractiveObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
433
+ interactive(body: InteractiveObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
434
434
  /**
435
435
  * Sends a location via WhatsApp
436
436
  * @param body The location object with coordinates
437
- * @param recipient Recipient's phone number
437
+ * @param to Recipient's phone number
438
438
  * @param replyMessageId Optional message ID to reply to
439
439
  * @returns Promise with the message response
440
440
  */
441
- location(body: LocationObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
441
+ location(body: LocationObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
442
442
  /**
443
443
  * Updates message status (used for read receipts and typing indicators)
444
444
  * @param body The status object
@@ -448,35 +448,35 @@ declare class MessagesClass extends BaseClass {
448
448
  /**
449
449
  * Sends a sticker via WhatsApp
450
450
  * @param body The sticker media object
451
- * @param recipient Recipient's phone number
451
+ * @param to Recipient's phone number
452
452
  * @param replyMessageId Optional message ID to reply to
453
453
  * @returns Promise with the message response
454
454
  */
455
- sticker(body: StickerMediaObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
455
+ sticker(body: StickerMediaObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
456
456
  /**
457
457
  * Sends a template message via WhatsApp
458
458
  * @param body The message template object
459
- * @param recipient Recipient's phone number
459
+ * @param to Recipient's phone number
460
460
  * @param replyMessageId Optional message ID to reply to
461
461
  * @returns Promise with the message response
462
462
  */
463
- template(body: MessageTemplateObject<ComponentTypesEnum>, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
463
+ template(body: MessageTemplateObject<ComponentTypesEnum>, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
464
464
  /**
465
465
  * Sends a text message via WhatsApp
466
466
  * @param body The text object containing the message
467
- * @param recipient Recipient's phone number
467
+ * @param to Recipient's phone number
468
468
  * @param replyMessageId Optional message ID to reply to
469
469
  * @returns Promise with the message response
470
470
  */
471
- text(body: TextObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
471
+ text(body: TextObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
472
472
  /**
473
473
  * Sends a video via WhatsApp
474
474
  * @param body The video media object
475
- * @param recipient Recipient's phone number
475
+ * @param to Recipient's phone number
476
476
  * @param replyMessageId Optional message ID to reply to
477
477
  * @returns Promise with the message response
478
478
  */
479
- video(body: VideoMediaObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
479
+ video(body: VideoMediaObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
480
480
  /**
481
481
  * Marks a message as read in WhatsApp
482
482
  * @param messageId ID of the message to mark as read
@@ -492,72 +492,72 @@ declare class MessagesClass extends BaseClass {
492
492
  /**
493
493
  * Sends an interactive list message
494
494
  * @param body The list message content
495
- * @param recipient Recipient phone number
495
+ * @param to Recipient phone number
496
496
  * @param replyMessageId Optional message ID to reply to
497
497
  * @returns Promise with the response
498
498
  */
499
499
  interactiveList(body: InteractiveObject & {
500
500
  type: 'list';
501
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
501
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
502
502
  /**
503
503
  * Sends an interactive CTA URL message
504
504
  * @param body The CTA URL message content
505
- * @param recipient Recipient phone number
505
+ * @param to Recipient phone number
506
506
  * @param replyMessageId Optional message ID to reply to
507
507
  * @returns Promise with the response
508
508
  */
509
509
  interactiveCtaUrl(body: InteractiveObject & {
510
510
  type: 'cta_url';
511
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
511
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
512
512
  /**
513
513
  * Sends a location request message
514
514
  * @param body The location request message content
515
- * @param recipient Recipient phone number
515
+ * @param to Recipient phone number
516
516
  * @param replyMessageId Optional message ID to reply to
517
517
  * @returns Promise with the response
518
518
  */
519
519
  interactiveLocationRequest(body: InteractiveObject & {
520
520
  type: 'location_request_message';
521
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
521
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
522
522
  /**
523
523
  * Sends an address message to request shipping address from the user
524
524
  * Note: This feature is only available for businesses based in India and their India customers
525
525
  * @param body The address message content
526
- * @param recipient Recipient phone number
526
+ * @param to Recipient phone number
527
527
  * @param replyMessageId Optional message ID to reply to
528
528
  * @returns Promise with the response
529
529
  */
530
530
  interactiveAddressMessage(body: InteractiveObject & {
531
531
  type: 'address_message';
532
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
532
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
533
533
  /**
534
534
  * Sends an interactive reply buttons message
535
535
  * @param body The reply buttons message content
536
- * @param recipient Recipient phone number
536
+ * @param to Recipient phone number
537
537
  * @param replyMessageId Optional message ID to reply to
538
538
  * @returns Promise with the response
539
539
  */
540
540
  interactiveReplyButtons(body: InteractiveObject & {
541
541
  type: 'button';
542
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
542
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
543
543
  /**
544
544
  * Sends a reaction to a message (emoji response)
545
545
  * @param messageId ID of the message to react to
546
546
  * @param emoji The emoji to send as reaction (e.g. "😀", "❤️", "👍")
547
- * @param recipient Recipient phone number
547
+ * @param to Recipient phone number
548
548
  * @returns Promise with the response
549
549
  */
550
- reaction(messageId: string, emoji: string, recipient: number): Promise<RequesterResponseInterface<MessagesResponse>>;
550
+ reaction(messageId: string, emoji: string, to: string): Promise<RequesterResponseInterface<MessagesResponse>>;
551
551
  /**
552
552
  * Sends an interactive Flow message
553
553
  * @param body The Flow message content
554
- * @param recipient Recipient phone number
554
+ * @param to Recipient phone number
555
555
  * @param replyMessageId Optional message ID to reply to
556
556
  * @returns Promise with the response
557
557
  */
558
558
  interactiveFlow(body: InteractiveObject & {
559
559
  type: 'flow';
560
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
560
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
561
561
  }
562
562
 
563
563
  export { type AudioMediaObject, type AudioMessageRequestBody, type ContactObject, type ContactsMessageRequestBody, type DocumentMediaObject, type DocumentMessageRequestBody, type GeneralMessageBody, type ImageMediaObject, type ImageMessageRequestBody, type InteractiveMessageRequestBody, type InteractiveObject, type LocationMessageRequestBody, type LocationObject, type MessageRequestBody, type MessageTemplateObject, type MessageTemplateRequestBody, MessagesClass, type MessagesResponse, type ReactionMessageRequestBody, type StatusObject, type StatusRequestBody, type StickerMediaObject, type StickerMessageRequestBody, type TextMessageRequestBody, type TextObject, type TypingIndicatorObject, type VideoMediaObject, type VideoMessageRequestBody };
@@ -394,51 +394,51 @@ declare class MessagesClass extends BaseClass {
394
394
  /**
395
395
  * Sends an audio message via WhatsApp
396
396
  * @param body The audio media object
397
- * @param recipient Recipient's phone number
397
+ * @param to Recipient's phone number
398
398
  * @param replyMessageId Optional message ID to reply to
399
399
  * @returns Promise with the message response
400
400
  */
401
- audio(body: AudioMediaObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
401
+ audio(body: AudioMediaObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
402
402
  /**
403
403
  * Sends a contact card via WhatsApp
404
404
  * @param body The contact object
405
- * @param recipient Recipient's phone number
405
+ * @param to Recipient's phone number
406
406
  * @param replyMessageId Optional message ID to reply to
407
407
  * @returns Promise with the message response
408
408
  */
409
- contacts(body: [ContactObject], recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
409
+ contacts(body: [ContactObject], to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
410
410
  /**
411
411
  * Sends a document via WhatsApp
412
412
  * @param body The document media object
413
- * @param recipient Recipient's phone number
413
+ * @param to Recipient's phone number
414
414
  * @param replyMessageId Optional message ID to reply to
415
415
  * @returns Promise with the message response
416
416
  */
417
- document(body: DocumentMediaObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
417
+ document(body: DocumentMediaObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
418
418
  /**
419
419
  * Sends an image via WhatsApp
420
420
  * @param body The image media object
421
- * @param recipient Recipient's phone number
421
+ * @param to Recipient's phone number
422
422
  * @param replyMessageId Optional message ID to reply to
423
423
  * @returns Promise with the message response
424
424
  */
425
- image(body: ImageMediaObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
425
+ image(body: ImageMediaObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
426
426
  /**
427
427
  * Sends an interactive message via WhatsApp
428
428
  * @param body The interactive object (buttons, lists, etc.)
429
- * @param recipient Recipient's phone number
429
+ * @param to Recipient's phone number
430
430
  * @param replyMessageId Optional message ID to reply to
431
431
  * @returns Promise with the message response
432
432
  */
433
- interactive(body: InteractiveObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
433
+ interactive(body: InteractiveObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
434
434
  /**
435
435
  * Sends a location via WhatsApp
436
436
  * @param body The location object with coordinates
437
- * @param recipient Recipient's phone number
437
+ * @param to Recipient's phone number
438
438
  * @param replyMessageId Optional message ID to reply to
439
439
  * @returns Promise with the message response
440
440
  */
441
- location(body: LocationObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
441
+ location(body: LocationObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
442
442
  /**
443
443
  * Updates message status (used for read receipts and typing indicators)
444
444
  * @param body The status object
@@ -448,35 +448,35 @@ declare class MessagesClass extends BaseClass {
448
448
  /**
449
449
  * Sends a sticker via WhatsApp
450
450
  * @param body The sticker media object
451
- * @param recipient Recipient's phone number
451
+ * @param to Recipient's phone number
452
452
  * @param replyMessageId Optional message ID to reply to
453
453
  * @returns Promise with the message response
454
454
  */
455
- sticker(body: StickerMediaObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
455
+ sticker(body: StickerMediaObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
456
456
  /**
457
457
  * Sends a template message via WhatsApp
458
458
  * @param body The message template object
459
- * @param recipient Recipient's phone number
459
+ * @param to Recipient's phone number
460
460
  * @param replyMessageId Optional message ID to reply to
461
461
  * @returns Promise with the message response
462
462
  */
463
- template(body: MessageTemplateObject<ComponentTypesEnum>, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
463
+ template(body: MessageTemplateObject<ComponentTypesEnum>, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
464
464
  /**
465
465
  * Sends a text message via WhatsApp
466
466
  * @param body The text object containing the message
467
- * @param recipient Recipient's phone number
467
+ * @param to Recipient's phone number
468
468
  * @param replyMessageId Optional message ID to reply to
469
469
  * @returns Promise with the message response
470
470
  */
471
- text(body: TextObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
471
+ text(body: TextObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
472
472
  /**
473
473
  * Sends a video via WhatsApp
474
474
  * @param body The video media object
475
- * @param recipient Recipient's phone number
475
+ * @param to Recipient's phone number
476
476
  * @param replyMessageId Optional message ID to reply to
477
477
  * @returns Promise with the message response
478
478
  */
479
- video(body: VideoMediaObject, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
479
+ video(body: VideoMediaObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
480
480
  /**
481
481
  * Marks a message as read in WhatsApp
482
482
  * @param messageId ID of the message to mark as read
@@ -492,72 +492,72 @@ declare class MessagesClass extends BaseClass {
492
492
  /**
493
493
  * Sends an interactive list message
494
494
  * @param body The list message content
495
- * @param recipient Recipient phone number
495
+ * @param to Recipient phone number
496
496
  * @param replyMessageId Optional message ID to reply to
497
497
  * @returns Promise with the response
498
498
  */
499
499
  interactiveList(body: InteractiveObject & {
500
500
  type: 'list';
501
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
501
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
502
502
  /**
503
503
  * Sends an interactive CTA URL message
504
504
  * @param body The CTA URL message content
505
- * @param recipient Recipient phone number
505
+ * @param to Recipient phone number
506
506
  * @param replyMessageId Optional message ID to reply to
507
507
  * @returns Promise with the response
508
508
  */
509
509
  interactiveCtaUrl(body: InteractiveObject & {
510
510
  type: 'cta_url';
511
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
511
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
512
512
  /**
513
513
  * Sends a location request message
514
514
  * @param body The location request message content
515
- * @param recipient Recipient phone number
515
+ * @param to Recipient phone number
516
516
  * @param replyMessageId Optional message ID to reply to
517
517
  * @returns Promise with the response
518
518
  */
519
519
  interactiveLocationRequest(body: InteractiveObject & {
520
520
  type: 'location_request_message';
521
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
521
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
522
522
  /**
523
523
  * Sends an address message to request shipping address from the user
524
524
  * Note: This feature is only available for businesses based in India and their India customers
525
525
  * @param body The address message content
526
- * @param recipient Recipient phone number
526
+ * @param to Recipient phone number
527
527
  * @param replyMessageId Optional message ID to reply to
528
528
  * @returns Promise with the response
529
529
  */
530
530
  interactiveAddressMessage(body: InteractiveObject & {
531
531
  type: 'address_message';
532
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
532
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
533
533
  /**
534
534
  * Sends an interactive reply buttons message
535
535
  * @param body The reply buttons message content
536
- * @param recipient Recipient phone number
536
+ * @param to Recipient phone number
537
537
  * @param replyMessageId Optional message ID to reply to
538
538
  * @returns Promise with the response
539
539
  */
540
540
  interactiveReplyButtons(body: InteractiveObject & {
541
541
  type: 'button';
542
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
542
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
543
543
  /**
544
544
  * Sends a reaction to a message (emoji response)
545
545
  * @param messageId ID of the message to react to
546
546
  * @param emoji The emoji to send as reaction (e.g. "😀", "❤️", "👍")
547
- * @param recipient Recipient phone number
547
+ * @param to Recipient phone number
548
548
  * @returns Promise with the response
549
549
  */
550
- reaction(messageId: string, emoji: string, recipient: number): Promise<RequesterResponseInterface<MessagesResponse>>;
550
+ reaction(messageId: string, emoji: string, to: string): Promise<RequesterResponseInterface<MessagesResponse>>;
551
551
  /**
552
552
  * Sends an interactive Flow message
553
553
  * @param body The Flow message content
554
- * @param recipient Recipient phone number
554
+ * @param to Recipient phone number
555
555
  * @param replyMessageId Optional message ID to reply to
556
556
  * @returns Promise with the response
557
557
  */
558
558
  interactiveFlow(body: InteractiveObject & {
559
559
  type: 'flow';
560
- }, recipient: number, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
560
+ }, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;
561
561
  }
562
562
 
563
563
  export { type AudioMediaObject, type AudioMessageRequestBody, type ContactObject, type ContactsMessageRequestBody, type DocumentMediaObject, type DocumentMessageRequestBody, type GeneralMessageBody, type ImageMediaObject, type ImageMessageRequestBody, type InteractiveMessageRequestBody, type InteractiveObject, type LocationMessageRequestBody, type LocationObject, type MessageRequestBody, type MessageTemplateObject, type MessageTemplateRequestBody, MessagesClass, type MessagesResponse, type ReactionMessageRequestBody, type StatusObject, type StatusRequestBody, type StickerMediaObject, type StickerMessageRequestBody, type TextMessageRequestBody, type TextObject, type TypingIndicatorObject, type VideoMediaObject, type VideoMessageRequestBody };
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of o(e))!c.call(t,s)&&s!==a&&n(t,s,{get:()=>e[s],enumerable:!(r=i(e,s))||r.enumerable});return t};var d=t=>p(n({},"__esModule",{value:!0}),t);var m={};module.exports=d(m);
1
+ "use strict";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of o(e))!c.call(t,s)&&s!==a&&n(t,s,{get:()=>e[s],enumerable:!(r=i(e,s))||r.enumerable});return t};var d=t=>p(n({},"__esModule",{value:!0}),t);var g={};module.exports=d(g);
2
2
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/messages.ts"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under the license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { BaseClass } from './base';\nimport {\n MessageTypesEnum,\n ComponentTypesEnum,\n LanguagesEnum,\n ParametersTypesEnum,\n CurrencyCodesEnum,\n ButtonTypesEnum,\n ButtonPositionEnum,\n InteractiveTypesEnum,\n} from './enums';\nimport { GeneralRequestBody, RequesterResponseInterface } from './request';\n\nexport type GeneralMessageBody = GeneralRequestBody & {\n /**\n * The Meta messaging product name.\n * @default 'whatsapp'\n */\n messaging_product: 'whatsapp';\n};\n\nexport type StatusObject = {\n status: 'read';\n message_id: string;\n typing_indicator?: TypingIndicatorObject;\n};\n\nexport type TypingIndicatorObject = {\n type: 'text';\n};\n\nexport type StatusRequestBody = GeneralMessageBody & StatusObject;\n\ntype ConTextObject = {\n message_id: string;\n};\n\nexport type MessageRequestBody<T extends MessageTypesEnum> = GeneralMessageBody & {\n recipient_type?: string;\n to: string;\n context?: ConTextObject;\n type?: T;\n};\n\ntype MetaAudioMediaObject = {\n id: string;\n link?: never;\n};\n\ntype HostedAudioMediaObject = {\n id?: never;\n link: string;\n};\n\nexport type AudioMediaObject = MetaAudioMediaObject | HostedAudioMediaObject;\n\nexport type AudioMessageRequestBody = MessageRequestBody<MessageTypesEnum.Audio> & {\n [MessageTypesEnum.Audio]: [AudioMediaObject];\n};\n\ntype AddressesObject = {\n street?: string;\n city?: string;\n state?: string;\n zip?: string;\n country?: string;\n country_code?: string;\n type?: 'HOME' | 'WORK' | string;\n};\n\ntype EmailObject = {\n email?: string;\n type?: 'HOME' | 'WORK' | string;\n};\n\ntype NameObject = {\n formatted_name: string;\n first_name?: string;\n last_name?: string;\n middle_name?: string;\n suffix?: string;\n prefix?: string;\n};\n\ntype OrgObject = {\n company?: string;\n department?: string;\n title?: string;\n};\n\ntype PhoneObject = {\n phone?: 'PHONE_NUMBER';\n type?: 'CELL' | 'MAIN' | 'IPHONE' | 'HOME' | 'WORK' | string;\n wa_id?: string;\n};\n\ntype URLObject = {\n url?: string;\n type?: 'HOME' | 'WORK' | string;\n};\n\nexport type ContactObject = {\n addresses?: AddressesObject[];\n birthday?: `${number}${number}${number}${number}-${number}${number}-${number}${number}`;\n emails?: EmailObject[];\n name: NameObject;\n org?: OrgObject;\n phones?: PhoneObject[];\n urls?: URLObject[];\n};\n\nexport type ContactsMessageRequestBody = MessageRequestBody<MessageTypesEnum.Contacts> & {\n [MessageTypesEnum.Contacts]: [ContactObject];\n};\n\ntype MetaDocumentMediaObject = {\n id: string;\n link?: never;\n caption?: string;\n filename?: string;\n};\n\ntype HostedDocumentMediaObject = {\n id?: never;\n link: string;\n caption?: string;\n filename?: string;\n};\n\nexport type DocumentMediaObject = MetaDocumentMediaObject | HostedDocumentMediaObject;\n\nexport type DocumentMessageRequestBody = MessageRequestBody<MessageTypesEnum.Document> & {\n [MessageTypesEnum.Document]: [DocumentMediaObject];\n};\n\ntype MetaImageMediaObject = {\n id: string;\n link?: never;\n caption?: string;\n};\n\ntype HostedImageMediaObject = {\n id?: never;\n link: string;\n caption?: string;\n};\n\nexport type ImageMediaObject = MetaImageMediaObject | HostedImageMediaObject;\n\nexport type ImageMessageRequestBody = MessageRequestBody<MessageTypesEnum.Image> & {\n [MessageTypesEnum.Image]: [ImageMediaObject];\n};\n\ntype ProductObject = {\n product_retailer_id: string;\n};\n\ntype SimpleTextObject = {\n text: string;\n};\n\ntype RowObject = {\n id: string;\n title: string;\n description?: string;\n};\n\ntype MultiProductSectionObject = {\n product_items: ProductObject[];\n rows?: never;\n title?: string;\n};\n\ntype ListSectionObject = {\n product_items?: never;\n rows: RowObject[];\n title?: string;\n};\n\ntype SectionObject = MultiProductSectionObject | ListSectionObject;\n\ntype ButtonObject = {\n title: string;\n id: string;\n};\n\ntype ReplyButtonObject = {\n type: 'reply';\n reply: ButtonObject;\n};\n\ntype ActionObject = {\n button?: string;\n buttons?: ReplyButtonObject[];\n catalog_id?: string;\n product_retailer_id?: string;\n sections?: SectionObject;\n};\n\ntype HeaderObject = {\n type: 'document' | 'image' | 'text' | 'video';\n document?: DocumentMediaObject;\n image?: ImageMediaObject;\n text?: string;\n video?: VideoMediaObject;\n};\n\ntype ButtonInteractiveObject = {\n type: InteractiveTypesEnum.Button;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: ActionObject;\n};\n\ntype ListInteractiveObject = {\n type: InteractiveTypesEnum.List;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: ActionObject;\n};\n\ntype ProductInteractiveObject = {\n type: InteractiveTypesEnum.Product;\n body?: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: ActionObject;\n};\n\ntype ProductListInteractiveObject = {\n type: InteractiveTypesEnum.ProductList;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header: HeaderObject;\n action: ActionObject;\n};\n\ntype CtaUrlParameters = {\n display_text: string;\n url: string;\n};\n\ntype CtaUrlActionObject = {\n name: 'cta_url';\n parameters: CtaUrlParameters;\n};\n\ntype CtaUrlInteractiveObject = {\n type: InteractiveTypesEnum.CtaUrl;\n body?: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: CtaUrlActionObject;\n};\n\ntype LocationRequestActionObject = {\n name: 'send_location';\n};\n\ntype LocationRequestInteractiveObject = {\n type: InteractiveTypesEnum.LocationRequest;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: LocationRequestActionObject;\n};\n\n// Address message types\ntype AddressValues = {\n name?: string;\n phone_number?: string;\n in_pin_code?: string;\n house_number?: string;\n floor_number?: string;\n tower_number?: string;\n building_name?: string;\n address?: string;\n landmark_area?: string;\n city?: string;\n state?: string;\n};\n\ntype SavedAddress = {\n id: string;\n value: AddressValues;\n};\n\ntype ValidationErrors = {\n [key in keyof AddressValues]?: string;\n};\n\ntype AddressMessageParameters = {\n country: string; // ISO country code, e.g., \"IN\" for India\n values?: AddressValues;\n saved_addresses?: SavedAddress[];\n validation_errors?: ValidationErrors;\n};\n\ntype AddressMessageActionObject = {\n name: 'address_message';\n parameters: AddressMessageParameters;\n};\n\ntype AddressMessageInteractiveObject = {\n type: InteractiveTypesEnum.AddressMessage;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: AddressMessageActionObject;\n};\n\n// Flow message types\ntype FlowParameters = {\n flow_token: string;\n flow_id?: string;\n flow_cta?: string;\n screen?: string;\n mode?: 'fullscreen' | 'drawer';\n data?: Record<string, string>;\n};\n\ntype FlowActionObject = {\n name: 'flow';\n parameters: FlowParameters;\n};\n\ntype FlowInteractiveObject = {\n type: InteractiveTypesEnum.Flow;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: FlowActionObject;\n};\n\n// Update InteractiveObject type\nexport type InteractiveObject =\n | ButtonInteractiveObject\n | ListInteractiveObject\n | ProductInteractiveObject\n | ProductListInteractiveObject\n | CtaUrlInteractiveObject\n | LocationRequestInteractiveObject\n | AddressMessageInteractiveObject\n | FlowInteractiveObject;\n\nexport type InteractiveMessageRequestBody = MessageRequestBody<MessageTypesEnum.Interactive> & {\n [MessageTypesEnum.Interactive]: InteractiveObject;\n};\n\ntype MetaStickerMediaObject = {\n id: string;\n link?: never;\n};\n\ntype HostedStickerMediaObject = {\n id?: never;\n link: string;\n};\n\nexport type StickerMediaObject = MetaStickerMediaObject | HostedStickerMediaObject;\n\nexport type StickerMessageRequestBody = MessageRequestBody<MessageTypesEnum.Sticker> & {\n [MessageTypesEnum.Sticker]: [StickerMediaObject];\n};\n\ntype ReActionObject = {\n message_id: string;\n emoji: string;\n};\n\nexport type ReactionMessageRequestBody = MessageRequestBody<MessageTypesEnum.Reaction> & ReActionObject;\n\nexport type TextObject = {\n body: string;\n preview_url?: boolean;\n};\n\nexport type TextMessageRequestBody = MessageRequestBody<MessageTypesEnum.Text> & {\n [MessageTypesEnum.Text]: [TextObject];\n};\n\ntype MetaHostedVideoMediaObject = {\n id: string;\n link?: never;\n caption?: string;\n};\n\ntype SelfHostedVideoMediaObject = {\n id?: never;\n link: string;\n caption?: string;\n};\n\nexport type VideoMediaObject = MetaHostedVideoMediaObject | SelfHostedVideoMediaObject;\n\nexport type VideoMessageRequestBody = MessageRequestBody<MessageTypesEnum.Video> & {\n [MessageTypesEnum.Video]: [VideoMediaObject];\n};\n\ntype LanguageObject = {\n policy: 'deterministic';\n code: LanguagesEnum;\n};\n\ntype ParametersObject<T extends ParametersTypesEnum> = {\n type: T;\n};\n\ntype TextParametersObject = ParametersObject<ParametersTypesEnum.Text> & SimpleTextObject;\n\ntype CurrencyObject = {\n fallback_value: string;\n code: CurrencyCodesEnum;\n amount_1000: number;\n};\n\ntype CurrencyParametersObject = ParametersObject<ParametersTypesEnum.Currency> & {\n currency: CurrencyObject;\n};\n\ntype DateTimeObject = {\n fallback_value: string;\n};\n\ntype DateTimeParametersObject = ParametersObject<ParametersTypesEnum.Currency> & {\n date_time: DateTimeObject;\n};\n\ntype DocumentParametersObject = ParametersObject<ParametersTypesEnum.Document> & DocumentMediaObject;\n\ntype ImageParametersObject = ParametersObject<ParametersTypesEnum.Image> & ImageMediaObject;\n\ntype VideoParametersObject = ParametersObject<ParametersTypesEnum.Video> & VideoMediaObject;\n\ntype QuickReplyButtonParametersObject = {\n type: ParametersTypesEnum.Payload;\n payload: string;\n};\n\ntype URLButtonParametersObject = SimpleTextObject & {\n type: ParametersTypesEnum.Text;\n};\n\ntype ButtonParameterObject = QuickReplyButtonParametersObject | URLButtonParametersObject;\n\ntype ComponentObject<T extends ComponentTypesEnum> = {\n type: T;\n parameters: (\n | CurrencyParametersObject\n | DateTimeParametersObject\n | DocumentParametersObject\n | ImageParametersObject\n | TextParametersObject\n | VideoParametersObject\n )[];\n};\n\ntype ButtonComponentObject = ComponentObject<ComponentTypesEnum.Button> & {\n parameters: ButtonParameterObject;\n sub_type: ButtonTypesEnum;\n index: ButtonPositionEnum;\n};\n\nexport type MessageTemplateObject<T extends ComponentTypesEnum> = {\n name: string;\n language: LanguageObject;\n components?: (ComponentObject<T> | ButtonComponentObject)[];\n};\n\nexport type MessageTemplateRequestBody<T extends ComponentTypesEnum> = MessageRequestBody<MessageTypesEnum.Template> &\n MessageTemplateObject<T>;\n\nexport type LocationObject = {\n longitude: number;\n latitude: number;\n name?: string;\n address?: string;\n};\n\nexport type LocationMessageRequestBody = MessageRequestBody<MessageTypesEnum.Location> & {\n [MessageTypesEnum.Location]: [LocationObject];\n};\n\nexport type MessagesResponse = GeneralMessageBody & {\n contacts: [\n {\n input: string;\n wa_id: string;\n },\n ];\n messages: [\n {\n id: string;\n },\n ];\n};\n\nexport declare class MessagesClass extends BaseClass {\n /**\n * Sends an audio message via WhatsApp\n * @param body The audio media object\n * @param recipient Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n audio(\n body: AudioMediaObject,\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a contact card via WhatsApp\n * @param body The contact object\n * @param recipient Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n contacts(\n body: [ContactObject],\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a document via WhatsApp\n * @param body The document media object\n * @param recipient Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n document(\n body: DocumentMediaObject,\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an image via WhatsApp\n * @param body The image media object\n * @param recipient Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n image(\n body: ImageMediaObject,\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an interactive message via WhatsApp\n * @param body The interactive object (buttons, lists, etc.)\n * @param recipient Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n interactive(\n body: InteractiveObject,\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a location via WhatsApp\n * @param body The location object with coordinates\n * @param recipient Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n location(\n body: LocationObject,\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Updates message status (used for read receipts and typing indicators)\n * @param body The status object\n * @returns Promise with the response\n */\n status(body: StatusObject): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a sticker via WhatsApp\n * @param body The sticker media object\n * @param recipient Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n sticker(\n body: StickerMediaObject,\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a template message via WhatsApp\n * @param body The message template object\n * @param recipient Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n template(\n body: MessageTemplateObject<ComponentTypesEnum>,\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a text message via WhatsApp\n * @param body The text object containing the message\n * @param recipient Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n text(\n body: TextObject,\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a video via WhatsApp\n * @param body The video media object\n * @param recipient Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n video(\n body: VideoMediaObject,\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n // New methods\n /**\n * Marks a message as read in WhatsApp\n * @param messageId ID of the message to mark as read\n * @returns Promise with the response\n */\n markAsRead(messageId: string): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Marks a message as read and shows a typing indicator in WhatsApp\n * @param messageId ID of the message to mark as read\n * @returns Promise with the response\n */\n showTypingIndicator(messageId: string): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an interactive list message\n * @param body The list message content\n * @param recipient Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveList(\n body: InteractiveObject & { type: 'list' },\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an interactive CTA URL message\n * @param body The CTA URL message content\n * @param recipient Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveCtaUrl(\n body: InteractiveObject & { type: 'cta_url' },\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a location request message\n * @param body The location request message content\n * @param recipient Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveLocationRequest(\n body: InteractiveObject & { type: 'location_request_message' },\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an address message to request shipping address from the user\n * Note: This feature is only available for businesses based in India and their India customers\n * @param body The address message content\n * @param recipient Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveAddressMessage(\n body: InteractiveObject & { type: 'address_message' },\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an interactive reply buttons message\n * @param body The reply buttons message content\n * @param recipient Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveReplyButtons(\n body: InteractiveObject & { type: 'button' },\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a reaction to a message (emoji response)\n * @param messageId ID of the message to react to\n * @param emoji The emoji to send as reaction (e.g. \"😀\", \"❤️\", \"👍\")\n * @param recipient Recipient phone number\n * @returns Promise with the response\n */\n reaction(\n messageId: string,\n emoji: string,\n recipient: number,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an interactive Flow message\n * @param body The Flow message content\n * @param recipient Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveFlow(\n body: InteractiveObject & { type: 'flow' },\n recipient: number,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n}\n"],"mappings":"+WAAA,IAAAA,EAAA,kBAAAC,EAAAD","names":["messages_exports","__toCommonJS"]}
1
+ {"version":3,"sources":["../../src/types/messages.ts"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under the license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { BaseClass } from './base';\nimport {\n ButtonPositionEnum,\n ButtonTypesEnum,\n ComponentTypesEnum,\n CurrencyCodesEnum,\n InteractiveTypesEnum,\n LanguagesEnum,\n MessageTypesEnum,\n ParametersTypesEnum,\n} from './enums';\nimport { GeneralRequestBody, RequesterResponseInterface } from './request';\n\nexport type GeneralMessageBody = GeneralRequestBody & {\n /**\n * The Meta messaging product name.\n * @default 'whatsapp'\n */\n messaging_product: 'whatsapp';\n};\n\nexport type StatusObject = {\n status: 'read';\n message_id: string;\n typing_indicator?: TypingIndicatorObject;\n};\n\nexport type TypingIndicatorObject = {\n type: 'text';\n};\n\nexport type StatusRequestBody = GeneralMessageBody & StatusObject;\n\ntype ConTextObject = {\n message_id: string;\n};\n\nexport type MessageRequestBody<T extends MessageTypesEnum> = GeneralMessageBody & {\n recipient_type?: string;\n to: string;\n context?: ConTextObject;\n type?: T;\n};\n\ntype MetaAudioMediaObject = {\n id: string;\n link?: never;\n};\n\ntype HostedAudioMediaObject = {\n id?: never;\n link: string;\n};\n\nexport type AudioMediaObject = MetaAudioMediaObject | HostedAudioMediaObject;\n\nexport type AudioMessageRequestBody = MessageRequestBody<MessageTypesEnum.Audio> & {\n [MessageTypesEnum.Audio]: [AudioMediaObject];\n};\n\ntype AddressesObject = {\n street?: string;\n city?: string;\n state?: string;\n zip?: string;\n country?: string;\n country_code?: string;\n type?: 'HOME' | 'WORK' | string;\n};\n\ntype EmailObject = {\n email?: string;\n type?: 'HOME' | 'WORK' | string;\n};\n\ntype NameObject = {\n formatted_name: string;\n first_name?: string;\n last_name?: string;\n middle_name?: string;\n suffix?: string;\n prefix?: string;\n};\n\ntype OrgObject = {\n company?: string;\n department?: string;\n title?: string;\n};\n\ntype PhoneObject = {\n phone?: 'PHONE_NUMBER';\n type?: 'CELL' | 'MAIN' | 'IPHONE' | 'HOME' | 'WORK' | string;\n wa_id?: string;\n};\n\ntype URLObject = {\n url?: string;\n type?: 'HOME' | 'WORK' | string;\n};\n\nexport type ContactObject = {\n addresses?: AddressesObject[];\n birthday?: `${number}${number}${number}${number}-${number}${number}-${number}${number}`;\n emails?: EmailObject[];\n name: NameObject;\n org?: OrgObject;\n phones?: PhoneObject[];\n urls?: URLObject[];\n};\n\nexport type ContactsMessageRequestBody = MessageRequestBody<MessageTypesEnum.Contacts> & {\n [MessageTypesEnum.Contacts]: [ContactObject];\n};\n\ntype MetaDocumentMediaObject = {\n id: string;\n link?: never;\n caption?: string;\n filename?: string;\n};\n\ntype HostedDocumentMediaObject = {\n id?: never;\n link: string;\n caption?: string;\n filename?: string;\n};\n\nexport type DocumentMediaObject = MetaDocumentMediaObject | HostedDocumentMediaObject;\n\nexport type DocumentMessageRequestBody = MessageRequestBody<MessageTypesEnum.Document> & {\n [MessageTypesEnum.Document]: [DocumentMediaObject];\n};\n\ntype MetaImageMediaObject = {\n id: string;\n link?: never;\n caption?: string;\n};\n\ntype HostedImageMediaObject = {\n id?: never;\n link: string;\n caption?: string;\n};\n\nexport type ImageMediaObject = MetaImageMediaObject | HostedImageMediaObject;\n\nexport type ImageMessageRequestBody = MessageRequestBody<MessageTypesEnum.Image> & {\n [MessageTypesEnum.Image]: [ImageMediaObject];\n};\n\ntype ProductObject = {\n product_retailer_id: string;\n};\n\ntype SimpleTextObject = {\n text: string;\n};\n\ntype RowObject = {\n id: string;\n title: string;\n description?: string;\n};\n\ntype MultiProductSectionObject = {\n product_items: ProductObject[];\n rows?: never;\n title?: string;\n};\n\ntype ListSectionObject = {\n product_items?: never;\n rows: RowObject[];\n title?: string;\n};\n\ntype SectionObject = MultiProductSectionObject | ListSectionObject;\n\ntype ButtonObject = {\n title: string;\n id: string;\n};\n\ntype ReplyButtonObject = {\n type: 'reply';\n reply: ButtonObject;\n};\n\ntype ActionObject = {\n button?: string;\n buttons?: ReplyButtonObject[];\n catalog_id?: string;\n product_retailer_id?: string;\n sections?: SectionObject;\n};\n\ntype HeaderObject = {\n type: 'document' | 'image' | 'text' | 'video';\n document?: DocumentMediaObject;\n image?: ImageMediaObject;\n text?: string;\n video?: VideoMediaObject;\n};\n\ntype ButtonInteractiveObject = {\n type: InteractiveTypesEnum.Button;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: ActionObject;\n};\n\ntype ListInteractiveObject = {\n type: InteractiveTypesEnum.List;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: ActionObject;\n};\n\ntype ProductInteractiveObject = {\n type: InteractiveTypesEnum.Product;\n body?: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: ActionObject;\n};\n\ntype ProductListInteractiveObject = {\n type: InteractiveTypesEnum.ProductList;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header: HeaderObject;\n action: ActionObject;\n};\n\ntype CtaUrlParameters = {\n display_text: string;\n url: string;\n};\n\ntype CtaUrlActionObject = {\n name: 'cta_url';\n parameters: CtaUrlParameters;\n};\n\ntype CtaUrlInteractiveObject = {\n type: InteractiveTypesEnum.CtaUrl;\n body?: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: CtaUrlActionObject;\n};\n\ntype LocationRequestActionObject = {\n name: 'send_location';\n};\n\ntype LocationRequestInteractiveObject = {\n type: InteractiveTypesEnum.LocationRequest;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: LocationRequestActionObject;\n};\n\n// Address message types\ntype AddressValues = {\n name?: string;\n phone_number?: string;\n in_pin_code?: string;\n house_number?: string;\n floor_number?: string;\n tower_number?: string;\n building_name?: string;\n address?: string;\n landmark_area?: string;\n city?: string;\n state?: string;\n};\n\ntype SavedAddress = {\n id: string;\n value: AddressValues;\n};\n\ntype ValidationErrors = {\n [key in keyof AddressValues]?: string;\n};\n\ntype AddressMessageParameters = {\n country: string; // ISO country code, e.g., \"IN\" for India\n values?: AddressValues;\n saved_addresses?: SavedAddress[];\n validation_errors?: ValidationErrors;\n};\n\ntype AddressMessageActionObject = {\n name: 'address_message';\n parameters: AddressMessageParameters;\n};\n\ntype AddressMessageInteractiveObject = {\n type: InteractiveTypesEnum.AddressMessage;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: AddressMessageActionObject;\n};\n\n// Flow message types\ntype FlowParameters = {\n flow_token: string;\n flow_id?: string;\n flow_cta?: string;\n screen?: string;\n mode?: 'fullscreen' | 'drawer';\n data?: Record<string, string>;\n};\n\ntype FlowActionObject = {\n name: 'flow';\n parameters: FlowParameters;\n};\n\ntype FlowInteractiveObject = {\n type: InteractiveTypesEnum.Flow;\n body: SimpleTextObject;\n footer?: SimpleTextObject;\n header?: HeaderObject;\n action: FlowActionObject;\n};\n\n// Update InteractiveObject type\nexport type InteractiveObject =\n | ButtonInteractiveObject\n | ListInteractiveObject\n | ProductInteractiveObject\n | ProductListInteractiveObject\n | CtaUrlInteractiveObject\n | LocationRequestInteractiveObject\n | AddressMessageInteractiveObject\n | FlowInteractiveObject;\n\nexport type InteractiveMessageRequestBody = MessageRequestBody<MessageTypesEnum.Interactive> & {\n [MessageTypesEnum.Interactive]: InteractiveObject;\n};\n\ntype MetaStickerMediaObject = {\n id: string;\n link?: never;\n};\n\ntype HostedStickerMediaObject = {\n id?: never;\n link: string;\n};\n\nexport type StickerMediaObject = MetaStickerMediaObject | HostedStickerMediaObject;\n\nexport type StickerMessageRequestBody = MessageRequestBody<MessageTypesEnum.Sticker> & {\n [MessageTypesEnum.Sticker]: [StickerMediaObject];\n};\n\ntype ReActionObject = {\n message_id: string;\n emoji: string;\n};\n\nexport type ReactionMessageRequestBody = MessageRequestBody<MessageTypesEnum.Reaction> & ReActionObject;\n\nexport type TextObject = {\n body: string;\n preview_url?: boolean;\n};\n\nexport type TextMessageRequestBody = MessageRequestBody<MessageTypesEnum.Text> & {\n [MessageTypesEnum.Text]: [TextObject];\n};\n\ntype MetaHostedVideoMediaObject = {\n id: string;\n link?: never;\n caption?: string;\n};\n\ntype SelfHostedVideoMediaObject = {\n id?: never;\n link: string;\n caption?: string;\n};\n\nexport type VideoMediaObject = MetaHostedVideoMediaObject | SelfHostedVideoMediaObject;\n\nexport type VideoMessageRequestBody = MessageRequestBody<MessageTypesEnum.Video> & {\n [MessageTypesEnum.Video]: [VideoMediaObject];\n};\n\ntype LanguageObject = {\n policy: 'deterministic';\n code: LanguagesEnum;\n};\n\ntype ParametersObject<T extends ParametersTypesEnum> = {\n type: T;\n};\n\ntype TextParametersObject = ParametersObject<ParametersTypesEnum.Text> & SimpleTextObject;\n\ntype CurrencyObject = {\n fallback_value: string;\n code: CurrencyCodesEnum;\n amount_1000: number;\n};\n\ntype CurrencyParametersObject = ParametersObject<ParametersTypesEnum.Currency> & {\n currency: CurrencyObject;\n};\n\ntype DateTimeObject = {\n fallback_value: string;\n};\n\ntype DateTimeParametersObject = ParametersObject<ParametersTypesEnum.Currency> & {\n date_time: DateTimeObject;\n};\n\ntype DocumentParametersObject = ParametersObject<ParametersTypesEnum.Document> & DocumentMediaObject;\n\ntype ImageParametersObject = ParametersObject<ParametersTypesEnum.Image> & ImageMediaObject;\n\ntype VideoParametersObject = ParametersObject<ParametersTypesEnum.Video> & VideoMediaObject;\n\ntype QuickReplyButtonParametersObject = {\n type: ParametersTypesEnum.Payload;\n payload: string;\n};\n\ntype URLButtonParametersObject = SimpleTextObject & {\n type: ParametersTypesEnum.Text;\n};\n\ntype ButtonParameterObject = QuickReplyButtonParametersObject | URLButtonParametersObject;\n\ntype ComponentObject<T extends ComponentTypesEnum> = {\n type: T;\n parameters: (\n | CurrencyParametersObject\n | DateTimeParametersObject\n | DocumentParametersObject\n | ImageParametersObject\n | TextParametersObject\n | VideoParametersObject\n )[];\n};\n\ntype ButtonComponentObject = ComponentObject<ComponentTypesEnum.Button> & {\n parameters: ButtonParameterObject;\n sub_type: ButtonTypesEnum;\n index: ButtonPositionEnum;\n};\n\nexport type MessageTemplateObject<T extends ComponentTypesEnum> = {\n name: string;\n language: LanguageObject;\n components?: (ComponentObject<T> | ButtonComponentObject)[];\n};\n\nexport type MessageTemplateRequestBody<T extends ComponentTypesEnum> = MessageRequestBody<MessageTypesEnum.Template> &\n MessageTemplateObject<T>;\n\nexport type LocationObject = {\n longitude: number;\n latitude: number;\n name?: string;\n address?: string;\n};\n\nexport type LocationMessageRequestBody = MessageRequestBody<MessageTypesEnum.Location> & {\n [MessageTypesEnum.Location]: [LocationObject];\n};\n\nexport type MessagesResponse = GeneralMessageBody & {\n contacts: [\n {\n input: string;\n wa_id: string;\n },\n ];\n messages: [\n {\n id: string;\n },\n ];\n};\n\nexport declare class MessagesClass extends BaseClass {\n /**\n * Sends an audio message via WhatsApp\n * @param body The audio media object\n * @param to Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n audio(\n body: AudioMediaObject,\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a contact card via WhatsApp\n * @param body The contact object\n * @param to Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n contacts(\n body: [ContactObject],\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a document via WhatsApp\n * @param body The document media object\n * @param to Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n document(\n body: DocumentMediaObject,\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an image via WhatsApp\n * @param body The image media object\n * @param to Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n image(\n body: ImageMediaObject,\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an interactive message via WhatsApp\n * @param body The interactive object (buttons, lists, etc.)\n * @param to Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n interactive(\n body: InteractiveObject,\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a location via WhatsApp\n * @param body The location object with coordinates\n * @param to Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n location(\n body: LocationObject,\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Updates message status (used for read receipts and typing indicators)\n * @param body The status object\n * @returns Promise with the response\n */\n status(body: StatusObject): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a sticker via WhatsApp\n * @param body The sticker media object\n * @param to Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n sticker(\n body: StickerMediaObject,\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a template message via WhatsApp\n * @param body The message template object\n * @param to Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n template(\n body: MessageTemplateObject<ComponentTypesEnum>,\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a text message via WhatsApp\n * @param body The text object containing the message\n * @param to Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n text(body: TextObject, to: string, replyMessageId?: string): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a video via WhatsApp\n * @param body The video media object\n * @param to Recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the message response\n */\n video(\n body: VideoMediaObject,\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n // New methods\n /**\n * Marks a message as read in WhatsApp\n * @param messageId ID of the message to mark as read\n * @returns Promise with the response\n */\n markAsRead(messageId: string): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Marks a message as read and shows a typing indicator in WhatsApp\n * @param messageId ID of the message to mark as read\n * @returns Promise with the response\n */\n showTypingIndicator(messageId: string): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an interactive list message\n * @param body The list message content\n * @param to Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveList(\n body: InteractiveObject & { type: 'list' },\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an interactive CTA URL message\n * @param body The CTA URL message content\n * @param to Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveCtaUrl(\n body: InteractiveObject & { type: 'cta_url' },\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a location request message\n * @param body The location request message content\n * @param to Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveLocationRequest(\n body: InteractiveObject & { type: 'location_request_message' },\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an address message to request shipping address from the user\n * Note: This feature is only available for businesses based in India and their India customers\n * @param body The address message content\n * @param to Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveAddressMessage(\n body: InteractiveObject & { type: 'address_message' },\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an interactive reply buttons message\n * @param body The reply buttons message content\n * @param to Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveReplyButtons(\n body: InteractiveObject & { type: 'button' },\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends a reaction to a message (emoji response)\n * @param messageId ID of the message to react to\n * @param emoji The emoji to send as reaction (e.g. \"😀\", \"❤️\", \"👍\")\n * @param to Recipient phone number\n * @returns Promise with the response\n */\n reaction(messageId: string, emoji: string, to: string): Promise<RequesterResponseInterface<MessagesResponse>>;\n\n /**\n * Sends an interactive Flow message\n * @param body The Flow message content\n * @param to Recipient phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns Promise with the response\n */\n interactiveFlow(\n body: InteractiveObject & { type: 'flow' },\n to: string,\n replyMessageId?: string,\n ): Promise<RequesterResponseInterface<MessagesResponse>>;\n}\n"],"mappings":"+WAAA,IAAAA,EAAA,kBAAAC,EAAAD","names":["messages_exports","__toCommonJS"]}