meta-cloud-api 0.0.17 → 0.0.19
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.
- package/dist/api/index.js +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/api/index.mjs.map +1 -1
- package/dist/api/messages.d.mts +74 -84
- package/dist/api/messages.d.ts +74 -84
- package/dist/api/messages.js +1 -1
- package/dist/api/messages.js.map +1 -1
- package/dist/api/messages.mjs +1 -1
- package/dist/api/messages.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/messages.d.mts +77 -87
- package/dist/types/messages.d.ts +77 -87
- package/dist/types/messages.js +1 -1
- package/dist/types/messages.js.map +1 -1
- package/dist/whatsapp.js +1 -1
- package/dist/whatsapp.js.map +1 -1
- package/dist/whatsapp.mjs +1 -1
- package/dist/whatsapp.mjs.map +1 -1
- package/package.json +1 -1
package/dist/types/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ export { GeneralHeaderInterface, GeneralRequestBody, Paging, RequesterClass, Req
|
|
|
4
4
|
export { BaseClass } from './base.mjs';
|
|
5
5
|
export { HttpsClientClass, HttpsClientResponseClass, ResponseHeaderValue, ResponseHeaders, ResponseJSONBody } from './httpsClient.mjs';
|
|
6
6
|
export { LoggerInterface } from './logger.mjs';
|
|
7
|
-
export { AudioMediaObject, AudioMessageRequestBody, ContactObject, ContactsMessageRequestBody, DocumentMediaObject, DocumentMessageRequestBody, GeneralMessageBody, ImageMediaObject, ImageMessageRequestBody, InteractiveMessageRequestBody, InteractiveObject, LocationMessageRequestBody, LocationObject, MessageRequestBody, MessageTemplateObject, MessageTemplateRequestBody, MessagesClass, MessagesResponse, ReactionMessageRequestBody, StatusObject, StatusRequestBody, StickerMediaObject, StickerMessageRequestBody, TextMessageRequestBody, TextObject, TypingIndicatorObject, VideoMediaObject, VideoMessageRequestBody } from './messages.mjs';
|
|
7
|
+
export { AudioMediaObject, AudioMessageRequestBody, ContactObject, ContactsMessageRequestBody, DocumentMediaObject, DocumentMessageRequestBody, GeneralMessageBody, ImageMediaObject, ImageMessageRequestBody, InteractiveMessageRequestBody, InteractiveObject, LocationMessageRequestBody, LocationObject, MessageRequestBody, MessageRequestParams, MessageTemplateObject, MessageTemplateRequestBody, MessagesClass, MessagesResponse, ReactionMessageRequestBody, ReactionParams, StatusObject, StatusParams, StatusRequestBody, StickerMediaObject, StickerMessageRequestBody, TextMessageParams, TextMessageRequestBody, TextObject, TypingIndicatorObject, VideoMediaObject, VideoMessageRequestBody } from './messages.mjs';
|
|
8
8
|
export { WhatsAppClass, WhatsAppConfig } from './whatsapp.mjs';
|
|
9
9
|
export { ComponentTypes, CopyCodeButton, FlowButton, MPMButton, OTPButton, PhoneNumberButton, QuickReplyButton, SPMButton, TemplateBody, TemplateButton, TemplateClass, TemplateDeleteParams, TemplateFooter, TemplateFormat, TemplateGetParams, TemplateHeader, TemplateHeaderExample, TemplateRequestBody, TemplateResponse, URLButton } from './template.mjs';
|
|
10
10
|
export { AccountMode, CodeVerificationStatus, Cursors, HealthStatus, HealthStatusEntity, MessagingLimitTier, PhoneNumberClass, PhoneNumberResponse, PhoneNumbersResponse, PlatformType, QualityRating, QualityScore, RequestVerificationCodeRequest, Throughput, ThroughputLevel, TwoStepVerificationParams, VerifyCodeRequest } from './phoneNumber.mjs';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { GeneralHeaderInterface, GeneralRequestBody, Paging, RequesterClass, Req
|
|
|
4
4
|
export { BaseClass } from './base.js';
|
|
5
5
|
export { HttpsClientClass, HttpsClientResponseClass, ResponseHeaderValue, ResponseHeaders, ResponseJSONBody } from './httpsClient.js';
|
|
6
6
|
export { LoggerInterface } from './logger.js';
|
|
7
|
-
export { AudioMediaObject, AudioMessageRequestBody, ContactObject, ContactsMessageRequestBody, DocumentMediaObject, DocumentMessageRequestBody, GeneralMessageBody, ImageMediaObject, ImageMessageRequestBody, InteractiveMessageRequestBody, InteractiveObject, LocationMessageRequestBody, LocationObject, MessageRequestBody, MessageTemplateObject, MessageTemplateRequestBody, MessagesClass, MessagesResponse, ReactionMessageRequestBody, StatusObject, StatusRequestBody, StickerMediaObject, StickerMessageRequestBody, TextMessageRequestBody, TextObject, TypingIndicatorObject, VideoMediaObject, VideoMessageRequestBody } from './messages.js';
|
|
7
|
+
export { AudioMediaObject, AudioMessageRequestBody, ContactObject, ContactsMessageRequestBody, DocumentMediaObject, DocumentMessageRequestBody, GeneralMessageBody, ImageMediaObject, ImageMessageRequestBody, InteractiveMessageRequestBody, InteractiveObject, LocationMessageRequestBody, LocationObject, MessageRequestBody, MessageRequestParams, MessageTemplateObject, MessageTemplateRequestBody, MessagesClass, MessagesResponse, ReactionMessageRequestBody, ReactionParams, StatusObject, StatusParams, StatusRequestBody, StickerMediaObject, StickerMessageRequestBody, TextMessageParams, TextMessageRequestBody, TextObject, TypingIndicatorObject, VideoMediaObject, VideoMessageRequestBody } from './messages.js';
|
|
8
8
|
export { WhatsAppClass, WhatsAppConfig } from './whatsapp.js';
|
|
9
9
|
export { ComponentTypes, CopyCodeButton, FlowButton, MPMButton, OTPButton, PhoneNumberButton, QuickReplyButton, SPMButton, TemplateBody, TemplateButton, TemplateClass, TemplateDeleteParams, TemplateFooter, TemplateFormat, TemplateGetParams, TemplateHeader, TemplateHeaderExample, TemplateRequestBody, TemplateResponse, URLButton } from './template.js';
|
|
10
10
|
export { AccountMode, CodeVerificationStatus, Cursors, HealthStatus, HealthStatusEntity, MessagingLimitTier, PhoneNumberClass, PhoneNumberResponse, PhoneNumbersResponse, PlatformType, QualityRating, QualityScore, RequestVerificationCodeRequest, Throughput, ThroughputLevel, TwoStepVerificationParams, VerifyCodeRequest } from './phoneNumber.js';
|
|
@@ -390,174 +390,164 @@ type MessagesResponse = GeneralMessageBody & {
|
|
|
390
390
|
}
|
|
391
391
|
];
|
|
392
392
|
};
|
|
393
|
+
interface MessageRequestParams<T> {
|
|
394
|
+
body: T;
|
|
395
|
+
to: string;
|
|
396
|
+
replyMessageId?: string;
|
|
397
|
+
}
|
|
398
|
+
interface TextMessageParams extends MessageRequestParams<TextObject | string> {
|
|
399
|
+
previewUrl?: boolean;
|
|
400
|
+
}
|
|
401
|
+
interface ReactionParams {
|
|
402
|
+
messageId: string;
|
|
403
|
+
emoji: string;
|
|
404
|
+
to: string;
|
|
405
|
+
}
|
|
406
|
+
interface StatusParams {
|
|
407
|
+
status: string;
|
|
408
|
+
messageId: string;
|
|
409
|
+
typingIndicator?: {
|
|
410
|
+
type: string;
|
|
411
|
+
};
|
|
412
|
+
}
|
|
393
413
|
declare class MessagesClass extends BaseClass {
|
|
394
414
|
/**
|
|
395
415
|
* Sends an audio message via WhatsApp
|
|
396
|
-
* @param
|
|
397
|
-
* @param recipient Recipient's phone number
|
|
398
|
-
* @param replyMessageId Optional message ID to reply to
|
|
416
|
+
* @param params The audio message parameter object
|
|
399
417
|
* @returns Promise with the message response
|
|
400
418
|
*/
|
|
401
|
-
audio(
|
|
419
|
+
audio(params: MessageRequestParams<AudioMediaObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
402
420
|
/**
|
|
403
421
|
* Sends a contact card via WhatsApp
|
|
404
|
-
* @param
|
|
405
|
-
* @param recipient Recipient's phone number
|
|
406
|
-
* @param replyMessageId Optional message ID to reply to
|
|
422
|
+
* @param params The contact message parameter object
|
|
407
423
|
* @returns Promise with the message response
|
|
408
424
|
*/
|
|
409
|
-
contacts(
|
|
425
|
+
contacts(params: MessageRequestParams<[ContactObject]>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
410
426
|
/**
|
|
411
427
|
* Sends a document via WhatsApp
|
|
412
|
-
* @param
|
|
413
|
-
* @param recipient Recipient's phone number
|
|
414
|
-
* @param replyMessageId Optional message ID to reply to
|
|
428
|
+
* @param params The document message parameter object
|
|
415
429
|
* @returns Promise with the message response
|
|
416
430
|
*/
|
|
417
|
-
document(
|
|
431
|
+
document(params: MessageRequestParams<DocumentMediaObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
418
432
|
/**
|
|
419
433
|
* Sends an image via WhatsApp
|
|
420
|
-
* @param
|
|
421
|
-
* @param recipient Recipient's phone number
|
|
422
|
-
* @param replyMessageId Optional message ID to reply to
|
|
434
|
+
* @param params The image message parameter object
|
|
423
435
|
* @returns Promise with the message response
|
|
424
436
|
*/
|
|
425
|
-
image(
|
|
437
|
+
image(params: MessageRequestParams<ImageMediaObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
426
438
|
/**
|
|
427
439
|
* Sends an interactive message via WhatsApp
|
|
428
|
-
* @param
|
|
429
|
-
* @param recipient Recipient's phone number
|
|
430
|
-
* @param replyMessageId Optional message ID to reply to
|
|
440
|
+
* @param params The interactive message parameter object
|
|
431
441
|
* @returns Promise with the message response
|
|
432
442
|
*/
|
|
433
|
-
interactive(
|
|
443
|
+
interactive(params: MessageRequestParams<InteractiveObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
434
444
|
/**
|
|
435
445
|
* Sends a location via WhatsApp
|
|
436
|
-
* @param
|
|
437
|
-
* @param recipient Recipient's phone number
|
|
438
|
-
* @param replyMessageId Optional message ID to reply to
|
|
446
|
+
* @param params The location message parameter object
|
|
439
447
|
* @returns Promise with the message response
|
|
440
448
|
*/
|
|
441
|
-
location(
|
|
449
|
+
location(params: MessageRequestParams<LocationObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
442
450
|
/**
|
|
443
451
|
* Updates message status (used for read receipts and typing indicators)
|
|
444
|
-
* @param
|
|
452
|
+
* @param params The status update parameter object
|
|
445
453
|
* @returns Promise with the response
|
|
446
454
|
*/
|
|
447
|
-
status(
|
|
455
|
+
status(params: StatusParams): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
448
456
|
/**
|
|
449
457
|
* Sends a sticker via WhatsApp
|
|
450
|
-
* @param
|
|
451
|
-
* @param recipient Recipient's phone number
|
|
452
|
-
* @param replyMessageId Optional message ID to reply to
|
|
458
|
+
* @param params The sticker message parameter object
|
|
453
459
|
* @returns Promise with the message response
|
|
454
460
|
*/
|
|
455
|
-
sticker(
|
|
461
|
+
sticker(params: MessageRequestParams<StickerMediaObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
456
462
|
/**
|
|
457
463
|
* Sends a template message via WhatsApp
|
|
458
|
-
* @param
|
|
459
|
-
* @param recipient Recipient's phone number
|
|
460
|
-
* @param replyMessageId Optional message ID to reply to
|
|
464
|
+
* @param params The template message parameter object
|
|
461
465
|
* @returns Promise with the message response
|
|
462
466
|
*/
|
|
463
|
-
template(
|
|
467
|
+
template(params: MessageRequestParams<MessageTemplateObject<ComponentTypesEnum>>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
464
468
|
/**
|
|
465
469
|
* Sends a text message via WhatsApp
|
|
466
|
-
* @param
|
|
467
|
-
* @param recipient Recipient's phone number
|
|
468
|
-
* @param replyMessageId Optional message ID to reply to
|
|
470
|
+
* @param params The text message parameter object
|
|
469
471
|
* @returns Promise with the message response
|
|
470
472
|
*/
|
|
471
|
-
text(
|
|
473
|
+
text(params: TextMessageParams): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
472
474
|
/**
|
|
473
475
|
* Sends a video via WhatsApp
|
|
474
|
-
* @param
|
|
475
|
-
* @param recipient Recipient's phone number
|
|
476
|
-
* @param replyMessageId Optional message ID to reply to
|
|
476
|
+
* @param params The video message parameter object
|
|
477
477
|
* @returns Promise with the message response
|
|
478
478
|
*/
|
|
479
|
-
video(
|
|
479
|
+
video(params: MessageRequestParams<VideoMediaObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
480
480
|
/**
|
|
481
481
|
* Marks a message as read in WhatsApp
|
|
482
|
-
* @param
|
|
482
|
+
* @param params The parameter object to mark message as read
|
|
483
483
|
* @returns Promise with the response
|
|
484
484
|
*/
|
|
485
|
-
markAsRead(
|
|
485
|
+
markAsRead(params: {
|
|
486
|
+
messageId: string;
|
|
487
|
+
}): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
486
488
|
/**
|
|
487
489
|
* Marks a message as read and shows a typing indicator in WhatsApp
|
|
488
|
-
* @param
|
|
490
|
+
* @param params The typing indicator parameter object
|
|
489
491
|
* @returns Promise with the response
|
|
490
492
|
*/
|
|
491
|
-
showTypingIndicator(
|
|
493
|
+
showTypingIndicator(params: {
|
|
494
|
+
messageId: string;
|
|
495
|
+
}): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
492
496
|
/**
|
|
493
497
|
* Sends an interactive list message
|
|
494
|
-
* @param
|
|
495
|
-
* @param recipient Recipient phone number
|
|
496
|
-
* @param replyMessageId Optional message ID to reply to
|
|
498
|
+
* @param params The list message parameter object
|
|
497
499
|
* @returns Promise with the response
|
|
498
500
|
*/
|
|
499
|
-
interactiveList(
|
|
500
|
-
type:
|
|
501
|
-
}
|
|
501
|
+
interactiveList(params: MessageRequestParams<InteractiveObject & {
|
|
502
|
+
type: InteractiveTypesEnum.List;
|
|
503
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
502
504
|
/**
|
|
503
505
|
* Sends an interactive CTA URL message
|
|
504
|
-
* @param
|
|
505
|
-
* @param recipient Recipient phone number
|
|
506
|
-
* @param replyMessageId Optional message ID to reply to
|
|
506
|
+
* @param params The CTA URL message parameter object
|
|
507
507
|
* @returns Promise with the response
|
|
508
508
|
*/
|
|
509
|
-
interactiveCtaUrl(
|
|
510
|
-
type:
|
|
511
|
-
}
|
|
509
|
+
interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
|
|
510
|
+
type: InteractiveTypesEnum.CtaUrl;
|
|
511
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
512
512
|
/**
|
|
513
513
|
* Sends a location request message
|
|
514
|
-
* @param
|
|
515
|
-
* @param recipient Recipient phone number
|
|
516
|
-
* @param replyMessageId Optional message ID to reply to
|
|
514
|
+
* @param params The location request message parameter object
|
|
517
515
|
* @returns Promise with the response
|
|
518
516
|
*/
|
|
519
|
-
interactiveLocationRequest(
|
|
520
|
-
type:
|
|
521
|
-
}
|
|
517
|
+
interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
|
|
518
|
+
type: InteractiveTypesEnum.LocationRequest;
|
|
519
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
522
520
|
/**
|
|
523
521
|
* Sends an address message to request shipping address from the user
|
|
524
522
|
* Note: This feature is only available for businesses based in India and their India customers
|
|
525
|
-
* @param
|
|
526
|
-
* @param recipient Recipient phone number
|
|
527
|
-
* @param replyMessageId Optional message ID to reply to
|
|
523
|
+
* @param params The address message parameter object
|
|
528
524
|
* @returns Promise with the response
|
|
529
525
|
*/
|
|
530
|
-
interactiveAddressMessage(
|
|
531
|
-
type:
|
|
532
|
-
}
|
|
526
|
+
interactiveAddressMessage(params: MessageRequestParams<InteractiveObject & {
|
|
527
|
+
type: InteractiveTypesEnum.AddressMessage;
|
|
528
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
533
529
|
/**
|
|
534
530
|
* Sends an interactive reply buttons message
|
|
535
|
-
* @param
|
|
536
|
-
* @param recipient Recipient phone number
|
|
537
|
-
* @param replyMessageId Optional message ID to reply to
|
|
531
|
+
* @param params The reply buttons message parameter object
|
|
538
532
|
* @returns Promise with the response
|
|
539
533
|
*/
|
|
540
|
-
interactiveReplyButtons(
|
|
541
|
-
type:
|
|
542
|
-
}
|
|
534
|
+
interactiveReplyButtons(params: MessageRequestParams<InteractiveObject & {
|
|
535
|
+
type: InteractiveTypesEnum.Button;
|
|
536
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
543
537
|
/**
|
|
544
538
|
* Sends a reaction to a message (emoji response)
|
|
545
|
-
* @param
|
|
546
|
-
* @param emoji The emoji to send as reaction (e.g. "😀", "❤️", "👍")
|
|
547
|
-
* @param recipient Recipient phone number
|
|
539
|
+
* @param params The reaction message parameter object
|
|
548
540
|
* @returns Promise with the response
|
|
549
541
|
*/
|
|
550
|
-
reaction(
|
|
542
|
+
reaction(params: ReactionParams): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
551
543
|
/**
|
|
552
544
|
* Sends an interactive Flow message
|
|
553
|
-
* @param
|
|
554
|
-
* @param recipient Recipient phone number
|
|
555
|
-
* @param replyMessageId Optional message ID to reply to
|
|
545
|
+
* @param params The Flow message parameter object
|
|
556
546
|
* @returns Promise with the response
|
|
557
547
|
*/
|
|
558
|
-
interactiveFlow(
|
|
559
|
-
type:
|
|
560
|
-
}
|
|
548
|
+
interactiveFlow(params: MessageRequestParams<InteractiveObject & {
|
|
549
|
+
type: InteractiveTypesEnum.Flow;
|
|
550
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
561
551
|
}
|
|
562
552
|
|
|
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 };
|
|
553
|
+
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 MessageRequestParams, type MessageTemplateObject, type MessageTemplateRequestBody, MessagesClass, type MessagesResponse, type ReactionMessageRequestBody, type ReactionParams, type StatusObject, type StatusParams, type StatusRequestBody, type StickerMediaObject, type StickerMessageRequestBody, type TextMessageParams, type TextMessageRequestBody, type TextObject, type TypingIndicatorObject, type VideoMediaObject, type VideoMessageRequestBody };
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -390,174 +390,164 @@ type MessagesResponse = GeneralMessageBody & {
|
|
|
390
390
|
}
|
|
391
391
|
];
|
|
392
392
|
};
|
|
393
|
+
interface MessageRequestParams<T> {
|
|
394
|
+
body: T;
|
|
395
|
+
to: string;
|
|
396
|
+
replyMessageId?: string;
|
|
397
|
+
}
|
|
398
|
+
interface TextMessageParams extends MessageRequestParams<TextObject | string> {
|
|
399
|
+
previewUrl?: boolean;
|
|
400
|
+
}
|
|
401
|
+
interface ReactionParams {
|
|
402
|
+
messageId: string;
|
|
403
|
+
emoji: string;
|
|
404
|
+
to: string;
|
|
405
|
+
}
|
|
406
|
+
interface StatusParams {
|
|
407
|
+
status: string;
|
|
408
|
+
messageId: string;
|
|
409
|
+
typingIndicator?: {
|
|
410
|
+
type: string;
|
|
411
|
+
};
|
|
412
|
+
}
|
|
393
413
|
declare class MessagesClass extends BaseClass {
|
|
394
414
|
/**
|
|
395
415
|
* Sends an audio message via WhatsApp
|
|
396
|
-
* @param
|
|
397
|
-
* @param recipient Recipient's phone number
|
|
398
|
-
* @param replyMessageId Optional message ID to reply to
|
|
416
|
+
* @param params The audio message parameter object
|
|
399
417
|
* @returns Promise with the message response
|
|
400
418
|
*/
|
|
401
|
-
audio(
|
|
419
|
+
audio(params: MessageRequestParams<AudioMediaObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
402
420
|
/**
|
|
403
421
|
* Sends a contact card via WhatsApp
|
|
404
|
-
* @param
|
|
405
|
-
* @param recipient Recipient's phone number
|
|
406
|
-
* @param replyMessageId Optional message ID to reply to
|
|
422
|
+
* @param params The contact message parameter object
|
|
407
423
|
* @returns Promise with the message response
|
|
408
424
|
*/
|
|
409
|
-
contacts(
|
|
425
|
+
contacts(params: MessageRequestParams<[ContactObject]>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
410
426
|
/**
|
|
411
427
|
* Sends a document via WhatsApp
|
|
412
|
-
* @param
|
|
413
|
-
* @param recipient Recipient's phone number
|
|
414
|
-
* @param replyMessageId Optional message ID to reply to
|
|
428
|
+
* @param params The document message parameter object
|
|
415
429
|
* @returns Promise with the message response
|
|
416
430
|
*/
|
|
417
|
-
document(
|
|
431
|
+
document(params: MessageRequestParams<DocumentMediaObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
418
432
|
/**
|
|
419
433
|
* Sends an image via WhatsApp
|
|
420
|
-
* @param
|
|
421
|
-
* @param recipient Recipient's phone number
|
|
422
|
-
* @param replyMessageId Optional message ID to reply to
|
|
434
|
+
* @param params The image message parameter object
|
|
423
435
|
* @returns Promise with the message response
|
|
424
436
|
*/
|
|
425
|
-
image(
|
|
437
|
+
image(params: MessageRequestParams<ImageMediaObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
426
438
|
/**
|
|
427
439
|
* Sends an interactive message via WhatsApp
|
|
428
|
-
* @param
|
|
429
|
-
* @param recipient Recipient's phone number
|
|
430
|
-
* @param replyMessageId Optional message ID to reply to
|
|
440
|
+
* @param params The interactive message parameter object
|
|
431
441
|
* @returns Promise with the message response
|
|
432
442
|
*/
|
|
433
|
-
interactive(
|
|
443
|
+
interactive(params: MessageRequestParams<InteractiveObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
434
444
|
/**
|
|
435
445
|
* Sends a location via WhatsApp
|
|
436
|
-
* @param
|
|
437
|
-
* @param recipient Recipient's phone number
|
|
438
|
-
* @param replyMessageId Optional message ID to reply to
|
|
446
|
+
* @param params The location message parameter object
|
|
439
447
|
* @returns Promise with the message response
|
|
440
448
|
*/
|
|
441
|
-
location(
|
|
449
|
+
location(params: MessageRequestParams<LocationObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
442
450
|
/**
|
|
443
451
|
* Updates message status (used for read receipts and typing indicators)
|
|
444
|
-
* @param
|
|
452
|
+
* @param params The status update parameter object
|
|
445
453
|
* @returns Promise with the response
|
|
446
454
|
*/
|
|
447
|
-
status(
|
|
455
|
+
status(params: StatusParams): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
448
456
|
/**
|
|
449
457
|
* Sends a sticker via WhatsApp
|
|
450
|
-
* @param
|
|
451
|
-
* @param recipient Recipient's phone number
|
|
452
|
-
* @param replyMessageId Optional message ID to reply to
|
|
458
|
+
* @param params The sticker message parameter object
|
|
453
459
|
* @returns Promise with the message response
|
|
454
460
|
*/
|
|
455
|
-
sticker(
|
|
461
|
+
sticker(params: MessageRequestParams<StickerMediaObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
456
462
|
/**
|
|
457
463
|
* Sends a template message via WhatsApp
|
|
458
|
-
* @param
|
|
459
|
-
* @param recipient Recipient's phone number
|
|
460
|
-
* @param replyMessageId Optional message ID to reply to
|
|
464
|
+
* @param params The template message parameter object
|
|
461
465
|
* @returns Promise with the message response
|
|
462
466
|
*/
|
|
463
|
-
template(
|
|
467
|
+
template(params: MessageRequestParams<MessageTemplateObject<ComponentTypesEnum>>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
464
468
|
/**
|
|
465
469
|
* Sends a text message via WhatsApp
|
|
466
|
-
* @param
|
|
467
|
-
* @param recipient Recipient's phone number
|
|
468
|
-
* @param replyMessageId Optional message ID to reply to
|
|
470
|
+
* @param params The text message parameter object
|
|
469
471
|
* @returns Promise with the message response
|
|
470
472
|
*/
|
|
471
|
-
text(
|
|
473
|
+
text(params: TextMessageParams): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
472
474
|
/**
|
|
473
475
|
* Sends a video via WhatsApp
|
|
474
|
-
* @param
|
|
475
|
-
* @param recipient Recipient's phone number
|
|
476
|
-
* @param replyMessageId Optional message ID to reply to
|
|
476
|
+
* @param params The video message parameter object
|
|
477
477
|
* @returns Promise with the message response
|
|
478
478
|
*/
|
|
479
|
-
video(
|
|
479
|
+
video(params: MessageRequestParams<VideoMediaObject>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
480
480
|
/**
|
|
481
481
|
* Marks a message as read in WhatsApp
|
|
482
|
-
* @param
|
|
482
|
+
* @param params The parameter object to mark message as read
|
|
483
483
|
* @returns Promise with the response
|
|
484
484
|
*/
|
|
485
|
-
markAsRead(
|
|
485
|
+
markAsRead(params: {
|
|
486
|
+
messageId: string;
|
|
487
|
+
}): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
486
488
|
/**
|
|
487
489
|
* Marks a message as read and shows a typing indicator in WhatsApp
|
|
488
|
-
* @param
|
|
490
|
+
* @param params The typing indicator parameter object
|
|
489
491
|
* @returns Promise with the response
|
|
490
492
|
*/
|
|
491
|
-
showTypingIndicator(
|
|
493
|
+
showTypingIndicator(params: {
|
|
494
|
+
messageId: string;
|
|
495
|
+
}): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
492
496
|
/**
|
|
493
497
|
* Sends an interactive list message
|
|
494
|
-
* @param
|
|
495
|
-
* @param recipient Recipient phone number
|
|
496
|
-
* @param replyMessageId Optional message ID to reply to
|
|
498
|
+
* @param params The list message parameter object
|
|
497
499
|
* @returns Promise with the response
|
|
498
500
|
*/
|
|
499
|
-
interactiveList(
|
|
500
|
-
type:
|
|
501
|
-
}
|
|
501
|
+
interactiveList(params: MessageRequestParams<InteractiveObject & {
|
|
502
|
+
type: InteractiveTypesEnum.List;
|
|
503
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
502
504
|
/**
|
|
503
505
|
* Sends an interactive CTA URL message
|
|
504
|
-
* @param
|
|
505
|
-
* @param recipient Recipient phone number
|
|
506
|
-
* @param replyMessageId Optional message ID to reply to
|
|
506
|
+
* @param params The CTA URL message parameter object
|
|
507
507
|
* @returns Promise with the response
|
|
508
508
|
*/
|
|
509
|
-
interactiveCtaUrl(
|
|
510
|
-
type:
|
|
511
|
-
}
|
|
509
|
+
interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
|
|
510
|
+
type: InteractiveTypesEnum.CtaUrl;
|
|
511
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
512
512
|
/**
|
|
513
513
|
* Sends a location request message
|
|
514
|
-
* @param
|
|
515
|
-
* @param recipient Recipient phone number
|
|
516
|
-
* @param replyMessageId Optional message ID to reply to
|
|
514
|
+
* @param params The location request message parameter object
|
|
517
515
|
* @returns Promise with the response
|
|
518
516
|
*/
|
|
519
|
-
interactiveLocationRequest(
|
|
520
|
-
type:
|
|
521
|
-
}
|
|
517
|
+
interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
|
|
518
|
+
type: InteractiveTypesEnum.LocationRequest;
|
|
519
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
522
520
|
/**
|
|
523
521
|
* Sends an address message to request shipping address from the user
|
|
524
522
|
* Note: This feature is only available for businesses based in India and their India customers
|
|
525
|
-
* @param
|
|
526
|
-
* @param recipient Recipient phone number
|
|
527
|
-
* @param replyMessageId Optional message ID to reply to
|
|
523
|
+
* @param params The address message parameter object
|
|
528
524
|
* @returns Promise with the response
|
|
529
525
|
*/
|
|
530
|
-
interactiveAddressMessage(
|
|
531
|
-
type:
|
|
532
|
-
}
|
|
526
|
+
interactiveAddressMessage(params: MessageRequestParams<InteractiveObject & {
|
|
527
|
+
type: InteractiveTypesEnum.AddressMessage;
|
|
528
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
533
529
|
/**
|
|
534
530
|
* Sends an interactive reply buttons message
|
|
535
|
-
* @param
|
|
536
|
-
* @param recipient Recipient phone number
|
|
537
|
-
* @param replyMessageId Optional message ID to reply to
|
|
531
|
+
* @param params The reply buttons message parameter object
|
|
538
532
|
* @returns Promise with the response
|
|
539
533
|
*/
|
|
540
|
-
interactiveReplyButtons(
|
|
541
|
-
type:
|
|
542
|
-
}
|
|
534
|
+
interactiveReplyButtons(params: MessageRequestParams<InteractiveObject & {
|
|
535
|
+
type: InteractiveTypesEnum.Button;
|
|
536
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
543
537
|
/**
|
|
544
538
|
* Sends a reaction to a message (emoji response)
|
|
545
|
-
* @param
|
|
546
|
-
* @param emoji The emoji to send as reaction (e.g. "😀", "❤️", "👍")
|
|
547
|
-
* @param recipient Recipient phone number
|
|
539
|
+
* @param params The reaction message parameter object
|
|
548
540
|
* @returns Promise with the response
|
|
549
541
|
*/
|
|
550
|
-
reaction(
|
|
542
|
+
reaction(params: ReactionParams): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
551
543
|
/**
|
|
552
544
|
* Sends an interactive Flow message
|
|
553
|
-
* @param
|
|
554
|
-
* @param recipient Recipient phone number
|
|
555
|
-
* @param replyMessageId Optional message ID to reply to
|
|
545
|
+
* @param params The Flow message parameter object
|
|
556
546
|
* @returns Promise with the response
|
|
557
547
|
*/
|
|
558
|
-
interactiveFlow(
|
|
559
|
-
type:
|
|
560
|
-
}
|
|
548
|
+
interactiveFlow(params: MessageRequestParams<InteractiveObject & {
|
|
549
|
+
type: InteractiveTypesEnum.Flow;
|
|
550
|
+
}>): Promise<RequesterResponseInterface<MessagesResponse>>;
|
|
561
551
|
}
|
|
562
552
|
|
|
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 };
|
|
553
|
+
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 MessageRequestParams, type MessageTemplateObject, type MessageTemplateRequestBody, MessagesClass, type MessagesResponse, type ReactionMessageRequestBody, type ReactionParams, type StatusObject, type StatusParams, type StatusRequestBody, type StickerMediaObject, type StickerMessageRequestBody, type TextMessageParams, type TextMessageRequestBody, type TextObject, type TypingIndicatorObject, type VideoMediaObject, type VideoMessageRequestBody };
|
package/dist/types/messages.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var r=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of o(e))!c.call(t,s)&&s!==n&&r(t,s,{get:()=>e[s],enumerable:!(a=i(e,s))||a.enumerable});return t};var m=t=>p(r({},"__esModule",{value:!0}),t);var d={};module.exports=m(d);
|
|
2
2
|
//# sourceMappingURL=messages.js.map
|